cfel-base-components 2.5.51 → 2.5.53
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/demo/src/index.jsx +157 -76
- package/package.json +1 -1
- package/src/.umi/core/helmet.ts +1 -1
- package/src/components/layout/index.scss +14 -2
- package/src/components/layout/index.tsx +86 -163
- package/src/components/layout-console/index-console.scss +17 -1
- package/src/components/layout-console/index.tsx +83 -160
- package/src/global.d.ts +0 -2
- package/demo/src/index.scss +0 -0
|
@@ -64,7 +64,7 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
64
64
|
isHideHeader,
|
|
65
65
|
onCollapse,
|
|
66
66
|
type,
|
|
67
|
-
umiHistory
|
|
67
|
+
umiHistory,
|
|
68
68
|
} = props
|
|
69
69
|
|
|
70
70
|
const findKeyPath = (pathname: string) => {
|
|
@@ -88,9 +88,7 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
// 初始化选中菜单
|
|
91
|
-
const [selectKey, setSelectKey] = useState<any>(
|
|
92
|
-
findKeyPath('/' + location.pathname.split('/')[2])
|
|
93
|
-
)
|
|
91
|
+
const [selectKey, setSelectKey] = useState<any>(findKeyPath('/' + location.pathname.split('/')[2]))
|
|
94
92
|
|
|
95
93
|
const [infoOpen, setInfoOpen] = useState<string | null>(null)
|
|
96
94
|
|
|
@@ -135,7 +133,7 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
135
133
|
//在这里找到当前菜单的上层目录
|
|
136
134
|
const paMenu = findParentMenu(menuList, '/' + location.pathname.split('/')[2])
|
|
137
135
|
//去重
|
|
138
|
-
const set = new Set(paMenu.map(item => item.key))
|
|
136
|
+
const set = new Set(paMenu.map((item) => item.key))
|
|
139
137
|
openKeys.forEach((element: string) => {
|
|
140
138
|
set.add(element)
|
|
141
139
|
})
|
|
@@ -148,10 +146,10 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
148
146
|
account: false,
|
|
149
147
|
id: false,
|
|
150
148
|
tenantName: false,
|
|
151
|
-
tenantId: false
|
|
149
|
+
tenantId: false,
|
|
152
150
|
})
|
|
153
151
|
|
|
154
|
-
const onOpenChange: MenuProps['onOpenChange'] = keys => {
|
|
152
|
+
const onOpenChange: MenuProps['onOpenChange'] = (keys) => {
|
|
155
153
|
setOpenKeys(keys)
|
|
156
154
|
}
|
|
157
155
|
|
|
@@ -165,7 +163,7 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
165
163
|
// 菜单动画
|
|
166
164
|
const collapseNode = () => {
|
|
167
165
|
return {
|
|
168
|
-
height: 0
|
|
166
|
+
height: 0,
|
|
169
167
|
}
|
|
170
168
|
}
|
|
171
169
|
const expandNode = (node: any) => {
|
|
@@ -179,26 +177,26 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
179
177
|
onEnterStart: collapseNode,
|
|
180
178
|
onEnterActive: expandNode,
|
|
181
179
|
onLeaveStart: expandNode,
|
|
182
|
-
onLeaveActive: collapseNode
|
|
180
|
+
onLeaveActive: collapseNode,
|
|
183
181
|
}
|
|
184
182
|
|
|
185
183
|
const verticalMotion = {
|
|
186
184
|
motionName: 'rc-menu-open-zoom',
|
|
187
185
|
motionAppear: true,
|
|
188
186
|
motionEnter: true,
|
|
189
|
-
motionLeave: true
|
|
187
|
+
motionLeave: true,
|
|
190
188
|
}
|
|
191
189
|
|
|
192
190
|
return (
|
|
193
|
-
<Layout className=
|
|
191
|
+
<Layout className="layout-warps-console">
|
|
194
192
|
{Array.isArray(menuList) && menuList.length > 0 && (
|
|
195
193
|
<Sider
|
|
196
|
-
className=
|
|
194
|
+
className="layout-side-console"
|
|
197
195
|
collapsible
|
|
198
196
|
trigger={null}
|
|
199
197
|
collapsed={collapsed}
|
|
200
198
|
width={260}
|
|
201
|
-
onCollapse={value => {
|
|
199
|
+
onCollapse={(value) => {
|
|
202
200
|
if (onCollapse) {
|
|
203
201
|
onCollapse(value)
|
|
204
202
|
}
|
|
@@ -206,12 +204,9 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
206
204
|
setCollapsed(value)
|
|
207
205
|
}}
|
|
208
206
|
>
|
|
209
|
-
<div className=
|
|
207
|
+
<div className="layout-side-mask2-console"></div>
|
|
210
208
|
|
|
211
|
-
<div
|
|
212
|
-
className='header-logo-console'
|
|
213
|
-
style={{ justifyContent: collapsed ? 'center' : '', paddingLeft: collapsed ? '0' : '' }}
|
|
214
|
-
>
|
|
209
|
+
<div className="header-logo-console" style={{ justifyContent: collapsed ? 'center' : '', paddingLeft: collapsed ? '0' : '' }}>
|
|
215
210
|
<div
|
|
216
211
|
onClick={() => {
|
|
217
212
|
window.open('/home')
|
|
@@ -237,8 +232,9 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
237
232
|
{collapsed && (
|
|
238
233
|
<div style={{ width: '100%', display: 'flex', justifyContent: 'center' }}>
|
|
239
234
|
<div
|
|
240
|
-
className=
|
|
235
|
+
className="close-trigger-console"
|
|
241
236
|
onClick={() => {
|
|
237
|
+
localStorage.setItem('layout_collapsed', 'false')
|
|
242
238
|
setCollapsed(false)
|
|
243
239
|
}}
|
|
244
240
|
>
|
|
@@ -250,19 +246,12 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
250
246
|
<div style={{ height: 24 }}></div>
|
|
251
247
|
|
|
252
248
|
<div style={{ width: '100%', padding: '0 16px' }}>
|
|
253
|
-
<Search
|
|
254
|
-
menuList={menuList}
|
|
255
|
-
collapsed={collapsed}
|
|
256
|
-
type={type || ''}
|
|
257
|
-
umiHistory={umiHistory}
|
|
258
|
-
setSelectKey={setSelectKey}
|
|
259
|
-
findKeyPath={findKeyPath}
|
|
260
|
-
/>
|
|
249
|
+
<Search menuList={menuList} collapsed={collapsed} type={type || ''} umiHistory={umiHistory} setSelectKey={setSelectKey} findKeyPath={findKeyPath} />
|
|
261
250
|
</div>
|
|
262
251
|
|
|
263
252
|
{!collapsed && <div style={{ height: 12 }}></div>}
|
|
264
253
|
|
|
265
|
-
<div className=
|
|
254
|
+
<div className="layout-menu-console">
|
|
266
255
|
<RcMenu
|
|
267
256
|
mode={collapsed ? 'vertical' : 'inline'}
|
|
268
257
|
className={`menu-console${collapsed ? '-collapsed' : ''}`}
|
|
@@ -276,7 +265,7 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
276
265
|
onMenuClick(item)
|
|
277
266
|
}
|
|
278
267
|
}}
|
|
279
|
-
triggerSubMenuAction=
|
|
268
|
+
triggerSubMenuAction="hover"
|
|
280
269
|
>
|
|
281
270
|
{menuList.map((item: any) => {
|
|
282
271
|
const isSelected = selectKey.includes(item.key)
|
|
@@ -287,17 +276,13 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
287
276
|
}
|
|
288
277
|
return (
|
|
289
278
|
<SubMenu
|
|
290
|
-
popupClassName=
|
|
279
|
+
popupClassName="rc-menu-submenu-popup"
|
|
291
280
|
key={item.key}
|
|
292
|
-
className=
|
|
281
|
+
className="menu-item-content"
|
|
293
282
|
title={
|
|
294
|
-
<div className=
|
|
295
|
-
<div className=
|
|
296
|
-
<span
|
|
297
|
-
className={`menu-item-icon ${isSelected ? 'submenu-selected' : ''}`}
|
|
298
|
-
>
|
|
299
|
-
{item.icon}
|
|
300
|
-
</span>
|
|
283
|
+
<div className="sub-list">
|
|
284
|
+
<div className="menu-item-inner">
|
|
285
|
+
<span className={`menu-item-icon ${isSelected ? 'submenu-selected' : ''}`}>{item.icon}</span>
|
|
301
286
|
{!collapsed && <span className={classNames}>{item.label}</span>}
|
|
302
287
|
</div>
|
|
303
288
|
</div>
|
|
@@ -314,20 +299,10 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
314
299
|
if (child.children) {
|
|
315
300
|
return (
|
|
316
301
|
<SubMenu
|
|
317
|
-
popupClassName=
|
|
318
|
-
className=
|
|
302
|
+
popupClassName="rc-menu-submenu-popup"
|
|
303
|
+
className="menu-item-content sub-li"
|
|
319
304
|
key={child.key}
|
|
320
|
-
title={
|
|
321
|
-
<div className='sub-list'>
|
|
322
|
-
{!collapsed && (
|
|
323
|
-
<span
|
|
324
|
-
className={`menu-item-label ${isSelected ? 'submenu-selected' : ''}`}
|
|
325
|
-
>
|
|
326
|
-
{child.label}
|
|
327
|
-
</span>
|
|
328
|
-
)}
|
|
329
|
-
</div>
|
|
330
|
-
}
|
|
305
|
+
title={<div className="sub-list">{!collapsed && <span className={`menu-item-label ${isSelected ? 'submenu-selected' : ''}`}>{child.label}</span>}</div>}
|
|
331
306
|
>
|
|
332
307
|
{child.children.map((grandChild: any) => {
|
|
333
308
|
const isSelected = selectKey.includes(grandChild.key)
|
|
@@ -338,16 +313,8 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
338
313
|
}
|
|
339
314
|
}
|
|
340
315
|
return (
|
|
341
|
-
<MenuItem key={grandChild.key} className=
|
|
342
|
-
<div className=
|
|
343
|
-
{!collapsed && (
|
|
344
|
-
<span
|
|
345
|
-
className={`menu-item-label ${isSelected ? 'submenu-selected' : ''}`}
|
|
346
|
-
>
|
|
347
|
-
{grandChild.label}
|
|
348
|
-
</span>
|
|
349
|
-
)}
|
|
350
|
-
</div>
|
|
316
|
+
<MenuItem key={grandChild.key} className="grand-li">
|
|
317
|
+
<div className="menu-item-content">{!collapsed && <span className={`menu-item-label ${isSelected ? 'submenu-selected' : ''}`}>{grandChild.label}</span>}</div>
|
|
351
318
|
</MenuItem>
|
|
352
319
|
)
|
|
353
320
|
})}
|
|
@@ -355,16 +322,8 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
355
322
|
)
|
|
356
323
|
}
|
|
357
324
|
return (
|
|
358
|
-
<MenuItem key={child.key} className=
|
|
359
|
-
<div className=
|
|
360
|
-
{!collapsed && (
|
|
361
|
-
<span
|
|
362
|
-
className={`menu-item-label ${isSelected ? 'submenu-selected' : ''}`}
|
|
363
|
-
>
|
|
364
|
-
{child.label}
|
|
365
|
-
</span>
|
|
366
|
-
)}
|
|
367
|
-
</div>
|
|
325
|
+
<MenuItem key={child.key} className="sub-li">
|
|
326
|
+
<div className="menu-item-content">{!collapsed && <span className={`menu-item-label ${isSelected ? 'submenu-selected' : ''}`}>{child.label}</span>}</div>
|
|
368
327
|
</MenuItem>
|
|
369
328
|
)
|
|
370
329
|
})}
|
|
@@ -378,11 +337,9 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
378
337
|
classNames += ' submenu-selected'
|
|
379
338
|
}
|
|
380
339
|
return (
|
|
381
|
-
<MenuItem key={item.key} className=
|
|
382
|
-
<div>
|
|
383
|
-
<span className={`menu-item-icon ${isSelected ? 'submenu-selected' : ''}`}>
|
|
384
|
-
{item.icon}
|
|
385
|
-
</span>
|
|
340
|
+
<MenuItem key={item.key} className="menu-item-content">
|
|
341
|
+
<div className="first-li">
|
|
342
|
+
<span className={`menu-item-icon ${isSelected ? 'submenu-selected' : ''}`}>{item.icon}</span>
|
|
386
343
|
{!collapsed && <span className={classNames}>{item.label}</span>}
|
|
387
344
|
</div>
|
|
388
345
|
</MenuItem>
|
|
@@ -394,21 +351,21 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
394
351
|
</Sider>
|
|
395
352
|
)}
|
|
396
353
|
|
|
397
|
-
<div className=
|
|
354
|
+
<div className="layout-main-console">
|
|
398
355
|
{!isHideHeader && (
|
|
399
|
-
<div className=
|
|
356
|
+
<div className="layout-header-console">
|
|
400
357
|
{appName && (
|
|
401
|
-
<div className=
|
|
358
|
+
<div className="app-name">
|
|
402
359
|
<strong>{appName}</strong>
|
|
403
360
|
</div>
|
|
404
361
|
)}
|
|
405
362
|
|
|
406
|
-
<div className=
|
|
363
|
+
<div className="layout-header-fill-console" />
|
|
407
364
|
|
|
408
|
-
<div className=
|
|
365
|
+
<div className="layout-header-actions-console">
|
|
409
366
|
{actions?.map((item, index) => {
|
|
410
367
|
return (
|
|
411
|
-
<div className=
|
|
368
|
+
<div className="actions-item" key={index}>
|
|
412
369
|
{item}
|
|
413
370
|
</div>
|
|
414
371
|
)
|
|
@@ -416,40 +373,33 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
416
373
|
</div>
|
|
417
374
|
|
|
418
375
|
<Popover
|
|
419
|
-
placement=
|
|
376
|
+
placement="bottom"
|
|
420
377
|
content={
|
|
421
|
-
<UserCard
|
|
422
|
-
myWalletInfo={myWalletInfo}
|
|
423
|
-
MyLoginInfo={MyLoginInfo}
|
|
424
|
-
amountInfo={amountInfo}
|
|
425
|
-
customAction={customAction}
|
|
426
|
-
isCopied={isCopied}
|
|
427
|
-
copyTextToClipboard={copyTextToClipboard}
|
|
428
|
-
/>
|
|
378
|
+
<UserCard myWalletInfo={myWalletInfo} MyLoginInfo={MyLoginInfo} amountInfo={amountInfo} customAction={customAction} isCopied={isCopied} copyTextToClipboard={copyTextToClipboard} />
|
|
429
379
|
}
|
|
430
380
|
arrow={false}
|
|
431
|
-
trigger=
|
|
432
|
-
onOpenChange={e => {
|
|
381
|
+
trigger="click"
|
|
382
|
+
onOpenChange={(e) => {
|
|
433
383
|
setInfoOpen(e ? 'up' : 'down')
|
|
434
384
|
if (!e) return
|
|
435
385
|
setIsCopied({
|
|
436
386
|
account: false,
|
|
437
387
|
id: false,
|
|
438
388
|
tenantName: false,
|
|
439
|
-
tenantId: false
|
|
389
|
+
tenantId: false,
|
|
440
390
|
})
|
|
441
391
|
if (myLoginInfoAction) {
|
|
442
392
|
myLoginInfoAction()
|
|
443
393
|
}
|
|
444
394
|
}}
|
|
445
395
|
>
|
|
446
|
-
<div className=
|
|
447
|
-
<img className=
|
|
448
|
-
<div className=
|
|
396
|
+
<div className="layout-header-user-console">
|
|
397
|
+
<img className="avatar" src={avatar} />
|
|
398
|
+
<div className="name">{name}</div>
|
|
449
399
|
<span
|
|
450
400
|
style={{
|
|
451
401
|
display: 'inline-block',
|
|
452
|
-
marginLeft: '4px'
|
|
402
|
+
marginLeft: '4px',
|
|
453
403
|
}}
|
|
454
404
|
className={`iconfont icon-zhankai ${infoOpen ? (infoOpen === 'up' ? 'up' : 'down') : ''}`}
|
|
455
405
|
></span>
|
|
@@ -457,7 +407,7 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
457
407
|
</Popover>
|
|
458
408
|
</div>
|
|
459
409
|
)}
|
|
460
|
-
<div className=
|
|
410
|
+
<div className="layout-content-console">{props.children}</div>
|
|
461
411
|
</div>
|
|
462
412
|
</Layout>
|
|
463
413
|
)
|
|
@@ -465,17 +415,10 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
465
415
|
|
|
466
416
|
function Arrow({ collapsed, type }: { collapsed?: boolean; type?: string }) {
|
|
467
417
|
return (
|
|
468
|
-
<svg
|
|
469
|
-
style={{ transform: !collapsed ? 'rotate(180deg)' : 'rotate(0deg)' }}
|
|
470
|
-
viewBox='0 0 1024 1024'
|
|
471
|
-
version='1.1'
|
|
472
|
-
xmlns='http://www.w3.org/2000/svg'
|
|
473
|
-
width='20'
|
|
474
|
-
height='20'
|
|
475
|
-
>
|
|
418
|
+
<svg style={{ transform: !collapsed ? 'rotate(180deg)' : 'rotate(0deg)' }} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20">
|
|
476
419
|
<path
|
|
477
|
-
fill=
|
|
478
|
-
d=
|
|
420
|
+
fill="FFFFFF"
|
|
421
|
+
d="M564.6336 775.168a41.5744 41.5744 0 0 0-13.312-28.672l-230.4-234.4448 229.9904-234.1888a42.0864 42.0864 0 0 0-26.3168-73.0112 42.0864 42.0864 0 0 0-30.6176 11.264L231.0656 481.024a41.984 41.984 0 0 0-2.4576 59.5968l1.9968 2.048 263.7824 265.6256a41.984 41.984 0 0 0 70.2464-33.0752z m254.5152 0a41.472 41.472 0 0 0-13.312-28.672L575.488 512l229.9904-234.1376a41.984 41.984 0 1 0-56.9344-61.7984L485.632 480.9728a42.0864 42.0864 0 0 0-2.4064 59.6992l0.8704 0.9216 0.8704 0.8192 0.4096 0.4096 263.5776 265.4208a41.984 41.984 0 0 0 70.1952-33.0752z"
|
|
479
422
|
></path>
|
|
480
423
|
</svg>
|
|
481
424
|
)
|
|
@@ -502,10 +445,7 @@ function Search({ menuList, collapsed, type, umiHistory, setSelectKey, findKeyPa
|
|
|
502
445
|
|
|
503
446
|
useEffect(() => {
|
|
504
447
|
const handleKeyDown = (event: KeyboardEvent) => {
|
|
505
|
-
if (
|
|
506
|
-
(navigator.platform.toLowerCase().includes('mac') ? event.metaKey : event.ctrlKey) &&
|
|
507
|
-
event.key.toLowerCase() === 'k'
|
|
508
|
-
) {
|
|
448
|
+
if ((navigator.platform.toLowerCase().includes('mac') ? event.metaKey : event.ctrlKey) && event.key.toLowerCase() === 'k') {
|
|
509
449
|
event.preventDefault()
|
|
510
450
|
const searchInput = document.querySelector('#menu-input') as HTMLInputElement
|
|
511
451
|
if (searchInput) {
|
|
@@ -544,7 +484,7 @@ function Search({ menuList, collapsed, type, umiHistory, setSelectKey, findKeyPa
|
|
|
544
484
|
search(menuList as Router[])
|
|
545
485
|
setSearchResult(searchResults)
|
|
546
486
|
function search(data: Router[]) {
|
|
547
|
-
data.forEach(item => {
|
|
487
|
+
data.forEach((item) => {
|
|
548
488
|
if (typeof item.label === 'string' && item.label.includes(value.toLocaleUpperCase())) {
|
|
549
489
|
searchResults.push(item)
|
|
550
490
|
}
|
|
@@ -558,7 +498,7 @@ function Search({ menuList, collapsed, type, umiHistory, setSelectKey, findKeyPa
|
|
|
558
498
|
const enter = (item: Router) => {
|
|
559
499
|
setIsFocused(false)
|
|
560
500
|
//如果搜索历史里面有这个item,就不再添加
|
|
561
|
-
if (searchHistory.findIndex(i => i.key === item.key) === -1) {
|
|
501
|
+
if (searchHistory.findIndex((i) => i.key === item.key) === -1) {
|
|
562
502
|
setSearchHistory([...searchHistory, item])
|
|
563
503
|
}
|
|
564
504
|
//如果是目录就找到目录下第一个菜单进入
|
|
@@ -585,65 +525,50 @@ function Search({ menuList, collapsed, type, umiHistory, setSelectKey, findKeyPa
|
|
|
585
525
|
}
|
|
586
526
|
|
|
587
527
|
const deleteHistory = (item: Router) => {
|
|
588
|
-
setSearchHistory(searchHistory.filter(i => i.key !== item.key))
|
|
528
|
+
setSearchHistory(searchHistory.filter((i) => i.key !== item.key))
|
|
589
529
|
}
|
|
590
530
|
return (
|
|
591
531
|
<>
|
|
592
532
|
{collapsed ? (
|
|
593
|
-
<div className=
|
|
594
|
-
<div className=
|
|
595
|
-
<svg
|
|
596
|
-
viewBox='0 0 1024 1024'
|
|
597
|
-
version='1.1'
|
|
598
|
-
xmlns='http://www.w3.org/2000/svg'
|
|
599
|
-
width='18'
|
|
600
|
-
height='18'
|
|
601
|
-
>
|
|
533
|
+
<div className="search-mobile-console">
|
|
534
|
+
<div className="search-icon">
|
|
535
|
+
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="18" height="18">
|
|
602
536
|
<path
|
|
603
|
-
fill=
|
|
604
|
-
d=
|
|
537
|
+
fill="#C3CAEF"
|
|
538
|
+
d="M962.048 907.776l-229.0176-229.0176a384.3072 384.3072 0 1 0-54.272 54.272l229.0176 229.0176a38.4 38.4 0 0 0 54.272-54.272zM436.1216 743.0656a306.944 306.944 0 1 1 306.944-306.944 307.3024 307.3024 0 0 1-306.944 306.944z"
|
|
605
539
|
></path>
|
|
606
540
|
</svg>
|
|
607
541
|
</div>
|
|
608
542
|
</div>
|
|
609
543
|
) : (
|
|
610
544
|
<div>
|
|
611
|
-
<div className=
|
|
612
|
-
<div className=
|
|
613
|
-
<img src=
|
|
545
|
+
<div className="search-console">
|
|
546
|
+
<div className="search-bg-mask">
|
|
547
|
+
<img src="https://cfel-front.oss-cn-hangzhou.aliyuncs.com/logo/base-component/menu-search-bg-console.png" />
|
|
614
548
|
</div>
|
|
615
549
|
<input
|
|
616
|
-
autoComplete=
|
|
617
|
-
id=
|
|
550
|
+
autoComplete="off"
|
|
551
|
+
id="menu-input"
|
|
618
552
|
value={searchTerm}
|
|
619
|
-
onChange={e => handleSearch(e.target.value)}
|
|
620
|
-
className=
|
|
621
|
-
placeholder=
|
|
553
|
+
onChange={(e) => handleSearch(e.target.value)}
|
|
554
|
+
className="search-input"
|
|
555
|
+
placeholder="搜索菜单..."
|
|
622
556
|
onFocus={() => setIsFocused(true)}
|
|
623
|
-
onBlur={e => {
|
|
557
|
+
onBlur={(e) => {
|
|
624
558
|
if (!e.relatedTarget?.closest('.lists-console')) {
|
|
625
559
|
setIsFocused(false)
|
|
626
560
|
}
|
|
627
561
|
}}
|
|
628
562
|
/>
|
|
629
|
-
<div className=
|
|
630
|
-
<svg
|
|
631
|
-
viewBox='0 0 1024 1024'
|
|
632
|
-
version='1.1'
|
|
633
|
-
xmlns='http://www.w3.org/2000/svg'
|
|
634
|
-
width='18'
|
|
635
|
-
height='18'
|
|
636
|
-
>
|
|
563
|
+
<div className="search-icon">
|
|
564
|
+
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="18" height="18">
|
|
637
565
|
<path
|
|
638
|
-
fill=
|
|
639
|
-
d=
|
|
566
|
+
fill="#C3CAEF"
|
|
567
|
+
d="M962.048 907.776l-229.0176-229.0176a384.3072 384.3072 0 1 0-54.272 54.272l229.0176 229.0176a38.4 38.4 0 0 0 54.272-54.272zM436.1216 743.0656a306.944 306.944 0 1 1 306.944-306.944 307.3024 307.3024 0 0 1-306.944 306.944z"
|
|
640
568
|
></path>
|
|
641
569
|
</svg>
|
|
642
570
|
</div>
|
|
643
|
-
<div
|
|
644
|
-
className='search-command'
|
|
645
|
-
style={{ width: navigator.platform.toLowerCase().includes('mac') ? '' : '50px' }}
|
|
646
|
-
>
|
|
571
|
+
<div className="search-command" style={{ width: navigator.platform.toLowerCase().includes('mac') ? '' : '50px' }}>
|
|
647
572
|
{navigator.platform.toLowerCase().includes('mac') ? '⌘' : 'Ctrl+'}K
|
|
648
573
|
</div>
|
|
649
574
|
|
|
@@ -661,31 +586,29 @@ function Search({ menuList, collapsed, type, umiHistory, setSelectKey, findKeyPa
|
|
|
661
586
|
<List
|
|
662
587
|
tabIndex={-1}
|
|
663
588
|
split={false}
|
|
664
|
-
className=
|
|
665
|
-
size=
|
|
589
|
+
className="lists-console"
|
|
590
|
+
size="small"
|
|
666
591
|
bordered
|
|
667
592
|
dataSource={searchResult}
|
|
668
|
-
renderItem={item => (
|
|
669
|
-
<List.Item onClick={() => enter(item)}>{item.label}</List.Item>
|
|
670
|
-
)}
|
|
593
|
+
renderItem={(item) => <List.Item onClick={() => enter(item)}>{item.label}</List.Item>}
|
|
671
594
|
/>
|
|
672
595
|
) : (
|
|
673
596
|
<List
|
|
674
597
|
tabIndex={-1}
|
|
675
598
|
split={false}
|
|
676
|
-
className=
|
|
677
|
-
header=
|
|
678
|
-
size=
|
|
599
|
+
className="lists-console"
|
|
600
|
+
header="最近访问"
|
|
601
|
+
size="small"
|
|
679
602
|
bordered
|
|
680
603
|
dataSource={searchHistory}
|
|
681
|
-
renderItem={item => {
|
|
604
|
+
renderItem={(item) => {
|
|
682
605
|
return (
|
|
683
606
|
<div
|
|
684
607
|
className={'search-item'}
|
|
685
608
|
style={{
|
|
686
609
|
display: 'flex',
|
|
687
610
|
justifyContent: 'space-between',
|
|
688
|
-
alignItems: 'center'
|
|
611
|
+
alignItems: 'center',
|
|
689
612
|
}}
|
|
690
613
|
>
|
|
691
614
|
<List.Item onClick={() => enter(item)}>{item.label}</List.Item>
|
package/src/global.d.ts
CHANGED
package/demo/src/index.scss
DELETED
|
File without changes
|