@aks-dev/easyui 1.2.15 → 1.2.16
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.
|
@@ -3,7 +3,7 @@ import React from "react";
|
|
|
3
3
|
export interface FlexPropsType {
|
|
4
4
|
direction?: "row" | "row-reverse" | "column" | "column-reverse";
|
|
5
5
|
wrap?: "nowrap" | "wrap" | "wrap-reverse";
|
|
6
|
-
justify?: "
|
|
6
|
+
justify?: "start" | "end" | "center" | "between" | "around" | "evenly";
|
|
7
7
|
align?: "flex-start" | "flex-end" | "center" | "baseline" | "stretch";
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
disabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../src/components/Antd/Flex.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,KAAK,GAAG,aAAa,GAAG,QAAQ,GAAG,gBAAgB,CAAC;IAChE,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,cAAc,CAAC;IAC1C,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../src/components/Antd/Flex.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,KAAK,GAAG,aAAa,GAAG,QAAQ,GAAG,gBAAgB,CAAC;IAChE,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,cAAc,CAAC;IAC1C,OAAO,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACvE,KAAK,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;IACtE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AACD,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAkBD,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,SAAS,qBA6B5C"}
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { TouchableOpacity, StyleSheet, } from "react-native";
|
|
2
2
|
import React from "react";
|
|
3
|
+
const justifyDict = {
|
|
4
|
+
start: "flex-start",
|
|
5
|
+
end: "flex-end",
|
|
6
|
+
center: "center",
|
|
7
|
+
between: "space-between",
|
|
8
|
+
round: "space-around",
|
|
9
|
+
evenly: "space-evenly",
|
|
10
|
+
};
|
|
11
|
+
const alignDict = {
|
|
12
|
+
start: "flex-start",
|
|
13
|
+
end: "flex-end",
|
|
14
|
+
center: "center",
|
|
15
|
+
baseline: "baseline",
|
|
16
|
+
stretch: "stretch",
|
|
17
|
+
};
|
|
3
18
|
// 自定义 Flex 组件
|
|
4
19
|
export default function Flex(props) {
|
|
5
20
|
const { direction, justify, align, wrap, style, children, activeOpacity = 1, ...rest } = props;
|
|
@@ -7,8 +22,8 @@ export default function Flex(props) {
|
|
|
7
22
|
styles.flex,
|
|
8
23
|
{
|
|
9
24
|
flexDirection: direction,
|
|
10
|
-
justifyContent: justify,
|
|
11
|
-
alignItems: align,
|
|
25
|
+
justifyContent: justify && justifyDict[justify],
|
|
26
|
+
alignItems: align && alignDict[align],
|
|
12
27
|
flexWrap: wrap,
|
|
13
28
|
},
|
|
14
29
|
style,
|