@fovestta2/mobile-react-native 1.0.1
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/dist/components/FvCheckbox.d.ts +14 -0
- package/dist/components/FvCheckbox.d.ts.map +1 -0
- package/dist/components/FvCheckbox.js +73 -0
- package/dist/components/FvCheckbox.js.map +1 -0
- package/dist/components/FvDateField.d.ts +22 -0
- package/dist/components/FvDateField.d.ts.map +1 -0
- package/dist/components/FvDateField.js +117 -0
- package/dist/components/FvDateField.js.map +1 -0
- package/dist/components/FvDropdown.d.ts +25 -0
- package/dist/components/FvDropdown.d.ts.map +1 -0
- package/dist/components/FvDropdown.js +213 -0
- package/dist/components/FvDropdown.js.map +1 -0
- package/dist/components/FvEntryField.d.ts +21 -0
- package/dist/components/FvEntryField.d.ts.map +1 -0
- package/dist/components/FvEntryField.js +124 -0
- package/dist/components/FvEntryField.js.map +1 -0
- package/dist/components/FvFileSelector.d.ts +28 -0
- package/dist/components/FvFileSelector.d.ts.map +1 -0
- package/dist/components/FvFileSelector.js +205 -0
- package/dist/components/FvFileSelector.js.map +1 -0
- package/dist/components/FvImageSelector.d.ts +32 -0
- package/dist/components/FvImageSelector.d.ts.map +1 -0
- package/dist/components/FvImageSelector.js +268 -0
- package/dist/components/FvImageSelector.js.map +1 -0
- package/dist/components/FvMonthYearField.d.ts +22 -0
- package/dist/components/FvMonthYearField.d.ts.map +1 -0
- package/dist/components/FvMonthYearField.js +115 -0
- package/dist/components/FvMonthYearField.js.map +1 -0
- package/dist/components/FvNumberField.d.ts +23 -0
- package/dist/components/FvNumberField.d.ts.map +1 -0
- package/dist/components/FvNumberField.js +140 -0
- package/dist/components/FvNumberField.js.map +1 -0
- package/dist/components/FvRadioGroup.d.ts +20 -0
- package/dist/components/FvRadioGroup.d.ts.map +1 -0
- package/dist/components/FvRadioGroup.js +95 -0
- package/dist/components/FvRadioGroup.js.map +1 -0
- package/dist/components/FvRichTextEditor.d.ts +25 -0
- package/dist/components/FvRichTextEditor.d.ts.map +1 -0
- package/dist/components/FvRichTextEditor.js +246 -0
- package/dist/components/FvRichTextEditor.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.FvMonthYearField = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const react_native_1 = require("react-native");
|
|
29
|
+
const validation_engine_1 = require("@fovestta2/validation-engine");
|
|
30
|
+
const FvMonthYearField = ({ label, placeholder = "YYYY-MM", value, schema, disabled = false, readonly = false, onChange, onBlur, onFocus, containerStyle, inputStyle, labelStyle, errorStyle, }) => {
|
|
31
|
+
const [errorMessage, setErrorMessage] = (0, react_1.useState)(null);
|
|
32
|
+
(0, react_1.useEffect)(() => {
|
|
33
|
+
if (schema) {
|
|
34
|
+
const result = validation_engine_1.Validator.validate(value, schema);
|
|
35
|
+
setErrorMessage(result.errorKey);
|
|
36
|
+
}
|
|
37
|
+
}, [value, schema]);
|
|
38
|
+
const handleChange = (text) => {
|
|
39
|
+
onChange(text);
|
|
40
|
+
};
|
|
41
|
+
const handleBlur = () => {
|
|
42
|
+
onBlur?.();
|
|
43
|
+
};
|
|
44
|
+
const getErrorMessage = () => {
|
|
45
|
+
if (!errorMessage)
|
|
46
|
+
return "";
|
|
47
|
+
const errorMessages = {
|
|
48
|
+
ERR_REQUIRED: "Month/Year is required",
|
|
49
|
+
ERR_MIN_DATE: "Date is too early",
|
|
50
|
+
ERR_MAX_DATE: "Date is too late",
|
|
51
|
+
};
|
|
52
|
+
return errorMessages[errorMessage] || errorMessage;
|
|
53
|
+
};
|
|
54
|
+
const isRequired = schema?.rules?.some((r) => r.name === "required" && r.params?.enabled);
|
|
55
|
+
return (<react_native_1.View style={[styles.container, containerStyle]}>
|
|
56
|
+
{label && (<react_native_1.View style={styles.labelContainer}>
|
|
57
|
+
<react_native_1.Text style={[styles.label, labelStyle]}>
|
|
58
|
+
{label}
|
|
59
|
+
{isRequired && <react_native_1.Text style={styles.requiredAsterisk}> *</react_native_1.Text>}
|
|
60
|
+
</react_native_1.Text>
|
|
61
|
+
</react_native_1.View>)}
|
|
62
|
+
|
|
63
|
+
<react_native_1.TextInput style={[
|
|
64
|
+
styles.input,
|
|
65
|
+
errorMessage && styles.inputError,
|
|
66
|
+
disabled && styles.inputDisabled,
|
|
67
|
+
inputStyle,
|
|
68
|
+
]} value={value} placeholder={placeholder} onChangeText={handleChange} onBlur={handleBlur} onFocus={onFocus} editable={!disabled && !readonly} placeholderTextColor="#999999"/>
|
|
69
|
+
|
|
70
|
+
{errorMessage && (<react_native_1.Text style={[styles.errorText, errorStyle]}>
|
|
71
|
+
⚠ {getErrorMessage()}
|
|
72
|
+
</react_native_1.Text>)}
|
|
73
|
+
</react_native_1.View>);
|
|
74
|
+
};
|
|
75
|
+
exports.FvMonthYearField = FvMonthYearField;
|
|
76
|
+
const styles = react_native_1.StyleSheet.create({
|
|
77
|
+
container: {
|
|
78
|
+
marginBottom: 16,
|
|
79
|
+
width: "100%",
|
|
80
|
+
},
|
|
81
|
+
labelContainer: {
|
|
82
|
+
marginBottom: 6,
|
|
83
|
+
},
|
|
84
|
+
label: {
|
|
85
|
+
fontSize: 14,
|
|
86
|
+
fontWeight: "500",
|
|
87
|
+
color: "#333333",
|
|
88
|
+
},
|
|
89
|
+
requiredAsterisk: {
|
|
90
|
+
color: "#dc3545",
|
|
91
|
+
fontWeight: "bold",
|
|
92
|
+
},
|
|
93
|
+
input: {
|
|
94
|
+
padding: 10,
|
|
95
|
+
borderWidth: 1,
|
|
96
|
+
borderColor: "#cccccc",
|
|
97
|
+
borderRadius: 4,
|
|
98
|
+
fontSize: 14,
|
|
99
|
+
backgroundColor: "#ffffff",
|
|
100
|
+
color: "#333333",
|
|
101
|
+
},
|
|
102
|
+
inputError: {
|
|
103
|
+
borderColor: "#dc3545",
|
|
104
|
+
},
|
|
105
|
+
inputDisabled: {
|
|
106
|
+
backgroundColor: "#f5f5f5",
|
|
107
|
+
opacity: 0.6,
|
|
108
|
+
},
|
|
109
|
+
errorText: {
|
|
110
|
+
marginTop: 4,
|
|
111
|
+
fontSize: 12,
|
|
112
|
+
color: "#dc3545",
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
//# sourceMappingURL=FvMonthYearField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FvMonthYearField.js","sourceRoot":"","sources":["../../src/components/FvMonthYearField.tsx"],"names":[],"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AAI,CAAC,CACV,CAAC;AACN,CAAC,CAAC;AAlFW,QAAA,gBAAgB,oBAkF3B;AAEF,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC7B,SAAS,EAAE;QACP,YAAY,EAAE,EAAE;QAChB,KAAK,EAAE,MAAM;KAChB;IACD,cAAc,EAAE;QACZ,YAAY,EAAE,CAAC;KAClB;IACD,KAAK,EAAE;QACH,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,SAAS;KACnB;IACD,gBAAgB,EAAE;QACd,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,MAAM;KACrB;IACD,KAAK,EAAE;QACH,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,SAAS;QACtB,YAAY,EAAE,CAAC;QACf,QAAQ,EAAE,EAAE;QACZ,eAAe,EAAE,SAAS;QAC1B,KAAK,EAAE,SAAS;KACnB;IACD,UAAU,EAAE;QACR,WAAW,EAAE,SAAS;KACzB;IACD,aAAa,EAAE;QACX,eAAe,EAAE,SAAS;QAC1B,OAAO,EAAE,GAAG;KACf;IACD,SAAS,EAAE;QACP,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,SAAS;KACnB;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ViewStyle, TextStyle } from "react-native";
|
|
3
|
+
import { ValidationSchema } from "@fovestta2/validation-engine";
|
|
4
|
+
export interface FvNumberFieldProps {
|
|
5
|
+
label?: string;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
value: string | number;
|
|
8
|
+
schema?: ValidationSchema;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
readonly?: boolean;
|
|
11
|
+
min?: number;
|
|
12
|
+
max?: number;
|
|
13
|
+
step?: number;
|
|
14
|
+
onChange: (value: string) => void;
|
|
15
|
+
onBlur?: () => void;
|
|
16
|
+
onFocus?: () => void;
|
|
17
|
+
containerStyle?: ViewStyle;
|
|
18
|
+
inputStyle?: TextStyle;
|
|
19
|
+
labelStyle?: TextStyle;
|
|
20
|
+
errorStyle?: TextStyle;
|
|
21
|
+
}
|
|
22
|
+
export declare const FvNumberField: React.FC<FvNumberFieldProps>;
|
|
23
|
+
//# sourceMappingURL=FvNumberField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FvNumberField.d.ts","sourceRoot":"","sources":["../../src/components/FvNumberField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAMH,SAAS,EACT,SAAS,EACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAa,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAE3E,MAAM,WAAW,kBAAkB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE,SAAS,CAAC;CAC1B;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAiHtD,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.FvNumberField = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const react_native_1 = require("react-native");
|
|
29
|
+
const validation_engine_1 = require("@fovestta2/validation-engine");
|
|
30
|
+
const FvNumberField = ({ label, placeholder, value, schema, disabled = false, readonly = false, onChange, onBlur, onFocus, containerStyle, inputStyle, labelStyle, errorStyle, }) => {
|
|
31
|
+
const [errorMessage, setErrorMessage] = (0, react_1.useState)(null);
|
|
32
|
+
const stringValue = value !== undefined && value !== null ? String(value) : "";
|
|
33
|
+
(0, react_1.useEffect)(() => {
|
|
34
|
+
if (schema) {
|
|
35
|
+
const result = validation_engine_1.Validator.validate(stringValue, schema);
|
|
36
|
+
setErrorMessage(result.errorKey);
|
|
37
|
+
}
|
|
38
|
+
}, [stringValue, schema]);
|
|
39
|
+
const handleChange = (text) => {
|
|
40
|
+
// Extract numeric rule params from schema to determine what to allow
|
|
41
|
+
const numericRule = schema?.rules?.find(r => r.name === 'numeric');
|
|
42
|
+
const allowDecimals = numericRule?.params?.allowDecimals ?? true;
|
|
43
|
+
const allowNegative = numericRule?.params?.allowNegative ?? true;
|
|
44
|
+
// If empty, allow it
|
|
45
|
+
if (text === '') {
|
|
46
|
+
onChange(text);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
// Build regex pattern based on what's allowed
|
|
50
|
+
let pattern = '^';
|
|
51
|
+
if (allowNegative) {
|
|
52
|
+
pattern += '-?';
|
|
53
|
+
}
|
|
54
|
+
pattern += '\\d*';
|
|
55
|
+
if (allowDecimals) {
|
|
56
|
+
pattern += '(\\.\\d*)?';
|
|
57
|
+
}
|
|
58
|
+
pattern += '$';
|
|
59
|
+
const regex = new RegExp(pattern);
|
|
60
|
+
// Only update if the text matches the allowed pattern
|
|
61
|
+
if (regex.test(text)) {
|
|
62
|
+
onChange(text);
|
|
63
|
+
}
|
|
64
|
+
// Otherwise, ignore the input (don't call onChange)
|
|
65
|
+
};
|
|
66
|
+
const handleBlur = () => {
|
|
67
|
+
onBlur?.();
|
|
68
|
+
};
|
|
69
|
+
const getErrorMessage = () => {
|
|
70
|
+
if (!errorMessage)
|
|
71
|
+
return "";
|
|
72
|
+
const errorMessages = {
|
|
73
|
+
ERR_REQUIRED: "This field is required",
|
|
74
|
+
ERR_NUMERIC_INVALID: "Please enter a valid number",
|
|
75
|
+
ERR_RANGE_INVALID: "Number is out of range",
|
|
76
|
+
};
|
|
77
|
+
return errorMessages[errorMessage] || errorMessage;
|
|
78
|
+
};
|
|
79
|
+
const isRequired = schema?.rules?.some((r) => r.name === "required" && r.params?.enabled);
|
|
80
|
+
return (<react_native_1.View style={[styles.container, containerStyle]}>
|
|
81
|
+
{label && (<react_native_1.View style={styles.labelContainer}>
|
|
82
|
+
<react_native_1.Text style={[styles.label, labelStyle]}>
|
|
83
|
+
{label}
|
|
84
|
+
{isRequired && <react_native_1.Text style={styles.requiredAsterisk}> *</react_native_1.Text>}
|
|
85
|
+
</react_native_1.Text>
|
|
86
|
+
</react_native_1.View>)}
|
|
87
|
+
|
|
88
|
+
<react_native_1.TextInput style={[
|
|
89
|
+
styles.input,
|
|
90
|
+
errorMessage && styles.inputError,
|
|
91
|
+
disabled && styles.inputDisabled,
|
|
92
|
+
inputStyle,
|
|
93
|
+
]} value={stringValue} placeholder={placeholder} onChangeText={handleChange} onBlur={handleBlur} onFocus={onFocus} editable={!disabled && !readonly} keyboardType="numeric" placeholderTextColor="#999999"/>
|
|
94
|
+
|
|
95
|
+
{errorMessage && (<react_native_1.Text style={[styles.errorText, errorStyle]}>
|
|
96
|
+
⚠ {getErrorMessage()}
|
|
97
|
+
</react_native_1.Text>)}
|
|
98
|
+
</react_native_1.View>);
|
|
99
|
+
};
|
|
100
|
+
exports.FvNumberField = FvNumberField;
|
|
101
|
+
const styles = react_native_1.StyleSheet.create({
|
|
102
|
+
container: {
|
|
103
|
+
marginBottom: 16,
|
|
104
|
+
width: "100%",
|
|
105
|
+
},
|
|
106
|
+
labelContainer: {
|
|
107
|
+
marginBottom: 6,
|
|
108
|
+
},
|
|
109
|
+
label: {
|
|
110
|
+
fontSize: 14,
|
|
111
|
+
fontWeight: "500",
|
|
112
|
+
color: "#333333",
|
|
113
|
+
},
|
|
114
|
+
requiredAsterisk: {
|
|
115
|
+
color: "#dc3545",
|
|
116
|
+
fontWeight: "bold",
|
|
117
|
+
},
|
|
118
|
+
input: {
|
|
119
|
+
padding: 10,
|
|
120
|
+
borderWidth: 1,
|
|
121
|
+
borderColor: "#cccccc",
|
|
122
|
+
borderRadius: 4,
|
|
123
|
+
fontSize: 14,
|
|
124
|
+
backgroundColor: "#ffffff",
|
|
125
|
+
color: "#333333",
|
|
126
|
+
},
|
|
127
|
+
inputError: {
|
|
128
|
+
borderColor: "#dc3545",
|
|
129
|
+
},
|
|
130
|
+
inputDisabled: {
|
|
131
|
+
backgroundColor: "#f5f5f5",
|
|
132
|
+
opacity: 0.6,
|
|
133
|
+
},
|
|
134
|
+
errorText: {
|
|
135
|
+
marginTop: 4,
|
|
136
|
+
fontSize: 12,
|
|
137
|
+
color: "#dc3545",
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
//# sourceMappingURL=FvNumberField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FvNumberField.js","sourceRoot":"","sources":["../../src/components/FvNumberField.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAmD;AACnD,+CAQsB;AACtB,oEAA2E;AAqBpE,MAAM,aAAa,GAAiC,CAAC,EACxD,KAAK,EACL,WAAW,EACX,KAAK,EACL,MAAM,EACN,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,MAAM,EACN,OAAO,EACP,cAAc,EACd,UAAU,EACV,UAAU,EACV,UAAU,GACb,EAAE,EAAE;IACD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAgB,IAAI,CAAC,CAAC;IAEtE,MAAM,WAAW,GAAG,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAE/E,IAAA,iBAAS,EAAC,GAAG,EAAE;QACX,IAAI,MAAM,EAAE,CAAC;YACT,MAAM,MAAM,GAAG,6BAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YACvD,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,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,CAAC,SAAS,CACtB,oBAAoB,CAAC,SAAS,EAGlC;;YAAA,CAAC,YAAY,IAAI,CACb,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CACxC;sBAAE,CAAC,eAAe,EAAE,CACxB;gBAAA,EAAE,mBAAI,CAAC,CACV,CACL;QAAA,EAAE,mBAAI,CAAC,CACV,CAAC;AACN,CAAC,CAAC;AAjHW,QAAA,aAAa,iBAiHxB;AAEF,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC7B,SAAS,EAAE;QACP,YAAY,EAAE,EAAE;QAChB,KAAK,EAAE,MAAM;KAChB;IACD,cAAc,EAAE;QACZ,YAAY,EAAE,CAAC;KAClB;IACD,KAAK,EAAE;QACH,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,SAAS;KACnB;IACD,gBAAgB,EAAE;QACd,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,MAAM;KACrB;IACD,KAAK,EAAE;QACH,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,SAAS;QACtB,YAAY,EAAE,CAAC;QACf,QAAQ,EAAE,EAAE;QACZ,eAAe,EAAE,SAAS;QAC1B,KAAK,EAAE,SAAS;KACnB;IACD,UAAU,EAAE;QACR,WAAW,EAAE,SAAS;KACzB;IACD,aAAa,EAAE;QACX,eAAe,EAAE,SAAS;QAC1B,OAAO,EAAE,GAAG;KACf;IACD,SAAS,EAAE;QACP,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,SAAS;KACnB;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ViewStyle, TextStyle } from "react-native";
|
|
3
|
+
export interface RadioOption {
|
|
4
|
+
value: any;
|
|
5
|
+
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface FvRadioGroupProps {
|
|
9
|
+
label?: string;
|
|
10
|
+
value: any;
|
|
11
|
+
options: RadioOption[];
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
onChange: (value: any) => void;
|
|
15
|
+
containerStyle?: ViewStyle;
|
|
16
|
+
labelStyle?: TextStyle;
|
|
17
|
+
optionStyle?: ViewStyle;
|
|
18
|
+
}
|
|
19
|
+
export declare const FvRadioGroup: React.FC<FvRadioGroupProps>;
|
|
20
|
+
//# sourceMappingURL=FvRadioGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FvRadioGroup.d.ts","sourceRoot":"","sources":["../../src/components/FvRadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAKH,SAAS,EACT,SAAS,EACZ,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,GAAG,CAAC;IACX,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAuDpD,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FvRadioGroup = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const FvRadioGroup = ({ label, value, options, disabled = false, required = false, onChange, containerStyle, labelStyle, optionStyle, }) => {
|
|
10
|
+
return (<react_native_1.View style={[styles.container, containerStyle]}>
|
|
11
|
+
{label && (<react_native_1.Text style={[styles.groupLabel, labelStyle]}>
|
|
12
|
+
{label}
|
|
13
|
+
{required && <react_native_1.Text style={styles.requiredAsterisk}> *</react_native_1.Text>}
|
|
14
|
+
</react_native_1.Text>)}
|
|
15
|
+
<react_native_1.View style={styles.optionsContainer}>
|
|
16
|
+
{options.map((option, index) => {
|
|
17
|
+
const isSelected = value === option.value;
|
|
18
|
+
const isOptionDisabled = disabled || option.disabled;
|
|
19
|
+
return (<react_native_1.TouchableOpacity key={index} activeOpacity={0.7} disabled={isOptionDisabled} onPress={() => onChange(option.value)} style={[styles.option, optionStyle]}>
|
|
20
|
+
<react_native_1.View style={[
|
|
21
|
+
styles.radio,
|
|
22
|
+
isSelected && styles.radioActive,
|
|
23
|
+
isOptionDisabled && styles.radioDisabled,
|
|
24
|
+
]}>
|
|
25
|
+
{isSelected && <react_native_1.View style={styles.radioInner}/>}
|
|
26
|
+
</react_native_1.View>
|
|
27
|
+
<react_native_1.Text style={[
|
|
28
|
+
styles.optionLabel,
|
|
29
|
+
isOptionDisabled && styles.labelDisabled,
|
|
30
|
+
]}>
|
|
31
|
+
{option.label}
|
|
32
|
+
</react_native_1.Text>
|
|
33
|
+
</react_native_1.TouchableOpacity>);
|
|
34
|
+
})}
|
|
35
|
+
</react_native_1.View>
|
|
36
|
+
</react_native_1.View>);
|
|
37
|
+
};
|
|
38
|
+
exports.FvRadioGroup = FvRadioGroup;
|
|
39
|
+
const styles = react_native_1.StyleSheet.create({
|
|
40
|
+
container: {
|
|
41
|
+
marginBottom: 16,
|
|
42
|
+
width: "100%",
|
|
43
|
+
},
|
|
44
|
+
groupLabel: {
|
|
45
|
+
fontSize: 14,
|
|
46
|
+
fontWeight: "500",
|
|
47
|
+
color: "#333333",
|
|
48
|
+
marginBottom: 8,
|
|
49
|
+
},
|
|
50
|
+
optionsContainer: {
|
|
51
|
+
flexDirection: "row",
|
|
52
|
+
flexWrap: "wrap",
|
|
53
|
+
gap: 15,
|
|
54
|
+
},
|
|
55
|
+
option: {
|
|
56
|
+
flexDirection: "row",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
},
|
|
59
|
+
radio: {
|
|
60
|
+
width: 20,
|
|
61
|
+
height: 20,
|
|
62
|
+
borderWidth: 2,
|
|
63
|
+
borderColor: "#667eea",
|
|
64
|
+
borderRadius: 10,
|
|
65
|
+
marginRight: 8,
|
|
66
|
+
justifyContent: "center",
|
|
67
|
+
alignItems: "center",
|
|
68
|
+
backgroundColor: "#ffffff",
|
|
69
|
+
},
|
|
70
|
+
radioActive: {
|
|
71
|
+
borderColor: "#667eea",
|
|
72
|
+
},
|
|
73
|
+
radioDisabled: {
|
|
74
|
+
borderColor: "#cccccc",
|
|
75
|
+
backgroundColor: "#f5f5f5",
|
|
76
|
+
},
|
|
77
|
+
radioInner: {
|
|
78
|
+
width: 10,
|
|
79
|
+
height: 10,
|
|
80
|
+
backgroundColor: "#667eea",
|
|
81
|
+
borderRadius: 5,
|
|
82
|
+
},
|
|
83
|
+
optionLabel: {
|
|
84
|
+
fontSize: 14,
|
|
85
|
+
color: "#333333",
|
|
86
|
+
},
|
|
87
|
+
labelDisabled: {
|
|
88
|
+
color: "#999999",
|
|
89
|
+
},
|
|
90
|
+
requiredAsterisk: {
|
|
91
|
+
color: "#dc3545",
|
|
92
|
+
fontWeight: "bold",
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
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,EAAE,EAAE;QACV,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,SAAS;QACtB,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,CAAC;QACd,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,SAAS;KAC7B;IACD,WAAW,EAAE;QACT,WAAW,EAAE,SAAS;KACzB;IACD,aAAa,EAAE;QACX,WAAW,EAAE,SAAS;QACtB,eAAe,EAAE,SAAS;KAC7B;IACD,UAAU,EAAE;QACR,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,eAAe,EAAE,SAAS;QAC1B,YAAY,EAAE,CAAC;KAClB;IACD,WAAW,EAAE;QACT,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,SAAS;KACnB;IACD,aAAa,EAAE;QACX,KAAK,EAAE,SAAS;KACnB;IACD,gBAAgB,EAAE;QACd,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,MAAM;KACrB;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ViewStyle, TextStyle } from "react-native";
|
|
3
|
+
import { ValidationSchema } from "@fovestta2/validation-engine";
|
|
4
|
+
export type TextFormat = "bold" | "italic" | "underline" | "strikethrough";
|
|
5
|
+
export interface FvRichTextEditorProps {
|
|
6
|
+
label?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
value: string;
|
|
9
|
+
schema?: ValidationSchema;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
readonly?: boolean;
|
|
12
|
+
minHeight?: number;
|
|
13
|
+
maxHeight?: number;
|
|
14
|
+
showToolbar?: boolean;
|
|
15
|
+
onChange: (value: string) => void;
|
|
16
|
+
onBlur?: () => void;
|
|
17
|
+
onFocus?: () => void;
|
|
18
|
+
containerStyle?: ViewStyle;
|
|
19
|
+
editorStyle?: ViewStyle;
|
|
20
|
+
labelStyle?: TextStyle;
|
|
21
|
+
errorStyle?: TextStyle;
|
|
22
|
+
toolbarStyle?: ViewStyle;
|
|
23
|
+
}
|
|
24
|
+
export declare const FvRichTextEditor: React.FC<FvRichTextEditorProps>;
|
|
25
|
+
//# sourceMappingURL=FvRichTextEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FvRichTextEditor.d.ts","sourceRoot":"","sources":["../../src/components/FvRichTextEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAOH,SAAS,EACT,SAAS,EACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAa,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAE3E,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,eAAe,CAAC;AAE3E,MAAM,WAAW,qBAAqB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,YAAY,CAAC,EAAE,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAoM5D,CAAC"}
|