@aloudata/aloudata-design 2.2.0 → 2.4.0

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 (36) hide show
  1. package/dist/DataPreviewTable/index.js +1 -1
  2. package/dist/DatePicker/index.d.ts +1 -0
  3. package/dist/DatePicker/index.js +0 -1
  4. package/dist/Divider/index.d.ts +7 -25
  5. package/dist/Divider/index.js +14 -4
  6. package/dist/Divider/style/index.less +36 -1
  7. package/dist/MemberPicker/components/MultipleOption.js +1 -0
  8. package/dist/Menu/style/index.less +0 -3
  9. package/dist/Radio/components/Group/index.d.ts +1 -3
  10. package/dist/Radio/components/Group/index.js +2 -10
  11. package/dist/Radio/components/Radio/index.js +2 -34
  12. package/dist/Radio/style/index.less +26 -47
  13. package/dist/Select/index.js +1 -1
  14. package/dist/Switch/index.js +6 -1
  15. package/dist/Switch/style/index.less +1 -0
  16. package/dist/Switch/style/status.less +12 -0
  17. package/dist/Table/components/Cell.d.ts +1 -1
  18. package/dist/Table/components/Cell.js +24 -2
  19. package/dist/Table/components/ErrorBoundary.d.ts +15 -0
  20. package/dist/Table/components/ErrorBoundary.js +56 -0
  21. package/dist/Table/helper.d.ts +14 -4
  22. package/dist/Table/helper.js +12 -3
  23. package/dist/Table/index.js +6 -6
  24. package/dist/Table/types.d.ts +8 -0
  25. package/dist/Tree/Tree.js +1 -1
  26. package/dist/Watermark/index.d.ts +25 -0
  27. package/dist/Watermark/index.js +6 -0
  28. package/dist/Watermark/style/index.d.ts +2 -0
  29. package/dist/Watermark/style/index.js +2 -0
  30. package/dist/Watermark/style/index.less +1 -0
  31. package/dist/ald.min.css +1 -1
  32. package/dist/index.d.ts +1 -0
  33. package/dist/index.js +1 -0
  34. package/dist/index.less +1 -0
  35. package/package.json +1 -1
  36. package/dist/Divider/style/index.less.d.ts +0 -183
@@ -1,10 +1,17 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ 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; }
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
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1
7
  import _ from 'lodash';
2
8
  import Cell from "./components/Cell";
3
9
  import Header from "./components/Header";
4
10
  export function getTableColumns(_ref) {
5
11
  var columns = _ref.columns,
6
12
  columnSizing = _ref.columnSizing,
7
- totalWidth = _ref.totalWidth;
13
+ totalWidth = _ref.totalWidth,
14
+ onError = _ref.onError;
8
15
  var columnWidths = getColumnWidths(columns, columnSizing, totalWidth);
9
16
  return _.map(columns, function (col, index) {
10
17
  return {
@@ -13,13 +20,15 @@ export function getTableColumns(_ref) {
13
20
  header: Header,
14
21
  cell: Cell,
15
22
  size: columnWidths[index],
16
- meta: col
23
+ meta: _objectSpread(_objectSpread({}, col), {}, {
24
+ onError: onError
25
+ })
17
26
  };
18
27
  });
19
28
  }
20
29
 
21
30
  /**
22
- * 计算
31
+ * 计算列宽
23
32
  * @param columns
24
33
  * @param columnSizing
25
34
  * @param totalWidth
@@ -35,7 +35,8 @@ function Table(props, ref) {
35
35
  rowClassName = _props$rowClassName === void 0 ? function () {
36
36
  return '';
37
37
  } : _props$rowClassName,
38
- onRowClick = props.onRowClick;
38
+ onRowClick = props.onRowClick,
39
+ onError = props.onError;
39
40
  var _useState = useState(null),
40
41
  _useState2 = _slicedToArray(_useState, 2),
41
42
  totalSize = _useState2[0],
@@ -67,9 +68,10 @@ function Table(props, ref) {
67
68
  return getTableColumns({
68
69
  columns: columns,
69
70
  columnSizing: !!columnSizing,
70
- totalWidth: realWidth
71
+ totalWidth: realWidth,
72
+ onError: onError
71
73
  });
72
- }, [columns, totalSize, columnSizing, realWidth]);
74
+ }, [columns, totalSize, columnSizing, realWidth, onError]);
73
75
  var tableInstance = useReactTable({
74
76
  columns: tableColumns,
75
77
  data: data,
@@ -134,8 +136,7 @@ function Table(props, ref) {
134
136
 
135
137
  // 渲染 body
136
138
  var bodyContent = /*#__PURE__*/React.createElement(Spin, {
137
- spinning: !!loading,
138
- tip: "Loading..."
139
+ spinning: !!loading
139
140
  }, /*#__PURE__*/React.createElement("div", {
140
141
  className: prefixCls('body'),
141
142
  style: {
@@ -144,7 +145,6 @@ function Table(props, ref) {
144
145
  }, rows.length === 0 && !loading ? emptyComponent || /*#__PURE__*/React.createElement("div", {
145
146
  className: prefixCls('empty')
146
147
  }, /*#__PURE__*/React.createElement(Empty, {
147
- title: "No Data",
148
148
  image: Empty.PRESENTED_IMAGE_SEARCH
149
149
  })) : _.map(rows, function (row, rowIndex) {
150
150
  return /*#__PURE__*/React.createElement("div", {
@@ -14,6 +14,14 @@ export interface ITableProps<TDataItem extends object> {
14
14
  empty?: React.ReactNode;
15
15
  rowClassName?: (record: TDataItem, index: number) => string;
16
16
  onRowClick?: (record: TDataItem, index: number) => void;
17
+ onError?: (errorInfo: ITableCellErrorInfo) => void;
18
+ }
19
+ export interface ITableCellErrorInfo {
20
+ error: Error;
21
+ stack: React.ErrorInfo['componentStack'];
22
+ extra?: {
23
+ [key: string]: unknown;
24
+ };
17
25
  }
18
26
  export interface ITableRef {
19
27
  scrollToFirstRow: () => void;
package/dist/Tree/Tree.js CHANGED
@@ -169,7 +169,7 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
169
169
  if (newTreeData !== null && newTreeData !== void 0 && newTreeData.length) {
170
170
  return newTreeData.every(function (node) {
171
171
  var _node$children;
172
- return !((_node$children = node.children) !== null && _node$children !== void 0 && _node$children.length);
172
+ return !((_node$children = node.children) !== null && _node$children !== void 0 && _node$children.length) && node.isLeaf !== false;
173
173
  });
174
174
  }
175
175
  return true;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ export interface IFont {
3
+ color?: string;
4
+ fontSize?: number | string;
5
+ fontWeight?: 'normal' | 'light' | 'weight' | number;
6
+ fontStyle?: 'none' | 'normal' | 'italic' | 'oblique';
7
+ fontFamily?: string;
8
+ }
9
+ export interface IWatermarkProps {
10
+ zIndex?: number;
11
+ rotate?: number;
12
+ width?: number;
13
+ height?: number;
14
+ image?: string;
15
+ content?: string | string[];
16
+ font?: IFont;
17
+ style?: React.CSSProperties;
18
+ className?: string;
19
+ rootClassName?: string;
20
+ gap?: [number, number];
21
+ offset?: [number, number];
22
+ children?: React.ReactNode;
23
+ }
24
+ declare function Watermark(props: IWatermarkProps): React.JSX.Element;
25
+ export default Watermark;
@@ -0,0 +1,6 @@
1
+ import { Watermark as AntdWatermark } from 'antd';
2
+ import React from 'react';
3
+ function Watermark(props) {
4
+ return /*#__PURE__*/React.createElement(AntdWatermark, props);
5
+ }
6
+ export default Watermark;
@@ -0,0 +1,2 @@
1
+ import '../../style';
2
+ import './index.less';
@@ -0,0 +1,2 @@
1
+ import "../../style";
2
+ import "./index.less";
@@ -0,0 +1 @@
1
+ @import '../../style/index.less';