@ccs-ui/rc-pro 2.3.3-beta-7 → 2.3.3-beta-8
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/button/group.d.ts +1 -1
- package/es/button/group.js +9 -7
- package/es/button/index.d.ts +5 -1
- package/es/button/index.js +3 -2
- package/es/dialog/button.d.ts +1 -1
- package/package.json +1 -1
package/es/button/group.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CcsButtonGroupProps } from '.';
|
|
2
|
-
export default function CssButtonGroup({ size, isLink, showCount, moreIcon, moreText, items, onClick, }: CcsButtonGroupProps): import("react/jsx-runtime").JSX.Element | null;
|
|
2
|
+
export default function CssButtonGroup({ size, isLink, showCount, moreIcon, moreText, showRowsCount, items, onClick, }: CcsButtonGroupProps): import("react/jsx-runtime").JSX.Element | null;
|
package/es/button/group.js
CHANGED
|
@@ -17,14 +17,15 @@ import { ModalConfirm } from '.';
|
|
|
17
17
|
import { useCcsPage } from '..';
|
|
18
18
|
import { TableSelectionContext } from "../pro-table/table";
|
|
19
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
21
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
22
|
export default function CssButtonGroup(_ref) {
|
|
23
23
|
var size = _ref.size,
|
|
24
24
|
isLink = _ref.isLink,
|
|
25
25
|
showCount = _ref.showCount,
|
|
26
26
|
moreIcon = _ref.moreIcon,
|
|
27
27
|
moreText = _ref.moreText,
|
|
28
|
+
showRowsCount = _ref.showRowsCount,
|
|
28
29
|
_ref$items = _ref.items,
|
|
29
30
|
items = _ref$items === void 0 ? [] : _ref$items,
|
|
30
31
|
onClick = _ref.onClick;
|
|
@@ -34,6 +35,7 @@ export default function CssButtonGroup(_ref) {
|
|
|
34
35
|
var _ref3 = useContext(TableSelectionContext) || {},
|
|
35
36
|
selectedRows = _ref3.selectedRows;
|
|
36
37
|
var authButtons = [];
|
|
38
|
+
var showSelectedRows = showRowsCount && selectedRows !== null && selectedRows !== void 0 && selectedRows.length ? "(".concat(selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.length, ")") : '';
|
|
37
39
|
|
|
38
40
|
// 过滤隐藏按钮
|
|
39
41
|
authButtons = items.filter(function (item) {
|
|
@@ -103,7 +105,7 @@ export default function CssButtonGroup(_ref) {
|
|
|
103
105
|
onDisabled = _ref5.onDisabled,
|
|
104
106
|
onHidden = _ref5.onHidden,
|
|
105
107
|
restProps = _objectWithoutProperties(_ref5, _excluded2);
|
|
106
|
-
return /*#__PURE__*/
|
|
108
|
+
return /*#__PURE__*/_jsxs(Button, _objectSpread(_objectSpread({
|
|
107
109
|
style: {
|
|
108
110
|
padding: 0
|
|
109
111
|
}
|
|
@@ -113,7 +115,7 @@ export default function CssButtonGroup(_ref) {
|
|
|
113
115
|
onClick: function onClick() {
|
|
114
116
|
return handleOnClick(key);
|
|
115
117
|
},
|
|
116
|
-
children: label
|
|
118
|
+
children: [label, showSelectedRows]
|
|
117
119
|
}), key);
|
|
118
120
|
})
|
|
119
121
|
}), authButtons.length > 0 && /*#__PURE__*/_jsx(Dropdown, {
|
|
@@ -154,13 +156,13 @@ export default function CssButtonGroup(_ref) {
|
|
|
154
156
|
// 更多按钮
|
|
155
157
|
if (index === showBtns.length - 1 && authButtons.length > 0) {
|
|
156
158
|
return /*#__PURE__*/_jsxs(Space.Compact, {
|
|
157
|
-
children: [/*#__PURE__*/
|
|
159
|
+
children: [/*#__PURE__*/_jsxs(Button, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
158
160
|
size: size,
|
|
159
161
|
onClick: function onClick() {
|
|
160
162
|
return handleOnClick(key);
|
|
161
163
|
},
|
|
162
164
|
disabled: isDisabled,
|
|
163
|
-
children: label
|
|
165
|
+
children: [label, showRowsCount]
|
|
164
166
|
})), /*#__PURE__*/_jsx(Dropdown, {
|
|
165
167
|
menu: {
|
|
166
168
|
items: authButtons,
|
|
@@ -175,13 +177,13 @@ export default function CssButtonGroup(_ref) {
|
|
|
175
177
|
})]
|
|
176
178
|
}, key);
|
|
177
179
|
}
|
|
178
|
-
return /*#__PURE__*/
|
|
180
|
+
return /*#__PURE__*/_jsxs(Button, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
179
181
|
size: size,
|
|
180
182
|
disabled: isDisabled,
|
|
181
183
|
onClick: function onClick() {
|
|
182
184
|
return handleOnClick(key);
|
|
183
185
|
},
|
|
184
|
-
children: label
|
|
186
|
+
children: [label, showSelectedRows]
|
|
185
187
|
}), key);
|
|
186
188
|
})
|
|
187
189
|
}), items.find(function (i) {
|
package/es/button/index.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export type CcsButtonGroupProps = {
|
|
|
36
36
|
moreIcon?: ReactNode;
|
|
37
37
|
/** 更多文字 */
|
|
38
38
|
moreText?: string;
|
|
39
|
+
/** 显示当前选中的记录条数 */
|
|
40
|
+
showRowsCount?: boolean;
|
|
39
41
|
/** 点击事件 */
|
|
40
42
|
onClick?: (key: string, selectedRows?: any[]) => void;
|
|
41
43
|
};
|
|
@@ -51,6 +53,8 @@ export type CcsAuthButtonProps = Omit<ButtonProps, 'onClick'> & {
|
|
|
51
53
|
confirm?: string;
|
|
52
54
|
/** 输入确认的值 */
|
|
53
55
|
inputConfirm?: string;
|
|
56
|
+
/** 显示当前选中的记录条数 */
|
|
57
|
+
showRowsCount?: boolean;
|
|
54
58
|
/** 点击事件 */
|
|
55
59
|
onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>, selectedRows?: any[]) => void;
|
|
56
60
|
/** 按钮禁用方法 */
|
|
@@ -61,7 +65,7 @@ export type CcsAuthButtonProps = Omit<ButtonProps, 'onClick'> & {
|
|
|
61
65
|
* @param CcsAuthButtonProps
|
|
62
66
|
* @returns
|
|
63
67
|
*/
|
|
64
|
-
declare function CcsButton({ auth, text, confirm, disabled, inputConfirm, onClick, onDisabled, ...restProps }: CcsAuthButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
declare function CcsButton({ auth, text, confirm, disabled, inputConfirm, showRowsCount, onClick, onDisabled, ...restProps }: CcsAuthButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
65
69
|
declare namespace CcsButton {
|
|
66
70
|
var displayName: string;
|
|
67
71
|
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", "onClick", "onDisabled"];
|
|
2
|
+
var _excluded = ["auth", "text", "confirm", "disabled", "inputConfirm", "showRowsCount", "onClick", "onDisabled"];
|
|
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; }
|
|
@@ -47,6 +47,7 @@ function CcsButton(_ref2) {
|
|
|
47
47
|
confirm = _ref2.confirm,
|
|
48
48
|
disabled = _ref2.disabled,
|
|
49
49
|
inputConfirm = _ref2.inputConfirm,
|
|
50
|
+
showRowsCount = _ref2.showRowsCount,
|
|
50
51
|
_onClick = _ref2.onClick,
|
|
51
52
|
onDisabled = _ref2.onDisabled,
|
|
52
53
|
restProps = _objectWithoutProperties(_ref2, _excluded);
|
|
@@ -109,7 +110,7 @@ function CcsButton(_ref2) {
|
|
|
109
110
|
_onClick(e, selectedRows);
|
|
110
111
|
},
|
|
111
112
|
disabled: disabled || onDisabled && onDisabled(selectedRows),
|
|
112
|
-
children: [text, restProps.children]
|
|
113
|
+
children: [text, "".concat(showRowsCount && selectedRows !== null && selectedRows !== void 0 && selectedRows.length ? "(".concat(selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.length, ")") : ''), restProps.children]
|
|
113
114
|
}));
|
|
114
115
|
|
|
115
116
|
// 不控制权限或没有传auth
|
package/es/dialog/button.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type DialogButtonsProps<T> = Pick<CcsDialogModalProps, 'okText' | 'onClos
|
|
|
16
16
|
export type DialogButtonRef = {
|
|
17
17
|
onSetButtons: (e: React.ReactElement) => void;
|
|
18
18
|
};
|
|
19
|
-
export declare const DialogButtonHolder: <TParams, TData>({ auth, extraBtn, formRef, request, onOk, onClose, buttonRef, requestFieldNames, formInitialValues, preventRequestHandle, }: Pick<CcsDialogModalProps<TParams, TData>, "
|
|
19
|
+
export declare const DialogButtonHolder: <TParams, TData>({ auth, extraBtn, formRef, request, onOk, onClose, buttonRef, requestFieldNames, formInitialValues, preventRequestHandle, }: Pick<CcsDialogModalProps<TParams, TData>, "onClose" | "auth" | "onOk" | "request" | "extraBtn" | "requestFieldNames" | "preventRequestHandle"> & {
|
|
20
20
|
formRef: React.RefObject<DialogFormRef<TParams>>;
|
|
21
21
|
formInitialValues: FormProps['initialValues'];
|
|
22
22
|
buttonRef: RefObject<DialogButtonRef>;
|