@react-spectrum/actiongroup 3.10.8 → 3.10.10
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/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2019 Adobe
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;AA6BD,SAAS,kCAA8B,KAAkC,EAAE,GAA2B;IACpG,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAE5B,IAAI,gBACF,YAAY,WACZ,OAAO,eACP,WAAW,cACX,UAAU,eACV,cAAc,uBACd,OAAO,eACP,WAAW,gBACX,eAAe,kBACf,QAAQ,uBACR,mBAAmB,eACnB,WAAW,EACX,GAAG,YACJ,GAAG;IAEJ,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,aAAa,CAAA,GAAA,mBAAK,EAAkB;IACxC,IAAI,QAAQ,CAAA,GAAA,oCAAW,EAAE;QAAC,GAAG,KAAK;QAAE,0BAA0B;IAAI;IAClE,IAAI,oBAAC,gBAAgB,EAAC,GAAG,CAAA,GAAA,0CAAa,EAAE,OAAO,OAAO;IACtD,IAAI,aAAa,gBAAgB;IACjC,IAAI,gBAAgB;sBAAC;oBAAc;iBAAY;IAAO;IACtD,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IAEjC,8FAA8F;IAC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Q,qBAAqB,GAAG,KAAK,GAAI,CAAA,mBAAmB,IAAI,+BAAS,MAAM,UAAU,CAAA,IAAM,CAAA,oBAAoB,IAAI,+BAAS,MAAM,WAAW,CAAA;AAC1J;AAGA,SAAS,kCAAY,OAAoB,EAAE,eAAwB,EAAE,kBAA2B;IAC9F,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,OAAO,QAAQ,qBAAqB,GAAG,MAAM,GAAI,CAAA,kBAAkB,IAAI,+BAAS,MAAM,SAAS,CAAA,IAAM,CAAA,qBAAqB,IAAI,+BAAS,MAAM,YAAY,CAAA;AAC3J;AAEA,SAAS,+BAAS,KAAa;IAC7B,IAAI,SAAS,SAAS,OAAO;IAC7B,OAAO,MAAM,UAAU,IAAI;AAC7B","sources":["packages/@react-spectrum/actiongroup/src/ActionGroup.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\nimport {ActionButton} from '@react-spectrum/button';\nimport {AriaLabelingProps, DOMProps, DOMRef, Key, Node, StyleProps} from '@react-types/shared';\nimport buttonStyles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport ChevronDownMedium from '@spectrum-icons/ui/ChevronDownMedium';\nimport {\n classNames,\n ClearSlots,\n SlotProvider,\n useDOMRef,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport {filterDOMProps, mergeProps, useId, useLayoutEffect, useResizeObserver, useValueEffect} from '@react-aria/utils';\nimport {FocusScope} from '@react-aria/focus';\nimport {Item, Menu, MenuTrigger} from '@react-spectrum/menu';\nimport {ListState, useListState} from '@react-stately/list';\nimport More from '@spectrum-icons/workflow/More';\nimport {PressResponder, useHover} from '@react-aria/interactions';\nimport {Provider, useProviderProps} from '@react-spectrum/provider';\nimport React, {forwardRef, ReactElement, ReactNode, useCallback, useMemo, useRef, useState} from 'react';\nimport {SpectrumActionGroupProps} from '@react-types/actiongroup';\nimport styles from '@adobe/spectrum-css-temp/components/actiongroup/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {Tooltip, TooltipTrigger} from '@react-spectrum/tooltip';\nimport {useActionGroup, useActionGroupItem} from '@react-aria/actiongroup';\n\n\nfunction ActionGroup<T extends object>(props: SpectrumActionGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n props = useSlotProps(props, 'actionGroup');\n\n let {\n isEmphasized,\n density,\n isJustified,\n isDisabled,\n orientation = 'horizontal',\n isQuiet,\n staticColor,\n overflowMode = 'wrap',\n onAction,\n buttonLabelBehavior,\n summaryIcon,\n ...otherProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n let state = useListState({...props, suppressTextValueWarning: true});\n let {actionGroupProps} = useActionGroup(props, state, domRef);\n let isVertical = orientation === 'vertical';\n let providerProps = {isEmphasized, isDisabled, isQuiet};\n let {styleProps} = useStyleProps(props);\n\n // Only hide button text if every item contains more than just plain text (we assume an icon).\n let isIconCollapsible = useMemo(() => [...state.collection].every(item => typeof item.rendered !== 'string'), [state.collection]);\n let [{visibleItems, hideButtonText, isMeasuring}, setVisibleItems] = useValueEffect({\n visibleItems: state.collection.size,\n hideButtonText: buttonLabelBehavior === 'hide' && isIconCollapsible,\n isMeasuring: false\n });\n\n let selectionMode = state.selectionManager.selectionMode;\n let updateOverflow = useCallback(() => {\n if (overflowMode === 'wrap') {\n return;\n }\n\n if (orientation === 'vertical' && selectionMode !== 'none') {\n // Collapsing vertical action groups with selection is currently unsupported by Spectrum.\n return;\n }\n\n let computeVisibleItems = (visibleItems: number) => {\n if (domRef.current && wrapperRef.current) {\n let listItems = Array.from(domRef.current.children) as HTMLLIElement[];\n let containerSize = orientation === 'horizontal' ? wrapperRef.current.getBoundingClientRect().width : wrapperRef.current.getBoundingClientRect().height;\n\n let isShowingMenu = visibleItems < state.collection.size;\n let calculatedSize = 0;\n let newVisibleItems = 0;\n\n if (isShowingMenu) {\n let item = listItems.pop();\n if (item) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, false, true)\n : outerHeight(item, false, true);\n }\n }\n\n for (let [i, item] of listItems.entries()) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, i === 0, i === listItems.length - 1)\n : outerHeight(item, i === 0, i === listItems.length - 1);\n if (Math.round(calculatedSize) <= Math.round(containerSize)) {\n newVisibleItems++;\n } else {\n break;\n }\n }\n\n // If selection is enabled, and not all of the items fit, collapse all of them into a dropdown\n // immediately rather than having some visible and some not.\n if (selectionMode !== 'none' && newVisibleItems < state.collection.size) {\n return 0;\n }\n\n return newVisibleItems;\n }\n return visibleItems;\n };\n\n setVisibleItems(function *() {\n let hideButtonText = buttonLabelBehavior === 'hide' && isIconCollapsible;\n\n // Update to show all items.\n yield {\n visibleItems: state.collection.size,\n hideButtonText,\n isMeasuring: true\n };\n\n // Measure, and update to show the items that fit.\n let newVisibleItems = computeVisibleItems(state.collection.size);\n let isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n\n // If not all of the buttons fit, and buttonLabelBehavior is 'collapse', then first try hiding\n // the button text and only showing icons. Only if that still doesn't fit collapse into a menu.\n if (newVisibleItems < state.collection.size && buttonLabelBehavior === 'collapse' && isIconCollapsible) {\n yield {\n visibleItems: state.collection.size,\n hideButtonText: true,\n isMeasuring: true\n };\n\n newVisibleItems = computeVisibleItems(state.collection.size);\n isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n hideButtonText = true;\n }\n\n yield {\n visibleItems: newVisibleItems,\n hideButtonText,\n isMeasuring\n };\n\n // If the number of items is less than the number of children,\n // then update again to ensure that the menu fits.\n if (isMeasuring) {\n yield {\n visibleItems: computeVisibleItems(newVisibleItems),\n hideButtonText,\n isMeasuring: false\n };\n }\n });\n }, [domRef, state.collection, setVisibleItems, overflowMode, selectionMode, buttonLabelBehavior, isIconCollapsible, orientation]);\n\n // Watch the parent element for size changes. Watching only the action group itself may not work\n // in all scenarios because it may not shrink when available space is reduced.\n let parentRef = useMemo(() => ({\n get current() {\n return wrapperRef.current?.parentElement;\n }\n }), [wrapperRef]);\n useResizeObserver({ref: overflowMode !== 'wrap' ? parentRef : undefined, onResize: updateOverflow});\n useLayoutEffect(updateOverflow, [updateOverflow, state.collection]);\n\n let children = [...state.collection];\n let menuItem: ReactElement | null = null;\n let menuProps = {};\n\n // If there are no visible items, don't apply any props to the action group container\n // and pass all aria labeling props through to the menu button.\n if (overflowMode === 'collapse' && visibleItems === 0) {\n menuProps = filterDOMProps(props, {labelable: true});\n actionGroupProps = {};\n }\n\n if (overflowMode === 'collapse' && visibleItems < state.collection.size) {\n let menuChildren = children.slice(visibleItems);\n children = children.slice(0, visibleItems);\n menuItem = (\n <ActionGroupMenu\n {...menuProps}\n items={menuChildren}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n state={state}\n summaryIcon={summaryIcon}\n hideButtonText={hideButtonText}\n isOnlyItem={visibleItems === 0}\n orientation={orientation} />\n );\n }\n\n let style = {\n ...styleProps.style,\n // While measuring, take up as much space as possible.\n flexBasis: isMeasuring ? '100%' : undefined\n };\n\n return (\n <FocusScope>\n <div {...styleProps} style={style} className={classNames(styles, 'flex-container', styleProps.className)} ref={wrapperRef}>\n <div\n {...actionGroupProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'flex-gap',\n 'spectrum-ActionGroup',\n {\n 'spectrum-ActionGroup--quiet': isQuiet,\n 'spectrum-ActionGroup--vertical': isVertical,\n 'spectrum-ActionGroup--compact': density === 'compact',\n 'spectrum-ActionGroup--justified': isJustified && !isMeasuring,\n 'spectrum-ActionGroup--overflowCollapse': overflowMode === 'collapse'\n },\n otherProps.UNSAFE_className\n )\n }>\n <Provider {...providerProps}>\n {children.map((item) => (\n <ActionGroupItem\n key={item.key}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n item={item}\n state={state}\n hideButtonText={hideButtonText}\n orientation={orientation} />\n ))}\n {menuItem}\n </Provider>\n </div>\n </div>\n </FocusScope>\n );\n}\n\n/**\n * An ActionGroup is a grouping of ActionButtons that are related to one another.\n */\nconst _ActionGroup = forwardRef(ActionGroup) as <T>(props: SpectrumActionGroupProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_ActionGroup as ActionGroup};\n\ninterface ActionGroupItemProps<T> extends DOMProps, StyleProps {\n item: Node<T>,\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n hideButtonText?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupItem<T>({item, state, isDisabled, isEmphasized, staticColor, onAction, hideButtonText, orientation}: ActionGroupItemProps<T>) {\n let ref = useRef(null);\n let {buttonProps} = useActionGroupItem({key: item.key}, state);\n isDisabled = isDisabled || state.disabledKeys.has(item.key);\n let isSelected = state.selectionManager.isSelected(item.key);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let domProps = filterDOMProps(item.props);\n\n if (onAction && !isDisabled) {\n buttonProps = mergeProps(buttonProps, {\n onPress: () => onAction(item.key)\n });\n }\n\n // If button text is hidden, we need to show it as a tooltip instead, so\n // go find the text element in the DOM after rendering.\n let textId = useId();\n let [textContent, setTextContent] = useState<string | null | undefined>('');\n useLayoutEffect(() => {\n if (hideButtonText) {\n setTextContent(document.getElementById(textId)?.textContent);\n }\n }, [hideButtonText, item.rendered, textId]);\n\n let button = (\n // Use a PressResponder to send DOM props through.\n // ActionButton doesn't allow overriding the role by default.\n <PressResponder {...mergeProps(buttonProps, hoverProps, domProps)}>\n <ClearSlots>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText\n }\n }}>\n <ActionButton\n ref={ref}\n // @ts-ignore (private)\n hideButtonText={hideButtonText}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n {\n 'is-selected': isSelected,\n 'is-hovered': isHovered,\n 'spectrum-ActionGroup-item--iconOnly': hideButtonText,\n 'spectrum-ActionGroup-item--isDisabled': isDisabled\n },\n classNames(\n buttonStyles,\n {\n 'spectrum-ActionButton--emphasized': isEmphasized,\n 'is-selected': isSelected\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}\n aria-label={item['aria-label']}\n aria-labelledby={item['aria-label'] == null && hideButtonText ? textId : undefined}>\n {item.rendered}\n </ActionButton>\n </SlotProvider>\n </ClearSlots>\n </PressResponder>\n );\n\n if (hideButtonText && textContent) {\n button = (\n <TooltipTrigger placement={orientation === 'vertical' ? 'end' : 'top'}>\n {button}\n <Tooltip>{textContent}</Tooltip>\n </TooltipTrigger>\n );\n }\n\n if (item.wrapper) {\n button = item.wrapper(button);\n }\n\n return button;\n}\n\ninterface ActionGroupMenuProps<T> extends AriaLabelingProps {\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n items: Node<T>[],\n hideButtonText?: boolean,\n summaryIcon?: ReactNode,\n isOnlyItem?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupMenu<T>({state, isDisabled, isEmphasized, staticColor, items, onAction, summaryIcon, hideButtonText, isOnlyItem, orientation, ...otherProps}: ActionGroupMenuProps<T>) {\n // Use the key of the first item within the menu as the key of the button.\n // The key must actually exist in the collection for focus to work correctly.\n let key = items[0].key;\n let {buttonProps} = useActionGroupItem({key}, state);\n\n // The menu button shouldn't act like an actual action group item.\n delete buttonProps.onPress;\n delete buttonProps.role;\n delete buttonProps['aria-checked'];\n\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n // If no aria-label or aria-labelledby is given, provide a default one.\n let ariaLabel = otherProps['aria-label'] || (otherProps['aria-labelledby'] ? undefined : '…');\n let ariaLabelledby = otherProps['aria-labelledby'];\n let textId = useId();\n let id = useId();\n\n // Summary icon only applies when selection is enabled.\n if (state.selectionManager.selectionMode === 'none') {\n summaryIcon = null;\n }\n\n let iconOnly = false;\n\n // If there is a selection, show the selected state on the menu button.\n let isSelected = state.selectionManager.selectionMode !== 'none' && !state.selectionManager.isEmpty;\n\n // If single selection and empty selection is not allowed, swap the contents of the button to the selected item (like a Picker).\n if (!summaryIcon && state.selectionManager.selectionMode === 'single' && state.selectionManager.disallowEmptySelection && state.selectionManager.firstSelectedKey != null) {\n let selectedItem = state.collection.getItem(state.selectionManager.firstSelectedKey);\n if (selectedItem) {\n summaryIcon = selectedItem.rendered;\n if (typeof summaryIcon === 'string') {\n summaryIcon = <Text>{summaryIcon}</Text>;\n }\n iconOnly = !!hideButtonText;\n ariaLabelledby = `${ariaLabelledby ?? id} ${textId}`;\n }\n }\n\n if (summaryIcon) {\n // If there's a custom summary icon, also add a chevron.\n summaryIcon = (\n <>\n <ChevronDownMedium UNSAFE_className={classNames(styles, 'spectrum-ActionGroup-menu-chevron')} />\n <span className={classNames(styles, 'spectrum-ActionGroup-menu-contents', {'spectrum-ActionGroup-item--iconOnly': iconOnly})}>\n {summaryIcon}\n </span>\n </>\n );\n }\n\n return (\n // Use a PressResponder to send DOM props through.\n <MenuTrigger align={isOnlyItem ? 'start' : 'end'} direction={orientation === 'vertical' ? 'end' : 'bottom'}>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText,\n UNSAFE_className: classNames(styles, 'spectrum-ActionGroup-menu-text')\n }\n }}>\n <PressResponder {...mergeProps(buttonProps, hoverProps)}>\n <ActionButton\n {...otherProps}\n id={id}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n 'spectrum-ActionGroup-menu',\n {\n 'is-hovered': isHovered,\n 'is-selected': isSelected\n },\n classNames(\n buttonStyles,\n {\n 'is-selected': isSelected,\n 'spectrum-ActionButton--emphasized': isEmphasized\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}>\n {summaryIcon || <More />}\n </ActionButton>\n </PressResponder>\n </SlotProvider>\n <Menu\n items={items}\n disabledKeys={state.disabledKeys}\n selectionMode={state.selectionManager.selectionMode}\n selectedKeys={state.selectionManager.selectedKeys}\n disallowEmptySelection={state.selectionManager.disallowEmptySelection}\n onSelectionChange={(keys) => state.selectionManager.setSelectedKeys(keys)}\n onAction={onAction}>\n {node => <Item textValue={node.textValue} {...filterDOMProps(node.props)}>{node.rendered}</Item>}\n </Menu>\n </MenuTrigger>\n );\n}\n\nfunction outerWidth(element: HTMLElement, ignoreLeftMargin: boolean, ignoreRightMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().width + (ignoreLeftMargin ? 0 : toNumber(style.marginLeft)) + (ignoreRightMargin ? 0 : toNumber(style.marginRight));\n}\n\n\nfunction outerHeight(element: HTMLElement, ignoreTopMargin: boolean, ignoreBottomMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().height + (ignoreTopMargin ? 0 : toNumber(style.marginTop)) + (ignoreBottomMargin ? 0 : toNumber(style.marginBottom));\n}\n\nfunction toNumber(value: string) {\n let parsed = parseInt(value, 10);\n return isNaN(parsed) ? 0 : parsed;\n}\n"],"names":[],"version":3,"file":"ActionGroup.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;AA6BD,SAAS,kCAA8B,KAAkC,EAAE,GAA2B;IACpG,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAE5B,IAAI,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DAAC,CAAA,GAAA,0DAAG,2BAI1B,0DAAC,CAAA,GAAA,6BAAG;QACF,OAAO;QACP,cAAc,MAAM,YAAY;QAChC,eAAe,MAAM,gBAAgB,CAAC,aAAa;QACnD,cAAc,MAAM,gBAAgB,CAAC,YAAY;QACjD,wBAAwB,MAAM,gBAAgB,CAAC,sBAAsB;QACrE,mBAAmB,CAAC,OAAS,MAAM,gBAAgB,CAAC,eAAe,CAAC;QACpE,UAAU;OACT,CAAA,qBAAQ,0DAAC,CAAA,GAAA,6BAAG;YAAE,WAAW,KAAK,SAAS;YAAG,GAAG,CAAA,GAAA,oCAAa,EAAE,KAAK,KAAK,CAAC;WAAG,KAAK,QAAQ;AAIhG;AAEA,SAAS,iCAAW,OAAoB,EAAE,gBAAyB,EAAE,iBAA0B;IAC7F,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,OAAO,QAAQ,qBAAqB,GAAG,KAAK,GAAI,CAAA,mBAAmB,IAAI,+BAAS,MAAM,UAAU,CAAA,IAAM,CAAA,oBAAoB,IAAI,+BAAS,MAAM,WAAW,CAAA;AAC1J;AAGA,SAAS,kCAAY,OAAoB,EAAE,eAAwB,EAAE,kBAA2B;IAC9F,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,OAAO,QAAQ,qBAAqB,GAAG,MAAM,GAAI,CAAA,kBAAkB,IAAI,+BAAS,MAAM,SAAS,CAAA,IAAM,CAAA,qBAAqB,IAAI,+BAAS,MAAM,YAAY,CAAA;AAC3J;AAEA,SAAS,+BAAS,KAAa;IAC7B,IAAI,SAAS,SAAS,OAAO;IAC7B,OAAO,MAAM,UAAU,IAAI;AAC7B","sources":["packages/@react-spectrum/actiongroup/src/ActionGroup.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\nimport {ActionButton} from '@react-spectrum/button';\nimport {AriaLabelingProps, DOMProps, DOMRef, Key, Node, StyleProps} from '@react-types/shared';\nimport buttonStyles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport ChevronDownMedium from '@spectrum-icons/ui/ChevronDownMedium';\nimport {\n classNames,\n ClearSlots,\n SlotProvider,\n useDOMRef,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport {filterDOMProps, mergeProps, useId, useLayoutEffect, useResizeObserver, useValueEffect} from '@react-aria/utils';\nimport {FocusScope} from '@react-aria/focus';\nimport {Item, Menu, MenuTrigger} from '@react-spectrum/menu';\nimport {ListState, useListState} from '@react-stately/list';\nimport More from '@spectrum-icons/workflow/More';\nimport {PressResponder, useHover} from '@react-aria/interactions';\nimport {Provider, useProviderProps} from '@react-spectrum/provider';\nimport React, {forwardRef, ReactElement, ReactNode, useCallback, useMemo, useRef, useState} from 'react';\nimport {SpectrumActionGroupProps} from '@react-types/actiongroup';\nimport styles from '@adobe/spectrum-css-temp/components/actiongroup/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {Tooltip, TooltipTrigger} from '@react-spectrum/tooltip';\nimport {useActionGroup, useActionGroupItem} from '@react-aria/actiongroup';\n\n\nfunction ActionGroup<T extends object>(props: SpectrumActionGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n props = useSlotProps(props, 'actionGroup');\n\n let {\n isEmphasized,\n density,\n isJustified,\n isDisabled,\n orientation = 'horizontal',\n isQuiet,\n staticColor,\n overflowMode = 'wrap',\n onAction,\n buttonLabelBehavior,\n summaryIcon,\n ...otherProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n let state = useListState({...props, suppressTextValueWarning: true});\n let {actionGroupProps} = useActionGroup(props, state, domRef);\n let isVertical = orientation === 'vertical';\n let providerProps = {isEmphasized, isDisabled, isQuiet};\n let {styleProps} = useStyleProps(props);\n\n // Only hide button text if every item contains more than just plain text (we assume an icon).\n let isIconCollapsible = useMemo(() => [...state.collection].every(item => typeof item.rendered !== 'string'), [state.collection]);\n let [{visibleItems, hideButtonText, isMeasuring}, setVisibleItems] = useValueEffect({\n visibleItems: state.collection.size,\n hideButtonText: buttonLabelBehavior === 'hide' && isIconCollapsible,\n isMeasuring: false\n });\n\n let selectionMode = state.selectionManager.selectionMode;\n let updateOverflow = useCallback(() => {\n if (overflowMode === 'wrap') {\n return;\n }\n\n if (orientation === 'vertical' && selectionMode !== 'none') {\n // Collapsing vertical action groups with selection is currently unsupported by Spectrum.\n return;\n }\n\n let computeVisibleItems = (visibleItems: number) => {\n if (domRef.current && wrapperRef.current) {\n let listItems = Array.from(domRef.current.children) as HTMLLIElement[];\n let containerSize = orientation === 'horizontal' ? wrapperRef.current.getBoundingClientRect().width : wrapperRef.current.getBoundingClientRect().height;\n\n let isShowingMenu = visibleItems < state.collection.size;\n let calculatedSize = 0;\n let newVisibleItems = 0;\n\n if (isShowingMenu) {\n let item = listItems.pop();\n if (item) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, false, true)\n : outerHeight(item, false, true);\n }\n }\n\n for (let [i, item] of listItems.entries()) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, i === 0, i === listItems.length - 1)\n : outerHeight(item, i === 0, i === listItems.length - 1);\n if (Math.round(calculatedSize) <= Math.round(containerSize)) {\n newVisibleItems++;\n } else {\n break;\n }\n }\n\n // If selection is enabled, and not all of the items fit, collapse all of them into a dropdown\n // immediately rather than having some visible and some not.\n if (selectionMode !== 'none' && newVisibleItems < state.collection.size) {\n return 0;\n }\n\n return newVisibleItems;\n }\n return visibleItems;\n };\n\n setVisibleItems(function *() {\n let hideButtonText = buttonLabelBehavior === 'hide' && isIconCollapsible;\n\n // Update to show all items.\n yield {\n visibleItems: state.collection.size,\n hideButtonText,\n isMeasuring: true\n };\n\n // Measure, and update to show the items that fit.\n let newVisibleItems = computeVisibleItems(state.collection.size);\n let isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n\n // If not all of the buttons fit, and buttonLabelBehavior is 'collapse', then first try hiding\n // the button text and only showing icons. Only if that still doesn't fit collapse into a menu.\n if (newVisibleItems < state.collection.size && buttonLabelBehavior === 'collapse' && isIconCollapsible) {\n yield {\n visibleItems: state.collection.size,\n hideButtonText: true,\n isMeasuring: true\n };\n\n newVisibleItems = computeVisibleItems(state.collection.size);\n isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n hideButtonText = true;\n }\n\n yield {\n visibleItems: newVisibleItems,\n hideButtonText,\n isMeasuring\n };\n\n // If the number of items is less than the number of children,\n // then update again to ensure that the menu fits.\n if (isMeasuring) {\n yield {\n visibleItems: computeVisibleItems(newVisibleItems),\n hideButtonText,\n isMeasuring: false\n };\n }\n });\n }, [domRef, state.collection, setVisibleItems, overflowMode, selectionMode, buttonLabelBehavior, isIconCollapsible, orientation]);\n\n // Watch the parent element for size changes. Watching only the action group itself may not work\n // in all scenarios because it may not shrink when available space is reduced.\n let parentRef = useMemo(() => ({\n get current() {\n return wrapperRef.current?.parentElement;\n }\n }), [wrapperRef]);\n useResizeObserver({ref: overflowMode !== 'wrap' ? parentRef : undefined, onResize: updateOverflow});\n useLayoutEffect(updateOverflow, [updateOverflow, state.collection]);\n\n let children = [...state.collection];\n let menuItem: ReactElement | null = null;\n let menuProps = {};\n\n // If there are no visible items, don't apply any props to the action group container\n // and pass all aria labeling props through to the menu button.\n if (overflowMode === 'collapse' && visibleItems === 0) {\n menuProps = filterDOMProps(props, {labelable: true});\n actionGroupProps = {};\n }\n\n if (overflowMode === 'collapse' && visibleItems < state.collection.size) {\n let menuChildren = children.slice(visibleItems);\n children = children.slice(0, visibleItems);\n menuItem = (\n <ActionGroupMenu\n {...menuProps}\n items={menuChildren}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n state={state}\n summaryIcon={summaryIcon}\n hideButtonText={hideButtonText}\n isOnlyItem={visibleItems === 0}\n orientation={orientation} />\n );\n }\n\n let style = {\n ...styleProps.style,\n // While measuring, take up as much space as possible.\n flexBasis: isMeasuring ? '100%' : undefined\n };\n\n return (\n <FocusScope>\n <div {...styleProps} style={style} className={classNames(styles, 'flex-container', styleProps.className)} ref={wrapperRef}>\n <div\n {...actionGroupProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'flex-gap',\n 'spectrum-ActionGroup',\n {\n 'spectrum-ActionGroup--quiet': isQuiet,\n 'spectrum-ActionGroup--vertical': isVertical,\n 'spectrum-ActionGroup--compact': density === 'compact',\n 'spectrum-ActionGroup--justified': isJustified && !isMeasuring,\n 'spectrum-ActionGroup--overflowCollapse': overflowMode === 'collapse'\n },\n otherProps.UNSAFE_className\n )\n }>\n <Provider {...providerProps}>\n {children.map((item) => (\n <ActionGroupItem\n key={item.key}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n item={item}\n state={state}\n hideButtonText={hideButtonText}\n orientation={orientation} />\n ))}\n {menuItem}\n </Provider>\n </div>\n </div>\n </FocusScope>\n );\n}\n\n/**\n * An ActionGroup is a grouping of ActionButtons that are related to one another.\n */\nconst _ActionGroup = forwardRef(ActionGroup) as <T>(props: SpectrumActionGroupProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_ActionGroup as ActionGroup};\n\ninterface ActionGroupItemProps<T> extends DOMProps, StyleProps {\n item: Node<T>,\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n hideButtonText?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupItem<T>({item, state, isDisabled, isEmphasized, staticColor, onAction, hideButtonText, orientation}: ActionGroupItemProps<T>) {\n let ref = useRef(null);\n let {buttonProps} = useActionGroupItem({key: item.key}, state);\n isDisabled = isDisabled || state.disabledKeys.has(item.key);\n let isSelected = state.selectionManager.isSelected(item.key);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let domProps = filterDOMProps(item.props);\n\n if (onAction && !isDisabled) {\n buttonProps = mergeProps(buttonProps, {\n onPress: () => onAction(item.key)\n });\n }\n\n // If button text is hidden, we need to show it as a tooltip instead, so\n // go find the text element in the DOM after rendering.\n let textId = useId();\n let [textContent, setTextContent] = useState<string | null | undefined>('');\n useLayoutEffect(() => {\n if (hideButtonText) {\n setTextContent(document.getElementById(textId)?.textContent);\n }\n }, [hideButtonText, item.rendered, textId]);\n\n let button = (\n // Use a PressResponder to send DOM props through.\n // ActionButton doesn't allow overriding the role by default.\n <PressResponder {...mergeProps(buttonProps, hoverProps, domProps)}>\n <ClearSlots>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText\n }\n }}>\n <ActionButton\n ref={ref}\n // @ts-ignore (private)\n hideButtonText={hideButtonText}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n {\n 'is-selected': isSelected,\n 'is-hovered': isHovered,\n 'spectrum-ActionGroup-item--iconOnly': hideButtonText,\n 'spectrum-ActionGroup-item--isDisabled': isDisabled\n },\n classNames(\n buttonStyles,\n {\n 'spectrum-ActionButton--emphasized': isEmphasized,\n 'is-selected': isSelected\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}\n aria-label={item['aria-label']}\n aria-labelledby={item['aria-label'] == null && hideButtonText ? textId : undefined}>\n {item.rendered}\n </ActionButton>\n </SlotProvider>\n </ClearSlots>\n </PressResponder>\n );\n\n if (hideButtonText && textContent) {\n button = (\n <TooltipTrigger placement={orientation === 'vertical' ? 'end' : 'top'}>\n {button}\n <Tooltip>{textContent}</Tooltip>\n </TooltipTrigger>\n );\n }\n\n if (item.wrapper) {\n button = item.wrapper(button);\n }\n\n return button;\n}\n\ninterface ActionGroupMenuProps<T> extends AriaLabelingProps {\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n items: Node<T>[],\n hideButtonText?: boolean,\n summaryIcon?: ReactNode,\n isOnlyItem?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupMenu<T>({state, isDisabled, isEmphasized, staticColor, items, onAction, summaryIcon, hideButtonText, isOnlyItem, orientation, ...otherProps}: ActionGroupMenuProps<T>) {\n // Use the key of the first item within the menu as the key of the button.\n // The key must actually exist in the collection for focus to work correctly.\n let key = items[0].key;\n let {buttonProps} = useActionGroupItem({key}, state);\n\n // The menu button shouldn't act like an actual action group item.\n delete buttonProps.onPress;\n delete buttonProps.role;\n delete buttonProps['aria-checked'];\n\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n // If no aria-label or aria-labelledby is given, provide a default one.\n let ariaLabel = otherProps['aria-label'] || (otherProps['aria-labelledby'] ? undefined : '…');\n let ariaLabelledby = otherProps['aria-labelledby'];\n let textId = useId();\n let id = useId();\n\n // Summary icon only applies when selection is enabled.\n if (state.selectionManager.selectionMode === 'none') {\n summaryIcon = null;\n }\n\n let iconOnly = false;\n\n // If there is a selection, show the selected state on the menu button.\n let isSelected = state.selectionManager.selectionMode !== 'none' && !state.selectionManager.isEmpty;\n\n // If single selection and empty selection is not allowed, swap the contents of the button to the selected item (like a Picker).\n if (!summaryIcon && state.selectionManager.selectionMode === 'single' && state.selectionManager.disallowEmptySelection && state.selectionManager.firstSelectedKey != null) {\n let selectedItem = state.collection.getItem(state.selectionManager.firstSelectedKey);\n if (selectedItem) {\n summaryIcon = selectedItem.rendered;\n if (typeof summaryIcon === 'string') {\n summaryIcon = <Text>{summaryIcon}</Text>;\n }\n iconOnly = !!hideButtonText;\n ariaLabelledby = `${ariaLabelledby ?? id} ${textId}`;\n }\n }\n\n if (summaryIcon) {\n // If there's a custom summary icon, also add a chevron.\n summaryIcon = (\n <>\n <ChevronDownMedium UNSAFE_className={classNames(styles, 'spectrum-ActionGroup-menu-chevron')} />\n <span className={classNames(styles, 'spectrum-ActionGroup-menu-contents', {'spectrum-ActionGroup-item--iconOnly': iconOnly})}>\n {summaryIcon}\n </span>\n </>\n );\n }\n\n return (\n // Use a PressResponder to send DOM props through.\n <MenuTrigger align={isOnlyItem ? 'start' : 'end'} direction={orientation === 'vertical' ? 'end' : 'bottom'}>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText,\n UNSAFE_className: classNames(styles, 'spectrum-ActionGroup-menu-text')\n }\n }}>\n <PressResponder {...mergeProps(buttonProps, hoverProps)}>\n <ActionButton\n {...otherProps}\n id={id}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n 'spectrum-ActionGroup-menu',\n {\n 'is-hovered': isHovered,\n 'is-selected': isSelected\n },\n classNames(\n buttonStyles,\n {\n 'is-selected': isSelected,\n 'spectrum-ActionButton--emphasized': isEmphasized\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}>\n {summaryIcon || <More />}\n </ActionButton>\n </PressResponder>\n </SlotProvider>\n <Menu\n items={items}\n disabledKeys={state.disabledKeys}\n selectionMode={state.selectionManager.selectionMode}\n selectedKeys={state.selectionManager.selectedKeys}\n disallowEmptySelection={state.selectionManager.disallowEmptySelection}\n onSelectionChange={(keys) => state.selectionManager.setSelectedKeys(keys)}\n onAction={onAction}>\n {node => <Item textValue={node.textValue} {...filterDOMProps(node.props)}>{node.rendered}</Item>}\n </Menu>\n </MenuTrigger>\n );\n}\n\nfunction outerWidth(element: HTMLElement, ignoreLeftMargin: boolean, ignoreRightMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().width + (ignoreLeftMargin ? 0 : toNumber(style.marginLeft)) + (ignoreRightMargin ? 0 : toNumber(style.marginRight));\n}\n\n\nfunction outerHeight(element: HTMLElement, ignoreTopMargin: boolean, ignoreBottomMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().height + (ignoreTopMargin ? 0 : toNumber(style.marginTop)) + (ignoreBottomMargin ? 0 : toNumber(style.marginBottom));\n}\n\nfunction toNumber(value: string) {\n let parsed = parseInt(value, 10);\n return isNaN(parsed) ? 0 : parsed;\n}\n"],"names":[],"version":3,"file":"ActionGroup.main.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;AA6BD,SAAS,kCAA8B,KAAkC,EAAE,GAA2B;IACpG,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAE5B,IAAI,gBACF,YAAY,WACZ,OAAO,eACP,WAAW,cACX,UAAU,eACV,cAAc,uBACd,OAAO,eACP,WAAW,gBACX,eAAe,kBACf,QAAQ,uBACR,mBAAmB,eACnB,WAAW,EACX,GAAG,YACJ,GAAG;IAEJ,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,aAAa,CAAA,GAAA,aAAK,EAAkB;IACxC,IAAI,QAAQ,CAAA,GAAA,mBAAW,EAAE;QAAC,GAAG,KAAK;QAAE,0BAA0B;IAAI;IAClE,IAAI,oBAAC,gBAAgB,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE,OAAO,OAAO;IACtD,IAAI,aAAa,gBAAgB;IACjC,IAAI,gBAAgB;sBAAC;oBAAc;iBAAY;IAAO;IACtD,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IAEjC,8FAA8F;IAC9F,IAAI,oBAAoB,CAAA,GAAA,cAAM,EAAE,IAAM;eAAI,MAAM,UAAU;SAAC,CAAC,KAAK,CAAC,CAAA,OAAQ,OAAO,K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AAC1J;AAGA,SAAS,kCAAY,OAAoB,EAAE,eAAwB,EAAE,kBAA2B;IAC9F,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,OAAO,QAAQ,qBAAqB,GAAG,MAAM,GAAI,CAAA,kBAAkB,IAAI,+BAAS,MAAM,SAAS,CAAA,IAAM,CAAA,qBAAqB,IAAI,+BAAS,MAAM,YAAY,CAAA;AAC3J;AAEA,SAAS,+BAAS,KAAa;IAC7B,IAAI,SAAS,SAAS,OAAO;IAC7B,OAAO,MAAM,UAAU,IAAI;AAC7B","sources":["packages/@react-spectrum/actiongroup/src/ActionGroup.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\nimport {ActionButton} from '@react-spectrum/button';\nimport {AriaLabelingProps, DOMProps, DOMRef, Key, Node, StyleProps} from '@react-types/shared';\nimport buttonStyles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport ChevronDownMedium from '@spectrum-icons/ui/ChevronDownMedium';\nimport {\n classNames,\n ClearSlots,\n SlotProvider,\n useDOMRef,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport {filterDOMProps, mergeProps, useId, useLayoutEffect, useResizeObserver, useValueEffect} from '@react-aria/utils';\nimport {FocusScope} from '@react-aria/focus';\nimport {Item, Menu, MenuTrigger} from '@react-spectrum/menu';\nimport {ListState, useListState} from '@react-stately/list';\nimport More from '@spectrum-icons/workflow/More';\nimport {PressResponder, useHover} from '@react-aria/interactions';\nimport {Provider, useProviderProps} from '@react-spectrum/provider';\nimport React, {forwardRef, ReactElement, ReactNode, useCallback, useMemo, useRef, useState} from 'react';\nimport {SpectrumActionGroupProps} from '@react-types/actiongroup';\nimport styles from '@adobe/spectrum-css-temp/components/actiongroup/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {Tooltip, TooltipTrigger} from '@react-spectrum/tooltip';\nimport {useActionGroup, useActionGroupItem} from '@react-aria/actiongroup';\n\n\nfunction ActionGroup<T extends object>(props: SpectrumActionGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n props = useSlotProps(props, 'actionGroup');\n\n let {\n isEmphasized,\n density,\n isJustified,\n isDisabled,\n orientation = 'horizontal',\n isQuiet,\n staticColor,\n overflowMode = 'wrap',\n onAction,\n buttonLabelBehavior,\n summaryIcon,\n ...otherProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n let state = useListState({...props, suppressTextValueWarning: true});\n let {actionGroupProps} = useActionGroup(props, state, domRef);\n let isVertical = orientation === 'vertical';\n let providerProps = {isEmphasized, isDisabled, isQuiet};\n let {styleProps} = useStyleProps(props);\n\n // Only hide button text if every item contains more than just plain text (we assume an icon).\n let isIconCollapsible = useMemo(() => [...state.collection].every(item => typeof item.rendered !== 'string'), [state.collection]);\n let [{visibleItems, hideButtonText, isMeasuring}, setVisibleItems] = useValueEffect({\n visibleItems: state.collection.size,\n hideButtonText: buttonLabelBehavior === 'hide' && isIconCollapsible,\n isMeasuring: false\n });\n\n let selectionMode = state.selectionManager.selectionMode;\n let updateOverflow = useCallback(() => {\n if (overflowMode === 'wrap') {\n return;\n }\n\n if (orientation === 'vertical' && selectionMode !== 'none') {\n // Collapsing vertical action groups with selection is currently unsupported by Spectrum.\n return;\n }\n\n let computeVisibleItems = (visibleItems: number) => {\n if (domRef.current && wrapperRef.current) {\n let listItems = Array.from(domRef.current.children) as HTMLLIElement[];\n let containerSize = orientation === 'horizontal' ? wrapperRef.current.getBoundingClientRect().width : wrapperRef.current.getBoundingClientRect().height;\n\n let isShowingMenu = visibleItems < state.collection.size;\n let calculatedSize = 0;\n let newVisibleItems = 0;\n\n if (isShowingMenu) {\n let item = listItems.pop();\n if (item) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, false, true)\n : outerHeight(item, false, true);\n }\n }\n\n for (let [i, item] of listItems.entries()) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, i === 0, i === listItems.length - 1)\n : outerHeight(item, i === 0, i === listItems.length - 1);\n if (Math.round(calculatedSize) <= Math.round(containerSize)) {\n newVisibleItems++;\n } else {\n break;\n }\n }\n\n // If selection is enabled, and not all of the items fit, collapse all of them into a dropdown\n // immediately rather than having some visible and some not.\n if (selectionMode !== 'none' && newVisibleItems < state.collection.size) {\n return 0;\n }\n\n return newVisibleItems;\n }\n return visibleItems;\n };\n\n setVisibleItems(function *() {\n let hideButtonText = buttonLabelBehavior === 'hide' && isIconCollapsible;\n\n // Update to show all items.\n yield {\n visibleItems: state.collection.size,\n hideButtonText,\n isMeasuring: true\n };\n\n // Measure, and update to show the items that fit.\n let newVisibleItems = computeVisibleItems(state.collection.size);\n let isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n\n // If not all of the buttons fit, and buttonLabelBehavior is 'collapse', then first try hiding\n // the button text and only showing icons. Only if that still doesn't fit collapse into a menu.\n if (newVisibleItems < state.collection.size && buttonLabelBehavior === 'collapse' && isIconCollapsible) {\n yield {\n visibleItems: state.collection.size,\n hideButtonText: true,\n isMeasuring: true\n };\n\n newVisibleItems = computeVisibleItems(state.collection.size);\n isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n hideButtonText = true;\n }\n\n yield {\n visibleItems: newVisibleItems,\n hideButtonText,\n isMeasuring\n };\n\n // If the number of items is less than the number of children,\n // then update again to ensure that the menu fits.\n if (isMeasuring) {\n yield {\n visibleItems: computeVisibleItems(newVisibleItems),\n hideButtonText,\n isMeasuring: false\n };\n }\n });\n }, [domRef, state.collection, setVisibleItems, overflowMode, selectionMode, buttonLabelBehavior, isIconCollapsible, orientation]);\n\n // Watch the parent element for size changes. Watching only the action group itself may not work\n // in all scenarios because it may not shrink when available space is reduced.\n let parentRef = useMemo(() => ({\n get current() {\n return wrapperRef.current?.parentElement;\n }\n }), [wrapperRef]);\n useResizeObserver({ref: overflowMode !== 'wrap' ? parentRef : undefined, onResize: updateOverflow});\n useLayoutEffect(updateOverflow, [updateOverflow, state.collection]);\n\n let children = [...state.collection];\n let menuItem: ReactElement | null = null;\n let menuProps = {};\n\n // If there are no visible items, don't apply any props to the action group container\n // and pass all aria labeling props through to the menu button.\n if (overflowMode === 'collapse' && visibleItems === 0) {\n menuProps = filterDOMProps(props, {labelable: true});\n actionGroupProps = {};\n }\n\n if (overflowMode === 'collapse' && visibleItems < state.collection.size) {\n let menuChildren = children.slice(visibleItems);\n children = children.slice(0, visibleItems);\n menuItem = (\n <ActionGroupMenu\n {...menuProps}\n items={menuChildren}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n state={state}\n summaryIcon={summaryIcon}\n hideButtonText={hideButtonText}\n isOnlyItem={visibleItems === 0}\n orientation={orientation} />\n );\n }\n\n let style = {\n ...styleProps.style,\n // While measuring, take up as much space as possible.\n flexBasis: isMeasuring ? '100%' : undefined\n };\n\n return (\n <FocusScope>\n <div {...styleProps} style={style} className={classNames(styles, 'flex-container', styleProps.className)} ref={wrapperRef}>\n <div\n {...actionGroupProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'flex-gap',\n 'spectrum-ActionGroup',\n {\n 'spectrum-ActionGroup--quiet': isQuiet,\n 'spectrum-ActionGroup--vertical': isVertical,\n 'spectrum-ActionGroup--compact': density === 'compact',\n 'spectrum-ActionGroup--justified': isJustified && !isMeasuring,\n 'spectrum-ActionGroup--overflowCollapse': overflowMode === 'collapse'\n },\n otherProps.UNSAFE_className\n )\n }>\n <Provider {...providerProps}>\n {children.map((item) => (\n <ActionGroupItem\n key={item.key}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n item={item}\n state={state}\n hideButtonText={hideButtonText}\n orientation={orientation} />\n ))}\n {menuItem}\n </Provider>\n </div>\n </div>\n </FocusScope>\n );\n}\n\n/**\n * An ActionGroup is a grouping of ActionButtons that are related to one another.\n */\nconst _ActionGroup = forwardRef(ActionGroup) as <T>(props: SpectrumActionGroupProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_ActionGroup as ActionGroup};\n\ninterface ActionGroupItemProps<T> extends DOMProps, StyleProps {\n item: Node<T>,\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n hideButtonText?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupItem<T>({item, state, isDisabled, isEmphasized, staticColor, onAction, hideButtonText, orientation}: ActionGroupItemProps<T>) {\n let ref = useRef(null);\n let {buttonProps} = useActionGroupItem({key: item.key}, state);\n isDisabled = isDisabled || state.disabledKeys.has(item.key);\n let isSelected = state.selectionManager.isSelected(item.key);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let domProps = filterDOMProps(item.props);\n\n if (onAction && !isDisabled) {\n buttonProps = mergeProps(buttonProps, {\n onPress: () => onAction(item.key)\n });\n }\n\n // If button text is hidden, we need to show it as a tooltip instead, so\n // go find the text element in the DOM after rendering.\n let textId = useId();\n let [textContent, setTextContent] = useState<string | null | undefined>('');\n useLayoutEffect(() => {\n if (hideButtonText) {\n setTextContent(document.getElementById(textId)?.textContent);\n }\n }, [hideButtonText, item.rendered, textId]);\n\n let button = (\n // Use a PressResponder to send DOM props through.\n // ActionButton doesn't allow overriding the role by default.\n <PressResponder {...mergeProps(buttonProps, hoverProps, domProps)}>\n <ClearSlots>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText\n }\n }}>\n <ActionButton\n ref={ref}\n // @ts-ignore (private)\n hideButtonText={hideButtonText}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n {\n 'is-selected': isSelected,\n 'is-hovered': isHovered,\n 'spectrum-ActionGroup-item--iconOnly': hideButtonText,\n 'spectrum-ActionGroup-item--isDisabled': isDisabled\n },\n classNames(\n buttonStyles,\n {\n 'spectrum-ActionButton--emphasized': isEmphasized,\n 'is-selected': isSelected\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}\n aria-label={item['aria-label']}\n aria-labelledby={item['aria-label'] == null && hideButtonText ? textId : undefined}>\n {item.rendered}\n </ActionButton>\n </SlotProvider>\n </ClearSlots>\n </PressResponder>\n );\n\n if (hideButtonText && textContent) {\n button = (\n <TooltipTrigger placement={orientation === 'vertical' ? 'end' : 'top'}>\n {button}\n <Tooltip>{textContent}</Tooltip>\n </TooltipTrigger>\n );\n }\n\n if (item.wrapper) {\n button = item.wrapper(button);\n }\n\n return button;\n}\n\ninterface ActionGroupMenuProps<T> extends AriaLabelingProps {\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n items: Node<T>[],\n hideButtonText?: boolean,\n summaryIcon?: ReactNode,\n isOnlyItem?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupMenu<T>({state, isDisabled, isEmphasized, staticColor, items, onAction, summaryIcon, hideButtonText, isOnlyItem, orientation, ...otherProps}: ActionGroupMenuProps<T>) {\n // Use the key of the first item within the menu as the key of the button.\n // The key must actually exist in the collection for focus to work correctly.\n let key = items[0].key;\n let {buttonProps} = useActionGroupItem({key}, state);\n\n // The menu button shouldn't act like an actual action group item.\n delete buttonProps.onPress;\n delete buttonProps.role;\n delete buttonProps['aria-checked'];\n\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n // If no aria-label or aria-labelledby is given, provide a default one.\n let ariaLabel = otherProps['aria-label'] || (otherProps['aria-labelledby'] ? undefined : '…');\n let ariaLabelledby = otherProps['aria-labelledby'];\n let textId = useId();\n let id = useId();\n\n // Summary icon only applies when selection is enabled.\n if (state.selectionManager.selectionMode === 'none') {\n summaryIcon = null;\n }\n\n let iconOnly = false;\n\n // If there is a selection, show the selected state on the menu button.\n let isSelected = state.selectionManager.selectionMode !== 'none' && !state.selectionManager.isEmpty;\n\n // If single selection and empty selection is not allowed, swap the contents of the button to the selected item (like a Picker).\n if (!summaryIcon && state.selectionManager.selectionMode === 'single' && state.selectionManager.disallowEmptySelection && state.selectionManager.firstSelectedKey != null) {\n let selectedItem = state.collection.getItem(state.selectionManager.firstSelectedKey);\n if (selectedItem) {\n summaryIcon = selectedItem.rendered;\n if (typeof summaryIcon === 'string') {\n summaryIcon = <Text>{summaryIcon}</Text>;\n }\n iconOnly = !!hideButtonText;\n ariaLabelledby = `${ariaLabelledby ?? id} ${textId}`;\n }\n }\n\n if (summaryIcon) {\n // If there's a custom summary icon, also add a chevron.\n summaryIcon = (\n <>\n <ChevronDownMedium UNSAFE_className={classNames(styles, 'spectrum-ActionGroup-menu-chevron')} />\n <span className={classNames(styles, 'spectrum-ActionGroup-menu-contents', {'spectrum-ActionGroup-item--iconOnly': iconOnly})}>\n {summaryIcon}\n </span>\n </>\n );\n }\n\n return (\n // Use a PressResponder to send DOM props through.\n <MenuTrigger align={isOnlyItem ? 'start' : 'end'} direction={orientation === 'vertical' ? 'end' : 'bottom'}>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText,\n UNSAFE_className: classNames(styles, 'spectrum-ActionGroup-menu-text')\n }\n }}>\n <PressResponder {...mergeProps(buttonProps, hoverProps)}>\n <ActionButton\n {...otherProps}\n id={id}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n 'spectrum-ActionGroup-menu',\n {\n 'is-hovered': isHovered,\n 'is-selected': isSelected\n },\n classNames(\n buttonStyles,\n {\n 'is-selected': isSelected,\n 'spectrum-ActionButton--emphasized': isEmphasized\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}>\n {summaryIcon || <More />}\n </ActionButton>\n </PressResponder>\n </SlotProvider>\n <Menu\n items={items}\n disabledKeys={state.disabledKeys}\n selectionMode={state.selectionManager.selectionMode}\n selectedKeys={state.selectionManager.selectedKeys}\n disallowEmptySelection={state.selectionManager.disallowEmptySelection}\n onSelectionChange={(keys) => state.selectionManager.setSelectedKeys(keys)}\n onAction={onAction}>\n {node => <Item textValue={node.textValue} {...filterDOMProps(node.props)}>{node.rendered}</Item>}\n </Menu>\n </MenuTrigger>\n );\n}\n\nfunction outerWidth(element: HTMLElement, ignoreLeftMargin: boolean, ignoreRightMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().width + (ignoreLeftMargin ? 0 : toNumber(style.marginLeft)) + (ignoreRightMargin ? 0 : toNumber(style.marginRight));\n}\n\n\nfunction outerHeight(element: HTMLElement, ignoreTopMargin: boolean, ignoreBottomMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().height + (ignoreTopMargin ? 0 : toNumber(style.marginTop)) + (ignoreBottomMargin ? 0 : toNumber(style.marginBottom));\n}\n\nfunction toNumber(value: string) {\n let parsed = parseInt(value, 10);\n return isNaN(parsed) ? 0 : parsed;\n}\n"],"names":[],"version":3,"file":"ActionGroup.module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;AA6BD,SAAS,kCAA8B,KAAkC,EAAE,GAA2B;IACpG,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAE5B,IAAI,gBACF,YAAY,WACZ,OAAO,eACP,WAAW,cACX,UAAU,eACV,cAAc,uBACd,OAAO,eACP,WAAW,gBACX,eAAe,kBACf,QAAQ,uBACR,mBAAmB,eACnB,WAAW,EACX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BAAgB,CAAC,YAAY;QACjD,wBAAwB,MAAM,gBAAgB,CAAC,sBAAsB;QACrE,mBAAmB,CAAC,OAAS,MAAM,gBAAgB,CAAC,eAAe,CAAC;QACpE,UAAU;OACT,CAAA,qBAAQ,gCAAC,CAAA,GAAA,WAAG;YAAE,WAAW,KAAK,SAAS;YAAG,GAAG,CAAA,GAAA,qBAAa,EAAE,KAAK,KAAK,CAAC;WAAG,KAAK,QAAQ;AAIhG;AAEA,SAAS,iCAAW,OAAoB,EAAE,gBAAyB,EAAE,iBAA0B;IAC7F,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,OAAO,QAAQ,qBAAqB,GAAG,KAAK,GAAI,CAAA,mBAAmB,IAAI,+BAAS,MAAM,UAAU,CAAA,IAAM,CAAA,oBAAoB,IAAI,+BAAS,MAAM,WAAW,CAAA;AAC1J;AAGA,SAAS,kCAAY,OAAoB,EAAE,eAAwB,EAAE,kBAA2B;IAC9F,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,OAAO,QAAQ,qBAAqB,GAAG,MAAM,GAAI,CAAA,kBAAkB,IAAI,+BAAS,MAAM,SAAS,CAAA,IAAM,CAAA,qBAAqB,IAAI,+BAAS,MAAM,YAAY,CAAA;AAC3J;AAEA,SAAS,+BAAS,KAAa;IAC7B,IAAI,SAAS,SAAS,OAAO;IAC7B,OAAO,MAAM,UAAU,IAAI;AAC7B","sources":["packages/@react-spectrum/actiongroup/src/ActionGroup.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\nimport {ActionButton} from '@react-spectrum/button';\nimport {AriaLabelingProps, DOMProps, DOMRef, Key, Node, StyleProps} from '@react-types/shared';\nimport buttonStyles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport ChevronDownMedium from '@spectrum-icons/ui/ChevronDownMedium';\nimport {\n classNames,\n ClearSlots,\n SlotProvider,\n useDOMRef,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport {filterDOMProps, mergeProps, useId, useLayoutEffect, useResizeObserver, useValueEffect} from '@react-aria/utils';\nimport {FocusScope} from '@react-aria/focus';\nimport {Item, Menu, MenuTrigger} from '@react-spectrum/menu';\nimport {ListState, useListState} from '@react-stately/list';\nimport More from '@spectrum-icons/workflow/More';\nimport {PressResponder, useHover} from '@react-aria/interactions';\nimport {Provider, useProviderProps} from '@react-spectrum/provider';\nimport React, {forwardRef, ReactElement, ReactNode, useCallback, useMemo, useRef, useState} from 'react';\nimport {SpectrumActionGroupProps} from '@react-types/actiongroup';\nimport styles from '@adobe/spectrum-css-temp/components/actiongroup/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {Tooltip, TooltipTrigger} from '@react-spectrum/tooltip';\nimport {useActionGroup, useActionGroupItem} from '@react-aria/actiongroup';\n\n\nfunction ActionGroup<T extends object>(props: SpectrumActionGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useProviderProps(props);\n props = useSlotProps(props, 'actionGroup');\n\n let {\n isEmphasized,\n density,\n isJustified,\n isDisabled,\n orientation = 'horizontal',\n isQuiet,\n staticColor,\n overflowMode = 'wrap',\n onAction,\n buttonLabelBehavior,\n summaryIcon,\n ...otherProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n let state = useListState({...props, suppressTextValueWarning: true});\n let {actionGroupProps} = useActionGroup(props, state, domRef);\n let isVertical = orientation === 'vertical';\n let providerProps = {isEmphasized, isDisabled, isQuiet};\n let {styleProps} = useStyleProps(props);\n\n // Only hide button text if every item contains more than just plain text (we assume an icon).\n let isIconCollapsible = useMemo(() => [...state.collection].every(item => typeof item.rendered !== 'string'), [state.collection]);\n let [{visibleItems, hideButtonText, isMeasuring}, setVisibleItems] = useValueEffect({\n visibleItems: state.collection.size,\n hideButtonText: buttonLabelBehavior === 'hide' && isIconCollapsible,\n isMeasuring: false\n });\n\n let selectionMode = state.selectionManager.selectionMode;\n let updateOverflow = useCallback(() => {\n if (overflowMode === 'wrap') {\n return;\n }\n\n if (orientation === 'vertical' && selectionMode !== 'none') {\n // Collapsing vertical action groups with selection is currently unsupported by Spectrum.\n return;\n }\n\n let computeVisibleItems = (visibleItems: number) => {\n if (domRef.current && wrapperRef.current) {\n let listItems = Array.from(domRef.current.children) as HTMLLIElement[];\n let containerSize = orientation === 'horizontal' ? wrapperRef.current.getBoundingClientRect().width : wrapperRef.current.getBoundingClientRect().height;\n\n let isShowingMenu = visibleItems < state.collection.size;\n let calculatedSize = 0;\n let newVisibleItems = 0;\n\n if (isShowingMenu) {\n let item = listItems.pop();\n if (item) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, false, true)\n : outerHeight(item, false, true);\n }\n }\n\n for (let [i, item] of listItems.entries()) {\n calculatedSize += orientation === 'horizontal'\n ? outerWidth(item, i === 0, i === listItems.length - 1)\n : outerHeight(item, i === 0, i === listItems.length - 1);\n if (Math.round(calculatedSize) <= Math.round(containerSize)) {\n newVisibleItems++;\n } else {\n break;\n }\n }\n\n // If selection is enabled, and not all of the items fit, collapse all of them into a dropdown\n // immediately rather than having some visible and some not.\n if (selectionMode !== 'none' && newVisibleItems < state.collection.size) {\n return 0;\n }\n\n return newVisibleItems;\n }\n return visibleItems;\n };\n\n setVisibleItems(function *() {\n let hideButtonText = buttonLabelBehavior === 'hide' && isIconCollapsible;\n\n // Update to show all items.\n yield {\n visibleItems: state.collection.size,\n hideButtonText,\n isMeasuring: true\n };\n\n // Measure, and update to show the items that fit.\n let newVisibleItems = computeVisibleItems(state.collection.size);\n let isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n\n // If not all of the buttons fit, and buttonLabelBehavior is 'collapse', then first try hiding\n // the button text and only showing icons. Only if that still doesn't fit collapse into a menu.\n if (newVisibleItems < state.collection.size && buttonLabelBehavior === 'collapse' && isIconCollapsible) {\n yield {\n visibleItems: state.collection.size,\n hideButtonText: true,\n isMeasuring: true\n };\n\n newVisibleItems = computeVisibleItems(state.collection.size);\n isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;\n hideButtonText = true;\n }\n\n yield {\n visibleItems: newVisibleItems,\n hideButtonText,\n isMeasuring\n };\n\n // If the number of items is less than the number of children,\n // then update again to ensure that the menu fits.\n if (isMeasuring) {\n yield {\n visibleItems: computeVisibleItems(newVisibleItems),\n hideButtonText,\n isMeasuring: false\n };\n }\n });\n }, [domRef, state.collection, setVisibleItems, overflowMode, selectionMode, buttonLabelBehavior, isIconCollapsible, orientation]);\n\n // Watch the parent element for size changes. Watching only the action group itself may not work\n // in all scenarios because it may not shrink when available space is reduced.\n let parentRef = useMemo(() => ({\n get current() {\n return wrapperRef.current?.parentElement;\n }\n }), [wrapperRef]);\n useResizeObserver({ref: overflowMode !== 'wrap' ? parentRef : undefined, onResize: updateOverflow});\n useLayoutEffect(updateOverflow, [updateOverflow, state.collection]);\n\n let children = [...state.collection];\n let menuItem: ReactElement | null = null;\n let menuProps = {};\n\n // If there are no visible items, don't apply any props to the action group container\n // and pass all aria labeling props through to the menu button.\n if (overflowMode === 'collapse' && visibleItems === 0) {\n menuProps = filterDOMProps(props, {labelable: true});\n actionGroupProps = {};\n }\n\n if (overflowMode === 'collapse' && visibleItems < state.collection.size) {\n let menuChildren = children.slice(visibleItems);\n children = children.slice(0, visibleItems);\n menuItem = (\n <ActionGroupMenu\n {...menuProps}\n items={menuChildren}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n state={state}\n summaryIcon={summaryIcon}\n hideButtonText={hideButtonText}\n isOnlyItem={visibleItems === 0}\n orientation={orientation} />\n );\n }\n\n let style = {\n ...styleProps.style,\n // While measuring, take up as much space as possible.\n flexBasis: isMeasuring ? '100%' : undefined\n };\n\n return (\n <FocusScope>\n <div {...styleProps} style={style} className={classNames(styles, 'flex-container', styleProps.className)} ref={wrapperRef}>\n <div\n {...actionGroupProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'flex-gap',\n 'spectrum-ActionGroup',\n {\n 'spectrum-ActionGroup--quiet': isQuiet,\n 'spectrum-ActionGroup--vertical': isVertical,\n 'spectrum-ActionGroup--compact': density === 'compact',\n 'spectrum-ActionGroup--justified': isJustified && !isMeasuring,\n 'spectrum-ActionGroup--overflowCollapse': overflowMode === 'collapse'\n },\n otherProps.UNSAFE_className\n )\n }>\n <Provider {...providerProps}>\n {children.map((item) => (\n <ActionGroupItem\n key={item.key}\n onAction={onAction}\n isDisabled={isDisabled}\n isEmphasized={isEmphasized}\n staticColor={staticColor}\n item={item}\n state={state}\n hideButtonText={hideButtonText}\n orientation={orientation} />\n ))}\n {menuItem}\n </Provider>\n </div>\n </div>\n </FocusScope>\n );\n}\n\n/**\n * An ActionGroup is a grouping of ActionButtons that are related to one another.\n */\nconst _ActionGroup = forwardRef(ActionGroup) as <T>(props: SpectrumActionGroupProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_ActionGroup as ActionGroup};\n\ninterface ActionGroupItemProps<T> extends DOMProps, StyleProps {\n item: Node<T>,\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n hideButtonText?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupItem<T>({item, state, isDisabled, isEmphasized, staticColor, onAction, hideButtonText, orientation}: ActionGroupItemProps<T>) {\n let ref = useRef(null);\n let {buttonProps} = useActionGroupItem({key: item.key}, state);\n isDisabled = isDisabled || state.disabledKeys.has(item.key);\n let isSelected = state.selectionManager.isSelected(item.key);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let domProps = filterDOMProps(item.props);\n\n if (onAction && !isDisabled) {\n buttonProps = mergeProps(buttonProps, {\n onPress: () => onAction(item.key)\n });\n }\n\n // If button text is hidden, we need to show it as a tooltip instead, so\n // go find the text element in the DOM after rendering.\n let textId = useId();\n let [textContent, setTextContent] = useState<string | null | undefined>('');\n useLayoutEffect(() => {\n if (hideButtonText) {\n setTextContent(document.getElementById(textId)?.textContent);\n }\n }, [hideButtonText, item.rendered, textId]);\n\n let button = (\n // Use a PressResponder to send DOM props through.\n // ActionButton doesn't allow overriding the role by default.\n <PressResponder {...mergeProps(buttonProps, hoverProps, domProps)}>\n <ClearSlots>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText\n }\n }}>\n <ActionButton\n ref={ref}\n // @ts-ignore (private)\n hideButtonText={hideButtonText}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n {\n 'is-selected': isSelected,\n 'is-hovered': isHovered,\n 'spectrum-ActionGroup-item--iconOnly': hideButtonText,\n 'spectrum-ActionGroup-item--isDisabled': isDisabled\n },\n classNames(\n buttonStyles,\n {\n 'spectrum-ActionButton--emphasized': isEmphasized,\n 'is-selected': isSelected\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}\n aria-label={item['aria-label']}\n aria-labelledby={item['aria-label'] == null && hideButtonText ? textId : undefined}>\n {item.rendered}\n </ActionButton>\n </SlotProvider>\n </ClearSlots>\n </PressResponder>\n );\n\n if (hideButtonText && textContent) {\n button = (\n <TooltipTrigger placement={orientation === 'vertical' ? 'end' : 'top'}>\n {button}\n <Tooltip>{textContent}</Tooltip>\n </TooltipTrigger>\n );\n }\n\n if (item.wrapper) {\n button = item.wrapper(button);\n }\n\n return button;\n}\n\ninterface ActionGroupMenuProps<T> extends AriaLabelingProps {\n state: ListState<T>,\n isDisabled?: boolean,\n isEmphasized?: boolean,\n staticColor?: 'white' | 'black',\n items: Node<T>[],\n hideButtonText?: boolean,\n summaryIcon?: ReactNode,\n isOnlyItem?: boolean,\n orientation?: 'horizontal' | 'vertical',\n onAction?: (key: Key) => void\n}\n\nfunction ActionGroupMenu<T>({state, isDisabled, isEmphasized, staticColor, items, onAction, summaryIcon, hideButtonText, isOnlyItem, orientation, ...otherProps}: ActionGroupMenuProps<T>) {\n // Use the key of the first item within the menu as the key of the button.\n // The key must actually exist in the collection for focus to work correctly.\n let key = items[0].key;\n let {buttonProps} = useActionGroupItem({key}, state);\n\n // The menu button shouldn't act like an actual action group item.\n delete buttonProps.onPress;\n delete buttonProps.role;\n delete buttonProps['aria-checked'];\n\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n // If no aria-label or aria-labelledby is given, provide a default one.\n let ariaLabel = otherProps['aria-label'] || (otherProps['aria-labelledby'] ? undefined : '…');\n let ariaLabelledby = otherProps['aria-labelledby'];\n let textId = useId();\n let id = useId();\n\n // Summary icon only applies when selection is enabled.\n if (state.selectionManager.selectionMode === 'none') {\n summaryIcon = null;\n }\n\n let iconOnly = false;\n\n // If there is a selection, show the selected state on the menu button.\n let isSelected = state.selectionManager.selectionMode !== 'none' && !state.selectionManager.isEmpty;\n\n // If single selection and empty selection is not allowed, swap the contents of the button to the selected item (like a Picker).\n if (!summaryIcon && state.selectionManager.selectionMode === 'single' && state.selectionManager.disallowEmptySelection && state.selectionManager.firstSelectedKey != null) {\n let selectedItem = state.collection.getItem(state.selectionManager.firstSelectedKey);\n if (selectedItem) {\n summaryIcon = selectedItem.rendered;\n if (typeof summaryIcon === 'string') {\n summaryIcon = <Text>{summaryIcon}</Text>;\n }\n iconOnly = !!hideButtonText;\n ariaLabelledby = `${ariaLabelledby ?? id} ${textId}`;\n }\n }\n\n if (summaryIcon) {\n // If there's a custom summary icon, also add a chevron.\n summaryIcon = (\n <>\n <ChevronDownMedium UNSAFE_className={classNames(styles, 'spectrum-ActionGroup-menu-chevron')} />\n <span className={classNames(styles, 'spectrum-ActionGroup-menu-contents', {'spectrum-ActionGroup-item--iconOnly': iconOnly})}>\n {summaryIcon}\n </span>\n </>\n );\n }\n\n return (\n // Use a PressResponder to send DOM props through.\n <MenuTrigger align={isOnlyItem ? 'start' : 'end'} direction={orientation === 'vertical' ? 'end' : 'bottom'}>\n <SlotProvider\n slots={{\n text: {\n id: hideButtonText ? textId : null,\n isHidden: hideButtonText,\n UNSAFE_className: classNames(styles, 'spectrum-ActionGroup-menu-text')\n }\n }}>\n <PressResponder {...mergeProps(buttonProps, hoverProps)}>\n <ActionButton\n {...otherProps}\n id={id}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-ActionGroup-item',\n 'spectrum-ActionGroup-menu',\n {\n 'is-hovered': isHovered,\n 'is-selected': isSelected\n },\n classNames(\n buttonStyles,\n {\n 'is-selected': isSelected,\n 'spectrum-ActionButton--emphasized': isEmphasized\n }\n )\n )\n }\n isDisabled={isDisabled}\n staticColor={staticColor}>\n {summaryIcon || <More />}\n </ActionButton>\n </PressResponder>\n </SlotProvider>\n <Menu\n items={items}\n disabledKeys={state.disabledKeys}\n selectionMode={state.selectionManager.selectionMode}\n selectedKeys={state.selectionManager.selectedKeys}\n disallowEmptySelection={state.selectionManager.disallowEmptySelection}\n onSelectionChange={(keys) => state.selectionManager.setSelectedKeys(keys)}\n onAction={onAction}>\n {node => <Item textValue={node.textValue} {...filterDOMProps(node.props)}>{node.rendered}</Item>}\n </Menu>\n </MenuTrigger>\n );\n}\n\nfunction outerWidth(element: HTMLElement, ignoreLeftMargin: boolean, ignoreRightMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().width + (ignoreLeftMargin ? 0 : toNumber(style.marginLeft)) + (ignoreRightMargin ? 0 : toNumber(style.marginRight));\n}\n\n\nfunction outerHeight(element: HTMLElement, ignoreTopMargin: boolean, ignoreBottomMargin: boolean) {\n let style = window.getComputedStyle(element);\n return element.getBoundingClientRect().height + (ignoreTopMargin ? 0 : toNumber(style.marginTop)) + (ignoreBottomMargin ? 0 : toNumber(style.marginBottom));\n}\n\nfunction toNumber(value: string) {\n let parsed = parseInt(value, 10);\n return isNaN(parsed) ? 0 : parsed;\n}\n"],"names":[],"version":3,"file":"ActionGroup.module.js.map"}
|
|
@@ -1 +1 @@
|
|
|
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;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AArCA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA8B,CAAC,gBAAgB,CAAC;AAChD,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA4B,CAAC,cAAc,CAAC;AAC5C,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAAwC,CAAC,2BAA2B,EAAE,
|
|
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;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4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,2CAAyC,CAAC,4BAA4B,EAAE,0CAAsC,CAAC,EAAE,2CAAsC;AACvJ,4CAAyD,CAAC,2CAA2C,CAAC;AACtG,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAAyC,CAAC,4BAA4B,EAAE,0CAAsC,CAAC,EAAE,2CAAsC;AACvJ,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAgD,CAAC,mCAAmC,EAAE,2CAA6C;AACnI,4CAAkC,CAAC,oBAAoB,CAAC;AACxD,4CAAyC,CAAC,4BAA4B,EAAE,0CAAsC,CAAC,EAAE,2CAAsC;AACvJ,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA6C,CAAC,+BAA+B,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/button/vars.css"],"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"],"names":[],"version":3,"file":"button_vars_css.main.js.map"}
|
|
@@ -1 +1 @@
|
|
|
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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AAsC,CAAC,EAAE,2CAAsC;AACvJ,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA6C,CAAC,+BAA+B,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/button/vars.css"],"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"],"names":[],"version":3,"file":"button_vars_css.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/actiongroup",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.10",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,21 +36,21 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-aria/actiongroup": "^3.7.
|
|
40
|
-
"@react-aria/focus": "^3.
|
|
41
|
-
"@react-aria/interactions": "^3.22.
|
|
42
|
-
"@react-aria/utils": "^3.
|
|
43
|
-
"@react-spectrum/button": "^3.16.
|
|
44
|
-
"@react-spectrum/menu": "^3.
|
|
45
|
-
"@react-spectrum/text": "^3.5.
|
|
46
|
-
"@react-spectrum/tooltip": "^3.
|
|
47
|
-
"@react-spectrum/utils": "^3.
|
|
48
|
-
"@react-stately/collections": "^3.
|
|
49
|
-
"@react-stately/list": "^3.11.
|
|
50
|
-
"@react-types/actiongroup": "^3.4.
|
|
51
|
-
"@react-types/shared": "^3.
|
|
52
|
-
"@spectrum-icons/ui": "^3.6.
|
|
53
|
-
"@spectrum-icons/workflow": "^4.2.
|
|
39
|
+
"@react-aria/actiongroup": "^3.7.11",
|
|
40
|
+
"@react-aria/focus": "^3.19.0",
|
|
41
|
+
"@react-aria/interactions": "^3.22.5",
|
|
42
|
+
"@react-aria/utils": "^3.26.0",
|
|
43
|
+
"@react-spectrum/button": "^3.16.9",
|
|
44
|
+
"@react-spectrum/menu": "^3.21.0",
|
|
45
|
+
"@react-spectrum/text": "^3.5.10",
|
|
46
|
+
"@react-spectrum/tooltip": "^3.7.0",
|
|
47
|
+
"@react-spectrum/utils": "^3.12.0",
|
|
48
|
+
"@react-stately/collections": "^3.12.0",
|
|
49
|
+
"@react-stately/list": "^3.11.1",
|
|
50
|
+
"@react-types/actiongroup": "^3.4.13",
|
|
51
|
+
"@react-types/shared": "^3.26.0",
|
|
52
|
+
"@spectrum-icons/ui": "^3.6.11",
|
|
53
|
+
"@spectrum-icons/workflow": "^4.2.16",
|
|
54
54
|
"@swc/helpers": "^0.5.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
@@ -58,10 +58,11 @@
|
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@react-spectrum/provider": "^3.2.0",
|
|
61
|
-
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0",
|
|
62
|
-
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
|
|
61
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
|
|
62
|
+
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
|
|
63
63
|
},
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
|
-
}
|
|
67
|
-
|
|
66
|
+
},
|
|
67
|
+
"gitHead": "71f0ef23053f9e03ee7e97df736e8b083e006849"
|
|
68
|
+
}
|