@fluentui-react-native/experimental-activity-indicator 0.3.26 → 0.5.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.
- package/CHANGELOG.json +113 -1
- package/CHANGELOG.md +39 -2
- package/lib/ActivityIndicator.android.d.ts +4 -0
- package/lib/ActivityIndicator.android.d.ts.map +1 -0
- package/lib/ActivityIndicator.android.js +4 -0
- package/lib/ActivityIndicator.android.js.map +1 -0
- package/lib/ActivityIndicator.d.ts +3 -5
- package/lib/ActivityIndicator.d.ts.map +1 -1
- package/lib/ActivityIndicator.ios.d.ts +4 -0
- package/lib/ActivityIndicator.ios.d.ts.map +1 -0
- package/lib/ActivityIndicator.ios.js +4 -0
- package/lib/ActivityIndicator.ios.js.map +1 -0
- package/lib/ActivityIndicator.js +3 -90
- package/lib/ActivityIndicator.js.map +1 -1
- package/lib/ActivityIndicator.mobile.d.ts +6 -0
- package/lib/ActivityIndicator.mobile.d.ts.map +1 -0
- package/lib/ActivityIndicator.mobile.js +117 -0
- package/lib/ActivityIndicator.mobile.js.map +1 -0
- package/lib/ActivityIndicator.styling.d.ts +5 -2
- package/lib/ActivityIndicator.styling.d.ts.map +1 -1
- package/lib/ActivityIndicator.styling.js +45 -0
- package/lib/ActivityIndicator.styling.js.map +1 -1
- package/lib/ActivityIndicator.types.d.ts +17 -9
- package/lib/ActivityIndicator.types.d.ts.map +1 -1
- package/lib/CoreActivityIndicator.d.ts +8 -0
- package/lib/CoreActivityIndicator.d.ts.map +1 -0
- package/lib/CoreActivityIndicator.js +27 -0
- package/lib/CoreActivityIndicator.js.map +1 -0
- package/lib-commonjs/ActivityIndicator.android.d.ts +4 -0
- package/lib-commonjs/ActivityIndicator.android.d.ts.map +1 -0
- package/lib-commonjs/ActivityIndicator.android.js +7 -0
- package/lib-commonjs/ActivityIndicator.android.js.map +1 -0
- package/lib-commonjs/ActivityIndicator.d.ts +3 -5
- package/lib-commonjs/ActivityIndicator.d.ts.map +1 -1
- package/lib-commonjs/ActivityIndicator.ios.d.ts +4 -0
- package/lib-commonjs/ActivityIndicator.ios.d.ts.map +1 -0
- package/lib-commonjs/ActivityIndicator.ios.js +7 -0
- package/lib-commonjs/ActivityIndicator.ios.js.map +1 -0
- package/lib-commonjs/ActivityIndicator.js +4 -90
- package/lib-commonjs/ActivityIndicator.js.map +1 -1
- package/lib-commonjs/ActivityIndicator.mobile.d.ts +6 -0
- package/lib-commonjs/ActivityIndicator.mobile.d.ts.map +1 -0
- package/lib-commonjs/ActivityIndicator.mobile.js +119 -0
- package/lib-commonjs/ActivityIndicator.mobile.js.map +1 -0
- package/lib-commonjs/ActivityIndicator.styling.d.ts +5 -2
- package/lib-commonjs/ActivityIndicator.styling.d.ts.map +1 -1
- package/lib-commonjs/ActivityIndicator.styling.js +49 -0
- package/lib-commonjs/ActivityIndicator.styling.js.map +1 -1
- package/lib-commonjs/ActivityIndicator.types.d.ts +17 -9
- package/lib-commonjs/ActivityIndicator.types.d.ts.map +1 -1
- package/lib-commonjs/CoreActivityIndicator.d.ts +8 -0
- package/lib-commonjs/CoreActivityIndicator.d.ts.map +1 -0
- package/lib-commonjs/CoreActivityIndicator.js +29 -0
- package/lib-commonjs/CoreActivityIndicator.js.map +1 -0
- package/package.json +8 -7
- package/src/ActivityIndicator.android.tsx +3 -0
- package/src/ActivityIndicator.ios.tsx +3 -0
- package/src/ActivityIndicator.mobile.tsx +119 -0
- package/src/ActivityIndicator.styling.tsx +48 -3
- package/src/ActivityIndicator.tsx +3 -89
- package/src/ActivityIndicator.types.tsx +19 -10
- package/src/CoreActivityIndicator.tsx +22 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @jsx withSlots */
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
import { ActivityIndicator as CoreActivityIndicator } from 'react-native';
|
|
14
|
+
import { activityIndicatorName } from './ActivityIndicator.types';
|
|
15
|
+
import { coreStylingSettings } from './ActivityIndicator.styling';
|
|
16
|
+
import { compose, withSlots } from '@fluentui-react-native/framework';
|
|
17
|
+
/**
|
|
18
|
+
* Wrapper around React Native Core's ActivityIndicator for platforms we do not
|
|
19
|
+
* have a custom FluentUI React Native ActivityIndicator defined.
|
|
20
|
+
*/
|
|
21
|
+
export var ActivityIndicator = compose(__assign(__assign({ displayName: activityIndicatorName }, coreStylingSettings), { slots: {
|
|
22
|
+
root: CoreActivityIndicator,
|
|
23
|
+
}, render: function (props, useSlots) {
|
|
24
|
+
var Slots = useSlots(props);
|
|
25
|
+
return function () { return withSlots(Slots.root, null); };
|
|
26
|
+
} }));
|
|
27
|
+
//# sourceMappingURL=CoreActivityIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoreActivityIndicator.js","sourceRoot":"","sources":["../src/CoreActivityIndicator.tsx"],"names":[],"mappings":"AAAA,qBAAqB;;;;;;;;;;;;AAErB,OAAO,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAqD,MAAM,2BAA2B,CAAC;AACrH,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAY,MAAM,kCAAkC,CAAC;AAEhF;;;GAGG;AACH,MAAM,CAAC,IAAM,iBAAiB,GAAG,OAAO,qBACtC,WAAW,EAAE,qBAAqB,IAC/B,mBAAmB,KACtB,KAAK,EAAE;QACL,IAAI,EAAE,qBAAqB;KAC5B,EACD,MAAM,EAAE,UAAC,KAA6B,EAAE,QAA6C;QACnF,IAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC9B,OAAO,cAAM,OAAA,UAAC,KAAK,CAAC,IAAI,OAAG,EAAd,CAAc,CAAC;IAC9B,CAAC,IACD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.android.d.ts","sourceRoot":"","sources":["../src/ActivityIndicator.android.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var ActivityIndicator_mobile_1 = require("./ActivityIndicator.mobile");
|
|
4
|
+
var ActivityIndicator_mobile_2 = require("./ActivityIndicator.mobile");
|
|
5
|
+
exports.ActivityIndicator = ActivityIndicator_mobile_2.ActivityIndicator;
|
|
6
|
+
exports.default = ActivityIndicator_mobile_1.ActivityIndicator;
|
|
7
|
+
//# sourceMappingURL=ActivityIndicator.android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.android.js","sourceRoot":"","sources":["../src/ActivityIndicator.android.tsx"],"names":[],"mappings":";;AAAA,uEAA+D;AAC/D,uEAA+D;AAAtD,uDAAA,iBAAiB,CAAA;AAC1B,kBAAe,4CAAiB,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare const AnimatedSvg: Animated.AnimatedComponent<import("react").ComponentClass<import("react-native-svg").SvgProps, any>>;
|
|
5
|
-
export declare const ActivityIndicator: import("@fluentui-react-native/composition").ComposeFactoryComponent<ActivityIndicatorProps, import("./ActivityIndicator.types").ActivityIndicatorSlotProps, import("./ActivityIndicator.types").ActivityIndicatorTokens, import("@fluentui-react-native/framework").Theme, object>;
|
|
1
|
+
import { ActivityIndicator } from './CoreActivityIndicator';
|
|
2
|
+
export { ActivityIndicator } from './CoreActivityIndicator';
|
|
3
|
+
export default ActivityIndicator;
|
|
6
4
|
//# sourceMappingURL=ActivityIndicator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityIndicator.d.ts","sourceRoot":"","sources":["../src/ActivityIndicator.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.d.ts","sourceRoot":"","sources":["../src/ActivityIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.ios.d.ts","sourceRoot":"","sources":["../src/ActivityIndicator.ios.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var ActivityIndicator_mobile_1 = require("./ActivityIndicator.mobile");
|
|
4
|
+
var ActivityIndicator_mobile_2 = require("./ActivityIndicator.mobile");
|
|
5
|
+
exports.ActivityIndicator = ActivityIndicator_mobile_2.ActivityIndicator;
|
|
6
|
+
exports.default = ActivityIndicator_mobile_1.ActivityIndicator;
|
|
7
|
+
//# sourceMappingURL=ActivityIndicator.ios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.ios.js","sourceRoot":"","sources":["../src/ActivityIndicator.ios.tsx"],"names":[],"mappings":";;AAAA,uEAA+D;AAC/D,uEAA+D;AAAtD,uDAAA,iBAAiB,CAAA;AAC1B,kBAAe,4CAAiB,CAAC"}
|
|
@@ -1,93 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var framework_1 = require("@fluentui-react-native/framework");
|
|
30
|
-
var ActivityIndicator_types_1 = require("./ActivityIndicator.types");
|
|
31
|
-
var ActivityIndicator_styling_1 = require("./ActivityIndicator.styling");
|
|
32
|
-
var getActivityIndicatorPath = function (diameter, width, color) {
|
|
33
|
-
var start = {
|
|
34
|
-
x: width / 2,
|
|
35
|
-
y: diameter / 2,
|
|
36
|
-
};
|
|
37
|
-
var innerRadius = diameter / 2 - width / 2;
|
|
38
|
-
var path = "M" + start.x + " " + start.y + " a" + innerRadius + " " + innerRadius + " 0 1 1 " + innerRadius + " " + innerRadius;
|
|
39
|
-
return framework_1.withSlots(react_native_svg_1.Path, { d: path, stroke: color, strokeWidth: width, strokeLinecap: "round" });
|
|
40
|
-
};
|
|
41
|
-
exports.AnimatedSvg = react_native_1.Animated.createAnimatedComponent(react_native_svg_1.Svg);
|
|
42
|
-
var useStyling = framework_1.buildUseStyling(ActivityIndicator_styling_1.stylingSettings);
|
|
43
|
-
exports.ActivityIndicator = framework_1.compose(__assign(__assign({ displayName: ActivityIndicator_types_1.activityIndicatorName }, ActivityIndicator_styling_1.stylingSettings), { slots: {
|
|
44
|
-
root: react_native_1.View,
|
|
45
|
-
svg: exports.AnimatedSvg,
|
|
46
|
-
}, render: function (props, useSlots) {
|
|
47
|
-
var Slots = useSlots(props);
|
|
48
|
-
var slotProps = useStyling(props);
|
|
49
|
-
var animating = props.animating != undefined ? props.animating : true;
|
|
50
|
-
var hidesWhenStopped = props.hidesWhenStopped != undefined ? props.hidesWhenStopped : true;
|
|
51
|
-
// React Native ActivityIndicator still takes up space when hidden, so to perfectly match would use opacity
|
|
52
|
-
// hiding opacity makes the screen reader on iOS and Android skip over it
|
|
53
|
-
var hideOpacity = animating == false && hidesWhenStopped == true ? 0 : 1;
|
|
54
|
-
var spinAnimation = react_1.useRef(new react_native_1.Animated.Value(0)).current;
|
|
55
|
-
react_1.useEffect(function () {
|
|
56
|
-
if (animating) {
|
|
57
|
-
react_native_1.Animated.loop(react_native_1.Animated.sequence([
|
|
58
|
-
react_native_1.Animated.timing(spinAnimation, {
|
|
59
|
-
toValue: 359,
|
|
60
|
-
duration: 750,
|
|
61
|
-
useNativeDriver: false,
|
|
62
|
-
easing: react_native_1.Easing.linear,
|
|
63
|
-
}),
|
|
64
|
-
])).start();
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
spinAnimation.stopAnimation();
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
var interpolateSpin = spinAnimation.interpolate({
|
|
71
|
-
inputRange: [0, 359],
|
|
72
|
-
outputRange: ['0deg', '359deg'],
|
|
73
|
-
});
|
|
74
|
-
var path = getActivityIndicatorPath(ActivityIndicator_styling_1.diameterSizeMap[slotProps.root.size], ActivityIndicator_styling_1.lineThicknessSizeMap[slotProps.root.lineThickness], slotProps.root.activityIndicatorColor);
|
|
75
|
-
// perspective is needed for animations to work on Android. See https://reactnative.dev/docs/animations#bear-in-mind
|
|
76
|
-
var animatedSvgProps = {
|
|
77
|
-
style: {
|
|
78
|
-
transform: [{ rotateZ: interpolateSpin }, { perspective: 10 }],
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
var otherRootProps = {
|
|
82
|
-
style: {
|
|
83
|
-
opacity: hideOpacity,
|
|
84
|
-
},
|
|
85
|
-
accessibilityState: { busy: animating },
|
|
86
|
-
};
|
|
87
|
-
return function (rest) {
|
|
88
|
-
var mergedProps = __rest(framework_1.mergeProps(props, rest, otherRootProps), []);
|
|
89
|
-
return (framework_1.withSlots(Slots.root, __assign({}, mergedProps),
|
|
90
|
-
framework_1.withSlots(Slots.svg, __assign({}, animatedSvgProps), path)));
|
|
91
|
-
};
|
|
92
|
-
} }));
|
|
3
|
+
var CoreActivityIndicator_1 = require("./CoreActivityIndicator");
|
|
4
|
+
var CoreActivityIndicator_2 = require("./CoreActivityIndicator");
|
|
5
|
+
exports.ActivityIndicator = CoreActivityIndicator_2.ActivityIndicator;
|
|
6
|
+
exports.default = CoreActivityIndicator_1.ActivityIndicator;
|
|
93
7
|
//# sourceMappingURL=ActivityIndicator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityIndicator.js","sourceRoot":"","sources":["../src/ActivityIndicator.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.js","sourceRoot":"","sources":["../src/ActivityIndicator.tsx"],"names":[],"mappings":";;AAAA,iEAA4D;AAC5D,iEAA4D;AAAnD,oDAAA,iBAAiB,CAAA;AAC1B,kBAAe,yCAAiB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Animated } from 'react-native';
|
|
3
|
+
import { ActivityIndicatorProps } from './ActivityIndicator.types';
|
|
4
|
+
export declare const AnimatedSvg: Animated.AnimatedComponent<import("react").ComponentClass<import("react-native-svg").SvgProps, any>>;
|
|
5
|
+
export declare const ActivityIndicator: import("@fluentui-react-native/composition").ComposeFactoryComponent<ActivityIndicatorProps, import("./ActivityIndicator.types").FluentActivityIndicatorSlotProps, import("./ActivityIndicator.types").ActivityIndicatorTokens, import("@fluentui-react-native/framework").Theme, object>;
|
|
6
|
+
//# sourceMappingURL=ActivityIndicator.mobile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.mobile.d.ts","sourceRoot":"","sources":["../src/ActivityIndicator.mobile.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAgB,MAAM,cAAc,CAAC;AAGtD,OAAO,EAAyB,sBAAsB,EAA+B,MAAM,2BAA2B,CAAC;AAcvH,eAAO,MAAM,WAAW,sGAAwC,CAAC;AAEjE,eAAO,MAAM,iBAAiB,2RAiG5B,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
/** @jsx withSlots */
|
|
26
|
+
var react_1 = require("react");
|
|
27
|
+
var react_native_1 = require("react-native");
|
|
28
|
+
var react_native_svg_1 = require("react-native-svg");
|
|
29
|
+
var framework_1 = require("@fluentui-react-native/framework");
|
|
30
|
+
var ActivityIndicator_types_1 = require("./ActivityIndicator.types");
|
|
31
|
+
var ActivityIndicator_styling_1 = require("./ActivityIndicator.styling");
|
|
32
|
+
var getActivityIndicatorPath = function (diameter, width, color) {
|
|
33
|
+
var start = {
|
|
34
|
+
x: width / 2,
|
|
35
|
+
y: diameter / 2,
|
|
36
|
+
};
|
|
37
|
+
var innerRadius = diameter / 2 - width / 2;
|
|
38
|
+
var path = "M" + start.x + " " + start.y + " a" + innerRadius + " " + innerRadius + " 0 1 1 " + innerRadius + " " + innerRadius;
|
|
39
|
+
return framework_1.withSlots(react_native_svg_1.Path, { d: path, stroke: color, strokeWidth: width, strokeLinecap: "round" });
|
|
40
|
+
};
|
|
41
|
+
exports.AnimatedSvg = react_native_1.Animated.createAnimatedComponent(react_native_svg_1.Svg);
|
|
42
|
+
var useStyling = framework_1.buildUseStyling(ActivityIndicator_styling_1.stylingSettings);
|
|
43
|
+
exports.ActivityIndicator = framework_1.compose(__assign(__assign({ displayName: ActivityIndicator_types_1.activityIndicatorName }, ActivityIndicator_styling_1.stylingSettings), { slots: {
|
|
44
|
+
root: react_native_1.View,
|
|
45
|
+
svg: exports.AnimatedSvg,
|
|
46
|
+
}, render: function (props, useSlots) {
|
|
47
|
+
var Slots = useSlots(props);
|
|
48
|
+
var slotProps = useStyling(props);
|
|
49
|
+
var animating = props.animating != undefined ? props.animating : true;
|
|
50
|
+
var hidesWhenStopped = props.hidesWhenStopped != undefined ? props.hidesWhenStopped : true;
|
|
51
|
+
// React Native ActivityIndicator still takes up space when hidden, so to perfectly match would use opacity
|
|
52
|
+
// hiding opacity makes the screen reader on iOS and Android skip over it
|
|
53
|
+
var hideOpacity = animating == false && hidesWhenStopped == true ? 0 : 1;
|
|
54
|
+
var rotationAngle = react_1.useRef(new react_native_1.Animated.Value(0)).current;
|
|
55
|
+
var rotationAnimation = react_1.useRef(undefined);
|
|
56
|
+
/**
|
|
57
|
+
* https://github.com/facebook/react-native/pull/29585
|
|
58
|
+
* For Animated.loop() to work with the native driver, React Native needs this fix.
|
|
59
|
+
* It's only available in React Native 0.66+, and React Native macOS 0.62+
|
|
60
|
+
* To workaround this, let's just rerun the loop everytime the animation finishes
|
|
61
|
+
*/
|
|
62
|
+
var startRotation = react_1.useCallback(function () {
|
|
63
|
+
if (rotationAnimation.current) {
|
|
64
|
+
rotationAngle.setValue(0);
|
|
65
|
+
rotationAnimation.current.reset();
|
|
66
|
+
rotationAnimation.current.start(function (result) {
|
|
67
|
+
if (result.finished) {
|
|
68
|
+
startRotation();
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}, [rotationAngle, animating]);
|
|
73
|
+
var stopRotation = function () {
|
|
74
|
+
if (rotationAnimation.current) {
|
|
75
|
+
rotationAnimation.current.stop();
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
react_1.useEffect(function () {
|
|
79
|
+
if (rotationAnimation.current === undefined) {
|
|
80
|
+
rotationAnimation.current = react_native_1.Animated.sequence([
|
|
81
|
+
react_native_1.Animated.timing(rotationAngle, {
|
|
82
|
+
toValue: 359,
|
|
83
|
+
duration: 750,
|
|
84
|
+
useNativeDriver: true,
|
|
85
|
+
easing: react_native_1.Easing.linear,
|
|
86
|
+
}),
|
|
87
|
+
]);
|
|
88
|
+
}
|
|
89
|
+
if (animating) {
|
|
90
|
+
startRotation();
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
stopRotation();
|
|
94
|
+
}
|
|
95
|
+
}, [animating, hidesWhenStopped, rotationAngle]);
|
|
96
|
+
var interpolateSpin = rotationAngle.interpolate({
|
|
97
|
+
inputRange: [0, 359],
|
|
98
|
+
outputRange: ['0deg', '359deg'],
|
|
99
|
+
});
|
|
100
|
+
var path = getActivityIndicatorPath(ActivityIndicator_styling_1.diameterSizeMap[slotProps.root.size], ActivityIndicator_styling_1.lineThicknessSizeMap[slotProps.root.lineThickness], slotProps.root.activityIndicatorColor);
|
|
101
|
+
// perspective is needed for animations to work on Android. See https://reactnative.dev/docs/animations#bear-in-mind
|
|
102
|
+
var animatedSvgProps = {
|
|
103
|
+
style: {
|
|
104
|
+
transform: [{ rotateZ: interpolateSpin }, { perspective: 10 }],
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
var otherRootProps = {
|
|
108
|
+
style: {
|
|
109
|
+
opacity: hideOpacity,
|
|
110
|
+
},
|
|
111
|
+
accessibilityState: { busy: animating },
|
|
112
|
+
};
|
|
113
|
+
return function (rest) {
|
|
114
|
+
var mergedProps = __rest(framework_1.mergeProps(props, rest, otherRootProps), []);
|
|
115
|
+
return (framework_1.withSlots(Slots.root, __assign({}, mergedProps),
|
|
116
|
+
framework_1.withSlots(Slots.svg, __assign({}, animatedSvgProps), path)));
|
|
117
|
+
};
|
|
118
|
+
} }));
|
|
119
|
+
//# sourceMappingURL=ActivityIndicator.mobile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.mobile.js","sourceRoot":"","sources":["../src/ActivityIndicator.mobile.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;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
+
import { ActivityIndicatorProps as CoreActivityIndicatorProps } from 'react-native';
|
|
3
|
+
import { ActivityIndicatorProps, FluentActivityIndicatorSlotProps, ActivityIndicatorTokens, CoreActivityIndicatorSlotProps, ActivityIndicatorSize } from './ActivityIndicator.types';
|
|
3
4
|
export declare const diameterSizeMap: {
|
|
4
5
|
[key: string]: number;
|
|
5
6
|
};
|
|
6
7
|
export declare const lineThicknessSizeMap: {
|
|
7
8
|
[key: string]: number;
|
|
8
9
|
};
|
|
9
|
-
export declare
|
|
10
|
+
export declare function coreSizeFromFluentSize(fluentSize: ActivityIndicatorSize): CoreActivityIndicatorProps['size'];
|
|
11
|
+
export declare const stylingSettings: UseStylingOptions<ActivityIndicatorProps, FluentActivityIndicatorSlotProps, ActivityIndicatorTokens>;
|
|
12
|
+
export declare const coreStylingSettings: UseStylingOptions<ActivityIndicatorProps, CoreActivityIndicatorSlotProps, ActivityIndicatorTokens>;
|
|
10
13
|
//# sourceMappingURL=ActivityIndicator.styling.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityIndicator.styling.d.ts","sourceRoot":"","sources":["../src/ActivityIndicator.styling.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAc,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.styling.d.ts","sourceRoot":"","sources":["../src/ActivityIndicator.styling.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAc,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,sBAAsB,IAAI,0BAA0B,EAAc,MAAM,cAAc,CAAC;AAChG,OAAO,EAEL,sBAAsB,EACtB,gCAAgC,EAChC,uBAAuB,EACvB,8BAA8B,EAC9B,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;AAGnC,eAAO,MAAM,eAAe,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAMpD,CAAC;AACF,eAAO,MAAM,oBAAoB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAMzD,CAAC;AAGF,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,qBAAqB,GAAG,0BAA0B,CAAC,MAAM,CAAC,CAmB5G;AAED,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,sBAAsB,EAAE,gCAAgC,EAAE,uBAAuB,CAiChI,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,CAAC,sBAAsB,EAAE,8BAA8B,EAAE,uBAAuB,CAiBlI,CAAC"}
|
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
var framework_1 = require("@fluentui-react-native/framework");
|
|
4
18
|
var react_native_1 = require("react-native");
|
|
5
19
|
var ActivityIndicator_types_1 = require("./ActivityIndicator.types");
|
|
20
|
+
var assert_never_1 = __importDefault(require("assert-never"));
|
|
6
21
|
exports.diameterSizeMap = {
|
|
7
22
|
xSmall: 12,
|
|
8
23
|
small: 16,
|
|
@@ -17,6 +32,27 @@ exports.lineThicknessSizeMap = {
|
|
|
17
32
|
large: 3,
|
|
18
33
|
xLarge: 4,
|
|
19
34
|
};
|
|
35
|
+
// Size coversion ramp from the Fluent ActivityIndicator size to the RN ActivityIndicator.
|
|
36
|
+
function coreSizeFromFluentSize(fluentSize) {
|
|
37
|
+
if (typeof fluentSize === 'undefined') {
|
|
38
|
+
return fluentSize;
|
|
39
|
+
}
|
|
40
|
+
switch (fluentSize) {
|
|
41
|
+
case 'xSmall':
|
|
42
|
+
return 'small';
|
|
43
|
+
case 'small':
|
|
44
|
+
return 'small';
|
|
45
|
+
case 'medium':
|
|
46
|
+
return 'small';
|
|
47
|
+
case 'large':
|
|
48
|
+
return 'large';
|
|
49
|
+
case 'xLarge':
|
|
50
|
+
return 'large';
|
|
51
|
+
default:
|
|
52
|
+
assert_never_1.default(fluentSize);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.coreSizeFromFluentSize = coreSizeFromFluentSize;
|
|
20
56
|
exports.stylingSettings = {
|
|
21
57
|
tokens: [
|
|
22
58
|
function () { return ({
|
|
@@ -45,4 +81,17 @@ exports.stylingSettings = {
|
|
|
45
81
|
}); }, ['size']),
|
|
46
82
|
},
|
|
47
83
|
};
|
|
84
|
+
// Minimal styling settings for the RN Core ActivityIndicator
|
|
85
|
+
exports.coreStylingSettings = {
|
|
86
|
+
tokens: [
|
|
87
|
+
function () { return ({
|
|
88
|
+
size: 'small',
|
|
89
|
+
}); },
|
|
90
|
+
ActivityIndicator_types_1.activityIndicatorName,
|
|
91
|
+
],
|
|
92
|
+
tokensThatAreAlsoProps: 'all',
|
|
93
|
+
slotProps: {
|
|
94
|
+
root: framework_1.buildProps(function (tokens) { return (__assign({ color: tokens.activityIndicatorColor }, (tokens.size && { size: coreSizeFromFluentSize(tokens.size) }))); }, ['activityIndicatorColor', 'size']),
|
|
95
|
+
},
|
|
96
|
+
};
|
|
48
97
|
//# sourceMappingURL=ActivityIndicator.styling.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityIndicator.styling.js","sourceRoot":"","sources":["../src/ActivityIndicator.styling.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ActivityIndic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Animated,
|
|
1
|
+
import { Animated, ActivityIndicatorProps as CoreActivityIndicatorProps } from 'react-native';
|
|
2
2
|
import { SvgProps } from 'react-native-svg';
|
|
3
3
|
export declare const activityIndicatorName = "ActivityIndicator";
|
|
4
4
|
/**
|
|
5
|
-
* Specifies the possible sizes of the ActivityIndicator
|
|
5
|
+
* Specifies the possible sizes of the ActivityIndicator.
|
|
6
6
|
*/
|
|
7
7
|
export declare type ActivityIndicatorSize = 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge';
|
|
8
8
|
export interface ActivityIndicatorTokens {
|
|
@@ -22,11 +22,7 @@ export interface ActivityIndicatorTokens {
|
|
|
22
22
|
*/
|
|
23
23
|
size?: ActivityIndicatorSize;
|
|
24
24
|
}
|
|
25
|
-
export interface
|
|
26
|
-
root: ViewProps & ActivityIndicatorTokens;
|
|
27
|
-
svg: Animated.AnimatedProps<SvgProps>;
|
|
28
|
-
}
|
|
29
|
-
export interface ActivityIndicatorProps extends ActivityIndicatorTokens, ViewProps {
|
|
25
|
+
export interface ActivityIndicatorProps extends ActivityIndicatorTokens, Omit<CoreActivityIndicatorProps, 'size'> {
|
|
30
26
|
/**
|
|
31
27
|
* ActivityIndicator animating or not
|
|
32
28
|
* @defaultValue 'true'
|
|
@@ -38,9 +34,21 @@ export interface ActivityIndicatorProps extends ActivityIndicatorTokens, ViewPro
|
|
|
38
34
|
*/
|
|
39
35
|
hidesWhenStopped?: boolean;
|
|
40
36
|
}
|
|
41
|
-
export interface
|
|
37
|
+
export interface FluentActivityIndicatorSlotProps {
|
|
38
|
+
root: ActivityIndicatorProps;
|
|
39
|
+
svg: Animated.AnimatedProps<SvgProps>;
|
|
40
|
+
}
|
|
41
|
+
export interface FluentActivityIndicatorType {
|
|
42
|
+
props: ActivityIndicatorProps;
|
|
43
|
+
slotProps: FluentActivityIndicatorSlotProps;
|
|
44
|
+
tokens: ActivityIndicatorTokens;
|
|
45
|
+
}
|
|
46
|
+
export interface CoreActivityIndicatorSlotProps {
|
|
47
|
+
root: CoreActivityIndicatorProps;
|
|
48
|
+
}
|
|
49
|
+
export interface CoreActivityIndicatorType {
|
|
42
50
|
props: ActivityIndicatorProps;
|
|
43
|
-
slotProps:
|
|
51
|
+
slotProps: CoreActivityIndicatorSlotProps;
|
|
44
52
|
tokens: ActivityIndicatorTokens;
|
|
45
53
|
}
|
|
46
54
|
//# sourceMappingURL=ActivityIndicator.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityIndicator.types.d.ts","sourceRoot":"","sources":["../src/ActivityIndicator.types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.types.d.ts","sourceRoot":"","sources":["../src/ActivityIndicator.types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,sBAAsB,IAAI,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC9F,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AACzD;;GAEG;AACH,oBAAY,qBAAqB,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEvF,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;OAGG;IACH,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC;;;OAGG;IACH,IAAI,CAAC,EAAE,qBAAqB,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAuB,SAAQ,uBAAuB,EAAE,IAAI,CAAC,0BAA0B,EAAE,MAAM,CAAC;IAC/G;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,gCAAgC;IAC/C,IAAI,EAAE,sBAAsB,CAAC;IAC7B,GAAG,EAAE,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;CACvC;AACD,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,sBAAsB,CAAC;IAC9B,SAAS,EAAE,gCAAgC,CAAC;IAC5C,MAAM,EAAE,uBAAuB,CAAC;CACjC;AAED,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,0BAA0B,CAAC;CAClC;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,sBAAsB,CAAC;IAC9B,SAAS,EAAE,8BAA8B,CAAC;IAC1C,MAAM,EAAE,uBAAuB,CAAC;CACjC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @jsx withSlots */
|
|
2
|
+
import { ActivityIndicatorProps } from './ActivityIndicator.types';
|
|
3
|
+
/**
|
|
4
|
+
* Wrapper around React Native Core's ActivityIndicator for platforms we do not
|
|
5
|
+
* have a custom FluentUI React Native ActivityIndicator defined.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ActivityIndicator: import("@fluentui-react-native/composition").ComposeFactoryComponent<ActivityIndicatorProps, import("./ActivityIndicator.types").CoreActivityIndicatorSlotProps, import("./ActivityIndicator.types").ActivityIndicatorTokens, import("@fluentui-react-native/framework").Theme, object>;
|
|
8
|
+
//# sourceMappingURL=CoreActivityIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoreActivityIndicator.d.ts","sourceRoot":"","sources":["../src/CoreActivityIndicator.tsx"],"names":[],"mappings":"AAAA,qBAAqB;AAGrB,OAAO,EAAoD,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAIrH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,yRAU5B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** @jsx withSlots */
|
|
3
|
+
var __assign = (this && this.__assign) || function () {
|
|
4
|
+
__assign = Object.assign || function(t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
+
t[p] = s[p];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
return __assign.apply(this, arguments);
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
var react_native_1 = require("react-native");
|
|
16
|
+
var ActivityIndicator_types_1 = require("./ActivityIndicator.types");
|
|
17
|
+
var ActivityIndicator_styling_1 = require("./ActivityIndicator.styling");
|
|
18
|
+
var framework_1 = require("@fluentui-react-native/framework");
|
|
19
|
+
/**
|
|
20
|
+
* Wrapper around React Native Core's ActivityIndicator for platforms we do not
|
|
21
|
+
* have a custom FluentUI React Native ActivityIndicator defined.
|
|
22
|
+
*/
|
|
23
|
+
exports.ActivityIndicator = framework_1.compose(__assign(__assign({ displayName: ActivityIndicator_types_1.activityIndicatorName }, ActivityIndicator_styling_1.coreStylingSettings), { slots: {
|
|
24
|
+
root: react_native_1.ActivityIndicator,
|
|
25
|
+
}, render: function (props, useSlots) {
|
|
26
|
+
var Slots = useSlots(props);
|
|
27
|
+
return function () { return framework_1.withSlots(Slots.root, null); };
|
|
28
|
+
} }));
|
|
29
|
+
//# sourceMappingURL=CoreActivityIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoreActivityIndicator.js","sourceRoot":"","sources":["../src/CoreActivityIndicator.tsx"],"names":[],"mappings":";AAAA,qBAAqB;;;;;;;;;;;;;AAErB,6CAA0E;AAC1E,qEAAqH;AACrH,yEAAkE;AAClE,8DAAgF;AAEhF;;;GAGG;AACU,QAAA,iBAAiB,GAAG,mBAAO,qBACtC,WAAW,EAAE,+CAAqB,IAC/B,+CAAmB,KACtB,KAAK,EAAE;QACL,IAAI,EAAE,gCAAqB;KAC5B,EACD,MAAM,EAAE,UAAC,KAA6B,EAAE,QAA6C;QACnF,IAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC9B,OAAO,cAAM,OAAA,sBAAC,KAAK,CAAC,IAAI,OAAG,EAAd,CAAc,CAAC;IAC9B,CAAC,IACD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/experimental-activity-indicator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "A cross-platform Fluent Activity Indicator component",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -17,18 +17,19 @@
|
|
|
17
17
|
"prettier-fix": "fluentui-scripts prettier --fix true"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@fluentui-react-native/framework": "0.
|
|
20
|
+
"@fluentui-react-native/framework": "0.7.2",
|
|
21
|
+
"assert-never": "^1.2.1",
|
|
21
22
|
"react-native-svg": "^12.1.1"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
|
-
"@
|
|
25
|
+
"@fluentui-react-native/eslint-config-rules": "^0.1.1",
|
|
26
|
+
"@types/react-native": "^0.64.0",
|
|
25
27
|
"@uifabricshared/build-native": "^0.1.1",
|
|
26
|
-
"
|
|
27
|
-
"react-native": "^0.63.4"
|
|
28
|
+
"react-native": "^0.64.3"
|
|
28
29
|
},
|
|
29
30
|
"peerDependencies": {
|
|
30
|
-
"react
|
|
31
|
-
"react": "
|
|
31
|
+
"react": "17.0.1",
|
|
32
|
+
"react-native": ">=0.64.3"
|
|
32
33
|
},
|
|
33
34
|
"author": "",
|
|
34
35
|
"license": "MIT"
|