@ccs-ui/rc-pro 1.1.22-beta-2 → 1.1.22-beta-4

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/ccs.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ButtonProps, MenuProps, ThemeConfig } from 'antd';
2
2
  import { Rule } from 'antd/es/form';
3
- import { ColumnGroupType, ColumnType } from 'antd/es/table';
4
3
  import { MutableRefObject, ReactElement, ReactNode } from 'react';
4
+ import { TableColumn } from './pro-table/table';
5
5
  type MenuTreeNodeData = {
6
6
  buttonUrlId: number;
7
7
  createTime: string;
@@ -203,7 +203,5 @@ type GlobalConfig = {
203
203
  };
204
204
  type TableFormItems = TableFormItem[];
205
205
  type TableInstanceRef<T = any> = MutableRefObject<TableInstance<T> | undefined> | React.RefObject<TableInstance<T>>;
206
- type TableColumns<RecordType = any> = ((ColumnGroupType<RecordType> | ColumnType<RecordType>) & {
207
- hidden?: boolean;
208
- })[];
206
+ type TableColumns<RecordType = any> = TableColumn<RecordType>[];
209
207
  export type { PageType, RecordType, MenuTreeNode, PageQuery, ListQuery, HttpResult, GlobalConfig, HttpListResult, HttpPageResult, AuthButtonItem, MenuTreeNodeData, UserDetail, RouteHistory, TableData, TableFormItems, TableColumns, TableInstance, TableInstanceRef, TriggerChildrenProps, };
@@ -1,8 +1,9 @@
1
1
  import { ColProps, TableProps } from 'antd';
2
2
  import { FormLayout } from 'antd/es/form/Form';
3
+ import { ColumnGroupType, ColumnType } from 'antd/es/table';
3
4
  import { CSSProperties, ReactElement, ReactNode } from 'react';
4
5
  import CCS from '..';
5
- import { HttpPageResult } from '../ccs';
6
+ import { HttpPageResult, TableColumns } from '../ccs';
6
7
  import './index.less';
7
8
  type ParamType = Record<string, any>;
8
9
  export type ShowDependType = {
@@ -13,7 +14,13 @@ export type SearchEventType = 'search' | 'reset' | 'reload' | 'changePage' | 'in
13
14
  type SearchBeforeType = ParamType & {
14
15
  query: ParamType;
15
16
  };
16
- export type CcsTableProps<T> = TableProps<T> & {
17
+ export type TableColumn<RecordType = any> = (Omit<ColumnGroupType<RecordType>, 'ellipsis'> | Omit<ColumnType<RecordType>, 'ellipsis'>) & {
18
+ /** 隐藏列 */
19
+ hidden?: boolean;
20
+ /** 省略显示行数,最大支持10行 */
21
+ ellipsis?: boolean | number;
22
+ };
23
+ export type CcsTableProps<T> = Omit<TableProps<T>, 'columns'> & {
17
24
  data?: CCS.TableData<T>;
18
25
  /** request 方法 */
19
26
  request?: (params: any) => void;
@@ -25,6 +32,8 @@ export type CcsTableProps<T> = TableProps<T> & {
25
32
  event$?: any;
26
33
  /** style */
27
34
  style?: CSSProperties;
35
+ /** 列配置 */
36
+ columns?: TableColumns<T>;
28
37
  };
29
38
  export type CcsProTableProps<T> = {
30
39
  /** api权限标识 */
package/es/table/index.js CHANGED
@@ -139,16 +139,19 @@ var CustomTable = function CustomTable(props) {
139
139
  });
140
140
  cls === null || cls === void 0 ? void 0 : cls.forEach(function (c) {
141
141
  if (c.ellipsis && !c.render) {
142
- var sc = c;
143
- sc.ellipsis = {
144
- showTitle: false
145
- };
146
- sc.render = function (e) {
142
+ var isMultiRow = typeof c.ellipsis === 'number' && c.ellipsis > 1;
143
+ var ellipsis = c.ellipsis;
144
+ c.ellipsis = !isMultiRow;
145
+ c.render = function (e) {
147
146
  return /*#__PURE__*/_jsx(Tooltip, {
148
147
  zIndex: 2020,
149
148
  title: e,
150
149
  placement: "bottomLeft",
151
150
  destroyTooltipOnHide: true,
151
+ className: classNames(_defineProperty({}, "ccs-table-cell-ellipsis-multi lineclamp".concat(ellipsis), isMultiRow)),
152
+ overlayInnerStyle: {
153
+ whiteSpace: 'normal'
154
+ },
152
155
  children: e
153
156
  });
154
157
  };
@@ -104,6 +104,48 @@
104
104
  }
105
105
  }
106
106
 
107
+ &-cell-ellipsis {
108
+ overflow: hidden;
109
+ text-overflow: ellipsis;
110
+ white-space: nowrap;
111
+ }
112
+
113
+ &-cell-ellipsis-multi {
114
+ overflow: hidden;
115
+ text-overflow: ellipsis;
116
+ display: -webkit-box;
117
+ -webkit-box-orient: vertical;
118
+ white-space: normal;
119
+ }
120
+
121
+ &-cell-ellipsis-multi.lineclamp2 {
122
+ -webkit-line-clamp: 2;
123
+ }
124
+ &-cell-ellipsis-multi.lineclamp3 {
125
+ -webkit-line-clamp: 3;
126
+ }
127
+ &-cell-ellipsis-multi.lineclamp4 {
128
+ -webkit-line-clamp: 4;
129
+ }
130
+ &-cell-ellipsis-multi.lineclamp5 {
131
+ -webkit-line-clamp: 5;
132
+ }
133
+ &-cell-ellipsis-multi.lineclamp6 {
134
+ -webkit-line-clamp: 6;
135
+ }
136
+ &-cell-ellipsis-multi.lineclamp7 {
137
+ -webkit-line-clamp: 7;
138
+ }
139
+ &-cell-ellipsis-multi.lineclamp8 {
140
+ -webkit-line-clamp: 8;
141
+ }
142
+ &-cell-ellipsis-multi.lineclamp9 {
143
+ -webkit-line-clamp: 9;
144
+ }
145
+ &-cell-ellipsis-multi.lineclamp10 {
146
+ -webkit-line-clamp: 10;
147
+ }
148
+
107
149
  &-nodata {
108
150
  color: red;
109
151
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "1.1.22-beta-2",
3
+ "version": "1.1.22-beta-4",
4
4
  "description": "CcsDatePicker.RangePicker参数bug;CcsProTable删除disableCollapseForm参数;CcsProTable添加formItemLayout,formItemCol参数适应自定义布局",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -21,7 +21,6 @@
21
21
  "lint": "npm run lint:es && npm run lint:css",
22
22
  "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
23
23
  "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
24
- "prepare": "husky install && dumi setup",
25
24
  "prepublishOnly": "father doctor && npm run build",
26
25
  "publish:beta": "father build && npm publish --tag=beta && cnpm sync @ccs-ui/rc-pro",
27
26
  "publish:prod": "father build && npm publish && cnpm sync @ccs-ui/rc-pro",