react-aria-components 1.11.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Autocomplete.main.js +7 -20
- package/dist/Autocomplete.main.js.map +1 -1
- package/dist/Autocomplete.mjs +8 -20
- package/dist/Autocomplete.module.js +8 -20
- package/dist/Autocomplete.module.js.map +1 -1
- package/dist/Breadcrumbs.main.js +4 -1
- package/dist/Breadcrumbs.main.js.map +1 -1
- package/dist/Breadcrumbs.mjs +5 -2
- package/dist/Breadcrumbs.module.js +5 -2
- package/dist/Breadcrumbs.module.js.map +1 -1
- package/dist/GridList.main.js +96 -15
- package/dist/GridList.main.js.map +1 -1
- package/dist/GridList.mjs +98 -19
- package/dist/GridList.module.js +98 -19
- package/dist/GridList.module.js.map +1 -1
- package/dist/Header.main.js +1 -1
- package/dist/Header.main.js.map +1 -1
- package/dist/Header.mjs +2 -2
- package/dist/Header.module.js +2 -2
- package/dist/Header.module.js.map +1 -1
- package/dist/ListBox.main.js +6 -18
- package/dist/ListBox.main.js.map +1 -1
- package/dist/ListBox.mjs +8 -20
- package/dist/ListBox.module.js +8 -20
- package/dist/ListBox.module.js.map +1 -1
- package/dist/Menu.main.js +29 -15
- package/dist/Menu.main.js.map +1 -1
- package/dist/Menu.mjs +31 -17
- package/dist/Menu.module.js +31 -17
- package/dist/Menu.module.js.map +1 -1
- package/dist/Popover.main.js +7 -11
- package/dist/Popover.main.js.map +1 -1
- package/dist/Popover.mjs +8 -12
- package/dist/Popover.module.js +8 -12
- package/dist/Popover.module.js.map +1 -1
- package/dist/SearchField.main.js +6 -4
- package/dist/SearchField.main.js.map +1 -1
- package/dist/SearchField.mjs +7 -5
- package/dist/SearchField.module.js +7 -5
- package/dist/SearchField.module.js.map +1 -1
- package/dist/Separator.main.js +13 -1
- package/dist/Separator.main.js.map +1 -1
- package/dist/Separator.mjs +15 -3
- package/dist/Separator.module.js +15 -3
- package/dist/Separator.module.js.map +1 -1
- package/dist/Table.main.js +58 -17
- package/dist/Table.main.js.map +1 -1
- package/dist/Table.mjs +60 -19
- package/dist/Table.module.js +60 -19
- package/dist/Table.module.js.map +1 -1
- package/dist/Tabs.main.js +4 -1
- package/dist/Tabs.main.js.map +1 -1
- package/dist/Tabs.mjs +5 -2
- package/dist/Tabs.module.js +5 -2
- package/dist/Tabs.module.js.map +1 -1
- package/dist/TagGroup.main.js +13 -4
- package/dist/TagGroup.main.js.map +1 -1
- package/dist/TagGroup.mjs +15 -6
- package/dist/TagGroup.module.js +15 -6
- package/dist/TagGroup.module.js.map +1 -1
- package/dist/TextField.main.js +7 -5
- package/dist/TextField.main.js.map +1 -1
- package/dist/TextField.mjs +8 -6
- package/dist/TextField.module.js +8 -6
- package/dist/TextField.module.js.map +1 -1
- package/dist/Tooltip.main.js +4 -11
- package/dist/Tooltip.main.js.map +1 -1
- package/dist/Tooltip.mjs +6 -13
- package/dist/Tooltip.module.js +6 -13
- package/dist/Tooltip.module.js.map +1 -1
- package/dist/Tree.main.js +9 -3
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +10 -4
- package/dist/Tree.module.js +10 -4
- package/dist/Tree.module.js.map +1 -1
- package/dist/context.main.js +25 -0
- package/dist/context.main.js.map +1 -0
- package/dist/context.mjs +19 -0
- package/dist/context.module.js +19 -0
- package/dist/context.module.js.map +1 -0
- package/dist/import.mjs +3 -3
- package/dist/main.js +3 -0
- package/dist/main.js.map +1 -1
- package/dist/module.js +3 -3
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +178 -171
- package/dist/types.d.ts.map +1 -1
- package/dist/useDragAndDrop.main.js.map +1 -1
- package/dist/useDragAndDrop.module.js.map +1 -1
- package/package.json +23 -22
- package/src/Autocomplete.tsx +14 -25
- package/src/Breadcrumbs.tsx +6 -2
- package/src/GridList.tsx +89 -21
- package/src/Header.tsx +2 -2
- package/src/ListBox.tsx +12 -15
- package/src/Menu.tsx +37 -17
- package/src/Popover.tsx +11 -11
- package/src/SearchField.tsx +5 -4
- package/src/Separator.tsx +17 -2
- package/src/Table.tsx +65 -22
- package/src/Tabs.tsx +6 -2
- package/src/TagGroup.tsx +15 -6
- package/src/TextField.tsx +8 -7
- package/src/Tooltip.tsx +10 -14
- package/src/Tree.tsx +13 -5
- package/src/context.tsx +34 -0
- package/src/index.ts +2 -2
- package/src/useDragAndDrop.tsx +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAuEM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAoD;AAMxF,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,SAA2B,KAAuB,EAAE,GAAiC;IACjK,+FAA+F;IAC/F,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,qBACE,0DAAC,CAAA,GAAA,6CAAgB;QAAE,uBAAS,0DAAC,CAAA,GAAA,sCAAS,GAAM;OACzC,CAAA,2BAAc,0DAAC;YAAc,OAAO;YAAO,YAAY;YAAY,aAAa;;AAGvF;AAQA,SAAS,oCAAgC,SAAC,KAAK,cAAE,UAAU,EAAE,aAAa,GAAG,EAAwB;IACnG,IAAI,oBAAC,gBAAgB,8BAAE,6BAA6B,iBAAS,SAAS,SAAQ,GAAG;IACjF,IAAI,kBAAC,cAAc,iBAAE,aAAa,kBAAE,cAAc,EAAE,oBAAoB,qBAAqB,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,mDAAwB;IACpI,IAAI,QAAQ,CAAA,GAAA,gCAAW,EAAE;QACvB,GAAG,KAAK;oBACR;QACA,UAAU;wBACV;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,4BAAU,EAAE;QAAC,OAAO;QAAU,aAAa;IAAM;IAChE,IAAI,oBAAC,gBAAgB,gBAAE,YAAY,EAAC,GAAG,MAAM,g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packages/react-aria-components/src/GridList.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaGridListProps, DraggableItemResult, DragPreviewRenderer, DropIndicatorAria, DroppableCollectionResult, FocusScope, ListKeyboardDelegate, mergeProps, useCollator, useFocusRing, useGridList, useGridListItem, useGridListSelectionCheckbox, useHover, useLocale, useVisuallyHidden} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CheckboxContext} from './RSPContexts';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps} from './Collection';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, SlotProps, StyleProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {DragAndDropContext, DropIndicatorContext, DropIndicatorProps, useDndPersistedKeys, useRenderDropIndicator} from './DragAndDrop';\nimport {DragAndDropHooks} from './useDragAndDrop';\nimport {DraggableCollectionState, DroppableCollectionState, Collection as ICollection, ListState, Node, SelectionBehavior, useListState} from 'react-stately';\nimport {filterDOMProps, inertValue, LoadMoreSentinelProps, useLoadMoreSentinel, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, HoverEvents, Key, LinkDOMProps, PressEvents, RefObject} from '@react-types/shared';\nimport {ListStateContext} from './ListBox';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, JSX, ReactNode, useContext, useEffect, useMemo, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface GridListRenderProps {\n /**\n * Whether the list has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the grid list is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the grid list is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the grid list is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean,\n /**\n * Whether the items are arranged in a stack or grid.\n * @selector [data-layout=\"stack | grid\"]\n */\n layout: 'stack' | 'grid',\n /**\n * State of the grid list.\n */\n state: ListState<unknown>\n}\n\nexport interface GridListProps<T> extends Omit<AriaGridListProps<T>, 'children'>, CollectionProps<T>, StyleRenderProps<GridListRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * Whether typeahead navigation is disabled.\n * @default false\n */\n disallowTypeAhead?: boolean,\n /**\n * How multiple selection should behave in the collection.\n * @default \"toggle\"\n */\n selectionBehavior?: SelectionBehavior,\n /** The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the GridList. */\n dragAndDropHooks?: DragAndDropHooks,\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: GridListRenderProps) => ReactNode,\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid'\n}\n\n\nexport const GridListContext = createContext<ContextValue<GridListProps<any>, HTMLDivElement>>(null);\n\n/**\n * A grid list displays a list of interactive items, with support for keyboard navigation,\n * single or multiple selection, and row actions.\n */\nexport const GridList = /*#__PURE__*/ (forwardRef as forwardRefType)(function GridList<T extends object>(props: GridListProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n // Render the portal first so that we have the collection by the time we render the DOM in SSR.\n [props, ref] = useContextProps(props, ref, GridListContext);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <GridListInner props={props} collection={collection} gridListRef={ref} />}\n </CollectionBuilder>\n );\n});\n\ninterface GridListInnerProps<T extends object> {\n props: GridListProps<T>,\n collection: ICollection<Node<object>>,\n gridListRef: RefObject<HTMLDivElement | null>\n}\n\nfunction GridListInner<T extends object>({props, collection, gridListRef: ref}: GridListInnerProps<T>) {\n let {dragAndDropHooks, keyboardNavigationBehavior = 'arrow', layout = 'stack'} = props;\n let {CollectionRoot, isVirtualized, layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate} = useContext(CollectionRendererContext);\n let state = useListState({\n ...props,\n collection,\n children: undefined,\n layoutDelegate\n });\n\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {disabledBehavior, disabledKeys} = state.selectionManager;\n let {direction} = useLocale();\n let keyboardDelegate = useMemo(() => (\n new ListKeyboardDelegate({\n collection,\n collator,\n ref,\n disabledKeys,\n disabledBehavior,\n layoutDelegate,\n layout,\n direction\n })\n ), [collection, ref, layout, disabledKeys, disabledBehavior, layoutDelegate, collator, direction]);\n\n let {gridProps} = useGridList({\n ...props,\n keyboardDelegate,\n // Only tab navigation is supported in grid layout.\n keyboardNavigationBehavior: layout === 'grid' ? 'tab' : keyboardNavigationBehavior,\n isVirtualized,\n shouldSelectOnPressUp: props.shouldSelectOnPressUp\n }, state, ref);\n\n let selectionManager = state.selectionManager;\n let isListDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n let isListDroppable = !!dragAndDropHooks?.useDroppableCollectionState;\n let dragHooksProvided = useRef(isListDraggable);\n let dropHooksProvided = useRef(isListDroppable);\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n if (dragHooksProvided.current !== isListDraggable) {\n console.warn('Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n if (dropHooksProvided.current !== isListDroppable) {\n console.warn('Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n }, [isListDraggable, isListDroppable]);\n\n let dragState: DraggableCollectionState | undefined = undefined;\n let dropState: DroppableCollectionState | undefined = undefined;\n let droppableCollection: DroppableCollectionResult | undefined = undefined;\n let isRootDropTarget = false;\n let dragPreview: JSX.Element | null = null;\n let preview = useRef<DragPreviewRenderer>(null);\n\n if (isListDraggable && dragAndDropHooks) {\n dragState = dragAndDropHooks.useDraggableCollectionState!({\n collection,\n selectionManager,\n preview: dragAndDropHooks.renderDragPreview ? preview : undefined\n });\n dragAndDropHooks.useDraggableCollection!({}, dragState, ref);\n\n let DragPreview = dragAndDropHooks.DragPreview!;\n dragPreview = dragAndDropHooks.renderDragPreview\n ? <DragPreview ref={preview}>{dragAndDropHooks.renderDragPreview}</DragPreview>\n : null;\n }\n\n if (isListDroppable && dragAndDropHooks) {\n dropState = dragAndDropHooks.useDroppableCollectionState!({\n collection,\n selectionManager\n });\n\n let keyboardDelegate = new ListKeyboardDelegate({\n collection,\n disabledKeys: selectionManager.disabledKeys,\n disabledBehavior: selectionManager.disabledBehavior,\n ref\n });\n let dropTargetDelegate = dragAndDropHooks.dropTargetDelegate || ctxDropTargetDelegate || new dragAndDropHooks.ListDropTargetDelegate(collection, ref, {layout, direction});\n droppableCollection = dragAndDropHooks.useDroppableCollection!({\n keyboardDelegate,\n dropTargetDelegate\n }, dropState, ref);\n\n isRootDropTarget = dropState.isDropTarget({type: 'root'});\n }\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let isEmpty = state.collection.size === 0;\n let renderValues = {\n isDropTarget: isRootDropTarget,\n isEmpty,\n isFocused,\n isFocusVisible,\n layout,\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-GridList',\n values: renderValues\n });\n\n let emptyState: ReactNode = null;\n let emptyStatePropOverrides: HTMLAttributes<HTMLElement> | null = null;\n\n if (isEmpty && props.renderEmptyState) {\n let content = props.renderEmptyState(renderValues);\n emptyState = (\n <div role=\"row\" aria-rowindex={1} style={{display: 'contents'}}>\n <div role=\"gridcell\" style={{display: 'contents'}}>\n {content}\n </div>\n </div>\n );\n }\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <FocusScope>\n <div\n {...mergeProps(DOMProps, renderProps, gridProps, focusProps, droppableCollection?.collectionProps, emptyStatePropOverrides)}\n ref={ref}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-drop-target={isRootDropTarget || undefined}\n data-empty={isEmpty || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-layout={layout}>\n <Provider\n values={[\n [ListStateContext, state],\n [DragAndDropContext, {dragAndDropHooks, dragState, dropState}],\n [DropIndicatorContext, {render: GridListDropIndicatorWrapper}]\n ]}>\n {isListDroppable && <RootDropIndicator />}\n <CollectionRoot\n collection={collection}\n scrollRef={ref}\n persistedKeys={useDndPersistedKeys(selectionManager, dragAndDropHooks, dropState)}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </Provider>\n {emptyState}\n {dragPreview}\n </div>\n </FocusScope>\n );\n}\n\nexport interface GridListItemRenderProps extends ItemRenderProps {}\n\nexport interface GridListItemProps<T = object> extends RenderProps<GridListItemRenderProps>, LinkDOMProps, HoverEvents, PressEvents, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void\n}\n\n/**\n * A GridListItem represents an individual item in a GridList.\n */\nexport const GridListItem = /*#__PURE__*/ createLeafComponent('item', function GridListItem<T extends object>(props: GridListItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dragState, dropState} = useContext(DragAndDropContext);\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {isVirtualized} = useContext(CollectionRendererContext);\n let {rowProps, gridCellProps, descriptionProps, ...states} = useGridListItem(\n {\n node: item,\n shouldSelectOnPressUp: !!dragState,\n isVirtualized\n },\n state,\n ref\n );\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let {isFocusVisible, focusProps} = useFocusRing();\n let {checkboxProps} = useGridListSelectionCheckbox(\n {key: item.key},\n state\n );\n\n let buttonProps = state.selectionManager.disabledBehavior === 'all' && states.isDisabled ? {isDisabled: true} : {};\n\n let draggableItem: DraggableItemResult | null = null;\n if (dragState && dragAndDropHooks) {\n draggableItem = dragAndDropHooks.useDraggableItem!({key: item.key, hasDragButton: true}, dragState);\n }\n\n let dropIndicator: DropIndicatorAria | null = null;\n let dropIndicatorRef = useRef<HTMLDivElement>(null);\n let {visuallyHiddenProps} = useVisuallyHidden();\n if (dropState && dragAndDropHooks) {\n dropIndicator = dragAndDropHooks.useDropIndicator!({\n target: {type: 'item', key: item.key, dropPosition: 'on'}\n }, dropState, dropIndicatorRef);\n }\n\n let isDragging = dragState && dragState.isDragging(item.key);\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-GridListItem',\n values: {\n ...states,\n isHovered,\n isFocusVisible,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n allowsDragging: !!dragState,\n isDragging,\n isDropTarget: dropIndicator?.isDropTarget\n }\n });\n\n let dragButtonRef = useRef<HTMLButtonElement>(null);\n useEffect(() => {\n if (dragState && !dragButtonRef.current) {\n console.warn('Draggable items in a GridList must contain a <Button slot=\"drag\"> element so that keyboard and screen reader users can drag them.');\n }\n // eslint-disable-next-line\n }, []);\n\n useEffect(() => {\n if (!item.textValue && process.env.NODE_ENV !== 'production') {\n console.warn('A `textValue` prop is required for <GridListItem> elements with non-plain text children in order to support accessibility features such as type to select.');\n }\n }, [item.textValue]);\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <>\n {dropIndicator && !dropIndicator.isHidden &&\n <div role=\"row\" style={{position: 'absolute'}}>\n <div role=\"gridcell\">\n <div role=\"button\" {...visuallyHiddenProps} {...dropIndicator?.dropIndicatorProps} ref={dropIndicatorRef} />\n </div>\n </div>\n }\n <div\n {...mergeProps(DOMProps, renderProps, rowProps, focusProps, hoverProps, draggableItem?.dragProps)}\n ref={ref}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-allows-dragging={!!dragState || undefined}\n data-dragging={isDragging || undefined}\n data-drop-target={dropIndicator?.isDropTarget || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [CheckboxContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n selection: checkboxProps\n }\n }],\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: buttonProps,\n drag: {\n ...draggableItem?.dragButtonProps,\n ref: dragButtonRef,\n style: {\n pointerEvents: 'none'\n }\n }\n }\n }],\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n description: descriptionProps\n }\n }],\n [CollectionRendererContext, DefaultCollectionRenderer],\n [ListStateContext, null]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </div>\n </>\n );\n});\n\nfunction GridListDropIndicatorWrapper(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n ref = useObjectRef(ref);\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext);\n let buttonRef = useRef<HTMLDivElement>(null);\n let {dropIndicatorProps, isHidden, isDropTarget} = dragAndDropHooks!.useDropIndicator!(\n props,\n dropState!,\n buttonRef\n );\n\n if (isHidden) {\n return null;\n }\n\n return (\n <GridListDropIndicatorForwardRef {...props} dropIndicatorProps={dropIndicatorProps} isDropTarget={isDropTarget} buttonRef={buttonRef} ref={ref} />\n );\n}\n\ninterface GridListDropIndicatorProps extends DropIndicatorProps {\n dropIndicatorProps: React.HTMLAttributes<HTMLElement>,\n isDropTarget: boolean,\n buttonRef: RefObject<HTMLDivElement | null>\n}\n\nfunction GridListDropIndicator(props: GridListDropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n let {\n dropIndicatorProps,\n isDropTarget,\n buttonRef,\n ...otherProps\n } = props;\n\n let {visuallyHiddenProps} = useVisuallyHidden();\n let renderProps = useRenderProps({\n ...otherProps,\n defaultClassName: 'react-aria-DropIndicator',\n values: {\n isDropTarget\n }\n });\n\n return (\n <div\n {...renderProps}\n role=\"row\"\n ref={ref as RefObject<HTMLDivElement | null>}\n data-drop-target={isDropTarget || undefined}>\n <div role=\"gridcell\">\n <div {...visuallyHiddenProps} role=\"button\" {...dropIndicatorProps} ref={buttonRef} />\n {renderProps.children}\n </div>\n </div>\n );\n}\n\nconst GridListDropIndicatorForwardRef = forwardRef(GridListDropIndicator);\n\nfunction RootDropIndicator() {\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext);\n let ref = useRef<HTMLDivElement>(null);\n let {dropIndicatorProps} = dragAndDropHooks!.useDropIndicator!({\n target: {type: 'root'}\n }, dropState!, ref);\n let isDropTarget = dropState!.isDropTarget({type: 'root'});\n let {visuallyHiddenProps} = useVisuallyHidden();\n\n if (!isDropTarget && dropIndicatorProps['aria-hidden']) {\n return null;\n }\n\n return (\n <div role=\"row\" aria-hidden={dropIndicatorProps['aria-hidden']} style={{position: 'absolute'}}>\n <div role=\"gridcell\">\n <div role=\"button\" {...visuallyHiddenProps} {...dropIndicatorProps} ref={ref} />\n </div>\n </div>\n );\n}\n\nexport interface GridListLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'collection'>, StyleProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The load more spinner to render when loading additional items.\n */\n children?: ReactNode,\n /**\n * Whether or not the loading spinner should be rendered or not.\n */\n isLoading?: boolean\n}\n\nexport const GridListLoadMoreItem = createLeafComponent('loader', function GridListLoadingIndicator(props: GridListLoadMoreItemProps, ref: ForwardedRef<HTMLDivElement>, item: Node<object>) {\n let state = useContext(ListStateContext)!;\n let {isVirtualized} = useContext(CollectionRendererContext);\n let {isLoading, onLoadMore, scrollOffset, ...otherProps} = props;\n\n let sentinelRef = useRef(null);\n let memoedLoadMoreProps = useMemo(() => ({\n onLoadMore,\n collection: state?.collection,\n sentinelRef,\n scrollOffset\n }), [onLoadMore, scrollOffset, state?.collection]);\n useLoadMoreSentinel(memoedLoadMoreProps, sentinelRef);\n\n let renderProps = useRenderProps({\n ...otherProps,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-GridListLoadingIndicator',\n values: null\n });\n // For now don't include aria-posinset and aria-setsize on loader since they aren't keyboard focusable\n // Arguably shouldn't include them ever since it might be confusing to the user to include the loaders as part of the\n // item count\n\n return (\n <>\n {/* Alway render the sentinel. For now onus is on the user for styling when using flex + gap (this would introduce a gap even though it doesn't take room) */}\n {/* @ts-ignore - compatibility with React < 19 */}\n <div style={{position: 'relative', width: 0, height: 0}} inert={inertValue(true)} >\n <div data-testid=\"loadMoreSentinel\" ref={sentinelRef} style={{position: 'absolute', height: 1, width: 1}} />\n </div>\n {isLoading && renderProps.children && (\n <div\n {...renderProps}\n {...filterDOMProps(props, {global: true})}\n role=\"row\"\n ref={ref}>\n <div\n aria-colindex={isVirtualized ? 1 : undefined}\n role=\"gridcell\">\n {renderProps.children}\n </div>\n </div>\n )}\n </>\n );\n});\n"],"names":[],"version":3,"file":"GridList.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAyEM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAoD;AAMxF,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,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DAAwB,CAAA,GAAA,0BAAY,EAAsC;AAEzE,MAAM,4CAAiB,WAAW,GAAG,CAAA,GAAA,+CAAkB,EAAE,CAAA,GAAA,sCAAS,GAAG,SAAS,OAAO,KAAkC,EAAE,GAA8B;IAC5J,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK,CAAA,GAAA,uCAAY;IACvD,IAAI,iBAAiB,CAAA,GAAA,uBAAS,EAAE;IAEhC,qBACE,0DAAC;QAAO,WAAU;QAA4B,KAAK;QAAM,GAAG,KAAK;qBAC/D,0DAAC;QAAK,GAAG,cAAc;QAAE,OAAO;YAAC,SAAS;QAAU;OACjD,MAAM,QAAQ;AAIvB","sources":["packages/react-aria-components/src/GridList.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaGridListProps, DraggableItemResult, DragPreviewRenderer, DropIndicatorAria, DroppableCollectionResult, FocusScope, ListKeyboardDelegate, mergeProps, useCollator, useFocusRing, useGridList, useGridListItem, useGridListSection, useGridListSelectionCheckbox, useHover, useLocale, useVisuallyHidden} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CheckboxContext} from './RSPContexts';\nimport {Collection, CollectionBuilder, createBranchComponent, createLeafComponent, HeaderNode, ItemNode, LoaderNode, SectionNode} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps, SectionProps} from './Collection';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, SlotProps, StyleProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {DragAndDropContext, DropIndicatorContext, DropIndicatorProps, useDndPersistedKeys, useRenderDropIndicator} from './DragAndDrop';\nimport {DragAndDropHooks} from './useDragAndDrop';\nimport {DraggableCollectionState, DroppableCollectionState, Collection as ICollection, ListState, Node, SelectionBehavior, UNSTABLE_useFilteredListState, useListState} from 'react-stately';\nimport {FieldInputContext, SelectableCollectionContext} from './context';\nimport {filterDOMProps, inertValue, LoadMoreSentinelProps, useLoadMoreSentinel, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, HoverEvents, Key, LinkDOMProps, PressEvents, RefObject} from '@react-types/shared';\nimport {HeaderContext} from './Header';\nimport {ListStateContext} from './ListBox';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, JSX, ReactNode, useContext, useEffect, useMemo, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface GridListRenderProps {\n /**\n * Whether the list has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the grid list is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the grid list is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the grid list is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean,\n /**\n * Whether the items are arranged in a stack or grid.\n * @selector [data-layout=\"stack | grid\"]\n */\n layout: 'stack' | 'grid',\n /**\n * State of the grid list.\n */\n state: ListState<unknown>\n}\n\nexport interface GridListProps<T> extends Omit<AriaGridListProps<T>, 'children'>, CollectionProps<T>, StyleRenderProps<GridListRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * Whether typeahead navigation is disabled.\n * @default false\n */\n disallowTypeAhead?: boolean,\n /**\n * How multiple selection should behave in the collection.\n * @default \"toggle\"\n */\n selectionBehavior?: SelectionBehavior,\n /** The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the GridList. */\n dragAndDropHooks?: DragAndDropHooks<NoInfer<T>>,\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: GridListRenderProps) => ReactNode,\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid'\n}\n\n\nexport const GridListContext = createContext<ContextValue<GridListProps<any>, HTMLDivElement>>(null);\n\n/**\n * A grid list displays a list of interactive items, with support for keyboard navigation,\n * single or multiple selection, and row actions.\n */\nexport const GridList = /*#__PURE__*/ (forwardRef as forwardRefType)(function GridList<T extends object>(props: GridListProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n // Render the portal first so that we have the collection by the time we render the DOM in SSR.\n [props, ref] = useContextProps(props, ref, GridListContext);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <GridListInner props={props} collection={collection} gridListRef={ref} />}\n </CollectionBuilder>\n );\n});\n\ninterface GridListInnerProps<T extends object> {\n props: GridListProps<T>,\n collection: ICollection<Node<object>>,\n gridListRef: RefObject<HTMLDivElement | null>\n}\n\nfunction GridListInner<T extends object>({props, collection, gridListRef: ref}: GridListInnerProps<T>) {\n // TODO: for now, don't grab collection ref and collectionProps from the autocomplete, rely on the user tabbing to the gridlist\n // figure out if we want to support virtual focus for grids when wrapped in an autocomplete\n let contextProps;\n [contextProps] = useContextProps({}, null, SelectableCollectionContext);\n let {filter, ...collectionProps} = contextProps;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {shouldUseVirtualFocus, disallowTypeAhead, ...DOMCollectionProps} = collectionProps || {};\n let {dragAndDropHooks, keyboardNavigationBehavior = 'arrow', layout = 'stack'} = props;\n let {CollectionRoot, isVirtualized, layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate} = useContext(CollectionRendererContext);\n let gridlistState = useListState({\n ...props,\n collection,\n children: undefined,\n layoutDelegate\n });\n\n let filteredState = UNSTABLE_useFilteredListState(gridlistState, filter);\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {disabledBehavior, disabledKeys} = filteredState.selectionManager;\n let {direction} = useLocale();\n let keyboardDelegate = useMemo(() => (\n new ListKeyboardDelegate({\n collection: filteredState.collection,\n collator,\n ref,\n disabledKeys,\n disabledBehavior,\n layoutDelegate,\n layout,\n direction\n })\n ), [filteredState.collection, ref, layout, disabledKeys, disabledBehavior, layoutDelegate, collator, direction]);\n\n let {gridProps} = useGridList({\n ...props,\n ...DOMCollectionProps,\n keyboardDelegate,\n // Only tab navigation is supported in grid layout.\n keyboardNavigationBehavior: layout === 'grid' ? 'tab' : keyboardNavigationBehavior,\n isVirtualized,\n shouldSelectOnPressUp: props.shouldSelectOnPressUp\n }, filteredState, ref);\n\n let selectionManager = filteredState.selectionManager;\n let isListDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n let isListDroppable = !!dragAndDropHooks?.useDroppableCollectionState;\n let dragHooksProvided = useRef(isListDraggable);\n let dropHooksProvided = useRef(isListDroppable);\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n if (dragHooksProvided.current !== isListDraggable) {\n console.warn('Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n if (dropHooksProvided.current !== isListDroppable) {\n console.warn('Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n }, [isListDraggable, isListDroppable]);\n\n let dragState: DraggableCollectionState | undefined = undefined;\n let dropState: DroppableCollectionState | undefined = undefined;\n let droppableCollection: DroppableCollectionResult | undefined = undefined;\n let isRootDropTarget = false;\n let dragPreview: JSX.Element | null = null;\n let preview = useRef<DragPreviewRenderer>(null);\n\n if (isListDraggable && dragAndDropHooks) {\n dragState = dragAndDropHooks.useDraggableCollectionState!({\n collection: filteredState.collection,\n selectionManager,\n preview: dragAndDropHooks.renderDragPreview ? preview : undefined\n });\n dragAndDropHooks.useDraggableCollection!({}, dragState, ref);\n\n let DragPreview = dragAndDropHooks.DragPreview!;\n dragPreview = dragAndDropHooks.renderDragPreview\n ? <DragPreview ref={preview}>{dragAndDropHooks.renderDragPreview}</DragPreview>\n : null;\n }\n\n if (isListDroppable && dragAndDropHooks) {\n dropState = dragAndDropHooks.useDroppableCollectionState!({\n collection: filteredState.collection,\n selectionManager\n });\n\n let keyboardDelegate = new ListKeyboardDelegate({\n collection: filteredState.collection,\n disabledKeys: selectionManager.disabledKeys,\n disabledBehavior: selectionManager.disabledBehavior,\n ref\n });\n let dropTargetDelegate = dragAndDropHooks.dropTargetDelegate || ctxDropTargetDelegate || new dragAndDropHooks.ListDropTargetDelegate(collection, ref, {layout, direction});\n droppableCollection = dragAndDropHooks.useDroppableCollection!({\n keyboardDelegate,\n dropTargetDelegate\n }, dropState, ref);\n\n isRootDropTarget = dropState.isDropTarget({type: 'root'});\n }\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let isEmpty = filteredState.collection.size === 0;\n let renderValues = {\n isDropTarget: isRootDropTarget,\n isEmpty,\n isFocused,\n isFocusVisible,\n layout,\n state: filteredState\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-GridList',\n values: renderValues\n });\n\n let emptyState: ReactNode = null;\n let emptyStatePropOverrides: HTMLAttributes<HTMLElement> | null = null;\n\n if (isEmpty && props.renderEmptyState) {\n let content = props.renderEmptyState(renderValues);\n emptyState = (\n <div role=\"row\" aria-rowindex={1} style={{display: 'contents'}}>\n <div role=\"gridcell\" style={{display: 'contents'}}>\n {content}\n </div>\n </div>\n );\n }\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <FocusScope>\n <div\n {...mergeProps(DOMProps, renderProps, gridProps, focusProps, droppableCollection?.collectionProps, emptyStatePropOverrides)}\n ref={ref}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-drop-target={isRootDropTarget || undefined}\n data-empty={isEmpty || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-layout={layout}>\n <Provider\n values={[\n [ListStateContext, filteredState],\n [DragAndDropContext, {dragAndDropHooks, dragState, dropState}],\n [DropIndicatorContext, {render: GridListDropIndicatorWrapper}]\n ]}>\n {isListDroppable && <RootDropIndicator />}\n <CollectionRoot\n collection={filteredState.collection}\n scrollRef={ref}\n persistedKeys={useDndPersistedKeys(selectionManager, dragAndDropHooks, dropState)}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </Provider>\n {emptyState}\n {dragPreview}\n </div>\n </FocusScope>\n );\n}\n\nexport interface GridListItemRenderProps extends ItemRenderProps {}\n\nexport interface GridListItemProps<T = object> extends RenderProps<GridListItemRenderProps>, LinkDOMProps, HoverEvents, PressEvents, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void\n}\n\n/**\n * A GridListItem represents an individual item in a GridList.\n */\nexport const GridListItem = /*#__PURE__*/ createLeafComponent(ItemNode, function GridListItem<T extends object>(props: GridListItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dragState, dropState} = useContext(DragAndDropContext);\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {isVirtualized} = useContext(CollectionRendererContext);\n let {rowProps, gridCellProps, descriptionProps, ...states} = useGridListItem(\n {\n node: item,\n shouldSelectOnPressUp: !!dragState,\n isVirtualized\n },\n state,\n ref\n );\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let {isFocusVisible, focusProps} = useFocusRing();\n let {checkboxProps} = useGridListSelectionCheckbox(\n {key: item.key},\n state\n );\n\n let buttonProps = state.selectionManager.disabledBehavior === 'all' && states.isDisabled ? {isDisabled: true} : {};\n\n let draggableItem: DraggableItemResult | null = null;\n if (dragState && dragAndDropHooks) {\n draggableItem = dragAndDropHooks.useDraggableItem!({key: item.key, hasDragButton: true}, dragState);\n }\n\n let dropIndicator: DropIndicatorAria | null = null;\n let dropIndicatorRef = useRef<HTMLDivElement>(null);\n let {visuallyHiddenProps} = useVisuallyHidden();\n if (dropState && dragAndDropHooks) {\n dropIndicator = dragAndDropHooks.useDropIndicator!({\n target: {type: 'item', key: item.key, dropPosition: 'on'}\n }, dropState, dropIndicatorRef);\n }\n\n let isDragging = dragState && dragState.isDragging(item.key);\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-GridListItem',\n values: {\n ...states,\n isHovered,\n isFocusVisible,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n allowsDragging: !!dragState,\n isDragging,\n isDropTarget: dropIndicator?.isDropTarget\n }\n });\n\n let dragButtonRef = useRef<HTMLButtonElement>(null);\n useEffect(() => {\n if (dragState && !dragButtonRef.current) {\n console.warn('Draggable items in a GridList must contain a <Button slot=\"drag\"> element so that keyboard and screen reader users can drag them.');\n }\n // eslint-disable-next-line\n }, []);\n\n useEffect(() => {\n if (!item.textValue && process.env.NODE_ENV !== 'production') {\n console.warn('A `textValue` prop is required for <GridListItem> elements with non-plain text children in order to support accessibility features such as type to select.');\n }\n }, [item.textValue]);\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <>\n {dropIndicator && !dropIndicator.isHidden &&\n <div role=\"row\" style={{position: 'absolute'}}>\n <div role=\"gridcell\">\n <div role=\"button\" {...visuallyHiddenProps} {...dropIndicator?.dropIndicatorProps} ref={dropIndicatorRef} />\n </div>\n </div>\n }\n <div\n {...mergeProps(DOMProps, renderProps, rowProps, focusProps, hoverProps, draggableItem?.dragProps)}\n ref={ref}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-allows-dragging={!!dragState || undefined}\n data-dragging={isDragging || undefined}\n data-drop-target={dropIndicator?.isDropTarget || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [CheckboxContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n selection: checkboxProps\n }\n }],\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: buttonProps,\n drag: {\n ...draggableItem?.dragButtonProps,\n ref: dragButtonRef,\n style: {\n pointerEvents: 'none'\n }\n }\n }\n }],\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n description: descriptionProps\n }\n }],\n [CollectionRendererContext, DefaultCollectionRenderer],\n [ListStateContext, null],\n [SelectableCollectionContext, null],\n [FieldInputContext, null]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </div>\n </>\n );\n});\n\nfunction GridListDropIndicatorWrapper(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n ref = useObjectRef(ref);\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext);\n let buttonRef = useRef<HTMLDivElement>(null);\n let {dropIndicatorProps, isHidden, isDropTarget} = dragAndDropHooks!.useDropIndicator!(\n props,\n dropState!,\n buttonRef\n );\n\n if (isHidden) {\n return null;\n }\n\n return (\n <GridListDropIndicatorForwardRef {...props} dropIndicatorProps={dropIndicatorProps} isDropTarget={isDropTarget} buttonRef={buttonRef} ref={ref} />\n );\n}\n\ninterface GridListDropIndicatorProps extends DropIndicatorProps {\n dropIndicatorProps: React.HTMLAttributes<HTMLElement>,\n isDropTarget: boolean,\n buttonRef: RefObject<HTMLDivElement | null>\n}\n\nfunction GridListDropIndicator(props: GridListDropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n let {\n dropIndicatorProps,\n isDropTarget,\n buttonRef,\n ...otherProps\n } = props;\n\n let {visuallyHiddenProps} = useVisuallyHidden();\n let renderProps = useRenderProps({\n ...otherProps,\n defaultClassName: 'react-aria-DropIndicator',\n values: {\n isDropTarget\n }\n });\n\n return (\n <div\n {...renderProps}\n role=\"row\"\n ref={ref as RefObject<HTMLDivElement | null>}\n data-drop-target={isDropTarget || undefined}>\n <div role=\"gridcell\">\n <div {...visuallyHiddenProps} role=\"button\" {...dropIndicatorProps} ref={buttonRef} />\n {renderProps.children}\n </div>\n </div>\n );\n}\n\nconst GridListDropIndicatorForwardRef = forwardRef(GridListDropIndicator);\n\nfunction RootDropIndicator() {\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext);\n let ref = useRef<HTMLDivElement>(null);\n let {dropIndicatorProps} = dragAndDropHooks!.useDropIndicator!({\n target: {type: 'root'}\n }, dropState!, ref);\n let isDropTarget = dropState!.isDropTarget({type: 'root'});\n let {visuallyHiddenProps} = useVisuallyHidden();\n\n if (!isDropTarget && dropIndicatorProps['aria-hidden']) {\n return null;\n }\n\n return (\n <div role=\"row\" aria-hidden={dropIndicatorProps['aria-hidden']} style={{position: 'absolute'}}>\n <div role=\"gridcell\">\n <div role=\"button\" {...visuallyHiddenProps} {...dropIndicatorProps} ref={ref} />\n </div>\n </div>\n );\n}\n\nexport interface GridListLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'collection'>, StyleProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The load more spinner to render when loading additional items.\n */\n children?: ReactNode,\n /**\n * Whether or not the loading spinner should be rendered or not.\n */\n isLoading?: boolean\n}\n\nexport const GridListLoadMoreItem = createLeafComponent(LoaderNode, function GridListLoadingIndicator(props: GridListLoadMoreItemProps, ref: ForwardedRef<HTMLDivElement>, item: Node<object>) {\n let state = useContext(ListStateContext)!;\n let {isVirtualized} = useContext(CollectionRendererContext);\n let {isLoading, onLoadMore, scrollOffset, ...otherProps} = props;\n\n let sentinelRef = useRef(null);\n let memoedLoadMoreProps = useMemo(() => ({\n onLoadMore,\n collection: state?.collection,\n sentinelRef,\n scrollOffset\n }), [onLoadMore, scrollOffset, state?.collection]);\n useLoadMoreSentinel(memoedLoadMoreProps, sentinelRef);\n\n let renderProps = useRenderProps({\n ...otherProps,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-GridListLoadingIndicator',\n values: null\n });\n // For now don't include aria-posinset and aria-setsize on loader since they aren't keyboard focusable\n // Arguably shouldn't include them ever since it might be confusing to the user to include the loaders as part of the\n // item count\n\n return (\n <>\n {/* Alway render the sentinel. For now onus is on the user for styling when using flex + gap (this would introduce a gap even though it doesn't take room) */}\n {/* @ts-ignore - compatibility with React < 19 */}\n <div style={{position: 'relative', width: 0, height: 0}} inert={inertValue(true)} >\n <div data-testid=\"loadMoreSentinel\" ref={sentinelRef} style={{position: 'absolute', height: 1, width: 1}} />\n </div>\n {isLoading && renderProps.children && (\n <div\n {...renderProps}\n {...filterDOMProps(props, {global: true})}\n role=\"row\"\n ref={ref}>\n <div\n aria-colindex={isVirtualized ? 1 : undefined}\n role=\"gridcell\">\n {renderProps.children}\n </div>\n </div>\n )}\n </>\n );\n});\n\nexport interface GridListSectionProps<T> extends SectionProps<T> {}\n\n/**\n * A GridListSection represents a section within a GridList.\n */\nexport const GridListSection = /*#__PURE__*/ createBranchComponent(SectionNode, <T extends object>(props: GridListSectionProps<T>, ref: ForwardedRef<HTMLElement>, item: Node<T>) => {\n let state = useContext(ListStateContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let headingRef = useRef(null);\n ref = useObjectRef<HTMLElement>(ref);\n let {rowHeaderProps, rowProps, rowGroupProps} = useGridListSection({\n 'aria-label': props['aria-label'] ?? undefined\n }, state, ref);\n let renderProps = useRenderProps({\n defaultClassName: 'react-aria-GridListSection',\n className: props.className,\n style: props.style,\n values: {}\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n\n return (\n <section\n {...mergeProps(DOMProps, renderProps, rowGroupProps)}\n ref={ref}>\n <Provider\n values={[\n [HeaderContext, {...rowProps, ref: headingRef}],\n [GridListHeaderContext, {...rowHeaderProps}]\n ]}>\n <CollectionBranch\n collection={state.collection}\n parent={item} />\n </Provider>\n </section>\n );\n});\n\nconst GridListHeaderContext = createContext<HTMLAttributes<HTMLElement> | null>(null);\n\nexport const GridListHeader = /*#__PURE__*/ createLeafComponent(HeaderNode, function Header(props: HTMLAttributes<HTMLElement>, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, HeaderContext);\n let rowHeaderProps = useContext(GridListHeaderContext);\n\n return (\n <header className=\"react-aria-GridListHeader\" ref={ref} {...props}>\n <div {...rowHeaderProps} style={{display: 'contents'}}>\n {props.children}\n </div>\n </header>\n );\n});\n"],"names":[],"version":3,"file":"GridList.main.js.map"}
|
package/dist/GridList.mjs
CHANGED
|
@@ -3,11 +3,13 @@ import {CheckboxContext as $4e85f108e88277b8$export$b085522c77523c51} from "./RS
|
|
|
3
3
|
import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5, DefaultCollectionRenderer as $7135fc7d473fd974$export$a164736487e3f0ae} from "./Collection.mjs";
|
|
4
4
|
import {DEFAULT_SLOT as $64fa3d84918910a7$export$c62b8e45d58ddad9, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.mjs";
|
|
5
5
|
import {DragAndDropContext as $612b8eb6cb90e02d$export$d188a835a7bc5783, DropIndicatorContext as $612b8eb6cb90e02d$export$f55761759794cf55, useDndPersistedKeys as $612b8eb6cb90e02d$export$d1e8e3fbb7461f6, useRenderDropIndicator as $612b8eb6cb90e02d$export$971707d8a129a1f7} from "./DragAndDrop.mjs";
|
|
6
|
+
import {FieldInputContext as $8e6cc465cc68f603$export$698f465ec27e93df, SelectableCollectionContext as $8e6cc465cc68f603$export$b0d3ecf7112093a7} from "./context.mjs";
|
|
7
|
+
import {HeaderContext as $72a5793c14baf454$export$e0e4026c12a8bdbb} from "./Header.mjs";
|
|
6
8
|
import {ListStateContext as $eed445e0843c11d0$export$7c5906fe4f1f2af2} from "./ListBox.mjs";
|
|
7
9
|
import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.mjs";
|
|
8
|
-
import {useCollator as $jTmF7$useCollator, useLocale as $jTmF7$useLocale, ListKeyboardDelegate as $jTmF7$ListKeyboardDelegate, useGridList as $jTmF7$useGridList, useFocusRing as $jTmF7$useFocusRing, FocusScope as $jTmF7$FocusScope, mergeProps as $jTmF7$mergeProps, useGridListItem as $jTmF7$useGridListItem, useHover as $jTmF7$useHover, useGridListSelectionCheckbox as $jTmF7$useGridListSelectionCheckbox, useVisuallyHidden as $jTmF7$useVisuallyHidden} from "react-aria";
|
|
9
|
-
import {CollectionBuilder as $jTmF7$CollectionBuilder, Collection as $jTmF7$Collection, createLeafComponent as $jTmF7$createLeafComponent} from "@react-aria/collections";
|
|
10
|
-
import {useListState as $jTmF7$useListState} from "react-stately";
|
|
10
|
+
import {useCollator as $jTmF7$useCollator, useLocale as $jTmF7$useLocale, ListKeyboardDelegate as $jTmF7$ListKeyboardDelegate, useGridList as $jTmF7$useGridList, useFocusRing as $jTmF7$useFocusRing, FocusScope as $jTmF7$FocusScope, mergeProps as $jTmF7$mergeProps, useGridListItem as $jTmF7$useGridListItem, useHover as $jTmF7$useHover, useGridListSelectionCheckbox as $jTmF7$useGridListSelectionCheckbox, useVisuallyHidden as $jTmF7$useVisuallyHidden, useGridListSection as $jTmF7$useGridListSection} from "react-aria";
|
|
11
|
+
import {CollectionBuilder as $jTmF7$CollectionBuilder, Collection as $jTmF7$Collection, createLeafComponent as $jTmF7$createLeafComponent, ItemNode as $jTmF7$ItemNode, LoaderNode as $jTmF7$LoaderNode, createBranchComponent as $jTmF7$createBranchComponent, SectionNode as $jTmF7$SectionNode, HeaderNode as $jTmF7$HeaderNode} from "@react-aria/collections";
|
|
12
|
+
import {useListState as $jTmF7$useListState, UNSTABLE_useFilteredListState as $jTmF7$UNSTABLE_useFilteredListState} from "react-stately";
|
|
11
13
|
import {filterDOMProps as $jTmF7$filterDOMProps, useObjectRef as $jTmF7$useObjectRef, useLoadMoreSentinel as $jTmF7$useLoadMoreSentinel, inertValue as $jTmF7$inertValue} from "@react-aria/utils";
|
|
12
14
|
import $jTmF7$react, {createContext as $jTmF7$createContext, forwardRef as $jTmF7$forwardRef, useContext as $jTmF7$useContext, useMemo as $jTmF7$useMemo, useRef as $jTmF7$useRef, useEffect as $jTmF7$useEffect} from "react";
|
|
13
15
|
|
|
@@ -33,6 +35,8 @@ import $jTmF7$react, {createContext as $jTmF7$createContext, forwardRef as $jTmF
|
|
|
33
35
|
|
|
34
36
|
|
|
35
37
|
|
|
38
|
+
|
|
39
|
+
|
|
36
40
|
const $72e60046c03fbe42$export$54fe942636b6416d = /*#__PURE__*/ (0, $jTmF7$createContext)(null);
|
|
37
41
|
const $72e60046c03fbe42$export$a7bfbda1311ca015 = /*#__PURE__*/ (0, $jTmF7$forwardRef)(function GridList(props, ref) {
|
|
38
42
|
// Render the portal first so that we have the collection by the time we render the DOM in SSR.
|
|
@@ -46,22 +50,30 @@ const $72e60046c03fbe42$export$a7bfbda1311ca015 = /*#__PURE__*/ (0, $jTmF7$forwa
|
|
|
46
50
|
}));
|
|
47
51
|
});
|
|
48
52
|
function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collection, gridListRef: ref }) {
|
|
53
|
+
// TODO: for now, don't grab collection ref and collectionProps from the autocomplete, rely on the user tabbing to the gridlist
|
|
54
|
+
// figure out if we want to support virtual focus for grids when wrapped in an autocomplete
|
|
55
|
+
let contextProps;
|
|
56
|
+
[contextProps] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)({}, null, (0, $8e6cc465cc68f603$export$b0d3ecf7112093a7));
|
|
57
|
+
let { filter: filter, ...collectionProps } = contextProps;
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
59
|
+
let { shouldUseVirtualFocus: shouldUseVirtualFocus, disallowTypeAhead: disallowTypeAhead, ...DOMCollectionProps } = collectionProps || {};
|
|
49
60
|
let { dragAndDropHooks: dragAndDropHooks, keyboardNavigationBehavior: keyboardNavigationBehavior = 'arrow', layout: layout = 'stack' } = props;
|
|
50
61
|
let { CollectionRoot: CollectionRoot, isVirtualized: isVirtualized, layoutDelegate: layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate } = (0, $jTmF7$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
51
|
-
let
|
|
62
|
+
let gridlistState = (0, $jTmF7$useListState)({
|
|
52
63
|
...props,
|
|
53
64
|
collection: collection,
|
|
54
65
|
children: undefined,
|
|
55
66
|
layoutDelegate: layoutDelegate
|
|
56
67
|
});
|
|
68
|
+
let filteredState = (0, $jTmF7$UNSTABLE_useFilteredListState)(gridlistState, filter);
|
|
57
69
|
let collator = (0, $jTmF7$useCollator)({
|
|
58
70
|
usage: 'search',
|
|
59
71
|
sensitivity: 'base'
|
|
60
72
|
});
|
|
61
|
-
let { disabledBehavior: disabledBehavior, disabledKeys: disabledKeys } =
|
|
73
|
+
let { disabledBehavior: disabledBehavior, disabledKeys: disabledKeys } = filteredState.selectionManager;
|
|
62
74
|
let { direction: direction } = (0, $jTmF7$useLocale)();
|
|
63
75
|
let keyboardDelegate = (0, $jTmF7$useMemo)(()=>new (0, $jTmF7$ListKeyboardDelegate)({
|
|
64
|
-
collection: collection,
|
|
76
|
+
collection: filteredState.collection,
|
|
65
77
|
collator: collator,
|
|
66
78
|
ref: ref,
|
|
67
79
|
disabledKeys: disabledKeys,
|
|
@@ -70,7 +82,7 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
70
82
|
layout: layout,
|
|
71
83
|
direction: direction
|
|
72
84
|
}), [
|
|
73
|
-
collection,
|
|
85
|
+
filteredState.collection,
|
|
74
86
|
ref,
|
|
75
87
|
layout,
|
|
76
88
|
disabledKeys,
|
|
@@ -81,13 +93,14 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
81
93
|
]);
|
|
82
94
|
let { gridProps: gridProps } = (0, $jTmF7$useGridList)({
|
|
83
95
|
...props,
|
|
96
|
+
...DOMCollectionProps,
|
|
84
97
|
keyboardDelegate: keyboardDelegate,
|
|
85
98
|
// Only tab navigation is supported in grid layout.
|
|
86
99
|
keyboardNavigationBehavior: layout === 'grid' ? 'tab' : keyboardNavigationBehavior,
|
|
87
100
|
isVirtualized: isVirtualized,
|
|
88
101
|
shouldSelectOnPressUp: props.shouldSelectOnPressUp
|
|
89
|
-
},
|
|
90
|
-
let selectionManager =
|
|
102
|
+
}, filteredState, ref);
|
|
103
|
+
let selectionManager = filteredState.selectionManager;
|
|
91
104
|
let isListDraggable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDraggableCollectionState);
|
|
92
105
|
let isListDroppable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDroppableCollectionState);
|
|
93
106
|
let dragHooksProvided = (0, $jTmF7$useRef)(isListDraggable);
|
|
@@ -108,7 +121,7 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
108
121
|
let preview = (0, $jTmF7$useRef)(null);
|
|
109
122
|
if (isListDraggable && dragAndDropHooks) {
|
|
110
123
|
dragState = dragAndDropHooks.useDraggableCollectionState({
|
|
111
|
-
collection: collection,
|
|
124
|
+
collection: filteredState.collection,
|
|
112
125
|
selectionManager: selectionManager,
|
|
113
126
|
preview: dragAndDropHooks.renderDragPreview ? preview : undefined
|
|
114
127
|
});
|
|
@@ -120,11 +133,11 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
120
133
|
}
|
|
121
134
|
if (isListDroppable && dragAndDropHooks) {
|
|
122
135
|
dropState = dragAndDropHooks.useDroppableCollectionState({
|
|
123
|
-
collection: collection,
|
|
136
|
+
collection: filteredState.collection,
|
|
124
137
|
selectionManager: selectionManager
|
|
125
138
|
});
|
|
126
139
|
let keyboardDelegate = new (0, $jTmF7$ListKeyboardDelegate)({
|
|
127
|
-
collection: collection,
|
|
140
|
+
collection: filteredState.collection,
|
|
128
141
|
disabledKeys: selectionManager.disabledKeys,
|
|
129
142
|
disabledBehavior: selectionManager.disabledBehavior,
|
|
130
143
|
ref: ref
|
|
@@ -142,14 +155,14 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
142
155
|
});
|
|
143
156
|
}
|
|
144
157
|
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $jTmF7$useFocusRing)();
|
|
145
|
-
let isEmpty =
|
|
158
|
+
let isEmpty = filteredState.collection.size === 0;
|
|
146
159
|
let renderValues = {
|
|
147
160
|
isDropTarget: isRootDropTarget,
|
|
148
161
|
isEmpty: isEmpty,
|
|
149
162
|
isFocused: isFocused,
|
|
150
163
|
isFocusVisible: isFocusVisible,
|
|
151
164
|
layout: layout,
|
|
152
|
-
state:
|
|
165
|
+
state: filteredState
|
|
153
166
|
};
|
|
154
167
|
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
155
168
|
className: props.className,
|
|
@@ -191,7 +204,7 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
191
204
|
values: [
|
|
192
205
|
[
|
|
193
206
|
(0, $eed445e0843c11d0$export$7c5906fe4f1f2af2),
|
|
194
|
-
|
|
207
|
+
filteredState
|
|
195
208
|
],
|
|
196
209
|
[
|
|
197
210
|
(0, $612b8eb6cb90e02d$export$d188a835a7bc5783),
|
|
@@ -209,13 +222,13 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
209
222
|
]
|
|
210
223
|
]
|
|
211
224
|
}, isListDroppable && /*#__PURE__*/ (0, $jTmF7$react).createElement($72e60046c03fbe42$var$RootDropIndicator, null), /*#__PURE__*/ (0, $jTmF7$react).createElement(CollectionRoot, {
|
|
212
|
-
collection: collection,
|
|
225
|
+
collection: filteredState.collection,
|
|
213
226
|
scrollRef: ref,
|
|
214
227
|
persistedKeys: (0, $612b8eb6cb90e02d$export$d1e8e3fbb7461f6)(selectionManager, dragAndDropHooks, dropState),
|
|
215
228
|
renderDropIndicator: (0, $612b8eb6cb90e02d$export$971707d8a129a1f7)(dragAndDropHooks, dropState)
|
|
216
229
|
})), emptyState, dragPreview));
|
|
217
230
|
}
|
|
218
|
-
const $72e60046c03fbe42$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $jTmF7$createLeafComponent)(
|
|
231
|
+
const $72e60046c03fbe42$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $jTmF7$createLeafComponent)((0, $jTmF7$ItemNode), function GridListItem(props, forwardedRef, item) {
|
|
219
232
|
let state = (0, $jTmF7$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
|
|
220
233
|
let { dragAndDropHooks: dragAndDropHooks, dragState: dragState, dropState: dropState } = (0, $jTmF7$useContext)((0, $612b8eb6cb90e02d$export$d188a835a7bc5783));
|
|
221
234
|
let ref = (0, $jTmF7$useObjectRef)(forwardedRef);
|
|
@@ -357,6 +370,14 @@ const $72e60046c03fbe42$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $jTmF7$creat
|
|
|
357
370
|
[
|
|
358
371
|
(0, $eed445e0843c11d0$export$7c5906fe4f1f2af2),
|
|
359
372
|
null
|
|
373
|
+
],
|
|
374
|
+
[
|
|
375
|
+
(0, $8e6cc465cc68f603$export$b0d3ecf7112093a7),
|
|
376
|
+
null
|
|
377
|
+
],
|
|
378
|
+
[
|
|
379
|
+
(0, $8e6cc465cc68f603$export$698f465ec27e93df),
|
|
380
|
+
null
|
|
360
381
|
]
|
|
361
382
|
]
|
|
362
383
|
}, renderProps.children))));
|
|
@@ -428,7 +449,7 @@ function $72e60046c03fbe42$var$RootDropIndicator() {
|
|
|
428
449
|
ref: ref
|
|
429
450
|
})));
|
|
430
451
|
}
|
|
431
|
-
const $72e60046c03fbe42$export$392b9a0bbc7c7e43 = (0, $jTmF7$createLeafComponent)(
|
|
452
|
+
const $72e60046c03fbe42$export$392b9a0bbc7c7e43 = (0, $jTmF7$createLeafComponent)((0, $jTmF7$LoaderNode), function GridListLoadingIndicator(props, ref, item) {
|
|
432
453
|
let state = (0, $jTmF7$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
|
|
433
454
|
let { isVirtualized: isVirtualized } = (0, $jTmF7$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
434
455
|
let { isLoading: isLoading, onLoadMore: onLoadMore, scrollOffset: scrollOffset, ...otherProps } = props;
|
|
@@ -481,7 +502,65 @@ const $72e60046c03fbe42$export$392b9a0bbc7c7e43 = (0, $jTmF7$createLeafComponent
|
|
|
481
502
|
role: "gridcell"
|
|
482
503
|
}, renderProps.children)));
|
|
483
504
|
});
|
|
505
|
+
const $72e60046c03fbe42$export$f696877219115b14 = /*#__PURE__*/ (0, $jTmF7$createBranchComponent)((0, $jTmF7$SectionNode), (props, ref, item)=>{
|
|
506
|
+
let state = (0, $jTmF7$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
|
|
507
|
+
let { CollectionBranch: CollectionBranch } = (0, $jTmF7$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
508
|
+
let headingRef = (0, $jTmF7$useRef)(null);
|
|
509
|
+
ref = (0, $jTmF7$useObjectRef)(ref);
|
|
510
|
+
var _props_arialabel;
|
|
511
|
+
let { rowHeaderProps: rowHeaderProps, rowProps: rowProps, rowGroupProps: rowGroupProps } = (0, $jTmF7$useGridListSection)({
|
|
512
|
+
'aria-label': (_props_arialabel = props['aria-label']) !== null && _props_arialabel !== void 0 ? _props_arialabel : undefined
|
|
513
|
+
}, state, ref);
|
|
514
|
+
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
515
|
+
defaultClassName: 'react-aria-GridListSection',
|
|
516
|
+
className: props.className,
|
|
517
|
+
style: props.style,
|
|
518
|
+
values: {}
|
|
519
|
+
});
|
|
520
|
+
let DOMProps = (0, $jTmF7$filterDOMProps)(props, {
|
|
521
|
+
global: true
|
|
522
|
+
});
|
|
523
|
+
delete DOMProps.id;
|
|
524
|
+
return /*#__PURE__*/ (0, $jTmF7$react).createElement("section", {
|
|
525
|
+
...(0, $jTmF7$mergeProps)(DOMProps, renderProps, rowGroupProps),
|
|
526
|
+
ref: ref
|
|
527
|
+
}, /*#__PURE__*/ (0, $jTmF7$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
|
|
528
|
+
values: [
|
|
529
|
+
[
|
|
530
|
+
(0, $72a5793c14baf454$export$e0e4026c12a8bdbb),
|
|
531
|
+
{
|
|
532
|
+
...rowProps,
|
|
533
|
+
ref: headingRef
|
|
534
|
+
}
|
|
535
|
+
],
|
|
536
|
+
[
|
|
537
|
+
$72e60046c03fbe42$var$GridListHeaderContext,
|
|
538
|
+
{
|
|
539
|
+
...rowHeaderProps
|
|
540
|
+
}
|
|
541
|
+
]
|
|
542
|
+
]
|
|
543
|
+
}, /*#__PURE__*/ (0, $jTmF7$react).createElement(CollectionBranch, {
|
|
544
|
+
collection: state.collection,
|
|
545
|
+
parent: item
|
|
546
|
+
})));
|
|
547
|
+
});
|
|
548
|
+
const $72e60046c03fbe42$var$GridListHeaderContext = /*#__PURE__*/ (0, $jTmF7$createContext)(null);
|
|
549
|
+
const $72e60046c03fbe42$export$1b574dbdb0075ff6 = /*#__PURE__*/ (0, $jTmF7$createLeafComponent)((0, $jTmF7$HeaderNode), function Header(props, ref) {
|
|
550
|
+
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, (0, $72a5793c14baf454$export$e0e4026c12a8bdbb));
|
|
551
|
+
let rowHeaderProps = (0, $jTmF7$useContext)($72e60046c03fbe42$var$GridListHeaderContext);
|
|
552
|
+
return /*#__PURE__*/ (0, $jTmF7$react).createElement("header", {
|
|
553
|
+
className: "react-aria-GridListHeader",
|
|
554
|
+
ref: ref,
|
|
555
|
+
...props
|
|
556
|
+
}, /*#__PURE__*/ (0, $jTmF7$react).createElement("div", {
|
|
557
|
+
...rowHeaderProps,
|
|
558
|
+
style: {
|
|
559
|
+
display: 'contents'
|
|
560
|
+
}
|
|
561
|
+
}, props.children));
|
|
562
|
+
});
|
|
484
563
|
|
|
485
564
|
|
|
486
|
-
export {$72e60046c03fbe42$export$54fe942636b6416d as GridListContext, $72e60046c03fbe42$export$a7bfbda1311ca015 as GridList, $72e60046c03fbe42$export$e96fc9a8407faa6b as GridListItem, $72e60046c03fbe42$export$392b9a0bbc7c7e43 as GridListLoadMoreItem};
|
|
565
|
+
export {$72e60046c03fbe42$export$54fe942636b6416d as GridListContext, $72e60046c03fbe42$export$a7bfbda1311ca015 as GridList, $72e60046c03fbe42$export$e96fc9a8407faa6b as GridListItem, $72e60046c03fbe42$export$392b9a0bbc7c7e43 as GridListLoadMoreItem, $72e60046c03fbe42$export$f696877219115b14 as GridListSection, $72e60046c03fbe42$export$1b574dbdb0075ff6 as GridListHeader};
|
|
487
566
|
//# sourceMappingURL=GridList.module.js.map
|