@fto-consult/expo-ui 2.16.9 → 2.16.11
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": "2.16.
|
|
3
|
+
"version": "2.16.11",
|
|
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": "^1.22.
|
|
64
|
+
"@fto-consult/common": "^1.22.18",
|
|
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",
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from '$react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import {defaultStr,defaultObj,uniqid} from "$utils";
|
|
3
|
+
import {defaultStr,defaultObj,uniqid,defaultNumber} from "$utils";
|
|
4
4
|
import {extend} from "./utils"
|
|
5
5
|
import stableHash from 'stable-hash';
|
|
6
6
|
import Chart from "./appexChart";
|
|
7
7
|
|
|
8
8
|
/**** le composant Chart s'appuie sur le composant appexChart : https://apexcharts.com/
|
|
9
|
+
* pour le formattage des date, voir : https://apexcharts.com/docs/datetime/
|
|
9
10
|
* les props requis duduit composant sont :
|
|
10
11
|
* type {string}, le type de chart
|
|
11
12
|
* series {array} - //les series appexchart
|
|
@@ -32,6 +33,12 @@ const ChartComponent = React.forwardRef(({type, height,chartId, width, series, o
|
|
|
32
33
|
const prevWidth = React.usePrevious(width), prevHeight = React.usePrevious(height);
|
|
33
34
|
const prevOptions = React.usePrevious(options,JSON.stringify);
|
|
34
35
|
const prevSeries = React.usePrevious(series,JSON.stringify);
|
|
36
|
+
/***change size chart, @see : https://apexcharts.com/docs/chart-types/line-chart/ */
|
|
37
|
+
options.xaxis = defaultObj(options.xaxis);
|
|
38
|
+
options.xaxis.stroke = defaultObj(options.xaxis.stroke);
|
|
39
|
+
options.xaxis.stroke.width = defaultNumber(options.xaxis.stroke.width,2);
|
|
40
|
+
options.xaxis.stroke.height = defaultNumber(options.xaxis.height,1);
|
|
41
|
+
|
|
35
42
|
React.useEffect(()=>{
|
|
36
43
|
if(chartContext.current && chartContext.current.updateOptions){
|
|
37
44
|
if((prevSeries == series) || width != prevWidth || height != prevHeight){
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// Copyright 2022 @fto-consult/Boris Fouomene. All rights reserved.
|
|
2
|
-
// Use of this source code is governed by a BSD-style
|
|
3
|
-
// license that can be found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
function base64toBlob(base64Data, contentType) {
|
|
6
|
-
contentType = contentType || '';
|
|
7
|
-
let sliceSize = 1024;
|
|
8
|
-
let byteCharacters = atob(base64Data);
|
|
9
|
-
let bytesLength = byteCharacters.length;
|
|
10
|
-
let slicesCount = Math.ceil(bytesLength / sliceSize);
|
|
11
|
-
let byteArrays = new Array(slicesCount);
|
|
12
|
-
for (let sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
|
|
13
|
-
let begin = sliceIndex * sliceSize;
|
|
14
|
-
let end = Math.min(begin + sliceSize, bytesLength);
|
|
15
|
-
|
|
16
|
-
let bytes = new Array(end - begin);
|
|
17
|
-
for (var offset = begin, i = 0; offset < end; ++i, ++offset) {
|
|
18
|
-
bytes[i] = byteCharacters[offset].charCodeAt(0);
|
|
19
|
-
}
|
|
20
|
-
byteArrays[sliceIndex] = new Uint8Array(bytes);
|
|
21
|
-
}
|
|
22
|
-
return new Blob(byteArrays, { type: contentType });
|
|
23
|
-
}
|