@gm-mobile/c-react 3.9.3-beta.29 → 3.9.3-beta.31

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.29",
3
+ "version": "3.9.3-beta.31",
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.29",
25
- "@gm-mobile/c-tool": "^3.9.3-beta.29",
26
- "@gm-mobile/locales": "^3.9.3-beta.29"
24
+ "@gm-mobile/c-font": "^3.9.3-beta.31",
25
+ "@gm-mobile/c-tool": "^3.9.3-beta.31",
26
+ "@gm-mobile/locales": "^3.9.3-beta.31"
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": "216ad1a8f7127b895838785f208455768b382ba2"
36
+ "gitHead": "d97c83cad805c300c6881dd4da5a856e61e57355"
37
37
  }
@@ -1,4 +1,10 @@
1
- import React, { FC, useState, ReactNode, useEffect } from 'react'
1
+ import React, {
2
+ FC,
3
+ useState,
4
+ ReactNode,
5
+ useEffect,
6
+ HTMLAttributes,
7
+ } from 'react'
2
8
  import _ from 'lodash'
3
9
  import { is } from '@gm-mobile/c-tool'
4
10
 
@@ -13,7 +19,10 @@ import {
13
19
 
14
20
  const cbMap: CBMapType = {}
15
21
 
16
- const LayoutRoot: FC & LayoutRootStatic = () => {
22
+ const LayoutRoot: FC<HTMLAttributes<HTMLDivElement>> & LayoutRootStatic = ({
23
+ style,
24
+ ...rest
25
+ }) => {
17
26
  const [state, setState] = useState<LayoutRootState>({})
18
27
  const path: string = getPath()
19
28
 
@@ -31,7 +40,15 @@ const LayoutRoot: FC & LayoutRootStatic = () => {
31
40
 
32
41
  // 有层级关系
33
42
  return (
34
- <View>
43
+ <View
44
+ style={{
45
+ ...style,
46
+ display: Object.keys(state).find((k) => !!state[k as 'popup'])
47
+ ? 'block'
48
+ : 'none',
49
+ }}
50
+ {...rest}
51
+ >
35
52
  {state.innerLayer}
36
53
  {state.popup}
37
54
  {state.picker}
@@ -1,4 +1,10 @@
1
- import React, { FC, useState, ReactNode, useEffect } from 'react'
1
+ import React, {
2
+ FC,
3
+ useState,
4
+ ReactNode,
5
+ useEffect,
6
+ HTMLAttributes,
7
+ } from 'react'
2
8
  import _ from 'lodash'
3
9
  import { is } from '@gm-mobile/c-tool'
4
10
 
@@ -16,7 +22,10 @@ const cbMap: CBMapV1Type = {}
16
22
  /**
17
23
  * @description: 目前仅用于Popup的多层弹窗
18
24
  */
19
- const LayoutRootV1: FC & LayoutV1RootStatic = () => {
25
+ const LayoutRootV1: FC<HTMLAttributes<HTMLDivElement>> & LayoutV1RootStatic = ({
26
+ style,
27
+ ...rest
28
+ }) => {
20
29
  const path = getPath()
21
30
  const [state, setState] = useState<LayoutRootState>({})
22
31
 
@@ -52,7 +61,13 @@ const LayoutRootV1: FC & LayoutV1RootStatic = () => {
52
61
 
53
62
  // 有层级关系
54
63
  return (
55
- <View>
64
+ <View
65
+ style={{
66
+ ...style,
67
+ display: state.popup && state.popup.length > 0 ? 'block' : 'none',
68
+ }}
69
+ {...rest}
70
+ >
56
71
  {/* {state.innerLayer} */}
57
72
  {state.popup}
58
73
  {/* {state.modal}
@@ -329,3 +329,7 @@ export class TextField extends Component<TextFieldProps, TextFieldState> {
329
329
  }
330
330
 
331
331
  export default TextField
332
+
333
+ export function AutoPreview_TextField() {
334
+ return <TextField value='test' onChange={() => {}} />
335
+ }