@carefrees/form-utils-react-native 0.0.15 → 0.0.17

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.
@@ -23,6 +23,8 @@ export interface FormLayoutProps extends AttrsOptions {
23
23
  * @description gap 属性是用来设置网格行与列之间的间隙,该属性是row-gap and column-gap的简写形式。
24
24
  */
25
25
  gap?: string | number;
26
+ /**是否添加输入框边框*/
27
+ inputBordered?: boolean;
26
28
  }
27
29
  /**布局组件*/
28
30
  export declare const FormLayout: React.MemoExoticComponent<(props: FormLayoutProps) => import("react/jsx-runtime").JSX.Element>;
@@ -4,8 +4,8 @@ import { AttrsContext, useAttrs } from "../hooks/useAttrs.js";
4
4
  import { Text, View } from "react-native";
5
5
  import { StylesBase } from "../styles/index.js";
6
6
  const FormLayout = /*#__PURE__*/ memo((props)=>{
7
- const { colCount: p_colCount = 4, errorLayout: p_errorLayout = 'left-bottom', labelMode: p_labelMode = 'left', showColon: p_showColon = true, formItemStyle: p_formItemStyle, formItemLabelStyle: p_formItemLabelStyle } = useAttrs();
8
- const { colCount = p_colCount, title, extra, children, isAllColSpan, style, headerStyle, bodyStyle, errorLayout = p_errorLayout, labelMode = p_labelMode, showColon = p_showColon, formItemStyle = p_formItemStyle, formItemLabelStyle = p_formItemLabelStyle, bordered = false, gap } = props;
7
+ const { colCount: p_colCount = 4, errorLayout: p_errorLayout = 'left-bottom', labelMode: p_labelMode = 'left', showColon: p_showColon = true, formItemStyle: p_formItemStyle, formItemLabelStyle: p_formItemLabelStyle, inputBordered: p_inputBordered } = useAttrs();
8
+ const { colCount = p_colCount, title, extra, children, isAllColSpan, style, headerStyle, bodyStyle, errorLayout = p_errorLayout, labelMode = p_labelMode, showColon = p_showColon, formItemStyle = p_formItemStyle, formItemLabelStyle = p_formItemLabelStyle, bordered = false, gap, inputBordered = p_inputBordered } = props;
9
9
  const propsRef = useRef(props);
10
10
  propsRef.current = props;
11
11
  const value = useMemo(()=>({
@@ -14,14 +14,16 @@ const FormLayout = /*#__PURE__*/ memo((props)=>{
14
14
  labelMode,
15
15
  showColon,
16
16
  formItemStyle,
17
- formItemLabelStyle
17
+ formItemLabelStyle,
18
+ inputBordered
18
19
  }), [
19
20
  colCount,
20
21
  errorLayout,
21
22
  labelMode,
22
23
  showColon,
23
24
  formItemStyle,
24
- formItemLabelStyle
25
+ formItemLabelStyle,
26
+ inputBordered
25
27
  ]);
26
28
  const styleBase = useMemo(()=>{
27
29
  const css = {};
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "author": "SunLxy <1011771396@qq.com>",
4
4
  "description": "react-native 表单组件",
5
5
  "homepage": "https://github.com/SunLxy/carefrees-form-utils",
6
- "version": "0.0.15",
6
+ "version": "0.0.17",
7
7
  "main": "esm/index.js",
8
8
  "types": "esm/index.d.ts",
9
9
  "module": "esm/index.js",
@@ -24,12 +24,12 @@
24
24
  "esm"
25
25
  ],
26
26
  "dependencies": {
27
- "@carefrees/form-utils": "^0.0.15",
28
- "@carefrees/form-utils-react-hooks": "^0.0.15"
27
+ "@carefrees/form-utils": "^0.0.17",
28
+ "@carefrees/form-utils-react-hooks": "^0.0.17"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/react": "18.2.21",
32
32
  "react": "^18.2.0",
33
33
  "react-native": "0.76.9"
34
34
  }
35
- }
35
+ }
@@ -25,6 +25,8 @@ export interface FormLayoutProps extends AttrsOptions {
25
25
  * @description gap 属性是用来设置网格行与列之间的间隙,该属性是row-gap and column-gap的简写形式。
26
26
  */
27
27
  gap?: string | number;
28
+ /**是否添加输入框边框*/
29
+ inputBordered?: boolean;
28
30
  }
29
31
 
30
32
  /**布局组件*/
@@ -36,6 +38,7 @@ export const FormLayout = memo((props: FormLayoutProps) => {
36
38
  showColon: p_showColon = true,
37
39
  formItemStyle: p_formItemStyle,
38
40
  formItemLabelStyle: p_formItemLabelStyle,
41
+ inputBordered: p_inputBordered,
39
42
  } = useAttrs();
40
43
  const {
41
44
  colCount = p_colCount,
@@ -53,6 +56,7 @@ export const FormLayout = memo((props: FormLayoutProps) => {
53
56
  formItemLabelStyle = p_formItemLabelStyle,
54
57
  bordered = false,
55
58
  gap,
59
+ inputBordered = p_inputBordered,
56
60
  } = props;
57
61
  const propsRef = useRef(props);
58
62
  propsRef.current = props;
@@ -65,8 +69,9 @@ export const FormLayout = memo((props: FormLayoutProps) => {
65
69
  showColon,
66
70
  formItemStyle,
67
71
  formItemLabelStyle,
72
+ inputBordered,
68
73
  };
69
- }, [colCount, errorLayout, labelMode, showColon, formItemStyle, formItemLabelStyle]);
74
+ }, [colCount, errorLayout, labelMode, showColon, formItemStyle, formItemLabelStyle, inputBordered]);
70
75
 
71
76
  const styleBase = useMemo(() => {
72
77
  const css: ViewProps['style'] = {};