@aloudata/aloudata-design 2.2.0 → 2.3.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.
- package/dist/DataPreviewTable/index.js +1 -1
- package/dist/MemberPicker/components/MultipleOption.js +1 -0
- package/dist/Switch/index.js +6 -1
- package/dist/Switch/style/index.less +1 -0
- package/dist/Switch/style/status.less +12 -0
- package/dist/Table/components/Cell.d.ts +1 -1
- package/dist/Table/components/Cell.js +24 -2
- package/dist/Table/components/ErrorBoundary.d.ts +15 -0
- package/dist/Table/components/ErrorBoundary.js +56 -0
- package/dist/Table/helper.d.ts +14 -4
- package/dist/Table/helper.js +12 -3
- package/dist/Table/index.js +6 -6
- package/dist/Table/types.d.ts +8 -0
- package/dist/Watermark/index.d.ts +25 -0
- package/dist/Watermark/index.js +6 -0
- package/dist/Watermark/style/index.d.ts +2 -0
- package/dist/Watermark/style/index.js +2 -0
- package/dist/Watermark/style/index.less +1 -0
- package/dist/ald.min.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.less +1 -0
- package/package.json +1 -1
|
@@ -103,7 +103,7 @@ var DataPreviewTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
103
103
|
columnLayout: columnLayout,
|
|
104
104
|
setWidth: setColumnsWidth,
|
|
105
105
|
columnRange: columnRange
|
|
106
|
-
}), dataStatus === 'pending' && /*#__PURE__*/React.createElement("div", {
|
|
106
|
+
}), dataStatus === 'pending' && tableColumns.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
107
107
|
className: "ald-data-preview-loading"
|
|
108
108
|
}, /*#__PURE__*/React.createElement(Spin, null)), dataStatus === 'success' && /*#__PURE__*/React.createElement(Body, {
|
|
109
109
|
columns: tableColumns,
|
|
@@ -40,6 +40,7 @@ export default function MultipleList(params) {
|
|
|
40
40
|
})), isUserGroup(user) && hasNextLevel && /*#__PURE__*/React.createElement(TextLink, {
|
|
41
41
|
className: "ald-member-picker-btn",
|
|
42
42
|
size: "small",
|
|
43
|
+
disabled: disabled,
|
|
43
44
|
onClick: function onClick(e) {
|
|
44
45
|
onNextLevel === null || onNextLevel === void 0 ? void 0 : onNextLevel(user);
|
|
45
46
|
e.stopPropagation();
|
package/dist/Switch/index.js
CHANGED
|
@@ -5,7 +5,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
5
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { Switch as AntdSwitch } from 'antd';
|
|
8
|
+
import { getMergedStatus, getStatusClassNames } from 'antd/lib/_util/statusUtils';
|
|
8
9
|
import DisabledContext from 'antd/lib/config-provider/DisabledContext';
|
|
10
|
+
import { FormItemInputContext } from 'antd/lib/form/context';
|
|
9
11
|
import classnames from 'classnames';
|
|
10
12
|
import React, { useContext, useEffect, useState } from 'react';
|
|
11
13
|
import SizeContext from "../ConfigProvider/sizeContext";
|
|
@@ -31,6 +33,9 @@ var Switch = function Switch(_ref) {
|
|
|
31
33
|
// ===================== Disabled =====================
|
|
32
34
|
var disabled = React.useContext(DisabledContext);
|
|
33
35
|
var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
36
|
+
var _useContext = useContext(FormItemInputContext),
|
|
37
|
+
contextStatus = _useContext.status;
|
|
38
|
+
var mergedStatus = getMergedStatus(contextStatus);
|
|
34
39
|
var onChangeCB = function onChangeCB(isChecked, event) {
|
|
35
40
|
if (checked === undefined) {
|
|
36
41
|
setUserChecked(isChecked);
|
|
@@ -47,7 +52,7 @@ var Switch = function Switch(_ref) {
|
|
|
47
52
|
className: classnames(className, 'ald-switch', "ald-switch-".concat(size), {
|
|
48
53
|
'ald-switch-disabled': currentDisabled,
|
|
49
54
|
'ald-switch-checked': userChecked
|
|
50
|
-
})
|
|
55
|
+
}, getStatusClassNames('ald-switch', mergedStatus))
|
|
51
56
|
}, /*#__PURE__*/React.createElement(AntdSwitch, {
|
|
52
57
|
disabled: currentDisabled,
|
|
53
58
|
loading: loading,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
.ald-switch.ald-switch.ald-switch-status {
|
|
2
|
+
&-error {
|
|
3
|
+
.ald-switch-btn:not(.ant-switch-checked) {
|
|
4
|
+
box-shadow: 0 0 0 1px var(--alias-colors-icon-inverse-default, #fff),
|
|
5
|
+
0 0 0 2.5px var(--alias-color-icon-danger, #ef4444);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.ald-switch-btn.ant-switch-checked {
|
|
9
|
+
background-color: var(--alias-color-icon-danger, #ef4444);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Column, Row } from '@tanstack/react-table';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export default function
|
|
3
|
+
export default function CellWithErrorBoundary<T>(props: IProps<T>): React.JSX.Element;
|
|
4
4
|
export interface IProps<T> {
|
|
5
5
|
row: Row<T>;
|
|
6
6
|
column: Column<T>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import classnames from 'classnames';
|
|
2
2
|
import _ from 'lodash';
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { useCallback } from 'react';
|
|
4
4
|
import { prefixCls } from "../helper";
|
|
5
|
-
|
|
5
|
+
import ErrorBoundary from "./ErrorBoundary";
|
|
6
|
+
function Cell(props) {
|
|
6
7
|
var column = props.column,
|
|
7
8
|
row = props.row;
|
|
8
9
|
var meta = column.columnDef.meta;
|
|
@@ -17,4 +18,25 @@ export default function Cell(props) {
|
|
|
17
18
|
}, ellipsis ? /*#__PURE__*/React.createElement("div", {
|
|
18
19
|
className: prefixCls('td-ellipsis-content')
|
|
19
20
|
}, node) : node);
|
|
21
|
+
}
|
|
22
|
+
export default function CellWithErrorBoundary(props) {
|
|
23
|
+
var column = props.column;
|
|
24
|
+
var meta = column.columnDef.meta;
|
|
25
|
+
var dataIndex = meta.dataIndex,
|
|
26
|
+
onError = meta.onError;
|
|
27
|
+
var reportError = useCallback(function (err, stack) {
|
|
28
|
+
if (onError) {
|
|
29
|
+
onError({
|
|
30
|
+
error: err,
|
|
31
|
+
stack: stack,
|
|
32
|
+
extra: {
|
|
33
|
+
place: 'bodyCell',
|
|
34
|
+
dataIndex: dataIndex
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}, [onError, dataIndex]);
|
|
39
|
+
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
40
|
+
onError: reportError
|
|
41
|
+
}, /*#__PURE__*/React.createElement(Cell, props));
|
|
20
42
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
interface ErrorBoundaryProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
onError: (error: Error, stack: string) => void;
|
|
5
|
+
}
|
|
6
|
+
interface ErrorBoundaryState {
|
|
7
|
+
hasError: boolean;
|
|
8
|
+
}
|
|
9
|
+
export default class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
10
|
+
constructor(props: ErrorBoundaryProps);
|
|
11
|
+
static getDerivedStateFromError(): ErrorBoundaryState;
|
|
12
|
+
componentDidCatch(error: Error, info: React.ErrorInfo): void;
|
|
13
|
+
render(): ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
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); }
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import { prefixCls } from "../helper";
|
|
16
|
+
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
17
|
+
_inherits(ErrorBoundary, _React$Component);
|
|
18
|
+
var _super = _createSuper(ErrorBoundary);
|
|
19
|
+
function ErrorBoundary(props) {
|
|
20
|
+
var _this;
|
|
21
|
+
_classCallCheck(this, ErrorBoundary);
|
|
22
|
+
_this = _super.call(this, props);
|
|
23
|
+
_this.state = {
|
|
24
|
+
hasError: false
|
|
25
|
+
};
|
|
26
|
+
return _this;
|
|
27
|
+
}
|
|
28
|
+
_createClass(ErrorBoundary, [{
|
|
29
|
+
key: "componentDidCatch",
|
|
30
|
+
value: function componentDidCatch(error, info) {
|
|
31
|
+
// 在这里上报错误信息
|
|
32
|
+
this.props.onError(error, info.componentStack);
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
key: "render",
|
|
36
|
+
value: function render() {
|
|
37
|
+
if (this.state.hasError) {
|
|
38
|
+
// 你可以渲染任何自定义后备 UI
|
|
39
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
className: prefixCls('td-default')
|
|
41
|
+
}, "\u53D1\u751F\u4E86\u9519\u8BEF");
|
|
42
|
+
}
|
|
43
|
+
return this.props.children;
|
|
44
|
+
}
|
|
45
|
+
}], [{
|
|
46
|
+
key: "getDerivedStateFromError",
|
|
47
|
+
value: function getDerivedStateFromError() {
|
|
48
|
+
// 更新状态,以便下一次渲染将显示后备 UI。
|
|
49
|
+
return {
|
|
50
|
+
hasError: true
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}]);
|
|
54
|
+
return ErrorBoundary;
|
|
55
|
+
}(React.Component);
|
|
56
|
+
export { ErrorBoundary as default };
|
package/dist/Table/helper.d.ts
CHANGED
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ITableColumn } from './types';
|
|
3
|
-
export declare function getTableColumns<TDataItem extends object>({ columns, columnSizing, totalWidth, }: {
|
|
2
|
+
import { ITableColumn, ITableProps } from './types';
|
|
3
|
+
export declare function getTableColumns<TDataItem extends object>({ columns, columnSizing, totalWidth, onError, }: {
|
|
4
4
|
columns: ITableColumn<TDataItem>[];
|
|
5
5
|
columnSizing: boolean;
|
|
6
6
|
totalWidth: number;
|
|
7
|
+
onError: ITableProps<TDataItem>['onError'];
|
|
7
8
|
}): {
|
|
8
9
|
accessorKey: string;
|
|
9
10
|
header: (props: import("./components/Header").IProps<TDataItem>) => import("react").JSX.Element;
|
|
10
11
|
cell: (props: import("./components/Cell").IProps<TDataItem>) => import("react").JSX.Element;
|
|
11
12
|
size: number;
|
|
12
|
-
meta:
|
|
13
|
+
meta: {
|
|
14
|
+
onError: ((errorInfo: import("./types").ITableCellErrorInfo) => void) | undefined;
|
|
15
|
+
title: import("react").ReactNode;
|
|
16
|
+
dataIndex?: string | undefined;
|
|
17
|
+
width?: string | number | undefined;
|
|
18
|
+
render?: ((text: any, record: TDataItem, rowIndex: number) => import("react").ReactNode) | undefined;
|
|
19
|
+
ellipsis?: boolean | undefined;
|
|
20
|
+
noPadding?: boolean | undefined;
|
|
21
|
+
align?: "center" | "left" | "right" | undefined;
|
|
22
|
+
};
|
|
13
23
|
}[];
|
|
14
24
|
/**
|
|
15
|
-
*
|
|
25
|
+
* 计算列宽
|
|
16
26
|
* @param columns
|
|
17
27
|
* @param columnSizing
|
|
18
28
|
* @param totalWidth
|
package/dist/Table/helper.js
CHANGED
|
@@ -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
|
package/dist/Table/index.js
CHANGED
|
@@ -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", {
|
package/dist/Table/types.d.ts
CHANGED
|
@@ -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;
|
|
@@ -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 @@
|
|
|
1
|
+
@import '../../style/index.less';
|