@zat-design/sisyphus-react 3.4.13 → 3.5.0
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/LICENSE +201 -21
- package/dist/index.esm.css +60 -0
- package/dist/less.esm.css +60 -0
- package/es/ProEditTable/components/DndWrapper/index.js +1 -0
- package/es/ProEditTable/index.d.ts +1 -1
- package/es/ProEditTable/index.js +8 -3
- package/es/ProEditTable/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/ProNumberRange/index.js +28 -7
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +1 -2
- package/es/ProForm/utils/valueType.d.ts +0 -6
- package/es/ProForm/utils/valueType.js +30 -2
- package/es/ProLayout/index.js +6 -2
- package/es/ProLayout/propTypes.d.ts +4 -0
- package/es/ProSelect/index.js +52 -45
- package/es/ProSelect/index.less +6 -0
- package/es/ProTable/components/DndWrapper/index.d.ts +15 -0
- package/es/ProTable/components/DndWrapper/index.js +94 -0
- package/es/ProTable/components/index.d.ts +1 -0
- package/es/ProTable/components/index.js +2 -1
- package/es/ProTable/index.d.ts +3 -0
- package/es/ProTable/index.js +177 -74
- package/es/ProTable/propsType.d.ts +5 -1
- package/es/ProTable/style/index.less +90 -0
- package/es/ProTree/utils.d.ts +1 -1
- package/es/ProTree/utils.js +1 -1
- package/es/ProTreeModal/index.js +10 -4
- package/es/ProTreeModal/style/index.less +1 -0
- package/lib/ProEditTable/components/DndWrapper/index.js +1 -0
- package/lib/ProEditTable/index.d.ts +1 -1
- package/lib/ProEditTable/index.js +8 -3
- package/lib/ProEditTable/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/ProNumberRange/index.js +28 -7
- package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +1 -2
- package/lib/ProForm/utils/valueType.d.ts +0 -6
- package/lib/ProForm/utils/valueType.js +30 -2
- package/lib/ProLayout/index.js +6 -2
- package/lib/ProLayout/propTypes.d.ts +4 -0
- package/lib/ProSelect/index.js +54 -45
- package/lib/ProSelect/index.less +6 -0
- package/lib/ProTable/components/DndWrapper/index.d.ts +15 -0
- package/lib/ProTable/components/DndWrapper/index.js +101 -0
- package/lib/ProTable/components/index.d.ts +1 -0
- package/lib/ProTable/components/index.js +15 -1
- package/lib/ProTable/index.d.ts +3 -0
- package/lib/ProTable/index.js +173 -70
- package/lib/ProTable/propsType.d.ts +5 -1
- package/lib/ProTable/style/index.less +90 -0
- package/lib/ProTree/utils.d.ts +1 -1
- package/lib/ProTree/utils.js +1 -1
- package/lib/ProTreeModal/index.js +10 -4
- package/lib/ProTreeModal/style/index.less +1 -0
- package/package.json +1 -1
|
@@ -2,6 +2,90 @@
|
|
|
2
2
|
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
3
|
|
|
4
4
|
.pro-table {
|
|
5
|
+
&.pro-table-draggable-only{
|
|
6
|
+
.ant-table-tbody{
|
|
7
|
+
.anticon {
|
|
8
|
+
margin-right: 0;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.@{ant-prefix}-table-content {
|
|
14
|
+
>table {
|
|
15
|
+
.@{ant-prefix}-table-summary {
|
|
16
|
+
background-color: var(--zaui-table-header-bg, #f2f3f5);
|
|
17
|
+
color : var(--zaui-text, #343434);
|
|
18
|
+
font-weight : 600;
|
|
19
|
+
|
|
20
|
+
.@{ant-prefix}-table-cell-fix-left,
|
|
21
|
+
.@{ant-prefix}-table-cell-fix-right {
|
|
22
|
+
background-color: var(--zaui-table-header-bg, #f2f3f5);
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
th.@{ant-prefix}-table-selection-column {
|
|
28
|
+
width: 48px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
td {
|
|
32
|
+
.pro-form-view-container_nowrap {
|
|
33
|
+
white-space: normal;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.@{ant-prefix}-table-thead>tr>th:not(.@{ant-prefix}-table-selection-column):not(.@{ant-prefix}-table-row-expand-icon-cell):not([colspan]).is-required {
|
|
38
|
+
&.is-required-right {
|
|
39
|
+
.pro-edit-table-title {
|
|
40
|
+
&::before {
|
|
41
|
+
position : static;
|
|
42
|
+
top : 0;
|
|
43
|
+
display : inline-block;
|
|
44
|
+
text-indent: -8px;
|
|
45
|
+
color : #ff5050;
|
|
46
|
+
font-size : var(--zaui-font-size-md, 14px);
|
|
47
|
+
line-height: 1;
|
|
48
|
+
content : "*";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
&.is-required-left {
|
|
53
|
+
.pro-edit-table-title {
|
|
54
|
+
&::after {
|
|
55
|
+
width: auto;
|
|
56
|
+
position : static;
|
|
57
|
+
top : 0;
|
|
58
|
+
display : inline-block;
|
|
59
|
+
margin-left: var(--zaui-space-size-xs, 4px);
|
|
60
|
+
color : #ff5050;
|
|
61
|
+
font-size : 14px;
|
|
62
|
+
line-height: 1;
|
|
63
|
+
content : "*";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
.drag-wrapper {
|
|
71
|
+
display: flex;
|
|
72
|
+
width: 20px;
|
|
73
|
+
.anticon {
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
margin-right: 12px;
|
|
76
|
+
.drag-icon{
|
|
77
|
+
margin-right: 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
.drag-wrapper.no-check {
|
|
82
|
+
.anticon {
|
|
83
|
+
margin-right: 0;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
5
89
|
&.pro-table-bordered {
|
|
6
90
|
.@{ant-prefix}-table .@{ant-prefix}-table-thead > tr > th {
|
|
7
91
|
border-bottom: 1px solid #f0f0f0;
|
|
@@ -465,3 +549,9 @@
|
|
|
465
549
|
}
|
|
466
550
|
}
|
|
467
551
|
}
|
|
552
|
+
|
|
553
|
+
.pro-edit-table-drag {
|
|
554
|
+
table tr th.@{ant-prefix}-table-selection-column.@{ant-prefix}-table-cell-fix-left{
|
|
555
|
+
text-align: right;
|
|
556
|
+
}
|
|
557
|
+
}
|
package/es/ProTree/utils.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare function getAllKeys(data: TreeDataProps[], fieldNames: FieldNames
|
|
|
22
22
|
export declare const getParentKey: (key: string, tree: TreeDataProps[], fieldNames: FieldNamesType) => string;
|
|
23
23
|
export declare function findTreeNodeByKey(treeData: TreeDataProps[], key: string, fieldNames: FieldNamesType): TreeDataProps[];
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* 过滤掉每一层假值(例如 false、null、0、""、undefined 等)
|
|
26
26
|
* @param data
|
|
27
27
|
* @param checkedKeys
|
|
28
28
|
* @returns
|
package/es/ProTree/utils.js
CHANGED
package/es/ProTreeModal/index.js
CHANGED
|
@@ -259,10 +259,16 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
259
259
|
}
|
|
260
260
|
onChange === null || onChange === void 0 ? void 0 : onChange(values);
|
|
261
261
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
262
|
+
// fix: 当有 openChange 时候、点击确定应该由关闭 openChange 控制
|
|
263
|
+
if (!openChange || open === undefined) {
|
|
264
|
+
setState({
|
|
265
|
+
open: false
|
|
266
|
+
});
|
|
267
|
+
openChange === null || openChange === void 0 ? void 0 : openChange(false);
|
|
268
|
+
}
|
|
269
|
+
if (openChange && open !== undefined) {
|
|
270
|
+
openChange === null || openChange === void 0 ? void 0 : openChange(true);
|
|
271
|
+
}
|
|
266
272
|
};
|
|
267
273
|
/**
|
|
268
274
|
* clear all checked
|
|
@@ -43,6 +43,7 @@ var Row = exports.Row = function Row(props) {
|
|
|
43
43
|
}, attributes), {}, {
|
|
44
44
|
children: _react.default.Children.map(children, function (child) {
|
|
45
45
|
if (child.key === 'RC_TABLE_KEY') {
|
|
46
|
+
console.log('走这里么', child.key);
|
|
46
47
|
var _ref = (child === null || child === void 0 ? void 0 : child.props) || {},
|
|
47
48
|
render = _ref.render,
|
|
48
49
|
record = _ref.record,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ProEditTableProps, ProEditTableRefProps } from './propsType';
|
|
3
|
-
declare const ForwardProEditTable: React.ForwardRefExoticComponent<ProEditTableProps<any> & React.RefAttributes<ProEditTableRefProps>>;
|
|
3
|
+
declare const ForwardProEditTable: React.ForwardRefExoticComponent<Omit<ProEditTableProps<any>, "ref"> & React.RefAttributes<ProEditTableRefProps>>;
|
|
4
4
|
export default ForwardProEditTable;
|
|
@@ -23,7 +23,7 @@ var _components = require("./components");
|
|
|
23
23
|
var _ProForm = _interopRequireDefault(require("../ProForm"));
|
|
24
24
|
var _empty = _interopRequireDefault(require("../assets/empty.png"));
|
|
25
25
|
var _locale = _interopRequireWildcard(require("../locale"));
|
|
26
|
-
var _excluded = ["value", "onChange", "className", "columns", "type", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "originalDiffTip", "rowKey", "rowDisabled", "footerRender"];
|
|
26
|
+
var _excluded = ["value", "onChange", "className", "columns", "type", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "originalDiffTip", "rowKey", "rowDisabled", "footerRender", "scroll"];
|
|
27
27
|
var ProEditTable = function ProEditTable(_ref, ref) {
|
|
28
28
|
var _resetProps$id, _resetProps$id$split, _themeConfig$data2, _value$2;
|
|
29
29
|
var value = _ref.value,
|
|
@@ -54,6 +54,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
54
54
|
rowKey = _ref.rowKey,
|
|
55
55
|
rowDisabled = _ref.rowDisabled,
|
|
56
56
|
footerRender = _ref.footerRender,
|
|
57
|
+
scroll = _ref.scroll,
|
|
57
58
|
resetProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
58
59
|
// 上下文form
|
|
59
60
|
var contentForm = _antd.Form.useFormInstance();
|
|
@@ -298,7 +299,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
298
299
|
}
|
|
299
300
|
}
|
|
300
301
|
}, [value]);
|
|
301
|
-
(0, _react.useImperativeHandle)(ref, function () {
|
|
302
|
+
(0, _react.useImperativeHandle)((resetProps === null || resetProps === void 0 ? void 0 : resetProps.ref) || ref, function () {
|
|
302
303
|
return {
|
|
303
304
|
getInternalState: function getInternalState() {
|
|
304
305
|
return state;
|
|
@@ -349,7 +350,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
349
350
|
pageSize: page.pageSize,
|
|
350
351
|
showSizeChanger: false,
|
|
351
352
|
showQuickJumper: true,
|
|
352
|
-
total: value.length,
|
|
353
|
+
total: value === null || value === void 0 ? void 0 : value.length,
|
|
353
354
|
showTotal: function showTotal(total) {
|
|
354
355
|
var _locale$ProEditTable;
|
|
355
356
|
if (!total) return;
|
|
@@ -360,6 +361,10 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
360
361
|
onChange: handlePageChange
|
|
361
362
|
}, pagination) : false,
|
|
362
363
|
rowKey: "rowKey",
|
|
364
|
+
scroll: {
|
|
365
|
+
x: scroll === null || scroll === void 0 ? void 0 : scroll.x,
|
|
366
|
+
y: (value === null || value === void 0 ? void 0 : value.length) ? scroll === null || scroll === void 0 ? void 0 : scroll.y : undefined
|
|
367
|
+
},
|
|
363
368
|
summary: _summary
|
|
364
369
|
}))]
|
|
365
370
|
}), !isView && (value === null || value === void 0 ? void 0 : value.length) ? (0, _jsxRuntime.jsx)("div", {
|
|
@@ -21,6 +21,7 @@ var formatAmount = _utils.tools.formatAmount,
|
|
|
21
21
|
formatPercent = _utils.tools.formatPercent,
|
|
22
22
|
formatPerMill = _utils.tools.formatPerMill;
|
|
23
23
|
var ProNumberRange = function ProNumberRange(props) {
|
|
24
|
+
var _valueProps, _valueProps2, _valueProps3, _valueProps4;
|
|
24
25
|
var _props$value = props.value,
|
|
25
26
|
value = _props$value === void 0 ? [] : _props$value,
|
|
26
27
|
_props$onChange = props.onChange,
|
|
@@ -138,8 +139,26 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
138
139
|
}
|
|
139
140
|
};
|
|
140
141
|
break;
|
|
142
|
+
// 百分比
|
|
143
|
+
case 'percentage':
|
|
144
|
+
valueProps = {
|
|
145
|
+
min: 0,
|
|
146
|
+
max: 100,
|
|
147
|
+
step: 1
|
|
148
|
+
};
|
|
149
|
+
break;
|
|
150
|
+
// 千分比
|
|
151
|
+
case 'permillage':
|
|
152
|
+
valueProps = {
|
|
153
|
+
min: 0,
|
|
154
|
+
max: 1000,
|
|
155
|
+
step: 1
|
|
156
|
+
};
|
|
157
|
+
break;
|
|
141
158
|
default:
|
|
142
|
-
valueProps = {
|
|
159
|
+
valueProps = {
|
|
160
|
+
max: 999999999999
|
|
161
|
+
};
|
|
143
162
|
}
|
|
144
163
|
}
|
|
145
164
|
/**
|
|
@@ -161,15 +180,16 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
161
180
|
className: "range-left",
|
|
162
181
|
value: (value === null || value === void 0 ? void 0 : value[0]) || range[0],
|
|
163
182
|
placeholder: "".concat(_locale.default.ProForm.inputPlaceholder),
|
|
164
|
-
min: min,
|
|
165
|
-
max: (value === null || value === void 0 ? void 0 : value[1]) || max || range[1],
|
|
166
183
|
precision: precision,
|
|
167
184
|
disabled: getDisabled(disabled, 0),
|
|
168
185
|
onChange: function onChange(e) {
|
|
169
186
|
firstHandleChange(e);
|
|
170
187
|
},
|
|
171
188
|
addonBefore: addonBefore
|
|
172
|
-
}, valueProps),
|
|
189
|
+
}, valueProps), {}, {
|
|
190
|
+
min: min || ((_valueProps = valueProps) === null || _valueProps === void 0 ? void 0 : _valueProps.min),
|
|
191
|
+
max: (value === null || value === void 0 ? void 0 : value[1]) || range[1] || max || ((_valueProps2 = valueProps) === null || _valueProps2 === void 0 ? void 0 : _valueProps2.max)
|
|
192
|
+
}, childProps === null || childProps === void 0 ? void 0 : childProps[0])), (0, _jsxRuntime.jsx)(_antd.Input, {
|
|
173
193
|
className: (0, _classnames.default)({
|
|
174
194
|
'range-split': true,
|
|
175
195
|
'range-split-disabled': !!disabled
|
|
@@ -180,15 +200,16 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
180
200
|
className: "range-right",
|
|
181
201
|
value: (value === null || value === void 0 ? void 0 : value[1]) || range[1],
|
|
182
202
|
placeholder: "".concat(_locale.default.ProForm.inputPlaceholder),
|
|
183
|
-
min: (value === null || value === void 0 ? void 0 : value[0]) || min || range[0],
|
|
184
|
-
max: max,
|
|
185
203
|
precision: precision,
|
|
186
204
|
disabled: getDisabled(disabled, 1),
|
|
187
205
|
onChange: function onChange(e) {
|
|
188
206
|
lastHandleChange(e);
|
|
189
207
|
},
|
|
190
208
|
addonAfter: addonAfter
|
|
191
|
-
}, valueProps),
|
|
209
|
+
}, valueProps), {}, {
|
|
210
|
+
max: max || ((_valueProps3 = valueProps) === null || _valueProps3 === void 0 ? void 0 : _valueProps3.max),
|
|
211
|
+
min: (value === null || value === void 0 ? void 0 : value[0]) || range[0] || min || ((_valueProps4 = valueProps) === null || _valueProps4 === void 0 ? void 0 : _valueProps4.min)
|
|
212
|
+
}, childProps === null || childProps === void 0 ? void 0 : childProps[1]))]
|
|
192
213
|
});
|
|
193
214
|
};
|
|
194
215
|
var _default = exports.default = ProNumberRange;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ProFormOtherProps } from '../../../propsType';
|
|
3
|
-
export type ValueTypeEnum = 'percentage' | 'permillage' | 'thousandth';
|
|
4
3
|
export interface ProNumberRangeProps {
|
|
5
4
|
/**
|
|
6
5
|
* @description 组件的值,[最小值,最大值]
|
|
@@ -46,7 +45,7 @@ export interface ProNumberRangeProps {
|
|
|
46
45
|
* @description 值类型,回显时区分金额与百分比
|
|
47
46
|
* @default '-'
|
|
48
47
|
*/
|
|
49
|
-
valueType?:
|
|
48
|
+
valueType?: 'percentage' | 'permillage' | 'thousandth';
|
|
50
49
|
/**
|
|
51
50
|
* @description 空值查看时默认展示内容
|
|
52
51
|
* @default '-'
|
|
@@ -34,9 +34,6 @@ declare const _default: {
|
|
|
34
34
|
type: any;
|
|
35
35
|
valueType: any;
|
|
36
36
|
}) => {
|
|
37
|
-
normalize?: undefined;
|
|
38
|
-
getValueProps?: undefined;
|
|
39
|
-
} | {
|
|
40
37
|
normalize: (value: any) => any;
|
|
41
38
|
getValueProps: (value: any) => {
|
|
42
39
|
value: any;
|
|
@@ -47,9 +44,6 @@ declare const _default: {
|
|
|
47
44
|
type: any;
|
|
48
45
|
valueType: any;
|
|
49
46
|
}) => {
|
|
50
|
-
normalize?: undefined;
|
|
51
|
-
getValueProps?: undefined;
|
|
52
|
-
} | {
|
|
53
47
|
normalize: (value: any) => any;
|
|
54
48
|
getValueProps: (value: any) => {
|
|
55
49
|
value: any;
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
9
|
var _big = _interopRequireDefault(require("big.js"));
|
|
10
|
+
var _lodash = require("lodash");
|
|
10
11
|
var _utils = require("@zat-design/utils");
|
|
11
12
|
var transformDate = _utils.transforms.transformDate,
|
|
12
13
|
transformSwitch = _utils.transforms.transformSwitch;
|
|
@@ -20,8 +21,35 @@ var transformRatio = function transformRatio(_ref) {
|
|
|
20
21
|
precision = _ref$precision === void 0 ? 2 : _ref$precision,
|
|
21
22
|
valueType = _ref.valueType;
|
|
22
23
|
if (type === 'ProNumberRange' && ['permillage', 'percentage'].includes(valueType)) {
|
|
23
|
-
|
|
24
|
-
return {
|
|
24
|
+
var ref = null;
|
|
25
|
+
return {
|
|
26
|
+
normalize: function normalize(value) {
|
|
27
|
+
if (!value || !value.some(function (item) {
|
|
28
|
+
return item;
|
|
29
|
+
})) {
|
|
30
|
+
return {};
|
|
31
|
+
}
|
|
32
|
+
return [(value[0] || value[0] === 0) && Number.isFinite(value[0] - 0) ? (0, _big.default)(value[0] - 0).div(Math.pow(10, precision)).toNumber() : null, (value[1] || value[1] === 0) && Number.isFinite(value[1] - 0) ? (0, _big.default)(value[1] - 0).div(Math.pow(10, precision)).toNumber() : null];
|
|
33
|
+
},
|
|
34
|
+
getValueProps: function getValueProps(value) {
|
|
35
|
+
if (!value || !value.some(function (item) {
|
|
36
|
+
return item;
|
|
37
|
+
})) {
|
|
38
|
+
return {
|
|
39
|
+
value: []
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if ((0, _lodash.isEqual)(ref, value)) {
|
|
43
|
+
return {
|
|
44
|
+
value: [(value[0] || value[0] === 0) && Number.isFinite(value[0] - 0) ? (0, _big.default)(value[0] - 0).times(Math.pow(10, precision)).toNumber() : null, (value[1] || value[1] === 0) && Number.isFinite(value[1] - 0) ? (0, _big.default)(value[1] - 0).times(Math.pow(10, precision)).toNumber() : null]
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
ref = value;
|
|
48
|
+
return {
|
|
49
|
+
value: [(value[0] || value[0] === 0) && Number.isFinite(value[0] - 0) ? (0, _big.default)(value[0] - 0).times(Math.pow(10, precision)).toNumber() : null, (value[1] || value[1] === 0) && Number.isFinite(value[1] - 0) ? (0, _big.default)(value[1] - 0).times(Math.pow(10, precision)).toNumber() : null]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
};
|
|
25
53
|
}
|
|
26
54
|
return {
|
|
27
55
|
normalize: function normalize(value) {
|
package/lib/ProLayout/index.js
CHANGED
|
@@ -31,7 +31,8 @@ var ProLayout = function ProLayout(props) {
|
|
|
31
31
|
headerNotice = props.headerNotice,
|
|
32
32
|
noticeIn = props.notice,
|
|
33
33
|
dataSource = props.dataSource,
|
|
34
|
-
theme = props.theme
|
|
34
|
+
theme = props.theme,
|
|
35
|
+
onCollapsedChange = props.onCollapsedChange;
|
|
35
36
|
var _useSetState = (0, _ahooks.useSetState)({
|
|
36
37
|
notice: headerNotice || noticeIn,
|
|
37
38
|
menus: [],
|
|
@@ -92,7 +93,10 @@ var ProLayout = function ProLayout(props) {
|
|
|
92
93
|
dataSource: menus,
|
|
93
94
|
notice: notice,
|
|
94
95
|
collapsed: collapsed,
|
|
95
|
-
onToggle:
|
|
96
|
+
onToggle: function onToggle() {
|
|
97
|
+
toggle();
|
|
98
|
+
onCollapsedChange && onCollapsedChange(!collapsed);
|
|
99
|
+
}
|
|
96
100
|
})), (0, _jsxRuntime.jsx)("div", {
|
|
97
101
|
className: "pro-layout-content",
|
|
98
102
|
style: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, contentStyle), {}, {
|
|
@@ -51,6 +51,10 @@ export interface ProLayoutProps {
|
|
|
51
51
|
contentStyle?: CSSProperties;
|
|
52
52
|
waterMarkProps?: ProWaterMarkProps;
|
|
53
53
|
theme?: themeEnum;
|
|
54
|
+
/**
|
|
55
|
+
* 折叠回调事件
|
|
56
|
+
*/
|
|
57
|
+
onCollapsedChange?: (collapsed: any) => void;
|
|
54
58
|
[key: string]: any;
|
|
55
59
|
}
|
|
56
60
|
export interface ProLayoutStates {
|
package/lib/ProSelect/index.js
CHANGED
|
@@ -28,7 +28,8 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
|
|
|
28
28
|
var _ref = (0, _ProConfigProvider.useProConfig)('ProSelect') || {},
|
|
29
29
|
_ref$fieldNames = _ref.fieldNames,
|
|
30
30
|
proSelectFieldNames = _ref$fieldNames === void 0 ? {} : _ref$fieldNames,
|
|
31
|
-
showCodeName = _ref.showCodeName
|
|
31
|
+
showCodeName = _ref.showCodeName,
|
|
32
|
+
gViewportReady = _ref.viewportReady;
|
|
32
33
|
var label = 'label';
|
|
33
34
|
var code = 'value';
|
|
34
35
|
if (proSelectFieldNames && Object.keys(proSelectFieldNames).length) {
|
|
@@ -55,16 +56,16 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
|
|
|
55
56
|
updateDataSource = props.updateDataSource,
|
|
56
57
|
transformResponse = props.transformResponse,
|
|
57
58
|
isViewPro = props.isView,
|
|
58
|
-
|
|
59
|
-
viewportReady = _props$viewportReady === void 0 ? false : _props$viewportReady,
|
|
59
|
+
__viewportReady = props.viewportReady,
|
|
60
60
|
selectProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
61
|
+
var viewportReady = __viewportReady || gViewportReady;
|
|
61
62
|
/** 是否在可视区域出现过 */
|
|
62
63
|
var _useState = (0, _react.useState)(false),
|
|
63
64
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
64
65
|
viewFlag = _useState2[0],
|
|
65
66
|
setViewFlag = _useState2[1];
|
|
66
|
-
var
|
|
67
|
-
var _useInViewport = (0, _ahooks.useInViewport)(
|
|
67
|
+
var refSelect1 = (0, _react.useRef)();
|
|
68
|
+
var _useInViewport = (0, _ahooks.useInViewport)(refSelect1),
|
|
68
69
|
_useInViewport2 = (0, _slicedToArray2.default)(_useInViewport, 1),
|
|
69
70
|
inViewport = _useInViewport2[0];
|
|
70
71
|
selectProps.showCodeName = (_selectProps$showCode = selectProps.showCodeName) !== null && _selectProps$showCode !== void 0 ? _selectProps$showCode : showCodeName;
|
|
@@ -300,45 +301,53 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
|
|
|
300
301
|
fieldNames: fieldNames
|
|
301
302
|
});
|
|
302
303
|
}
|
|
303
|
-
return (0, _jsxRuntime.jsx)(
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
304
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
305
|
+
ref: refSelect1,
|
|
306
|
+
style: props.style,
|
|
307
|
+
className: "ant-select-compact-item-div",
|
|
308
|
+
children: (0, _jsxRuntime.jsx)(_antd.Select
|
|
309
|
+
// id={refSelect1.current}
|
|
310
|
+
, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
311
|
+
// id={refSelect1.current}
|
|
312
|
+
placeholder: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProSelect = _locale.default.ProSelect) === null || _locale$ProSelect === void 0 ? void 0 : _locale$ProSelect.select,
|
|
313
|
+
allowClear: true,
|
|
314
|
+
showArrow: true,
|
|
315
|
+
loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading,
|
|
316
|
+
onChange: handleChange,
|
|
317
|
+
optionLabelProp: "children" // 解决warning报错,添加默认值
|
|
318
|
+
,
|
|
319
|
+
showSearch: true,
|
|
320
|
+
filterOption: (0, _lodash.isFunction)(_onSearch) ? false : function (input, option) {
|
|
321
|
+
var _option$children, _option$children$prop;
|
|
322
|
+
var value = (0, _lodash.isString)(option === null || option === void 0 ? void 0 : option.children) ? option === null || option === void 0 ? void 0 : option.children : option === null || option === void 0 ? void 0 : (_option$children = option.children) === null || _option$children === void 0 ? void 0 : (_option$children$prop = _option$children.props) === null || _option$children$prop === void 0 ? void 0 : _option$children$prop.title;
|
|
323
|
+
return value.toLowerCase().includes(input.toLowerCase());
|
|
324
|
+
},
|
|
325
|
+
onSearch: function onSearch(value) {
|
|
326
|
+
_onSearch && _onSearch(value, (0, _objectSpread2.default)({}, fetchFunction));
|
|
327
|
+
},
|
|
328
|
+
getPopupContainer: function getPopupContainer(trigger) {
|
|
329
|
+
return scrollFollowParent ? trigger.parentElement : document.body;
|
|
330
|
+
}
|
|
331
|
+
}, (0, _lodash.omit)((0, _lodash.cloneDeep)(selectProps), ['isView', 'showCodeName', 'form', 'name', 'style'])), {}, {
|
|
332
|
+
value: transformValue(),
|
|
333
|
+
children: Array.isArray(newSelectList) && newSelectList.map(function (item) {
|
|
334
|
+
return (0, _jsxRuntime.jsx)(Option, {
|
|
335
|
+
value: item[code],
|
|
336
|
+
record: item,
|
|
337
|
+
disabled: !!item.disabled,
|
|
338
|
+
children: (0, _jsxRuntime.jsx)(TooltipOption, {
|
|
339
|
+
title: OptionRender ? OptionRender(item) : selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label],
|
|
340
|
+
children: OptionRender ? (0, _jsxRuntime.jsx)("span", {
|
|
341
|
+
title: OptionRender(item),
|
|
342
|
+
children: OptionRender(item)
|
|
343
|
+
}) : (0, _jsxRuntime.jsx)("span", {
|
|
344
|
+
title: "".concat(item[code], "-").concat(item[label]),
|
|
345
|
+
children: selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label]
|
|
346
|
+
})
|
|
347
|
+
}, item[code])
|
|
348
|
+
}, item[code]);
|
|
349
|
+
})
|
|
350
|
+
}))
|
|
351
|
+
});
|
|
343
352
|
};
|
|
344
353
|
var _default = exports.default = /*#__PURE__*/(0, _react.forwardRef)(ProSelect);
|
package/lib/ProSelect/index.less
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
interface RowProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
3
|
+
'data-row-key': string;
|
|
4
|
+
'data-hide'?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const Row: FC<RowProps>;
|
|
8
|
+
declare const DndWrapper: ({ draggable, value, onChange, disabled, children }: {
|
|
9
|
+
draggable: any;
|
|
10
|
+
value: any;
|
|
11
|
+
onChange: any;
|
|
12
|
+
disabled: any;
|
|
13
|
+
children: any;
|
|
14
|
+
}) => any;
|
|
15
|
+
export default DndWrapper;
|