@ccs-ui/rc-pro 2.3.3-beta-7 → 2.3.3-beta-9
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.js +11 -10
- package/es/button/index.d.ts +3 -1
- package/es/button/index.js +3 -2
- package/es/ccs.d.ts +2 -0
- package/es/dialog/button.d.ts +1 -1
- package/package.json +1 -1
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
2
|
var _excluded = ["onDisabled", "onHidden"],
|
|
3
|
-
_excluded2 = ["key", "label", "auth", "confirm", "onDisabled", "onHidden"],
|
|
4
|
-
_excluded3 = ["key", "label", "disabled", "auth", "confirm", "onDisabled", "onHidden"];
|
|
3
|
+
_excluded2 = ["key", "label", "auth", "confirm", "showRowsCount", "onDisabled", "onHidden"],
|
|
4
|
+
_excluded3 = ["key", "label", "disabled", "auth", "confirm", "showRowsCount", "onDisabled", "onHidden"];
|
|
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; }
|
|
@@ -17,8 +17,8 @@ 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,
|
|
@@ -84,7 +84,6 @@ export default function CssButtonGroup(_ref) {
|
|
|
84
84
|
}
|
|
85
85
|
onClick(key, selectedRows);
|
|
86
86
|
};
|
|
87
|
-
|
|
88
87
|
// link类型按钮
|
|
89
88
|
if (isLink) {
|
|
90
89
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
@@ -100,10 +99,11 @@ export default function CssButtonGroup(_ref) {
|
|
|
100
99
|
label = _ref5.label,
|
|
101
100
|
auth = _ref5.auth,
|
|
102
101
|
confirm = _ref5.confirm,
|
|
102
|
+
showRowsCount = _ref5.showRowsCount,
|
|
103
103
|
onDisabled = _ref5.onDisabled,
|
|
104
104
|
onHidden = _ref5.onHidden,
|
|
105
105
|
restProps = _objectWithoutProperties(_ref5, _excluded2);
|
|
106
|
-
return /*#__PURE__*/
|
|
106
|
+
return /*#__PURE__*/_jsxs(Button, _objectSpread(_objectSpread({
|
|
107
107
|
style: {
|
|
108
108
|
padding: 0
|
|
109
109
|
}
|
|
@@ -113,7 +113,7 @@ export default function CssButtonGroup(_ref) {
|
|
|
113
113
|
onClick: function onClick() {
|
|
114
114
|
return handleOnClick(key);
|
|
115
115
|
},
|
|
116
|
-
children: label
|
|
116
|
+
children: [label, showRowsCount && selectedRows !== null && selectedRows !== void 0 && selectedRows.length ? "(".concat(selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.length, ")") : '']
|
|
117
117
|
}), key);
|
|
118
118
|
})
|
|
119
119
|
}), authButtons.length > 0 && /*#__PURE__*/_jsx(Dropdown, {
|
|
@@ -145,6 +145,7 @@ export default function CssButtonGroup(_ref) {
|
|
|
145
145
|
disabled = _ref6.disabled,
|
|
146
146
|
auth = _ref6.auth,
|
|
147
147
|
confirm = _ref6.confirm,
|
|
148
|
+
showRowsCount = _ref6.showRowsCount,
|
|
148
149
|
onDisabled = _ref6.onDisabled,
|
|
149
150
|
onHidden = _ref6.onHidden,
|
|
150
151
|
restProps = _objectWithoutProperties(_ref6, _excluded3);
|
|
@@ -154,13 +155,13 @@ export default function CssButtonGroup(_ref) {
|
|
|
154
155
|
// 更多按钮
|
|
155
156
|
if (index === showBtns.length - 1 && authButtons.length > 0) {
|
|
156
157
|
return /*#__PURE__*/_jsxs(Space.Compact, {
|
|
157
|
-
children: [/*#__PURE__*/
|
|
158
|
+
children: [/*#__PURE__*/_jsxs(Button, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
158
159
|
size: size,
|
|
159
160
|
onClick: function onClick() {
|
|
160
161
|
return handleOnClick(key);
|
|
161
162
|
},
|
|
162
163
|
disabled: isDisabled,
|
|
163
|
-
children: label
|
|
164
|
+
children: [label, showRowsCount && selectedRows !== null && selectedRows !== void 0 && selectedRows.length ? "(".concat(selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.length, ")") : '']
|
|
164
165
|
})), /*#__PURE__*/_jsx(Dropdown, {
|
|
165
166
|
menu: {
|
|
166
167
|
items: authButtons,
|
|
@@ -175,13 +176,13 @@ export default function CssButtonGroup(_ref) {
|
|
|
175
176
|
})]
|
|
176
177
|
}, key);
|
|
177
178
|
}
|
|
178
|
-
return /*#__PURE__*/
|
|
179
|
+
return /*#__PURE__*/_jsxs(Button, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
179
180
|
size: size,
|
|
180
181
|
disabled: isDisabled,
|
|
181
182
|
onClick: function onClick() {
|
|
182
183
|
return handleOnClick(key);
|
|
183
184
|
},
|
|
184
|
-
children: label
|
|
185
|
+
children: [label, showRowsCount && selectedRows !== null && selectedRows !== void 0 && selectedRows.length ? "(".concat(selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.length, ")") : '']
|
|
185
186
|
}), key);
|
|
186
187
|
})
|
|
187
188
|
}), items.find(function (i) {
|
package/es/button/index.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ export type CcsAuthButtonProps = Omit<ButtonProps, 'onClick'> & {
|
|
|
51
51
|
confirm?: string;
|
|
52
52
|
/** 输入确认的值 */
|
|
53
53
|
inputConfirm?: string;
|
|
54
|
+
/** 显示当前选中的记录条数 */
|
|
55
|
+
showRowsCount?: boolean;
|
|
54
56
|
/** 点击事件 */
|
|
55
57
|
onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>, selectedRows?: any[]) => void;
|
|
56
58
|
/** 按钮禁用方法 */
|
|
@@ -61,7 +63,7 @@ export type CcsAuthButtonProps = Omit<ButtonProps, 'onClick'> & {
|
|
|
61
63
|
* @param CcsAuthButtonProps
|
|
62
64
|
* @returns
|
|
63
65
|
*/
|
|
64
|
-
declare function CcsButton({ auth, text, confirm, disabled, inputConfirm, onClick, onDisabled, ...restProps }: CcsAuthButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
66
|
+
declare function CcsButton({ auth, text, confirm, disabled, inputConfirm, showRowsCount, onClick, onDisabled, ...restProps }: CcsAuthButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
65
67
|
declare namespace CcsButton {
|
|
66
68
|
var displayName: string;
|
|
67
69
|
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/ccs.d.ts
CHANGED
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>, "onOk" | "onClose" | "auth" | "request" | "extraBtn" | "requestFieldNames" | "preventRequestHandle"> & {
|
|
20
20
|
formRef: React.RefObject<DialogFormRef<TParams>>;
|
|
21
21
|
formInitialValues: FormProps['initialValues'];
|
|
22
22
|
buttonRef: RefObject<DialogButtonRef>;
|