@react-spectrum/labeledvalue 3.1.8-nightly.4230 → 3.1.8-nightly.4245
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/import.mjs +96 -57
- package/dist/main.js +94 -55
- package/dist/main.js.map +1 -1
- package/dist/module.js +96 -57
- package/dist/module.js.map +1 -1
- package/package.json +9 -9
package/dist/import.mjs
CHANGED
@@ -6,68 +6,79 @@ import {filterDOMProps as $3xnHL$filterDOMProps} from "@react-aria/utils";
|
|
6
6
|
import $3xnHL$react from "react";
|
7
7
|
import {useListFormatter as $3xnHL$useListFormatter, useNumberFormatter as $3xnHL$useNumberFormatter, useDateFormatter as $3xnHL$useDateFormatter} from "@react-aria/i18n";
|
8
8
|
|
9
|
-
|
10
|
-
return a && a.__esModule ? a.default : a;
|
11
|
-
}
|
9
|
+
|
12
10
|
function $parcel$export(e, n, v, s) {
|
13
11
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
14
12
|
}
|
15
|
-
/*
|
16
|
-
* Copyright 2022 Adobe. All rights reserved.
|
17
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
18
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
19
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
20
|
-
*
|
21
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
22
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
23
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
24
|
-
* governing permissions and limitations under the License.
|
25
|
-
*/ /// <reference types="css-module-types" />
|
26
|
-
/*
|
27
|
-
* Copyright 2020 Adobe. All rights reserved.
|
28
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
29
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
30
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
31
|
-
*
|
32
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
33
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
34
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
35
|
-
* governing permissions and limitations under the License.
|
36
|
-
*/
|
37
13
|
|
14
|
+
function $parcel$interopDefault(a) {
|
15
|
+
return a && a.__esModule ? a.default : a;
|
16
|
+
}
|
17
|
+
|
18
|
+
var $parcel$global = globalThis;
|
19
|
+
|
20
|
+
var $parcel$modules = {};
|
21
|
+
var $parcel$inits = {};
|
38
22
|
|
23
|
+
var parcelRequire = $parcel$global["parcelRequire7f0c"];
|
39
24
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
$parcel$
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
$parcel$
|
48
|
-
|
49
|
-
$parcel$
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
$parcel$
|
60
|
-
|
61
|
-
|
62
|
-
$parcel$
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
$parcel$export(
|
69
|
-
$parcel$export(
|
70
|
-
$parcel$export(
|
25
|
+
if (parcelRequire == null) {
|
26
|
+
parcelRequire = function(id) {
|
27
|
+
if (id in $parcel$modules) {
|
28
|
+
return $parcel$modules[id].exports;
|
29
|
+
}
|
30
|
+
if (id in $parcel$inits) {
|
31
|
+
var init = $parcel$inits[id];
|
32
|
+
delete $parcel$inits[id];
|
33
|
+
var module = {id: id, exports: {}};
|
34
|
+
$parcel$modules[id] = module;
|
35
|
+
init.call(module.exports, module, module.exports);
|
36
|
+
return module.exports;
|
37
|
+
}
|
38
|
+
var err = new Error("Cannot find module '" + id + "'");
|
39
|
+
err.code = 'MODULE_NOT_FOUND';
|
40
|
+
throw err;
|
41
|
+
};
|
42
|
+
|
43
|
+
parcelRequire.register = function register(id, init) {
|
44
|
+
$parcel$inits[id] = init;
|
45
|
+
};
|
46
|
+
|
47
|
+
$parcel$global["parcelRequire7f0c"] = parcelRequire;
|
48
|
+
}
|
49
|
+
|
50
|
+
var parcelRegister = parcelRequire.register;
|
51
|
+
parcelRegister("hBWiT", function(module, exports) {
|
52
|
+
|
53
|
+
$parcel$export(module.exports, "contextualHelp", () => $cd231e464c886c86$export$4ba534aba1836d, (v) => $cd231e464c886c86$export$4ba534aba1836d = v);
|
54
|
+
$parcel$export(module.exports, "field", () => $cd231e464c886c86$export$e0f35d825088c098, (v) => $cd231e464c886c86$export$e0f35d825088c098 = v);
|
55
|
+
$parcel$export(module.exports, "focus-ring", () => $cd231e464c886c86$export$f39a09f249340e2a, (v) => $cd231e464c886c86$export$f39a09f249340e2a = v);
|
56
|
+
$parcel$export(module.exports, "helpText", () => $cd231e464c886c86$export$431a3b688422af44, (v) => $cd231e464c886c86$export$431a3b688422af44 = v);
|
57
|
+
$parcel$export(module.exports, "i18nFontFamily", () => $cd231e464c886c86$export$8c4ee2c50c22c514, (v) => $cd231e464c886c86$export$8c4ee2c50c22c514 = v);
|
58
|
+
$parcel$export(module.exports, "is-disabled", () => $cd231e464c886c86$export$d35bc1e505d1ebbf, (v) => $cd231e464c886c86$export$d35bc1e505d1ebbf = v);
|
59
|
+
$parcel$export(module.exports, "label", () => $cd231e464c886c86$export$1237798dc640739a, (v) => $cd231e464c886c86$export$1237798dc640739a = v);
|
60
|
+
$parcel$export(module.exports, "spectrum-Field", () => $cd231e464c886c86$export$f6d480ae1e56eba0, (v) => $cd231e464c886c86$export$f6d480ae1e56eba0 = v);
|
61
|
+
$parcel$export(module.exports, "spectrum-Field--alignEnd", () => $cd231e464c886c86$export$5354c9be7ada5f83, (v) => $cd231e464c886c86$export$5354c9be7ada5f83 = v);
|
62
|
+
$parcel$export(module.exports, "spectrum-Field--hasContextualHelp", () => $cd231e464c886c86$export$9ba23707a252cdd4, (v) => $cd231e464c886c86$export$9ba23707a252cdd4 = v);
|
63
|
+
$parcel$export(module.exports, "spectrum-Field--positionSide", () => $cd231e464c886c86$export$2963225c91179589, (v) => $cd231e464c886c86$export$2963225c91179589 = v);
|
64
|
+
$parcel$export(module.exports, "spectrum-Field--positionTop", () => $cd231e464c886c86$export$a4ea780a9064d7f9, (v) => $cd231e464c886c86$export$a4ea780a9064d7f9 = v);
|
65
|
+
$parcel$export(module.exports, "spectrum-Field-contextualHelp", () => $cd231e464c886c86$export$24fb860d16dd2d3f, (v) => $cd231e464c886c86$export$24fb860d16dd2d3f = v);
|
66
|
+
$parcel$export(module.exports, "spectrum-Field-field", () => $cd231e464c886c86$export$3ab8a3dc7f0563d, (v) => $cd231e464c886c86$export$3ab8a3dc7f0563d = v);
|
67
|
+
$parcel$export(module.exports, "spectrum-Field-labelCell", () => $cd231e464c886c86$export$9cde5aecff012641, (v) => $cd231e464c886c86$export$9cde5aecff012641 = v);
|
68
|
+
$parcel$export(module.exports, "spectrum-Field-labelWrapper", () => $cd231e464c886c86$export$a872a8c78b26c9e0, (v) => $cd231e464c886c86$export$a872a8c78b26c9e0 = v);
|
69
|
+
$parcel$export(module.exports, "spectrum-Field-wrapper", () => $cd231e464c886c86$export$127df0b7290eb8ef, (v) => $cd231e464c886c86$export$127df0b7290eb8ef = v);
|
70
|
+
$parcel$export(module.exports, "spectrum-FieldLabel", () => $cd231e464c886c86$export$493d18e796ae054, (v) => $cd231e464c886c86$export$493d18e796ae054 = v);
|
71
|
+
$parcel$export(module.exports, "spectrum-FieldLabel--alignEnd", () => $cd231e464c886c86$export$885efcc08143a987, (v) => $cd231e464c886c86$export$885efcc08143a987 = v);
|
72
|
+
$parcel$export(module.exports, "spectrum-FieldLabel--positionSide", () => $cd231e464c886c86$export$9e6f19dc21f22f2e, (v) => $cd231e464c886c86$export$9e6f19dc21f22f2e = v);
|
73
|
+
$parcel$export(module.exports, "spectrum-FieldLabel-requiredIcon", () => $cd231e464c886c86$export$7c47642c7d46f3c9, (v) => $cd231e464c886c86$export$7c47642c7d46f3c9 = v);
|
74
|
+
$parcel$export(module.exports, "spectrum-FocusRing-ring", () => $cd231e464c886c86$export$4109102f950813a6, (v) => $cd231e464c886c86$export$4109102f950813a6 = v);
|
75
|
+
$parcel$export(module.exports, "spectrum-FocusRing", () => $cd231e464c886c86$export$24c7f46a6e3605dd, (v) => $cd231e464c886c86$export$24c7f46a6e3605dd = v);
|
76
|
+
$parcel$export(module.exports, "spectrum-FocusRing--quiet", () => $cd231e464c886c86$export$2927016961429360, (v) => $cd231e464c886c86$export$2927016961429360 = v);
|
77
|
+
$parcel$export(module.exports, "spectrum-Form", () => $cd231e464c886c86$export$94d2bcc94afabd89, (v) => $cd231e464c886c86$export$94d2bcc94afabd89 = v);
|
78
|
+
$parcel$export(module.exports, "spectrum-Form--positionSide", () => $cd231e464c886c86$export$7f44db659563c8f4, (v) => $cd231e464c886c86$export$7f44db659563c8f4 = v);
|
79
|
+
$parcel$export(module.exports, "spectrum-Form--positionTop", () => $cd231e464c886c86$export$11b8bc81fe551057, (v) => $cd231e464c886c86$export$11b8bc81fe551057 = v);
|
80
|
+
$parcel$export(module.exports, "spectrum-Form-itemLabel", () => $cd231e464c886c86$export$51ec27881a1e3928, (v) => $cd231e464c886c86$export$51ec27881a1e3928 = v);
|
81
|
+
$parcel$export(module.exports, "spectrum-LabeledValue", () => $cd231e464c886c86$export$79f9a5e9dd010c8d, (v) => $cd231e464c886c86$export$79f9a5e9dd010c8d = v);
|
71
82
|
var $cd231e464c886c86$export$4ba534aba1836d;
|
72
83
|
var $cd231e464c886c86$export$e0f35d825088c098;
|
73
84
|
var $cd231e464c886c86$export$f39a09f249340e2a;
|
@@ -127,7 +138,35 @@ $cd231e464c886c86$export$11b8bc81fe551057 = `A-HlBa_spectrum-Form--positionTop`;
|
|
127
138
|
$cd231e464c886c86$export$51ec27881a1e3928 = `A-HlBa_spectrum-Form-itemLabel`;
|
128
139
|
$cd231e464c886c86$export$79f9a5e9dd010c8d = `A-HlBa_spectrum-LabeledValue`;
|
129
140
|
|
141
|
+
});
|
142
|
+
|
143
|
+
/*
|
144
|
+
* Copyright 2022 Adobe. All rights reserved.
|
145
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
146
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
147
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
148
|
+
*
|
149
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
150
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
151
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
152
|
+
* governing permissions and limitations under the License.
|
153
|
+
*/ /// <reference types="css-module-types" />
|
154
|
+
/*
|
155
|
+
* Copyright 2020 Adobe. All rights reserved.
|
156
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
157
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
158
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
159
|
+
*
|
160
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
161
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
162
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
163
|
+
* governing permissions and limitations under the License.
|
164
|
+
*/
|
165
|
+
|
166
|
+
|
167
|
+
|
130
168
|
|
169
|
+
var $hBWiT = parcelRequire("hBWiT");
|
131
170
|
|
132
171
|
|
133
172
|
function $3e9971be431adb24$var$LabeledValue(props, ref) {
|
@@ -161,7 +200,7 @@ function $3e9971be431adb24$var$LabeledValue(props, ref) {
|
|
161
200
|
wrapperProps: (0, $3xnHL$filterDOMProps)(props),
|
162
201
|
ref: domRef,
|
163
202
|
elementType: "span",
|
164
|
-
wrapperClassName: (0, $3xnHL$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($
|
203
|
+
wrapperClassName: (0, $3xnHL$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($hBWiT))), "spectrum-LabeledValue")
|
165
204
|
}, /*#__PURE__*/ (0, $3xnHL$react).createElement("span", null, children));
|
166
205
|
}
|
167
206
|
function $3e9971be431adb24$var$FormattedStringList(props) {
|
package/dist/main.js
CHANGED
@@ -6,70 +6,79 @@ var $3cJLQ$reactariautils = require("@react-aria/utils");
|
|
6
6
|
var $3cJLQ$react = require("react");
|
7
7
|
var $3cJLQ$reactariai18n = require("@react-aria/i18n");
|
8
8
|
|
9
|
+
|
9
10
|
function $parcel$export(e, n, v, s) {
|
10
11
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
11
12
|
}
|
13
|
+
|
12
14
|
function $parcel$interopDefault(a) {
|
13
15
|
return a && a.__esModule ? a.default : a;
|
14
16
|
}
|
15
17
|
|
16
|
-
$parcel$
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
21
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
22
|
-
*
|
23
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
24
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
25
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
26
|
-
* governing permissions and limitations under the License.
|
27
|
-
*/ /// <reference types="css-module-types" />
|
28
|
-
/*
|
29
|
-
* Copyright 2020 Adobe. All rights reserved.
|
30
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
31
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
32
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
33
|
-
*
|
34
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
35
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
36
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
37
|
-
* governing permissions and limitations under the License.
|
38
|
-
*/
|
18
|
+
var $parcel$global = globalThis;
|
19
|
+
|
20
|
+
var $parcel$modules = {};
|
21
|
+
var $parcel$inits = {};
|
39
22
|
|
23
|
+
var parcelRequire = $parcel$global["parcelRequire7f0c"];
|
40
24
|
|
25
|
+
if (parcelRequire == null) {
|
26
|
+
parcelRequire = function(id) {
|
27
|
+
if (id in $parcel$modules) {
|
28
|
+
return $parcel$modules[id].exports;
|
29
|
+
}
|
30
|
+
if (id in $parcel$inits) {
|
31
|
+
var init = $parcel$inits[id];
|
32
|
+
delete $parcel$inits[id];
|
33
|
+
var module = {id: id, exports: {}};
|
34
|
+
$parcel$modules[id] = module;
|
35
|
+
init.call(module.exports, module, module.exports);
|
36
|
+
return module.exports;
|
37
|
+
}
|
38
|
+
var err = new Error("Cannot find module '" + id + "'");
|
39
|
+
err.code = 'MODULE_NOT_FOUND';
|
40
|
+
throw err;
|
41
|
+
};
|
42
|
+
|
43
|
+
parcelRequire.register = function register(id, init) {
|
44
|
+
$parcel$inits[id] = init;
|
45
|
+
};
|
46
|
+
|
47
|
+
$parcel$global["parcelRequire7f0c"] = parcelRequire;
|
48
|
+
}
|
41
49
|
|
42
|
-
var
|
43
|
-
|
44
|
-
|
45
|
-
$parcel$export(
|
46
|
-
$parcel$export(
|
47
|
-
$parcel$export(
|
48
|
-
$parcel$export(
|
49
|
-
$parcel$export(
|
50
|
-
$parcel$export(
|
51
|
-
$parcel$export(
|
52
|
-
$parcel$export(
|
53
|
-
$parcel$export(
|
54
|
-
$parcel$export(
|
55
|
-
$parcel$export(
|
56
|
-
$parcel$export(
|
57
|
-
$parcel$export(
|
58
|
-
$parcel$export(
|
59
|
-
$parcel$export(
|
60
|
-
$parcel$export(
|
61
|
-
$parcel$export(
|
62
|
-
$parcel$export(
|
63
|
-
$parcel$export(
|
64
|
-
$parcel$export(
|
65
|
-
$parcel$export(
|
66
|
-
$parcel$export(
|
67
|
-
$parcel$export(
|
68
|
-
$parcel$export(
|
69
|
-
$parcel$export(
|
70
|
-
$parcel$export(
|
71
|
-
$parcel$export(
|
72
|
-
$parcel$export(
|
50
|
+
var parcelRegister = parcelRequire.register;
|
51
|
+
parcelRegister("kbTks", function(module, exports) {
|
52
|
+
|
53
|
+
$parcel$export(module.exports, "contextualHelp", () => $eb2fc0ee655eff6b$export$4ba534aba1836d, (v) => $eb2fc0ee655eff6b$export$4ba534aba1836d = v);
|
54
|
+
$parcel$export(module.exports, "field", () => $eb2fc0ee655eff6b$export$e0f35d825088c098, (v) => $eb2fc0ee655eff6b$export$e0f35d825088c098 = v);
|
55
|
+
$parcel$export(module.exports, "focus-ring", () => $eb2fc0ee655eff6b$export$f39a09f249340e2a, (v) => $eb2fc0ee655eff6b$export$f39a09f249340e2a = v);
|
56
|
+
$parcel$export(module.exports, "helpText", () => $eb2fc0ee655eff6b$export$431a3b688422af44, (v) => $eb2fc0ee655eff6b$export$431a3b688422af44 = v);
|
57
|
+
$parcel$export(module.exports, "i18nFontFamily", () => $eb2fc0ee655eff6b$export$8c4ee2c50c22c514, (v) => $eb2fc0ee655eff6b$export$8c4ee2c50c22c514 = v);
|
58
|
+
$parcel$export(module.exports, "is-disabled", () => $eb2fc0ee655eff6b$export$d35bc1e505d1ebbf, (v) => $eb2fc0ee655eff6b$export$d35bc1e505d1ebbf = v);
|
59
|
+
$parcel$export(module.exports, "label", () => $eb2fc0ee655eff6b$export$1237798dc640739a, (v) => $eb2fc0ee655eff6b$export$1237798dc640739a = v);
|
60
|
+
$parcel$export(module.exports, "spectrum-Field", () => $eb2fc0ee655eff6b$export$f6d480ae1e56eba0, (v) => $eb2fc0ee655eff6b$export$f6d480ae1e56eba0 = v);
|
61
|
+
$parcel$export(module.exports, "spectrum-Field--alignEnd", () => $eb2fc0ee655eff6b$export$5354c9be7ada5f83, (v) => $eb2fc0ee655eff6b$export$5354c9be7ada5f83 = v);
|
62
|
+
$parcel$export(module.exports, "spectrum-Field--hasContextualHelp", () => $eb2fc0ee655eff6b$export$9ba23707a252cdd4, (v) => $eb2fc0ee655eff6b$export$9ba23707a252cdd4 = v);
|
63
|
+
$parcel$export(module.exports, "spectrum-Field--positionSide", () => $eb2fc0ee655eff6b$export$2963225c91179589, (v) => $eb2fc0ee655eff6b$export$2963225c91179589 = v);
|
64
|
+
$parcel$export(module.exports, "spectrum-Field--positionTop", () => $eb2fc0ee655eff6b$export$a4ea780a9064d7f9, (v) => $eb2fc0ee655eff6b$export$a4ea780a9064d7f9 = v);
|
65
|
+
$parcel$export(module.exports, "spectrum-Field-contextualHelp", () => $eb2fc0ee655eff6b$export$24fb860d16dd2d3f, (v) => $eb2fc0ee655eff6b$export$24fb860d16dd2d3f = v);
|
66
|
+
$parcel$export(module.exports, "spectrum-Field-field", () => $eb2fc0ee655eff6b$export$3ab8a3dc7f0563d, (v) => $eb2fc0ee655eff6b$export$3ab8a3dc7f0563d = v);
|
67
|
+
$parcel$export(module.exports, "spectrum-Field-labelCell", () => $eb2fc0ee655eff6b$export$9cde5aecff012641, (v) => $eb2fc0ee655eff6b$export$9cde5aecff012641 = v);
|
68
|
+
$parcel$export(module.exports, "spectrum-Field-labelWrapper", () => $eb2fc0ee655eff6b$export$a872a8c78b26c9e0, (v) => $eb2fc0ee655eff6b$export$a872a8c78b26c9e0 = v);
|
69
|
+
$parcel$export(module.exports, "spectrum-Field-wrapper", () => $eb2fc0ee655eff6b$export$127df0b7290eb8ef, (v) => $eb2fc0ee655eff6b$export$127df0b7290eb8ef = v);
|
70
|
+
$parcel$export(module.exports, "spectrum-FieldLabel", () => $eb2fc0ee655eff6b$export$493d18e796ae054, (v) => $eb2fc0ee655eff6b$export$493d18e796ae054 = v);
|
71
|
+
$parcel$export(module.exports, "spectrum-FieldLabel--alignEnd", () => $eb2fc0ee655eff6b$export$885efcc08143a987, (v) => $eb2fc0ee655eff6b$export$885efcc08143a987 = v);
|
72
|
+
$parcel$export(module.exports, "spectrum-FieldLabel--positionSide", () => $eb2fc0ee655eff6b$export$9e6f19dc21f22f2e, (v) => $eb2fc0ee655eff6b$export$9e6f19dc21f22f2e = v);
|
73
|
+
$parcel$export(module.exports, "spectrum-FieldLabel-requiredIcon", () => $eb2fc0ee655eff6b$export$7c47642c7d46f3c9, (v) => $eb2fc0ee655eff6b$export$7c47642c7d46f3c9 = v);
|
74
|
+
$parcel$export(module.exports, "spectrum-FocusRing-ring", () => $eb2fc0ee655eff6b$export$4109102f950813a6, (v) => $eb2fc0ee655eff6b$export$4109102f950813a6 = v);
|
75
|
+
$parcel$export(module.exports, "spectrum-FocusRing", () => $eb2fc0ee655eff6b$export$24c7f46a6e3605dd, (v) => $eb2fc0ee655eff6b$export$24c7f46a6e3605dd = v);
|
76
|
+
$parcel$export(module.exports, "spectrum-FocusRing--quiet", () => $eb2fc0ee655eff6b$export$2927016961429360, (v) => $eb2fc0ee655eff6b$export$2927016961429360 = v);
|
77
|
+
$parcel$export(module.exports, "spectrum-Form", () => $eb2fc0ee655eff6b$export$94d2bcc94afabd89, (v) => $eb2fc0ee655eff6b$export$94d2bcc94afabd89 = v);
|
78
|
+
$parcel$export(module.exports, "spectrum-Form--positionSide", () => $eb2fc0ee655eff6b$export$7f44db659563c8f4, (v) => $eb2fc0ee655eff6b$export$7f44db659563c8f4 = v);
|
79
|
+
$parcel$export(module.exports, "spectrum-Form--positionTop", () => $eb2fc0ee655eff6b$export$11b8bc81fe551057, (v) => $eb2fc0ee655eff6b$export$11b8bc81fe551057 = v);
|
80
|
+
$parcel$export(module.exports, "spectrum-Form-itemLabel", () => $eb2fc0ee655eff6b$export$51ec27881a1e3928, (v) => $eb2fc0ee655eff6b$export$51ec27881a1e3928 = v);
|
81
|
+
$parcel$export(module.exports, "spectrum-LabeledValue", () => $eb2fc0ee655eff6b$export$79f9a5e9dd010c8d, (v) => $eb2fc0ee655eff6b$export$79f9a5e9dd010c8d = v);
|
73
82
|
var $eb2fc0ee655eff6b$export$4ba534aba1836d;
|
74
83
|
var $eb2fc0ee655eff6b$export$e0f35d825088c098;
|
75
84
|
var $eb2fc0ee655eff6b$export$f39a09f249340e2a;
|
@@ -129,7 +138,37 @@ $eb2fc0ee655eff6b$export$11b8bc81fe551057 = `A-HlBa_spectrum-Form--positionTop`;
|
|
129
138
|
$eb2fc0ee655eff6b$export$51ec27881a1e3928 = `A-HlBa_spectrum-Form-itemLabel`;
|
130
139
|
$eb2fc0ee655eff6b$export$79f9a5e9dd010c8d = `A-HlBa_spectrum-LabeledValue`;
|
131
140
|
|
141
|
+
});
|
142
|
+
|
143
|
+
|
144
|
+
$parcel$export(module.exports, "LabeledValue", () => $2a7417c2df2197f7$export$d1328f67a56fa517);
|
145
|
+
/*
|
146
|
+
* Copyright 2022 Adobe. All rights reserved.
|
147
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
148
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
149
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
150
|
+
*
|
151
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
152
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
153
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
154
|
+
* governing permissions and limitations under the License.
|
155
|
+
*/ /// <reference types="css-module-types" />
|
156
|
+
/*
|
157
|
+
* Copyright 2020 Adobe. All rights reserved.
|
158
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
159
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
160
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
161
|
+
*
|
162
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
163
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
164
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
165
|
+
* governing permissions and limitations under the License.
|
166
|
+
*/
|
167
|
+
|
168
|
+
|
169
|
+
|
132
170
|
|
171
|
+
var $kbTks = parcelRequire("kbTks");
|
133
172
|
|
134
173
|
|
135
174
|
function $2a7417c2df2197f7$var$LabeledValue(props, ref) {
|
@@ -163,7 +202,7 @@ function $2a7417c2df2197f7$var$LabeledValue(props, ref) {
|
|
163
202
|
wrapperProps: (0, $3cJLQ$reactariautils.filterDOMProps)(props),
|
164
203
|
ref: domRef,
|
165
204
|
elementType: "span",
|
166
|
-
wrapperClassName: (0, $3cJLQ$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($
|
205
|
+
wrapperClassName: (0, $3cJLQ$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($kbTks))), "spectrum-LabeledValue")
|
167
206
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement("span", null, children));
|
168
207
|
}
|
169
208
|
function $2a7417c2df2197f7$var$FormattedStringList(props) {
|
package/dist/main.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVD,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AA5BA,0CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA0B,CAAC,YAAY,CAAC;AACxC,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA6B,CAAC,eAAe,CAAC;AAC9C,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA0B,CAAC,YAAY,CAAC;AACxC,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA6C,CAAC,+BAA+B,CAAC;A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AO;IAC7C;IAEA,QAAQ,sCAAgB,OAAO;IAC/B,qBAAO,sHAAG,cAAc,OAAO;AACjC;AAEA,SAAS,sCAAgB,KAAe,EAAE,QAAa;IACrD,IAAI,cAAc,OAChB,OAAO,MAAM;SACR,IAAI,cAAc,OACvB,OAAO,MAAM,OAAO;SACf,IAAI,CAAE,CAAA,iBAAiB,IAAG,GAC/B,OAAO,mCAAa,OAAO,OAAO;IAGpC,OAAO;AACT;AAEA,SAAS,8CAAwB,KAAe;IAC9C,IAAI,iBAAiB,MACnB,OAAO;QAAC,WAAW;QAAQ,WAAW;IAAO;SACxC,IAAI,cAAc,OACvB,OAAO;QAAC,MAAM;QAAW,OAAO;QAAQ,KAAK;QAAW,MAAM;QAAW,QAAQ;QAAW,UAAU,MAAM;QAAU,cAAc;IAAO;SACtI,IAAI,UAAU,SAAS,UAAU,OACtC,OAAO;QAAC,WAAW;QAAQ,WAAW;IAAO;SACxC,IAAI,UAAU,OACnB,OAAO;QAAC,WAAW;IAAO;SAE1B,OAAO;QAAC,WAAW;IAAM;AAE7B;AAEA,SAAS,mCAAa,KAAW;IAC/B,IAAI,OAAO,CAAA,GAAA,kCAAI,EAAE,CAAA,GAAA,6CAAe;IAEhC,OAAO,CAAA,GAAA,+CAAiB,EAAE,MAAM;AAClC;AAEA;;CAEC,GACD,IAAI,0DAAgB,CAAA,GAAA,sCAAI,EAAE,WAAW;","sources":["packages/@react-spectrum/labeledvalue/src/index.ts","packages/@react-spectrum/labeledvalue/src/LabeledValue.tsx","packages/@adobe/spectrum-css-temp/components/fieldlabel/vars.css"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport type {SpectrumLabeledValueProps} from './LabeledValue';\nexport {LabeledValue} from './LabeledValue';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CalendarDate, CalendarDateTime, getLocalTimeZone, Time, toCalendarDateTime, today, ZonedDateTime} from '@internationalized/date';\nimport {classNames, useDOMRef} from '@react-spectrum/utils';\nimport type {DOMProps, DOMRef, RangeValue, SpectrumLabelableProps, StyleProps} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {filterDOMProps} from '@react-aria/utils';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport React, {ReactNode} from 'react';\nimport {useDateFormatter, useListFormatter, useNumberFormatter} from '@react-aria/i18n';\n\n// NOTE: the types here need to be synchronized with the ones in docs/types.ts, which are simpler so the documentation generator can handle them.\n\nexport interface LabeledValueBaseProps extends DOMProps, StyleProps, Omit<SpectrumLabelableProps, 'necessityIndicator' | 'isRequired'>, DOMProps {\n /** The content to display as the label. */\n label: ReactNode\n}\n\ntype NumberValue = number | RangeValue<number>;\ninterface NumberProps<T extends NumberValue> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: Intl.NumberFormatOptions\n}\n\nexport type DateTime = Date | CalendarDate | CalendarDateTime | ZonedDateTime | Time;\ntype RangeDateTime = RangeValue<DateTime>;\ntype DateTimeValue = DateTime | RangeDateTime;\ninterface DateProps<T extends DateTimeValue> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: Intl.DateTimeFormatOptions\n}\n\ninterface StringProps<T extends string> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: never\n}\n\ninterface StringListProps<T extends string[]> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n // @ts-ignore\n formatOptions?: Intl.ListFormatOptions\n}\n\ntype LabeledValueProps<T> =\n T extends NumberValue ? NumberProps<T> :\n T extends DateTimeValue ? DateProps<T> :\n T extends string[] ? StringListProps<T> :\n T extends string ? StringProps<T> :\n never;\n\ntype SpectrumLabeledValueTypes = string[] | string | Date | CalendarDate | CalendarDateTime | ZonedDateTime | Time | number | RangeValue<number> | RangeValue<DateTime>;\nexport type SpectrumLabeledValueProps<T> = LabeledValueProps<T> & LabeledValueBaseProps;\n\nfunction LabeledValue<T extends SpectrumLabeledValueTypes>(props: SpectrumLabeledValueProps<T>, ref: DOMRef<HTMLElement>) {\n let {\n value,\n formatOptions\n } = props;\n let domRef = useDOMRef(ref);\n\n let children;\n if (Array.isArray(value)) {\n // @ts-ignore\n children = <FormattedStringList value={value} formatOptions={formatOptions as Intl.ListFormatOptions} />;\n }\n\n if (typeof value === 'object' && 'start' in value && typeof value.start === 'number' && typeof value.end === 'number') {\n children = <FormattedNumber value={value as NumberValue} formatOptions={formatOptions as Intl.NumberFormatOptions} />;\n }\n\n if (typeof value === 'object' && 'start' in value && typeof value.start !== 'number' && typeof value.end !== 'number') {\n children = <FormattedDate value={value as DateTimeValue} formatOptions={formatOptions as Intl.DateTimeFormatOptions} />;\n }\n\n if (typeof value === 'number') {\n children = <FormattedNumber value={value} formatOptions={formatOptions as Intl.NumberFormatOptions} />;\n }\n\n if (typeof value === 'object' && ('calendar' in value || 'hour' in value) || (value instanceof Date)) {\n children = <FormattedDate value={value} formatOptions={formatOptions as Intl.DateTimeFormatOptions} />;\n }\n\n if (typeof value === 'string') {\n children = value;\n }\n\n return (\n <Field {...props as any} wrapperProps={filterDOMProps(props as any)} ref={domRef} elementType=\"span\" wrapperClassName={classNames(labelStyles, 'spectrum-LabeledValue')}>\n <span>{children}</span>\n </Field>\n );\n}\n\nfunction FormattedStringList<T extends string[]>(props: StringListProps<T>) {\n let stringFormatter = useListFormatter(props.formatOptions);\n\n return (\n <>{stringFormatter.format(props.value)}</>\n );\n}\n\nfunction FormattedNumber<T extends NumberValue>(props: NumberProps<T>) {\n let numberFormatter = useNumberFormatter(props.formatOptions);\n let value = props.value;\n\n if (typeof value === 'object') {\n return <>{numberFormatter.formatRange(value.start, value.end)}</>;\n }\n\n return <>{numberFormatter.format(value)}</>;\n}\n\nfunction FormattedDate<T extends DateTimeValue>(props: DateProps<T>) {\n let {value, formatOptions} = props;\n if (!formatOptions) {\n formatOptions = getDefaultFormatOptions('start' in value ? value.start : value);\n }\n\n let dateFormatter = useDateFormatter(formatOptions);\n let timeZone = dateFormatter.resolvedOptions().timeZone || getLocalTimeZone();\n let final: Date;\n\n if ('start' in value && 'end' in value) {\n let start = value.start;\n let end = value.end;\n\n start = convertDateTime(start, timeZone);\n end = convertDateTime(end, timeZone);\n\n return <>{dateFormatter.formatRange(start, end)}</>;\n }\n\n final = convertDateTime(value, timeZone);\n return <>{dateFormatter.format(final)}</>;\n}\n\nfunction convertDateTime(value: DateTime, timeZone: any) {\n if ('timeZone' in value) {\n return value.toDate();\n } else if ('calendar' in value) {\n return value.toDate(timeZone);\n } else if (!(value instanceof Date)) {\n return convertValue(value).toDate(timeZone);\n }\n\n return value;\n}\n\nfunction getDefaultFormatOptions(value: DateTime): Intl.DateTimeFormatOptions {\n if (value instanceof Date) {\n return {dateStyle: 'long', timeStyle: 'short'};\n } else if ('timeZone' in value) {\n return {year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric', timeZone: value.timeZone, timeZoneName: 'short'};\n } else if ('hour' in value && 'year' in value) {\n return {dateStyle: 'long', timeStyle: 'short'};\n } else if ('hour' in value) {\n return {timeStyle: 'short'};\n } else {\n return {dateStyle: 'long'};\n }\n}\n\nfunction convertValue(value: Time) {\n let date = today(getLocalTimeZone());\n\n return toCalendarDateTime(date, value);\n}\n\n/**\n * A LabeledValue displays a non-editable value with a label. It formats numbers, dates, times, and lists according to the user's locale.\n */\nlet _LabeledValue = React.forwardRef(LabeledValue);\nexport {_LabeledValue as LabeledValue};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"main.js.map"}
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AA5BA,0CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA0B,CAAC,YAAY,CAAC;AACxC,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA6B,CAAC,eAAe,CAAC;AAC9C,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA0B,CAAC,YAAY,CAAC;AACxC,4CAAmC,CAAC,qBAAqB,C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CAAA,GAAA,6CAAe;IAC1E,IAAI;IAEJ,IAAI,WAAW,SAAS,SAAS,OAAO;QACtC,IAAI,QAAQ,MAAM,KAAK;QACvB,IAAI,MAAM,MAAM,GAAG;QAEnB,QAAQ,sCAAgB,OAAO;QAC/B,MAAM,sCAAgB,KAAK;QAE3B,qBAAO,sHAAG,cAAc,WAAW,CAAC,OAAO;IAC7C;IAEA,QAAQ,sCAAgB,OAAO;IAC/B,qBAAO,sHAAG,cAAc,MAAM,CAAC;AACjC;AAEA,SAAS,sCAAgB,KAAe,EAAE,QAAa;IACrD,IAAI,cAAc,OAChB,OAAO,MAAM,MAAM;SACd,IAAI,cAAc,OACvB,OAAO,MAAM,MAAM,CAAC;SACf,IAAI,CAAE,CAAA,iBAAiB,IAAG,GAC/B,OAAO,mCAAa,OAAO,MAAM,CAAC;IAGpC,OAAO;AACT;AAEA,SAAS,8CAAwB,KAAe;IAC9C,IAAI,iBAAiB,MACnB,OAAO;QAAC,WAAW;QAAQ,WAAW;IAAO;SACxC,IAAI,cAAc,OACvB,OAAO;QAAC,MAAM;QAAW,OAAO;QAAQ,KAAK;QAAW,MAAM;QAAW,QAAQ;QAAW,UAAU,MAAM,QAAQ;QAAE,cAAc;IAAO;SACtI,IAAI,UAAU,SAAS,UAAU,OACtC,OAAO;QAAC,WAAW;QAAQ,WAAW;IAAO;SACxC,IAAI,UAAU,OACnB,OAAO;QAAC,WAAW;IAAO;SAE1B,OAAO;QAAC,WAAW;IAAM;AAE7B;AAEA,SAAS,mCAAa,KAAW;IAC/B,IAAI,OAAO,CAAA,GAAA,kCAAI,EAAE,CAAA,GAAA,6CAAe;IAEhC,OAAO,CAAA,GAAA,+CAAiB,EAAE,MAAM;AAClC;AAEA;;CAEC,GACD,IAAI,0DAAgB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;","sources":["packages/@adobe/spectrum-css-temp/components/fieldlabel/vars.css","packages/@react-spectrum/labeledvalue/src/index.ts","packages/@react-spectrum/labeledvalue/src/LabeledValue.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n","/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport type {SpectrumLabeledValueProps} from './LabeledValue';\nexport {LabeledValue} from './LabeledValue';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CalendarDate, CalendarDateTime, getLocalTimeZone, Time, toCalendarDateTime, today, ZonedDateTime} from '@internationalized/date';\nimport {classNames, useDOMRef} from '@react-spectrum/utils';\nimport type {DOMProps, DOMRef, RangeValue, SpectrumLabelableProps, StyleProps} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {filterDOMProps} from '@react-aria/utils';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport React, {ReactNode} from 'react';\nimport {useDateFormatter, useListFormatter, useNumberFormatter} from '@react-aria/i18n';\n\n// NOTE: the types here need to be synchronized with the ones in docs/types.ts, which are simpler so the documentation generator can handle them.\n\nexport interface LabeledValueBaseProps extends DOMProps, StyleProps, Omit<SpectrumLabelableProps, 'necessityIndicator' | 'isRequired'>, DOMProps {\n /** The content to display as the label. */\n label: ReactNode\n}\n\ntype NumberValue = number | RangeValue<number>;\ninterface NumberProps<T extends NumberValue> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: Intl.NumberFormatOptions\n}\n\nexport type DateTime = Date | CalendarDate | CalendarDateTime | ZonedDateTime | Time;\ntype RangeDateTime = RangeValue<DateTime>;\ntype DateTimeValue = DateTime | RangeDateTime;\ninterface DateProps<T extends DateTimeValue> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: Intl.DateTimeFormatOptions\n}\n\ninterface StringProps<T extends string> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: never\n}\n\ninterface StringListProps<T extends string[]> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n // @ts-ignore\n formatOptions?: Intl.ListFormatOptions\n}\n\ntype LabeledValueProps<T> =\n T extends NumberValue ? NumberProps<T> :\n T extends DateTimeValue ? DateProps<T> :\n T extends string[] ? StringListProps<T> :\n T extends string ? StringProps<T> :\n never;\n\ntype SpectrumLabeledValueTypes = string[] | string | Date | CalendarDate | CalendarDateTime | ZonedDateTime | Time | number | RangeValue<number> | RangeValue<DateTime>;\nexport type SpectrumLabeledValueProps<T> = LabeledValueProps<T> & LabeledValueBaseProps;\n\nfunction LabeledValue<T extends SpectrumLabeledValueTypes>(props: SpectrumLabeledValueProps<T>, ref: DOMRef<HTMLElement>) {\n let {\n value,\n formatOptions\n } = props;\n let domRef = useDOMRef(ref);\n\n let children;\n if (Array.isArray(value)) {\n // @ts-ignore\n children = <FormattedStringList value={value} formatOptions={formatOptions as Intl.ListFormatOptions} />;\n }\n\n if (typeof value === 'object' && 'start' in value && typeof value.start === 'number' && typeof value.end === 'number') {\n children = <FormattedNumber value={value as NumberValue} formatOptions={formatOptions as Intl.NumberFormatOptions} />;\n }\n\n if (typeof value === 'object' && 'start' in value && typeof value.start !== 'number' && typeof value.end !== 'number') {\n children = <FormattedDate value={value as DateTimeValue} formatOptions={formatOptions as Intl.DateTimeFormatOptions} />;\n }\n\n if (typeof value === 'number') {\n children = <FormattedNumber value={value} formatOptions={formatOptions as Intl.NumberFormatOptions} />;\n }\n\n if (typeof value === 'object' && ('calendar' in value || 'hour' in value) || (value instanceof Date)) {\n children = <FormattedDate value={value} formatOptions={formatOptions as Intl.DateTimeFormatOptions} />;\n }\n\n if (typeof value === 'string') {\n children = value;\n }\n\n return (\n <Field {...props as any} wrapperProps={filterDOMProps(props as any)} ref={domRef} elementType=\"span\" wrapperClassName={classNames(labelStyles, 'spectrum-LabeledValue')}>\n <span>{children}</span>\n </Field>\n );\n}\n\nfunction FormattedStringList<T extends string[]>(props: StringListProps<T>) {\n let stringFormatter = useListFormatter(props.formatOptions);\n\n return (\n <>{stringFormatter.format(props.value)}</>\n );\n}\n\nfunction FormattedNumber<T extends NumberValue>(props: NumberProps<T>) {\n let numberFormatter = useNumberFormatter(props.formatOptions);\n let value = props.value;\n\n if (typeof value === 'object') {\n return <>{numberFormatter.formatRange(value.start, value.end)}</>;\n }\n\n return <>{numberFormatter.format(value)}</>;\n}\n\nfunction FormattedDate<T extends DateTimeValue>(props: DateProps<T>) {\n let {value, formatOptions} = props;\n if (!formatOptions) {\n formatOptions = getDefaultFormatOptions('start' in value ? value.start : value);\n }\n\n let dateFormatter = useDateFormatter(formatOptions);\n let timeZone = dateFormatter.resolvedOptions().timeZone || getLocalTimeZone();\n let final: Date;\n\n if ('start' in value && 'end' in value) {\n let start = value.start;\n let end = value.end;\n\n start = convertDateTime(start, timeZone);\n end = convertDateTime(end, timeZone);\n\n return <>{dateFormatter.formatRange(start, end)}</>;\n }\n\n final = convertDateTime(value, timeZone);\n return <>{dateFormatter.format(final)}</>;\n}\n\nfunction convertDateTime(value: DateTime, timeZone: any) {\n if ('timeZone' in value) {\n return value.toDate();\n } else if ('calendar' in value) {\n return value.toDate(timeZone);\n } else if (!(value instanceof Date)) {\n return convertValue(value).toDate(timeZone);\n }\n\n return value;\n}\n\nfunction getDefaultFormatOptions(value: DateTime): Intl.DateTimeFormatOptions {\n if (value instanceof Date) {\n return {dateStyle: 'long', timeStyle: 'short'};\n } else if ('timeZone' in value) {\n return {year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric', timeZone: value.timeZone, timeZoneName: 'short'};\n } else if ('hour' in value && 'year' in value) {\n return {dateStyle: 'long', timeStyle: 'short'};\n } else if ('hour' in value) {\n return {timeStyle: 'short'};\n } else {\n return {dateStyle: 'long'};\n }\n}\n\nfunction convertValue(value: Time) {\n let date = today(getLocalTimeZone());\n\n return toCalendarDateTime(date, value);\n}\n\n/**\n * A LabeledValue displays a non-editable value with a label. It formats numbers, dates, times, and lists according to the user's locale.\n */\nlet _LabeledValue = React.forwardRef(LabeledValue);\nexport {_LabeledValue as LabeledValue};\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
@@ -6,68 +6,79 @@ import {filterDOMProps as $3xnHL$filterDOMProps} from "@react-aria/utils";
|
|
6
6
|
import $3xnHL$react from "react";
|
7
7
|
import {useListFormatter as $3xnHL$useListFormatter, useNumberFormatter as $3xnHL$useNumberFormatter, useDateFormatter as $3xnHL$useDateFormatter} from "@react-aria/i18n";
|
8
8
|
|
9
|
-
|
10
|
-
return a && a.__esModule ? a.default : a;
|
11
|
-
}
|
9
|
+
|
12
10
|
function $parcel$export(e, n, v, s) {
|
13
11
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
14
12
|
}
|
15
|
-
/*
|
16
|
-
* Copyright 2022 Adobe. All rights reserved.
|
17
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
18
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
19
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
20
|
-
*
|
21
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
22
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
23
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
24
|
-
* governing permissions and limitations under the License.
|
25
|
-
*/ /// <reference types="css-module-types" />
|
26
|
-
/*
|
27
|
-
* Copyright 2020 Adobe. All rights reserved.
|
28
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
29
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
30
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
31
|
-
*
|
32
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
33
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
34
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
35
|
-
* governing permissions and limitations under the License.
|
36
|
-
*/
|
37
13
|
|
14
|
+
function $parcel$interopDefault(a) {
|
15
|
+
return a && a.__esModule ? a.default : a;
|
16
|
+
}
|
17
|
+
|
18
|
+
var $parcel$global = globalThis;
|
19
|
+
|
20
|
+
var $parcel$modules = {};
|
21
|
+
var $parcel$inits = {};
|
38
22
|
|
23
|
+
var parcelRequire = $parcel$global["parcelRequire7f0c"];
|
39
24
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
$parcel$
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
$parcel$
|
48
|
-
|
49
|
-
$parcel$
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
$parcel$
|
60
|
-
|
61
|
-
|
62
|
-
$parcel$
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
$parcel$export(
|
69
|
-
$parcel$export(
|
70
|
-
$parcel$export(
|
25
|
+
if (parcelRequire == null) {
|
26
|
+
parcelRequire = function(id) {
|
27
|
+
if (id in $parcel$modules) {
|
28
|
+
return $parcel$modules[id].exports;
|
29
|
+
}
|
30
|
+
if (id in $parcel$inits) {
|
31
|
+
var init = $parcel$inits[id];
|
32
|
+
delete $parcel$inits[id];
|
33
|
+
var module = {id: id, exports: {}};
|
34
|
+
$parcel$modules[id] = module;
|
35
|
+
init.call(module.exports, module, module.exports);
|
36
|
+
return module.exports;
|
37
|
+
}
|
38
|
+
var err = new Error("Cannot find module '" + id + "'");
|
39
|
+
err.code = 'MODULE_NOT_FOUND';
|
40
|
+
throw err;
|
41
|
+
};
|
42
|
+
|
43
|
+
parcelRequire.register = function register(id, init) {
|
44
|
+
$parcel$inits[id] = init;
|
45
|
+
};
|
46
|
+
|
47
|
+
$parcel$global["parcelRequire7f0c"] = parcelRequire;
|
48
|
+
}
|
49
|
+
|
50
|
+
var parcelRegister = parcelRequire.register;
|
51
|
+
parcelRegister("hBWiT", function(module, exports) {
|
52
|
+
|
53
|
+
$parcel$export(module.exports, "contextualHelp", () => $cd231e464c886c86$export$4ba534aba1836d, (v) => $cd231e464c886c86$export$4ba534aba1836d = v);
|
54
|
+
$parcel$export(module.exports, "field", () => $cd231e464c886c86$export$e0f35d825088c098, (v) => $cd231e464c886c86$export$e0f35d825088c098 = v);
|
55
|
+
$parcel$export(module.exports, "focus-ring", () => $cd231e464c886c86$export$f39a09f249340e2a, (v) => $cd231e464c886c86$export$f39a09f249340e2a = v);
|
56
|
+
$parcel$export(module.exports, "helpText", () => $cd231e464c886c86$export$431a3b688422af44, (v) => $cd231e464c886c86$export$431a3b688422af44 = v);
|
57
|
+
$parcel$export(module.exports, "i18nFontFamily", () => $cd231e464c886c86$export$8c4ee2c50c22c514, (v) => $cd231e464c886c86$export$8c4ee2c50c22c514 = v);
|
58
|
+
$parcel$export(module.exports, "is-disabled", () => $cd231e464c886c86$export$d35bc1e505d1ebbf, (v) => $cd231e464c886c86$export$d35bc1e505d1ebbf = v);
|
59
|
+
$parcel$export(module.exports, "label", () => $cd231e464c886c86$export$1237798dc640739a, (v) => $cd231e464c886c86$export$1237798dc640739a = v);
|
60
|
+
$parcel$export(module.exports, "spectrum-Field", () => $cd231e464c886c86$export$f6d480ae1e56eba0, (v) => $cd231e464c886c86$export$f6d480ae1e56eba0 = v);
|
61
|
+
$parcel$export(module.exports, "spectrum-Field--alignEnd", () => $cd231e464c886c86$export$5354c9be7ada5f83, (v) => $cd231e464c886c86$export$5354c9be7ada5f83 = v);
|
62
|
+
$parcel$export(module.exports, "spectrum-Field--hasContextualHelp", () => $cd231e464c886c86$export$9ba23707a252cdd4, (v) => $cd231e464c886c86$export$9ba23707a252cdd4 = v);
|
63
|
+
$parcel$export(module.exports, "spectrum-Field--positionSide", () => $cd231e464c886c86$export$2963225c91179589, (v) => $cd231e464c886c86$export$2963225c91179589 = v);
|
64
|
+
$parcel$export(module.exports, "spectrum-Field--positionTop", () => $cd231e464c886c86$export$a4ea780a9064d7f9, (v) => $cd231e464c886c86$export$a4ea780a9064d7f9 = v);
|
65
|
+
$parcel$export(module.exports, "spectrum-Field-contextualHelp", () => $cd231e464c886c86$export$24fb860d16dd2d3f, (v) => $cd231e464c886c86$export$24fb860d16dd2d3f = v);
|
66
|
+
$parcel$export(module.exports, "spectrum-Field-field", () => $cd231e464c886c86$export$3ab8a3dc7f0563d, (v) => $cd231e464c886c86$export$3ab8a3dc7f0563d = v);
|
67
|
+
$parcel$export(module.exports, "spectrum-Field-labelCell", () => $cd231e464c886c86$export$9cde5aecff012641, (v) => $cd231e464c886c86$export$9cde5aecff012641 = v);
|
68
|
+
$parcel$export(module.exports, "spectrum-Field-labelWrapper", () => $cd231e464c886c86$export$a872a8c78b26c9e0, (v) => $cd231e464c886c86$export$a872a8c78b26c9e0 = v);
|
69
|
+
$parcel$export(module.exports, "spectrum-Field-wrapper", () => $cd231e464c886c86$export$127df0b7290eb8ef, (v) => $cd231e464c886c86$export$127df0b7290eb8ef = v);
|
70
|
+
$parcel$export(module.exports, "spectrum-FieldLabel", () => $cd231e464c886c86$export$493d18e796ae054, (v) => $cd231e464c886c86$export$493d18e796ae054 = v);
|
71
|
+
$parcel$export(module.exports, "spectrum-FieldLabel--alignEnd", () => $cd231e464c886c86$export$885efcc08143a987, (v) => $cd231e464c886c86$export$885efcc08143a987 = v);
|
72
|
+
$parcel$export(module.exports, "spectrum-FieldLabel--positionSide", () => $cd231e464c886c86$export$9e6f19dc21f22f2e, (v) => $cd231e464c886c86$export$9e6f19dc21f22f2e = v);
|
73
|
+
$parcel$export(module.exports, "spectrum-FieldLabel-requiredIcon", () => $cd231e464c886c86$export$7c47642c7d46f3c9, (v) => $cd231e464c886c86$export$7c47642c7d46f3c9 = v);
|
74
|
+
$parcel$export(module.exports, "spectrum-FocusRing-ring", () => $cd231e464c886c86$export$4109102f950813a6, (v) => $cd231e464c886c86$export$4109102f950813a6 = v);
|
75
|
+
$parcel$export(module.exports, "spectrum-FocusRing", () => $cd231e464c886c86$export$24c7f46a6e3605dd, (v) => $cd231e464c886c86$export$24c7f46a6e3605dd = v);
|
76
|
+
$parcel$export(module.exports, "spectrum-FocusRing--quiet", () => $cd231e464c886c86$export$2927016961429360, (v) => $cd231e464c886c86$export$2927016961429360 = v);
|
77
|
+
$parcel$export(module.exports, "spectrum-Form", () => $cd231e464c886c86$export$94d2bcc94afabd89, (v) => $cd231e464c886c86$export$94d2bcc94afabd89 = v);
|
78
|
+
$parcel$export(module.exports, "spectrum-Form--positionSide", () => $cd231e464c886c86$export$7f44db659563c8f4, (v) => $cd231e464c886c86$export$7f44db659563c8f4 = v);
|
79
|
+
$parcel$export(module.exports, "spectrum-Form--positionTop", () => $cd231e464c886c86$export$11b8bc81fe551057, (v) => $cd231e464c886c86$export$11b8bc81fe551057 = v);
|
80
|
+
$parcel$export(module.exports, "spectrum-Form-itemLabel", () => $cd231e464c886c86$export$51ec27881a1e3928, (v) => $cd231e464c886c86$export$51ec27881a1e3928 = v);
|
81
|
+
$parcel$export(module.exports, "spectrum-LabeledValue", () => $cd231e464c886c86$export$79f9a5e9dd010c8d, (v) => $cd231e464c886c86$export$79f9a5e9dd010c8d = v);
|
71
82
|
var $cd231e464c886c86$export$4ba534aba1836d;
|
72
83
|
var $cd231e464c886c86$export$e0f35d825088c098;
|
73
84
|
var $cd231e464c886c86$export$f39a09f249340e2a;
|
@@ -127,7 +138,35 @@ $cd231e464c886c86$export$11b8bc81fe551057 = `A-HlBa_spectrum-Form--positionTop`;
|
|
127
138
|
$cd231e464c886c86$export$51ec27881a1e3928 = `A-HlBa_spectrum-Form-itemLabel`;
|
128
139
|
$cd231e464c886c86$export$79f9a5e9dd010c8d = `A-HlBa_spectrum-LabeledValue`;
|
129
140
|
|
141
|
+
});
|
142
|
+
|
143
|
+
/*
|
144
|
+
* Copyright 2022 Adobe. All rights reserved.
|
145
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
146
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
147
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
148
|
+
*
|
149
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
150
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
151
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
152
|
+
* governing permissions and limitations under the License.
|
153
|
+
*/ /// <reference types="css-module-types" />
|
154
|
+
/*
|
155
|
+
* Copyright 2020 Adobe. All rights reserved.
|
156
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
157
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
158
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
159
|
+
*
|
160
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
161
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
162
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
163
|
+
* governing permissions and limitations under the License.
|
164
|
+
*/
|
165
|
+
|
166
|
+
|
167
|
+
|
130
168
|
|
169
|
+
var $hBWiT = parcelRequire("hBWiT");
|
131
170
|
|
132
171
|
|
133
172
|
function $3e9971be431adb24$var$LabeledValue(props, ref) {
|
@@ -161,7 +200,7 @@ function $3e9971be431adb24$var$LabeledValue(props, ref) {
|
|
161
200
|
wrapperProps: (0, $3xnHL$filterDOMProps)(props),
|
162
201
|
ref: domRef,
|
163
202
|
elementType: "span",
|
164
|
-
wrapperClassName: (0, $3xnHL$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($
|
203
|
+
wrapperClassName: (0, $3xnHL$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($hBWiT))), "spectrum-LabeledValue")
|
165
204
|
}, /*#__PURE__*/ (0, $3xnHL$react).createElement("span", null, children));
|
166
205
|
}
|
167
206
|
function $3e9971be431adb24$var$FormattedStringList(props) {
|
package/dist/module.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVD,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AA5BA,0CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA0B,CAAC,YAAY,CAAC;AACxC,4CAA+B,CAA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BAAkB,YAAY,CAAA,GAAA,uBAAe;IAC1E,IAAI;IAEJ,IAAI,WAAW,SAAS,SAAS,OAAO;QACtC,IAAI,QAAQ,MAAM;QAClB,IAAI,MAAM,MAAM;QAEhB,QAAQ,sCAAgB,OAAO;QAC/B,MAAM,sCAAgB,KAAK;QAE3B,qBAAO,kEAAG,cAAc,YAAY,OAAO;IAC7C;IAEA,QAAQ,sCAAgB,OAAO;IAC/B,qBAAO,kEAAG,cAAc,OAAO;AACjC;AAEA,SAAS,sCAAgB,KAAe,EAAE,QAAa;IACrD,IAAI,cAAc,OAChB,OAAO,MAAM;SACR,IAAI,cAAc,OACvB,OAAO,MAAM,OAAO;SACf,IAAI,CAAE,CAAA,iBAAiB,IAAG,GAC/B,OAAO,mCAAa,OAAO,OAAO;IAGpC,OAAO;AACT;AAEA,SAAS,8CAAwB,KAAe;IAC9C,IAAI,iBAAiB,MACnB,OAAO;QAAC,WAAW;QAAQ,WAAW;IAAO;SACxC,IAAI,cAAc,OACvB,OAAO;QAAC,MAAM;QAAW,OAAO;QAAQ,KAAK;QAAW,MAAM;QAAW,QAAQ;QAAW,UAAU,MAAM;QAAU,cAAc;IAAO;SACtI,IAAI,UAAU,SAAS,UAAU,OACtC,OAAO;QAAC,WAAW;QAAQ,WAAW;IAAO;SACxC,IAAI,UAAU,OACnB,OAAO;QAAC,WAAW;IAAO;SAE1B,OAAO;QAAC,WAAW;IAAM;AAE7B;AAEA,SAAS,mCAAa,KAAW;IAC/B,IAAI,OAAO,CAAA,GAAA,YAAI,EAAE,CAAA,GAAA,uBAAe;IAEhC,OAAO,CAAA,GAAA,yBAAiB,EAAE,MAAM;AAClC;AAEA;;CAEC,GACD,IAAI,0DAAgB,CAAA,GAAA,YAAI,EAAE,WAAW;","sources":["packages/@react-spectrum/labeledvalue/src/index.ts","packages/@react-spectrum/labeledvalue/src/LabeledValue.tsx","packages/@adobe/spectrum-css-temp/components/fieldlabel/vars.css"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport type {SpectrumLabeledValueProps} from './LabeledValue';\nexport {LabeledValue} from './LabeledValue';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CalendarDate, CalendarDateTime, getLocalTimeZone, Time, toCalendarDateTime, today, ZonedDateTime} from '@internationalized/date';\nimport {classNames, useDOMRef} from '@react-spectrum/utils';\nimport type {DOMProps, DOMRef, RangeValue, SpectrumLabelableProps, StyleProps} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {filterDOMProps} from '@react-aria/utils';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport React, {ReactNode} from 'react';\nimport {useDateFormatter, useListFormatter, useNumberFormatter} from '@react-aria/i18n';\n\n// NOTE: the types here need to be synchronized with the ones in docs/types.ts, which are simpler so the documentation generator can handle them.\n\nexport interface LabeledValueBaseProps extends DOMProps, StyleProps, Omit<SpectrumLabelableProps, 'necessityIndicator' | 'isRequired'>, DOMProps {\n /** The content to display as the label. */\n label: ReactNode\n}\n\ntype NumberValue = number | RangeValue<number>;\ninterface NumberProps<T extends NumberValue> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: Intl.NumberFormatOptions\n}\n\nexport type DateTime = Date | CalendarDate | CalendarDateTime | ZonedDateTime | Time;\ntype RangeDateTime = RangeValue<DateTime>;\ntype DateTimeValue = DateTime | RangeDateTime;\ninterface DateProps<T extends DateTimeValue> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: Intl.DateTimeFormatOptions\n}\n\ninterface StringProps<T extends string> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: never\n}\n\ninterface StringListProps<T extends string[]> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n // @ts-ignore\n formatOptions?: Intl.ListFormatOptions\n}\n\ntype LabeledValueProps<T> =\n T extends NumberValue ? NumberProps<T> :\n T extends DateTimeValue ? DateProps<T> :\n T extends string[] ? StringListProps<T> :\n T extends string ? StringProps<T> :\n never;\n\ntype SpectrumLabeledValueTypes = string[] | string | Date | CalendarDate | CalendarDateTime | ZonedDateTime | Time | number | RangeValue<number> | RangeValue<DateTime>;\nexport type SpectrumLabeledValueProps<T> = LabeledValueProps<T> & LabeledValueBaseProps;\n\nfunction LabeledValue<T extends SpectrumLabeledValueTypes>(props: SpectrumLabeledValueProps<T>, ref: DOMRef<HTMLElement>) {\n let {\n value,\n formatOptions\n } = props;\n let domRef = useDOMRef(ref);\n\n let children;\n if (Array.isArray(value)) {\n // @ts-ignore\n children = <FormattedStringList value={value} formatOptions={formatOptions as Intl.ListFormatOptions} />;\n }\n\n if (typeof value === 'object' && 'start' in value && typeof value.start === 'number' && typeof value.end === 'number') {\n children = <FormattedNumber value={value as NumberValue} formatOptions={formatOptions as Intl.NumberFormatOptions} />;\n }\n\n if (typeof value === 'object' && 'start' in value && typeof value.start !== 'number' && typeof value.end !== 'number') {\n children = <FormattedDate value={value as DateTimeValue} formatOptions={formatOptions as Intl.DateTimeFormatOptions} />;\n }\n\n if (typeof value === 'number') {\n children = <FormattedNumber value={value} formatOptions={formatOptions as Intl.NumberFormatOptions} />;\n }\n\n if (typeof value === 'object' && ('calendar' in value || 'hour' in value) || (value instanceof Date)) {\n children = <FormattedDate value={value} formatOptions={formatOptions as Intl.DateTimeFormatOptions} />;\n }\n\n if (typeof value === 'string') {\n children = value;\n }\n\n return (\n <Field {...props as any} wrapperProps={filterDOMProps(props as any)} ref={domRef} elementType=\"span\" wrapperClassName={classNames(labelStyles, 'spectrum-LabeledValue')}>\n <span>{children}</span>\n </Field>\n );\n}\n\nfunction FormattedStringList<T extends string[]>(props: StringListProps<T>) {\n let stringFormatter = useListFormatter(props.formatOptions);\n\n return (\n <>{stringFormatter.format(props.value)}</>\n );\n}\n\nfunction FormattedNumber<T extends NumberValue>(props: NumberProps<T>) {\n let numberFormatter = useNumberFormatter(props.formatOptions);\n let value = props.value;\n\n if (typeof value === 'object') {\n return <>{numberFormatter.formatRange(value.start, value.end)}</>;\n }\n\n return <>{numberFormatter.format(value)}</>;\n}\n\nfunction FormattedDate<T extends DateTimeValue>(props: DateProps<T>) {\n let {value, formatOptions} = props;\n if (!formatOptions) {\n formatOptions = getDefaultFormatOptions('start' in value ? value.start : value);\n }\n\n let dateFormatter = useDateFormatter(formatOptions);\n let timeZone = dateFormatter.resolvedOptions().timeZone || getLocalTimeZone();\n let final: Date;\n\n if ('start' in value && 'end' in value) {\n let start = value.start;\n let end = value.end;\n\n start = convertDateTime(start, timeZone);\n end = convertDateTime(end, timeZone);\n\n return <>{dateFormatter.formatRange(start, end)}</>;\n }\n\n final = convertDateTime(value, timeZone);\n return <>{dateFormatter.format(final)}</>;\n}\n\nfunction convertDateTime(value: DateTime, timeZone: any) {\n if ('timeZone' in value) {\n return value.toDate();\n } else if ('calendar' in value) {\n return value.toDate(timeZone);\n } else if (!(value instanceof Date)) {\n return convertValue(value).toDate(timeZone);\n }\n\n return value;\n}\n\nfunction getDefaultFormatOptions(value: DateTime): Intl.DateTimeFormatOptions {\n if (value instanceof Date) {\n return {dateStyle: 'long', timeStyle: 'short'};\n } else if ('timeZone' in value) {\n return {year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric', timeZone: value.timeZone, timeZoneName: 'short'};\n } else if ('hour' in value && 'year' in value) {\n return {dateStyle: 'long', timeStyle: 'short'};\n } else if ('hour' in value) {\n return {timeStyle: 'short'};\n } else {\n return {dateStyle: 'long'};\n }\n}\n\nfunction convertValue(value: Time) {\n let date = today(getLocalTimeZone());\n\n return toCalendarDateTime(date, value);\n}\n\n/**\n * A LabeledValue displays a non-editable value with a label. It formats numbers, dates, times, and lists according to the user's locale.\n */\nlet _LabeledValue = React.forwardRef(LabeledValue);\nexport {_LabeledValue as LabeledValue};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"module.js.map"}
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AA5BA,0CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA0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EhC,OAAO,CAAA,GAAA,yBAAiB,EAAE,MAAM;AAClC;AAEA;;CAEC,GACD,IAAI,0DAAgB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC;","sources":["packages/@adobe/spectrum-css-temp/components/fieldlabel/vars.css","packages/@react-spectrum/labeledvalue/src/index.ts","packages/@react-spectrum/labeledvalue/src/LabeledValue.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n","/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport type {SpectrumLabeledValueProps} from './LabeledValue';\nexport {LabeledValue} from './LabeledValue';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CalendarDate, CalendarDateTime, getLocalTimeZone, Time, toCalendarDateTime, today, ZonedDateTime} from '@internationalized/date';\nimport {classNames, useDOMRef} from '@react-spectrum/utils';\nimport type {DOMProps, DOMRef, RangeValue, SpectrumLabelableProps, StyleProps} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {filterDOMProps} from '@react-aria/utils';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport React, {ReactNode} from 'react';\nimport {useDateFormatter, useListFormatter, useNumberFormatter} from '@react-aria/i18n';\n\n// NOTE: the types here need to be synchronized with the ones in docs/types.ts, which are simpler so the documentation generator can handle them.\n\nexport interface LabeledValueBaseProps extends DOMProps, StyleProps, Omit<SpectrumLabelableProps, 'necessityIndicator' | 'isRequired'>, DOMProps {\n /** The content to display as the label. */\n label: ReactNode\n}\n\ntype NumberValue = number | RangeValue<number>;\ninterface NumberProps<T extends NumberValue> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: Intl.NumberFormatOptions\n}\n\nexport type DateTime = Date | CalendarDate | CalendarDateTime | ZonedDateTime | Time;\ntype RangeDateTime = RangeValue<DateTime>;\ntype DateTimeValue = DateTime | RangeDateTime;\ninterface DateProps<T extends DateTimeValue> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: Intl.DateTimeFormatOptions\n}\n\ninterface StringProps<T extends string> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: never\n}\n\ninterface StringListProps<T extends string[]> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n // @ts-ignore\n formatOptions?: Intl.ListFormatOptions\n}\n\ntype LabeledValueProps<T> =\n T extends NumberValue ? NumberProps<T> :\n T extends DateTimeValue ? DateProps<T> :\n T extends string[] ? StringListProps<T> :\n T extends string ? StringProps<T> :\n never;\n\ntype SpectrumLabeledValueTypes = string[] | string | Date | CalendarDate | CalendarDateTime | ZonedDateTime | Time | number | RangeValue<number> | RangeValue<DateTime>;\nexport type SpectrumLabeledValueProps<T> = LabeledValueProps<T> & LabeledValueBaseProps;\n\nfunction LabeledValue<T extends SpectrumLabeledValueTypes>(props: SpectrumLabeledValueProps<T>, ref: DOMRef<HTMLElement>) {\n let {\n value,\n formatOptions\n } = props;\n let domRef = useDOMRef(ref);\n\n let children;\n if (Array.isArray(value)) {\n // @ts-ignore\n children = <FormattedStringList value={value} formatOptions={formatOptions as Intl.ListFormatOptions} />;\n }\n\n if (typeof value === 'object' && 'start' in value && typeof value.start === 'number' && typeof value.end === 'number') {\n children = <FormattedNumber value={value as NumberValue} formatOptions={formatOptions as Intl.NumberFormatOptions} />;\n }\n\n if (typeof value === 'object' && 'start' in value && typeof value.start !== 'number' && typeof value.end !== 'number') {\n children = <FormattedDate value={value as DateTimeValue} formatOptions={formatOptions as Intl.DateTimeFormatOptions} />;\n }\n\n if (typeof value === 'number') {\n children = <FormattedNumber value={value} formatOptions={formatOptions as Intl.NumberFormatOptions} />;\n }\n\n if (typeof value === 'object' && ('calendar' in value || 'hour' in value) || (value instanceof Date)) {\n children = <FormattedDate value={value} formatOptions={formatOptions as Intl.DateTimeFormatOptions} />;\n }\n\n if (typeof value === 'string') {\n children = value;\n }\n\n return (\n <Field {...props as any} wrapperProps={filterDOMProps(props as any)} ref={domRef} elementType=\"span\" wrapperClassName={classNames(labelStyles, 'spectrum-LabeledValue')}>\n <span>{children}</span>\n </Field>\n );\n}\n\nfunction FormattedStringList<T extends string[]>(props: StringListProps<T>) {\n let stringFormatter = useListFormatter(props.formatOptions);\n\n return (\n <>{stringFormatter.format(props.value)}</>\n );\n}\n\nfunction FormattedNumber<T extends NumberValue>(props: NumberProps<T>) {\n let numberFormatter = useNumberFormatter(props.formatOptions);\n let value = props.value;\n\n if (typeof value === 'object') {\n return <>{numberFormatter.formatRange(value.start, value.end)}</>;\n }\n\n return <>{numberFormatter.format(value)}</>;\n}\n\nfunction FormattedDate<T extends DateTimeValue>(props: DateProps<T>) {\n let {value, formatOptions} = props;\n if (!formatOptions) {\n formatOptions = getDefaultFormatOptions('start' in value ? value.start : value);\n }\n\n let dateFormatter = useDateFormatter(formatOptions);\n let timeZone = dateFormatter.resolvedOptions().timeZone || getLocalTimeZone();\n let final: Date;\n\n if ('start' in value && 'end' in value) {\n let start = value.start;\n let end = value.end;\n\n start = convertDateTime(start, timeZone);\n end = convertDateTime(end, timeZone);\n\n return <>{dateFormatter.formatRange(start, end)}</>;\n }\n\n final = convertDateTime(value, timeZone);\n return <>{dateFormatter.format(final)}</>;\n}\n\nfunction convertDateTime(value: DateTime, timeZone: any) {\n if ('timeZone' in value) {\n return value.toDate();\n } else if ('calendar' in value) {\n return value.toDate(timeZone);\n } else if (!(value instanceof Date)) {\n return convertValue(value).toDate(timeZone);\n }\n\n return value;\n}\n\nfunction getDefaultFormatOptions(value: DateTime): Intl.DateTimeFormatOptions {\n if (value instanceof Date) {\n return {dateStyle: 'long', timeStyle: 'short'};\n } else if ('timeZone' in value) {\n return {year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric', timeZone: value.timeZone, timeZoneName: 'short'};\n } else if ('hour' in value && 'year' in value) {\n return {dateStyle: 'long', timeStyle: 'short'};\n } else if ('hour' in value) {\n return {timeStyle: 'short'};\n } else {\n return {dateStyle: 'long'};\n }\n}\n\nfunction convertValue(value: Time) {\n let date = today(getLocalTimeZone());\n\n return toCalendarDateTime(date, value);\n}\n\n/**\n * A LabeledValue displays a non-editable value with a label. It formats numbers, dates, times, and lists according to the user's locale.\n */\nlet _LabeledValue = React.forwardRef(LabeledValue);\nexport {_LabeledValue as LabeledValue};\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-spectrum/labeledvalue",
|
3
|
-
"version": "3.1.8-nightly.
|
3
|
+
"version": "3.1.8-nightly.4245+403ec27bf",
|
4
4
|
"description": "Spectrum UI components in React",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "dist/main.js",
|
@@ -36,16 +36,16 @@
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
|
-
"@internationalized/date": "3.5.1-nightly.
|
40
|
-
"@react-aria/i18n": "3.0.0-nightly.
|
41
|
-
"@react-aria/utils": "3.0.0-nightly.
|
42
|
-
"@react-spectrum/label": "3.15.2-nightly.
|
43
|
-
"@react-spectrum/utils": "3.0.0-nightly.
|
44
|
-
"@react-types/shared": "3.0.0-nightly.
|
39
|
+
"@internationalized/date": "3.5.1-nightly.4245+403ec27bf",
|
40
|
+
"@react-aria/i18n": "3.0.0-nightly.2534+403ec27bf",
|
41
|
+
"@react-aria/utils": "3.0.0-nightly.2534+403ec27bf",
|
42
|
+
"@react-spectrum/label": "3.15.2-nightly.4245+403ec27bf",
|
43
|
+
"@react-spectrum/utils": "3.0.0-nightly.2534+403ec27bf",
|
44
|
+
"@react-types/shared": "3.0.0-nightly.2534+403ec27bf",
|
45
45
|
"@swc/helpers": "^0.5.0"
|
46
46
|
},
|
47
47
|
"devDependencies": {
|
48
|
-
"@adobe/spectrum-css-temp": "3.0.0-nightly.
|
48
|
+
"@adobe/spectrum-css-temp": "3.0.0-nightly.2534+403ec27bf"
|
49
49
|
},
|
50
50
|
"peerDependencies": {
|
51
51
|
"@react-spectrum/provider": "^3.0.0",
|
@@ -54,5 +54,5 @@
|
|
54
54
|
"publishConfig": {
|
55
55
|
"access": "public"
|
56
56
|
},
|
57
|
-
"gitHead": "
|
57
|
+
"gitHead": "403ec27bf8f5af6e19529b78782526f680c171ca"
|
58
58
|
}
|