@umituz/react-native-design-system 4.25.67 → 4.25.68
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": "@umituz/react-native-design-system",
|
|
3
|
-
"version": "4.25.
|
|
3
|
+
"version": "4.25.68",
|
|
4
4
|
"description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive, safe area, exception, infinite scroll, UUID, image, timezone, offline, onboarding, and loading utilities",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -43,7 +43,7 @@ export class ValidationManager {
|
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
// Custom validator
|
|
46
|
+
// Custom validator (for types not covered by switch, e.g. default)
|
|
47
47
|
if (validation.customValidator) {
|
|
48
48
|
const customResult = validation.customValidator(answer);
|
|
49
49
|
return customResult === true;
|
|
@@ -85,10 +85,20 @@ export class ValidationManager {
|
|
|
85
85
|
): boolean {
|
|
86
86
|
if (!validation) return true;
|
|
87
87
|
|
|
88
|
+
// If no answer yet (undefined/null), valid only when not required
|
|
89
|
+
if (answer === undefined || answer === null) {
|
|
90
|
+
return !validation.required;
|
|
91
|
+
}
|
|
92
|
+
|
|
88
93
|
if (typeof answer !== "string") {
|
|
89
94
|
return false;
|
|
90
95
|
}
|
|
91
96
|
|
|
97
|
+
// Empty string: valid only when not required
|
|
98
|
+
if (!answer.trim() && validation.required) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
|
|
92
102
|
if (validation.minLength && answer.length < validation.minLength) {
|
|
93
103
|
return false;
|
|
94
104
|
}
|
|
@@ -97,6 +107,12 @@ export class ValidationManager {
|
|
|
97
107
|
return false;
|
|
98
108
|
}
|
|
99
109
|
|
|
110
|
+
// Run custom validator if provided
|
|
111
|
+
if (validation.customValidator) {
|
|
112
|
+
const customResult = validation.customValidator(answer);
|
|
113
|
+
return customResult === true;
|
|
114
|
+
}
|
|
115
|
+
|
|
100
116
|
return true;
|
|
101
117
|
}
|
|
102
118
|
|
|
@@ -16,19 +16,21 @@ export const QuestionSlideHeader = ({ slide }: QuestionSlideHeaderProps) => {
|
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
18
|
<View style={styles.container}>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
{!slide.hideIcon && (
|
|
20
|
+
<View style={[
|
|
21
|
+
styles.iconContainer,
|
|
22
|
+
{
|
|
23
|
+
backgroundColor: colors.iconBg,
|
|
24
|
+
borderColor: colors.iconBorder,
|
|
25
|
+
}
|
|
26
|
+
]}>
|
|
27
|
+
{isEmoji ? (
|
|
28
|
+
<AtomicText style={{ fontSize: 48 }}>{slide.icon}</AtomicText>
|
|
29
|
+
) : (
|
|
30
|
+
<AtomicIcon name={slide.icon} customSize={48} customColor={colors.textColor} />
|
|
31
|
+
)}
|
|
32
|
+
</View>
|
|
33
|
+
)}
|
|
32
34
|
|
|
33
35
|
<AtomicText type="headlineMedium" style={[styles.title, { color: colors.textColor }]}>
|
|
34
36
|
{slide.title}
|