@aloudata/aloudata-design 0.4.0-beta.5 → 0.4.0-beta.7

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 (49) hide show
  1. package/es/Breadcrumb/index.d.ts +5 -2
  2. package/es/Breadcrumb/index.js +17 -7
  3. package/es/Checkbox/style/index.less +0 -4
  4. package/es/Dropdown/Button.d.ts +4 -4
  5. package/es/Dropdown/Button.js +5 -5
  6. package/es/Dropdown/index.d.ts +5 -5
  7. package/es/Dropdown/index.js +5 -5
  8. package/es/Icon/icons.js +135 -58
  9. package/es/Input/components/Password/index.d.ts +1 -1
  10. package/es/Input/components/TextArea/index.d.ts +1 -1
  11. package/es/{Popconfim → Popconfirm}/index.d.ts +0 -0
  12. package/es/{Popconfim → Popconfirm}/index.js +0 -0
  13. package/es/{Popconfim → Popconfirm}/style/index.d.ts +0 -0
  14. package/es/{Popconfim → Popconfirm}/style/index.js +0 -0
  15. package/es/{Popconfim → Popconfirm}/style/index.less +0 -0
  16. package/es/Table/interface.d.ts +1 -0
  17. package/es/Table/utils.js +15 -8
  18. package/es/Tooltip/index.d.ts +2 -2
  19. package/es/Tooltip/index.js +4 -4
  20. package/es/index.d.ts +2 -2
  21. package/es/index.js +1 -1
  22. package/es/style/themes/default/scrollBar.less +10 -7
  23. package/lib/Breadcrumb/index.d.ts +5 -2
  24. package/lib/Breadcrumb/index.js +17 -8
  25. package/lib/Checkbox/style/index.less +0 -4
  26. package/lib/Dropdown/Button.d.ts +4 -4
  27. package/lib/Dropdown/Button.js +5 -5
  28. package/lib/Dropdown/index.d.ts +5 -5
  29. package/lib/Dropdown/index.js +5 -5
  30. package/lib/Icon/icons.js +135 -58
  31. package/lib/Input/components/Password/index.d.ts +1 -1
  32. package/lib/Input/components/TextArea/index.d.ts +1 -1
  33. package/lib/{Popconfim → Popconfirm}/index.d.ts +0 -0
  34. package/lib/{Popconfim → Popconfirm}/index.js +0 -0
  35. package/lib/{Popconfim → Popconfirm}/style/index.d.ts +0 -0
  36. package/lib/{Popconfim → Popconfirm}/style/index.js +0 -0
  37. package/lib/{Popconfim → Popconfirm}/style/index.less +0 -0
  38. package/lib/Table/interface.d.ts +1 -0
  39. package/lib/Table/utils.js +15 -8
  40. package/lib/Tooltip/index.d.ts +2 -2
  41. package/lib/Tooltip/index.js +4 -4
  42. package/lib/index.d.ts +2 -2
  43. package/lib/index.js +3 -3
  44. package/lib/style/themes/default/scrollBar.less +10 -7
  45. package/package.json +3 -3
  46. package/es/Table/hooks/useTableColumn.d.ts +0 -28
  47. package/es/Table/hooks/useTableColumn.js +0 -53
  48. package/lib/Table/hooks/useTableColumn.d.ts +0 -28
  49. package/lib/Table/hooks/useTableColumn.js +0 -66
@@ -1,13 +1,16 @@
1
- ::-webkit-scrollbar-thumb {
2
- background: @NL90;
3
- background-clip: padding-box;
1
+ &::-webkit-scrollbar {
2
+ width: 12px !important;
3
+ height: 12px !important;
4
+ opacity: 0.5;
5
+ }
6
+
7
+ &::-webkit-scrollbar-thumb {
8
+ background-color: rgba(152, 162, 179, 0.5);
4
9
  border: 3px solid transparent;
5
10
  border-radius: 6px;
11
+ background-clip: padding-box;
6
12
  }
7
13
 
8
- ::-webkit-scrollbar {
9
- width: 12px;
10
- height: 12px;
11
- min-height: 12px;
14
+ &::-webkit-scrollbar-track {
12
15
  background-color: transparent;
13
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloudata/aloudata-design",
3
- "version": "0.4.0-beta.5",
3
+ "version": "0.4.0-beta.7",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -52,9 +52,9 @@
52
52
  ]
53
53
  },
54
54
  "dependencies": {
55
- "@aloudata/icons-react": "^0.0.10",
55
+ "@aloudata/icons-react": "^0.0.12",
56
56
  "@ant-design/icons": "^4.7.0",
57
- "antd": "^4.21.5",
57
+ "antd": "^4.23.5",
58
58
  "babel-preset-react-app": "^10.0.1",
59
59
  "classnames": "^2.3.1",
60
60
  "lodash": "^4.17.21",
@@ -1,28 +0,0 @@
1
- import React from 'react';
2
- import { IColumn } from '../interface';
3
- import { IWidthDetail } from '../utils';
4
- import { Cell } from 'react-table';
5
- import 'react-table/node_modules/@types/react';
6
- interface IUseTableColumnProps<T> {
7
- columnsWidthMapRef: React.MutableRefObject<Map<string, IWidthDetail> | undefined>;
8
- columnsTotalWidthRef: React.MutableRefObject<number>;
9
- columnsRef: React.MutableRefObject<IColumn<T>[]>;
10
- tableClientWidth: number;
11
- sortable?: boolean;
12
- }
13
- declare function useTableColumn<T extends object = {}>(props: IUseTableColumnProps<T>): {
14
- width: number | undefined;
15
- Header: string | (() => null);
16
- disableSortBy: boolean;
17
- accessor: string;
18
- Cell: ({ row, value }: Cell) => any;
19
- title: string | null;
20
- dataIndex: string;
21
- render?: ((value: any, row: T, index: number) => React.ReactNode) | undefined;
22
- minWidth?: number | undefined;
23
- sorter?: boolean | "string" | "number" | "basic" | "datetime" | "alphanumeric" | undefined;
24
- sortOrder?: false | "ascend" | "descend" | undefined;
25
- sortDirections?: ("ascend" | "descend")[] | undefined;
26
- selected?: boolean | undefined;
27
- }[];
28
- export default useTableColumn;
@@ -1,53 +0,0 @@
1
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
-
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
-
5
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
-
7
- import { useMemo } from 'react';
8
- import { getColumnsWidthMap } from '../utils';
9
- import message from '../../message';
10
- import 'react-table/node_modules/@types/react';
11
-
12
- function useTableColumn(props) {
13
- var columnsWidthMapRef = props.columnsWidthMapRef,
14
- columnsTotalWidthRef = props.columnsTotalWidthRef,
15
- columnsRef = props.columnsRef,
16
- tableClientWidth = props.tableClientWidth,
17
- sortable = props.sortable; // 转换外部传入的columns
18
-
19
- var newColumns = useMemo(function () {
20
- var _getColumnsWidthMap = getColumnsWidthMap(columnsRef.current, tableClientWidth, columnsWidthMapRef.current),
21
- columnsWidthMap = _getColumnsWidthMap.columnsWidthMap,
22
- totalColumnWidth = _getColumnsWidthMap.totalColumnWidth;
23
-
24
- columnsWidthMapRef.current = columnsWidthMap;
25
- columnsTotalWidthRef.current = totalColumnWidth;
26
- return columnsRef.current.map(function (column, index) {
27
- var _columnsWidthMapRef$c, _columnsWidthMapRef$c2;
28
-
29
- var key = index.toString(); // 不设置dataIndex同时进行排序 则报错
30
-
31
- if (!column.dataIndex === undefined && sortable) {
32
- message.error('不支持未设置dataIndex时进行排序设置');
33
- }
34
-
35
- return _objectSpread(_objectSpread({}, column), {}, {
36
- width: (_columnsWidthMapRef$c = columnsWidthMapRef.current) === null || _columnsWidthMapRef$c === void 0 ? void 0 : (_columnsWidthMapRef$c2 = _columnsWidthMapRef$c.get(key)) === null || _columnsWidthMapRef$c2 === void 0 ? void 0 : _columnsWidthMapRef$c2.width,
37
- Header: column.title ? column.title : function () {
38
- return null;
39
- },
40
- disableSortBy: !sortable || typeof column.sorter === 'boolean',
41
- accessor: column.dataIndex,
42
- Cell: function Cell(_ref) {
43
- var row = _ref.row,
44
- value = _ref.value;
45
- return typeof column.render === 'function' ? column.render(value, row.original, row.index) : value;
46
- }
47
- });
48
- });
49
- }, [columnsRef, columnsTotalWidthRef, columnsWidthMapRef, sortable, tableClientWidth]);
50
- return newColumns;
51
- }
52
-
53
- export default useTableColumn;
@@ -1,28 +0,0 @@
1
- import React from 'react';
2
- import { IColumn } from '../interface';
3
- import { IWidthDetail } from '../utils';
4
- import { Cell } from 'react-table';
5
- import 'react-table/node_modules/@types/react';
6
- interface IUseTableColumnProps<T> {
7
- columnsWidthMapRef: React.MutableRefObject<Map<string, IWidthDetail> | undefined>;
8
- columnsTotalWidthRef: React.MutableRefObject<number>;
9
- columnsRef: React.MutableRefObject<IColumn<T>[]>;
10
- tableClientWidth: number;
11
- sortable?: boolean;
12
- }
13
- declare function useTableColumn<T extends object = {}>(props: IUseTableColumnProps<T>): {
14
- width: number | undefined;
15
- Header: string | (() => null);
16
- disableSortBy: boolean;
17
- accessor: string;
18
- Cell: ({ row, value }: Cell) => any;
19
- title: string | null;
20
- dataIndex: string;
21
- render?: ((value: any, row: T, index: number) => React.ReactNode) | undefined;
22
- minWidth?: number | undefined;
23
- sorter?: boolean | "string" | "number" | "basic" | "datetime" | "alphanumeric" | undefined;
24
- sortOrder?: false | "ascend" | "descend" | undefined;
25
- sortDirections?: ("ascend" | "descend")[] | undefined;
26
- selected?: boolean | undefined;
27
- }[];
28
- export default useTableColumn;
@@ -1,66 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = require("react");
9
-
10
- var _utils = require("../utils");
11
-
12
- var _message = _interopRequireDefault(require("../../message"));
13
-
14
- require("react-table/node_modules/@types/react");
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
-
20
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
21
-
22
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
-
24
- function useTableColumn(props) {
25
- var columnsWidthMapRef = props.columnsWidthMapRef,
26
- columnsTotalWidthRef = props.columnsTotalWidthRef,
27
- columnsRef = props.columnsRef,
28
- tableClientWidth = props.tableClientWidth,
29
- sortable = props.sortable; // 转换外部传入的columns
30
-
31
- var newColumns = (0, _react.useMemo)(function () {
32
- var _getColumnsWidthMap = (0, _utils.getColumnsWidthMap)(columnsRef.current, tableClientWidth, columnsWidthMapRef.current),
33
- columnsWidthMap = _getColumnsWidthMap.columnsWidthMap,
34
- totalColumnWidth = _getColumnsWidthMap.totalColumnWidth;
35
-
36
- columnsWidthMapRef.current = columnsWidthMap;
37
- columnsTotalWidthRef.current = totalColumnWidth;
38
- return columnsRef.current.map(function (column, index) {
39
- var _columnsWidthMapRef$c, _columnsWidthMapRef$c2;
40
-
41
- var key = index.toString(); // 不设置dataIndex同时进行排序 则报错
42
-
43
- if (!column.dataIndex === undefined && sortable) {
44
- _message.default.error('不支持未设置dataIndex时进行排序设置');
45
- }
46
-
47
- return _objectSpread(_objectSpread({}, column), {}, {
48
- width: (_columnsWidthMapRef$c = columnsWidthMapRef.current) === null || _columnsWidthMapRef$c === void 0 ? void 0 : (_columnsWidthMapRef$c2 = _columnsWidthMapRef$c.get(key)) === null || _columnsWidthMapRef$c2 === void 0 ? void 0 : _columnsWidthMapRef$c2.width,
49
- Header: column.title ? column.title : function () {
50
- return null;
51
- },
52
- disableSortBy: !sortable || typeof column.sorter === 'boolean',
53
- accessor: column.dataIndex,
54
- Cell: function Cell(_ref) {
55
- var row = _ref.row,
56
- value = _ref.value;
57
- return typeof column.render === 'function' ? column.render(value, row.original, row.index) : value;
58
- }
59
- });
60
- });
61
- }, [columnsRef, columnsTotalWidthRef, columnsWidthMapRef, sortable, tableClientWidth]);
62
- return newColumns;
63
- }
64
-
65
- var _default = useTableColumn;
66
- exports.default = _default;