@pointcloud/pcloud-components 0.1.36 → 0.1.38

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.
@@ -1,146 +1,146 @@
1
- @import '../../commonStyle/index.less';
2
-
3
- .@{prefix}-search-filter {
4
- align-items: center;
5
- width: 100%;
6
- margin-top: 10px;
7
- background-color: #fff;
8
-
9
- span.ant-collapse-header-text {
10
- display: inline-block;
11
- width: 100%;
12
- cursor: auto !important;
13
- }
14
-
15
- .ant-collapse-content-box {
16
- padding: 0;
17
- }
18
-
19
- .search-header {
20
- display: flex;
21
- width: 100%;
22
-
23
- .left {
24
- max-width: 100%;
25
- overflow: hidden;
26
- white-space: no-wrap;
27
- text-overflow: ellipsis;
28
-
29
- :global {
30
- .ant-radio-wrapper:first-child {
31
- border-left: 1px solid #d9d9d9;
32
- border-radius: 5px 0 0 5px;
33
- }
34
-
35
- .ant-radio-wrapper:last-child {
36
- border-radius: 0 5px 5px 0;
37
- }
38
-
39
- .ant-radio-wrapper {
40
- margin-right: 0;
41
- padding: 4px 6px;
42
- border: 1px solid #d9d9d9;
43
- border-top-width: 1px;
44
- border-left: 1px solid #fff;
45
- border-left-width: 1px;
46
-
47
- .ant-radio {
48
- display: none;
49
- }
50
- }
51
-
52
- .ant-radio-wrapper:hover {
53
- color: #1890ff;
54
- }
55
-
56
- .ant-radio-wrapper-checked {
57
- z-index: 1;
58
- color: #1890ff;
59
- background: #fff;
60
- border: 1px solid #1890ff;
61
- border-left: 1px solid #1890ff !important;
62
- }
63
- }
64
- }
65
-
66
- .right {
67
- display: flex;
68
- justify-content: center;
69
-
70
- .input {
71
- width: 200px;
72
- border-radius: 4px;
73
- }
74
-
75
- .button {
76
- margin-left: 10px;
77
- color: #fff;
78
- background-color: #ff7e00;
79
- border-radius: 4px;
80
-
81
- &:active,
82
- &:focus,
83
- &:hover {
84
- border-color: transparent;
85
- }
86
-
87
- .icon {
88
- margin-left: 8px;
89
- transition: transform 0.4s;
90
-
91
- &.down {
92
- transform: rotateZ(180deg);
93
- }
94
-
95
- &.up {
96
- transform: rotateZ(0deg);
97
- }
98
- }
99
- }
100
- }
101
- }
102
-
103
- .title {
104
- display: flex;
105
- align-items: center;
106
- margin: 0 10px;
107
- padding-bottom: 10px;
108
- font-weight: bold;
109
- border-bottom: 1px solid #f0f0f0;
110
-
111
- span.icon {
112
- width: 4px;
113
- height: 16px;
114
- margin-right: 6px;
115
- background-color: #ff7e00;
116
- border-radius: 2px;
117
- }
118
- }
119
-
120
- .search-content {
121
- .filter-row {
122
- display: flex;
123
- flex-wrap: wrap;
124
- width: 100%;
125
- padding: 10px;
126
- }
127
-
128
- .filter-col {
129
- height: 30px;
130
- margin-bottom: 10px;
131
- line-height: 30px;
132
- }
133
-
134
- .filter-col .ant-picker {
135
- width: 100%;
136
- }
137
-
138
- .search-btn {
139
- justify-content: center;
140
-
141
- > button {
142
- margin: 0 5px;
143
- }
144
- }
145
- }
146
- }
1
+ @import '../../commonStyle/index.less';
2
+
3
+ .@{prefix}-search-filter {
4
+ align-items: center;
5
+ width: 100%;
6
+ margin-top: 10px;
7
+ background-color: #fff;
8
+
9
+ span.ant-collapse-header-text {
10
+ display: inline-block;
11
+ width: 100%;
12
+ cursor: auto !important;
13
+ }
14
+
15
+ .ant-collapse-content-box {
16
+ padding: 0;
17
+ }
18
+
19
+ .search-header {
20
+ display: flex;
21
+ width: 100%;
22
+
23
+ .left {
24
+ max-width: 100%;
25
+ overflow: hidden;
26
+ white-space: no-wrap;
27
+ text-overflow: ellipsis;
28
+
29
+ :global {
30
+ .ant-radio-wrapper:first-child {
31
+ border-left: 1px solid #d9d9d9;
32
+ border-radius: 5px 0 0 5px;
33
+ }
34
+
35
+ .ant-radio-wrapper:last-child {
36
+ border-radius: 0 5px 5px 0;
37
+ }
38
+
39
+ .ant-radio-wrapper {
40
+ margin-right: 0;
41
+ padding: 4px 6px;
42
+ border: 1px solid #d9d9d9;
43
+ border-top-width: 1px;
44
+ border-left: 1px solid #fff;
45
+ border-left-width: 1px;
46
+
47
+ .ant-radio {
48
+ display: none;
49
+ }
50
+ }
51
+
52
+ .ant-radio-wrapper:hover {
53
+ color: #1890ff;
54
+ }
55
+
56
+ .ant-radio-wrapper-checked {
57
+ z-index: 1;
58
+ color: #1890ff;
59
+ background: #fff;
60
+ border: 1px solid #1890ff;
61
+ border-left: 1px solid #1890ff !important;
62
+ }
63
+ }
64
+ }
65
+
66
+ .right {
67
+ display: flex;
68
+ justify-content: center;
69
+
70
+ .input {
71
+ width: 200px;
72
+ border-radius: 4px;
73
+ }
74
+
75
+ .button {
76
+ margin-left: 10px;
77
+ color: #fff;
78
+ background-color: #ff7e00;
79
+ border-radius: 4px;
80
+
81
+ &:active,
82
+ &:focus,
83
+ &:hover {
84
+ border-color: transparent;
85
+ }
86
+
87
+ .icon {
88
+ margin-left: 8px;
89
+ transition: transform 0.4s;
90
+
91
+ &.down {
92
+ transform: rotateZ(180deg);
93
+ }
94
+
95
+ &.up {
96
+ transform: rotateZ(0deg);
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }
102
+
103
+ .title {
104
+ display: flex;
105
+ align-items: center;
106
+ margin: 0 10px;
107
+ padding-bottom: 10px;
108
+ font-weight: bold;
109
+ border-bottom: 1px solid #f0f0f0;
110
+
111
+ span.icon {
112
+ width: 4px;
113
+ height: 16px;
114
+ margin-right: 6px;
115
+ background-color: #ff7e00;
116
+ border-radius: 2px;
117
+ }
118
+ }
119
+
120
+ .search-content {
121
+ .filter-row {
122
+ display: flex;
123
+ flex-wrap: wrap;
124
+ width: 100%;
125
+ padding: 10px;
126
+ }
127
+
128
+ .filter-col {
129
+ height: 30px;
130
+ margin-bottom: 10px;
131
+ line-height: 30px;
132
+ }
133
+
134
+ .filter-col .ant-picker {
135
+ width: 100%;
136
+ }
137
+
138
+ .search-btn {
139
+ justify-content: center;
140
+
141
+ > button {
142
+ margin: 0 5px;
143
+ }
144
+ }
145
+ }
146
+ }
@@ -4,6 +4,7 @@
4
4
  height: 100%;
5
5
  display: flex;
6
6
  flex-direction: column;
7
+ overflow: hidden;
7
8
 
8
9
  &.fullscreen {
9
10
  position: fixed;
@@ -134,6 +135,7 @@
134
135
 
135
136
  &-table {
136
137
  flex: 1;
138
+ overflow: hidden;
137
139
  }
138
140
 
139
141
  &-modalform-view {
@@ -10,12 +10,8 @@ import { DTreeSelectProps } from '../../DTreeSelect';
10
10
  import { DUploadProps } from '../../DUpload';
11
11
  import { IPAddressProps } from '../../IPAddress';
12
12
  import { DRangePickerProps } from '../../DRangePicker/interface';
13
- export type DItemBaseProps = {
14
- /** label标签文本,同antd Form.Item的label,只能是string */
15
- label?: string;
16
- /** name标签文本,同antd Form.Item的name */
17
- name?: string | number | (string | number)[];
18
- /** Form.Item 的其他属性 */
13
+ export type RenderType = 'custom' | 'dInput' | 'ipAddress' | 'input' | 'textArea' | 'password' | 'inputNumber' | 'autoComplete' | 'dSelect' | 'select' | 'dCascader' | 'cascader' | 'dTreeSelect' | 'treeSelect' | 'datePicker' | 'dRangePicker' | 'timePicker' | 'rangePicker' | 'mentions' | 'checkbox' | 'checkboxGroup' | 'radio' | 'radioGroup' | 'rate' | 'slider' | 'switch' | 'transfer' | 'upload' | 'dUpload' | 'button' | 'divider';
14
+ export type DItemBaseProps = Pick<FormItemProps, 'label' | 'name'> & {
19
15
  formItemProps?: FormItemProps & {
20
16
  grid?: Omit<ColProps, 'prefixCls'>;
21
17
  };
@@ -1,27 +1,27 @@
1
- @import '../../commonStyle/index.less';
2
-
3
- .@{prefix}-modal-container {
4
- .ant-modal-wrap {
5
- .ant-modal {
6
- max-width: unset;
7
- height: 100%;
8
-
9
- .ant-modal-content {
10
- width: 100%;
11
- height: 100%;
12
- }
13
- }
14
- }
15
- }
16
-
17
- .@{prefix}-absolute-modal-container {
18
- .ant-modal-wrap {
19
- position: fixed;
20
- }
21
- }
22
-
23
- .@{prefix}-relative-modal-container {
24
- .ant-modal-wrap {
25
- position: absolute;
26
- }
27
- }
1
+ @import '../../commonStyle/index.less';
2
+
3
+ .@{prefix}-modal-container {
4
+ .ant-modal-wrap {
5
+ .ant-modal {
6
+ max-width: unset;
7
+ height: 100%;
8
+
9
+ .ant-modal-content {
10
+ width: 100%;
11
+ height: 100%;
12
+ }
13
+ }
14
+ }
15
+ }
16
+
17
+ .@{prefix}-absolute-modal-container {
18
+ .ant-modal-wrap {
19
+ position: fixed;
20
+ }
21
+ }
22
+
23
+ .@{prefix}-relative-modal-container {
24
+ .ant-modal-wrap {
25
+ position: absolute;
26
+ }
27
+ }
@@ -109,16 +109,11 @@ function InternalTable(props, ref) {
109
109
  tableParams = _useState4[0],
110
110
  setTableParams = _useState4[1];
111
111
 
112
- // 隐藏单个分页时, 高度充满
113
- var extraHeight = useMemo(function () {
114
- return _pagination['hideOnSinglePage'] ? 0 : 56;
115
- }, [_pagination]);
116
-
117
- // 默认垂直滚动高度为 calc(100% - 56px),其中56px为表格header高度,如需修改,需要自行覆盖styles中的相关样式
112
+ // 默认垂直滚动高度为 calc(100% - 56px),其中56px为表格header默认高度
118
113
  var _scroll = scroll ? _objectSpread({
119
- y: "calc(100% - ".concat(extraHeight, "px)")
114
+ y: "calc(100% - 56px)"
120
115
  }, scroll) : {
121
- y: "calc(100% - ".concat(extraHeight, "px)")
116
+ y: "calc(100% - 56px)"
122
117
  };
123
118
 
124
119
  // 合并列属性
@@ -1,71 +1,61 @@
1
- @import '../commonStyle/index.less';
2
-
3
- .@{prefix}-table {
4
- .ant-spin-nested-loading,
5
- .ant-spin-container,
6
- .ant-table-container,
7
- .ant-table {
8
- width: 100%;
9
- height: 100%;
10
- }
11
-
12
- // 隐藏表头最后一个滚动样式单元格
13
- // .ant-table-thead .ant-table-cell-scrollbar {
14
- // position: absolute;
15
- // top: -1px;
16
- // border: none;
17
- // box-shadow: none;
18
- // background-color: #2e404d;
19
- // }
20
-
21
- .ant-table-body {
22
- position: absolute;
23
- overflow-y: auto !important;
24
- min-width: 100%;
25
- max-width: 100%;
26
- min-height: calc(100% - 56px);
27
- max-height: calc(100% - 56px);
28
-
29
- // 表内单元格不省略
30
- .ant-table-tbody > tr > td.ant-table-cell.d-table-cell-wrap {
31
- white-space: initial;
32
- }
33
-
34
- // x轨道的宽度和y轨道的高度
35
- &::-webkit-scrollbar {
36
- width: 4px;
37
- height: 8px;
38
- }
39
-
40
- // 轨道拖动部分的背景颜色
41
- &::-webkit-scrollbar-thumb {
42
- background-color: #0084ff;
43
- }
44
-
45
- // 轨道背景颜色
46
- &::-webkit-scrollbar-track {
47
- background-color: #f1f1f1;
48
- border-radius: 2px;
49
- }
50
-
51
- // x、y两条轨道的交叉处
52
- &::-webkit-scrollbar-corner {
53
- background-color: #f1f1f1;
54
- }
55
- }
56
-
57
- .ant-spin-nested-loading > div > .ant-spin {
58
- max-height: initial;
59
- }
60
-
61
- .ant-pagination-total-text span {
62
- color: #40a9ff;
63
- font-weight: bold;
64
- }
65
-
66
- &.height-on-page {
67
- .ant-table {
68
- height: calc(100% - 56px);
69
- }
70
- }
71
- }
1
+ @import '../commonStyle/index.less';
2
+
3
+ .@{prefix}-table {
4
+ .ant-spin-nested-loading,
5
+ .ant-spin-container,
6
+ .ant-table-container,
7
+ .ant-table-content {
8
+ height: 100%;
9
+ }
10
+
11
+ .ant-spin-container,
12
+ .ant-table-container {
13
+ display: flex;
14
+ flex-direction: column;
15
+ overflow: hidden;
16
+ }
17
+
18
+ .ant-table {
19
+ flex: 1;
20
+ overflow: hidden;
21
+ }
22
+
23
+ .ant-table-body {
24
+ overflow-y: auto;
25
+ // 表内单元格不省略
26
+ .ant-table-tbody > tr > td.ant-table-cell.d-table-cell-wrap {
27
+ white-space: initial;
28
+ }
29
+
30
+ // x轨道的宽度和y轨道的高度
31
+ &::-webkit-scrollbar {
32
+ width: 4px;
33
+ height: 8px;
34
+ }
35
+
36
+ // 轨道拖动部分的背景颜色
37
+ &::-webkit-scrollbar-thumb {
38
+ background-color: #0084ff;
39
+ }
40
+
41
+ // 轨道背景颜色
42
+ &::-webkit-scrollbar-track {
43
+ background-color: #f1f1f1;
44
+ border-radius: 2px;
45
+ }
46
+
47
+ // x、y两条轨道的交叉处
48
+ &::-webkit-scrollbar-corner {
49
+ background-color: #f1f1f1;
50
+ }
51
+ }
52
+
53
+ .ant-spin-nested-loading > div > .ant-spin {
54
+ max-height: initial;
55
+ }
56
+
57
+ .ant-pagination-total-text span {
58
+ color: #40a9ff;
59
+ font-weight: bold;
60
+ }
61
+ }
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { Button } from 'antd';
3
+ import type { FormListProps } from 'antd/lib/form/FormList';
4
+ import type { DItemProps } from '../DForm/DItem';
5
+ import './index.less';
6
+ export interface DynamicFormItemProps extends Omit<FormListProps, 'children'> {
7
+ /** 表单项配置 */
8
+ itemConfig: DItemProps | DItemProps[];
9
+ /** 初始值 */
10
+ value?: any[];
11
+ /** 新增按钮文本 */
12
+ addButtonText?: string;
13
+ /** 新增按钮属性 */
14
+ addButtonProps?: React.ComponentProps<typeof Button>;
15
+ /** 是否添加到头部 */
16
+ addAtHead?: boolean;
17
+ /** 删除按钮文本 */
18
+ removeButtonText?: string;
19
+ /** 删除按钮属性 */
20
+ removeButtonProps?: React.ComponentProps<typeof Button>;
21
+ /** 最小项数 */
22
+ minItems?: number;
23
+ /** 最大项数 */
24
+ maxItems?: number;
25
+ /** 是否显示添加按钮 */
26
+ showAdd?: boolean;
27
+ /** 是否显示删除按钮 */
28
+ showRemove?: boolean;
29
+ /** 添加按钮位置 */
30
+ addPosition?: 'top' | 'bottom';
31
+ }
32
+ declare const DynamicFormItem: React.FC<DynamicFormItemProps>;
33
+ export default DynamicFormItem;
@@ -0,0 +1,100 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["name"];
4
+ import React from 'react';
5
+ import { Button, Form, Space } from 'antd';
6
+ import { PlusCircleOutlined, MinusCircleOutlined } from '@ant-design/icons';
7
+ import DForm from "../DForm";
8
+ import "./index.less";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ import { jsxs as _jsxs } from "react/jsx-runtime";
11
+ import { Fragment as _Fragment } from "react/jsx-runtime";
12
+ var DynamicFormItem = function DynamicFormItem(props) {
13
+ var _props$name = props.name,
14
+ name = _props$name === void 0 ? 'dynamicItems' : _props$name,
15
+ _props$initialValue = props.initialValue,
16
+ initialValue = _props$initialValue === void 0 ? [undefined] : _props$initialValue,
17
+ rules = props.rules,
18
+ itemConfig = props.itemConfig,
19
+ _props$addButtonText = props.addButtonText,
20
+ addButtonText = _props$addButtonText === void 0 ? '添加' : _props$addButtonText,
21
+ _props$addButtonProps = props.addButtonProps,
22
+ addButtonProps = _props$addButtonProps === void 0 ? {} : _props$addButtonProps,
23
+ _props$addAtHead = props.addAtHead,
24
+ addAtHead = _props$addAtHead === void 0 ? false : _props$addAtHead,
25
+ removeButtonText = props.removeButtonText,
26
+ _props$removeButtonPr = props.removeButtonProps,
27
+ removeButtonProps = _props$removeButtonPr === void 0 ? {} : _props$removeButtonPr,
28
+ _props$minItems = props.minItems,
29
+ minItems = _props$minItems === void 0 ? 0 : _props$minItems,
30
+ maxItems = props.maxItems,
31
+ _props$showAdd = props.showAdd,
32
+ showAdd = _props$showAdd === void 0 ? true : _props$showAdd,
33
+ _props$showRemove = props.showRemove,
34
+ showRemove = _props$showRemove === void 0 ? true : _props$showRemove,
35
+ _props$addPosition = props.addPosition,
36
+ addPosition = _props$addPosition === void 0 ? 'bottom' : _props$addPosition;
37
+ var renderItem = function renderItem(_ref, index, _ref2, totalFieldsCount) {
38
+ var key = _ref.key,
39
+ name = _ref.name;
40
+ var remove = _ref2.remove;
41
+ var nested = Array.isArray(itemConfig) && itemConfig.length > 0;
42
+ return /*#__PURE__*/_jsxs(Space, {
43
+ align: "start",
44
+ className: "".concat(nested ? 'dynamic-form-item nested' : 'dynamic-form-item single'),
45
+ children: [nested ? itemConfig.map(function (config, idx) {
46
+ var configName = config.name,
47
+ restConfig = _objectWithoutProperties(config, _excluded);
48
+ return /*#__PURE__*/_jsx(DForm.Item, _objectSpread(_objectSpread({}, restConfig), {}, {
49
+ name: [name, configName]
50
+ }), "dynamic-item-".concat(idx));
51
+ }) : /*#__PURE__*/_jsx(DForm.Item, _objectSpread(_objectSpread({}, itemConfig), {}, {
52
+ name: name
53
+ })), showRemove && totalFieldsCount > minItems && /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
54
+ type: "link",
55
+ danger: true,
56
+ icon: /*#__PURE__*/_jsx(MinusCircleOutlined, {}),
57
+ onClick: function onClick() {
58
+ return remove(name);
59
+ },
60
+ title: removeButtonText || '移除'
61
+ }, removeButtonProps), {}, {
62
+ children: removeButtonText
63
+ }))]
64
+ }, key);
65
+ };
66
+ var renderAddButton = function renderAddButton(_ref3, totalFieldsCount, position) {
67
+ var add = _ref3.add;
68
+ if (!showAdd || maxItems && totalFieldsCount >= maxItems) return null;
69
+ return /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
70
+ type: "dashed",
71
+ block: true,
72
+ onClick: function onClick() {
73
+ if (addAtHead) {
74
+ add('', 0);
75
+ } else {
76
+ add();
77
+ }
78
+ },
79
+ icon: /*#__PURE__*/_jsx(PlusCircleOutlined, {}),
80
+ style: {
81
+ marginBottom: position === 'top' ? '8px' : 0
82
+ }
83
+ }, addButtonProps), {}, {
84
+ children: addButtonText
85
+ }));
86
+ };
87
+ return /*#__PURE__*/_jsx(Form.List, {
88
+ name: name,
89
+ initialValue: initialValue,
90
+ rules: rules,
91
+ children: function children(fields, operation) {
92
+ return /*#__PURE__*/_jsxs(_Fragment, {
93
+ children: [addPosition === 'top' && renderAddButton(operation, fields.length, 'top'), fields.map(function (field, index) {
94
+ return renderItem(field, index, operation, fields.length);
95
+ }), addPosition === 'bottom' && renderAddButton(operation, fields.length, 'bottom')]
96
+ });
97
+ }
98
+ });
99
+ };
100
+ export default DynamicFormItem;