@arcblock/ux 2.1.15 → 2.1.18
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/lib/Datatable/TableSearch.js +17 -2
- package/lib/Datatable/index.js +4 -2
- package/lib/Header/header.js +4 -3
- package/lib/Header/responsive-header.js +1 -1
- package/lib/Layout/dashboard/index.js +121 -100
- package/lib/Layout/dashboard/sidebar.js +23 -64
- package/lib/Layout/{dashboard → dashboard-legacy}/header.js +1 -1
- package/lib/Layout/dashboard-legacy/index.js +154 -0
- package/lib/Layout/dashboard-legacy/sidebar.js +117 -0
- package/lib/NavMenu/nav-menu.js +1 -3
- package/package.json +4 -4
- package/src/Datatable/TableSearch.js +16 -3
- package/src/Datatable/index.js +6 -2
- package/src/Header/header.js +9 -3
- package/src/Header/responsive-header.js +1 -1
- package/src/Layout/dashboard/index.js +117 -116
- package/src/Layout/dashboard/sidebar.js +69 -84
- package/src/Layout/{dashboard → dashboard-legacy}/header.js +0 -0
- package/src/Layout/dashboard-legacy/index.js +150 -0
- package/src/Layout/dashboard-legacy/sidebar.js +120 -0
- package/src/NavMenu/nav-menu.js +1 -3
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = Dashboard;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _reactHelmet = _interopRequireDefault(require("react-helmet"));
|
|
13
|
+
|
|
14
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
|
|
16
|
+
var _Container = _interopRequireDefault(require("@mui/material/Container"));
|
|
17
|
+
|
|
18
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
19
|
+
|
|
20
|
+
var _Drawer = _interopRequireDefault(require("@mui/material/Drawer"));
|
|
21
|
+
|
|
22
|
+
var _useWindowSize = _interopRequireDefault(require("react-use/lib/useWindowSize"));
|
|
23
|
+
|
|
24
|
+
var _sidebar = _interopRequireDefault(require("./sidebar"));
|
|
25
|
+
|
|
26
|
+
var _header = _interopRequireDefault(require("./header"));
|
|
27
|
+
|
|
28
|
+
var _Footer = _interopRequireDefault(require("../../Footer"));
|
|
29
|
+
|
|
30
|
+
const _excluded = ["children", "title", "brand", "description", "brandAddon", "headerAddon", "images", "links", "prefix", "fullWidth", "contentLayout", "className", "homeUrl", "logo"];
|
|
31
|
+
|
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
|
+
|
|
34
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
+
|
|
36
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
+
|
|
38
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
39
|
+
|
|
40
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
41
|
+
|
|
42
|
+
const Wrapper = _styledComponents.default.div.withConfig({
|
|
43
|
+
displayName: "dashboard-legacy__Wrapper",
|
|
44
|
+
componentId: "sc-z8z10v-0"
|
|
45
|
+
})(["&.dashboard{display:flex;flex-direction:column;height:100vh;}.dashboard__body{overflow:hidden;flex:1;}.dashboard__main{display:flex;flex-direction:column;overflow:auto;flex:1;}.dashboard__content{flex:1;}.dashboard__footer{padding-left:30px;}.drawerPaper{position:relative;white-space:nowrap;width:120px;background:", ";box-shadow:2px 16px 10px 0 rgba(0,0,0,", ");border:0;}"], props => props.theme.palette.background.default, props => props.theme.mode === 'light' ? 0.05 : 0.5);
|
|
46
|
+
|
|
47
|
+
function Dashboard(_ref) {
|
|
48
|
+
let {
|
|
49
|
+
children,
|
|
50
|
+
title,
|
|
51
|
+
brand,
|
|
52
|
+
description,
|
|
53
|
+
brandAddon,
|
|
54
|
+
headerAddon,
|
|
55
|
+
images,
|
|
56
|
+
links,
|
|
57
|
+
prefix,
|
|
58
|
+
fullWidth,
|
|
59
|
+
contentLayout,
|
|
60
|
+
className,
|
|
61
|
+
homeUrl,
|
|
62
|
+
logo
|
|
63
|
+
} = _ref,
|
|
64
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
65
|
+
|
|
66
|
+
const breakpoint = 960;
|
|
67
|
+
const {
|
|
68
|
+
width
|
|
69
|
+
} = (0, _useWindowSize.default)();
|
|
70
|
+
const [drawerMode, setDrawerMode] = (0, _react.useState)(width >= breakpoint ? 'permanent' : 'temporary');
|
|
71
|
+
const [drawerOpen, setDrawerOpen] = (0, _react.useState)(drawerMode === 'permanent');
|
|
72
|
+
(0, _react.useEffect)(() => {
|
|
73
|
+
const newMode = width >= breakpoint ? 'permanent' : 'temporary';
|
|
74
|
+
setDrawerMode(newMode);
|
|
75
|
+
setDrawerOpen(newMode !== 'temporary');
|
|
76
|
+
}, [width]);
|
|
77
|
+
|
|
78
|
+
const onToggleDrawer = () => {
|
|
79
|
+
setDrawerOpen(!drawerOpen);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const isFullWidth = fullWidth || contentLayout === 'row';
|
|
83
|
+
return /*#__PURE__*/_react.default.createElement(Wrapper, Object.assign({
|
|
84
|
+
className: "dashboard ".concat(className)
|
|
85
|
+
}, rest), /*#__PURE__*/_react.default.createElement(_reactHelmet.default, {
|
|
86
|
+
title: "".concat(title, "-").concat(brand)
|
|
87
|
+
}), /*#__PURE__*/_react.default.createElement(_header.default, {
|
|
88
|
+
className: "dashboard__header",
|
|
89
|
+
onToggleMenu: onToggleDrawer,
|
|
90
|
+
brand: brand,
|
|
91
|
+
brandAddon: brandAddon,
|
|
92
|
+
description: description,
|
|
93
|
+
addons: headerAddon,
|
|
94
|
+
homeUrl: homeUrl,
|
|
95
|
+
logo: logo
|
|
96
|
+
}), /*#__PURE__*/_react.default.createElement(_Box.default, {
|
|
97
|
+
display: "flex",
|
|
98
|
+
className: "dashboard__body"
|
|
99
|
+
}, /*#__PURE__*/_react.default.createElement(_Drawer.default, {
|
|
100
|
+
variant: drawerMode,
|
|
101
|
+
className: "drawer",
|
|
102
|
+
classes: {
|
|
103
|
+
paper: 'drawerPaper'
|
|
104
|
+
},
|
|
105
|
+
open: drawerOpen,
|
|
106
|
+
onClose: onToggleDrawer,
|
|
107
|
+
ModalProps: {
|
|
108
|
+
disablePortal: true,
|
|
109
|
+
keepMounted: true
|
|
110
|
+
}
|
|
111
|
+
}, /*#__PURE__*/_react.default.createElement(_sidebar.default, {
|
|
112
|
+
className: "dashboard__sidebar",
|
|
113
|
+
images: images,
|
|
114
|
+
links: links,
|
|
115
|
+
prefix: prefix,
|
|
116
|
+
logo: logo
|
|
117
|
+
})), /*#__PURE__*/_react.default.createElement(_Box.default, {
|
|
118
|
+
className: "dashboard__main"
|
|
119
|
+
}, /*#__PURE__*/_react.default.createElement(_Container.default, {
|
|
120
|
+
maxWidth: isFullWidth ? false : 'lg',
|
|
121
|
+
className: "dashboard__content"
|
|
122
|
+
}, children), /*#__PURE__*/_react.default.createElement(_Footer.default, {
|
|
123
|
+
className: "dashboard__footer"
|
|
124
|
+
}))));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
Dashboard.propTypes = {
|
|
128
|
+
children: _propTypes.default.any.isRequired,
|
|
129
|
+
title: _propTypes.default.string,
|
|
130
|
+
brand: _propTypes.default.string.isRequired,
|
|
131
|
+
links: _propTypes.default.array.isRequired,
|
|
132
|
+
images: _propTypes.default.object.isRequired,
|
|
133
|
+
brandAddon: _propTypes.default.object,
|
|
134
|
+
description: _propTypes.default.any.isRequired,
|
|
135
|
+
headerAddon: _propTypes.default.any,
|
|
136
|
+
prefix: _propTypes.default.string,
|
|
137
|
+
// 兼容旧版的设置,新版使用 fullWidth 进行设置
|
|
138
|
+
contentLayout: _propTypes.default.oneOf(['row', 'column']),
|
|
139
|
+
fullWidth: _propTypes.default.bool,
|
|
140
|
+
className: _propTypes.default.string,
|
|
141
|
+
homeUrl: _propTypes.default.string,
|
|
142
|
+
logo: _propTypes.default.any
|
|
143
|
+
};
|
|
144
|
+
Dashboard.defaultProps = {
|
|
145
|
+
title: 'Home',
|
|
146
|
+
contentLayout: 'column',
|
|
147
|
+
headerAddon: null,
|
|
148
|
+
brandAddon: null,
|
|
149
|
+
prefix: '/images',
|
|
150
|
+
fullWidth: false,
|
|
151
|
+
className: '',
|
|
152
|
+
homeUrl: '/',
|
|
153
|
+
logo: null
|
|
154
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _withTheme = _interopRequireDefault(require("@mui/styles/withTheme"));
|
|
15
|
+
|
|
16
|
+
var _reactRouterDom = require("react-router-dom");
|
|
17
|
+
|
|
18
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
19
|
+
|
|
20
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
21
|
+
|
|
22
|
+
var _colors = require("@mui/material/colors");
|
|
23
|
+
|
|
24
|
+
var _image = _interopRequireDefault(require("../../Icon/image"));
|
|
25
|
+
|
|
26
|
+
var _Logo = _interopRequireDefault(require("../../Logo"));
|
|
27
|
+
|
|
28
|
+
const _excluded = ["location", "theme", "images", "links", "prefix", "addons", "logo"];
|
|
29
|
+
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
+
|
|
32
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
33
|
+
|
|
34
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
35
|
+
|
|
36
|
+
function Sidebar(_ref) {
|
|
37
|
+
let {
|
|
38
|
+
location,
|
|
39
|
+
theme,
|
|
40
|
+
images,
|
|
41
|
+
links,
|
|
42
|
+
prefix,
|
|
43
|
+
addons,
|
|
44
|
+
logo
|
|
45
|
+
} = _ref,
|
|
46
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
47
|
+
|
|
48
|
+
const isSelected = (url, name) => {
|
|
49
|
+
const pattern = new RegExp("/".concat(name));
|
|
50
|
+
return pattern.test(location.pathname);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(MenuItems, rest, /*#__PURE__*/_react.default.createElement(_reactRouterDom.Link, {
|
|
54
|
+
to: "/",
|
|
55
|
+
className: "sidebar-logo"
|
|
56
|
+
}, logo || /*#__PURE__*/_react.default.createElement(_Logo.default, {
|
|
57
|
+
showText: false,
|
|
58
|
+
size: 20
|
|
59
|
+
})), links.map(_ref2 => {
|
|
60
|
+
let {
|
|
61
|
+
url,
|
|
62
|
+
name,
|
|
63
|
+
title,
|
|
64
|
+
showBadge
|
|
65
|
+
} = _ref2;
|
|
66
|
+
const selected = isSelected(url, name);
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(MenuItem, {
|
|
68
|
+
component: _reactRouterDom.Link,
|
|
69
|
+
key: url,
|
|
70
|
+
selected: selected,
|
|
71
|
+
to: url
|
|
72
|
+
}, /*#__PURE__*/_react.default.createElement(_image.default, {
|
|
73
|
+
name: images[name],
|
|
74
|
+
size: 36,
|
|
75
|
+
color: selected ? '#00c2c4' : theme.typography.color.main,
|
|
76
|
+
prefix: prefix,
|
|
77
|
+
showBadge: showBadge
|
|
78
|
+
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
79
|
+
component: "span",
|
|
80
|
+
className: "menu-title"
|
|
81
|
+
}, title));
|
|
82
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
83
|
+
style: {
|
|
84
|
+
flex: 1
|
|
85
|
+
}
|
|
86
|
+
}), addons);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
Sidebar.propTypes = {
|
|
90
|
+
location: _propTypes.default.object.isRequired,
|
|
91
|
+
theme: _propTypes.default.object.isRequired,
|
|
92
|
+
images: _propTypes.default.object.isRequired,
|
|
93
|
+
links: _propTypes.default.array.isRequired,
|
|
94
|
+
prefix: _propTypes.default.string,
|
|
95
|
+
addons: _propTypes.default.any,
|
|
96
|
+
logo: _propTypes.default.any
|
|
97
|
+
};
|
|
98
|
+
Sidebar.defaultProps = {
|
|
99
|
+
prefix: '/images',
|
|
100
|
+
addons: null,
|
|
101
|
+
logo: null
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const MenuItems = /*#__PURE__*/_react.default.memo(_styledComponents.default.div.withConfig({
|
|
105
|
+
displayName: "sidebar__MenuItems",
|
|
106
|
+
componentId: "sc-gtwxx4-0"
|
|
107
|
+
})(["flex:1;display:flex;flex-direction:column;&& .sidebar-logo{display:none;border-bottom:1px solid #eee;background:", ";position:sticky;top:0;z-index:1;padding:10px 0;text-align:center;font-size:0;}", "{&& .sidebar-logo{display:block;}}"], props => props.theme.palette.background.default, props => props.theme.breakpoints.down('md')));
|
|
108
|
+
|
|
109
|
+
const gradient = 'linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))';
|
|
110
|
+
const MenuItem = (0, _styledComponents.default)(_Button.default).withConfig({
|
|
111
|
+
displayName: "sidebar__MenuItem",
|
|
112
|
+
componentId: "sc-gtwxx4-1"
|
|
113
|
+
})(["&&{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;transition:all 200ms ease-in-out;background:", ";padding:24px 0;border-left:2px solid ", ";border-radius:0;&:hover{background:", ";border-left-color:", ";}.menu-title{margin-top:8px;font-size:12px;font-weight:500;text-align:center;text-transform:capitalize;letter-spacing:normal;width:80%;color:", ";}}"], props => props.selected ? gradient : '', props => props.selected ? _colors.teal.A700 : 'transparent', gradient, _colors.teal.A700, props => props.theme.palette.text.primary);
|
|
114
|
+
|
|
115
|
+
var _default = (0, _reactRouterDom.withRouter)((0, _withTheme.default)(Sidebar));
|
|
116
|
+
|
|
117
|
+
exports.default = _default;
|
package/lib/NavMenu/nav-menu.js
CHANGED
|
@@ -189,7 +189,7 @@ function Item(_ref2) {
|
|
|
189
189
|
if (active) {
|
|
190
190
|
activate(id);
|
|
191
191
|
}
|
|
192
|
-
}, []);
|
|
192
|
+
}, [active]);
|
|
193
193
|
|
|
194
194
|
const handleClick = () => {
|
|
195
195
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
@@ -214,8 +214,6 @@ Item.propTypes = {
|
|
|
214
214
|
id: _propTypes.default.string,
|
|
215
215
|
icon: _propTypes.default.element,
|
|
216
216
|
label: _propTypes.default.node,
|
|
217
|
-
// 未显式指定各个 item#id 时, 不方便设置 NavMenu#defaultActiveId, 此时可以给 item 指定 active, 表示 nav menu 默认激活该 item
|
|
218
|
-
// (仅在初始化时有效, 后续更新无效)
|
|
219
217
|
active: _propTypes.default.bool,
|
|
220
218
|
onClick: _propTypes.default.func
|
|
221
219
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ux",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.18",
|
|
4
4
|
"description": "Common used react components for arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"react": ">=18.1.0",
|
|
53
53
|
"react-ga": "^2.7.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "5724cf7868e1dcb5d96af8d100f4254546a59442",
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@arcblock/icons": "^2.1.
|
|
58
|
-
"@arcblock/react-hooks": "^2.1.
|
|
57
|
+
"@arcblock/icons": "^2.1.18",
|
|
58
|
+
"@arcblock/react-hooks": "^2.1.18",
|
|
59
59
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
60
60
|
"@emotion/react": "^11.9.0",
|
|
61
61
|
"@emotion/styled": "^11.8.1",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useState, useRef } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import IconButton from '@mui/material/IconButton';
|
|
4
4
|
import Tooltip from '@mui/material/Tooltip';
|
|
@@ -16,6 +16,10 @@ export default function TableSearch({
|
|
|
16
16
|
onSearchOpen,
|
|
17
17
|
}) {
|
|
18
18
|
const [inputMode, setInputMode] = useState(false);
|
|
19
|
+
const [innerSearchText, setInnerSearchText] = useState('');
|
|
20
|
+
const inputTimer = useRef(null);
|
|
21
|
+
|
|
22
|
+
const searchDebounceTime = options.serverSide && options.searchDebounceTime;
|
|
19
23
|
|
|
20
24
|
const clickSearchIcon = () => {
|
|
21
25
|
setInputMode(true);
|
|
@@ -23,7 +27,16 @@ export default function TableSearch({
|
|
|
23
27
|
};
|
|
24
28
|
|
|
25
29
|
const onChange = event => {
|
|
26
|
-
|
|
30
|
+
const { value } = event.currentTarget;
|
|
31
|
+
if (searchDebounceTime) {
|
|
32
|
+
clearTimeout(inputTimer.current);
|
|
33
|
+
setInnerSearchText(value);
|
|
34
|
+
inputTimer.current = setTimeout(() => {
|
|
35
|
+
searchTextUpdate(value);
|
|
36
|
+
}, searchDebounceTime);
|
|
37
|
+
} else {
|
|
38
|
+
searchTextUpdate(value);
|
|
39
|
+
}
|
|
27
40
|
};
|
|
28
41
|
|
|
29
42
|
const clickClose = () => {
|
|
@@ -56,7 +69,7 @@ export default function TableSearch({
|
|
|
56
69
|
variant="standard"
|
|
57
70
|
spacing={2}
|
|
58
71
|
onChange={onChange}
|
|
59
|
-
value={searchText || ''}
|
|
72
|
+
value={searchDebounceTime ? innerSearchText : searchText || ''}
|
|
60
73
|
autoFocus
|
|
61
74
|
/>
|
|
62
75
|
)}
|
package/src/Datatable/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import MUIDataTable, { TableFilterList, TableFooter } from 'mui-datatables';
|
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import isObject from 'lodash/isObject';
|
|
6
6
|
import cloneDeep from 'lodash/cloneDeep';
|
|
7
|
+
import Empty from '../Empty';
|
|
7
8
|
import CustomToolbar from './CustomToolbar';
|
|
8
9
|
import { DatatableProvide, useDatatableContext } from './DatatableContext';
|
|
9
10
|
|
|
@@ -103,7 +104,10 @@ function ReDatatable({
|
|
|
103
104
|
useEffect(() => setDisabled(disabled), [disabled]);
|
|
104
105
|
|
|
105
106
|
let textLabels = {
|
|
106
|
-
body: {
|
|
107
|
+
body: {
|
|
108
|
+
noMatch: <Empty>Sorry, no matching records found</Empty>,
|
|
109
|
+
toolTip: 'Sort',
|
|
110
|
+
},
|
|
107
111
|
pagination: {
|
|
108
112
|
next: 'Next Page',
|
|
109
113
|
previous: 'Previous Page',
|
|
@@ -125,7 +129,7 @@ function ReDatatable({
|
|
|
125
129
|
|
|
126
130
|
if (locale === 'zh') {
|
|
127
131
|
textLabels = {
|
|
128
|
-
body: { noMatch:
|
|
132
|
+
body: { noMatch: <Empty>对不起,没有找到匹配的记录</Empty>, toolTip: '排序' },
|
|
129
133
|
pagination: {
|
|
130
134
|
next: '下一页',
|
|
131
135
|
previous: '上一页',
|
package/src/Header/header.js
CHANGED
|
@@ -32,9 +32,10 @@ function Header({ logo, brand, brandAddon, description, children, addons, prepen
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
Header.propTypes = {
|
|
35
|
+
// logo img/svg, 可以包裹一个 a 标签
|
|
35
36
|
logo: PropTypes.node,
|
|
36
|
-
// 相当于 Title
|
|
37
|
-
brand: PropTypes.
|
|
37
|
+
// 相当于 Title, 可以包裹一个 a 标签
|
|
38
|
+
brand: PropTypes.node,
|
|
38
39
|
// brand 右侧的内容区域, 可显示一个 badge 或 tag
|
|
39
40
|
brandAddon: PropTypes.node,
|
|
40
41
|
// brand 下方的描述
|
|
@@ -58,7 +59,7 @@ Header.defaultProps = {
|
|
|
58
59
|
|
|
59
60
|
const Root = styled.div`
|
|
60
61
|
position: relative;
|
|
61
|
-
z-index: ${props => props.$theme.zIndex.
|
|
62
|
+
z-index: ${props => props.$theme.zIndex.appBar};
|
|
62
63
|
font-size: 14px;
|
|
63
64
|
background: ${props => props.$theme.palette.common.white};
|
|
64
65
|
.header-container {
|
|
@@ -95,10 +96,15 @@ const Root = styled.div`
|
|
|
95
96
|
flex-direction: column;
|
|
96
97
|
flex-shrink: 0;
|
|
97
98
|
margin-right: 16px;
|
|
99
|
+
a {
|
|
100
|
+
color: inherit;
|
|
101
|
+
text-decoration: none;
|
|
102
|
+
}
|
|
98
103
|
.header-brand-title {
|
|
99
104
|
display: flex;
|
|
100
105
|
align-items: center;
|
|
101
106
|
h2 {
|
|
107
|
+
margin: 0;
|
|
102
108
|
font-size: 16px;
|
|
103
109
|
}
|
|
104
110
|
.header-brand-addon {
|
|
@@ -49,7 +49,7 @@ function ResponsiveHeader({ menu, prepend, children, ...rest }) {
|
|
|
49
49
|
<Drawer
|
|
50
50
|
open={drawerOpen}
|
|
51
51
|
onClose={() => setDrawerOpen(false)}
|
|
52
|
-
ModalProps={{ disablePortal:
|
|
52
|
+
ModalProps={{ disablePortal: false, keepMounted: true }}>
|
|
53
53
|
<Sidebar>
|
|
54
54
|
<div className="header-sidebar-head">
|
|
55
55
|
<div className="header-sidebar-logo">{logo}</div>
|