@fto-consult/expo-ui 6.16.4 → 6.16.6

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": "@fto-consult/expo-ui",
3
- "version": "6.16.4",
3
+ "version": "6.16.6",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -99,7 +99,7 @@
99
99
  "react-native-iphone-x-helper": "^1.3.1",
100
100
  "react-native-mime-types": "^2.4.0",
101
101
  "react-native-paper": "^5.10.0",
102
- "react-native-paper-dates": "^0.18.12",
102
+ "react-native-paper-dates": "^0.18.13",
103
103
  "react-native-reanimated": "~3.3.0",
104
104
  "react-native-safe-area-context": "4.6.3",
105
105
  "react-native-screens": "~3.22.0",
@@ -7,6 +7,7 @@ import PropTypes from "prop-types";
7
7
  import theme,{styles} from "$theme";
8
8
  import { locale } from "./utils";
9
9
  import { TouchableRipple } from "react-native-paper";
10
+ import View from "$ecomponents/View";
10
11
  export const getDate = (hours,minutes,seconds)=>{
11
12
  return new Date(2000, 1, 1, defaultDecimal(hours), defaultDecimal(minutes),defaultDecimal(seconds))
12
13
  }
@@ -72,7 +73,7 @@ export default function TimePickerComponent (props){
72
73
  let right = null;
73
74
  if(withModal){
74
75
  right = (props)=>{
75
- return <>
76
+ return <View testID="RN_DatePickerRightContainer" style={[{pointerEvents:isEditable && !disabled ?"auto":"none"},styles.row,styles.justifyContentStart,styles.alignItemsCenter]}>
76
77
  <Icon title={label} {...anchorProps}
77
78
  icon="clock-outline" onPress={(e)=>{
78
79
  React.stopEventPropagation(e);
@@ -82,7 +83,7 @@ export default function TimePickerComponent (props){
82
83
  style = {[props.style,anchorProps.style]}
83
84
  />
84
85
  {typeof customRight =='function'? customRight(props): customRight}
85
- </>
86
+ </View>
86
87
  }
87
88
  } else right = customRight;
88
89
  React.useEffect(()=>{
@@ -111,15 +112,16 @@ export default function TimePickerComponent (props){
111
112
  if(!disabled){
112
113
  containerProps.style = [containerProps.style,{opacity:1}]
113
114
  }
115
+ const tCursor = disabled || readOnly ? styles.cursorNotAllowed:styles.cursorPointer;
114
116
  const iContainerProps = defaultObj(inputProps.containerProps);
115
117
  return <>
116
118
  <TouchableRipple {...containerProps}
117
119
  disabled = {!isEditable}
118
- style = {[containerProps.style,styles.cursorPointer]}
120
+ style = {[containerProps.style,tCursor]}
119
121
  onPress = {isEditable?openModal:undefined}
120
122
  rippleColor={containerProps.rippleColor}
121
123
  >
122
- <TextField
124
+ <TextField
123
125
  mode = {mode||theme.textFieldMode}
124
126
  {...rest}
125
127
  {...inputProps}
@@ -128,12 +130,12 @@ export default function TimePickerComponent (props){
128
130
  right = {right}
129
131
  disabled = {disabled}
130
132
  readOnly = {true}
131
- handleOpacity = {false}
132
- style = {[rest.style,!disabled && {opacity:1,color:theme.colors.text}]}
133
+ useReadOnlyOpacity = {!disabled && !readOnly ? false : true}
134
+ style = {[rest.style,tCursor,!disabled && {color:theme.colors.text}]}
133
135
  contentContainerProps = {{...defaultObj(rest.contentContainerProps),pointerEvents:'auto'}}
134
136
  defaultValue = {state.value}
135
137
  placeholder = {formatLabel}
136
- />
138
+ />
137
139
  </TouchableRipple>
138
140
  {withModal && <TimePickerModal
139
141
  {...dialogProps}
@@ -1,3 +1,9 @@
1
- import {TimePickerModal} from 'react-native-paper-dates'
1
+ import {TimePickerModal} from 'react-native-paper-dates';
2
+ import {PaperProvider} from 'react-native-paper';
3
+ import theme from "$theme";
2
4
 
3
- export default TimePickerModal;
5
+ export default function TimePickerModalComponent(props){
6
+ return <PaperProvider theme={theme}>
7
+ <TimePickerModal {...props}/>
8
+ </PaperProvider>
9
+ }
@@ -894,7 +894,7 @@ class DropdownComponent extends AppComponent {
894
894
  {<TextField
895
895
  defaultValue={selectedText}
896
896
  autoHeight = {renderTag}
897
- useReadOnlyOpacity = {false}
897
+ useReadOnlyOpacity = {!disabled && !readOnly ? false : true}
898
898
  {...inputProps}
899
899
  {...textInputProps}
900
900
  mode = {mode}
@@ -240,7 +240,7 @@ const SimpleSelect = React.forwardRef((props,ref)=>{
240
240
  }) :
241
241
  <TextField
242
242
  autoHeight = {false}
243
- useReadOnlyOpacity = {false}
243
+ useReadOnlyOpacity = {!disabled && !readOnly ? false : true}
244
244
  affix = {false}
245
245
  mode = {mode}
246
246
  {...rest}
@@ -254,7 +254,10 @@ const TableComponent = React.forwardRef(({containerProps,sortedColumn,listContai
254
254
  if(onRender){
255
255
  onRender(a,b,c);
256
256
  }
257
- if(hasChangedDataRef.current){
257
+ //au paravant il était possible de faire scroller le composant Table lorsque les données sont raffraichies, ce qui n'avait pas un bon impact sur le rendu de la table de données
258
+ if(false && hasChangedDataRef.current){
259
+ //permet de restaurer la position scrollé où scroll initial à chaque fois que le composant est re render
260
+ //ce qui n'est pas très interessant
258
261
  if(headerScrollViewRef.current && headerScrollViewRef.current.scrollTo){
259
262
  headerScrollViewRef.current.scrollTo({
260
263
  x : 0,
@@ -221,7 +221,7 @@ const TextFieldComponent = React.forwardRef((componentProps,inputRef)=>{
221
221
  const pointerEvents = isEditable?"auto":'none';
222
222
  const upperStyle = text && (upper || lower) && !isAndroid ? {textTransform:upper?'uppercase':'lowercase'} : null;
223
223
  const opacity = disabled ? DISABLED_OPACITY : (useReadOnlyOpacity !== false && !error && (readOnly)) ? READONLY_OPACITY : undefined;
224
- const disabledStyle = handleOpacity != false && opacity ? {opacity} : undefined;
224
+ const disabledStyle = typeof opacity =="number" ? {opacity} : undefined;
225
225
  if((readOnly === true || disabled === true) ){
226
226
  selection = defaultObj(selection);
227
227
  if(!isNumber(selection.start)){
@@ -354,6 +354,7 @@ const TextFieldComponent = React.forwardRef((componentProps,inputRef)=>{
354
354
  isWeb && { outline: 'none'},
355
355
  disabledStyle,
356
356
  {height},
357
+ readOnly || disabled && theme.styles.cursorNotAllowed,
357
358
  inputStyle2,
358
359
  isNormalMode && styles.inputNormalMode,
359
360
  isShadowMode && styles.inputShadowMode,
@@ -751,7 +752,7 @@ TextFieldComponent.propTypes = {
751
752
  ]),
752
753
  ///le style à afficher sur l'affix
753
754
  affixStyle : PropTypes.object,
754
- handleOpacity : PropTypes.bool,///si l'opacité sera géré automatiquement en fonction du status disabled de la textField
755
+ //handleOpacity : PropTypes.bool,///si l'opacité sera géré automatiquement en fonction du status disabled de la textField
755
756
  toCase : PropTypes.func,
756
757
  };
757
758