@aloudata/aloudata-design 2.4.0 → 2.5.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/Badge/index.d.ts +3 -0
- package/dist/Badge/index.js +2 -0
- package/dist/Badge/style/index.d.ts +2 -0
- package/dist/Badge/style/index.js +2 -0
- package/dist/Badge/style/index.less +1 -0
- package/dist/Spin/CustomIcon/index.d.ts +5 -3
- package/dist/Spin/CustomIcon/index.js +15 -8
- package/dist/Spin/index.d.ts +7 -3
- package/dist/Spin/index.js +52 -19
- package/dist/Spin/{CustomIcon/index.less → style/customIcon.less} +17 -2
- package/dist/Spin/style/index.less +1 -0
- package/dist/Table/index.js +14 -7
- package/dist/Table/style/index.less +26 -0
- package/dist/TextLink/style/type.less +32 -0
- package/dist/_utils/reactNode.d.ts +1 -0
- package/dist/_utils/reactNode.js +3 -0
- package/dist/ald.min.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/index.less +1 -0
- package/package.json +1 -1
- package/dist/Spin/Icon/index.d.ts +0 -4
- package/dist/Spin/Icon/index.js +0 -7
- package/dist/Spin/Icon/index.less +0 -41
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../style/index.less';
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TDirection } from '..';
|
|
3
|
-
import type { SizeType } from '../../ConfigProvider/
|
|
4
|
-
import './index.less';
|
|
3
|
+
import type { SizeType } from '../../ConfigProvider/sizeContext';
|
|
5
4
|
interface ICustomIconProps {
|
|
6
5
|
size?: SizeType;
|
|
7
6
|
tip?: React.ReactNode;
|
|
8
7
|
direction: TDirection;
|
|
8
|
+
spinning?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
inContainer?: boolean;
|
|
9
11
|
}
|
|
10
|
-
declare const Icon: (props: ICustomIconProps) => React.JSX.Element;
|
|
12
|
+
declare const Icon: (props: ICustomIconProps) => React.JSX.Element | null;
|
|
11
13
|
export default Icon;
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
import { LoadingDuotone } from "../../Icon";
|
|
2
1
|
import classNames from 'classnames';
|
|
3
2
|
import React from 'react';
|
|
4
|
-
import "
|
|
3
|
+
import { LoadingDuotone } from "../../Icon";
|
|
5
4
|
var Icon = function Icon(props) {
|
|
6
5
|
var size = props.size,
|
|
7
6
|
tip = props.tip,
|
|
8
|
-
direction = props.direction
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
direction = props.direction,
|
|
8
|
+
_props$spinning = props.spinning,
|
|
9
|
+
spinning = _props$spinning === void 0 ? true : _props$spinning,
|
|
10
|
+
className = props.className,
|
|
11
|
+
inContainer = props.inContainer;
|
|
12
|
+
if (!spinning) return null;
|
|
13
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, inContainer && /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: "spinner-mask"
|
|
15
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
className: classNames('spinner', className, {
|
|
17
|
+
'spinner-horizontal': direction === 'horizontal',
|
|
18
|
+
'spinner-center': inContainer
|
|
12
19
|
})
|
|
13
20
|
}, /*#__PURE__*/React.createElement("div", {
|
|
14
21
|
className: classNames('spinner-inner', {
|
|
@@ -22,8 +29,8 @@ var Icon = function Icon(props) {
|
|
|
22
29
|
size: 64
|
|
23
30
|
}), size !== 'small' && size !== 'large' && /*#__PURE__*/React.createElement(LoadingDuotone, {
|
|
24
31
|
size: 40
|
|
25
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
32
|
+
})), tip && /*#__PURE__*/React.createElement("div", {
|
|
26
33
|
className: "spinner-text"
|
|
27
|
-
}, tip));
|
|
34
|
+
}, tip)));
|
|
28
35
|
};
|
|
29
36
|
export default Icon;
|
package/dist/Spin/index.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { SpinProps as AntdSpinProps } from 'antd';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
export type TDirection = 'vertical' | 'horizontal';
|
|
4
|
-
export interface SpinProps
|
|
3
|
+
export interface SpinProps {
|
|
5
4
|
size?: 'small' | 'large' | 'middle';
|
|
6
5
|
direction?: TDirection;
|
|
6
|
+
children?: React.ReactElement;
|
|
7
|
+
tip?: React.ReactNode;
|
|
8
|
+
spinning?: boolean;
|
|
9
|
+
wrapperClassName?: string;
|
|
10
|
+
className?: string;
|
|
7
11
|
}
|
|
8
|
-
declare function CustomSpin(props: SpinProps): React.JSX.Element;
|
|
12
|
+
declare function CustomSpin(props: SpinProps): React.JSX.Element | null;
|
|
9
13
|
export default CustomSpin;
|
package/dist/Spin/index.js
CHANGED
|
@@ -1,30 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
function
|
|
3
|
-
function
|
|
4
|
-
function
|
|
5
|
-
|
|
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); }
|
|
6
7
|
import classNames from 'classnames';
|
|
7
|
-
import React from 'react';
|
|
8
|
+
import React, { isValidElement } from 'react';
|
|
9
|
+
import { cloneElement, isFragment, isReactComponent } from "../_utils/reactNode";
|
|
8
10
|
import CustomIcon from "./CustomIcon";
|
|
9
11
|
function CustomSpin(props) {
|
|
10
12
|
var size = props.size,
|
|
11
13
|
tip = props.tip,
|
|
12
14
|
_props$direction = props.direction,
|
|
13
15
|
direction = _props$direction === void 0 ? 'vertical' : _props$direction,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
children = props.children,
|
|
17
|
+
spinning = props.spinning,
|
|
18
|
+
wrapperClassName = props.wrapperClassName,
|
|
19
|
+
className = props.className;
|
|
20
|
+
if (!children) {
|
|
21
|
+
return CustomIcon({
|
|
22
|
+
size: size,
|
|
23
|
+
tip: tip,
|
|
24
|
+
direction: direction,
|
|
25
|
+
spinning: spinning,
|
|
26
|
+
className: className
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
if (! /*#__PURE__*/isValidElement(children)) {
|
|
30
|
+
return children;
|
|
18
31
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
32
|
+
if (isFragment(children) || isReactComponent(children)) {
|
|
33
|
+
return /*#__PURE__*/React.createElement('div', {
|
|
34
|
+
style: {
|
|
35
|
+
position: 'relative'
|
|
36
|
+
},
|
|
37
|
+
className: classNames(wrapperClassName)
|
|
38
|
+
}, [children, CustomIcon({
|
|
39
|
+
size: size,
|
|
23
40
|
tip: tip,
|
|
24
|
-
direction: direction
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
41
|
+
direction: direction,
|
|
42
|
+
inContainer: true,
|
|
43
|
+
spinning: spinning,
|
|
44
|
+
className: className
|
|
45
|
+
})]);
|
|
46
|
+
} else {
|
|
47
|
+
return cloneElement(children, {
|
|
48
|
+
style: _objectSpread({
|
|
49
|
+
position: 'relative'
|
|
50
|
+
}, children.props.style),
|
|
51
|
+
className: classNames(wrapperClassName, children.props.className),
|
|
52
|
+
children: [children.props.children, CustomIcon({
|
|
53
|
+
size: size,
|
|
54
|
+
tip: tip,
|
|
55
|
+
direction: direction,
|
|
56
|
+
spinning: spinning,
|
|
57
|
+
inContainer: true,
|
|
58
|
+
className: className
|
|
59
|
+
})]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
29
62
|
}
|
|
30
63
|
export default CustomSpin;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
@import '../../style/themes/default/themeColor.module.less';
|
|
2
|
-
|
|
3
1
|
@spinner-size-large: 64px;
|
|
4
2
|
@spinner-size-middle: 40px;
|
|
5
3
|
@spinner-size-small: 20px;
|
|
@@ -37,6 +35,23 @@
|
|
|
37
35
|
}
|
|
38
36
|
}
|
|
39
37
|
|
|
38
|
+
.spinner-center {
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: 50%;
|
|
41
|
+
left: 50%;
|
|
42
|
+
transform: translate(-50%, -50%);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.spinner-mask {
|
|
46
|
+
position: absolute;
|
|
47
|
+
top: 0;
|
|
48
|
+
left: 0;
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: 100%;
|
|
51
|
+
opacity: 0.4;
|
|
52
|
+
background: var(--alias-colors-bg-skeleton-subtler, #fff);
|
|
53
|
+
}
|
|
54
|
+
|
|
40
55
|
.spinner-text {
|
|
41
56
|
color: var(--alias-colors-text-subtle, #4b5563);
|
|
42
57
|
}
|
package/dist/Table/index.js
CHANGED
|
@@ -135,9 +135,7 @@ function Table(props, ref) {
|
|
|
135
135
|
}, [onRowClick]);
|
|
136
136
|
|
|
137
137
|
// 渲染 body
|
|
138
|
-
var bodyContent = /*#__PURE__*/React.createElement(
|
|
139
|
-
spinning: !!loading
|
|
140
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
138
|
+
var bodyContent = /*#__PURE__*/React.createElement("div", {
|
|
141
139
|
className: prefixCls('body'),
|
|
142
140
|
style: {
|
|
143
141
|
width: tableInstance.getTotalSize()
|
|
@@ -160,8 +158,10 @@ function Table(props, ref) {
|
|
|
160
158
|
}
|
|
161
159
|
}, flexRender(cell.column.columnDef.cell, cell.getContext()));
|
|
162
160
|
}));
|
|
163
|
-
}))
|
|
164
|
-
var tableContent = y && totalSize ? /*#__PURE__*/React.createElement(
|
|
161
|
+
}));
|
|
162
|
+
var tableContent = y && totalSize ? /*#__PURE__*/React.createElement(Spin, {
|
|
163
|
+
spinning: !!loading
|
|
164
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
165
165
|
className: prefixCls('content')
|
|
166
166
|
}, /*#__PURE__*/React.createElement("div", {
|
|
167
167
|
className: prefixCls('header'),
|
|
@@ -176,9 +176,16 @@ function Table(props, ref) {
|
|
|
176
176
|
}, /*#__PURE__*/React.createElement(ScrollArea, {
|
|
177
177
|
onViewportScroll: onBodyScroll,
|
|
178
178
|
ref: tableBodyRef
|
|
179
|
-
}, bodyContent))) : /*#__PURE__*/React.createElement("div", {
|
|
179
|
+
}, bodyContent)))) : /*#__PURE__*/React.createElement("div", {
|
|
180
180
|
className: prefixCls('content')
|
|
181
|
-
},
|
|
181
|
+
}, !!loading && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
182
|
+
className: prefixCls('spin-mask')
|
|
183
|
+
}), /*#__PURE__*/React.createElement(Spin, null, /*#__PURE__*/React.createElement("div", {
|
|
184
|
+
className: prefixCls('spin'),
|
|
185
|
+
style: {
|
|
186
|
+
position: 'absolute'
|
|
187
|
+
}
|
|
188
|
+
}))), headerContent, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ScrollArea, {
|
|
182
189
|
onViewportScroll: onBodyScroll,
|
|
183
190
|
ref: tableBodyRef
|
|
184
191
|
}, bodyContent)));
|
|
@@ -22,6 +22,32 @@
|
|
|
22
22
|
display: flex;
|
|
23
23
|
flex-direction: column;
|
|
24
24
|
border-spacing: 0;
|
|
25
|
+
position: relative;
|
|
26
|
+
|
|
27
|
+
.ald-table-spin {
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 0;
|
|
30
|
+
left: 0;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 300px;
|
|
33
|
+
max-height: 100%;
|
|
34
|
+
z-index: 2;
|
|
35
|
+
|
|
36
|
+
.spinner-mask {
|
|
37
|
+
opacity: 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.ald-table-spin-mask {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0;
|
|
44
|
+
left: 0;
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: 100%;
|
|
47
|
+
background: #fff;
|
|
48
|
+
opacity: 0.4;
|
|
49
|
+
z-index: 1;
|
|
50
|
+
}
|
|
25
51
|
}
|
|
26
52
|
|
|
27
53
|
.ald-table-resizer {
|
|
@@ -1,32 +1,64 @@
|
|
|
1
1
|
.ald-text-link-primary {
|
|
2
2
|
color: var(--alias-colors-link-default, #126fdd);
|
|
3
3
|
|
|
4
|
+
.ald-icon {
|
|
5
|
+
color: #2986f4;
|
|
6
|
+
}
|
|
7
|
+
|
|
4
8
|
&:hover {
|
|
5
9
|
color: var(--alias-colors-link-hover, #0f59b1);
|
|
10
|
+
|
|
11
|
+
.ald-icon {
|
|
12
|
+
color: #126fdd;
|
|
13
|
+
}
|
|
6
14
|
}
|
|
7
15
|
|
|
8
16
|
&:active {
|
|
9
17
|
color: var(--alias-colors-link-hover, #0f59b1);
|
|
18
|
+
|
|
19
|
+
.ald-icon {
|
|
20
|
+
color: #126fdd;
|
|
21
|
+
}
|
|
10
22
|
}
|
|
11
23
|
|
|
12
24
|
&.ald-text-link-disabled {
|
|
13
25
|
color: var(--alias-colors-text-disabled, rgba(0, 0, 0, 0.25));
|
|
26
|
+
|
|
27
|
+
.ald-icon {
|
|
28
|
+
color: rgba(0, 0, 0, 0.25);
|
|
29
|
+
}
|
|
14
30
|
}
|
|
15
31
|
}
|
|
16
32
|
|
|
17
33
|
.ald-text-link-secondary {
|
|
18
34
|
color: var(--alias-colors-text-default, #1f2937);
|
|
19
35
|
|
|
36
|
+
.ald-icon {
|
|
37
|
+
color: #6b7280;
|
|
38
|
+
}
|
|
39
|
+
|
|
20
40
|
&:hover {
|
|
21
41
|
color: var(--alias-colors-text-selected, #126fdd);
|
|
42
|
+
|
|
43
|
+
.ald-icon {
|
|
44
|
+
color: #2986f4;
|
|
45
|
+
}
|
|
22
46
|
}
|
|
23
47
|
|
|
24
48
|
&:active {
|
|
25
49
|
color: var(--alias-colors-text-selected, #126fdd);
|
|
50
|
+
|
|
51
|
+
.ald-icon {
|
|
52
|
+
color: #126fdd;
|
|
53
|
+
}
|
|
26
54
|
}
|
|
27
55
|
|
|
28
56
|
&.ald-text-link-disabled {
|
|
29
57
|
color: var(--alias-colors-text-disabled, rgba(0, 0, 0, 0.25));
|
|
58
|
+
|
|
59
|
+
.ald-icon {
|
|
60
|
+
color: rgba(0, 0, 0, 0.25);
|
|
61
|
+
}
|
|
30
62
|
}
|
|
31
63
|
}
|
|
32
64
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export declare const isValidElement: typeof React.isValidElement;
|
|
3
3
|
export declare function isFragment(child: any): boolean;
|
|
4
|
+
export declare function isReactComponent(child: any): boolean;
|
|
4
5
|
type AnyObject = Record<PropertyKey, any>;
|
|
5
6
|
type RenderProps = AnyObject | ((originProps: AnyObject) => AnyObject | void);
|
|
6
7
|
export declare function replaceElement(element: React.ReactNode, replacement: React.ReactNode, props?: RenderProps): React.ReactNode;
|
package/dist/_utils/reactNode.js
CHANGED
|
@@ -4,6 +4,9 @@ export { isValidElement };
|
|
|
4
4
|
export function isFragment(child) {
|
|
5
5
|
return child && isValidElement(child) && child.type === React.Fragment;
|
|
6
6
|
}
|
|
7
|
+
export function isReactComponent(child) {
|
|
8
|
+
return child && isValidElement(child) && typeof child.type === 'function';
|
|
9
|
+
}
|
|
7
10
|
export function replaceElement(element, replacement, props) {
|
|
8
11
|
if (!isValidElement(element)) {
|
|
9
12
|
return replacement;
|