@react-spectrum/actiongroup 3.0.0-alpha.1 → 3.0.0-nightly-4980928d3-240906

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.
@@ -0,0 +1,391 @@
1
+ import "./vars.406b82f3.css";
2
+ import $lajJX$button_vars_cssmodulejs from "./button_vars_css.mjs";
3
+ import "./vars.d604f0e4.css";
4
+ import $lajJX$actiongroup_vars_cssmodulejs from "./actiongroup_vars_css.mjs";
5
+ import {ActionButton as $lajJX$ActionButton} from "@react-spectrum/button";
6
+ import $lajJX$spectrumiconsuiChevronDownMedium from "@spectrum-icons/ui/ChevronDownMedium";
7
+ import {useSlotProps as $lajJX$useSlotProps, useDOMRef as $lajJX$useDOMRef, useStyleProps as $lajJX$useStyleProps, classNames as $lajJX$classNames, ClearSlots as $lajJX$ClearSlots, SlotProvider as $lajJX$SlotProvider} from "@react-spectrum/utils";
8
+ import {useValueEffect as $lajJX$useValueEffect, useResizeObserver as $lajJX$useResizeObserver, useLayoutEffect as $lajJX$useLayoutEffect, filterDOMProps as $lajJX$filterDOMProps, mergeProps as $lajJX$mergeProps, useId as $lajJX$useId} from "@react-aria/utils";
9
+ import {FocusScope as $lajJX$FocusScope} from "@react-aria/focus";
10
+ import {MenuTrigger as $lajJX$MenuTrigger, Menu as $lajJX$Menu, Item as $lajJX$Item} from "@react-spectrum/menu";
11
+ import {useListState as $lajJX$useListState} from "@react-stately/list";
12
+ import $lajJX$spectrumiconsworkflowMore from "@spectrum-icons/workflow/More";
13
+ import {useHover as $lajJX$useHover, PressResponder as $lajJX$PressResponder} from "@react-aria/interactions";
14
+ import {useProviderProps as $lajJX$useProviderProps, Provider as $lajJX$Provider} from "@react-spectrum/provider";
15
+ import $lajJX$react, {useRef as $lajJX$useRef, useMemo as $lajJX$useMemo, useCallback as $lajJX$useCallback, forwardRef as $lajJX$forwardRef, useState as $lajJX$useState} from "react";
16
+ import {Text as $lajJX$Text} from "@react-spectrum/text";
17
+ import {TooltipTrigger as $lajJX$TooltipTrigger, Tooltip as $lajJX$Tooltip} from "@react-spectrum/tooltip";
18
+ import {useActionGroup as $lajJX$useActionGroup, useActionGroupItem as $lajJX$useActionGroupItem} from "@react-aria/actiongroup";
19
+
20
+
21
+ function $parcel$interopDefault(a) {
22
+ return a && a.__esModule ? a.default : a;
23
+ }
24
+ /*
25
+ * Copyright 2020 Adobe. All rights reserved.
26
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
27
+ * you may not use this file except in compliance with the License. You may obtain a copy
28
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
29
+ *
30
+ * Unless required by applicable law or agreed to in writing, software distributed under
31
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
32
+ * OF ANY KIND, either express or implied. See the License for the specific language
33
+ * governing permissions and limitations under the License.
34
+ */
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+ function $a04ee251ffcc2690$var$ActionGroup(props, ref) {
51
+ props = (0, $lajJX$useProviderProps)(props);
52
+ props = (0, $lajJX$useSlotProps)(props, 'actionGroup');
53
+ let { isEmphasized: isEmphasized, density: density, isJustified: isJustified, isDisabled: isDisabled, orientation: orientation = 'horizontal', isQuiet: isQuiet, staticColor: staticColor, overflowMode: overflowMode = 'wrap', onAction: onAction, buttonLabelBehavior: buttonLabelBehavior, summaryIcon: summaryIcon, ...otherProps } = props;
54
+ let domRef = (0, $lajJX$useDOMRef)(ref);
55
+ let wrapperRef = (0, $lajJX$useRef)(null);
56
+ let state = (0, $lajJX$useListState)({
57
+ ...props,
58
+ suppressTextValueWarning: true
59
+ });
60
+ let { actionGroupProps: actionGroupProps } = (0, $lajJX$useActionGroup)(props, state, domRef);
61
+ let isVertical = orientation === 'vertical';
62
+ let providerProps = {
63
+ isEmphasized: isEmphasized,
64
+ isDisabled: isDisabled,
65
+ isQuiet: isQuiet
66
+ };
67
+ let { styleProps: styleProps } = (0, $lajJX$useStyleProps)(props);
68
+ // Only hide button text if every item contains more than just plain text (we assume an icon).
69
+ let isIconCollapsible = (0, $lajJX$useMemo)(()=>[
70
+ ...state.collection
71
+ ].every((item)=>typeof item.rendered !== 'string'), [
72
+ state.collection
73
+ ]);
74
+ let [{ visibleItems: visibleItems, hideButtonText: hideButtonText, isMeasuring: isMeasuring }, setVisibleItems] = (0, $lajJX$useValueEffect)({
75
+ visibleItems: state.collection.size,
76
+ hideButtonText: buttonLabelBehavior === 'hide' && isIconCollapsible,
77
+ isMeasuring: false
78
+ });
79
+ let selectionMode = state.selectionManager.selectionMode;
80
+ let updateOverflow = (0, $lajJX$useCallback)(()=>{
81
+ if (overflowMode === 'wrap') return;
82
+ if (orientation === 'vertical' && selectionMode !== 'none') // Collapsing vertical action groups with selection is currently unsupported by Spectrum.
83
+ return;
84
+ let computeVisibleItems = (visibleItems)=>{
85
+ if (domRef.current && wrapperRef.current) {
86
+ let listItems = Array.from(domRef.current.children);
87
+ let containerSize = orientation === 'horizontal' ? wrapperRef.current.getBoundingClientRect().width : wrapperRef.current.getBoundingClientRect().height;
88
+ let isShowingMenu = visibleItems < state.collection.size;
89
+ let calculatedSize = 0;
90
+ let newVisibleItems = 0;
91
+ if (isShowingMenu) {
92
+ let item = listItems.pop();
93
+ if (item) calculatedSize += orientation === 'horizontal' ? $a04ee251ffcc2690$var$outerWidth(item, false, true) : $a04ee251ffcc2690$var$outerHeight(item, false, true);
94
+ }
95
+ for (let [i, item] of listItems.entries()){
96
+ calculatedSize += orientation === 'horizontal' ? $a04ee251ffcc2690$var$outerWidth(item, i === 0, i === listItems.length - 1) : $a04ee251ffcc2690$var$outerHeight(item, i === 0, i === listItems.length - 1);
97
+ if (Math.round(calculatedSize) <= Math.round(containerSize)) newVisibleItems++;
98
+ else break;
99
+ }
100
+ // If selection is enabled, and not all of the items fit, collapse all of them into a dropdown
101
+ // immediately rather than having some visible and some not.
102
+ if (selectionMode !== 'none' && newVisibleItems < state.collection.size) return 0;
103
+ return newVisibleItems;
104
+ }
105
+ return visibleItems;
106
+ };
107
+ setVisibleItems(function*() {
108
+ let hideButtonText = buttonLabelBehavior === 'hide' && isIconCollapsible;
109
+ // Update to show all items.
110
+ yield {
111
+ visibleItems: state.collection.size,
112
+ hideButtonText: hideButtonText,
113
+ isMeasuring: true
114
+ };
115
+ // Measure, and update to show the items that fit.
116
+ let newVisibleItems = computeVisibleItems(state.collection.size);
117
+ let isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;
118
+ // If not all of the buttons fit, and buttonLabelBehavior is 'collapse', then first try hiding
119
+ // the button text and only showing icons. Only if that still doesn't fit collapse into a menu.
120
+ if (newVisibleItems < state.collection.size && buttonLabelBehavior === 'collapse' && isIconCollapsible) {
121
+ yield {
122
+ visibleItems: state.collection.size,
123
+ hideButtonText: true,
124
+ isMeasuring: true
125
+ };
126
+ newVisibleItems = computeVisibleItems(state.collection.size);
127
+ isMeasuring = newVisibleItems < state.collection.size && newVisibleItems > 0;
128
+ hideButtonText = true;
129
+ }
130
+ yield {
131
+ visibleItems: newVisibleItems,
132
+ hideButtonText: hideButtonText,
133
+ isMeasuring: isMeasuring
134
+ };
135
+ // If the number of items is less than the number of children,
136
+ // then update again to ensure that the menu fits.
137
+ if (isMeasuring) yield {
138
+ visibleItems: computeVisibleItems(newVisibleItems),
139
+ hideButtonText: hideButtonText,
140
+ isMeasuring: false
141
+ };
142
+ });
143
+ }, [
144
+ domRef,
145
+ state.collection,
146
+ setVisibleItems,
147
+ overflowMode,
148
+ selectionMode,
149
+ buttonLabelBehavior,
150
+ isIconCollapsible,
151
+ orientation
152
+ ]);
153
+ // Watch the parent element for size changes. Watching only the action group itself may not work
154
+ // in all scenarios because it may not shrink when available space is reduced.
155
+ let parentRef = (0, $lajJX$useMemo)(()=>({
156
+ get current () {
157
+ var _wrapperRef_current;
158
+ return (_wrapperRef_current = wrapperRef.current) === null || _wrapperRef_current === void 0 ? void 0 : _wrapperRef_current.parentElement;
159
+ }
160
+ }), [
161
+ wrapperRef
162
+ ]);
163
+ (0, $lajJX$useResizeObserver)({
164
+ ref: overflowMode !== 'wrap' ? parentRef : undefined,
165
+ onResize: updateOverflow
166
+ });
167
+ (0, $lajJX$useLayoutEffect)(updateOverflow, [
168
+ updateOverflow,
169
+ state.collection
170
+ ]);
171
+ let children = [
172
+ ...state.collection
173
+ ];
174
+ let menuItem = null;
175
+ let menuProps = {};
176
+ // If there are no visible items, don't apply any props to the action group container
177
+ // and pass all aria labeling props through to the menu button.
178
+ if (overflowMode === 'collapse' && visibleItems === 0) {
179
+ menuProps = (0, $lajJX$filterDOMProps)(props, {
180
+ labelable: true
181
+ });
182
+ actionGroupProps = {};
183
+ }
184
+ if (overflowMode === 'collapse' && visibleItems < state.collection.size) {
185
+ let menuChildren = children.slice(visibleItems);
186
+ children = children.slice(0, visibleItems);
187
+ menuItem = /*#__PURE__*/ (0, $lajJX$react).createElement($a04ee251ffcc2690$var$ActionGroupMenu, {
188
+ ...menuProps,
189
+ items: menuChildren,
190
+ onAction: onAction,
191
+ isDisabled: isDisabled,
192
+ isEmphasized: isEmphasized,
193
+ staticColor: staticColor,
194
+ state: state,
195
+ summaryIcon: summaryIcon,
196
+ hideButtonText: hideButtonText,
197
+ isOnlyItem: visibleItems === 0,
198
+ orientation: orientation
199
+ });
200
+ }
201
+ let style = {
202
+ ...styleProps.style,
203
+ // While measuring, take up as much space as possible.
204
+ flexBasis: isMeasuring ? '100%' : undefined
205
+ };
206
+ return /*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$FocusScope), null, /*#__PURE__*/ (0, $lajJX$react).createElement("div", {
207
+ ...styleProps,
208
+ style: style,
209
+ className: (0, $lajJX$classNames)((0, ($parcel$interopDefault($lajJX$actiongroup_vars_cssmodulejs))), 'flex-container', styleProps.className),
210
+ ref: wrapperRef
211
+ }, /*#__PURE__*/ (0, $lajJX$react).createElement("div", {
212
+ ...actionGroupProps,
213
+ ref: domRef,
214
+ className: (0, $lajJX$classNames)((0, ($parcel$interopDefault($lajJX$actiongroup_vars_cssmodulejs))), 'flex-gap', 'spectrum-ActionGroup', {
215
+ 'spectrum-ActionGroup--quiet': isQuiet,
216
+ 'spectrum-ActionGroup--vertical': isVertical,
217
+ 'spectrum-ActionGroup--compact': density === 'compact',
218
+ 'spectrum-ActionGroup--justified': isJustified && !isMeasuring,
219
+ 'spectrum-ActionGroup--overflowCollapse': overflowMode === 'collapse'
220
+ }, otherProps.UNSAFE_className)
221
+ }, /*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$Provider), providerProps, children.map((item)=>/*#__PURE__*/ (0, $lajJX$react).createElement($a04ee251ffcc2690$var$ActionGroupItem, {
222
+ key: item.key,
223
+ onAction: onAction,
224
+ isDisabled: isDisabled,
225
+ isEmphasized: isEmphasized,
226
+ staticColor: staticColor,
227
+ item: item,
228
+ state: state,
229
+ hideButtonText: hideButtonText,
230
+ orientation: orientation
231
+ })), menuItem))));
232
+ }
233
+ /**
234
+ * An ActionGroup is a grouping of ActionButtons that are related to one another.
235
+ */ const $a04ee251ffcc2690$export$c21a5597f732a168 = /*#__PURE__*/ (0, $lajJX$forwardRef)($a04ee251ffcc2690$var$ActionGroup);
236
+ function $a04ee251ffcc2690$var$ActionGroupItem({ item: item, state: state, isDisabled: isDisabled, isEmphasized: isEmphasized, staticColor: staticColor, onAction: onAction, hideButtonText: hideButtonText, orientation: orientation }) {
237
+ let ref = (0, $lajJX$useRef)(null);
238
+ let { buttonProps: buttonProps } = (0, $lajJX$useActionGroupItem)({
239
+ key: item.key
240
+ }, state);
241
+ isDisabled = isDisabled || state.disabledKeys.has(item.key);
242
+ let isSelected = state.selectionManager.isSelected(item.key);
243
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $lajJX$useHover)({
244
+ isDisabled: isDisabled
245
+ });
246
+ let domProps = (0, $lajJX$filterDOMProps)(item.props);
247
+ if (onAction && !isDisabled) buttonProps = (0, $lajJX$mergeProps)(buttonProps, {
248
+ onPress: ()=>onAction(item.key)
249
+ });
250
+ // If button text is hidden, we need to show it as a tooltip instead, so
251
+ // go find the text element in the DOM after rendering.
252
+ let textId = (0, $lajJX$useId)();
253
+ let [textContent, setTextContent] = (0, $lajJX$useState)('');
254
+ (0, $lajJX$useLayoutEffect)(()=>{
255
+ var _document_getElementById;
256
+ if (hideButtonText) setTextContent((_document_getElementById = document.getElementById(textId)) === null || _document_getElementById === void 0 ? void 0 : _document_getElementById.textContent);
257
+ }, [
258
+ hideButtonText,
259
+ item.rendered,
260
+ textId
261
+ ]);
262
+ let button = // Use a PressResponder to send DOM props through.
263
+ // ActionButton doesn't allow overriding the role by default.
264
+ /*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$PressResponder), (0, $lajJX$mergeProps)(buttonProps, hoverProps, domProps), /*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$ClearSlots), null, /*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$SlotProvider), {
265
+ slots: {
266
+ text: {
267
+ id: hideButtonText ? textId : null,
268
+ isHidden: hideButtonText
269
+ }
270
+ }
271
+ }, /*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$ActionButton), {
272
+ ref: ref,
273
+ // @ts-ignore (private)
274
+ hideButtonText: hideButtonText,
275
+ UNSAFE_className: (0, $lajJX$classNames)((0, ($parcel$interopDefault($lajJX$actiongroup_vars_cssmodulejs))), 'spectrum-ActionGroup-item', {
276
+ 'is-selected': isSelected,
277
+ 'is-hovered': isHovered,
278
+ 'spectrum-ActionGroup-item--iconOnly': hideButtonText,
279
+ 'spectrum-ActionGroup-item--isDisabled': isDisabled
280
+ }, (0, $lajJX$classNames)((0, ($parcel$interopDefault($lajJX$button_vars_cssmodulejs))), {
281
+ 'spectrum-ActionButton--emphasized': isEmphasized,
282
+ 'is-selected': isSelected
283
+ })),
284
+ isDisabled: isDisabled,
285
+ staticColor: staticColor,
286
+ "aria-label": item['aria-label'],
287
+ "aria-labelledby": item['aria-label'] == null && hideButtonText ? textId : undefined
288
+ }, item.rendered))));
289
+ if (hideButtonText && textContent) button = /*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$TooltipTrigger), {
290
+ placement: orientation === 'vertical' ? 'end' : 'top'
291
+ }, button, /*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$Tooltip), null, textContent));
292
+ if (item.wrapper) button = item.wrapper(button);
293
+ return button;
294
+ }
295
+ function $a04ee251ffcc2690$var$ActionGroupMenu({ state: state, isDisabled: isDisabled, isEmphasized: isEmphasized, staticColor: staticColor, items: items, onAction: onAction, summaryIcon: summaryIcon, hideButtonText: hideButtonText, isOnlyItem: isOnlyItem, orientation: orientation, ...otherProps }) {
296
+ // Use the key of the first item within the menu as the key of the button.
297
+ // The key must actually exist in the collection for focus to work correctly.
298
+ let key = items[0].key;
299
+ let { buttonProps: buttonProps } = (0, $lajJX$useActionGroupItem)({
300
+ key: key
301
+ }, state);
302
+ // The menu button shouldn't act like an actual action group item.
303
+ delete buttonProps.onPress;
304
+ delete buttonProps.role;
305
+ delete buttonProps['aria-checked'];
306
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $lajJX$useHover)({
307
+ isDisabled: isDisabled
308
+ });
309
+ // If no aria-label or aria-labelledby is given, provide a default one.
310
+ let ariaLabel = otherProps['aria-label'] || (otherProps['aria-labelledby'] ? undefined : "\u2026");
311
+ let ariaLabelledby = otherProps['aria-labelledby'];
312
+ let textId = (0, $lajJX$useId)();
313
+ let id = (0, $lajJX$useId)();
314
+ // Summary icon only applies when selection is enabled.
315
+ if (state.selectionManager.selectionMode === 'none') summaryIcon = null;
316
+ let iconOnly = false;
317
+ // If there is a selection, show the selected state on the menu button.
318
+ let isSelected = state.selectionManager.selectionMode !== 'none' && !state.selectionManager.isEmpty;
319
+ // If single selection and empty selection is not allowed, swap the contents of the button to the selected item (like a Picker).
320
+ if (!summaryIcon && state.selectionManager.selectionMode === 'single' && state.selectionManager.disallowEmptySelection && state.selectionManager.firstSelectedKey != null) {
321
+ let selectedItem = state.collection.getItem(state.selectionManager.firstSelectedKey);
322
+ if (selectedItem) {
323
+ summaryIcon = selectedItem.rendered;
324
+ if (typeof summaryIcon === 'string') summaryIcon = /*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$Text), null, summaryIcon);
325
+ iconOnly = !!hideButtonText;
326
+ ariaLabelledby = `${ariaLabelledby !== null && ariaLabelledby !== void 0 ? ariaLabelledby : id} ${textId}`;
327
+ }
328
+ }
329
+ if (summaryIcon) // If there's a custom summary icon, also add a chevron.
330
+ summaryIcon = /*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$react).Fragment, null, /*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$spectrumiconsuiChevronDownMedium), {
331
+ UNSAFE_className: (0, $lajJX$classNames)((0, ($parcel$interopDefault($lajJX$actiongroup_vars_cssmodulejs))), 'spectrum-ActionGroup-menu-chevron')
332
+ }), /*#__PURE__*/ (0, $lajJX$react).createElement("span", {
333
+ className: (0, $lajJX$classNames)((0, ($parcel$interopDefault($lajJX$actiongroup_vars_cssmodulejs))), 'spectrum-ActionGroup-menu-contents', {
334
+ 'spectrum-ActionGroup-item--iconOnly': iconOnly
335
+ })
336
+ }, summaryIcon));
337
+ return(// Use a PressResponder to send DOM props through.
338
+ /*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$MenuTrigger), {
339
+ align: isOnlyItem ? 'start' : 'end',
340
+ direction: orientation === 'vertical' ? 'end' : 'bottom'
341
+ }, /*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$SlotProvider), {
342
+ slots: {
343
+ text: {
344
+ id: hideButtonText ? textId : null,
345
+ isHidden: hideButtonText,
346
+ UNSAFE_className: (0, $lajJX$classNames)((0, ($parcel$interopDefault($lajJX$actiongroup_vars_cssmodulejs))), 'spectrum-ActionGroup-menu-text')
347
+ }
348
+ }
349
+ }, /*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$PressResponder), (0, $lajJX$mergeProps)(buttonProps, hoverProps), /*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$ActionButton), {
350
+ ...otherProps,
351
+ id: id,
352
+ "aria-label": ariaLabel,
353
+ "aria-labelledby": ariaLabelledby,
354
+ UNSAFE_className: (0, $lajJX$classNames)((0, ($parcel$interopDefault($lajJX$actiongroup_vars_cssmodulejs))), 'spectrum-ActionGroup-item', 'spectrum-ActionGroup-menu', {
355
+ 'is-hovered': isHovered,
356
+ 'is-selected': isSelected
357
+ }, (0, $lajJX$classNames)((0, ($parcel$interopDefault($lajJX$button_vars_cssmodulejs))), {
358
+ 'is-selected': isSelected,
359
+ 'spectrum-ActionButton--emphasized': isEmphasized
360
+ })),
361
+ isDisabled: isDisabled,
362
+ staticColor: staticColor
363
+ }, summaryIcon || /*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$spectrumiconsworkflowMore), null)))), /*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$Menu), {
364
+ items: items,
365
+ disabledKeys: state.disabledKeys,
366
+ selectionMode: state.selectionManager.selectionMode,
367
+ selectedKeys: state.selectionManager.selectedKeys,
368
+ disallowEmptySelection: state.selectionManager.disallowEmptySelection,
369
+ onSelectionChange: (keys)=>state.selectionManager.setSelectedKeys(keys),
370
+ onAction: onAction
371
+ }, (node)=>/*#__PURE__*/ (0, $lajJX$react).createElement((0, $lajJX$Item), {
372
+ textValue: node.textValue,
373
+ ...(0, $lajJX$filterDOMProps)(node.props)
374
+ }, node.rendered))));
375
+ }
376
+ function $a04ee251ffcc2690$var$outerWidth(element, ignoreLeftMargin, ignoreRightMargin) {
377
+ let style = window.getComputedStyle(element);
378
+ return element.getBoundingClientRect().width + (ignoreLeftMargin ? 0 : $a04ee251ffcc2690$var$toNumber(style.marginLeft)) + (ignoreRightMargin ? 0 : $a04ee251ffcc2690$var$toNumber(style.marginRight));
379
+ }
380
+ function $a04ee251ffcc2690$var$outerHeight(element, ignoreTopMargin, ignoreBottomMargin) {
381
+ let style = window.getComputedStyle(element);
382
+ return element.getBoundingClientRect().height + (ignoreTopMargin ? 0 : $a04ee251ffcc2690$var$toNumber(style.marginTop)) + (ignoreBottomMargin ? 0 : $a04ee251ffcc2690$var$toNumber(style.marginBottom));
383
+ }
384
+ function $a04ee251ffcc2690$var$toNumber(value) {
385
+ let parsed = parseInt(value, 10);
386
+ return isNaN(parsed) ? 0 : parsed;
387
+ }
388
+
389
+
390
+ export {$a04ee251ffcc2690$export$c21a5597f732a168 as ActionGroup};
391
+ //# sourceMappingURL=ActionGroup.module.js.map