@gm-mobile/c-react 3.9.3-beta.17 → 3.9.3-beta.20
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-beta.
|
|
3
|
+
"version": "3.9.3-beta.20",
|
|
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.3-beta.
|
|
25
|
-
"@gm-mobile/c-tool": "^3.9.3-beta.
|
|
26
|
-
"@gm-mobile/locales": "^3.9.3-beta.
|
|
24
|
+
"@gm-mobile/c-font": "^3.9.3-beta.20",
|
|
25
|
+
"@gm-mobile/c-tool": "^3.9.3-beta.20",
|
|
26
|
+
"@gm-mobile/locales": "^3.9.3-beta.20"
|
|
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": "257d61e68ef1a76de48d9202a1a7b3c95c656f9d"
|
|
37
37
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react'
|
|
2
2
|
import { Flex, Popup, View, Button } from '../../..'
|
|
3
3
|
import { noop } from 'lodash'
|
|
4
|
+
import './base.less'
|
|
4
5
|
|
|
5
6
|
interface Option<T> {
|
|
6
7
|
title: ReactNode
|
|
@@ -54,7 +55,11 @@ export function showDialog<T>({
|
|
|
54
55
|
const Template = () => {
|
|
55
56
|
return (
|
|
56
57
|
<Flex column className='m-border-radius m-overflow-hidden m-bg-white'>
|
|
57
|
-
<Flex
|
|
58
|
+
<Flex
|
|
59
|
+
justifyBetween
|
|
60
|
+
alignCenter
|
|
61
|
+
className='m-customer-dialog-header m-padding-10'
|
|
62
|
+
>
|
|
58
63
|
<Flex flex>{left}</Flex>
|
|
59
64
|
<Flex
|
|
60
65
|
flex
|
|
@@ -68,7 +73,6 @@ export function showDialog<T>({
|
|
|
68
73
|
<Button
|
|
69
74
|
mini
|
|
70
75
|
plain
|
|
71
|
-
noRound
|
|
72
76
|
type='link'
|
|
73
77
|
className='m-text-desc m-margin-lr-0'
|
|
74
78
|
onClick={cancel}
|
|
@@ -81,7 +85,7 @@ export function showDialog<T>({
|
|
|
81
85
|
{children}
|
|
82
86
|
{bottom || (
|
|
83
87
|
<Flex className='m-padding-lr-10'>
|
|
84
|
-
<Button block
|
|
88
|
+
<Button block type='primary' onClick={() => ok()}>
|
|
85
89
|
{okText}
|
|
86
90
|
</Button>
|
|
87
91
|
</Flex>
|
|
@@ -94,7 +98,7 @@ export function showDialog<T>({
|
|
|
94
98
|
disabledHeader: true,
|
|
95
99
|
[direction]: true,
|
|
96
100
|
disabledAnimate: false,
|
|
97
|
-
onHide:
|
|
101
|
+
onHide: cancel,
|
|
98
102
|
children: <Template />,
|
|
99
103
|
})
|
|
100
104
|
})
|
|
@@ -24,6 +24,7 @@ export interface ChooseProps {
|
|
|
24
24
|
/** 搜索功能 */
|
|
25
25
|
// search?: boolean
|
|
26
26
|
maxHeight?: string
|
|
27
|
+
onCancel?: () => void
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
/** 底部弹出的选择界面 */
|
|
@@ -34,6 +35,7 @@ export default function ({
|
|
|
34
35
|
multiSelect = false,
|
|
35
36
|
defaultSelected = [],
|
|
36
37
|
maxHeight = '50vh',
|
|
38
|
+
onCancel,
|
|
37
39
|
}: ChooseProps) {
|
|
38
40
|
if (multiSelect) needConfirm = true
|
|
39
41
|
const selected = [...defaultSelected] as Item[]
|
|
@@ -93,6 +95,7 @@ export default function ({
|
|
|
93
95
|
title,
|
|
94
96
|
children: <Children />,
|
|
95
97
|
onOk: () => selected,
|
|
98
|
+
onCancel: onCancel,
|
|
96
99
|
bottom: needConfirm ? undefined : <View />,
|
|
97
100
|
})
|
|
98
101
|
return promise
|
|
@@ -94,7 +94,6 @@ export class TextField extends Component<TextFieldProps, TextFieldState> {
|
|
|
94
94
|
!value.endsWith('.') &&
|
|
95
95
|
['digit', 'number'].includes(this.props.type || '')
|
|
96
96
|
) {
|
|
97
|
-
console.log(value)
|
|
98
97
|
const float = parseFloat(value.replace(/\D\./g, ''))
|
|
99
98
|
if (isNaN(float)) {
|
|
100
99
|
value = ''
|