@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.
- package/dist/DataPreviewTable/index.js +1 -1
- package/dist/DatePicker/index.d.ts +1 -0
- package/dist/DatePicker/index.js +0 -1
- package/dist/Divider/index.d.ts +7 -25
- package/dist/Divider/index.js +14 -4
- package/dist/Divider/style/index.less +36 -1
- package/dist/MemberPicker/components/MultipleOption.js +1 -0
- package/dist/Menu/style/index.less +0 -3
- package/dist/Radio/components/Group/index.d.ts +1 -3
- package/dist/Radio/components/Group/index.js +2 -10
- package/dist/Radio/components/Radio/index.js +2 -34
- package/dist/Radio/style/index.less +26 -47
- package/dist/Select/index.js +1 -1
- 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/Tree/Tree.js +1 -1
- 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
- package/dist/Divider/style/index.less.d.ts +0 -183
|
@@ -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,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DatePicker as AntdDatePicker, DatePickerProps as AntdDatePickerProps } from 'antd';
|
|
2
2
|
import { Dayjs } from 'dayjs';
|
|
3
|
+
export type { RangeValue } from 'rc-picker/lib/interface';
|
|
3
4
|
declare const DatePicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs> & {
|
|
4
5
|
status?: "" | "warning" | "error" | undefined;
|
|
5
6
|
hashId?: string | undefined;
|
package/dist/DatePicker/index.js
CHANGED
|
@@ -21,7 +21,6 @@ import SizeContext from "../ConfigProvider/sizeContext";
|
|
|
21
21
|
// WeekPickerProps,
|
|
22
22
|
// } from 'antd/lib/date-picker';
|
|
23
23
|
// export type { DatePickerProps };
|
|
24
|
-
|
|
25
24
|
var DatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
26
25
|
var customSize = props.size,
|
|
27
26
|
customDisabled = props.disabled,
|
package/dist/Divider/index.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface IDividerProps {
|
|
3
|
-
/**
|
|
4
|
-
* @description 水平或竖直
|
|
5
|
-
* @type 'horizontal' | 'vertical'
|
|
6
|
-
* @default 'horizontal'
|
|
7
|
-
*/
|
|
8
|
-
type?: 'horizontal' | 'vertical';
|
|
9
3
|
/**
|
|
10
4
|
* @description 类名
|
|
11
5
|
* @type string
|
|
@@ -13,29 +7,17 @@ export interface IDividerProps {
|
|
|
13
7
|
*/
|
|
14
8
|
className?: string;
|
|
15
9
|
/**
|
|
16
|
-
* @description
|
|
17
|
-
* @type
|
|
10
|
+
* @description 颜色
|
|
11
|
+
* @type string
|
|
18
12
|
* @default --
|
|
19
13
|
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @description 分割线标题的位置
|
|
23
|
-
* @type 'left' | 'right' | 'center'
|
|
24
|
-
* @default 'center'
|
|
25
|
-
*/
|
|
26
|
-
orientation?: 'left' | 'right' | 'center';
|
|
27
|
-
/**
|
|
28
|
-
* @description 是否是虚线
|
|
29
|
-
* @type boolean
|
|
30
|
-
* @default false
|
|
31
|
-
*/
|
|
32
|
-
dashed?: boolean;
|
|
14
|
+
color?: string;
|
|
33
15
|
/**
|
|
34
|
-
* @description
|
|
35
|
-
* @type
|
|
36
|
-
* @default
|
|
16
|
+
* @description 尺寸
|
|
17
|
+
* @type 'small' | 'middle' | 'large'
|
|
18
|
+
* @default 'middle'
|
|
37
19
|
*/
|
|
38
|
-
|
|
20
|
+
size?: 'small' | 'middle' | 'large';
|
|
39
21
|
}
|
|
40
22
|
declare const Divider: (props: IDividerProps) => React.JSX.Element;
|
|
41
23
|
export default Divider;
|
package/dist/Divider/index.js
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
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 _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; }
|
|
3
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
4
|
+
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); }
|
|
3
5
|
import classNames from 'classnames';
|
|
4
6
|
import React from 'react';
|
|
5
7
|
var Divider = function Divider(props) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
var className = props.className,
|
|
9
|
+
_props$size = props.size,
|
|
10
|
+
size = _props$size === void 0 ? 'middle' : _props$size;
|
|
11
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
className: classNames('ald-divider', className, _defineProperty({}, "ald-divider-".concat(size), size))
|
|
13
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: "ald-divider-inner",
|
|
15
|
+
style: {
|
|
16
|
+
backgroundColor: props.color
|
|
17
|
+
}
|
|
8
18
|
}));
|
|
9
19
|
};
|
|
10
20
|
export default Divider;
|
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
@import '../../style/index.less';
|
|
2
2
|
|
|
3
3
|
.ald-divider {
|
|
4
|
-
|
|
4
|
+
display: inline-block;
|
|
5
|
+
vertical-align: middle;
|
|
6
|
+
width: 1px;
|
|
7
|
+
|
|
8
|
+
.ald-divider-inner {
|
|
9
|
+
display: block;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
content: '';
|
|
13
|
+
background-color: #e5e7eb;
|
|
14
|
+
mix-blend-mode: multiply;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&-small {
|
|
18
|
+
margin-inline: 6px 6px;
|
|
19
|
+
|
|
20
|
+
.ald-divider-inner {
|
|
21
|
+
height: 12px;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&-middle {
|
|
26
|
+
margin-inline: 8px 8px;
|
|
27
|
+
|
|
28
|
+
.ald-divider-inner {
|
|
29
|
+
height: 14px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&-large {
|
|
34
|
+
margin-inline: 12px 12px;
|
|
35
|
+
|
|
36
|
+
.ald-divider-inner {
|
|
37
|
+
height: 16px;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
5
40
|
}
|
|
@@ -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();
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
@menu-item-horizontal-padding: 12px;
|
|
8
8
|
@menu-width: 168px + 2 * @menu-item-horizontal-padding;
|
|
9
|
-
@max-menu-width: 300px;
|
|
10
9
|
|
|
11
10
|
.menuContainerStyle {
|
|
12
11
|
display: flex;
|
|
@@ -19,7 +18,6 @@
|
|
|
19
18
|
background: var(--alias-colors-bg-skeleton-subtler, #fff);
|
|
20
19
|
box-shadow: 0 10px 18px -2px #00000014;
|
|
21
20
|
min-width: @menu-width;
|
|
22
|
-
max-width: @max-menu-width;
|
|
23
21
|
z-index: 999;
|
|
24
22
|
}
|
|
25
23
|
|
|
@@ -53,7 +51,6 @@
|
|
|
53
51
|
background: var(--alias-colors-bg-transp, rgba(0, 0, 0, 0));
|
|
54
52
|
width: 100%;
|
|
55
53
|
line-height: 20px;
|
|
56
|
-
max-width: @max-menu-width;
|
|
57
54
|
cursor: pointer;
|
|
58
55
|
}
|
|
59
56
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IRadioGroupProps } from '../../interface/radioGroup';
|
|
3
|
-
export declare const RadioGroupContext: React.Context<Omit<IRadioGroupProps, "
|
|
4
|
-
sliderRef?: React.RefObject<HTMLDivElement> | undefined;
|
|
5
|
-
}>;
|
|
3
|
+
export declare const RadioGroupContext: React.Context<Omit<IRadioGroupProps, "className" | "children">>;
|
|
6
4
|
export default function RadioGroup(props: IRadioGroupProps): React.JSX.Element;
|
|
@@ -10,7 +10,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
import classNames from 'classnames';
|
|
12
12
|
import useMergedState from 'rc-util/lib/hooks/useMergedState';
|
|
13
|
-
import React, { createContext
|
|
13
|
+
import React, { createContext } from 'react';
|
|
14
14
|
import DisabledContext from 'antd/lib/config-provider/DisabledContext';
|
|
15
15
|
export var RadioGroupContext = /*#__PURE__*/createContext({});
|
|
16
16
|
export default function RadioGroup(props) {
|
|
@@ -23,8 +23,6 @@ export default function RadioGroup(props) {
|
|
|
23
23
|
type = _props$type === void 0 ? 'radio' : _props$type,
|
|
24
24
|
className = props.className,
|
|
25
25
|
customDisabled = props.disabled;
|
|
26
|
-
// 滑块的ref
|
|
27
|
-
var sliderRef = useRef(null);
|
|
28
26
|
// 该hooks与useState相同,但是当props中有value值时,优先使用value的值
|
|
29
27
|
var _useMergedState = useMergedState(props.defaultValue, {
|
|
30
28
|
value: props === null || props === void 0 ? void 0 : props.value
|
|
@@ -38,8 +36,6 @@ export default function RadioGroup(props) {
|
|
|
38
36
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
37
|
var onRadioChange = function onRadioChange(selectedValue) {
|
|
40
38
|
var lastValue = value;
|
|
41
|
-
// const val = ev.target.value;
|
|
42
|
-
// console.log(selectValue);
|
|
43
39
|
setValue(selectedValue);
|
|
44
40
|
var onChange = props.onChange;
|
|
45
41
|
if (onChange && selectedValue !== lastValue) {
|
|
@@ -59,13 +55,9 @@ export default function RadioGroup(props) {
|
|
|
59
55
|
radioGroupStyle: radioGroupStyle,
|
|
60
56
|
size: size,
|
|
61
57
|
type: type,
|
|
62
|
-
sliderRef: sliderRef,
|
|
63
58
|
disabled: mergedDisabled
|
|
64
59
|
}
|
|
65
60
|
}, /*#__PURE__*/React.createElement("div", {
|
|
66
61
|
className: getWrapperClass()
|
|
67
|
-
}, children
|
|
68
|
-
className: classNames('ald-radio-filled-slider'),
|
|
69
|
-
ref: sliderRef
|
|
70
|
-
}) : null));
|
|
62
|
+
}, children));
|
|
71
63
|
}
|
|
@@ -6,7 +6,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
6
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
7
|
import classNames from 'classnames';
|
|
8
8
|
import _ from 'lodash';
|
|
9
|
-
import React, { useContext,
|
|
9
|
+
import React, { useContext, useRef } from 'react';
|
|
10
10
|
import { getUUID } from "../../../_utils/hooks/useId";
|
|
11
11
|
import { RadioGroupContext } from "../Group";
|
|
12
12
|
export default function Radio(props) {
|
|
@@ -57,15 +57,6 @@ export default function Radio(props) {
|
|
|
57
57
|
'ald-radio-wrapper-disabled': radioProps.disabled
|
|
58
58
|
});
|
|
59
59
|
};
|
|
60
|
-
|
|
61
|
-
// filled button模式下,更改滑块的位置
|
|
62
|
-
useEffect(function () {
|
|
63
|
-
var _groupContext$sliderR;
|
|
64
|
-
if (radioProps.checked && groupContext !== null && groupContext !== void 0 && (_groupContext$sliderR = groupContext.sliderRef) !== null && _groupContext$sliderR !== void 0 && _groupContext$sliderR.current && labelRef !== null && labelRef !== void 0 && labelRef.current) {
|
|
65
|
-
groupContext.sliderRef.current.style.left = "".concat(labelRef.current.offsetLeft - 2, "px");
|
|
66
|
-
groupContext.sliderRef.current.style.width = "".concat(labelRef.current.offsetWidth, "px");
|
|
67
|
-
}
|
|
68
|
-
}, [groupContext.sliderRef, radioProps.checked]);
|
|
69
60
|
var onChange = function onChange() {
|
|
70
61
|
if (groupContext !== null && groupContext !== void 0 && groupContext.onChange) {
|
|
71
62
|
// input事件的value会被toString,所以此处进行一个覆盖
|
|
@@ -89,29 +80,6 @@ export default function Radio(props) {
|
|
|
89
80
|
}), /*#__PURE__*/React.createElement("span", {
|
|
90
81
|
className: "ald-radio-inner"
|
|
91
82
|
})), /*#__PURE__*/React.createElement("span", {
|
|
92
|
-
className: "ald-radio-desc"
|
|
93
|
-
onMouseEnter: function onMouseEnter() {
|
|
94
|
-
if (radioProps.checked) {
|
|
95
|
-
var _groupContext$sliderR2, _groupContext$sliderR3;
|
|
96
|
-
(_groupContext$sliderR2 = groupContext.sliderRef) === null || _groupContext$sliderR2 === void 0 ? void 0 : (_groupContext$sliderR3 = _groupContext$sliderR2.current) === null || _groupContext$sliderR3 === void 0 ? void 0 : _groupContext$sliderR3.classList.add('ald-radio-fill-slider-hover');
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
onMouseLeave: function onMouseLeave() {
|
|
100
|
-
if (radioProps.checked) {
|
|
101
|
-
var _groupContext$sliderR4, _groupContext$sliderR5, _groupContext$sliderR6, _groupContext$sliderR7;
|
|
102
|
-
(_groupContext$sliderR4 = groupContext.sliderRef) === null || _groupContext$sliderR4 === void 0 ? void 0 : (_groupContext$sliderR5 = _groupContext$sliderR4.current) === null || _groupContext$sliderR5 === void 0 ? void 0 : _groupContext$sliderR5.classList.remove('ald-radio-fill-slider-hover');
|
|
103
|
-
(_groupContext$sliderR6 = groupContext.sliderRef) === null || _groupContext$sliderR6 === void 0 ? void 0 : (_groupContext$sliderR7 = _groupContext$sliderR6.current) === null || _groupContext$sliderR7 === void 0 ? void 0 : _groupContext$sliderR7.classList.remove('ald-radio-fill-slider-active');
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
onMouseDown: function onMouseDown() {
|
|
107
|
-
if (radioProps.checked) {
|
|
108
|
-
var _groupContext$sliderR8, _groupContext$sliderR9;
|
|
109
|
-
(_groupContext$sliderR8 = groupContext.sliderRef) === null || _groupContext$sliderR8 === void 0 ? void 0 : (_groupContext$sliderR9 = _groupContext$sliderR8.current) === null || _groupContext$sliderR9 === void 0 ? void 0 : _groupContext$sliderR9.classList.add('ald-radio-fill-slider-active');
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
onMouseUp: function onMouseUp() {
|
|
113
|
-
var _groupContext$sliderR10, _groupContext$sliderR11;
|
|
114
|
-
if (radioProps.checked) (_groupContext$sliderR10 = groupContext.sliderRef) === null || _groupContext$sliderR10 === void 0 ? void 0 : (_groupContext$sliderR11 = _groupContext$sliderR10.current) === null || _groupContext$sliderR11 === void 0 ? void 0 : _groupContext$sliderR11.classList.remove('ald-radio-fill-slider-active');
|
|
115
|
-
}
|
|
83
|
+
className: "ald-radio-desc"
|
|
116
84
|
}, props.children));
|
|
117
85
|
}
|
|
@@ -167,40 +167,6 @@
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
// filled填充样式下的滑块样式
|
|
171
|
-
.ald-radio-filled-slider {
|
|
172
|
-
position: absolute;
|
|
173
|
-
top: 0;
|
|
174
|
-
left: 0;
|
|
175
|
-
z-index: 1;
|
|
176
|
-
width: 0;
|
|
177
|
-
height: calc(100% - 2px - 2px); // 减去上下边距
|
|
178
|
-
margin: 2px;
|
|
179
|
-
background: var(--alias-colors-bg-skeleton-subtler, #fff);
|
|
180
|
-
border: 1px solid
|
|
181
|
-
var(--alias-colors-border-accent-gray-subtle-default, #d1d5db);
|
|
182
|
-
border-radius: var(--alias-radius-75, 6px);
|
|
183
|
-
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
|
|
184
|
-
// transition: width, left, height 0.3s, 0.3s, 0.3s ease;
|
|
185
|
-
cursor: pointer;
|
|
186
|
-
|
|
187
|
-
&:hover,
|
|
188
|
-
&.ald-radio-fill-slider-hover {
|
|
189
|
-
border-radius: var(--alias-radius-75, 6px);
|
|
190
|
-
border: 1px solid
|
|
191
|
-
var(--alias-colors-border-accent-gray-subtle-hover, #9ca3af);
|
|
192
|
-
background: var(--alias-colors-bg-skeleton-subtler, #fff);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
&:active,
|
|
196
|
-
&.ald-radio-fill-slider-active {
|
|
197
|
-
border-radius: var(--alias-radius-75, 6px);
|
|
198
|
-
border: 1px solid
|
|
199
|
-
var(--alias-colors-border-accent-gray-subtle-default, #d1d5db);
|
|
200
|
-
background: var(--alias-colors-bg-skeleton-subtle, #f9fafb);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
170
|
.ald-radio-group-icon-button {
|
|
205
171
|
padding: 0 !important;
|
|
206
172
|
}
|
|
@@ -212,7 +178,6 @@
|
|
|
212
178
|
align-items: flex-start;
|
|
213
179
|
box-sizing: border-box;
|
|
214
180
|
padding: 0;
|
|
215
|
-
overflow: hidden;
|
|
216
181
|
|
|
217
182
|
.ald-radio-label {
|
|
218
183
|
color: @NL30;
|
|
@@ -319,6 +284,32 @@
|
|
|
319
284
|
height: calc(100% - 4px);
|
|
320
285
|
background-color: var(--alias-colors-bg-skeleton-strong, #f3f4f6);
|
|
321
286
|
cursor: pointer;
|
|
287
|
+
border: 1px solid transparent;
|
|
288
|
+
|
|
289
|
+
// 选中样式
|
|
290
|
+
&.ald-radio-wrapper-checked {
|
|
291
|
+
background: var(--alias-colors-bg-skeleton-subtler, #fff);
|
|
292
|
+
border: 1px solid
|
|
293
|
+
var(--alias-colors-border-accent-gray-subtle-default, #d1d5db);
|
|
294
|
+
border-radius: var(--alias-radius-75, 6px);
|
|
295
|
+
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1),
|
|
296
|
+
0 1px 2px 0 rgba(0, 0, 0, 0.06);
|
|
297
|
+
cursor: pointer;
|
|
298
|
+
|
|
299
|
+
&:hover {
|
|
300
|
+
border-radius: var(--alias-radius-75, 6px);
|
|
301
|
+
border: 1px solid
|
|
302
|
+
var(--alias-colors-border-accent-gray-subtle-hover, #9ca3af);
|
|
303
|
+
background: var(--alias-colors-bg-skeleton-subtler, #fff);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
&:active {
|
|
307
|
+
border-radius: var(--alias-radius-75, 6px);
|
|
308
|
+
border: 1px solid
|
|
309
|
+
var(--alias-colors-border-accent-gray-subtle-default, #d1d5db);
|
|
310
|
+
background: var(--alias-colors-bg-skeleton-subtle, #f9fafb);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
322
313
|
|
|
323
314
|
&:first-of-type {
|
|
324
315
|
border-radius: @border-radius-middle 0 0 @border-radius-middle;
|
|
@@ -382,10 +373,6 @@
|
|
|
382
373
|
height: @radio-group-height-middle;
|
|
383
374
|
border-radius: @border-radius-middle;
|
|
384
375
|
|
|
385
|
-
.ald-radio-filled-slider {
|
|
386
|
-
border-radius: var(--alias-radius-50, 4px);
|
|
387
|
-
}
|
|
388
|
-
|
|
389
376
|
.ald-radio-icon-button-wrapper-filled {
|
|
390
377
|
border-radius: var(--alias-radius-50, 4px) !important ;
|
|
391
378
|
}
|
|
@@ -438,10 +425,6 @@
|
|
|
438
425
|
height: @radio-group-height-small;
|
|
439
426
|
border-radius: @border-radius-small;
|
|
440
427
|
|
|
441
|
-
.ald-radio-filled-slider {
|
|
442
|
-
border-radius: var(--alias-radius-25, 2px);
|
|
443
|
-
}
|
|
444
|
-
|
|
445
428
|
.ald-radio-label {
|
|
446
429
|
.ald-radio-desc {
|
|
447
430
|
font-size: @font-size-small;
|
|
@@ -513,10 +496,6 @@
|
|
|
513
496
|
height: @radio-group-height-large;
|
|
514
497
|
border-radius: @border-radius-large;
|
|
515
498
|
|
|
516
|
-
.ald-radio-filled-slider {
|
|
517
|
-
border-radius: var(--alias-radius-75, 6px);
|
|
518
|
-
}
|
|
519
|
-
|
|
520
499
|
.ald-radio-icon-button-wrapper-filled {
|
|
521
500
|
border-radius: var(--alias-radius-75, 6px) !important ;
|
|
522
501
|
}
|
package/dist/Select/index.js
CHANGED
|
@@ -397,7 +397,7 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
397
397
|
setIsOpen(!isOpen);
|
|
398
398
|
}
|
|
399
399
|
},
|
|
400
|
-
className: classNames('ald-select', className, (_classNames = {}, _defineProperty(_classNames, "ald-select-".concat(type), type === 'primary' || type === 'secondary'), _defineProperty(_classNames, 'ald-select-multiple', isMultiple), _defineProperty(_classNames, 'ald-select-single', !isMultiple), _defineProperty(_classNames, 'ald-select-large', size === 'large'), _defineProperty(_classNames, 'ald-select-small', size === 'small'), _defineProperty(_classNames, 'ald-select-disabled', mergedDisabled), _defineProperty(_classNames, 'ald-select-middle', size !== 'large' && size !== 'small'), _defineProperty(_classNames, 'ald-select-open', typeof _open === 'boolean' ? _open : isOpen), _defineProperty(_classNames, 'ald-select-focused', isFocus), _defineProperty(_classNames, "ald-select-status-".concat(mergedStatus), mergedStatus), _defineProperty(_classNames, 'ald-select-empty-show-all', type === 'primary'), _defineProperty(_classNames, 'ald-select-has-value', !_.isEmpty(value) || !_.isEmpty(currentValue)), _classNames), compactItemClassnames, hashId),
|
|
400
|
+
className: classNames('ald-select', className, (_classNames = {}, _defineProperty(_classNames, "ald-select-".concat(type), type === 'primary' || type === 'secondary'), _defineProperty(_classNames, 'ald-select-multiple', isMultiple), _defineProperty(_classNames, 'ald-select-single', !isMultiple), _defineProperty(_classNames, 'ald-select-large', size === 'large'), _defineProperty(_classNames, 'ald-select-small', size === 'small'), _defineProperty(_classNames, 'ald-select-disabled', mergedDisabled), _defineProperty(_classNames, 'ald-select-middle', size !== 'large' && size !== 'small'), _defineProperty(_classNames, 'ald-select-open', typeof _open === 'boolean' ? _open : isOpen), _defineProperty(_classNames, 'ald-select-focused', isFocus && type === 'secondary'), _defineProperty(_classNames, "ald-select-status-".concat(mergedStatus), mergedStatus), _defineProperty(_classNames, 'ald-select-empty-show-all', type === 'primary'), _defineProperty(_classNames, 'ald-select-has-value', !_.isEmpty(value) || !_.isEmpty(currentValue)), _classNames), compactItemClassnames, hashId),
|
|
401
401
|
spellCheck: false,
|
|
402
402
|
style: Object.assign(styleVar, style)
|
|
403
403
|
}, !!prefix && /*#__PURE__*/React.createElement("span", {
|
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
|