@gm-mobile/c-react 3.9.6-beta.2 → 3.9.7-beta.2

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.6-beta.2",
3
+ "version": "3.9.7-beta.2",
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.6-beta.2",
25
- "@gm-mobile/c-tool": "^3.9.6-beta.2",
26
- "@gm-mobile/locales": "^3.9.6-beta.2"
24
+ "@gm-mobile/c-font": "^3.9.7-beta.2",
25
+ "@gm-mobile/c-tool": "^3.9.7-beta.2",
26
+ "@gm-mobile/locales": "^3.9.7-beta.2"
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": "6017ff553c0db37b691ec6bcfc00c226b96ecf48"
36
+ "gitHead": "47401ab0f5c303c3dc2aafcec9ad03ff500beb11"
37
37
  }
@@ -28,13 +28,7 @@ export const defaultDigitalKeys = [
28
28
  }
29
29
  },
30
30
  }),
31
- new DKBtn({
32
- className: 'iconfont icon-backspace',
33
- fn: (value) => {
34
- if (value.length === 0) return value
35
- return value.slice(0, value.length - 1)
36
- },
37
- }),
31
+ new DKBtn({ label: '清零', className: 'btn-clear', fn: (_) => '' }),
38
32
  ]
39
33
 
40
34
  /** 右侧功能按钮 */
@@ -68,6 +62,7 @@ export interface KeyboardProps
68
62
  show?: boolean
69
63
  /** 整数类型键盘 */
70
64
  int?: boolean
65
+ isClearBtn?: boolean
71
66
  }
72
67
 
73
68
  export const Keyboard: FC<KeyboardProps> = ({
@@ -78,6 +73,7 @@ export const Keyboard: FC<KeyboardProps> = ({
78
73
  digitalKeys = defaultDigitalKeys,
79
74
  show = true,
80
75
  className,
76
+ isClearBtn = true,
81
77
  int,
82
78
  ...rest
83
79
  }) => {
@@ -110,27 +106,33 @@ export const Keyboard: FC<KeyboardProps> = ({
110
106
  >
111
107
  <Flex>
112
108
  <Flex flex={3} wrap>
113
- {digitalKeys.map((btn, i) => {
114
- return (
115
- <Flex
116
- key={i}
117
- width='33.33333%'
118
- alignCenter
119
- justifyCenter
120
- className='keyboard-item'
121
- >
122
- <View
123
- className={classNames(
124
- 'keyboard-button digital m-text-20',
125
- btn.className
126
- )}
127
- 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'
128
123
  >
129
- {btn.label}
130
- </View>
131
- </Flex>
132
- )
133
- })}
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
+ })}
134
136
  </Flex>
135
137
  <Flex flex={1} column>
136
138
  {actionKeys.map((btn, keyIndex) => {
@@ -150,7 +152,20 @@ export const Keyboard: FC<KeyboardProps> = ({
150
152
  )}
151
153
  onClick={() => handleInput(btn)}
152
154
  >
153
- {btn.label}
155
+ {btn.label ? (
156
+ btn.label
157
+ ) : (
158
+ <Flex alignCenter justifyCenter className='bt-delete'>
159
+ <View className='triangle' />
160
+ <Flex
161
+ alignCenter
162
+ justifyCenter
163
+ className='m-text-14 m-text-white square'
164
+ >
165
+ x
166
+ </Flex>
167
+ </Flex>
168
+ )}
154
169
  </View>
155
170
  </Flex>
156
171
  )
@@ -1,5 +1,5 @@
1
1
  .keyboard {
2
- @background: darken(white, 3);
2
+ @background: darken(white, 8);
3
3
  @btn: white;
4
4
  @text: black;
5
5
  background-color: @background;
@@ -13,17 +13,18 @@
13
13
  top: 0;
14
14
  }
15
15
  .keyboard-item {
16
- padding: 3px;
16
+ padding: 3.5px;
17
17
  height: 60px;
18
18
  .keyboard-button {
19
19
  display: flex;
20
+ font-family: DINPro-Medium, DINPro;
20
21
  justify-content: center;
21
22
  align-items: center;
22
23
  width: 100%;
23
24
  height: 100%;
24
25
  color: @text;
25
- // font-weight: bold;
26
- border-radius: 5px;
26
+ font-weight: bold;
27
+ border-radius: 4px;
27
28
  background-color: @btn;
28
29
  overflow: hidden;
29
30
  cursor: pointer;
@@ -45,5 +46,33 @@
45
46
  }
46
47
  }
47
48
  }
49
+
50
+ .btn-ok {
51
+ background-color: #06C160;
52
+ }
53
+
54
+ .btn-clear {
55
+ font-size: 15px !important;
56
+ font-weight: 500;
57
+ }
58
+
59
+ .bt-delete {
60
+ padding-right: 10px;
61
+ .square {
62
+ width: 20px;
63
+ height: 20px;
64
+ background: #000000;
65
+ border-bottom-right-radius: 2px;
66
+ border-top-right-radius: 2px;
67
+ padding-right: 2px;
68
+ }
69
+
70
+ .triangle {
71
+ width: 0;
72
+ height: 0;
73
+ border: 10px solid;
74
+ border-color: transparent #000000 transparent transparent;
75
+ }
76
+ }
48
77
  }
49
78
  }
@@ -165,19 +165,26 @@ export class DigitalKeyboard {
165
165
  /** 自定义功能按钮 */
166
166
  get actionKeys() {
167
167
  return [
168
- new DKBtn({ label: '清零', fn: (_) => '' }),
168
+ new DKBtn({
169
+ label: '',
170
+ // className: 'iconfont icon-backspace m-text-26',
171
+ fn: (value) => {
172
+ if (value.length === 0) return value
173
+ return value.slice(0, value.length - 1)
174
+ },
175
+ }),
169
176
  new DKBtn({
170
177
  label: '下一个',
171
- className: 'm-bg-primary m-text-white',
178
+ className: 'm-text-black btn-clear',
172
179
  fn: (value) => {
173
180
  this.next()
174
181
  return this.form[this.active]
175
182
  },
176
183
  }),
177
184
  new DKBtn({
178
- label: '确认',
185
+ label: '确定',
179
186
  flex: 2,
180
- className: 'm-bg-primary m-text-white',
187
+ className: 'btn-ok m-text-white',
181
188
  fn: (value) => {
182
189
  return this.form[this.active]
183
190
  },