@ccs-ui/rc-pro 2.3.3-beta-8 → 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.
@@ -1,2 +1,2 @@
1
1
  import { CcsButtonGroupProps } from '.';
2
- export default function CssButtonGroup({ size, isLink, showCount, moreIcon, moreText, showRowsCount, items, onClick, }: CcsButtonGroupProps): import("react/jsx-runtime").JSX.Element | null;
2
+ export default function CssButtonGroup({ size, isLink, showCount, moreIcon, moreText, items, onClick, }: CcsButtonGroupProps): import("react/jsx-runtime").JSX.Element | null;
@@ -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; }
@@ -25,7 +25,6 @@ export default function CssButtonGroup(_ref) {
25
25
  showCount = _ref.showCount,
26
26
  moreIcon = _ref.moreIcon,
27
27
  moreText = _ref.moreText,
28
- showRowsCount = _ref.showRowsCount,
29
28
  _ref$items = _ref.items,
30
29
  items = _ref$items === void 0 ? [] : _ref$items,
31
30
  onClick = _ref.onClick;
@@ -35,7 +34,6 @@ export default function CssButtonGroup(_ref) {
35
34
  var _ref3 = useContext(TableSelectionContext) || {},
36
35
  selectedRows = _ref3.selectedRows;
37
36
  var authButtons = [];
38
- var showSelectedRows = showRowsCount && selectedRows !== null && selectedRows !== void 0 && selectedRows.length ? "(".concat(selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.length, ")") : '';
39
37
 
40
38
  // 过滤隐藏按钮
41
39
  authButtons = items.filter(function (item) {
@@ -86,7 +84,6 @@ export default function CssButtonGroup(_ref) {
86
84
  }
87
85
  onClick(key, selectedRows);
88
86
  };
89
-
90
87
  // link类型按钮
91
88
  if (isLink) {
92
89
  return /*#__PURE__*/_jsxs(_Fragment, {
@@ -102,6 +99,7 @@ export default function CssButtonGroup(_ref) {
102
99
  label = _ref5.label,
103
100
  auth = _ref5.auth,
104
101
  confirm = _ref5.confirm,
102
+ showRowsCount = _ref5.showRowsCount,
105
103
  onDisabled = _ref5.onDisabled,
106
104
  onHidden = _ref5.onHidden,
107
105
  restProps = _objectWithoutProperties(_ref5, _excluded2);
@@ -115,7 +113,7 @@ export default function CssButtonGroup(_ref) {
115
113
  onClick: function onClick() {
116
114
  return handleOnClick(key);
117
115
  },
118
- children: [label, showSelectedRows]
116
+ children: [label, showRowsCount && selectedRows !== null && selectedRows !== void 0 && selectedRows.length ? "(".concat(selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.length, ")") : '']
119
117
  }), key);
120
118
  })
121
119
  }), authButtons.length > 0 && /*#__PURE__*/_jsx(Dropdown, {
@@ -147,6 +145,7 @@ export default function CssButtonGroup(_ref) {
147
145
  disabled = _ref6.disabled,
148
146
  auth = _ref6.auth,
149
147
  confirm = _ref6.confirm,
148
+ showRowsCount = _ref6.showRowsCount,
150
149
  onDisabled = _ref6.onDisabled,
151
150
  onHidden = _ref6.onHidden,
152
151
  restProps = _objectWithoutProperties(_ref6, _excluded3);
@@ -162,7 +161,7 @@ export default function CssButtonGroup(_ref) {
162
161
  return handleOnClick(key);
163
162
  },
164
163
  disabled: isDisabled,
165
- children: [label, showRowsCount]
164
+ children: [label, showRowsCount && selectedRows !== null && selectedRows !== void 0 && selectedRows.length ? "(".concat(selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.length, ")") : '']
166
165
  })), /*#__PURE__*/_jsx(Dropdown, {
167
166
  menu: {
168
167
  items: authButtons,
@@ -183,7 +182,7 @@ export default function CssButtonGroup(_ref) {
183
182
  onClick: function onClick() {
184
183
  return handleOnClick(key);
185
184
  },
186
- children: [label, showSelectedRows]
185
+ children: [label, showRowsCount && selectedRows !== null && selectedRows !== void 0 && selectedRows.length ? "(".concat(selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.length, ")") : '']
187
186
  }), key);
188
187
  })
189
188
  }), items.find(function (i) {
@@ -36,8 +36,6 @@ export type CcsButtonGroupProps = {
36
36
  moreIcon?: ReactNode;
37
37
  /** 更多文字 */
38
38
  moreText?: string;
39
- /** 显示当前选中的记录条数 */
40
- showRowsCount?: boolean;
41
39
  /** 点击事件 */
42
40
  onClick?: (key: string, selectedRows?: any[]) => void;
43
41
  };
package/es/ccs.d.ts CHANGED
@@ -84,6 +84,8 @@ type AuthButtonItem = {
84
84
  icon?: ReactNode;
85
85
  /** 按钮操作确认消息 */
86
86
  confirm?: string;
87
+ /** 显示当前选中的记录条数 */
88
+ showRowsCount?: boolean;
87
89
  };
88
90
  type TriggerChildrenProps<T = any> = {
89
91
  /** 选中值 */
@@ -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>, "onClose" | "auth" | "onOk" | "request" | "extraBtn" | "requestFieldNames" | "preventRequestHandle"> & {
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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "2.3.3-beta-8",
3
+ "version": "2.3.3-beta-9",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": {