@ccs-ui/rc-pro 2.3.4 → 2.3.6-alpha-1
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/es/aj-captcha/index.d.ts +5 -2
- package/es/aj-captcha/index.js +6 -2
- package/es/auth/index.d.ts +3 -0
- package/es/auth/index.js +3 -0
- package/es/button/dropdown.js +5 -17
- package/es/button/group.js +47 -65
- package/es/button/index.d.ts +4 -11
- package/es/button/index.js +10 -13
- package/es/cascader/index.d.ts +6 -3
- package/es/cascader/index.js +11 -7
- package/es/ccs.d.ts +9 -10
- package/es/color-picker/index.d.ts +5 -1
- package/es/color-picker/index.js +6 -2
- package/es/context/index.d.ts +24 -2
- package/es/date-picker/index.d.ts +1 -0
- package/es/date-picker/index.js +3 -0
- package/es/dialog/HookDrawer.js +3 -1
- package/es/dialog/HookModal.js +3 -1
- package/es/dialog/context.d.ts +2 -1
- package/es/dialog/hook.d.ts +10 -0
- package/es/dialog/index.d.ts +3 -1
- package/es/dialog/index.js +3 -0
- package/es/editor/index.d.ts +1 -0
- package/es/editor/index.js +3 -0
- package/es/ellipsis/index.d.ts +21 -5
- package/es/ellipsis/index.js +117 -28
- package/es/ellipsis/index.less +5 -0
- package/es/ellipsis/useMeasure.d.ts +9 -0
- package/es/ellipsis/useMeasure.js +142 -0
- package/es/ellipsis/useResizeEffect.d.ts +2 -0
- package/es/ellipsis/useResizeEffect.js +28 -0
- package/es/ellipsis/withStopPropagation.d.ts +4 -0
- package/es/ellipsis/withStopPropagation.js +38 -0
- package/es/hooks/use-app.d.ts +7 -2
- package/es/hooks/use-app.js +8 -3
- package/es/hooks/use-selection.d.ts +28 -0
- package/es/hooks/use-selection.js +146 -0
- package/es/index.d.ts +3 -2
- package/es/index.js +3 -2
- package/es/interval-button/index.js +3 -0
- package/es/layout-keep-alive/index.d.ts +10 -13
- package/es/layout-keep-alive/index.js +98 -60
- package/es/layout-keep-alive/page.d.ts +3 -5
- package/es/layout-keep-alive/page.js +9 -5
- package/es/layout-single-page/index.d.ts +5 -3
- package/es/layout-single-page/index.js +14 -20
- package/es/layout-single-page/page.d.ts +3 -5
- package/es/layout-single-page/page.js +7 -2
- package/es/loading/index.d.ts +4 -1
- package/es/loading/index.js +4 -1
- package/es/pro-table/head.d.ts +8 -7
- package/es/pro-table/head.js +54 -100
- package/es/pro-table/index.d.ts +8 -8
- package/es/pro-table/index.js +8 -3
- package/es/pro-table/index.less +8 -3
- package/es/pro-table/selection-alert.d.ts +18 -0
- package/es/pro-table/selection-alert.js +52 -0
- package/es/pro-table/summary.d.ts +8 -0
- package/es/pro-table/summary.js +32 -0
- package/es/pro-table/table.d.ts +37 -30
- package/es/pro-table/table.js +485 -265
- package/es/pro-table/tree.d.ts +1 -1
- package/es/pro-table/tree.js +9 -15
- package/es/pro-tabs/index.d.ts +5 -2
- package/es/pro-tabs/index.js +16 -6
- package/es/resize-observer.d.ts +2 -2
- package/es/resize-observer.js +2 -2
- package/es/result/index.d.ts +11 -15
- package/es/result/index.js +57 -54
- package/es/select/ modal.d.ts +16 -0
- package/es/select/ modal.js +100 -0
- package/es/select/api.d.ts +25 -0
- package/es/select/api.js +67 -0
- package/es/select/customize.d.ts +35 -0
- package/es/select/customize.js +140 -0
- package/es/select/index.d.ts +20 -20
- package/es/select/index.js +70 -80
- package/es/status-tag/index.d.ts +5 -1
- package/es/status-tag/index.js +6 -2
- package/es/table/index.d.ts +5 -2
- package/es/table/index.js +82 -42
- package/es/table/index.less +27 -42
- package/es/trigger/index.d.ts +1 -0
- package/es/trigger/index.js +1 -0
- package/es/upload/index.d.ts +4 -3
- package/es/upload/index.js +6 -3
- package/es/water-mark/index.d.ts +4 -1
- package/es/water-mark/index.js +3 -0
- package/package.json +5 -4
package/es/aj-captcha/index.d.ts
CHANGED
|
@@ -27,5 +27,8 @@ export type AjCaptchaProps = {
|
|
|
27
27
|
/** 校验方法 */
|
|
28
28
|
onValid: (point: Point | Point[], captchaType: 'sliding' | 'wordSelect') => void;
|
|
29
29
|
};
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
declare function AjCaptcha(props: AjCaptchaProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
declare namespace AjCaptcha {
|
|
32
|
+
var displayName: string;
|
|
33
|
+
}
|
|
34
|
+
export default AjCaptcha;
|
package/es/aj-captcha/index.js
CHANGED
|
@@ -271,7 +271,7 @@ function AjCaptchaWord(_ref3) {
|
|
|
271
271
|
})]
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
|
-
|
|
274
|
+
function AjCaptcha(props) {
|
|
275
275
|
var bodyPadding = props.captchaType === 'sliding' ? '10px 10px 0 10px' : 10;
|
|
276
276
|
return /*#__PURE__*/_jsx(Modal, {
|
|
277
277
|
width: 330,
|
|
@@ -295,4 +295,8 @@ export default function AjCaptcha(props) {
|
|
|
295
295
|
},
|
|
296
296
|
children: props.captchaType === 'sliding' ? /*#__PURE__*/_jsx(AjCaptchaSliding, _objectSpread({}, props)) : /*#__PURE__*/_jsx(AjCaptchaWord, _objectSpread({}, props))
|
|
297
297
|
});
|
|
298
|
-
}
|
|
298
|
+
}
|
|
299
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
300
|
+
AjCaptcha.displayName = 'CcsAjCaptcha';
|
|
301
|
+
}
|
|
302
|
+
export default AjCaptcha;
|
package/es/auth/index.d.ts
CHANGED
|
@@ -9,4 +9,7 @@ export declare function ModalConfirm({ modalRef }: {
|
|
|
9
9
|
modalRef: any;
|
|
10
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
declare function CcsAuth({ auth, children }: CcsAuthProps): ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
12
|
+
declare namespace CcsAuth {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
12
15
|
export default CcsAuth;
|
package/es/auth/index.js
CHANGED
package/es/button/dropdown.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["auth", "menus", "children", "onClick"]
|
|
3
|
-
_excluded2 = ["onDisabled"];
|
|
2
|
+
var _excluded = ["auth", "menus", "children", "onClick"];
|
|
4
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -9,9 +8,8 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
9
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
10
|
import { Dropdown } from 'antd';
|
|
12
|
-
import React, {
|
|
11
|
+
import React, { useMemo } from 'react';
|
|
13
12
|
import { useCcsPage } from '..';
|
|
14
|
-
import { TableSelectionContext } from "../pro-table/table";
|
|
15
13
|
|
|
16
14
|
/**
|
|
17
15
|
* 带权限的Dropdown组件
|
|
@@ -23,12 +21,10 @@ export default function CssButtonDropdown(_ref) {
|
|
|
23
21
|
_ref$menus = _ref.menus,
|
|
24
22
|
menus = _ref$menus === void 0 ? [] : _ref$menus,
|
|
25
23
|
children = _ref.children,
|
|
26
|
-
|
|
24
|
+
onClick = _ref.onClick,
|
|
27
25
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
28
26
|
var _ref2 = useCcsPage() || {},
|
|
29
27
|
onAuth = _ref2.onAuth;
|
|
30
|
-
var _ref3 = useContext(TableSelectionContext) || {},
|
|
31
|
-
selectedRows = _ref3.selectedRows;
|
|
32
28
|
var items = useMemo(function () {
|
|
33
29
|
function filterTreeArray(menuItems) {
|
|
34
30
|
var mis = menuItems.filter(function (item) {
|
|
@@ -68,16 +64,8 @@ export default function CssButtonDropdown(_ref) {
|
|
|
68
64
|
return i.type !== 'divider';
|
|
69
65
|
}).length ? /*#__PURE__*/_jsx(Dropdown, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
70
66
|
menu: {
|
|
71
|
-
items: items
|
|
72
|
-
|
|
73
|
-
item = _objectWithoutProperties(_ref4, _excluded2);
|
|
74
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
75
|
-
disabled: (item === null || item === void 0 ? void 0 : item.disabled) || onDisabled && onDisabled(selectedRows)
|
|
76
|
-
});
|
|
77
|
-
}),
|
|
78
|
-
onClick: function onClick(e) {
|
|
79
|
-
if (_onClick) _onClick(e, selectedRows);
|
|
80
|
-
}
|
|
67
|
+
items: items,
|
|
68
|
+
onClick: onClick
|
|
81
69
|
},
|
|
82
70
|
children: renderChildren
|
|
83
71
|
})) : /*#__PURE__*/_jsx(_Fragment, {});
|
package/es/button/group.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["
|
|
3
|
-
_excluded2 = ["key", "label", "auth", "confirm"
|
|
4
|
-
_excluded3 = ["key", "label", "disabled", "auth", "confirm"
|
|
2
|
+
var _excluded = ["auth", "hidden"],
|
|
3
|
+
_excluded2 = ["key", "label", "auth", "confirm"],
|
|
4
|
+
_excluded3 = ["key", "label", "disabled", "auth", "confirm"];
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -12,13 +12,12 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
12
12
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
13
13
|
import { EllipsisOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
|
14
14
|
import { Button, Divider, Dropdown, Space } from 'antd';
|
|
15
|
-
import {
|
|
15
|
+
import { useRef } from 'react';
|
|
16
16
|
import { ModalConfirm } from '.';
|
|
17
17
|
import { useCcsPage } from '..';
|
|
18
|
-
import { TableSelectionContext } from "../pro-table/table";
|
|
19
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
19
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
21
|
export default function CssButtonGroup(_ref) {
|
|
23
22
|
var size = _ref.size,
|
|
24
23
|
isLink = _ref.isLink,
|
|
@@ -31,37 +30,25 @@ export default function CssButtonGroup(_ref) {
|
|
|
31
30
|
var _ref2 = useCcsPage() || {},
|
|
32
31
|
onAuth = _ref2.onAuth;
|
|
33
32
|
var modalRef = useRef(null);
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
|
|
34
|
+
// 有权限的按钮
|
|
36
35
|
var authButtons = [];
|
|
37
36
|
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
// 变量按钮
|
|
38
|
+
items.forEach(function (_ref3) {
|
|
39
|
+
var auth = _ref3.auth,
|
|
40
|
+
hidden = _ref3.hidden,
|
|
41
|
+
item = _objectWithoutProperties(_ref3, _excluded);
|
|
42
|
+
// 权限校验
|
|
43
|
+
if (onAuth && auth && !onAuth(auth)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (hidden) return;
|
|
47
|
+
authButtons.push(item);
|
|
41
48
|
});
|
|
49
|
+
if (!authButtons || items.length === 0) return null;
|
|
42
50
|
|
|
43
|
-
//
|
|
44
|
-
if (isLink) {
|
|
45
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
46
|
-
authButtons = authButtons.map(function (_ref4) {
|
|
47
|
-
var onDisabled = _ref4.onDisabled,
|
|
48
|
-
onHidden = _ref4.onHidden,
|
|
49
|
-
b = _objectWithoutProperties(_ref4, _excluded);
|
|
50
|
-
return _objectSpread({}, b);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// 需要判断权限
|
|
55
|
-
if (onAuth) {
|
|
56
|
-
authButtons = authButtons.filter(function (b) {
|
|
57
|
-
if (b.auth) return onAuth(b.auth);
|
|
58
|
-
return true;
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
if (!items || items.length === 0) return null;
|
|
62
|
-
|
|
63
|
-
// 当前菜单下查找按钮权限
|
|
64
|
-
var showBtns = authButtons.splice(0, showCount || items.length);
|
|
51
|
+
// 按钮点击
|
|
65
52
|
var handleOnClick = function handleOnClick(key) {
|
|
66
53
|
if (!onClick) return;
|
|
67
54
|
var item = items.find(function (i) {
|
|
@@ -77,13 +64,17 @@ export default function CssButtonGroup(_ref) {
|
|
|
77
64
|
okText: '确认',
|
|
78
65
|
cancelText: '取消',
|
|
79
66
|
onOk: function onOk() {
|
|
80
|
-
return onClick
|
|
67
|
+
return onClick === null || onClick === void 0 ? void 0 : onClick(key);
|
|
81
68
|
}
|
|
82
69
|
});
|
|
83
70
|
return;
|
|
84
71
|
}
|
|
85
|
-
onClick(key
|
|
72
|
+
onClick(key);
|
|
86
73
|
};
|
|
74
|
+
|
|
75
|
+
// 显示的按钮
|
|
76
|
+
var showBtns = authButtons.splice(0, showCount || items.length);
|
|
77
|
+
|
|
87
78
|
// link类型按钮
|
|
88
79
|
if (isLink) {
|
|
89
80
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
@@ -94,16 +85,13 @@ export default function CssButtonGroup(_ref) {
|
|
|
94
85
|
margin: 0
|
|
95
86
|
}
|
|
96
87
|
}),
|
|
97
|
-
children: showBtns === null || showBtns === void 0 ? void 0 : showBtns.map(function (
|
|
98
|
-
var key =
|
|
99
|
-
label =
|
|
100
|
-
auth =
|
|
101
|
-
confirm =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
onHidden = _ref5.onHidden,
|
|
105
|
-
restProps = _objectWithoutProperties(_ref5, _excluded2);
|
|
106
|
-
return /*#__PURE__*/_jsxs(Button, _objectSpread(_objectSpread({
|
|
88
|
+
children: showBtns === null || showBtns === void 0 ? void 0 : showBtns.map(function (_ref4) {
|
|
89
|
+
var key = _ref4.key,
|
|
90
|
+
label = _ref4.label,
|
|
91
|
+
auth = _ref4.auth,
|
|
92
|
+
confirm = _ref4.confirm,
|
|
93
|
+
restProps = _objectWithoutProperties(_ref4, _excluded2);
|
|
94
|
+
return /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
|
107
95
|
style: {
|
|
108
96
|
padding: 0
|
|
109
97
|
}
|
|
@@ -113,7 +101,7 @@ export default function CssButtonGroup(_ref) {
|
|
|
113
101
|
onClick: function onClick() {
|
|
114
102
|
return handleOnClick(key);
|
|
115
103
|
},
|
|
116
|
-
children:
|
|
104
|
+
children: label
|
|
117
105
|
}), key);
|
|
118
106
|
})
|
|
119
107
|
}), authButtons.length > 0 && /*#__PURE__*/_jsx(Dropdown, {
|
|
@@ -139,29 +127,23 @@ export default function CssButtonGroup(_ref) {
|
|
|
139
127
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
140
128
|
children: [/*#__PURE__*/_jsx(Space, {
|
|
141
129
|
wrap: true,
|
|
142
|
-
children: showBtns === null || showBtns === void 0 ? void 0 : showBtns.map(function (
|
|
143
|
-
var key =
|
|
144
|
-
label =
|
|
145
|
-
disabled =
|
|
146
|
-
auth =
|
|
147
|
-
confirm =
|
|
148
|
-
|
|
149
|
-
onDisabled = _ref6.onDisabled,
|
|
150
|
-
onHidden = _ref6.onHidden,
|
|
151
|
-
restProps = _objectWithoutProperties(_ref6, _excluded3);
|
|
152
|
-
// 按钮禁用
|
|
153
|
-
var isDisabled = disabled || onDisabled && onDisabled(selectedRows || []);
|
|
154
|
-
|
|
130
|
+
children: showBtns === null || showBtns === void 0 ? void 0 : showBtns.map(function (_ref5, index) {
|
|
131
|
+
var key = _ref5.key,
|
|
132
|
+
label = _ref5.label,
|
|
133
|
+
disabled = _ref5.disabled,
|
|
134
|
+
auth = _ref5.auth,
|
|
135
|
+
confirm = _ref5.confirm,
|
|
136
|
+
restProps = _objectWithoutProperties(_ref5, _excluded3);
|
|
155
137
|
// 更多按钮
|
|
156
138
|
if (index === showBtns.length - 1 && authButtons.length > 0) {
|
|
157
139
|
return /*#__PURE__*/_jsxs(Space.Compact, {
|
|
158
|
-
children: [/*#__PURE__*/
|
|
140
|
+
children: [/*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
159
141
|
size: size,
|
|
160
142
|
onClick: function onClick() {
|
|
161
143
|
return handleOnClick(key);
|
|
162
144
|
},
|
|
163
|
-
disabled:
|
|
164
|
-
children:
|
|
145
|
+
disabled: disabled,
|
|
146
|
+
children: label
|
|
165
147
|
})), /*#__PURE__*/_jsx(Dropdown, {
|
|
166
148
|
menu: {
|
|
167
149
|
items: authButtons,
|
|
@@ -176,13 +158,13 @@ export default function CssButtonGroup(_ref) {
|
|
|
176
158
|
})]
|
|
177
159
|
}, key);
|
|
178
160
|
}
|
|
179
|
-
return /*#__PURE__*/
|
|
161
|
+
return /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
180
162
|
size: size,
|
|
181
|
-
disabled:
|
|
163
|
+
disabled: disabled,
|
|
182
164
|
onClick: function onClick() {
|
|
183
165
|
return handleOnClick(key);
|
|
184
166
|
},
|
|
185
|
-
children:
|
|
167
|
+
children: label
|
|
186
168
|
}), key);
|
|
187
169
|
})
|
|
188
170
|
}), items.find(function (i) {
|
package/es/button/index.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export type DropdownMenuItemType = ItemType & {
|
|
|
11
11
|
auth?: string;
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
children?: DropdownMenuItemType[];
|
|
14
|
-
onDisabled?: (selectedRows?: any[]) => boolean;
|
|
15
14
|
};
|
|
16
15
|
export type CcsAuthDropdownProps = Omit<DropDownProps, 'overlay' | 'children'> & {
|
|
17
16
|
/** 权限标识 */
|
|
@@ -21,7 +20,7 @@ export type CcsAuthDropdownProps = Omit<DropDownProps, 'overlay' | 'children'> &
|
|
|
21
20
|
/** 自定义显示内容 */
|
|
22
21
|
children: ChildrenType;
|
|
23
22
|
/** 点击事件 */
|
|
24
|
-
onClick?: (info: MenuInfo
|
|
23
|
+
onClick?: (info: MenuInfo) => void;
|
|
25
24
|
};
|
|
26
25
|
export type CcsButtonGroupProps = {
|
|
27
26
|
/** 按钮尺寸 */
|
|
@@ -37,12 +36,12 @@ export type CcsButtonGroupProps = {
|
|
|
37
36
|
/** 更多文字 */
|
|
38
37
|
moreText?: string;
|
|
39
38
|
/** 点击事件 */
|
|
40
|
-
onClick?: (key: string
|
|
39
|
+
onClick?: (key: string) => void;
|
|
41
40
|
};
|
|
42
41
|
export declare function ModalConfirm({ modalRef }: {
|
|
43
42
|
modalRef: any;
|
|
44
43
|
}): import("react/jsx-runtime").JSX.Element;
|
|
45
|
-
export type CcsAuthButtonProps =
|
|
44
|
+
export type CcsAuthButtonProps = ButtonProps & {
|
|
46
45
|
/** 权限标识 */
|
|
47
46
|
auth?: string;
|
|
48
47
|
/** 文本 */
|
|
@@ -51,19 +50,13 @@ export type CcsAuthButtonProps = Omit<ButtonProps, 'onClick'> & {
|
|
|
51
50
|
confirm?: string;
|
|
52
51
|
/** 输入确认的值 */
|
|
53
52
|
inputConfirm?: string;
|
|
54
|
-
/** 显示当前选中的记录条数 */
|
|
55
|
-
showRowsCount?: boolean;
|
|
56
|
-
/** 点击事件 */
|
|
57
|
-
onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>, selectedRows?: any[]) => void;
|
|
58
|
-
/** 按钮禁用方法 */
|
|
59
|
-
onDisabled?: (selectedRows?: any[]) => boolean;
|
|
60
53
|
};
|
|
61
54
|
/**
|
|
62
55
|
* 带权限的按钮组件、继承Ant Button所有属性
|
|
63
56
|
* @param CcsAuthButtonProps
|
|
64
57
|
* @returns
|
|
65
58
|
*/
|
|
66
|
-
declare function CcsButton({ auth, text, confirm, disabled, inputConfirm,
|
|
59
|
+
declare function CcsButton({ auth, text, confirm, disabled, inputConfirm, onClick, ...restProps }: CcsAuthButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
67
60
|
declare namespace CcsButton {
|
|
68
61
|
var displayName: string;
|
|
69
62
|
var Group: typeof CssButtonGroup;
|
package/es/button/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["auth", "text", "confirm", "disabled", "inputConfirm", "
|
|
2
|
+
var _excluded = ["auth", "text", "confirm", "disabled", "inputConfirm", "onClick"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -15,9 +15,8 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
16
|
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
|
17
17
|
import { Button, Input, Modal } from 'antd';
|
|
18
|
-
import {
|
|
18
|
+
import { useEffect, useRef } from 'react';
|
|
19
19
|
import { useCcsPage } from '..';
|
|
20
|
-
import { TableSelectionContext } from "../pro-table/table";
|
|
21
20
|
import CssButtonDropdown from "./dropdown";
|
|
22
21
|
import CssButtonGroup from "./group";
|
|
23
22
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -47,15 +46,11 @@ function CcsButton(_ref2) {
|
|
|
47
46
|
confirm = _ref2.confirm,
|
|
48
47
|
disabled = _ref2.disabled,
|
|
49
48
|
inputConfirm = _ref2.inputConfirm,
|
|
50
|
-
showRowsCount = _ref2.showRowsCount,
|
|
51
49
|
_onClick = _ref2.onClick,
|
|
52
|
-
onDisabled = _ref2.onDisabled,
|
|
53
50
|
restProps = _objectWithoutProperties(_ref2, _excluded);
|
|
54
51
|
var _ref3 = useCcsPage() || {},
|
|
55
52
|
onAuth = _ref3.onAuth;
|
|
56
53
|
var modalRef = useRef(null);
|
|
57
|
-
var _ref4 = useContext(TableSelectionContext) || {},
|
|
58
|
-
selectedRows = _ref4.selectedRows;
|
|
59
54
|
var ref = useRef(null);
|
|
60
55
|
var button = /*#__PURE__*/_jsxs(Button, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
61
56
|
onClick: function onClick(e) {
|
|
@@ -88,7 +83,7 @@ function CcsButton(_ref2) {
|
|
|
88
83
|
return new Promise(function (resolve, reject) {
|
|
89
84
|
var _ref$current;
|
|
90
85
|
if (((_ref$current = ref.current) === null || _ref$current === void 0 || (_ref$current = _ref$current.input) === null || _ref$current === void 0 ? void 0 : _ref$current.value) === inputConfirm) {
|
|
91
|
-
_onClick(e
|
|
86
|
+
_onClick(e);
|
|
92
87
|
resolve(true);
|
|
93
88
|
} else {
|
|
94
89
|
var errorDom = document.getElementById('_inputConfirmError');
|
|
@@ -102,15 +97,15 @@ function CcsButton(_ref2) {
|
|
|
102
97
|
}
|
|
103
98
|
});
|
|
104
99
|
}
|
|
105
|
-
_onClick(e
|
|
100
|
+
_onClick(e);
|
|
106
101
|
}
|
|
107
102
|
});
|
|
108
103
|
return;
|
|
109
104
|
}
|
|
110
|
-
_onClick(e
|
|
105
|
+
_onClick(e);
|
|
111
106
|
},
|
|
112
|
-
disabled: disabled
|
|
113
|
-
children: [text,
|
|
107
|
+
disabled: disabled,
|
|
108
|
+
children: [text, restProps.children]
|
|
114
109
|
}));
|
|
115
110
|
|
|
116
111
|
// 不控制权限或没有传auth
|
|
@@ -130,7 +125,9 @@ function CcsButton(_ref2) {
|
|
|
130
125
|
}) : null]
|
|
131
126
|
});
|
|
132
127
|
}
|
|
133
|
-
|
|
128
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
129
|
+
CcsButton.displayName = 'CcsButton';
|
|
130
|
+
}
|
|
134
131
|
CcsButton.Group = CssButtonGroup;
|
|
135
132
|
CcsButton.Dropdown = CssButtonDropdown;
|
|
136
133
|
export default CcsButton;
|
package/es/cascader/index.d.ts
CHANGED
|
@@ -19,12 +19,15 @@ type ApiCascaderProps = Omit<CascaderProps, 'fieldNames'> & {
|
|
|
19
19
|
children?: string[] | string;
|
|
20
20
|
};
|
|
21
21
|
/** 查询请求 */
|
|
22
|
-
|
|
22
|
+
request?: (params?: any) => Promise<any>;
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
25
|
* 基于接口查询的select组件
|
|
26
26
|
* @param CcsSelectProps
|
|
27
27
|
* @returns
|
|
28
28
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
declare function ApiCascader({ request, cache, fieldNames, defaultParams, ...restProps }: ApiCascaderProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
declare namespace ApiCascader {
|
|
31
|
+
var displayName: string;
|
|
32
|
+
}
|
|
33
|
+
export default ApiCascader;
|
package/es/cascader/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["
|
|
2
|
+
var _excluded = ["request", "cache", "fieldNames", "defaultParams"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -31,8 +31,8 @@ function onIsArray(data) {
|
|
|
31
31
|
* @param CcsSelectProps
|
|
32
32
|
* @returns
|
|
33
33
|
*/
|
|
34
|
-
|
|
35
|
-
var
|
|
34
|
+
function ApiCascader(_ref) {
|
|
35
|
+
var request = _ref.request,
|
|
36
36
|
cache = _ref.cache,
|
|
37
37
|
fieldNames = _ref.fieldNames,
|
|
38
38
|
_ref$defaultParams = _ref.defaultParams,
|
|
@@ -47,14 +47,14 @@ export default function CcsApiCascader(_ref) {
|
|
|
47
47
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
48
48
|
while (1) switch (_context.prev = _context.next) {
|
|
49
49
|
case 0:
|
|
50
|
-
if (
|
|
50
|
+
if (request) {
|
|
51
51
|
_context.next = 2;
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
54
|
return _context.abrupt("return", []);
|
|
55
55
|
case 2:
|
|
56
56
|
_context.next = 4;
|
|
57
|
-
return
|
|
57
|
+
return request(params);
|
|
58
58
|
case 4:
|
|
59
59
|
result = _context.sent;
|
|
60
60
|
case 5:
|
|
@@ -100,7 +100,7 @@ export default function CcsApiCascader(_ref) {
|
|
|
100
100
|
data = _useRequest$data === void 0 ? [] : _useRequest$data,
|
|
101
101
|
run = _useRequest.run;
|
|
102
102
|
useEffect(function () {
|
|
103
|
-
if (
|
|
103
|
+
if (request) run(defaultParams);
|
|
104
104
|
}, [JSON.stringify(defaultParams)]);
|
|
105
105
|
return (
|
|
106
106
|
/*#__PURE__*/
|
|
@@ -113,4 +113,8 @@ export default function CcsApiCascader(_ref) {
|
|
|
113
113
|
}
|
|
114
114
|
}, restProps))
|
|
115
115
|
);
|
|
116
|
-
}
|
|
116
|
+
}
|
|
117
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
118
|
+
ApiCascader.displayName = 'CcsApiCascader';
|
|
119
|
+
}
|
|
120
|
+
export default ApiCascader;
|
package/es/ccs.d.ts
CHANGED
|
@@ -43,10 +43,15 @@ type TableDataType<T> = {
|
|
|
43
43
|
result?: T[];
|
|
44
44
|
};
|
|
45
45
|
type TableInstance<T = any> = {
|
|
46
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated
|
|
48
|
+
* 获取form表单数据,排序等条件数据
|
|
49
|
+
*/
|
|
47
50
|
formValues: Record<string, any>;
|
|
51
|
+
/** 接口请求参数 */
|
|
52
|
+
searchParam: Record<string, any>;
|
|
48
53
|
/** 获取当前表单数据 */
|
|
49
|
-
data:
|
|
54
|
+
data: TableData<T>;
|
|
50
55
|
/** 获取当前选中的数据 */
|
|
51
56
|
selectedRows: T[];
|
|
52
57
|
/** 查询数据,根据条件,从第一页开始显示 */
|
|
@@ -60,7 +65,7 @@ type TableInstance<T = any> = {
|
|
|
60
65
|
/** 改变data 数据 */
|
|
61
66
|
onChangeData: React.Dispatch<React.SetStateAction<TableDataType<T>>>;
|
|
62
67
|
/** 清空选中的数据 */
|
|
63
|
-
onClearSelected: () => void;
|
|
68
|
+
onClearSelected: (key?: React.Key) => void;
|
|
64
69
|
};
|
|
65
70
|
type AuthButtonItem = {
|
|
66
71
|
key: string;
|
|
@@ -72,10 +77,6 @@ type AuthButtonItem = {
|
|
|
72
77
|
type?: ButtonProps['type'];
|
|
73
78
|
/** 按钮禁用 */
|
|
74
79
|
disabled?: boolean;
|
|
75
|
-
/** 根据选中数据判断是否禁用 */
|
|
76
|
-
onDisabled?: (selectedRows: any[]) => boolean;
|
|
77
|
-
/** 根据选中数据判断是否隐藏 */
|
|
78
|
-
onHidden?: (selectedRows: any[]) => boolean;
|
|
79
80
|
/** 按钮隐藏 */
|
|
80
81
|
hidden?: boolean;
|
|
81
82
|
/** 警告按钮 */
|
|
@@ -84,8 +85,6 @@ type AuthButtonItem = {
|
|
|
84
85
|
icon?: ReactNode;
|
|
85
86
|
/** 按钮操作确认消息 */
|
|
86
87
|
confirm?: string;
|
|
87
|
-
/** 显示当前选中的记录条数 */
|
|
88
|
-
showRowsCount?: boolean;
|
|
89
88
|
};
|
|
90
89
|
type TriggerChildrenProps<T = any> = {
|
|
91
90
|
/** 选中值 */
|
|
@@ -116,7 +115,7 @@ export type TableFormItem = {
|
|
|
116
115
|
showDepends?: ShowDependType[];
|
|
117
116
|
/** 必填规则 */
|
|
118
117
|
rules?: Rule[];
|
|
119
|
-
/**
|
|
118
|
+
/** 在发起请求时调用方法,格式化值 */
|
|
120
119
|
onFormat?: (e: any) => any;
|
|
121
120
|
};
|
|
122
121
|
type TableFormItems = TableFormItem[];
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { ColorPickerProps } from 'antd';
|
|
2
2
|
import './index.less';
|
|
3
|
-
|
|
3
|
+
declare function CcsColorPicker({ mode, children, onChange, ...otherProps }: ColorPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare namespace CcsColorPicker {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
7
|
+
export default CcsColorPicker;
|
package/es/color-picker/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var presets = genPresets({
|
|
|
44
44
|
presets.forEach(function (f) {
|
|
45
45
|
f.colors = f.colors.slice(0, 6);
|
|
46
46
|
});
|
|
47
|
-
|
|
47
|
+
function CcsColorPicker(_ref3) {
|
|
48
48
|
var _ref3$mode = _ref3.mode,
|
|
49
49
|
mode = _ref3$mode === void 0 ? 'single' : _ref3$mode,
|
|
50
50
|
children = _ref3.children,
|
|
@@ -135,4 +135,8 @@ export default function CcsColorPicker(_ref3) {
|
|
|
135
135
|
}, otherProps), {}, {
|
|
136
136
|
children: children || renderValue()
|
|
137
137
|
}));
|
|
138
|
-
}
|
|
138
|
+
}
|
|
139
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
140
|
+
CcsColorPicker.displayName = 'CcsColorPicker';
|
|
141
|
+
}
|
|
142
|
+
export default CcsColorPicker;
|
package/es/context/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export type CcsTabProps = Omit<TabPaneProps, 'tab'> & {
|
|
|
20
20
|
label: React.ReactNode;
|
|
21
21
|
};
|
|
22
22
|
type CcsTabsContextType = {
|
|
23
|
+
/** dom id */
|
|
24
|
+
tabsId: string;
|
|
23
25
|
/** 当前激活tab面板的key */
|
|
24
26
|
activeKey: string;
|
|
25
27
|
/** tab间传递的参数 */
|
|
@@ -51,10 +53,30 @@ type FnContextType<T = Store> = {
|
|
|
51
53
|
close: () => void;
|
|
52
54
|
};
|
|
53
55
|
type CcsFieldNamesType = {
|
|
56
|
+
/** 数据源 */
|
|
54
57
|
dataSource?: string[];
|
|
58
|
+
/** 数据总条数 */
|
|
55
59
|
total?: string[];
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
/** 自定义接口请求属性对象,
|
|
61
|
+
* 默认配置
|
|
62
|
+
* { pageNo:['pageNo'],
|
|
63
|
+
* pageSize: ['pageSize'],
|
|
64
|
+
* filters':['filters'],
|
|
65
|
+
* orderProps: ['orderProps'],
|
|
66
|
+
* query: ['query'] }
|
|
67
|
+
* */
|
|
68
|
+
requestParam?: {
|
|
69
|
+
/** 页码 */
|
|
70
|
+
pageNo: string[];
|
|
71
|
+
/** 页记录数 */
|
|
72
|
+
pageSize: string[];
|
|
73
|
+
/** 查询条件 */
|
|
74
|
+
query?: string[];
|
|
75
|
+
/** 排序 */
|
|
76
|
+
orderProps?: string[];
|
|
77
|
+
/** 列过滤条件 */
|
|
78
|
+
filters?: string[];
|
|
79
|
+
};
|
|
58
80
|
};
|
|
59
81
|
type CcsDialogFieldNames = {
|
|
60
82
|
/** 成功标识字段 */
|
|
@@ -14,5 +14,6 @@ type CcsRangePickerProps = {
|
|
|
14
14
|
declare function CcsDatePicker({ value, onChange, ...restProps }: CcsDatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
declare namespace CcsDatePicker {
|
|
16
16
|
var RangePicker: ({ value, onChange, ...restProps }: CcsRangePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
var displayName: string;
|
|
17
18
|
}
|
|
18
19
|
export default CcsDatePicker;
|
package/es/date-picker/index.js
CHANGED