@pointcloud/pcloud-components 0.1.19 → 0.1.20
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 +8 -1
- package/dist/esm/DForm/DItem/itemsRender.d.ts +1 -1
- package/dist/esm/DForm/DItem/itemsRender.js +6 -6
- package/dist/esm/DForm/index.less +44 -44
- package/dist/esm/InfiniteScrollList/index.d.ts +54 -0
- package/dist/esm/InfiniteScrollList/index.js +169 -0
- package/dist/esm/InfiniteScrollList/styles/index.less +22 -0
- package/dist/esm/PictureCard/index.d.ts +16 -0
- package/dist/esm/PictureCard/index.js +79 -0
- package/dist/esm/PictureCard/index.less +28 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +3 -1
- package/dist/umd/pcloud-components.min.css +1 -1
- package/dist/umd/pcloud-components.min.js +1 -1
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# pcloud-components
|
|
2
2
|
|
|
3
|
-
>) ?style=flat&logo=antdesign>)  >) ?style=flat&logo=antdesign>)  ?style=flat&logo=webcomponentsdotorg>) ?style=flat>)
|
|
4
4
|
|
|
5
5
|
pcloud-components 是一套基于 Antd v4.24.x+ React v17.x 开发的业务组件库。
|
|
6
6
|
该项目已经发布到 Npm 仓库,可以直接使用, 点击[pcloud-components 地址](https://www.npmjs.com/package/@pointcloud/pcloud-components)访问。
|
|
@@ -299,6 +299,13 @@ git commit -m "fix: 修复bug" // type后的冒号和空格不可省略,descri
|
|
|
299
299
|
// npm unlink --no-save package && npm install // 调试完成后解除链接
|
|
300
300
|
```
|
|
301
301
|
|
|
302
|
+
3. docker 推送镜像
|
|
303
|
+
|
|
304
|
+
```
|
|
305
|
+
// 推送镜像之前需要先登录,并修改package.json-->scripts中对应docker的配置
|
|
306
|
+
npm run push
|
|
307
|
+
```
|
|
308
|
+
|
|
302
309
|
##### 发布项目
|
|
303
310
|
|
|
304
311
|
1. 前置工作
|
|
@@ -38,6 +38,6 @@ declare const renderMap: {
|
|
|
38
38
|
dUpload: (props: DUploadProps, formItemProps: FormItemProps, render: (props: any) => ReactNode, children: DUploadProps['children']) => JSX.Element;
|
|
39
39
|
button: (props: ButtonProps, formItemProps: FormItemProps, label: DItemBaseProps['label']) => JSX.Element;
|
|
40
40
|
divider: (props: DividerProps, formItemProps: FormItemProps, label: DItemBaseProps['label']) => JSX.Element;
|
|
41
|
-
other: (formItemProps: FormItemProps, children:
|
|
41
|
+
other: (formItemProps: FormItemProps, children: ReactNode) => JSX.Element;
|
|
42
42
|
};
|
|
43
43
|
export default renderMap;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
/*
|
|
3
|
-
* @Author : wangfeihu
|
|
4
|
-
* @Date : 2023-06-12 17:35:10
|
|
5
|
-
* @LastEditors : frank
|
|
6
|
-
* @LastEditTime : 2023-12-20 15:40:13
|
|
7
|
-
* @Description : 根据renderType渲染对应的表单项组件
|
|
2
|
+
/*
|
|
3
|
+
* @Author : wangfeihu
|
|
4
|
+
* @Date : 2023-06-12 17:35:10
|
|
5
|
+
* @LastEditors : frank
|
|
6
|
+
* @LastEditTime : 2023-12-20 15:40:13
|
|
7
|
+
* @Description : 根据renderType渲染对应的表单项组件
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { AutoComplete, Button, Cascader, Checkbox, DatePicker, Divider, Form, Input, InputNumber, Mentions, Radio, Rate, Select, Slider, Switch, TimePicker, Transfer, TreeSelect, Upload } from 'antd';
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
@import '../commonStyle/index.less';
|
|
2
|
-
|
|
3
|
-
.@{prefix}-form {
|
|
4
|
-
.form-wrapper > .ant-form-item {
|
|
5
|
-
min-height: 32px;
|
|
6
|
-
margin-right: 0;
|
|
7
|
-
margin-bottom: 24px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.form-wrapper > .ant-form-item:last-child {
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.ant-input-number,
|
|
15
|
-
.ant-picker {
|
|
16
|
-
width: 100%;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.@{prefix}-form.ant-form-horizontal .ant-form-item-label {
|
|
21
|
-
min-width: 80px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.@{prefix}-form.ant-form-inline .form-wrapper,
|
|
25
|
-
.@{prefix}-form.ant-form-inline.inlineVertical .form-wrapper {
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-wrap: wrap;
|
|
28
|
-
align-items: flex-end;
|
|
29
|
-
height: min-content;
|
|
30
|
-
|
|
31
|
-
> .ant-form-item {
|
|
32
|
-
padding-right: 16px;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.@{prefix}-form.ant-form-inline.inlineVertical {
|
|
37
|
-
.ant-form-item-row {
|
|
38
|
-
flex-direction: column;
|
|
39
|
-
|
|
40
|
-
.ant-form-item-label {
|
|
41
|
-
text-align: left;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
1
|
+
@import '../commonStyle/index.less';
|
|
2
|
+
|
|
3
|
+
.@{prefix}-form {
|
|
4
|
+
.form-wrapper > .ant-form-item {
|
|
5
|
+
min-height: 32px;
|
|
6
|
+
margin-right: 0;
|
|
7
|
+
margin-bottom: 24px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// .form-wrapper > .ant-form-item:last-child {
|
|
11
|
+
// margin-bottom: 0;
|
|
12
|
+
// }
|
|
13
|
+
|
|
14
|
+
.ant-input-number,
|
|
15
|
+
.ant-picker {
|
|
16
|
+
width: 100%;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.@{prefix}-form.ant-form-horizontal .ant-form-item-label {
|
|
21
|
+
min-width: 80px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.@{prefix}-form.ant-form-inline .form-wrapper,
|
|
25
|
+
.@{prefix}-form.ant-form-inline.inlineVertical .form-wrapper {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
align-items: flex-end;
|
|
29
|
+
height: min-content;
|
|
30
|
+
|
|
31
|
+
> .ant-form-item {
|
|
32
|
+
padding-right: 16px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.@{prefix}-form.ant-form-inline.inlineVertical {
|
|
37
|
+
.ant-form-item-row {
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
|
|
40
|
+
.ant-form-item-label {
|
|
41
|
+
text-align: left;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './styles/index.less';
|
|
3
|
+
interface ISLProps<T, P> {
|
|
4
|
+
/**
|
|
5
|
+
* @description 容器id
|
|
6
|
+
* @default scrollableDiv
|
|
7
|
+
*/
|
|
8
|
+
containerId?: string;
|
|
9
|
+
/**
|
|
10
|
+
* @description 列表项的唯一标识字段
|
|
11
|
+
* @default id
|
|
12
|
+
*/
|
|
13
|
+
itemKey?: string;
|
|
14
|
+
/**
|
|
15
|
+
* @description 容器高度(超过此高度将滚动)
|
|
16
|
+
*/
|
|
17
|
+
containerHeight: number | string;
|
|
18
|
+
/**
|
|
19
|
+
* @description 列表请求的初始参数
|
|
20
|
+
*/
|
|
21
|
+
initialParams?: any;
|
|
22
|
+
/**
|
|
23
|
+
* @description 列表请求方法
|
|
24
|
+
* @param params 请求参数
|
|
25
|
+
* @returns Promise<{ data: { total: number; records: any[] } }>
|
|
26
|
+
*/
|
|
27
|
+
loadMore: (params?: T) => Promise<{
|
|
28
|
+
data: {
|
|
29
|
+
total: number;
|
|
30
|
+
records: any[];
|
|
31
|
+
};
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* @description 列表项的渲染方法
|
|
35
|
+
* @param item 列表项数据
|
|
36
|
+
* @returns React.ReactNode
|
|
37
|
+
*/
|
|
38
|
+
renderItem: (item: P, index: number) => React.ReactNode;
|
|
39
|
+
grid?: object;
|
|
40
|
+
className?: string;
|
|
41
|
+
/**
|
|
42
|
+
* @description 滚动阈值,默认为 100px
|
|
43
|
+
* @default 100px
|
|
44
|
+
*/
|
|
45
|
+
scrollThreshold?: string | number;
|
|
46
|
+
/**
|
|
47
|
+
* @description 滚动高度达到此参数值才出现 BackTop
|
|
48
|
+
* @default 200
|
|
49
|
+
*/
|
|
50
|
+
visibilityHeight?: number;
|
|
51
|
+
}
|
|
52
|
+
export declare type InfiniteScrollListProps<T, P> = ISLProps<T, P>;
|
|
53
|
+
declare const _default: React.MemoExoticComponent<(<T, P>(props: ISLProps<T, P>) => JSX.Element)>;
|
|
54
|
+
export default _default;
|
|
@@ -0,0 +1,169 @@
|
|
|
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 _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
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$data2, _listData$data3;
|
|
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 scrollRef = useRef(null);
|
|
39
|
+
var _useState = useState({
|
|
40
|
+
total: 0,
|
|
41
|
+
data: []
|
|
42
|
+
}),
|
|
43
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
44
|
+
listData = _useState2[0],
|
|
45
|
+
setListData = _useState2[1];
|
|
46
|
+
var _useState3 = useState(false),
|
|
47
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
48
|
+
isLoading = _useState4[0],
|
|
49
|
+
setIsLoading = _useState4[1];
|
|
50
|
+
var _useState5 = useState(_objectSpread({
|
|
51
|
+
current: 1,
|
|
52
|
+
size: 10
|
|
53
|
+
}, initialParams)),
|
|
54
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
55
|
+
pageParams = _useState6[0],
|
|
56
|
+
setPageParams = _useState6[1];
|
|
57
|
+
var handleLoadMore = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
58
|
+
var _listData$data, _yield$loadMore, data, total, records;
|
|
59
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
60
|
+
while (1) switch (_context.prev = _context.next) {
|
|
61
|
+
case 0:
|
|
62
|
+
if (!isLoading) {
|
|
63
|
+
_context.next = 2;
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
return _context.abrupt("return");
|
|
67
|
+
case 2:
|
|
68
|
+
setIsLoading(true);
|
|
69
|
+
_context.prev = 3;
|
|
70
|
+
_context.next = 6;
|
|
71
|
+
return loadMore(_objectSpread({}, pageParams));
|
|
72
|
+
case 6:
|
|
73
|
+
_yield$loadMore = _context.sent;
|
|
74
|
+
data = _yield$loadMore.data;
|
|
75
|
+
total = data.total, records = data.records;
|
|
76
|
+
if ((records === null || records === void 0 ? void 0 : records.length) > 0 && (listData === null || listData === void 0 ? void 0 : (_listData$data = listData.data) === null || _listData$data === void 0 ? void 0 : _listData$data.length) < total) {
|
|
77
|
+
setPageParams(function (prevParams) {
|
|
78
|
+
return _objectSpread(_objectSpread({}, prevParams), {}, {
|
|
79
|
+
current: prevParams.current + 1
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
setListData(function (prevData) {
|
|
84
|
+
return {
|
|
85
|
+
total: total,
|
|
86
|
+
data: total > 0 ? [].concat(_toConsumableArray(prevData.data), _toConsumableArray(records || [])) : []
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
setIsLoading(false);
|
|
90
|
+
_context.next = 17;
|
|
91
|
+
break;
|
|
92
|
+
case 14:
|
|
93
|
+
_context.prev = 14;
|
|
94
|
+
_context.t0 = _context["catch"](3);
|
|
95
|
+
setIsLoading(false);
|
|
96
|
+
case 17:
|
|
97
|
+
_context.prev = 17;
|
|
98
|
+
setIsLoading(false);
|
|
99
|
+
return _context.finish(17);
|
|
100
|
+
case 20:
|
|
101
|
+
case "end":
|
|
102
|
+
return _context.stop();
|
|
103
|
+
}
|
|
104
|
+
}, _callee, null, [[3, 14, 17, 20]]);
|
|
105
|
+
})), [loadMore, isLoading, pageParams]);
|
|
106
|
+
useEffect(function () {
|
|
107
|
+
if (Reflect.ownKeys(initialParams).length > 0 && pageParams.current !== 1) {
|
|
108
|
+
var _scrollRef$current;
|
|
109
|
+
scrollRef === null || scrollRef === void 0 ? void 0 : (_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.scrollTo({
|
|
110
|
+
top: 0,
|
|
111
|
+
behavior: 'smooth'
|
|
112
|
+
});
|
|
113
|
+
setPageParams(_objectSpread({
|
|
114
|
+
current: 1
|
|
115
|
+
}, initialParams));
|
|
116
|
+
}
|
|
117
|
+
handleLoadMore();
|
|
118
|
+
}, [initialParams]);
|
|
119
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
120
|
+
id: containerId,
|
|
121
|
+
className: "scroll-container",
|
|
122
|
+
ref: scrollRef,
|
|
123
|
+
style: {
|
|
124
|
+
height: containerHeight,
|
|
125
|
+
overflowY: 'auto'
|
|
126
|
+
},
|
|
127
|
+
children: [/*#__PURE__*/_jsx(InfiniteScroll, {
|
|
128
|
+
className: "".concat(wrapperClass, " ").concat(className, " "),
|
|
129
|
+
scrollableTarget: containerId,
|
|
130
|
+
dataLength: listData === null || listData === void 0 ? void 0 : (_listData$data2 = listData.data) === null || _listData$data2 === void 0 ? void 0 : _listData$data2.length,
|
|
131
|
+
next: handleLoadMore,
|
|
132
|
+
hasMore: (listData === null || listData === void 0 ? void 0 : (_listData$data3 = listData.data) === null || _listData$data3 === void 0 ? void 0 : _listData$data3.length) < (listData === null || listData === void 0 ? void 0 : listData.total),
|
|
133
|
+
loader: /*#__PURE__*/_jsx("div", {
|
|
134
|
+
style: {
|
|
135
|
+
textAlign: 'center'
|
|
136
|
+
},
|
|
137
|
+
children: /*#__PURE__*/_jsx(Spin, {
|
|
138
|
+
tip: "\u62FC\u547D\u52A0\u8F7D\u4E2D..."
|
|
139
|
+
})
|
|
140
|
+
}),
|
|
141
|
+
endMessage: (listData === null || listData === void 0 ? void 0 : listData.total) > 0 && /*#__PURE__*/_jsx(Divider, {
|
|
142
|
+
plain: true,
|
|
143
|
+
children: "\u5DF2\u7ECF\u5230\u5E95\u90E8\u4E86"
|
|
144
|
+
}),
|
|
145
|
+
scrollThreshold: scrollThreshold,
|
|
146
|
+
inverse: false,
|
|
147
|
+
children: /*#__PURE__*/_jsx(List, {
|
|
148
|
+
grid: grid,
|
|
149
|
+
dataSource: listData.data,
|
|
150
|
+
renderItem: function renderItem(item, index) {
|
|
151
|
+
return /*#__PURE__*/_jsx(List.Item, {
|
|
152
|
+
children: _renderItem(item, index)
|
|
153
|
+
}, item[itemKey]);
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
}), /*#__PURE__*/_jsx(BackTop, {
|
|
157
|
+
className: "backtop",
|
|
158
|
+
target: function target() {
|
|
159
|
+
return (scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) || document.body;
|
|
160
|
+
},
|
|
161
|
+
visibilityHeight: visibilityHeight,
|
|
162
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
163
|
+
className: "up",
|
|
164
|
+
children: "\u56DE\u5230\u9876\u90E8"
|
|
165
|
+
})
|
|
166
|
+
})]
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
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
|
+
}
|
|
@@ -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) => JSX.Element;
|
|
15
|
+
export declare type PictureCardProps = IPictureCardProps;
|
|
16
|
+
export default PictureCard;
|
|
@@ -0,0 +1,79 @@
|
|
|
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 _classNames2;
|
|
14
|
+
var className = props.className,
|
|
15
|
+
_props$layout = props.layout,
|
|
16
|
+
layout = _props$layout === void 0 ? 'vertical' : _props$layout,
|
|
17
|
+
src = props.src,
|
|
18
|
+
_props$preview = props.preview,
|
|
19
|
+
preview = _props$preview === void 0 ? false : _props$preview,
|
|
20
|
+
imageWidth = props.imageWidth,
|
|
21
|
+
content = props.content,
|
|
22
|
+
style = props.style,
|
|
23
|
+
_props$bordered = props.bordered,
|
|
24
|
+
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
25
|
+
_props$hoverable = props.hoverable,
|
|
26
|
+
hoverable = _props$hoverable === void 0 ? true : _props$hoverable;
|
|
27
|
+
var _useContext = useContext(ConfigContext),
|
|
28
|
+
prefixCls = _useContext.prefixCls,
|
|
29
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
30
|
+
var classname = getPrefixCls('picture-card');
|
|
31
|
+
var wrapperClass = classNames(_defineProperty({}, "".concat(prefixCls, "-picture-card"), !!prefixCls), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(classname, "-hoverable"), hoverable), _defineProperty(_classNames2, "".concat(classname, "-bordered"), bordered), _classNames2), classname, className, layout);
|
|
32
|
+
var _useState = useState(false),
|
|
33
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
34
|
+
visible = _useState2[0],
|
|
35
|
+
setVisible = _useState2[1];
|
|
36
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
37
|
+
className: wrapperClass,
|
|
38
|
+
style: style,
|
|
39
|
+
children: [Array.isArray(src) ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
40
|
+
children: [/*#__PURE__*/_jsx(Image, {
|
|
41
|
+
src: src[0],
|
|
42
|
+
preview: preview && {
|
|
43
|
+
visible: false
|
|
44
|
+
},
|
|
45
|
+
width: imageWidth,
|
|
46
|
+
onClick: function onClick(e) {
|
|
47
|
+
e.stopPropagation();
|
|
48
|
+
// eslint-disable-next-line no-unused-expressions
|
|
49
|
+
preview && setVisible(true);
|
|
50
|
+
}
|
|
51
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
52
|
+
style: {
|
|
53
|
+
display: 'none'
|
|
54
|
+
},
|
|
55
|
+
children: /*#__PURE__*/_jsx(Image.PreviewGroup, {
|
|
56
|
+
preview: {
|
|
57
|
+
visible: visible,
|
|
58
|
+
onVisibleChange: function onVisibleChange(vis) {
|
|
59
|
+
return setVisible(vis);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
children: src.map(function (item) {
|
|
63
|
+
return /*#__PURE__*/_jsx(Image, {
|
|
64
|
+
src: item
|
|
65
|
+
}, item);
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
})]
|
|
69
|
+
}) : /*#__PURE__*/_jsx(Image, {
|
|
70
|
+
src: src,
|
|
71
|
+
preview: preview,
|
|
72
|
+
width: imageWidth
|
|
73
|
+
}), content && /*#__PURE__*/_jsx("div", {
|
|
74
|
+
className: "info",
|
|
75
|
+
children: content
|
|
76
|
+
})]
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
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
|
+
}
|
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,5 @@ 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';
|
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,5 @@ 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";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.pui-label-value{display:inline-flex}.pui-label-value span:first-child{max-width:120px;padding-right:4px;white-space:nowrap}.pui-label-value span:last-child{flex:1 1}.pui-label-value span:last-child.no-wrap{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pui-search-filter{align-items:center;background-color:#fff;margin-top:10px;width:100%}.pui-search-filter span.ant-collapse-header-text{cursor:auto!important;display:inline-block;width:100%}.pui-search-filter .ant-collapse-content-box{padding:0}.pui-search-filter .search-header{display:flex;width:100%}.pui-search-filter .search-header .left{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:no-wrap}.pui-search-filter .search-header .left :global .ant-radio-wrapper:first-child{border-left:1px solid #d9d9d9;border-radius:5px 0 0 5px}.pui-search-filter .search-header .left :global .ant-radio-wrapper:last-child{border-radius:0 5px 5px 0}.pui-search-filter .search-header .left :global .ant-radio-wrapper{border:1px solid #d9d9d9;border-left-color:#fff;margin-right:0;padding:4px 6px}.pui-search-filter .search-header .left :global .ant-radio-wrapper .ant-radio{display:none}.pui-search-filter .search-header .left :global .ant-radio-wrapper:hover{color:#1890ff}.pui-search-filter .search-header .left :global .ant-radio-wrapper-checked{background:#fff;border:1px solid #1890ff;border-left:1px solid #1890ff!important;color:#1890ff;z-index:1}.pui-search-filter .search-header .right{display:flex;justify-content:center}.pui-search-filter .search-header .right .input{border-radius:4px;width:200px}.pui-search-filter .search-header .right .button{background-color:#ff7e00;border-radius:4px;color:#fff;margin-left:10px}.pui-search-filter .search-header .right .button:active,.pui-search-filter .search-header .right .button:focus,.pui-search-filter .search-header .right .button:hover{border-color:transparent}.pui-search-filter .search-header .right .button .icon{margin-left:8px;transition:transform .4s}.pui-search-filter .search-header .right .button .icon.down{transform:rotate(180deg)}.pui-search-filter .search-header .right .button .icon.up{transform:rotate(0deg)}.pui-search-filter .title{align-items:center;border-bottom:1px solid #f0f0f0;display:flex;font-weight:700;margin:0 10px;padding-bottom:10px}.pui-search-filter .title span.icon{background-color:#ff7e00;border-radius:2px;height:16px;margin-right:6px;width:4px}.pui-search-filter .search-content .filter-row{display:flex;flex-wrap:wrap;padding:10px;width:100%}.pui-search-filter .search-content .filter-col{height:30px;line-height:30px;margin-bottom:10px}.pui-search-filter .search-content .filter-col .ant-picker{width:100%}.pui-search-filter .search-content .search-btn{justify-content:center}.pui-search-filter .search-content .search-btn>button{margin:0 5px}.pui-error-boundary{align-items:center;background-color:#dd7f7f;border-radius:10px;display:flex;flex-direction:column;justify-content:center;margin:20px;padding:15px;width:auto}.pui-error-boundary .error-text{margin-top:20px}.pui-error-boundary .error-refresh{background-color:#4593ef;border-radius:5px;color:#fff;cursor:pointer;font-weight:700;height:40px;line-height:40px;text-align:center;width:140px}.pui-error-boundary .errorDetiles .detilesLink{color:blue}.pui-error-boundary .errorDetiles .errordetails{background-color:#ccc6be;border:1px solid #777;border-radius:5px;color:#777;font-size:80%;padding:10px}.pui-loading .mask{height:100%;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:100000}.pui-loading .loading{background:#fff;border-radius:10px;box-shadow:3px 3px 3px rgba(0,0,0,.2);padding:20px;z-index:100001}.pui-loading .loading,.pui-nodata{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.pui-nodata .not-data-image{display:block;height:100px}.pui-nodata .no-data-text{color:#000;display:inline-block;font-size:14px;font-weight:400;margin-top:5px;opacity:.65;text-align:center;width:100%}.pui-cascader-dropdown .ant-cascader-menu::-webkit-scrollbar{height:8px;width:8px}.pui-cascader-dropdown .ant-cascader-menu::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.5);border-radius:8px}.pui-cascader-dropdown .ant-cascader-menu::-webkit-scrollbar-track{border-radius:2px}.pui-cascader-dropdown .ant-cascader-menu::-webkit-scrollbar-corner{background-color:#f1f1f1}.pui-tree-select-dropdown .ant-select-tree-node-content-wrapper{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pui-tree-select-dropdown .ant-select-tree-node-content-wrapper .ant-select-tree-title{overflow:hidden}.pui-upload .preview .ant-upload-list-item-actions a[target=_blank][rel="noopener noreferrer"]{opacity:1!important;pointer-events:auto!important}.pui-upload .ant-upload-list.ant-upload-list-picture-card .ant-upload-span .ant-upload-list-item-thumbnail{height:46px}.pui-upload .ant-upload-list.ant-upload-list-picture-card .ant-upload-span .ant-upload-list-item-name{display:inline;display:initial;position:absolute}.pui-table .ant-spin-container,.pui-table .ant-spin-nested-loading,.pui-table .ant-table,.pui-table .ant-table-container{height:100%;width:100%}.pui-table .ant-table-body{max-height:calc(100% - 56px);max-width:100%;min-height:calc(100% - 56px);min-width:100%;overflow-y:auto!important;position:absolute}.pui-table .ant-table-body .ant-table-tbody>tr>td.ant-table-cell.d-table-cell-wrap{white-space:normal}.pui-table .ant-table-body::-webkit-scrollbar{height:8px;width:4px}.pui-table .ant-table-body::-webkit-scrollbar-thumb{background-color:#0084ff}.pui-table .ant-table-body::-webkit-scrollbar-track{background-color:#f1f1f1;border-radius:2px}.pui-table .ant-table-body::-webkit-scrollbar-corner{background-color:#f1f1f1}.pui-table .ant-spin-nested-loading>div>.ant-spin{max-height:none}.pui-table .ant-pagination-total-text span{color:#40a9ff;font-weight:700}.pui-table.height-on-page .ant-table{height:calc(100% - 56px)}.pui-form .form-wrapper>.ant-form-item{margin-bottom:24px;margin-right:0;min-height:32px}.pui-form .
|
|
1
|
+
.pui-label-value{display:inline-flex}.pui-label-value span:first-child{max-width:120px;padding-right:4px;white-space:nowrap}.pui-label-value span:last-child{flex:1 1}.pui-label-value span:last-child.no-wrap{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pui-search-filter{align-items:center;background-color:#fff;margin-top:10px;width:100%}.pui-search-filter span.ant-collapse-header-text{cursor:auto!important;display:inline-block;width:100%}.pui-search-filter .ant-collapse-content-box{padding:0}.pui-search-filter .search-header{display:flex;width:100%}.pui-search-filter .search-header .left{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:no-wrap}.pui-search-filter .search-header .left :global .ant-radio-wrapper:first-child{border-left:1px solid #d9d9d9;border-radius:5px 0 0 5px}.pui-search-filter .search-header .left :global .ant-radio-wrapper:last-child{border-radius:0 5px 5px 0}.pui-search-filter .search-header .left :global .ant-radio-wrapper{border:1px solid #d9d9d9;border-left-color:#fff;margin-right:0;padding:4px 6px}.pui-search-filter .search-header .left :global .ant-radio-wrapper .ant-radio{display:none}.pui-search-filter .search-header .left :global .ant-radio-wrapper:hover{color:#1890ff}.pui-search-filter .search-header .left :global .ant-radio-wrapper-checked{background:#fff;border:1px solid #1890ff;border-left:1px solid #1890ff!important;color:#1890ff;z-index:1}.pui-search-filter .search-header .right{display:flex;justify-content:center}.pui-search-filter .search-header .right .input{border-radius:4px;width:200px}.pui-search-filter .search-header .right .button{background-color:#ff7e00;border-radius:4px;color:#fff;margin-left:10px}.pui-search-filter .search-header .right .button:active,.pui-search-filter .search-header .right .button:focus,.pui-search-filter .search-header .right .button:hover{border-color:transparent}.pui-search-filter .search-header .right .button .icon{margin-left:8px;transition:transform .4s}.pui-search-filter .search-header .right .button .icon.down{transform:rotate(180deg)}.pui-search-filter .search-header .right .button .icon.up{transform:rotate(0deg)}.pui-search-filter .title{align-items:center;border-bottom:1px solid #f0f0f0;display:flex;font-weight:700;margin:0 10px;padding-bottom:10px}.pui-search-filter .title span.icon{background-color:#ff7e00;border-radius:2px;height:16px;margin-right:6px;width:4px}.pui-search-filter .search-content .filter-row{display:flex;flex-wrap:wrap;padding:10px;width:100%}.pui-search-filter .search-content .filter-col{height:30px;line-height:30px;margin-bottom:10px}.pui-search-filter .search-content .filter-col .ant-picker{width:100%}.pui-search-filter .search-content .search-btn{justify-content:center}.pui-search-filter .search-content .search-btn>button{margin:0 5px}.pui-error-boundary{align-items:center;background-color:#dd7f7f;border-radius:10px;display:flex;flex-direction:column;justify-content:center;margin:20px;padding:15px;width:auto}.pui-error-boundary .error-text{margin-top:20px}.pui-error-boundary .error-refresh{background-color:#4593ef;border-radius:5px;color:#fff;cursor:pointer;font-weight:700;height:40px;line-height:40px;text-align:center;width:140px}.pui-error-boundary .errorDetiles .detilesLink{color:blue}.pui-error-boundary .errorDetiles .errordetails{background-color:#ccc6be;border:1px solid #777;border-radius:5px;color:#777;font-size:80%;padding:10px}.pui-picture-card{display:inline-block;padding:10px;transition:box-shadow .3s linear}.pui-picture-card .info{margin-top:10px}.pui-picture-card-bordered{border:1px solid rgba(0,0,0,.06)}.pui-picture-card-hoverable:hover{border-color:transparent;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,.09);cursor:pointer}.pui-picture-card.horizontal{display:flex;justify-content:space-around}.pui-loading .mask{height:100%;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:100000}.pui-loading .loading{background:#fff;border-radius:10px;box-shadow:3px 3px 3px rgba(0,0,0,.2);padding:20px;z-index:100001}.pui-loading .loading,.pui-nodata{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.pui-nodata .not-data-image{display:block;height:100px}.pui-nodata .no-data-text{color:#000;display:inline-block;font-size:14px;font-weight:400;margin-top:5px;opacity:.65;text-align:center;width:100%}.pui-cascader-dropdown .ant-cascader-menu::-webkit-scrollbar{height:8px;width:8px}.pui-cascader-dropdown .ant-cascader-menu::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.5);border-radius:8px}.pui-cascader-dropdown .ant-cascader-menu::-webkit-scrollbar-track{border-radius:2px}.pui-cascader-dropdown .ant-cascader-menu::-webkit-scrollbar-corner{background-color:#f1f1f1}.pui-tree-select-dropdown .ant-select-tree-node-content-wrapper{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pui-tree-select-dropdown .ant-select-tree-node-content-wrapper .ant-select-tree-title{overflow:hidden}.pui-upload .preview .ant-upload-list-item-actions a[target=_blank][rel="noopener noreferrer"]{opacity:1!important;pointer-events:auto!important}.pui-upload .ant-upload-list.ant-upload-list-picture-card .ant-upload-span .ant-upload-list-item-thumbnail{height:46px}.pui-upload .ant-upload-list.ant-upload-list-picture-card .ant-upload-span .ant-upload-list-item-name{display:inline;display:initial;position:absolute}.pui-table .ant-spin-container,.pui-table .ant-spin-nested-loading,.pui-table .ant-table,.pui-table .ant-table-container{height:100%;width:100%}.pui-table .ant-table-body{max-height:calc(100% - 56px);max-width:100%;min-height:calc(100% - 56px);min-width:100%;overflow-y:auto!important;position:absolute}.pui-table .ant-table-body .ant-table-tbody>tr>td.ant-table-cell.d-table-cell-wrap{white-space:normal}.pui-table .ant-table-body::-webkit-scrollbar{height:8px;width:4px}.pui-table .ant-table-body::-webkit-scrollbar-thumb{background-color:#0084ff}.pui-table .ant-table-body::-webkit-scrollbar-track{background-color:#f1f1f1;border-radius:2px}.pui-table .ant-table-body::-webkit-scrollbar-corner{background-color:#f1f1f1}.pui-table .ant-spin-nested-loading>div>.ant-spin{max-height:none}.pui-table .ant-pagination-total-text span{color:#40a9ff;font-weight:700}.pui-table.height-on-page .ant-table{height:calc(100% - 56px)}.pui-form .form-wrapper>.ant-form-item{margin-bottom:24px;margin-right:0;min-height:32px}.pui-form .ant-input-number,.pui-form .ant-picker{width:100%}.pui-form.ant-form-horizontal .ant-form-item-label{min-width:80px}.pui-form.ant-form-inline .form-wrapper,.pui-form.ant-form-inline.inlineVertical .form-wrapper{align-items:flex-end;display:flex;flex-wrap:wrap;height:min-content}.pui-form.ant-form-inline .form-wrapper>.ant-form-item,.pui-form.ant-form-inline.inlineVertical .form-wrapper>.ant-form-item{padding-right:16px}.pui-form.ant-form-inline.inlineVertical .ant-form-item-row{flex-direction:column}.pui-form.ant-form-inline.inlineVertical .ant-form-item-row .ant-form-item-label{text-align:left}.pui-modal-container .ant-modal-wrap .ant-modal{height:100%;max-width:none}.pui-modal-container .ant-modal-wrap .ant-modal .ant-modal-content{height:100%;width:100%}.pui-absolute-modal-container .ant-modal-wrap{position:fixed}.pui-relative-modal-container .ant-modal-wrap{position:absolute}.pui-color-picker .sketch-picker{box-shadow:none!important;padding:0!important}.trigger{border:5px solid #fff;border-radius:2px;box-shadow:0 0 2px #000;cursor:pointer;display:inline-block;height:26px;width:60px}.pui-infinite-scroll-wrapper .ant-list .ant-row{margin-right:0!important}.scroll-container{position:relative}.scroll-container .backtop{right:50px}.scroll-container .up{background:#007aff;border-radius:3px;color:#fff;text-align:center}
|