@pointcloud/pcloud-components 0.1.19 → 0.1.21
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 +24 -3
- package/dist/esm/AdvancedFilter/FormFilter.d.ts +1 -2
- package/dist/esm/AdvancedFilter/index.js +3 -3
- package/dist/esm/AdvancedFilter/styles/index.less +146 -146
- package/dist/esm/AuthComponent/index.d.ts +1 -2
- package/dist/esm/ColorPicker/index.d.ts +10 -11
- package/dist/esm/ColorPicker/index.js +4 -4
- package/dist/esm/ColorPicker/index.less +18 -18
- package/dist/esm/ConfigProvider/index.d.ts +1 -1
- package/dist/esm/DCascader/index.js +2 -3
- package/dist/esm/DForm/DItem/itemsRender.d.ts +29 -29
- package/dist/esm/DForm/DItem/itemsRender.js +6 -6
- package/dist/esm/DForm/index.d.ts +2 -1
- package/dist/esm/DForm/index.js +1 -2
- package/dist/esm/DForm/index.less +5 -4
- package/dist/esm/DInput/index.js +4 -4
- package/dist/esm/DModal/index.d.ts +1 -2
- package/dist/esm/DModal/styles/index.less +27 -27
- package/dist/esm/DSelect/index.d.ts +1 -2
- package/dist/esm/DSelect/index.js +1 -1
- package/dist/esm/DTable/index.js +8 -8
- package/dist/esm/DTreeSelect/index.d.ts +1 -11
- package/dist/esm/DTreeSelect/index.js +1 -9
- package/dist/esm/DUpload/helper.d.ts +1 -1
- package/dist/esm/DUpload/helper.js +48 -48
- package/dist/esm/DUpload/index.d.ts +1 -1
- package/dist/esm/DUpload/index.js +8 -8
- package/dist/esm/ErrorBoundary/index.d.ts +1 -2
- package/dist/esm/InfiniteScrollList/index.d.ts +54 -0
- package/dist/esm/InfiniteScrollList/index.js +175 -0
- package/dist/esm/InfiniteScrollList/styles/index.less +22 -0
- package/dist/esm/LabelValue/index.d.ts +1 -1
- package/dist/esm/LabelValue/index.js +7 -3
- package/dist/esm/LabelValue/interface.d.ts +12 -3
- package/dist/esm/Loading/index.js +1 -1
- package/dist/esm/Loading/interface.d.ts +8 -3
- package/dist/esm/Loading/loading.d.ts +1 -2
- package/dist/esm/Loading/loading.js +32 -11
- package/dist/esm/ModalForm/index.d.ts +1 -1
- package/dist/esm/ModalForm/index.js +1 -1
- package/dist/esm/NoData/index.d.ts +1 -2
- package/dist/esm/PictureCard/index.d.ts +16 -0
- package/dist/esm/PictureCard/index.js +78 -0
- package/dist/esm/PictureCard/index.less +28 -0
- package/dist/esm/RndDrag/index.d.ts +5 -0
- package/dist/esm/RndDrag/index.js +26 -0
- package/dist/esm/ScrollNumber/index.d.ts +1 -2
- package/dist/esm/WordCloud/index.d.ts +1 -2
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.js +4 -1
- package/dist/umd/pcloud-components.min.css +1 -1
- package/dist/umd/pcloud-components.min.js +1 -1
- package/package.json +106 -100
- package/dist/cjs/AdvancedFilter/FormFilter.d.ts +0 -5
- package/dist/cjs/AdvancedFilter/FormFilter.js +0 -158
- package/dist/cjs/AdvancedFilter/demos/demo1.d.ts +0 -3
- package/dist/cjs/AdvancedFilter/demos/demo1.js +0 -56
- package/dist/cjs/AdvancedFilter/demos/demo2.d.ts +0 -3
- package/dist/cjs/AdvancedFilter/demos/demo2.js +0 -63
- package/dist/cjs/AdvancedFilter/demos/demo3.d.ts +0 -3
- package/dist/cjs/AdvancedFilter/demos/demo3.js +0 -113
- package/dist/cjs/AdvancedFilter/index.d.ts +0 -5
- package/dist/cjs/AdvancedFilter/index.js +0 -114
- package/dist/cjs/AdvancedFilter/interface.d.ts +0 -97
- package/dist/cjs/AdvancedFilter/interface.js +0 -17
- package/dist/cjs/AdvancedFilter/styles/index.less +0 -115
- package/dist/cjs/ErrorBoundary/index.d.ts +0 -6
- package/dist/cjs/ErrorBoundary/index.js +0 -45
- package/dist/cjs/ErrorBoundary/index.less +0 -42
- package/dist/cjs/LabelValue/demos/demo1.d.ts +0 -3
- package/dist/cjs/LabelValue/demos/demo1.js +0 -35
- package/dist/cjs/LabelValue/demos/demo2.d.ts +0 -3
- package/dist/cjs/LabelValue/demos/demo2.js +0 -36
- package/dist/cjs/LabelValue/demos/demo3.d.ts +0 -3
- package/dist/cjs/LabelValue/demos/demo3.js +0 -36
- package/dist/cjs/LabelValue/index.d.ts +0 -16
- package/dist/cjs/LabelValue/index.js +0 -50
- package/dist/cjs/LabelValue/interface.d.ts +0 -29
- package/dist/cjs/LabelValue/interface.js +0 -17
- package/dist/cjs/LabelValue/styles/index.less +0 -18
- package/dist/cjs/index.d.ts +0 -4
- package/dist/cjs/index.js +0 -38
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
+
import { BackTop, Divider, List, Spin } from 'antd';
|
|
8
|
+
import React, { useCallback, useEffect, useRef, useState, useContext } from 'react';
|
|
9
|
+
import InfiniteScroll from 'react-infinite-scroll-component';
|
|
10
|
+
import classNames from 'classnames';
|
|
11
|
+
import { ConfigContext } from "../ConfigProvider";
|
|
12
|
+
import "./styles/index.less";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
var InfiniteScrollList = function InfiniteScrollList(props) {
|
|
16
|
+
var _listData$data, _listData$data2;
|
|
17
|
+
var loadMore = props.loadMore,
|
|
18
|
+
_props$initialParams = props.initialParams,
|
|
19
|
+
initialParams = _props$initialParams === void 0 ? {} : _props$initialParams,
|
|
20
|
+
_props$itemKey = props.itemKey,
|
|
21
|
+
itemKey = _props$itemKey === void 0 ? 'id' : _props$itemKey,
|
|
22
|
+
_props$containerId = props.containerId,
|
|
23
|
+
containerId = _props$containerId === void 0 ? 'scrollableDiv' : _props$containerId,
|
|
24
|
+
containerHeight = props.containerHeight,
|
|
25
|
+
_props$className = props.className,
|
|
26
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
27
|
+
grid = props.grid,
|
|
28
|
+
_props$scrollThreshol = props.scrollThreshold,
|
|
29
|
+
scrollThreshold = _props$scrollThreshol === void 0 ? '100px' : _props$scrollThreshol,
|
|
30
|
+
_props$visibilityHeig = props.visibilityHeight,
|
|
31
|
+
visibilityHeight = _props$visibilityHeig === void 0 ? 200 : _props$visibilityHeig,
|
|
32
|
+
_renderItem = props.renderItem;
|
|
33
|
+
var _useContext = useContext(ConfigContext),
|
|
34
|
+
prefixCls = _useContext.prefixCls,
|
|
35
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
36
|
+
var classname = getPrefixCls('infinite-scroll-wrapper');
|
|
37
|
+
var wrapperClass = classNames(_defineProperty({}, "".concat(prefixCls, "-infinite-scroll-wrapper"), !!prefixCls), classname, className);
|
|
38
|
+
var pageParamsRef = useRef(_objectSpread({
|
|
39
|
+
current: 1,
|
|
40
|
+
size: 10
|
|
41
|
+
}, initialParams));
|
|
42
|
+
var loadingRef = useRef(false);
|
|
43
|
+
var scrollRef = useRef(null);
|
|
44
|
+
var _useState = useState({
|
|
45
|
+
total: 0,
|
|
46
|
+
data: []
|
|
47
|
+
}),
|
|
48
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
49
|
+
listData = _useState2[0],
|
|
50
|
+
setListData = _useState2[1];
|
|
51
|
+
var handleLoadMore = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
52
|
+
var _yield$loadMore, data, total, records;
|
|
53
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
54
|
+
while (1) switch (_context.prev = _context.next) {
|
|
55
|
+
case 0:
|
|
56
|
+
if (!loadingRef.current) {
|
|
57
|
+
_context.next = 2;
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
return _context.abrupt("return");
|
|
61
|
+
case 2:
|
|
62
|
+
loadingRef.current = true;
|
|
63
|
+
_context.prev = 3;
|
|
64
|
+
_context.next = 6;
|
|
65
|
+
return loadMore(_objectSpread({}, pageParamsRef.current));
|
|
66
|
+
case 6:
|
|
67
|
+
_yield$loadMore = _context.sent;
|
|
68
|
+
data = _yield$loadMore.data;
|
|
69
|
+
total = data.total, records = data.records; // 初始参数重置时不拼接数据
|
|
70
|
+
if (pageParamsRef.current.current === 1) {
|
|
71
|
+
setListData({
|
|
72
|
+
total: total,
|
|
73
|
+
data: total > 0 ? _toConsumableArray(records) : []
|
|
74
|
+
});
|
|
75
|
+
} else {
|
|
76
|
+
setListData(function (prevData) {
|
|
77
|
+
return {
|
|
78
|
+
total: total,
|
|
79
|
+
data: total > 0 ? [].concat(_toConsumableArray(prevData.data), _toConsumableArray(records || [])) : []
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
loadingRef.current = false;
|
|
84
|
+
_context.next = 17;
|
|
85
|
+
break;
|
|
86
|
+
case 13:
|
|
87
|
+
_context.prev = 13;
|
|
88
|
+
_context.t0 = _context["catch"](3);
|
|
89
|
+
loadingRef.current = false;
|
|
90
|
+
setListData({
|
|
91
|
+
total: 0,
|
|
92
|
+
data: []
|
|
93
|
+
});
|
|
94
|
+
case 17:
|
|
95
|
+
_context.prev = 17;
|
|
96
|
+
loadingRef.current = false;
|
|
97
|
+
return _context.finish(17);
|
|
98
|
+
case 20:
|
|
99
|
+
case "end":
|
|
100
|
+
return _context.stop();
|
|
101
|
+
}
|
|
102
|
+
}, _callee, null, [[3, 13, 17, 20]]);
|
|
103
|
+
})), [loadMore]);
|
|
104
|
+
useEffect(function () {
|
|
105
|
+
if (listData.total > 0 && listData.data.length < listData.total) {
|
|
106
|
+
pageParamsRef.current = _objectSpread(_objectSpread({}, pageParamsRef.current), {}, {
|
|
107
|
+
current: pageParamsRef.current.current + 1
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}, [listData]);
|
|
111
|
+
useEffect(function () {
|
|
112
|
+
if (Reflect.ownKeys(initialParams).length > 0) {
|
|
113
|
+
var _scrollRef$current;
|
|
114
|
+
scrollRef === null || scrollRef === void 0 || (_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 || _scrollRef$current.scrollTo({
|
|
115
|
+
top: 0,
|
|
116
|
+
behavior: 'smooth'
|
|
117
|
+
});
|
|
118
|
+
pageParamsRef.current = _objectSpread({
|
|
119
|
+
current: 1,
|
|
120
|
+
size: 10
|
|
121
|
+
}, initialParams);
|
|
122
|
+
}
|
|
123
|
+
handleLoadMore();
|
|
124
|
+
}, [initialParams]);
|
|
125
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
126
|
+
id: containerId,
|
|
127
|
+
className: "scroll-container",
|
|
128
|
+
ref: scrollRef,
|
|
129
|
+
style: {
|
|
130
|
+
height: containerHeight,
|
|
131
|
+
overflowY: 'auto'
|
|
132
|
+
},
|
|
133
|
+
children: [/*#__PURE__*/_jsx(InfiniteScroll, {
|
|
134
|
+
className: "".concat(wrapperClass, " ").concat(className),
|
|
135
|
+
scrollableTarget: containerId,
|
|
136
|
+
dataLength: (_listData$data = listData.data) === null || _listData$data === void 0 ? void 0 : _listData$data.length,
|
|
137
|
+
next: handleLoadMore,
|
|
138
|
+
hasMore: ((_listData$data2 = listData.data) === null || _listData$data2 === void 0 ? void 0 : _listData$data2.length) < listData.total,
|
|
139
|
+
loader: /*#__PURE__*/_jsx("div", {
|
|
140
|
+
style: {
|
|
141
|
+
textAlign: 'center'
|
|
142
|
+
},
|
|
143
|
+
children: /*#__PURE__*/_jsx(Spin, {
|
|
144
|
+
tip: "\u62FC\u547D\u52A0\u8F7D\u4E2D..."
|
|
145
|
+
})
|
|
146
|
+
}),
|
|
147
|
+
endMessage: (listData === null || listData === void 0 ? void 0 : listData.total) > 0 && /*#__PURE__*/_jsx(Divider, {
|
|
148
|
+
plain: true,
|
|
149
|
+
children: "\u5DF2\u7ECF\u5230\u5E95\u90E8\u4E86"
|
|
150
|
+
}),
|
|
151
|
+
scrollThreshold: scrollThreshold,
|
|
152
|
+
inverse: false,
|
|
153
|
+
children: /*#__PURE__*/_jsx(List, {
|
|
154
|
+
grid: grid,
|
|
155
|
+
dataSource: listData.data,
|
|
156
|
+
renderItem: function renderItem(item, index) {
|
|
157
|
+
return /*#__PURE__*/_jsx(List.Item, {
|
|
158
|
+
children: _renderItem(item, index)
|
|
159
|
+
}, item[itemKey]);
|
|
160
|
+
}
|
|
161
|
+
})
|
|
162
|
+
}), /*#__PURE__*/_jsx(BackTop, {
|
|
163
|
+
className: "backtop",
|
|
164
|
+
target: function target() {
|
|
165
|
+
return (scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) || document.body;
|
|
166
|
+
},
|
|
167
|
+
visibilityHeight: visibilityHeight,
|
|
168
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
169
|
+
className: "up",
|
|
170
|
+
children: "\u56DE\u5230\u9876\u90E8"
|
|
171
|
+
})
|
|
172
|
+
})]
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
export default /*#__PURE__*/React.memo(InfiniteScrollList);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@import '../../commonStyle/index.less';
|
|
2
|
+
|
|
3
|
+
.@{prefix}-infinite-scroll-wrapper {
|
|
4
|
+
.ant-list .ant-row {
|
|
5
|
+
margin-right: 0 !important;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.scroll-container {
|
|
10
|
+
position: relative;
|
|
11
|
+
|
|
12
|
+
.backtop {
|
|
13
|
+
right: 50px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.up {
|
|
17
|
+
background: #007aff;
|
|
18
|
+
color: #fff;
|
|
19
|
+
text-align: center;
|
|
20
|
+
border-radius: 3px;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ILabelValueProps } from './interface';
|
|
3
3
|
import './styles/index.less';
|
|
4
|
-
declare function LabelValue({ label, value, emptyValue, className, noWrap, noColon }: ILabelValueProps): JSX.Element;
|
|
4
|
+
declare function LabelValue({ label, value, emptyValue, className, noWrap, noColon, formatter, style }: ILabelValueProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare namespace LabelValue {
|
|
6
6
|
var defaultProps: {
|
|
7
7
|
className: string;
|
|
@@ -11,21 +11,25 @@ function LabelValue(_ref) {
|
|
|
11
11
|
emptyValue = _ref.emptyValue,
|
|
12
12
|
className = _ref.className,
|
|
13
13
|
noWrap = _ref.noWrap,
|
|
14
|
-
noColon = _ref.noColon
|
|
14
|
+
noColon = _ref.noColon,
|
|
15
|
+
formatter = _ref.formatter,
|
|
16
|
+
style = _ref.style;
|
|
15
17
|
var _useContext = useContext(ConfigContext),
|
|
16
18
|
prefixCls = _useContext.prefixCls,
|
|
17
19
|
getPrefixCls = _useContext.getPrefixCls;
|
|
18
20
|
var classname = getPrefixCls('label-value');
|
|
19
21
|
var wrapperClass = classNames(_defineProperty({}, "".concat(prefixCls, "-label-value"), !!prefixCls), classname, className);
|
|
22
|
+
var title = typeof value === 'string' ? value : undefined;
|
|
20
23
|
return /*#__PURE__*/_jsxs("div", {
|
|
24
|
+
style: style,
|
|
21
25
|
className: wrapperClass,
|
|
22
26
|
children: [/*#__PURE__*/_jsxs("span", {
|
|
23
27
|
className: "".concat(defaultPrefixCls, "-label"),
|
|
24
28
|
children: [label, noColon ? '' : ':']
|
|
25
29
|
}), /*#__PURE__*/_jsx("span", {
|
|
26
|
-
title:
|
|
30
|
+
title: title,
|
|
27
31
|
className: "".concat(noWrap ? "".concat(defaultPrefixCls, "-value no-wrap") : "".concat(defaultPrefixCls, "-value")),
|
|
28
|
-
children: value
|
|
32
|
+
children: formatter && typeof formatter === 'function' ? formatter(value) : value || emptyValue
|
|
29
33
|
})]
|
|
30
34
|
});
|
|
31
35
|
}
|
|
@@ -1,21 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
export interface ILabelValueProps {
|
|
2
3
|
/**
|
|
3
4
|
* @description 文字标签
|
|
4
5
|
*/
|
|
5
|
-
label: string |
|
|
6
|
+
label: string | React.ReactNode;
|
|
6
7
|
/**
|
|
7
8
|
* @description 文字标签值
|
|
8
9
|
*/
|
|
9
|
-
value?: string |
|
|
10
|
+
value?: string | React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* @description 格式化value值
|
|
13
|
+
*/
|
|
14
|
+
formatter?: (v?: any) => string | React.ReactNode;
|
|
10
15
|
/**
|
|
11
16
|
* @description 文字标签值为空时的值
|
|
12
17
|
* @default -
|
|
13
18
|
*/
|
|
14
|
-
emptyValue?: string |
|
|
19
|
+
emptyValue?: string | React.ReactNode;
|
|
15
20
|
/**
|
|
16
21
|
* @description 类名
|
|
17
22
|
*/
|
|
18
23
|
className?: string;
|
|
24
|
+
/**
|
|
25
|
+
* @description 样式
|
|
26
|
+
*/
|
|
27
|
+
style?: React.CSSProperties;
|
|
19
28
|
/**
|
|
20
29
|
* @description 是否不换行
|
|
21
30
|
* @default false
|
|
@@ -11,7 +11,7 @@ export default {
|
|
|
11
11
|
close: function close() {
|
|
12
12
|
if (loadingInstance) {
|
|
13
13
|
var _loadingInstance;
|
|
14
|
-
(_loadingInstance = loadingInstance) === null || _loadingInstance === void 0
|
|
14
|
+
(_loadingInstance = loadingInstance) === null || _loadingInstance === void 0 || _loadingInstance.destroy();
|
|
15
15
|
loadingInstance = null;
|
|
16
16
|
}
|
|
17
17
|
},
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { SpinProps } from 'antd';
|
|
2
2
|
import React, { ReactInstance } from 'react';
|
|
3
|
-
export interface LoadingInstanceProps extends SpinProps {
|
|
3
|
+
export interface LoadingInstanceProps extends Omit<SpinProps, 'delay'> {
|
|
4
4
|
/**
|
|
5
5
|
* @description 加载框容器
|
|
6
6
|
* @default body
|
|
7
7
|
*/
|
|
8
8
|
container?: ReactInstance | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* @description 延迟显示加载框毫秒
|
|
11
|
+
* @default 0
|
|
12
|
+
*/
|
|
13
|
+
delay?: number;
|
|
9
14
|
}
|
|
10
15
|
export interface ILoadingProps {
|
|
11
|
-
open: (
|
|
16
|
+
open: (_param: LoadingInstanceProps) => React.ReactNode;
|
|
12
17
|
close: () => void;
|
|
13
|
-
getInstance: () => React.
|
|
18
|
+
getInstance: () => React.ReactNode;
|
|
14
19
|
}
|
|
15
20
|
export declare type LoadingProps = ILoadingProps;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { LoadingInstanceProps } from './interface';
|
|
3
2
|
import './styles/index.less';
|
|
4
|
-
declare function Loading(props: LoadingInstanceProps): JSX.Element;
|
|
3
|
+
declare function Loading(props: LoadingInstanceProps): import("react/jsx-runtime").JSX.Element;
|
|
5
4
|
declare namespace Loading {
|
|
6
5
|
var newInstance: (args: LoadingInstanceProps) => {
|
|
7
6
|
destroy(): void;
|
|
@@ -1,45 +1,66 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
+
var _excluded = ["delay"],
|
|
6
|
+
_excluded2 = ["container"];
|
|
7
7
|
import { Spin } from 'antd';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
|
+
import { useContext, useEffect, useState } from 'react';
|
|
10
|
+
import ReactDOM from 'react-dom';
|
|
9
11
|
import { ConfigContext } from "../ConfigProvider";
|
|
10
12
|
import "./styles/index.less";
|
|
13
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
16
|
function Loading(props) {
|
|
14
|
-
var
|
|
15
|
-
|
|
17
|
+
var delay = props.delay,
|
|
18
|
+
other = _objectWithoutProperties(props, _excluded);
|
|
16
19
|
var _useContext = useContext(ConfigContext),
|
|
17
20
|
prefixCls = _useContext.prefixCls,
|
|
18
21
|
getPrefixCls = _useContext.getPrefixCls;
|
|
19
22
|
var classname = getPrefixCls('loading');
|
|
20
23
|
var wrapperClass = classNames(_defineProperty({}, "".concat(prefixCls, "-loading"), !!prefixCls), classname);
|
|
24
|
+
var _useState = useState(false),
|
|
25
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
+
visible = _useState2[0],
|
|
27
|
+
setVisible = _useState2[1];
|
|
21
28
|
useEffect(function () {
|
|
22
29
|
document.body.style.overflow = 'hidden';
|
|
23
30
|
return function () {
|
|
24
31
|
document.body.style.overflow = '';
|
|
25
32
|
};
|
|
26
33
|
}, []);
|
|
34
|
+
useEffect(function () {
|
|
35
|
+
var timer = setTimeout(function () {
|
|
36
|
+
return setVisible(true);
|
|
37
|
+
}, delay || 0);
|
|
38
|
+
return function () {
|
|
39
|
+
clearTimeout(timer);
|
|
40
|
+
};
|
|
41
|
+
}, [delay]);
|
|
42
|
+
if (!visible) return /*#__PURE__*/_jsx(_Fragment, {});
|
|
27
43
|
return /*#__PURE__*/_jsxs("div", {
|
|
28
44
|
className: wrapperClass,
|
|
29
45
|
children: [/*#__PURE__*/_jsx("div", {
|
|
30
46
|
className: "mask"
|
|
31
47
|
}), /*#__PURE__*/_jsx("div", {
|
|
32
48
|
className: "loading",
|
|
33
|
-
children: /*#__PURE__*/_jsx(Spin, {
|
|
34
|
-
|
|
35
|
-
|
|
49
|
+
children: /*#__PURE__*/_jsx(Spin, _objectSpread(_objectSpread({}, other), {}, {
|
|
50
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
51
|
+
style: {
|
|
52
|
+
opacity: 0
|
|
53
|
+
},
|
|
54
|
+
children: other.tip
|
|
55
|
+
})
|
|
56
|
+
}))
|
|
36
57
|
})]
|
|
37
58
|
});
|
|
38
59
|
}
|
|
39
60
|
Loading.newInstance = function newNotificationInstance(args) {
|
|
40
61
|
var _ref = args || {},
|
|
41
62
|
container = _ref.container,
|
|
42
|
-
otherProps = _objectWithoutProperties(_ref,
|
|
63
|
+
otherProps = _objectWithoutProperties(_ref, _excluded2);
|
|
43
64
|
var div = document.createElement('div');
|
|
44
65
|
// eslint-disable-next-line react/no-find-dom-node
|
|
45
66
|
var element = ReactDOM.findDOMNode(container);
|
|
@@ -54,7 +75,7 @@ Loading.newInstance = function newNotificationInstance(args) {
|
|
|
54
75
|
destroy: function destroy() {
|
|
55
76
|
ReactDOM.unmountComponentAtNode(div);
|
|
56
77
|
if (element) {
|
|
57
|
-
element === null || element === void 0
|
|
78
|
+
element === null || element === void 0 || element.removeChild(div);
|
|
58
79
|
} else {
|
|
59
80
|
document.body.removeChild(div);
|
|
60
81
|
}
|
|
@@ -7,5 +7,5 @@ export declare type ModalFormProps = {
|
|
|
7
7
|
formProps: DFormProps;
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
};
|
|
10
|
-
declare const _default: (props: ModalFormProps) => JSX.Element;
|
|
10
|
+
declare const _default: (props: ModalFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export default _default;
|
|
@@ -19,7 +19,7 @@ export default (function (props) {
|
|
|
19
19
|
} : {};
|
|
20
20
|
var handleOk = function handleOk() {
|
|
21
21
|
form.validateFields().then(function (values) {
|
|
22
|
-
onOk === null || onOk === void 0
|
|
22
|
+
onOk === null || onOk === void 0 || onOk(values);
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
return /*#__PURE__*/_jsxs(DModal, _objectSpread(_objectSpread(_objectSpread({
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { INoDataProps } from './interface';
|
|
3
2
|
import './styles/index.less';
|
|
4
|
-
declare const NoData: (props: INoDataProps) => JSX.Element;
|
|
3
|
+
declare const NoData: (props: INoDataProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
4
|
export default NoData;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ImageProps } from 'antd';
|
|
3
|
+
import './index.less';
|
|
4
|
+
interface IPictureCardProps extends Omit<ImageProps, 'src' | 'width'> {
|
|
5
|
+
className?: string;
|
|
6
|
+
layout?: 'vertical' | 'horizontal';
|
|
7
|
+
src: ImageProps['src'] | ImageProps['src'][];
|
|
8
|
+
imageWidth?: ImageProps['width'];
|
|
9
|
+
content?: React.ReactNode;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
hoverable?: boolean;
|
|
12
|
+
bordered?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const PictureCard: (props: IPictureCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare type PictureCardProps = IPictureCardProps;
|
|
16
|
+
export default PictureCard;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
4
|
+
import React, { useState, useContext } from 'react';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import { ConfigContext } from "../ConfigProvider";
|
|
7
|
+
import { Image } from 'antd';
|
|
8
|
+
import "./index.less";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
var PictureCard = function PictureCard(props) {
|
|
13
|
+
var className = props.className,
|
|
14
|
+
_props$layout = props.layout,
|
|
15
|
+
layout = _props$layout === void 0 ? 'vertical' : _props$layout,
|
|
16
|
+
src = props.src,
|
|
17
|
+
_props$preview = props.preview,
|
|
18
|
+
preview = _props$preview === void 0 ? false : _props$preview,
|
|
19
|
+
imageWidth = props.imageWidth,
|
|
20
|
+
content = props.content,
|
|
21
|
+
style = props.style,
|
|
22
|
+
_props$bordered = props.bordered,
|
|
23
|
+
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
24
|
+
_props$hoverable = props.hoverable,
|
|
25
|
+
hoverable = _props$hoverable === void 0 ? true : _props$hoverable;
|
|
26
|
+
var _useContext = useContext(ConfigContext),
|
|
27
|
+
prefixCls = _useContext.prefixCls,
|
|
28
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
29
|
+
var classname = getPrefixCls('picture-card');
|
|
30
|
+
var wrapperClass = classNames(_defineProperty({}, "".concat(prefixCls, "-picture-card"), !!prefixCls), _defineProperty(_defineProperty({}, "".concat(classname, "-hoverable"), hoverable), "".concat(classname, "-bordered"), bordered), classname, className, layout);
|
|
31
|
+
var _useState = useState(false),
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
visible = _useState2[0],
|
|
34
|
+
setVisible = _useState2[1];
|
|
35
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
36
|
+
className: wrapperClass,
|
|
37
|
+
style: style,
|
|
38
|
+
children: [Array.isArray(src) ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
39
|
+
children: [/*#__PURE__*/_jsx(Image, {
|
|
40
|
+
src: src[0],
|
|
41
|
+
preview: preview && {
|
|
42
|
+
visible: false
|
|
43
|
+
},
|
|
44
|
+
width: imageWidth,
|
|
45
|
+
onClick: function onClick(e) {
|
|
46
|
+
e.stopPropagation();
|
|
47
|
+
// eslint-disable-next-line no-unused-expressions
|
|
48
|
+
preview && setVisible(true);
|
|
49
|
+
}
|
|
50
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
51
|
+
style: {
|
|
52
|
+
display: 'none'
|
|
53
|
+
},
|
|
54
|
+
children: /*#__PURE__*/_jsx(Image.PreviewGroup, {
|
|
55
|
+
preview: {
|
|
56
|
+
visible: visible,
|
|
57
|
+
onVisibleChange: function onVisibleChange(vis) {
|
|
58
|
+
return setVisible(vis);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
children: src.map(function (item) {
|
|
62
|
+
return /*#__PURE__*/_jsx(Image, {
|
|
63
|
+
src: item
|
|
64
|
+
}, item);
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
})]
|
|
68
|
+
}) : /*#__PURE__*/_jsx(Image, {
|
|
69
|
+
src: src,
|
|
70
|
+
preview: preview,
|
|
71
|
+
width: imageWidth
|
|
72
|
+
}), content && /*#__PURE__*/_jsx("div", {
|
|
73
|
+
className: "info",
|
|
74
|
+
children: content
|
|
75
|
+
})]
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
export default PictureCard;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@import '../commonStyle/index.less';
|
|
2
|
+
|
|
3
|
+
.@{prefix}-picture-card {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
padding: 10px;
|
|
6
|
+
transition: box-shadow 0.3s linear;
|
|
7
|
+
|
|
8
|
+
.info {
|
|
9
|
+
margin-top: 10px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&-bordered {
|
|
13
|
+
border: 1px solid rgba(0, 0, 0, 6%);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&-hoverable {
|
|
17
|
+
&:hover {
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
border-color: transparent;
|
|
20
|
+
box-shadow: 0 1px 2px -2px rgba(0, 0, 0, 16%), 0 3px 6px rgba(0, 0, 0, 12%), 0 5px 12px 4px rgba(0, 0, 0, 9%);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.horizontal {
|
|
25
|
+
display: flex;
|
|
26
|
+
justify-content: space-around;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Props } from 'react-rnd';
|
|
2
|
+
declare const RndDrag: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default RndDrag;
|
|
4
|
+
export type { Props as RndDragProps } from 'react-rnd';
|
|
5
|
+
export type { DraggableData, Position, Grid, RndDragCallback, RndDragEvent, RndResizeStartCallback, HandleStyles } from 'react-rnd';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["children", "className"];
|
|
5
|
+
import { Rnd } from 'react-rnd';
|
|
6
|
+
import { useContext } from 'react';
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import { ConfigContext } from "../ConfigProvider";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
var RndDrag = function RndDrag(props) {
|
|
11
|
+
var children = props.children,
|
|
12
|
+
className = props.className,
|
|
13
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
14
|
+
var _useContext = useContext(ConfigContext),
|
|
15
|
+
prefixCls = _useContext.prefixCls,
|
|
16
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
17
|
+
var classname = getPrefixCls('rnd-drag');
|
|
18
|
+
var wrapperClass = classNames(_defineProperty({}, "".concat(prefixCls, "-rnd-drag"), !!prefixCls), classname, className);
|
|
19
|
+
return /*#__PURE__*/_jsx(Rnd, _objectSpread(_objectSpread({
|
|
20
|
+
className: wrapperClass,
|
|
21
|
+
bounds: "parent"
|
|
22
|
+
}, rest), {}, {
|
|
23
|
+
children: children
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
export default RndDrag;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CountUpProps as ICountUpProps } from 'react-countup';
|
|
3
2
|
declare const ScrollNumber: {
|
|
4
|
-
(props: ICountUpProps): JSX.Element;
|
|
3
|
+
(props: ICountUpProps): import("react/jsx-runtime").JSX.Element;
|
|
5
4
|
useCountUp: (props: import("react-countup/build/useCountUp").UseCountUpProps) => import("react-countup/build/types").CountUpApi;
|
|
6
5
|
};
|
|
7
6
|
export declare type ScrollNumberProps = ICountUpProps;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { Props } from 'react-wordcloud';
|
|
3
2
|
export declare type WordCloudProps = Props & {
|
|
4
3
|
className?: string;
|
|
5
4
|
};
|
|
6
|
-
declare const WordCloud: (props: WordCloudProps) => JSX.Element;
|
|
5
|
+
declare const WordCloud: (props: WordCloudProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export default WordCloud;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export { default as AuthComponent } from './AuthComponent';
|
|
|
6
6
|
export type { AuthComponentProps } from './AuthComponent/interface';
|
|
7
7
|
export { default as ErrorBoundary } from './ErrorBoundary';
|
|
8
8
|
export { default as ConfigProvider } from './ConfigProvider';
|
|
9
|
+
export { default as PictureCard } from './PictureCard';
|
|
10
|
+
export type { PictureCardProps } from './PictureCard';
|
|
9
11
|
export { default as Loading } from './Loading';
|
|
10
12
|
export type { LoadingProps } from './Loading/interface';
|
|
11
13
|
export { default as NoData } from './NoData';
|
|
@@ -34,3 +36,7 @@ export { default as ScrollNumber } from './ScrollNumber';
|
|
|
34
36
|
export type { ScrollNumberProps } from './ScrollNumber';
|
|
35
37
|
export type { WordCloudProps } from './WordCloud';
|
|
36
38
|
export { default as WordCloud } from './WordCloud';
|
|
39
|
+
export type { InfiniteScrollListProps } from './InfiniteScrollList';
|
|
40
|
+
export { default as InfiniteScrollList } from './InfiniteScrollList';
|
|
41
|
+
export { default as RndDrag } from './RndDrag';
|
|
42
|
+
export type { RndDragProps, DraggableData, Position, Grid, RndDragCallback, RndDragEvent, RndResizeStartCallback, HandleStyles } from './RndDrag';
|
package/dist/esm/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { default as AdvancedFilter } from "./AdvancedFilter";
|
|
|
3
3
|
export { default as AuthComponent } from "./AuthComponent";
|
|
4
4
|
export { default as ErrorBoundary } from "./ErrorBoundary";
|
|
5
5
|
export { default as ConfigProvider } from "./ConfigProvider";
|
|
6
|
+
export { default as PictureCard } from "./PictureCard";
|
|
6
7
|
export { default as Loading } from "./Loading";
|
|
7
8
|
export { default as NoData } from "./NoData";
|
|
8
9
|
export { default as DInput } from "./DInput";
|
|
@@ -16,4 +17,6 @@ export { default as DModal } from "./DModal";
|
|
|
16
17
|
export { default as ModalForm } from "./ModalForm";
|
|
17
18
|
export { default as ColorPicker } from "./ColorPicker";
|
|
18
19
|
export { default as ScrollNumber } from "./ScrollNumber";
|
|
19
|
-
export { default as WordCloud } from "./WordCloud";
|
|
20
|
+
export { default as WordCloud } from "./WordCloud";
|
|
21
|
+
export { default as InfiniteScrollList } from "./InfiniteScrollList";
|
|
22
|
+
export { default as RndDrag } from "./RndDrag";
|