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

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.
Files changed (65) hide show
  1. package/es/aj-captcha/index.d.ts +5 -2
  2. package/es/aj-captcha/index.js +6 -2
  3. package/es/auth/index.d.ts +3 -0
  4. package/es/auth/index.js +3 -0
  5. package/es/button/dropdown.js +5 -17
  6. package/es/button/group.js +31 -48
  7. package/es/button/index.d.ts +2 -8
  8. package/es/button/index.js +10 -13
  9. package/es/cascader/index.d.ts +5 -2
  10. package/es/cascader/index.js +6 -2
  11. package/es/ccs.d.ts +7 -8
  12. package/es/color-picker/index.d.ts +5 -1
  13. package/es/color-picker/index.js +6 -2
  14. package/es/date-picker/index.d.ts +1 -0
  15. package/es/date-picker/index.js +3 -0
  16. package/es/dialog/button.d.ts +1 -1
  17. package/es/dialog/index.d.ts +3 -1
  18. package/es/dialog/index.js +3 -0
  19. package/es/editor/index.d.ts +1 -0
  20. package/es/editor/index.js +3 -0
  21. package/es/ellipsis/index.d.ts +2 -2
  22. package/es/ellipsis/index.js +7 -6
  23. package/es/index.d.ts +1 -2
  24. package/es/index.js +1 -2
  25. package/es/interval-button/index.js +3 -0
  26. package/es/layout-keep-alive/index.d.ts +5 -2
  27. package/es/layout-keep-alive/index.js +6 -2
  28. package/es/layout-single-page/index.d.ts +5 -2
  29. package/es/layout-single-page/index.js +8 -7
  30. package/es/loading/index.d.ts +4 -1
  31. package/es/loading/index.js +4 -1
  32. package/es/pro-table/index.d.ts +7 -0
  33. package/es/pro-table/index.js +9 -0
  34. package/es/pro-table/selection-alert.d.ts +18 -0
  35. package/es/pro-table/selection-alert.js +52 -0
  36. package/es/pro-table/summary.d.ts +8 -0
  37. package/es/pro-table/summary.js +32 -0
  38. package/es/pro-table/table.d.ts +28 -18
  39. package/es/pro-table/table.js +279 -141
  40. package/es/pro-table/useSelection.d.ts +28 -0
  41. package/es/pro-table/useSelection.js +146 -0
  42. package/es/pro-tabs/index.d.ts +5 -2
  43. package/es/pro-tabs/index.js +6 -2
  44. package/es/result/index.d.ts +11 -15
  45. package/es/result/index.js +57 -54
  46. package/es/select/ modal.d.ts +16 -0
  47. package/es/select/ modal.js +100 -0
  48. package/es/select/api.d.ts +25 -0
  49. package/es/select/api.js +67 -0
  50. package/es/select/customize.d.ts +33 -0
  51. package/es/{select-customize/index.js → select/customize.js} +82 -98
  52. package/es/select/index.d.ts +20 -20
  53. package/es/select/index.js +69 -80
  54. package/es/status-tag/index.d.ts +5 -1
  55. package/es/status-tag/index.js +6 -2
  56. package/es/table/index.d.ts +5 -2
  57. package/es/table/index.js +53 -43
  58. package/es/trigger/index.d.ts +1 -0
  59. package/es/trigger/index.js +1 -0
  60. package/es/upload/index.d.ts +4 -3
  61. package/es/upload/index.js +6 -3
  62. package/es/water-mark/index.d.ts +4 -1
  63. package/es/water-mark/index.js +3 -0
  64. package/package.json +3 -2
  65. package/es/select-customize/index.d.ts +0 -26
@@ -124,7 +124,7 @@ export function findMenusByUrl(tree, targetUrl) {
124
124
  }
125
125
  return null;
126
126
  }
127
- export default function KeepAliveTabs(_ref) {
127
+ function KeepAliveTabs(_ref) {
128
128
  var _ref$maxLen = _ref.maxLen,
129
129
  maxLen = _ref$maxLen === void 0 ? 10 : _ref$maxLen,
130
130
  appName = _ref.appName,
@@ -387,4 +387,8 @@ export default function KeepAliveTabs(_ref) {
387
387
  }, key);
388
388
  })]
389
389
  });
390
- }
390
+ }
391
+ if (process.env.NODE_ENV !== 'production') {
392
+ KeepAliveTabs.displayName = 'CcsKeepAliveTabs';
393
+ }
394
+ export default KeepAliveTabs;
@@ -5,5 +5,8 @@ type PropsType = {
5
5
  menuItems: CCS.MenuType[];
6
6
  className?: string;
7
7
  };
8
- export default function SinglePage({ appName, menuItems, className, }: PropsType): import("react/jsx-runtime").JSX.Element;
9
- export {};
8
+ declare function SinglePage({ appName, menuItems, className }: PropsType): import("react/jsx-runtime").JSX.Element;
9
+ declare namespace SinglePage {
10
+ var displayName: string;
11
+ }
12
+ export default SinglePage;
@@ -7,7 +7,7 @@ import CcsResult from "../result";
7
7
  import "./index.less";
8
8
  import Page from "./page";
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
- export default function SinglePage(_ref) {
10
+ function SinglePage(_ref) {
11
11
  var appName = _ref.appName,
12
12
  _ref$menuItems = _ref.menuItems,
13
13
  menuItems = _ref$menuItems === void 0 ? [] : _ref$menuItems,
@@ -53,11 +53,12 @@ export default function SinglePage(_ref) {
53
53
  urlAuthList: menuInfo.auth,
54
54
  breadcrumb: menuInfo.breadcrumb,
55
55
  children: outlet
56
- }) : /*#__PURE__*/_jsx(CcsResult.NotFound, {
57
- style: {
58
- marginTop: 100
59
- },
60
- iconWidth: 200
56
+ }) : /*#__PURE__*/_jsx(CcsResult.Page404, {
57
+ subTitle: "\u9875\u9762\u4E0D\u5B58\u5728"
61
58
  })
62
59
  });
63
- }
60
+ }
61
+ if (process.env.NODE_ENV !== 'production') {
62
+ SinglePage.displayName = 'CcsSinglePage';
63
+ }
64
+ export default SinglePage;
@@ -7,5 +7,8 @@ type CcsLoadingProps = {
7
7
  /** loading 文字说明 */
8
8
  loadingTip?: string;
9
9
  };
10
- declare const Loading: ({ loading, loadingTip }: CcsLoadingProps) => import("react/jsx-runtime").JSX.Element | null;
10
+ declare const Loading: {
11
+ ({ loading, loadingTip }: CcsLoadingProps): import("react/jsx-runtime").JSX.Element | null;
12
+ displayName: string;
13
+ };
11
14
  export default Loading;
@@ -11,7 +11,7 @@ var Loading = function Loading(_ref) {
11
11
  position: 'absolute',
12
12
  inset: 0,
13
13
  background: 'rgba(0, 0, 0, 0.1)',
14
- zIndex: 1000
14
+ zIndex: 9999
15
15
  },
16
16
  children: /*#__PURE__*/_jsxs("div", {
17
17
  style: {
@@ -37,4 +37,7 @@ var Loading = function Loading(_ref) {
37
37
  })
38
38
  }) : null;
39
39
  };
40
+ if (process.env.NODE_ENV !== 'production') {
41
+ Loading.displayName = 'CcsLoading';
42
+ }
40
43
  export default Loading;
@@ -1,5 +1,8 @@
1
1
  import './index.less';
2
+ import SelectionAlert from './selection-alert';
3
+ import TableSummary from './summary';
2
4
  import { CcsProTableProps } from './table';
5
+ import { useSelection } from './useSelection';
3
6
  type TableProps<T> = Omit<CcsProTableProps<T>, 'parentFieldName'>;
4
7
  type TableTreeProps<T> = CcsProTableProps<T> & {
5
8
  /** 父级值字段 */
@@ -14,5 +17,9 @@ type TableTreeProps<T> = CcsProTableProps<T> & {
14
17
  declare const ProTable: {
15
18
  <T extends object = any>(props: TableProps<T>): import("react/jsx-runtime").JSX.Element;
16
19
  Tree: <T_1 extends object = any>(props: TableTreeProps<T_1>) => import("react/jsx-runtime").JSX.Element;
20
+ SelectionAlert: typeof SelectionAlert;
21
+ Summary: typeof TableSummary;
22
+ useSelection: typeof useSelection;
23
+ displayName: string;
17
24
  };
18
25
  export default ProTable;
@@ -5,7 +5,10 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import "./index.less";
8
+ import SelectionAlert from "./selection-alert";
9
+ import TableSummary from "./summary";
8
10
  import InternalProTable from "./table";
11
+ import { useSelection } from "./useSelection";
9
12
  import { jsx as _jsx } from "react/jsx-runtime";
10
13
  /**
11
14
  * 查询表格组件
@@ -27,4 +30,10 @@ var ProTableTree = function ProTableTree(props) {
27
30
  return /*#__PURE__*/_jsx(InternalProTable, _objectSpread({}, props));
28
31
  };
29
32
  ProTable.Tree = ProTableTree;
33
+ ProTable.SelectionAlert = SelectionAlert;
34
+ ProTable.Summary = TableSummary;
35
+ ProTable.useSelection = useSelection;
36
+ if (process.env.NODE_ENV !== 'production') {
37
+ ProTable.displayName = 'CcsProTable';
38
+ }
30
39
  export default ProTable;
@@ -0,0 +1,18 @@
1
+ import { TagProps } from 'antd';
2
+ import React from 'react';
3
+ interface PropsType {
4
+ data: any[];
5
+ color?: TagProps['color'];
6
+ fieldNames: {
7
+ key: string;
8
+ label: string;
9
+ };
10
+ onClear: (key?: React.Key) => void;
11
+ }
12
+ /**
13
+ * 显示table行选中项
14
+ * @param PropsType
15
+ * @returns
16
+ */
17
+ export default function SelectionAlert({ data, color, fieldNames, onClear, }: PropsType): import("react/jsx-runtime").JSX.Element | undefined;
18
+ export {};
@@ -0,0 +1,52 @@
1
+ import { DeleteOutlined } from '@ant-design/icons';
2
+ import { Button, Space, Tag } from 'antd';
3
+ import React from 'react';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { jsxs as _jsxs } from "react/jsx-runtime";
6
+ /**
7
+ * 显示table行选中项
8
+ * @param PropsType
9
+ * @returns
10
+ */
11
+ export default function SelectionAlert(_ref) {
12
+ var data = _ref.data,
13
+ color = _ref.color,
14
+ _ref$fieldNames = _ref.fieldNames,
15
+ fieldNames = _ref$fieldNames === void 0 ? {
16
+ key: 'key',
17
+ label: 'label'
18
+ } : _ref$fieldNames,
19
+ onClear = _ref.onClear;
20
+ if (!data || data.length === 0) {
21
+ return undefined;
22
+ }
23
+ return /*#__PURE__*/_jsxs(Space, {
24
+ size: 4,
25
+ style: {
26
+ padding: '6px 12px'
27
+ },
28
+ wrap: true,
29
+ children: [data.map(function () {
30
+ var row = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
31
+ return /*#__PURE__*/_jsx(Tag, {
32
+ color: color,
33
+ closable: true,
34
+ onClose: function onClose(e) {
35
+ onClear(row[fieldNames.key]);
36
+ e.preventDefault();
37
+ },
38
+ children: row[fieldNames.label || 'name']
39
+ }, row[fieldNames.key || 'key']);
40
+ }), data.length > 1 && /*#__PURE__*/_jsx(Button, {
41
+ size: "small",
42
+ onClick: function onClick(e) {
43
+ onClear();
44
+ e.preventDefault();
45
+ },
46
+ icon: /*#__PURE__*/_jsx(DeleteOutlined, {}),
47
+ danger: true,
48
+ type: "text",
49
+ children: "\u6E05\u7A7A"
50
+ })]
51
+ });
52
+ }
@@ -0,0 +1,8 @@
1
+ import CCS from '..';
2
+ interface PropsType {
3
+ data: Record<string, any>;
4
+ columns: CCS.TableColumns;
5
+ hasRowSelection: boolean;
6
+ }
7
+ export default function TableSummary({ data, columns, hasRowSelection, }: PropsType): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,32 @@
1
+ import { Table } from 'antd';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { jsxs as _jsxs } from "react/jsx-runtime";
4
+ var SummaryIndex = -1;
5
+ export default function TableSummary(_ref) {
6
+ var _ref$data = _ref.data,
7
+ data = _ref$data === void 0 ? {} : _ref$data,
8
+ columns = _ref.columns,
9
+ hasRowSelection = _ref.hasRowSelection;
10
+ SummaryIndex = -1;
11
+ var renderCell = function renderCell(cs) {
12
+ return cs.map(function (d) {
13
+ if (d.children && d.children.length > 0) {
14
+ return renderCell(d.children);
15
+ }
16
+ SummaryIndex += 1;
17
+ return /*#__PURE__*/_jsx(Table.Summary.Cell, {
18
+ index: 0,
19
+ children: data[d.dataIndex]
20
+ }, SummaryIndex);
21
+ });
22
+ };
23
+ if (hasRowSelection) SummaryIndex += 1;
24
+ return /*#__PURE__*/_jsx(Table.Summary, {
25
+ fixed: true,
26
+ children: /*#__PURE__*/_jsxs(Table.Summary.Row, {
27
+ children: [hasRowSelection && /*#__PURE__*/_jsx(Table.Summary.Cell, {
28
+ index: SummaryIndex
29
+ }), renderCell(columns)]
30
+ })
31
+ });
32
+ }
@@ -1,7 +1,7 @@
1
1
  import { TableProps } from 'antd';
2
2
  import { ColumnGroupType, ColumnType } from 'antd/es/table';
3
3
  import { TableSticky } from 'rc-table/lib/interface';
4
- import React, { CSSProperties, ReactElement, ReactNode } from 'react';
4
+ import React, { CSSProperties, ReactNode } from 'react';
5
5
  import CCS from '..';
6
6
  import { PropsWithCss, PropsWithNodeChildren, TableColumns } from '../ccs';
7
7
  import { CcsFieldNamesType } from '../context';
@@ -12,7 +12,16 @@ export type ShowDependType = {
12
12
  name: string;
13
13
  value: any;
14
14
  };
15
- export type SearchEventType = 'search' | 'reset' | 'reload' | 'changePage' | 'initSearch';
15
+ export declare enum TableEvent {
16
+ Search = "search",
17
+ Reset = "reset",
18
+ Reload = "reload",
19
+ ChangePage = "changePage",
20
+ InitSearch = "initSearch",
21
+ FullScreen = "fullScreen",
22
+ ColumnFilter = "columnFilter",
23
+ SelectedRows = "SelectedRows"
24
+ }
16
25
  export type TableColumn<RecordType = any> = (Omit<ColumnGroupType<RecordType>, 'ellipsis'> | Omit<ColumnType<RecordType>, 'ellipsis'>) & {
17
26
  dataIndex?: keyof RecordType;
18
27
  /** 隐藏列 */
@@ -21,11 +30,17 @@ export type TableColumn<RecordType = any> = (Omit<ColumnGroupType<RecordType>, '
21
30
  ellipsis?: Omit<EllipsisProps, 'content'> | boolean | number;
22
31
  };
23
32
  type TableTitleType<T> = {
24
- selectedRows: T[];
33
+ /** 选中Key */
34
+ selectedRowKeys?: React.Key[];
35
+ /** 选中记录 */
36
+ selectedRows?: T[];
37
+ /** table datasource */
25
38
  data: T[];
26
- onClear: () => void;
39
+ /** 清空选择,传入key取消指定选中,否清空所有 */
40
+ onClear: (key?: React.Key) => void;
27
41
  };
28
- export type CcsTableProps<T> = Omit<TableProps<T>, 'columns' | 'title'> & {
42
+ export type TableExtraNode<T> = ReactNode | (({ selectedRowKeys, selectedRows, data, onClear, }: TableTitleType<T>) => ReactNode);
43
+ export type CcsTableProps<T> = Omit<TableProps<T>, 'columns' | 'title' | 'summary'> & {
29
44
  data?: CCS.TableData<T>;
30
45
  /** 为空时,默认一条数据 */
31
46
  emptyDefaultOne?: boolean;
@@ -44,9 +59,12 @@ export type CcsTableProps<T> = Omit<TableProps<T>, 'columns' | 'title'> & {
44
59
  /** 列配置 */
45
60
  columns?: TableColumns<T>;
46
61
  /** table title */
47
- title?: ({ selectedRows, data, onClear }: TableTitleType<T>) => ReactNode;
62
+ title?: TableExtraNode<T>;
63
+ /** table summary */
64
+ summary?: (data: readonly T[], columns: TableColumn<T>[]) => React.ReactNode;
48
65
  };
49
- export type CcsProTableProps<RecordType> = Pick<PropsWithCss, 'className'> & PropsWithNodeChildren & {
66
+ export type TableEventHandle = (eventName: TableEvent, options?: any) => void;
67
+ export type CcsProTableProps<RecordType = any> = Pick<PropsWithCss, 'className'> & PropsWithNodeChildren & {
50
68
  /** api权限标识 */
51
69
  auth?: string | 'ignore';
52
70
  /** 是否初始查询,默认true */
@@ -60,9 +78,7 @@ export type CcsProTableProps<RecordType> = Pick<PropsWithCss, 'className'> & Pro
60
78
  /** 查询form 初始值 */
61
79
  formInitValues?: ParamType;
62
80
  /** 按钮 操作部分 */
63
- toolbar?: ReactElement;
64
- /** 操作按钮扩展 */
65
- toolbarExtra?: ReactElement;
81
+ toolbar?: TableExtraNode<RecordType>;
66
82
  /** 边框 */
67
83
  bordered?: boolean;
68
84
  /** 展开查询条件,默认false */
@@ -82,19 +98,13 @@ export type CcsProTableProps<RecordType> = Pick<PropsWithCss, 'className'> & Pro
82
98
  proRef?: CCS.TableInstanceRef<RecordType>;
83
99
  /** 显示序号 */
84
100
  showNumber?: boolean;
85
- };
86
- export type TableEventType = {
87
- key: 'columnFilter' | 'fullScreen';
88
- columnHiddenKeys?: any;
89
- full?: any;
101
+ /** table 事件 */
102
+ onEvent?: TableEventHandle;
90
103
  };
91
104
  export type TableStickyProps = boolean | (TableSticky & {
92
105
  isInDialog?: boolean;
93
106
  });
94
107
  export declare const classPrefix = "ccs-pl";
95
- export declare const TableSelectionContext: React.Context<{
96
- selectedRows?: any[] | undefined;
97
- }>;
98
108
  /**
99
109
  * 布局组件 包括form、查询、toolbar、table 自动初始化数据
100
110
  * @param CcsProTableType