@fluentui-react-native/experimental-activity-indicator 0.10.18 → 0.11.0
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.md +36 -0
- package/lib/ActivityIndicator.android.d.ts +1 -1
- package/lib/ActivityIndicator.android.js +1 -1
- package/lib/ActivityIndicator.d.ts +1 -1
- package/lib/ActivityIndicator.ios.d.ts +1 -1
- package/lib/ActivityIndicator.ios.js +1 -1
- package/lib/ActivityIndicator.js +1 -1
- package/lib/ActivityIndicator.mobile.d.ts +7 -2
- package/lib/ActivityIndicator.mobile.d.ts.map +1 -1
- package/lib/ActivityIndicator.mobile.js +91 -89
- package/lib/ActivityIndicator.mobile.js.map +1 -1
- package/lib/ActivityIndicator.styling.d.ts +15 -5
- package/lib/ActivityIndicator.styling.js +76 -67
- package/lib/ActivityIndicator.styling.js.map +1 -1
- package/lib/ActivityIndicator.types.d.ts +36 -36
- package/lib/ActivityIndicator.types.js +1 -1
- package/lib/CoreActivityIndicator.d.ts +8 -4
- package/lib/CoreActivityIndicator.d.ts.map +1 -1
- package/lib/CoreActivityIndicator.js +13 -13
- package/lib/CoreActivityIndicator.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib-commonjs/ActivityIndicator.android.d.ts +1 -1
- package/lib-commonjs/ActivityIndicator.android.js +11 -6
- package/lib-commonjs/ActivityIndicator.android.js.map +1 -1
- package/lib-commonjs/ActivityIndicator.d.ts +1 -1
- package/lib-commonjs/ActivityIndicator.ios.d.ts +1 -1
- package/lib-commonjs/ActivityIndicator.ios.js +11 -6
- package/lib-commonjs/ActivityIndicator.ios.js.map +1 -1
- package/lib-commonjs/ActivityIndicator.js +11 -6
- package/lib-commonjs/ActivityIndicator.js.map +1 -1
- package/lib-commonjs/ActivityIndicator.mobile.d.ts +7 -2
- package/lib-commonjs/ActivityIndicator.mobile.d.ts.map +1 -1
- package/lib-commonjs/ActivityIndicator.mobile.js +107 -96
- package/lib-commonjs/ActivityIndicator.mobile.js.map +1 -1
- package/lib-commonjs/ActivityIndicator.styling.d.ts +15 -5
- package/lib-commonjs/ActivityIndicator.styling.js +89 -78
- package/lib-commonjs/ActivityIndicator.styling.js.map +1 -1
- package/lib-commonjs/ActivityIndicator.types.d.ts +36 -36
- package/lib-commonjs/ActivityIndicator.types.js +3 -3
- package/lib-commonjs/CoreActivityIndicator.d.ts +8 -4
- package/lib-commonjs/CoreActivityIndicator.d.ts.map +1 -1
- package/lib-commonjs/CoreActivityIndicator.js +18 -18
- package/lib-commonjs/CoreActivityIndicator.js.map +1 -1
- package/lib-commonjs/index.d.ts +1 -1
- package/lib-commonjs/index.js +10 -5
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +56 -57
- package/src/ActivityIndicator.mobile.tsx +2 -3
- package/src/CoreActivityIndicator.tsx +2 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreActivityIndicator.d.ts","sourceRoot":"","sources":["../src/CoreActivityIndicator.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"CoreActivityIndicator.d.ts","sourceRoot":"","sources":["../src/CoreActivityIndicator.tsx"],"names":[],"mappings":"AAAA,6DAA6D;AAQ7D,OAAO,KAAK,EAA6B,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAGnG;;;GAGG;AACH,eAAO,MAAM,iBAAiB,qRAU5B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
/** @
|
|
1
|
+
import { jsx as _jsx } from '@fluentui-react-native/framework-base/jsx-runtime';
|
|
2
|
+
/** @jsxImportSource @fluentui-react-native/framework-base */
|
|
3
3
|
import { ActivityIndicator as CoreActivityIndicator } from 'react-native';
|
|
4
|
-
import { compose
|
|
4
|
+
import { compose } from '@fluentui-react-native/framework';
|
|
5
5
|
import { coreStylingSettings } from './ActivityIndicator.styling';
|
|
6
6
|
import { activityIndicatorName } from './ActivityIndicator.types';
|
|
7
7
|
/**
|
|
@@ -9,14 +9,14 @@ import { activityIndicatorName } from './ActivityIndicator.types';
|
|
|
9
9
|
* have a custom FluentUI React Native ActivityIndicator defined.
|
|
10
10
|
*/
|
|
11
11
|
export const ActivityIndicator = compose({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
displayName: activityIndicatorName,
|
|
13
|
+
...coreStylingSettings,
|
|
14
|
+
slots: {
|
|
15
|
+
root: CoreActivityIndicator,
|
|
16
|
+
},
|
|
17
|
+
useRender: (props, useSlots) => {
|
|
18
|
+
const Slots = useSlots(props);
|
|
19
|
+
return () => _jsx(Slots.root, {});
|
|
20
|
+
},
|
|
21
21
|
});
|
|
22
|
-
//# sourceMappingURL=CoreActivityIndicator.js.map
|
|
22
|
+
//# sourceMappingURL=CoreActivityIndicator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreActivityIndicator.js","sourceRoot":"","sources":["../src/CoreActivityIndicator.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"CoreActivityIndicator.js","sourceRoot":"","sources":["../src/CoreActivityIndicator.tsx"],"names":[],"mappings":";AAAA,6DAA6D;AAE7D,OAAO,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAG1E,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAA4B;IAClE,WAAW,EAAE,qBAAqB;IAClC,GAAG,mBAAmB;IACtB,KAAK,EAAE;QACL,IAAI,EAAE,qBAAqB;KAC5B;IACD,SAAS,EAAE,CAAC,KAA6B,EAAE,QAA6C,EAAE,EAAE,CAAC;QAC3F,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC9B,OAAO,GAAG,EAAE,CAAC,KAAC,KAAK,CAAC,IAAI,KAAG,CAAC;IAAA,CAC7B;CACF,CAAC,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { ActivityIndicator } from './ActivityIndicator';
|
|
2
|
-
//# sourceMappingURL=index.d.ts.map
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { ActivityIndicator } from './ActivityIndicator';
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ActivityIndicator } from './ActivityIndicator.mobile';
|
|
2
2
|
export { ActivityIndicator } from './ActivityIndicator.mobile';
|
|
3
3
|
export default ActivityIndicator;
|
|
4
|
-
//# sourceMappingURL=ActivityIndicator.android.d.ts.map
|
|
4
|
+
//# sourceMappingURL=ActivityIndicator.android.d.ts.map
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.ActivityIndicator = void 0;
|
|
4
|
-
const ActivityIndicator_mobile_1 = require(
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(exports,
|
|
4
|
+
const ActivityIndicator_mobile_1 = require('./ActivityIndicator.mobile');
|
|
5
|
+
const ActivityIndicator_mobile_2 = require('./ActivityIndicator.mobile');
|
|
6
|
+
Object.defineProperty(exports, 'ActivityIndicator', {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return ActivityIndicator_mobile_2.ActivityIndicator;
|
|
10
|
+
},
|
|
11
|
+
});
|
|
7
12
|
exports.default = ActivityIndicator_mobile_1.ActivityIndicator;
|
|
8
|
-
//# sourceMappingURL=ActivityIndicator.android.js.map
|
|
13
|
+
//# sourceMappingURL=ActivityIndicator.android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityIndicator.android.js","sourceRoot":"","sources":["../src/ActivityIndicator.android.tsx"],"names":[],"mappings":";;;AAAA,yEAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.android.js","sourceRoot":"","sources":["../src/ActivityIndicator.android.tsx"],"names":[],"mappings":";;;AAAA,yEAA+D;AAC/D,yEAA+D;AAAtD,6HAAA,iBAAiB,OAAA;kBACX,4CAAiB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ActivityIndicator } from './ActivityIndicator.mobile';
|
|
2
2
|
export { ActivityIndicator } from './ActivityIndicator.mobile';
|
|
3
3
|
export default ActivityIndicator;
|
|
4
|
-
//# sourceMappingURL=ActivityIndicator.ios.d.ts.map
|
|
4
|
+
//# sourceMappingURL=ActivityIndicator.ios.d.ts.map
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.ActivityIndicator = void 0;
|
|
4
|
-
const ActivityIndicator_mobile_1 = require(
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(exports,
|
|
4
|
+
const ActivityIndicator_mobile_1 = require('./ActivityIndicator.mobile');
|
|
5
|
+
const ActivityIndicator_mobile_2 = require('./ActivityIndicator.mobile');
|
|
6
|
+
Object.defineProperty(exports, 'ActivityIndicator', {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return ActivityIndicator_mobile_2.ActivityIndicator;
|
|
10
|
+
},
|
|
11
|
+
});
|
|
7
12
|
exports.default = ActivityIndicator_mobile_1.ActivityIndicator;
|
|
8
|
-
//# sourceMappingURL=ActivityIndicator.ios.js.map
|
|
13
|
+
//# sourceMappingURL=ActivityIndicator.ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityIndicator.ios.js","sourceRoot":"","sources":["../src/ActivityIndicator.ios.tsx"],"names":[],"mappings":";;;AAAA,yEAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.ios.js","sourceRoot":"","sources":["../src/ActivityIndicator.ios.tsx"],"names":[],"mappings":";;;AAAA,yEAA+D;AAC/D,yEAA+D;AAAtD,6HAAA,iBAAiB,OAAA;kBACX,4CAAiB"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.ActivityIndicator = void 0;
|
|
4
|
-
const CoreActivityIndicator_1 = require(
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(exports,
|
|
4
|
+
const CoreActivityIndicator_1 = require('./CoreActivityIndicator');
|
|
5
|
+
const CoreActivityIndicator_2 = require('./CoreActivityIndicator');
|
|
6
|
+
Object.defineProperty(exports, 'ActivityIndicator', {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return CoreActivityIndicator_2.ActivityIndicator;
|
|
10
|
+
},
|
|
11
|
+
});
|
|
7
12
|
exports.default = CoreActivityIndicator_1.ActivityIndicator;
|
|
8
|
-
//# sourceMappingURL=ActivityIndicator.js.map
|
|
13
|
+
//# sourceMappingURL=ActivityIndicator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityIndicator.js","sourceRoot":"","sources":["../src/ActivityIndicator.tsx"],"names":[],"mappings":";;;AAAA,mEAA4D;AAC5D,
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.js","sourceRoot":"","sources":["../src/ActivityIndicator.tsx"],"names":[],"mappings":";;;AAAA,mEAA4D;AAC5D,mEAA4D;AAAnD,0HAAA,iBAAiB,OAAA;kBACX,yCAAiB"}
|
|
@@ -2,5 +2,10 @@ import { Animated } from 'react-native';
|
|
|
2
2
|
import { Svg } from 'react-native-svg';
|
|
3
3
|
import type { ActivityIndicatorProps } from './ActivityIndicator.types';
|
|
4
4
|
export declare const AnimatedSvg: Animated.AnimatedComponent<typeof Svg>;
|
|
5
|
-
export declare const ActivityIndicator: import(
|
|
6
|
-
|
|
5
|
+
export declare const ActivityIndicator: import('@fluentui-react-native/framework').ComposableComponent<
|
|
6
|
+
ActivityIndicatorProps,
|
|
7
|
+
import('./ActivityIndicator.types').FluentActivityIndicatorSlotProps,
|
|
8
|
+
import('./ActivityIndicator.types').ActivityIndicatorTokens,
|
|
9
|
+
import('@fluentui-react-native/framework').ObjectBase
|
|
10
|
+
>;
|
|
11
|
+
//# sourceMappingURL=ActivityIndicator.mobile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityIndicator.mobile.d.ts","sourceRoot":"","sources":["../src/ActivityIndicator.mobile.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.mobile.d.ts","sourceRoot":"","sources":["../src/ActivityIndicator.mobile.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAgB,MAAM,cAAc,CAAC;AAItD,OAAO,EAAE,GAAG,EAAQ,MAAM,kBAAkB,CAAC;AAI7C,OAAO,KAAK,EAAE,sBAAsB,EAA+B,MAAM,2BAA2B,CAAC;AAcrG,eAAO,MAAM,WAAW,wCAAwC,CAAC;AAEjE,eAAO,MAAM,iBAAiB,kRAiG5B,CAAC"}
|
|
@@ -1,104 +1,115 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.ActivityIndicator = exports.AnimatedSvg = void 0;
|
|
4
|
-
|
|
5
|
-
/** @
|
|
6
|
-
const react_1 = require(
|
|
7
|
-
const react_native_1 = require(
|
|
8
|
-
const framework_1 = require(
|
|
9
|
-
const react_native_svg_1 = require(
|
|
10
|
-
const ActivityIndicator_styling_1 = require(
|
|
11
|
-
const ActivityIndicator_types_1 = require(
|
|
4
|
+
const jsx_runtime_1 = require('@fluentui-react-native/framework-base/jsx-runtime');
|
|
5
|
+
/** @jsxImportSource @fluentui-react-native/framework-base */
|
|
6
|
+
const react_1 = require('react');
|
|
7
|
+
const react_native_1 = require('react-native');
|
|
8
|
+
const framework_1 = require('@fluentui-react-native/framework');
|
|
9
|
+
const react_native_svg_1 = require('react-native-svg');
|
|
10
|
+
const ActivityIndicator_styling_1 = require('./ActivityIndicator.styling');
|
|
11
|
+
const ActivityIndicator_types_1 = require('./ActivityIndicator.types');
|
|
12
12
|
const getActivityIndicatorPath = (diameter, width, color) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
const start = {
|
|
14
|
+
x: width / 2,
|
|
15
|
+
y: diameter / 2,
|
|
16
|
+
};
|
|
17
|
+
const innerRadius = diameter / 2 - width / 2;
|
|
18
|
+
const path = `M${start.x} ${start.y} a${innerRadius} ${innerRadius} 0 1 1 ${innerRadius} ${innerRadius}`;
|
|
19
|
+
return jsx_runtime_1.jsx(react_native_svg_1.Path, {
|
|
20
|
+
d: path,
|
|
21
|
+
stroke: color,
|
|
22
|
+
strokeWidth: width,
|
|
23
|
+
strokeLinecap: 'round',
|
|
24
|
+
fill: 'transparent',
|
|
25
|
+
});
|
|
20
26
|
};
|
|
21
27
|
exports.AnimatedSvg = react_native_1.Animated.createAnimatedComponent(react_native_svg_1.Svg);
|
|
22
28
|
const useStyling = (0, framework_1.buildUseStyling)(ActivityIndicator_styling_1.stylingSettings);
|
|
23
29
|
exports.ActivityIndicator = (0, framework_1.compose)({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}, [rotationAngle, animating]);
|
|
57
|
-
const stopRotation = () => {
|
|
58
|
-
if (rotationAnimation.current) {
|
|
59
|
-
rotationAnimation.current.stop();
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
(0, react_1.useEffect)(() => {
|
|
63
|
-
if (rotationAnimation.current === undefined) {
|
|
64
|
-
rotationAnimation.current = react_native_1.Animated.sequence([
|
|
65
|
-
react_native_1.Animated.timing(rotationAngle, {
|
|
66
|
-
toValue: 359,
|
|
67
|
-
duration: 750,
|
|
68
|
-
useNativeDriver: true,
|
|
69
|
-
easing: react_native_1.Easing.linear,
|
|
70
|
-
}),
|
|
71
|
-
]);
|
|
72
|
-
}
|
|
73
|
-
if (animating) {
|
|
74
|
-
startRotation();
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
stopRotation();
|
|
78
|
-
}
|
|
79
|
-
}, [animating, hidesWhenStopped, rotationAngle]);
|
|
80
|
-
const interpolateSpin = rotationAngle.interpolate({
|
|
81
|
-
inputRange: [0, 359],
|
|
82
|
-
outputRange: ['0deg', '359deg'],
|
|
30
|
+
displayName: ActivityIndicator_types_1.activityIndicatorName,
|
|
31
|
+
...ActivityIndicator_styling_1.stylingSettings,
|
|
32
|
+
slots: {
|
|
33
|
+
root: react_native_1.View,
|
|
34
|
+
svg: exports.AnimatedSvg,
|
|
35
|
+
},
|
|
36
|
+
useRender: (props, useSlots) => {
|
|
37
|
+
const Slots = useSlots(props);
|
|
38
|
+
const slotProps = useStyling(props);
|
|
39
|
+
const animating = props.animating != undefined ? props.animating : true;
|
|
40
|
+
const hidesWhenStopped = props.hidesWhenStopped != undefined ? props.hidesWhenStopped : true;
|
|
41
|
+
// React Native ActivityIndicator still takes up space when hidden, so to perfectly match would use opacity
|
|
42
|
+
// hiding opacity makes the screen reader on iOS and Android skip over it
|
|
43
|
+
const hideOpacity = animating == false && hidesWhenStopped == true ? 0 : 1;
|
|
44
|
+
const rotationAngle = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
|
|
45
|
+
const rotationAnimation = (0, react_1.useRef)(undefined);
|
|
46
|
+
/**
|
|
47
|
+
* https://github.com/facebook/react-native/pull/29585
|
|
48
|
+
* For Animated.loop() to work with the native driver, React Native needs this fix.
|
|
49
|
+
* It's only available in React Native 0.66+, and React Native macOS 0.62+
|
|
50
|
+
* To workaround this, let's just rerun the loop everytime the animation finishes
|
|
51
|
+
*/
|
|
52
|
+
const startRotation = (0, react_1.useCallback)(() => {
|
|
53
|
+
if (rotationAnimation.current) {
|
|
54
|
+
rotationAngle.setValue(0);
|
|
55
|
+
rotationAnimation.current.reset();
|
|
56
|
+
rotationAnimation.current.start((result) => {
|
|
57
|
+
if (result.finished) {
|
|
58
|
+
startRotation();
|
|
59
|
+
}
|
|
83
60
|
});
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
61
|
+
}
|
|
62
|
+
}, [rotationAngle, animating]);
|
|
63
|
+
const stopRotation = () => {
|
|
64
|
+
if (rotationAnimation.current) {
|
|
65
|
+
rotationAnimation.current.stop();
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
(0, react_1.useEffect)(() => {
|
|
69
|
+
if (rotationAnimation.current === undefined) {
|
|
70
|
+
rotationAnimation.current = react_native_1.Animated.sequence([
|
|
71
|
+
react_native_1.Animated.timing(rotationAngle, {
|
|
72
|
+
toValue: 359,
|
|
73
|
+
duration: 750,
|
|
74
|
+
useNativeDriver: true,
|
|
75
|
+
easing: react_native_1.Easing.linear,
|
|
76
|
+
}),
|
|
77
|
+
]);
|
|
78
|
+
}
|
|
79
|
+
if (animating) {
|
|
80
|
+
startRotation();
|
|
81
|
+
} else {
|
|
82
|
+
stopRotation();
|
|
83
|
+
}
|
|
84
|
+
}, [animating, hidesWhenStopped, rotationAngle]);
|
|
85
|
+
const interpolateSpin = rotationAngle.interpolate({
|
|
86
|
+
inputRange: [0, 359],
|
|
87
|
+
outputRange: ['0deg', '359deg'],
|
|
88
|
+
});
|
|
89
|
+
const path = getActivityIndicatorPath(
|
|
90
|
+
ActivityIndicator_styling_1.diameterSizeMap[slotProps.root.size],
|
|
91
|
+
ActivityIndicator_styling_1.lineThicknessSizeMap[slotProps.root.lineThickness],
|
|
92
|
+
slotProps.root.activityIndicatorColor,
|
|
93
|
+
);
|
|
94
|
+
// perspective is needed for animations to work on Android. See https://reactnative.dev/docs/animations#bear-in-mind
|
|
95
|
+
const animatedSvgProps = {
|
|
96
|
+
style: {
|
|
97
|
+
transform: [{ rotateZ: interpolateSpin }, { perspective: 10 }],
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
const otherRootProps = {
|
|
101
|
+
style: {
|
|
102
|
+
opacity: hideOpacity,
|
|
103
|
+
},
|
|
104
|
+
accessibilityState: { busy: animating },
|
|
105
|
+
};
|
|
106
|
+
return (rest) => {
|
|
107
|
+
const { ...mergedProps } = (0, framework_1.mergeProps)(props, rest, otherRootProps);
|
|
108
|
+
return jsx_runtime_1.jsx(Slots.root, {
|
|
109
|
+
...mergedProps,
|
|
110
|
+
children: jsx_runtime_1.jsx(Slots.svg, { ...animatedSvgProps, children: path }),
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
},
|
|
103
114
|
});
|
|
104
|
-
//# sourceMappingURL=ActivityIndicator.mobile.js.map
|
|
115
|
+
//# sourceMappingURL=ActivityIndicator.mobile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityIndicator.mobile.js","sourceRoot":"","sources":["../src/ActivityIndicator.mobile.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.mobile.js","sourceRoot":"","sources":["../src/ActivityIndicator.mobile.tsx"],"names":[],"mappings":";;;;AAAA,6DAA6D;AAC7D,iCAAuD;AACvD,+CAAsD;AAGtD,gEAAwF;AACxF,uDAA6C;AAG7C,2EAAqG;AAErG,uEAAkE;AAElE,MAAM,wBAAwB,GAAG,CAAC,QAAgB,EAAE,KAAa,EAAE,KAAa,EAAE,EAAE,CAAC;IACnF,MAAM,KAAK,GAAG;QACZ,CAAC,EAAE,KAAK,GAAG,CAAC;QACZ,CAAC,EAAE,QAAQ,GAAG,CAAC;KAChB,CAAC;IACF,MAAM,WAAW,GAAG,QAAQ,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,IAAI,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,WAAW,IAAI,WAAW,UAAU,WAAW,IAAI,WAAW,EAAE,CAAC;IAEzG,OAAO,kBAAC,uBAAI,IAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,aAAa,EAAC,OAAO,EAAC,IAAI,EAAE,aAAa,GAAI,CAAC;AAAA,CACxG,CAAC;AAEW,QAAA,WAAW,GAAG,uBAAQ,CAAC,uBAAuB,CAAC,sBAAG,CAAC,CAAC;AACjE,MAAM,UAAU,GAAG,IAAA,2BAAe,EAAC,2CAAe,CAAC,CAAC;AACvC,QAAA,iBAAiB,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C;QAEF,oHAAoH;QACpH,MAAM,gBAAgB,GAAa;YACjC,KAAK,EAAE;gBACL,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;aAC/D;SACF,CAAC;QAEF,MAAM,cAAc,GAAG;YACrB,KAAK,EAAE;gBACL,OAAO,EAAE,WAAW;aACrB;YACD,kBAAkB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;SACxC,CAAC;QACF,OAAO,CAAC,IAA4B,EAAE,EAAE,CAAC;YACvC,MAAM,EAAE,GAAG,WAAW,EAAE,GAAG,IAAA,sBAAU,EAAC,KAAK,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;YACnE,OAAO,CACL,kBAAC,KAAK,CAAC,IAAI,OAAK,WAAW,YACzB,kBAAC,KAAK,CAAC,GAAG,OAAK,gBAAgB,YAAG,IAAI,GAAa,GACxC,CACd,CAAC;QAAA,CACH,CAAC;IAAA,CACH;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import type { ActivityIndicatorProps as CoreActivityIndicatorProps } from 'react-native';
|
|
2
2
|
import type { UseStylingOptions } from '@fluentui-react-native/framework';
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
ActivityIndicatorProps,
|
|
5
|
+
FluentActivityIndicatorSlotProps,
|
|
6
|
+
ActivityIndicatorTokens,
|
|
7
|
+
CoreActivityIndicatorSlotProps,
|
|
8
|
+
ActivityIndicatorSize,
|
|
9
|
+
} from './ActivityIndicator.types';
|
|
4
10
|
export declare const diameterSizeMap: {
|
|
5
|
-
|
|
11
|
+
[key: string]: number;
|
|
6
12
|
};
|
|
7
13
|
export declare const lineThicknessSizeMap: {
|
|
8
|
-
|
|
14
|
+
[key: string]: number;
|
|
9
15
|
};
|
|
10
16
|
export declare function coreSizeFromFluentSize(fluentSize: ActivityIndicatorSize): CoreActivityIndicatorProps['size'];
|
|
11
17
|
export declare const stylingSettings: UseStylingOptions<ActivityIndicatorProps, FluentActivityIndicatorSlotProps, ActivityIndicatorTokens>;
|
|
12
|
-
export declare const coreStylingSettings: UseStylingOptions<
|
|
13
|
-
|
|
18
|
+
export declare const coreStylingSettings: UseStylingOptions<
|
|
19
|
+
ActivityIndicatorProps,
|
|
20
|
+
CoreActivityIndicatorSlotProps,
|
|
21
|
+
ActivityIndicatorTokens
|
|
22
|
+
>;
|
|
23
|
+
//# sourceMappingURL=ActivityIndicator.styling.d.ts.map
|
|
@@ -1,90 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault =
|
|
3
|
+
(this && this.__importDefault) ||
|
|
4
|
+
function (mod) {
|
|
5
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
6
|
+
};
|
|
7
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8
|
+
exports.coreStylingSettings = exports.stylingSettings = exports.lineThicknessSizeMap = exports.diameterSizeMap = void 0;
|
|
9
|
+
exports.coreSizeFromFluentSize = coreSizeFromFluentSize;
|
|
10
|
+
const react_native_1 = require('react-native');
|
|
11
|
+
const framework_1 = require('@fluentui-react-native/framework');
|
|
12
|
+
const assert_never_1 = __importDefault(require('assert-never'));
|
|
13
|
+
const ActivityIndicator_types_1 = require('./ActivityIndicator.types');
|
|
11
14
|
exports.diameterSizeMap = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
xSmall: 12,
|
|
16
|
+
small: 16,
|
|
17
|
+
medium: 24,
|
|
18
|
+
large: 32,
|
|
19
|
+
xLarge: 36,
|
|
17
20
|
};
|
|
18
21
|
exports.lineThicknessSizeMap = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
xSmall: 1,
|
|
23
|
+
small: 1,
|
|
24
|
+
medium: 2,
|
|
25
|
+
large: 3,
|
|
26
|
+
xLarge: 4,
|
|
24
27
|
};
|
|
25
28
|
// Size coversion ramp from the Fluent ActivityIndicator size to the RN ActivityIndicator.
|
|
26
29
|
function coreSizeFromFluentSize(fluentSize) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
if (typeof fluentSize === 'undefined') {
|
|
31
|
+
return fluentSize;
|
|
32
|
+
}
|
|
33
|
+
switch (fluentSize) {
|
|
34
|
+
case 'xSmall':
|
|
35
|
+
return 'small';
|
|
36
|
+
case 'small':
|
|
37
|
+
return 'small';
|
|
38
|
+
case 'medium':
|
|
39
|
+
return 'small';
|
|
40
|
+
case 'large':
|
|
41
|
+
return 'large';
|
|
42
|
+
case 'xLarge':
|
|
43
|
+
return 'large';
|
|
44
|
+
default:
|
|
45
|
+
(0, assert_never_1.default)(fluentSize);
|
|
46
|
+
}
|
|
44
47
|
}
|
|
45
|
-
exports.coreSizeFromFluentSize = coreSizeFromFluentSize;
|
|
46
48
|
exports.stylingSettings = {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
49
|
+
tokens: [
|
|
50
|
+
() => ({
|
|
51
|
+
activityIndicatorColor: react_native_1.Appearance.getColorScheme() === 'light' ? '#BDBDBD' : '#666666',
|
|
52
|
+
lineThickness: 'medium',
|
|
53
|
+
size: 'medium',
|
|
54
|
+
}),
|
|
55
|
+
ActivityIndicator_types_1.activityIndicatorName,
|
|
56
|
+
],
|
|
57
|
+
tokensThatAreAlsoProps: 'all',
|
|
58
|
+
slotProps: {
|
|
59
|
+
root: (0, framework_1.buildProps)(
|
|
60
|
+
(tokens) => ({
|
|
61
|
+
activityIndicatorColor: tokens.activityIndicatorColor,
|
|
62
|
+
size: tokens.size,
|
|
63
|
+
lineThickness: tokens.lineThickness != 'medium' ? tokens.lineThickness : tokens.size,
|
|
64
|
+
accessibilityLabel: 'progressbar',
|
|
65
|
+
accessible: true,
|
|
66
|
+
style: {
|
|
67
|
+
width: exports.diameterSizeMap[tokens.size],
|
|
68
|
+
height: exports.diameterSizeMap[tokens.size],
|
|
69
|
+
},
|
|
70
|
+
}),
|
|
71
|
+
['activityIndicatorColor', 'lineThickness', 'size'],
|
|
72
|
+
),
|
|
73
|
+
svg: (0, framework_1.buildProps)(
|
|
74
|
+
(tokens) => ({
|
|
75
|
+
width: exports.diameterSizeMap[tokens.size],
|
|
76
|
+
height: exports.diameterSizeMap[tokens.size],
|
|
77
|
+
}),
|
|
78
|
+
['size'],
|
|
79
|
+
),
|
|
80
|
+
},
|
|
73
81
|
};
|
|
74
82
|
// Minimal styling settings for the RN Core ActivityIndicator
|
|
75
83
|
exports.coreStylingSettings = {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}),
|
|
88
|
-
|
|
84
|
+
tokens: [
|
|
85
|
+
() => ({
|
|
86
|
+
size: 'small',
|
|
87
|
+
}),
|
|
88
|
+
ActivityIndicator_types_1.activityIndicatorName,
|
|
89
|
+
],
|
|
90
|
+
tokensThatAreAlsoProps: 'all',
|
|
91
|
+
slotProps: {
|
|
92
|
+
root: (0, framework_1.buildProps)(
|
|
93
|
+
(tokens) => ({
|
|
94
|
+
color: tokens.activityIndicatorColor,
|
|
95
|
+
...(tokens.size && { size: coreSizeFromFluentSize(tokens.size) }), // Only pass in the prop if defined
|
|
96
|
+
}),
|
|
97
|
+
['activityIndicatorColor', 'size'],
|
|
98
|
+
),
|
|
99
|
+
},
|
|
89
100
|
};
|
|
90
|
-
//# sourceMappingURL=ActivityIndicator.styling.js.map
|
|
101
|
+
//# sourceMappingURL=ActivityIndicator.styling.js.map
|