@draftbit/core 47.5.3-cda36f.2 → 47.5.3-e8c679.2
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/lib/src/components/Progress/LinearProgress/LinearProgress.d.ts +1 -2
- package/lib/src/components/Progress/LinearProgress/LinearProgress.js +5 -6
- package/lib/src/components/Progress/LinearProgress/LinearProgress.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/Progress/LinearProgress/LinearProgress.js +5 -6
- package/src/components/Progress/LinearProgress/LinearProgress.js.map +1 -1
- package/src/components/Progress/LinearProgress/LinearProgress.tsx +10 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "47.5.3-
|
|
3
|
+
"version": "47.5.3-e8c679.2+e8c679a",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/src/index.js",
|
|
6
6
|
"types": "lib/src/index.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^47.5.3-
|
|
44
|
+
"@draftbit/types": "^47.5.3-e8c679.2+e8c679a",
|
|
45
45
|
"@expo/vector-icons": "^13.0.0",
|
|
46
46
|
"@material-ui/core": "^4.11.0",
|
|
47
47
|
"@material-ui/pickers": "^3.2.10",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
],
|
|
98
98
|
"testEnvironment": "node"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "e8c679a32a7857e699d2fdaec47a21a4c13c3ee7"
|
|
101
101
|
}
|
|
@@ -15,7 +15,7 @@ export const LinearProgress = ({ theme, minimumValue = 0, maximumValue = 100, va
|
|
|
15
15
|
const maxThickness = Math.max(thickness, trackThickness);
|
|
16
16
|
const thicknessOffset = maxThickness / 2; // This offset guarantees nothing is cut off by view bounds
|
|
17
17
|
const progressLineWidth = svgContainerWidth - thicknessOffset;
|
|
18
|
-
console.log("LINE WIDTH
|
|
18
|
+
console.log("LINE WIDTH", progressLineWidth);
|
|
19
19
|
const trackProgressLineWidth = svgContainerWidth - thicknessOffset;
|
|
20
20
|
const currentFillPercentage = value / (maximumValue + minimumValue);
|
|
21
21
|
console.log("PERC", currentFillPercentage);
|
|
@@ -24,16 +24,15 @@ export const LinearProgress = ({ theme, minimumValue = 0, maximumValue = 100, va
|
|
|
24
24
|
const isBelowMinWidth = currentProgressLineWidth.value <= thicknessOffset;
|
|
25
25
|
console.log("RECEIVED", currentProgressLineWidth.value);
|
|
26
26
|
return {
|
|
27
|
-
x2:
|
|
28
|
-
{
|
|
29
|
-
duration: isAnimated ? animationDuration : 0,
|
|
30
|
-
}),
|
|
27
|
+
x2: Math.min(progressLineWidth, currentProgressLineWidth.value),
|
|
31
28
|
strokeOpacity: isBelowMinWidth ? 0.0 : 1.0,
|
|
32
29
|
};
|
|
33
30
|
});
|
|
34
31
|
React.useEffect(() => {
|
|
35
32
|
console.log("UPDATING TO", progressLineWidth * currentFillPercentage);
|
|
36
|
-
currentProgressLineWidth.value = progressLineWidth * currentFillPercentage
|
|
33
|
+
currentProgressLineWidth.value = withTiming(progressLineWidth * currentFillPercentage, {
|
|
34
|
+
duration: isAnimated ? animationDuration : 0,
|
|
35
|
+
});
|
|
37
36
|
}, [
|
|
38
37
|
value,
|
|
39
38
|
progressLineWidth,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinearProgress.js","sourceRoot":"","sources":["LinearProgress.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,EAAE,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"LinearProgress.js","sourceRoot":"","sources":["LinearProgress.ts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AAE,GAAG,EAAE,GAAE,CAAC,GACjB,CACE,CACD,CACR,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import Svg, { Line
|
|
2
|
+
import Svg, { Line } from "react-native-svg";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
import Animated, {
|
|
5
5
|
useAnimatedProps,
|
|
@@ -55,7 +55,7 @@ export const LinearProgress: React.FC<ValueProgressProps> = ({
|
|
|
55
55
|
const thicknessOffset = maxThickness / 2; // This offset guarantees nothing is cut off by view bounds
|
|
56
56
|
|
|
57
57
|
const progressLineWidth = svgContainerWidth - thicknessOffset;
|
|
58
|
-
console.log("LINE WIDTH
|
|
58
|
+
console.log("LINE WIDTH", progressLineWidth);
|
|
59
59
|
const trackProgressLineWidth = svgContainerWidth - thicknessOffset;
|
|
60
60
|
|
|
61
61
|
const currentFillPercentage = value / (maximumValue + minimumValue);
|
|
@@ -64,23 +64,23 @@ export const LinearProgress: React.FC<ValueProgressProps> = ({
|
|
|
64
64
|
currentFillPercentage * progressLineWidth
|
|
65
65
|
);
|
|
66
66
|
|
|
67
|
-
const progressLineAnimatedProps = useAnimatedProps
|
|
67
|
+
const progressLineAnimatedProps = useAnimatedProps(() => {
|
|
68
68
|
const isBelowMinWidth = currentProgressLineWidth.value <= thicknessOffset;
|
|
69
69
|
console.log("RECEIVED", currentProgressLineWidth.value);
|
|
70
70
|
return {
|
|
71
|
-
x2:
|
|
72
|
-
Math.min(progressLineWidth, currentProgressLineWidth.value), //Prevents going beyond the max width,
|
|
73
|
-
{
|
|
74
|
-
duration: isAnimated ? animationDuration : 0,
|
|
75
|
-
}
|
|
76
|
-
),
|
|
71
|
+
x2: Math.min(progressLineWidth, currentProgressLineWidth.value), //Prevents going beyond the max width
|
|
77
72
|
strokeOpacity: isBelowMinWidth ? 0.0 : 1.0,
|
|
78
73
|
};
|
|
79
74
|
});
|
|
80
75
|
|
|
81
76
|
React.useEffect(() => {
|
|
82
77
|
console.log("UPDATING TO", progressLineWidth * currentFillPercentage);
|
|
83
|
-
currentProgressLineWidth.value =
|
|
78
|
+
currentProgressLineWidth.value = withTiming(
|
|
79
|
+
progressLineWidth * currentFillPercentage,
|
|
80
|
+
{
|
|
81
|
+
duration: isAnimated ? animationDuration : 0,
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
84
|
}, [
|
|
85
85
|
value,
|
|
86
86
|
progressLineWidth,
|