@arcblock/ux 2.10.1 → 2.10.2
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/Blocklet/blocklet.js +4 -1
- package/lib/Blocklet/utils.js +4 -1
- package/lib/BlockletNFT/index.js +4 -1
- package/lib/ClickToCopy/index.js +16 -16
- package/lib/Datatable/CustomToolbar.js +1 -1
- package/lib/Datatable/index.js +65 -65
- package/lib/Dialog/types.d.ts +5 -5
- package/lib/Icon/image.js +3 -1
- package/lib/Layout/dashboard/sidebar.js +15 -12
- package/lib/Locale/selector.js +3 -1
- package/lib/NFTDisplay/broken.js +4 -1
- package/lib/NavMenu/nav-menu.js +1 -0
- package/package.json +5 -5
- package/src/Blocklet/blocklet.js +4 -1
- package/src/Blocklet/utils.js +4 -1
- package/src/BlockletNFT/index.js +4 -1
- package/src/ClickToCopy/index.js +17 -17
- package/src/Datatable/CustomToolbar.js +2 -1
- package/src/Datatable/index.jsx +61 -61
- package/src/Dialog/types.d.ts +5 -5
- package/src/Dialog/use-confirm.jsx +7 -11
- package/src/Icon/image.js +3 -1
- package/src/Layout/dashboard/sidebar.js +13 -10
- package/src/Locale/selector.jsx +3 -1
- package/src/NFTDisplay/broken.js +4 -1
- package/src/NavMenu/nav-menu.js +1 -0
- package/src/Util/index.js +3 -1
package/lib/Blocklet/blocklet.js
CHANGED
@@ -62,7 +62,10 @@ const Div = styled('div')`
|
|
62
62
|
transform: scale(0.1);
|
63
63
|
opacity: 0;
|
64
64
|
z-index: -1;
|
65
|
-
transition:
|
65
|
+
transition:
|
66
|
+
transform 0.3s,
|
67
|
+
opacity 0.3s,
|
68
|
+
background-color 0.3s;
|
66
69
|
}
|
67
70
|
&:hover::after {
|
68
71
|
opacity: 1;
|
package/lib/Blocklet/utils.js
CHANGED
@@ -28,7 +28,10 @@ const ActionButton = styled('div')`
|
|
28
28
|
transform: scale(0.1);
|
29
29
|
opacity: 0;
|
30
30
|
z-index: -1;
|
31
|
-
transition:
|
31
|
+
transition:
|
32
|
+
transform 0.3s,
|
33
|
+
opacity 0.3s,
|
34
|
+
background-color 0.3s;
|
32
35
|
}
|
33
36
|
&:hover::after {
|
34
37
|
opacity: 1;
|
package/lib/BlockletNFT/index.js
CHANGED
@@ -92,7 +92,10 @@ const Div = styled('div')`
|
|
92
92
|
transform: scale(0.1);
|
93
93
|
opacity: 0;
|
94
94
|
z-index: -1;
|
95
|
-
transition:
|
95
|
+
transition:
|
96
|
+
transform 0.3s,
|
97
|
+
opacity 0.3s,
|
98
|
+
background-color 0.3s;
|
96
99
|
}
|
97
100
|
&:hover::after {
|
98
101
|
opacity: 1;
|
package/lib/ClickToCopy/index.js
CHANGED
@@ -7,6 +7,21 @@ import { mergeProps } from '../Util';
|
|
7
7
|
import { styled } from '../Theme';
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
9
|
export { default as CopyButton } from './copy-button';
|
10
|
+
const Container = styled('span')`
|
11
|
+
display: inline;
|
12
|
+
white-space: pre-wrap;
|
13
|
+
word-wrap: break-word;
|
14
|
+
overflow-wrap: break-word;
|
15
|
+
align-items: center;
|
16
|
+
justify-content: start;
|
17
|
+
border-radius: 15px;
|
18
|
+
padding: 1px 12px;
|
19
|
+
background-color: rgba(0, 0, 0, 0.08);
|
20
|
+
cursor: pointer;
|
21
|
+
`;
|
22
|
+
const UnstyledContainer = styled('span')`
|
23
|
+
cursor: pointer;
|
24
|
+
`;
|
10
25
|
export default function ClickToCopy(props) {
|
11
26
|
const newProps = mergeProps(props, ClickToCopy, ['style']);
|
12
27
|
const {
|
@@ -74,19 +89,4 @@ ClickToCopy.defaultProps = {
|
|
74
89
|
locale: 'en',
|
75
90
|
style: {},
|
76
91
|
unstyled: false
|
77
|
-
};
|
78
|
-
const Container = styled('span')`
|
79
|
-
display: inline;
|
80
|
-
white-space: pre-wrap;
|
81
|
-
word-wrap: break-word;
|
82
|
-
overflow-wrap: break-word;
|
83
|
-
align-items: center;
|
84
|
-
justify-content: start;
|
85
|
-
border-radius: 15px;
|
86
|
-
padding: 1px 12px;
|
87
|
-
background-color: rgba(0, 0, 0, 0.08);
|
88
|
-
cursor: pointer;
|
89
|
-
`;
|
90
|
-
const UnstyledContainer = styled('span')`
|
91
|
-
cursor: pointer;
|
92
|
-
`;
|
92
|
+
};
|
@@ -55,6 +55,7 @@ export default function CustomToolbar(props) {
|
|
55
55
|
searchTextUpdate,
|
56
56
|
searchClose
|
57
57
|
} = props;
|
58
|
+
const [allPopsEl, setAllPopsEl] = useState({});
|
58
59
|
const customToolbarEle = options.customToolbar ? options.customToolbar(props) : '';
|
59
60
|
const {
|
60
61
|
search,
|
@@ -132,7 +133,6 @@ export default function CustomToolbar(props) {
|
|
132
133
|
}
|
133
134
|
const showMore = [!hidePrint, ...defaultButtons, ...customButtons].filter(e => !!e).length > 1 && isMobile;
|
134
135
|
const allPops = [];
|
135
|
-
const [allPopsEl, setAllPopsEl] = useState({});
|
136
136
|
|
137
137
|
// Large screens show the toolbar buttons directly, small screens show the drop-down menu style buttons
|
138
138
|
// The right-hand button of the form toolbar in desktop mode
|
package/lib/Datatable/index.js
CHANGED
@@ -58,6 +58,71 @@ import { styled } from '../Theme';
|
|
58
58
|
* durableKeys?: 'page' | 'rowsPerPage' | 'searchText' | 'sortOrder'
|
59
59
|
* } & import('mui-datatables').MUIDataTableProps} DataTableProps
|
60
60
|
*/
|
61
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
62
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
63
|
+
const FilterLine = styled('div')`
|
64
|
+
display: flex;
|
65
|
+
align-items: center;
|
66
|
+
.toolbar-filter-content {
|
67
|
+
margin-bottom: 8px;
|
68
|
+
}
|
69
|
+
.toolbar-filter-title {
|
70
|
+
font-weight: 700;
|
71
|
+
font-size: 14px;
|
72
|
+
}
|
73
|
+
`;
|
74
|
+
function WrapFilterList(props) {
|
75
|
+
const {
|
76
|
+
filterLabel
|
77
|
+
} = useDatatableContext();
|
78
|
+
const hasFilter = !!props.filterList.filter(e => e.length).length;
|
79
|
+
if (hasFilter) {
|
80
|
+
return /*#__PURE__*/_jsxs(FilterLine, {
|
81
|
+
children: [hasFilter && /*#__PURE__*/_jsx("div", {
|
82
|
+
className: "toolbar-filter-title",
|
83
|
+
children: filterLabel
|
84
|
+
}), /*#__PURE__*/_jsx("div", {
|
85
|
+
className: "toolbar-filter-content",
|
86
|
+
children: /*#__PURE__*/_jsx(TableFilterList, {
|
87
|
+
...props
|
88
|
+
})
|
89
|
+
})]
|
90
|
+
});
|
91
|
+
}
|
92
|
+
return '';
|
93
|
+
}
|
94
|
+
WrapFilterList.propTypes = {
|
95
|
+
filterList: PropTypes.array
|
96
|
+
};
|
97
|
+
WrapFilterList.defaultProps = {
|
98
|
+
filterList: []
|
99
|
+
};
|
100
|
+
function WrapTableFooter(props) {
|
101
|
+
const {
|
102
|
+
loading,
|
103
|
+
disabled
|
104
|
+
} = useDatatableContext();
|
105
|
+
return /*#__PURE__*/_jsx(FooterContainer, {
|
106
|
+
children: /*#__PURE__*/_jsx("div", {
|
107
|
+
className: `datatable-footer ${loading || disabled ? 'datatable-footer-disabled' : ''}`,
|
108
|
+
children: /*#__PURE__*/_jsx(TableFooter, {
|
109
|
+
...props
|
110
|
+
})
|
111
|
+
})
|
112
|
+
});
|
113
|
+
}
|
114
|
+
export const getDurableData = key => {
|
115
|
+
const durableKey = `datatable-durable-${key}`;
|
116
|
+
let localData = localStorage[durableKey];
|
117
|
+
if (localData) {
|
118
|
+
try {
|
119
|
+
localData = JSON.parse(localData);
|
120
|
+
} catch (err) {
|
121
|
+
console.error(`parse durable data error (key:${key}) => `, err);
|
122
|
+
}
|
123
|
+
}
|
124
|
+
return localData || {};
|
125
|
+
};
|
61
126
|
|
62
127
|
/**
|
63
128
|
* @description
|
@@ -65,8 +130,6 @@ import { styled } from '../Theme';
|
|
65
130
|
* @param {DataTableProps} props
|
66
131
|
* @return {import('react').ReactComponentElement}
|
67
132
|
*/
|
68
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
69
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
70
133
|
export default function DataTable(props) {
|
71
134
|
return /*#__PURE__*/_jsx(DataTableProvider, {
|
72
135
|
children: /*#__PURE__*/_jsx(ReDataTable, {
|
@@ -397,18 +460,6 @@ ReDataTable.defaultProps = {
|
|
397
460
|
durable: '',
|
398
461
|
durableKeys: ['page', 'rowsPerPage', 'searchText', 'sortOrder']
|
399
462
|
};
|
400
|
-
export const getDurableData = key => {
|
401
|
-
const durableKey = `datatable-durable-${key}`;
|
402
|
-
let localData = localStorage[durableKey];
|
403
|
-
if (localData) {
|
404
|
-
try {
|
405
|
-
localData = JSON.parse(localData);
|
406
|
-
} catch (err) {
|
407
|
-
console.error(`parse durable data error (key:${key}) => `, err);
|
408
|
-
}
|
409
|
-
}
|
410
|
-
return localData || {};
|
411
|
-
};
|
412
463
|
const alignCss = css`
|
413
464
|
.MuiTableCell-head {
|
414
465
|
[class*='MUIDataTableHeadCell-toolButton'] {
|
@@ -535,57 +586,6 @@ const TableContainer = styled('div', {
|
|
535
586
|
}
|
536
587
|
}
|
537
588
|
`;
|
538
|
-
const FilterLine = styled('div')`
|
539
|
-
display: flex;
|
540
|
-
align-items: center;
|
541
|
-
.toolbar-filter-content {
|
542
|
-
margin-bottom: 8px;
|
543
|
-
}
|
544
|
-
.toolbar-filter-title {
|
545
|
-
font-weight: 700;
|
546
|
-
font-size: 14px;
|
547
|
-
}
|
548
|
-
`;
|
549
|
-
function WrapFilterList(props) {
|
550
|
-
const {
|
551
|
-
filterLabel
|
552
|
-
} = useDatatableContext();
|
553
|
-
const hasFilter = !!props.filterList.filter(e => e.length).length;
|
554
|
-
if (hasFilter) {
|
555
|
-
return /*#__PURE__*/_jsxs(FilterLine, {
|
556
|
-
children: [hasFilter && /*#__PURE__*/_jsx("div", {
|
557
|
-
className: "toolbar-filter-title",
|
558
|
-
children: filterLabel
|
559
|
-
}), /*#__PURE__*/_jsx("div", {
|
560
|
-
className: "toolbar-filter-content",
|
561
|
-
children: /*#__PURE__*/_jsx(TableFilterList, {
|
562
|
-
...props
|
563
|
-
})
|
564
|
-
})]
|
565
|
-
});
|
566
|
-
}
|
567
|
-
return '';
|
568
|
-
}
|
569
|
-
WrapFilterList.propTypes = {
|
570
|
-
filterList: PropTypes.array
|
571
|
-
};
|
572
|
-
WrapFilterList.defaultProps = {
|
573
|
-
filterList: []
|
574
|
-
};
|
575
|
-
function WrapTableFooter(props) {
|
576
|
-
const {
|
577
|
-
loading,
|
578
|
-
disabled
|
579
|
-
} = useDatatableContext();
|
580
|
-
return /*#__PURE__*/_jsx(FooterContainer, {
|
581
|
-
children: /*#__PURE__*/_jsx("div", {
|
582
|
-
className: `datatable-footer ${loading || disabled ? 'datatable-footer-disabled' : ''}`,
|
583
|
-
children: /*#__PURE__*/_jsx(TableFooter, {
|
584
|
-
...props
|
585
|
-
})
|
586
|
-
})
|
587
|
-
});
|
588
|
-
}
|
589
589
|
const FooterContainer = styled('div')`
|
590
590
|
display: flex;
|
591
591
|
align-items: center;
|
package/lib/Dialog/types.d.ts
CHANGED
@@ -3,11 +3,11 @@ import type { ReactNode } from 'react';
|
|
3
3
|
export type OpenConfirmProps = {
|
4
4
|
title: ReactNode;
|
5
5
|
content: ReactNode;
|
6
|
-
onConfirm
|
7
|
-
onCancel
|
8
|
-
showCancelButton
|
9
|
-
confirmButtonText
|
10
|
-
cancelButtonText
|
6
|
+
onConfirm?: (close: () => void) => void;
|
7
|
+
onCancel?: () => void;
|
8
|
+
showCancelButton?: boolean;
|
9
|
+
confirmButtonText?: string;
|
10
|
+
cancelButtonText?: string;
|
11
11
|
};
|
12
12
|
|
13
13
|
export type UpdateConfirmProps = Partial<Pick<OpenConfirmProps, 'title' | 'content'>>;
|
package/lib/Icon/image.js
CHANGED
@@ -60,6 +60,8 @@ const Div = styled('div')`
|
|
60
60
|
background-color: #fe4e44;
|
61
61
|
right: -2px;
|
62
62
|
top: 0;
|
63
|
-
box-shadow:
|
63
|
+
box-shadow:
|
64
|
+
0px 1px 4px rgba(0, 0, 0, 0.3),
|
65
|
+
0px 0px 20px rgba(0, 0, 0, 0.1);
|
64
66
|
}
|
65
67
|
`;
|
@@ -7,19 +7,9 @@ import { styled } from '../../Theme';
|
|
7
7
|
import { NavLink } from './external-link';
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
|
-
function renderGroup(item, index) {
|
11
|
-
return /*#__PURE__*/_jsxs("li", {
|
12
|
-
className: "layout-sidebar-group",
|
13
|
-
children: [/*#__PURE__*/_jsx("span", {
|
14
|
-
className: "layout-sidebar-group-title",
|
15
|
-
children: item.title
|
16
|
-
}), /*#__PURE__*/_jsx("ul", {
|
17
|
-
children: item.children.map(renderItem)
|
18
|
-
})]
|
19
|
-
}, `group-${item.title}-${index}`);
|
20
|
-
}
|
21
10
|
function renderItem(item, index) {
|
22
11
|
if (item.children?.length) {
|
12
|
+
// eslint-disable-next-line no-use-before-define
|
23
13
|
return renderGroup(item, index);
|
24
14
|
}
|
25
15
|
const {
|
@@ -52,6 +42,17 @@ function renderItem(item, index) {
|
|
52
42
|
})
|
53
43
|
}, `${url}-${index}`);
|
54
44
|
}
|
45
|
+
function renderGroup(item, index) {
|
46
|
+
return /*#__PURE__*/_jsxs("li", {
|
47
|
+
className: "layout-sidebar-group",
|
48
|
+
children: [/*#__PURE__*/_jsx("span", {
|
49
|
+
className: "layout-sidebar-group-title",
|
50
|
+
children: item.title
|
51
|
+
}), /*#__PURE__*/_jsx("ul", {
|
52
|
+
children: item.children.map(renderItem)
|
53
|
+
})]
|
54
|
+
}, `group-${item.title}-${index}`);
|
55
|
+
}
|
55
56
|
function Sidebar({
|
56
57
|
links,
|
57
58
|
addons,
|
@@ -126,7 +127,9 @@ const Root = styled('div')`
|
|
126
127
|
background-color: #fe4e44;
|
127
128
|
right: -2px;
|
128
129
|
top: 0;
|
129
|
-
box-shadow:
|
130
|
+
box-shadow:
|
131
|
+
0px 1px 4px rgba(0, 0, 0, 0.3),
|
132
|
+
0px 0px 20px rgba(0, 0, 0, 0.1);
|
130
133
|
}
|
131
134
|
}
|
132
135
|
.layout-sidebar-link-text {
|
package/lib/Locale/selector.js
CHANGED
@@ -152,7 +152,9 @@ const Div = styled('div', {
|
|
152
152
|
|
153
153
|
.locales {
|
154
154
|
background: ${props => getBackground(props)};
|
155
|
-
box-shadow:
|
155
|
+
box-shadow:
|
156
|
+
0px 8px 16px 0px ${colors.gray6},
|
157
|
+
0px 0px 0px 1px ${colors.gray6};
|
156
158
|
border-radius: 8px;
|
157
159
|
}
|
158
160
|
|
package/lib/NFTDisplay/broken.js
CHANGED
@@ -126,7 +126,10 @@ const Root = styled(Box)`
|
|
126
126
|
font-size: 13px;
|
127
127
|
color: #9aa3b0;
|
128
128
|
text-align: center;
|
129
|
-
text-shadow:
|
129
|
+
text-shadow:
|
130
|
+
0 0 2px #fff,
|
131
|
+
0 0 2px #fff,
|
132
|
+
0 0 2px #fff;
|
130
133
|
user-select: none;
|
131
134
|
}
|
132
135
|
`;
|
package/lib/NavMenu/nav-menu.js
CHANGED
@@ -13,6 +13,7 @@ const NavMenuContext = /*#__PURE__*/createContext();
|
|
13
13
|
// 过滤 children 中的 Item/Sub, 忽略其它类型的 element
|
14
14
|
function filterItems(children) {
|
15
15
|
if (children) {
|
16
|
+
// eslint-disable-next-line no-use-before-define
|
16
17
|
return Children.toArray(children).filter(child => child.type === Item || child.type === Sub);
|
17
18
|
}
|
18
19
|
return null;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arcblock/ux",
|
3
|
-
"version": "2.10.
|
3
|
+
"version": "2.10.2",
|
4
4
|
"description": "Common used react components for arcblock products",
|
5
5
|
"keywords": [
|
6
6
|
"react",
|
@@ -54,12 +54,12 @@
|
|
54
54
|
"react": ">=18.2.0",
|
55
55
|
"react-router-dom": ">=6.22.3"
|
56
56
|
},
|
57
|
-
"gitHead": "
|
57
|
+
"gitHead": "01c29cd905a2baf029d7be25d41c79a261ebd959",
|
58
58
|
"dependencies": {
|
59
59
|
"@arcblock/did-motif": "^1.1.13",
|
60
|
-
"@arcblock/icons": "^2.10.
|
61
|
-
"@arcblock/nft-display": "^2.10.
|
62
|
-
"@arcblock/react-hooks": "^2.10.
|
60
|
+
"@arcblock/icons": "^2.10.2",
|
61
|
+
"@arcblock/nft-display": "^2.10.2",
|
62
|
+
"@arcblock/react-hooks": "^2.10.2",
|
63
63
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
64
64
|
"@fontsource/inter": "^5.0.16",
|
65
65
|
"@fontsource/ubuntu-mono": "^5.0.18",
|
package/src/Blocklet/blocklet.js
CHANGED
@@ -62,7 +62,10 @@ const Div = styled('div')`
|
|
62
62
|
transform: scale(0.1);
|
63
63
|
opacity: 0;
|
64
64
|
z-index: -1;
|
65
|
-
transition:
|
65
|
+
transition:
|
66
|
+
transform 0.3s,
|
67
|
+
opacity 0.3s,
|
68
|
+
background-color 0.3s;
|
66
69
|
}
|
67
70
|
&:hover::after {
|
68
71
|
opacity: 1;
|
package/src/Blocklet/utils.js
CHANGED
@@ -29,7 +29,10 @@ const ActionButton = styled('div')`
|
|
29
29
|
transform: scale(0.1);
|
30
30
|
opacity: 0;
|
31
31
|
z-index: -1;
|
32
|
-
transition:
|
32
|
+
transition:
|
33
|
+
transform 0.3s,
|
34
|
+
opacity 0.3s,
|
35
|
+
background-color 0.3s;
|
33
36
|
}
|
34
37
|
&:hover::after {
|
35
38
|
opacity: 1;
|
package/src/BlockletNFT/index.js
CHANGED
@@ -91,7 +91,10 @@ const Div = styled('div')`
|
|
91
91
|
transform: scale(0.1);
|
92
92
|
opacity: 0;
|
93
93
|
z-index: -1;
|
94
|
-
transition:
|
94
|
+
transition:
|
95
|
+
transform 0.3s,
|
96
|
+
opacity 0.3s,
|
97
|
+
background-color 0.3s;
|
95
98
|
}
|
96
99
|
&:hover::after {
|
97
100
|
opacity: 1;
|
package/src/ClickToCopy/index.js
CHANGED
@@ -9,6 +9,23 @@ import { styled } from '../Theme';
|
|
9
9
|
|
10
10
|
export { default as CopyButton } from './copy-button';
|
11
11
|
|
12
|
+
const Container = styled('span')`
|
13
|
+
display: inline;
|
14
|
+
white-space: pre-wrap;
|
15
|
+
word-wrap: break-word;
|
16
|
+
overflow-wrap: break-word;
|
17
|
+
align-items: center;
|
18
|
+
justify-content: start;
|
19
|
+
border-radius: 15px;
|
20
|
+
padding: 1px 12px;
|
21
|
+
background-color: rgba(0, 0, 0, 0.08);
|
22
|
+
cursor: pointer;
|
23
|
+
`;
|
24
|
+
|
25
|
+
const UnstyledContainer = styled('span')`
|
26
|
+
cursor: pointer;
|
27
|
+
`;
|
28
|
+
|
12
29
|
export default function ClickToCopy(props) {
|
13
30
|
const newProps = mergeProps(props, ClickToCopy, ['style']);
|
14
31
|
const { children, content, tip, copiedTip, tipPlacement, locale, style, unstyled, ...rest } = newProps;
|
@@ -61,20 +78,3 @@ ClickToCopy.defaultProps = {
|
|
61
78
|
style: {},
|
62
79
|
unstyled: false,
|
63
80
|
};
|
64
|
-
|
65
|
-
const Container = styled('span')`
|
66
|
-
display: inline;
|
67
|
-
white-space: pre-wrap;
|
68
|
-
word-wrap: break-word;
|
69
|
-
overflow-wrap: break-word;
|
70
|
-
align-items: center;
|
71
|
-
justify-content: start;
|
72
|
-
border-radius: 15px;
|
73
|
-
padding: 1px 12px;
|
74
|
-
background-color: rgba(0, 0, 0, 0.08);
|
75
|
-
cursor: pointer;
|
76
|
-
`;
|
77
|
-
|
78
|
-
const UnstyledContainer = styled('span')`
|
79
|
-
cursor: pointer;
|
80
|
-
`;
|
@@ -52,6 +52,8 @@ export default function CustomToolbar(props) {
|
|
52
52
|
searchClose,
|
53
53
|
} = props;
|
54
54
|
|
55
|
+
const [allPopsEl, setAllPopsEl] = useState({});
|
56
|
+
|
55
57
|
const customToolbarEle = options.customToolbar ? options.customToolbar(props) : '';
|
56
58
|
|
57
59
|
const { search, downloadCsv, print, viewColumns, filterTable } = options.textLabels.toolbar;
|
@@ -137,7 +139,6 @@ export default function CustomToolbar(props) {
|
|
137
139
|
const showMore = [!hidePrint, ...defaultButtons, ...customButtons].filter((e) => !!e).length > 1 && isMobile;
|
138
140
|
|
139
141
|
const allPops = [];
|
140
|
-
const [allPopsEl, setAllPopsEl] = useState({});
|
141
142
|
|
142
143
|
// Large screens show the toolbar buttons directly, small screens show the drop-down menu style buttons
|
143
144
|
// The right-hand button of the form toolbar in desktop mode
|
package/src/Datatable/index.jsx
CHANGED
@@ -59,6 +59,67 @@ import { styled } from '../Theme';
|
|
59
59
|
* } & import('mui-datatables').MUIDataTableProps} DataTableProps
|
60
60
|
*/
|
61
61
|
|
62
|
+
const FilterLine = styled('div')`
|
63
|
+
display: flex;
|
64
|
+
align-items: center;
|
65
|
+
.toolbar-filter-content {
|
66
|
+
margin-bottom: 8px;
|
67
|
+
}
|
68
|
+
.toolbar-filter-title {
|
69
|
+
font-weight: 700;
|
70
|
+
font-size: 14px;
|
71
|
+
}
|
72
|
+
`;
|
73
|
+
|
74
|
+
function WrapFilterList(props) {
|
75
|
+
const { filterLabel } = useDatatableContext();
|
76
|
+
const hasFilter = !!props.filterList.filter((e) => e.length).length;
|
77
|
+
if (hasFilter) {
|
78
|
+
return (
|
79
|
+
<FilterLine>
|
80
|
+
{hasFilter && <div className="toolbar-filter-title">{filterLabel}</div>}
|
81
|
+
<div className="toolbar-filter-content">
|
82
|
+
<TableFilterList {...props} />
|
83
|
+
</div>
|
84
|
+
</FilterLine>
|
85
|
+
);
|
86
|
+
}
|
87
|
+
return '';
|
88
|
+
}
|
89
|
+
|
90
|
+
WrapFilterList.propTypes = {
|
91
|
+
filterList: PropTypes.array,
|
92
|
+
};
|
93
|
+
|
94
|
+
WrapFilterList.defaultProps = {
|
95
|
+
filterList: [],
|
96
|
+
};
|
97
|
+
|
98
|
+
function WrapTableFooter(props) {
|
99
|
+
const { loading, disabled } = useDatatableContext();
|
100
|
+
|
101
|
+
return (
|
102
|
+
<FooterContainer>
|
103
|
+
<div className={`datatable-footer ${loading || disabled ? 'datatable-footer-disabled' : ''}`}>
|
104
|
+
<TableFooter {...props} />
|
105
|
+
</div>
|
106
|
+
</FooterContainer>
|
107
|
+
);
|
108
|
+
}
|
109
|
+
|
110
|
+
export const getDurableData = (key) => {
|
111
|
+
const durableKey = `datatable-durable-${key}`;
|
112
|
+
let localData = localStorage[durableKey];
|
113
|
+
if (localData) {
|
114
|
+
try {
|
115
|
+
localData = JSON.parse(localData);
|
116
|
+
} catch (err) {
|
117
|
+
console.error(`parse durable data error (key:${key}) => `, err);
|
118
|
+
}
|
119
|
+
}
|
120
|
+
return localData || {};
|
121
|
+
};
|
122
|
+
|
62
123
|
/**
|
63
124
|
* @description
|
64
125
|
* @export
|
@@ -386,19 +447,6 @@ ReDataTable.defaultProps = {
|
|
386
447
|
durableKeys: ['page', 'rowsPerPage', 'searchText', 'sortOrder'],
|
387
448
|
};
|
388
449
|
|
389
|
-
export const getDurableData = (key) => {
|
390
|
-
const durableKey = `datatable-durable-${key}`;
|
391
|
-
let localData = localStorage[durableKey];
|
392
|
-
if (localData) {
|
393
|
-
try {
|
394
|
-
localData = JSON.parse(localData);
|
395
|
-
} catch (err) {
|
396
|
-
console.error(`parse durable data error (key:${key}) => `, err);
|
397
|
-
}
|
398
|
-
}
|
399
|
-
return localData || {};
|
400
|
-
};
|
401
|
-
|
402
450
|
const alignCss = css`
|
403
451
|
.MuiTableCell-head {
|
404
452
|
[class*='MUIDataTableHeadCell-toolButton'] {
|
@@ -526,54 +574,6 @@ const TableContainer = styled('div', { shouldForwardProp: (prop) => prop !== 've
|
|
526
574
|
}
|
527
575
|
`;
|
528
576
|
|
529
|
-
const FilterLine = styled('div')`
|
530
|
-
display: flex;
|
531
|
-
align-items: center;
|
532
|
-
.toolbar-filter-content {
|
533
|
-
margin-bottom: 8px;
|
534
|
-
}
|
535
|
-
.toolbar-filter-title {
|
536
|
-
font-weight: 700;
|
537
|
-
font-size: 14px;
|
538
|
-
}
|
539
|
-
`;
|
540
|
-
|
541
|
-
function WrapFilterList(props) {
|
542
|
-
const { filterLabel } = useDatatableContext();
|
543
|
-
const hasFilter = !!props.filterList.filter((e) => e.length).length;
|
544
|
-
if (hasFilter) {
|
545
|
-
return (
|
546
|
-
<FilterLine>
|
547
|
-
{hasFilter && <div className="toolbar-filter-title">{filterLabel}</div>}
|
548
|
-
<div className="toolbar-filter-content">
|
549
|
-
<TableFilterList {...props} />
|
550
|
-
</div>
|
551
|
-
</FilterLine>
|
552
|
-
);
|
553
|
-
}
|
554
|
-
return '';
|
555
|
-
}
|
556
|
-
|
557
|
-
WrapFilterList.propTypes = {
|
558
|
-
filterList: PropTypes.array,
|
559
|
-
};
|
560
|
-
|
561
|
-
WrapFilterList.defaultProps = {
|
562
|
-
filterList: [],
|
563
|
-
};
|
564
|
-
|
565
|
-
function WrapTableFooter(props) {
|
566
|
-
const { loading, disabled } = useDatatableContext();
|
567
|
-
|
568
|
-
return (
|
569
|
-
<FooterContainer>
|
570
|
-
<div className={`datatable-footer ${loading || disabled ? 'datatable-footer-disabled' : ''}`}>
|
571
|
-
<TableFooter {...props} />
|
572
|
-
</div>
|
573
|
-
</FooterContainer>
|
574
|
-
);
|
575
|
-
}
|
576
|
-
|
577
577
|
const FooterContainer = styled('div')`
|
578
578
|
display: flex;
|
579
579
|
align-items: center;
|
package/src/Dialog/types.d.ts
CHANGED
@@ -3,11 +3,11 @@ import type { ReactNode } from 'react';
|
|
3
3
|
export type OpenConfirmProps = {
|
4
4
|
title: ReactNode;
|
5
5
|
content: ReactNode;
|
6
|
-
onConfirm
|
7
|
-
onCancel
|
8
|
-
showCancelButton
|
9
|
-
confirmButtonText
|
10
|
-
cancelButtonText
|
6
|
+
onConfirm?: (close: () => void) => void;
|
7
|
+
onCancel?: () => void;
|
8
|
+
showCancelButton?: boolean;
|
9
|
+
confirmButtonText?: string;
|
10
|
+
cancelButtonText?: string;
|
11
11
|
};
|
12
12
|
|
13
13
|
export type UpdateConfirmProps = Partial<Pick<OpenConfirmProps, 'title' | 'content'>>;
|
@@ -62,17 +62,13 @@ const ConfirmHolder = forwardRef((props, ref) => {
|
|
62
62
|
state.loading = false;
|
63
63
|
}
|
64
64
|
}, []);
|
65
|
-
useImperativeHandle(
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
};
|
73
|
-
},
|
74
|
-
[open, close, update]
|
75
|
-
);
|
65
|
+
useImperativeHandle(ref, () => {
|
66
|
+
return {
|
67
|
+
open,
|
68
|
+
close,
|
69
|
+
update,
|
70
|
+
};
|
71
|
+
}, [open, close, update]);
|
76
72
|
|
77
73
|
return (
|
78
74
|
<Confirm
|
package/src/Icon/image.js
CHANGED
@@ -49,6 +49,8 @@ const Div = styled('div')`
|
|
49
49
|
background-color: #fe4e44;
|
50
50
|
right: -2px;
|
51
51
|
top: 0;
|
52
|
-
box-shadow:
|
52
|
+
box-shadow:
|
53
|
+
0px 1px 4px rgba(0, 0, 0, 0.3),
|
54
|
+
0px 0px 20px rgba(0, 0, 0, 0.1);
|
53
55
|
}
|
54
56
|
`;
|
@@ -6,17 +6,9 @@ import clsx from 'clsx';
|
|
6
6
|
import { styled } from '../../Theme';
|
7
7
|
import { NavLink } from './external-link';
|
8
8
|
|
9
|
-
function renderGroup(item, index) {
|
10
|
-
return (
|
11
|
-
<li key={`group-${item.title}-${index}`} className="layout-sidebar-group">
|
12
|
-
<span className="layout-sidebar-group-title">{item.title}</span>
|
13
|
-
<ul>{item.children.map(renderItem)}</ul>
|
14
|
-
</li>
|
15
|
-
);
|
16
|
-
}
|
17
|
-
|
18
9
|
function renderItem(item, index) {
|
19
10
|
if (item.children?.length) {
|
11
|
+
// eslint-disable-next-line no-use-before-define
|
20
12
|
return renderGroup(item, index);
|
21
13
|
}
|
22
14
|
const { url, icon, title, showBadge, external, active } = item;
|
@@ -38,6 +30,15 @@ function renderItem(item, index) {
|
|
38
30
|
);
|
39
31
|
}
|
40
32
|
|
33
|
+
function renderGroup(item, index) {
|
34
|
+
return (
|
35
|
+
<li key={`group-${item.title}-${index}`} className="layout-sidebar-group">
|
36
|
+
<span className="layout-sidebar-group-title">{item.title}</span>
|
37
|
+
<ul>{item.children.map(renderItem)}</ul>
|
38
|
+
</li>
|
39
|
+
);
|
40
|
+
}
|
41
|
+
|
41
42
|
function Sidebar({ links, addons, dense, ...rest }) {
|
42
43
|
return (
|
43
44
|
<Root {...rest} className={clsx({ 'layout-sidebar-dense': dense })}>
|
@@ -105,7 +106,9 @@ const Root = styled('div')`
|
|
105
106
|
background-color: #fe4e44;
|
106
107
|
right: -2px;
|
107
108
|
top: 0;
|
108
|
-
box-shadow:
|
109
|
+
box-shadow:
|
110
|
+
0px 1px 4px rgba(0, 0, 0, 0.3),
|
111
|
+
0px 0px 20px rgba(0, 0, 0, 0.1);
|
109
112
|
}
|
110
113
|
}
|
111
114
|
.layout-sidebar-link-text {
|
package/src/Locale/selector.jsx
CHANGED
@@ -137,7 +137,9 @@ const Div = styled('div', {
|
|
137
137
|
|
138
138
|
.locales {
|
139
139
|
background: ${(props) => getBackground(props)};
|
140
|
-
box-shadow:
|
140
|
+
box-shadow:
|
141
|
+
0px 8px 16px 0px ${colors.gray6},
|
142
|
+
0px 0px 0px 1px ${colors.gray6};
|
141
143
|
border-radius: 8px;
|
142
144
|
}
|
143
145
|
|
package/src/NFTDisplay/broken.js
CHANGED
package/src/NavMenu/nav-menu.js
CHANGED
@@ -23,6 +23,7 @@ const NavMenuContext = createContext();
|
|
23
23
|
// 过滤 children 中的 Item/Sub, 忽略其它类型的 element
|
24
24
|
function filterItems(children) {
|
25
25
|
if (children) {
|
26
|
+
// eslint-disable-next-line no-use-before-define
|
26
27
|
return Children.toArray(children).filter((child) => child.type === Item || child.type === Sub);
|
27
28
|
}
|
28
29
|
return null;
|
package/src/Util/index.js
CHANGED
@@ -114,7 +114,9 @@ export function mergeProps(props, component, jsonAttrs = []) {
|
|
114
114
|
|
115
115
|
export function getCopyright(startYear = 2017) {
|
116
116
|
const currentYear = new Date().getFullYear();
|
117
|
-
return `${currentYear}` === `${startYear}`
|
117
|
+
return `${currentYear}` === `${startYear}`
|
118
|
+
? `© ArcBlock ${currentYear}`
|
119
|
+
: `© ArcBlock ${startYear} - ${currentYear}`;
|
118
120
|
}
|
119
121
|
|
120
122
|
export const getTimezone = () => {
|