@gm-mobile/c-react 3.9.6 → 3.9.7-beta.4
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-mobile/c-react",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.7-beta.4",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "liyatang <liyatang@qq.com>",
|
|
6
6
|
"homepage": "https://github.com/gmfe/gm-mobile#readme",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"url": "https://github.com/gmfe/gm-mobile/issues"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@gm-mobile/c-font": "^3.9.
|
|
25
|
-
"@gm-mobile/c-tool": "^3.9.
|
|
26
|
-
"@gm-mobile/locales": "^3.9.
|
|
24
|
+
"@gm-mobile/c-font": "^3.9.7-beta.4",
|
|
25
|
+
"@gm-mobile/c-tool": "^3.9.7-beta.4",
|
|
26
|
+
"@gm-mobile/locales": "^3.9.7-beta.4"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@tarojs/components": "3.0.18",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"prop-types": "^15.7.2",
|
|
34
34
|
"react": "^16.13.1"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "4424cdf414312317331f3c649cc6e5902257d5fb"
|
|
37
37
|
}
|
|
@@ -14,6 +14,7 @@ export const defaultDigitalKeys = [
|
|
|
14
14
|
...['1', '2', '3'].map((v, _) => new DKBtn({ label: v })),
|
|
15
15
|
...['4', '5', '6'].map((v, _) => new DKBtn({ label: v })),
|
|
16
16
|
...['7', '8', '9'].map((v, _) => new DKBtn({ label: v })),
|
|
17
|
+
new DKBtn({ label: '0' }),
|
|
17
18
|
new DKBtn({
|
|
18
19
|
label: '.',
|
|
19
20
|
fn: (value = '') => {
|
|
@@ -27,7 +28,6 @@ export const defaultDigitalKeys = [
|
|
|
27
28
|
}
|
|
28
29
|
},
|
|
29
30
|
}),
|
|
30
|
-
new DKBtn({ label: '0' }),
|
|
31
31
|
new DKBtn({ label: '清零', className: 'btn-clear', fn: (_) => '' }),
|
|
32
32
|
]
|
|
33
33
|
|
|
@@ -62,6 +62,7 @@ export interface KeyboardProps
|
|
|
62
62
|
show?: boolean
|
|
63
63
|
/** 整数类型键盘 */
|
|
64
64
|
int?: boolean
|
|
65
|
+
isClearBtn?: boolean
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
export const Keyboard: FC<KeyboardProps> = ({
|
|
@@ -72,6 +73,7 @@ export const Keyboard: FC<KeyboardProps> = ({
|
|
|
72
73
|
digitalKeys = defaultDigitalKeys,
|
|
73
74
|
show = true,
|
|
74
75
|
className,
|
|
76
|
+
isClearBtn = true,
|
|
75
77
|
int,
|
|
76
78
|
...rest
|
|
77
79
|
}) => {
|
|
@@ -104,27 +106,33 @@ export const Keyboard: FC<KeyboardProps> = ({
|
|
|
104
106
|
>
|
|
105
107
|
<Flex>
|
|
106
108
|
<Flex flex={3} wrap>
|
|
107
|
-
{digitalKeys
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
onClick={() => handleInput(btn)}
|
|
109
|
+
{digitalKeys
|
|
110
|
+
.filter((f) => (isClearBtn ? f : f.label !== '清零'))
|
|
111
|
+
.map((btn, i) => {
|
|
112
|
+
return (
|
|
113
|
+
<Flex
|
|
114
|
+
key={i}
|
|
115
|
+
width={
|
|
116
|
+
!isClearBtn && btn.label === '0'
|
|
117
|
+
? '66.666666%'
|
|
118
|
+
: '33.33333%'
|
|
119
|
+
}
|
|
120
|
+
alignCenter
|
|
121
|
+
justifyCenter
|
|
122
|
+
className='keyboard-item'
|
|
122
123
|
>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
<View
|
|
125
|
+
className={classNames(
|
|
126
|
+
'keyboard-button digital m-text-22',
|
|
127
|
+
btn.className
|
|
128
|
+
)}
|
|
129
|
+
onClick={() => handleInput(btn)}
|
|
130
|
+
>
|
|
131
|
+
{btn.label}
|
|
132
|
+
</View>
|
|
133
|
+
</Flex>
|
|
134
|
+
)
|
|
135
|
+
})}
|
|
128
136
|
</Flex>
|
|
129
137
|
<Flex flex={1} column>
|
|
130
138
|
{actionKeys.map((btn, keyIndex) => {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
}
|
|
15
15
|
.keyboard-item {
|
|
16
16
|
padding: 3.5px;
|
|
17
|
-
height:
|
|
17
|
+
height: 60px;
|
|
18
18
|
.keyboard-button {
|
|
19
19
|
display: flex;
|
|
20
20
|
font-family: DINPro-Medium, DINPro;
|
|
@@ -59,21 +59,19 @@
|
|
|
59
59
|
.bt-delete {
|
|
60
60
|
padding-right: 10px;
|
|
61
61
|
.square {
|
|
62
|
-
width:
|
|
63
|
-
height:
|
|
62
|
+
width: 20px;
|
|
63
|
+
height: 20px;
|
|
64
64
|
background: #000000;
|
|
65
65
|
border-bottom-right-radius: 2px;
|
|
66
66
|
border-top-right-radius: 2px;
|
|
67
|
-
|
|
68
|
-
border-bottom-left-radius: 3px;
|
|
67
|
+
padding-right: 2px;
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
.triangle {
|
|
72
71
|
width: 0;
|
|
73
72
|
height: 0;
|
|
74
|
-
border:
|
|
73
|
+
border: 10px solid;
|
|
75
74
|
border-color: transparent #000000 transparent transparent;
|
|
76
|
-
margin-right: -2px;
|
|
77
75
|
}
|
|
78
76
|
}
|
|
79
77
|
}
|