@towsila/expo-ui-library 1.5.8 → 1.5.11

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": "@towsila/expo-ui-library",
3
- "version": "1.5.8",
3
+ "version": "1.5.11",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -21,10 +21,8 @@ interface Props {
21
21
  function splitIntoSteps(fields: Field[]): Field[][] {
22
22
  const info = fields.filter((f) => f.type !== "password");
23
23
  const security = fields.filter((f) => f.type === "password");
24
-
25
24
  const steps: Field[][] = [];
26
25
 
27
- // Split info fields if more than 3
28
26
  if (info.length > 4) {
29
27
  const mid = Math.ceil(info.length / 2);
30
28
  steps.push(info.slice(0, mid));
@@ -104,11 +102,6 @@ export const DynamicForm: React.FC<Props> = ({
104
102
  );
105
103
 
106
104
  return (
107
- <ScrollView
108
- contentContainerStyle={{ flexGrow: 1 }}
109
- showsVerticalScrollIndicator={false}
110
- bounces={false}
111
- >
112
105
  <View style={{ gap: 4, paddingBottom: 20 }}>
113
106
 
114
107
  {/* Stepper — only show if more than 1 step */}
@@ -159,6 +152,5 @@ export const DynamicForm: React.FC<Props> = ({
159
152
  </View>
160
153
  )}
161
154
  </View>
162
- </ScrollView>
163
155
  );
164
156
  };
@@ -17,11 +17,26 @@ interface Props {
17
17
  nextLabel?: string;
18
18
  backLabel?: string;
19
19
  }
20
- // can i split it into 2 not only move the password if the number of fields is > 4
20
+
21
21
  function splitIntoSteps(fields: Field[]): Field[][] {
22
22
  const info = fields.filter((f) => f.type !== "password");
23
23
  const security = fields.filter((f) => f.type === "password");
24
- return [info, security].filter((s) => s.length > 0);
24
+ const steps: Field[][] = [];
25
+
26
+ if (info.length > 4) {
27
+ const mid = Math.ceil(info.length / 2);
28
+ steps.push(info.slice(0, mid));
29
+ steps.push(info.slice(mid));
30
+ } else if (info.length > 0) {
31
+ steps.push(info);
32
+ }
33
+
34
+ // Add security fields as separate step
35
+ if (security.length > 0) {
36
+ steps.push(security);
37
+ }
38
+
39
+ return steps;
25
40
  }
26
41
 
27
42
  export const SharpDynamicForm: React.FC<Props> = ({