@pointcloud/pcloud-components 1.0.4 → 1.0.6
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 +1 -1
- package/dist/esm/AdvancedFilter/styles/index.less +143 -143
- package/dist/esm/AnimatedScrollList/styles/index.less +22 -22
- package/dist/esm/CRUD/index.less +156 -154
- package/dist/esm/CRUD/toolbar.d.ts +3 -3
- package/dist/esm/ColorPicker/index.js +4 -4
- package/dist/esm/ContextMenu/index.less +61 -61
- package/dist/esm/DCascader/index.d.ts +1 -1
- package/dist/esm/DForm/DItem/itemsRender.js +6 -6
- package/dist/esm/DForm/index.js +6 -6
- package/dist/esm/DForm/index.less +50 -50
- package/dist/esm/DInput/index.js +6 -6
- package/dist/esm/DModal/styles/index.less +33 -33
- package/dist/esm/DRangePicker/index.less +30 -30
- package/dist/esm/DSelect/index.d.ts +1 -1
- package/dist/esm/DTable/index.d.ts +7 -3
- package/dist/esm/DTable/index.js +53 -19
- package/dist/esm/DTable/index.less +13 -23
- package/dist/esm/DUpload/helper.js +47 -47
- package/dist/esm/DUpload/index.js +6 -6
- package/dist/esm/DynamicFormItem/index.less +28 -28
- package/dist/esm/IPAddress/index.less +75 -75
- package/dist/esm/InfiniteScrollList/index.d.ts +1 -1
- package/dist/esm/InfiniteScrollList/index.js +3 -3
- package/dist/esm/InfiniteScrollList/styles/index.less +24 -24
- package/dist/esm/Loading/styles/index.less +37 -37
- package/dist/esm/LoginForm/index.js +1 -0
- package/dist/esm/ModalTable/index.d.ts +3 -0
- package/dist/esm/ModalTable/index.js +95 -0
- package/dist/esm/ModalTable/interface.d.ts +23 -0
- package/dist/esm/ModalTable/interface.js +1 -0
- package/dist/esm/OrgTree/index.less +15 -15
- package/dist/esm/RCropper/index.js +5 -5
- package/dist/esm/RCropper/styles/toolbar.less +25 -25
- package/dist/esm/SignaturePad/style/index.less +47 -47
- package/dist/esm/TypewriterText/index.less +29 -29
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +1 -0
- package/dist/umd/pcloud-components.min.css +1 -1
- package/dist/umd/pcloud-components.min.js +1 -1
- package/package.json +133 -133
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
@import '../commonStyle/index.less';
|
|
2
|
-
|
|
3
|
-
@context-menu-bg: #ffffff;
|
|
4
|
-
@context-menu-border-color: #f0f0f0;
|
|
5
|
-
@context-menu-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
6
|
-
@border-radius-base: 1px;
|
|
7
|
-
|
|
8
|
-
.@{prefix}-context-menu {
|
|
9
|
-
background: @context-menu-bg;
|
|
10
|
-
border-radius: @border-radius-base;
|
|
11
|
-
border: 1px solid @context-menu-border-color;
|
|
12
|
-
box-shadow: @context-menu-shadow;
|
|
13
|
-
padding: 4px 0;
|
|
14
|
-
min-width: 120px;
|
|
15
|
-
opacity: 0;
|
|
16
|
-
transform: scale(0.8);
|
|
17
|
-
transform-origin: top left;
|
|
18
|
-
animation: contextmenu-show 0.2s ease-out forwards;
|
|
19
|
-
|
|
20
|
-
&-item {
|
|
21
|
-
padding: 5px 12px;
|
|
22
|
-
cursor: pointer;
|
|
23
|
-
user-select: none;
|
|
24
|
-
transition: all 0.3s;
|
|
25
|
-
display: flex;
|
|
26
|
-
align-items: center;
|
|
27
|
-
gap: 8px;
|
|
28
|
-
color: rgba(0, 0, 0, 88%);
|
|
29
|
-
|
|
30
|
-
&:hover {
|
|
31
|
-
background: rgba(0, 0, 0, 4%);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&-disabled {
|
|
35
|
-
color: rgba(0, 0, 0, 25%);
|
|
36
|
-
cursor: not-allowed;
|
|
37
|
-
|
|
38
|
-
&:hover {
|
|
39
|
-
background: none;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&-divider {
|
|
44
|
-
height: 1px;
|
|
45
|
-
margin: 4px 0;
|
|
46
|
-
background: #f0f0f0;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@keyframes contextmenu-show {
|
|
52
|
-
0% {
|
|
53
|
-
opacity: 0;
|
|
54
|
-
transform: scale(0.8);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
100% {
|
|
58
|
-
opacity: 1;
|
|
59
|
-
transform: scale(1);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
1
|
+
@import '../commonStyle/index.less';
|
|
2
|
+
|
|
3
|
+
@context-menu-bg: #ffffff;
|
|
4
|
+
@context-menu-border-color: #f0f0f0;
|
|
5
|
+
@context-menu-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
6
|
+
@border-radius-base: 1px;
|
|
7
|
+
|
|
8
|
+
.@{prefix}-context-menu {
|
|
9
|
+
background: @context-menu-bg;
|
|
10
|
+
border-radius: @border-radius-base;
|
|
11
|
+
border: 1px solid @context-menu-border-color;
|
|
12
|
+
box-shadow: @context-menu-shadow;
|
|
13
|
+
padding: 4px 0;
|
|
14
|
+
min-width: 120px;
|
|
15
|
+
opacity: 0;
|
|
16
|
+
transform: scale(0.8);
|
|
17
|
+
transform-origin: top left;
|
|
18
|
+
animation: contextmenu-show 0.2s ease-out forwards;
|
|
19
|
+
|
|
20
|
+
&-item {
|
|
21
|
+
padding: 5px 12px;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
user-select: none;
|
|
24
|
+
transition: all 0.3s;
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: 8px;
|
|
28
|
+
color: rgba(0, 0, 0, 88%);
|
|
29
|
+
|
|
30
|
+
&:hover {
|
|
31
|
+
background: rgba(0, 0, 0, 4%);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&-disabled {
|
|
35
|
+
color: rgba(0, 0, 0, 25%);
|
|
36
|
+
cursor: not-allowed;
|
|
37
|
+
|
|
38
|
+
&:hover {
|
|
39
|
+
background: none;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&-divider {
|
|
44
|
+
height: 1px;
|
|
45
|
+
margin: 4px 0;
|
|
46
|
+
background: #f0f0f0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@keyframes contextmenu-show {
|
|
52
|
+
0% {
|
|
53
|
+
opacity: 0;
|
|
54
|
+
transform: scale(0.8);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
100% {
|
|
58
|
+
opacity: 1;
|
|
59
|
+
transform: scale(1);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -11,7 +11,7 @@ export type DCascaderProps = Omit<CascaderProps<any>, 'options' | 'loadData' | '
|
|
|
11
11
|
/** antd的loading属性,是否显示加载中:传入数字表示延迟加载,单位毫秒,0等同于false */
|
|
12
12
|
loading?: boolean | number;
|
|
13
13
|
};
|
|
14
|
-
declare const DCascader: React.ForwardRefExoticComponent<Omit<CascaderProps<any>, "
|
|
14
|
+
declare const DCascader: React.ForwardRefExoticComponent<Omit<CascaderProps<any>, "loading" | "options" | "loadData"> & {
|
|
15
15
|
/** antd的options属性,同onSearch属性,可以是一个options数组,或一个返回等价options数组的promise */
|
|
16
16
|
options?: DefaultOptionType[] | ((value?: string, option?: DefaultOptionType, options?: DefaultOptionType[]) => Promise<DefaultOptionType[]>) | undefined;
|
|
17
17
|
/** antd的loadData属性,动态加载子级列表数据,默认使用options所提供的方法,如果传入null,则表示不进行动态加载,该方法要求返回一个options数组或与其等价的Promise */
|
|
@@ -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';
|
package/dist/esm/DForm/index.js
CHANGED
|
@@ -2,12 +2,12 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
var _excluded = ["className", "defaultItemProps", "items", "children", "layout", "autoComplete"];
|
|
5
|
-
/*
|
|
6
|
-
* @Author : wangfeihu
|
|
7
|
-
* @Date : 2023-06-02 09:29:11
|
|
8
|
-
* @LastEditors : wangfeihu
|
|
9
|
-
* @LastEditTime : 2023-08-16 17:44:33
|
|
10
|
-
* @Description : 基于antd的Form组件
|
|
5
|
+
/*
|
|
6
|
+
* @Author : wangfeihu
|
|
7
|
+
* @Date : 2023-06-02 09:29:11
|
|
8
|
+
* @LastEditors : wangfeihu
|
|
9
|
+
* @LastEditTime : 2023-08-16 17:44:33
|
|
10
|
+
* @Description : 基于antd的Form组件
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import React, { forwardRef, useContext, useState, useMemo, useEffect, useImperativeHandle } from 'react';
|
|
@@ -1,50 +1,50 @@
|
|
|
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
|
-
.ant-input-number,
|
|
11
|
-
.ant-picker {
|
|
12
|
-
width: 100%;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.@{prefix}-form.ant-form-vertical .form-wrapper > .ant-form-item:last-child,
|
|
17
|
-
.@{prefix}-form.ant-form-horizontal .form-wrapper > .ant-form-item:last-child {
|
|
18
|
-
margin-bottom: 0;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.@{prefix}-form.ant-form-horizontal .ant-form-item-label {
|
|
22
|
-
min-width: 80px;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.@{prefix}-form.ant-form-inline .form-wrapper,
|
|
26
|
-
.@{prefix}-form.ant-form-inline.inlineVertical .form-wrapper {
|
|
27
|
-
display: flex;
|
|
28
|
-
flex-wrap: wrap;
|
|
29
|
-
align-items: flex-end;
|
|
30
|
-
height: min-content;
|
|
31
|
-
flex: 1;
|
|
32
|
-
|
|
33
|
-
> .ant-form-item {
|
|
34
|
-
padding-right: 16px;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.@{prefix}-form.ant-form-inline.inlineVertical {
|
|
39
|
-
.ant-form-item-row {
|
|
40
|
-
flex-direction: column;
|
|
41
|
-
|
|
42
|
-
.ant-form-item-label {
|
|
43
|
-
text-align: left;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.grid-row {
|
|
48
|
-
flex: 1;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
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
|
+
.ant-input-number,
|
|
11
|
+
.ant-picker {
|
|
12
|
+
width: 100%;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.@{prefix}-form.ant-form-vertical .form-wrapper > .ant-form-item:last-child,
|
|
17
|
+
.@{prefix}-form.ant-form-horizontal .form-wrapper > .ant-form-item:last-child {
|
|
18
|
+
margin-bottom: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.@{prefix}-form.ant-form-horizontal .ant-form-item-label {
|
|
22
|
+
min-width: 80px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.@{prefix}-form.ant-form-inline .form-wrapper,
|
|
26
|
+
.@{prefix}-form.ant-form-inline.inlineVertical .form-wrapper {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-wrap: wrap;
|
|
29
|
+
align-items: flex-end;
|
|
30
|
+
height: min-content;
|
|
31
|
+
flex: 1;
|
|
32
|
+
|
|
33
|
+
> .ant-form-item {
|
|
34
|
+
padding-right: 16px;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.@{prefix}-form.ant-form-inline.inlineVertical {
|
|
39
|
+
.ant-form-item-row {
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
|
|
42
|
+
.ant-form-item-label {
|
|
43
|
+
text-align: left;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.grid-row {
|
|
48
|
+
flex: 1;
|
|
49
|
+
}
|
|
50
|
+
}
|
package/dist/esm/DInput/index.js
CHANGED
|
@@ -2,12 +2,12 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["className", "onChange", "onCompositionStart", "onCompositionEnd", "value", "debounce", "enableCompose"];
|
|
5
|
-
/*
|
|
6
|
-
* @Author : wangfeihu
|
|
7
|
-
* @Date : 2023-05-16 10:08:26
|
|
8
|
-
* @LastEditors : wangfeihu
|
|
9
|
-
* @LastEditTime : 2023-08-16 16:48:52
|
|
10
|
-
* @Description : 基于antd的Input组件
|
|
5
|
+
/*
|
|
6
|
+
* @Author : wangfeihu
|
|
7
|
+
* @Date : 2023-05-16 10:08:26
|
|
8
|
+
* @LastEditors : wangfeihu
|
|
9
|
+
* @LastEditTime : 2023-08-16 16:48:52
|
|
10
|
+
* @Description : 基于antd的Input组件
|
|
11
11
|
*/
|
|
12
12
|
import React, { useRef, forwardRef, useState, useEffect, useContext, useCallback } from 'react';
|
|
13
13
|
import { Input } from 'antd';
|
|
@@ -1,33 +1,33 @@
|
|
|
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}-fixed-modal-container {
|
|
24
|
-
.ant-modal-wrap {
|
|
25
|
-
position: fixed;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.@{prefix}-relative-modal-container {
|
|
30
|
-
.ant-modal-wrap {
|
|
31
|
-
position: absolute;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
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}-fixed-modal-container {
|
|
24
|
+
.ant-modal-wrap {
|
|
25
|
+
position: fixed;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.@{prefix}-relative-modal-container {
|
|
30
|
+
.ant-modal-wrap {
|
|
31
|
+
position: absolute;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
@import '../commonStyle/index.less';
|
|
2
|
-
|
|
3
|
-
.@{prefix}-range-picker {
|
|
4
|
-
&-right,
|
|
5
|
-
&-left {
|
|
6
|
-
.ant-picker-panel-container {
|
|
7
|
-
display: flex;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.ant-picker-footer {
|
|
11
|
-
min-width: 40px;
|
|
12
|
-
flex: 1;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.ant-picker-ranges {
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.ant-picker-preset .ant-tag {
|
|
21
|
-
margin-right: 0;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&-left {
|
|
26
|
-
.ant-picker-panel-container {
|
|
27
|
-
flex-direction: row-reverse;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
1
|
+
@import '../commonStyle/index.less';
|
|
2
|
+
|
|
3
|
+
.@{prefix}-range-picker {
|
|
4
|
+
&-right,
|
|
5
|
+
&-left {
|
|
6
|
+
.ant-picker-panel-container {
|
|
7
|
+
display: flex;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ant-picker-footer {
|
|
11
|
+
min-width: 40px;
|
|
12
|
+
flex: 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ant-picker-ranges {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ant-picker-preset .ant-tag {
|
|
21
|
+
margin-right: 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&-left {
|
|
26
|
+
.ant-picker-panel-container {
|
|
27
|
+
flex-direction: row-reverse;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -11,7 +11,7 @@ export type DSelectProps = Omit<SelectProps, 'options' | 'onSearch' | 'loading'>
|
|
|
11
11
|
/** 是否开启防抖: true表示800毫秒,true表示默认值,false或0表示不开启 */
|
|
12
12
|
debounce?: boolean | number;
|
|
13
13
|
};
|
|
14
|
-
declare const DSelect: React.ForwardRefExoticComponent<Omit<SelectProps<any, DefaultOptionType>, "
|
|
14
|
+
declare const DSelect: React.ForwardRefExoticComponent<Omit<SelectProps<any, DefaultOptionType>, "loading" | "options" | "onSearch"> & {
|
|
15
15
|
/** antd的onSearch属性,onSearch有效时showSearch自动为true */
|
|
16
16
|
onSearch?: ((params?: any) => Promise<DefaultOptionType[] | any[]>) | undefined;
|
|
17
17
|
/** antd的options属性,可以是一个options数组,或一个返回等价options数组的promise */
|
|
@@ -28,16 +28,18 @@ export type DTableProps = Omit<TableProps<any>, 'columns'> & {
|
|
|
28
28
|
extraParams?: TableParamsProps;
|
|
29
29
|
/** 表格列配置 */
|
|
30
30
|
columns?: DColumnType[];
|
|
31
|
+
/** 自动显示序号列 */
|
|
32
|
+
autoSerialNumber?: boolean;
|
|
31
33
|
};
|
|
32
34
|
export type DTableRef = {
|
|
33
35
|
/** 手动刷新列表方法
|
|
34
36
|
* @param params 可选的新参数,如果不传则使用现有参数
|
|
35
37
|
*/
|
|
36
|
-
refresh: (
|
|
38
|
+
refresh: (_params?: TableParamsProps) => void;
|
|
37
39
|
/** 手动刷新列表到指定页数方法
|
|
38
40
|
* @param page 指定页数
|
|
39
41
|
*/
|
|
40
|
-
refreshToPage: (
|
|
42
|
+
refreshToPage: (_page: number) => void;
|
|
41
43
|
/** 获取当前分页信息 */
|
|
42
44
|
getPaginationState: () => {
|
|
43
45
|
current: number;
|
|
@@ -58,5 +60,7 @@ declare const DTable: React.ForwardRefExoticComponent<Omit<TableProps<any>, "col
|
|
|
58
60
|
extraParams?: TableParamsProps | undefined;
|
|
59
61
|
/** 表格列配置 */
|
|
60
62
|
columns?: DColumnType[] | undefined;
|
|
61
|
-
|
|
63
|
+
/** 自动显示序号列 */
|
|
64
|
+
autoSerialNumber?: boolean | undefined;
|
|
65
|
+
} & React.RefAttributes<DTableRef>>;
|
|
62
66
|
export default DTable;
|
package/dist/esm/DTable/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
-
var _excluded = ["loadMore", "defaultColumnProps", "actionColumn", "showErrorMsg", "extraParams", "dataSource", "rowKey", "scroll", "className", "pagination", "columns", "loading"];
|
|
5
|
-
/*
|
|
6
|
-
* @Author : wangfeihu
|
|
7
|
-
* @Date : 2023-05-09 15:04:48
|
|
8
|
-
* @LastEditors : wangfeihu
|
|
9
|
-
* @LastEditTime : 2023-08-16 16:45:15
|
|
10
|
-
* @Description : 基于antd的Table组件
|
|
4
|
+
var _excluded = ["loadMore", "defaultColumnProps", "actionColumn", "showErrorMsg", "extraParams", "dataSource", "rowKey", "scroll", "className", "pagination", "columns", "loading", "autoSerialNumber"];
|
|
5
|
+
/*
|
|
6
|
+
* @Author : wangfeihu
|
|
7
|
+
* @Date : 2023-05-09 15:04:48
|
|
8
|
+
* @LastEditors : wangfeihu
|
|
9
|
+
* @LastEditTime : 2023-08-16 16:45:15
|
|
10
|
+
* @Description : 基于antd的Table组件
|
|
11
11
|
*/
|
|
12
12
|
import React, { forwardRef, useEffect, useRef, useState, useContext, useMemo, useImperativeHandle, useCallback } from 'react';
|
|
13
13
|
import { message, Table } from 'antd';
|
|
@@ -50,6 +50,28 @@ function getColumns(columns, defaultColumnProps) {
|
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
// 序号列
|
|
54
|
+
function getSerialNumberColumnProps(defaultColumnProps, params) {
|
|
55
|
+
var defaultProps = {
|
|
56
|
+
width: 80,
|
|
57
|
+
title: '序号',
|
|
58
|
+
dataIndex: 'serialNumber',
|
|
59
|
+
align: 'center'
|
|
60
|
+
};
|
|
61
|
+
return _objectSpread(_objectSpread(_objectSpread({}, defaultColumnProps), defaultProps), {}, {
|
|
62
|
+
render: function render(_, __, index) {
|
|
63
|
+
if (params) {
|
|
64
|
+
var size = params.size,
|
|
65
|
+
current = params.current;
|
|
66
|
+
return /*#__PURE__*/_jsx("div", {
|
|
67
|
+
children: "".concat((current - 1) * size + (index + 1))
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return index + 1;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
53
75
|
// 操作列
|
|
54
76
|
function getActionColumnProps(props, defaultColumnProps) {
|
|
55
77
|
var defaultProps = {
|
|
@@ -90,6 +112,8 @@ function InternalTable(props, ref) {
|
|
|
90
112
|
pagination = props.pagination,
|
|
91
113
|
columns = props.columns,
|
|
92
114
|
loading = props.loading,
|
|
115
|
+
_props$autoSerialNumb = props.autoSerialNumber,
|
|
116
|
+
autoSerialNumber = _props$autoSerialNumb === void 0 ? false : _props$autoSerialNumb,
|
|
93
117
|
otherProps = _objectWithoutProperties(props, _excluded);
|
|
94
118
|
var _useContext = useContext(ConfigContext),
|
|
95
119
|
getPrefixCls = _useContext.getPrefixCls;
|
|
@@ -109,20 +133,22 @@ function InternalTable(props, ref) {
|
|
|
109
133
|
tableParams = _useState4[0],
|
|
110
134
|
setTableParams = _useState4[1];
|
|
111
135
|
|
|
112
|
-
//
|
|
113
|
-
var extraHeight = useMemo(function () {
|
|
114
|
-
return _pagination['hideOnSinglePage'] ? 0 : 56;
|
|
115
|
-
}, [_pagination]);
|
|
116
|
-
|
|
117
|
-
// 默认垂直滚动高度为 calc(100% - 56px),其中56px为表格header高度,如需修改,需要自行覆盖styles中的相关样式
|
|
136
|
+
// 默认垂直滚动高度为 calc(100% - 56px),其中56px为表格header默认高度
|
|
118
137
|
var _scroll = scroll ? _objectSpread({
|
|
119
|
-
y: "calc(100% -
|
|
138
|
+
y: "calc(100% - 56px)"
|
|
120
139
|
}, scroll) : {
|
|
121
|
-
y: "calc(100% -
|
|
140
|
+
y: "calc(100% - 56px)"
|
|
122
141
|
};
|
|
123
142
|
|
|
124
143
|
// 合并列属性
|
|
125
144
|
var _columns = getColumns(columns, defaultColumnProps);
|
|
145
|
+
var serialNumberColumn = useMemo(function () {
|
|
146
|
+
return getSerialNumberColumnProps(defaultColumnProps, {
|
|
147
|
+
current: tableParams.current,
|
|
148
|
+
size: tableParams.size
|
|
149
|
+
});
|
|
150
|
+
}, [defaultColumnProps, tableParams.current, tableParams.size]);
|
|
151
|
+
if (_columns instanceof Array && autoSerialNumber) _columns.unshift(serialNumberColumn);
|
|
126
152
|
|
|
127
153
|
// 加入操作列
|
|
128
154
|
var _actionColumn = actionColumn ? getActionColumnProps(actionColumn, defaultColumnProps) : undefined;
|
|
@@ -148,11 +174,19 @@ function InternalTable(props, ref) {
|
|
|
148
174
|
setTableSource(_objectSpread(_objectSpread({}, tableSource), {}, {
|
|
149
175
|
loading: true
|
|
150
176
|
}));
|
|
151
|
-
var
|
|
152
|
-
|
|
177
|
+
var filteredParams = {};
|
|
178
|
+
Object.entries(_objectSpread(_objectSpread({}, getTablePage(_pagination)), params)).forEach(function (_ref2) {
|
|
179
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
180
|
+
key = _ref3[0],
|
|
181
|
+
value = _ref3[1];
|
|
182
|
+
if (value !== undefined && value !== null) {
|
|
183
|
+
filteredParams[key] = value;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
var paramsString = JSON.stringify(filteredParams);
|
|
153
187
|
loadingParamsRef.current = paramsString;
|
|
154
|
-
setTableParams(
|
|
155
|
-
loadMore(
|
|
188
|
+
setTableParams(filteredParams);
|
|
189
|
+
loadMore(filteredParams, tableSource.records).then(function (response) {
|
|
156
190
|
if (loadingParamsRef.current === paramsString) {
|
|
157
191
|
var _response$total = response.total,
|
|
158
192
|
total = _response$total === void 0 ? 0 : _response$total,
|
|
@@ -4,28 +4,24 @@
|
|
|
4
4
|
.ant-spin-nested-loading,
|
|
5
5
|
.ant-spin-container,
|
|
6
6
|
.ant-table-container,
|
|
7
|
-
.ant-table {
|
|
8
|
-
width: 100%;
|
|
7
|
+
.ant-table-content {
|
|
9
8
|
height: 100%;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
// background-color: #2e404d;
|
|
19
|
-
// }
|
|
11
|
+
.ant-spin-container,
|
|
12
|
+
.ant-table-container {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
}
|
|
20
17
|
|
|
21
|
-
.ant-table
|
|
22
|
-
|
|
23
|
-
overflow
|
|
24
|
-
|
|
25
|
-
max-width: 100%;
|
|
26
|
-
min-height: calc(100% - 56px);
|
|
27
|
-
max-height: calc(100% - 56px);
|
|
18
|
+
.ant-table {
|
|
19
|
+
flex: 1;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
28
22
|
|
|
23
|
+
.ant-table-body {
|
|
24
|
+
overflow-y: auto;
|
|
29
25
|
// 表内单元格不省略
|
|
30
26
|
.ant-table-tbody > tr > td.ant-table-cell.d-table-cell-wrap {
|
|
31
27
|
white-space: initial;
|
|
@@ -62,10 +58,4 @@
|
|
|
62
58
|
color: #40a9ff;
|
|
63
59
|
font-weight: bold;
|
|
64
60
|
}
|
|
65
|
-
|
|
66
|
-
&.height-on-page {
|
|
67
|
-
.ant-table {
|
|
68
|
-
height: calc(100% - 56px);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
61
|
}
|