@fto-consult/expo-ui 6.43.0 → 6.44.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.
@@ -15,6 +15,10 @@ module.exports = (opts)=>{
15
15
  const expoUI = require("./expo-ui-path")();
16
16
  const euCommon = path.resolve(expoUI,"node_modules","@fto-consult","common");
17
17
  const cpath = fs.existsSync(euCommon)? path.resolve(euCommon,"babel.config.alias") : "@fto-consult/common/babel.config.alias";
18
+ const mainAppPackage = path.resolve(projectRoot,"expo-ui.json");
19
+ if(fs.existsSync(mainAppPackage)){
20
+ opts.$packageJSON = mainAppPackage;
21
+ }
18
22
  const r = require(`${cpath}`)(opts);
19
23
  const expo = path.resolve(expoUI,"src");
20
24
  r["$ecomponents"] = r["$expo-components"] = path.resolve(expo,"components");
@@ -74,6 +78,7 @@ module.exports = (opts)=>{
74
78
  r.$ehooks = path.resolve(expo,"context","hooks");
75
79
  ///le chemin racine du projet expo-ui
76
80
  r["$expo-ui-root-path"] = r["$expo-ui-root"]= path.resolve(expo,"..");
81
+
77
82
  const $assets = r.$assets;
78
83
  const $electron = path.resolve(dir,"electron");
79
84
  const electronPaths = {
package/metro.config.js CHANGED
@@ -41,5 +41,19 @@ module.exports = function(opts){
41
41
  });*/
42
42
  ///on génère les librairies open sources utilisées par l'application
43
43
  require("./find-licenses");
44
+
45
+ const packageJSonPath = path.resolve(projectRoot,"package.json");
46
+ const mainAppPackage = path.resolve(projectRoot,"expo-ui.json");
47
+ if(!fs.existsSync(mainAppPackage) && fs.existsSync(packageJSonPath)){
48
+ try {
49
+ const packageObj = require(`${packageJSonPath}`);
50
+ if(packageObj && typeof packageObj =='object'){
51
+ ["scripts","private","main","repository","keywords","bugs","dependencies","devDependencies"].map(v=>{
52
+ delete packageObj[v];
53
+ });
54
+ fs.writeFileSync(mainAppPackage,JSON.stringify(packageObj,null,"\t"));
55
+ }
56
+ } catch{}
57
+ }
44
58
  return config;
45
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "6.43.0",
3
+ "version": "6.44.1",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "main",
6
6
  "scripts": {
@@ -17,7 +17,7 @@ import View from "$ecomponents/View";
17
17
  import Portal from "$ecomponents/Portal";
18
18
  import { ScrollView } from "react-native";
19
19
  import BackHandler from "$ecomponents/BackHandler";
20
- import Reanimated, { useSharedValue,withTiming,useAnimatedStyle, } from 'react-native-reanimated';
20
+ import Reanimated, { useSharedValue,withTiming,useAnimatedStyle} from 'react-native-reanimated';
21
21
  import {
22
22
  Pressable,
23
23
  Animated,
@@ -128,7 +128,7 @@ const BottomSheetComponent = React.forwardRef((props,ref)=> {
128
128
  };
129
129
  hasCallCallbackRef.current = false;
130
130
  if(animatedHeight.value != 0){
131
- animatedHeight.value = withTiming(0,{
131
+ animatedHeight.value = animate(0,{
132
132
  duration: closeDuration,
133
133
  callback,
134
134
  });
@@ -142,7 +142,7 @@ const BottomSheetComponent = React.forwardRef((props,ref)=> {
142
142
  onPanResponderMove: (e, gestureState) => {
143
143
  const diff = gestureState.dy > 0 ? animatedHeight.value - gestureState.dy : Math.min(heightRef.current,animatedHeight.value-gestureState.dy);
144
144
  if(diff >0 && diff !== animatedHeight.value){
145
- animatedHeight.value = withTiming(diff,{duration:100});
145
+ animatedHeight.value = animate(diff,{duration:100});
146
146
  }
147
147
  },
148
148
  onPanResponderRelease: (e, gestureState) => {
@@ -160,7 +160,7 @@ const BottomSheetComponent = React.forwardRef((props,ref)=> {
160
160
  if(typeof customVisible !=='boolean' || customVisible === visible) return;
161
161
  if(customVisible){
162
162
  if(animatedHeight.value >0){
163
- animatedHeight.value = withTiming(0);
163
+ animatedHeight.value = animate(0);
164
164
  }
165
165
  setVisible(true);
166
166
  } else {
@@ -175,7 +175,7 @@ const BottomSheetComponent = React.forwardRef((props,ref)=> {
175
175
  if(visible){
176
176
  addListener();
177
177
  pan.setValue({ x: 0, y: 0 });
178
- animatedHeight.value = withTiming(height,{
178
+ animatedHeight.value = animate(height,{
179
179
  callback : ()=>{
180
180
  if (typeof onOpen === "function") onOpen(props)
181
181
  },
@@ -425,4 +425,10 @@ const styles = StyleSheet.create({
425
425
  }
426
426
  });
427
427
 
428
- BottomSheetComponent.displayName = "BottomSheetComponent";
428
+ BottomSheetComponent.displayName = "BottomSheetComponent";
429
+
430
+ export const animate = (time,options)=>{
431
+ return withTiming(time,{
432
+ ...Object.assign({},options)
433
+ });
434
+ }
@@ -5,16 +5,17 @@
5
5
  import Accordion,{ TableData as TableDataAccordion} from "./Accordion";
6
6
  import Table,{TableData as DatagridTableData} from "./Table";
7
7
  import {isDesktopMedia,isMobileMedia} from "$cplatform/dimensions";
8
- import {isFunction,defaultVal} from "$cutils";
8
+ import {isFunction,defaultVal,defaultStr} from "$cutils";
9
9
  import React from "$react";
10
10
  import {getRenderType} from "./utils";
11
11
 
12
12
 
13
13
  const DatagridMainComponent = React.forwardRef((props,ref)=>{
14
14
  const isDesk = isDesktopMedia();
15
- const isMob = isMobileMedia();
15
+ const isMob = defaultStr(isMobileMedia());
16
16
  const isTableData = typeof props.isTableData =='boolean'? props.isTableData : defaultStr(props.tableName,props.table).trim() || typeof props.fetchData ==='function'?true : false;
17
- const renderType = defaultStr(getRenderType(),isDesk? "table":'accordion').trim().toLowerCase();
17
+ const rType = defaultStr(getRenderType()).toLowerCase().trim();
18
+ const renderType = defaultStr(rType && ['table','accordion'].includes(rType) ? rType : "",isDesk? "table":'accordion').trim().toLowerCase();
18
19
  const canRenderAccordion = (isFunction(props.accordion) || (isObj(props.accordionProps) && isFunction(props.accordionProps.accordion)) || props.accordion === true);
19
20
  const Component = React.useMemo(()=>{
20
21
  if((renderType == 'accordion' || (renderType !=='table' && isMob)) && canRenderAccordion){
@@ -18,18 +18,9 @@ const DatagridRenderTypeComponent = (props)=>{
18
18
  let type = defaultStr(get(typeKey),isDesk? "fixed":'accordion').toLowerCase().trim();
19
19
  const rTypes = [
20
20
  {...getActiveProps(type,'accordion'),tooltip:"Les éléments de liste s'affichent de manière optimisé pour téléphone mobile",code:'accordion',icon:accordionIcon,label:'Mobile',labelText:'environnement optimisé pour téléphone mobile'},
21
- {...getActiveProps(type,'table'),tooltip:"Les éléments de listes s'affichent dans un tableau",code:'table',icon:tableIcon,label:'Tableau'}
21
+ {...getActiveProps(type,'table'),tooltip:"Les éléments de listes s'affichent dans un tableau",code:'table',icon:tableIcon,label:'Tableau'},
22
+ {...getActiveProps(type,'auto'),tooltip:"Les éléments de listes s'affichent de fasson automatique en fonction de la taille de l'écran",code:'auto',icon:"material-wb-auto",label:'Automatique'}
22
23
  ]
23
- /*Object.map(rendersTypes,(t,i)=>{
24
- if(isObj(t)){
25
- if((isDesk && t.desktop) || (!isDesk && t.mobile)){
26
- rTypes.push({
27
- ...t,
28
- ...getActiveProps(type,i)
29
- })
30
- }
31
- }
32
- });*/
33
24
  let typeObj = {};
34
25
  Object.map(rTypes,(t)=>{
35
26
  if(isObj(t) && t.code == type){