@react-aria/progress 3.1.5 → 3.1.8
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/dist/index.js +12 -12
- package/dist/module.js +12 -12
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $
|
|
3
|
-
var $
|
|
1
|
+
var $jaqU8$reactariautils = require("@react-aria/utils");
|
|
2
|
+
var $jaqU8$reactarialabel = require("@react-aria/label");
|
|
3
|
+
var $jaqU8$reactariai18n = require("@react-aria/i18n");
|
|
4
4
|
|
|
5
5
|
function $parcel$exportWildcard(dest, source) {
|
|
6
6
|
Object.keys(source).forEach(function(key) {
|
|
@@ -21,34 +21,34 @@ function $parcel$exportWildcard(dest, source) {
|
|
|
21
21
|
function $parcel$export(e, n, v, s) {
|
|
22
22
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
23
23
|
}
|
|
24
|
-
var $
|
|
24
|
+
var $c6bb999a3b4eb4f3$exports = {};
|
|
25
25
|
|
|
26
|
-
$parcel$export($
|
|
26
|
+
$parcel$export($c6bb999a3b4eb4f3$exports, "useProgressBar", () => $c6bb999a3b4eb4f3$export$ed5abd763a836edc);
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
function $
|
|
30
|
+
function $c6bb999a3b4eb4f3$export$ed5abd763a836edc(props) {
|
|
31
31
|
let { value: value = 0 , minValue: minValue = 0 , maxValue: maxValue = 100 , valueLabel: valueLabel , isIndeterminate: isIndeterminate , formatOptions: formatOptions = {
|
|
32
32
|
style: 'percent'
|
|
33
33
|
} } = props;
|
|
34
|
-
let domProps = $
|
|
34
|
+
let domProps = $jaqU8$reactariautils.filterDOMProps(props, {
|
|
35
35
|
labelable: true
|
|
36
36
|
});
|
|
37
|
-
let { labelProps: labelProps , fieldProps: fieldProps } = $
|
|
37
|
+
let { labelProps: labelProps , fieldProps: fieldProps } = $jaqU8$reactarialabel.useLabel({
|
|
38
38
|
...props,
|
|
39
39
|
// Progress bar is not an HTML input element so it
|
|
40
40
|
// shouldn't be labeled by a <label> element.
|
|
41
41
|
labelElementType: 'span'
|
|
42
42
|
});
|
|
43
|
-
value = $
|
|
43
|
+
value = $jaqU8$reactariautils.clamp(value, minValue, maxValue);
|
|
44
44
|
let percentage = (value - minValue) / (maxValue - minValue);
|
|
45
|
-
let formatter = $
|
|
45
|
+
let formatter = $jaqU8$reactariai18n.useNumberFormatter(formatOptions);
|
|
46
46
|
if (!isIndeterminate && !valueLabel) {
|
|
47
47
|
let valueToFormat = formatOptions.style === 'percent' ? percentage : value;
|
|
48
48
|
valueLabel = formatter.format(valueToFormat);
|
|
49
49
|
}
|
|
50
50
|
return {
|
|
51
|
-
progressBarProps: $
|
|
51
|
+
progressBarProps: $jaqU8$reactariautils.mergeProps(domProps, {
|
|
52
52
|
...fieldProps,
|
|
53
53
|
'aria-valuenow': isIndeterminate ? undefined : value,
|
|
54
54
|
'aria-valuemin': minValue,
|
|
@@ -61,7 +61,7 @@ function $0a93f89481d2e8b4$export$ed5abd763a836edc(props) {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
$parcel$exportWildcard(module.exports, $
|
|
64
|
+
$parcel$exportWildcard(module.exports, $c6bb999a3b4eb4f3$exports);
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
//# sourceMappingURL=index.js.map
|
package/dist/module.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import {filterDOMProps as $
|
|
2
|
-
import {useLabel as $
|
|
3
|
-
import {useNumberFormatter as $
|
|
1
|
+
import {filterDOMProps as $e3Dei$filterDOMProps, clamp as $e3Dei$clamp, mergeProps as $e3Dei$mergeProps} from "@react-aria/utils";
|
|
2
|
+
import {useLabel as $e3Dei$useLabel} from "@react-aria/label";
|
|
3
|
+
import {useNumberFormatter as $e3Dei$useNumberFormatter} from "@react-aria/i18n";
|
|
4
4
|
|
|
5
5
|
function $parcel$export(e, n, v, s) {
|
|
6
6
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
7
7
|
}
|
|
8
|
-
var $
|
|
8
|
+
var $204d9ebcedfb8806$exports = {};
|
|
9
9
|
|
|
10
|
-
$parcel$export($
|
|
10
|
+
$parcel$export($204d9ebcedfb8806$exports, "useProgressBar", () => $204d9ebcedfb8806$export$ed5abd763a836edc);
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
function $
|
|
14
|
+
function $204d9ebcedfb8806$export$ed5abd763a836edc(props) {
|
|
15
15
|
let { value: value = 0 , minValue: minValue = 0 , maxValue: maxValue = 100 , valueLabel: valueLabel , isIndeterminate: isIndeterminate , formatOptions: formatOptions = {
|
|
16
16
|
style: 'percent'
|
|
17
17
|
} } = props;
|
|
18
|
-
let domProps = $
|
|
18
|
+
let domProps = $e3Dei$filterDOMProps(props, {
|
|
19
19
|
labelable: true
|
|
20
20
|
});
|
|
21
|
-
let { labelProps: labelProps , fieldProps: fieldProps } = $
|
|
21
|
+
let { labelProps: labelProps , fieldProps: fieldProps } = $e3Dei$useLabel({
|
|
22
22
|
...props,
|
|
23
23
|
// Progress bar is not an HTML input element so it
|
|
24
24
|
// shouldn't be labeled by a <label> element.
|
|
25
25
|
labelElementType: 'span'
|
|
26
26
|
});
|
|
27
|
-
value = $
|
|
27
|
+
value = $e3Dei$clamp(value, minValue, maxValue);
|
|
28
28
|
let percentage = (value - minValue) / (maxValue - minValue);
|
|
29
|
-
let formatter = $
|
|
29
|
+
let formatter = $e3Dei$useNumberFormatter(formatOptions);
|
|
30
30
|
if (!isIndeterminate && !valueLabel) {
|
|
31
31
|
let valueToFormat = formatOptions.style === 'percent' ? percentage : value;
|
|
32
32
|
valueLabel = formatter.format(valueToFormat);
|
|
33
33
|
}
|
|
34
34
|
return {
|
|
35
|
-
progressBarProps: $
|
|
35
|
+
progressBarProps: $e3Dei$mergeProps(domProps, {
|
|
36
36
|
...fieldProps,
|
|
37
37
|
'aria-valuenow': isIndeterminate ? undefined : value,
|
|
38
38
|
'aria-valuemin': minValue,
|
|
@@ -47,5 +47,5 @@ function $bfde0caba5aedf6c$export$ed5abd763a836edc(props) {
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
export {$
|
|
50
|
+
export {$204d9ebcedfb8806$export$ed5abd763a836edc as useProgressBar};
|
|
51
51
|
//# sourceMappingURL=module.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/progress",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.8",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/runtime": "^7.6.2",
|
|
21
|
-
"@react-aria/i18n": "^3.3.
|
|
22
|
-
"@react-aria/label": "^3.2.
|
|
23
|
-
"@react-aria/utils": "^3.
|
|
24
|
-
"@react-types/progress": "^3.1.
|
|
25
|
-
"@react-types/shared": "^3.
|
|
21
|
+
"@react-aria/i18n": "^3.3.9",
|
|
22
|
+
"@react-aria/label": "^3.2.5",
|
|
23
|
+
"@react-aria/utils": "^3.12.0",
|
|
24
|
+
"@react-types/progress": "^3.1.6",
|
|
25
|
+
"@react-types/shared": "^3.12.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^16.8.0 || ^17.0.0-rc.1"
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "6a503b715e0dbbf92038cd7f08b1bcdde4c78e82"
|
|
34
34
|
}
|