@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
package/es/table/index.js CHANGED
@@ -15,6 +15,7 @@ import { useEffect, useImperativeHandle } from 'react';
15
15
  import { Resizable } from 'react-resizable';
16
16
  import CcsEllipsis2 from "../ellipsis";
17
17
  import useTabs from "../hooks/use-tabs";
18
+ import { TableEvent } from "../pro-table/table";
18
19
  import "./index.less";
19
20
  import { jsx as _jsx } from "react/jsx-runtime";
20
21
  var ResizableTitle = function ResizableTitle(props) {
@@ -67,53 +68,52 @@ var CustomTable = function CustomTable(props) {
67
68
 
68
69
  // table 固定表头,内容滚动
69
70
  var _useDebounceFn = useDebounceFn(function () {
70
- if ((scroll === null || scroll === void 0 ? void 0 : scroll.y) === 'auto') {
71
- var _tableContentRef$curr;
72
- var tableTarget = tableContentRef === null || tableContentRef === void 0 ? void 0 : tableContentRef.current;
71
+ var _tableContentRef$curr;
72
+ if ((scroll === null || scroll === void 0 ? void 0 : scroll.y) !== 'auto') return;
73
+ var tableTarget = tableContentRef === null || tableContentRef === void 0 ? void 0 : tableContentRef.current;
73
74
 
74
- // 在ccs tabs组件内
75
- if (inTabs !== null && inTabs !== void 0 && inTabs.tabsId) {
76
- var tabsDom = document.getElementById(inTabs === null || inTabs === void 0 ? void 0 : inTabs.tabsId);
77
- if (tabsDom) {
78
- tabsDom.classList.add('ccs-tabs-auto-height');
79
- }
75
+ // 在ccs tabs组件内
76
+ if (inTabs !== null && inTabs !== void 0 && inTabs.tabsId) {
77
+ var tabsDom = document.getElementById(inTabs === null || inTabs === void 0 ? void 0 : inTabs.tabsId);
78
+ if (tabsDom) {
79
+ tabsDom.classList.add('ccs-tabs-auto-height');
80
80
  }
81
- if (!tableTarget) return;
82
-
83
- // 容器最大高度
84
- var maxHeight = (_tableContentRef$curr = tableContentRef.current) === null || _tableContentRef$curr === void 0 ? void 0 : _tableContentRef$curr.clientHeight;
81
+ }
82
+ if (!tableTarget) return;
85
83
 
86
- // 计算所有dom高度
87
- var tableEle = tableTarget.getElementsByClassName('ant-table')[0];
88
- var childHeights = [];
89
- var antTablebody = undefined;
90
- tableEle.childNodes.forEach(function (e) {
91
- if (e.classList.contains('ant-table-container')) {
92
- e.childNodes.forEach(function (node) {
93
- if (node.classList.contains('ant-table-body')) {
94
- antTablebody = node;
95
- } else {
96
- childHeights.push(node.clientHeight || 0);
97
- }
98
- });
99
- } else {
100
- childHeights.push(e.clientHeight || 0);
101
- }
102
- });
84
+ // 容器最大高度
85
+ var maxHeight = (_tableContentRef$curr = tableContentRef.current) === null || _tableContentRef$curr === void 0 ? void 0 : _tableContentRef$curr.clientHeight;
103
86
 
104
- // 分页高度
105
- var _pagination = tableTarget.getElementsByClassName('ant-pagination');
106
- if (_pagination && _pagination.length > 0) {
107
- childHeights.push(_pagination[0].clientHeight);
87
+ // 计算所有dom高度
88
+ var tableEle = tableTarget.getElementsByClassName('ant-table')[0];
89
+ var childHeights = [];
90
+ var antTablebody = undefined;
91
+ tableEle.childNodes.forEach(function (e) {
92
+ if (e.classList.contains('ant-table-container')) {
93
+ e.childNodes.forEach(function (node) {
94
+ if (node.classList.contains('ant-table-body')) {
95
+ antTablebody = node;
96
+ } else {
97
+ childHeights.push(node.clientHeight || 0);
98
+ }
99
+ });
100
+ } else {
101
+ childHeights.push(e.clientHeight || 0);
108
102
  }
103
+ });
109
104
 
110
- // 计算body滚动高度
111
- if (antTablebody) {
112
- var scrollHeight = maxHeight - childHeights.reduce(function (c, s) {
113
- return c + s;
114
- }, 0);
115
- antTablebody.style.height = "".concat(scrollHeight, "px");
116
- }
105
+ // 分页高度
106
+ var pagination = tableTarget.getElementsByClassName('ant-pagination');
107
+ if (pagination && pagination.length > 0) {
108
+ childHeights.push(pagination[0].clientHeight);
109
+ }
110
+
111
+ // 计算body滚动高度
112
+ if (antTablebody) {
113
+ var scrollHeight = maxHeight - childHeights.reduce(function (c, s) {
114
+ return c + s;
115
+ }, 0);
116
+ antTablebody.style.height = "".concat(scrollHeight, "px");
117
117
  }
118
118
  }, {
119
119
  wait: 500,
@@ -131,9 +131,11 @@ var CustomTable = function CustomTable(props) {
131
131
  useImperativeHandle(tableRef, function () {
132
132
  return {
133
133
  onColumnFilter: function onColumnFilter(e) {
134
+ var _props$onEvent;
134
135
  columns === null || columns === void 0 || columns.forEach(function (c) {
135
136
  c.hidden = e.columnHiddenKeys.includes(c.dataIndex);
136
137
  });
138
+ (_props$onEvent = props.onEvent) === null || _props$onEvent === void 0 || _props$onEvent.call(props, TableEvent.ColumnFilter, e);
137
139
  update();
138
140
  },
139
141
  onFixedThead: onFixedThead
@@ -205,6 +207,7 @@ var CustomTable = function CustomTable(props) {
205
207
  var tableRowKey = function tableRowKey(_, index) {
206
208
  return index || 0;
207
209
  };
210
+ var showColumns = filterColumns();
208
211
  return /*#__PURE__*/_jsx("div", {
209
212
  className: "ccs-table-card",
210
213
  style: _objectSpread(_objectSpread({}, style), {}, {
@@ -229,7 +232,7 @@ var CustomTable = function CustomTable(props) {
229
232
  rowSelection: rowSelection ? _objectSpread(_objectSpread({}, rowSelection), {}, {
230
233
  columnWidth: 60
231
234
  }) : undefined,
232
- columns: filterColumns(),
235
+ columns: showColumns,
233
236
  components: {
234
237
  header: {
235
238
  cell: ResizableTitle
@@ -238,8 +241,15 @@ var CustomTable = function CustomTable(props) {
238
241
  }, restProps), {}, {
239
242
  size: restProps.size || 'middle',
240
243
  className: classNames(_defineProperty(_defineProperty(_defineProperty({}, 'ccs-table-nodata', !dataSource || dataSource.length === 0), 'ccs-table-wrapper', !rowSelection), "className", className)),
241
- scroll: scroll
244
+ scroll: scroll,
245
+ summary: restProps !== null && restProps !== void 0 && restProps.summary ? function (e) {
246
+ var _restProps$summary;
247
+ return (_restProps$summary = restProps.summary) === null || _restProps$summary === void 0 ? void 0 : _restProps$summary.call(restProps, e, showColumns || []);
248
+ } : undefined
242
249
  }))
243
250
  });
244
251
  };
252
+ if (process.env.NODE_ENV !== 'production') {
253
+ CustomTable.displayName = 'CcsTable';
254
+ }
245
255
  export default CustomTable;
@@ -35,6 +35,7 @@ export type CcsTriggerProps = PropsWithCss & PropsWithElementChildren & {
35
35
  };
36
36
  /**
37
37
  * 适用于Form.Item中的 trigger组件,其内容自行定义,遵循ant form 自定义组件规范
38
+ * @deprecated
38
39
  * @param CcsTriggerPropsType
39
40
  * @returns
40
41
  */
@@ -29,6 +29,7 @@ var classPrefix = 'ccs-trigger';
29
29
 
30
30
  /**
31
31
  * 适用于Form.Item中的 trigger组件,其内容自行定义,遵循ant form 自定义组件规范
32
+ * @deprecated
32
33
  * @param CcsTriggerPropsType
33
34
  * @returns
34
35
  */
@@ -34,8 +34,9 @@ export type FileUploadList = UploadChangeParam['fileList'][0] & {
34
34
  };
35
35
  /** 生成图片默认值 */
36
36
  export declare function uploadDefaultFlies(value: CcsUploadProps['value'], fileDownloadUrl: string): FileUploadList[];
37
- declare function CcsUpload({ value, uploadText, maxCount, maxFileSize, fileDownloadUrl, uploadRequest, onChange, ...otherProps }: CcsUploadProps): import("react/jsx-runtime").JSX.Element;
38
- declare namespace CcsUpload {
37
+ declare function CustomUpload({ value, uploadText, maxCount, maxFileSize, fileDownloadUrl, uploadRequest, onChange, ...otherProps }: CcsUploadProps): import("react/jsx-runtime").JSX.Element;
38
+ declare namespace CustomUpload {
39
39
  var Image: typeof ImageUpload;
40
+ var displayName: string;
40
41
  }
41
- export default CcsUpload;
42
+ export default CustomUpload;
@@ -59,7 +59,7 @@ export function uploadDefaultFlies(value, fileDownloadUrl) {
59
59
  }
60
60
  return [];
61
61
  }
62
- function CcsUpload(_ref) {
62
+ function CustomUpload(_ref) {
63
63
  var value = _ref.value,
64
64
  uploadText = _ref.uploadText,
65
65
  _ref$maxCount = _ref.maxCount,
@@ -160,5 +160,8 @@ function CcsUpload(_ref) {
160
160
  })
161
161
  }));
162
162
  }
163
- CcsUpload.Image = ImageUpload;
164
- export default CcsUpload;
163
+ CustomUpload.Image = ImageUpload;
164
+ if (process.env.NODE_ENV !== 'production') {
165
+ CustomUpload.displayName = 'CcsUpload';
166
+ }
167
+ export default CustomUpload;
@@ -58,5 +58,8 @@ export type WaterMarkProps = PropsWithNodeChildren & PropsWithCss & {
58
58
  * @param WaterMarkProps
59
59
  * @returns
60
60
  */
61
- declare const WaterMarkComponent: (props: WaterMarkProps) => import("react/jsx-runtime").JSX.Element;
61
+ declare const WaterMarkComponent: {
62
+ (props: WaterMarkProps): import("react/jsx-runtime").JSX.Element;
63
+ displayName: string;
64
+ };
62
65
  export default WaterMarkComponent;
@@ -135,4 +135,7 @@ var WaterMarkComponent = function WaterMarkComponent(props) {
135
135
  })]
136
136
  });
137
137
  };
138
+ if (process.env.NODE_ENV !== 'production') {
139
+ WaterMarkComponent.displayName = 'CcsWaterMark';
140
+ }
138
141
  export default WaterMarkComponent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "2.3.6-beta-34",
3
+ "version": "2.3.6-beta-36",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -71,7 +71,8 @@
71
71
  "react-draggable": "^4.4.5",
72
72
  "react-error-overlay": "^6.0.11",
73
73
  "react-resizable": "^3.0.5",
74
- "runes2": "^1.1.4"
74
+ "runes2": "^1.1.4",
75
+ "tiny-pinyin": "^1.3.2"
75
76
  },
76
77
  "devDependencies": {
77
78
  "@ant-design/compatible": "^5.1.2",
@@ -1,26 +0,0 @@
1
- import { SelectProps } from 'antd';
2
- import { ReactElement } from 'react';
3
- export type SelectCustomInstance = {
4
- value?: any;
5
- onClose?: () => void;
6
- onChange?: (value: any) => void;
7
- onChangeLabel?: (label?: string) => void;
8
- };
9
- interface SelectCustomizeProps extends SelectProps {
10
- /** 选择触发器宽度 */
11
- width?: number;
12
- /** 内容宽度 */
13
- contentWidth?: number;
14
- /** 选择模式,下拉或弹框 */
15
- customMode?: 'select' | 'modal';
16
- /** 自定义内容 */
17
- children: ReactElement;
18
- /** form item value */
19
- value?: any;
20
- /** 隐藏确定 */
21
- hideOk?: boolean;
22
- /** form item onChange */
23
- onChange?: (e: any) => void;
24
- }
25
- export default function CcsSelectCustomize({ width, title, hideOk, children, customMode, contentWidth, value, onChange, style, ...otherProps }: SelectCustomizeProps): import("react/jsx-runtime").JSX.Element;
26
- export {};