@gm-pc/react 1.6.1 → 1.7.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gm-pc/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "观麦前端基础组件库",
|
|
5
5
|
"author": "liyatang <liyatang@qq.com>",
|
|
6
6
|
"homepage": "https://github.com/gmfe/gm-pc#readme",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@gm-common/hooks": "^2.10.0",
|
|
26
26
|
"@gm-common/tool": "^2.10.0",
|
|
27
|
-
"@gm-pc/locales": "^1.
|
|
27
|
+
"@gm-pc/locales": "^1.7.0",
|
|
28
28
|
"big.js": "^6.0.1",
|
|
29
29
|
"classnames": "^2.2.5",
|
|
30
30
|
"lodash": "^4.17.19",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"react-dom": "^16.14.0",
|
|
47
47
|
"react-window": "^1.8.5"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "8e2ac723db7b743cb76a63dc9ce6977233a1da37"
|
|
50
50
|
}
|
|
@@ -56,7 +56,7 @@ const BoxPanel: FC<BoxPanelProps> = ({
|
|
|
56
56
|
{_.map(summary, (s: BoxPanelSummaryData, i) => {
|
|
57
57
|
if (i < summary.length - 1)
|
|
58
58
|
return (
|
|
59
|
-
<span>
|
|
59
|
+
<span key={s.value}>
|
|
60
60
|
{s.text}:
|
|
61
61
|
<span className='gm-text-primary gm-text-bold'>{s.value}</span>
|
|
62
62
|
,
|
|
@@ -64,7 +64,7 @@ const BoxPanel: FC<BoxPanelProps> = ({
|
|
|
64
64
|
)
|
|
65
65
|
else
|
|
66
66
|
return (
|
|
67
|
-
<span>
|
|
67
|
+
<span key={s.value}>
|
|
68
68
|
{s.text}:
|
|
69
69
|
<span className='gm-text-primary gm-text-bold'>{s.value}</span>
|
|
70
70
|
</span>
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {
|
|
2
|
+
CSSProperties,
|
|
3
|
+
ReactNode,
|
|
4
|
+
useState,
|
|
5
|
+
useRef,
|
|
6
|
+
useEffect,
|
|
7
|
+
useMemo,
|
|
8
|
+
} from 'react'
|
|
2
9
|
import classNames from 'classnames'
|
|
3
10
|
import _ from 'lodash'
|
|
4
11
|
import { Flex, FlexProps } from '../flex'
|
|
@@ -15,6 +22,8 @@ interface TabsItem<V extends string | number> {
|
|
|
15
22
|
/* 是否可关闭 */
|
|
16
23
|
closable?: boolean
|
|
17
24
|
ref?: HTMLDivElement | null
|
|
25
|
+
/** 是否隐藏 */
|
|
26
|
+
hide?: boolean
|
|
18
27
|
}
|
|
19
28
|
|
|
20
29
|
interface TabsProps<V extends string | number> extends Omit<FlexProps, 'onChange'> {
|
|
@@ -43,29 +52,28 @@ interface TabsProps<V extends string | number> extends Omit<FlexProps, 'onChange
|
|
|
43
52
|
popverTitle?: string
|
|
44
53
|
}
|
|
45
54
|
|
|
46
|
-
function Tabs<V extends string | number = string>(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
function Tabs<V extends string | number = string>({
|
|
56
|
+
tabs,
|
|
57
|
+
light,
|
|
58
|
+
active,
|
|
59
|
+
defaultActive,
|
|
60
|
+
keep,
|
|
61
|
+
onChange,
|
|
62
|
+
onClose,
|
|
63
|
+
onChangeValidate,
|
|
64
|
+
className,
|
|
65
|
+
column = true,
|
|
66
|
+
activeOnce,
|
|
67
|
+
full,
|
|
68
|
+
type,
|
|
69
|
+
extraAction,
|
|
70
|
+
isPopover,
|
|
71
|
+
popup,
|
|
72
|
+
popoverContent,
|
|
73
|
+
popverTitle,
|
|
74
|
+
...rest
|
|
75
|
+
}: TabsProps<V>) {
|
|
76
|
+
tabs = useMemo(() => tabs.filter((tab) => !tab.hide), [tabs])
|
|
69
77
|
const editableCard: boolean = type === 'editable-card'
|
|
70
78
|
|
|
71
79
|
const baseTabClassName = `gm-${full ? 'framework-full-' : ''}tabs`
|