react-aria-components 1.10.1 → 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 +13 -3
- package/dist/Breadcrumbs.main.js.map +1 -1
- package/dist/Breadcrumbs.mjs +15 -5
- package/dist/Breadcrumbs.module.js +15 -5
- package/dist/Breadcrumbs.module.js.map +1 -1
- package/dist/Button.main.js +7 -17
- package/dist/Button.main.js.map +1 -1
- package/dist/Button.mjs +7 -17
- package/dist/Button.module.js +7 -17
- package/dist/Button.module.js.map +1 -1
- package/dist/Calendar.main.js +36 -14
- package/dist/Calendar.main.js.map +1 -1
- package/dist/Calendar.mjs +38 -16
- package/dist/Calendar.module.js +38 -16
- package/dist/Calendar.module.js.map +1 -1
- package/dist/Checkbox.main.js +8 -3
- package/dist/Checkbox.main.js.map +1 -1
- package/dist/Checkbox.mjs +10 -5
- package/dist/Checkbox.module.js +10 -5
- package/dist/Checkbox.module.js.map +1 -1
- package/dist/Collection.main.js.map +1 -1
- package/dist/Collection.module.js.map +1 -1
- package/dist/ColorArea.main.js +4 -4
- package/dist/ColorArea.main.js.map +1 -1
- package/dist/ColorArea.mjs +5 -5
- package/dist/ColorArea.module.js +5 -5
- package/dist/ColorArea.module.js.map +1 -1
- package/dist/ColorField.main.js +14 -1
- package/dist/ColorField.main.js.map +1 -1
- package/dist/ColorField.mjs +14 -1
- package/dist/ColorField.module.js +14 -1
- package/dist/ColorField.module.js.map +1 -1
- package/dist/ColorSlider.main.js +3 -1
- package/dist/ColorSlider.main.js.map +1 -1
- package/dist/ColorSlider.mjs +3 -1
- package/dist/ColorSlider.module.js +3 -1
- package/dist/ColorSlider.module.js.map +1 -1
- package/dist/ColorSwatch.main.js +6 -2
- package/dist/ColorSwatch.main.js.map +1 -1
- package/dist/ColorSwatch.mjs +6 -2
- package/dist/ColorSwatch.module.js +6 -2
- package/dist/ColorSwatch.module.js.map +1 -1
- package/dist/ColorSwatchPicker.main.js.map +1 -1
- package/dist/ColorSwatchPicker.module.js.map +1 -1
- package/dist/ColorThumb.main.js +3 -1
- package/dist/ColorThumb.main.js.map +1 -1
- package/dist/ColorThumb.mjs +3 -1
- package/dist/ColorThumb.module.js +3 -1
- package/dist/ColorThumb.module.js.map +1 -1
- package/dist/ColorWheel.main.js +3 -1
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +3 -1
- package/dist/ColorWheel.module.js +3 -1
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/ComboBox.main.js +4 -1
- package/dist/ComboBox.main.js.map +1 -1
- package/dist/ComboBox.mjs +4 -1
- package/dist/ComboBox.module.js +4 -1
- package/dist/ComboBox.module.js.map +1 -1
- package/dist/DateField.main.js +16 -3
- package/dist/DateField.main.js.map +1 -1
- package/dist/DateField.mjs +16 -3
- package/dist/DateField.module.js +16 -3
- package/dist/DateField.module.js.map +1 -1
- package/dist/DatePicker.main.js +15 -8
- package/dist/DatePicker.main.js.map +1 -1
- package/dist/DatePicker.mjs +16 -9
- package/dist/DatePicker.module.js +16 -9
- package/dist/DatePicker.module.js.map +1 -1
- package/dist/Dialog.main.js +4 -3
- package/dist/Dialog.main.js.map +1 -1
- package/dist/Dialog.mjs +5 -4
- package/dist/Dialog.module.js +5 -4
- package/dist/Dialog.module.js.map +1 -1
- package/dist/Disclosure.main.js +12 -10
- package/dist/Disclosure.main.js.map +1 -1
- package/dist/Disclosure.mjs +13 -11
- package/dist/Disclosure.module.js +13 -11
- package/dist/Disclosure.module.js.map +1 -1
- package/dist/DragAndDrop.main.js +31 -3
- package/dist/DragAndDrop.main.js.map +1 -1
- package/dist/DragAndDrop.mjs +31 -3
- package/dist/DragAndDrop.module.js +31 -3
- package/dist/DragAndDrop.module.js.map +1 -1
- package/dist/DropZone.main.js +4 -3
- package/dist/DropZone.main.js.map +1 -1
- package/dist/DropZone.mjs +4 -3
- package/dist/DropZone.module.js +4 -3
- package/dist/DropZone.module.js.map +1 -1
- package/dist/FieldError.main.js +3 -1
- package/dist/FieldError.main.js.map +1 -1
- package/dist/FieldError.mjs +3 -1
- package/dist/FieldError.module.js +3 -1
- package/dist/FieldError.module.js.map +1 -1
- package/dist/FileTrigger.main.js +3 -1
- package/dist/FileTrigger.main.js.map +1 -1
- package/dist/FileTrigger.mjs +3 -1
- package/dist/FileTrigger.module.js +3 -1
- package/dist/FileTrigger.module.js.map +1 -1
- package/dist/Form.main.js.map +1 -1
- package/dist/Form.module.js.map +1 -1
- package/dist/GridList.main.js +114 -26
- package/dist/GridList.main.js.map +1 -1
- package/dist/GridList.mjs +116 -30
- package/dist/GridList.module.js +116 -30
- 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/HiddenDateInput.main.js +118 -0
- package/dist/HiddenDateInput.main.js.map +1 -0
- package/dist/HiddenDateInput.mjs +109 -0
- package/dist/HiddenDateInput.module.js +109 -0
- package/dist/HiddenDateInput.module.js.map +1 -0
- package/dist/Link.main.js +7 -1
- package/dist/Link.main.js.map +1 -1
- package/dist/Link.mjs +7 -1
- package/dist/Link.module.js +7 -1
- package/dist/Link.module.js.map +1 -1
- package/dist/ListBox.main.js +27 -36
- package/dist/ListBox.main.js.map +1 -1
- package/dist/ListBox.mjs +29 -38
- package/dist/ListBox.module.js +29 -38
- package/dist/ListBox.module.js.map +1 -1
- package/dist/Menu.main.js +44 -23
- package/dist/Menu.main.js.map +1 -1
- package/dist/Menu.mjs +47 -26
- package/dist/Menu.module.js +47 -26
- package/dist/Menu.module.js.map +1 -1
- package/dist/Meter.main.js +6 -2
- package/dist/Meter.main.js.map +1 -1
- package/dist/Meter.mjs +6 -2
- package/dist/Meter.module.js +6 -2
- package/dist/Meter.module.js.map +1 -1
- package/dist/Modal.main.js +31 -6
- package/dist/Modal.main.js.map +1 -1
- package/dist/Modal.mjs +31 -6
- package/dist/Modal.module.js +31 -6
- package/dist/Modal.module.js.map +1 -1
- package/dist/NumberField.main.js +4 -1
- package/dist/NumberField.main.js.map +1 -1
- package/dist/NumberField.mjs +4 -1
- package/dist/NumberField.module.js +4 -1
- package/dist/NumberField.module.js.map +1 -1
- package/dist/Popover.main.js +10 -12
- package/dist/Popover.main.js.map +1 -1
- package/dist/Popover.mjs +11 -13
- package/dist/Popover.module.js +11 -13
- package/dist/Popover.module.js.map +1 -1
- package/dist/ProgressBar.main.js +6 -2
- package/dist/ProgressBar.main.js.map +1 -1
- package/dist/ProgressBar.mjs +6 -2
- package/dist/ProgressBar.module.js +6 -2
- package/dist/ProgressBar.module.js.map +1 -1
- package/dist/RadioGroup.main.js +8 -3
- package/dist/RadioGroup.main.js.map +1 -1
- package/dist/RadioGroup.mjs +9 -4
- package/dist/RadioGroup.module.js +9 -4
- package/dist/RadioGroup.module.js.map +1 -1
- package/dist/SearchField.main.js +9 -5
- package/dist/SearchField.main.js.map +1 -1
- package/dist/SearchField.mjs +10 -6
- package/dist/SearchField.module.js +10 -6
- package/dist/SearchField.module.js.map +1 -1
- package/dist/Select.main.js +12 -14
- package/dist/Select.main.js.map +1 -1
- package/dist/Select.mjs +13 -15
- package/dist/Select.module.js +13 -15
- package/dist/Select.module.js.map +1 -1
- package/dist/Separator.main.js +17 -3
- package/dist/Separator.main.js.map +1 -1
- package/dist/Separator.mjs +20 -6
- package/dist/Separator.module.js +20 -6
- package/dist/Separator.module.js.map +1 -1
- package/dist/Slider.main.js +7 -5
- package/dist/Slider.main.js.map +1 -1
- package/dist/Slider.mjs +8 -6
- package/dist/Slider.module.js +8 -6
- package/dist/Slider.module.js.map +1 -1
- package/dist/Switch.main.js +4 -1
- package/dist/Switch.main.js.map +1 -1
- package/dist/Switch.mjs +4 -1
- package/dist/Switch.module.js +4 -1
- package/dist/Switch.module.js.map +1 -1
- package/dist/Table.main.js +104 -42
- package/dist/Table.main.js.map +1 -1
- package/dist/Table.mjs +107 -45
- package/dist/Table.module.js +107 -45
- package/dist/Table.module.js.map +1 -1
- package/dist/Tabs.main.js +24 -11
- package/dist/Tabs.main.js.map +1 -1
- package/dist/Tabs.mjs +26 -13
- package/dist/Tabs.module.js +26 -13
- package/dist/Tabs.module.js.map +1 -1
- package/dist/TagGroup.main.js +27 -12
- package/dist/TagGroup.main.js.map +1 -1
- package/dist/TagGroup.mjs +29 -14
- package/dist/TagGroup.module.js +29 -14
- package/dist/TagGroup.module.js.map +1 -1
- package/dist/TextField.main.js +20 -6
- package/dist/TextField.main.js.map +1 -1
- package/dist/TextField.mjs +21 -7
- package/dist/TextField.module.js +21 -7
- package/dist/TextField.module.js.map +1 -1
- package/dist/Toast.main.js +9 -5
- package/dist/Toast.main.js.map +1 -1
- package/dist/Toast.mjs +9 -5
- package/dist/Toast.module.js +9 -5
- package/dist/Toast.module.js.map +1 -1
- package/dist/ToggleButton.main.js +8 -2
- package/dist/ToggleButton.main.js.map +1 -1
- package/dist/ToggleButton.mjs +8 -2
- package/dist/ToggleButton.module.js +8 -2
- package/dist/ToggleButton.module.js.map +1 -1
- package/dist/ToggleButtonGroup.main.js +6 -2
- package/dist/ToggleButtonGroup.main.js.map +1 -1
- package/dist/ToggleButtonGroup.mjs +6 -2
- package/dist/ToggleButtonGroup.module.js +6 -2
- package/dist/ToggleButtonGroup.module.js.map +1 -1
- package/dist/Toolbar.main.js +4 -3
- package/dist/Toolbar.main.js.map +1 -1
- package/dist/Toolbar.mjs +4 -3
- package/dist/Toolbar.module.js +4 -3
- package/dist/Toolbar.module.js.map +1 -1
- package/dist/Tooltip.main.js +9 -14
- package/dist/Tooltip.main.js.map +1 -1
- package/dist/Tooltip.mjs +10 -15
- package/dist/Tooltip.module.js +10 -15
- package/dist/Tooltip.module.js.map +1 -1
- package/dist/Tree.main.js +81 -28
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +83 -30
- package/dist/Tree.module.js +83 -30
- package/dist/Tree.module.js.map +1 -1
- package/dist/TreeDropTargetDelegate.main.js +8 -5
- package/dist/TreeDropTargetDelegate.main.js.map +1 -1
- package/dist/TreeDropTargetDelegate.mjs +8 -5
- package/dist/TreeDropTargetDelegate.module.js +8 -5
- package/dist/TreeDropTargetDelegate.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 +6 -6
- package/dist/main.js +7 -4
- package/dist/main.js.map +1 -1
- package/dist/module.js +6 -6
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +358 -342
- 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/dist/utils.main.js.map +1 -1
- package/dist/utils.module.js.map +1 -1
- package/i18n/de-DE.js +1 -1
- package/i18n/de-DE.mjs +1 -1
- package/package.json +27 -26
- package/src/Autocomplete.tsx +14 -25
- package/src/Breadcrumbs.tsx +16 -8
- package/src/Button.tsx +8 -30
- package/src/Calendar.tsx +41 -24
- package/src/Checkbox.tsx +8 -6
- package/src/Collection.tsx +2 -2
- package/src/ColorArea.tsx +5 -6
- package/src/ColorField.tsx +6 -4
- package/src/ColorSlider.tsx +3 -2
- package/src/ColorSwatch.tsx +6 -3
- package/src/ColorSwatchPicker.tsx +3 -3
- package/src/ColorThumb.tsx +3 -3
- package/src/ColorWheel.tsx +6 -5
- package/src/ComboBox.tsx +4 -4
- package/src/DateField.tsx +15 -10
- package/src/DatePicker.tsx +14 -12
- package/src/Dialog.tsx +6 -6
- package/src/Disclosure.tsx +10 -14
- package/src/DragAndDrop.tsx +31 -1
- package/src/DropZone.tsx +4 -5
- package/src/FieldError.tsx +3 -3
- package/src/FileTrigger.tsx +4 -3
- package/src/Form.tsx +2 -1
- package/src/GridList.tsx +112 -37
- package/src/Header.tsx +2 -2
- package/src/HiddenDateInput.tsx +142 -0
- package/src/Link.tsx +7 -3
- package/src/ListBox.tsx +40 -39
- package/src/Menu.tsx +52 -29
- package/src/Meter.tsx +6 -3
- package/src/Modal.tsx +16 -5
- package/src/NumberField.tsx +4 -4
- package/src/Popover.tsx +14 -14
- package/src/ProgressBar.tsx +6 -2
- package/src/RadioGroup.tsx +8 -6
- package/src/SearchField.tsx +8 -6
- package/src/Select.tsx +13 -16
- package/src/Separator.tsx +23 -6
- package/src/Slider.tsx +9 -11
- package/src/Switch.tsx +4 -3
- package/src/Table.tsx +119 -74
- package/src/Tabs.tsx +24 -17
- package/src/TagGroup.tsx +28 -18
- package/src/TextField.tsx +13 -9
- package/src/Toast.tsx +10 -8
- package/src/ToggleButton.tsx +8 -4
- package/src/ToggleButtonGroup.tsx +6 -4
- package/src/Toolbar.tsx +4 -5
- package/src/Tooltip.tsx +15 -18
- package/src/Tree.tsx +102 -46
- package/src/TreeDropTargetDelegate.ts +5 -1
- package/src/context.tsx +34 -0
- package/src/index.ts +9 -9
- package/src/useDragAndDrop.tsx +11 -11
- package/src/utils.tsx +9 -9
package/dist/Tooltip.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAiEM,MAAM,0DAA6B,CAAA,GAAA,0BAAY,EAA8B;AAC7E,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAA8C;AAOjF,SAAS,0CAAe,KAAmC;IAChE,IAAI,QAAQ,CAAA,GAAA,0CAAqB,EAAE;IACnC,IAAI,MAAM,CAAA,GAAA,mBAAK,EAAoB;IACnC,IAAI,gBAAC,YAAY,gBAAE,YAAY,EAAC,GAAG,CAAA,GAAA,kCAAgB,EAAE,OAAO,OAAO;IAEnE,qBACE,0DAAC,CAAA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AAM,UAAU;kBAC5B;QACA,QAAQ,MAAM,MAAM;QACpB,aAAa,MAAM,WAAW;QAC9B,QAAQ,MAAM,MAAM;QACpB,qBAAqB,MAAM,mBAAmB;QAC9C,YAAY,MAAM,UAAU;QAC5B,kBAAkB,MAAM,gBAAgB;QACxC,SAAS,IAAM,MAAM,KAAK,CAAC;IAC7B;IAEA,IAAI,aAAa,CAAA,GAAA,uCAAgB,EAAE,MAAM,UAAU,EAAE,CAAC,CAAC,cAAc,MAAM,UAAU,IAAI;IACzF,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;uBACN;wBACA;YACA,WAAW,MAAM,SAAS;mBAC1B;QACF;IACF;IAEA,QAAQ,CAAA,GAAA,2BAAS,EAAE,OAAO;IAC1B,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,2BAAS,EAAE,OAAO;IAEvC,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,UAAU,aAAa,aAAa;QACnD,KAAK,MAAM,UAAU;QACrB,OAAO;YACL,GAAG,aAAa,KAAK;YACrB,0BAA0B,qBAAqB,GAAG,mBAAmB,CAAC,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,GAAG;YACvG,GAAG,YAAY,KAAK;QACtB;QACA,kBAAgB,sBAAA,uBAAA,YAAa;QAC7B,iBAAe,cAAc;QAC7B,gBAAc,MAAM,SAAS,IAAI;qBACjC,0DAAC,CAAA,GAAA,6CAAkB,EAAE,QAAQ;QAAC,OAAO;YAAC,GAAG,UAAU;uBAAE;YAAW,KAAK;QAAQ;OAC1E,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Tooltip.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 */\n\nimport {AriaLabelingProps, FocusableElement, forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {AriaPositionProps, mergeProps, OverlayContainer, Placement, PlacementAxis, PositionProps, useOverlayPosition, useTooltip, useTooltipTrigger} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, useEnterAnimation, useExitAnimation} from '@react-aria/utils';\nimport {FocusableProvider} from '@react-aria/focus';\nimport {OverlayArrowContext} from './OverlayArrow';\nimport {OverlayTriggerProps, TooltipTriggerProps, TooltipTriggerState, useTooltipTriggerState} from 'react-stately';\nimport React, {createContext, CSSProperties, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useRef} from 'react';\n\nexport interface TooltipTriggerComponentProps extends TooltipTriggerProps {\n children: ReactNode\n}\n\nexport interface TooltipProps extends PositionProps, Pick<AriaPositionProps, 'arrowBoundaryOffset'>, OverlayTriggerProps, AriaLabelingProps, RenderProps<TooltipRenderProps>, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The ref for the element which the tooltip positions itself with respect to.\n *\n * When used within a TooltipTrigger this is set automatically. It is only required when used standalone.\n */\n triggerRef?: RefObject<Element | null>,\n /**\n * Whether the tooltip is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the tooltip is currently performing an exit animation.\n */\n isExiting?: boolean,\n /**\n * The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to.\n * @default document.body\n * @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead.\n */\n UNSTABLE_portalContainer?: Element,\n /**\n * The placement of the tooltip with respect to the trigger.\n * @default 'top'\n */\n placement?: Placement\n}\n\nexport interface TooltipRenderProps {\n /**\n * The placement of the tooltip relative to the trigger.\n * @selector [data-placement=\"left | right | top | bottom\"]\n */\n placement: PlacementAxis | null,\n /**\n * Whether the tooltip is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the tooltip is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean,\n /**\n * State of the tooltip.\n */\n state: TooltipTriggerState\n}\n\nexport const TooltipTriggerStateContext = createContext<TooltipTriggerState | null>(null);\nexport const TooltipContext = createContext<ContextValue<TooltipProps, HTMLDivElement>>(null);\n\n/**\n * TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing\n * the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip\n * relative to the trigger.\n */\nexport function TooltipTrigger(props: TooltipTriggerComponentProps): JSX.Element {\n let state = useTooltipTriggerState(props);\n let ref = useRef<FocusableElement>(null);\n let {triggerProps, tooltipProps} = useTooltipTrigger(props, state, ref);\n\n return (\n <Provider\n values={[\n [TooltipTriggerStateContext, state],\n [TooltipContext, {...tooltipProps, triggerRef: ref}]\n ]}>\n <FocusableProvider {...triggerProps} ref={ref}>\n {props.children}\n </FocusableProvider>\n </Provider>\n );\n}\n\n/**\n * A tooltip displays a description of an element on hover or focus.\n */\nexport const Tooltip = /*#__PURE__*/ (forwardRef as forwardRefType)(function Tooltip({UNSTABLE_portalContainer, ...props}: TooltipProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TooltipContext);\n let contextState = useContext(TooltipTriggerStateContext);\n let localState = useTooltipTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n let isExiting = useExitAnimation(ref, state.isOpen) || props.isExiting || false;\n if (!state.isOpen && !isExiting) {\n return null;\n }\n\n return (\n <OverlayContainer portalContainer={UNSTABLE_portalContainer}>\n <TooltipInner {...props} tooltipRef={ref} isExiting={isExiting} />\n </OverlayContainer>\n );\n});\n\nfunction TooltipInner(props: TooltipProps & {isExiting: boolean, tooltipRef: RefObject<HTMLDivElement | null>}) {\n let state = useContext(TooltipTriggerStateContext)!;\n let arrowRef = useRef<HTMLDivElement>(null);\n\n let {overlayProps, arrowProps, placement, triggerAnchorPoint} = useOverlayPosition({\n placement: props.placement || 'top',\n targetRef: props.triggerRef!,\n overlayRef: props.tooltipRef,\n arrowRef,\n offset: props.offset,\n crossOffset: props.crossOffset,\n isOpen: state.isOpen,\n arrowBoundaryOffset: props.arrowBoundaryOffset,\n shouldFlip: props.shouldFlip,\n containerPadding: props.containerPadding,\n onClose: () => state.close(true)\n });\n\n let isEntering = useEnterAnimation(props.tooltipRef, !!placement) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Tooltip',\n values: {\n placement,\n isEntering,\n isExiting: props.isExiting,\n state\n }\n });\n\n props = mergeProps(props, overlayProps);\n let {tooltipProps} = useTooltip(props, state);\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, tooltipProps)}\n ref={props.tooltipRef}\n style={{\n ...overlayProps.style,\n '--trigger-anchor-point': triggerAnchorPoint ? `${triggerAnchorPoint.x}px ${triggerAnchorPoint.y}px` : undefined,\n ...renderProps.style\n } as CSSProperties}\n data-placement={placement ?? undefined}\n data-entering={isEntering || undefined}\n data-exiting={props.isExiting || undefined}>\n <OverlayArrowContext.Provider value={{...arrowProps, placement, ref: arrowRef}}>\n {renderProps.children}\n </OverlayArrowContext.Provider>\n </div>\n );\n}\n"],"names":[],"version":3,"file":"Tooltip.main.js.map"}
|
package/dist/Tooltip.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.mjs";
|
|
2
2
|
import {OverlayArrowContext as $44f671af83e7d9e0$export$2de4954e8ae13b9f} from "./OverlayArrow.mjs";
|
|
3
3
|
import {useTooltipTrigger as $cCslV$useTooltipTrigger, OverlayContainer as $cCslV$OverlayContainer, useOverlayPosition as $cCslV$useOverlayPosition, mergeProps as $cCslV$mergeProps, useTooltip as $cCslV$useTooltip} from "react-aria";
|
|
4
|
+
import {useExitAnimation as $cCslV$useExitAnimation, useEnterAnimation as $cCslV$useEnterAnimation, filterDOMProps as $cCslV$filterDOMProps} from "@react-aria/utils";
|
|
4
5
|
import {FocusableProvider as $cCslV$FocusableProvider} from "@react-aria/focus";
|
|
5
6
|
import {useTooltipTriggerState as $cCslV$useTooltipTriggerState} from "react-stately";
|
|
6
|
-
import $cCslV$react, {createContext as $cCslV$createContext, useRef as $cCslV$useRef, forwardRef as $cCslV$forwardRef, useContext as $cCslV$useContext
|
|
7
|
-
import {useExitAnimation as $cCslV$useExitAnimation, useLayoutEffect as $cCslV$useLayoutEffect, useEnterAnimation as $cCslV$useEnterAnimation} from "@react-aria/utils";
|
|
7
|
+
import $cCslV$react, {createContext as $cCslV$createContext, useRef as $cCslV$useRef, forwardRef as $cCslV$forwardRef, useContext as $cCslV$useContext} from "react";
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
10
|
* Copyright 2022 Adobe. All rights reserved.
|
|
@@ -65,26 +65,18 @@ const $4e3b923658d69c60$export$28c660c63b792dea = /*#__PURE__*/ (0, $cCslV$forwa
|
|
|
65
65
|
});
|
|
66
66
|
function $4e3b923658d69c60$var$TooltipInner(props) {
|
|
67
67
|
let state = (0, $cCslV$useContext)($4e3b923658d69c60$export$7a7623236eec67fa);
|
|
68
|
-
// Calculate the arrow size internally
|
|
69
|
-
// Referenced from: packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx
|
|
70
68
|
let arrowRef = (0, $cCslV$useRef)(null);
|
|
71
|
-
let
|
|
72
|
-
(0, $cCslV$useLayoutEffect)(()=>{
|
|
73
|
-
if (arrowRef.current && state.isOpen) setArrowWidth(arrowRef.current.getBoundingClientRect().width);
|
|
74
|
-
}, [
|
|
75
|
-
state.isOpen,
|
|
76
|
-
arrowRef
|
|
77
|
-
]);
|
|
78
|
-
let { overlayProps: overlayProps, arrowProps: arrowProps, placement: placement } = (0, $cCslV$useOverlayPosition)({
|
|
69
|
+
let { overlayProps: overlayProps, arrowProps: arrowProps, placement: placement, triggerAnchorPoint: triggerAnchorPoint } = (0, $cCslV$useOverlayPosition)({
|
|
79
70
|
placement: props.placement || 'top',
|
|
80
71
|
targetRef: props.triggerRef,
|
|
81
72
|
overlayRef: props.tooltipRef,
|
|
73
|
+
arrowRef: arrowRef,
|
|
82
74
|
offset: props.offset,
|
|
83
75
|
crossOffset: props.crossOffset,
|
|
84
76
|
isOpen: state.isOpen,
|
|
85
|
-
arrowSize: arrowWidth,
|
|
86
77
|
arrowBoundaryOffset: props.arrowBoundaryOffset,
|
|
87
78
|
shouldFlip: props.shouldFlip,
|
|
79
|
+
containerPadding: props.containerPadding,
|
|
88
80
|
onClose: ()=>state.close(true)
|
|
89
81
|
});
|
|
90
82
|
let isEntering = (0, $cCslV$useEnterAnimation)(props.tooltipRef, !!placement) || props.isEntering || false;
|
|
@@ -100,12 +92,15 @@ function $4e3b923658d69c60$var$TooltipInner(props) {
|
|
|
100
92
|
});
|
|
101
93
|
props = (0, $cCslV$mergeProps)(props, overlayProps);
|
|
102
94
|
let { tooltipProps: tooltipProps } = (0, $cCslV$useTooltip)(props, state);
|
|
95
|
+
let DOMProps = (0, $cCslV$filterDOMProps)(props, {
|
|
96
|
+
global: true
|
|
97
|
+
});
|
|
103
98
|
return /*#__PURE__*/ (0, $cCslV$react).createElement("div", {
|
|
104
|
-
...tooltipProps,
|
|
99
|
+
...(0, $cCslV$mergeProps)(DOMProps, renderProps, tooltipProps),
|
|
105
100
|
ref: props.tooltipRef,
|
|
106
|
-
...renderProps,
|
|
107
101
|
style: {
|
|
108
102
|
...overlayProps.style,
|
|
103
|
+
'--trigger-anchor-point': triggerAnchorPoint ? `${triggerAnchorPoint.x}px ${triggerAnchorPoint.y}px` : undefined,
|
|
109
104
|
...renderProps.style
|
|
110
105
|
},
|
|
111
106
|
"data-placement": placement !== null && placement !== void 0 ? placement : undefined,
|
package/dist/Tooltip.module.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.module.js";
|
|
2
2
|
import {OverlayArrowContext as $44f671af83e7d9e0$export$2de4954e8ae13b9f} from "./OverlayArrow.module.js";
|
|
3
3
|
import {useTooltipTrigger as $cCslV$useTooltipTrigger, OverlayContainer as $cCslV$OverlayContainer, useOverlayPosition as $cCslV$useOverlayPosition, mergeProps as $cCslV$mergeProps, useTooltip as $cCslV$useTooltip} from "react-aria";
|
|
4
|
+
import {useExitAnimation as $cCslV$useExitAnimation, useEnterAnimation as $cCslV$useEnterAnimation, filterDOMProps as $cCslV$filterDOMProps} from "@react-aria/utils";
|
|
4
5
|
import {FocusableProvider as $cCslV$FocusableProvider} from "@react-aria/focus";
|
|
5
6
|
import {useTooltipTriggerState as $cCslV$useTooltipTriggerState} from "react-stately";
|
|
6
|
-
import $cCslV$react, {createContext as $cCslV$createContext, useRef as $cCslV$useRef, forwardRef as $cCslV$forwardRef, useContext as $cCslV$useContext
|
|
7
|
-
import {useExitAnimation as $cCslV$useExitAnimation, useLayoutEffect as $cCslV$useLayoutEffect, useEnterAnimation as $cCslV$useEnterAnimation} from "@react-aria/utils";
|
|
7
|
+
import $cCslV$react, {createContext as $cCslV$createContext, useRef as $cCslV$useRef, forwardRef as $cCslV$forwardRef, useContext as $cCslV$useContext} from "react";
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
10
|
* Copyright 2022 Adobe. All rights reserved.
|
|
@@ -65,26 +65,18 @@ const $4e3b923658d69c60$export$28c660c63b792dea = /*#__PURE__*/ (0, $cCslV$forwa
|
|
|
65
65
|
});
|
|
66
66
|
function $4e3b923658d69c60$var$TooltipInner(props) {
|
|
67
67
|
let state = (0, $cCslV$useContext)($4e3b923658d69c60$export$7a7623236eec67fa);
|
|
68
|
-
// Calculate the arrow size internally
|
|
69
|
-
// Referenced from: packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx
|
|
70
68
|
let arrowRef = (0, $cCslV$useRef)(null);
|
|
71
|
-
let
|
|
72
|
-
(0, $cCslV$useLayoutEffect)(()=>{
|
|
73
|
-
if (arrowRef.current && state.isOpen) setArrowWidth(arrowRef.current.getBoundingClientRect().width);
|
|
74
|
-
}, [
|
|
75
|
-
state.isOpen,
|
|
76
|
-
arrowRef
|
|
77
|
-
]);
|
|
78
|
-
let { overlayProps: overlayProps, arrowProps: arrowProps, placement: placement } = (0, $cCslV$useOverlayPosition)({
|
|
69
|
+
let { overlayProps: overlayProps, arrowProps: arrowProps, placement: placement, triggerAnchorPoint: triggerAnchorPoint } = (0, $cCslV$useOverlayPosition)({
|
|
79
70
|
placement: props.placement || 'top',
|
|
80
71
|
targetRef: props.triggerRef,
|
|
81
72
|
overlayRef: props.tooltipRef,
|
|
73
|
+
arrowRef: arrowRef,
|
|
82
74
|
offset: props.offset,
|
|
83
75
|
crossOffset: props.crossOffset,
|
|
84
76
|
isOpen: state.isOpen,
|
|
85
|
-
arrowSize: arrowWidth,
|
|
86
77
|
arrowBoundaryOffset: props.arrowBoundaryOffset,
|
|
87
78
|
shouldFlip: props.shouldFlip,
|
|
79
|
+
containerPadding: props.containerPadding,
|
|
88
80
|
onClose: ()=>state.close(true)
|
|
89
81
|
});
|
|
90
82
|
let isEntering = (0, $cCslV$useEnterAnimation)(props.tooltipRef, !!placement) || props.isEntering || false;
|
|
@@ -100,12 +92,15 @@ function $4e3b923658d69c60$var$TooltipInner(props) {
|
|
|
100
92
|
});
|
|
101
93
|
props = (0, $cCslV$mergeProps)(props, overlayProps);
|
|
102
94
|
let { tooltipProps: tooltipProps } = (0, $cCslV$useTooltip)(props, state);
|
|
95
|
+
let DOMProps = (0, $cCslV$filterDOMProps)(props, {
|
|
96
|
+
global: true
|
|
97
|
+
});
|
|
103
98
|
return /*#__PURE__*/ (0, $cCslV$react).createElement("div", {
|
|
104
|
-
...tooltipProps,
|
|
99
|
+
...(0, $cCslV$mergeProps)(DOMProps, renderProps, tooltipProps),
|
|
105
100
|
ref: props.tooltipRef,
|
|
106
|
-
...renderProps,
|
|
107
101
|
style: {
|
|
108
102
|
...overlayProps.style,
|
|
103
|
+
'--trigger-anchor-point': triggerAnchorPoint ? `${triggerAnchorPoint.x}px ${triggerAnchorPoint.y}px` : undefined,
|
|
109
104
|
...renderProps.style
|
|
110
105
|
},
|
|
111
106
|
"data-placement": placement !== null && placement !== void 0 ? placement : undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAiEM,MAAM,0DAA6B,CAAA,GAAA,oBAAY,EAA8B;AAC7E,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAA8C;AAOjF,SAAS,0CAAe,KAAmC;IAChE,IAAI,QAAQ,CAAA,GAAA,6BAAqB,EAAE;IACnC,IAAI,MAAM,CAAA,GAAA,aAAK,EAAoB;IACnC,IAAI,gBAAC,YAAY,gBAAE,YAAY,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE,OAAO,OAAO;IAEnE,qBACE,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC;gBAA4B;aAAM;YACnC;gBAAC;gBAAgB;oBAAC,GAAG,YAAY;oBAAE,YAAY;gBAAG;aAAE;SACrD;qBACD,gCAAC,CAAA,GAAA,wBAAgB;QAAG,GAAG,YAAY;QAAE,KAAK;OACvC,MAAM,QAAQ;AAIvB;AAKO,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,QAAQ,4BAAC,wBAA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,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;uBACN;wBACA;YACA,WAAW,MAAM,SAAS;mBAC1B;QACF;IACF;IAEA,QAAQ,CAAA,GAAA,iBAAS,EAAE,OAAO;IAC1B,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE,OAAO;IAEvC,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,aAAa;QACnD,KAAK,MAAM,UAAU;QACrB,OAAO;YACL,GAAG,aAAa,KAAK;YACrB,0BAA0B,qBAAqB,GAAG,mBAAmB,CAAC,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,GAAG;YACvG,GAAG,YAAY,KAAK;QACtB;QACA,kBAAgB,sBAAA,uBAAA,YAAa;QAC7B,iBAAe,cAAc;QAC7B,gBAAc,MAAM,SAAS,IAAI;qBACjC,gCAAC,CAAA,GAAA,yCAAkB,EAAE,QAAQ;QAAC,OAAO;YAAC,GAAG,UAAU;uBAAE;YAAW,KAAK;QAAQ;OAC1E,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Tooltip.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 */\n\nimport {AriaLabelingProps, FocusableElement, forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {AriaPositionProps, mergeProps, OverlayContainer, Placement, PlacementAxis, PositionProps, useOverlayPosition, useTooltip, useTooltipTrigger} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, useEnterAnimation, useExitAnimation} from '@react-aria/utils';\nimport {FocusableProvider} from '@react-aria/focus';\nimport {OverlayArrowContext} from './OverlayArrow';\nimport {OverlayTriggerProps, TooltipTriggerProps, TooltipTriggerState, useTooltipTriggerState} from 'react-stately';\nimport React, {createContext, CSSProperties, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useRef} from 'react';\n\nexport interface TooltipTriggerComponentProps extends TooltipTriggerProps {\n children: ReactNode\n}\n\nexport interface TooltipProps extends PositionProps, Pick<AriaPositionProps, 'arrowBoundaryOffset'>, OverlayTriggerProps, AriaLabelingProps, RenderProps<TooltipRenderProps>, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The ref for the element which the tooltip positions itself with respect to.\n *\n * When used within a TooltipTrigger this is set automatically. It is only required when used standalone.\n */\n triggerRef?: RefObject<Element | null>,\n /**\n * Whether the tooltip is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the tooltip is currently performing an exit animation.\n */\n isExiting?: boolean,\n /**\n * The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to.\n * @default document.body\n * @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead.\n */\n UNSTABLE_portalContainer?: Element,\n /**\n * The placement of the tooltip with respect to the trigger.\n * @default 'top'\n */\n placement?: Placement\n}\n\nexport interface TooltipRenderProps {\n /**\n * The placement of the tooltip relative to the trigger.\n * @selector [data-placement=\"left | right | top | bottom\"]\n */\n placement: PlacementAxis | null,\n /**\n * Whether the tooltip is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the tooltip is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean,\n /**\n * State of the tooltip.\n */\n state: TooltipTriggerState\n}\n\nexport const TooltipTriggerStateContext = createContext<TooltipTriggerState | null>(null);\nexport const TooltipContext = createContext<ContextValue<TooltipProps, HTMLDivElement>>(null);\n\n/**\n * TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing\n * the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip\n * relative to the trigger.\n */\nexport function TooltipTrigger(props: TooltipTriggerComponentProps): JSX.Element {\n let state = useTooltipTriggerState(props);\n let ref = useRef<FocusableElement>(null);\n let {triggerProps, tooltipProps} = useTooltipTrigger(props, state, ref);\n\n return (\n <Provider\n values={[\n [TooltipTriggerStateContext, state],\n [TooltipContext, {...tooltipProps, triggerRef: ref}]\n ]}>\n <FocusableProvider {...triggerProps} ref={ref}>\n {props.children}\n </FocusableProvider>\n </Provider>\n );\n}\n\n/**\n * A tooltip displays a description of an element on hover or focus.\n */\nexport const Tooltip = /*#__PURE__*/ (forwardRef as forwardRefType)(function Tooltip({UNSTABLE_portalContainer, ...props}: TooltipProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TooltipContext);\n let contextState = useContext(TooltipTriggerStateContext);\n let localState = useTooltipTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n let isExiting = useExitAnimation(ref, state.isOpen) || props.isExiting || false;\n if (!state.isOpen && !isExiting) {\n return null;\n }\n\n return (\n <OverlayContainer portalContainer={UNSTABLE_portalContainer}>\n <TooltipInner {...props} tooltipRef={ref} isExiting={isExiting} />\n </OverlayContainer>\n );\n});\n\nfunction TooltipInner(props: TooltipProps & {isExiting: boolean, tooltipRef: RefObject<HTMLDivElement | null>}) {\n let state = useContext(TooltipTriggerStateContext)!;\n let arrowRef = useRef<HTMLDivElement>(null);\n\n let {overlayProps, arrowProps, placement, triggerAnchorPoint} = useOverlayPosition({\n placement: props.placement || 'top',\n targetRef: props.triggerRef!,\n overlayRef: props.tooltipRef,\n arrowRef,\n offset: props.offset,\n crossOffset: props.crossOffset,\n isOpen: state.isOpen,\n arrowBoundaryOffset: props.arrowBoundaryOffset,\n shouldFlip: props.shouldFlip,\n containerPadding: props.containerPadding,\n onClose: () => state.close(true)\n });\n\n let isEntering = useEnterAnimation(props.tooltipRef, !!placement) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Tooltip',\n values: {\n placement,\n isEntering,\n isExiting: props.isExiting,\n state\n }\n });\n\n props = mergeProps(props, overlayProps);\n let {tooltipProps} = useTooltip(props, state);\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, tooltipProps)}\n ref={props.tooltipRef}\n style={{\n ...overlayProps.style,\n '--trigger-anchor-point': triggerAnchorPoint ? `${triggerAnchorPoint.x}px ${triggerAnchorPoint.y}px` : undefined,\n ...renderProps.style\n } as CSSProperties}\n data-placement={placement ?? undefined}\n data-entering={isEntering || undefined}\n data-exiting={props.isExiting || undefined}>\n <OverlayArrowContext.Provider value={{...arrowProps, placement, ref: arrowRef}}>\n {renderProps.children}\n </OverlayArrowContext.Provider>\n </div>\n );\n}\n"],"names":[],"version":3,"file":"Tooltip.module.js.map"}
|
package/dist/Tree.main.js
CHANGED
|
@@ -25,7 +25,7 @@ $parcel$export(module.exports, "TreeStateContext", () => $c6576bb58bfa084b$expor
|
|
|
25
25
|
$parcel$export(module.exports, "Tree", () => $c6576bb58bfa084b$export$7fbedc92909ed28e);
|
|
26
26
|
$parcel$export(module.exports, "TreeItemContent", () => $c6576bb58bfa084b$export$4b687e3f663d618c);
|
|
27
27
|
$parcel$export(module.exports, "TreeItem", () => $c6576bb58bfa084b$export$53d36ab85dc89436);
|
|
28
|
-
$parcel$export(module.exports, "
|
|
28
|
+
$parcel$export(module.exports, "TreeLoadMoreItem", () => $c6576bb58bfa084b$export$533df5f8efd48cc9);
|
|
29
29
|
/*
|
|
30
30
|
* Copyright 2024 Adobe. All rights reserved.
|
|
31
31
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -55,7 +55,7 @@ class $c6576bb58bfa084b$var$TreeCollection {
|
|
|
55
55
|
yield* this.flattenedRows;
|
|
56
56
|
}
|
|
57
57
|
get size() {
|
|
58
|
-
return this.
|
|
58
|
+
return this.itemCount;
|
|
59
59
|
}
|
|
60
60
|
getKeys() {
|
|
61
61
|
return this.keyMap.keys();
|
|
@@ -72,7 +72,7 @@ class $c6576bb58bfa084b$var$TreeCollection {
|
|
|
72
72
|
}
|
|
73
73
|
getLastKey() {
|
|
74
74
|
var _this_flattenedRows_;
|
|
75
|
-
return (_this_flattenedRows_ = this.flattenedRows[this.
|
|
75
|
+
return (_this_flattenedRows_ = this.flattenedRows[this.flattenedRows.length - 1]) === null || _this_flattenedRows_ === void 0 ? void 0 : _this_flattenedRows_.key;
|
|
76
76
|
}
|
|
77
77
|
getKeyAfter(key) {
|
|
78
78
|
var _this_flattenedRows_;
|
|
@@ -104,13 +104,15 @@ class $c6576bb58bfa084b$var$TreeCollection {
|
|
|
104
104
|
}
|
|
105
105
|
constructor(opts){
|
|
106
106
|
this.keyMap = new Map();
|
|
107
|
+
this.itemCount = 0;
|
|
107
108
|
let { collection: collection, expandedKeys: expandedKeys } = opts;
|
|
108
|
-
let { flattenedRows: flattenedRows, keyMap: keyMap } = $c6576bb58bfa084b$var$flattenTree(collection, {
|
|
109
|
+
let { flattenedRows: flattenedRows, keyMap: keyMap, itemCount: itemCount } = $c6576bb58bfa084b$var$flattenTree(collection, {
|
|
109
110
|
expandedKeys: expandedKeys
|
|
110
111
|
});
|
|
111
112
|
this.flattenedRows = flattenedRows;
|
|
112
113
|
// Use generated keyMap because it contains the modified collection nodes (aka it adjusts the indexes so that they ignore the existence of the Content items)
|
|
113
114
|
this.keyMap = keyMap;
|
|
115
|
+
this.itemCount = itemCount;
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
118
|
const $c6576bb58bfa084b$export$dfae7d399eea2568 = /*#__PURE__*/ (0, $5SMu3$react.createContext)(null);
|
|
@@ -288,9 +290,7 @@ function $c6576bb58bfa084b$var$TreeInner({ props: props, collection: collection,
|
|
|
288
290
|
...values
|
|
289
291
|
});
|
|
290
292
|
let treeGridRowProps = {
|
|
291
|
-
'aria-level': 1
|
|
292
|
-
'aria-posinset': 1,
|
|
293
|
-
'aria-setsize': 1
|
|
293
|
+
'aria-level': 1
|
|
294
294
|
};
|
|
295
295
|
emptyState = /*#__PURE__*/ (0, ($parcel$interopDefault($5SMu3$react))).createElement("div", {
|
|
296
296
|
role: "row",
|
|
@@ -305,13 +305,13 @@ function $c6576bb58bfa084b$var$TreeInner({ props: props, collection: collection,
|
|
|
305
305
|
}
|
|
306
306
|
}, content));
|
|
307
307
|
}
|
|
308
|
+
let DOMProps = (0, $5SMu3$reactariautils.filterDOMProps)(props, {
|
|
309
|
+
global: true
|
|
310
|
+
});
|
|
308
311
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($5SMu3$react))).createElement((0, ($parcel$interopDefault($5SMu3$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($5SMu3$react))).createElement((0, $5SMu3$reactaria.FocusScope), null, /*#__PURE__*/ (0, ($parcel$interopDefault($5SMu3$react))).createElement("div", {
|
|
309
|
-
...(0, $5SMu3$
|
|
310
|
-
...renderProps,
|
|
311
|
-
...(0, $5SMu3$reactaria.mergeProps)(gridProps, focusProps, droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps),
|
|
312
|
+
...(0, $5SMu3$reactaria.mergeProps)(DOMProps, renderProps, gridProps, focusProps, droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps),
|
|
312
313
|
ref: ref,
|
|
313
314
|
slot: props.slot || undefined,
|
|
314
|
-
onScroll: props.onScroll,
|
|
315
315
|
"data-empty": state.collection.size === 0 || undefined,
|
|
316
316
|
"data-focused": isFocused || undefined,
|
|
317
317
|
"data-drop-target": isRootDropTarget || undefined,
|
|
@@ -346,7 +346,10 @@ function $c6576bb58bfa084b$var$TreeInner({ props: props, collection: collection,
|
|
|
346
346
|
renderDropIndicator: (0, $0c2289d253cb4544$exports.useRenderDropIndicator)(dragAndDropHooks, dropState)
|
|
347
347
|
})), emptyState)), dragPreview);
|
|
348
348
|
}
|
|
349
|
-
|
|
349
|
+
class $c6576bb58bfa084b$var$TreeContentNode extends (0, $5SMu3$reactariacollections.CollectionNode) {
|
|
350
|
+
}
|
|
351
|
+
$c6576bb58bfa084b$var$TreeContentNode.type = 'content';
|
|
352
|
+
const $c6576bb58bfa084b$export$4b687e3f663d618c = /*#__PURE__*/ (0, $5SMu3$reactariacollections.createLeafComponent)($c6576bb58bfa084b$var$TreeContentNode, function TreeItemContent(props) {
|
|
350
353
|
let values = (0, $5SMu3$react.useContext)($c6576bb58bfa084b$export$36b5dda0d9bc8f78);
|
|
351
354
|
let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
|
|
352
355
|
children: props.children,
|
|
@@ -357,7 +360,10 @@ const $c6576bb58bfa084b$export$4b687e3f663d618c = /*#__PURE__*/ (0, $5SMu3$react
|
|
|
357
360
|
}, renderProps.children);
|
|
358
361
|
});
|
|
359
362
|
const $c6576bb58bfa084b$export$36b5dda0d9bc8f78 = /*#__PURE__*/ (0, $5SMu3$react.createContext)(null);
|
|
360
|
-
|
|
363
|
+
class $c6576bb58bfa084b$var$TreeItemNode extends (0, $5SMu3$reactariacollections.CollectionNode) {
|
|
364
|
+
}
|
|
365
|
+
$c6576bb58bfa084b$var$TreeItemNode.type = 'item';
|
|
366
|
+
const $c6576bb58bfa084b$export$53d36ab85dc89436 = /*#__PURE__*/ (0, $5SMu3$reactariacollections.createBranchComponent)($c6576bb58bfa084b$var$TreeItemNode, (props, ref, item)=>{
|
|
361
367
|
var _this;
|
|
362
368
|
let state = (0, $5SMu3$react.useContext)($c6576bb58bfa084b$export$8953bccafd7bce87);
|
|
363
369
|
ref = (0, $5SMu3$reactariautils.useObjectRef)(ref);
|
|
@@ -481,6 +487,11 @@ const $c6576bb58bfa084b$export$53d36ab85dc89436 = /*#__PURE__*/ (0, $5SMu3$react
|
|
|
481
487
|
}
|
|
482
488
|
});
|
|
483
489
|
let activateButtonId = (0, $5SMu3$reactaria.useId)();
|
|
490
|
+
let DOMProps = (0, $5SMu3$reactariautils.filterDOMProps)(props, {
|
|
491
|
+
global: true
|
|
492
|
+
});
|
|
493
|
+
delete DOMProps.id;
|
|
494
|
+
delete DOMProps.onClick;
|
|
484
495
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($5SMu3$react))).createElement((0, ($parcel$interopDefault($5SMu3$react))).Fragment, null, dropIndicator && !dropIndicator.isHidden && /*#__PURE__*/ (0, ($parcel$interopDefault($5SMu3$react))).createElement("div", {
|
|
485
496
|
role: "row",
|
|
486
497
|
"aria-level": rowProps['aria-level'],
|
|
@@ -507,7 +518,7 @@ const $c6576bb58bfa084b$export$53d36ab85dc89436 = /*#__PURE__*/ (0, $5SMu3$react
|
|
|
507
518
|
tabIndex: -1,
|
|
508
519
|
ref: activateButtonRef
|
|
509
520
|
}) : null)), /*#__PURE__*/ (0, ($parcel$interopDefault($5SMu3$react))).createElement("div", {
|
|
510
|
-
...(0, $5SMu3$reactaria.mergeProps)(
|
|
521
|
+
...(0, $5SMu3$reactaria.mergeProps)(DOMProps, rowProps, focusProps, hoverProps, focusWithinProps, draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragProps),
|
|
511
522
|
...renderProps,
|
|
512
523
|
ref: ref,
|
|
513
524
|
// TODO: missing selectionBehavior, hasAction and allowsSelection data attribute equivalents (available in renderProps). Do we want those?
|
|
@@ -569,21 +580,38 @@ const $c6576bb58bfa084b$export$53d36ab85dc89436 = /*#__PURE__*/ (0, $5SMu3$react
|
|
|
569
580
|
]
|
|
570
581
|
}, children))));
|
|
571
582
|
});
|
|
572
|
-
const $c6576bb58bfa084b$export$
|
|
583
|
+
const $c6576bb58bfa084b$export$533df5f8efd48cc9 = (0, $5SMu3$reactariacollections.createLeafComponent)((0, $5SMu3$reactariacollections.LoaderNode), function TreeLoadingSentinel(props, ref, item) {
|
|
584
|
+
let { isVirtualized: isVirtualized } = (0, $5SMu3$react.useContext)((0, $3114c2382242bdc0$exports.CollectionRendererContext));
|
|
573
585
|
let state = (0, $5SMu3$react.useContext)($c6576bb58bfa084b$export$8953bccafd7bce87);
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
let
|
|
586
|
+
let { isLoading: isLoading, onLoadMore: onLoadMore, scrollOffset: scrollOffset, ...otherProps } = props;
|
|
587
|
+
let sentinelRef = (0, $5SMu3$react.useRef)(null);
|
|
588
|
+
let memoedLoadMoreProps = (0, $5SMu3$react.useMemo)(()=>({
|
|
589
|
+
onLoadMore: onLoadMore,
|
|
590
|
+
// this collection will update anytime a row is expanded/collapsed becaused the flattenedRows will change.
|
|
591
|
+
// This means onLoadMore will trigger but that might be ok cause the user should have logic to handle multiple loadMore calls
|
|
592
|
+
collection: state === null || state === void 0 ? void 0 : state.collection,
|
|
593
|
+
sentinelRef: sentinelRef,
|
|
594
|
+
scrollOffset: scrollOffset
|
|
595
|
+
}), [
|
|
596
|
+
onLoadMore,
|
|
597
|
+
scrollOffset,
|
|
598
|
+
state === null || state === void 0 ? void 0 : state.collection
|
|
599
|
+
]);
|
|
600
|
+
(0, $5SMu3$reactariautils.useLoadMoreSentinel)(memoedLoadMoreProps, sentinelRef);
|
|
601
|
+
ref = (0, $5SMu3$reactariautils.useObjectRef)(ref);
|
|
602
|
+
let { rowProps: rowProps, gridCellProps: gridCellProps } = (0, $5SMu3$reactaria.useTreeItem)({
|
|
577
603
|
node: item
|
|
578
604
|
}, state, ref);
|
|
579
605
|
let level = rowProps['aria-level'] || 1;
|
|
606
|
+
// For now don't include aria-posinset and aria-setsize on loader since they aren't keyboard focusable
|
|
607
|
+
// Arguably shouldn't include them ever since it might be confusing to the user to include the loaders as part of the
|
|
608
|
+
// item count
|
|
580
609
|
let ariaProps = {
|
|
581
|
-
|
|
582
|
-
'aria-
|
|
583
|
-
'aria-setsize': rowProps['aria-setsize']
|
|
610
|
+
role: 'row',
|
|
611
|
+
'aria-level': rowProps['aria-level']
|
|
584
612
|
};
|
|
585
613
|
let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
|
|
586
|
-
...
|
|
614
|
+
...otherProps,
|
|
587
615
|
id: undefined,
|
|
588
616
|
children: item.rendered,
|
|
589
617
|
defaultClassName: 'react-aria-TreeLoader',
|
|
@@ -591,15 +619,33 @@ const $c6576bb58bfa084b$export$9d1a587784d97b41 = (0, $5SMu3$reactariacollection
|
|
|
591
619
|
level: level
|
|
592
620
|
}
|
|
593
621
|
});
|
|
622
|
+
let style = {};
|
|
623
|
+
if (isVirtualized) style = {
|
|
624
|
+
display: 'contents'
|
|
625
|
+
};
|
|
594
626
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($5SMu3$react))).createElement((0, ($parcel$interopDefault($5SMu3$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($5SMu3$react))).createElement("div", {
|
|
595
|
-
|
|
627
|
+
style: {
|
|
628
|
+
position: 'relative',
|
|
629
|
+
width: 0,
|
|
630
|
+
height: 0
|
|
631
|
+
},
|
|
632
|
+
inert: (0, $5SMu3$reactariautils.inertValue)(true)
|
|
633
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($5SMu3$react))).createElement("div", {
|
|
634
|
+
"data-testid": "loadMoreSentinel",
|
|
635
|
+
ref: sentinelRef,
|
|
636
|
+
style: {
|
|
637
|
+
position: 'absolute',
|
|
638
|
+
height: 1,
|
|
639
|
+
width: 1
|
|
640
|
+
}
|
|
641
|
+
})), isLoading && renderProps.children && /*#__PURE__*/ (0, ($parcel$interopDefault($5SMu3$react))).createElement("div", {
|
|
596
642
|
ref: ref,
|
|
597
643
|
...(0, $5SMu3$reactaria.mergeProps)((0, $5SMu3$reactariautils.filterDOMProps)(props), ariaProps),
|
|
598
644
|
...renderProps,
|
|
599
645
|
"data-level": level
|
|
600
646
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($5SMu3$react))).createElement("div", {
|
|
601
|
-
|
|
602
|
-
|
|
647
|
+
...gridCellProps,
|
|
648
|
+
style: style
|
|
603
649
|
}, renderProps.children)));
|
|
604
650
|
});
|
|
605
651
|
function $c6576bb58bfa084b$var$convertExpanded(expanded) {
|
|
@@ -610,6 +656,8 @@ function $c6576bb58bfa084b$var$flattenTree(collection, opts) {
|
|
|
610
656
|
let { expandedKeys: expandedKeys = new Set() } = opts;
|
|
611
657
|
let keyMap = new Map();
|
|
612
658
|
let flattenedRows = [];
|
|
659
|
+
// Need to count the items here because BaseCollection will return the full item count regardless if items are hidden via collapsed rows
|
|
660
|
+
let itemCount = 0;
|
|
613
661
|
let visitNode = (node)=>{
|
|
614
662
|
if (node.type === 'item' || node.type === 'loader') {
|
|
615
663
|
let parentKey = node === null || node === void 0 ? void 0 : node.parentKey;
|
|
@@ -628,15 +676,20 @@ function $c6576bb58bfa084b$var$flattenTree(collection, opts) {
|
|
|
628
676
|
if (node.type === 'loader') clone.level = node.level + 1;
|
|
629
677
|
keyMap.set(clone.key, clone);
|
|
630
678
|
} else keyMap.set(node.key, node);
|
|
631
|
-
|
|
632
|
-
|
|
679
|
+
// Grab the modified node from the key map so our flattened list and modified key map point to the same nodes
|
|
680
|
+
let modifiedNode = keyMap.get(node.key) || node;
|
|
681
|
+
if (modifiedNode.level === 0 || modifiedNode.parentKey != null && expandedKeys.has(modifiedNode.parentKey) && flattenedRows.find((row)=>row.key === modifiedNode.parentKey)) {
|
|
682
|
+
if (modifiedNode.type === 'item') itemCount++;
|
|
683
|
+
flattenedRows.push(modifiedNode);
|
|
684
|
+
}
|
|
633
685
|
} else if (node.type !== null) keyMap.set(node.key, node);
|
|
634
686
|
for (let child of collection.getChildren(node.key))visitNode(child);
|
|
635
687
|
};
|
|
636
688
|
for (let node of collection)visitNode(node);
|
|
637
689
|
return {
|
|
638
690
|
flattenedRows: flattenedRows,
|
|
639
|
-
keyMap: keyMap
|
|
691
|
+
keyMap: keyMap,
|
|
692
|
+
itemCount: itemCount
|
|
640
693
|
};
|
|
641
694
|
}
|
|
642
695
|
function $c6576bb58bfa084b$var$TreeDropIndicatorWrapper(props, ref) {
|