ebaoferc 0.3.4 → 0.3.6

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,15 +1,18 @@
1
1
  import type { TableProps } from 'antd';
2
2
  import { SetStateAction } from 'react';
3
3
  import './index.less';
4
+ type StyledTableProps = TableProps<any> & {
5
+ maxCellWidth?: number;
6
+ maxTooltipWidth?: number;
7
+ maxTooltipHeight?: number;
8
+ };
4
9
  export declare const PaginationCommonProps: {
5
10
  showSizeChanger: boolean;
6
11
  showQuickJumper: boolean;
7
12
  showTotal: (total: number) => string;
8
13
  };
9
- export declare const TableCellText: (text: string | number, maxWidth?: number) => import("react/jsx-runtime").JSX.Element | "-";
10
- export default function (props: TableProps<any> & {
11
- maxCellWidth?: number;
12
- }): import("react/jsx-runtime").JSX.Element;
14
+ export declare const TableCellText: (text: string | number, cellWidth: any, maxTooltipWidth: any, maxTooltipHeight: any) => import("react/jsx-runtime").JSX.Element | "-";
15
+ export default function (props: StyledTableProps): import("react/jsx-runtime").JSX.Element;
13
16
  export declare const useRowSelection: () => {
14
17
  selectedRowKeys: any[];
15
18
  selectedRows: any[];
@@ -26,3 +29,4 @@ export declare const useRowSelection: () => {
26
29
  };
27
30
  clearRows: () => void;
28
31
  };
32
+ export {};
@@ -1,5 +1,6 @@
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 = ["columns", "pagination", "maxCellWidth"];
2
+ var _excluded = ["columns", "pagination", "maxCellWidth", "maxTooltipWidth", "maxTooltipHeight"],
3
+ _excluded2 = ["longTextWidth", "maxTooltipWidth", "maxTooltipHeight"];
3
4
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
5
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
6
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
@@ -30,10 +31,10 @@ export var PaginationCommonProps = {
30
31
  showQuickJumper: true,
31
32
  showTotal: showTotal
32
33
  };
33
- export var TableCellText = function TableCellText(text) {
34
- var maxWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 230;
34
+ export var TableCellText = function TableCellText(text, cellWidth, maxTooltipWidth, maxTooltipHeight) {
35
35
  var val = text || text === 0 ? text : '-';
36
36
  if (val === '-') return '-';
37
+ var _maxWidth = maxTooltipWidth || cellWidth + 100;
37
38
  return /*#__PURE__*/_jsx(Typography.Text, {
38
39
  ellipsis: {
39
40
  tooltip: {
@@ -42,14 +43,16 @@ export var TableCellText = function TableCellText(text) {
42
43
  placement: 'topLeft',
43
44
  overlayInnerStyle: {
44
45
  color: '#000',
45
- width: maxWidth + 100,
46
+ width: _maxWidth,
46
47
  lineHeight: '22px',
47
- padding: '15px'
48
+ maxHeight: maxTooltipHeight,
49
+ overflow: 'auto',
50
+ padding: '15px 5px 15px 15px'
48
51
  }
49
52
  }
50
53
  },
51
54
  style: {
52
- maxWidth: maxWidth
55
+ maxWidth: cellWidth
53
56
  },
54
57
  children: val
55
58
  });
@@ -59,13 +62,20 @@ export default function (props) {
59
62
  pagination = props.pagination,
60
63
  _props$maxCellWidth = props.maxCellWidth,
61
64
  maxCellWidth = _props$maxCellWidth === void 0 ? 230 : _props$maxCellWidth,
65
+ maxTooltipWidth = props.maxTooltipWidth,
66
+ _props$maxTooltipHeig = props.maxTooltipHeight,
67
+ maxTooltipHeight = _props$maxTooltipHeig === void 0 ? 300 : _props$maxTooltipHeig,
62
68
  rest = _objectWithoutProperties(props, _excluded);
63
69
  var _columns = columns === null || columns === void 0 ? void 0 : columns.map(function (item) {
64
- return _objectSpread(_objectSpread({}, item), {}, {
70
+ var longTextWidth = item.longTextWidth,
71
+ _maxTooltipWidth = item.maxTooltipWidth,
72
+ _maxTooltipHeight = item.maxTooltipHeight,
73
+ rest = _objectWithoutProperties(item, _excluded2);
74
+ return _objectSpread(_objectSpread({}, rest), {}, {
65
75
  ellipsis: false,
66
76
  render: function render(val, record, index) {
67
77
  var renderVal = item.render ? item.render(val, record, index) : val;
68
- return /*#__PURE__*/isValidElement(renderVal) ? renderVal : TableCellText(renderVal, item.longTextWidth || maxCellWidth);
78
+ return /*#__PURE__*/isValidElement(renderVal) ? renderVal : TableCellText(renderVal, longTextWidth || maxCellWidth, _maxTooltipWidth || maxTooltipWidth, _maxTooltipHeight || maxTooltipHeight);
69
79
  }
70
80
  });
71
81
  });
@@ -1,6 +1,7 @@
1
1
  .styled-table-row {
2
2
  td {
3
- padding: 12.67px 16px !important;
3
+ padding-top: 12.67px !important;
4
+ padding-bottom: 12.67px !important;
4
5
  }
5
6
 
6
7
  &:hover {
package/package.json CHANGED
@@ -1,100 +1,100 @@
1
- {
2
- "name": "ebaoferc",
3
- "version": "0.3.4",
4
- "description": "A react library developed with dumi",
5
- "license": "MIT",
6
- "module": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "files": [
9
- "dist"
10
- ],
11
- "scripts": {
12
- "build": "node checkProject && father build",
13
- "build:watch": "father dev",
14
- "dev": "dumi dev",
15
- "docs:build": "dumi build",
16
- "docs:preview": "dumi preview",
17
- "doctor": "father doctor",
18
- "lint": "npm run lint:es && npm run lint:css",
19
- "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
20
- "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
21
- "prepare": "husky install && dumi setup",
22
- "prepublishOnly": "father doctor && npm run build",
23
- "start": "npm run dev"
24
- },
25
- "commitlint": {
26
- "extends": [
27
- "@commitlint/config-conventional"
28
- ]
29
- },
30
- "lint-staged": {
31
- "*.{md,json}": [
32
- "prettier --write --no-error-on-unmatched-pattern"
33
- ],
34
- "*.{css,less}": [
35
- "stylelint --fix",
36
- "prettier --write"
37
- ],
38
- "*.{js,jsx}": [
39
- "eslint --fix",
40
- "prettier --write"
41
- ],
42
- "*.{ts,tsx}": [
43
- "eslint --fix",
44
- "prettier --parser=typescript --write"
45
- ]
46
- },
47
- "dependencies": {
48
- "d3": "^7.9.0",
49
- "dagre": "^0.8.5"
50
- },
51
- "devDependencies": {
52
- "@ant-design/icons": "^5.3.7",
53
- "@ant-design/pro-components": "^2.7.1",
54
- "@commitlint/cli": "^18.2.0",
55
- "@commitlint/config-conventional": "^18.1.0",
56
- "@commitlint/config-pnpm-scopes": "^18.1.0",
57
- "@types/lodash": "^4.17.7",
58
- "@types/react": "^18.2.36",
59
- "@types/react-dom": "^18.2.14",
60
- "@umijs/lint": "^4.0.87",
61
- "@umijs/max": "^4.1.10",
62
- "@vitest/coverage-v8": "^0.34.6",
63
- "ahooks": "^3.7.10",
64
- "antd": "^5.17.0",
65
- "classnames": "^2.5.1",
66
- "connect-history-api-fallback": "^2.0.0",
67
- "cross-env": "^7.0.3",
68
- "dayjs": "^1.11.10",
69
- "dumi": "^2.3.0",
70
- "eslint": "^8.23.0",
71
- "express": "^4.19.2",
72
- "father": "^4.1.0",
73
- "husky": "^8.0.1",
74
- "lint-staged": "^13.0.3",
75
- "lodash": "^4.17.21",
76
- "prettier": "^2.7.1",
77
- "prettier-plugin-organize-imports": "^3.0.0",
78
- "prettier-plugin-packagejson": "^2.2.18",
79
- "react": "^18.0.0",
80
- "react-dom": "^18.0.0",
81
- "stylelint": "^14.9.1"
82
- },
83
- "peerDependencies": {
84
- "@ant-design/icons": "^5.3.7",
85
- "@ant-design/pro-components": "^2.7.1",
86
- "ahooks": "^3.7.10",
87
- "antd": "^5.17.0",
88
- "classnames": "^2.5.1",
89
- "cross-env": "^7.0.3",
90
- "dayjs": "^1.11.10",
91
- "lodash": "^4.17.21",
92
- "react": ">=16.9.0",
93
- "react-dom": ">=16.9.0"
94
- },
95
- "publishConfig": {
96
- "access": "public",
97
- "registry": "https://registry.npmjs.org"
98
- },
99
- "authors": []
100
- }
1
+ {
2
+ "name": "ebaoferc",
3
+ "version": "0.3.6",
4
+ "description": "A react library developed with dumi",
5
+ "license": "MIT",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "build": "node checkProject && father build",
13
+ "build:watch": "father dev",
14
+ "dev": "dumi dev",
15
+ "docs:build": "dumi build",
16
+ "docs:preview": "dumi preview",
17
+ "doctor": "father doctor",
18
+ "lint": "npm run lint:es && npm run lint:css",
19
+ "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
20
+ "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
21
+ "prepare": "husky install && dumi setup",
22
+ "prepublishOnly": "father doctor && npm run build",
23
+ "start": "npm run dev"
24
+ },
25
+ "commitlint": {
26
+ "extends": [
27
+ "@commitlint/config-conventional"
28
+ ]
29
+ },
30
+ "lint-staged": {
31
+ "*.{md,json}": [
32
+ "prettier --write --no-error-on-unmatched-pattern"
33
+ ],
34
+ "*.{css,less}": [
35
+ "stylelint --fix",
36
+ "prettier --write"
37
+ ],
38
+ "*.{js,jsx}": [
39
+ "eslint --fix",
40
+ "prettier --write"
41
+ ],
42
+ "*.{ts,tsx}": [
43
+ "eslint --fix",
44
+ "prettier --parser=typescript --write"
45
+ ]
46
+ },
47
+ "dependencies": {
48
+ "d3": "^7.9.0",
49
+ "dagre": "^0.8.5"
50
+ },
51
+ "devDependencies": {
52
+ "@ant-design/icons": "^5.3.7",
53
+ "@ant-design/pro-components": "^2.7.1",
54
+ "@commitlint/cli": "^18.2.0",
55
+ "@commitlint/config-conventional": "^18.1.0",
56
+ "@commitlint/config-pnpm-scopes": "^18.1.0",
57
+ "@types/lodash": "^4.17.7",
58
+ "@types/react": "^18.2.36",
59
+ "@types/react-dom": "^18.2.14",
60
+ "@umijs/lint": "^4.0.87",
61
+ "@umijs/max": "^4.1.10",
62
+ "@vitest/coverage-v8": "^0.34.6",
63
+ "ahooks": "^3.7.10",
64
+ "antd": "^5.17.0",
65
+ "classnames": "^2.5.1",
66
+ "connect-history-api-fallback": "^2.0.0",
67
+ "cross-env": "^7.0.3",
68
+ "dayjs": "^1.11.10",
69
+ "dumi": "^2.3.0",
70
+ "eslint": "^8.23.0",
71
+ "express": "^4.19.2",
72
+ "father": "^4.1.0",
73
+ "husky": "^8.0.1",
74
+ "lint-staged": "^13.0.3",
75
+ "lodash": "^4.17.21",
76
+ "prettier": "^2.7.1",
77
+ "prettier-plugin-organize-imports": "^3.0.0",
78
+ "prettier-plugin-packagejson": "^2.2.18",
79
+ "react": "^18.0.0",
80
+ "react-dom": "^18.0.0",
81
+ "stylelint": "^14.9.1"
82
+ },
83
+ "peerDependencies": {
84
+ "@ant-design/icons": "^5.3.7",
85
+ "@ant-design/pro-components": "^2.7.1",
86
+ "ahooks": "^3.7.10",
87
+ "antd": "^5.17.0",
88
+ "classnames": "^2.5.1",
89
+ "cross-env": "^7.0.3",
90
+ "dayjs": "^1.11.10",
91
+ "lodash": "^4.17.21",
92
+ "react": ">=16.9.0",
93
+ "react-dom": ">=16.9.0"
94
+ },
95
+ "publishConfig": {
96
+ "access": "public",
97
+ "registry": "https://registry.npmjs.org"
98
+ },
99
+ "authors": []
100
+ }