@zykj2024/much-library 1.0.12-beta.5 → 1.0.12-beta.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/dist/McContainer/demo/actionBar.d.ts +1 -1
- package/dist/McContainer/demo/actionBar.js +58 -10
- package/dist/McContainer/demo/batch.d.ts +1 -1
- package/dist/McContainer/demo/batch.js +70 -30
- package/dist/McContainer/demo/standard.js +1 -2
- package/dist/McContainer/index.d.ts +21 -2
- package/dist/McContainer/index.js +85 -23
- package/dist/McEllipsisMiddle/demo/base.d.ts +6 -0
- package/dist/McEllipsisMiddle/demo/base.js +25 -0
- package/dist/McEllipsisMiddle/index.css +3 -0
- package/dist/McEllipsisMiddle/index.d.ts +11 -0
- package/dist/McEllipsisMiddle/index.js +32 -0
- package/dist/McThemeConfig/demo/modal.js +3 -11
- package/dist/McThemeConfig/globalStyle.js +1 -1
- package/dist/Styles/demo/basic.d.ts +3 -0
- package/dist/Styles/demo/basic.js +44 -0
- package/dist/Styles/demo/delete-icon.d.ts +3 -0
- package/dist/Styles/demo/delete-icon.js +73 -0
- package/dist/Styles/demo/form-bottom-0.d.ts +3 -0
- package/dist/Styles/demo/form-bottom-0.js +34 -0
- package/dist/{styles → Styles}/index.css +1 -1
- package/dist/{styles → Styles}/utilities.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +2 -1
- /package/dist/{styles → Styles}/mixins.css +0 -0
@@ -1,17 +1,21 @@
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
1
2
|
/**
|
2
3
|
* title: 操作栏区域
|
3
|
-
* description:
|
4
|
+
* description: 若未设置该项,则不显示。`actionBarRender` 可自定义操作栏区域,提供批量操作按钮实例
|
4
5
|
* transform: true
|
5
6
|
* compact: true
|
6
7
|
*/
|
7
8
|
|
8
|
-
import {
|
9
|
+
import { useToggle } from "../../../packages/hooks/src";
|
10
|
+
import { Button, Space, Switch } from 'antd';
|
9
11
|
import { AddOutlined } from 'much-icons';
|
10
12
|
import { McContainer, McInput } from "../..";
|
13
|
+
import { useState } from 'react';
|
11
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
12
15
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
13
16
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
14
17
|
export default (function () {
|
18
|
+
var _selectedRows$length;
|
15
19
|
var dataSource = Array.from({
|
16
20
|
length: 5
|
17
21
|
}, function (_, index) {
|
@@ -21,6 +25,14 @@ export default (function () {
|
|
21
25
|
age: 18 + index
|
22
26
|
};
|
23
27
|
});
|
28
|
+
var _useState = useState([]),
|
29
|
+
_useState2 = _slicedToArray(_useState, 2),
|
30
|
+
selectedRows = _useState2[0],
|
31
|
+
setSelectedRows = _useState2[1];
|
32
|
+
var _useToggle = useToggle(false),
|
33
|
+
_useToggle2 = _slicedToArray(_useToggle, 2),
|
34
|
+
showCustomActionBar = _useToggle2[0],
|
35
|
+
toggle = _useToggle2[1].toggle;
|
24
36
|
var columns = [{
|
25
37
|
title: 'ID',
|
26
38
|
dataIndex: 'id'
|
@@ -58,13 +70,49 @@ export default (function () {
|
|
58
70
|
children: "\u4E0A\u4F20"
|
59
71
|
})]
|
60
72
|
});
|
61
|
-
return /*#__PURE__*/
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
73
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
74
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
75
|
+
style: {
|
76
|
+
padding: '24px 24px 0'
|
77
|
+
},
|
78
|
+
children: ["\u662F\u5426\u81EA\u5B9A\u4E49\u6E32\u67D3\u64CD\u4F5C\u533A\uFF1A", /*#__PURE__*/_jsx(Switch, {
|
79
|
+
checked: showCustomActionBar,
|
80
|
+
onChange: toggle
|
81
|
+
})]
|
82
|
+
}), /*#__PURE__*/_jsx(McContainer, {
|
83
|
+
height: "100%",
|
84
|
+
queryItems: queryItems,
|
85
|
+
actionBar: actionBar,
|
86
|
+
actionBarRender: showCustomActionBar ? function (batchEl) {
|
87
|
+
return /*#__PURE__*/_jsxs(Space, {
|
88
|
+
size: 16,
|
89
|
+
style: {
|
90
|
+
marginBottom: 16
|
91
|
+
},
|
92
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
93
|
+
type: "primary",
|
94
|
+
children: "\u4E0B\u8F7D"
|
95
|
+
}), batchEl]
|
96
|
+
});
|
97
|
+
} : undefined,
|
98
|
+
batchNum: (_selectedRows$length = selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.length) !== null && _selectedRows$length !== void 0 ? _selectedRows$length : 0,
|
99
|
+
onCancel: function onCancel() {
|
100
|
+
return setSelectedRows([]);
|
101
|
+
},
|
102
|
+
tableProps: {
|
103
|
+
columns: columns,
|
104
|
+
dataSource: dataSource,
|
105
|
+
rowKey: 'id',
|
106
|
+
rowSelection: {
|
107
|
+
selectedRowKeys: selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.map(function (item) {
|
108
|
+
return item.id;
|
109
|
+
}),
|
110
|
+
preserveSelectedRowKeys: true,
|
111
|
+
onChange: function onChange(selectedRowKeys, selectedRows) {
|
112
|
+
return setSelectedRows(selectedRows);
|
113
|
+
}
|
114
|
+
}
|
115
|
+
}
|
116
|
+
})]
|
69
117
|
});
|
70
118
|
});
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* title: 预设批量操作
|
3
|
-
* description: 包括多选数据的处理、展示、批量操作区,开启多选功能时,在`tableProps`中进行多选的配置,`rowKey`必须设置且唯一。`batchNum`展示批量操作数、`batchBtns`配置批量操作区、`onCancel
|
3
|
+
* description: 包括多选数据的处理、展示、批量操作区,开启多选功能时,在`tableProps`中进行多选的配置,`rowKey`必须设置且唯一。`batchNum`展示批量操作数、`batchBtns`配置批量操作区、`onCancel`取消批量选中,配合实现多选功能。设置`batch`参数时,注意`actionBar`要为合法的React节点,如`<Button>操作1</Button>`、`<>只需要字符串的场景</>`,设置`batch.show`为`true`显示批量操作按钮,设置`batch.order`可以调整批量操作按钮的位置
|
4
4
|
* transform: true
|
5
5
|
* compact: true
|
6
6
|
*/
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
2
2
|
/**
|
3
3
|
* title: 预设批量操作
|
4
|
-
* description: 包括多选数据的处理、展示、批量操作区,开启多选功能时,在`tableProps`中进行多选的配置,`rowKey`必须设置且唯一。`batchNum`展示批量操作数、`batchBtns`配置批量操作区、`onCancel
|
4
|
+
* description: 包括多选数据的处理、展示、批量操作区,开启多选功能时,在`tableProps`中进行多选的配置,`rowKey`必须设置且唯一。`batchNum`展示批量操作数、`batchBtns`配置批量操作区、`onCancel`取消批量选中,配合实现多选功能。设置`batch`参数时,注意`actionBar`要为合法的React节点,如`<Button>操作1</Button>`、`<>只需要字符串的场景</>`,设置`batch.show`为`true`显示批量操作按钮,设置`batch.order`可以调整批量操作按钮的位置
|
5
5
|
* transform: true
|
6
6
|
* compact: true
|
7
7
|
*/
|
8
8
|
|
9
|
-
import {
|
10
|
-
import {
|
9
|
+
import { useToggle } from "../../../packages/hooks/src";
|
10
|
+
import { Button, Switch } from 'antd';
|
11
|
+
import { McContainer, McInput, McInputNumber } from "../..";
|
11
12
|
import { useState } from 'react';
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
13
14
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
@@ -27,6 +28,14 @@ export default (function () {
|
|
27
28
|
age: 18 + index
|
28
29
|
};
|
29
30
|
});
|
31
|
+
var _useToggle = useToggle(true),
|
32
|
+
_useToggle2 = _slicedToArray(_useToggle, 2),
|
33
|
+
showBatchBtn = _useToggle2[0],
|
34
|
+
toggle = _useToggle2[1].toggle;
|
35
|
+
var _useState3 = useState(),
|
36
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
37
|
+
batchBtnOrder = _useState4[0],
|
38
|
+
setBatchBtnOrder = _useState4[1];
|
30
39
|
var columns = [{
|
31
40
|
title: 'ID',
|
32
41
|
dataIndex: 'id'
|
@@ -55,35 +64,66 @@ export default (function () {
|
|
55
64
|
}
|
56
65
|
})
|
57
66
|
});
|
58
|
-
return /*#__PURE__*/
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
67
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
68
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
69
|
+
style: {
|
70
|
+
padding: 24
|
71
|
+
},
|
72
|
+
children: ["\u662F\u5426\u5C55\u793A\u6279\u91CF\u64CD\u4F5C\u6309\u94AE\uFF1A", /*#__PURE__*/_jsx(Switch, {
|
73
|
+
checked: showBatchBtn,
|
74
|
+
onChange: toggle
|
75
|
+
})]
|
76
|
+
}), /*#__PURE__*/_jsxs("div", {
|
77
|
+
style: {
|
78
|
+
padding: '0 0 24px 24px'
|
79
|
+
},
|
80
|
+
children: ["\u6279\u91CF\u64CD\u4F5C\u6309\u94AE\u4F4D\u7F6E\uFF1A", /*#__PURE__*/_jsx(McInputNumber, {
|
81
|
+
value: batchBtnOrder,
|
82
|
+
onChange: setBatchBtnOrder
|
72
83
|
})]
|
73
|
-
}),
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
84
|
+
}), /*#__PURE__*/_jsx(McContainer, {
|
85
|
+
height: "100%",
|
86
|
+
queryItems: queryItems,
|
87
|
+
batchNum: (_selectedRows$length = selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.length) !== null && _selectedRows$length !== void 0 ? _selectedRows$length : 0,
|
88
|
+
onCancel: function onCancel() {
|
89
|
+
return setSelectedRows([]);
|
90
|
+
},
|
91
|
+
actionBar: /*#__PURE__*/_jsxs(_Fragment, {
|
92
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
93
|
+
type: "primary",
|
94
|
+
children: "\u64CD\u4F5C1"
|
95
|
+
}), /*#__PURE__*/_jsx(Button, {
|
96
|
+
type: "primary",
|
97
|
+
children: "\u64CD\u4F5C2"
|
98
|
+
})]
|
99
|
+
}),
|
100
|
+
batchBtns: /*#__PURE__*/_jsxs(_Fragment, {
|
101
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
102
|
+
type: "primary",
|
103
|
+
children: "\u6279\u91CF\u64CD\u4F5C1"
|
104
|
+
}), /*#__PURE__*/_jsx(Button, {
|
105
|
+
type: "primary",
|
106
|
+
children: "\u6279\u91CF\u64CD\u4F5C2"
|
107
|
+
})]
|
108
|
+
}),
|
109
|
+
batch: {
|
110
|
+
show: showBatchBtn,
|
111
|
+
order: batchBtnOrder
|
112
|
+
},
|
113
|
+
tableProps: {
|
114
|
+
columns: columns,
|
115
|
+
dataSource: dataSource,
|
116
|
+
rowKey: 'id',
|
117
|
+
rowSelection: {
|
118
|
+
selectedRowKeys: selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.map(function (item) {
|
119
|
+
return item.id;
|
120
|
+
}),
|
121
|
+
preserveSelectedRowKeys: true,
|
122
|
+
onChange: function onChange(selectedRowKeys, selectedRows) {
|
123
|
+
return setSelectedRows(selectedRows);
|
124
|
+
}
|
85
125
|
}
|
86
126
|
}
|
87
|
-
}
|
127
|
+
})]
|
88
128
|
});
|
89
129
|
});
|
@@ -24,7 +24,6 @@ var tableData = Array.from({
|
|
24
24
|
};
|
25
25
|
});
|
26
26
|
export default (function () {
|
27
|
-
var _selectedRows$length;
|
28
27
|
var mcContainerRef = useRef();
|
29
28
|
var _useState = useState(0),
|
30
29
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -138,7 +137,7 @@ export default (function () {
|
|
138
137
|
icon: /*#__PURE__*/_jsx(AddOutlined, {}),
|
139
138
|
children: "\u65B0\u589E"
|
140
139
|
}),
|
141
|
-
batchNum:
|
140
|
+
batchNum: selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.length,
|
142
141
|
onCancel: function onCancel() {
|
143
142
|
return setSelectedRows([]);
|
144
143
|
},
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { TableProps } from 'antd';
|
1
|
+
import { ButtonProps, TableProps } from 'antd';
|
2
2
|
import { CSSProperties, FC, ReactElement, ReactNode } from 'react';
|
3
3
|
import './index.less';
|
4
4
|
export type McContainerPropsType = {
|
@@ -28,9 +28,28 @@ export type McContainerPropsType = {
|
|
28
28
|
[key: string]: any;
|
29
29
|
}) => void;
|
30
30
|
queryRender?: ReactNode;
|
31
|
-
actionBar?:
|
31
|
+
actionBar?: ReactElement;
|
32
|
+
/**
|
33
|
+
* @description 操作栏自定义渲染
|
34
|
+
* @param batchEl - 批量操作按钮实例
|
35
|
+
* @returns 操作栏元素
|
36
|
+
*/
|
37
|
+
actionBarRender?: (batchEl: ReactNode) => ReactNode;
|
32
38
|
batchNum?: number;
|
33
39
|
batchBtns?: ReactNode;
|
40
|
+
/**
|
41
|
+
* @description 批量操作按钮配置
|
42
|
+
* @param show - 是否显示批量操作按钮(默认不显示 false)
|
43
|
+
* @param buttonText - 批量操作按钮文字
|
44
|
+
* @param buttonProps - 批量操作按钮属性
|
45
|
+
* @param order - 批量操作按钮在操作栏中的位置(默认为最后一个)
|
46
|
+
*/
|
47
|
+
batch?: {
|
48
|
+
show?: boolean;
|
49
|
+
buttonText?: string;
|
50
|
+
buttonProps?: ButtonProps;
|
51
|
+
order?: number;
|
52
|
+
};
|
34
53
|
onCancel?: () => void;
|
35
54
|
tableProps?: TableProps<any>;
|
36
55
|
tableRender?: ReactNode;
|
@@ -2,10 +2,12 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
4
4
|
import { Button, Spin, Table } from 'antd';
|
5
|
+
import { isNumber } from 'lodash';
|
5
6
|
import { CaretDownFilled, DoubleLeftOutlined } from 'much-icons';
|
6
|
-
import { Children, cloneElement, forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
7
|
+
import { Children, cloneElement, forwardRef, isValidElement, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
7
8
|
import "./index.css";
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
10
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
9
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
12
|
var McContainer = /*#__PURE__*/forwardRef(function (props, ref) {
|
11
13
|
var _tableProps$dataSourc;
|
@@ -36,6 +38,8 @@ var McContainer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
36
38
|
_props$batchNum = props.batchNum,
|
37
39
|
batchNum = _props$batchNum === void 0 ? 0 : _props$batchNum,
|
38
40
|
batchBtns = props.batchBtns,
|
41
|
+
batch = props.batch,
|
42
|
+
actionBarRender = props.actionBarRender,
|
39
43
|
onCancel = props.onCancel,
|
40
44
|
tableProps = props.tableProps,
|
41
45
|
tableRender = props.tableRender,
|
@@ -53,12 +57,25 @@ var McContainer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
53
57
|
var defaultQueryParamsRef = useRef({});
|
54
58
|
var initializedRef = useRef(false);
|
55
59
|
|
60
|
+
/* 批量操作相关 */
|
61
|
+
var _ref = batch || {},
|
62
|
+
_ref$buttonText = _ref.buttonText,
|
63
|
+
buttonText = _ref$buttonText === void 0 ? '批量操作' : _ref$buttonText,
|
64
|
+
buttonProps = _ref.buttonProps,
|
65
|
+
_ref$show = _ref.show,
|
66
|
+
batchShow = _ref$show === void 0 ? false : _ref$show,
|
67
|
+
batchOrder = _ref.order;
|
68
|
+
var _useState5 = useState(false),
|
69
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
70
|
+
showBatchBar = _useState6[0],
|
71
|
+
setShowBatchBar = _useState6[1];
|
72
|
+
|
56
73
|
/* 获取actionBar高度 */
|
57
74
|
var actionBarRef = useRef();
|
58
|
-
var
|
59
|
-
|
60
|
-
actionBarHeight =
|
61
|
-
setActionBarHeight =
|
75
|
+
var _useState7 = useState(0),
|
76
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
77
|
+
actionBarHeight = _useState8[0],
|
78
|
+
setActionBarHeight = _useState8[1];
|
62
79
|
var actionBarResizeObserver = new ResizeObserver(function (entries) {
|
63
80
|
setActionBarHeight(entries[0].contentRect.height + 40);
|
64
81
|
});
|
@@ -108,6 +125,45 @@ var McContainer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
108
125
|
return ELs;
|
109
126
|
};
|
110
127
|
|
128
|
+
// 批量操作按钮
|
129
|
+
var handelBatchClick = function handelBatchClick() {
|
130
|
+
if (showBatchBar) {
|
131
|
+
onCancel === null || onCancel === void 0 || onCancel();
|
132
|
+
}
|
133
|
+
setShowBatchBar(!showBatchBar);
|
134
|
+
};
|
135
|
+
|
136
|
+
// 批量操作按钮
|
137
|
+
var batchEl = /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
138
|
+
onClick: handelBatchClick
|
139
|
+
}, buttonProps), {}, {
|
140
|
+
children: buttonText
|
141
|
+
}));
|
142
|
+
|
143
|
+
// 生成 actionBar
|
144
|
+
var mapActionBar = function mapActionBar() {
|
145
|
+
var Els;
|
146
|
+
// 是否展示批量操作按钮
|
147
|
+
if (batchShow) {
|
148
|
+
// 是否配置actionBar
|
149
|
+
if (actionBar) {
|
150
|
+
var _actionBar$props;
|
151
|
+
// 判断是否为合法的React节点
|
152
|
+
var itemsCount = /*#__PURE__*/isValidElement(actionBar) ? Children.count(actionBar === null || actionBar === void 0 || (_actionBar$props = actionBar.props) === null || _actionBar$props === void 0 ? void 0 : _actionBar$props.children) : 1;
|
153
|
+
var newEls = Children.toArray(itemsCount > 1 ? actionBar.props.children : actionBar);
|
154
|
+
var _batchOrder = isNumber(batchOrder) && batchOrder >= 0 && batchOrder <= itemsCount ? batchOrder : itemsCount;
|
155
|
+
// 插入批量操作按钮,默认放在actionBar操作项后面
|
156
|
+
newEls.splice(_batchOrder, 0, batchEl);
|
157
|
+
Els = /*#__PURE__*/cloneElement(itemsCount > 1 ? actionBar : /*#__PURE__*/_jsx(_Fragment, {}), {}, newEls);
|
158
|
+
} else {
|
159
|
+
Els = batchEl;
|
160
|
+
}
|
161
|
+
} else {
|
162
|
+
Els = actionBar;
|
163
|
+
}
|
164
|
+
return Els;
|
165
|
+
};
|
166
|
+
|
111
167
|
// 格式化查询参数(返回当前可见的查询项的参数集)
|
112
168
|
var formatQueryParams = function formatQueryParams() {
|
113
169
|
var _tableProps$paginatio;
|
@@ -138,10 +194,10 @@ var McContainer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
138
194
|
if (params) {
|
139
195
|
var _params = _objectSpread({}, queryParamsRef.current);
|
140
196
|
// 仅支持设置过name属性的查询项(和current、pageSize)
|
141
|
-
Object.entries(params).forEach(function (
|
142
|
-
var
|
143
|
-
key =
|
144
|
-
value =
|
197
|
+
Object.entries(params).forEach(function (_ref2) {
|
198
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
199
|
+
key = _ref3[0],
|
200
|
+
value = _ref3[1];
|
145
201
|
if (allNamesRef.current.includes(key)) {
|
146
202
|
_params[key] = value;
|
147
203
|
}
|
@@ -194,10 +250,10 @@ var McContainer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
194
250
|
return !allNamesRef.current.includes(k) && allNamesRef.current.push(k);
|
195
251
|
});
|
196
252
|
// 仅支持设置过name属性的查询项(和current、pageSize)
|
197
|
-
Object.entries(params).forEach(function (
|
198
|
-
var
|
199
|
-
key =
|
200
|
-
value =
|
253
|
+
Object.entries(params).forEach(function (_ref4) {
|
254
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
255
|
+
key = _ref5[0],
|
256
|
+
value = _ref5[1];
|
201
257
|
if (allNamesRef.current.includes(key)) {
|
202
258
|
_params[key] = value;
|
203
259
|
}
|
@@ -236,6 +292,9 @@ var McContainer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
236
292
|
queryParamsRef.current = _params;
|
237
293
|
setQueryParams(_params);
|
238
294
|
};
|
295
|
+
useEffect(function () {
|
296
|
+
setShowBatchBar(batchNum > 0);
|
297
|
+
}, [batchNum]);
|
239
298
|
|
240
299
|
// 监听immediateQuery,初始设置默认查询参数并判断是否触发首次查询
|
241
300
|
useEffect(function () {
|
@@ -324,14 +383,14 @@ var McContainer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
324
383
|
})]
|
325
384
|
}), queryRender !== null && /*#__PURE__*/_jsx("div", {
|
326
385
|
className: "mc-container__divider"
|
327
|
-
}), actionBar && /*#__PURE__*/_jsx("div", {
|
386
|
+
}), actionBarRender ? actionBarRender(batchEl) : (!!actionBar || !!batchShow) && /*#__PURE__*/_jsx("div", {
|
328
387
|
ref: actionBarRef,
|
329
388
|
className: "mc-container__action-bar",
|
330
389
|
style: {
|
331
390
|
backgroundColor: backgroundColor
|
332
391
|
},
|
333
|
-
children:
|
334
|
-
}),
|
392
|
+
children: mapActionBar()
|
393
|
+
}), showBatchBar && /*#__PURE__*/_jsx("div", {
|
335
394
|
className: "mc-container__batch-bar",
|
336
395
|
style: {
|
337
396
|
backgroundColor: backgroundColor,
|
@@ -349,7 +408,10 @@ var McContainer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
349
408
|
style: {
|
350
409
|
marginLeft: 'auto'
|
351
410
|
},
|
352
|
-
onClick:
|
411
|
+
onClick: function onClick() {
|
412
|
+
onCancel === null || onCancel === void 0 || onCancel();
|
413
|
+
setShowBatchBar(false);
|
414
|
+
},
|
353
415
|
children: "\u53D6\u6D88"
|
354
416
|
})]
|
355
417
|
})
|
@@ -379,13 +441,13 @@ var McContainer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
379
441
|
pageSize: queryParams.pageSize
|
380
442
|
}, tableProps === null || tableProps === void 0 ? void 0 : tableProps.pagination),
|
381
443
|
expandable: _objectSpread({
|
382
|
-
expandIcon: function expandIcon(
|
444
|
+
expandIcon: function expandIcon(_ref6) {
|
383
445
|
var _tableProps$dataSourc2, _record$children;
|
384
|
-
var expanded =
|
385
|
-
onExpand =
|
386
|
-
record =
|
387
|
-
return tableProps !== null && tableProps !== void 0 && (_tableProps$dataSourc2 = tableProps.dataSource) !== null && _tableProps$dataSourc2 !== void 0 && _tableProps$dataSourc2.some(function (
|
388
|
-
var children =
|
446
|
+
var expanded = _ref6.expanded,
|
447
|
+
onExpand = _ref6.onExpand,
|
448
|
+
record = _ref6.record;
|
449
|
+
return tableProps !== null && tableProps !== void 0 && (_tableProps$dataSourc2 = tableProps.dataSource) !== null && _tableProps$dataSourc2 !== void 0 && _tableProps$dataSourc2.some(function (_ref7) {
|
450
|
+
var children = _ref7.children;
|
389
451
|
return (children === null || children === void 0 ? void 0 : children.length) > 0;
|
390
452
|
}) ? ((_record$children = record.children) === null || _record$children === void 0 ? void 0 : _record$children.length) > 0 ? /*#__PURE__*/_jsx(CaretDownFilled, {
|
391
453
|
className: "mc-container__table__expand-icon",
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/**
|
2
|
+
* title: 基础用法
|
3
|
+
* description: 中间省略号,超出时展示省略号,并且移入会有tooltip
|
4
|
+
*/
|
5
|
+
|
6
|
+
import { McEllipsisMiddle } from "../..";
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
9
|
+
export default (function () {
|
10
|
+
return /*#__PURE__*/_jsxs("div", {
|
11
|
+
children: [/*#__PURE__*/_jsx(McEllipsisMiddle, {
|
12
|
+
style: {
|
13
|
+
width: 250
|
14
|
+
},
|
15
|
+
text: "\u8FD9\u662F\u4E00\u6BB5\u6CA1\u6709\u6EA2\u51FA\u7684\u6587\u5B57",
|
16
|
+
suffixCount: 4
|
17
|
+
}), /*#__PURE__*/_jsx(McEllipsisMiddle, {
|
18
|
+
style: {
|
19
|
+
width: 250
|
20
|
+
},
|
21
|
+
text: "\u8FD9\u662F\u4E00\u6BB5\u6709\u6EA2\u51FA\u7684\u6587\u5B57\uFF0C\u8FD9\u662F\u4E00\u6BB5\u6709\u6EA2\u51FA\u7684\u6587\u5B57",
|
22
|
+
suffixCount: 4
|
23
|
+
})]
|
24
|
+
});
|
25
|
+
});
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { TextProps } from 'antd/es/typography/Text';
|
3
|
+
import './index.less';
|
4
|
+
export interface McEllipsisMiddleProps extends TextProps {
|
5
|
+
text: string;
|
6
|
+
/** 省略号结尾显示的字个数 */
|
7
|
+
suffixCount: number;
|
8
|
+
style?: React.CSSProperties;
|
9
|
+
className?: string;
|
10
|
+
}
|
11
|
+
export declare const McEllipsisMiddle: ({ text, suffixCount, style, className, ...rest }: McEllipsisMiddleProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
+
var _excluded = ["text", "suffixCount", "style", "className"];
|
4
|
+
import { Typography } from 'antd';
|
5
|
+
import "./index.css";
|
6
|
+
|
7
|
+
/** 中间省略 */
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
9
|
+
var Text = Typography.Text;
|
10
|
+
export var McEllipsisMiddle = function McEllipsisMiddle(_ref) {
|
11
|
+
var text = _ref.text,
|
12
|
+
suffixCount = _ref.suffixCount,
|
13
|
+
style = _ref.style,
|
14
|
+
className = _ref.className,
|
15
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
16
|
+
var labelStr = String(text || '').trim();
|
17
|
+
var isBeyond = labelStr.length > suffixCount;
|
18
|
+
var start = isBeyond ? labelStr.slice(0, labelStr.length - suffixCount) : labelStr;
|
19
|
+
var suffix = isBeyond ? labelStr.slice(-suffixCount).trim() : '';
|
20
|
+
return /*#__PURE__*/_jsx(Text, _objectSpread(_objectSpread({
|
21
|
+
className: ['mc-ellipsis-middle', className].filter(Boolean).join(''),
|
22
|
+
style: _objectSpread({
|
23
|
+
width: '100%'
|
24
|
+
}, style),
|
25
|
+
ellipsis: {
|
26
|
+
tooltip: labelStr,
|
27
|
+
suffix: suffix
|
28
|
+
}
|
29
|
+
}, rest), {}, {
|
30
|
+
children: start
|
31
|
+
}));
|
32
|
+
};
|
@@ -59,8 +59,8 @@ export default (function () {
|
|
59
59
|
})]
|
60
60
|
}), /*#__PURE__*/_jsx(Row, {
|
61
61
|
gutter: [16, 20],
|
62
|
-
children: /*#__PURE__*/
|
63
|
-
children:
|
62
|
+
children: /*#__PURE__*/_jsx(Col, {
|
63
|
+
children: /*#__PURE__*/_jsx(Button, {
|
64
64
|
onClick: function onClick() {
|
65
65
|
McModalProvider.show(demoModal, {
|
66
66
|
title: '编辑弹窗',
|
@@ -71,15 +71,7 @@ export default (function () {
|
|
71
71
|
});
|
72
72
|
},
|
73
73
|
children: "Modal"
|
74
|
-
})
|
75
|
-
onClick: function onClick() {
|
76
|
-
Modal.info({
|
77
|
-
title: '信息弹窗',
|
78
|
-
content: '具体内容'
|
79
|
-
});
|
80
|
-
},
|
81
|
-
children: "Modal Info"
|
82
|
-
})]
|
74
|
+
})
|
83
75
|
})
|
84
76
|
})]
|
85
77
|
});
|
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLit
|
|
2
2
|
var _templateObject;
|
3
3
|
// @ts-nocheck
|
4
4
|
import { createGlobalStyle } from 'antd-style';
|
5
|
-
var globalStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\n// <====================== Layout ======================>\n\n", "\n\n// <====================== Font ======================>\n\n@font-face {\n font-family: 'SourceHanSansCN';\n src: url(", ");\n}\n\nbody * {\n font-family: 'SourceHanSansCN';\n box-sizing: border-box;\n}\n\n// <====================== Button ======================>\n\n// primary\n.ant-btn-primary[disabled]{\n background: ", ";\n color: ", ";\n opacity: 0.3;\n}\n\n// default\n.ant-btn-default[disabled] {\n border-color: ", " !important;\n}\n\n// danger\n.ant-btn-default.ant-btn-dangerous,.ant-btn-default[data-danger],\n.ant-btn-default.ant-btn-dangerous[disabled],.ant-btn-default[data-danger][disabled] {\n color: ", ";\n background: ", ";\n border-color:", ";\n\n &:hover {\n color: ", " !important;\n background: ", " !important;\n border-color:", " !important;\n }\n\n &:active {\n color: ", " !important;\n }\n}\n.ant-btn-default.ant-btn-dangerous[disabled],.ant-btn-default[data-danger][disabled] {\n opacity: 0.4;\n}\n\n// secondary\n.ant-btn-default[data-secondary],\n// modal\u3001drawer\u3001popconfirm footer\n.ant-modal-footer .ant-btn-default:not([data-default]):not([data-danger]):not(.ant-btn-dangerous),\n.ant-drawer-footer .ant-btn-default:not([data-default]):not([data-danger]):not(.ant-btn-dangerous),\n.ant-popconfirm-buttons .ant-btn-default:not([data-default]):not([data-danger]):not(.ant-btn-dangerous){\n background: ", ";\n border-color: ", ";\n\n &:hover {\n background: ", " !important;\n border-color: ", " !important;\n }\n\n &:active {\n border-color: ", " !important;\n color: ", " !important;\n }\n}\n\n.ant-btn-default[data-secondary][disabled] {\n color: ", " ;\n background: ", ";\n border-color: ", " !important;\n\n &:hover {\n color: ", ";\n background: ", " !important;\n border-color: ", " !important;\n }\n\n &:active {\n color: ", " !important;\n border-color: ", " !important;\n }\n}\n\n// add\n.ant-btn-default[data-add] {\n background: ", " !important;\n color: ", " !important;\n border-color: ", " !important;\n\n &:hover {\n color: ", " !important;\n background: ", " !important;\n border-color: ", " !important;\n }\n\n &:active{\n color: ", " !important;\n }\n}\n\n.ant-btn-default[data-add][disabled] {\n opacity: 0.4;\n color: ", ";\n\n &:hover {\n background: ", " !important;\n color: ", " !important;\n }\n\n &:active{\n background: ", " !important;\n color: ", " !important;\n }\n}\n\n//dashed\n.ant-btn-dashed {\n background: ", " !important;\n border-color: ", " !important;\n}\n\n.ant-btn-dashed:not([disabled]) {\n &:hover {\n background: ", " !important;\n color: ", " !important;\n border-color: ", " !important;\n }\n\n &:active{\n color: ", " !important;\n border-color: ", " !important;\n }\n}\n\n// dashed danger\n.ant-btn-dashed.ant-btn-dangerous,\n.ant-btn-dashed.ant-btn-dangerous:disabled {\n color: ", " !important;\n border-color: ", " !important;\n\n &:hover {\n color: ", " !important;\n border-color: ", " !important;\n }\n\n &:active {\n color: ", " !important;\n }\n}\n.ant-btn-dashed.ant-btn-dangerous:disabled {\n opacity: 0.4;\n\n &:hover {\n color: ", " !important;\n border-color: ", " !important;\n }\n\n &:active {\n color: ", " !important;\n border-color: ", " !important;\n }\n}\n\n// ghost\n.ant-btn-background-ghost:not([disabled]) {\n &:hover {\n color: ", " !important;\n border-color: ", " !important;\n }\n\n &:active {\n color: ", " !important;\n border-color: ", " !important;\n }\n}\n\n// link\n.ant-btn-link:not([disabled]) {\n &:hover {\n color: ", " !important;\n }\n\n &:active {\n color: ", " !important;\n\n }\n}\n\n.ant-btn-link[disabled] {\n color: ", " !important;\n opacity: 0.3;\n}\n\n// link danger\n.ant-btn-link.ant-btn-dangerous {\n\n &:hover {\n color: ", " !important;\n }\n\n &:active {\n color: ", " !important;\n }\n}\n\n.ant-btn-link.ant-btn-dangerous:disabled {\n color: ", " !important;\n opacity: 0.3;\n}\n\n\n\n// <====================== Drawer ======================>\n\n.ant-drawer .ant-drawer-header{\n border-bottom: none;\n padding: 23px 24px;\n .ant-drawer-header-title {\n flex-direction: row-reverse;\n .ant-drawer-close {\n margin: -4px;\n }\n }\n}\n// Drawer \u5BBD\u9AD8 \u4E1A\u52A1\u65B9\u81EA\u884C\u5B9E\u73B0\n//.ant-drawer .ant-drawer-content-wrapper {\n// min-width: 480px\n//}\n.ant-drawer .ant-drawer-body{\n padding: 0 24px;\n}\n.ant-drawer .ant-drawer-footer{\n border-top: none;\n padding: 24px;\n}\n\n// <====================== Modal ======================>\n.ant-modal .ant-modal-content {\n padding: 24px;\n}\n.ant-modal .ant-modal-header {\n margin-bottom:24px;\n}\n.ant-modal .ant-modal-footer {\n margin-top: 24px;\n}\n.ant-modal .ant-modal-content {\n top: 16px;\n}\n.ant-modal-body {\n overflow-y: auto\n}\n\n/*\u5F53\u9875\u9762\u5BBD\u5EA6\u5927\u4E8E1280px\u4E14\u5C0F\u4E8E1366px\u7684\u65F6\u5019\u6267\u884C,1280-1366*/\n@media screen and (min-width:1280px) and (max-width: 1366px){\n .ant-modal-root[data-small] {\n .ant-modal-body {\n max-height: 150px;\n }\n .ant-modal {\n top: 150px;\n }\n }\n\n .ant-modal-root[data-medium] {\n .ant-modal-body {\n max-height: 300px;\n min-height: 150px\n }\n .ant-modal {\n top: 80px;\n }\n }\n\n .ant-modal-root[data-large] {\n .ant-modal-body {\n max-height: 450px;\n min-height: 300px\n }\n .ant-modal {\n top: 40px;\n }\n }\n}\n\n/*\u5F53\u9875\u9762\u5BBD\u5EA6\u5927\u4E8E1440px\u4E14\u5C0F\u4E8E1600px\u7684\u65F6\u5019\u6267\u884C,1440-1600*/\n@media screen and (min-width:1440px) and (max-width:1600px){\n .ant-modal-root[data-small] {\n .ant-modal-body {\n max-height: 150px;\n }\n .ant-modal {\n top: 200px;\n }\n }\n\n .ant-modal-root[data-medium] {\n .ant-modal-body {\n max-height: 300px;\n min-height: 150px\n }\n .ant-modal {\n top: 150px;\n }\n }\n\n .ant-modal-root[data-large] {\n .ant-modal-body {\n max-height: 450px;\n min-height: 300px\n }\n .ant-modal {\n top: 80px;\n }\n }\n}\n/*\u5F53\u9875\u9762\u5BBD\u5EA6\u5927\u4E8E1680px\u4E14\u5C0F\u4E8E1920px\u7684\u65F6\u5019\u6267\u884C,1680-1920*/\n@media screen and (min-width:1680px) and (max-width:2560px){\n .ant-modal-root[data-small] {\n .ant-modal-body {\n max-height: 150px;\n }\n .ant-modal {\n top: 200px;\n }\n }\n\n .ant-modal-root[data-medium] {\n .ant-modal-body {\n max-height: 300px;\n min-height: 150px\n }\n .ant-modal {\n top: 150px;\n }\n }\n\n .ant-modal-root[data-large] {\n .ant-modal-body {\n max-height: 450px;\n min-height: 300px\n }\n .ant-modal {\n top: 150px;\n }\n }\n}\n\n// <====================== Tabs ======================>\n\n.ant-tabs .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {\n text-shadow: unset;\n}\n.ant-tabs-card {\n .ant-tabs-nav {\n margin: 0;\n &::before {\n border: none;\n }\n .ant-tabs-nav-wrap {\n background: transparent;\n .ant-tabs-nav-list {\n background: ", ";\n border-top-right-radius: ", "px;\n .ant-tabs-tab {\n position: relative;\n border: ", ";\n border-radius: ", "px ", "px 0px 0px;\n &::after {\n position: absolute;\n top: 11px;\n right: -1px;\n width: 1px;\n height: 24px;\n background: ", ";\n content: '';\n }\n }\n .ant-tabs-nav-add {\n position: relative;\n border: none;\n border-top-right-radius: ", "px;\n &::before {\n position: absolute;\n top: 11px;\n left: 1px;\n width: 1px;\n height: 24px;\n background: ", ";\n content: '';\n }\n }\n .ant-tabs-tab-active {\n border: ", ";\n &::after {\n display: none;\n }\n }\n .ant-tabs-tab:nth-last-of-type(2) {\n &::after {\n display: none;\n }\n }\n .ant-tabs-tab:has(+ .ant-tabs-tab-active) {\n &::after {\n display: none;\n }\n }\n }\n }\n }\n}\n\n// <====================== Pagination ======================>\n\n.ant-pagination {\n display: flex;\n align-items: center;\n\n .ant-pagination-total-text {\n margin-right: auto;\n color: ", ";\n }\n\n .ant-pagination-item.ant-pagination-item-active {\n &:hover {\n border-color: ", ";\n }\n\n &>a {\n color: ", ";\n }\n }\n\n .ant-pagination-options {\n .ant-pagination-options-quick-jumper {\n input {\n background: ", ";\n border-color: ", ";\n padding: 12px;\n\n &:hover {\n border-color: ", ";\n }\n\n &:focus {\n border-color: ", ";\n }\n }\n }\n }\n\n &.ant-pagination-mini li:not(:first-of-type) {\n margin-left: 2px;\n }\n}\n\n// <====================== Radio ======================>\n .ant-radio-group {\n .ant-radio-button-wrapper {\n position: relative;\n border: 1px solid ", ";\n &::before {\n display: none;\n }\n &::after {\n display: inline-block;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: 1px;\n height: ", "px;\n background: ", ";\n right: -1px;\n content: '';\n }\n }\n .ant-radio-button-wrapper-checked {\n border: 1px solid ", ";\n &::after {\n display: none;\n }\n }\n .ant-radio-button-wrapper:nth-last-of-type(1) {\n &::after {\n display: none;\n }\n }\n .ant-radio-button-wrapper:has(+ .ant-radio-button-wrapper-checked) {\n &::after {\n display: none;\n }\n }\n .ant-radio-button-wrapper-disabled {\n border: 1px solid ", " !important;\n }\n .ant-radio-button-wrapper-disabled.ant-radio-button-wrapper-checked {\n border-color: ", " !important;\n }\n}\n// <====================== Collapse ======================>\n.ant-collapse .ant-collapse-content {\n border-top-width: 0px;\n}\n\n// <====================== Card ======================>\n.ant-card-type-inner .ant-card-head {\n border-bottom-width: 0;\n background: #FAFAFA;\n}\n\n.ant-table-sticky-scroll-bar {\n opacity: 0.5;\n height: 6px;\n}\n"])), function (props) {
|
5
|
+
var globalStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\n// <====================== Layout ======================>\n\n", "\n\n// <====================== Font ======================>\n\n@font-face {\n font-family: 'SourceHanSansCN';\n src: url(", ");\n}\n\nbody * {\n font-family: 'SourceHanSansCN';\n box-sizing: border-box;\n}\n\n// <====================== Button ======================>\n\n// primary\n.ant-btn-primary[disabled]{\n background: ", ";\n color: ", ";\n opacity: 0.3;\n}\n\n// default\n.ant-btn-default[disabled] {\n border-color: ", " !important;\n}\n\n// danger\n.ant-btn-default.ant-btn-dangerous,.ant-btn-default[data-danger],\n.ant-btn-default.ant-btn-dangerous[disabled],.ant-btn-default[data-danger][disabled] {\n color: ", ";\n background: ", ";\n border-color:", ";\n\n &:hover {\n color: ", " !important;\n background: ", " !important;\n border-color:", " !important;\n }\n\n &:active {\n color: ", " !important;\n }\n}\n.ant-btn-default.ant-btn-dangerous[disabled],.ant-btn-default[data-danger][disabled] {\n opacity: 0.4;\n}\n\n// secondary\n.ant-btn-default[data-secondary],\n// modal\u3001drawer\u3001popconfirm footer\n.ant-modal-footer .ant-btn-default:not([data-default]):not([data-danger]):not(.ant-btn-dangerous),\n.ant-drawer-footer .ant-btn-default:not([data-default]):not([data-danger]):not(.ant-btn-dangerous),\n.ant-popconfirm-buttons .ant-btn-default:not([data-default]):not([data-danger]):not(.ant-btn-dangerous){\n background: ", ";\n border-color: ", ";\n\n &:hover {\n background: ", " !important;\n border-color: ", " !important;\n }\n\n &:active {\n border-color: ", " !important;\n color: ", " !important;\n }\n}\n\n.ant-btn-default[data-secondary][disabled] {\n color: ", " ;\n background: ", ";\n border-color: ", " !important;\n\n &:hover {\n color: ", ";\n background: ", " !important;\n border-color: ", " !important;\n }\n\n &:active {\n color: ", " !important;\n border-color: ", " !important;\n }\n}\n\n// add\n.ant-btn-default[data-add] {\n background: ", " !important;\n color: ", " !important;\n border-color: ", " !important;\n\n &:hover {\n color: ", " !important;\n background: ", " !important;\n border-color: ", " !important;\n }\n\n &:active{\n color: ", " !important;\n }\n}\n\n.ant-btn-default[data-add][disabled] {\n opacity: 0.4;\n color: ", ";\n\n &:hover {\n background: ", " !important;\n color: ", " !important;\n }\n\n &:active{\n background: ", " !important;\n color: ", " !important;\n }\n}\n\n//dashed\n.ant-btn-dashed {\n background: ", " !important;\n border-color: ", " !important;\n}\n\n.ant-btn-dashed:not([disabled]) {\n &:hover {\n background: ", " !important;\n color: ", " !important;\n border-color: ", " !important;\n }\n\n &:active{\n color: ", " !important;\n border-color: ", " !important;\n }\n}\n\n// dashed danger\n.ant-btn-dashed.ant-btn-dangerous,\n.ant-btn-dashed.ant-btn-dangerous:disabled {\n color: ", " !important;\n border-color: ", " !important;\n\n &:hover {\n color: ", " !important;\n border-color: ", " !important;\n }\n\n &:active {\n color: ", " !important;\n }\n}\n.ant-btn-dashed.ant-btn-dangerous:disabled {\n opacity: 0.4;\n\n &:hover {\n color: ", " !important;\n border-color: ", " !important;\n }\n\n &:active {\n color: ", " !important;\n border-color: ", " !important;\n }\n}\n\n// ghost\n.ant-btn-background-ghost:not([disabled]) {\n &:hover {\n color: ", " !important;\n border-color: ", " !important;\n }\n\n &:active {\n color: ", " !important;\n border-color: ", " !important;\n }\n}\n\n// link\n.ant-btn-link:not([disabled]) {\n &:hover {\n color: ", " !important;\n }\n\n &:active {\n color: ", " !important;\n\n }\n}\n\n.ant-btn-link[disabled] {\n color: ", " !important;\n opacity: 0.3;\n}\n\n// link danger\n.ant-btn-link.ant-btn-dangerous {\n\n &:hover {\n color: ", " !important;\n }\n\n &:active {\n color: ", " !important;\n }\n}\n\n.ant-btn-link.ant-btn-dangerous:disabled {\n color: ", " !important;\n opacity: 0.3;\n}\n\n\n\n// <====================== Drawer ======================>\n\n.ant-drawer .ant-drawer-header{\n border-bottom: none;\n padding: 23px 24px;\n .ant-drawer-header-title {\n flex-direction: row-reverse;\n .ant-drawer-close {\n margin: -4px;\n }\n }\n}\n// Drawer \u5BBD\u9AD8 \u4E1A\u52A1\u65B9\u81EA\u884C\u5B9E\u73B0\n//.ant-drawer .ant-drawer-content-wrapper {\n// min-width: 480px\n//}\n.ant-drawer .ant-drawer-body{\n padding: 0 24px;\n}\n.ant-drawer .ant-drawer-footer{\n border-top: none;\n padding: 24px;\n}\n\n// <====================== Modal ======================>\n\n.ant-modal .ant-modal-header {\n margin-bottom:24px;\n}\n.ant-modal-body {\n overflow-y: auto\n}\n\n/*\u5F53\u9875\u9762\u5BBD\u5EA6\u5927\u4E8E1280px\u4E14\u5C0F\u4E8E1366px\u7684\u65F6\u5019\u6267\u884C,1280-1366*/\n@media screen and (min-width:1280px) and (max-width: 1366px){\n .ant-modal-root[data-small] {\n .ant-modal-body {\n max-height: 150px;\n }\n .ant-modal {\n top: 150px;\n }\n }\n\n .ant-modal-root[data-medium] {\n .ant-modal-body {\n max-height: 300px;\n min-height: 150px\n }\n .ant-modal {\n top: 80px;\n }\n }\n\n .ant-modal-root[data-large] {\n .ant-modal-body {\n max-height: 450px;\n min-height: 300px\n }\n .ant-modal {\n top: 40px;\n }\n }\n}\n\n/*\u5F53\u9875\u9762\u5BBD\u5EA6\u5927\u4E8E1440px\u4E14\u5C0F\u4E8E1600px\u7684\u65F6\u5019\u6267\u884C,1440-1600*/\n@media screen and (min-width:1440px) and (max-width:1600px){\n .ant-modal-root[data-small] {\n .ant-modal-body {\n max-height: 150px;\n }\n .ant-modal {\n top: 200px;\n }\n }\n\n .ant-modal-root[data-medium] {\n .ant-modal-body {\n max-height: 300px;\n min-height: 150px\n }\n .ant-modal {\n top: 150px;\n }\n }\n\n .ant-modal-root[data-large] {\n .ant-modal-body {\n max-height: 450px;\n min-height: 300px\n }\n .ant-modal {\n top: 80px;\n }\n }\n}\n/*\u5F53\u9875\u9762\u5BBD\u5EA6\u5927\u4E8E1680px\u4E14\u5C0F\u4E8E1920px\u7684\u65F6\u5019\u6267\u884C,1680-1920*/\n@media screen and (min-width:1680px) and (max-width:2560px){\n .ant-modal-root[data-small] {\n .ant-modal-body {\n max-height: 150px;\n }\n .ant-modal {\n top: 200px;\n }\n }\n\n .ant-modal-root[data-medium] {\n .ant-modal-body {\n max-height: 300px;\n min-height: 150px\n }\n .ant-modal {\n top: 150px;\n }\n }\n\n .ant-modal-root[data-large] {\n .ant-modal-body {\n max-height: 450px;\n min-height: 300px\n }\n .ant-modal {\n top: 150px;\n }\n }\n}\n\n// <====================== Tabs ======================>\n\n.ant-tabs .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {\n text-shadow: unset;\n}\n.ant-tabs-card {\n .ant-tabs-nav {\n margin: 0;\n &::before {\n border: none;\n }\n .ant-tabs-nav-wrap {\n background: transparent;\n .ant-tabs-nav-list {\n background: ", ";\n border-top-right-radius: ", "px;\n .ant-tabs-tab {\n position: relative;\n border: ", ";\n border-radius: ", "px ", "px 0px 0px;\n &::after {\n position: absolute;\n top: 11px;\n right: -1px;\n width: 1px;\n height: 24px;\n background: ", ";\n content: '';\n }\n }\n .ant-tabs-nav-add {\n position: relative;\n border: none;\n border-top-right-radius: ", "px;\n &::before {\n position: absolute;\n top: 11px;\n left: 1px;\n width: 1px;\n height: 24px;\n background: ", ";\n content: '';\n }\n }\n .ant-tabs-tab-active {\n border: ", ";\n &::after {\n display: none;\n }\n }\n .ant-tabs-tab:nth-last-of-type(2) {\n &::after {\n display: none;\n }\n }\n .ant-tabs-tab:has(+ .ant-tabs-tab-active) {\n &::after {\n display: none;\n }\n }\n }\n }\n }\n}\n\n// <====================== Pagination ======================>\n\n.ant-pagination {\n display: flex;\n align-items: center;\n\n .ant-pagination-total-text {\n margin-right: auto;\n color: ", ";\n }\n\n .ant-pagination-item.ant-pagination-item-active {\n &:hover {\n border-color: ", ";\n }\n\n &>a {\n color: ", ";\n }\n }\n\n .ant-pagination-options {\n .ant-pagination-options-quick-jumper {\n input {\n background: ", ";\n border-color: ", ";\n padding: 12px;\n\n &:hover {\n border-color: ", ";\n }\n\n &:focus {\n border-color: ", ";\n }\n }\n }\n }\n\n &.ant-pagination-mini li:not(:first-of-type) {\n margin-left: 2px;\n }\n}\n\n// <====================== Radio ======================>\n .ant-radio-group {\n .ant-radio-button-wrapper {\n position: relative;\n border: 1px solid ", ";\n &::before {\n display: none;\n }\n &::after {\n display: inline-block;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: 1px;\n height: ", "px;\n background: ", ";\n right: -1px;\n content: '';\n }\n }\n .ant-radio-button-wrapper-checked {\n border: 1px solid ", ";\n &::after {\n display: none;\n }\n }\n .ant-radio-button-wrapper:nth-last-of-type(1) {\n &::after {\n display: none;\n }\n }\n .ant-radio-button-wrapper:has(+ .ant-radio-button-wrapper-checked) {\n &::after {\n display: none;\n }\n }\n .ant-radio-button-wrapper-disabled {\n border: 1px solid ", " !important;\n }\n .ant-radio-button-wrapper-disabled.ant-radio-button-wrapper-checked {\n border-color: ", " !important;\n }\n}\n// <====================== Collapse ======================>\n.ant-collapse .ant-collapse-content {\n border-top-width: 0px;\n}\n\n// <====================== Card ======================>\n.ant-card-type-inner .ant-card-head {\n border-bottom-width: 0;\n background: #FAFAFA;\n}\n\n.ant-table-wrapper .ant-table-sticky-scroll-bar {\n opacity: 0.5;\n height: 6px;\n}\n"])), function (props) {
|
6
6
|
return props.layout;
|
7
7
|
}, function (props) {
|
8
8
|
return props.font.Regular;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { Form, Radio } from 'antd';
|
2
|
+
import "../index.css";
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
4
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
5
|
+
export default (function () {
|
6
|
+
return /*#__PURE__*/_jsxs("div", {
|
7
|
+
children: [/*#__PURE__*/_jsx(Form.Item, {
|
8
|
+
label: ".text-center",
|
9
|
+
children: /*#__PURE__*/_jsx("div", {
|
10
|
+
style: {
|
11
|
+
width: 100,
|
12
|
+
border: '1px solid grey'
|
13
|
+
},
|
14
|
+
className: "text-center",
|
15
|
+
children: "\u6587\u5B57\u5C45\u4E2D"
|
16
|
+
})
|
17
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
18
|
+
label: ".text-ellipsis",
|
19
|
+
children: /*#__PURE__*/_jsx("div", {
|
20
|
+
style: {
|
21
|
+
width: 100,
|
22
|
+
border: '1px solid grey'
|
23
|
+
},
|
24
|
+
className: "text-ellipsis",
|
25
|
+
children: "\u5C3E\u90E8\u8D85\u51FA\u7701\u7565\u5C3E\u90E8\u8D85\u51FA\u7701\u7565\u5C3E\u90E8\u8D85\u51FA\u7701\u7565\u5C3E\u90E8\u8D85\u51FA\u7701\u7565"
|
26
|
+
})
|
27
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
28
|
+
label: "\u7B49\u5BBDRadioButton .equal-radio-group",
|
29
|
+
children: /*#__PURE__*/_jsxs(Radio.Group, {
|
30
|
+
className: "equal-radio-group",
|
31
|
+
children: [/*#__PURE__*/_jsx(Radio.Button, {
|
32
|
+
value: "a",
|
33
|
+
children: "A"
|
34
|
+
}), /*#__PURE__*/_jsx(Radio.Button, {
|
35
|
+
value: "b",
|
36
|
+
children: "B"
|
37
|
+
}), /*#__PURE__*/_jsx(Radio.Button, {
|
38
|
+
value: "c",
|
39
|
+
children: "C\u5F88\u957F\u5F88\u957F"
|
40
|
+
})]
|
41
|
+
})
|
42
|
+
})]
|
43
|
+
});
|
44
|
+
});
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
+
var _excluded = ["key", "name"];
|
4
|
+
import { Button, Form, Input, Space } from 'antd';
|
5
|
+
import { DeleteOutlined, PlusOutlined } from 'much-icons';
|
6
|
+
import "../index.css";
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
9
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
10
|
+
export default (function () {
|
11
|
+
return /*#__PURE__*/_jsx("div", {
|
12
|
+
children: /*#__PURE__*/_jsx(Form, {
|
13
|
+
layout: "vertical",
|
14
|
+
children: /*#__PURE__*/_jsx(Form.List, {
|
15
|
+
name: "items",
|
16
|
+
initialValue: [{
|
17
|
+
name: '',
|
18
|
+
description: ''
|
19
|
+
}] // 初始数据
|
20
|
+
,
|
21
|
+
children: function children(fields, _ref) {
|
22
|
+
var add = _ref.add,
|
23
|
+
remove = _ref.remove;
|
24
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
25
|
+
children: [fields.map(function (_ref2) {
|
26
|
+
var key = _ref2.key,
|
27
|
+
name = _ref2.name,
|
28
|
+
restField = _objectWithoutProperties(_ref2, _excluded);
|
29
|
+
return /*#__PURE__*/_jsxs(Space, {
|
30
|
+
style: {
|
31
|
+
display: 'flex',
|
32
|
+
marginBottom: 0
|
33
|
+
},
|
34
|
+
align: "baseline",
|
35
|
+
children: [/*#__PURE__*/_jsx(Form.Item, _objectSpread(_objectSpread({}, restField), {}, {
|
36
|
+
name: [name, 'name'],
|
37
|
+
rules: [{
|
38
|
+
required: true,
|
39
|
+
message: '请输入名称'
|
40
|
+
}],
|
41
|
+
children: /*#__PURE__*/_jsx(Input, {
|
42
|
+
placeholder: "\u540D\u79F0"
|
43
|
+
})
|
44
|
+
})), /*#__PURE__*/_jsx(Form.Item, _objectSpread(_objectSpread({}, restField), {}, {
|
45
|
+
name: [name, 'description'],
|
46
|
+
rules: [{
|
47
|
+
required: true,
|
48
|
+
message: '请输入描述'
|
49
|
+
}],
|
50
|
+
children: /*#__PURE__*/_jsx(Input, {
|
51
|
+
placeholder: "\u63CF\u8FF0"
|
52
|
+
})
|
53
|
+
})), /*#__PURE__*/_jsx(DeleteOutlined, {
|
54
|
+
className: "mc-delete-icon",
|
55
|
+
onClick: function onClick() {
|
56
|
+
return remove(name);
|
57
|
+
}
|
58
|
+
})]
|
59
|
+
}, key);
|
60
|
+
}), /*#__PURE__*/_jsx(Button, {
|
61
|
+
type: "link",
|
62
|
+
onClick: function onClick() {
|
63
|
+
return add();
|
64
|
+
},
|
65
|
+
icon: /*#__PURE__*/_jsx(PlusOutlined, {}),
|
66
|
+
children: "\u6DFB\u52A0"
|
67
|
+
})]
|
68
|
+
});
|
69
|
+
}
|
70
|
+
})
|
71
|
+
})
|
72
|
+
});
|
73
|
+
});
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { Card, Form, Input, Space } from 'antd';
|
2
|
+
import "../index.css";
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
4
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
5
|
+
export default (function () {
|
6
|
+
return /*#__PURE__*/_jsx("div", {
|
7
|
+
children: /*#__PURE__*/_jsx("div", {
|
8
|
+
children: /*#__PURE__*/_jsxs(Space, {
|
9
|
+
children: [/*#__PURE__*/_jsxs(Card, {
|
10
|
+
type: "inner",
|
11
|
+
title: "\u9ED8\u8BA4\u72B6\u6001\uFF0C\u5E95\u90E8\u95F4\u8DDD\u8FC7\u5927",
|
12
|
+
children: [/*#__PURE__*/_jsx(Form.Item, {
|
13
|
+
label: "\u59D3\u540D",
|
14
|
+
children: /*#__PURE__*/_jsx(Input, {})
|
15
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
16
|
+
label: "\u5E74\u9F84",
|
17
|
+
children: /*#__PURE__*/_jsx(Input, {})
|
18
|
+
})]
|
19
|
+
}), /*#__PURE__*/_jsxs(Card, {
|
20
|
+
type: "inner",
|
21
|
+
title: "\u6DFB\u52A0className='card-last-form-item-mb0',\u53BB\u6389\u5E95\u90E8\u95F4\u8DDD",
|
22
|
+
className: "card-last-form-item-mb0",
|
23
|
+
children: [/*#__PURE__*/_jsx(Form.Item, {
|
24
|
+
label: "\u59D3\u540D",
|
25
|
+
children: /*#__PURE__*/_jsx(Input, {})
|
26
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
27
|
+
label: "\u5E74\u9F84",
|
28
|
+
children: /*#__PURE__*/_jsx(Input, {})
|
29
|
+
})]
|
30
|
+
})]
|
31
|
+
})
|
32
|
+
})
|
33
|
+
});
|
34
|
+
});
|
package/dist/index.d.ts
CHANGED
@@ -19,6 +19,7 @@ export * from './McContainer';
|
|
19
19
|
export { default as McContainer } from './McContainer';
|
20
20
|
export * from './McDateRange';
|
21
21
|
export { default as McDateRange } from './McDateRange';
|
22
|
+
export * from './McEllipsisMiddle';
|
22
23
|
export * from './McInput';
|
23
24
|
export { default as McInput } from './McInput';
|
24
25
|
export * from './McSelect';
|
package/dist/index.js
CHANGED
@@ -19,6 +19,7 @@ export * from "./McContainer";
|
|
19
19
|
export { default as McContainer } from "./McContainer";
|
20
20
|
export * from "./McDateRange";
|
21
21
|
export { default as McDateRange } from "./McDateRange";
|
22
|
+
export * from "./McEllipsisMiddle";
|
22
23
|
export * from "./McInput";
|
23
24
|
export { default as McInput } from "./McInput";
|
24
25
|
export * from "./McSelect";
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zykj2024/much-library",
|
3
|
-
"version": "1.0.12-beta.
|
3
|
+
"version": "1.0.12-beta.6",
|
4
4
|
"description": "react library",
|
5
5
|
"license": "MIT",
|
6
6
|
"module": "dist/index.js",
|
@@ -47,6 +47,7 @@
|
|
47
47
|
"@babel/runtime": "^7.25.6",
|
48
48
|
"@dnd-kit/core": "^6.1.0",
|
49
49
|
"@dnd-kit/sortable": "^8.0.0",
|
50
|
+
"@zykj2024/much-hooks": "^1.0.0",
|
50
51
|
"antd": "^5.16.2",
|
51
52
|
"antd-style": "^3.6.2",
|
52
53
|
"dayjs": "^1.11.12",
|
File without changes
|