@oracle/oraclejet-preact 19.0.6 → 19.0.8
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/amd/{BarChart-d94f9c56.js → BarChart-8521c53a.js} +2 -2
- package/amd/{BarChart-d94f9c56.js.map → BarChart-8521c53a.js.map} +1 -1
- package/amd/{Chart-3108fa88.js → Chart-061335fe.js} +2 -2
- package/amd/{Chart-3108fa88.js.map → Chart-061335fe.js.map} +1 -1
- package/amd/CheckboxSetContext-2e486ea8.js +2 -0
- package/amd/CheckboxSetContext-2e486ea8.js.map +1 -0
- package/amd/ColorPalette-d9ceb947.js +2 -0
- package/amd/{ColorPalette-b26f3861.js.map → ColorPalette-d9ceb947.js.map} +1 -1
- package/amd/{ColorPicker-d578df9c.js → ColorPicker-fdbea1d5.js} +2 -2
- package/amd/{ColorPicker-d578df9c.js.map → ColorPicker-fdbea1d5.js.map} +1 -1
- package/amd/{ComboChart-e61b5581.js → ComboChart-f3876b51.js} +2 -2
- package/amd/{ComboChart-e61b5581.js.map → ComboChart-f3876b51.js.map} +1 -1
- package/amd/{InputColor-192a309b.js → InputColor-d8c29025.js} +2 -2
- package/amd/{InputColor-192a309b.js.map → InputColor-d8c29025.js.map} +1 -1
- package/amd/InputDatePicker-8c8e14ca.js +2 -0
- package/amd/{InputDatePicker-c5ceeb44.js.map → InputDatePicker-8c8e14ca.js.map} +1 -1
- package/amd/{LineAreaChart-ee71fd90.js → LineAreaChart-07848f77.js} +2 -2
- package/amd/{LineAreaChart-ee71fd90.js.map → LineAreaChart-07848f77.js.map} +1 -1
- package/amd/NavigationListItem-82b0c382.js +2 -0
- package/amd/{NavigationListItem-cdbcc394.js.map → NavigationListItem-82b0c382.js.map} +1 -1
- package/amd/{OverflowTabBar-587b7c2a.js → OverflowTabBar-e2b5f36e.js} +2 -2
- package/amd/{OverflowTabBar-587b7c2a.js.map → OverflowTabBar-e2b5f36e.js.map} +1 -1
- package/amd/{OverflowTabBarItem-bcf24ceb.js → OverflowTabBarItem-e01e53ae.js} +2 -2
- package/amd/{OverflowTabBarItem-bcf24ceb.js.map → OverflowTabBarItem-e01e53ae.js.map} +1 -1
- package/amd/PRIVATE_Chart.js +1 -1
- package/amd/{ScatterChart-2b76df73.js → ScatterChart-292935ff.js} +2 -2
- package/amd/{ScatterChart-2b76df73.js.map → ScatterChart-292935ff.js.map} +1 -1
- package/amd/Theme-redwood/theme.css +210 -210
- package/amd/Theme-stable/theme.css +205 -205
- package/amd/UNSAFE_BarChart/__test__/BarChart.spec.js +1 -1
- package/amd/UNSAFE_BarChart.js +1 -1
- package/amd/UNSAFE_CheckboxItem.js +1 -1
- package/amd/UNSAFE_CheckboxItem.js.map +1 -1
- package/amd/UNSAFE_CheckboxSet.js +1 -1
- package/amd/UNSAFE_CheckboxSet.js.map +1 -1
- package/amd/UNSAFE_ColorPalette.js +1 -1
- package/amd/UNSAFE_ColorPicker.js +1 -1
- package/amd/UNSAFE_ComboChart.js +1 -1
- package/amd/UNSAFE_InputColor.js +1 -1
- package/amd/UNSAFE_InputDatePicker.js +1 -1
- package/amd/UNSAFE_LineAreaChart.js +1 -1
- package/amd/UNSAFE_NavigationList.js +1 -1
- package/amd/UNSAFE_OverflowTabBar.js +1 -1
- package/amd/UNSAFE_RichCheckboxSet.js +1 -1
- package/amd/UNSAFE_RichCheckboxSet.js.map +1 -1
- package/amd/UNSAFE_RichSelectionItem.js +1 -1
- package/amd/UNSAFE_RichSelectionItem.js.map +1 -1
- package/amd/UNSAFE_ScatterChart.js +1 -1
- package/amd/UNSAFE_TabBar.js +1 -1
- package/amd/UNSAFE_TabBarCommon.js +1 -1
- package/amd/UNSAFE_TabBarMixed.js +1 -1
- package/cjs/{BaseButton-d48ce138.js → BaseButton-acda944a.js} +2 -2
- package/cjs/{BaseButton-d48ce138.js.map → BaseButton-acda944a.js.map} +1 -1
- package/cjs/BaseCardView-43379b36.js +6 -6
- package/cjs/BaseRichSelection-9b1ada4d.js +9 -9
- package/cjs/BaseSwatchView-3d9dbf9a.js +2 -2
- package/cjs/{Button-fd334204.js → Button-170bea0b.js} +2 -2
- package/cjs/{Button-fd334204.js.map → Button-170bea0b.js.map} +1 -1
- package/cjs/ButtonSet-a1f0f8b9.js +2 -2
- package/cjs/ButtonSetButton-97ceb927.js +1 -1
- package/cjs/ButtonSetIconButton-5bad7aa5.js +4 -4
- package/cjs/{Center-1098ae1b.js → Center-8b52b781.js} +2 -2
- package/cjs/{Center-1098ae1b.js.map → Center-8b52b781.js.map} +1 -1
- package/cjs/{Chart-c07adbbd.js → Chart-55c4cd8f.js} +12 -12
- package/cjs/{Chart-c07adbbd.js.map → Chart-55c4cd8f.js.map} +1 -1
- package/cjs/CheckboxControl-45f11f7e.js +6 -6
- package/cjs/CheckboxRadioField-c707f81f.js +6 -6
- package/cjs/CheckboxRadioLabelValueLayout-e9110e5f.js +1 -1
- package/cjs/CheckboxSetContext-c62db26d.js +12 -0
- package/cjs/CheckboxSetContext-c62db26d.js.map +1 -0
- package/cjs/Chip-6d729286.js +1 -1
- package/cjs/ClearIcon-d2d959a1.js +1 -1
- package/cjs/CollapseIcon-7612943e.js +1 -1
- package/cjs/ColorPalette-ea5e1bed.js +2 -2
- package/cjs/{ColorPicker-e3c74415.js → ColorPicker-03036ee3.js} +4 -4
- package/cjs/{ColorPicker-e3c74415.js.map → ColorPicker-03036ee3.js.map} +1 -1
- package/cjs/ColorSwatch-590183e3.js +4 -4
- package/cjs/{CompactLabelAssistance-d5bbeb5e.js → CompactLabelAssistance-eb32e7f5.js} +6 -6
- package/cjs/{CompactLabelAssistance-d5bbeb5e.js.map → CompactLabelAssistance-eb32e7f5.js.map} +1 -1
- package/cjs/CompactUserAssistance-58a6899d.js +5 -5
- package/cjs/ComponentMessageContainer-1b9e8036.js +4 -4
- package/cjs/{DatePicker-b46146c5.js → DatePicker-142a4531.js} +8 -8
- package/cjs/{DatePicker-b46146c5.js.map → DatePicker-142a4531.js.map} +1 -1
- package/cjs/DatePickerHeader-305234ff.js +3 -3
- package/cjs/{Dialog-be4d8900.js → Dialog-152ab89d.js} +8 -8
- package/cjs/{Dialog-be4d8900.js.map → Dialog-152ab89d.js.map} +1 -1
- package/cjs/DirectionalCollapseArrowIcon-c6d6750f.js +1 -1
- package/cjs/DirectionalExpandArrowIcon-33ebe393.js +1 -1
- package/cjs/{Dropdown-b2579045.js → Dropdown-08111f9d.js} +6 -6
- package/cjs/{Dropdown-b2579045.js.map → Dropdown-08111f9d.js.map} +1 -1
- package/cjs/{EmbeddedIconButton-79de5690.js → EmbeddedIconButton-88b1a5cd.js} +2 -2
- package/cjs/{EmbeddedIconButton-79de5690.js.map → EmbeddedIconButton-88b1a5cd.js.map} +1 -1
- package/cjs/{EnvironmentProvider-8696a5b8.js → EnvironmentProvider-5a401f32.js} +3 -3
- package/cjs/{EnvironmentProvider-8696a5b8.js.map → EnvironmentProvider-5a401f32.js.map} +1 -1
- package/cjs/Expander-01af6642.js +1 -1
- package/cjs/{Flex-6ca216a7.js → Flex-a6d1c038.js} +2 -2
- package/cjs/{Flex-6ca216a7.js.map → Flex-a6d1c038.js.map} +1 -1
- package/cjs/{Floating-5a704a27.js → Floating-a360e16a.js} +4 -4
- package/cjs/{Floating-5a704a27.js.map → Floating-a360e16a.js.map} +1 -1
- package/cjs/{Grid-57fb11dc.js → Grid-44ca9332.js} +2 -2
- package/cjs/{Grid-57fb11dc.js.map → Grid-44ca9332.js.map} +1 -1
- package/cjs/{Gridlines-3bdce0b7.js → Gridlines-7e6b9ff9.js} +2 -2
- package/cjs/{Gridlines-3bdce0b7.js.map → Gridlines-7e6b9ff9.js.map} +1 -1
- package/cjs/GroupLoadingIndicator-19c221cd.js +1 -1
- package/cjs/{HighlightText-e622ae4f.js → HighlightText-188f85a6.js} +2 -2
- package/cjs/{HighlightText-e622ae4f.js.map → HighlightText-188f85a6.js.map} +1 -1
- package/cjs/Icon-bc05e7bd.js +3 -3
- package/cjs/IconButton-7ebfcb64.js +4 -4
- package/cjs/IconSwitchButton-84e07848.js +4 -4
- package/cjs/IconToggleButton-5cb32026.js +4 -4
- package/cjs/{IconUserAssistance-b0f33cac.js → IconUserAssistance-65d6d06c.js} +3 -3
- package/cjs/{IconUserAssistance-b0f33cac.js.map → IconUserAssistance-65d6d06c.js.map} +1 -1
- package/cjs/InlineHelp-8097a102.js +1 -1
- package/cjs/InlineUserAssistance-74680664.js +5 -5
- package/cjs/InputDateMask-8a4b2660.js +7 -7
- package/cjs/Label-670472a7.js +8 -8
- package/cjs/LabelValueLayout-efc94d8e.js +1 -1
- package/cjs/{Layer-28b1afce.js → Layer-c8668ea4.js} +3 -3
- package/cjs/{Layer-28b1afce.js.map → Layer-c8668ea4.js.map} +1 -1
- package/cjs/{LayerHost-aee0e070.js → LayerHost-f1a1533f.js} +2 -2
- package/cjs/{LayerHost-aee0e070.js.map → LayerHost-f1a1533f.js.map} +1 -1
- package/cjs/{LayerManager-fc4df14f.js → LayerManager-2a80307c.js} +2 -2
- package/cjs/{LayerManager-fc4df14f.js.map → LayerManager-2a80307c.js.map} +1 -1
- package/cjs/Link-33dcecc2.js +1 -1
- package/cjs/List-d4904e56.js +5 -5
- package/cjs/{LiveRegion-e410e187.js → LiveRegion-a2c839ea.js} +2 -2
- package/cjs/{LiveRegion-e410e187.js.map → LiveRegion-a2c839ea.js.map} +1 -1
- package/cjs/{MaxLengthLiveRegion-bfb22b29.js → MaxLengthLiveRegion-cf615038.js} +3 -3
- package/cjs/{MaxLengthLiveRegion-bfb22b29.js.map → MaxLengthLiveRegion-cf615038.js.map} +1 -1
- package/cjs/Message-4dfcf417.js +2 -2
- package/cjs/{MessageLayer-0b0feb51.js → MessageLayer-29034032.js} +6 -6
- package/cjs/{MessageLayer-0b0feb51.js.map → MessageLayer-29034032.js.map} +1 -1
- package/cjs/MessagesManager-5f1e36da.js +3 -3
- package/cjs/{Modal-0cea796e.js → Modal-b00b9f5e.js} +4 -4
- package/cjs/{Modal-0cea796e.js.map → Modal-b00b9f5e.js.map} +1 -1
- package/cjs/{MonthView-044bcacb.js → MonthView-7fc19b53.js} +4 -4
- package/cjs/{MonthView-044bcacb.js.map → MonthView-7fc19b53.js.map} +1 -1
- package/cjs/NavigationListItem-843e014d.js +8 -8
- package/cjs/NavigationListLinkItem-0931af4d.js +4 -4
- package/cjs/NumberInputText-565c84b9.js +6 -6
- package/cjs/OverflowTabBarItem-6c3c9629.js +7 -7
- package/cjs/PRIVATE_BaseCardView.js +22 -22
- package/cjs/PRIVATE_BaseSwatchView.js +5 -5
- package/cjs/PRIVATE_Chart.js +40 -40
- package/cjs/PRIVATE_CheckboxControl.js +26 -26
- package/cjs/PRIVATE_CheckboxRadioField.js +28 -28
- package/cjs/PRIVATE_ClearIcon.js +19 -19
- package/cjs/PRIVATE_ContainerDiagram.js +30 -30
- package/cjs/PRIVATE_DatePickerHeader.js +20 -20
- package/cjs/PRIVATE_DatePickerLayout.js +4 -4
- package/cjs/PRIVATE_EmbeddedIconButton.js +6 -6
- package/cjs/PRIVATE_Expander.js +19 -19
- package/cjs/PRIVATE_FormControls.js +21 -21
- package/cjs/PRIVATE_IconSwitchButton.js +17 -17
- package/cjs/PRIVATE_Icons/CheckboxCrossed.js +16 -16
- package/cjs/PRIVATE_Icons/CheckboxMixed.js +16 -16
- package/cjs/PRIVATE_Icons/CheckboxOff.js +16 -16
- package/cjs/PRIVATE_Icons/CheckboxOn.js +16 -16
- package/cjs/PRIVATE_Icons/DragV.js +16 -16
- package/cjs/PRIVATE_Icons/None.js +16 -16
- package/cjs/PRIVATE_List.js +20 -20
- package/cjs/PRIVATE_Message.js +20 -20
- package/cjs/PRIVATE_MessageLayer.js +12 -12
- package/cjs/PRIVATE_MonthView.js +7 -7
- package/cjs/PRIVATE_MonthYearGridView.js +7 -7
- package/cjs/PRIVATE_PlotArea.js +4 -4
- package/cjs/PRIVATE_RevealToggleIcon.js +18 -18
- package/cjs/PRIVATE_RichSelectionCommon.js +29 -29
- package/cjs/PRIVATE_SelectCommon.js +32 -32
- package/cjs/PRIVATE_StyledCard.js +4 -4
- package/cjs/PRIVATE_StyledCheckbox.js +16 -16
- package/cjs/PRIVATE_SwatchFlexView.js +5 -5
- package/cjs/PRIVATE_Table.js +37 -37
- package/cjs/PRIVATE_ThemedIcons/CalendarIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/ChartMarqueeSelectIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/ChartPanIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/ChartZoomIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/CheckIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/CheckboxCrossedIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/CheckboxMixedIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/CheckboxOffIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/CheckboxOnIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/CloseIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/CollapseIcon.js +17 -17
- package/cjs/PRIVATE_ThemedIcons/CollapseUpIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/DecrementIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/DeleteIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/DirectionalCollapseArrowIcon.js +17 -17
- package/cjs/PRIVATE_ThemedIcons/DirectionalExpandArrowIcon.js +17 -17
- package/cjs/PRIVATE_ThemedIcons/DragHandleIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/DropdownArrowIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/ExpandIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/HelpIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/IncrementIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/MenuButtonDropdownIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/MessageConfirmationIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/MessageErrorIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/MessageInfoIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/MessageWarningIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/MinusIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/NavDownIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/None.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/OverviewHorizontalDragHandleIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/PlusIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/RadioOffIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/RadioOnIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/SortAscendingIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/SortDescendingIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/ViewHideIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/ViewIcon.js +16 -16
- package/cjs/PRIVATE_TimeComponent.js +19 -19
- package/cjs/PRIVATE_VisOverview.js +16 -16
- package/cjs/PRIVATE_VisTabularDatatip.js +4 -4
- package/cjs/{Popup-080e8f67.js → Popup-91e33a1d.js} +11 -11
- package/cjs/{Popup-080e8f67.js.map → Popup-91e33a1d.js.map} +1 -1
- package/cjs/ProgressButtonLabelLayout-689a7a8d.js +3 -3
- package/cjs/{ProgressCircle-dcd9f3e3.js → ProgressCircle-fb0abf95.js} +2 -2
- package/cjs/{ProgressCircle-dcd9f3e3.js.map → ProgressCircle-fb0abf95.js.map} +1 -1
- package/cjs/ReadonlyTextFieldInput-00b3e796.js +1 -1
- package/cjs/RevealToggleIcon-98b44cc6.js +1 -1
- package/cjs/{SectionedContent-bece051b.js → SectionedContent-ac2d4bd2.js} +5 -5
- package/cjs/{SectionedContent-bece051b.js.map → SectionedContent-ac2d4bd2.js.map} +1 -1
- package/cjs/SelectMenuGroupContext-ae5e1373.js +7 -7
- package/cjs/SelectMobileFieldInput-33427c18.js +8 -8
- package/cjs/Selector-9b72f861.js +1 -1
- package/cjs/{SelectorAll-c7d87dc7.js → SelectorAll-c497a428.js} +7 -7
- package/cjs/{SelectorAll-c7d87dc7.js.map → SelectorAll-c497a428.js.map} +1 -1
- package/cjs/{Sheet-44b25f1d.js → Sheet-65ae604e.js} +4 -4
- package/cjs/{Sheet-44b25f1d.js.map → Sheet-65ae604e.js.map} +1 -1
- package/cjs/SortControl-5ca85c6b.js +3 -3
- package/cjs/{StyledCard-1767aa5b.js → StyledCard-acec9285.js} +2 -2
- package/cjs/{StyledCard-1767aa5b.js.map → StyledCard-acec9285.js.map} +1 -1
- package/cjs/{StyledLabelValueLayout-d7705c97.js → StyledLabelValueLayout-dd89f379.js} +2 -2
- package/cjs/{StyledLabelValueLayout-d7705c97.js.map → StyledLabelValueLayout-dd89f379.js.map} +1 -1
- package/cjs/StyledTextField-d8c8a3bf.js +5 -5
- package/cjs/Submenu-416179ad.js +1 -1
- package/cjs/TabBar-1885c9c5.js +7 -7
- package/cjs/TabBarContextMenu-42fdbda0.js +2 -2
- package/cjs/TabBarLayout-b74e2f96.js +1 -1
- package/cjs/Table-49575528.js +11 -11
- package/cjs/TextArea-8608dba1.js +5 -5
- package/cjs/TextField-71dba81e.js +3 -3
- package/cjs/Theme-redwood/theme.css +226 -226
- package/cjs/Theme-stable/theme.css +199 -199
- package/cjs/TimeComponentCanvas2D-471abe04.js +6 -6
- package/cjs/ToggleButton-14cd62ef.js +1 -1
- package/cjs/TruncatingText-82495650.js +1 -1
- package/cjs/UNSAFE_ActionCard.js +3 -3
- package/cjs/UNSAFE_BarChart.js +41 -41
- package/cjs/UNSAFE_BareButton.js +2 -2
- package/cjs/UNSAFE_BaseButton.js +5 -5
- package/cjs/UNSAFE_Button.js +6 -6
- package/cjs/UNSAFE_ButtonSet.js +4 -4
- package/cjs/UNSAFE_ButtonSetButton.js +5 -5
- package/cjs/UNSAFE_ButtonSetIconButton.js +17 -17
- package/cjs/UNSAFE_ButtonSetItem.js +18 -18
- package/cjs/UNSAFE_ButtonSetMultiple.js +4 -4
- package/cjs/UNSAFE_ButtonSetSingle.js +4 -4
- package/cjs/UNSAFE_Card.js +4 -4
- package/cjs/UNSAFE_CardFlexView.js +22 -22
- package/cjs/UNSAFE_CardGridView.js +22 -22
- package/cjs/UNSAFE_Center.js +5 -5
- package/cjs/UNSAFE_Checkbox.js +26 -26
- package/cjs/UNSAFE_CheckboxItem.js +66 -120
- package/cjs/UNSAFE_CheckboxItem.js.map +1 -1
- package/cjs/UNSAFE_CheckboxRadioField.js +4 -4
- package/cjs/UNSAFE_CheckboxSet.js +71 -42
- package/cjs/UNSAFE_CheckboxSet.js.map +1 -1
- package/cjs/UNSAFE_Chip.js +2 -2
- package/cjs/UNSAFE_Collapsible.js +18 -18
- package/cjs/UNSAFE_ColorPalette.js +19 -19
- package/cjs/UNSAFE_ColorPicker.js +44 -44
- package/cjs/UNSAFE_ColorSwatch.js +17 -17
- package/cjs/UNSAFE_ComboChart.js +41 -41
- package/cjs/UNSAFE_ComponentMessage.js +20 -20
- package/cjs/UNSAFE_ConveyorBelt.js +18 -18
- package/cjs/UNSAFE_DatePicker.js +27 -27
- package/cjs/UNSAFE_Diagram.js +30 -30
- package/cjs/UNSAFE_Dialog.js +23 -23
- package/cjs/UNSAFE_DragHandle.js +17 -17
- package/cjs/UNSAFE_DrawerLayout.js +12 -12
- package/cjs/UNSAFE_DrawerPopup.js +12 -12
- package/cjs/UNSAFE_Dropdown.js +15 -15
- package/cjs/UNSAFE_Environment.js +4 -4
- package/cjs/UNSAFE_ExpandableList.js +25 -25
- package/cjs/UNSAFE_FilePicker.js +4 -4
- package/cjs/UNSAFE_FlatTreeView.js +25 -25
- package/cjs/UNSAFE_Flex.js +4 -4
- package/cjs/UNSAFE_Floating.js +11 -11
- package/cjs/UNSAFE_FormLayout.js +2 -2
- package/cjs/UNSAFE_Gantt.js +23 -23
- package/cjs/UNSAFE_Grid.js +4 -4
- package/cjs/UNSAFE_HighlightText.js +4 -4
- package/cjs/UNSAFE_Icon.js +16 -16
- package/cjs/UNSAFE_IconButton.js +17 -17
- package/cjs/UNSAFE_IconMenuButton.js +27 -27
- package/cjs/UNSAFE_IconProgressButton.js +20 -20
- package/cjs/UNSAFE_IconToggleButton.js +17 -17
- package/cjs/UNSAFE_Indexer.js +6 -6
- package/cjs/UNSAFE_InlineSelectSingle.js +33 -33
- package/cjs/UNSAFE_InputColor.js +35 -35
- package/cjs/UNSAFE_InputDateMask.js +27 -27
- package/cjs/UNSAFE_InputDatePicker.js +38 -38
- package/cjs/UNSAFE_InputPassword.js +27 -27
- package/cjs/UNSAFE_InputSensitiveText.js +28 -28
- package/cjs/UNSAFE_InputText.js +29 -29
- package/cjs/UNSAFE_InputTimeMask.js +27 -27
- package/cjs/UNSAFE_Label.js +26 -26
- package/cjs/UNSAFE_LabelValueLayout.js +4 -4
- package/cjs/UNSAFE_LabelledLink.js +28 -28
- package/cjs/UNSAFE_Layer.js +8 -8
- package/cjs/UNSAFE_Legend.js +29 -29
- package/cjs/UNSAFE_LineAreaChart.js +41 -41
- package/cjs/UNSAFE_Link.js +2 -2
- package/cjs/UNSAFE_ListItemLayout.js +4 -4
- package/cjs/UNSAFE_ListView.js +30 -30
- package/cjs/UNSAFE_LiveRegion.js +4 -4
- package/cjs/UNSAFE_Menu.js +28 -28
- package/cjs/UNSAFE_MenuButton.js +27 -27
- package/cjs/UNSAFE_MessageBanner.js +20 -20
- package/cjs/UNSAFE_MessageToast.js +22 -22
- package/cjs/UNSAFE_MeterBar.js +16 -16
- package/cjs/UNSAFE_MeterCircle.js +17 -17
- package/cjs/UNSAFE_Modal.js +9 -9
- package/cjs/UNSAFE_NavigationList.js +30 -30
- package/cjs/UNSAFE_NavigationListCommon.js +20 -20
- package/cjs/UNSAFE_NumberInputText.js +29 -29
- package/cjs/UNSAFE_OverflowTabBar.js +29 -29
- package/cjs/UNSAFE_PictoChart.js +27 -27
- package/cjs/UNSAFE_PieChart.js +28 -28
- package/cjs/UNSAFE_Popup.js +19 -19
- package/cjs/UNSAFE_ProgressBar.js +4 -4
- package/cjs/UNSAFE_ProgressButton.js +20 -20
- package/cjs/UNSAFE_ProgressButtonLabelLayout.js +10 -10
- package/cjs/UNSAFE_ProgressCircle.js +4 -4
- package/cjs/UNSAFE_RadioItem.js +26 -26
- package/cjs/UNSAFE_RadioSet.js +27 -27
- package/cjs/UNSAFE_RatingGauge.js +18 -18
- package/cjs/UNSAFE_ReorderableTabBar.js +27 -27
- package/cjs/UNSAFE_RichCheckboxSet.js +50 -54
- package/cjs/UNSAFE_RichCheckboxSet.js.map +1 -1
- package/cjs/UNSAFE_RichRadioSet.js +29 -29
- package/cjs/UNSAFE_RichSelectionItem.js +50 -193
- package/cjs/UNSAFE_RichSelectionItem.js.map +1 -1
- package/cjs/UNSAFE_ScatterChart.js +41 -41
- package/cjs/UNSAFE_SectionalLegend.js +29 -29
- package/cjs/UNSAFE_SelectMultiple.js +36 -36
- package/cjs/UNSAFE_SelectSingle.js +35 -35
- package/cjs/UNSAFE_SelectionCard.js +4 -4
- package/cjs/UNSAFE_Selector.js +16 -16
- package/cjs/UNSAFE_SelectorAll.js +20 -20
- package/cjs/UNSAFE_Sheet.js +13 -13
- package/cjs/UNSAFE_SortControl.js +20 -20
- package/cjs/UNSAFE_SplitMenuButton.js +27 -27
- package/cjs/UNSAFE_TabBar.js +30 -30
- package/cjs/UNSAFE_TabBarCommon.js +30 -30
- package/cjs/UNSAFE_TabBarMixed.js +30 -30
- package/cjs/UNSAFE_TableView.js +37 -37
- package/cjs/UNSAFE_TagCloud.js +28 -28
- package/cjs/UNSAFE_TextArea.js +28 -28
- package/cjs/UNSAFE_TextAreaAutosize.js +28 -28
- package/cjs/UNSAFE_TextField.js +20 -20
- package/cjs/UNSAFE_ToggleButton.js +5 -5
- package/cjs/UNSAFE_Toolbar.js +4 -4
- package/cjs/UNSAFE_Train.js +17 -17
- package/cjs/UNSAFE_TruncatingBadge.js +17 -17
- package/cjs/UNSAFE_TruncatingText.js +17 -17
- package/cjs/UNSAFE_UserAssistance.js +27 -27
- package/cjs/UNSAFE_View.js +7 -7
- package/cjs/UNSAFE_VirtualizedListView.js +20 -20
- package/cjs/UNSAFE_VisProgressiveLoader.js +5 -5
- package/cjs/UNSAFE_VisStatusMessage.js +5 -5
- package/cjs/UNSAFE_WindowOverlay.js +4 -4
- package/cjs/{View-7d9034a7.js → View-251db2a6.js} +5 -5
- package/cjs/{View-7d9034a7.js.map → View-251db2a6.js.map} +1 -1
- package/cjs/{VisTabularDatatip-9e44a7dd.js → VisTabularDatatip-f9ba79d0.js} +2 -2
- package/cjs/{VisTabularDatatip-9e44a7dd.js.map → VisTabularDatatip-f9ba79d0.js.map} +1 -1
- package/cjs/{WindowOverlay-a10f995e.js → WindowOverlay-5a341d43.js} +2 -2
- package/cjs/{WindowOverlay-a10f995e.js.map → WindowOverlay-5a341d43.js.map} +1 -1
- package/cjs/{YearsGridView-6c18a6df.js → YearsGridView-5062a05d.js} +4 -4
- package/cjs/{YearsGridView-6c18a6df.js.map → YearsGridView-5062a05d.js.map} +1 -1
- package/cjs/hoc/PRIVATE_withDirectionIcon.js +4 -4
- package/cjs/hoc/PRIVATE_withThemeIcon.js +3 -3
- package/cjs/hoc/UNSAFE_withThemeProps.js +3 -3
- package/cjs/hooks/PRIVATE_useChartContextMenu.js +25 -25
- package/cjs/hooks/PRIVATE_useChartDatatip.js +14 -14
- package/cjs/hooks/PRIVATE_useChartEvents.js +19 -19
- package/cjs/hooks/PRIVATE_useChartMarquee.js +19 -19
- package/cjs/hooks/PRIVATE_useCssVars.js +7 -7
- package/cjs/hooks/PRIVATE_useCurrentKey.js +4 -4
- package/cjs/hooks/PRIVATE_useDatatip.js +12 -12
- package/cjs/hooks/PRIVATE_useFloating.js +4 -4
- package/cjs/hooks/PRIVATE_useListCommon.js +5 -5
- package/cjs/hooks/PRIVATE_useOutsideMousedown.js +9 -9
- package/cjs/hooks/PRIVATE_useReorderable.js +5 -5
- package/cjs/hooks/PRIVATE_useRovingTabIndexContainer.js +4 -4
- package/cjs/hooks/PRIVATE_useSelection.js +4 -4
- package/cjs/hooks/PRIVATE_useTabBar.js +26 -26
- package/cjs/hooks/PRIVATE_useTooltipOnTruncation.js +17 -17
- package/cjs/hooks/PRIVATE_useVisContextMenu.js +25 -25
- package/cjs/hooks/PRIVATE_useVisDragModeControls.js +19 -19
- package/cjs/hooks/PRIVATE_useVisEvents.js +4 -4
- package/cjs/hooks/PRIVATE_useVisMeterEvents.js +14 -14
- package/cjs/hooks/PRIVATE_useVisSelection.js +15 -15
- package/cjs/hooks/UNSAFE_useBareButton.js +2 -2
- package/cjs/hooks/UNSAFE_useColorScheme.js +3 -3
- package/cjs/hooks/UNSAFE_useCurrentBgColor.js +2 -2
- package/cjs/hooks/UNSAFE_useDensity.js +3 -3
- package/cjs/hooks/UNSAFE_useHiddenTestMethod.js +3 -3
- package/cjs/hooks/UNSAFE_useOutsideClick.js +8 -8
- package/cjs/hooks/UNSAFE_usePrefixSuffix.js +4 -4
- package/cjs/hooks/UNSAFE_useScale.js +3 -3
- package/cjs/hooks/UNSAFE_useTestId.js +3 -3
- package/cjs/hooks/UNSAFE_useTheme.js +3 -3
- package/cjs/hooks/UNSAFE_useThemeInterpolations.js +6 -6
- package/cjs/hooks/UNSAFE_useTooltip.js +17 -17
- package/cjs/hooks/UNSAFE_useTranslationBundle.js +3 -3
- package/cjs/hooks/UNSAFE_useUser.js +3 -3
- package/cjs/{popupUtils-488fe8f7.js → popupUtils-96acfe58.js} +2 -2
- package/cjs/{popupUtils-488fe8f7.js.map → popupUtils-96acfe58.js.map} +1 -1
- package/cjs/{tooltipUtils-ae48fed6.js → tooltipUtils-842e04c7.js} +5 -5
- package/cjs/{tooltipUtils-ae48fed6.js.map → tooltipUtils-842e04c7.js.map} +1 -1
- package/cjs/useBareButton-3c8d1a5d.js +1 -1
- package/cjs/useCellNavigation-d5b07844.js +1 -1
- package/cjs/useChartContextMenu-a8c6d928.js +2 -2
- package/cjs/{useChartDatatip-76d4aeaa.js → useChartDatatip-488151ad.js} +4 -4
- package/cjs/{useChartDatatip-76d4aeaa.js.map → useChartDatatip-488151ad.js.map} +1 -1
- package/cjs/{useColorScheme-23e4aab4.js → useColorScheme-a379cdb9.js} +2 -2
- package/cjs/{useColorScheme-23e4aab4.js.map → useColorScheme-a379cdb9.js.map} +1 -1
- package/cjs/useContextMenu-e90f401c.js +2 -2
- package/cjs/{useCssVars-cc025013.js → useCssVars-7a254269.js} +5 -5
- package/cjs/{useCssVars-cc025013.js.map → useCssVars-7a254269.js.map} +1 -1
- package/cjs/{useCurrentKey-76fed320.js → useCurrentKey-25fa7256.js} +2 -2
- package/cjs/{useCurrentKey-76fed320.js.map → useCurrentKey-25fa7256.js.map} +1 -1
- package/cjs/{useDatatip-4f6d3759.js → useDatatip-44a30e0a.js} +4 -4
- package/cjs/{useDatatip-4f6d3759.js.map → useDatatip-44a30e0a.js.map} +1 -1
- package/cjs/{useDensity-022a8f80.js → useDensity-a1ed72b0.js} +2 -2
- package/cjs/{useDensity-022a8f80.js.map → useDensity-a1ed72b0.js.map} +1 -1
- package/cjs/useDisplayValue-981e83e0.js +5 -5
- package/cjs/{useExpandCollapse-336b4f0c.js → useExpandCollapse-6267248f.js} +2 -2
- package/cjs/{useExpandCollapse-336b4f0c.js.map → useExpandCollapse-6267248f.js.map} +1 -1
- package/cjs/{useFloating-13101293.js → useFloating-768519ce.js} +2 -2
- package/cjs/{useFloating-13101293.js.map → useFloating-768519ce.js.map} +1 -1
- package/cjs/{useHiddenTestMethod-51be5bf2.js → useHiddenTestMethod-07be6a8e.js} +2 -2
- package/cjs/{useHiddenTestMethod-51be5bf2.js.map → useHiddenTestMethod-07be6a8e.js.map} +1 -1
- package/cjs/{useKeyboardEvents-caa4eb2d.js → useKeyboardEvents-aeae6a28.js} +2 -2
- package/cjs/{useKeyboardEvents-caa4eb2d.js.map → useKeyboardEvents-aeae6a28.js.map} +1 -1
- package/cjs/useLegendContextMenu-2a905d60.js +4 -4
- package/cjs/{useMeterDatatip-45a314e6.js → useMeterDatatip-05aea311.js} +3 -3
- package/cjs/{useMeterDatatip-45a314e6.js.map → useMeterDatatip-05aea311.js.map} +1 -1
- package/cjs/useNavigation-49344b44.js +1 -1
- package/cjs/{useOutsideClick-c3802f86.js → useOutsideClick-0ad85b65.js} +2 -2
- package/cjs/{useOutsideClick-c3802f86.js.map → useOutsideClick-0ad85b65.js.map} +1 -1
- package/cjs/{useOutsideMousedown-8f913d1a.js → useOutsideMousedown-fee3f752.js} +2 -2
- package/cjs/{useOutsideMousedown-8f913d1a.js.map → useOutsideMousedown-fee3f752.js.map} +1 -1
- package/cjs/{usePopupAnimation-18040396.js → usePopupAnimation-d24b74af.js} +2 -2
- package/cjs/{usePopupAnimation-18040396.js.map → usePopupAnimation-d24b74af.js.map} +1 -1
- package/cjs/{usePrefixSuffix-37dfbfbd.js → usePrefixSuffix-aca06b3b.js} +2 -2
- package/cjs/{usePrefixSuffix-37dfbfbd.js.map → usePrefixSuffix-aca06b3b.js.map} +1 -1
- package/cjs/{useReorderableItem-db13db70.js → useReorderableItem-cee284be.js} +3 -3
- package/cjs/{useReorderableItem-db13db70.js.map → useReorderableItem-cee284be.js.map} +1 -1
- package/cjs/{useRovingTabIndexContainer-a3594203.js → useRovingTabIndexContainer-7474adbd.js} +2 -2
- package/cjs/{useRovingTabIndexContainer-a3594203.js.map → useRovingTabIndexContainer-7474adbd.js.map} +1 -1
- package/cjs/{useScale-adc62f41.js → useScale-349360cd.js} +2 -2
- package/cjs/{useScale-adc62f41.js.map → useScale-349360cd.js.map} +1 -1
- package/cjs/useSelectCommon-c3f3b7bc.js +5 -5
- package/cjs/{useSelectDrill-d6321bb7.js → useSelectDrill-97935ff4.js} +3 -3
- package/cjs/{useSelectDrill-d6321bb7.js.map → useSelectDrill-97935ff4.js.map} +1 -1
- package/cjs/{useSelection-45d53f55.js → useSelection-1ffadc6e.js} +6 -6
- package/cjs/{useSelection-45d53f55.js.map → useSelection-1ffadc6e.js.map} +1 -1
- package/cjs/{useSelection-e11d979f.js → useSelection-ec8ed204.js} +2 -2
- package/cjs/{useSelection-e11d979f.js.map → useSelection-ec8ed204.js.map} +1 -1
- package/cjs/useTabBar-6df595c7.js +3 -3
- package/cjs/{useTestId-9093a54b.js → useTestId-15ee37d6.js} +2 -2
- package/cjs/{useTestId-9093a54b.js.map → useTestId-15ee37d6.js.map} +1 -1
- package/cjs/{useTheme-09dfbb78.js → useTheme-9ced18e9.js} +2 -2
- package/cjs/{useTheme-09dfbb78.js.map → useTheme-9ced18e9.js.map} +1 -1
- package/cjs/{useThemeInterpolations-4faece98.js → useThemeInterpolations-b29f0f7d.js} +5 -5
- package/cjs/{useThemeInterpolations-4faece98.js.map → useThemeInterpolations-b29f0f7d.js.map} +1 -1
- package/cjs/{useTooltip-8728f2ff.js → useTooltip-43bfe8a3.js} +2 -2
- package/cjs/{useTooltip-8728f2ff.js.map → useTooltip-43bfe8a3.js.map} +1 -1
- package/cjs/{useTooltipControlled-3c2afa53.js → useTooltipControlled-4a59aaf5.js} +5 -5
- package/cjs/{useTooltipControlled-3c2afa53.js.map → useTooltipControlled-4a59aaf5.js.map} +1 -1
- package/cjs/{useTooltipOnTruncation-781972d7.js → useTooltipOnTruncation-77728bdf.js} +4 -4
- package/cjs/{useTooltipOnTruncation-781972d7.js.map → useTooltipOnTruncation-77728bdf.js.map} +1 -1
- package/cjs/{useTranslationBundle-18b7bf8b.js → useTranslationBundle-24c593f4.js} +2 -2
- package/cjs/{useTranslationBundle-18b7bf8b.js.map → useTranslationBundle-24c593f4.js.map} +1 -1
- package/cjs/{useUser-f900ddf1.js → useUser-081e5bd5.js} +2 -2
- package/cjs/{useUser-f900ddf1.js.map → useUser-081e5bd5.js.map} +1 -1
- package/cjs/useVisDragModeControls-6acfca25.js +1 -1
- package/cjs/{useVisEvents-9b21e260.js → useVisEvents-c0863287.js} +2 -2
- package/cjs/{useVisEvents-9b21e260.js.map → useVisEvents-c0863287.js.map} +1 -1
- package/cjs/utils/PRIVATE_tooltipUtils.js +14 -14
- package/cjs/utils/PRIVATE_visTestUtils.js +4 -4
- package/cjs/utils/UNSAFE_popupUtils.js +8 -8
- package/cjs/{withDirectionIcon-edb93142.js → withDirectionIcon-574c8e58.js} +2 -2
- package/cjs/{withDirectionIcon-edb93142.js.map → withDirectionIcon-574c8e58.js.map} +1 -1
- package/cjs/withThemeProps-59cfaa3e.js +2 -2
- package/es/{Expander-f035d214.js → Expander-138433a6.js} +2 -2
- package/es/{Expander-f035d214.js.map → Expander-138433a6.js.map} +1 -1
- package/es/MeterCircleVariants.styles.css +8 -8
- package/es/MeterCircleVariants.styles2.css +8 -8
- package/es/{NavigationListItem-70f70367.js → NavigationListItem-db2a88ef.js} +2 -4
- package/es/{NavigationListItem-70f70367.js.map → NavigationListItem-db2a88ef.js.map} +1 -1
- package/es/NavigationListItemVariants.styles.css +4 -4
- package/es/NavigationListItemVariants.styles2.css +4 -4
- package/es/{NavigationListLinkItem-8a575042.js → NavigationListLinkItem-fc69548b.js} +2 -2
- package/es/{NavigationListLinkItem-8a575042.js.map → NavigationListLinkItem-fc69548b.js.map} +1 -1
- package/es/{OverflowTabBarItem-187bd359.js → OverflowTabBarItem-49be7e0a.js} +4 -4
- package/es/{OverflowTabBarItem-187bd359.js.map → OverflowTabBarItem-49be7e0a.js.map} +1 -1
- package/es/PRIVATE_Expander.js +55 -55
- package/es/PRIVATE_Table.js +5 -5
- package/es/SegmentStyles.styles.css +8 -11
- package/es/SegmentStyles.styles2.css +11 -8
- package/es/{SortControl-36062682.js → SortControl-2eaa26f5.js} +2 -2
- package/es/{SortControl-36062682.js.map → SortControl-2eaa26f5.js.map} +1 -1
- package/es/{TabBar-218d6e96.js → TabBar-0de29233.js} +1 -3
- package/es/{TabBar-218d6e96.js.map → TabBar-0de29233.js.map} +1 -1
- package/es/{TabBarLinkItem-574d7229.js → TabBarLinkItem-af4541c2.js} +2 -2
- package/es/{TabBarLinkItem-574d7229.js.map → TabBarLinkItem-af4541c2.js.map} +1 -1
- package/es/{Table-3f93cee3.js → Table-c8a87739.js} +2 -2
- package/es/{Table-3f93cee3.js.map → Table-c8a87739.js.map} +1 -1
- package/es/Theme-redwood/theme.css +439 -439
- package/es/Theme-stable/theme.css +469 -469
- package/es/TrainVariants.styles.css +6 -6
- package/es/TrainVariants.styles2.css +6 -6
- package/es/UNSAFE_FlatTreeView.js +30 -30
- package/es/UNSAFE_InputDateMask/themes/SegmentStyles.css.js +1 -1
- package/es/UNSAFE_InputDateMask.js +1 -1
- package/es/UNSAFE_InputDatePicker.js +1 -1
- package/es/UNSAFE_InputTimeMask/themes/SegmentStyles.css.js +1 -1
- package/es/UNSAFE_InputTimeMask.js +1 -1
- package/es/UNSAFE_MeterCircle/themes/redwood/MeterCircleTheme.js +1 -1
- package/es/UNSAFE_MeterCircle/themes/redwood/MeterCircleVariants.css.js +1 -1
- package/es/UNSAFE_MeterCircle/themes/stable/MeterCircleTheme.js +1 -1
- package/es/UNSAFE_MeterCircle/themes/stable/MeterCircleVariants.css.js +1 -1
- package/es/UNSAFE_MeterCircle.js +1 -1
- package/es/UNSAFE_NavigationList/themes/redwood/NavigationListItemVariants.css.js +1 -1
- package/es/UNSAFE_NavigationList/themes/stable/NavigationListItemTheme.js +1 -1
- package/es/UNSAFE_NavigationList/themes/stable/NavigationListItemVariants.css.js +1 -1
- package/es/UNSAFE_NavigationList.js +14 -14
- package/es/UNSAFE_NavigationListCommon/themes/redwood/NavigationListItemTheme.js +1 -1
- package/es/UNSAFE_NavigationListCommon.js +3 -3
- package/es/UNSAFE_OverflowTabBar.js +36 -36
- package/es/UNSAFE_ReorderableTabBar.js +9 -30
- package/es/UNSAFE_ReorderableTabBar.js.map +1 -1
- package/es/UNSAFE_SortControl.js +47 -47
- package/es/UNSAFE_TabBar.js +36 -36
- package/es/UNSAFE_TabBarCommon.js +56 -56
- package/es/UNSAFE_TabBarMixed.js +35 -35
- package/es/UNSAFE_TableView.js +5 -5
- package/es/UNSAFE_Train/themes/redwood/TrainTheme.js +1 -1
- package/es/UNSAFE_Train/themes/redwood/TrainVariants.css.js +1 -1
- package/es/UNSAFE_Train/themes/stable/TrainTheme.js +1 -1
- package/es/UNSAFE_Train/themes/stable/TrainVariants.css.js +1 -1
- package/es/UNSAFE_Train.js +1 -1
- package/package.json +2 -2
- package/amd/CheckboxSet-678ea1d4.js +0 -2
- package/amd/CheckboxSet-678ea1d4.js.map +0 -1
- package/amd/ColorPalette-b26f3861.js +0 -2
- package/amd/InputDatePicker-c5ceeb44.js +0 -2
- package/amd/NavigationListItem-cdbcc394.js +0 -2
- package/cjs/CheckboxSet-ee5f6850.js +0 -53
- package/cjs/CheckboxSet-ee5f6850.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputDatePicker-c5ceeb44.js","sources":["../../src/UNSAFE_InputDatePicker/InputDatePickerDropdown.tsx","../../src/UNSAFE_InputDatePicker/useInputDatePickerState.ts","../../src/UNSAFE_InputDatePicker/useInputDatePicker.ts","../../src/UNSAFE_InputDatePicker/InputDatePicker.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { ComponentProps } from 'preact';\nimport { useCallback, useState } from 'preact/hooks';\nimport { BundleType } from '../resources/nls/bundle';\nimport { DatePicker } from '#UNSAFE_DatePicker';\nimport { type CloseDetail as DropdownCloseDetail } from '#UNSAFE_Dropdown';\nimport { getClientHints } from '#utils/PRIVATE_clientHints';\nimport { FormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { InlineUserAssistance } from '../UNSAFE_UserAssistance';\nimport { InputDatePicker } from './InputDatePicker';\nimport { dropdownStyles, userAssistanceStyles } from './themes/InputDatePickerDropdownStyles.css';\nimport { PositionData } from '../UNSAFE_Floating';\nimport { StickyPositioningDropdown } from '#PRIVATE_FormControls';\nimport { SectionedContent } from '#PRIVATE_FormControls';\nimport { type CloseDetail as SheetCloseDetail, Sheet } from '#UNSAFE_Sheet';\nimport type { TestIdProps } from '#hooks/UNSAFE_useTestId';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport { SizeOptions } from '#UNSAFE_Floating/Floating';\n\ntype StickyPositioningDropdownProps = ComponentProps<typeof StickyPositioningDropdown>;\ntype InputDatePickerProps = ComponentProps<typeof InputDatePicker>;\ntype PickedPropsFromInputDatePicker = Pick<\n InputDatePickerProps,\n | 'assistiveText'\n | 'dayFormatter'\n | 'daysOutsideMonth'\n | 'helpSourceLink'\n | 'helpSourceText'\n | 'isDisabled'\n | 'isReadonly'\n | 'label'\n | 'messages'\n | 'min'\n | 'max'\n | 'monthAndYearPicker'\n | 'todayButton'\n | 'todayTimeZone'\n | 'userAssistanceDensity'\n | 'value'\n | 'weekDisplay'\n>;\ntype DatePickerProps = ComponentProps<typeof DatePicker>;\ntype PickedPropsFromDatePicker = Pick<DatePickerProps, 'value' | 'onCommit'>;\ntype PickedPropsFromDropdown = Omit<StickyPositioningDropdownProps, 'onClose'>;\ntype CloseDetail = SheetCloseDetail | DropdownCloseDetail;\n\ntype Props = PickedPropsFromDatePicker &\n PickedPropsFromInputDatePicker &\n PickedPropsFromDropdown &\n TestIdProps & {\n /**\n * Called when the dropdown or sheet is supposed to be closed.\n */\n onClose?: (detail: CloseDetail) => void;\n };\n\n/**\n * Component that renders DatePicker either inside a dropdown or sheet; at small screen\n * widths, it renders inside a sheet. Additionally, when a dropdown is being shown beneath\n * the component, we also show any user assistance text or messages below the picker\n * because otherwise that information would be obscured from view. When a sheet is being\n * shown, it will always display UA and messages at the bottom of the sheet.\n */\nconst InputDatePickerDropdown = ({\n anchorRef,\n assistiveText,\n dayFormatter,\n daysOutsideMonth,\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isOpen,\n isReadonly,\n label,\n onClose,\n onCommit,\n max,\n messages,\n min,\n monthAndYearPicker,\n testId,\n todayButton,\n todayTimeZone,\n userAssistanceDensity,\n value,\n weekDisplay\n}: Props) => {\n // If the dropdown opens above the component, we don't want to show UA or messages.\n const [isDropdownAbove, setDropdownAbove] = useState(false);\n const [prevIsOpen, setPrevIsOpen] = useState(isOpen);\n const handleDropdownPosition = useCallback<\n NonNullable<StickyPositioningDropdownProps['onPosition']>\n >((data: PositionData) => {\n setDropdownAbove(data.placement.startsWith('top'));\n }, []);\n // Reset the flag when the dropdown is closed.\n if (prevIsOpen !== isOpen) {\n setPrevIsOpen(isOpen);\n if (!isOpen) {\n setDropdownAbove(false);\n }\n }\n\n const sizeOptions: SizeOptions = {\n isMaxWidthAdjusted: false,\n isMaxHeightAdjusted: true\n };\n\n // On mobile phones, the dropdown becomes a sheet.\n const shouldShowSheet = isPhone();\n\n const { datePicker_label } = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const datePickerAriaLabel = datePicker_label();\n\n const datePickerMainContent = (\n <DatePicker\n dayFormatter={dayFormatter}\n daysOutsideMonth={daysOutsideMonth}\n height={!shouldShowSheet ? 'auto' : undefined}\n onCommit={onCommit}\n max={max}\n min={min}\n // for sheet, we want the width to grow to the width of the sheet, otherwise it will use the theme default.\n maxWidth={shouldShowSheet ? '100%' : undefined}\n width=\"100%\"\n monthAndYearPicker={monthAndYearPicker}\n testId={testId}\n todayTimeZone={todayTimeZone}\n todayButton={todayButton}\n value={value}\n weekDisplay={weekDisplay}\n />\n );\n\n const inlineUserAssistanceFooter =\n isOpen &&\n (!isDropdownAbove || shouldShowSheet) &&\n !isDisabled &&\n !isReadonly &&\n (assistiveText || helpSourceLink || (messages && messages.length > 0)) &&\n (userAssistanceDensity === 'efficient' || userAssistanceDensity === 'reflow') ? (\n <FormFieldContext.Provider value={{ isFocused: true }}>\n <div class={userAssistanceStyles}>\n <InlineUserAssistance\n assistiveText={assistiveText}\n fieldLabel={label}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n messages={messages}\n userAssistanceDensity={userAssistanceDensity}\n />\n </div>\n </FormFieldContext.Provider>\n ) : undefined;\n\n const contentTestId = testId ? testId + (shouldShowSheet ? '_sheet' : '_dropdown') : undefined;\n\n // The same content is displayed either in a dropdown or sheet: date picker and inline UA.\n // Add styling to the dropdown to enforce a fixed width.\n const dropdownContent = (\n <div class={dropdownStyles}>\n <SectionedContent\n aria-label={datePickerAriaLabel}\n footer={inlineUserAssistanceFooter}\n hasFocusTrap={true}\n main={datePickerMainContent}\n role=\"dialog\"\n testId={contentTestId}\n />\n </div>\n );\n\n const dropdown = shouldShowSheet ? (\n <Sheet initialFocus=\"firstFocusable\" isOpen={isOpen} onClose={onClose}>\n <SectionedContent\n aria-label={datePickerAriaLabel}\n footer={inlineUserAssistanceFooter}\n hasFocusTrap={true}\n main={datePickerMainContent}\n role=\"dialog\"\n testId={contentTestId}\n />\n </Sheet>\n ) : (\n <StickyPositioningDropdown\n anchorRef={anchorRef}\n initialFocus=\"firstFocusable\"\n isOpen={isOpen}\n onClose={onClose}\n onPosition={handleDropdownPosition}\n sizeOptions={sizeOptions}>\n {dropdownContent}\n </StickyPositioningDropdown>\n );\n\n return dropdown;\n};\n\nconst isPhone = () => {\n return getClientHints().deviceType === 'phone';\n};\n\nexport { InputDatePickerDropdown, type CloseDetail };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { useReducer } from 'preact/hooks';\nimport type { CalendarDate, CalendarDateRequired } from '#utils/UNSAFE_calendarDateUtils';\nimport { isCompleteCalendarDate } from '#utils/UNSAFE_calendarDateUtils';\n\ntype InputDatePickerState = {\n /**\n * If dateValue is a complete date, then completeDateValue is the same as dateValue\n * otherwise is is undefined. We need to maintain separate states because\n * InputDateMask uses CalendarDate, but DatePicker uses CalendarDateRequired.\n * If the user types a partial date then opens the picker, we treat that as\n * no selection. The picker opens to the current month showing today.\n */\n completeDateValue?: CalendarDateRequired;\n\n /**\n * Represents the current date value of the component. The user either selected\n * the date in the picker, or typed it into the date field.\n */\n dateValue?: CalendarDate;\n};\n\ntype DateChangedAction = { type: 'dateChanged'; data?: CalendarDate };\ntype DateResetAction = { type: 'reset'; data?: CalendarDate };\ntype DateSelectedAction = { type: 'dateSelected'; data?: CalendarDateRequired };\ntype InputDatePickerReducerAction = DateChangedAction | DateResetAction | DateSelectedAction;\n\n// If dateVal is a complete date, return it as a CalendarDateRequired\n// otherwise return undefined.\nconst convertToCalendarDateRequired = (dateVal?: CalendarDate) => {\n return !dateVal || !isCompleteCalendarDate(dateVal)\n ? undefined\n : (dateVal as CalendarDateRequired);\n};\n\n// Use a reducer function to manage InputDatePickerState.\nconst inputDatePickerReducer = (\n state: InputDatePickerState,\n action: InputDatePickerReducerAction\n): InputDatePickerState => {\n switch (action.type) {\n case 'dateChanged': {\n return {\n ...state,\n dateValue: action.data,\n completeDateValue: convertToCalendarDateRequired(action.data)\n };\n }\n case 'dateSelected': {\n return { ...state, dateValue: action.data, completeDateValue: action.data };\n }\n case 'reset': {\n return {\n completeDateValue: convertToCalendarDateRequired(action.data),\n dateValue: action.data\n };\n }\n default:\n return state;\n }\n};\n\ntype Props = {\n /**\n * The value of the InputDatePicker, or undefined.\n */\n value?: CalendarDate;\n};\n\n/**\n * useInputDatePickerState calls useReducer to determine the initial state. Any changes to that state\n * are managed by dispatching actions to the reducer function.\n */\nconst useInputDatePickerState = ({ value }: Props) => {\n const [state, dispatch] = useReducer(inputDatePickerReducer, {\n completeDateValue: convertToCalendarDateRequired(value),\n dateValue: value\n });\n\n return { state, dispatch };\n};\n\nexport { useInputDatePickerState };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport type { ComponentProps, RefObject } from 'preact';\nimport type { ElementRef } from 'preact/compat';\nimport { useCallback, useEffect, useRef, useState } from 'preact/hooks';\nimport type { CalendarDate, CalendarDateRequired } from '#utils/UNSAFE_calendarDateUtils';\nimport { calendarDatesAreDifferent } from '#utils/PRIVATE_dayUtils';\nimport { DatePicker } from '#UNSAFE_DatePicker';\nimport { CloseDetail, InputDatePickerDropdown } from './InputDatePickerDropdown';\nimport { IconButton } from '#UNSAFE_IconButton';\nimport { InputDateMask } from '#UNSAFE_InputDateMask';\nimport { InputDatePicker } from './InputDatePicker';\nimport { useHiddenTestMethod } from '#hooks/UNSAFE_useHiddenTestMethod';\nimport { useInputDatePickerState } from './useInputDatePickerState';\nimport type { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\n\ntype InputDatePickerProps = ComponentProps<typeof InputDatePicker>;\ntype InputDateMaskProps = ComponentProps<typeof InputDateMask>;\ntype DatePickerProps = ComponentProps<typeof DatePicker>;\ntype IconButtonProps = ComponentProps<typeof IconButton>;\ntype DropdownProps = ComponentProps<typeof InputDatePickerDropdown>;\n\ntype IconButtonHandle = ElementRef<typeof IconButton>;\n\ntype Props = {\n isDisabled: InputDatePickerProps['isDisabled'];\n isReadonly: InputDatePickerProps['isReadonly'];\n onCommit: InputDatePickerProps['onCommit'];\n onInput: InputDatePickerProps['onInput'];\n rootRef: RefObject<HTMLElement>;\n value: InputDatePickerProps['value'];\n};\n\n/**\n * Hook that provides handlers and other functionality for InputDatePicker.\n */\nconst useInputDatePicker = ({\n isDisabled,\n isReadonly,\n onCommit,\n onInput,\n rootRef,\n value: currentValue\n}: Props) => {\n // Whether the dropdown is open.\n const [isOpen, setIsOpen] = useState(false);\n\n // Ref to the calendar icon button.\n const iconRef = useRef<IconButtonHandle>(null);\n\n // Ref to the InputDateMask component.\n const maskRef: RefObject<HTMLElement> = useRef<HTMLElement>(null);\n\n // Keep track of whether the dropdown was just dismissed from an outside mousedown event.\n const outsideMousedownRef = useRef<boolean>(false);\n const outsideMousedownTimerRef = useRef<ReturnType<typeof setTimeout> | undefined>();\n\n // Keep track of the last date values passed to onInput and onCommit.\n const lastCommittedDateRef = useRef<CalendarDate | undefined>(currentValue);\n const lastDateRef = useRef<CalendarDate | undefined>(currentValue);\n\n // Keep track of the last controlled value passed from the parent, so we can detect a programmatic change.\n const lastValueFromParentRef = useRef<CalendarDate | undefined>(currentValue);\n\n // Keep track of whether a date was selected in the date picker.\n const dateSelectedRef = useRef<boolean>(false);\n\n const { state, dispatch } = useInputDatePickerState({ value: currentValue });\n\n // If a new value is being pushed from the parent, and that value differs from\n // the current value of the reducer, then this is a programmatic update\n // and we need to call 'reset' to update the reducer state. Otherwise, the only\n // time the reducer state is updated from the value is on mount.\n if (calendarDatesAreDifferent(lastValueFromParentRef.current, currentValue)) {\n lastValueFromParentRef.current = currentValue;\n if (calendarDatesAreDifferent(currentValue, state.dateValue)) {\n dispatch({ type: 'reset', data: currentValue });\n lastDateRef.current = currentValue;\n lastCommittedDateRef.current = currentValue;\n }\n }\n\n // Reducer updates are async, so wait until the state updates and then call our callbacks.\n useEffect(() => {\n if (calendarDatesAreDifferent(state.dateValue, lastDateRef.current)) {\n onInput({ previousValue: lastDateRef.current, value: state.dateValue });\n lastDateRef.current = state.dateValue;\n }\n if (\n dateSelectedRef.current &&\n calendarDatesAreDifferent(state.dateValue, lastCommittedDateRef.current)\n ) {\n onCommit?.({ previousValue: lastCommittedDateRef.current, value: state.dateValue });\n lastCommittedDateRef.current = state.dateValue;\n dateSelectedRef.current = false;\n }\n }, [onCommit, onInput, state.dateValue]);\n\n // Handle onInput from InputDateMask as segment values are being added or changed in the input field.\n // We wait for the state to update before calling onInput.\n const maskInputHandler = useCallback<InputDateMaskProps['onInput']>(\n (detail: ValueUpdateDetail<CalendarDate>) => {\n dispatch({ type: 'dateChanged', data: detail.value });\n },\n [dispatch]\n );\n\n // Handle onCommit from InputDateMask, which is called when the user presses Enter or the field is blurred.\n const maskCommitHandler = useCallback<NonNullable<InputDateMaskProps['onCommit']>>(\n (detail: ValueUpdateDetail<CalendarDate>) => {\n // If the value we get from InputDateMask's onCommit differs from the last committed value, then call onCommit.\n if (calendarDatesAreDifferent(lastCommittedDateRef.current, detail.value)) {\n onCommit?.({ value: detail.value, previousValue: lastCommittedDateRef.current });\n lastCommittedDateRef.current = detail.value;\n }\n },\n [onCommit]\n );\n\n // Respond to onAction event from the calendar icon button. Toggles the date picker dropdown.\n const calendarIconActionHandler = useCallback<NonNullable<IconButtonProps['onAction']>>(() => {\n // Only toggle the value of isOpen if we didn't just dismiss the dropdown.\n if (!outsideMousedownRef.current) {\n setIsOpen((prevIsOpen) => !prevIsOpen);\n }\n outsideMousedownRef.current = false;\n }, []);\n\n const dropdownCloseHandler = useCallback<NonNullable<DropdownProps['onClose']>>(\n (detail: CloseDetail) => {\n // Keep track of when the dropdown is closed via outside mousedown, including when the calendar icon\n // is clicked. We need this in order to toggle visibility of the picker and dropdown.\n if (detail.reason === 'outsideMousedown') {\n outsideMousedownRef.current = true;\n clearTimeout(outsideMousedownTimerRef.current);\n\n // Clear the flag after a short delay to ensure the dropdown can be opened again.\n outsideMousedownTimerRef.current = setTimeout(() => {\n outsideMousedownRef.current = false;\n }, 200);\n } else if (detail.reason === 'dismissed' || detail.reason === 'keyboardDismissed') {\n // Focus the calendar icon when the dropdown is closed.\n iconRef.current?.focus();\n }\n setIsOpen(false);\n },\n []\n );\n\n // Handle date selection in the picker.\n // - Updates the value in state.\n // - Closes the dropdown.\n // - Sets focus to the date field.\n const datePickerCommitHandler = useCallback<DatePickerProps['onCommit']>(\n (detail: ValueUpdateDetail<CalendarDateRequired>) => {\n // Set focus to the calendar icon when a date is selected.\n iconRef.current?.focus();\n\n // Set a ref indicating a date was selected.\n dateSelectedRef.current = true;\n dispatch({ type: 'dateSelected', data: detail.value });\n setIsOpen(false);\n },\n [dispatch]\n );\n\n // Create a changeValue method that can be called by a test adapter to simulate a user\n // changing the value and committing it.\n const changeValue = useCallback(\n (newValue?: CalendarDate) => {\n // We always want this method available on the DOM element so that a test can call it,\n // but we only want it to change the value when the component is enabled because that's\n // the only time the user could change the value through the UI.\n if (!isReadonly && !isDisabled) {\n onInput({ value: newValue, previousValue: currentValue });\n onCommit?.({ value: newValue, previousValue: currentValue });\n return Promise.resolve();\n }\n return Promise.reject('Component is readonly or disabled');\n },\n [currentValue, isDisabled, isReadonly, onCommit, onInput]\n );\n // Expose _changeValue as a hidden method on the root DOM.\n useHiddenTestMethod({\n elementRef: rootRef,\n method: changeValue,\n name: '_changeValue'\n });\n\n return {\n calendarIconActionHandler,\n datePickerCommitHandler,\n dropdownCloseHandler,\n completeDateValue: state.completeDateValue,\n dateValue: state.dateValue,\n iconRef,\n isOpen,\n maskCommitHandler,\n maskInputHandler,\n maskRef\n };\n};\n\nexport { useInputDatePicker };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { ComponentProps, Ref } from 'preact';\nimport { forwardRef } from 'preact/compat';\nimport { useImperativeHandle, useRef } from 'preact/hooks';\nimport { BundleType } from '../resources/nls/bundle';\nimport { CalendarIcon } from '#PRIVATE_ThemedIcons/CalendarIcon';\nimport {\n CalendarDate,\n CalendarDatePlaceholders,\n InputDateMask,\n InputDateMaskContext\n} from '#UNSAFE_InputDateMask';\nimport { DatePicker } from '#UNSAFE_DatePicker';\nimport { HiddenAccessible } from '#UNSAFE_HiddenAccessible';\nimport { IconButton } from '#UNSAFE_IconButton';\nimport { InputDatePickerDropdown } from './InputDatePickerDropdown';\nimport { FocusableHandle } from '#hooks/UNSAFE_useFocusableTextField';\nimport { merge } from '@oracle/oraclejet-internal-utilities/stringUtils';\nimport { useFormContext } from '#hooks/UNSAFE_useFormContext';\nimport { useId } from '#hooks/UNSAFE_useId';\nimport { useInputDatePicker } from './useInputDatePicker';\nimport { useTestId } from '#hooks/UNSAFE_useTestId';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\n\ntype InputDateMaskProps = ComponentProps<typeof InputDateMask>;\ntype PickedPropsFromInputDateMask = Pick<\n InputDateMaskProps,\n | 'aria-describedby'\n | 'assistiveText'\n | 'columnSpan'\n | 'helpSourceLink'\n | 'helpSourceText'\n | 'isDisabled'\n | 'isReadonly'\n | 'isRequired'\n | 'isRequiredShown'\n | 'label'\n | 'labelEdge'\n | 'labelStartWidth'\n | 'messages'\n | 'textAlign'\n | 'testId'\n | 'userAssistanceDensity'\n | 'variant'\n>;\n\ntype DatePickerProps = ComponentProps<typeof DatePicker>;\ntype PickedPropsFromDatePicker = Pick<\n DatePickerProps,\n | 'dayFormatter'\n | 'daysOutsideMonth'\n | 'max'\n | 'min'\n | 'monthAndYearPicker'\n | 'todayTimeZone'\n | 'todayButton'\n | 'weekDisplay'\n>;\n\ntype Props = PickedPropsFromInputDateMask &\n PickedPropsFromDatePicker & {\n /**\n * If specified, overrides the locale specific order of the individual date segments\n * in the date field as well as the locale specific separator. The value of each placeholder\n * is only used when the type is 'literal', otherwise it is replaced with a translated\n * placeholder for month, day, or year. The placeholders must include month, day, and year.\n */\n masks?: CalendarDatePlaceholders;\n\n /**\n * The current display value of the component.\n * This is a CalendarDate, not CalendarDateRequired, because this is a controlled component and\n * the user may type the month, day, and year separately. If a selection is made in the date\n * picker, then the value is a complete date.\n */\n value?: CalendarDate;\n\n /**\n * Callback invoked when the user commits the entered value by blurring or hitting the enter key.\n * It is also called when a selection is made in the date picker.\n */\n onCommit?: (detail: ValueUpdateDetail<CalendarDate>) => void;\n\n /**\n * Callback invoked each time the user changes the value of a segment. For example, if the user\n * types '12' into the month segment, this callback will be called twice to change the month\n * first to '1' and then '12'.\n */\n onInput: (detail: ValueUpdateDetail<CalendarDate>) => void;\n };\n\n/**\n * InputDatePicker allows users to enter or select a single date using a calendar interface.\n */\nexport const InputDatePicker = forwardRef(\n (\n {\n 'aria-describedby': propDescribedBy,\n assistiveText,\n dayFormatter,\n daysOutsideMonth,\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isReadonly,\n label,\n max,\n messages,\n min,\n monthAndYearPicker,\n todayTimeZone,\n todayButton,\n value,\n onCommit,\n onInput,\n testId,\n userAssistanceDensity: propUserAssistanceDensity,\n weekDisplay,\n ...dateMaskProps\n }: Props,\n ref?: Ref<FocusableHandle>\n ) => {\n const testIdProps = useTestId(testId);\n const rootRef = useRef<HTMLDivElement>(null);\n\n const {\n calendarIconActionHandler,\n datePickerCommitHandler,\n completeDateValue,\n dateValue,\n dropdownCloseHandler,\n iconRef,\n isOpen,\n maskCommitHandler,\n maskInputHandler,\n maskRef\n } = useInputDatePicker({\n isDisabled,\n isReadonly,\n onCommit,\n onInput,\n rootRef,\n value\n });\n\n const mainFieldRef = useRef<HTMLDivElement>(null);\n const { inputDatePicker_selectDate, inputDatePicker_instruction } =\n useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const calendarIconAriaLabel = inputDatePicker_selectDate();\n\n // We need this to determine if UA/messaging should be shown in the dropdown.\n const { userAssistanceDensity: formUserAssistanceDensity } = useFormContext();\n const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;\n\n useImperativeHandle(ref!, () => ({\n focus: () => {\n maskRef.current?.focus();\n },\n blur: () => {\n maskRef.current?.blur();\n }\n }));\n\n const maskFieldInstructionId = useId();\n const maskFieldInstructionText = inputDatePicker_instruction();\n const maskFieldInstruction =\n !isDisabled && !isReadonly ? (\n <HiddenAccessible id={maskFieldInstructionId} isHidden={true}>\n {maskFieldInstructionText}\n </HiddenAccessible>\n ) : undefined;\n const ariaDescribedBy =\n !isDisabled && !isReadonly\n ? merge([propDescribedBy, maskFieldInstructionId])\n : propDescribedBy;\n\n const endContent = (\n <IconButton\n aria-haspopup=\"dialog\"\n aria-label={calendarIconAriaLabel}\n isDisabled={isDisabled}\n ref={iconRef}\n size=\"sm\"\n testId={testId ? testId + '_calendarIcon' : undefined}\n variant=\"ghost\"\n onAction={calendarIconActionHandler}>\n <CalendarIcon />\n </IconButton>\n );\n\n const shouldShowDropdown = isOpen as boolean;\n\n return (\n <div {...testIdProps} ref={rootRef}>\n <InputDateMaskContext.Provider\n value={{ isDropdownOpen: isOpen, isInputDatePickerParent: true }}>\n <InputDateMask\n aria-describedby={ariaDescribedBy}\n assistiveText={assistiveText}\n endContent={endContent}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n isDisabled={isDisabled}\n isReadonly={isReadonly}\n label={label}\n onCommit={maskCommitHandler}\n onInput={maskInputHandler}\n mainFieldRef={mainFieldRef}\n messages={messages}\n testId={testId ? testId + '_mask' : undefined}\n ref={maskRef}\n userAssistanceDensity={propUserAssistanceDensity}\n value={dateValue}\n {...dateMaskProps}\n />\n </InputDateMaskContext.Provider>\n\n {maskFieldInstruction}\n\n {shouldShowDropdown && (\n <InputDatePickerDropdown\n anchorRef={mainFieldRef}\n assistiveText={assistiveText}\n dayFormatter={dayFormatter}\n daysOutsideMonth={daysOutsideMonth}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n isDisabled={isDisabled}\n isReadonly={isReadonly}\n isOpen={isOpen}\n label={label}\n onClose={dropdownCloseHandler}\n onCommit={datePickerCommitHandler}\n max={max}\n messages={messages}\n min={min}\n monthAndYearPicker={monthAndYearPicker}\n testId={testId ? testId + '_datePicker' : undefined}\n todayTimeZone={todayTimeZone}\n todayButton={todayButton}\n userAssistanceDensity={userAssistanceDensity}\n value={completeDateValue}\n weekDisplay={weekDisplay}\n />\n )}\n </div>\n );\n }\n);\n"],"names":["InputDatePickerDropdown","anchorRef","assistiveText","dayFormatter","daysOutsideMonth","helpSourceLink","helpSourceText","isDisabled","isOpen","isReadonly","label","onClose","onCommit","max","messages","min","monthAndYearPicker","testId","todayButton","todayTimeZone","userAssistanceDensity","value","weekDisplay","isDropdownAbove","setDropdownAbove","useState","prevIsOpen","setPrevIsOpen","handleDropdownPosition","useCallback","data","placement","startsWith","shouldShowSheet","isPhone","datePicker_label","useTranslationBundle","datePickerAriaLabel","datePickerMainContent","_jsx","DatePicker","height","undefined","maxWidth","width","inlineUserAssistanceFooter","length","FormFieldContext","Provider","isFocused","children","jsx","class","userAssistanceStyles","InlineUserAssistance","fieldLabel","contentTestId","dropdownContent","dropdownStyles","SectionedContent","footer","hasFocusTrap","main","role","Sheet","initialFocus","StickyPositioningDropdown","onPosition","sizeOptions","isMaxWidthAdjusted","isMaxHeightAdjusted","getClientHints","deviceType","convertToCalendarDateRequired","dateVal","isCompleteCalendarDate","inputDatePickerReducer","state","action","type","dateValue","completeDateValue","useInputDatePicker","onInput","rootRef","currentValue","setIsOpen","iconRef","useRef","maskRef","outsideMousedownRef","outsideMousedownTimerRef","lastCommittedDateRef","lastDateRef","lastValueFromParentRef","dateSelectedRef","dispatch","useReducer","useInputDatePickerState","calendarDatesAreDifferent","current","useEffect","previousValue","maskInputHandler","detail","maskCommitHandler","calendarIconActionHandler","dropdownCloseHandler","reason","clearTimeout","setTimeout","focus","datePickerCommitHandler","changeValue","newValue","Promise","reject","resolve","useHiddenTestMethod","elementRef","method","name","InputDatePicker","forwardRef","propDescribedBy","propUserAssistanceDensity","dateMaskProps","ref","testIdProps","useTestId","mainFieldRef","inputDatePicker_selectDate","inputDatePicker_instruction","calendarIconAriaLabel","formUserAssistanceDensity","useFormContext","useImperativeHandle","blur","maskFieldInstructionId","useId","maskFieldInstructionText","maskFieldInstruction","HiddenAccessible","id","isHidden","ariaDescribedBy","merge","endContent","IconButton","size","variant","onAction","CalendarIcon","shouldShowDropdown","_jsxs","InputDateMaskContext","isDropdownOpen","isInputDatePickerParent","InputDateMask"],"mappings":"upEAsEA,MAAMA,GAA0B,EAC9BC,YACAC,gBACAC,eACAC,mBACAC,iBACAC,iBACAC,aACAC,SACAC,aACAC,QACAC,UACAC,WACAC,MACAC,WACAC,MACAC,qBACAC,SACA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C,QAASgG,EACT/F,SAAUoG,EACVnG,IAAKA,EACLC,SAAUA,EACVC,IAAKA,EACLC,mBAAoBA,EACpBC,OAAQA,EAASA,EAAS,mBAAgByB,EAC1CvB,cAAeA,EACfD,YAAaA,EACbE,sBAAuBA,EACvBC,MAAO4D,EACP3D,YAAaA,MAInB"}
|
|
1
|
+
{"version":3,"file":"InputDatePicker-8c8e14ca.js","sources":["../../src/UNSAFE_InputDatePicker/InputDatePickerDropdown.tsx","../../src/UNSAFE_InputDatePicker/useInputDatePickerState.ts","../../src/UNSAFE_InputDatePicker/useInputDatePicker.ts","../../src/UNSAFE_InputDatePicker/InputDatePicker.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { ComponentProps } from 'preact';\nimport { useCallback, useState } from 'preact/hooks';\nimport { BundleType } from '../resources/nls/bundle';\nimport { DatePicker } from '#UNSAFE_DatePicker';\nimport { type CloseDetail as DropdownCloseDetail } from '#UNSAFE_Dropdown';\nimport { getClientHints } from '#utils/PRIVATE_clientHints';\nimport { FormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { InlineUserAssistance } from '../UNSAFE_UserAssistance';\nimport { InputDatePicker } from './InputDatePicker';\nimport { dropdownStyles, userAssistanceStyles } from './themes/InputDatePickerDropdownStyles.css';\nimport { PositionData } from '../UNSAFE_Floating';\nimport { StickyPositioningDropdown } from '#PRIVATE_FormControls';\nimport { SectionedContent } from '#PRIVATE_FormControls';\nimport { type CloseDetail as SheetCloseDetail, Sheet } from '#UNSAFE_Sheet';\nimport type { TestIdProps } from '#hooks/UNSAFE_useTestId';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport { SizeOptions } from '#UNSAFE_Floating/Floating';\n\ntype StickyPositioningDropdownProps = ComponentProps<typeof StickyPositioningDropdown>;\ntype InputDatePickerProps = ComponentProps<typeof InputDatePicker>;\ntype PickedPropsFromInputDatePicker = Pick<\n InputDatePickerProps,\n | 'assistiveText'\n | 'dayFormatter'\n | 'daysOutsideMonth'\n | 'helpSourceLink'\n | 'helpSourceText'\n | 'isDisabled'\n | 'isReadonly'\n | 'label'\n | 'messages'\n | 'min'\n | 'max'\n | 'monthAndYearPicker'\n | 'todayButton'\n | 'todayTimeZone'\n | 'userAssistanceDensity'\n | 'value'\n | 'weekDisplay'\n>;\ntype DatePickerProps = ComponentProps<typeof DatePicker>;\ntype PickedPropsFromDatePicker = Pick<DatePickerProps, 'value' | 'onCommit'>;\ntype PickedPropsFromDropdown = Omit<StickyPositioningDropdownProps, 'onClose'>;\ntype CloseDetail = SheetCloseDetail | DropdownCloseDetail;\n\ntype Props = PickedPropsFromDatePicker &\n PickedPropsFromInputDatePicker &\n PickedPropsFromDropdown &\n TestIdProps & {\n /**\n * Called when the dropdown or sheet is supposed to be closed.\n */\n onClose?: (detail: CloseDetail) => void;\n };\n\n/**\n * Component that renders DatePicker either inside a dropdown or sheet; at small screen\n * widths, it renders inside a sheet. Additionally, when a dropdown is being shown beneath\n * the component, we also show any user assistance text or messages below the picker\n * because otherwise that information would be obscured from view. When a sheet is being\n * shown, it will always display UA and messages at the bottom of the sheet.\n */\nconst InputDatePickerDropdown = ({\n anchorRef,\n assistiveText,\n dayFormatter,\n daysOutsideMonth,\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isOpen,\n isReadonly,\n label,\n onClose,\n onCommit,\n max,\n messages,\n min,\n monthAndYearPicker,\n testId,\n todayButton,\n todayTimeZone,\n userAssistanceDensity,\n value,\n weekDisplay\n}: Props) => {\n // If the dropdown opens above the component, we don't want to show UA or messages.\n const [isDropdownAbove, setDropdownAbove] = useState(false);\n const [prevIsOpen, setPrevIsOpen] = useState(isOpen);\n const handleDropdownPosition = useCallback<\n NonNullable<StickyPositioningDropdownProps['onPosition']>\n >((data: PositionData) => {\n setDropdownAbove(data.placement.startsWith('top'));\n }, []);\n // Reset the flag when the dropdown is closed.\n if (prevIsOpen !== isOpen) {\n setPrevIsOpen(isOpen);\n if (!isOpen) {\n setDropdownAbove(false);\n }\n }\n\n const sizeOptions: SizeOptions = {\n isMaxWidthAdjusted: false,\n isMaxHeightAdjusted: true\n };\n\n // On mobile phones, the dropdown becomes a sheet.\n const shouldShowSheet = isPhone();\n\n const { datePicker_label } = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const datePickerAriaLabel = datePicker_label();\n\n const datePickerMainContent = (\n <DatePicker\n dayFormatter={dayFormatter}\n daysOutsideMonth={daysOutsideMonth}\n height={!shouldShowSheet ? 'auto' : undefined}\n onCommit={onCommit}\n max={max}\n min={min}\n // for sheet, we want the width to grow to the width of the sheet, otherwise it will use the theme default.\n maxWidth={shouldShowSheet ? '100%' : undefined}\n width=\"100%\"\n monthAndYearPicker={monthAndYearPicker}\n testId={testId}\n todayTimeZone={todayTimeZone}\n todayButton={todayButton}\n value={value}\n weekDisplay={weekDisplay}\n />\n );\n\n const inlineUserAssistanceFooter =\n isOpen &&\n (!isDropdownAbove || shouldShowSheet) &&\n !isDisabled &&\n !isReadonly &&\n (assistiveText || helpSourceLink || (messages && messages.length > 0)) &&\n (userAssistanceDensity === 'efficient' || userAssistanceDensity === 'reflow') ? (\n <FormFieldContext.Provider value={{ isFocused: true }}>\n <div class={userAssistanceStyles}>\n <InlineUserAssistance\n assistiveText={assistiveText}\n fieldLabel={label}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n messages={messages}\n userAssistanceDensity={userAssistanceDensity}\n />\n </div>\n </FormFieldContext.Provider>\n ) : undefined;\n\n const contentTestId = testId ? testId + (shouldShowSheet ? '_sheet' : '_dropdown') : undefined;\n\n // The same content is displayed either in a dropdown or sheet: date picker and inline UA.\n // Add styling to the dropdown to enforce a fixed width.\n const dropdownContent = (\n <div class={dropdownStyles}>\n <SectionedContent\n aria-label={datePickerAriaLabel}\n footer={inlineUserAssistanceFooter}\n hasFocusTrap={true}\n main={datePickerMainContent}\n role=\"dialog\"\n testId={contentTestId}\n />\n </div>\n );\n\n const dropdown = shouldShowSheet ? (\n <Sheet initialFocus=\"firstFocusable\" isOpen={isOpen} onClose={onClose}>\n <SectionedContent\n aria-label={datePickerAriaLabel}\n footer={inlineUserAssistanceFooter}\n hasFocusTrap={true}\n main={datePickerMainContent}\n role=\"dialog\"\n testId={contentTestId}\n />\n </Sheet>\n ) : (\n <StickyPositioningDropdown\n anchorRef={anchorRef}\n initialFocus=\"firstFocusable\"\n isOpen={isOpen}\n onClose={onClose}\n onPosition={handleDropdownPosition}\n sizeOptions={sizeOptions}>\n {dropdownContent}\n </StickyPositioningDropdown>\n );\n\n return dropdown;\n};\n\nconst isPhone = () => {\n return getClientHints().deviceType === 'phone';\n};\n\nexport { InputDatePickerDropdown, type CloseDetail };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { useReducer } from 'preact/hooks';\nimport type { CalendarDate, CalendarDateRequired } from '#utils/UNSAFE_calendarDateUtils';\nimport { isCompleteCalendarDate } from '#utils/UNSAFE_calendarDateUtils';\n\ntype InputDatePickerState = {\n /**\n * If dateValue is a complete date, then completeDateValue is the same as dateValue\n * otherwise is is undefined. We need to maintain separate states because\n * InputDateMask uses CalendarDate, but DatePicker uses CalendarDateRequired.\n * If the user types a partial date then opens the picker, we treat that as\n * no selection. The picker opens to the current month showing today.\n */\n completeDateValue?: CalendarDateRequired;\n\n /**\n * Represents the current date value of the component. The user either selected\n * the date in the picker, or typed it into the date field.\n */\n dateValue?: CalendarDate;\n};\n\ntype DateChangedAction = { type: 'dateChanged'; data?: CalendarDate };\ntype DateResetAction = { type: 'reset'; data?: CalendarDate };\ntype DateSelectedAction = { type: 'dateSelected'; data?: CalendarDateRequired };\ntype InputDatePickerReducerAction = DateChangedAction | DateResetAction | DateSelectedAction;\n\n// If dateVal is a complete date, return it as a CalendarDateRequired\n// otherwise return undefined.\nconst convertToCalendarDateRequired = (dateVal?: CalendarDate) => {\n return !dateVal || !isCompleteCalendarDate(dateVal)\n ? undefined\n : (dateVal as CalendarDateRequired);\n};\n\n// Use a reducer function to manage InputDatePickerState.\nconst inputDatePickerReducer = (\n state: InputDatePickerState,\n action: InputDatePickerReducerAction\n): InputDatePickerState => {\n switch (action.type) {\n case 'dateChanged': {\n return {\n ...state,\n dateValue: action.data,\n completeDateValue: convertToCalendarDateRequired(action.data)\n };\n }\n case 'dateSelected': {\n return { ...state, dateValue: action.data, completeDateValue: action.data };\n }\n case 'reset': {\n return {\n completeDateValue: convertToCalendarDateRequired(action.data),\n dateValue: action.data\n };\n }\n default:\n return state;\n }\n};\n\ntype Props = {\n /**\n * The value of the InputDatePicker, or undefined.\n */\n value?: CalendarDate;\n};\n\n/**\n * useInputDatePickerState calls useReducer to determine the initial state. Any changes to that state\n * are managed by dispatching actions to the reducer function.\n */\nconst useInputDatePickerState = ({ value }: Props) => {\n const [state, dispatch] = useReducer(inputDatePickerReducer, {\n completeDateValue: convertToCalendarDateRequired(value),\n dateValue: value\n });\n\n return { state, dispatch };\n};\n\nexport { useInputDatePickerState };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport type { ComponentProps, RefObject } from 'preact';\nimport type { ElementRef } from 'preact/compat';\nimport { useCallback, useEffect, useRef, useState } from 'preact/hooks';\nimport type { CalendarDate, CalendarDateRequired } from '#utils/UNSAFE_calendarDateUtils';\nimport { calendarDatesAreDifferent } from '#utils/PRIVATE_dayUtils';\nimport { DatePicker } from '#UNSAFE_DatePicker';\nimport { CloseDetail, InputDatePickerDropdown } from './InputDatePickerDropdown';\nimport { IconButton } from '#UNSAFE_IconButton';\nimport { InputDateMask } from '#UNSAFE_InputDateMask';\nimport { InputDatePicker } from './InputDatePicker';\nimport { useHiddenTestMethod } from '#hooks/UNSAFE_useHiddenTestMethod';\nimport { useInputDatePickerState } from './useInputDatePickerState';\nimport type { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\n\ntype InputDatePickerProps = ComponentProps<typeof InputDatePicker>;\ntype InputDateMaskProps = ComponentProps<typeof InputDateMask>;\ntype DatePickerProps = ComponentProps<typeof DatePicker>;\ntype IconButtonProps = ComponentProps<typeof IconButton>;\ntype DropdownProps = ComponentProps<typeof InputDatePickerDropdown>;\n\ntype IconButtonHandle = ElementRef<typeof IconButton>;\n\ntype Props = {\n isDisabled: InputDatePickerProps['isDisabled'];\n isReadonly: InputDatePickerProps['isReadonly'];\n onCommit: InputDatePickerProps['onCommit'];\n onInput: InputDatePickerProps['onInput'];\n rootRef: RefObject<HTMLElement>;\n value: InputDatePickerProps['value'];\n};\n\n/**\n * Hook that provides handlers and other functionality for InputDatePicker.\n */\nconst useInputDatePicker = ({\n isDisabled,\n isReadonly,\n onCommit,\n onInput,\n rootRef,\n value: currentValue\n}: Props) => {\n // Whether the dropdown is open.\n const [isOpen, setIsOpen] = useState(false);\n\n // Ref to the calendar icon button.\n const iconRef = useRef<IconButtonHandle>(null);\n\n // Ref to the InputDateMask component.\n const maskRef: RefObject<HTMLElement> = useRef<HTMLElement>(null);\n\n // Keep track of whether the dropdown was just dismissed from an outside mousedown event.\n const outsideMousedownRef = useRef<boolean>(false);\n const outsideMousedownTimerRef = useRef<ReturnType<typeof setTimeout> | undefined>();\n\n // Keep track of the last date values passed to onInput and onCommit.\n const lastCommittedDateRef = useRef<CalendarDate | undefined>(currentValue);\n const lastDateRef = useRef<CalendarDate | undefined>(currentValue);\n\n // Keep track of the last controlled value passed from the parent, so we can detect a programmatic change.\n const lastValueFromParentRef = useRef<CalendarDate | undefined>(currentValue);\n\n // Keep track of whether a date was selected in the date picker.\n const dateSelectedRef = useRef<boolean>(false);\n\n const { state, dispatch } = useInputDatePickerState({ value: currentValue });\n\n // If a new value is being pushed from the parent, and that value differs from\n // the current value of the reducer, then this is a programmatic update\n // and we need to call 'reset' to update the reducer state. Otherwise, the only\n // time the reducer state is updated from the value is on mount.\n if (calendarDatesAreDifferent(lastValueFromParentRef.current, currentValue)) {\n lastValueFromParentRef.current = currentValue;\n if (calendarDatesAreDifferent(currentValue, state.dateValue)) {\n dispatch({ type: 'reset', data: currentValue });\n lastDateRef.current = currentValue;\n lastCommittedDateRef.current = currentValue;\n }\n }\n\n // Reducer updates are async, so wait until the state updates and then call our callbacks.\n useEffect(() => {\n if (calendarDatesAreDifferent(state.dateValue, lastDateRef.current)) {\n onInput({ previousValue: lastDateRef.current, value: state.dateValue });\n lastDateRef.current = state.dateValue;\n }\n if (\n dateSelectedRef.current &&\n calendarDatesAreDifferent(state.dateValue, lastCommittedDateRef.current)\n ) {\n onCommit?.({ previousValue: lastCommittedDateRef.current, value: state.dateValue });\n lastCommittedDateRef.current = state.dateValue;\n dateSelectedRef.current = false;\n }\n }, [onCommit, onInput, state.dateValue]);\n\n // Handle onInput from InputDateMask as segment values are being added or changed in the input field.\n // We wait for the state to update before calling onInput.\n const maskInputHandler = useCallback<InputDateMaskProps['onInput']>(\n (detail: ValueUpdateDetail<CalendarDate>) => {\n dispatch({ type: 'dateChanged', data: detail.value });\n },\n [dispatch]\n );\n\n // Handle onCommit from InputDateMask, which is called when the user presses Enter or the field is blurred.\n const maskCommitHandler = useCallback<NonNullable<InputDateMaskProps['onCommit']>>(\n (detail: ValueUpdateDetail<CalendarDate>) => {\n // If the value we get from InputDateMask's onCommit differs from the last committed value, then call onCommit.\n if (calendarDatesAreDifferent(lastCommittedDateRef.current, detail.value)) {\n onCommit?.({ value: detail.value, previousValue: lastCommittedDateRef.current });\n lastCommittedDateRef.current = detail.value;\n }\n },\n [onCommit]\n );\n\n // Respond to onAction event from the calendar icon button. Toggles the date picker dropdown.\n const calendarIconActionHandler = useCallback<NonNullable<IconButtonProps['onAction']>>(() => {\n // Only toggle the value of isOpen if we didn't just dismiss the dropdown.\n if (!outsideMousedownRef.current) {\n setIsOpen((prevIsOpen) => !prevIsOpen);\n }\n outsideMousedownRef.current = false;\n }, []);\n\n const dropdownCloseHandler = useCallback<NonNullable<DropdownProps['onClose']>>(\n (detail: CloseDetail) => {\n // Keep track of when the dropdown is closed via outside mousedown, including when the calendar icon\n // is clicked. We need this in order to toggle visibility of the picker and dropdown.\n if (detail.reason === 'outsideMousedown') {\n outsideMousedownRef.current = true;\n clearTimeout(outsideMousedownTimerRef.current);\n\n // Clear the flag after a short delay to ensure the dropdown can be opened again.\n outsideMousedownTimerRef.current = setTimeout(() => {\n outsideMousedownRef.current = false;\n }, 200);\n } else if (detail.reason === 'dismissed' || detail.reason === 'keyboardDismissed') {\n // Focus the calendar icon when the dropdown is closed.\n iconRef.current?.focus();\n }\n setIsOpen(false);\n },\n []\n );\n\n // Handle date selection in the picker.\n // - Updates the value in state.\n // - Closes the dropdown.\n // - Sets focus to the date field.\n const datePickerCommitHandler = useCallback<DatePickerProps['onCommit']>(\n (detail: ValueUpdateDetail<CalendarDateRequired>) => {\n // Set focus to the calendar icon when a date is selected.\n iconRef.current?.focus();\n\n // Set a ref indicating a date was selected.\n dateSelectedRef.current = true;\n dispatch({ type: 'dateSelected', data: detail.value });\n setIsOpen(false);\n },\n [dispatch]\n );\n\n // Create a changeValue method that can be called by a test adapter to simulate a user\n // changing the value and committing it.\n const changeValue = useCallback(\n (newValue?: CalendarDate) => {\n // We always want this method available on the DOM element so that a test can call it,\n // but we only want it to change the value when the component is enabled because that's\n // the only time the user could change the value through the UI.\n if (!isReadonly && !isDisabled) {\n onInput({ value: newValue, previousValue: currentValue });\n onCommit?.({ value: newValue, previousValue: currentValue });\n return Promise.resolve();\n }\n return Promise.reject('Component is readonly or disabled');\n },\n [currentValue, isDisabled, isReadonly, onCommit, onInput]\n );\n // Expose _changeValue as a hidden method on the root DOM.\n useHiddenTestMethod({\n elementRef: rootRef,\n method: changeValue,\n name: '_changeValue'\n });\n\n return {\n calendarIconActionHandler,\n datePickerCommitHandler,\n dropdownCloseHandler,\n completeDateValue: state.completeDateValue,\n dateValue: state.dateValue,\n iconRef,\n isOpen,\n maskCommitHandler,\n maskInputHandler,\n maskRef\n };\n};\n\nexport { useInputDatePicker };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { ComponentProps, Ref } from 'preact';\nimport { forwardRef } from 'preact/compat';\nimport { useImperativeHandle, useRef } from 'preact/hooks';\nimport { BundleType } from '../resources/nls/bundle';\nimport { CalendarIcon } from '#PRIVATE_ThemedIcons/CalendarIcon';\nimport {\n CalendarDate,\n CalendarDatePlaceholders,\n InputDateMask,\n InputDateMaskContext\n} from '#UNSAFE_InputDateMask';\nimport { DatePicker } from '#UNSAFE_DatePicker';\nimport { HiddenAccessible } from '#UNSAFE_HiddenAccessible';\nimport { IconButton } from '#UNSAFE_IconButton';\nimport { InputDatePickerDropdown } from './InputDatePickerDropdown';\nimport { FocusableHandle } from '#hooks/UNSAFE_useFocusableTextField';\nimport { merge } from '@oracle/oraclejet-internal-utilities/stringUtils';\nimport { useFormContext } from '#hooks/UNSAFE_useFormContext';\nimport { useId } from '#hooks/UNSAFE_useId';\nimport { useInputDatePicker } from './useInputDatePicker';\nimport { useTestId } from '#hooks/UNSAFE_useTestId';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\n\ntype InputDateMaskProps = ComponentProps<typeof InputDateMask>;\ntype PickedPropsFromInputDateMask = Pick<\n InputDateMaskProps,\n | 'aria-describedby'\n | 'assistiveText'\n | 'columnSpan'\n | 'helpSourceLink'\n | 'helpSourceText'\n | 'isDisabled'\n | 'isReadonly'\n | 'isRequired'\n | 'isRequiredShown'\n | 'label'\n | 'labelEdge'\n | 'labelStartWidth'\n | 'messages'\n | 'textAlign'\n | 'testId'\n | 'userAssistanceDensity'\n | 'variant'\n>;\n\ntype DatePickerProps = ComponentProps<typeof DatePicker>;\ntype PickedPropsFromDatePicker = Pick<\n DatePickerProps,\n | 'dayFormatter'\n | 'daysOutsideMonth'\n | 'max'\n | 'min'\n | 'monthAndYearPicker'\n | 'todayTimeZone'\n | 'todayButton'\n | 'weekDisplay'\n>;\n\ntype Props = PickedPropsFromInputDateMask &\n PickedPropsFromDatePicker & {\n /**\n * If specified, overrides the locale specific order of the individual date segments\n * in the date field as well as the locale specific separator. The value of each placeholder\n * is only used when the type is 'literal', otherwise it is replaced with a translated\n * placeholder for month, day, or year. The placeholders must include month, day, and year.\n */\n masks?: CalendarDatePlaceholders;\n\n /**\n * The current display value of the component.\n * This is a CalendarDate, not CalendarDateRequired, because this is a controlled component and\n * the user may type the month, day, and year separately. If a selection is made in the date\n * picker, then the value is a complete date.\n */\n value?: CalendarDate;\n\n /**\n * Callback invoked when the user commits the entered value by blurring or hitting the enter key.\n * It is also called when a selection is made in the date picker.\n */\n onCommit?: (detail: ValueUpdateDetail<CalendarDate>) => void;\n\n /**\n * Callback invoked each time the user changes the value of a segment. For example, if the user\n * types '12' into the month segment, this callback will be called twice to change the month\n * first to '1' and then '12'.\n */\n onInput: (detail: ValueUpdateDetail<CalendarDate>) => void;\n };\n\n/**\n * InputDatePicker allows users to enter or select a single date using a calendar interface.\n */\nexport const InputDatePicker = forwardRef(\n (\n {\n 'aria-describedby': propDescribedBy,\n assistiveText,\n dayFormatter,\n daysOutsideMonth,\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isReadonly,\n label,\n max,\n messages,\n min,\n monthAndYearPicker,\n todayTimeZone,\n todayButton,\n value,\n onCommit,\n onInput,\n testId,\n userAssistanceDensity: propUserAssistanceDensity,\n weekDisplay,\n ...dateMaskProps\n }: Props,\n ref?: Ref<FocusableHandle>\n ) => {\n const testIdProps = useTestId(testId);\n const rootRef = useRef<HTMLDivElement>(null);\n\n const {\n calendarIconActionHandler,\n datePickerCommitHandler,\n completeDateValue,\n dateValue,\n dropdownCloseHandler,\n iconRef,\n isOpen,\n maskCommitHandler,\n maskInputHandler,\n maskRef\n } = useInputDatePicker({\n isDisabled,\n isReadonly,\n onCommit,\n onInput,\n rootRef,\n value\n });\n\n const mainFieldRef = useRef<HTMLDivElement>(null);\n const { inputDatePicker_selectDate, inputDatePicker_instruction } =\n useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const calendarIconAriaLabel = inputDatePicker_selectDate();\n\n // We need this to determine if UA/messaging should be shown in the dropdown.\n const { userAssistanceDensity: formUserAssistanceDensity } = useFormContext();\n const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;\n\n useImperativeHandle(ref!, () => ({\n focus: () => {\n maskRef.current?.focus();\n },\n blur: () => {\n maskRef.current?.blur();\n }\n }));\n\n const maskFieldInstructionId = useId();\n const maskFieldInstructionText = inputDatePicker_instruction();\n const maskFieldInstruction =\n !isDisabled && !isReadonly ? (\n <HiddenAccessible id={maskFieldInstructionId} isHidden={true}>\n {maskFieldInstructionText}\n </HiddenAccessible>\n ) : undefined;\n const ariaDescribedBy =\n !isDisabled && !isReadonly\n ? merge([propDescribedBy, maskFieldInstructionId])\n : propDescribedBy;\n\n const endContent = (\n <IconButton\n aria-haspopup=\"dialog\"\n aria-label={calendarIconAriaLabel}\n isDisabled={isDisabled}\n ref={iconRef}\n size=\"sm\"\n testId={testId ? testId + '_calendarIcon' : undefined}\n variant=\"ghost\"\n onAction={calendarIconActionHandler}>\n <CalendarIcon />\n </IconButton>\n );\n\n const shouldShowDropdown = isOpen as boolean;\n\n return (\n <div {...testIdProps} ref={rootRef}>\n <InputDateMaskContext.Provider\n value={{ isDropdownOpen: isOpen, isInputDatePickerParent: true }}>\n <InputDateMask\n aria-describedby={ariaDescribedBy}\n assistiveText={assistiveText}\n endContent={endContent}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n isDisabled={isDisabled}\n isReadonly={isReadonly}\n label={label}\n onCommit={maskCommitHandler}\n onInput={maskInputHandler}\n mainFieldRef={mainFieldRef}\n messages={messages}\n testId={testId ? testId + '_mask' : undefined}\n ref={maskRef}\n userAssistanceDensity={propUserAssistanceDensity}\n value={dateValue}\n {...dateMaskProps}\n />\n </InputDateMaskContext.Provider>\n\n {maskFieldInstruction}\n\n {shouldShowDropdown && (\n <InputDatePickerDropdown\n anchorRef={mainFieldRef}\n assistiveText={assistiveText}\n dayFormatter={dayFormatter}\n daysOutsideMonth={daysOutsideMonth}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n isDisabled={isDisabled}\n isReadonly={isReadonly}\n isOpen={isOpen}\n label={label}\n onClose={dropdownCloseHandler}\n onCommit={datePickerCommitHandler}\n max={max}\n messages={messages}\n min={min}\n monthAndYearPicker={monthAndYearPicker}\n testId={testId ? testId + '_datePicker' : undefined}\n todayTimeZone={todayTimeZone}\n todayButton={todayButton}\n userAssistanceDensity={userAssistanceDensity}\n value={completeDateValue}\n weekDisplay={weekDisplay}\n />\n )}\n </div>\n );\n }\n);\n"],"names":["InputDatePickerDropdown","anchorRef","assistiveText","dayFormatter","daysOutsideMonth","helpSourceLink","helpSourceText","isDisabled","isOpen","isReadonly","label","onClose","onCommit","max","messages","min","monthAndYearPicker","testId","todayButton","todayTimeZone","userAssistanceDensity","value","weekDisplay","isDropdownAbove","setDropdownAbove","useState","prevIsOpen","setPrevIsOpen","handleDropdownPosition","useCallback","data","placement","startsWith","shouldShowSheet","isPhone","datePicker_label","useTranslationBundle","datePickerAriaLabel","datePickerMainContent","_jsx","DatePicker","height","undefined","maxWidth","width","inlineUserAssistanceFooter","length","FormFieldContext","Provider","isFocused","children","jsx","class","userAssistanceStyles","InlineUserAssistance","fieldLabel","contentTestId","dropdownContent","dropdownStyles","SectionedContent","footer","hasFocusTrap","main","role","Sheet","initialFocus","StickyPositioningDropdown","onPosition","sizeOptions","isMaxWidthAdjusted","isMaxHeightAdjusted","getClientHints","deviceType","convertToCalendarDateRequired","dateVal","isCompleteCalendarDate","inputDatePickerReducer","state","action","type","dateValue","completeDateValue","useInputDatePicker","onInput","rootRef","currentValue","setIsOpen","iconRef","useRef","maskRef","outsideMousedownRef","outsideMousedownTimerRef","lastCommittedDateRef","lastDateRef","lastValueFromParentRef","dateSelectedRef","dispatch","useReducer","useInputDatePickerState","calendarDatesAreDifferent","current","useEffect","previousValue","maskInputHandler","detail","maskCommitHandler","calendarIconActionHandler","dropdownCloseHandler","reason","clearTimeout","setTimeout","focus","datePickerCommitHandler","changeValue","newValue","Promise","reject","resolve","useHiddenTestMethod","elementRef","method","name","InputDatePicker","forwardRef","propDescribedBy","propUserAssistanceDensity","dateMaskProps","ref","testIdProps","useTestId","mainFieldRef","inputDatePicker_selectDate","inputDatePicker_instruction","calendarIconAriaLabel","formUserAssistanceDensity","useFormContext","useImperativeHandle","blur","maskFieldInstructionId","useId","maskFieldInstructionText","maskFieldInstruction","HiddenAccessible","id","isHidden","ariaDescribedBy","merge","endContent","IconButton","size","variant","onAction","CalendarIcon","shouldShowDropdown","_jsxs","InputDateMaskContext","isDropdownOpen","isInputDatePickerParent","InputDateMask"],"mappings":"upEAsEA,MAAMA,GAA0B,EAC9BC,YACAC,gBACAC,eACAC,mBACAC,iBACAC,iBACAC,aACAC,SACAC,aACAC,QACAC,UACAC,WACAC,MACAC,WACAC,MACAC,qBACAC,SACAC,cACAC,gBACAC,wBACAC,QACAC,kBAGA,MAAOC,EAAiBC,GAAoBC,EAAQA,UAAC,IAC9CC,EAAYC,GAAiBF,EAAQA,SAACjB,GACvCoB,EAAyBC,eAE5BC,IACDN,EAAiBM,EAAKC,UAAUC,WAAW,OAAO,GACjD,IAECN,IAAelB,IACjBmB,EAAcnB,GACTA,GACHgB,GAAiB,IAIrB,MAMMS,EAAkBC,MAElBC,iBAAEA,GAAqBC,EAAoBA,qB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a01', './LineSeries-53e65053', './dataStyleUtils-9895ff76', './useUser-12ec03f1', './colorUtils-7aaca9f1', './accUtils-acd70e81', './themeContract.css-2e4b066d', './Chart-
|
|
2
|
-
//# sourceMappingURL=LineAreaChart-
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', './utils-8ccd1b88', './chartUtils-d0a5aa01', './LineSeries-53e65053', './dataStyleUtils-9895ff76', './useUser-12ec03f1', './colorUtils-7aaca9f1', './accUtils-acd70e81', './themeContract.css-2e4b066d', './Chart-061335fe'], (function(e,t,i,s,n,r,a,o,d,l,g){"use strict";function c({width:e,height:d,selectedIds:c=[],hiddenIds:x=[],highlightedIds:I,hideAndShowBehavior:p="none",orientation:u="vertical",yAxis:m,y2Axis:S,series:f,groups:y,isStacked:v=!1,getDataItem:A,selectionMode:C="none",drilling:T="off",type:L="line",overview:b="off",dataLabelEffect:D="outline",...k}){const{direction:E,forcedColors:M}=a.useUser(),U="active"===M,j=void 0!==k.testId,w="rtl"===E,R="log"===m?.scale,W=k.xAxis?.timeAxisType,P=new Set(x),F=new Set(c),z=new Set(I),H="horizontal"===u,N=o.getColorRamp();let O=v?i.getCumulativeSeries(f.length,y.length,A,P,R):i.getSeriesData(f?.length,y?.length,A,P,R);const q=(e,t)=>v?{...A(e,t),value:O[e][t]}:A(e,t),{hasCenteredSeries:B,hasUncenteredSeries:V}=f.reduce(((e,t)=>({hasCenteredSeries:e.hasCenteredSeries||"centeredSegmented"===t.lineType||"centeredStepped"===t.lineType,hasUncenteredSeries:e.hasUncenteredSeries||"segmented"===t.lineType||"stepped"===t.lineType})),{hasCenteredSeries:!1,hasUncenteredSeries:!1}),Y=i.getMarkers(),G="lineWithArea"===L?.2:1,J="area"===L||"lineWithArea"===L,K="area"===L,Q=[];return t.jsx(g.Chart,{width:e,height:d,selectedIds:F,hiddenIds:x,hideAndShowBehavior:p,orientation:u,yAxis:m,y2Axis:S,series:f,groups:y,selectionMode:C,drilling:T,isStacked:v,getDataItem:A,findNearest:(e,t,s)=>i.findNearestDataPoint(f,y,e,t,q,v,(()=>({offset:0,dataWidth:0})),((e,t)=>t.transform(e)),R,0,P,W,s),getDataItemPos:(e,t,i)=>(n,r)=>{const a="y2"===f[n].associatedYAxis;return s.getLineAreaChartItemPosition(n,r,O,A,y,H,e,a?i:t,W)},getMarkerInfo:(e,t)=>({color:r.getItemColor(e,t,f,A),type:r.getMarkerType(e,t,A)}),renderGridLinesInFront:J,getNavUtil:(e,t)=>r.getLineAreaChartNavUtil(A,f.length,e,t,v,w,H),getGapRatio:()=>1,getStartAndEndAxesOffset:e=>i.getStartAndEndAxesOffset(B,V,H,e),isRtl:w,overview:b,defaultOverviewContentRenderer:()=>t.jsx(h,{series:f,groups:y,getDataItem:A,type:L}),...k,children:({getItemAriaLabel:e,groupsInfo:r,xStartIndex:a,xEndIndex:o,xScale:d,yScale:g,y2Scale:c,activeId:h,focusedItemInfo:x,hoveredItemInfo:p,isPointInsideMarquee:m,defaultFontSize:S,getTextDimensions:y,plotAreaClipPathId:L,axisStepWidth:b})=>{const E=r.map((({item:e})=>e));return O=v?i.getCumulativeSeries(f.length,E.length,A,P,R):i.getSeriesData(f?.length,E?.length,A,P,R),t.jsxs(t.Fragment,{children:[O.map(((r,M)=>{if(0===r.length)return;const P=f[M],B="y2"===P.associatedYAxis,V=i.getLineAreaSegments(B?c:g,d,r,a,o,R,E,M,q,W);Q[M]=V[0];const X="curved"===P.lineType&&v&&O.length>1&&M>0,Z=void 0===I||0===I.length||z.has(P.id),$=v&&0!=M?Q.reduce(((e,t,i)=>i>=M?e:t.length>0?i:e),0):void 0;return t.jsxs(t.Fragment,{children:[J&&t.jsx(s.AreaSeries,{yScale:B?c:g,lineType:P.lineType,color:P.areaColor||N[M%N.length],isHorizontal:H,areaColorOpacity:G,isBottomSegmentCurved:X,bottomCoords:void 0!==$&&Q[$].some((e=>null!=e))?Q[$]:void 0,lineSegments:V,isLog:R,isHighlighted:Z,seriesIndex:M,groupWidth:b,isRtl:w,timeAxisType:W,plotAreaClipPathId:L}),t.jsx(n.LineSeries,{lineType:P.lineType,lineColor:K?l.colorSchemeVars.dvt.contrastLine:P.lineColor,lineWidth:K?v?2.5:1.25:P.lineWidth,lineStyle:P.lineStyle,color:P.lineColor||N[M%N.length],lineSegmentCoords:V,isHorizontal:H,isHighlighted:Z,seriesIndex:M,groupWidth:b,isRtl:w,timeAxisType:W,plotAreaClipPathId:L}),!v&&t.jsx(n.MarkersWithLabel,{yScale:B?c:g,xScale:d,groups:E,series:P,timeAxisType:W,color:P.lineColor||P.areaColor||N[M%N.length],seriesIndex:M,startIndex:a,endIndex:o,markerType:Y[M%Y.length],orientation:u,isLog:R,activeId:h,getDataItem:A,isPointInsideMarquee:m,selectedIds:F,highlightedIds:void 0!==I?z:void 0,focusedItemIndex:x.seriesIndex!==M||!x.isFocusVisible||k.isDataCursorEnabled&&k.dataCursorStyle?.isMarkerDisplayed?void 0:x.groupIndex,hoveredItemIndex:p?.isCurrent&&p.seriesIndex===M?p.groupIndex:void 0,isSelectionEnabled:"single"===C||"multiple"===C,isDrillEnabled:"on"===T,defaultFontSize:S,dataLabelEffect:D,isHighContrast:U,isTestEnv:j,getTextDimensions:y,getItemAriaLabel:e})]})})),v&&O.map(((i,s)=>{if(0===i.length)return;const r=f[s],l="y2"===r.associatedYAxis;return t.jsx(n.MarkersWithLabel,{yScale:l?c:g,series:f[s],xScale:d,groups:E,timeAxisType:W,color:r.lineColor||r.areaColor||N[s%N.length],seriesIndex:s,isPointInsideMarquee:m,startIndex:a,endIndex:o,markerType:Y[s%Y.length],orientation:u,isLog:R,activeId:h,getDataItem:q,selectedIds:F,focusedItemIndex:x.seriesIndex===s&&x.isFocusVisible?x.groupIndex:void 0,hoveredItemIndex:p?.isCurrent&&p.seriesIndex===s?p.groupIndex:void 0,isSelectionEnabled:"single"===C||"multiple"===C,isDrillEnabled:"on"===T,defaultFontSize:S,dataLabelEffect:D,isHighContrast:U,isTestEnv:j,getTextDimensions:y,getItemAriaLabel:e})}))]})}})}function h(e){return t.jsx(c,{datatip:()=>({content:""}),zoomAndScroll:"off",overview:"off",plotArea:{yMajorTick:{isRendered:!1}},xAxis:{tickLabel:{autoRotate:!1,isRendered:!!e.xAxis?.timeAxisType}},series:e.series,groups:e.groups,getDataItem:e.getDataItem,yAxis:{tickLabel:{isRendered:!1}},type:e.type})}e.LineAreaChart=c}));
|
|
2
|
+
//# sourceMappingURL=LineAreaChart-07848f77.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineAreaChart-ee71fd90.js","sources":["../../src/UNSAFE_LineAreaChart/LineAreaChart.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { LineAreaChartProps, LineAreaItem } from './lineAreaChart.types';\nimport {\n findNearestDataPoint,\n getStartAndEndAxesOffset\n} from '#utils/PRIVATE_chartUtils/layoutUtils';\nimport { AreaSeries } from '#PRIVATE_LineAreaComponents/AreaSeries';\nimport { getCumulativeSeries, getMarkers, getSeriesData } from '#utils/PRIVATE_chartUtils/utils';\nimport { MarkersWithLabel } from '#PRIVATE_Chart/MarkersWithLabel';\nimport { getLineAreaChartNavUtil } from '#utils/PRIVATE_chartUtils/navUtils';\nimport { Chart } from '#PRIVATE_Chart';\nimport { Scale, TimeAxisProps } from '#utils/UNSAFE_visTypes/chart';\nimport { useUser } from '#hooks/UNSAFE_useUser';\nimport { getColorRamp } from '#utils/UNSAFE_visUtils';\nimport { LineSeries } from '#PRIVATE_LineAreaComponents/LineSeries';\nimport { Point } from '#utils/PRIVATE_visSVGUtils';\nimport { getLineAreaSegments } from '#utils/PRIVATE_chartUtils/utils';\nimport { colorSchemeVars } from '@oracle/oraclejet-internal-theme-contract/themeContract.css';\nimport { getItemColor, getMarkerType } from '#utils/PRIVATE_chartUtils/dataStyleUtils';\nimport { getLineAreaChartItemPosition } from '#PRIVATE_LineAreaComponents/utils/chartUtils';\n\nconst LINE_WITH_AREA_OPACITY = 0.2;\n\n/**\n * The LineAreaChart displays information graphically using lines and filled areas, making relationships among the data easier to understand.\n */\nexport function LineAreaChart<K extends string | number, D extends LineAreaItem<K>>({\n width,\n height,\n selectedIds = [],\n hiddenIds = [],\n highlightedIds,\n hideAndShowBehavior = 'none',\n orientation = 'vertical',\n yAxis,\n y2Axis,\n series,\n groups,\n isStacked = false,\n getDataItem,\n selectionMode = 'none',\n drilling = 'off',\n type = 'line',\n overview = 'off',\n dataLabelEffect = 'outline',\n ...props\n}: LineAreaChartProps<K, D>) {\n const { direction, forcedColors } = useUser();\n const isHighContrast = forcedColors === 'active';\n const isTestEnv = props.testId !== undefined;\n const isRtl = direction === 'rtl';\n const isLog = yAxis?.scale === 'log';\n const timeAxisType = (props.xAxis as TimeAxisProps)?.timeAxisType;\n const hiddenSet = new Set(hiddenIds);\n const selectedSet = new Set(selectedIds);\n const highlightedSet = new Set(highlightedIds);\n const isHoriz = orientation === 'horizontal';\n const colors = getColorRamp();\n let renderedSeries = isStacked\n ? getCumulativeSeries(series.length, groups.length, getDataItem, hiddenSet, isLog)\n : getSeriesData(series?.length, groups?.length, getDataItem, hiddenSet, isLog);\n\n const renderedGetDataItem = (seriesIndex: number, groupIndex: number): D | undefined => {\n if (!isStacked) return getDataItem(seriesIndex, groupIndex);\n return {\n ...getDataItem(seriesIndex, groupIndex),\n value: renderedSeries[seriesIndex][groupIndex]\n } as D;\n };\n\n const getGapRatio = () => {\n return 1;\n };\n\n const getNextChartItemFunc = (startIndex: number, endIndex: number) => {\n // TODO: JET-71332\n //@ts-ignore\n return getLineAreaChartNavUtil<D>(\n getDataItem,\n series.length,\n startIndex,\n endIndex,\n isStacked,\n isRtl,\n isHoriz\n );\n };\n\n const getDataItemPos = (xScale: Scale, yScale: Scale, y2Scale: Scale) => {\n return (seriesIndex: number, groupIndex: number) => {\n const isAssociatedToY2 = series[seriesIndex].associatedYAxis === 'y2';\n return getLineAreaChartItemPosition(\n seriesIndex,\n groupIndex,\n renderedSeries,\n getDataItem,\n groups,\n isHoriz,\n xScale,\n isAssociatedToY2 ? y2Scale : yScale,\n timeAxisType\n );\n };\n };\n\n const getMarkerColorAndType = (seriesIndex: number, groupIndex: number) => {\n return {\n color: getItemColor(seriesIndex, groupIndex, series, getDataItem),\n type: getMarkerType(seriesIndex, groupIndex, getDataItem)\n };\n };\n\n const findNearest = (xScale: Scale, yScale: Scale, y2Scale: Scale) => {\n const getSeriesDataInfo = () => {\n return {\n offset: 0,\n dataWidth: 0\n };\n };\n\n const getYCoord = (value: number, yScale: Scale) => {\n return yScale.transform(value);\n };\n\n return findNearestDataPoint<K, D>(\n series,\n groups,\n xScale,\n yScale,\n renderedGetDataItem,\n isStacked,\n getSeriesDataInfo,\n getYCoord,\n isLog,\n 0,\n hiddenSet,\n timeAxisType,\n y2Scale\n );\n };\n const { hasCenteredSeries, hasUncenteredSeries } = series.reduce(\n (acc, s) => {\n return {\n hasCenteredSeries:\n acc.hasCenteredSeries ||\n s.lineType === 'centeredSegmented' ||\n s.lineType === 'centeredStepped',\n hasUncenteredSeries:\n acc.hasUncenteredSeries || s.lineType === 'segmented' || s.lineType === 'stepped'\n };\n },\n { hasCenteredSeries: false, hasUncenteredSeries: false }\n );\n\n const getOffset = (groupCount: number) => {\n return getStartAndEndAxesOffset(hasCenteredSeries, hasUncenteredSeries, isHoriz, groupCount);\n };\n\n const markers = getMarkers();\n const areaOpacity = type === 'lineWithArea' ? LINE_WITH_AREA_OPACITY : 1;\n const isAreaRendered = type === 'area' || type === 'lineWithArea';\n const isContrastLineNeeded = type === 'area';\n const allLineSegmentCoords: Point[][] = [];\n return (\n <Chart\n width={width}\n height={height}\n selectedIds={selectedSet}\n hiddenIds={hiddenIds}\n hideAndShowBehavior={hideAndShowBehavior}\n orientation={orientation}\n yAxis={yAxis}\n y2Axis={y2Axis}\n series={series}\n groups={groups}\n selectionMode={selectionMode}\n drilling={drilling}\n isStacked={isStacked}\n getDataItem={getDataItem}\n findNearest={findNearest}\n getDataItemPos={getDataItemPos}\n getMarkerInfo={getMarkerColorAndType}\n renderGridLinesInFront={isAreaRendered}\n getNavUtil={getNextChartItemFunc}\n getGapRatio={getGapRatio}\n getStartAndEndAxesOffset={getOffset}\n isRtl={isRtl}\n overview={overview}\n defaultOverviewContentRenderer={() => {\n return (\n <OverviewLineAreaChart\n series={series}\n groups={groups}\n getDataItem={getDataItem}\n type={type}\n />\n );\n }}\n {...props}>\n {({\n getItemAriaLabel,\n groupsInfo,\n xStartIndex,\n xEndIndex,\n xScale,\n yScale,\n y2Scale,\n activeId,\n focusedItemInfo,\n hoveredItemInfo,\n isPointInsideMarquee,\n defaultFontSize,\n getTextDimensions,\n plotAreaClipPathId,\n axisStepWidth\n }) => {\n const leafGroups = groupsInfo.map(({ item }) => item);\n renderedSeries = isStacked\n ? getCumulativeSeries(series.length, leafGroups.length, getDataItem, hiddenSet, isLog)\n : getSeriesData(series?.length, leafGroups?.length, getDataItem, hiddenSet, isLog);\n return (\n <>\n {renderedSeries.map((lineAreaSeries, index) => {\n if (lineAreaSeries.length === 0) {\n /* TODO: need a better way to handle when a series is hidden. */\n return;\n }\n const seriesItem = series[index];\n const isAssociatedToY2 = seriesItem.associatedYAxis === 'y2';\n const lineSegmentCoords: Point[][] = getLineAreaSegments<K, D>(\n isAssociatedToY2 ? y2Scale : yScale,\n xScale,\n lineAreaSeries,\n xStartIndex,\n xEndIndex,\n isLog,\n leafGroups,\n index,\n renderedGetDataItem,\n timeAxisType\n );\n allLineSegmentCoords[index] = lineSegmentCoords[0];\n const isBottomSegmentCurved =\n seriesItem.lineType === 'curved' &&\n isStacked &&\n renderedSeries.length > 1 &&\n index > 0;\n\n const isHighlighted =\n highlightedIds === undefined ||\n highlightedIds.length === 0 ||\n highlightedSet.has(seriesItem.id);\n\n const prevCoords =\n isStacked && index != 0\n ? allLineSegmentCoords.reduce((prevValue, newValue, j) => {\n // find the index i such that i < index, and series i has at least\n // one or more data item unhidden. Only such series will can be\n // used as bottomCoord for current series. Otherwise we have to use\n // baseline coord\n if (j >= index) {\n return prevValue;\n }\n if (newValue.length > 0) {\n return j;\n }\n return prevValue;\n }, 0)\n : undefined;\n\n return (\n <>\n {isAreaRendered && (\n <AreaSeries\n yScale={isAssociatedToY2 ? y2Scale : yScale}\n lineType={seriesItem.lineType}\n color={seriesItem.areaColor || colors[index % colors.length]}\n isHorizontal={isHoriz}\n areaColorOpacity={areaOpacity}\n isBottomSegmentCurved={isBottomSegmentCurved}\n bottomCoords={\n prevCoords !== undefined &&\n allLineSegmentCoords[prevCoords].some((value) => value != null)\n ? allLineSegmentCoords[prevCoords]\n : undefined\n }\n lineSegments={lineSegmentCoords}\n isLog={isLog}\n isHighlighted={isHighlighted}\n seriesIndex={index}\n groupWidth={axisStepWidth}\n isRtl={isRtl}\n timeAxisType={timeAxisType}\n plotAreaClipPathId={plotAreaClipPathId}\n />\n )}\n <LineSeries\n lineType={seriesItem.lineType}\n /* TODO: confirm with UX if this is contrastLine (changes depending on dark/light mode) or always white. \n It's always white in legacy.*/\n lineColor={\n isContrastLineNeeded ? colorSchemeVars.dvt.contrastLine : seriesItem.lineColor\n }\n /* The area generated in legacy are bit apart and not touching when stacked. Preact areas are a bit closer than legacy when curved. \n Increased the contrast linewidth (to 2.5 from legacy 1.25) to give legacy visual treatment.\n TODO: investivage why legacy areas are not touching. maybe we want to do the same in preact svg utils that\n generates this curve.\n */\n lineWidth={\n isContrastLineNeeded ? (isStacked ? 2.5 : 1.25) : seriesItem.lineWidth\n }\n lineStyle={seriesItem.lineStyle}\n color={seriesItem.lineColor || colors[index % colors.length]}\n lineSegmentCoords={lineSegmentCoords}\n isHorizontal={isHoriz}\n isHighlighted={isHighlighted}\n seriesIndex={index}\n groupWidth={axisStepWidth}\n isRtl={isRtl}\n timeAxisType={timeAxisType}\n plotAreaClipPathId={plotAreaClipPathId}\n />\n {\n /*for non stacked charts, markers should render in the order of series.\n some markers might get hidden behind area but this preserves the legacy behavior. */\n !isStacked && (\n <MarkersWithLabel\n yScale={isAssociatedToY2 ? y2Scale : yScale}\n xScale={xScale}\n groups={leafGroups}\n series={seriesItem}\n timeAxisType={timeAxisType}\n color={\n seriesItem.lineColor ||\n seriesItem.areaColor ||\n colors[\n index % colors.length\n ] /* TODO : make this use getItemColor function from dataStyleUtils. */\n }\n seriesIndex={index}\n startIndex={xStartIndex}\n endIndex={xEndIndex}\n markerType={markers[index % markers.length]}\n orientation={orientation}\n isLog={isLog}\n activeId={activeId}\n getDataItem={getDataItem}\n isPointInsideMarquee={isPointInsideMarquee}\n selectedIds={selectedSet}\n highlightedIds={highlightedIds !== undefined ? highlightedSet : undefined}\n focusedItemIndex={\n focusedItemInfo.seriesIndex === index &&\n focusedItemInfo.isFocusVisible &&\n !(props.isDataCursorEnabled && props.dataCursorStyle?.isMarkerDisplayed)\n ? focusedItemInfo.groupIndex\n : undefined\n }\n hoveredItemIndex={\n hoveredItemInfo?.isCurrent && hoveredItemInfo.seriesIndex === index\n ? hoveredItemInfo.groupIndex\n : undefined\n }\n isSelectionEnabled={\n selectionMode === 'single' || selectionMode === 'multiple'\n }\n isDrillEnabled={drilling === 'on'}\n defaultFontSize={defaultFontSize}\n dataLabelEffect={dataLabelEffect}\n isHighContrast={isHighContrast}\n isTestEnv={isTestEnv}\n getTextDimensions={getTextDimensions}\n getItemAriaLabel={getItemAriaLabel}\n />\n )\n }\n </>\n );\n })}\n {isStacked &&\n renderedSeries.map((lineAreaSeries, index) => {\n if (lineAreaSeries.length === 0) {\n /* TODO: need a better way to handle when a series is hidden.*/\n return;\n }\n const seriesItem = series[index];\n const isAssociatedToY2 = seriesItem.associatedYAxis === 'y2';\n return (\n <MarkersWithLabel\n yScale={isAssociatedToY2 ? y2Scale : yScale}\n series={series[index]}\n xScale={xScale}\n groups={leafGroups}\n timeAxisType={timeAxisType}\n color={\n seriesItem.lineColor || seriesItem.areaColor || colors[index % colors.length]\n }\n seriesIndex={index}\n isPointInsideMarquee={isPointInsideMarquee}\n startIndex={xStartIndex}\n endIndex={xEndIndex}\n markerType={markers[index % markers.length]}\n orientation={orientation}\n isLog={isLog}\n activeId={activeId}\n getDataItem={renderedGetDataItem}\n selectedIds={selectedSet}\n focusedItemIndex={\n focusedItemInfo.seriesIndex === index && focusedItemInfo.isFocusVisible\n ? focusedItemInfo.groupIndex\n : undefined\n }\n hoveredItemIndex={\n hoveredItemInfo?.isCurrent && hoveredItemInfo.seriesIndex === index\n ? hoveredItemInfo.groupIndex\n : undefined\n }\n isSelectionEnabled={selectionMode === 'single' || selectionMode === 'multiple'}\n isDrillEnabled={drilling === 'on'}\n defaultFontSize={defaultFontSize}\n dataLabelEffect={dataLabelEffect}\n isHighContrast={isHighContrast}\n isTestEnv={isTestEnv}\n getTextDimensions={getTextDimensions}\n getItemAriaLabel={getItemAriaLabel}\n />\n );\n })}\n </>\n );\n }}\n </Chart>\n );\n}\n\nfunction OverviewLineAreaChart<K extends string | number, D extends LineAreaItem<K>>(\n props: LineAreaChartProps<K, D>\n) {\n return (\n <LineAreaChart\n datatip={() => ({ content: '' })}\n zoomAndScroll=\"off\"\n overview=\"off\"\n plotArea={{\n yMajorTick: {\n isRendered: false\n }\n }}\n xAxis={{\n tickLabel: {\n autoRotate: false,\n // @ts-ignore\n isRendered: props.xAxis?.timeAxisType ? true : false\n }\n }}\n series={props.series}\n groups={props.groups}\n getDataItem={props.getDataItem}\n yAxis={{\n tickLabel: {\n isRendered: false\n }\n }}\n type={props.type}\n />\n );\n}\n"],"names":["LineAreaChart","width","height","selectedIds","hiddenIds","highlightedIds","hideAndShowBehavior","orientation","yAxis","y2Axis","series","groups","isStacked","getDataItem","selectionMode","drilling","type","overview","dataLabelEffect","props","direction","forcedColors","useUser","isHighContrast","isTestEnv","undefined","testId","isRtl","isLog","scale","timeAxisType","xAxis","hiddenSet","Set","selectedSet","highlightedSet","isHoriz","colors","getColorRamp","renderedSeries","getCumulativeSeries","length","getSeriesData","renderedGetDataItem","seriesIndex","groupIndex","value","hasCenteredSeries","hasUncenteredSeries","reduce","acc","s","lineType","markers","getMarkers","areaOpacity","isAreaRendered","isContrastLineNeeded","allLineSegmentCoords","_jsx","Chart","findNearest","xScale","yScale","y2Scale","findNearestDataPoint","offset","dataWidth","transform","getDataItemPos","isAssociatedToY2","associatedYAxis","getLineAreaChartItemPosition","getMarkerInfo","color","getItemColor","getMarkerType","renderGridLinesInFront","getNavUtil","startIndex","endIndex","getLineAreaChartNavUtil","getGapRatio","getStartAndEndAxesOffset","groupCount","defaultOverviewContentRenderer","OverviewLineAreaChart","children","getItemAriaLabel","groupsInfo","xStartIndex","xEndIndex","activeId","focusedItemInfo","hoveredItemInfo","isPointInsideMarquee","defaultFontSize","getTextDimensions","plotAreaClipPathId","axisStepWidth","leafGroups","map","item","_jsxs","jsxs","_Fragment","Fragment","lineAreaSeries","index","seriesItem","lineSegmentCoords","getLineAreaSegments","isBottomSegmentCurved","isHighlighted","has","id","prevCoords","prevValue","newValue","j","AreaSeries","areaColor","isHorizontal","areaColorOpacity","bottomCoords","some","lineSegments","groupWidth","LineSeries","lineColor","colorSchemeVars","dvt","contrastLine","lineWidth","lineStyle","jsx","MarkersWithLabel","markerType","focusedItemIndex","isFocusVisible","isDataCursorEnabled","dataCursorStyle","isMarkerDisplayed","hoveredItemIndex","isCurrent","isSelectionEnabled","isDrillEnabled","datatip","content","zoomAndScroll","plotArea","yMajorTick","isRendered","tickLabel","autoRotate"],"mappings":"0SAgCgB,SAAAA,GAAoEC,MAClFA,EAAKC,OACLA,EAAMC,YACNA,EAAc,GAAEC,UAChBA,EAAY,GAAEC,eACdA,EAAcC,oBACdA,EAAsB,OAAMC,YAC5BA,EAAc,WAAUC,MACxBA,EAAKC,OACLA,EAAMC,OACNA,EAAMC,OACNA,EAAMC,UACNA,GAAY,EAAKC,YACjBA,EAAWC,cACXA,EAAgB,OAAMC,SACtBA,EAAW,MAAKC,KAChBA,EAAO,OAAM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kD,OAA/BuC,EAAWtC,gBACpC,OACEZ,EAAC4E,IAAAC,EAAgBA,iBACf,CAAAzE,OAAQO,EAAmBN,EAAUD,EACrCrD,OAAQA,EAAOkG,GACf9C,OAAQA,EACRnD,OAAQyF,EACRtE,aAAcA,EACd4C,MACEmC,EAAWoB,WAAapB,EAAWY,WAAapF,EAAOuE,EAAQvE,EAAOI,QAExEG,YAAagE,EACbb,qBAAsBA,EACtBhB,WAAYW,EACZV,SAAUW,EACV8C,WAAYpF,EAAQuD,EAAQvD,EAAQZ,QACpClC,YAAaA,EACbqB,MAAOA,EACPgE,SAAUA,EACV/E,YAAa8B,EACbxC,YAAa+B,EACbwG,iBACE7C,EAAgBjD,cAAgBgE,GAASf,EAAgB8C,eACrD9C,EAAgBhD,gBAChBpB,EAENsH,iBACEjD,GAAiBkD,WAAalD,EAAgBlD,cAAgBgE,EAC1Dd,EAAgBjD,gBAChBpB,EAENwH,mBAAsC,WAAlBnI,GAAgD,aAAlBA,EAClDoI,eAA6B,OAAbnI,EAChBiF,gBAAiBA,EACjB9E,gBAAiBA,EACjBK,eAAgBA,EAChBC,UAAWA,EACXyE,kBAAmBA,EACnBT,iBAAkBA,GAEpB,MAGR,GAIV,CAEA,SAASF,EACPnE,GAEA,OACEwC,EAAC4E,IAAAvI,EACC,CAAAmJ,QAAS,KAAO,CAAEC,QAAS,KAC3BC,cAAc,MACdpI,SAAS,MACTqI,SAAU,CACRC,WAAY,CACVC,YAAY,IAGhBzH,MAAO,CACL0H,UAAW,CACTC,YAAY,EAEZF,aAAYrI,EAAMY,OAAOD,eAG7BpB,OAAQS,EAAMT,OACdC,OAAQQ,EAAMR,OACdE,YAAaM,EAAMN,YACnBL,MAAO,CACLiJ,UAAW,CACTD,YAAY,IAGhBxI,KAAMG,EAAMH,MAGlB"}
|
|
1
|
+
{"version":3,"file":"LineAreaChart-07848f77.js","sources":["../../src/UNSAFE_LineAreaChart/LineAreaChart.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { LineAreaChartProps, LineAreaItem } from './lineAreaChart.types';\nimport {\n findNearestDataPoint,\n getStartAndEndAxesOffset\n} from '#utils/PRIVATE_chartUtils/layoutUtils';\nimport { AreaSeries } from '#PRIVATE_LineAreaComponents/AreaSeries';\nimport { getCumulativeSeries, getMarkers, getSeriesData } from '#utils/PRIVATE_chartUtils/utils';\nimport { MarkersWithLabel } from '#PRIVATE_Chart/MarkersWithLabel';\nimport { getLineAreaChartNavUtil } from '#utils/PRIVATE_chartUtils/navUtils';\nimport { Chart } from '#PRIVATE_Chart';\nimport { Scale, TimeAxisProps } from '#utils/UNSAFE_visTypes/chart';\nimport { useUser } from '#hooks/UNSAFE_useUser';\nimport { getColorRamp } from '#utils/UNSAFE_visUtils';\nimport { LineSeries } from '#PRIVATE_LineAreaComponents/LineSeries';\nimport { Point } from '#utils/PRIVATE_visSVGUtils';\nimport { getLineAreaSegments } from '#utils/PRIVATE_chartUtils/utils';\nimport { colorSchemeVars } from '@oracle/oraclejet-internal-theme-contract/themeContract.css';\nimport { getItemColor, getMarkerType } from '#utils/PRIVATE_chartUtils/dataStyleUtils';\nimport { getLineAreaChartItemPosition } from '#PRIVATE_LineAreaComponents/utils/chartUtils';\n\nconst LINE_WITH_AREA_OPACITY = 0.2;\n\n/**\n * The LineAreaChart displays information graphically using lines and filled areas, making relationships among the data easier to understand.\n */\nexport function LineAreaChart<K extends string | number, D extends LineAreaItem<K>>({\n width,\n height,\n selectedIds = [],\n hiddenIds = [],\n highlightedIds,\n hideAndShowBehavior = 'none',\n orientation = 'vertical',\n yAxis,\n y2Axis,\n series,\n groups,\n isStacked = false,\n getDataItem,\n selectionMode = 'none',\n drilling = 'off',\n type = 'line',\n overview = 'off',\n dataLabelEffect = 'outline',\n ...props\n}: LineAreaChartProps<K, D>) {\n const { direction, forcedColors } = useUser();\n const isHighContrast = forcedColors === 'active';\n const isTestEnv = props.testId !== undefined;\n const isRtl = direction === 'rtl';\n const isLog = yAxis?.scale === 'log';\n const timeAxisType = (props.xAxis as TimeAxisProps)?.timeAxisType;\n const hiddenSet = new Set(hiddenIds);\n const selectedSet = new Set(selectedIds);\n const highlightedSet = new Set(highlightedIds);\n const isHoriz = orientation === 'horizontal';\n const colors = getColorRamp();\n let renderedSeries = isStacked\n ? getCumulativeSeries(series.length, groups.length, getDataItem, hiddenSet, isLog)\n : getSeriesData(series?.length, groups?.length, getDataItem, hiddenSet, isLog);\n\n const renderedGetDataItem = (seriesIndex: number, groupIndex: number): D | undefined => {\n if (!isStacked) return getDataItem(seriesIndex, groupIndex);\n return {\n ...getDataItem(seriesIndex, groupIndex),\n value: renderedSeries[seriesIndex][groupIndex]\n } as D;\n };\n\n const getGapRatio = () => {\n return 1;\n };\n\n const getNextChartItemFunc = (startIndex: number, endIndex: number) => {\n // TODO: JET-71332\n //@ts-ignore\n return getLineAreaChartNavUtil<D>(\n getDataItem,\n series.length,\n startIndex,\n endIndex,\n isStacked,\n isRtl,\n isHoriz\n );\n };\n\n const getDataItemPos = (xScale: Scale, yScale: Scale, y2Scale: Scale) => {\n return (seriesIndex: number, groupIndex: number) => {\n const isAssociatedToY2 = series[seriesIndex].associatedYAxis === 'y2';\n return getLineAreaChartItemPosition(\n seriesIndex,\n groupIndex,\n renderedSeries,\n getDataItem,\n groups,\n isHoriz,\n xScale,\n isAssociatedToY2 ? y2Scale : yScale,\n timeAxisType\n );\n };\n };\n\n const getMarkerColorAndType = (seriesIndex: number, groupIndex: number) => {\n return {\n color: getItemColor(seriesIndex, groupIndex, series, getDataItem),\n type: getMarkerType(seriesIndex, groupIndex, getDataItem)\n };\n };\n\n const findNearest = (xScale: Scale, yScale: Scale, y2Scale: Scale) => {\n const getSeriesDataInfo = () => {\n return {\n offset: 0,\n dataWidth: 0\n };\n };\n\n const getYCoord = (value: number, yScale: Scale) => {\n return yScale.transform(value);\n };\n\n return findNearestDataPoint<K, D>(\n series,\n groups,\n xScale,\n yScale,\n renderedGetDataItem,\n isStacked,\n getSeriesDataInfo,\n getYCoord,\n isLog,\n 0,\n hiddenSet,\n timeAxisType,\n y2Scale\n );\n };\n const { hasCenteredSeries, hasUncenteredSeries } = series.reduce(\n (acc, s) => {\n return {\n hasCenteredSeries:\n acc.hasCenteredSeries ||\n s.lineType === 'centeredSegmented' ||\n s.lineType === 'centeredStepped',\n hasUncenteredSeries:\n acc.hasUncenteredSeries || s.lineType === 'segmented' || s.lineType === 'stepped'\n };\n },\n { hasCenteredSeries: false, hasUncenteredSeries: false }\n );\n\n const getOffset = (groupCount: number) => {\n return getStartAndEndAxesOffset(hasCenteredSeries, hasUncenteredSeries, isHoriz, groupCount);\n };\n\n const markers = getMarkers();\n const areaOpacity = type === 'lineWithArea' ? LINE_WITH_AREA_OPACITY : 1;\n const isAreaRendered = type === 'area' || type === 'lineWithArea';\n const isContrastLineNeeded = type === 'area';\n const allLineSegmentCoords: Point[][] = [];\n return (\n <Chart\n width={width}\n height={height}\n selectedIds={selectedSet}\n hiddenIds={hiddenIds}\n hideAndShowBehavior={hideAndShowBehavior}\n orientation={orientation}\n yAxis={yAxis}\n y2Axis={y2Axis}\n series={series}\n groups={groups}\n selectionMode={selectionMode}\n drilling={drilling}\n isStacked={isStacked}\n getDataItem={getDataItem}\n findNearest={findNearest}\n getDataItemPos={getDataItemPos}\n getMarkerInfo={getMarkerColorAndType}\n renderGridLinesInFront={isAreaRendered}\n getNavUtil={getNextChartItemFunc}\n getGapRatio={getGapRatio}\n getStartAndEndAxesOffset={getOffset}\n isRtl={isRtl}\n overview={overview}\n defaultOverviewContentRenderer={() => {\n return (\n <OverviewLineAreaChart\n series={series}\n groups={groups}\n getDataItem={getDataItem}\n type={type}\n />\n );\n }}\n {...props}>\n {({\n getItemAriaLabel,\n groupsInfo,\n xStartIndex,\n xEndIndex,\n xScale,\n yScale,\n y2Scale,\n activeId,\n focusedItemInfo,\n hoveredItemInfo,\n isPointInsideMarquee,\n defaultFontSize,\n getTextDimensions,\n plotAreaClipPathId,\n axisStepWidth\n }) => {\n const leafGroups = groupsInfo.map(({ item }) => item);\n renderedSeries = isStacked\n ? getCumulativeSeries(series.length, leafGroups.length, getDataItem, hiddenSet, isLog)\n : getSeriesData(series?.length, leafGroups?.length, getDataItem, hiddenSet, isLog);\n return (\n <>\n {renderedSeries.map((lineAreaSeries, index) => {\n if (lineAreaSeries.length === 0) {\n /* TODO: need a better way to handle when a series is hidden. */\n return;\n }\n const seriesItem = series[index];\n const isAssociatedToY2 = seriesItem.associatedYAxis === 'y2';\n const lineSegmentCoords: Point[][] = getLineAreaSegments<K, D>(\n isAssociatedToY2 ? y2Scale : yScale,\n xScale,\n lineAreaSeries,\n xStartIndex,\n xEndIndex,\n isLog,\n leafGroups,\n index,\n renderedGetDataItem,\n timeAxisType\n );\n allLineSegmentCoords[index] = lineSegmentCoords[0];\n const isBottomSegmentCurved =\n seriesItem.lineType === 'curved' &&\n isStacked &&\n renderedSeries.length > 1 &&\n index > 0;\n\n const isHighlighted =\n highlightedIds === undefined ||\n highlightedIds.length === 0 ||\n highlightedSet.has(seriesItem.id);\n\n const prevCoords =\n isStacked && index != 0\n ? allLineSegmentCoords.reduce((prevValue, newValue, j) => {\n // find the index i such that i < index, and series i has at least\n // one or more data item unhidden. Only such series will can be\n // used as bottomCoord for current series. Otherwise we have to use\n // baseline coord\n if (j >= index) {\n return prevValue;\n }\n if (newValue.length > 0) {\n return j;\n }\n return prevValue;\n }, 0)\n : undefined;\n\n return (\n <>\n {isAreaRendered && (\n <AreaSeries\n yScale={isAssociatedToY2 ? y2Scale : yScale}\n lineType={seriesItem.lineType}\n color={seriesItem.areaColor || colors[index % colors.length]}\n isHorizontal={isHoriz}\n areaColorOpacity={areaOpacity}\n isBottomSegmentCurved={isBottomSegmentCurved}\n bottomCoords={\n prevCoords !== undefined &&\n allLineSegmentCoords[prevCoords].some((value) => value != null)\n ? allLineSegmentCoords[prevCoords]\n : undefined\n }\n lineSegments={lineSegmentCoords}\n isLog={isLog}\n isHighlighted={isHighlighted}\n seriesIndex={index}\n groupWidth={axisStepWidth}\n isRtl={isRtl}\n timeAxisType={timeAxisType}\n plotAreaClipPathId={plotAreaClipPathId}\n />\n )}\n <LineSeries\n lineType={seriesItem.lineType}\n /* TODO: confirm with UX if this is contrastLine (changes depending on dark/light mode) or always white. \n It's always white in legacy.*/\n lineColor={\n isContrastLineNeeded ? colorSchemeVars.dvt.contrastLine : seriesItem.lineColor\n }\n /* The area generated in legacy are bit apart and not touching when stacked. Preact areas are a bit closer than legacy when curved. \n Increased the contrast linewidth (to 2.5 from legacy 1.25) to give legacy visual treatment.\n TODO: investivage why legacy areas are not touching. maybe we want to do the same in preact svg utils that\n generates this curve.\n */\n lineWidth={\n isContrastLineNeeded ? (isStacked ? 2.5 : 1.25) : seriesItem.lineWidth\n }\n lineStyle={seriesItem.lineStyle}\n color={seriesItem.lineColor || colors[index % colors.length]}\n lineSegmentCoords={lineSegmentCoords}\n isHorizontal={isHoriz}\n isHighlighted={isHighlighted}\n seriesIndex={index}\n groupWidth={axisStepWidth}\n isRtl={isRtl}\n timeAxisType={timeAxisType}\n plotAreaClipPathId={plotAreaClipPathId}\n />\n {\n /*for non stacked charts, markers should render in the order of series.\n some markers might get hidden behind area but this preserves the legacy behavior. */\n !isStacked && (\n <MarkersWithLabel\n yScale={isAssociatedToY2 ? y2Scale : yScale}\n xScale={xScale}\n groups={leafGroups}\n series={seriesItem}\n timeAxisType={timeAxisType}\n color={\n seriesItem.lineColor ||\n seriesItem.areaColor ||\n colors[\n index % colors.length\n ] /* TODO : make this use getItemColor function from dataStyleUtils. */\n }\n seriesIndex={index}\n startIndex={xStartIndex}\n endIndex={xEndIndex}\n markerType={markers[index % markers.length]}\n orientation={orientation}\n isLog={isLog}\n activeId={activeId}\n getDataItem={getDataItem}\n isPointInsideMarquee={isPointInsideMarquee}\n selectedIds={selectedSet}\n highlightedIds={highlightedIds !== undefined ? highlightedSet : undefined}\n focusedItemIndex={\n focusedItemInfo.seriesIndex === index &&\n focusedItemInfo.isFocusVisible &&\n !(props.isDataCursorEnabled && props.dataCursorStyle?.isMarkerDisplayed)\n ? focusedItemInfo.groupIndex\n : undefined\n }\n hoveredItemIndex={\n hoveredItemInfo?.isCurrent && hoveredItemInfo.seriesIndex === index\n ? hoveredItemInfo.groupIndex\n : undefined\n }\n isSelectionEnabled={\n selectionMode === 'single' || selectionMode === 'multiple'\n }\n isDrillEnabled={drilling === 'on'}\n defaultFontSize={defaultFontSize}\n dataLabelEffect={dataLabelEffect}\n isHighContrast={isHighContrast}\n isTestEnv={isTestEnv}\n getTextDimensions={getTextDimensions}\n getItemAriaLabel={getItemAriaLabel}\n />\n )\n }\n </>\n );\n })}\n {isStacked &&\n renderedSeries.map((lineAreaSeries, index) => {\n if (lineAreaSeries.length === 0) {\n /* TODO: need a better way to handle when a series is hidden.*/\n return;\n }\n const seriesItem = series[index];\n const isAssociatedToY2 = seriesItem.associatedYAxis === 'y2';\n return (\n <MarkersWithLabel\n yScale={isAssociatedToY2 ? y2Scale : yScale}\n series={series[index]}\n xScale={xScale}\n groups={leafGroups}\n timeAxisType={timeAxisType}\n color={\n seriesItem.lineColor || seriesItem.areaColor || colors[index % colors.length]\n }\n seriesIndex={index}\n isPointInsideMarquee={isPointInsideMarquee}\n startIndex={xStartIndex}\n endIndex={xEndIndex}\n markerType={markers[index % markers.length]}\n orientation={orientation}\n isLog={isLog}\n activeId={activeId}\n getDataItem={renderedGetDataItem}\n selectedIds={selectedSet}\n focusedItemIndex={\n focusedItemInfo.seriesIndex === index && focusedItemInfo.isFocusVisible\n ? focusedItemInfo.groupIndex\n : undefined\n }\n hoveredItemIndex={\n hoveredItemInfo?.isCurrent && hoveredItemInfo.seriesIndex === index\n ? hoveredItemInfo.groupIndex\n : undefined\n }\n isSelectionEnabled={selectionMode === 'single' || selectionMode === 'multiple'}\n isDrillEnabled={drilling === 'on'}\n defaultFontSize={defaultFontSize}\n dataLabelEffect={dataLabelEffect}\n isHighContrast={isHighContrast}\n isTestEnv={isTestEnv}\n getTextDimensions={getTextDimensions}\n getItemAriaLabel={getItemAriaLabel}\n />\n );\n })}\n </>\n );\n }}\n </Chart>\n );\n}\n\nfunction OverviewLineAreaChart<K extends string | number, D extends LineAreaItem<K>>(\n props: LineAreaChartProps<K, D>\n) {\n return (\n <LineAreaChart\n datatip={() => ({ content: '' })}\n zoomAndScroll=\"off\"\n overview=\"off\"\n plotArea={{\n yMajorTick: {\n isRendered: false\n }\n }}\n xAxis={{\n tickLabel: {\n autoRotate: false,\n // @ts-ignore\n isRendered: props.xAxis?.timeAxisType ? true : false\n }\n }}\n series={props.series}\n groups={props.groups}\n getDataItem={props.getDataItem}\n yAxis={{\n tickLabel: {\n isRendered: false\n }\n }}\n type={props.type}\n />\n );\n}\n"],"names":["LineAreaChart","width","height","selectedIds","hiddenIds","highlightedIds","hideAndShowBehavior","orientation","yAxis","y2Axis","series","groups","isStacked","getDataItem","selectionMode","drilling","type","overview","dataLabelEffect","props","direction","forcedColors","useUser","isHighContrast","isTestEnv","undefined","testId","isRtl","isLog","scale","timeAxisType","xAxis","hiddenSet","Set","selectedSet","highlightedSet","isHoriz","colors","getColorRamp","renderedSeries","getCumulativeSeries","length","getSeriesData","renderedGetDataItem","seriesIndex","groupIndex","value","hasCenteredSeries","hasUncenteredSeries","reduce","acc","s","lineType","markers","getMarkers","areaOpacity","isAreaRendered","isContrastLineNeeded","allLineSegmentCoords","_jsx","Chart","findNearest","xScale","yScale","y2Scale","findNearestDataPoint","offset","dataWidth","transform","getDataItemPos","isAssociatedToY2","associatedYAxis","getLineAreaChartItemPosition","getMarkerInfo","color","getItemColor","getMarkerType","renderGridLinesInFront","getNavUtil","startIndex","endIndex","getLineAreaChartNavUtil","getGapRatio","getStartAndEndAxesOffset","groupCount","defaultOverviewContentRenderer","OverviewLineAreaChart","children","getItemAriaLabel","groupsInfo","xStartIndex","xEndIndex","activeId","focusedItemInfo","hoveredItemInfo","isPointInsideMarquee","defaultFontSize","getTextDimensions","plotAreaClipPathId","axisStepWidth","leafGroups","map","item","_jsxs","jsxs","_Fragment","Fragment","lineAreaSeries","index","seriesItem","lineSegmentCoords","getLineAreaSegments","isBottomSegmentCurved","isHighlighted","has","id","prevCoords","prevValue","newValue","j","AreaSeries","areaColor","isHorizontal","areaColorOpacity","bottomCoords","some","lineSegments","groupWidth","LineSeries","lineColor","colorSchemeVars","dvt","contrastLine","lineWidth","lineStyle","jsx","MarkersWithLabel","markerType","focusedItemIndex","isFocusVisible","isDataCursorEnabled","dataCursorStyle","isMarkerDisplayed","hoveredItemIndex","isCurrent","isSelectionEnabled","isDrillEnabled","datatip","content","zoomAndScroll","plotArea","yMajorTick","isRendered","tickLabel","autoRotate"],"mappings":"0SAgCgB,SAAAA,GAAoEC,MAClFA,EAAKC,OACLA,EAAMC,YACNA,EAAc,GAAEC,UAChBA,EAAY,GAAEC,eACdA,EAAcC,oBACdA,EAAsB,OAAMC,YAC5BA,EAAc,WAAUC,MACxBA,EAAKC,OACLA,EAAMC,OACNA,EAAMC,OACNA,EAAMC,UACNA,GAAY,EAAKC,YACjBA,EAAWC,cACXA,EAAgB,OAAMC,SACtBA,EAAW,MAAKC,KAChBA,EAAO,OAAMC,SACbA,EAAW,MAAKC,gBAChBA,EAAkB,aACfC,IAEH,MAAMC,UAAEA,EAASC,aAAEA,GAAiBC,EAAOA,UACrCC,EAAkC,WAAjBF,EACjBG,OAA6BC,IAAjBN,EAAMO,OAClBC,EAAsB,QAAdP,EACRQ,EAAyB,QAAjBpB,GAAOqB,MACfC,EAAgBX,EAAMY,OAAyBD,aAC/CE,EAAY,IAAIC,IAAI7B,GACpB8B,EAAc,IAAID,IAAI9B,GACtBgC,EAAiB,IAAIF,IAAI5B,GACzB+B,EAA0B,eAAhB7B,EACV8B,EAASC,EAAAA,eACf,IAAIC,EAAiB3B,EACjB4B,EAAmBA,oBAAC9B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G,iBACE7C,EAAgBjD,cAAgBgE,GAASf,EAAgB8C,eACrD9C,EAAgBhD,gBAChBpB,EAENsH,iBACEjD,GAAiBkD,WAAalD,EAAgBlD,cAAgBgE,EAC1Dd,EAAgBjD,gBAChBpB,EAENwH,mBAAsC,WAAlBnI,GAAgD,aAAlBA,EAClDoI,eAA6B,OAAbnI,EAChBiF,gBAAiBA,EACjB9E,gBAAiBA,EACjBK,eAAgBA,EAChBC,UAAWA,EACXyE,kBAAmBA,EACnBT,iBAAkBA,GAEpB,MAGR,GAIV,CAEA,SAASF,EACPnE,GAEA,OACEwC,EAAC4E,IAAAvI,EACC,CAAAmJ,QAAS,KAAO,CAAEC,QAAS,KAC3BC,cAAc,MACdpI,SAAS,MACTqI,SAAU,CACRC,WAAY,CACVC,YAAY,IAGhBzH,MAAO,CACL0H,UAAW,CACTC,YAAY,EAEZF,aAAYrI,EAAMY,OAAOD,eAG7BpB,OAAQS,EAAMT,OACdC,OAAQQ,EAAMR,OACdE,YAAaM,EAAMN,YACnBL,MAAO,CACLiJ,UAAW,CACTD,YAAY,IAGhBxI,KAAMG,EAAMH,MAGlB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact/hooks', './mergeProps-bcfa6a92', './classNames-08d99695', './clientUtils-f1eea2db', './useId-c9578d26', './UNSAFE_NavigationList/themes/NavigationListStyles.css', './collectionUtils-26e6c87c', './useCollectionFocusRing-35d278f5', './useCurrentKey-8e979c7a', './useContextMenuGesture-69b54d61', './useTranslationBundle-8e42d505', './TabBarContextMenu-cad0a362', 'preact/compat', './useTestId-9afc201a', './HiddenAccessible-037ef42d', './LiveRegion-ef77cf92', './BaseNavigationListItem-cb5c260b'], (function(e,t,n,o,r,i,s,a,c,l,u,d,f,m,y,g,b,v,x){"use strict";const C='[role="tab"]',h="[data-oj-navigationlist-item-remove-icon]",K={mouse:{initialFocus:"menu",placement:"bottom-start",offsetValue:0},keyboard:{initialFocus:"firstItem",placement:"bottom-start",offsetValue:0},touch:{initialFocus:"menu",placement:"end",offsetValue:40}},R={isOpen:!1,initialFocus:"menu",placement:"bottom-start",offsetValue:0,anchorRef:{current:null}};const p=(e,t,n)=>{const o=c.findElementByKey(t,e,C);if(o){return o.querySelector(n)}},I=(e,t)=>{const n=c.findElementByKey(t,e,C);if(n)return n.innerText},M=(e,t,n)=>{const o=e.closest(t),r=e.closest(n);return o?.contains(r)?null:c.keyExtractor(e,t)},k=(e,t,n)=>{const o=n.indexOf(e);if(o>0){const e=n[o===n.length-1?o-1:o+1];if(-1!==t.indexOf(e))return e}return t[0]},S=y.forwardRef((({children:e,selection:S,onSelectionChange:F,onRemove:N,"aria-label":w,"aria-labelledby":L,testId:j},E)=>{const A=n.useRef(null),D=i.isMobile(),P=n.useMemo((()=>({itemsRenderer:e=>{if(e){if(null!=p(e.itemKey,A.current,h)&&D){const n=e.defaultMenuItems;return t.jsx(t.Fragment,{children:n})}}return null}})),[]),{showFocusRing:B,currentKey:H,onCurrentKeyChange:V,containerHandlers:T,onKeyDown:O,contextMenuContext:U,menuProps:_,contextMenuDescription:q,contextMenuDescriptionId:G,accStatusInfo:$}=function({containerRef:e,selection:t,onRemove:r,onSelectionChange:i,children:s,contextMenuConfig:a}){const y=f.useTranslationBundle("@oracle/oraclejet-preact"),[g,b]=n.useState(t),v=n.useCallback((e=>{b(e.value)}),[]),{currentKeyProps:x}=u.useCurrentKey((e=>r?M(e,C,h):c.keyExtractor(e,C)),!1,c.getPrevNextKeyUsingRef(e,g,!0,C),c.getPrevNextKeyUsingRef(e,g,!1,C),void 0,void 0,g,v),[S,F]=l.useCollectionFocusRing(e,["Home","End","ArrowUp","ArrowDown"]),N={onFocus:n.useCallback((()=>{if(e.current&&void 0===g){const t=c.getFirstVisibleKey(e.current,C);t&&b(t)}}),[g,e])},w=n.useRef();n.useEffect((()=>{if(e.current){const t=Array.from(e.current.querySelectorAll(C),(e=>c.getKey(e)));if(null!=g&&-1!==t.indexOf(g)){const t=c.findElementByKey(e.current,g,C);t.scrollIntoViewIfNeeded?t.scrollIntoViewIfNeeded():t.scrollIntoView({block:"nearest"})}else g&&-1===t.indexOf(g)&&(w.current?b(k(g,t,w.current)):b(t[0])),w.current=t}}),[s,g,e]);const L=n.useCallback((t=>{if(("Home"===t.key||"End"===t.key)&&e.current&&g){const n=Array.from(e.current.querySelectorAll(C),(e=>c.getKey(e)));v?.({value:n["Home"===t.key?0:n.length-1]})}!g||"Enter"!==t.key&&" "!==t.key||i?.({value:g,reason:"keyboard"}),g&&"Delete"===t.key&&r?.({value:g})}),[g,i,r,v,e]),[j,E]=n.useState(),[A,D]=n.useState(R),[P,B]=n.useState(),{triggerProps:H}=d.useContextMenuGesture((({gesture:t,anchor:n,target:o})=>{let i=n,s=g;if("keyboard"===t){i=c.findElementByKey(e.current,g,C)||n}else{const e=c.keyExtractor(o,C);s=null!=e?e:g}let l=!1;e.current&&(l=null!=p(s,e.current,h));const u=m.getDefaultContextMenu({isRemovable:l,handleRemove:r,handleReorder:void 0,itemKey:s,tabKeys:void 0,direction:void 0,itemLabels:{labelRemove:l?y.tabbar_labelRemove():void 0},handleAccStatus:t=>{const n=I(t.removedKey,e.current),o=l&&t.removedKey?` Removed ${n}`:"";B(o)}});E(u),D({...K[t],anchorRef:{current:i},isOpen:null!=a})}),{isDisabled:!a}),V=n.useCallback((t=>{"dismissed"!==t.reason&&"itemAction"!==t.reason||(b(j?.itemKey),e.current?.focus()),D({...R})}),[e,j?.itemKey]),T="contextMenu_"+n.useId(),O=y.tabbar_labelContextMenu();return{showFocusRing:S,currentKey:g,onCurrentKeyChange:v,onKeyDown:L,menuProps:{...A,onClose:V},contextMenuContext:j,contextMenuDescription:O,contextMenuDescriptionId:T,accStatusInfo:P,containerHandlers:o.mergeProps(F,x,N,H)}}({containerRef:A,selection:S,onRemove:N,onSelectionChange:F,children:e,contextMenuConfig:P}),z=null!=P&&D,J={onKeyDown:O},Q=r.classNames([a.navigationListStyles.uListStyle]),W=s.useId()+"_",X=g.useTestId(j);return y.useImperativeHandle(E,(()=>({focus:()=>{A.current&&A.current.focus()},blur:()=>{A.current&&A.current.focus()}}))),t.jsxs(t.Fragment,{children:[t.jsx("div",{"aria-label":w,"aria-labelledby":L,role:"tablist",ref:A,"aria-orientation":"vertical",tabIndex:0,"aria-activedescendant":H?W+H:"",...o.mergeProps(J,T),...X,class:Q,children:t.jsx(x.NavigationListContext.Provider,{value:{selection:S,onSelectionChange:F,onCurrentKeyChange:V,currentKey:H,showFocusRing:B,navigationListItemPrefix:W,onRemove:N},children:e})}),z&&G&&q&&t.jsx("span",{id:G,children:t.jsx(b.HiddenAccessible,{children:q})}),z&&$&&t.jsx(v.LiveRegion,{children:$}),z&&t.jsx(m.TabBarContextMenu,{..._,contextMenuConfig:P,contextMenuContext:U})]})}));e.NavigationList=S,e.NavigationListItem=function({itemKey:e,label:n,badge:o,metadata:r,severity:i}){return t.jsx(x.BaseNavigationListItem,{itemKey:e,label:n,badge:o,metadata:r,severity:i})}}));
|
|
2
|
+
//# sourceMappingURL=NavigationListItem-82b0c382.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationListItem-cdbcc394.js","sources":["../../src/UNSAFE_NavigationList/useNavigationList.ts","../../src/UNSAFE_NavigationList/NavigationList.tsx","../../src/UNSAFE_NavigationList/NavigationListItem.tsx"],"sourcesContent":["import { ComponentChildren, ComponentProps } from 'preact';\nimport { useState, useCallback, MutableRef, useRef, useEffect, useId } from 'preact/hooks';\nimport {\n keyExtractor,\n getFirstVisibleKey,\n getKey,\n getPrevNextKeyUsingRef,\n findElementByKey\n} from '../utils/PRIVATE_collectionUtils';\nimport { mergeProps } from '../utils/UNSAFE_mergeProps';\nimport { useCollectionFocusRing } from '../hooks/PRIVATE_useCollectionFocusRing';\nimport { useCurrentKey } from '../hooks/PRIVATE_useCurrentKey';\nimport { MenuProps } from '../hooks/PRIVATE_useVisContextMenu/util';\nimport { useContextMenuGesture } from '../hooks/UNSAFE_useContextMenuGesture';\nimport { useTranslationBundle } from '../hooks/UNSAFE_useTranslationBundle';\nimport { BundleType } from '../resources/nls/bundle';\nimport { Menu } from '../UNSAFE_Menu';\nimport { getDefaultContextMenu } from '../UNSAFE_TabBar/TabBarContextMenu';\nimport { TabBarContextMenuConfig, TabBarItemContextMenuContext } from '../UNSAFE_TabBarCommon';\nimport { NavigationListContextProps } from '../UNSAFE_NavigationListCommon';\n\nconst ITEM_SELECTOR = '[role=\"tab\"]';\nexport const REMOVE_ICON_SELECTOR = '[data-oj-navigationlist-item-remove-icon]';\nconst TOUCH_OFFSET_VALUE = 40;\nconst menuPropGestureStates: Record<\n 'mouse' | 'keyboard' | 'touch',\n Omit<Required<MenuProps>, 'anchorRef' | 'isOpen'>\n> = {\n mouse: {\n initialFocus: 'menu',\n placement: 'bottom-start',\n offsetValue: 0\n },\n keyboard: {\n initialFocus: 'firstItem',\n placement: 'bottom-start',\n offsetValue: 0\n },\n touch: {\n initialFocus: 'menu',\n placement: 'end',\n offsetValue: TOUCH_OFFSET_VALUE\n }\n};\n\n/**\n * type for payload of current key change event handler\n */\ntype CurrentKeyDetail<K> = {\n value: K;\n};\n/**\n * type for payload of selection change event handler\n */\ntype SelectionDetail<K> = {\n value: K;\n reason: 'pointer' | 'keyboard';\n};\n/**\n * type for payload of remove event handler\n */\ntype RemoveDetail<K> = {\n value: K;\n};\n\nconst initialMenuProps: MenuProps = {\n isOpen: false,\n initialFocus: 'menu',\n placement: 'bottom-start',\n offsetValue: 0,\n anchorRef: { current: null }\n};\n\n/*TODO: JET-58534. Create a hook to share some logic between navlist and tabbar. Hook will be used inside this one. */\nexport function useNavigationList<K extends string | number>({\n containerRef,\n selection,\n onRemove,\n onSelectionChange,\n children,\n contextMenuConfig\n}: {\n containerRef: MutableRef<HTMLDivElement>;\n selection?: K;\n onRemove?: <K extends string | number>(detail: RemoveDetail<K>) => void;\n onSelectionChange?: <K extends string | number>(detail: SelectionDetail<K>) => void;\n children: ComponentChildren;\n contextMenuConfig?: TabBarContextMenuConfig<K>;\n}) {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const [currentKey, setCurrentKey] = useState<K | undefined>(selection);\n\n const onCurrentKeyChange = useCallback((detail: CurrentKeyDetail<K | undefined>) => {\n setCurrentKey(detail.value);\n }, []) as NavigationListContextProps<K>['onCurrentKeyChange'];\n\n const { currentKeyProps } = useCurrentKey(\n (element) =>\n onRemove\n ? (extractOnlyItemKey(element, ITEM_SELECTOR, REMOVE_ICON_SELECTOR) as K)\n : keyExtractor(element, ITEM_SELECTOR),\n false,\n getPrevNextKeyUsingRef(containerRef, currentKey, true, ITEM_SELECTOR),\n getPrevNextKeyUsingRef(containerRef, currentKey, false, ITEM_SELECTOR),\n undefined,\n undefined,\n currentKey,\n onCurrentKeyChange\n );\n\n const [showFocusRing, focusRingProps] = useCollectionFocusRing(containerRef, [\n 'Home',\n 'End',\n 'ArrowUp',\n 'ArrowDown'\n ]);\n\n const onFocus = useCallback(() => {\n if (containerRef.current && currentKey === undefined) {\n const key = getFirstVisibleKey(containerRef.current, ITEM_SELECTOR);\n if (key) {\n setCurrentKey(key as K);\n }\n }\n }, [currentKey, containerRef]);\n\n const onFocusProps = { onFocus };\n const prevNavItems = useRef<K[]>();\n\n useEffect(() => {\n if (containerRef.current) {\n const navListItemKeys = Array.from(\n containerRef.current.querySelectorAll(ITEM_SELECTOR),\n (elem) => getKey(elem as HTMLElement) as K\n );\n if (currentKey != null && navListItemKeys.indexOf(currentKey) !== -1) {\n const navListItem = findElementByKey(\n containerRef.current,\n currentKey,\n ITEM_SELECTOR\n ) as any;\n if (navListItem.scrollIntoViewIfNeeded) {\n // for some browsers, we'll need the non-standard scrollIntoViewIfNeeded\n navListItem.scrollIntoViewIfNeeded();\n } else {\n navListItem.scrollIntoView({ block: 'nearest' });\n }\n } else {\n if (currentKey && navListItemKeys.indexOf(currentKey) === -1) {\n prevNavItems.current\n ? setCurrentKey(findNextCurrentKey(currentKey, navListItemKeys, prevNavItems.current))\n : setCurrentKey(navListItemKeys[0] as K);\n }\n prevNavItems.current = navListItemKeys;\n }\n }\n }, [children, currentKey, containerRef]);\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if ((event.key === 'Home' || event.key === 'End') && containerRef.current && currentKey) {\n const navListItemKey = Array.from(\n containerRef.current.querySelectorAll(ITEM_SELECTOR),\n (elem) => getKey(elem as HTMLElement) as K\n );\n onCurrentKeyChange?.({\n value: navListItemKey[event.key === 'Home' ? 0 : navListItemKey.length - 1] as K\n });\n }\n if (currentKey && (event.key === 'Enter' || event.key === ' ')) {\n onSelectionChange?.({\n value: currentKey as K,\n reason: 'keyboard'\n });\n }\n if (currentKey && event.key === 'Delete') {\n onRemove?.({ value: currentKey as K });\n }\n },\n [currentKey, onSelectionChange, onRemove, onCurrentKeyChange, containerRef]\n );\n\n const [contextMenuContext, setContextMenuContext] = useState<TabBarItemContextMenuContext<K>>();\n\n const [menuProps, setMenuProps] = useState<MenuProps>(initialMenuProps);\n const [accStatusInfo, setAccStatusInfo] = useState<string>();\n\n const { triggerProps } = useContextMenuGesture(\n ({ gesture, anchor, target }) => {\n let anchorBasedOnGesture = anchor;\n let itemKey = currentKey as K;\n if (gesture === 'keyboard') {\n //We find the element where the position of the menu is going to be based of\n const elem = findElementByKey(\n containerRef.current as HTMLElement,\n currentKey as K,\n ITEM_SELECTOR\n );\n //We set the correct anchor\n anchorBasedOnGesture = elem ? elem : anchor;\n } else {\n //We search for the key using the target of the event\n const key = keyExtractor(target as HTMLElement, ITEM_SELECTOR);\n\n //On touch devices, the keyExtractor returns null because target of touch event is the entire tabbar. Hence we make use of currentkey since the context menu is always launched from selected item and its key is currentKey\n itemKey = key != null ? (key as K) : (currentKey as K);\n }\n let isRemovable = false;\n if (containerRef.current) {\n isRemovable = getItemAttribute(itemKey, containerRef.current, REMOVE_ICON_SELECTOR) != null;\n }\n const defaultContext = getDefaultContextMenu<K>({\n // For default menu items the existence of REMOVE_ICON_SELECTOR is the indicator that it is removable because we render the default menu in touch devices not the application.\n // Furthermore in corepack due to delegations onRemove is always defined as it is a even handler hence not a good check for isRemovable.\n isRemovable: isRemovable,\n handleRemove: onRemove,\n handleReorder: undefined,\n itemKey: itemKey,\n tabKeys: undefined,\n // As direction is only needed for reorder to switch the labels\n direction: undefined,\n itemLabels: {\n labelRemove: isRemovable ? translations.tabbar_labelRemove() : undefined\n },\n handleAccStatus: (detail) => {\n const removeItemLabel = getItemLabel(detail.removedKey!, containerRef.current!) as string;\n const removeStatus =\n isRemovable && detail.removedKey ? ` Removed ${removeItemLabel}` : '';\n\n setAccStatusInfo(removeStatus);\n }\n });\n setContextMenuContext(defaultContext);\n\n setMenuProps({\n ...menuPropGestureStates[gesture],\n anchorRef: { current: anchorBasedOnGesture },\n // This is set so that when no contextMenuConfig and when items is not removable we need not open it.\n isOpen: contextMenuConfig != null\n });\n },\n {\n isDisabled: !contextMenuConfig //If there is no a context menu renderer we disable the hook\n }\n );\n\n const handleCloseContextMenu = useCallback<Required<ComponentProps<typeof Menu>>['onClose']>(\n (detail) => {\n //Focus has to be set on the current target that was obtained\n //during context menu gesture when menu is dismissed or item is \"selected\"\n if (detail.reason === 'dismissed' || detail.reason === 'itemAction') {\n setCurrentKey(contextMenuContext?.itemKey);\n containerRef.current?.focus();\n }\n // We close the menu.The only prop that matters here is isOpen\n setMenuProps({ ...initialMenuProps });\n },\n [containerRef, contextMenuContext?.itemKey]\n );\n\n const contextMenuDescriptionId = 'contextMenu_' + useId();\n const contextMenuDescription = translations.tabbar_labelContextMenu();\n\n return {\n showFocusRing,\n currentKey,\n onCurrentKeyChange,\n onKeyDown,\n menuProps: { ...menuProps, onClose: handleCloseContextMenu },\n contextMenuContext,\n contextMenuDescription,\n contextMenuDescriptionId,\n accStatusInfo,\n containerHandlers: mergeProps(focusRingProps, currentKeyProps, onFocusProps, triggerProps)\n };\n}\n// Utility that returns the value for a attribute related to the role=\"tab\" item.\nexport const getItemAttribute = <K extends string | number>(\n itemKey: K,\n root: HTMLElement,\n attribute: string\n) => {\n const navItem = findElementByKey(root, itemKey as K, ITEM_SELECTOR) as HTMLElement;\n if (navItem) {\n const tabBarItemAttribute = navItem.querySelector(attribute);\n return tabBarItemAttribute;\n }\n return;\n};\n\n// Utility that returns the visible inner text inside the role=\"tab\" item.\nconst getItemLabel = <K extends string | number>(itemKey: K, root: HTMLElement) => {\n const tabBarItem = findElementByKey(root, itemKey as K, ITEM_SELECTOR) as HTMLElement;\n if (tabBarItem) {\n return tabBarItem.innerText;\n }\n return;\n};\n\nconst extractOnlyItemKey = (element: HTMLElement, itemSelector: string, itemEliminator: string) => {\n const navigationListItem = element.closest(itemSelector);\n const removeButton = element.closest(itemEliminator);\n return navigationListItem?.contains(removeButton) ? null : keyExtractor(element, itemSelector);\n};\n\nconst findNextCurrentKey = <K>(currentKey: K, currNavs: K[], prevNavs: K[]) => {\n const index = prevNavs.indexOf(currentKey);\n if (index > 0) {\n const nextIndex = index === prevNavs.length - 1 ? index - 1 : index + 1;\n const nextKey = prevNavs[nextIndex];\n if (currNavs.indexOf(nextKey) !== -1) {\n return nextKey;\n }\n }\n // update current key to be the first one if we can't find a suitable next key\n return currNavs[0];\n};\n","import { Ref } from 'preact';\nimport { MutableRef, useMemo, useRef } from 'preact/hooks';\nimport { mergeProps } from '../utils/UNSAFE_mergeProps';\nimport { classNames } from '../utils/UNSAFE_classNames';\nimport { isMobile } from '#utils/UNSAFE_clientUtils';\nimport { useId } from '../hooks/UNSAFE_useId';\nimport { navigationListStyles } from './themes/NavigationListStyles.css';\nimport { getItemAttribute, REMOVE_ICON_SELECTOR, useNavigationList } from './useNavigationList';\nimport { forwardRef, useImperativeHandle } from 'preact/compat';\nimport { useTestId, TestIdProps } from '../hooks/UNSAFE_useTestId';\nimport { HiddenAccessible } from '../UNSAFE_HiddenAccessible';\nimport { LiveRegion } from '../UNSAFE_LiveRegion';\nimport { NavigationListProps, NavigationListContext } from '../UNSAFE_NavigationListCommon';\nimport { TabBarContextMenu } from '../UNSAFE_TabBar/TabBarContextMenu';\nimport type { TabBarContextMenuConfig as NavigationListContextMenuConfig } from '../UNSAFE_TabBarCommon';\nexport {\n RemovableNavigationListItem,\n NavigationListLinkItem\n} from '../UNSAFE_NavigationListCommon';\n\nexport type FocusableHandle = {\n focus: () => void;\n blur: () => void;\n};\n\nexport const NavigationList = forwardRef(\n <K extends string | number>(\n {\n children,\n selection,\n onSelectionChange,\n onRemove,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelLedBy,\n testId\n }: NavigationListProps<K> & TestIdProps,\n ref?: Ref<FocusableHandle>\n ) => {\n const containerRef = useRef<HTMLDivElement>(null);\n\n const isMobileDevice = isMobile();\n const defaultContextMenuConfig = useMemo<\n NavigationListContextMenuConfig<string | number>\n >(() => {\n return {\n itemsRenderer: (context) => {\n //Only if context is available, it is a mobile device and it is removable item, we will return remove context menu item\n if (context) {\n const isRemovableItem =\n getItemAttribute(context.itemKey, containerRef.current!, REMOVE_ICON_SELECTOR) !=\n null;\n if (isRemovableItem && isMobileDevice) {\n const defaultItems = context.defaultMenuItems;\n return <>{defaultItems}</>;\n }\n }\n return null;\n }\n };\n }, []);\n\n const {\n showFocusRing,\n currentKey,\n onCurrentKeyChange,\n containerHandlers,\n onKeyDown,\n contextMenuContext,\n menuProps,\n contextMenuDescription,\n contextMenuDescriptionId,\n accStatusInfo\n } = useNavigationList({\n containerRef: containerRef as MutableRef<HTMLDivElement>,\n selection,\n onRemove,\n onSelectionChange,\n children,\n contextMenuConfig: defaultContextMenuConfig\n });\n\n const isContextMenuAvailable = defaultContextMenuConfig != null && isMobileDevice;\n\n const eventProps = { onKeyDown };\n const navigationListClass = classNames([navigationListStyles.uListStyle]);\n const navigationListItemPrefix = useId() + '_';\n const testIdProps = useTestId(testId);\n\n //Allows to call focus on rootRef without having to expose it\n useImperativeHandle(ref!, () => ({\n focus: () => {\n if (containerRef.current) {\n containerRef.current.focus();\n }\n },\n blur: () => {\n if (containerRef.current) {\n containerRef.current.focus();\n }\n }\n }));\n\n return (\n <>\n <div\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelLedBy}\n role=\"tablist\"\n ref={containerRef}\n aria-orientation={'vertical'}\n tabIndex={0}\n aria-activedescendant={currentKey ? navigationListItemPrefix + currentKey : ''}\n {...mergeProps(eventProps, containerHandlers)}\n {...testIdProps}\n class={navigationListClass}>\n <NavigationListContext.Provider\n value={{\n selection,\n onSelectionChange,\n onCurrentKeyChange,\n currentKey,\n showFocusRing,\n navigationListItemPrefix,\n onRemove\n }}>\n {children}\n </NavigationListContext.Provider>\n </div>\n {isContextMenuAvailable && contextMenuDescriptionId && contextMenuDescription && (\n <span id={contextMenuDescriptionId}>\n <HiddenAccessible>{contextMenuDescription}</HiddenAccessible>\n </span>\n )}\n {isContextMenuAvailable && accStatusInfo && <LiveRegion>{accStatusInfo}</LiveRegion>}\n {isContextMenuAvailable && (\n <TabBarContextMenu\n {...menuProps}\n contextMenuConfig={defaultContextMenuConfig}\n contextMenuContext={contextMenuContext!}\n />\n )}\n </>\n );\n }\n);\n","import {\n BaseNavigationListItem,\n BaseNavigationListItemProps\n} from '../UNSAFE_NavigationListCommon/BaseNavigationListItem';\n\nexport type NavigationListItemProps<K extends string | number> = Omit<\n BaseNavigationListItemProps<K>,\n 'removeIcon'\n>;\n\nexport function NavigationListItem<K extends string | number>({\n itemKey,\n label,\n badge,\n metadata,\n severity\n}: NavigationListItemProps<K>) {\n return (\n <BaseNavigationListItem\n itemKey={itemKey}\n label={label}\n badge={badge}\n metadata={metadata}\n severity={severity}\n />\n );\n}\n"],"names":["ITEM_SELECTOR","REMOVE_ICON_SELECTOR","menuPropGestureStates","mouse","initialFocus","placement","offsetValue","keyboard","touch","initialMenuProps","isOpen","anchorRef","current","getItemAttribute","itemKey","root","attribute","navItem","findElementByKey","querySelector","getItemLabel","tabBarItem","innerText","extractOnlyItemKey","element","itemSelector","itemEliminator","navigationListItem","closest","removeButton","contains","keyExtractor","findNextCurrentKey","currentKey","currNavs","prevNavs","index","indexOf","nextKey","length","NavigationList","forwardRef","children","selection","onSelectionChange","onRemove","ariaLabel","ariaLabelLedBy","testId","ref","containerRef","useRef","isMobileDevice","isMobile","defaultContextMenuConfig","useMemo","itemsRenderer","context","defaultItems","defaultMenuItems","_jsx","jsx","_Fragment","Fragment","showFocusRing","onCurrentKeyChange","containerHandlers","onKeyDown","contextMenuContext","menuProps","contextMenuDescription","contextMenuDescriptionId","accStatusInfo","contextMenuConfig","translations","useTranslationBundle","setCurrentKey","useState","useCallback","detail","value","currentKeyProps","useCurrentKey","getPrevNextKeyUsingRef","undefined","focusRingProps","useCollectionFocusRing","onFocusProps","onFocus","key","getFirstVisibleKey","prevNavItems","useEffect","navListItemKeys","Array","from","querySelectorAll","elem","getKey","navListItem","scrollIntoViewIfNeeded","scrollIntoView","block","event","navListItemKey","reason","setContextMenuContext","setMenuProps","setAccStatusInfo","triggerProps","useContextMenuGesture","gesture","anchor","target","anchorBasedOnGesture","isRemovable","defaultContext","getDefaultContextMenu","handleRemove","handleReorder","tabKeys","direction","itemLabels","labelRemove","tabbar_labelRemove","handleAccStatus","removeItemLabel","removedKey","removeStatus","isDisabled","handleCloseContextMenu","focus","useId","tabbar_labelContextMenu","onClose","mergeProps","useNavigationList","isContextMenuAvailable","eventProps","navigationListClass","classNames","navigationListStyles","uListStyle","navigationListItemPrefix","testIdProps","useTestId","useImperativeHandle","blur","_jsxs","role","tabIndex","class","NavigationListContext","Provider","id","HiddenAccessible","LiveRegion","TabBarContextMenu","label","badge","metadata","severity","BaseNavigationListItem"],"mappings":"8sCAqBA,MAAMA,EAAgB,eACTC,EAAuB,4CAE9BC,EAGF,CACFC,MAAO,CACLC,aAAc,OACdC,UAAW,eACXC,YAAa,GAEfC,SAAU,CACRH,aAAc,YACdC,UAAW,eACXC,YAAa,GAEfE,MAAO,CACLJ,aAAc,OACdC,UAAW,MACXC,YAlBuB,KA0CrBG,EAA8B,CAClCC,QAAQ,EACRN,aAAc,OACdC,UA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EACjBsG,KAAK,UACLpG,IAAKC,EAAY,mBACC,WAClBoG,SAAU,EACa,wBAAArH,EAAa8G,EAA2B9G,EAAa,MACxEsG,EAAAA,WAAWG,EAAYxE,MACvB8E,EACJO,MAAOZ,EACPjG,SAAAkB,EAAAC,IAAC2F,wBAAsBC,SACrB,CAAAzE,MAAO,CACLrC,YACAC,oBACAqB,qBACAhC,aACA+B,gBACA+E,2BACAlG,YAEDH,SAAAA,MAGJ+F,GAA0BlE,GAA4BD,GACrDV,MAAA,OAAA,CAAM8F,GAAInF,EACR7B,SAAAkB,EAAAC,IAAC8F,EAAgBA,iBAAA,CAAAjH,SAAE4B,MAGtBmE,GAA0BjE,GAAiBZ,EAAAC,IAAC+F,aAAU,CAAAlH,SAAE8B,IACxDiE,GACC7E,EAAAC,IAACgG,EAAiBA,kBAAA,IACZxF,EACJI,kBAAmBnB,EACnBc,mBAAoBA,MAI1B,4CCpIU,UAA8CtD,QAC5DA,EAAOgJ,MACPA,EAAKC,MACLA,EAAKC,SACLA,EAAQC,SACRA,IAEA,OACErG,EAACC,IAAAqG,EAAsBA,uBACrB,CAAApJ,QAASA,EACTgJ,MAAOA,EACPC,MAAOA,EACPC,SAAUA,EACVC,SAAUA,GAGhB"}
|
|
1
|
+
{"version":3,"file":"NavigationListItem-82b0c382.js","sources":["../../src/UNSAFE_NavigationList/useNavigationList.ts","../../src/UNSAFE_NavigationList/NavigationList.tsx","../../src/UNSAFE_NavigationList/NavigationListItem.tsx"],"sourcesContent":["import { ComponentChildren, ComponentProps } from 'preact';\nimport { useState, useCallback, MutableRef, useRef, useEffect, useId } from 'preact/hooks';\nimport {\n keyExtractor,\n getFirstVisibleKey,\n getKey,\n getPrevNextKeyUsingRef,\n findElementByKey\n} from '../utils/PRIVATE_collectionUtils';\nimport { mergeProps } from '../utils/UNSAFE_mergeProps';\nimport { useCollectionFocusRing } from '../hooks/PRIVATE_useCollectionFocusRing';\nimport { useCurrentKey } from '../hooks/PRIVATE_useCurrentKey';\nimport { MenuProps } from '../hooks/PRIVATE_useVisContextMenu/util';\nimport { useContextMenuGesture } from '../hooks/UNSAFE_useContextMenuGesture';\nimport { useTranslationBundle } from '../hooks/UNSAFE_useTranslationBundle';\nimport { BundleType } from '../resources/nls/bundle';\nimport { Menu } from '../UNSAFE_Menu';\nimport { getDefaultContextMenu } from '../UNSAFE_TabBar/TabBarContextMenu';\nimport { TabBarContextMenuConfig, TabBarItemContextMenuContext } from '../UNSAFE_TabBarCommon';\nimport { NavigationListContextProps } from '../UNSAFE_NavigationListCommon';\n\nconst ITEM_SELECTOR = '[role=\"tab\"]';\nexport const REMOVE_ICON_SELECTOR = '[data-oj-navigationlist-item-remove-icon]';\nconst TOUCH_OFFSET_VALUE = 40;\nconst menuPropGestureStates: Record<\n 'mouse' | 'keyboard' | 'touch',\n Omit<Required<MenuProps>, 'anchorRef' | 'isOpen'>\n> = {\n mouse: {\n initialFocus: 'menu',\n placement: 'bottom-start',\n offsetValue: 0\n },\n keyboard: {\n initialFocus: 'firstItem',\n placement: 'bottom-start',\n offsetValue: 0\n },\n touch: {\n initialFocus: 'menu',\n placement: 'end',\n offsetValue: TOUCH_OFFSET_VALUE\n }\n};\n\n/**\n * type for payload of current key change event handler\n */\ntype CurrentKeyDetail<K> = {\n value: K;\n};\n/**\n * type for payload of selection change event handler\n */\ntype SelectionDetail<K> = {\n value: K;\n reason: 'pointer' | 'keyboard';\n};\n/**\n * type for payload of remove event handler\n */\ntype RemoveDetail<K> = {\n value: K;\n};\n\nconst initialMenuProps: MenuProps = {\n isOpen: false,\n initialFocus: 'menu',\n placement: 'bottom-start',\n offsetValue: 0,\n anchorRef: { current: null }\n};\n\n/*TODO: JET-58534. Create a hook to share some logic between navlist and tabbar. Hook will be used inside this one. */\nexport function useNavigationList<K extends string | number>({\n containerRef,\n selection,\n onRemove,\n onSelectionChange,\n children,\n contextMenuConfig\n}: {\n containerRef: MutableRef<HTMLDivElement>;\n selection?: K;\n onRemove?: <K extends string | number>(detail: RemoveDetail<K>) => void;\n onSelectionChange?: <K extends string | number>(detail: SelectionDetail<K>) => void;\n children: ComponentChildren;\n contextMenuConfig?: TabBarContextMenuConfig<K>;\n}) {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const [currentKey, setCurrentKey] = useState<K | undefined>(selection);\n\n const onCurrentKeyChange = useCallback((detail: CurrentKeyDetail<K | undefined>) => {\n setCurrentKey(detail.value);\n }, []) as NavigationListContextProps<K>['onCurrentKeyChange'];\n\n const { currentKeyProps } = useCurrentKey(\n (element) =>\n onRemove\n ? (extractOnlyItemKey(element, ITEM_SELECTOR, REMOVE_ICON_SELECTOR) as K)\n : keyExtractor(element, ITEM_SELECTOR),\n false,\n getPrevNextKeyUsingRef(containerRef, currentKey, true, ITEM_SELECTOR),\n getPrevNextKeyUsingRef(containerRef, currentKey, false, ITEM_SELECTOR),\n undefined,\n undefined,\n currentKey,\n onCurrentKeyChange\n );\n\n const [showFocusRing, focusRingProps] = useCollectionFocusRing(containerRef, [\n 'Home',\n 'End',\n 'ArrowUp',\n 'ArrowDown'\n ]);\n\n const onFocus = useCallback(() => {\n if (containerRef.current && currentKey === undefined) {\n const key = getFirstVisibleKey(containerRef.current, ITEM_SELECTOR);\n if (key) {\n setCurrentKey(key as K);\n }\n }\n }, [currentKey, containerRef]);\n\n const onFocusProps = { onFocus };\n const prevNavItems = useRef<K[]>();\n\n useEffect(() => {\n if (containerRef.current) {\n const navListItemKeys = Array.from(\n containerRef.current.querySelectorAll(ITEM_SELECTOR),\n (elem) => getKey(elem as HTMLElement) as K\n );\n if (currentKey != null && navListItemKeys.indexOf(currentKey) !== -1) {\n const navListItem = findElementByKey(\n containerRef.current,\n currentKey,\n ITEM_SELECTOR\n ) as any;\n if (navListItem.scrollIntoViewIfNeeded) {\n // for some browsers, we'll need the non-standard scrollIntoViewIfNeeded\n navListItem.scrollIntoViewIfNeeded();\n } else {\n navListItem.scrollIntoView({ block: 'nearest' });\n }\n } else {\n if (currentKey && navListItemKeys.indexOf(currentKey) === -1) {\n prevNavItems.current\n ? setCurrentKey(findNextCurrentKey(currentKey, navListItemKeys, prevNavItems.current))\n : setCurrentKey(navListItemKeys[0] as K);\n }\n prevNavItems.current = navListItemKeys;\n }\n }\n }, [children, currentKey, containerRef]);\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if ((event.key === 'Home' || event.key === 'End') && containerRef.current && currentKey) {\n const navListItemKey = Array.from(\n containerRef.current.querySelectorAll(ITEM_SELECTOR),\n (elem) => getKey(elem as HTMLElement) as K\n );\n onCurrentKeyChange?.({\n value: navListItemKey[event.key === 'Home' ? 0 : navListItemKey.length - 1] as K\n });\n }\n if (currentKey && (event.key === 'Enter' || event.key === ' ')) {\n onSelectionChange?.({\n value: currentKey as K,\n reason: 'keyboard'\n });\n }\n if (currentKey && event.key === 'Delete') {\n onRemove?.({ value: currentKey as K });\n }\n },\n [currentKey, onSelectionChange, onRemove, onCurrentKeyChange, containerRef]\n );\n\n const [contextMenuContext, setContextMenuContext] = useState<TabBarItemContextMenuContext<K>>();\n\n const [menuProps, setMenuProps] = useState<MenuProps>(initialMenuProps);\n const [accStatusInfo, setAccStatusInfo] = useState<string>();\n\n const { triggerProps } = useContextMenuGesture(\n ({ gesture, anchor, target }) => {\n let anchorBasedOnGesture = anchor;\n let itemKey = currentKey as K;\n if (gesture === 'keyboard') {\n //We find the element where the position of the menu is going to be based of\n const elem = findElementByKey(\n containerRef.current as HTMLElement,\n currentKey as K,\n ITEM_SELECTOR\n );\n //We set the correct anchor\n anchorBasedOnGesture = elem ? elem : anchor;\n } else {\n //We search for the key using the target of the event\n const key = keyExtractor(target as HTMLElement, ITEM_SELECTOR);\n\n //On touch devices, the keyExtractor returns null because target of touch event is the entire tabbar. Hence we make use of currentkey since the context menu is always launched from selected item and its key is currentKey\n itemKey = key != null ? (key as K) : (currentKey as K);\n }\n let isRemovable = false;\n if (containerRef.current) {\n isRemovable = getItemAttribute(itemKey, containerRef.current, REMOVE_ICON_SELECTOR) != null;\n }\n const defaultContext = getDefaultContextMenu<K>({\n // For default menu items the existence of REMOVE_ICON_SELECTOR is the indicator that it is removable because we render the default menu in touch devices not the application.\n // Furthermore in corepack due to delegations onRemove is always defined as it is a even handler hence not a good check for isRemovable.\n isRemovable: isRemovable,\n handleRemove: onRemove,\n handleReorder: undefined,\n itemKey: itemKey,\n tabKeys: undefined,\n // As direction is only needed for reorder to switch the labels\n direction: undefined,\n itemLabels: {\n labelRemove: isRemovable ? translations.tabbar_labelRemove() : undefined\n },\n handleAccStatus: (detail) => {\n const removeItemLabel = getItemLabel(detail.removedKey!, containerRef.current!) as string;\n const removeStatus =\n isRemovable && detail.removedKey ? ` Removed ${removeItemLabel}` : '';\n\n setAccStatusInfo(removeStatus);\n }\n });\n setContextMenuContext(defaultContext);\n\n setMenuProps({\n ...menuPropGestureStates[gesture],\n anchorRef: { current: anchorBasedOnGesture },\n // This is set so that when no contextMenuConfig and when items is not removable we need not open it.\n isOpen: contextMenuConfig != null\n });\n },\n {\n isDisabled: !contextMenuConfig //If there is no a context menu renderer we disable the hook\n }\n );\n\n const handleCloseContextMenu = useCallback<Required<ComponentProps<typeof Menu>>['onClose']>(\n (detail) => {\n //Focus has to be set on the current target that was obtained\n //during context menu gesture when menu is dismissed or item is \"selected\"\n if (detail.reason === 'dismissed' || detail.reason === 'itemAction') {\n setCurrentKey(contextMenuContext?.itemKey);\n containerRef.current?.focus();\n }\n // We close the menu.The only prop that matters here is isOpen\n setMenuProps({ ...initialMenuProps });\n },\n [containerRef, contextMenuContext?.itemKey]\n );\n\n const contextMenuDescriptionId = 'contextMenu_' + useId();\n const contextMenuDescription = translations.tabbar_labelContextMenu();\n\n return {\n showFocusRing,\n currentKey,\n onCurrentKeyChange,\n onKeyDown,\n menuProps: { ...menuProps, onClose: handleCloseContextMenu },\n contextMenuContext,\n contextMenuDescription,\n contextMenuDescriptionId,\n accStatusInfo,\n containerHandlers: mergeProps(focusRingProps, currentKeyProps, onFocusProps, triggerProps)\n };\n}\n// Utility that returns the value for a attribute related to the role=\"tab\" item.\nexport const getItemAttribute = <K extends string | number>(\n itemKey: K,\n root: HTMLElement,\n attribute: string\n) => {\n const navItem = findElementByKey(root, itemKey as K, ITEM_SELECTOR) as HTMLElement;\n if (navItem) {\n const tabBarItemAttribute = navItem.querySelector(attribute);\n return tabBarItemAttribute;\n }\n return;\n};\n\n// Utility that returns the visible inner text inside the role=\"tab\" item.\nconst getItemLabel = <K extends string | number>(itemKey: K, root: HTMLElement) => {\n const tabBarItem = findElementByKey(root, itemKey as K, ITEM_SELECTOR) as HTMLElement;\n if (tabBarItem) {\n return tabBarItem.innerText;\n }\n return;\n};\n\nconst extractOnlyItemKey = (element: HTMLElement, itemSelector: string, itemEliminator: string) => {\n const navigationListItem = element.closest(itemSelector);\n const removeButton = element.closest(itemEliminator);\n return navigationListItem?.contains(removeButton) ? null : keyExtractor(element, itemSelector);\n};\n\nconst findNextCurrentKey = <K>(currentKey: K, currNavs: K[], prevNavs: K[]) => {\n const index = prevNavs.indexOf(currentKey);\n if (index > 0) {\n const nextIndex = index === prevNavs.length - 1 ? index - 1 : index + 1;\n const nextKey = prevNavs[nextIndex];\n if (currNavs.indexOf(nextKey) !== -1) {\n return nextKey;\n }\n }\n // update current key to be the first one if we can't find a suitable next key\n return currNavs[0];\n};\n","import { Ref } from 'preact';\nimport { MutableRef, useMemo, useRef } from 'preact/hooks';\nimport { mergeProps } from '../utils/UNSAFE_mergeProps';\nimport { classNames } from '../utils/UNSAFE_classNames';\nimport { isMobile } from '#utils/UNSAFE_clientUtils';\nimport { useId } from '../hooks/UNSAFE_useId';\nimport { navigationListStyles } from './themes/NavigationListStyles.css';\nimport { getItemAttribute, REMOVE_ICON_SELECTOR, useNavigationList } from './useNavigationList';\nimport { forwardRef, useImperativeHandle } from 'preact/compat';\nimport { useTestId, TestIdProps } from '../hooks/UNSAFE_useTestId';\nimport { HiddenAccessible } from '../UNSAFE_HiddenAccessible';\nimport { LiveRegion } from '../UNSAFE_LiveRegion';\nimport { NavigationListProps, NavigationListContext } from '../UNSAFE_NavigationListCommon';\nimport { TabBarContextMenu } from '../UNSAFE_TabBar/TabBarContextMenu';\nimport type { TabBarContextMenuConfig as NavigationListContextMenuConfig } from '../UNSAFE_TabBarCommon';\nexport {\n RemovableNavigationListItem,\n NavigationListLinkItem\n} from '../UNSAFE_NavigationListCommon';\n\nexport type FocusableHandle = {\n focus: () => void;\n blur: () => void;\n};\n\nexport const NavigationList = forwardRef(\n <K extends string | number>(\n {\n children,\n selection,\n onSelectionChange,\n onRemove,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelLedBy,\n testId\n }: NavigationListProps<K> & TestIdProps,\n ref?: Ref<FocusableHandle>\n ) => {\n const containerRef = useRef<HTMLDivElement>(null);\n\n const isMobileDevice = isMobile();\n const defaultContextMenuConfig = useMemo<\n NavigationListContextMenuConfig<string | number>\n >(() => {\n return {\n itemsRenderer: (context) => {\n //Only if context is available, it is a mobile device and it is removable item, we will return remove context menu item\n if (context) {\n const isRemovableItem =\n getItemAttribute(context.itemKey, containerRef.current!, REMOVE_ICON_SELECTOR) !=\n null;\n if (isRemovableItem && isMobileDevice) {\n const defaultItems = context.defaultMenuItems;\n return <>{defaultItems}</>;\n }\n }\n return null;\n }\n };\n }, []);\n\n const {\n showFocusRing,\n currentKey,\n onCurrentKeyChange,\n containerHandlers,\n onKeyDown,\n contextMenuContext,\n menuProps,\n contextMenuDescription,\n contextMenuDescriptionId,\n accStatusInfo\n } = useNavigationList({\n containerRef: containerRef as MutableRef<HTMLDivElement>,\n selection,\n onRemove,\n onSelectionChange,\n children,\n contextMenuConfig: defaultContextMenuConfig\n });\n\n const isContextMenuAvailable = defaultContextMenuConfig != null && isMobileDevice;\n\n const eventProps = { onKeyDown };\n const navigationListClass = classNames([navigationListStyles.uListStyle]);\n const navigationListItemPrefix = useId() + '_';\n const testIdProps = useTestId(testId);\n\n //Allows to call focus on rootRef without having to expose it\n useImperativeHandle(ref!, () => ({\n focus: () => {\n if (containerRef.current) {\n containerRef.current.focus();\n }\n },\n blur: () => {\n if (containerRef.current) {\n containerRef.current.focus();\n }\n }\n }));\n\n return (\n <>\n <div\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelLedBy}\n role=\"tablist\"\n ref={containerRef}\n aria-orientation={'vertical'}\n tabIndex={0}\n aria-activedescendant={currentKey ? navigationListItemPrefix + currentKey : ''}\n {...mergeProps(eventProps, containerHandlers)}\n {...testIdProps}\n class={navigationListClass}>\n <NavigationListContext.Provider\n value={{\n selection,\n onSelectionChange,\n onCurrentKeyChange,\n currentKey,\n showFocusRing,\n navigationListItemPrefix,\n onRemove\n }}>\n {children}\n </NavigationListContext.Provider>\n </div>\n {isContextMenuAvailable && contextMenuDescriptionId && contextMenuDescription && (\n <span id={contextMenuDescriptionId}>\n <HiddenAccessible>{contextMenuDescription}</HiddenAccessible>\n </span>\n )}\n {isContextMenuAvailable && accStatusInfo && <LiveRegion>{accStatusInfo}</LiveRegion>}\n {isContextMenuAvailable && (\n <TabBarContextMenu\n {...menuProps}\n contextMenuConfig={defaultContextMenuConfig}\n contextMenuContext={contextMenuContext!}\n />\n )}\n </>\n );\n }\n);\n","import {\n BaseNavigationListItem,\n BaseNavigationListItemProps\n} from '../UNSAFE_NavigationListCommon/BaseNavigationListItem';\n\nexport type NavigationListItemProps<K extends string | number> = Omit<\n BaseNavigationListItemProps<K>,\n 'removeIcon'\n>;\n\nexport function NavigationListItem<K extends string | number>({\n itemKey,\n label,\n badge,\n metadata,\n severity\n}: NavigationListItemProps<K>) {\n return (\n <BaseNavigationListItem\n itemKey={itemKey}\n label={label}\n badge={badge}\n metadata={metadata}\n severity={severity}\n />\n );\n}\n"],"names":["ITEM_SELECTOR","REMOVE_ICON_SELECTOR","menuPropGestureStates","mouse","initialFocus","placement","offsetValue","keyboard","touch","initialMenuProps","isOpen","anchorRef","current","getItemAttribute","itemKey","root","attribute","navItem","findElementByKey","querySelector","getItemLabel","tabBarItem","innerText","extractOnlyItemKey","element","itemSelector","itemEliminator","navigationListItem","closest","removeButton","contains","keyExtractor","findNextCurrentKey","currentKey","currNavs","prevNavs","index","indexOf","nextKey","length","NavigationList","forwardRef","children","selection","onSelectionChange","onRemove","ariaLabel","ariaLabelLedBy","testId","ref","containerRef","useRef","isMobileDevice","isMobile","defaultContextMenuConfig","useMemo","itemsRenderer","context","defaultItems","defaultMenuItems","_jsx","jsx","_Fragment","Fragment","showFocusRing","onCurrentKeyChange","containerHandlers","onKeyDown","contextMenuContext","menuProps","contextMenuDescription","contextMenuDescriptionId","accStatusInfo","contextMenuConfig","translations","useTranslationBundle","setCurrentKey","useState","useCallback","detail","value","currentKeyProps","useCurrentKey","getPrevNextKeyUsingRef","undefined","focusRingProps","useCollectionFocusRing","onFocusProps","onFocus","key","getFirstVisibleKey","prevNavItems","useEffect","navListItemKeys","Array","from","querySelectorAll","elem","getKey","navListItem","scrollIntoViewIfNeeded","scrollIntoView","block","event","navListItemKey","reason","setContextMenuContext","setMenuProps","setAccStatusInfo","triggerProps","useContextMenuGesture","gesture","anchor","target","anchorBasedOnGesture","isRemovable","defaultContext","getDefaultContextMenu","handleRemove","handleReorder","tabKeys","direction","itemLabels","labelRemove","tabbar_labelRemove","handleAccStatus","removeItemLabel","removedKey","removeStatus","isDisabled","handleCloseContextMenu","focus","useId","tabbar_labelContextMenu","onClose","mergeProps","useNavigationList","isContextMenuAvailable","eventProps","navigationListClass","classNames","navigationListStyles","uListStyle","navigationListItemPrefix","testIdProps","useTestId","useImperativeHandle","blur","_jsxs","role","tabIndex","class","NavigationListContext","Provider","id","HiddenAccessible","LiveRegion","TabBarContextMenu","label","badge","metadata","severity","BaseNavigationListItem"],"mappings":"4kBAqBA,MAAMA,EAAgB,eACTC,EAAuB,4CAE9BC,EAGF,CACFC,MAAO,CACLC,aAAc,OACdC,UAAW,eACXC,YAAa,GAEfC,SAAU,CACRH,aAAc,YACdC,UAAW,eACXC,YAAa,GAEfE,MAAO,CACLJ,aAAc,OACdC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,EAAAA,SAAA,CAAApB,SAAA,CAAAkB,MAAA,MAAA,CAAA,aACcd,EAAS,kBACJC,EACjBsG,KAAK,UACLpG,IAAKC,EAAY,mBACC,WAClBoG,SAAU,EACa,wBAAArH,EAAa8G,EAA2B9G,EAAa,MACxEsG,EAAAA,WAAWG,EAAYxE,MACvB8E,EACJO,MAAOZ,EACPjG,SAAAkB,EAAAC,IAAC2F,wBAAsBC,SACrB,CAAAzE,MAAO,CACLrC,YACAC,oBACAqB,qBACAhC,aACA+B,gBACA+E,2BACAlG,YAEDH,SAAAA,MAGJ+F,GAA0BlE,GAA4BD,GACrDV,MAAA,OAAA,CAAM8F,GAAInF,EACR7B,SAAAkB,EAAAC,IAAC8F,EAAgBA,iBAAA,CAAAjH,SAAE4B,MAGtBmE,GAA0BjE,GAAiBZ,EAAAC,IAAC+F,aAAU,CAAAlH,SAAE8B,IACxDiE,GACC7E,EAAAC,IAACgG,EAAiBA,kBAAA,IACZxF,EACJI,kBAAmBnB,EACnBc,mBAAoBA,MAI1B,4CCpIU,UAA8CtD,QAC5DA,EAAOgJ,MACPA,EAAKC,MACLA,EAAKC,SACLA,EAAQC,SACRA,IAEA,OACErG,EAACC,IAAAqG,EAAsBA,uBACrB,CAAApJ,QAASA,EACTgJ,MAAOA,EACPC,MAAOA,EACPC,SAAUA,EACVC,SAAUA,GAGhB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
define(['exports', 'preact/jsx-runtime', 'preact', 'preact/hooks', './classNames-08d99695', './TabBar-3fe1e19e', './UNSAFE_OverflowTabBar/themes/OverflowTabBarStyles.css', './useDetectHorizontalOverflow-f81f6202', './TabBarLinkItem-67ae56f5', './RemovableTabBarItem-8c254100', './TabBarItem-5c91efc9', './OverflowTabBarItem-
|
|
2
|
-
//# sourceMappingURL=OverflowTabBar-
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact', 'preact/hooks', './classNames-08d99695', './TabBar-3fe1e19e', './UNSAFE_OverflowTabBar/themes/OverflowTabBarStyles.css', './useDetectHorizontalOverflow-f81f6202', './TabBarLinkItem-67ae56f5', './RemovableTabBarItem-8c254100', './TabBarItem-5c91efc9', './OverflowTabBarItem-e01e53ae'], (function(e,a,t,l,r,s,i,o,n,c,m,d){"use strict";e.OverflowTabBar=function({items:e,layout:b="stretch",display:u="standard",size:f="md",edge:y="top",selection:v,truncation:I,onSelect:g,onRemove:B,"aria-label":K,"aria-labelledby":T,contextMenuConfig:h,testId:x}){const p="stacked"===u?{display:u}:{display:u,size:f},w=l.useRef(null),R=t.createRef(),[O,j]=l.useState(!1),M=l.useRef(!1),k=l.useCallback((e=>{"more"===e.value?M.current?j(!1):j(!0):g?.(e),M.current=!1}),[g]),S=l.useMemo((()=>e.map((e=>e.itemKey))),[e]),{visibleItemKeys:z,overflowItemKeys:C,maxWidths:W}=o.useDetectHorizontalOverflow({rootRef:R,keysArray:S,isTruncationDisabled:!(I&&"progressive"===I)}),A=r.classNames([i.styles.overflowTabBarBase]);return a.jsx("div",{ref:w,class:A,children:a.jsxs(s.TabBar,{ref:R,selection:v,onSelect:k,...p,layout:b,edge:y,onRemove:B,"aria-label":K,"aria-labelledby":T,testId:x,contextMenuConfig:h,children:[null!=z&&z.length>0&&e.filter((e=>z?.includes(e.itemKey))).map((e=>null!=e.href?a.jsx(n.TabBarLinkItem,{href:e.href,itemKey:e.itemKey,label:e.label,icon:e.icon,badge:e.badge,metadata:e.metadata,severity:e.severity,"aria-controls":e.tabPanelId,labelMaxWidth:W?.get(e.itemKey)}):e.isRemovable?a.jsx(c.RemovableTabBarItem,{itemKey:e.itemKey,label:e.label,icon:e.icon,badge:e.badge,metadata:e.metadata,severity:e.severity,"aria-controls":e.tabPanelId,labelMaxWidth:W?.get(e.itemKey)}):a.jsx(m.TabBarItem,{itemKey:e.itemKey,label:e.label,icon:e.icon,badge:e.badge,metadata:e.metadata,severity:e.severity,"aria-controls":e.tabPanelId,labelMaxWidth:W?.get(e.itemKey)}))),null!=C&&C.length>0&&a.jsx(d.OverflowTabBarItem,{isOpen:O,onClose:e=>{R.current&&["itemAction","dismissed"].includes(e.reason)&&R?.current?.focus(),"outsideMousedown"===e.reason&&(M.current=!0),j(!1)},overflowItemKey:"more",overflowItems:e.filter((e=>C?.includes(e.itemKey)))})]})})}}));
|
|
2
|
+
//# sourceMappingURL=OverflowTabBar-e2b5f36e.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverflowTabBar-
|
|
1
|
+
{"version":3,"file":"OverflowTabBar-e2b5f36e.js","sources":["../../src/UNSAFE_OverflowTabBar/OverflowTabBar.tsx"],"sourcesContent":["import { ComponentProps, createRef } from 'preact';\nimport { useCallback, useMemo, useRef, useState } from 'preact/hooks';\nimport { classNames } from '../utils/UNSAFE_classNames';\nimport { TestIdProps } from '../hooks/UNSAFE_useTestId';\nimport {\n OverflowTabBarItem,\n RemovableTabBarItem,\n TabBar,\n TabBarItem,\n TabBarLinkItem\n} from '../UNSAFE_TabBar';\nimport { CloseDetail, Item } from '../UNSAFE_TabBarCommon';\nimport { styles } from './themes/OverflowTabBarStyles.css';\nimport { useDetectHorizontalOverflow } from '../hooks/PRIVATE_useDetectHorizontalOverflow';\n\ntype OverflowTabBarProps<K extends string | number> = {\n /**\n * An array of data to render individual tabs\n */\n items: Item<K>[];\n /**\n * The truncation configuration for tab labels.\n * 'progressive' will restrict the width of each tab label to allow all tabs to fit if enough space is not available to display all of the tabs.\n * Labels that are truncated are displayed with ellipses. However the width of each tab label will not be truncated below a specific threshold.\n * 'none' tabs always take up the space needed by the labels even if enough space is not available to display all of the tabs.\n */\n truncation?: 'none' | 'progressive';\n} & Omit<ComponentProps<typeof TabBar>, 'children' | 'aria-describedby' | 'ref'>;\n\n/**\n * OverflowTabBar handles the rendering of overflowing tab items.\n */\nexport function OverflowTabBar<K extends string | number>({\n items,\n layout = 'stretch',\n display = 'standard',\n size = 'md',\n edge = 'top',\n selection,\n truncation,\n onSelect,\n onRemove,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n contextMenuConfig,\n testId\n}: OverflowTabBarProps<K> & TestIdProps) {\n const displayStackProps = {\n display: display\n };\n const displayNonStackProps = {\n display: display,\n size: size\n };\n\n const displayProps = display === 'stacked' ? displayStackProps : displayNonStackProps;\n const rootRef = useRef<HTMLDivElement>(null);\n const tabBarRef = createRef<HTMLDivElement>();\n\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n\n const isOutsideMouseDown = useRef<boolean>(false);\n\n const handleClose = (e: CloseDetail) => {\n if (tabBarRef.current && ['itemAction', 'dismissed'].includes(e.reason)) {\n tabBarRef?.current?.focus();\n }\n if (e.reason === 'outsideMousedown') {\n isOutsideMouseDown.current = true;\n }\n setIsDropDownOpen(false);\n };\n\n const handleSelect = useCallback<Required<ComponentProps<typeof TabBar>>['onSelect']>(\n (e: { value: string | number }) => {\n if (e.value === 'more') {\n //If overflow item is clicked after dropdown is open, the reason is outsideMouseDown and it needs to be closed\n if (isOutsideMouseDown.current) {\n setIsDropDownOpen(false);\n } else {\n setIsDropDownOpen(true);\n }\n } else {\n onSelect?.(e);\n }\n isOutsideMouseDown.current = false;\n },\n [onSelect]\n );\n\n const overflowItemKey = 'more' as K;\n\n const keysArray = useMemo(() => items.map((item) => item.itemKey) as K[], [items]);\n\n const { visibleItemKeys, overflowItemKeys, maxWidths } = useDetectHorizontalOverflow({\n rootRef: tabBarRef,\n keysArray,\n isTruncationDisabled: !(truncation && truncation === 'progressive')\n });\n\n const overflowTabBarClass = classNames([styles.overflowTabBarBase]);\n\n return (\n <div ref={rootRef} class={overflowTabBarClass}>\n <TabBar\n ref={tabBarRef}\n selection={selection}\n onSelect={handleSelect}\n {...displayProps}\n layout={layout}\n edge={edge}\n onRemove={onRemove}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n testId={testId}\n contextMenuConfig={contextMenuConfig}>\n {visibleItemKeys != null &&\n visibleItemKeys.length > 0 &&\n items\n .filter((item) => visibleItemKeys?.includes(item.itemKey))\n .map((item: Item<K>) =>\n item.href != null ? (\n <TabBarLinkItem\n href={item.href}\n itemKey={item.itemKey}\n label={item.label}\n icon={item.icon}\n badge={item.badge}\n metadata={item.metadata}\n severity={item.severity}\n aria-controls={item.tabPanelId}\n labelMaxWidth={maxWidths?.get(item.itemKey)}\n />\n ) : item.isRemovable ? (\n <RemovableTabBarItem\n itemKey={item.itemKey}\n label={item.label}\n icon={item.icon}\n badge={item.badge}\n metadata={item.metadata}\n severity={item.severity}\n aria-controls={item.tabPanelId}\n labelMaxWidth={maxWidths?.get(item.itemKey)}\n />\n ) : (\n <TabBarItem\n itemKey={item.itemKey}\n label={item.label}\n icon={item.icon}\n badge={item.badge}\n metadata={item.metadata}\n severity={item.severity}\n aria-controls={item.tabPanelId}\n labelMaxWidth={maxWidths?.get(item.itemKey)}\n />\n )\n )}\n {overflowItemKeys != null && overflowItemKeys.length > 0 && (\n <OverflowTabBarItem\n isOpen={isDropDownOpen}\n onClose={handleClose}\n overflowItemKey={overflowItemKey}\n overflowItems={items.filter((item) => overflowItemKeys?.includes(item.itemKey))}\n />\n )}\n </TabBar>\n </div>\n );\n}\n"],"names":["items","layout","display","size","edge","selection","truncation","onSelect","onRemove","ariaLabel","ariaLabelledby","contextMenuConfig","testId","displayProps","rootRef","useRef","tabBarRef","createRef","isDropDownOpen","setIsDropDownOpen","useState","isOutsideMouseDown","handleSelect","useCallback","e","value","current","keysArray","useMemo","map","item","itemKey","visibleItemKeys","overflowItemKeys","maxWidths","useDetectHorizontalOverflow","isTruncationDisabled","overflowTabBarClass","classNames","styles","overflowTabBarBase","_jsx","ref","class","children","_jsxs","jsxs","TabBar","length","filter","includes","href","TabBarLinkItem","label","icon","badge","metadata","severity","tabPanelId","labelMaxWidth","get","isRemovable","jsx","RemovableTabBarItem","TabBarItem","OverflowTabBarItem","isOpen","onClose","reason","focus","overflowItemKey","overflowItems"],"mappings":"+YAgC0DA,MACxDA,EAAKC,OACLA,EAAS,UAASC,QAClB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