@fto-consult/expo-ui 2.48.0 → 2.48.3
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 +2 -2
- package/src/auth/Login.js +5 -1
- package/src/components/AppBar/index.js +1 -1
- package/src/components/AppBar/utils.js +2 -2
- package/src/components/BottomSheet/Menu.js +1 -1
- package/src/components/Button/index.js +11 -5
- package/src/components/Checkbox/index.js +1 -1
- package/src/components/Color/index.js +1 -1
- package/src/components/Countries/resources/countries-normalized.json +1987 -1987
- package/src/components/Countries/resources/countries-with-not-extra.json +1211 -1211
- package/src/components/Countries/resources/countries.sql +243 -243
- package/src/components/Datagrid/Accordion/Row.js +1 -1
- package/src/components/Datagrid/Actions/index.js +1 -1
- package/src/components/Datagrid/Footer/index.js +1 -1
- package/src/components/Date/DatePickerInput/index.js +1 -1
- package/src/components/Date/Time.js +1 -1
- package/src/components/Dialog/Dialog.js +9 -5
- package/src/components/Drawer/DrawerItems/ExpandableItem.js +1 -1
- package/src/components/Drawer/index.js +1 -1
- package/src/components/Dropdown/index.js +4 -1
- package/src/components/Fab/Group.js +1 -1
- package/src/components/Form/Fields/Checkbox.js +0 -5
- package/src/components/Form/Fields/Field.js +2 -1
- package/src/components/Form/Fields/Radio.js +0 -5
- package/src/components/Form/Fields/SelectField.js +1 -0
- package/src/components/Form/Fields/Slider.js +0 -5
- package/src/components/Form/Fields/Switch.js +0 -5
- package/src/components/Form/FormData/DialogProvider.js +4 -2
- package/src/components/Form/FormData/FormDataActions.js +1 -0
- package/src/components/Form/FormData/componentsTypes.js +2 -2
- package/src/components/Form/FormData/utils.js +1 -2
- package/src/components/Icon/Checkbox.js +2 -2
- package/src/components/Icon/utils.js +2 -0
- package/src/components/Image/Editor/index copy.js +1 -1
- package/src/components/Image/Editor/index.js +2 -2
- package/src/components/Label/index.js +1 -1
- package/src/components/Menu/index.js +1 -1
- package/src/components/Modal/index.js +1 -1
- package/src/components/PhoneInput/index.js +1 -1
- package/src/components/Radio/index.js +1 -1
- package/src/components/ScrollView/index.js +9 -2
- package/src/components/SimpleSelect/index.js +1 -1
- package/src/components/Slider/index.js +1 -1
- package/src/components/Switch/index.js +1 -1
- package/src/components/Table/FiltersOrFooters.js +18 -0
- package/src/components/Table/index.js +32 -14
- package/src/components/TextField/index.js +3 -3
- package/src/screens/Auth/PermLines.js +417 -0
- package/src/screens/Auth/PermProfile.js +182 -0
- package/src/screens/Auth/PermProfiles.js +38 -0
- package/src/screens/Auth/Profile.js +1 -1
- package/src/screens/Auth/index.js +8 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fto-consult/expo-ui",
|
|
3
|
-
"version": "2.48.
|
|
3
|
+
"version": "2.48.3",
|
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@emotion/native": "^11.10.0",
|
|
62
62
|
"@expo/html-elements": "^0.2.0",
|
|
63
63
|
"@expo/vector-icons": "^13.0.0",
|
|
64
|
-
"@fto-consult/common": "^2.
|
|
64
|
+
"@fto-consult/common": "^2.13.1",
|
|
65
65
|
"@gorhom/portal": "^1.0.14",
|
|
66
66
|
"@react-native-async-storage/async-storage": "~1.17.3",
|
|
67
67
|
"@react-native-community/datetimepicker": "6.5.2",
|
package/src/auth/Login.js
CHANGED
|
@@ -150,7 +150,11 @@ export default function LoginComponent(props){
|
|
|
150
150
|
nextButtonRef.current?.enable();
|
|
151
151
|
}
|
|
152
152
|
if(step > 1){
|
|
153
|
-
|
|
153
|
+
const cS = canSubmit(args);
|
|
154
|
+
if(typeof cS === 'string' && cS){
|
|
155
|
+
return notifyUser(cS);
|
|
156
|
+
}
|
|
157
|
+
if(cS && beforeSubmit(args) !== false){
|
|
154
158
|
///pour modifier automatiquement la données à mettre à jour
|
|
155
159
|
if(typeof mutateData =='function'){
|
|
156
160
|
mutateData(data);
|
|
@@ -93,7 +93,7 @@ const AppBarComponent = React.forwardRef((props,ref)=> {
|
|
|
93
93
|
const [context] = React.useState({});
|
|
94
94
|
actions = typeof actions =='function'? actions(getCallAgs()) : actions;
|
|
95
95
|
const dimensions = Dimensions.get("window");
|
|
96
|
-
const [layout,setLayout] = React.
|
|
96
|
+
const [layout,setLayout] = React.useState({
|
|
97
97
|
width : dimensions.width,
|
|
98
98
|
height : dimensions.height,
|
|
99
99
|
})
|
|
@@ -155,9 +155,9 @@ export const splitActions = (args)=>{
|
|
|
155
155
|
return false;
|
|
156
156
|
}
|
|
157
157
|
if(menus.length && countActions > 1){
|
|
158
|
-
menus.push({...action,isMenuItem:true});
|
|
158
|
+
menus.push({...action,isCancelButton:true,isMenuItem:true});
|
|
159
159
|
} else {
|
|
160
|
-
_actions.push(<Button testID={'RN_AppBarCancelButton'} {...action} key={action.key}/>)
|
|
160
|
+
_actions.push(<Button isCancelButton testID={'RN_AppBarCancelButton'} {...action} key={action.key}/>)
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
}
|
|
@@ -12,7 +12,7 @@ const BottomSheetMenuComponent = React.forwardRef((props,ref)=>{
|
|
|
12
12
|
rest = defaultObj(rest);
|
|
13
13
|
const isControlled = controlled ? true : false;
|
|
14
14
|
const visibleRef = React.useRef(null);
|
|
15
|
-
const [state,setState] = React.
|
|
15
|
+
const [state,setState] = React.useState({
|
|
16
16
|
visible : false,
|
|
17
17
|
height : undefined,
|
|
18
18
|
});
|
|
@@ -27,6 +27,8 @@ const ButtonComponent = React.forwardRef(({
|
|
|
27
27
|
children,
|
|
28
28
|
text,
|
|
29
29
|
label,
|
|
30
|
+
isCancelButton,
|
|
31
|
+
error,
|
|
30
32
|
upperCase = true,
|
|
31
33
|
accessibilityLabel,
|
|
32
34
|
onPress,
|
|
@@ -59,6 +61,7 @@ const ButtonComponent = React.forwardRef(({
|
|
|
59
61
|
borderRadius,
|
|
60
62
|
...rest
|
|
61
63
|
},ref) => {
|
|
64
|
+
isCancelButton = isCancelButton || error && true || false;
|
|
62
65
|
children = defaultVal(children,label,text);
|
|
63
66
|
testID = defaultStr(testID,'RN_ButtonComponent');
|
|
64
67
|
upperCase = upperCase ? true : false;
|
|
@@ -137,10 +140,10 @@ const ButtonComponent = React.forwardRef(({
|
|
|
137
140
|
};
|
|
138
141
|
contentContainerProps = defaultObj(contentContainerProps);
|
|
139
142
|
containerProps = defaultObj(containerProps);
|
|
140
|
-
style = StyleSheet.flatten(style) || {};
|
|
143
|
+
style = Object.assign(StyleSheet.flatten(style) || {});
|
|
141
144
|
labelStyle = StyleSheet.flatten([labelStyle]);
|
|
142
145
|
const disabled = isDisabled || isLoading;
|
|
143
|
-
let textColor = Colors.isValid(buttonColor)?buttonColor : Colors.isValid(labelStyle.color) ? labelStyle.color : Colors.isValid(style.color)? style.color : theme.colors.primary,
|
|
146
|
+
let textColor = Colors.isValid(buttonColor)?buttonColor : Colors.isValid(labelStyle.color) ? labelStyle.color : Colors.isValid(style.color)? style.color : isCancelButton? theme.colors.errorText : theme.colors.primary,
|
|
144
147
|
borderWidth;
|
|
145
148
|
const restButtonStyle = {
|
|
146
149
|
opacity : disabled ? DISABLED_OPACITY : undefined
|
|
@@ -149,10 +152,13 @@ const ButtonComponent = React.forwardRef(({
|
|
|
149
152
|
iconProps = defaultObj(iconProps);
|
|
150
153
|
labelProps = defaultObj(labelProps);
|
|
151
154
|
contentProps = defaultObj(contentProps);
|
|
152
|
-
|
|
155
|
+
if(isCancelButton){
|
|
156
|
+
style.backgroundColor = theme.colors.error;
|
|
157
|
+
style.color = theme.styles.errorText ;
|
|
158
|
+
}
|
|
153
159
|
if (!disabled && hasElevation) {
|
|
154
|
-
backgroundColor = Colors.isValid(backgroundColor)? backgroundColor : Colors.isValid(style.backgroundColor)?style.backgroundColor
|
|
155
|
-
borderColor = Colors.isValid(borderColor)? borderColor : Colors.isValid(style.borderColor)? style.borderColor : undefined;
|
|
160
|
+
backgroundColor = Colors.isValid(backgroundColor)? backgroundColor : Colors.isValid(style.backgroundColor)?style.backgroundColor : undefined;
|
|
161
|
+
borderColor = Colors.isValid(borderColor)? borderColor : Colors.isValid(style.borderColor)? style.borderColor : isCancelButton ? theme.styles.errorText : undefined;
|
|
156
162
|
}
|
|
157
163
|
if(theme.isDark() && !hasElevation){
|
|
158
164
|
textColor = white;
|
|
@@ -58,7 +58,7 @@ const CheckboxComponent = React.forwardRef((props,ref)=>{
|
|
|
58
58
|
}
|
|
59
59
|
delete p.checked;
|
|
60
60
|
defaultValue = defaultVal(defaultValue,value,0);
|
|
61
|
-
const [status,setStatus] = React.
|
|
61
|
+
const [status,setStatus] = React.useState(defaultValue == checkedValue ? checkedStatus : uncheckedStatus)
|
|
62
62
|
const previousStatus = React.usePrevious(status);
|
|
63
63
|
const checked = status===checkedStatus?true:false;
|
|
64
64
|
if(checked){
|
|
@@ -19,7 +19,7 @@ const ColorPickerComponent = React.forwardRef ((props,ref)=>{
|
|
|
19
19
|
const isMob = isMobileOrTabletMedia();
|
|
20
20
|
const _label = defaultStr(label,text);
|
|
21
21
|
const pickerRef = React.useRef(null);
|
|
22
|
-
const [state,setState] = React.
|
|
22
|
+
const [state,setState] = React.useState({
|
|
23
23
|
color : Colors.isValid(defaultValue)? defaultValue : undefined,
|
|
24
24
|
visible : false,
|
|
25
25
|
})
|