@react-spectrum/labeledvalue 3.0.2-nightly.3598 → 3.0.2-nightly.3600
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/main.css +1 -1
- package/dist/main.js +67 -46
- package/dist/main.js.map +1 -1
- package/dist/module.mjs +67 -46
- package/dist/module.mjs.map +1 -1
- package/package.json +10 -10
package/dist/main.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
[dir=ltr] .spectrum-FieldLabel_d2db1f{text-align:left}[dir=rtl] .spectrum-FieldLabel_d2db1f{text-align:right}.spectrum-FieldLabel_d2db1f{box-sizing:border-box;padding:var(--spectrum-fieldlabel-padding-top,var(--spectrum-global-dimension-size-50))0 var(--spectrum-fieldlabel-padding-bottom,var(--spectrum-global-dimension-size-65));font-size:var(--spectrum-fieldlabel-text-size,var(--spectrum-global-dimension-font-size-75));font-weight:var(--spectrum-fieldlabel-text-font-weight,var(--spectrum-global-font-weight-regular));line-height:var(--spectrum-fieldlabel-text-line-height,var(--spectrum-global-font-line-height-small));vertical-align:top;-webkit-font-smoothing:subpixel-antialiased;-moz-osx-font-smoothing:auto;font-smoothing:subpixel-antialiased;cursor:default;flex:none;display:flex}[dir=ltr] .spectrum-FieldLabel--positionSide_d2db1f{padding-right:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}[dir=rtl] .spectrum-FieldLabel--positionSide_d2db1f{padding-left:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.spectrum-FieldLabel--positionSide_d2db1f{padding-top:var(--spectrum-fieldlabel-side-padding-top,var(--spectrum-global-dimension-size-100));display:inline-flex}[dir=ltr] .spectrum-FieldLabel-requiredIcon_d2db1f{margin-right:0}[dir=rtl] .spectrum-FieldLabel-requiredIcon_d2db1f{margin-left:0}[dir=ltr] .spectrum-FieldLabel-requiredIcon_d2db1f{margin-left:var(--spectrum-fieldlabel-asterisk-gap,var(--spectrum-global-dimension-size-25))}[dir=rtl] .spectrum-FieldLabel-requiredIcon_d2db1f{margin-right:var(--spectrum-fieldlabel-asterisk-gap,var(--spectrum-global-dimension-size-25))}.spectrum-FieldLabel-requiredIcon_d2db1f{margin-top:var(--spectrum-fieldlabel-asterisk-margin-y,var(--spectrum-global-dimension-size-50));margin-bottom:0}[dir=ltr] .spectrum-FieldLabel--alignEnd_d2db1f{text-align:right}[dir=rtl] .spectrum-FieldLabel--alignEnd_d2db1f{text-align:left}.spectrum-FieldLabel--alignEnd_d2db1f{justify-content:flex-end}.spectrum-Field_d2db1f{--spectrum-field-default-width:var(--spectrum-alias-single-line-width,var(--spectrum-global-dimension-size-2400))}.spectrum-Field_d2db1f.spectrum-Field--positionTop_d2db1f{display:-ms-inline-grid;-ms-grid-columns:auto auto minmax(0,1fr);-ms-grid-rows:auto 1fr auto;width:var(--spectrum-field-default-width);grid-template:"label contextualHelp.""field field field"1fr"helpText helpText helpText"/auto auto minmax(0,1fr);align-content:start;display:inline-grid}.spectrum-Field_d2db1f.spectrum-Field--positionTop_d2db1f .spectrum-Field-field_d2db1f{width:100%;grid-area:field}.spectrum-Field_d2db1f.spectrum-Field--positionTop_d2db1f.spectrum-Field--alignEnd_d2db1f{-ms-grid-columns:1fr auto 0;grid-template-columns:1fr auto 0}.spectrum-Field_d2db1f.spectrum-Field--positionTop_d2db1f .spectrum-FieldLabel_d2db1f{grid-area:label}.spectrum-Field_d2db1f.spectrum-Field--positionSide_d2db1f{align-items:flex-start;display:inline-flex}.spectrum-Field_d2db1f.spectrum-Field--positionSide_d2db1f .spectrum-Field-wrapper_d2db1f{min-width:0;width:var(--spectrum-field-default-width);height:100%;flex:1}.spectrum-Field_d2db1f.spectrum-Field--positionSide_d2db1f .spectrum-Field-wrapper_d2db1f .spectrum-Field-field_d2db1f{width:100%}.spectrum-Field_d2db1f.spectrum-Field--positionSide_d2db1f .spectrum-Field-field_d2db1f{min-width:0;flex:1}[dir=ltr] .spectrum-Field_d2db1f.spectrum-Field--positionSide_d2db1f .spectrum-Field-contextualHelp_d2db1f{margin-right:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}[dir=rtl] .spectrum-Field_d2db1f.spectrum-Field--positionSide_d2db1f .spectrum-Field-contextualHelp_d2db1f{margin-left:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.spectrum-Field_d2db1f.spectrum-Field--positionSide_d2db1f .spectrum-Field-contextualHelp_d2db1f{margin-top:var(--spectrum-global-dimension-size-65)}[dir=ltr] .spectrum-Field_d2db1f.spectrum-Field--hasContextualHelp_d2db1f .spectrum-FieldLabel_d2db1f{padding-right:0}[dir=rtl] .spectrum-Field_d2db1f.spectrum-Field--hasContextualHelp_d2db1f .spectrum-FieldLabel_d2db1f{padding-left:0}[dir=ltr] .spectrum-
|
1
|
+
[dir=ltr] .spectrum-FieldLabel_d2db1f{text-align:left}[dir=rtl] .spectrum-FieldLabel_d2db1f{text-align:right}.spectrum-FieldLabel_d2db1f{box-sizing:border-box;padding:var(--spectrum-fieldlabel-padding-top,var(--spectrum-global-dimension-size-50))0 var(--spectrum-fieldlabel-padding-bottom,var(--spectrum-global-dimension-size-65));font-size:var(--spectrum-fieldlabel-text-size,var(--spectrum-global-dimension-font-size-75));font-weight:var(--spectrum-fieldlabel-text-font-weight,var(--spectrum-global-font-weight-regular));line-height:var(--spectrum-fieldlabel-text-line-height,var(--spectrum-global-font-line-height-small));vertical-align:top;-webkit-font-smoothing:subpixel-antialiased;-moz-osx-font-smoothing:auto;font-smoothing:subpixel-antialiased;cursor:default;flex:none;display:flex}[dir=ltr] .spectrum-FieldLabel--positionSide_d2db1f{padding-right:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}[dir=rtl] .spectrum-FieldLabel--positionSide_d2db1f{padding-left:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.spectrum-FieldLabel--positionSide_d2db1f{padding-top:var(--spectrum-fieldlabel-side-padding-top,var(--spectrum-global-dimension-size-100));display:inline-flex}[dir=ltr] .spectrum-FieldLabel-requiredIcon_d2db1f{margin-right:0}[dir=rtl] .spectrum-FieldLabel-requiredIcon_d2db1f{margin-left:0}[dir=ltr] .spectrum-FieldLabel-requiredIcon_d2db1f{margin-left:var(--spectrum-fieldlabel-asterisk-gap,var(--spectrum-global-dimension-size-25))}[dir=rtl] .spectrum-FieldLabel-requiredIcon_d2db1f{margin-right:var(--spectrum-fieldlabel-asterisk-gap,var(--spectrum-global-dimension-size-25))}.spectrum-FieldLabel-requiredIcon_d2db1f{margin-top:var(--spectrum-fieldlabel-asterisk-margin-y,var(--spectrum-global-dimension-size-50));margin-bottom:0}[dir=ltr] .spectrum-FieldLabel--alignEnd_d2db1f{text-align:right}[dir=rtl] .spectrum-FieldLabel--alignEnd_d2db1f{text-align:left}.spectrum-FieldLabel--alignEnd_d2db1f{justify-content:flex-end}.spectrum-Field_d2db1f{--spectrum-field-default-width:var(--spectrum-alias-single-line-width,var(--spectrum-global-dimension-size-2400))}[dir=ltr] .spectrum-Field_d2db1f .spectrum-Field-contextualHelp_d2db1f{margin-left:var(--spectrum-global-dimension-size-50)}[dir=rtl] .spectrum-Field_d2db1f .spectrum-Field-contextualHelp_d2db1f{margin-right:var(--spectrum-global-dimension-size-50)}.spectrum-Field_d2db1f .spectrum-Field-contextualHelp_d2db1f{margin-top:var(--spectrum-global-dimension-size-25);grid-area:contextualHelp}.spectrum-Field_d2db1f:where(.spectrum-Field--positionTop_d2db1f){display:-ms-inline-grid;-ms-grid-columns:auto auto minmax(0,1fr);-ms-grid-rows:auto 1fr auto;width:var(--spectrum-field-default-width);grid-template:"label contextualHelp.""field field field"1fr"helpText helpText helpText"/auto auto minmax(0,1fr);align-content:start;display:inline-grid}.spectrum-Field_d2db1f:where(.spectrum-Field--positionTop_d2db1f) .spectrum-Field-field_d2db1f{width:100%;grid-area:field}.spectrum-Field_d2db1f:where(.spectrum-Field--positionTop_d2db1f).spectrum-Field--alignEnd_d2db1f{-ms-grid-columns:1fr auto 0;grid-template-columns:1fr auto 0}.spectrum-Field_d2db1f:where(.spectrum-Field--positionTop_d2db1f) .spectrum-FieldLabel_d2db1f{grid-area:label}.spectrum-Field_d2db1f:where(.spectrum-Field--positionSide_d2db1f){align-items:flex-start;display:inline-flex}.spectrum-Field_d2db1f:where(.spectrum-Field--positionSide_d2db1f) .spectrum-Field-wrapper_d2db1f{min-width:0;width:var(--spectrum-field-default-width);height:100%;flex:1}.spectrum-Field_d2db1f:where(.spectrum-Field--positionSide_d2db1f) .spectrum-Field-wrapper_d2db1f .spectrum-Field-field_d2db1f{width:100%}.spectrum-Field_d2db1f:where(.spectrum-Field--positionSide_d2db1f) .spectrum-Field-field_d2db1f{min-width:0;flex:1}[dir=ltr] .spectrum-Field_d2db1f:where(.spectrum-Field--positionSide_d2db1f) .spectrum-Field-contextualHelp_d2db1f{margin-right:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}[dir=rtl] .spectrum-Field_d2db1f:where(.spectrum-Field--positionSide_d2db1f) .spectrum-Field-contextualHelp_d2db1f{margin-left:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.spectrum-Field_d2db1f:where(.spectrum-Field--positionSide_d2db1f) .spectrum-Field-contextualHelp_d2db1f{margin-top:var(--spectrum-global-dimension-size-65)}[dir=ltr] .spectrum-Field_d2db1f.spectrum-Field--hasContextualHelp_d2db1f .spectrum-FieldLabel_d2db1f{padding-right:0}[dir=rtl] .spectrum-Field_d2db1f.spectrum-Field--hasContextualHelp_d2db1f .spectrum-FieldLabel_d2db1f{padding-left:0}[dir=ltr] .spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f){text-align:left}[dir=rtl] .spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f){text-align:right}.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f){border-collapse:separate;border-spacing:0 var(--spectrum-global-dimension-size-300);margin:calc(var(--spectrum-global-dimension-size-250)*-1)0;display:table}.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field_d2db1f{width:100%;display:table-row}.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field_d2db1f:not(.spectrum-Field--hasContextualHelp_d2db1f) .spectrum-FieldLabel_d2db1f,.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field_d2db1f.spectrum-Field--hasContextualHelp_d2db1f .spectrum-Field-labelCell_d2db1f{display:table-cell}.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field_d2db1f .spectrum-Field-labelCell_d2db1f{vertical-align:top}[dir=ltr] .spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field_d2db1f.spectrum-Field--alignEnd_d2db1f .spectrum-Field-labelCell_d2db1f{text-align:right}[dir=rtl] .spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field_d2db1f.spectrum-Field--alignEnd_d2db1f .spectrum-Field-labelCell_d2db1f{text-align:left}.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field_d2db1f .spectrum-Field-labelWrapper_d2db1f{display:inline-flex}.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field_d2db1f .spectrum-Field-labelWrapper_d2db1f .spectrum-FieldLabel_d2db1f{flex:1}.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field-wrapper_d2db1f{width:100%}.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field-field_d2db1f{width:auto;min-width:var(--spectrum-alias-single-line-width,var(--spectrum-global-dimension-size-2400))}.spectrum-Form_d2db1f:where(.spectrum-Form--positionTop_d2db1f){min-width:var(--spectrum-alias-single-line-width,var(--spectrum-global-dimension-size-2400));flex-direction:column;margin:0;display:flex}.spectrum-Form_d2db1f:where(.spectrum-Form--positionTop_d2db1f)>*{margin-top:var(--spectrum-global-dimension-size-100);width:100%}.spectrum-LabeledValue_d2db1f.spectrum-Field--positionSide_d2db1f{-ms-flex-align:first baseline;align-items:baseline}.spectrum-LabeledValue_d2db1f.spectrum-Field--positionSide_d2db1f .spectrum-Field-contextualHelp_d2db1f{top:var(--spectrum-global-dimension-size-40);position:relative}.spectrum-LabeledValue_d2db1f.spectrum-Field--positionTop_d2db1f{width:unset}.spectrum-LabeledValue_d2db1f .spectrum-FieldLabel_d2db1f.spectrum-FieldLabel_d2db1f{padding-top:0}.spectrum-LabeledValue_d2db1f .spectrum-Field-wrapper_d2db1f.spectrum-Field-wrapper_d2db1f{width:unset}.spectrum-LabeledValue_d2db1f .spectrum-Field-field_d2db1f{word-break:break-word;overflow:hidden}.spectrum-LabeledValue_d2db1f .spectrum-Field-contextualHelp_d2db1f{margin-top:calc(-1*var(--spectrum-global-dimension-size-25))}.spectrum-FieldLabel_d2db1f,.spectrum-Form-itemLabel_d2db1f{color:var(--spectrum-fieldlabel-text-color,var(--spectrum-alias-label-text-color))}.spectrum-FieldLabel_d2db1f.is-disabled_d2db1f,.spectrum-Form-itemLabel_d2db1f.is-disabled_d2db1f{color:var(--spectrum-fieldlabel-text-color-disabled,var(--spectrum-alias-text-color-disabled))}.spectrum-FieldLabel_d2db1f.is-disabled_d2db1f .spectrum-FieldLabel-requiredIcon_d2db1f,.spectrum-Form-itemLabel_d2db1f.is-disabled_d2db1f .spectrum-FieldLabel-requiredIcon_d2db1f{color:var(--spectrum-fieldlabel-asterisk-color-disabled,var(--spectrum-alias-text-color-disabled))}.spectrum-FieldLabel-requiredIcon_d2db1f{color:var(--spectrum-fieldlabel-asterisk-color,var(--spectrum-global-color-gray-600))}
|
package/dist/main.js
CHANGED
@@ -14,7 +14,28 @@ function $parcel$interopDefault(a) {
|
|
14
14
|
}
|
15
15
|
|
16
16
|
$parcel$export(module.exports, "LabeledValue", () => $2a7417c2df2197f7$export$d1328f67a56fa517);
|
17
|
-
|
17
|
+
/*
|
18
|
+
* Copyright 2022 Adobe. All rights reserved.
|
19
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
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
39
|
|
19
40
|
|
20
41
|
|
@@ -25,12 +46,12 @@ $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FieldLabel--positionSide", (
|
|
25
46
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FieldLabel-requiredIcon", () => $eb2fc0ee655eff6b$export$7c47642c7d46f3c9, (v) => $eb2fc0ee655eff6b$export$7c47642c7d46f3c9 = v);
|
26
47
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FieldLabel--alignEnd", () => $eb2fc0ee655eff6b$export$885efcc08143a987, (v) => $eb2fc0ee655eff6b$export$885efcc08143a987 = v);
|
27
48
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field", () => $eb2fc0ee655eff6b$export$f6d480ae1e56eba0, (v) => $eb2fc0ee655eff6b$export$f6d480ae1e56eba0 = v);
|
49
|
+
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-contextualHelp", () => $eb2fc0ee655eff6b$export$24fb860d16dd2d3f, (v) => $eb2fc0ee655eff6b$export$24fb860d16dd2d3f = v);
|
28
50
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field--positionTop", () => $eb2fc0ee655eff6b$export$a4ea780a9064d7f9, (v) => $eb2fc0ee655eff6b$export$a4ea780a9064d7f9 = v);
|
29
51
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-field", () => $eb2fc0ee655eff6b$export$3ab8a3dc7f0563d, (v) => $eb2fc0ee655eff6b$export$3ab8a3dc7f0563d = v);
|
30
52
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field--alignEnd", () => $eb2fc0ee655eff6b$export$5354c9be7ada5f83, (v) => $eb2fc0ee655eff6b$export$5354c9be7ada5f83 = v);
|
31
53
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field--positionSide", () => $eb2fc0ee655eff6b$export$2963225c91179589, (v) => $eb2fc0ee655eff6b$export$2963225c91179589 = v);
|
32
54
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-wrapper", () => $eb2fc0ee655eff6b$export$127df0b7290eb8ef, (v) => $eb2fc0ee655eff6b$export$127df0b7290eb8ef = v);
|
33
|
-
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-contextualHelp", () => $eb2fc0ee655eff6b$export$24fb860d16dd2d3f, (v) => $eb2fc0ee655eff6b$export$24fb860d16dd2d3f = v);
|
34
55
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field--hasContextualHelp", () => $eb2fc0ee655eff6b$export$9ba23707a252cdd4, (v) => $eb2fc0ee655eff6b$export$9ba23707a252cdd4 = v);
|
35
56
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Form", () => $eb2fc0ee655eff6b$export$94d2bcc94afabd89, (v) => $eb2fc0ee655eff6b$export$94d2bcc94afabd89 = v);
|
36
57
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Form--positionSide", () => $eb2fc0ee655eff6b$export$7f44db659563c8f4, (v) => $eb2fc0ee655eff6b$export$7f44db659563c8f4 = v);
|
@@ -45,12 +66,12 @@ var $eb2fc0ee655eff6b$export$9e6f19dc21f22f2e;
|
|
45
66
|
var $eb2fc0ee655eff6b$export$7c47642c7d46f3c9;
|
46
67
|
var $eb2fc0ee655eff6b$export$885efcc08143a987;
|
47
68
|
var $eb2fc0ee655eff6b$export$f6d480ae1e56eba0;
|
69
|
+
var $eb2fc0ee655eff6b$export$24fb860d16dd2d3f;
|
48
70
|
var $eb2fc0ee655eff6b$export$a4ea780a9064d7f9;
|
49
71
|
var $eb2fc0ee655eff6b$export$3ab8a3dc7f0563d;
|
50
72
|
var $eb2fc0ee655eff6b$export$5354c9be7ada5f83;
|
51
73
|
var $eb2fc0ee655eff6b$export$2963225c91179589;
|
52
74
|
var $eb2fc0ee655eff6b$export$127df0b7290eb8ef;
|
53
|
-
var $eb2fc0ee655eff6b$export$24fb860d16dd2d3f;
|
54
75
|
var $eb2fc0ee655eff6b$export$9ba23707a252cdd4;
|
55
76
|
var $eb2fc0ee655eff6b$export$94d2bcc94afabd89;
|
56
77
|
var $eb2fc0ee655eff6b$export$7f44db659563c8f4;
|
@@ -65,12 +86,12 @@ $eb2fc0ee655eff6b$export$9e6f19dc21f22f2e = "spectrum-FieldLabel--positionSide_d
|
|
65
86
|
$eb2fc0ee655eff6b$export$7c47642c7d46f3c9 = "spectrum-FieldLabel-requiredIcon_d2db1f";
|
66
87
|
$eb2fc0ee655eff6b$export$885efcc08143a987 = "spectrum-FieldLabel--alignEnd_d2db1f";
|
67
88
|
$eb2fc0ee655eff6b$export$f6d480ae1e56eba0 = "spectrum-Field_d2db1f";
|
89
|
+
$eb2fc0ee655eff6b$export$24fb860d16dd2d3f = "spectrum-Field-contextualHelp_d2db1f";
|
68
90
|
$eb2fc0ee655eff6b$export$a4ea780a9064d7f9 = "spectrum-Field--positionTop_d2db1f";
|
69
91
|
$eb2fc0ee655eff6b$export$3ab8a3dc7f0563d = "spectrum-Field-field_d2db1f";
|
70
92
|
$eb2fc0ee655eff6b$export$5354c9be7ada5f83 = "spectrum-Field--alignEnd_d2db1f";
|
71
93
|
$eb2fc0ee655eff6b$export$2963225c91179589 = "spectrum-Field--positionSide_d2db1f";
|
72
94
|
$eb2fc0ee655eff6b$export$127df0b7290eb8ef = "spectrum-Field-wrapper_d2db1f";
|
73
|
-
$eb2fc0ee655eff6b$export$24fb860d16dd2d3f = "spectrum-Field-contextualHelp_d2db1f";
|
74
95
|
$eb2fc0ee655eff6b$export$9ba23707a252cdd4 = "spectrum-Field--hasContextualHelp_d2db1f";
|
75
96
|
$eb2fc0ee655eff6b$export$94d2bcc94afabd89 = "spectrum-Form_d2db1f";
|
76
97
|
$eb2fc0ee655eff6b$export$7f44db659563c8f4 = "spectrum-Form--positionSide_d2db1f";
|
@@ -86,102 +107,102 @@ $eb2fc0ee655eff6b$export$d35bc1e505d1ebbf = "is-disabled_d2db1f";
|
|
86
107
|
|
87
108
|
function $2a7417c2df2197f7$var$LabeledValue(props, ref) {
|
88
109
|
let { value: value , formatOptions: formatOptions } = props;
|
89
|
-
let domRef = $3cJLQ$reactspectrumutils.useDOMRef(ref);
|
110
|
+
let domRef = (0, $3cJLQ$reactspectrumutils.useDOMRef)(ref);
|
90
111
|
let children;
|
91
112
|
if (Array.isArray(value)) // @ts-ignore
|
92
|
-
children = /*#__PURE__*/ ($parcel$interopDefault($3cJLQ$react)).createElement($2a7417c2df2197f7$var$FormattedStringList, {
|
113
|
+
children = /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement($2a7417c2df2197f7$var$FormattedStringList, {
|
93
114
|
value: value,
|
94
115
|
formatOptions: formatOptions
|
95
116
|
});
|
96
|
-
if (typeof value ===
|
117
|
+
if (typeof value === "object" && "start" in value && typeof value.start === "number" && typeof value.end === "number") children = /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement($2a7417c2df2197f7$var$FormattedNumber, {
|
97
118
|
value: value,
|
98
119
|
formatOptions: formatOptions
|
99
120
|
});
|
100
|
-
if (typeof value ===
|
121
|
+
if (typeof value === "object" && "start" in value && typeof value.start !== "number" && typeof value.end !== "number") children = /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement($2a7417c2df2197f7$var$FormattedDate, {
|
101
122
|
value: value,
|
102
123
|
formatOptions: formatOptions
|
103
124
|
});
|
104
|
-
if (typeof value ===
|
125
|
+
if (typeof value === "number") children = /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement($2a7417c2df2197f7$var$FormattedNumber, {
|
105
126
|
value: value,
|
106
127
|
formatOptions: formatOptions
|
107
128
|
});
|
108
|
-
if (typeof value ===
|
129
|
+
if (typeof value === "object" && ("calendar" in value || "hour" in value) || value instanceof Date) children = /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement($2a7417c2df2197f7$var$FormattedDate, {
|
109
130
|
value: value,
|
110
131
|
formatOptions: formatOptions
|
111
132
|
});
|
112
|
-
if (typeof value ===
|
113
|
-
return
|
133
|
+
if (typeof value === "string") children = value;
|
134
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement((0, $3cJLQ$reactspectrumlabel.Field), {
|
114
135
|
...props,
|
115
|
-
wrapperProps: $3cJLQ$reactariautils.filterDOMProps(props),
|
136
|
+
wrapperProps: (0, $3cJLQ$reactariautils.filterDOMProps)(props),
|
116
137
|
ref: domRef,
|
117
138
|
elementType: "span",
|
118
|
-
wrapperClassName: $3cJLQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($eb2fc0ee655eff6b$exports)),
|
119
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($3cJLQ$react)).createElement("span", null, children))
|
139
|
+
wrapperClassName: (0, $3cJLQ$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($eb2fc0ee655eff6b$exports))), "spectrum-LabeledValue")
|
140
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement("span", null, children));
|
120
141
|
}
|
121
142
|
function $2a7417c2df2197f7$var$FormattedStringList(props) {
|
122
|
-
let stringFormatter = $3cJLQ$reactariai18n.useListFormatter(props.formatOptions);
|
123
|
-
return
|
143
|
+
let stringFormatter = (0, $3cJLQ$reactariai18n.useListFormatter)(props.formatOptions);
|
144
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement((0, ($parcel$interopDefault($3cJLQ$react))).Fragment, null, stringFormatter.format(props.value));
|
124
145
|
}
|
125
146
|
function $2a7417c2df2197f7$var$FormattedNumber(props) {
|
126
|
-
let numberFormatter = $3cJLQ$reactariai18n.useNumberFormatter(props.formatOptions);
|
147
|
+
let numberFormatter = (0, $3cJLQ$reactariai18n.useNumberFormatter)(props.formatOptions);
|
127
148
|
let value = props.value;
|
128
|
-
if (typeof value ===
|
129
|
-
return
|
149
|
+
if (typeof value === "object") return /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement((0, ($parcel$interopDefault($3cJLQ$react))).Fragment, null, numberFormatter.formatRange(value.start, value.end));
|
150
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement((0, ($parcel$interopDefault($3cJLQ$react))).Fragment, null, numberFormatter.format(value));
|
130
151
|
}
|
131
152
|
function $2a7417c2df2197f7$var$FormattedDate(props) {
|
132
153
|
let { value: value , formatOptions: formatOptions } = props;
|
133
|
-
if (!formatOptions) formatOptions = $2a7417c2df2197f7$var$getDefaultFormatOptions(
|
134
|
-
let dateFormatter = $3cJLQ$reactariai18n.useDateFormatter(formatOptions);
|
135
|
-
let timeZone = dateFormatter.resolvedOptions().timeZone || $3cJLQ$internationalizeddate.getLocalTimeZone();
|
154
|
+
if (!formatOptions) formatOptions = $2a7417c2df2197f7$var$getDefaultFormatOptions("start" in value ? value.start : value);
|
155
|
+
let dateFormatter = (0, $3cJLQ$reactariai18n.useDateFormatter)(formatOptions);
|
156
|
+
let timeZone = dateFormatter.resolvedOptions().timeZone || (0, $3cJLQ$internationalizeddate.getLocalTimeZone)();
|
136
157
|
let final;
|
137
|
-
if (
|
158
|
+
if ("start" in value && "end" in value) {
|
138
159
|
let start = value.start;
|
139
160
|
let end = value.end;
|
140
161
|
start = $2a7417c2df2197f7$var$convertDateTime(start, timeZone);
|
141
162
|
end = $2a7417c2df2197f7$var$convertDateTime(end, timeZone);
|
142
|
-
return
|
163
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement((0, ($parcel$interopDefault($3cJLQ$react))).Fragment, null, dateFormatter.formatRange(start, end));
|
143
164
|
}
|
144
165
|
final = $2a7417c2df2197f7$var$convertDateTime(value, timeZone);
|
145
|
-
return
|
166
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement((0, ($parcel$interopDefault($3cJLQ$react))).Fragment, null, dateFormatter.format(final));
|
146
167
|
}
|
147
168
|
function $2a7417c2df2197f7$var$convertDateTime(value, timeZone) {
|
148
|
-
if (
|
149
|
-
else if (
|
169
|
+
if ("timeZone" in value) return value.toDate();
|
170
|
+
else if ("calendar" in value) return value.toDate(timeZone);
|
150
171
|
else if (!(value instanceof Date)) return $2a7417c2df2197f7$var$convertValue(value).toDate(timeZone);
|
151
172
|
return value;
|
152
173
|
}
|
153
174
|
function $2a7417c2df2197f7$var$getDefaultFormatOptions(value) {
|
154
175
|
if (value instanceof Date) return {
|
155
|
-
dateStyle:
|
156
|
-
timeStyle:
|
176
|
+
dateStyle: "long",
|
177
|
+
timeStyle: "short"
|
157
178
|
};
|
158
|
-
else if (
|
159
|
-
year:
|
160
|
-
month:
|
161
|
-
day:
|
162
|
-
hour:
|
163
|
-
minute:
|
179
|
+
else if ("timeZone" in value) return {
|
180
|
+
year: "numeric",
|
181
|
+
month: "long",
|
182
|
+
day: "numeric",
|
183
|
+
hour: "numeric",
|
184
|
+
minute: "numeric",
|
164
185
|
timeZone: value.timeZone,
|
165
|
-
timeZoneName:
|
186
|
+
timeZoneName: "short"
|
166
187
|
};
|
167
|
-
else if (
|
168
|
-
dateStyle:
|
169
|
-
timeStyle:
|
188
|
+
else if ("hour" in value && "year" in value) return {
|
189
|
+
dateStyle: "long",
|
190
|
+
timeStyle: "short"
|
170
191
|
};
|
171
|
-
else if (
|
172
|
-
timeStyle:
|
192
|
+
else if ("hour" in value) return {
|
193
|
+
timeStyle: "short"
|
173
194
|
};
|
174
195
|
else return {
|
175
|
-
dateStyle:
|
196
|
+
dateStyle: "long"
|
176
197
|
};
|
177
198
|
}
|
178
199
|
function $2a7417c2df2197f7$var$convertValue(value) {
|
179
|
-
let date = $3cJLQ$internationalizeddate.today($3cJLQ$internationalizeddate.getLocalTimeZone());
|
180
|
-
return $3cJLQ$internationalizeddate.toCalendarDateTime(date, value);
|
200
|
+
let date = (0, $3cJLQ$internationalizeddate.today)((0, $3cJLQ$internationalizeddate.getLocalTimeZone)());
|
201
|
+
return (0, $3cJLQ$internationalizeddate.toCalendarDateTime)(date, value);
|
181
202
|
}
|
182
203
|
/**
|
183
204
|
* A LabeledValue displays a non-editable value with a label. It formats numbers, dates, times, and lists according to the user's locale.
|
184
|
-
*/ let $2a7417c2df2197f7$export$d1328f67a56fa517 = /*#__PURE__*/ ($parcel$interopDefault($3cJLQ$react)).forwardRef($2a7417c2df2197f7$var$LabeledValue);
|
205
|
+
*/ let $2a7417c2df2197f7$export$d1328f67a56fa517 = /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).forwardRef($2a7417c2df2197f7$var$LabeledValue);
|
185
206
|
|
186
207
|
|
187
208
|
|
package/dist/main.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;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ACvC,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,GAAG,CAAC,yCAAa,iBAAG,sCAAK,CAAC,UAAU,CAAC,kCAAY","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;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;ACZA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,I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,EAAE;IACvD,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,EAA8B;IAC5E,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,EAAE;IACjC,IAAI,OAAO,CAAA,GAAA,kCAAI,EAAE,CAAA,GAAA,6CAAe;IAEhC,OAAO,CAAA,GAAA,+CAAkB,AAAD,EAAE,MAAM;AAClC;AAEA;;CAEC,GACD,IAAI,0DAAgB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;;AD/KrC","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"}
|
package/dist/module.mjs
CHANGED
@@ -12,7 +12,28 @@ function $parcel$interopDefault(a) {
|
|
12
12
|
function $parcel$export(e, n, v, s) {
|
13
13
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
14
14
|
}
|
15
|
-
|
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
|
+
*/
|
16
37
|
|
17
38
|
|
18
39
|
|
@@ -23,12 +44,12 @@ $parcel$export($cd231e464c886c86$exports, "spectrum-FieldLabel--positionSide", (
|
|
23
44
|
$parcel$export($cd231e464c886c86$exports, "spectrum-FieldLabel-requiredIcon", () => $cd231e464c886c86$export$7c47642c7d46f3c9, (v) => $cd231e464c886c86$export$7c47642c7d46f3c9 = v);
|
24
45
|
$parcel$export($cd231e464c886c86$exports, "spectrum-FieldLabel--alignEnd", () => $cd231e464c886c86$export$885efcc08143a987, (v) => $cd231e464c886c86$export$885efcc08143a987 = v);
|
25
46
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Field", () => $cd231e464c886c86$export$f6d480ae1e56eba0, (v) => $cd231e464c886c86$export$f6d480ae1e56eba0 = v);
|
47
|
+
$parcel$export($cd231e464c886c86$exports, "spectrum-Field-contextualHelp", () => $cd231e464c886c86$export$24fb860d16dd2d3f, (v) => $cd231e464c886c86$export$24fb860d16dd2d3f = v);
|
26
48
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Field--positionTop", () => $cd231e464c886c86$export$a4ea780a9064d7f9, (v) => $cd231e464c886c86$export$a4ea780a9064d7f9 = v);
|
27
49
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Field-field", () => $cd231e464c886c86$export$3ab8a3dc7f0563d, (v) => $cd231e464c886c86$export$3ab8a3dc7f0563d = v);
|
28
50
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Field--alignEnd", () => $cd231e464c886c86$export$5354c9be7ada5f83, (v) => $cd231e464c886c86$export$5354c9be7ada5f83 = v);
|
29
51
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Field--positionSide", () => $cd231e464c886c86$export$2963225c91179589, (v) => $cd231e464c886c86$export$2963225c91179589 = v);
|
30
52
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Field-wrapper", () => $cd231e464c886c86$export$127df0b7290eb8ef, (v) => $cd231e464c886c86$export$127df0b7290eb8ef = v);
|
31
|
-
$parcel$export($cd231e464c886c86$exports, "spectrum-Field-contextualHelp", () => $cd231e464c886c86$export$24fb860d16dd2d3f, (v) => $cd231e464c886c86$export$24fb860d16dd2d3f = v);
|
32
53
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Field--hasContextualHelp", () => $cd231e464c886c86$export$9ba23707a252cdd4, (v) => $cd231e464c886c86$export$9ba23707a252cdd4 = v);
|
33
54
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Form", () => $cd231e464c886c86$export$94d2bcc94afabd89, (v) => $cd231e464c886c86$export$94d2bcc94afabd89 = v);
|
34
55
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Form--positionSide", () => $cd231e464c886c86$export$7f44db659563c8f4, (v) => $cd231e464c886c86$export$7f44db659563c8f4 = v);
|
@@ -43,12 +64,12 @@ var $cd231e464c886c86$export$9e6f19dc21f22f2e;
|
|
43
64
|
var $cd231e464c886c86$export$7c47642c7d46f3c9;
|
44
65
|
var $cd231e464c886c86$export$885efcc08143a987;
|
45
66
|
var $cd231e464c886c86$export$f6d480ae1e56eba0;
|
67
|
+
var $cd231e464c886c86$export$24fb860d16dd2d3f;
|
46
68
|
var $cd231e464c886c86$export$a4ea780a9064d7f9;
|
47
69
|
var $cd231e464c886c86$export$3ab8a3dc7f0563d;
|
48
70
|
var $cd231e464c886c86$export$5354c9be7ada5f83;
|
49
71
|
var $cd231e464c886c86$export$2963225c91179589;
|
50
72
|
var $cd231e464c886c86$export$127df0b7290eb8ef;
|
51
|
-
var $cd231e464c886c86$export$24fb860d16dd2d3f;
|
52
73
|
var $cd231e464c886c86$export$9ba23707a252cdd4;
|
53
74
|
var $cd231e464c886c86$export$94d2bcc94afabd89;
|
54
75
|
var $cd231e464c886c86$export$7f44db659563c8f4;
|
@@ -63,12 +84,12 @@ $cd231e464c886c86$export$9e6f19dc21f22f2e = "spectrum-FieldLabel--positionSide_d
|
|
63
84
|
$cd231e464c886c86$export$7c47642c7d46f3c9 = "spectrum-FieldLabel-requiredIcon_d2db1f";
|
64
85
|
$cd231e464c886c86$export$885efcc08143a987 = "spectrum-FieldLabel--alignEnd_d2db1f";
|
65
86
|
$cd231e464c886c86$export$f6d480ae1e56eba0 = "spectrum-Field_d2db1f";
|
87
|
+
$cd231e464c886c86$export$24fb860d16dd2d3f = "spectrum-Field-contextualHelp_d2db1f";
|
66
88
|
$cd231e464c886c86$export$a4ea780a9064d7f9 = "spectrum-Field--positionTop_d2db1f";
|
67
89
|
$cd231e464c886c86$export$3ab8a3dc7f0563d = "spectrum-Field-field_d2db1f";
|
68
90
|
$cd231e464c886c86$export$5354c9be7ada5f83 = "spectrum-Field--alignEnd_d2db1f";
|
69
91
|
$cd231e464c886c86$export$2963225c91179589 = "spectrum-Field--positionSide_d2db1f";
|
70
92
|
$cd231e464c886c86$export$127df0b7290eb8ef = "spectrum-Field-wrapper_d2db1f";
|
71
|
-
$cd231e464c886c86$export$24fb860d16dd2d3f = "spectrum-Field-contextualHelp_d2db1f";
|
72
93
|
$cd231e464c886c86$export$9ba23707a252cdd4 = "spectrum-Field--hasContextualHelp_d2db1f";
|
73
94
|
$cd231e464c886c86$export$94d2bcc94afabd89 = "spectrum-Form_d2db1f";
|
74
95
|
$cd231e464c886c86$export$7f44db659563c8f4 = "spectrum-Form--positionSide_d2db1f";
|
@@ -84,102 +105,102 @@ $cd231e464c886c86$export$d35bc1e505d1ebbf = "is-disabled_d2db1f";
|
|
84
105
|
|
85
106
|
function $3e9971be431adb24$var$LabeledValue(props, ref) {
|
86
107
|
let { value: value , formatOptions: formatOptions } = props;
|
87
|
-
let domRef = $3xnHL$useDOMRef(ref);
|
108
|
+
let domRef = (0, $3xnHL$useDOMRef)(ref);
|
88
109
|
let children;
|
89
110
|
if (Array.isArray(value)) // @ts-ignore
|
90
|
-
children = /*#__PURE__*/ $3xnHL$react.createElement($3e9971be431adb24$var$FormattedStringList, {
|
111
|
+
children = /*#__PURE__*/ (0, $3xnHL$react).createElement($3e9971be431adb24$var$FormattedStringList, {
|
91
112
|
value: value,
|
92
113
|
formatOptions: formatOptions
|
93
114
|
});
|
94
|
-
if (typeof value ===
|
115
|
+
if (typeof value === "object" && "start" in value && typeof value.start === "number" && typeof value.end === "number") children = /*#__PURE__*/ (0, $3xnHL$react).createElement($3e9971be431adb24$var$FormattedNumber, {
|
95
116
|
value: value,
|
96
117
|
formatOptions: formatOptions
|
97
118
|
});
|
98
|
-
if (typeof value ===
|
119
|
+
if (typeof value === "object" && "start" in value && typeof value.start !== "number" && typeof value.end !== "number") children = /*#__PURE__*/ (0, $3xnHL$react).createElement($3e9971be431adb24$var$FormattedDate, {
|
99
120
|
value: value,
|
100
121
|
formatOptions: formatOptions
|
101
122
|
});
|
102
|
-
if (typeof value ===
|
123
|
+
if (typeof value === "number") children = /*#__PURE__*/ (0, $3xnHL$react).createElement($3e9971be431adb24$var$FormattedNumber, {
|
103
124
|
value: value,
|
104
125
|
formatOptions: formatOptions
|
105
126
|
});
|
106
|
-
if (typeof value ===
|
127
|
+
if (typeof value === "object" && ("calendar" in value || "hour" in value) || value instanceof Date) children = /*#__PURE__*/ (0, $3xnHL$react).createElement($3e9971be431adb24$var$FormattedDate, {
|
107
128
|
value: value,
|
108
129
|
formatOptions: formatOptions
|
109
130
|
});
|
110
|
-
if (typeof value ===
|
111
|
-
return
|
131
|
+
if (typeof value === "string") children = value;
|
132
|
+
return /*#__PURE__*/ (0, $3xnHL$react).createElement((0, $3xnHL$Field), {
|
112
133
|
...props,
|
113
|
-
wrapperProps: $3xnHL$filterDOMProps(props),
|
134
|
+
wrapperProps: (0, $3xnHL$filterDOMProps)(props),
|
114
135
|
ref: domRef,
|
115
136
|
elementType: "span",
|
116
|
-
wrapperClassName: $3xnHL$classNames((/*@__PURE__*/$parcel$interopDefault($cd231e464c886c86$exports)),
|
117
|
-
}, /*#__PURE__*/ $3xnHL$react.createElement("span", null, children))
|
137
|
+
wrapperClassName: (0, $3xnHL$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cd231e464c886c86$exports))), "spectrum-LabeledValue")
|
138
|
+
}, /*#__PURE__*/ (0, $3xnHL$react).createElement("span", null, children));
|
118
139
|
}
|
119
140
|
function $3e9971be431adb24$var$FormattedStringList(props) {
|
120
|
-
let stringFormatter = $3xnHL$useListFormatter(props.formatOptions);
|
121
|
-
return
|
141
|
+
let stringFormatter = (0, $3xnHL$useListFormatter)(props.formatOptions);
|
142
|
+
return /*#__PURE__*/ (0, $3xnHL$react).createElement((0, $3xnHL$react).Fragment, null, stringFormatter.format(props.value));
|
122
143
|
}
|
123
144
|
function $3e9971be431adb24$var$FormattedNumber(props) {
|
124
|
-
let numberFormatter = $3xnHL$useNumberFormatter(props.formatOptions);
|
145
|
+
let numberFormatter = (0, $3xnHL$useNumberFormatter)(props.formatOptions);
|
125
146
|
let value = props.value;
|
126
|
-
if (typeof value ===
|
127
|
-
return
|
147
|
+
if (typeof value === "object") return /*#__PURE__*/ (0, $3xnHL$react).createElement((0, $3xnHL$react).Fragment, null, numberFormatter.formatRange(value.start, value.end));
|
148
|
+
return /*#__PURE__*/ (0, $3xnHL$react).createElement((0, $3xnHL$react).Fragment, null, numberFormatter.format(value));
|
128
149
|
}
|
129
150
|
function $3e9971be431adb24$var$FormattedDate(props) {
|
130
151
|
let { value: value , formatOptions: formatOptions } = props;
|
131
|
-
if (!formatOptions) formatOptions = $3e9971be431adb24$var$getDefaultFormatOptions(
|
132
|
-
let dateFormatter = $3xnHL$useDateFormatter(formatOptions);
|
133
|
-
let timeZone = dateFormatter.resolvedOptions().timeZone || $3xnHL$getLocalTimeZone();
|
152
|
+
if (!formatOptions) formatOptions = $3e9971be431adb24$var$getDefaultFormatOptions("start" in value ? value.start : value);
|
153
|
+
let dateFormatter = (0, $3xnHL$useDateFormatter)(formatOptions);
|
154
|
+
let timeZone = dateFormatter.resolvedOptions().timeZone || (0, $3xnHL$getLocalTimeZone)();
|
134
155
|
let final;
|
135
|
-
if (
|
156
|
+
if ("start" in value && "end" in value) {
|
136
157
|
let start = value.start;
|
137
158
|
let end = value.end;
|
138
159
|
start = $3e9971be431adb24$var$convertDateTime(start, timeZone);
|
139
160
|
end = $3e9971be431adb24$var$convertDateTime(end, timeZone);
|
140
|
-
return
|
161
|
+
return /*#__PURE__*/ (0, $3xnHL$react).createElement((0, $3xnHL$react).Fragment, null, dateFormatter.formatRange(start, end));
|
141
162
|
}
|
142
163
|
final = $3e9971be431adb24$var$convertDateTime(value, timeZone);
|
143
|
-
return
|
164
|
+
return /*#__PURE__*/ (0, $3xnHL$react).createElement((0, $3xnHL$react).Fragment, null, dateFormatter.format(final));
|
144
165
|
}
|
145
166
|
function $3e9971be431adb24$var$convertDateTime(value, timeZone) {
|
146
|
-
if (
|
147
|
-
else if (
|
167
|
+
if ("timeZone" in value) return value.toDate();
|
168
|
+
else if ("calendar" in value) return value.toDate(timeZone);
|
148
169
|
else if (!(value instanceof Date)) return $3e9971be431adb24$var$convertValue(value).toDate(timeZone);
|
149
170
|
return value;
|
150
171
|
}
|
151
172
|
function $3e9971be431adb24$var$getDefaultFormatOptions(value) {
|
152
173
|
if (value instanceof Date) return {
|
153
|
-
dateStyle:
|
154
|
-
timeStyle:
|
174
|
+
dateStyle: "long",
|
175
|
+
timeStyle: "short"
|
155
176
|
};
|
156
|
-
else if (
|
157
|
-
year:
|
158
|
-
month:
|
159
|
-
day:
|
160
|
-
hour:
|
161
|
-
minute:
|
177
|
+
else if ("timeZone" in value) return {
|
178
|
+
year: "numeric",
|
179
|
+
month: "long",
|
180
|
+
day: "numeric",
|
181
|
+
hour: "numeric",
|
182
|
+
minute: "numeric",
|
162
183
|
timeZone: value.timeZone,
|
163
|
-
timeZoneName:
|
184
|
+
timeZoneName: "short"
|
164
185
|
};
|
165
|
-
else if (
|
166
|
-
dateStyle:
|
167
|
-
timeStyle:
|
186
|
+
else if ("hour" in value && "year" in value) return {
|
187
|
+
dateStyle: "long",
|
188
|
+
timeStyle: "short"
|
168
189
|
};
|
169
|
-
else if (
|
170
|
-
timeStyle:
|
190
|
+
else if ("hour" in value) return {
|
191
|
+
timeStyle: "short"
|
171
192
|
};
|
172
193
|
else return {
|
173
|
-
dateStyle:
|
194
|
+
dateStyle: "long"
|
174
195
|
};
|
175
196
|
}
|
176
197
|
function $3e9971be431adb24$var$convertValue(value) {
|
177
|
-
let date = $3xnHL$today($3xnHL$getLocalTimeZone());
|
178
|
-
return $3xnHL$toCalendarDateTime(date, value);
|
198
|
+
let date = (0, $3xnHL$today)((0, $3xnHL$getLocalTimeZone)());
|
199
|
+
return (0, $3xnHL$toCalendarDateTime)(date, value);
|
179
200
|
}
|
180
201
|
/**
|
181
202
|
* A LabeledValue displays a non-editable value with a label. It formats numbers, dates, times, and lists according to the user's locale.
|
182
|
-
*/ let $3e9971be431adb24$export$d1328f67a56fa517 = /*#__PURE__*/ $3xnHL$react.forwardRef($3e9971be431adb24$var$LabeledValue);
|
203
|
+
*/ let $3e9971be431adb24$export$d1328f67a56fa517 = /*#__PURE__*/ (0, $3xnHL$react).forwardRef($3e9971be431adb24$var$LabeledValue);
|
183
204
|
|
184
205
|
|
185
206
|
|
package/dist/module.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAAqC;AACrC,GAAmD;AACnD,GAAkD;AAClD,GAA+C;AAC/C,GAAgC;AAChC,GAA6C;AAC7C,GAAsC;AACtC,GAA0C;AAC1C,GAA8C;AAC9C,GAAwC;AACxC,GAA+C;AAC/C,GAAmD;AACnD,GAA+B;AAC/B,GAA6C;AAC7C,GAA0C;AAC1C,GAA6C;AAC7C,GAA4C;AAC5C,GAAuC;AACvC,GAAyC;AACzC,GAA6B;AAnB7B,wCAAqC,GAAG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G5C,MAAM,CAAC,KAAK;AACd,CAAC;SAEQ,6CAAuB,CAAC,KAAe,EAA8B,CAAC;IAC7E,EAAE,EAAE,KAAK,YAAY,IAAI,EACvB,MAAM,CAAC,CAAC;QAAA,SAAS,EAAE,CAAM;QAAE,SAAS,EAAE,CAAO;IAAA,CAAC;SACzC,EAAE,EAAE,CAAU,aAAI,KAAK,EAC5B,MAAM,CAAC,CAAC;QAAA,IAAI,EAAE,CAAS;QAAE,KAAK,EAAE,CAAM;QAAE,GAAG,EAAE,CAAS;QAAE,IAAI,EAAE,CAAS;QAAE,MAAM,EAAE,CAAS;QAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ;QAAE,YAAY,EAAE,CAAO;IAAA,CAAC;SACvI,EAAE,EAAE,CAAM,SAAI,KAAK,IAAI,CAAM,SAAI,KAAK,EAC3C,MAAM,CAAC,CAAC;QAAA,SAAS,EAAE,CAAM;QAAE,SAAS,EAAE,CAAO;IAAA,CAAC;SACzC,EAAE,EAAE,CAAM,SAAI,KAAK,EACxB,MAAM,CAAC,CAAC;QAAA,SAAS,EAAE,CAAO;IAAA,CAAC;SAE3B,MAAM,CAAC,CAAC;QAAA,SAAS,EAAE,CAAM;IAAA,CAAC;AAE9B,CAAC;SAEQ,kCAAY,CAAC,KAAW,EAAE,CAAC;IAClC,GAAG,CAAC,IAAI,GAAG,YAAK,CAAC,uBAAgB;IAEjC,MAAM,CAAC,yBAAkB,CAAC,IAAI,EAAE,KAAK;AACvC,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,GAAG,CAAC,yCAAa,iBAAG,YAAK,CAAC,UAAU,CAAC,kCAAY","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.mjs.map"}
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;ACZA,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;AAnBA,2CAAwC;AACxC,4CAAsD;AACtD,4CAAqD;AACrD,4CAAkD;AAClD,4CAAmC;AACnC,4CAAkD;AAClD,4CAAgD;AAChD,2CAAyC;AACzC,4CAA6C;AAC7C,4CAAiD;AACjD,4CAA2C;AAC3C,4CAAsD;AACtD,4CAAkC;AAClC,4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,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,EAAE;IACjC,IAAI,OAAO,CAAA,GAAA,YAAI,EAAE,CAAA,GAAA,uBAAe;IAEhC,OAAO,CAAA,GAAA,yBAAkB,AAAD,EAAE,MAAM;AAClC;AAEA;;CAEC,GACD,IAAI,0DAAgB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC;;AD/KrC","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.mjs.map"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-spectrum/labeledvalue",
|
3
|
-
"version": "3.0.2-nightly.
|
3
|
+
"version": "3.0.2-nightly.3600+bfce84fee",
|
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
|
-
"@
|
40
|
-
"@
|
41
|
-
"@react-aria/
|
42
|
-
"@react-
|
43
|
-
"@react-spectrum/
|
44
|
-
"@react-
|
45
|
-
"@
|
39
|
+
"@internationalized/date": "3.0.2-nightly.3600+bfce84fee",
|
40
|
+
"@react-aria/i18n": "3.0.0-nightly.1900+bfce84fee",
|
41
|
+
"@react-aria/utils": "3.0.0-nightly.1900+bfce84fee",
|
42
|
+
"@react-spectrum/label": "3.9.1-nightly.3600+bfce84fee",
|
43
|
+
"@react-spectrum/utils": "3.0.0-nightly.1900+bfce84fee",
|
44
|
+
"@react-types/shared": "3.0.0-nightly.1900+bfce84fee",
|
45
|
+
"@swc/helpers": "^0.4.14"
|
46
46
|
},
|
47
47
|
"devDependencies": {
|
48
|
-
"@adobe/spectrum-css-temp": "3.0.0-nightly.
|
48
|
+
"@adobe/spectrum-css-temp": "3.0.0-nightly.1900+bfce84fee"
|
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": "bfce84fee12a027d9cbc38b43e1747e3e4b4b169"
|
58
58
|
}
|