@ccs-ui/rc-pro 2.3.6-beta-36 → 2.3.6-beta-37

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.
@@ -19,14 +19,14 @@ type ApiCascaderProps = Omit<CascaderProps, 'fieldNames'> & {
19
19
  children?: string[] | string;
20
20
  };
21
21
  /** 查询请求 */
22
- onQuery?: (params?: any) => Promise<any>;
22
+ request?: (params?: any) => Promise<any>;
23
23
  };
24
24
  /**
25
25
  * 基于接口查询的select组件
26
26
  * @param CcsSelectProps
27
27
  * @returns
28
28
  */
29
- declare function ApiCascader({ onQuery, cache, fieldNames, defaultParams, ...restProps }: ApiCascaderProps): import("react/jsx-runtime").JSX.Element;
29
+ declare function ApiCascader({ request, cache, fieldNames, defaultParams, ...restProps }: ApiCascaderProps): import("react/jsx-runtime").JSX.Element;
30
30
  declare namespace ApiCascader {
31
31
  var displayName: string;
32
32
  }
@@ -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 = ["onQuery", "cache", "fieldNames", "defaultParams"];
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; }
@@ -32,7 +32,7 @@ function onIsArray(data) {
32
32
  * @returns
33
33
  */
34
34
  function ApiCascader(_ref) {
35
- var onQuery = _ref.onQuery,
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 @@ function ApiCascader(_ref) {
47
47
  return _regeneratorRuntime().wrap(function _callee$(_context) {
48
48
  while (1) switch (_context.prev = _context.next) {
49
49
  case 0:
50
- if (onQuery) {
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 onQuery(params);
57
+ return request(params);
58
58
  case 4:
59
59
  result = _context.sent;
60
60
  case 5:
@@ -100,7 +100,7 @@ function ApiCascader(_ref) {
100
100
  data = _useRequest$data === void 0 ? [] : _useRequest$data,
101
101
  run = _useRequest.run;
102
102
  useEffect(function () {
103
- if (onQuery) run(defaultParams);
103
+ if (request) run(defaultParams);
104
104
  }, [JSON.stringify(defaultParams)]);
105
105
  return (
106
106
  /*#__PURE__*/
@@ -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>, "auth" | "onClose" | "onOk" | "extraBtn" | "request" | "requestFieldNames" | "preventRequestHandle"> & {
19
+ export declare const DialogButtonHolder: <TParams, TData>({ auth, extraBtn, formRef, request, onOk, onClose, buttonRef, requestFieldNames, formInitialValues, preventRequestHandle, }: Pick<CcsDialogModalProps<TParams, TData>, "auth" | "onClose" | "request" | "onOk" | "extraBtn" | "requestFieldNames" | "preventRequestHandle"> & {
20
20
  formRef: React.RefObject<DialogFormRef<TParams>>;
21
21
  formInitialValues: FormProps['initialValues'];
22
22
  buttonRef: RefObject<DialogButtonRef>;
@@ -14,7 +14,7 @@ interface PropsType<T> {
14
14
  /** 设置选项 */
15
15
  onChangeOptions?: (options: any[]) => void;
16
16
  }
17
- export declare function useSelection<T = any>(props: PropsType<T>): {
17
+ export default function useTableSelection<T = any>(props: PropsType<T>): {
18
18
  onChange: (keys: React.Key[], rows: T[], info: {
19
19
  type: RowSelectMethod;
20
20
  }) => void;
@@ -21,7 +21,7 @@ function isEq(obj1, obj2) {
21
21
  }
22
22
  return JSON.stringify(o1) !== JSON.stringify(o2);
23
23
  }
24
- export function useSelection(props) {
24
+ export default function useTableSelection(props) {
25
25
  var _ref = props || {},
26
26
  value = _ref.value,
27
27
  defaultRows = _ref.defaultRows,
package/es/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export { default as CcsFullScreenButton } from './full-screen';
12
12
  export { default as useAppConfig } from './hooks/use-app';
13
13
  export { default as useCcsOnceEvent } from './hooks/use-once-event';
14
14
  export { default as useCcsPage } from './hooks/use-page';
15
+ export { default as useTableSelection } from './hooks/use-selection';
15
16
  export { default as useCcsTabs } from './hooks/use-tabs';
16
17
  export { default as useCcsWindow } from './hooks/use-window';
17
18
  export { default as CcsIntervalButton } from './interval-button';
package/es/index.js CHANGED
@@ -12,6 +12,7 @@ export { default as CcsFullScreenButton } from "./full-screen";
12
12
  export { default as useAppConfig } from "./hooks/use-app";
13
13
  export { default as useCcsOnceEvent } from "./hooks/use-once-event";
14
14
  export { default as useCcsPage } from "./hooks/use-page";
15
+ export { default as useTableSelection } from "./hooks/use-selection";
15
16
  export { default as useCcsTabs } from "./hooks/use-tabs";
16
17
  export { default as useCcsWindow } from "./hooks/use-window";
17
18
  export { default as CcsIntervalButton } from "./interval-button";
@@ -2,7 +2,6 @@ import './index.less';
2
2
  import SelectionAlert from './selection-alert';
3
3
  import TableSummary from './summary';
4
4
  import { CcsProTableProps } from './table';
5
- import { useSelection } from './useSelection';
6
5
  type TableProps<T> = Omit<CcsProTableProps<T>, 'parentFieldName'>;
7
6
  type TableTreeProps<T> = CcsProTableProps<T> & {
8
7
  /** 父级值字段 */
@@ -19,7 +18,6 @@ declare const ProTable: {
19
18
  Tree: <T_1 extends object = any>(props: TableTreeProps<T_1>) => import("react/jsx-runtime").JSX.Element;
20
19
  SelectionAlert: typeof SelectionAlert;
21
20
  Summary: typeof TableSummary;
22
- useSelection: typeof useSelection;
23
21
  displayName: string;
24
22
  };
25
23
  export default ProTable;
@@ -8,7 +8,6 @@ import "./index.less";
8
8
  import SelectionAlert from "./selection-alert";
9
9
  import TableSummary from "./summary";
10
10
  import InternalProTable from "./table";
11
- import { useSelection } from "./useSelection";
12
11
  import { jsx as _jsx } from "react/jsx-runtime";
13
12
  /**
14
13
  * 查询表格组件
@@ -32,7 +31,6 @@ var ProTableTree = function ProTableTree(props) {
32
31
  ProTable.Tree = ProTableTree;
33
32
  ProTable.SelectionAlert = SelectionAlert;
34
33
  ProTable.Summary = TableSummary;
35
- ProTable.useSelection = useSelection;
36
34
  if (process.env.NODE_ENV !== 'production') {
37
35
  ProTable.displayName = 'CcsProTable';
38
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "2.3.6-beta-36",
3
+ "version": "2.3.6-beta-37",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": {