@oracle/oraclejet-preact 20.0.0 → 20.0.1
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/BaseCardView-16fda4c3.js +2 -0
- package/amd/{BaseCardView-b8119561.js.map → BaseCardView-16fda4c3.js.map} +1 -1
- package/amd/BaseTabBarItem-d7c2922b.js +2 -0
- package/amd/BaseTabBarItem-d7c2922b.js.map +1 -0
- package/amd/CardFlexView-d3eb7373.js +2 -0
- package/amd/{CardFlexView-aa2f3de8.js.map → CardFlexView-d3eb7373.js.map} +1 -1
- package/amd/CardGridView-842f70cd.js +2 -0
- package/amd/{CardGridView-85f90c75.js.map → CardGridView-842f70cd.js.map} +1 -1
- package/amd/{CollapsibleNavigationList-f0072c90.js → CollapsibleNavigationList-fdeccbfb.js} +2 -2
- package/amd/{CollapsibleNavigationList-f0072c90.js.map → CollapsibleNavigationList-fdeccbfb.js.map} +1 -1
- package/amd/ColorPicker-e3167e4c.js +2 -0
- package/amd/{ColorPicker-141fa49d.js.map → ColorPicker-e3167e4c.js.map} +1 -1
- package/amd/{DatePicker-88c5bbcd.js → DatePicker-bf521b1c.js} +2 -2
- package/amd/{DatePicker-88c5bbcd.js.map → DatePicker-bf521b1c.js.map} +1 -1
- package/amd/{FlatTreeView-9ecf2be6.js → FlatTreeView-15edd439.js} +2 -2
- package/amd/{FlatTreeView-9ecf2be6.js.map → FlatTreeView-15edd439.js.map} +1 -1
- package/amd/{InputColor-58e3fce3.js → InputColor-51d7e40c.js} +2 -2
- package/amd/{InputColor-58e3fce3.js.map → InputColor-51d7e40c.js.map} +1 -1
- package/amd/{InputDatePicker-48633486.js → InputDatePicker-030e345a.js} +2 -2
- package/amd/{InputDatePicker-48633486.js.map → InputDatePicker-030e345a.js.map} +1 -1
- package/amd/ListView-02a92d18.js +2 -0
- package/amd/{ListView-2678b2af.js.map → ListView-02a92d18.js.map} +1 -1
- package/amd/{MonthView-ea883c49.js → MonthView-96fafba4.js} +2 -2
- package/amd/{MonthView-ea883c49.js.map → MonthView-96fafba4.js.map} +1 -1
- package/amd/{OverflowTabBar-b142f8d4.js → OverflowTabBar-5ff68da7.js} +2 -2
- package/amd/{OverflowTabBar-b142f8d4.js.map → OverflowTabBar-5ff68da7.js.map} +1 -1
- package/amd/{OverflowTabBarItem-49a82149.js → OverflowTabBarItem-926b0c8a.js} +2 -2
- package/amd/{OverflowTabBarItem-49a82149.js.map → OverflowTabBarItem-926b0c8a.js.map} +1 -1
- package/amd/PRIVATE_BaseCardView.js +1 -1
- package/amd/PRIVATE_CollapsibleNavigationList.js +1 -1
- package/amd/PRIVATE_MonthView.js +1 -1
- package/amd/PRIVATE_MonthYearGridView.js +1 -1
- package/amd/PRIVATE_StyledDatePickerButton.js +1 -1
- package/amd/PRIVATE_TableList.js +1 -1
- package/amd/{RemovableTabBarItem-e1bee7fa.js → RemovableTabBarItem-9ae273fe.js} +2 -2
- package/amd/{RemovableTabBarItem-e1bee7fa.js.map → RemovableTabBarItem-9ae273fe.js.map} +1 -1
- package/amd/ReorderableTabBar-0c69bfd4.js +2 -0
- package/amd/{ReorderableTabBar-46683bcb.js.map → ReorderableTabBar-0c69bfd4.js.map} +1 -1
- package/amd/StyledDatePickerButton-bceb62e1.js +2 -0
- package/amd/StyledDatePickerButton-bceb62e1.js.map +1 -0
- package/amd/StyledDatePickerButtonStyles.styles.css +17 -0
- package/amd/TabBar-de723fbc.js +2 -0
- package/amd/{TabBar-fcebb560.js.map → TabBar-de723fbc.js.map} +1 -1
- package/amd/TabBarItem-a39c5de3.js +2 -0
- package/amd/{TabBarItem-224bc6b3.js.map → TabBarItem-a39c5de3.js.map} +1 -1
- package/amd/TabBarLinkItem-944b1e8d.js +2 -0
- package/amd/{TabBarLinkItem-57587dbd.js.map → TabBarLinkItem-944b1e8d.js.map} +1 -1
- package/amd/TabBarMixed-cfd346bf.js +2 -0
- package/amd/{TabBarMixed-8cc4b4ed.js.map → TabBarMixed-cfd346bf.js.map} +1 -1
- package/amd/TextArea-345f89d4.js +2 -0
- package/{es/TextArea-93ce78a7.js.map → amd/TextArea-345f89d4.js.map} +1 -1
- package/amd/TextAreaAutosize-01dfd98e.js +2 -0
- package/amd/{TextAreaAutosize-3a13ebb2.js.map → TextAreaAutosize-01dfd98e.js.map} +1 -1
- package/amd/Theme-redwood/theme.css +211 -211
- package/amd/Theme-stable/theme.css +281 -281
- package/amd/UNSAFE_CardFlexView.js +1 -1
- package/amd/UNSAFE_CardGridView.js +1 -1
- package/amd/UNSAFE_ColorPicker.js +1 -1
- package/amd/UNSAFE_DatePicker.js +1 -1
- package/amd/UNSAFE_FlatTreeView.js +1 -1
- package/amd/UNSAFE_InputColor.js +1 -1
- package/amd/UNSAFE_InputDatePicker.js +1 -1
- package/amd/UNSAFE_ListView.js +1 -1
- package/amd/UNSAFE_OverflowTabBar.js +1 -1
- package/amd/UNSAFE_ReorderableTabBar.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/amd/UNSAFE_TextArea.js +1 -1
- package/amd/UNSAFE_TextAreaAutosize.js +1 -1
- package/amd/{YearsGridView-4aa7bc66.js → YearsGridView-561c3074.js} +2 -2
- package/amd/{YearsGridView-4aa7bc66.js.map → YearsGridView-561c3074.js.map} +1 -1
- package/cjs/CheckboxSet-6865f4fd.js +55 -0
- package/cjs/CheckboxSet-6865f4fd.js.map +1 -0
- package/cjs/{ColorPalette-9f041744.js → ColorPalette-b14114d8.js} +2 -2
- package/cjs/{ColorPalette-9f041744.js.map → ColorPalette-b14114d8.js.map} +1 -1
- package/cjs/{ColorPicker-9af6707c.js → ColorPicker-2c99c0fb.js} +2 -2
- package/cjs/{ColorPicker-9af6707c.js.map → ColorPicker-2c99c0fb.js.map} +1 -1
- package/cjs/{DatePicker-48c602ff.js → DatePicker-b60f8a7e.js} +3 -3
- package/cjs/{DatePicker-48c602ff.js.map → DatePicker-b60f8a7e.js.map} +1 -1
- package/cjs/{MonthView-59452edc.js → MonthView-a2661a58.js} +2 -2
- package/cjs/{MonthView-59452edc.js.map → MonthView-a2661a58.js.map} +1 -1
- package/cjs/{NavigationListItem-3b9eb0fb.js → NavigationListItem-cdfd0740.js} +19 -1
- package/cjs/{NavigationListItem-3b9eb0fb.js.map → NavigationListItem-cdfd0740.js.map} +1 -1
- package/cjs/{OverflowTabBarItem-2c967a89.js → OverflowTabBarItem-4bbd5830.js} +7 -4
- package/cjs/OverflowTabBarItem-4bbd5830.js.map +1 -0
- package/cjs/PRIVATE_MonthView.js +2 -3
- package/cjs/PRIVATE_MonthView.js.map +1 -1
- package/cjs/PRIVATE_MonthYearGridView.js +2 -3
- package/cjs/PRIVATE_MonthYearGridView.js.map +1 -1
- package/cjs/PRIVATE_StyledDatePickerButton.js +1 -2
- package/cjs/PRIVATE_StyledDatePickerButton.js.map +1 -1
- package/cjs/SegmentStyles.styles.css +12 -9
- package/cjs/SegmentStyles.styles2.css +9 -12
- package/cjs/{StyledDatePickerButton-cf4e4dc0.js → StyledDatePickerButton-becd2a7d.js} +2 -8
- package/cjs/StyledDatePickerButton-becd2a7d.js.map +1 -0
- package/cjs/StyledDatePickerButtonStyles.styles.css +17 -0
- package/cjs/{TabBarLinkItem-42785eb3.js → TabBarLinkItem-891a5f10.js} +2 -2
- package/cjs/{TabBarLinkItem-42785eb3.js.map → TabBarLinkItem-891a5f10.js.map} +1 -1
- package/cjs/Theme-redwood/theme.css +129 -129
- package/cjs/Theme-stable/theme.css +161 -161
- package/cjs/UNSAFE_CheckboxItem.js +117 -56
- package/cjs/UNSAFE_CheckboxItem.js.map +1 -1
- package/cjs/UNSAFE_CheckboxSet.js +21 -50
- package/cjs/UNSAFE_CheckboxSet.js.map +1 -1
- package/cjs/UNSAFE_ColorPalette.js +80 -80
- package/cjs/UNSAFE_ColorPicker.js +76 -76
- package/cjs/UNSAFE_DatePicker.js +4 -4
- package/cjs/UNSAFE_InputColor.js +12 -12
- package/cjs/UNSAFE_InputDatePicker.js +96 -96
- package/cjs/UNSAFE_NavigationList.js +12 -12
- package/cjs/UNSAFE_OverflowTabBar.js +3 -3
- package/cjs/UNSAFE_RichCheckboxSet.js +46 -42
- package/cjs/UNSAFE_RichCheckboxSet.js.map +1 -1
- package/cjs/UNSAFE_RichSelectionItem.js +154 -91
- package/cjs/UNSAFE_RichSelectionItem.js.map +1 -1
- package/cjs/UNSAFE_TabBar.js +3 -3
- package/cjs/UNSAFE_TabBarCommon.js +5 -5
- package/cjs/UNSAFE_TabBarMixed.js +4 -4
- package/cjs/{YearsGridView-b56f7f42.js → YearsGridView-d0d4e8e1.js} +2 -2
- package/cjs/{YearsGridView-b56f7f42.js.map → YearsGridView-d0d4e8e1.js.map} +1 -1
- package/es/{BaseButton-41068c85.js → BaseButton-243d200f.js} +2 -2
- package/es/{BaseButton-41068c85.js.map → BaseButton-243d200f.js.map} +1 -1
- package/es/{BaseCardView-85b9a71e.js → BaseCardView-b3d8bae0.js} +10 -7
- package/es/{BaseCardView-85b9a71e.js.map → BaseCardView-b3d8bae0.js.map} +1 -1
- package/es/BaseDiagram-b5b22e53.js +7 -7
- package/es/BaseRichSelection-223d9830.js +9 -9
- package/es/BaseSelector-7cbc48bc.js +1 -1
- package/es/BaseSwatchView-2e1e6bd2.js +2 -2
- package/es/{Button-956f51c7.js → Button-a76ecfa8.js} +2 -2
- package/es/{Button-956f51c7.js.map → Button-a76ecfa8.js.map} +1 -1
- package/es/ButtonSet-b7464e9a.js +2 -2
- package/es/ButtonSetButton-8685c752.js +1 -1
- package/es/ButtonSetIconButton-c8ed85f9.js +4 -4
- package/es/{Center-71a03e65.js → Center-3860fe60.js} +2 -2
- package/es/{Center-71a03e65.js.map → Center-3860fe60.js.map} +1 -1
- package/es/Chart-b866a74c.js +10 -10
- package/es/CheckboxControl-c008372a.js +6 -6
- package/es/CheckboxRadioField-a387b3cb.js +6 -6
- package/es/CheckboxRadioLabelValueLayout-e3845f16.js +1 -1
- package/es/CheckboxSet-3aab5935.js +1 -1
- package/es/Chip-4efea02e.js +1 -1
- package/es/ClearIcon-f85ea340.js +1 -1
- package/es/CollapseIcon-84f6ba8e.js +1 -1
- package/es/Collapsible-2608ce3b.js +2 -2
- package/es/ColorPalette-950c6fc6.js +2 -2
- package/es/{ColorPicker-ae648c4c.js → ColorPicker-8c297849.js} +3 -3
- package/es/{ColorPicker-ae648c4c.js.map → ColorPicker-8c297849.js.map} +1 -1
- package/es/ColorSwatch-8339ee2f.js +4 -4
- package/es/{CompactLabelAssistance-e2fcfcab.js → CompactLabelAssistance-50ff3f7e.js} +6 -6
- package/es/{CompactLabelAssistance-e2fcfcab.js.map → CompactLabelAssistance-50ff3f7e.js.map} +1 -1
- package/es/CompactUserAssistance-6aa8894b.js +5 -5
- package/es/ComponentMessageContainer-d16c8b1f.js +4 -4
- package/es/{DatePicker-2ab05fbe.js → DatePicker-fa7d39a7.js} +8 -8
- package/es/{DatePicker-2ab05fbe.js.map → DatePicker-fa7d39a7.js.map} +1 -1
- package/es/DatePickerHeader-f8cf86bb.js +3 -3
- package/es/DiagramStyles.styles2.css +10 -16
- package/es/DiagramStyles.styles3.css +16 -10
- package/es/{Dialog-83368f52.js → Dialog-d1de5b06.js} +7 -7
- package/es/{Dialog-83368f52.js.map → Dialog-d1de5b06.js.map} +1 -1
- package/es/DirectionalCollapseArrowIcon-132761da.js +1 -1
- package/es/DirectionalExpandArrowIcon-5bc45cad.js +1 -1
- package/es/{Dropdown-019aba37.js → Dropdown-9d9813a9.js} +6 -6
- package/es/{Dropdown-019aba37.js.map → Dropdown-9d9813a9.js.map} +1 -1
- package/es/{EmbeddedIconButton-46434710.js → EmbeddedIconButton-9f0e56b7.js} +2 -2
- package/es/{EmbeddedIconButton-46434710.js.map → EmbeddedIconButton-9f0e56b7.js.map} +1 -1
- package/es/{EnvironmentProvider-6a0a8212.js → EnvironmentProvider-6cf8ed37.js} +3 -3
- package/es/{EnvironmentProvider-6a0a8212.js.map → EnvironmentProvider-6cf8ed37.js.map} +1 -1
- package/es/Expander-1347e769.js +1 -1
- package/es/{Flex-03129963.js → Flex-fc483125.js} +2 -2
- package/es/{Flex-03129963.js.map → Flex-fc483125.js.map} +1 -1
- package/es/{Floating-4a82db94.js → Floating-be4c0cb6.js} +4 -4
- package/es/{Floating-4a82db94.js.map → Floating-be4c0cb6.js.map} +1 -1
- package/es/{Grid-9e4b4f19.js → Grid-6f92d323.js} +2 -2
- package/es/{Grid-9e4b4f19.js.map → Grid-6f92d323.js.map} +1 -1
- package/es/GroupLoadingIndicator-19c6545a.js +1 -1
- package/es/{HighlightText-0205faef.js → HighlightText-dd484ffd.js} +2 -2
- package/es/{HighlightText-0205faef.js.map → HighlightText-dd484ffd.js.map} +1 -1
- package/es/Icon-4983d06e.js +3 -3
- package/es/IconButton-7f91481c.js +4 -4
- package/es/IconSwitchButton-05f1f602.js +4 -4
- package/es/IconToggleButton-808818f5.js +4 -4
- package/es/{IconUserAssistance-61978211.js → IconUserAssistance-6abc7837.js} +3 -3
- package/es/{IconUserAssistance-61978211.js.map → IconUserAssistance-6abc7837.js.map} +1 -1
- package/es/InlineHelp-9eaac91c.js +1 -1
- package/es/InlineUserAssistance-890293dd.js +5 -5
- package/es/InputDateMask-ec27aee7.js +7 -7
- package/es/Label-5d1ae8d7.js +8 -8
- package/es/LabelValueLayout-c6b9945a.js +1 -1
- package/es/{Layer-535577b5.js → Layer-6c27170e.js} +3 -3
- package/es/{Layer-535577b5.js.map → Layer-6c27170e.js.map} +1 -1
- package/es/{LayerHost-7931b424.js → LayerHost-3cf255a6.js} +2 -2
- package/es/{LayerHost-7931b424.js.map → LayerHost-3cf255a6.js.map} +1 -1
- package/es/{LayerManager-52a26c55.js → LayerManager-e30fbfd6.js} +2 -2
- package/es/{LayerManager-52a26c55.js.map → LayerManager-e30fbfd6.js.map} +1 -1
- package/es/Link-8503aab2.js +1 -1
- package/es/List-4636ba9b.js +5 -5
- package/es/{LiveRegion-cebac18d.js → LiveRegion-2e8830ae.js} +2 -2
- package/es/{LiveRegion-cebac18d.js.map → LiveRegion-2e8830ae.js.map} +1 -1
- package/es/{MaxLengthLiveRegion-8099fde5.js → MaxLengthLiveRegion-8f552ae2.js} +3 -3
- package/es/{MaxLengthLiveRegion-8099fde5.js.map → MaxLengthLiveRegion-8f552ae2.js.map} +1 -1
- package/es/Message-510c2db8.js +2 -2
- package/es/{MessageLayer-2a7fdec7.js → MessageLayer-1dbdc0b6.js} +6 -6
- package/es/{MessageLayer-2a7fdec7.js.map → MessageLayer-1dbdc0b6.js.map} +1 -1
- package/es/MessagesManager-47000438.js +3 -3
- package/es/Modal-c0f730b8.js +3 -3
- package/es/{MonthView-097171eb.js → MonthView-4e05e712.js} +5 -5
- package/es/{MonthView-097171eb.js.map → MonthView-4e05e712.js.map} +1 -1
- package/es/{NavigationListItem-dbd29973.js → NavigationListItem-340ab770.js} +23 -5
- package/es/{NavigationListItem-dbd29973.js.map → NavigationListItem-340ab770.js.map} +1 -1
- package/es/NavigationListLinkItem-e28fd846.js +5 -5
- package/es/NumberInputText-60be5757.js +6 -6
- package/es/{OverflowTabBarItem-6966fbc7.js → OverflowTabBarItem-aa0ce915.js} +12 -9
- package/es/OverflowTabBarItem-aa0ce915.js.map +1 -0
- package/es/PRIVATE_BaseCardView.js +23 -23
- package/es/PRIVATE_BaseDiagram.js +29 -29
- package/es/PRIVATE_BaseSelector.js +17 -17
- package/es/PRIVATE_BaseSwatchView.js +18 -18
- package/es/PRIVATE_Chart.js +34 -34
- package/es/PRIVATE_CheckboxControl.js +25 -25
- package/es/PRIVATE_CheckboxRadioField.js +27 -27
- package/es/PRIVATE_ClearIcon.js +18 -18
- package/es/PRIVATE_CollapsibleNavigationList.js +43 -43
- package/es/PRIVATE_DatePickerHeader.js +20 -20
- package/es/PRIVATE_DatePickerLayout.js +4 -4
- package/es/PRIVATE_EmbeddedIconButton.js +6 -6
- package/es/PRIVATE_Expander.js +19 -19
- package/es/PRIVATE_FormControls.js +21 -21
- package/es/PRIVATE_IconSwitchButton.js +17 -17
- package/es/PRIVATE_Icons/CheckboxCrossed.js +16 -16
- package/es/PRIVATE_Icons/CheckboxMixed.js +16 -16
- package/es/PRIVATE_Icons/CheckboxOff.js +16 -16
- package/es/PRIVATE_Icons/CheckboxOn.js +16 -16
- package/es/PRIVATE_Icons/DragV.js +16 -16
- package/es/PRIVATE_Icons/None.js +16 -16
- package/es/PRIVATE_List.js +21 -21
- package/es/PRIVATE_Message.js +20 -20
- package/es/PRIVATE_MessageLayer.js +12 -12
- package/es/PRIVATE_MonthView.js +8 -9
- package/es/PRIVATE_MonthView.js.map +1 -1
- package/es/PRIVATE_MonthYearGridView.js +8 -9
- package/es/PRIVATE_MonthYearGridView.js.map +1 -1
- package/es/PRIVATE_PlotArea.js +5 -5
- package/es/PRIVATE_RevealToggleIcon.js +18 -18
- package/es/PRIVATE_RichSelectionCommon.js +28 -28
- package/es/PRIVATE_SelectCommon.js +31 -31
- package/es/PRIVATE_StyledCard.js +3 -3
- package/es/PRIVATE_StyledCheckbox.js +16 -16
- package/es/PRIVATE_StyledDatePickerButton.js +1 -2
- package/es/PRIVATE_StyledDatePickerButton.js.map +1 -1
- package/es/PRIVATE_StyledSwitch.js +4 -4
- package/es/PRIVATE_SwatchFlexView.js +18 -18
- package/es/PRIVATE_Table.js +35 -35
- package/es/PRIVATE_TableDisplay.js +19 -19
- package/es/PRIVATE_TableList.js +30 -30
- package/es/PRIVATE_ThemedIcons/CalendarIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/ChartMarqueeSelectIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/ChartPanIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/ChartZoomIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/CheckIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/CheckboxCrossedIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/CheckboxMixedIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/CheckboxOffIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/CheckboxOnIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/CloseIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/CollapseIcon.js +17 -17
- package/es/PRIVATE_ThemedIcons/CollapseUpIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/DecrementIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/DeleteIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/DirectionalCollapseArrowIcon.js +17 -17
- package/es/PRIVATE_ThemedIcons/DirectionalExpandArrowIcon.js +17 -17
- package/es/PRIVATE_ThemedIcons/DragHandleIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/DropdownArrowIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/ExpandIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/HelpIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/IncrementIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/MenuButtonDropdownIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/MessageConfirmationIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/MessageErrorIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/MessageInfoIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/MessageWarningIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/MinusIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/NavDownIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/None.js +16 -16
- package/es/PRIVATE_ThemedIcons/OverviewHorizontalDragHandleIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/PlusIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/RadioOffIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/RadioOnIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/SortAscendingIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/SortDescendingIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/ViewHideIcon.js +16 -16
- package/es/PRIVATE_ThemedIcons/ViewIcon.js +16 -16
- package/es/PRIVATE_TimeComponent.js +19 -19
- package/es/PRIVATE_TruncatingLink.js +16 -16
- package/es/PRIVATE_VisOverview.js +16 -16
- package/es/PRIVATE_VisStatusMessage.js +5 -5
- package/es/PRIVATE_VisTabularDatatip.js +4 -4
- package/es/{Popup-992b6c27.js → Popup-22d51095.js} +10 -10
- package/es/{Popup-992b6c27.js.map → Popup-22d51095.js.map} +1 -1
- package/es/ProgressButtonLabelLayout-69549cf9.js +3 -3
- package/es/{ProgressCircle-46084d0b.js → ProgressCircle-bce87dad.js} +2 -2
- package/es/{ProgressCircle-46084d0b.js.map → ProgressCircle-bce87dad.js.map} +1 -1
- package/es/RadioIconVariants.styles.css +3 -3
- package/es/RadioIconVariants.styles2.css +3 -3
- package/es/RadioItem-94909632.js +6 -6
- package/es/ReadonlyTextFieldInput-106ce959.js +1 -1
- package/es/{ReferenceLineArea-53129f72.js → ReferenceLineArea-cc72b070.js} +3 -3
- package/es/{ReferenceLineArea-53129f72.js.map → ReferenceLineArea-cc72b070.js.map} +1 -1
- package/es/RevealToggleIcon-2d622d8f.js +1 -1
- package/es/{SectionedContent-30e5bf98.js → SectionedContent-897e9c4e.js} +5 -5
- package/es/{SectionedContent-30e5bf98.js.map → SectionedContent-897e9c4e.js.map} +1 -1
- package/es/SegmentStyles.styles.css +9 -12
- package/es/SegmentStyles.styles2.css +12 -9
- package/es/SelectMenuGroupContext-aa1fe822.js +6 -6
- package/es/SelectMobileFieldInput-0a7c968c.js +8 -8
- package/es/{SelectorAll-de7ba2e1.js → SelectorAll-3d39196b.js} +5 -5
- package/es/{SelectorAll-de7ba2e1.js.map → SelectorAll-3d39196b.js.map} +1 -1
- package/es/Sheet-f9f8a4a4.js +2 -2
- package/es/SortControl-1044fcd9.js +3 -3
- package/es/SplitMenuButtonTheme.styles.css +4 -4
- package/es/SplitMenuButtonTheme.styles2.css +4 -4
- package/es/StyledCard-77623731.js +1 -1
- package/es/{StyledDatePickerButton-f3971567.js → StyledDatePickerButton-78f2f6e8.js} +2 -8
- package/es/StyledDatePickerButton-78f2f6e8.js.map +1 -0
- package/es/StyledDatePickerButtonStyles.styles.css +17 -0
- package/es/{StyledLabelValueLayout-bb05f474.js → StyledLabelValueLayout-bddfb884.js} +2 -2
- package/es/{StyledLabelValueLayout-bb05f474.js.map → StyledLabelValueLayout-bddfb884.js.map} +1 -1
- package/es/StyledSwitch-dbf29d95.js +2 -2
- package/es/StyledTextField-7605d76a.js +5 -5
- package/es/Submenu-cbd77756.js +1 -1
- package/es/{TabBar-10488830.js → TabBar-67ca442c.js} +9 -7
- package/es/{TabBar-10488830.js.map → TabBar-67ca442c.js.map} +1 -1
- package/es/TabBarContextMenu-c3326d67.js +2 -2
- package/es/TabBarLayout-9b67d1b6.js +1 -1
- package/es/{TabBarLinkItem-a9c1072b.js → TabBarLinkItem-e7be54fa.js} +2 -2
- package/es/{TabBarLinkItem-a9c1072b.js.map → TabBarLinkItem-e7be54fa.js.map} +1 -1
- package/es/Table-2f197c6a.js +11 -11
- package/es/TableColGroup-d74bd4f5.js +1 -1
- package/es/TextField-7884fcd7.js +3 -3
- package/es/Theme-redwood/theme.css +396 -396
- package/es/Theme-stable/theme.css +467 -467
- package/es/TimeComponentCanvas2D-cfb0066d.js +6 -6
- package/es/ToggleButton-bb69cf10.js +1 -1
- package/es/TrainVariants.styles.css +6 -6
- package/es/TrainVariants.styles2.css +6 -6
- package/es/TruncatingLink-298c6343.js +4 -4
- package/es/TruncatingText-1bf00351.js +1 -1
- package/es/UNSAFE_AccordionItemMultiple.js +18 -18
- package/es/UNSAFE_AccordionItemSingle.js +18 -18
- package/es/UNSAFE_ActionCard.js +2 -2
- package/es/UNSAFE_BarChart.js +35 -35
- package/es/UNSAFE_BareButton.js +2 -2
- package/es/UNSAFE_BaseButton.js +5 -5
- package/es/UNSAFE_Button.js +6 -6
- package/es/UNSAFE_ButtonSet.js +4 -4
- package/es/UNSAFE_ButtonSetButton.js +5 -5
- package/es/UNSAFE_ButtonSetIconButton.js +17 -17
- package/es/UNSAFE_ButtonSetItem.js +18 -18
- package/es/UNSAFE_ButtonSetMultiple.js +4 -4
- package/es/UNSAFE_ButtonSetSingle.js +4 -4
- package/es/UNSAFE_Card.js +3 -3
- package/es/UNSAFE_CardFlexView.js +23 -23
- package/es/UNSAFE_CardGridView.js +23 -23
- package/es/UNSAFE_Center.js +5 -5
- package/es/UNSAFE_Checkbox.js +25 -25
- package/es/UNSAFE_CheckboxItem.js +27 -27
- package/es/UNSAFE_CheckboxRadioField.js +4 -4
- package/es/UNSAFE_CheckboxSet.js +26 -26
- package/es/UNSAFE_Chip.js +2 -2
- package/es/UNSAFE_Collapsible.js +18 -18
- package/es/UNSAFE_ColorPalette.js +19 -19
- package/es/UNSAFE_ColorPicker.js +21 -21
- package/es/UNSAFE_ColorSwatch.js +17 -17
- package/es/UNSAFE_ComboChart.js +35 -35
- package/es/UNSAFE_ComponentMessage.js +20 -20
- package/es/UNSAFE_ContainerDiagram/themes/DiagramStyles.css.js +1 -1
- package/es/UNSAFE_ContainerDiagram.js +29 -29
- package/es/UNSAFE_ConveyorBelt.js +18 -18
- package/es/UNSAFE_DatePicker.js +28 -28
- package/es/UNSAFE_Diagram/themes/DiagramStyles.css.js +1 -1
- package/es/UNSAFE_Diagram.js +29 -29
- package/es/UNSAFE_Dialog.js +22 -22
- package/es/UNSAFE_DragHandle.js +17 -17
- package/es/UNSAFE_DrawerLayout.js +12 -12
- package/es/UNSAFE_DrawerPopup.js +11 -11
- package/es/UNSAFE_Dropdown.js +15 -15
- package/es/UNSAFE_Environment.js +4 -4
- package/es/UNSAFE_ExpandableList.js +25 -25
- package/es/UNSAFE_FilePicker.js +4 -4
- package/es/UNSAFE_FlatTreeView.js +39 -39
- package/es/UNSAFE_Flex.js +4 -4
- package/es/UNSAFE_Floating.js +11 -11
- package/es/UNSAFE_FormLayout.js +2 -2
- package/es/UNSAFE_Gantt.js +23 -23
- package/es/UNSAFE_Grid.js +4 -4
- package/es/UNSAFE_HighlightText.js +4 -4
- package/es/UNSAFE_Icon.js +16 -16
- package/es/UNSAFE_IconButton.js +17 -17
- package/es/UNSAFE_IconMenuButton.js +25 -25
- package/es/UNSAFE_IconProgressButton.js +21 -21
- package/es/UNSAFE_IconToggleButton.js +17 -17
- package/es/UNSAFE_Indexer.js +19 -19
- package/es/UNSAFE_InlineSelectSingle.js +32 -32
- package/es/UNSAFE_InputColor.js +32 -32
- package/es/UNSAFE_InputDateMask/themes/SegmentStyles.css.js +1 -1
- package/es/UNSAFE_InputDateMask.js +27 -27
- package/es/UNSAFE_InputDatePicker.js +38 -38
- package/es/UNSAFE_InputPassword.js +26 -26
- package/es/UNSAFE_InputSensitiveText.js +27 -27
- package/es/UNSAFE_InputText.js +28 -28
- package/es/UNSAFE_InputTimeMask/themes/SegmentStyles.css.js +1 -1
- package/es/UNSAFE_InputTimeMask.js +27 -27
- package/es/UNSAFE_Label.js +25 -25
- package/es/UNSAFE_LabelValueLayout.js +4 -4
- package/es/UNSAFE_LabelledLink.js +27 -27
- package/es/UNSAFE_Layer.js +8 -8
- package/es/UNSAFE_Legend.js +27 -27
- package/es/UNSAFE_LineAreaChart.js +35 -35
- package/es/UNSAFE_Link.js +2 -2
- package/es/UNSAFE_ListItemLayout.js +4 -4
- package/es/UNSAFE_ListView.js +74 -74
- package/es/UNSAFE_LiveRegion.js +4 -4
- package/es/UNSAFE_Menu.js +26 -26
- package/es/UNSAFE_MenuButton.js +25 -25
- package/es/UNSAFE_MessageBanner.js +20 -20
- package/es/UNSAFE_MessageToast.js +22 -22
- package/es/UNSAFE_MeterBar.js +16 -16
- package/es/UNSAFE_MeterCircle.js +17 -17
- package/es/UNSAFE_Modal.js +8 -8
- package/es/UNSAFE_NavigationList.js +40 -40
- package/es/UNSAFE_NavigationListCommon.js +20 -20
- package/es/UNSAFE_NumberInputText.js +28 -28
- package/es/UNSAFE_OverflowTabBar.js +40 -40
- package/es/UNSAFE_PictoChart.js +25 -25
- package/es/UNSAFE_PieChart.js +26 -26
- package/es/UNSAFE_Popup.js +18 -18
- package/es/UNSAFE_ProgressBar.js +4 -4
- package/es/UNSAFE_ProgressButton.js +21 -21
- package/es/UNSAFE_ProgressButtonLabelLayout.js +10 -10
- package/es/UNSAFE_ProgressCircle.js +4 -4
- package/es/UNSAFE_RadioItem/themes/redwood/RadioIconTheme.js +1 -1
- package/es/UNSAFE_RadioItem/themes/redwood/RadioIconVariants.css.js +1 -1
- package/es/UNSAFE_RadioItem/themes/stable/RadioIconTheme.js +1 -1
- package/es/UNSAFE_RadioItem/themes/stable/RadioIconVariants.css.js +1 -1
- package/es/UNSAFE_RadioItem.js +26 -26
- package/es/UNSAFE_RadioSet.js +27 -27
- package/es/UNSAFE_RatingGauge.js +18 -18
- package/es/UNSAFE_ReorderableTabBar.js +39 -39
- package/es/UNSAFE_RichCheckboxSet.js +28 -28
- package/es/UNSAFE_RichRadioSet.js +29 -29
- package/es/UNSAFE_RichSelectionItem.js +31 -31
- package/es/UNSAFE_ScatterChart.js +35 -35
- package/es/UNSAFE_SectionalLegend.js +27 -27
- package/es/UNSAFE_SelectMultiple.js +35 -35
- package/es/UNSAFE_SelectSingle.js +34 -34
- package/es/UNSAFE_SelectionCard.js +3 -3
- package/es/UNSAFE_Selector.js +17 -17
- package/es/UNSAFE_SelectorAll.js +19 -19
- package/es/UNSAFE_Sheet.js +11 -11
- package/es/UNSAFE_SortControl.js +20 -20
- package/es/UNSAFE_SplitMenuButton/themes/redwood/SplitMenuButtonTheme.css.js +1 -1
- package/es/UNSAFE_SplitMenuButton/themes/stable/SplitMenuButtonTheme.css.js +1 -1
- package/es/UNSAFE_SplitMenuButton.js +26 -26
- package/es/UNSAFE_Switch.js +26 -26
- package/es/UNSAFE_TabBar.js +41 -41
- package/es/UNSAFE_TabBarCommon.js +33 -33
- package/es/UNSAFE_TabBarMixed.js +40 -40
- package/es/UNSAFE_TableView.js +35 -35
- package/es/UNSAFE_TagCloud.js +26 -26
- package/es/UNSAFE_TextArea.js +237 -117
- package/es/UNSAFE_TextArea.js.map +1 -1
- package/es/UNSAFE_TextAreaAutosize.js +28 -28
- package/es/UNSAFE_TextField.js +20 -20
- package/es/UNSAFE_ToggleButton.js +5 -5
- package/es/UNSAFE_Toolbar.js +4 -4
- 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 +18 -18
- package/es/UNSAFE_TruncatingBadge.js +17 -17
- package/es/UNSAFE_TruncatingText.js +17 -17
- package/es/UNSAFE_UserAssistance.js +26 -26
- package/es/UNSAFE_View.js +7 -7
- package/es/UNSAFE_VirtualizedListView.js +21 -21
- package/es/UNSAFE_VisInvalidDataMessage.js +6 -6
- package/es/UNSAFE_VisNoDataMessage.js +6 -6
- package/es/UNSAFE_VisProgressiveLoader.js +5 -5
- package/es/UNSAFE_WindowOverlay.js +4 -4
- package/es/{View-5bdd9b3c.js → View-818f2f31.js} +5 -5
- package/es/{View-5bdd9b3c.js.map → View-818f2f31.js.map} +1 -1
- package/es/{VisStatusMessage-e2d629bb.js → VisStatusMessage-09c532e3.js} +2 -2
- package/es/{VisStatusMessage-e2d629bb.js.map → VisStatusMessage-09c532e3.js.map} +1 -1
- package/es/{VisTabularDatatip-85b00c1b.js → VisTabularDatatip-f45069f1.js} +2 -2
- package/es/{VisTabularDatatip-85b00c1b.js.map → VisTabularDatatip-f45069f1.js.map} +1 -1
- package/es/{WindowOverlay-7264c44a.js → WindowOverlay-467c2d12.js} +2 -2
- package/es/{WindowOverlay-7264c44a.js.map → WindowOverlay-467c2d12.js.map} +1 -1
- package/es/{YearsGridView-cac4710a.js → YearsGridView-5286a756.js} +5 -5
- package/es/{YearsGridView-cac4710a.js.map → YearsGridView-5286a756.js.map} +1 -1
- package/es/hoc/PRIVATE_withDirectionIcon.js +4 -4
- package/es/hoc/PRIVATE_withThemeIcon.js +3 -3
- package/es/hoc/UNSAFE_withThemeProps.js +3 -3
- package/es/hooks/PRIVATE_useChartContextMenu.js +23 -23
- package/es/hooks/PRIVATE_useChartDatatip.js +14 -14
- package/es/hooks/PRIVATE_useChartEvents.js +19 -19
- package/es/hooks/PRIVATE_useChartMarquee.js +19 -19
- package/es/hooks/PRIVATE_useCollectionFocusRing.js +17 -17
- package/es/hooks/PRIVATE_useCssVars.js +7 -7
- package/es/hooks/PRIVATE_useCurrentKey.js +4 -4
- package/es/hooks/PRIVATE_useDatatip.js +12 -12
- package/es/hooks/PRIVATE_useDetectHorizontalOverflow.js +16 -16
- package/es/hooks/PRIVATE_useFloating.js +4 -4
- package/es/hooks/PRIVATE_useItemAction.js +17 -17
- package/es/hooks/PRIVATE_useListCommon.js +19 -19
- package/es/hooks/PRIVATE_useOutsideMousedown.js +9 -9
- package/es/hooks/PRIVATE_useRadioFocusManager.js +4 -4
- package/es/hooks/PRIVATE_useReorderable.js +19 -19
- package/es/hooks/PRIVATE_useRovingTabIndexContainer.js +4 -4
- package/es/hooks/PRIVATE_useSelection.js +4 -4
- package/es/hooks/PRIVATE_useTabBar.js +26 -26
- package/es/hooks/PRIVATE_useTabbableModeSet.js +17 -17
- package/es/hooks/PRIVATE_useTooltipOnTruncation.js +17 -17
- package/es/hooks/PRIVATE_useVisContextMenu.js +23 -23
- package/es/hooks/PRIVATE_useVisDragModeControls.js +19 -19
- package/es/hooks/PRIVATE_useVisEvents.js +4 -4
- package/es/hooks/PRIVATE_useVisMeterEvents.js +14 -14
- package/es/hooks/PRIVATE_useVisSelection.js +15 -15
- package/es/hooks/UNSAFE_useBareButton.js +2 -2
- package/es/hooks/UNSAFE_useColorScheme.js +3 -3
- package/es/hooks/UNSAFE_useCurrentBgColor.js +2 -2
- package/es/hooks/UNSAFE_useDensity.js +3 -3
- package/es/hooks/UNSAFE_useHiddenTestMethod.js +3 -3
- package/es/hooks/UNSAFE_useOutsideClick.js +8 -8
- package/es/hooks/UNSAFE_usePrefixSuffix.js +4 -4
- package/es/hooks/UNSAFE_useScale.js +3 -3
- package/es/hooks/UNSAFE_useTestId.js +3 -3
- package/es/hooks/UNSAFE_useTheme.js +3 -3
- package/es/hooks/UNSAFE_useThemeInterpolations.js +6 -6
- package/es/hooks/UNSAFE_useTooltip.js +17 -17
- package/es/hooks/UNSAFE_useTranslationBundle.js +3 -3
- package/es/hooks/UNSAFE_useUser.js +3 -3
- package/es/{popupUtils-51366a29.js → popupUtils-7774330e.js} +2 -2
- package/es/{popupUtils-51366a29.js.map → popupUtils-7774330e.js.map} +1 -1
- package/es/{tooltipUtils-af0abd38.js → tooltipUtils-90fb656f.js} +5 -5
- package/es/{tooltipUtils-af0abd38.js.map → tooltipUtils-90fb656f.js.map} +1 -1
- package/es/useBareButton-ff4bd21e.js +1 -1
- package/es/useCellNavigation-0565b6dd.js +1 -1
- package/es/useChartContextMenu-5de82cd7.js +2 -2
- package/es/{useChartDatatip-8dd22b71.js → useChartDatatip-cba78e0f.js} +4 -4
- package/es/{useChartDatatip-8dd22b71.js.map → useChartDatatip-cba78e0f.js.map} +1 -1
- package/es/{useColorScheme-c4f6caab.js → useColorScheme-67245285.js} +2 -2
- package/es/{useColorScheme-c4f6caab.js.map → useColorScheme-67245285.js.map} +1 -1
- package/es/useContextMenu-730d6c12.js +2 -2
- package/es/{useCssVars-bc2527ac.js → useCssVars-048a52d8.js} +5 -5
- package/es/{useCssVars-bc2527ac.js.map → useCssVars-048a52d8.js.map} +1 -1
- package/es/{useCurrentKey-5f865bbd.js → useCurrentKey-38e5f097.js} +2 -2
- package/es/{useCurrentKey-5f865bbd.js.map → useCurrentKey-38e5f097.js.map} +1 -1
- package/es/{useDatatip-4895a07a.js → useDatatip-ef5c47a7.js} +4 -4
- package/es/{useDatatip-4895a07a.js.map → useDatatip-ef5c47a7.js.map} +1 -1
- package/es/{useDensity-1acb0153.js → useDensity-969273f3.js} +2 -2
- package/es/{useDensity-1acb0153.js.map → useDensity-969273f3.js.map} +1 -1
- package/es/useDisplayValue-5bbf2830.js +5 -5
- package/es/{useExpandCollapse-5739cfd2.js → useExpandCollapse-51f9bb4b.js} +2 -2
- package/es/{useExpandCollapse-5739cfd2.js.map → useExpandCollapse-51f9bb4b.js.map} +1 -1
- package/es/{useFloating-b9d680f7.js → useFloating-c74a7f54.js} +2 -2
- package/es/{useFloating-b9d680f7.js.map → useFloating-c74a7f54.js.map} +1 -1
- package/es/{useHiddenTestMethod-f3f25093.js → useHiddenTestMethod-ec7b3989.js} +2 -2
- package/es/{useHiddenTestMethod-f3f25093.js.map → useHiddenTestMethod-ec7b3989.js.map} +1 -1
- package/es/{useKeyboardEvents-9aae7ea3.js → useKeyboardEvents-a1495728.js} +2 -2
- package/es/{useKeyboardEvents-9aae7ea3.js.map → useKeyboardEvents-a1495728.js.map} +1 -1
- package/es/useLegendContextMenu-a678b26f.js +4 -4
- package/es/{useMeterDatatip-538a4d53.js → useMeterDatatip-f61ca3e0.js} +3 -3
- package/es/{useMeterDatatip-538a4d53.js.map → useMeterDatatip-f61ca3e0.js.map} +1 -1
- package/es/useNavigation-b257c33a.js +1 -1
- package/es/{useOutsideClick-b777a43e.js → useOutsideClick-01f3d3e1.js} +2 -2
- package/es/{useOutsideClick-b777a43e.js.map → useOutsideClick-01f3d3e1.js.map} +1 -1
- package/es/{useOutsideMousedown-c45c22c0.js → useOutsideMousedown-e0866d58.js} +2 -2
- package/es/{useOutsideMousedown-c45c22c0.js.map → useOutsideMousedown-e0866d58.js.map} +1 -1
- package/es/{usePopupAnimation-96d2bc83.js → usePopupAnimation-7c5db425.js} +2 -2
- package/es/{usePopupAnimation-96d2bc83.js.map → usePopupAnimation-7c5db425.js.map} +1 -1
- package/es/{usePrefixSuffix-f981b65f.js → usePrefixSuffix-95fc00fd.js} +2 -2
- package/es/{usePrefixSuffix-f981b65f.js.map → usePrefixSuffix-95fc00fd.js.map} +1 -1
- package/es/{useRadioFocusManager-36eb283e.js → useRadioFocusManager-d9eecfb4.js} +2 -2
- package/es/{useRadioFocusManager-36eb283e.js.map → useRadioFocusManager-d9eecfb4.js.map} +1 -1
- package/es/{useReorderableItem-857636b7.js → useReorderableItem-06bd7a7b.js} +3 -3
- package/es/{useReorderableItem-857636b7.js.map → useReorderableItem-06bd7a7b.js.map} +1 -1
- package/es/{useRovingTabIndexContainer-5992e107.js → useRovingTabIndexContainer-c0356f5d.js} +2 -2
- package/es/{useRovingTabIndexContainer-5992e107.js.map → useRovingTabIndexContainer-c0356f5d.js.map} +1 -1
- package/es/{useScale-434ad939.js → useScale-93490e54.js} +2 -2
- package/es/{useScale-434ad939.js.map → useScale-93490e54.js.map} +1 -1
- package/es/useSelectCommon-309d0f07.js +5 -5
- package/es/{useSelectDrill-f669e729.js → useSelectDrill-2f855daa.js} +3 -3
- package/es/{useSelectDrill-f669e729.js.map → useSelectDrill-2f855daa.js.map} +1 -1
- package/es/{useSelection-82bec039.js → useSelection-10ed8060.js} +6 -6
- package/es/{useSelection-82bec039.js.map → useSelection-10ed8060.js.map} +1 -1
- package/es/{useSelection-65134722.js → useSelection-d6fefa3d.js} +2 -2
- package/es/{useSelection-65134722.js.map → useSelection-d6fefa3d.js.map} +1 -1
- package/es/useTabBar-c5558e77.js +3 -3
- package/es/{useTestId-f24ac480.js → useTestId-ab1bede6.js} +2 -2
- package/es/{useTestId-f24ac480.js.map → useTestId-ab1bede6.js.map} +1 -1
- package/es/useTextAreaAltEnter-ac460f4c.js +61 -0
- package/{amd/useTextAreaAltEnter-32272da6.js.map → es/useTextAreaAltEnter-ac460f4c.js.map} +1 -1
- package/es/{useTheme-0e7497db.js → useTheme-c2cfbc29.js} +2 -2
- package/es/{useTheme-0e7497db.js.map → useTheme-c2cfbc29.js.map} +1 -1
- package/es/{useThemeInterpolations-e144e8ec.js → useThemeInterpolations-5f358139.js} +5 -5
- package/es/{useThemeInterpolations-e144e8ec.js.map → useThemeInterpolations-5f358139.js.map} +1 -1
- package/es/{useTooltip-94af94d4.js → useTooltip-ab739df0.js} +2 -2
- package/es/{useTooltip-94af94d4.js.map → useTooltip-ab739df0.js.map} +1 -1
- package/es/{useTooltipControlled-f2cfa454.js → useTooltipControlled-b7f30aee.js} +5 -5
- package/es/{useTooltipControlled-f2cfa454.js.map → useTooltipControlled-b7f30aee.js.map} +1 -1
- package/es/{useTooltipOnTruncation-94282e75.js → useTooltipOnTruncation-31afc3f2.js} +4 -4
- package/es/{useTooltipOnTruncation-94282e75.js.map → useTooltipOnTruncation-31afc3f2.js.map} +1 -1
- package/es/{useTranslationBundle-4822502f.js → useTranslationBundle-bc6e0896.js} +2 -2
- package/es/{useTranslationBundle-4822502f.js.map → useTranslationBundle-bc6e0896.js.map} +1 -1
- package/es/{useUser-06d34d19.js → useUser-e543b73c.js} +2 -2
- package/es/{useUser-06d34d19.js.map → useUser-e543b73c.js.map} +1 -1
- package/es/useVisDragModeControls-af64848c.js +1 -1
- package/es/{useVisEvents-256dee29.js → useVisEvents-0edc925f.js} +2 -2
- package/es/{useVisEvents-256dee29.js.map → useVisEvents-0edc925f.js.map} +1 -1
- package/es/utils/PRIVATE_collectionUtils.js +17 -17
- package/es/utils/PRIVATE_tabBarUtils.js +17 -17
- package/es/utils/PRIVATE_tooltipUtils.js +14 -14
- package/es/utils/PRIVATE_visTestUtils.js +4 -4
- package/es/utils/UNSAFE_popupUtils.js +8 -8
- package/es/{withDirectionIcon-a8d84a3d.js → withDirectionIcon-b725a6d7.js} +2 -2
- package/es/{withDirectionIcon-a8d84a3d.js.map → withDirectionIcon-b725a6d7.js.map} +1 -1
- package/es/withThemeProps-dbd4fedf.js +2 -2
- package/package.json +2 -2
- package/amd/BaseCardView-b8119561.js +0 -2
- package/amd/BaseTabBarItem-03c91d3f.js +0 -2
- package/amd/BaseTabBarItem-03c91d3f.js.map +0 -1
- package/amd/CardFlexView-aa2f3de8.js +0 -2
- package/amd/CardGridView-85f90c75.js +0 -2
- package/amd/ColorPicker-141fa49d.js +0 -2
- package/amd/ListView-2678b2af.js +0 -2
- package/amd/ReorderableTabBar-46683bcb.js +0 -2
- package/amd/StyledDatePickerButton-b664f4f0.js +0 -2
- package/amd/StyledDatePickerButton-b664f4f0.js.map +0 -1
- package/amd/TabBar-fcebb560.js +0 -2
- package/amd/TabBarItem-224bc6b3.js +0 -2
- package/amd/TabBarLinkItem-57587dbd.js +0 -2
- package/amd/TabBarMixed-8cc4b4ed.js +0 -2
- package/amd/TextArea-4a3b8b56.js +0 -2
- package/amd/TextArea-4a3b8b56.js.map +0 -1
- package/amd/TextAreaAutosize-3a13ebb2.js +0 -2
- package/amd/useTextAreaAltEnter-32272da6.js +0 -2
- package/cjs/CheckboxSetContext-c62db26d.js +0 -12
- package/cjs/CheckboxSetContext-c62db26d.js.map +0 -1
- package/cjs/OverflowTabBarItem-2c967a89.js.map +0 -1
- package/cjs/StyledDatePickerButton-cf4e4dc0.js.map +0 -1
- package/es/OverflowTabBarItem-6966fbc7.js.map +0 -1
- package/es/StyledDatePickerButton-f3971567.js.map +0 -1
- package/es/TextArea-93ce78a7.js +0 -225
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlatTreeView-9ecf2be6.js","sources":["../../src/UNSAFE_FlatTreeView/NodeSkeletonContainer.tsx","../../src/UNSAFE_FlatTreeView/TreeItemSkeletons.tsx","../../src/UNSAFE_FlatTreeView/TreeItem.tsx","../../src/UNSAFE_FlatTreeView/SkeletonContainer.tsx","../../src/UNSAFE_FlatTreeView/LoadMoreTreeCollection.tsx","../../src/UNSAFE_FlatTreeView/TreeViewUtils.ts","../../src/UNSAFE_FlatTreeView/useTreeNavigation.ts","../../src/UNSAFE_FlatTreeView/FlatTreeView.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 */\nimport { ComponentChildren } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport { Size } from '#utils/UNSAFE_size';\nimport { View } from '#UNSAFE_View';\n\ntype Props = {\n /**\n * Allows to pass and access the properties from child elements\n **/\n children?: (index: number) => ComponentChildren;\n indentation?: Size;\n};\n\n/**\n * Allows to specify the time delay for rendering the component\n **/\nconst timerValue = 50;\n\n/**\n * Represents the skeleton for a tree item in expanding state\n **/\nexport function NodeSkeletonContainer({ children, indentation = 0 }: Props) {\n const [isVisible, setIsVisible] = useState(false);\n\n useEffect(() => {\n setTimeout(() => {\n setIsVisible(true);\n }, timerValue);\n }, []);\n\n return isVisible && children ? (\n <div role=\"presentation\">\n <View paddingInlineStart={indentation as Size}>\n {[...Array(1)].map((_element, index) => children(index))}\n </View>\n </div>\n ) : null;\n}\n","import { calcIndentation } from './TreeItem';\nimport { View } from '#UNSAFE_View';\nimport { Skeleton } from '#UNSAFE_Skeleton';\nimport { Flex } from '#UNSAFE_Flex';\nimport { Size } from '#utils/UNSAFE_size';\n\ntype Props = {\n indentation?: number;\n isLeaf?: boolean;\n};\n\nfunction TreeItemSkeleton({ indentation = 0, isLeaf = false }: Props) {\n return (\n <View paddingInlineStart={calcIndentation(indentation, isLeaf ? undefined : true) as Size}>\n <View padding={[0, '4px']}>\n <Flex height=\"9x\" align=\"center\" gap=\"2x\">\n {!isLeaf && <Skeleton width=\"6x\" height=\"6x\" borderRadius=\"4px\" />}\n <Skeleton height=\"5x\" borderRadius=\"4px\" />\n </Flex>\n </View>\n </View>\n );\n}\n\nexport function TreeItemSkeletons() {\n return (\n <>\n <TreeItemSkeleton />\n <TreeItemSkeleton indentation={1} />\n <TreeItemSkeleton indentation={2} isLeaf={true} />\n </>\n );\n}\n","import { ComponentChildren } from 'preact';\nimport { useRef } from 'preact/hooks';\nimport { Size } from '#utils/UNSAFE_size';\nimport { classNames } from '#utils/UNSAFE_classNames';\nimport { TabbableModeContext } from '#hooks/UNSAFE_useTabbableMode';\nimport { ToggleDetail, ListItemRendererContext } from '#UNSAFE_Collection';\nimport { View } from '#UNSAFE_View';\nimport { styles } from './themes/TreeViewStyles.css';\nimport { treeViewVars as cssVars } from './themes/TreeViewContract.css';\nimport { Expander } from '#PRIVATE_Expander';\nimport { Flex } from '#UNSAFE_Flex';\nimport { NodeSkeletonContainer } from './NodeSkeletonContainer';\nimport { TreeItemSkeletons } from './TreeItemSkeletons';\nimport { useId } from '#hooks/UNSAFE_useId';\nimport { useHover } from '#hooks/UNSAFE_useHover';\nimport { getClientHints } from '#utils/PRIVATE_clientHints';\n\ntype Props<K, D> = {\n children: (context: ListItemRendererContext<K, D>) => ComponentChildren;\n itemKey: K;\n depth: number;\n context: ListItemRendererContext<K, D>;\n isExpanded: boolean | undefined;\n onToggle: (detail: ToggleDetail<K>) => void;\n selected: boolean | 'partial';\n isSelectable: boolean;\n isCheckboxless: boolean;\n isTabbable: boolean;\n isLoading?: boolean;\n isFocusRingVisible: boolean;\n};\n\nexport function TreeItem<K extends string | number, D>({\n itemKey,\n depth,\n context,\n children,\n isExpanded,\n onToggle,\n selected,\n isSelectable,\n isCheckboxless,\n isTabbable,\n isLoading,\n isFocusRingVisible\n}: Props<K, D>) {\n const rootRef = useRef<HTMLDivElement>(null);\n const indentation = calcIndentation(depth, isExpanded);\n const skeletonIndentation = calcIndentation(depth + 1, isExpanded);\n\n const { isHover, hoverProps } = useHover();\n\n const classes = classNames([\n styles.treeItemStyles.base,\n isFocusRingVisible && styles.treeItemStyles.focused,\n selected === true && styles.treeItemStyles.selected,\n selected === true && isCheckboxless && styles.treeItemStyles.checkboxlessSelected,\n isSelectable && !selected && isHover && styles.treeItemStyles.hovered\n ]);\n\n return (\n <>\n <div\n ref={rootRef}\n id={useId()}\n tabIndex={isMobile() ? -1 : undefined}\n data-oj-key={itemKey}\n data-oj-tree-item=\"\"\n class={classes}\n role=\"treeitem\"\n aria-level={depth + 1}\n aria-selected={selected ? 'true' : 'false'}\n {...(isExpanded !== undefined && { 'aria-expanded': isExpanded })}\n {...(typeof itemKey === 'number' && { 'data-oj-key-type': 'number' })}\n {...hoverProps}>\n <>\n {selected === true && isHover && <div class={styles.selectedHoveredOverlay}></div>}\n <TabbableModeContext.Provider value={{ isTabbable }}>\n <View paddingInlineStart={indentation as Size}>\n <Flex align=\"center\">\n {isExpanded !== undefined && (\n <Expander itemKey={itemKey} expanded={isExpanded} onToggle={onToggle} />\n )}\n {children(context)}\n </Flex>\n </View>\n </TabbableModeContext.Provider>\n </>\n </div>\n {isLoading ? (\n <NodeSkeletonContainer indentation={skeletonIndentation as Size}>\n {() => {\n return <TreeItemSkeletons />;\n }}\n </NodeSkeletonContainer>\n ) : null}\n </>\n );\n}\n\nexport const isMobile = () => {\n const { platform } = getClientHints();\n return platform === 'ios' || platform === 'android';\n};\n\nexport const calcIndentation = (depth: number, isExpanded?: boolean) => {\n const expanderPlaceholder = isExpanded === undefined ? '40px' : '0px';\n return `calc(${Math.max(0, depth)} * ${cssVars.indentWidth} + ${expanderPlaceholder})`;\n};\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 { ComponentChildren } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport { classNames } from '../utils/UNSAFE_classNames';\nimport { styles } from './themes/TreeViewStyles.css';\n\ntype Props = {\n /**\n * Allows to pass and access the properties from child elements\n **/\n children?: (index: number) => ComponentChildren;\n /**\n * Allows to specify number of skeletons to be rendered on initial load\n **/\n minimumCount?: number;\n /**\n * Callback when skeleton do become visible, handler can use this\n * to update its live region.\n */\n onSkeletonVisible?: () => void;\n};\n\n/**\n * Allows to specify the time delay for rendering the component\n **/\nconst timerValue = 50;\n\n/**\n * SkeletonContainer renders 'minimumCount' number of skeletons\n * of the variant specified from its child element - Skeleton's prop after\n * 'timerValue' ms delay\n **/\nexport function SkeletonContainer({ children, minimumCount = 1, onSkeletonVisible }: Props) {\n const [isVisible, setIsVisible] = useState(false);\n\n useEffect(() => {\n setTimeout(() => {\n setIsVisible(true);\n onSkeletonVisible?.();\n }, timerValue);\n }, [onSkeletonVisible]);\n\n const containerClasses = classNames([styles.skeletonStyles.container]);\n return isVisible && children ? (\n <div class={containerClasses} role=\"presentation\">\n {[...Array(minimumCount)].map((_element, index) => children(index))}\n </div>\n ) : null;\n}\n","import { ItemContext } from '#UNSAFE_Collection';\nimport { LoadMoreCollection } from '#PRIVATE_LoadMoreCollection';\nimport { TreeItem } from './TreeItem';\nimport { InternalTreeNode, LoadMoreTreeCollectionProps as Props } from './TreeView.types';\nimport { SkeletonContainer } from './SkeletonContainer';\nimport { TreeItemSkeletons } from './TreeItemSkeletons';\nimport { LOADMORE_STYLE_CLASS } from '#PRIVATE_LoadMoreCollection';\n// TODO: add this import due to issue JET-67485, need to update once Stable is introduced\nimport './themes/redwood/TreeViewTheme.css';\n\n/**\n * Component that receives the flattened data and renders the hierarchy betweens items based on the shaped metadata.\n * In order to maximize performance, only items that are visible in the viewport are rendered.\n * This is an internal component that is used by FlatTreeView.\n */\nexport function LoadMoreTreeCollection<K extends string | number, D>({\n data,\n children,\n selectionMode,\n onToggle = () => {},\n viewportConfig,\n hasMore = false,\n onLoadMore = () => {},\n loadMoreIndicator = defaultLoadMoreIndicator,\n updateContext\n}: Props<K, D>) {\n const createTreeItem = (context: ItemContext<InternalTreeNode<K, D>>) => {\n const key = context.data.metadata.key;\n const treeItemContext = {\n index: context.index,\n data: context.data.data,\n metadata: { key }\n };\n // allow container to inject additional things to context\n if (updateContext) {\n updateContext(treeItemContext);\n }\n const expanded = context.data.metadata.expanded;\n return (\n <TreeItem\n key={treeItemContext.metadata.key}\n itemKey={treeItemContext.metadata.key}\n context={treeItemContext}\n depth={context.data.metadata.treeDepth}\n isExpanded={expanded === 'ongoing' ? true : expanded}\n onToggle={onToggle}\n isSelectable={selectionMode !== 'none'}\n isCheckboxless={selectionMode === 'single'} // TODO: need to update when checkboxless multiple is added\n selected={context.data.metadata.selected}\n isLoading={expanded === 'ongoing'}\n isTabbable={false}\n isFocusRingVisible={context.data.metadata.hasFocus}>\n {children}\n </TreeItem>\n );\n };\n\n return (\n <>\n {data === null ? null : (\n <LoadMoreCollection\n data={data}\n viewportConfig={viewportConfig}\n hasMore={hasMore}\n onLoadMore={onLoadMore}\n loadMoreIndicator={loadMoreIndicator}>\n {createTreeItem}\n </LoadMoreCollection>\n )}\n </>\n );\n}\n\nconst defaultLoadMoreIndicator = (\n <div class={LOADMORE_STYLE_CLASS}>\n <SkeletonContainer minimumCount={1}>\n {() => {\n return <TreeItemSkeletons />;\n }}\n </SkeletonContainer>\n </div>\n);\n","/**\n * Item selector for tree item\n */\nexport const TREE_ITEM_SELECTOR = '[data-oj-tree-item]';\n","import { RefObject } from 'preact';\nimport { useCallback } from 'preact/hooks';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\nimport { useUser } from '#hooks/UNSAFE_useUser';\nimport { findElementByKey, keyExtractor, getPrevNextKey } from '#utils/PRIVATE_collectionUtils';\nimport { isKeyDefined } from '#utils/UNSAFE_keys';\nimport { useNavigation } from '#hooks/PRIVATE_useListCommon';\nimport { TREE_ITEM_SELECTOR } from './TreeViewUtils';\n\nexport function useTreeNavigation<K extends string | number>(\n data: any | null,\n rootRef: RefObject<HTMLDivElement>,\n isExpanded: (key: K) => boolean,\n idExtractor: (elem: Element) => string\n) {\n const { direction } = useUser();\n\n const arrowKeyAndHandlers = {\n ArrowUp: (key?: K) => getPrevNextKey(rootRef.current, key, true, TREE_ITEM_SELECTOR),\n ArrowDown: (key?: K) => getPrevNextKey(rootRef.current, key, false, TREE_ITEM_SELECTOR)\n };\n\n const { navigationProps, currentKey, onCurrentKeyChange, showFocusRing } = useNavigation(\n data,\n rootRef,\n idExtractor,\n TREE_ITEM_SELECTOR,\n arrowKeyAndHandlers,\n undefined, // currentItemOverride,\n undefined, //onPersistCurrentItem,\n undefined,\n undefined,\n true, // should always allow shift key\n false, // TODO: update allowTabbableMode when F2 mode is added\n true,\n false\n );\n\n const itemKeyExtractor = useCallback(\n (element: HTMLElement) => {\n if (element.getAttribute('role') === 'tree') {\n return currentKey === undefined ? null : currentKey;\n }\n return keyExtractor(element, TREE_ITEM_SELECTOR) as K;\n },\n [currentKey, keyExtractor]\n );\n\n const onKeyUp = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {\n const isRtl = direction === 'rtl';\n const isLeftArrow = event.key === 'ArrowLeft' && !isRtl;\n const itemKey = itemKeyExtractor(event.target as HTMLElement);\n if (itemKey) {\n const contains = isExpanded(itemKey);\n // arrow left on a collapsed node, go to its parent\n if (isLeftArrow && !contains && rootRef.current) {\n const item = findElementByKey(rootRef.current, itemKey, TREE_ITEM_SELECTOR);\n if (item) {\n const treeDepth = item.getAttribute('aria-level');\n const parent =\n treeDepth !== null &&\n findParentElementByKey(\n rootRef.current,\n itemKey,\n Number(treeDepth),\n TREE_ITEM_SELECTOR\n );\n const newKey = parent && itemKeyExtractor(parent as HTMLElement);\n if (isKeyDefined(newKey)) {\n onCurrentKeyChange?.({ value: newKey as K });\n }\n }\n } else if (!isLeftArrow && contains) {\n // arrow right on an expanded node, go to its first child\n const newKey = getPrevNextKey(rootRef.current, itemKey, false, TREE_ITEM_SELECTOR)();\n if (isKeyDefined(newKey)) {\n onCurrentKeyChange?.({ value: newKey as K });\n }\n }\n }\n }\n },\n [direction, isExpanded, onCurrentKeyChange, itemKeyExtractor]\n );\n\n const treeNavigationProps = mergeProps(navigationProps, { onKeyUp });\n return { treeNavigationProps, currentKey, showFocusRing };\n}\n\nconst findParentElementByKey = <K extends string | number>(\n root: HTMLElement | null,\n key: K | null,\n treeDepth: number,\n itemSelector: string\n) => {\n if (root && key !== null) {\n const items = Array.from(root.querySelectorAll(itemSelector));\n const index = items.findIndex((i) => (i as HTMLElement).dataset['ojKey'] == key);\n for (let i = index; i >= 0; i--) {\n const level = items[i].getAttribute('aria-level');\n if (level !== null && Number(level) == treeDepth - 1) {\n return items[i];\n }\n }\n }\n return null;\n};\n","import { useMemo, useRef, useCallback, useState } from 'preact/hooks';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\nimport { SelectionDetail, ListItemRendererContext } from '#UNSAFE_Collection';\nimport { getViewportConfig } from '#utils/PRIVATE_collectionUtils';\nimport { FlattenedTreeNode, InternalTreeNode, FlatTreeViewProps as Props } from './TreeView.types';\nimport { LoadMoreTreeCollection } from './LoadMoreTreeCollection';\nimport {\n useSelection,\n useAdditiveSelection,\n SelectionRangeDetail\n} from '#hooks/PRIVATE_useSelection';\nimport { useExpandCollapse } from '#hooks/PRIVATE_useListCommon';\nimport { keyExtractor, getPrevNextKey, findElementByKey } from '#utils/PRIVATE_collectionUtils';\nimport { addKeys, containsKey } from '#utils/UNSAFE_keys';\nimport { useComponentTheme } from '#hooks/UNSAFE_useComponentTheme';\nimport { TreeViewRedwoodTheme } from './themes/redwood/TreeViewTheme.css';\nimport { useTreeNavigation } from './useTreeNavigation';\nimport { Selector } from '#UNSAFE_Selector';\nimport { isMobile } from './TreeItem';\nimport { SkeletonContainer } from './SkeletonContainer';\nimport { TreeItemSkeletons } from './TreeItemSkeletons';\nimport { LiveRegion } from '#UNSAFE_LiveRegion';\nimport { HiddenAccessible } from '#UNSAFE_HiddenAccessible';\nimport { useId } from '#hooks/UNSAFE_useId';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport { BundleType } from '#resources/nls/bundle';\nimport { TREE_ITEM_SELECTOR } from './TreeViewUtils';\n\n/**\n * A FlatTreeView displays flattened data as a tree with highly interactive features.\n */\nexport function FlatTreeView<K extends string | number, D>({\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n data,\n selectionMode = 'none',\n selectedKeys = { all: false, keys: new Set() },\n onSelectionChange,\n onToggle,\n viewportConfig,\n ...rest\n}: Props<K, D>) {\n const rootRef = useRef<HTMLDivElement>(null);\n const [liveRegion, setLiveRegion] = useState<string>();\n const { collection_loading, collection_loaded } = useTranslationBundle<BundleType>(\n '@oracle/oraclejet-preact'\n );\n const loadingDescId = useId();\n\n const isExpanded = useCallback((key: K) => {\n if (rootRef.current) {\n const elem = findElementByKey(rootRef.current, key, TREE_ITEM_SELECTOR);\n return elem?.getAttribute('aria-expanded') === 'true';\n }\n return false;\n }, []);\n\n const { treeNavigationProps, currentKey, showFocusRing } = useTreeNavigation(\n data,\n rootRef,\n isExpanded,\n idExtractor\n );\n\n const items: InternalTreeNode<K, D>[] = useMemo(\n () =>\n data?.map((value: FlattenedTreeNode<K, D>) => {\n const itemKey = value.metadata.key;\n const newValue = { ...value } as InternalTreeNode<K, D>;\n newValue.metadata.selected = containsKey(selectedKeys, itemKey);\n newValue.metadata.hasFocus = currentKey === itemKey && showFocusRing;\n return newValue;\n }) || [],\n [data, selectedKeys, currentKey, showFocusRing]\n );\n\n const expandCollapseProps = useExpandCollapse(\n (element: HTMLElement) => {\n if (element.getAttribute('role') === 'tree') {\n return currentKey === undefined ? null : currentKey;\n }\n return keyExtractor(element, TREE_ITEM_SELECTOR) as K;\n },\n isExpanded,\n onToggle,\n true\n );\n\n // tracking the anchor key which is used for shift+click selection\n const anchorKey = useRef<K | undefined>();\n\n const handleSelectionChange = useCallback(\n (detail: SelectionDetail<K>) => {\n if (onSelectionChange) {\n if (detail.value.all === false && detail.value.keys.size > 0) {\n // during regular selection, the last key selected by a user gesture is the anchor key\n anchorKey.current = Array.from(detail.value.keys.values()).pop();\n }\n onSelectionChange(detail);\n }\n },\n [anchorKey, onSelectionChange]\n );\n\n const handleSelectionRangeChange = useCallback(\n (detail: SelectionRangeDetail<K>) => {\n if (data && onSelectionChange) {\n const value = handleSelectionRange(detail, data);\n if (Array.isArray(value)) {\n if (detail.eventType === 'shiftSpace') {\n // during range selection by shift+space, the first key selected by a user gesture is the anchor key\n anchorKey.current = detail.value.start;\n } else {\n // during range selection by shift+click/arrow keys, the last key selected by a user gesture is the anchor key\n anchorKey.current = detail.value.end;\n }\n if (selectionMode === 'multipleToggle') {\n const keys = addKeys(selectedKeys, value);\n onSelectionChange({ value: keys, target: null });\n } else {\n onSelectionChange({ value: { all: false, keys: new Set(value) }, target: null });\n }\n }\n }\n },\n [data, selectedKeys, onSelectionChange]\n );\n\n // single or multiple selection mode\n const { selectionProps } = useSelection(\n (element: HTMLElement) => {\n if (element === rootRef.current) {\n return currentKey === undefined ? null : currentKey;\n }\n return keyExtractor(element, TREE_ITEM_SELECTOR) as K;\n },\n selectedKeys,\n selectionMode === 'multipleToggle' ? 'none' : selectionMode,\n false,\n 'replace',\n handleSelectionChange,\n anchorKey.current,\n currentKey,\n (currentKey: K | undefined, isPrev: boolean) =>\n getPrevNextKey(rootRef.current, currentKey, isPrev, TREE_ITEM_SELECTOR),\n undefined,\n (key: K) => {\n if (rootRef.current) {\n const elem = findElementByKey(rootRef.current, key, TREE_ITEM_SELECTOR);\n if (elem) {\n elem.scrollIntoView({ block: 'nearest' });\n }\n }\n },\n handleSelectionRangeChange\n );\n\n // multipleToggle selection mode\n const { eventProps: multipleToggleSelectionProps } = useAdditiveSelection(\n (element: HTMLElement) => {\n if (element === rootRef.current) {\n return currentKey === undefined ? null : currentKey;\n }\n return keyExtractor(element, TREE_ITEM_SELECTOR) as K;\n },\n selectedKeys,\n selectionMode === 'multipleToggle' ? 'multiple' : 'none',\n false,\n (key: K) => {\n if (data) {\n return data.findIndex((value: FlattenedTreeNode<K, D>) => value.metadata.key === key);\n }\n return -1;\n },\n (startIndex: number, endIndex: number) => {\n if (data) {\n const keys = data.map((value: FlattenedTreeNode<K, D>) => value.metadata.key);\n return keys.slice(startIndex, endIndex);\n }\n return [];\n },\n (currentKey: K | undefined, isPrev: boolean) =>\n getPrevNextKey(rootRef.current, currentKey, isPrev, TREE_ITEM_SELECTOR),\n currentKey,\n handleSelectionChange,\n handleSelectionRangeChange\n );\n\n //Note: onKeyUp doesn't work with the cmd key\n const selectAllWithKeyboard = useCallback(\n (event: KeyboardEvent) => {\n if (selectionMode === 'multiple' || selectionMode === 'multipleToggle') {\n if (onSelectionChange && (event.metaKey || event.ctrlKey) && event.key === 'a') {\n event.preventDefault();\n onSelectionChange({\n value: { all: true, deletedKeys: new Set() },\n target: event.target\n });\n }\n }\n },\n [onSelectionChange, selectionMode]\n );\n\n const { classes } = useComponentTheme(TreeViewRedwoodTheme);\n viewportConfig = getViewportConfig(rootRef, viewportConfig);\n\n const updateContextCallback = useCallback(\n (context: ListItemRendererContext<K, D>) => {\n const key = context.metadata.key;\n context.selector =\n selectionMode === 'none' || selectionMode === 'single'\n ? undefined\n : (ariaLabel?: string) => (\n <div aria-hidden={isMobile() ? undefined : true}>\n <Selector\n aria-label={isMobile() ? ariaLabel : undefined}\n rowKey={key}\n selectedKeys={selectedKeys}\n onChange={onSelectionChange}\n />\n </div>\n );\n },\n [selectionMode, selectedKeys, onSelectionChange]\n );\n\n const updateLiveRegion = useCallback(() => {\n setLiveRegion(collection_loading());\n }, [collection_loading]);\n\n return (\n <>\n <div\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={\n data == null\n ? ariaDescribedBy\n ? [...new Set(ariaDescribedBy.split(/\\s+/).concat(loadingDescId))].join(' ')\n : loadingDescId\n : ariaDescribedBy\n }\n ref={rootRef}\n role=\"tree\"\n aria-multiselectable={selectionMode === 'multiple' ? true : false}\n tabIndex={0}\n class={classes}\n {...mergeProps(\n treeNavigationProps,\n selectionProps,\n multipleToggleSelectionProps,\n expandCollapseProps,\n { onKeyDown: selectAllWithKeyboard }\n )}>\n {data == null ? (\n defaultLoadingIndicator(updateLiveRegion)\n ) : (\n <LoadMoreTreeCollection\n data={items}\n selectionMode={selectionMode}\n onToggle={onToggle}\n viewportConfig={viewportConfig}\n updateContext={updateContextCallback}\n {...rest}></LoadMoreTreeCollection>\n )}\n </div>\n <HiddenAccessible id={loadingDescId}>{collection_loading()}</HiddenAccessible>\n <LiveRegion>\n {data == null ? liveRegion : liveRegion === collection_loading() ? collection_loaded() : ''}\n </LiveRegion>\n </>\n );\n}\n\nconst defaultLoadingIndicator = (callback: () => void) => {\n return (\n <SkeletonContainer minimumCount={8} onSkeletonVisible={callback}>\n {() => {\n return <TreeItemSkeletons />;\n }}\n </SkeletonContainer>\n );\n};\n\nconst idExtractor = (elem: Element) => elem.id;\n\n/**\n * A helper function to handle range selection\n */\nexport const handleSelectionRange = <K, D>(\n detail: SelectionRangeDetail<K>,\n data: FlattenedTreeNode<K, D>[]\n) => {\n const keys = data.map((value: FlattenedTreeNode<K, D>) => {\n return value.metadata.key;\n });\n const startIndex = keys.indexOf(detail.value.start);\n const endIndex = keys.indexOf(detail.value.end);\n const minIndex = Math.min(startIndex, endIndex);\n const maxIndex = Math.max(startIndex, endIndex);\n if (minIndex === -1) {\n // return a range to fetch so we can find all the keys, maxIndex should not be -1\n return { offset: 0, count: -1 };\n } else {\n // range of keys are in the current viewport, return them\n return keys.slice(minIndex, maxIndex + 1);\n }\n};\n"],"names":["NodeSkeletonContainer","children","indentation","isVisible","setIsVisible","useState","useEffect","setTimeout","_jsx","role","View","paddingInlineStart","Array","map","_element","index","TreeItemSkeleton","isLeaf","calcIndentation","undefined","padding","_jsxs","Flex","height","align","gap","Skeleton","width","borderRadius","TreeItemSkeletons","_Fragment","TreeItem","itemKey","depth","context","isExpanded","onToggle","selected","isSelectable","isCheckboxless","isTabbable","isLoading","isFocusRingVisible","rootRef","useRef","skeletonIndentation","isHover","hoverProps","useHover","classes","classNames","styles","treeItemStyles","base","focused","checkboxlessSelected","hovered","jsx","ref","id","useId","tabIndex","isMobile","class","selectedHoveredOverlay","TabbableModeContext","Provider","value","Expander","expanded","platform","getClientHints","expanderPlaceholder","Math","max","cssVars","treeViewVars","indentWidth","SkeletonContainer","minimumCount","onSkeletonVisible","containerClasses","skeletonStyles","container","LoadMoreTreeCollection","data","selectionMode","viewportConfig","hasMore","onLoadMore","loadMoreIndicator","defaultLoadMoreIndicator","updateContext","LoadMoreCollection","key","metadata","treeItemContext","treeDepth","hasFocus","LOADMORE_STYLE_CLASS","TREE_ITEM_SELECTOR","findParentElementByKey","root","itemSelector","items","from","querySelectorAll","findIndex","i","dataset","level","getAttribute","Number","defaultLoadingIndicator","callback","idExtractor","elem","handleSelectionRange","detail","keys","startIndex","indexOf","start","endIndex","end","minIndex","min","maxIndex","offset","count","slice","ariaLabel","ariaLabelledBy","ariaDescribedBy","selectedKeys","all","Set","onSelectionChange","rest","liveRegion","setLiveRegion","collection_loading","collection_loaded","useTranslationBundle","loadingDescId","useCallback","current","findElementByKey","treeNavigationProps","currentKey","showFocusRing","direction","useUser","arrowKeyAndHandlers","ArrowUp","getPrevNextKey","ArrowDown","navigationProps","onCurrentKeyChange","useNavigation","itemKeyExtractor","element","keyExtractor","onKeyUp","event","isRtl","isLeftArrow","target","contains","item","parent","newKey","isKeyDefined","mergeProps","useTreeNavigation","useMemo","newValue","containsKey","expandCollapseProps","useExpandCollapse","anchorKey","handleSelectionChange","size","values","pop","handleSelectionRangeChange","isArray","eventType","addKeys","selectionProps","useSelection","isPrev","scrollIntoView","block","eventProps","multipleToggleSelectionProps","useAdditiveSelection","selectAllWithKeyboard","metaKey","ctrlKey","preventDefault","deletedKeys","useComponentTheme","TreeViewRedwoodTheme","getViewportConfig","updateContextCallback","selector","Selector","rowKey","onChange","updateLiveRegion","split","concat","join","onKeyDown","HiddenAccessible","LiveRegion"],"mappings":"+7BA4BM,SAAUA,GAAsBC,SAAEA,EAAQC,YAAEA,EAAc,IAC9D,MAAOC,EAAWC,GAAgBC,EAAQA,UAAC,GAQ3C,OANAC,EAAAA,WAAU,KACRC,YAAW,KACTH,GAAa,EAAK,GAVL,GAWD,GACb,IAEID,GAAaF,EAClBO,MAAK,MAAA,CAAAC,KAAK,wBACRD,EAAAA,IAACE,EAAAA,MAAKC,mBAAoBT,EACvBD,SAAA,IAAIW,MAAM,IAAIC,KAAI,CAACC,EAAU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A2B,EACC,CAAAC,KAAMmB,EACNlB,cAAeA,EACflD,SAAUA,EACVmD,eAAgBA,EAChBK,cAAeiH,KACXnE,MAGVlI,EAAAA,IAAC+M,EAAAA,iBAAgB,CAAC5J,GAAIqF,EAAgB/I,SAAA4I,MACtCrI,EAAAiD,IAAC+J,EAAUA,WAAA,CAAAvN,SACA,MAARoF,EAAesD,EAAaA,IAAeE,IAAuBC,IAAsB,OAIjG"}
|
|
1
|
+
{"version":3,"file":"FlatTreeView-15edd439.js","sources":["../../src/UNSAFE_FlatTreeView/NodeSkeletonContainer.tsx","../../src/UNSAFE_FlatTreeView/TreeItemSkeletons.tsx","../../src/UNSAFE_FlatTreeView/TreeItem.tsx","../../src/UNSAFE_FlatTreeView/SkeletonContainer.tsx","../../src/UNSAFE_FlatTreeView/LoadMoreTreeCollection.tsx","../../src/UNSAFE_FlatTreeView/TreeViewUtils.ts","../../src/UNSAFE_FlatTreeView/useTreeNavigation.ts","../../src/UNSAFE_FlatTreeView/FlatTreeView.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 */\nimport { ComponentChildren } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport { Size } from '#utils/UNSAFE_size';\nimport { View } from '#UNSAFE_View';\n\ntype Props = {\n /**\n * Allows to pass and access the properties from child elements\n **/\n children?: (index: number) => ComponentChildren;\n indentation?: Size;\n};\n\n/**\n * Allows to specify the time delay for rendering the component\n **/\nconst timerValue = 50;\n\n/**\n * Represents the skeleton for a tree item in expanding state\n **/\nexport function NodeSkeletonContainer({ children, indentation = 0 }: Props) {\n const [isVisible, setIsVisible] = useState(false);\n\n useEffect(() => {\n setTimeout(() => {\n setIsVisible(true);\n }, timerValue);\n }, []);\n\n return isVisible && children ? (\n <div role=\"presentation\">\n <View paddingInlineStart={indentation as Size}>\n {[...Array(1)].map((_element, index) => children(index))}\n </View>\n </div>\n ) : null;\n}\n","import { calcIndentation } from './TreeItem';\nimport { View } from '#UNSAFE_View';\nimport { Skeleton } from '#UNSAFE_Skeleton';\nimport { Flex } from '#UNSAFE_Flex';\nimport { Size } from '#utils/UNSAFE_size';\n\ntype Props = {\n indentation?: number;\n isLeaf?: boolean;\n};\n\nfunction TreeItemSkeleton({ indentation = 0, isLeaf = false }: Props) {\n return (\n <View paddingInlineStart={calcIndentation(indentation, isLeaf ? undefined : true) as Size}>\n <View padding={[0, '4px']}>\n <Flex height=\"9x\" align=\"center\" gap=\"2x\">\n {!isLeaf && <Skeleton width=\"6x\" height=\"6x\" borderRadius=\"4px\" />}\n <Skeleton height=\"5x\" borderRadius=\"4px\" />\n </Flex>\n </View>\n </View>\n );\n}\n\nexport function TreeItemSkeletons() {\n return (\n <>\n <TreeItemSkeleton />\n <TreeItemSkeleton indentation={1} />\n <TreeItemSkeleton indentation={2} isLeaf={true} />\n </>\n );\n}\n","import { ComponentChildren } from 'preact';\nimport { useRef } from 'preact/hooks';\nimport { Size } from '#utils/UNSAFE_size';\nimport { classNames } from '#utils/UNSAFE_classNames';\nimport { TabbableModeContext } from '#hooks/UNSAFE_useTabbableMode';\nimport { ToggleDetail, ListItemRendererContext } from '#UNSAFE_Collection';\nimport { View } from '#UNSAFE_View';\nimport { styles } from './themes/TreeViewStyles.css';\nimport { treeViewVars as cssVars } from './themes/TreeViewContract.css';\nimport { Expander } from '#PRIVATE_Expander';\nimport { Flex } from '#UNSAFE_Flex';\nimport { NodeSkeletonContainer } from './NodeSkeletonContainer';\nimport { TreeItemSkeletons } from './TreeItemSkeletons';\nimport { useId } from '#hooks/UNSAFE_useId';\nimport { useHover } from '#hooks/UNSAFE_useHover';\nimport { getClientHints } from '#utils/PRIVATE_clientHints';\n\ntype Props<K, D> = {\n children: (context: ListItemRendererContext<K, D>) => ComponentChildren;\n itemKey: K;\n depth: number;\n context: ListItemRendererContext<K, D>;\n isExpanded: boolean | undefined;\n onToggle: (detail: ToggleDetail<K>) => void;\n selected: boolean | 'partial';\n isSelectable: boolean;\n isCheckboxless: boolean;\n isTabbable: boolean;\n isLoading?: boolean;\n isFocusRingVisible: boolean;\n};\n\nexport function TreeItem<K extends string | number, D>({\n itemKey,\n depth,\n context,\n children,\n isExpanded,\n onToggle,\n selected,\n isSelectable,\n isCheckboxless,\n isTabbable,\n isLoading,\n isFocusRingVisible\n}: Props<K, D>) {\n const rootRef = useRef<HTMLDivElement>(null);\n const indentation = calcIndentation(depth, isExpanded);\n const skeletonIndentation = calcIndentation(depth + 1, isExpanded);\n\n const { isHover, hoverProps } = useHover();\n\n const classes = classNames([\n styles.treeItemStyles.base,\n isFocusRingVisible && styles.treeItemStyles.focused,\n selected === true && styles.treeItemStyles.selected,\n selected === true && isCheckboxless && styles.treeItemStyles.checkboxlessSelected,\n isSelectable && !selected && isHover && styles.treeItemStyles.hovered\n ]);\n\n return (\n <>\n <div\n ref={rootRef}\n id={useId()}\n tabIndex={isMobile() ? -1 : undefined}\n data-oj-key={itemKey}\n data-oj-tree-item=\"\"\n class={classes}\n role=\"treeitem\"\n aria-level={depth + 1}\n aria-selected={selected ? 'true' : 'false'}\n {...(isExpanded !== undefined && { 'aria-expanded': isExpanded })}\n {...(typeof itemKey === 'number' && { 'data-oj-key-type': 'number' })}\n {...hoverProps}>\n <>\n {selected === true && isHover && <div class={styles.selectedHoveredOverlay}></div>}\n <TabbableModeContext.Provider value={{ isTabbable }}>\n <View paddingInlineStart={indentation as Size}>\n <Flex align=\"center\">\n {isExpanded !== undefined && (\n <Expander itemKey={itemKey} expanded={isExpanded} onToggle={onToggle} />\n )}\n {children(context)}\n </Flex>\n </View>\n </TabbableModeContext.Provider>\n </>\n </div>\n {isLoading ? (\n <NodeSkeletonContainer indentation={skeletonIndentation as Size}>\n {() => {\n return <TreeItemSkeletons />;\n }}\n </NodeSkeletonContainer>\n ) : null}\n </>\n );\n}\n\nexport const isMobile = () => {\n const { platform } = getClientHints();\n return platform === 'ios' || platform === 'android';\n};\n\nexport const calcIndentation = (depth: number, isExpanded?: boolean) => {\n const expanderPlaceholder = isExpanded === undefined ? '40px' : '0px';\n return `calc(${Math.max(0, depth)} * ${cssVars.indentWidth} + ${expanderPlaceholder})`;\n};\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 { ComponentChildren } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport { classNames } from '../utils/UNSAFE_classNames';\nimport { styles } from './themes/TreeViewStyles.css';\n\ntype Props = {\n /**\n * Allows to pass and access the properties from child elements\n **/\n children?: (index: number) => ComponentChildren;\n /**\n * Allows to specify number of skeletons to be rendered on initial load\n **/\n minimumCount?: number;\n /**\n * Callback when skeleton do become visible, handler can use this\n * to update its live region.\n */\n onSkeletonVisible?: () => void;\n};\n\n/**\n * Allows to specify the time delay for rendering the component\n **/\nconst timerValue = 50;\n\n/**\n * SkeletonContainer renders 'minimumCount' number of skeletons\n * of the variant specified from its child element - Skeleton's prop after\n * 'timerValue' ms delay\n **/\nexport function SkeletonContainer({ children, minimumCount = 1, onSkeletonVisible }: Props) {\n const [isVisible, setIsVisible] = useState(false);\n\n useEffect(() => {\n setTimeout(() => {\n setIsVisible(true);\n onSkeletonVisible?.();\n }, timerValue);\n }, [onSkeletonVisible]);\n\n const containerClasses = classNames([styles.skeletonStyles.container]);\n return isVisible && children ? (\n <div class={containerClasses} role=\"presentation\">\n {[...Array(minimumCount)].map((_element, index) => children(index))}\n </div>\n ) : null;\n}\n","import { ItemContext } from '#UNSAFE_Collection';\nimport { LoadMoreCollection } from '#PRIVATE_LoadMoreCollection';\nimport { TreeItem } from './TreeItem';\nimport { InternalTreeNode, LoadMoreTreeCollectionProps as Props } from './TreeView.types';\nimport { SkeletonContainer } from './SkeletonContainer';\nimport { TreeItemSkeletons } from './TreeItemSkeletons';\nimport { LOADMORE_STYLE_CLASS } from '#PRIVATE_LoadMoreCollection';\n// TODO: add this import due to issue JET-67485, need to update once Stable is introduced\nimport './themes/redwood/TreeViewTheme.css';\n\n/**\n * Component that receives the flattened data and renders the hierarchy betweens items based on the shaped metadata.\n * In order to maximize performance, only items that are visible in the viewport are rendered.\n * This is an internal component that is used by FlatTreeView.\n */\nexport function LoadMoreTreeCollection<K extends string | number, D>({\n data,\n children,\n selectionMode,\n onToggle = () => {},\n viewportConfig,\n hasMore = false,\n onLoadMore = () => {},\n loadMoreIndicator = defaultLoadMoreIndicator,\n updateContext\n}: Props<K, D>) {\n const createTreeItem = (context: ItemContext<InternalTreeNode<K, D>>) => {\n const key = context.data.metadata.key;\n const treeItemContext = {\n index: context.index,\n data: context.data.data,\n metadata: { key }\n };\n // allow container to inject additional things to context\n if (updateContext) {\n updateContext(treeItemContext);\n }\n const expanded = context.data.metadata.expanded;\n return (\n <TreeItem\n key={treeItemContext.metadata.key}\n itemKey={treeItemContext.metadata.key}\n context={treeItemContext}\n depth={context.data.metadata.treeDepth}\n isExpanded={expanded === 'ongoing' ? true : expanded}\n onToggle={onToggle}\n isSelectable={selectionMode !== 'none'}\n isCheckboxless={selectionMode === 'single'} // TODO: need to update when checkboxless multiple is added\n selected={context.data.metadata.selected}\n isLoading={expanded === 'ongoing'}\n isTabbable={false}\n isFocusRingVisible={context.data.metadata.hasFocus}>\n {children}\n </TreeItem>\n );\n };\n\n return (\n <>\n {data === null ? null : (\n <LoadMoreCollection\n data={data}\n viewportConfig={viewportConfig}\n hasMore={hasMore}\n onLoadMore={onLoadMore}\n loadMoreIndicator={loadMoreIndicator}>\n {createTreeItem}\n </LoadMoreCollection>\n )}\n </>\n );\n}\n\nconst defaultLoadMoreIndicator = (\n <div class={LOADMORE_STYLE_CLASS}>\n <SkeletonContainer minimumCount={1}>\n {() => {\n return <TreeItemSkeletons />;\n }}\n </SkeletonContainer>\n </div>\n);\n","/**\n * Item selector for tree item\n */\nexport const TREE_ITEM_SELECTOR = '[data-oj-tree-item]';\n","import { RefObject } from 'preact';\nimport { useCallback } from 'preact/hooks';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\nimport { useUser } from '#hooks/UNSAFE_useUser';\nimport { findElementByKey, keyExtractor, getPrevNextKey } from '#utils/PRIVATE_collectionUtils';\nimport { isKeyDefined } from '#utils/UNSAFE_keys';\nimport { useNavigation } from '#hooks/PRIVATE_useListCommon';\nimport { TREE_ITEM_SELECTOR } from './TreeViewUtils';\n\nexport function useTreeNavigation<K extends string | number>(\n data: any | null,\n rootRef: RefObject<HTMLDivElement>,\n isExpanded: (key: K) => boolean,\n idExtractor: (elem: Element) => string\n) {\n const { direction } = useUser();\n\n const arrowKeyAndHandlers = {\n ArrowUp: (key?: K) => getPrevNextKey(rootRef.current, key, true, TREE_ITEM_SELECTOR),\n ArrowDown: (key?: K) => getPrevNextKey(rootRef.current, key, false, TREE_ITEM_SELECTOR)\n };\n\n const { navigationProps, currentKey, onCurrentKeyChange, showFocusRing } = useNavigation(\n data,\n rootRef,\n idExtractor,\n TREE_ITEM_SELECTOR,\n arrowKeyAndHandlers,\n undefined, // currentItemOverride,\n undefined, //onPersistCurrentItem,\n undefined,\n undefined,\n true, // should always allow shift key\n false, // TODO: update allowTabbableMode when F2 mode is added\n true,\n false\n );\n\n const itemKeyExtractor = useCallback(\n (element: HTMLElement) => {\n if (element.getAttribute('role') === 'tree') {\n return currentKey === undefined ? null : currentKey;\n }\n return keyExtractor(element, TREE_ITEM_SELECTOR) as K;\n },\n [currentKey, keyExtractor]\n );\n\n const onKeyUp = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {\n const isRtl = direction === 'rtl';\n const isLeftArrow = event.key === 'ArrowLeft' && !isRtl;\n const itemKey = itemKeyExtractor(event.target as HTMLElement);\n if (itemKey) {\n const contains = isExpanded(itemKey);\n // arrow left on a collapsed node, go to its parent\n if (isLeftArrow && !contains && rootRef.current) {\n const item = findElementByKey(rootRef.current, itemKey, TREE_ITEM_SELECTOR);\n if (item) {\n const treeDepth = item.getAttribute('aria-level');\n const parent =\n treeDepth !== null &&\n findParentElementByKey(\n rootRef.current,\n itemKey,\n Number(treeDepth),\n TREE_ITEM_SELECTOR\n );\n const newKey = parent && itemKeyExtractor(parent as HTMLElement);\n if (isKeyDefined(newKey)) {\n onCurrentKeyChange?.({ value: newKey as K });\n }\n }\n } else if (!isLeftArrow && contains) {\n // arrow right on an expanded node, go to its first child\n const newKey = getPrevNextKey(rootRef.current, itemKey, false, TREE_ITEM_SELECTOR)();\n if (isKeyDefined(newKey)) {\n onCurrentKeyChange?.({ value: newKey as K });\n }\n }\n }\n }\n },\n [direction, isExpanded, onCurrentKeyChange, itemKeyExtractor]\n );\n\n const treeNavigationProps = mergeProps(navigationProps, { onKeyUp });\n return { treeNavigationProps, currentKey, showFocusRing };\n}\n\nconst findParentElementByKey = <K extends string | number>(\n root: HTMLElement | null,\n key: K | null,\n treeDepth: number,\n itemSelector: string\n) => {\n if (root && key !== null) {\n const items = Array.from(root.querySelectorAll(itemSelector));\n const index = items.findIndex((i) => (i as HTMLElement).dataset['ojKey'] == key);\n for (let i = index; i >= 0; i--) {\n const level = items[i].getAttribute('aria-level');\n if (level !== null && Number(level) == treeDepth - 1) {\n return items[i];\n }\n }\n }\n return null;\n};\n","import { useMemo, useRef, useCallback, useState } from 'preact/hooks';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\nimport { SelectionDetail, ListItemRendererContext } from '#UNSAFE_Collection';\nimport { getViewportConfig } from '#utils/PRIVATE_collectionUtils';\nimport { FlattenedTreeNode, InternalTreeNode, FlatTreeViewProps as Props } from './TreeView.types';\nimport { LoadMoreTreeCollection } from './LoadMoreTreeCollection';\nimport {\n useSelection,\n useAdditiveSelection,\n SelectionRangeDetail\n} from '#hooks/PRIVATE_useSelection';\nimport { useExpandCollapse } from '#hooks/PRIVATE_useListCommon';\nimport { keyExtractor, getPrevNextKey, findElementByKey } from '#utils/PRIVATE_collectionUtils';\nimport { addKeys, containsKey } from '#utils/UNSAFE_keys';\nimport { useComponentTheme } from '#hooks/UNSAFE_useComponentTheme';\nimport { TreeViewRedwoodTheme } from './themes/redwood/TreeViewTheme.css';\nimport { useTreeNavigation } from './useTreeNavigation';\nimport { Selector } from '#UNSAFE_Selector';\nimport { isMobile } from './TreeItem';\nimport { SkeletonContainer } from './SkeletonContainer';\nimport { TreeItemSkeletons } from './TreeItemSkeletons';\nimport { LiveRegion } from '#UNSAFE_LiveRegion';\nimport { HiddenAccessible } from '#UNSAFE_HiddenAccessible';\nimport { useId } from '#hooks/UNSAFE_useId';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport { BundleType } from '#resources/nls/bundle';\nimport { TREE_ITEM_SELECTOR } from './TreeViewUtils';\n\n/**\n * A FlatTreeView displays flattened data as a tree with highly interactive features.\n */\nexport function FlatTreeView<K extends string | number, D>({\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n data,\n selectionMode = 'none',\n selectedKeys = { all: false, keys: new Set() },\n onSelectionChange,\n onToggle,\n viewportConfig,\n ...rest\n}: Props<K, D>) {\n const rootRef = useRef<HTMLDivElement>(null);\n const [liveRegion, setLiveRegion] = useState<string>();\n const { collection_loading, collection_loaded } = useTranslationBundle<BundleType>(\n '@oracle/oraclejet-preact'\n );\n const loadingDescId = useId();\n\n const isExpanded = useCallback((key: K) => {\n if (rootRef.current) {\n const elem = findElementByKey(rootRef.current, key, TREE_ITEM_SELECTOR);\n return elem?.getAttribute('aria-expanded') === 'true';\n }\n return false;\n }, []);\n\n const { treeNavigationProps, currentKey, showFocusRing } = useTreeNavigation(\n data,\n rootRef,\n isExpanded,\n idExtractor\n );\n\n const items: InternalTreeNode<K, D>[] = useMemo(\n () =>\n data?.map((value: FlattenedTreeNode<K, D>) => {\n const itemKey = value.metadata.key;\n const newValue = { ...value } as InternalTreeNode<K, D>;\n newValue.metadata.selected = containsKey(selectedKeys, itemKey);\n newValue.metadata.hasFocus = currentKey === itemKey && showFocusRing;\n return newValue;\n }) || [],\n [data, selectedKeys, currentKey, showFocusRing]\n );\n\n const expandCollapseProps = useExpandCollapse(\n (element: HTMLElement) => {\n if (element.getAttribute('role') === 'tree') {\n return currentKey === undefined ? null : currentKey;\n }\n return keyExtractor(element, TREE_ITEM_SELECTOR) as K;\n },\n isExpanded,\n onToggle,\n true\n );\n\n // tracking the anchor key which is used for shift+click selection\n const anchorKey = useRef<K | undefined>();\n\n const handleSelectionChange = useCallback(\n (detail: SelectionDetail<K>) => {\n if (onSelectionChange) {\n if (detail.value.all === false && detail.value.keys.size > 0) {\n // during regular selection, the last key selected by a user gesture is the anchor key\n anchorKey.current = Array.from(detail.value.keys.values()).pop();\n }\n onSelectionChange(detail);\n }\n },\n [anchorKey, onSelectionChange]\n );\n\n const handleSelectionRangeChange = useCallback(\n (detail: SelectionRangeDetail<K>) => {\n if (data && onSelectionChange) {\n const value = handleSelectionRange(detail, data);\n if (Array.isArray(value)) {\n if (detail.eventType === 'shiftSpace') {\n // during range selection by shift+space, the first key selected by a user gesture is the anchor key\n anchorKey.current = detail.value.start;\n } else {\n // during range selection by shift+click/arrow keys, the last key selected by a user gesture is the anchor key\n anchorKey.current = detail.value.end;\n }\n if (selectionMode === 'multipleToggle') {\n const keys = addKeys(selectedKeys, value);\n onSelectionChange({ value: keys, target: null });\n } else {\n onSelectionChange({ value: { all: false, keys: new Set(value) }, target: null });\n }\n }\n }\n },\n [data, selectedKeys, onSelectionChange]\n );\n\n // single or multiple selection mode\n const { selectionProps } = useSelection(\n (element: HTMLElement) => {\n if (element === rootRef.current) {\n return currentKey === undefined ? null : currentKey;\n }\n return keyExtractor(element, TREE_ITEM_SELECTOR) as K;\n },\n selectedKeys,\n selectionMode === 'multipleToggle' ? 'none' : selectionMode,\n false,\n 'replace',\n handleSelectionChange,\n anchorKey.current,\n currentKey,\n (currentKey: K | undefined, isPrev: boolean) =>\n getPrevNextKey(rootRef.current, currentKey, isPrev, TREE_ITEM_SELECTOR),\n undefined,\n (key: K) => {\n if (rootRef.current) {\n const elem = findElementByKey(rootRef.current, key, TREE_ITEM_SELECTOR);\n if (elem) {\n elem.scrollIntoView({ block: 'nearest' });\n }\n }\n },\n handleSelectionRangeChange\n );\n\n // multipleToggle selection mode\n const { eventProps: multipleToggleSelectionProps } = useAdditiveSelection(\n (element: HTMLElement) => {\n if (element === rootRef.current) {\n return currentKey === undefined ? null : currentKey;\n }\n return keyExtractor(element, TREE_ITEM_SELECTOR) as K;\n },\n selectedKeys,\n selectionMode === 'multipleToggle' ? 'multiple' : 'none',\n false,\n (key: K) => {\n if (data) {\n return data.findIndex((value: FlattenedTreeNode<K, D>) => value.metadata.key === key);\n }\n return -1;\n },\n (startIndex: number, endIndex: number) => {\n if (data) {\n const keys = data.map((value: FlattenedTreeNode<K, D>) => value.metadata.key);\n return keys.slice(startIndex, endIndex);\n }\n return [];\n },\n (currentKey: K | undefined, isPrev: boolean) =>\n getPrevNextKey(rootRef.current, currentKey, isPrev, TREE_ITEM_SELECTOR),\n currentKey,\n handleSelectionChange,\n handleSelectionRangeChange\n );\n\n //Note: onKeyUp doesn't work with the cmd key\n const selectAllWithKeyboard = useCallback(\n (event: KeyboardEvent) => {\n if (selectionMode === 'multiple' || selectionMode === 'multipleToggle') {\n if (onSelectionChange && (event.metaKey || event.ctrlKey) && event.key === 'a') {\n event.preventDefault();\n onSelectionChange({\n value: { all: true, deletedKeys: new Set() },\n target: event.target\n });\n }\n }\n },\n [onSelectionChange, selectionMode]\n );\n\n const { classes } = useComponentTheme(TreeViewRedwoodTheme);\n viewportConfig = getViewportConfig(rootRef, viewportConfig);\n\n const updateContextCallback = useCallback(\n (context: ListItemRendererContext<K, D>) => {\n const key = context.metadata.key;\n context.selector =\n selectionMode === 'none' || selectionMode === 'single'\n ? undefined\n : (ariaLabel?: string) => (\n <div aria-hidden={isMobile() ? undefined : true}>\n <Selector\n aria-label={isMobile() ? ariaLabel : undefined}\n rowKey={key}\n selectedKeys={selectedKeys}\n onChange={onSelectionChange}\n />\n </div>\n );\n },\n [selectionMode, selectedKeys, onSelectionChange]\n );\n\n const updateLiveRegion = useCallback(() => {\n setLiveRegion(collection_loading());\n }, [collection_loading]);\n\n return (\n <>\n <div\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={\n data == null\n ? ariaDescribedBy\n ? [...new Set(ariaDescribedBy.split(/\\s+/).concat(loadingDescId))].join(' ')\n : loadingDescId\n : ariaDescribedBy\n }\n ref={rootRef}\n role=\"tree\"\n aria-multiselectable={selectionMode === 'multiple' ? true : false}\n tabIndex={0}\n class={classes}\n {...mergeProps(\n treeNavigationProps,\n selectionProps,\n multipleToggleSelectionProps,\n expandCollapseProps,\n { onKeyDown: selectAllWithKeyboard }\n )}>\n {data == null ? (\n defaultLoadingIndicator(updateLiveRegion)\n ) : (\n <LoadMoreTreeCollection\n data={items}\n selectionMode={selectionMode}\n onToggle={onToggle}\n viewportConfig={viewportConfig}\n updateContext={updateContextCallback}\n {...rest}></LoadMoreTreeCollection>\n )}\n </div>\n <HiddenAccessible id={loadingDescId}>{collection_loading()}</HiddenAccessible>\n <LiveRegion>\n {data == null ? liveRegion : liveRegion === collection_loading() ? collection_loaded() : ''}\n </LiveRegion>\n </>\n );\n}\n\nconst defaultLoadingIndicator = (callback: () => void) => {\n return (\n <SkeletonContainer minimumCount={8} onSkeletonVisible={callback}>\n {() => {\n return <TreeItemSkeletons />;\n }}\n </SkeletonContainer>\n );\n};\n\nconst idExtractor = (elem: Element) => elem.id;\n\n/**\n * A helper function to handle range selection\n */\nexport const handleSelectionRange = <K, D>(\n detail: SelectionRangeDetail<K>,\n data: FlattenedTreeNode<K, D>[]\n) => {\n const keys = data.map((value: FlattenedTreeNode<K, D>) => {\n return value.metadata.key;\n });\n const startIndex = keys.indexOf(detail.value.start);\n const endIndex = keys.indexOf(detail.value.end);\n const minIndex = Math.min(startIndex, endIndex);\n const maxIndex = Math.max(startIndex, endIndex);\n if (minIndex === -1) {\n // return a range to fetch so we can find all the keys, maxIndex should not be -1\n return { offset: 0, count: -1 };\n } else {\n // range of keys are in the current viewport, return them\n return keys.slice(minIndex, maxIndex + 1);\n }\n};\n"],"names":["NodeSkeletonContainer","children","indentation","isVisible","setIsVisible","useState","useEffect","setTimeout","_jsx","role","View","paddingInlineStart","Array","map","_element","index","TreeItemSkeleton","isLeaf","calcIndentation","undefined","padding","_jsxs","Flex","height","align","gap","Skeleton","width","borderRadius","TreeItemSkeletons","_Fragment","TreeItem","itemKey","depth","context","isExpanded","onToggle","selected","isSelectable","isCheckboxless","isTabbable","isLoading","isFocusRingVisible","rootRef","useRef","skeletonIndentation","isHover","hoverProps","useHover","classes","classNames","styles","treeItemStyles","base","focused","checkboxlessSelected","hovered","jsx","ref","id","useId","tabIndex","isMobile","class","selectedHoveredOverlay","TabbableModeContext","Provider","value","Expander","expanded","platform","getClientHints","expanderPlaceholder","Math","max","cssVars","treeViewVars","indentWidth","SkeletonContainer","minimumCount","onSkeletonVisible","containerClasses","skeletonStyles","container","LoadMoreTreeCollection","data","selectionMode","viewportConfig","hasMore","onLoadMore","loadMoreIndicator","defaultLoadMoreIndicator","updateContext","LoadMoreCollection","key","metadata","treeItemContext","treeDepth","hasFocus","LOADMORE_STYLE_CLASS","TREE_ITEM_SELECTOR","findParentElementByKey","root","itemSelector","items","from","querySelectorAll","findIndex","i","dataset","level","getAttribute","Number","defaultLoadingIndicator","callback","idExtractor","elem","handleSelectionRange","detail","keys","startIndex","indexOf","start","endIndex","end","minIndex","min","maxIndex","offset","count","slice","ariaLabel","ariaLabelledBy","ariaDescribedBy","selectedKeys","all","Set","onSelectionChange","rest","liveRegion","setLiveRegion","collection_loading","collection_loaded","useTranslationBundle","loadingDescId","useCallback","current","findElementByKey","treeNavigationProps","currentKey","showFocusRing","direction","useUser","arrowKeyAndHandlers","ArrowUp","getPrevNextKey","ArrowDown","navigationProps","onCurrentKeyChange","useNavigation","itemKeyExtractor","element","keyExtractor","onKeyUp","event","isRtl","isLeftArrow","target","contains","item","parent","newKey","isKeyDefined","mergeProps","useTreeNavigation","useMemo","newValue","containsKey","expandCollapseProps","useExpandCollapse","anchorKey","handleSelectionChange","size","values","pop","handleSelectionRangeChange","isArray","eventType","addKeys","selectionProps","useSelection","isPrev","scrollIntoView","block","eventProps","multipleToggleSelectionProps","useAdditiveSelection","selectAllWithKeyboard","metaKey","ctrlKey","preventDefault","deletedKeys","useComponentTheme","TreeViewRedwoodTheme","getViewportConfig","updateContextCallback","selector","Selector","rowKey","onChange","updateLiveRegion","split","concat","join","onKeyDown","HiddenAccessible","LiveRegion"],"mappings":"+7BA4BM,SAAUA,GAAsBC,SAAEA,EAAQC,YAAEA,EAAc,IAC9D,MAAOC,EAAWC,GAAgBC,EAAQA,UAAC,GAQ3C,OANAC,EAAAA,WAAU,KACRC,YAAW,KACTH,GAAa,EAAK,GAVL,GAWD,GACb,IAEID,GAAaF,EAClBO,MAAK,MAAA,CAAAC,KAAK,wBACRD,EAAAA,IAACE,EAAAA,MAAKC,mBAAoBT,EACvBD,SAAA,IAAIW,MAAM,IAAIC,KAAI,CAACC,EAAUC,IAAUd,EAASc,SAGnD,IACN,CCjCA,SAASC,GAAiBd,YAAEA,EAAc,EAACe,OAAEA,GAAS,IACpD,OACET,MAACE,EAAAA,KAAK,CAAAC,mBAAoBO,EAAgBhB,GAAae,QAASE,GAAyBlB,SACvFO,MAACE,OAAI,CAACU,QAAS,CAAC,EAAG,gBACjBC,OAACC,EAAAA,MAAKC,OAAO,KAAKC,MAAM,SAASC,IAAI,KAAIxB,SAAA,EACrCgB,GAAUT,EAAAA,IAACkB,EAAAA,UAASC,MAAM,KAAKJ,OAAO,KAAKK,aAAa,QAC1DpB,MAACkB,EAAAA,SAAQ,CAACH,OAAO,KAAKK,aAAa,cAK7C,UAEgBC,IACd,OACER,OACES,EAAAA,SAAA,CAAA7B,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S4C,GAE5C,MAAMsH,EAAwB5D,eAC3B/G,IACC,MAAM4D,EAAM5D,EAAQ6D,SAASD,IAC7B5D,EAAQ4K,SACY,SAAlBxH,GAA8C,WAAlBA,OACxBnE,EACCgH,GACC3H,EAAAA,0BAAkBsD,UAAa3C,EAAgBlB,SAC7CO,EAAAA,IAACuM,EAAAA,SACa,CAAA,aAAAjJ,IAAaqE,OAAYhH,EACrC6L,OAAQlH,EACRwC,aAAcA,EACd2E,SAAUxE,KAGf,GAET,CAACnD,EAAegD,EAAcG,IAG1ByE,GAAmBjE,EAAAA,aAAY,KACnCL,EAAcC,IAAqB,GAClC,CAACA,IAEJ,OACExH,6BACEb,EACciD,IAAA,MAAA,CAAA,aAAA0E,oBACKC,EAAc,mBAErB,MAAR/C,EACIgD,EACE,IAAI,IAAIG,IAAIH,EAAgB8E,MAAM,OAAOC,OAAOpE,KAAiBqE,KAAK,KACtErE,EACFX,EAEN3E,IAAKf,EACLlC,KAAK,OACiB,uBAAkB,aAAlB6E,EACtBzB,SAAU,EACVE,MAAOd,KACH4H,aACFzB,EACAyC,EACAM,EACAjB,EACA,CAAEoC,UAAWjB,IAEdpM,SAAQ,MAARoF,EACC4B,EAAwBiG,IAExB1M,EAACiD,IAAA2B,EACC,CAAAC,KAAMmB,EACNlB,cAAeA,EACflD,SAAUA,EACVmD,eAAgBA,EAChBK,cAAeiH,KACXnE,MAGVlI,EAAAA,IAAC+M,EAAAA,iBAAgB,CAAC5J,GAAIqF,EAAgB/I,SAAA4I,MACtCrI,EAAAiD,IAAC+J,EAAUA,WAAA,CAAAvN,SACA,MAARoF,EAAesD,EAAaA,IAAeE,IAAuBC,IAAsB,OAIjG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
define(['exports', 'preact/jsx-runtime', 'preact/compat', 'preact/hooks', './swatchData-ef8329c2', './clientHints-6d361eaa', './FormFieldContext-a024b891', './logger-0f873e29', './TabbableModeContext-a9c97640', './useTranslationBundle-e4dd341e', 'css!./UserAssistanceStyles.styles.css', 'module', './UNSAFE_UserAssistance/themes/redwood/UserAssistanceVariants.css', './InlineUserAssistance-a59440e5', './Flex-4b81b412', 'css!./MessageBannerStyles.styles.css', 'module', './UNSAFE_MessageBanner/themes/redwood/MessageBannerVariants.css', 'preact', './LayerHost-0b288129', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-2bb62284', 'css!./IconStyle.styles.css', './IconButton-dc1be00e', 'css!./MessageStyles.styles.css', './MessageFormattingUtils-ea0be23e', './TransitionGroup-3b9d81b6', './MessagesContext-602a69a2', 'css!./HiddenAccessibleStyles.styles.css', 'css!./ComponentMessageStyles.styles.css', 'module', './UNSAFE_ComponentMessage/themes/redwood/ComponentMessageVariants.css', './Popup-6b57cc3e', './UNSAFE_Separator/themes/SeparatorStyles.css', 'css!./LabelStyles.styles.css', 'module', './UNSAFE_Label/themes/redwood/LabelVariants.css', './InputGroupContext-372087af', 'module', './UNSAFE_Popup/themes/redwood/PopupVariants.css', './UNSAFE_InputColor/themes/InputColorPickerDropdownStyles.css', './Sheet-1d02491d', './ColorPicker-141fa49d', './SectionedContent-74559d9d', './ColorSwatch-04ab5601', './useDownToggle-80b61b43', './useClearIcon-2bedc84f', './useFocusableTextField-8b755b15', './FormContext-6b0879a0', './useFormContext-b8cbbb21', './useHover-8b8a1496', './useTextField-3ab0a23b', './Label-701506b1', './keyboardUtils-fb6219eb', './TextFieldInput-f8635c62', 'css!./ObfuscatedTextFieldInputStyles.styles.css', './ReadonlyTextFieldInput-41384d7e', './StyledTextField-2b62c81d', './TextField-c8c71735', 'css!./LiveRegionStyles.styles.css', './UNSAFE_TextField/themes/TextFieldStyles.css', 'css!./SkeletonStyles.styles.css', 'css!./TextFieldLoadingStyles.styles.css', 'css!./TextFieldStyles.styles.css', 'module', './UNSAFE_TextField/themes/redwood/TextFieldVariants.css', './CompactUserAssistance-fcc04dcc', './mergeProps-bcfa6a92', './ClearIcon-b3c8c741', './useCurrentValueReducer-faded381', './useSelectableTextField-900d2860'], (function(e,s,t,o,a,l,n,r,i,c,d,u,p,m,b,h,y,x,C,S,f,v,F,T,g,A,I,R,w,V,U,k,D,E,j,P,_,B,L,H,M,N,O,z,W,q,G,K,Z,$,J,Q,X,Y,ee,se,te,oe,ae,le,ne,re,ie,ce,de,ue,pe,me,be,he,ye,xe,Ce){"use strict";const Se=({anchorRef:e,assistiveText:t,swatchSize:a,palette:l,helpSourceLink:r,helpSourceText:i,isDisabled:d,isOpen:u,isReadonly:p,label:b,onClose:h,onCommit:y,messages:x,testId:C,userAssistanceDensity:S,value:f})=>{const[v,F]=o.useState(!1),[T,g]=o.useState(u),A=o.useCallback((e=>{F(e.placement.startsWith("top"))}),[]);T!==u&&(g(u),u||F(!1));const I=fe(),{colorPicker_label:R}=c.useTranslationBundle("@oracle/oraclejet-preact"),w=R(),V=s.jsx(W.ColorPicker,{height:I?void 0:"auto",onCommit:y,maxWidth:I?"100%":void 0,width:"100%",swatchSize:a,palette:l,testId:C,value:f}),U=!u||v&&!I||d||p||!(t||r||x&&x.length>0)||"efficient"!==S&&"reflow"!==S?void 0:s.jsx(n.FormFieldContext.Provider,{value:{isFocused:!0},children:s.jsx("div",{class:O.userAssistanceStyles,children:s.jsx(m.InlineUserAssistance,{assistiveText:t,fieldLabel:b,helpSourceLink:r,helpSourceText:i,messages:x,userAssistanceDensity:S})})}),k=C?C+(I?"_sheet":"_dropdown"):void 0,D=s.jsx("div",{class:O.dropdownStyles,children:s.jsx(q.SectionedContent,{paddingBlockEnd:"3.5x",paddingBlockStart:"3.5x",paddingInlineEnd:"3.5x",paddingInlineStart:"3.5x","aria-label":w,footer:U,hasFocusTrap:!0,main:V,role:"dialog",testId:k})});return I?s.jsx(z.Sheet,{isOpen:u,onClose:h,children:s.jsx(q.SectionedContent,{"aria-label":w,footer:U,hasFocusTrap:!0,main:V,role:"dialog",testId:k})}):s.jsx(q.StickyPositioningDropdown,{anchorRef:e,isOpen:u,onClose:h,onPosition:A,sizeOptions:{isMaxWidthAdjusted:!1,isMaxHeightAdjusted:!0},children:D})},fe=()=>"phone"===l.getClientHints().deviceType,ve=(e,s)=>{switch(s.type){case"colorChanged":case"colorSelected":return{...e,colorValue:s.data};case"reset":return{colorValue:s.data};default:return e}},Fe=({onCommit:e,onInput:s,value:t})=>{const[l,n]=o.useState(!1),r=o.useRef(null),i=o.useRef(null),c=o.useRef(!1),d=o.useRef(),u=o.useRef(t),p=o.useRef(t),m=o.useRef(t),b=o.useRef(!1),{state:h,dispatch:y}=(({value:e})=>{const[s,t]=o.useReducer(ve,{colorValue:e});return{state:s,dispatch:t}})({value:t});a.colorsAreDifferent(m.current,t)&&(m.current=t,a.colorsAreDifferent(t,h.colorValue)&&(y({type:"reset",data:t}),p.current=t,u.current=t)),o.useEffect((()=>{a.colorsAreDifferent(h.colorValue,p.current)&&(s({previousValue:p.current,value:h.colorValue}),p.current=h.colorValue),b.current&&a.colorsAreDifferent(h.colorValue,u.current)&&(e?.({previousValue:u.current,value:h.colorValue}),u.current=h.colorValue,b.current=!1)}),[e,s,h.colorValue]);const x=o.useCallback((e=>{y({type:"colorChanged",data:e.value})}),[y]),C=o.useCallback((()=>{a.colorsAreDifferent(u.current,h.colorValue)&&(e?.({value:h.colorValue,previousValue:u.current}),u.current=h.colorValue)}),[e,h.colorValue]),S=o.useCallback((()=>{c.current||n((e=>!e)),c.current=!1}),[]),f=o.useCallback((e=>{"outsideMousedown"===e.reason?(c.current=!0,clearTimeout(d.current),d.current=setTimeout((()=>{c.current=!1}),200)):"dismissed"!==e.reason&&"keyboardDismissed"!==e.reason||r.current?.focus(),n(!1)}),[]),v=o.useCallback((e=>{r.current?.focus(),b.current=!0,y({type:"colorSelected",data:e.value}),n(!1)}),[y]),F=o.useCallback((()=>{n(!0)}),[]),{triggerProps:T}=K.useDownToggle({isOpen:l,onToggle:F});return{colorIconActionHandler:S,colorPickerCommitHandler:v,dropdownCloseHandler:f,containerDropdownProps:T,colorValue:h.colorValue,iconRef:r,isOpen:l,colorCommitHandler:C,colorInputHandler:x,colorRef:i}},Te=t.forwardRef((({"aria-describedby":e,swatchSize:t,palette:l,value:r,isDisabled:i,isReadonly:d,labelEdge:u,labelStartWidth:p,isRequiredShown:b=!1,isRequired:h=!1,placeholder:y,hasClearIcon:x,columnSpan:C,textAlign:S,autoComplete:f,messages:v,assistiveText:F,helpSourceLink:T,helpSourceText:g,label:A,onCommit:I,onInput:R,testId:w,variant:V,userAssistanceDensity:U},k)=>{const{colorIconActionHandler:D,colorPickerCommitHandler:E,dropdownCloseHandler:j,colorValue:P,containerDropdownProps:_,iconRef:B,isOpen:L,colorCommitHandler:H,colorInputHandler:M,colorRef:N}=Fe({onCommit:I,onInput:R,value:r}),O=o.useRef(null),{inputColor_selectColor:z}=c.useTranslationBundle("@oracle/oraclejet-preact"),W=z(),{onKeyDown:q,...K}=_,{currentCommitValue:J,dispatch:se}=xe.useCurrentValueReducer({value:P}),oe=o.useCallback((e=>{se({type:"input",payload:e.value}),M?.(e)}),[M,se]),re=o.useCallback((e=>{se({type:"commit",payload:e.value}),H?.(e)}),[H,se]),{isDisabled:ie,isReadonly:ce,labelEdge:de,labelStartWidth:ue,textAlign:pe,userAssistanceDensity:me}=Q.useFormContext(),fe=i??ie,ve=d??ce,Te=u??de,Ae=p??ue,Ie=S??pe,Re=U??me,we=o.useRef(null),{focusProps:Ve,isFocused:Ue,methods:ke}=$.useFocusableTextField({isDisabled:fe,isReadonly:ve,enabledElementRef:N,readonlyElementRef:we}),{methods:De}=Ce.useSelectableTextField(N);o.useImperativeHandle(k,(()=>he.mergeProps(ke,De)),[ke,De]);const{hoverProps:Ee,isHover:je}=X.useHover({isDisabled:ve||fe||!1}),{formFieldContext:Pe,inputProps:_e,labelProps:Be,textFieldProps:Le,userAssistanceProps:He}=Y.useTextField({ariaDescribedBy:e,helpSourceLink:T,helpSourceText:g,isDisabled:fe,isFocused:Ue||L,isReadonly:ve,isRequiredShown:b,labelEdge:Te,messages:v,styleVariant:V,userAssistanceDensity:Re,value:P}),Me=o.useCallback((()=>{N.current?.focus();const e=void 0;P!==e&&oe?.({previousValue:P,value:e})}),[oe,P,N]),Ne=Z.useClearIcon({clearIcon:s.jsx(ye.ClearIcon,{onClick:Me,testId:`${w}_clearicon`}),display:x,hasValue:Pe.hasValue,isFocused:Ue,isEnabled:!ve&&!fe,isHover:je}),Oe=void 0!==A&&"inside"===Te,ze="none"!==Te?s.jsx(ee.Label,{...Be,children:A}):void 0,We={label:"none"!==Te?ze:void 0,labelEdge:"none"!==Te?Te:void 0,labelStartWidth:"none"!==Te?Ae:void 0},qe="none"===Te?A:void 0,Ge="efficient"===Re||"reflow"===Re?fe||ve?"efficient"!==Re?void 0:s.jsx(m.InlineUserAssistance,{userAssistanceDensity:Re,...He}):s.jsx(m.InlineUserAssistance,{assistiveText:F,fieldLabel:A,helpSourceLink:T,helpSourceText:g,messages:v,isRequiredShown:b,userAssistanceDensity:Re,...He}):void 0,Ke=o.useRef(null),Ze=O??Ke,$e="compact"===Re?s.jsx(be.CompactUserAssistance,{anchorRef:Ze,messages:v,assistiveText:F,...He}):void 0,Je=ve?s.jsx(ae.ReadonlyTextFieldInput,{"aria-describedby":_e["aria-describedby"],"aria-label":qe,"aria-labelledby":Be.id,as:"div",elementRef:we,textAlign:Ie,value:P,hasEmptyLabel:""===A&&"none"===Te,hasInsideLabel:Oe}):s.jsx(te.TextFieldInput,{"aria-labelledby":Be.id,"aria-label":qe,autoComplete:f,currentCommitValue:J,hasEmptyLabel:""===A&&"none"===Te,hasEndContent:!1,hasInsideLabel:void 0!==ze&&"inside"===Te,hasStartContent:!0,inputRef:N,isRequired:h,placeholder:y,textAlign:Ie,type:ge()?"text":void 0,value:P,onCommit:re,onInput:oe,onKeyDown:q,..._e});return s.jsxs(s.Fragment,{children:[s.jsx(n.FormFieldContext.Provider,{value:Pe,children:ve?s.jsx(le.ReadonlyTextField,{role:"presentation",columnSpan:C,compactUserAssistance:$e,inlineUserAssistance:Ge,onBlur:Ve.onFocusOut,onFocus:Ve.onFocusIn,ref:Ze,mainContent:Je,testId:w,...We}):s.jsx(ne.TextField,{endContent:Ne,columnSpan:C,compactUserAssistance:$e,inlineUserAssistance:Ge,mainContent:Je,onBlur:Ve.onFocusOut,onFocus:Ve.onFocusIn,startContent:s.jsx(G.ColorSwatch,{size:"xs","aria-haspopup":l?"grid":void 0,"aria-label":l?W:void 0,isDisabled:fe,isButton:!0,isTooltipDisabled:L,ref:B,testId:w?w+"_colorIcon":void 0,value:J,onToggle:fe||!l?void 0:D}),mainFieldRef:Ze,hasZeroStartMargin:!0,testId:w,...Le,...We,...Ee,...K})}),L&&!ve&&!fe&&s.jsx(Se,{anchorRef:O,assistiveText:F,helpSourceLink:T,helpSourceText:g,isDisabled:fe,isReadonly:ve,isOpen:L,label:A,onClose:j,onCommit:E,messages:v,testId:w?w+"_colorPicker":void 0,userAssistanceDensity:Re,value:P&&a.isValidColorValue(P)?P:void 0,palette:l,swatchSize:t})]})}));function ge(){const e=l.getClientHints().deviceType;return"phone"===e||"tablet"===e}Te.displayName="InputColor",e.InputColor=Te}));
|
|
2
|
-
//# sourceMappingURL=InputColor-
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact/compat', 'preact/hooks', './swatchData-ef8329c2', './clientHints-6d361eaa', './FormFieldContext-a024b891', './logger-0f873e29', './TabbableModeContext-a9c97640', './useTranslationBundle-e4dd341e', 'css!./UserAssistanceStyles.styles.css', 'module', './UNSAFE_UserAssistance/themes/redwood/UserAssistanceVariants.css', './InlineUserAssistance-a59440e5', './Flex-4b81b412', 'css!./MessageBannerStyles.styles.css', 'module', './UNSAFE_MessageBanner/themes/redwood/MessageBannerVariants.css', 'preact', './LayerHost-0b288129', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-2bb62284', 'css!./IconStyle.styles.css', './IconButton-dc1be00e', 'css!./MessageStyles.styles.css', './MessageFormattingUtils-ea0be23e', './TransitionGroup-3b9d81b6', './MessagesContext-602a69a2', 'css!./HiddenAccessibleStyles.styles.css', 'css!./ComponentMessageStyles.styles.css', 'module', './UNSAFE_ComponentMessage/themes/redwood/ComponentMessageVariants.css', './Popup-6b57cc3e', './UNSAFE_Separator/themes/SeparatorStyles.css', 'css!./LabelStyles.styles.css', 'module', './UNSAFE_Label/themes/redwood/LabelVariants.css', './InputGroupContext-372087af', 'module', './UNSAFE_Popup/themes/redwood/PopupVariants.css', './UNSAFE_InputColor/themes/InputColorPickerDropdownStyles.css', './Sheet-1d02491d', './ColorPicker-e3167e4c', './SectionedContent-74559d9d', './ColorSwatch-04ab5601', './useDownToggle-80b61b43', './useClearIcon-2bedc84f', './useFocusableTextField-8b755b15', './FormContext-6b0879a0', './useFormContext-b8cbbb21', './useHover-8b8a1496', './useTextField-3ab0a23b', './Label-701506b1', './keyboardUtils-fb6219eb', './TextFieldInput-f8635c62', 'css!./ObfuscatedTextFieldInputStyles.styles.css', './ReadonlyTextFieldInput-41384d7e', './StyledTextField-2b62c81d', './TextField-c8c71735', 'css!./LiveRegionStyles.styles.css', './UNSAFE_TextField/themes/TextFieldStyles.css', 'css!./SkeletonStyles.styles.css', 'css!./TextFieldLoadingStyles.styles.css', 'css!./TextFieldStyles.styles.css', 'module', './UNSAFE_TextField/themes/redwood/TextFieldVariants.css', './CompactUserAssistance-fcc04dcc', './mergeProps-bcfa6a92', './ClearIcon-b3c8c741', './useCurrentValueReducer-faded381', './useSelectableTextField-900d2860'], (function(e,s,t,o,l,a,n,r,i,c,d,u,p,m,b,h,y,x,C,S,f,v,F,T,g,A,I,R,w,V,U,k,D,E,j,P,_,B,L,H,M,N,O,z,W,q,G,K,Z,$,J,Q,X,Y,ee,se,te,oe,le,ae,ne,re,ie,ce,de,ue,pe,me,be,he,ye,xe,Ce){"use strict";const Se=({anchorRef:e,assistiveText:t,swatchSize:l,palette:a,helpSourceLink:r,helpSourceText:i,isDisabled:d,isOpen:u,isReadonly:p,label:b,onClose:h,onCommit:y,messages:x,testId:C,userAssistanceDensity:S,value:f})=>{const[v,F]=o.useState(!1),[T,g]=o.useState(u),A=o.useCallback((e=>{F(e.placement.startsWith("top"))}),[]);T!==u&&(g(u),u||F(!1));const I=fe(),{colorPicker_label:R}=c.useTranslationBundle("@oracle/oraclejet-preact"),w=R(),V=s.jsx(W.ColorPicker,{height:I?void 0:"auto",onCommit:y,maxWidth:I?"100%":void 0,width:"100%",swatchSize:l,palette:a,testId:C,value:f}),U=!u||v&&!I||d||p||!(t||r||x&&x.length>0)||"efficient"!==S&&"reflow"!==S?void 0:s.jsx(n.FormFieldContext.Provider,{value:{isFocused:!0},children:s.jsx("div",{class:O.userAssistanceStyles,children:s.jsx(m.InlineUserAssistance,{assistiveText:t,fieldLabel:b,helpSourceLink:r,helpSourceText:i,messages:x,userAssistanceDensity:S})})}),k=C?C+(I?"_sheet":"_dropdown"):void 0,D=s.jsx("div",{class:O.dropdownStyles,children:s.jsx(q.SectionedContent,{paddingBlockEnd:"3.5x",paddingBlockStart:"3.5x",paddingInlineEnd:"3.5x",paddingInlineStart:"3.5x","aria-label":w,footer:U,hasFocusTrap:!0,main:V,role:"dialog",testId:k})});return I?s.jsx(z.Sheet,{isOpen:u,onClose:h,children:s.jsx(q.SectionedContent,{"aria-label":w,footer:U,hasFocusTrap:!0,main:V,role:"dialog",testId:k})}):s.jsx(q.StickyPositioningDropdown,{anchorRef:e,isOpen:u,onClose:h,onPosition:A,sizeOptions:{isMaxWidthAdjusted:!1,isMaxHeightAdjusted:!0},children:D})},fe=()=>"phone"===a.getClientHints().deviceType,ve=(e,s)=>{switch(s.type){case"colorChanged":case"colorSelected":return{...e,colorValue:s.data};case"reset":return{colorValue:s.data};default:return e}},Fe=({onCommit:e,onInput:s,value:t})=>{const[a,n]=o.useState(!1),r=o.useRef(null),i=o.useRef(null),c=o.useRef(!1),d=o.useRef(),u=o.useRef(t),p=o.useRef(t),m=o.useRef(t),b=o.useRef(!1),{state:h,dispatch:y}=(({value:e})=>{const[s,t]=o.useReducer(ve,{colorValue:e});return{state:s,dispatch:t}})({value:t});l.colorsAreDifferent(m.current,t)&&(m.current=t,l.colorsAreDifferent(t,h.colorValue)&&(y({type:"reset",data:t}),p.current=t,u.current=t)),o.useEffect((()=>{l.colorsAreDifferent(h.colorValue,p.current)&&(s({previousValue:p.current,value:h.colorValue}),p.current=h.colorValue),b.current&&l.colorsAreDifferent(h.colorValue,u.current)&&(e?.({previousValue:u.current,value:h.colorValue}),u.current=h.colorValue,b.current=!1)}),[e,s,h.colorValue]);const x=o.useCallback((e=>{y({type:"colorChanged",data:e.value})}),[y]),C=o.useCallback((()=>{l.colorsAreDifferent(u.current,h.colorValue)&&(e?.({value:h.colorValue,previousValue:u.current}),u.current=h.colorValue)}),[e,h.colorValue]),S=o.useCallback((()=>{c.current||n((e=>!e)),c.current=!1}),[]),f=o.useCallback((e=>{"outsideMousedown"===e.reason?(c.current=!0,clearTimeout(d.current),d.current=setTimeout((()=>{c.current=!1}),200)):"dismissed"!==e.reason&&"keyboardDismissed"!==e.reason||r.current?.focus(),n(!1)}),[]),v=o.useCallback((e=>{r.current?.focus(),b.current=!0,y({type:"colorSelected",data:e.value}),n(!1)}),[y]),F=o.useCallback((()=>{n(!0)}),[]),{triggerProps:T}=K.useDownToggle({isOpen:a,onToggle:F});return{colorIconActionHandler:S,colorPickerCommitHandler:v,dropdownCloseHandler:f,containerDropdownProps:T,colorValue:h.colorValue,iconRef:r,isOpen:a,colorCommitHandler:C,colorInputHandler:x,colorRef:i}},Te=t.forwardRef((({"aria-describedby":e,swatchSize:t,palette:a,value:r,isDisabled:i,isReadonly:d,labelEdge:u,labelStartWidth:p,isRequiredShown:b=!1,isRequired:h=!1,placeholder:y,hasClearIcon:x,columnSpan:C,textAlign:S,autoComplete:f,messages:v,assistiveText:F,helpSourceLink:T,helpSourceText:g,label:A,onCommit:I,onInput:R,testId:w,variant:V,userAssistanceDensity:U},k)=>{const{colorIconActionHandler:D,colorPickerCommitHandler:E,dropdownCloseHandler:j,colorValue:P,containerDropdownProps:_,iconRef:B,isOpen:L,colorCommitHandler:H,colorInputHandler:M,colorRef:N}=Fe({onCommit:I,onInput:R,value:r}),O=o.useRef(null),{inputColor_selectColor:z}=c.useTranslationBundle("@oracle/oraclejet-preact"),W=z(),{onKeyDown:q,...K}=_,{currentCommitValue:J,dispatch:se}=xe.useCurrentValueReducer({value:P}),oe=o.useCallback((e=>{se({type:"input",payload:e.value}),M?.(e)}),[M,se]),re=o.useCallback((e=>{se({type:"commit",payload:e.value}),H?.(e)}),[H,se]),{isDisabled:ie,isReadonly:ce,labelEdge:de,labelStartWidth:ue,textAlign:pe,userAssistanceDensity:me}=Q.useFormContext(),fe=i??ie,ve=d??ce,Te=u??de,Ae=p??ue,Ie=S??pe,Re=U??me,we=o.useRef(null),{focusProps:Ve,isFocused:Ue,methods:ke}=$.useFocusableTextField({isDisabled:fe,isReadonly:ve,enabledElementRef:N,readonlyElementRef:we}),{methods:De}=Ce.useSelectableTextField(N);o.useImperativeHandle(k,(()=>he.mergeProps(ke,De)),[ke,De]);const{hoverProps:Ee,isHover:je}=X.useHover({isDisabled:ve||fe||!1}),{formFieldContext:Pe,inputProps:_e,labelProps:Be,textFieldProps:Le,userAssistanceProps:He}=Y.useTextField({ariaDescribedBy:e,helpSourceLink:T,helpSourceText:g,isDisabled:fe,isFocused:Ue||L,isReadonly:ve,isRequiredShown:b,labelEdge:Te,messages:v,styleVariant:V,userAssistanceDensity:Re,value:P}),Me=o.useCallback((()=>{N.current?.focus();const e=void 0;P!==e&&oe?.({previousValue:P,value:e})}),[oe,P,N]),Ne=Z.useClearIcon({clearIcon:s.jsx(ye.ClearIcon,{onClick:Me,testId:`${w}_clearicon`}),display:x,hasValue:Pe.hasValue,isFocused:Ue,isEnabled:!ve&&!fe,isHover:je}),Oe=void 0!==A&&"inside"===Te,ze="none"!==Te?s.jsx(ee.Label,{...Be,children:A}):void 0,We={label:"none"!==Te?ze:void 0,labelEdge:"none"!==Te?Te:void 0,labelStartWidth:"none"!==Te?Ae:void 0},qe="none"===Te?A:void 0,Ge="efficient"===Re||"reflow"===Re?fe||ve?"efficient"!==Re?void 0:s.jsx(m.InlineUserAssistance,{userAssistanceDensity:Re,...He}):s.jsx(m.InlineUserAssistance,{assistiveText:F,fieldLabel:A,helpSourceLink:T,helpSourceText:g,messages:v,isRequiredShown:b,userAssistanceDensity:Re,...He}):void 0,Ke=o.useRef(null),Ze=O??Ke,$e="compact"===Re?s.jsx(be.CompactUserAssistance,{anchorRef:Ze,messages:v,assistiveText:F,...He}):void 0,Je=ve?s.jsx(le.ReadonlyTextFieldInput,{"aria-describedby":_e["aria-describedby"],"aria-label":qe,"aria-labelledby":Be.id,as:"div",elementRef:we,textAlign:Ie,value:P,hasEmptyLabel:""===A&&"none"===Te,hasInsideLabel:Oe}):s.jsx(te.TextFieldInput,{"aria-labelledby":Be.id,"aria-label":qe,autoComplete:f,currentCommitValue:J,hasEmptyLabel:""===A&&"none"===Te,hasEndContent:!1,hasInsideLabel:void 0!==ze&&"inside"===Te,hasStartContent:!0,inputRef:N,isRequired:h,placeholder:y,textAlign:Ie,type:ge()?"text":void 0,value:P,onCommit:re,onInput:oe,onKeyDown:q,..._e});return s.jsxs(s.Fragment,{children:[s.jsx(n.FormFieldContext.Provider,{value:Pe,children:ve?s.jsx(ae.ReadonlyTextField,{role:"presentation",columnSpan:C,compactUserAssistance:$e,inlineUserAssistance:Ge,onBlur:Ve.onFocusOut,onFocus:Ve.onFocusIn,ref:Ze,mainContent:Je,testId:w,...We}):s.jsx(ne.TextField,{endContent:Ne,columnSpan:C,compactUserAssistance:$e,inlineUserAssistance:Ge,mainContent:Je,onBlur:Ve.onFocusOut,onFocus:Ve.onFocusIn,startContent:s.jsx(G.ColorSwatch,{size:"xs","aria-haspopup":a?"grid":void 0,"aria-label":a?W:void 0,isDisabled:fe,isButton:!0,isTooltipDisabled:L,ref:B,testId:w?w+"_colorIcon":void 0,value:J,onToggle:fe||!a?void 0:D}),mainFieldRef:Ze,hasZeroStartMargin:!0,testId:w,...Le,...We,...Ee,...K})}),L&&!ve&&!fe&&s.jsx(Se,{anchorRef:O,assistiveText:F,helpSourceLink:T,helpSourceText:g,isDisabled:fe,isReadonly:ve,isOpen:L,label:A,onClose:j,onCommit:E,messages:v,testId:w?w+"_colorPicker":void 0,userAssistanceDensity:Re,value:P&&l.isValidColorValue(P)?P:void 0,palette:a,swatchSize:t})]})}));function ge(){const e=a.getClientHints().deviceType;return"phone"===e||"tablet"===e}Te.displayName="InputColor",e.InputColor=Te}));
|
|
2
|
+
//# sourceMappingURL=InputColor-51d7e40c.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputColor-58e3fce3.js","sources":["../../src/UNSAFE_InputColor/InputColorPickerDropdown.tsx","../../src/UNSAFE_InputColor/useInputColorState.ts","../../src/UNSAFE_InputColor/useInputColor.ts","../../src/UNSAFE_InputColor/InputColor.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 { ColorPicker } from '#UNSAFE_ColorPicker';\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 { dropdownStyles, userAssistanceStyles } from './themes/InputColorPickerDropdownStyles.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';\nimport { InputColorPublicProps as InputColorProps } from './InputColor.types';\n\ntype StickyPositioningDropdownProps = ComponentProps<typeof StickyPositioningDropdown>;\ntype ColorPickerProps = ComponentProps<typeof ColorPicker>;\ntype PickedPropsFromColorPicker = Pick<ColorPickerProps, 'value' | 'onCommit'>;\ntype PickedPropsFromDropdown = Omit<StickyPositioningDropdownProps, 'onClose'>;\ntype CloseDetail = SheetCloseDetail | DropdownCloseDetail;\ntype PickedPropsFromInputColor = Pick<\n InputColorProps,\n | 'swatchSize'\n | 'palette'\n | 'value'\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 Props = PickedPropsFromColorPicker &\n PickedPropsFromInputColor &\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 ColorPicker either inside a dropdown or sheet; in mobile,\n * 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 InputColorPickerDropdown = ({\n anchorRef,\n assistiveText,\n swatchSize,\n palette,\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isOpen,\n isReadonly,\n label,\n onClose,\n onCommit,\n messages,\n testId,\n userAssistanceDensity,\n value\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 { colorPicker_label } = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const colorPickerAriaLabel = colorPicker_label();\n\n const colorPickerMainContent = (\n <ColorPicker\n height={!shouldShowSheet ? 'auto' : undefined}\n onCommit={onCommit}\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 swatchSize={swatchSize}\n palette={palette}\n testId={testId}\n value={value}\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: color 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 paddingBlockEnd=\"3.5x\"\n paddingBlockStart=\"3.5x\"\n paddingInlineEnd=\"3.5x\"\n paddingInlineStart=\"3.5x\"\n aria-label={colorPickerAriaLabel}\n footer={inlineUserAssistanceFooter}\n hasFocusTrap={true}\n main={colorPickerMainContent}\n role=\"dialog\"\n testId={contentTestId}\n />\n </div>\n );\n\n const dropdown = shouldShowSheet ? (\n <Sheet isOpen={isOpen} onClose={onClose}>\n <SectionedContent\n aria-label={colorPickerAriaLabel}\n footer={inlineUserAssistanceFooter}\n hasFocusTrap={true}\n main={colorPickerMainContent}\n role=\"dialog\"\n testId={contentTestId}\n />\n </Sheet>\n ) : (\n <StickyPositioningDropdown\n anchorRef={anchorRef}\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 { InputColorPickerDropdown, 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 ColorValue } from '#utils/UNSAFE_color';\n\ntype InputColorState = {\n /**\n * Represents the current color value of the component. The user either selected\n * the color in the picker, or typed it into the color field.\n */\n colorValue?: ColorValue;\n};\n\ntype ColorChangedAction = { type: 'colorChanged'; data?: ColorValue };\ntype ColorResetAction = { type: 'reset'; data?: ColorValue };\ntype ColorSelectedAction = { type: 'colorSelected'; data?: ColorValue };\ntype InputColorReducerAction = ColorChangedAction | ColorResetAction | ColorSelectedAction;\n\n// Use a reducer function to manage InputColorState.\nconst inputColorReducer = (\n state: InputColorState,\n action: InputColorReducerAction\n): InputColorState => {\n switch (action.type) {\n case 'colorChanged': {\n return {\n ...state,\n colorValue: action.data\n };\n }\n case 'colorSelected': {\n return { ...state, colorValue: action.data };\n }\n case 'reset': {\n return {\n colorValue: action.data\n };\n }\n default:\n return state;\n }\n};\n\ntype Props = {\n /**\n * The value of the InputColor, or undefined.\n */\n value?: ColorValue;\n};\n\n/**\n * useInputColorState calls useReducer to determine the initial state. Any changes to that state\n * are managed by dispatching actions to the reducer function.\n */\nconst useInputColorState = ({ value }: Props) => {\n const [state, dispatch] = useReducer(inputColorReducer, {\n colorValue: value\n });\n\n return { state, dispatch };\n};\n\nexport { useInputColorState };\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 { useCallback, useEffect, useRef, useState } from 'preact/hooks';\nimport { ElementRef } from 'preact/compat';\nimport { colorsAreDifferent, type ColorValue } from '#utils/UNSAFE_color';\nimport { ColorPicker } from '#UNSAFE_ColorPicker';\nimport { ColorSwatch } from '#UNSAFE_ColorSwatch';\nimport { CloseDetail, InputColorPickerDropdown } from './InputColorPickerDropdown';\nimport { useInputColorState } from './useInputColorState';\nimport type { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\nimport { useDownToggle } from '#hooks/UNSAFE_useDownToggle';\nimport { InputColorPublicProps as InputColorProps } from './InputColor.types';\n\ntype SwatchHandle = ElementRef<typeof ColorSwatch>;\n\ntype ColorPickerProps = ComponentProps<typeof ColorPicker>;\ntype ColorSwatchProps = ComponentProps<typeof ColorSwatch>;\ntype DropdownProps = ComponentProps<typeof InputColorPickerDropdown>;\n\ntype Props = {\n onCommit: InputColorProps['onCommit'];\n onInput: InputColorProps['onInput'];\n value: InputColorProps['value'];\n};\n\n/**\n * Hook that provides handlers and other functionality for InputColor.\n */\nconst useInputColor = ({ onCommit, onInput, value: currentValue }: Props) => {\n // Whether the dropdown is open.\n const [isOpen, setIsOpen] = useState<boolean>(false);\n\n // Ref to the swatch icon button.\n const iconRef: RefObject<SwatchHandle> = useRef<SwatchHandle>(null);\n\n // Ref to the text input which holds color value\n const colorRef: RefObject<HTMLInputElement> = useRef<HTMLInputElement>(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 color values passed to onInput and onCommit.\n const lastCommittedColorRef = useRef<ColorValue | undefined>(currentValue);\n const lastColorRef = useRef<ColorValue | 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<ColorValue | undefined>(currentValue);\n\n // Keep track of whether a color was selected in the color picker.\n const colorSelectedRef = useRef<boolean>(false);\n\n const { state, dispatch } = useInputColorState({ 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 (colorsAreDifferent(lastValueFromParentRef.current, currentValue)) {\n lastValueFromParentRef.current = currentValue;\n if (colorsAreDifferent(currentValue, state.colorValue)) {\n dispatch({ type: 'reset', data: currentValue });\n lastColorRef.current = currentValue;\n lastCommittedColorRef.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 (colorsAreDifferent(state.colorValue, lastColorRef.current)) {\n onInput({ previousValue: lastColorRef.current, value: state.colorValue });\n lastColorRef.current = state.colorValue;\n }\n if (\n colorSelectedRef.current &&\n colorsAreDifferent(state.colorValue, lastCommittedColorRef.current)\n ) {\n onCommit?.({ previousValue: lastCommittedColorRef.current, value: state.colorValue });\n lastCommittedColorRef.current = state.colorValue;\n colorSelectedRef.current = false;\n }\n }, [onCommit, onInput, state.colorValue]);\n\n // Handle onInput from InputColor as values are entered in the input field.\n // We wait for the state to update before calling onInput.\n const colorInputHandler = useCallback<InputColorProps['onInput']>(\n (detail: ValueUpdateDetail<ColorValue>) => {\n dispatch({ type: 'colorChanged', data: detail.value });\n },\n [dispatch]\n );\n\n // Handle onCommit from InputColor, which is called when the user presses Enter or the field is blurred.\n const colorCommitHandler = useCallback<NonNullable<InputColorProps['onCommit']>>(() => {\n // If the current color value differs from the last committed value, then call onCommit.\n if (colorsAreDifferent(lastCommittedColorRef.current, state.colorValue)) {\n onCommit?.({ value: state.colorValue, previousValue: lastCommittedColorRef.current });\n lastCommittedColorRef.current = state.colorValue;\n }\n }, [onCommit, state.colorValue]);\n\n // Respond to onAction event from the swatch icon button. Toggles the color picker dropdown.\n const colorIconActionHandler = useCallback<NonNullable<ColorSwatchProps['onToggle']>>(() => {\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 swatch 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 swatch icon when the dropdown is closed.\n iconRef.current?.focus();\n }\n setIsOpen(false);\n },\n []\n );\n\n // Handle color selection in the picker.\n // - Updates the value in state.\n // - Closes the dropdown.\n // - Sets focus to the color field.\n const colorPickerCommitHandler = useCallback<ColorPickerProps['onCommit']>(\n (detail: ValueUpdateDetail<ColorValue>) => {\n // Set focus to the swatch when a color is selected.\n iconRef.current?.focus();\n\n // Set a ref indicating a color was selected.\n colorSelectedRef.current = true;\n dispatch({ type: 'colorSelected', data: detail.value });\n setIsOpen(false);\n },\n [dispatch]\n );\n\n // The Redwood UX design calls for the dropdown to open when the down arrow is pressed.\n // Handle opening the dropdown when the down arrow is pressed in the text edit field.\n const colorPickerDownHandler = useCallback(() => {\n setIsOpen(true);\n }, []);\n\n const { triggerProps: containerDropdownProps } = useDownToggle({\n isOpen,\n onToggle: colorPickerDownHandler\n });\n\n return {\n colorIconActionHandler,\n colorPickerCommitHandler,\n dropdownCloseHandler,\n containerDropdownProps,\n colorValue: state.colorValue,\n iconRef,\n isOpen,\n colorCommitHandler,\n colorInputHandler,\n colorRef\n };\n};\n\nexport { useInputColor };\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 { Ref } from 'preact';\nimport { forwardRef, ElementRef } from 'preact/compat';\nimport { useCallback, useImperativeHandle, useRef } from 'preact/hooks';\nimport { type BundleType } from '../resources/nls/bundle';\nimport { type ColorValue, isValidColorValue } from '#utils/UNSAFE_color';\nimport { InputColorPickerDropdown } from './InputColorPickerDropdown';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\nimport { ColorSwatch } from '#UNSAFE_ColorSwatch';\nimport { useInputColor } from './useInputColor';\n\nimport { useClearIcon } from '../hooks/UNSAFE_useClearIcon';\nimport { FocusableHandle, useFocusableTextField } from '../hooks/UNSAFE_useFocusableTextField';\nimport { useFormContext } from '../hooks/UNSAFE_useFormContext';\nimport { FormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { useHover } from '../hooks/UNSAFE_useHover';\nimport { useTextField } from '../hooks/UNSAFE_useTextField';\nimport { Label } from '../UNSAFE_Label';\n\nimport {\n ReadonlyTextField,\n ReadonlyTextFieldInput,\n TextField,\n TextFieldInput\n} from '../UNSAFE_TextField';\nimport { CompactUserAssistance, InlineUserAssistance } from '../UNSAFE_UserAssistance';\nimport { getClientHints } from '../utils/PRIVATE_clientHints';\nimport { ClearIcon } from '../PRIVATE_ClearIcon/ClearIcon';\nimport { useCurrentValueReducer } from '../hooks/UNSAFE_useCurrentValueReducer';\nimport { SelectableHandle, useSelectableTextField } from '#hooks/UNSAFE_useSelectableTextField';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\nimport { InputColorPublicProps as Props } from './InputColor.types';\n\ntype SwatchHandle = ElementRef<typeof ColorSwatch>;\n\ntype FocusSelectHandle = FocusableHandle & SelectableHandle;\n\n/**\n * An Input Color is a form field that allows users to select or input a color value,\n * using a color picker or by enterihg a HEX code.\n */\nexport const InputColor = forwardRef(\n (\n {\n 'aria-describedby': ariaDescribedBy,\n swatchSize,\n palette,\n value,\n isDisabled: propIsDisabled,\n isReadonly: propIsReadonly,\n labelEdge: propLabelEdge,\n labelStartWidth: propLabelStartWidth,\n isRequiredShown = false,\n isRequired = false,\n placeholder,\n hasClearIcon,\n columnSpan,\n textAlign: propTextAlign,\n autoComplete,\n messages,\n assistiveText,\n helpSourceLink,\n helpSourceText,\n label,\n onCommit,\n onInput,\n testId,\n variant,\n userAssistanceDensity: propUserAssistanceDensity\n }: Props,\n ref?: Ref<FocusSelectHandle>\n ) => {\n const {\n colorIconActionHandler,\n colorPickerCommitHandler,\n dropdownCloseHandler,\n colorValue,\n containerDropdownProps,\n iconRef,\n isOpen,\n colorCommitHandler,\n colorInputHandler,\n colorRef: enabledElementRef\n } = useInputColor({\n onCommit,\n onInput,\n value\n });\n\n const mainFieldRef = useRef<HTMLDivElement>(null);\n const { inputColor_selectColor } = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const colorIconAriaLabel = inputColor_selectColor();\n const { onKeyDown, ...inputContainerAriaProps } = containerDropdownProps;\n\n const { currentCommitValue, dispatch } = useCurrentValueReducer({ value: colorValue });\n const onInputAndDispatch = useCallback(\n (detail: ValueUpdateDetail<ColorValue>) => {\n // Should dispatch happen first? This will queue up a re-render, ordering should not cause issues (this is async)\n dispatch({ type: 'input', payload: detail.value });\n colorInputHandler?.(detail);\n },\n [colorInputHandler, dispatch]\n );\n const onCommitAndDispatch = useCallback(\n (detail: ValueUpdateDetail<ColorValue>) => {\n // Should dispatch happen first? This will queue up a re-render, ordering should not cause issues (this is async)\n dispatch({ type: 'commit', payload: detail.value });\n colorCommitHandler?.(detail);\n },\n [colorCommitHandler, dispatch]\n );\n\n const startContent = () => (\n <ColorSwatch\n size=\"xs\"\n aria-haspopup={palette ? 'grid' : undefined} // with only palette, grid is a better choice than dialog for now.\n aria-label={palette ? colorIconAriaLabel : undefined}\n isDisabled={isDisabled}\n isButton={true}\n isTooltipDisabled={isOpen}\n ref={iconRef as Ref<SwatchHandle>}\n testId={testId ? testId + '_colorIcon' : undefined}\n value={currentCommitValue as ColorValue}\n onToggle={isDisabled || !palette ? undefined : colorIconActionHandler}\n />\n );\n const {\n isDisabled: isFormDisabled,\n isReadonly: isFormReadonly,\n labelEdge: formLabelEdge,\n labelStartWidth: formLabelStartWidth,\n textAlign: formTextAlign,\n userAssistanceDensity: formUserAssistanceDensity\n } = useFormContext();\n // default to FormContext values if component properties are not specified\n const isDisabled = propIsDisabled ?? isFormDisabled;\n const isReadonly = propIsReadonly ?? isFormReadonly;\n const labelEdge = propLabelEdge ?? formLabelEdge;\n const labelStartWidth = propLabelStartWidth ?? formLabelStartWidth;\n const textAlign = propTextAlign ?? formTextAlign;\n const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;\n\n const readonlyElementRef = useRef<HTMLDivElement>(null);\n\n const {\n focusProps,\n isFocused,\n methods: focusMethods\n } = useFocusableTextField<HTMLInputElement, HTMLDivElement>({\n isDisabled,\n isReadonly,\n enabledElementRef,\n readonlyElementRef\n });\n\n const { methods: selectMethods } = useSelectableTextField<HTMLInputElement>(enabledElementRef);\n\n useImperativeHandle(ref!, () => mergeProps(focusMethods, selectMethods), [\n focusMethods,\n selectMethods\n ]);\n\n const { hoverProps, isHover } = useHover({ isDisabled: isReadonly || isDisabled || false });\n\n const { formFieldContext, inputProps, labelProps, textFieldProps, userAssistanceProps } =\n useTextField({\n ariaDescribedBy,\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isFocused: isFocused || isOpen,\n isReadonly,\n isRequiredShown,\n labelEdge,\n messages,\n styleVariant: variant,\n userAssistanceDensity,\n value: colorValue\n });\n\n const onClickClearIcon = useCallback(() => {\n // Clicking the clear icon should put the focus on the input field\n enabledElementRef.current?.focus();\n // Send an event to clear the field's value if the value is not already cleared\n const nextValue = undefined;\n if (colorValue === nextValue) return;\n onInputAndDispatch?.({ previousValue: colorValue, value: nextValue });\n }, [onInputAndDispatch, colorValue, enabledElementRef]);\n\n const maybeClearIcon = useClearIcon({\n clearIcon: <ClearIcon onClick={onClickClearIcon} testId={`${testId}_clearicon`} />,\n display: hasClearIcon,\n hasValue: formFieldContext.hasValue,\n isFocused,\n isEnabled: !isReadonly && !isDisabled,\n isHover\n });\n\n const hasInsideLabel = label !== undefined && labelEdge === 'inside';\n\n const labelComp = labelEdge !== 'none' ? <Label {...labelProps}>{label}</Label> : undefined;\n\n const fieldLabelProps = {\n label: labelEdge !== 'none' ? labelComp : undefined,\n labelEdge: labelEdge !== 'none' ? labelEdge : undefined,\n labelStartWidth: labelEdge !== 'none' ? labelStartWidth : undefined\n };\n\n const ariaLabel = labelEdge === 'none' ? label : undefined;\n const isInlineDensity =\n userAssistanceDensity === 'efficient' || userAssistanceDensity === 'reflow';\n\n const inlineUserAssistance = isInlineDensity ? (\n isDisabled || isReadonly ? (\n // save space for user assistance if density is 'efficient', even though we don't\n // render user assistance for disabled or readonly fields\n userAssistanceDensity !== 'efficient' ? undefined : (\n <InlineUserAssistance\n userAssistanceDensity={userAssistanceDensity}\n {...userAssistanceProps}\n />\n )\n ) : (\n <InlineUserAssistance\n assistiveText={assistiveText}\n fieldLabel={label}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n messages={messages}\n isRequiredShown={isRequiredShown}\n userAssistanceDensity={userAssistanceDensity}\n {...userAssistanceProps}\n />\n )\n ) : undefined;\n\n const aRef = useRef<HTMLDivElement>(null);\n const anchorRef = mainFieldRef ?? aRef;\n\n const compactUserAssistance =\n userAssistanceDensity === 'compact' ? (\n <CompactUserAssistance\n anchorRef={anchorRef}\n messages={messages}\n assistiveText={assistiveText}\n {...userAssistanceProps}\n />\n ) : undefined;\n\n const mainContent = isReadonly ? (\n <ReadonlyTextFieldInput\n aria-describedby={inputProps['aria-describedby']}\n aria-label={ariaLabel}\n aria-labelledby={labelProps.id}\n as=\"div\"\n elementRef={readonlyElementRef}\n textAlign={textAlign}\n value={colorValue}\n hasEmptyLabel={label === '' && labelEdge === 'none'}\n hasInsideLabel={hasInsideLabel}\n />\n ) : (\n <TextFieldInput\n aria-labelledby={labelProps.id}\n aria-label={ariaLabel}\n autoComplete={autoComplete}\n currentCommitValue={currentCommitValue}\n hasEmptyLabel={label === '' && labelEdge === 'none'}\n hasEndContent={false}\n hasInsideLabel={labelComp !== undefined && labelEdge === 'inside'}\n hasStartContent={true}\n inputRef={enabledElementRef}\n isRequired={isRequired}\n placeholder={placeholder}\n textAlign={textAlign}\n type={isMobile() ? 'text' : undefined}\n value={colorValue}\n onCommit={\n onCommitAndDispatch as (detail: ValueUpdateDetail<string>) => {\n value: string;\n }\n }\n onInput={\n onInputAndDispatch as (detail: ValueUpdateDetail<string>) => {\n value: string;\n }\n }\n onKeyDown={onKeyDown}\n {...inputProps}\n />\n );\n\n return (\n <>\n <FormFieldContext.Provider value={formFieldContext}>\n {isReadonly ? (\n <ReadonlyTextField\n role=\"presentation\"\n columnSpan={columnSpan}\n compactUserAssistance={compactUserAssistance}\n inlineUserAssistance={inlineUserAssistance}\n onBlur={focusProps.onFocusOut}\n onFocus={focusProps.onFocusIn}\n ref={anchorRef}\n mainContent={mainContent}\n testId={testId}\n {...fieldLabelProps}></ReadonlyTextField>\n ) : (\n <TextField\n endContent={maybeClearIcon}\n columnSpan={columnSpan}\n compactUserAssistance={compactUserAssistance}\n inlineUserAssistance={inlineUserAssistance}\n mainContent={mainContent}\n onBlur={focusProps.onFocusOut}\n onFocus={focusProps.onFocusIn}\n startContent={startContent()}\n mainFieldRef={anchorRef}\n hasZeroStartMargin={true}\n testId={testId}\n {...textFieldProps}\n {...fieldLabelProps}\n {...hoverProps}\n {...inputContainerAriaProps}\n />\n )}\n </FormFieldContext.Provider>\n\n {isOpen && !isReadonly && !isDisabled && (\n <InputColorPickerDropdown\n anchorRef={mainFieldRef}\n assistiveText={assistiveText}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n isDisabled={isDisabled}\n isReadonly={isReadonly}\n isOpen={isOpen}\n label={label}\n onClose={dropdownCloseHandler}\n onCommit={colorPickerCommitHandler}\n messages={messages}\n testId={testId ? testId + '_colorPicker' : undefined}\n userAssistanceDensity={userAssistanceDensity}\n // memoize this for performance\n value={colorValue && isValidColorValue(colorValue) ? colorValue : undefined}\n palette={palette}\n swatchSize={swatchSize}\n />\n )}\n </>\n );\n }\n);\n\n/**\n * Helper function to determine whether the current device is a mobile device\n * @returns true if running on a mobile device, false otherwise\n */\nfunction isMobile() {\n const deviceType = getClientHints().deviceType;\n return deviceType === 'phone' || deviceType === 'tablet';\n}\nInputColor.displayName = 'InputColor';\n"],"names":["InputColorPickerDropdown","anchorRef","assistiveText","swatchSize","palette","helpSourceLink","helpSourceText","isDisabled","isOpen","isReadonly","label","onClose","onCommit","messages","testId","userAssistanceDensity","value","isDropdownAbove","setDropdownAbove","useState","prevIsOpen","setPrevIsOpen","handleDropdownPosition","useCallback","data","placement","startsWith","shouldShowSheet","isPhone","colorPicker_label","useTranslationBundle","colorPickerAriaLabel","colorPickerMainContent","_jsx","ColorPicker","height","undefined","maxWidth","width","inlineUserAssistanceFooter","length","FormFieldContext","Provider","isFocused","children","jsx","class","userAssistanceStyles","InlineUserAssistance","fieldLabel","contentTestId","dropdownContent","dropdownStyles","SectionedContent","paddingBlockEnd","paddingBlockStart","paddingInlineEnd","paddingInlineStart","footer","hasFocusTrap","main","role","Sheet","StickyPositioningDropdown","onPosition","sizeOptions","isMaxWidthAdjusted","isMaxHeightAdjusted","getClientHints","deviceType","inputColorReducer","state","action","type","colorValue","useInputColor","onInput","currentValue","setIsOpen","iconRef","useRef","colorRef","outsideMousedownRef","outsideMousedownTimerRef","lastCommittedColorRef","lastColorRef","lastValueFromParentRef","colorSelectedRef","dispatch","useReducer","useInputColorState","colorsAreDifferent","current","useEffect","previousValue","colorInputHandler","detail","colorCommitHandler","colorIconActionHandler","dropdownCloseHandler","reason","clearTimeout","setTimeout","focus","colorPickerCommitHandler","colorPickerDownHandler","triggerProps","containerDropdownProps","useDownToggle","onToggle","InputColor","forwardRef","ariaDescribedBy","propIsDisabled","propIsReadonly","labelEdge","propLabelEdge","labelStartWidth","propLabelStartWidth","isRequiredShown","isRequired","placeholder","hasClearIcon","columnSpan","textAlign","propTextAlign","autoComplete","variant","propUserAssistanceDensity","ref","enabledElementRef","mainFieldRef","inputColor_selectColor","colorIconAriaLabel","onKeyDown","inputContainerAriaProps","currentCommitValue","useCurrentValueReducer","onInputAndDispatch","payload","onCommitAndDispatch","isFormDisabled","isFormReadonly","formLabelEdge","formLabelStartWidth","formTextAlign","formUserAssistanceDensity","useFormContext","readonlyElementRef","focusProps","methods","focusMethods","useFocusableTextField","selectMethods","useSelectableTextField","useImperativeHandle","mergeProps","hoverProps","isHover","useHover","formFieldContext","inputProps","labelProps","textFieldProps","userAssistanceProps","useTextField","styleVariant","onClickClearIcon","nextValue","maybeClearIcon","useClearIcon","clearIcon","ClearIcon","onClick","display","hasValue","isEnabled","hasInsideLabel","labelComp","Label","fieldLabelProps","ariaLabel","inlineUserAssistance","aRef","compactUserAssistance","CompactUserAssistance","mainContent","ReadonlyTextFieldInput","id","as","elementRef","hasEmptyLabel","TextFieldInput","hasEndContent","hasStartContent","inputRef","isMobile","_jsxs","ReadonlyTextField","onBlur","onFocusOut","onFocus","onFocusIn","TextField","endContent","startContent","ColorSwatch","size","isButton","isTooltipDisabled","hasZeroStartMargin","isValidColorValue","displayName"],"mappings":"ixFAwEA,MAAMA,GAA2B,EAC/BC,YACAC,gBACAC,aACAC,UACAC,iBACAC,iBACAC,aACAC,SACAC,aACAC,QACAC,UACAC,WACAC,WACAC,SACAC,wBACAC,YAGA,MAAOC,EAAiBC,GAAoBC,EAAQA,UAAC,IAC9CC,EAAYC,GAAiBF,EAAQA,SAACX,GACvCc,EAAyBC,eAE5BC,IACDN,EAAiBM,EAAKC,UAAUC,WAAW,OAAO,GACjD,IAECN,IAAeZ,IACjBa,EAAcb,GACTA,GACHU,GAAiB,IAIrB,MAMMS,EAAkBC,MAElBC,kBAAEA,GAAsBC,EAAoBA,qBAAa,4BACzDC,EAAuBF,IAEvBG,EACJC,MAACC,EAAAA,YACC,CAAAC,OAASR,OAA2BS,EAAT,OAC3BxB,SAAUA,EAEVyB,SAAUV,EAAkB,YAASS,EACrCE,MAAM,OACNnC,WAAYA,EACZC,QAASA,EACTU,OAAQA,EACRE,MAAOA,IAILuB,GACJ/B,GACES,IAAmBU,GACpBpB,GACAE,KACAP,GAAiBG,GAAmBQ,GAAYA,EAAS2B,OAAS,IACxC,cAA1BzB,GAAmE,WAA1BA,OAatCqB,EAZFH,MAACQ,EAAAA,iBAAiBC,SAAQ,CAAC1B,MAAO,CAAE2B,WAAW,GAAMC,SACnDX,EAAKY,IAAA,MAAA,CAAAC,MAAOC,gCACVd,EAAAA,IAACe,EAAAA,qBACC,CAAA9C,cAAeA,EACf+C,WAAYvC,EACZL,eAAgBA,EAChBC,eAAgBA,EAChBO,SAAUA,EACVE,sBAAuBA,QAM3BmC,EAAgBpC,EAASA,GAAUa,EAAkB,SAAW,kBAAeS,EAI/Ee,EACJlB,EAAAA,IAAA,MAAA,CAAKa,MAAOM,EAAcA,eACxBR,SAAAX,EAAAY,IAACQ,EAAgBA,iBAAA,CACfC,gBAAgB,OAChBC,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yI,EAAAA,kBAAkBzI,GAAcA,OAAatC,EAClEhC,QAASA,EACTD,WAAYA,MAIlB,IAQN,SAASiM,KACP,MAAM/H,EAAaD,mBAAiBC,WACpC,MAAsB,UAAfA,GAAyC,WAAfA,CACnC,CACAyC,GAAWsG,YAAc"}
|
|
1
|
+
{"version":3,"file":"InputColor-51d7e40c.js","sources":["../../src/UNSAFE_InputColor/InputColorPickerDropdown.tsx","../../src/UNSAFE_InputColor/useInputColorState.ts","../../src/UNSAFE_InputColor/useInputColor.ts","../../src/UNSAFE_InputColor/InputColor.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 { ColorPicker } from '#UNSAFE_ColorPicker';\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 { dropdownStyles, userAssistanceStyles } from './themes/InputColorPickerDropdownStyles.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';\nimport { InputColorPublicProps as InputColorProps } from './InputColor.types';\n\ntype StickyPositioningDropdownProps = ComponentProps<typeof StickyPositioningDropdown>;\ntype ColorPickerProps = ComponentProps<typeof ColorPicker>;\ntype PickedPropsFromColorPicker = Pick<ColorPickerProps, 'value' | 'onCommit'>;\ntype PickedPropsFromDropdown = Omit<StickyPositioningDropdownProps, 'onClose'>;\ntype CloseDetail = SheetCloseDetail | DropdownCloseDetail;\ntype PickedPropsFromInputColor = Pick<\n InputColorProps,\n | 'swatchSize'\n | 'palette'\n | 'value'\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 Props = PickedPropsFromColorPicker &\n PickedPropsFromInputColor &\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 ColorPicker either inside a dropdown or sheet; in mobile,\n * 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 InputColorPickerDropdown = ({\n anchorRef,\n assistiveText,\n swatchSize,\n palette,\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isOpen,\n isReadonly,\n label,\n onClose,\n onCommit,\n messages,\n testId,\n userAssistanceDensity,\n value\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 { colorPicker_label } = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const colorPickerAriaLabel = colorPicker_label();\n\n const colorPickerMainContent = (\n <ColorPicker\n height={!shouldShowSheet ? 'auto' : undefined}\n onCommit={onCommit}\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 swatchSize={swatchSize}\n palette={palette}\n testId={testId}\n value={value}\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: color 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 paddingBlockEnd=\"3.5x\"\n paddingBlockStart=\"3.5x\"\n paddingInlineEnd=\"3.5x\"\n paddingInlineStart=\"3.5x\"\n aria-label={colorPickerAriaLabel}\n footer={inlineUserAssistanceFooter}\n hasFocusTrap={true}\n main={colorPickerMainContent}\n role=\"dialog\"\n testId={contentTestId}\n />\n </div>\n );\n\n const dropdown = shouldShowSheet ? (\n <Sheet isOpen={isOpen} onClose={onClose}>\n <SectionedContent\n aria-label={colorPickerAriaLabel}\n footer={inlineUserAssistanceFooter}\n hasFocusTrap={true}\n main={colorPickerMainContent}\n role=\"dialog\"\n testId={contentTestId}\n />\n </Sheet>\n ) : (\n <StickyPositioningDropdown\n anchorRef={anchorRef}\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 { InputColorPickerDropdown, 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 ColorValue } from '#utils/UNSAFE_color';\n\ntype InputColorState = {\n /**\n * Represents the current color value of the component. The user either selected\n * the color in the picker, or typed it into the color field.\n */\n colorValue?: ColorValue;\n};\n\ntype ColorChangedAction = { type: 'colorChanged'; data?: ColorValue };\ntype ColorResetAction = { type: 'reset'; data?: ColorValue };\ntype ColorSelectedAction = { type: 'colorSelected'; data?: ColorValue };\ntype InputColorReducerAction = ColorChangedAction | ColorResetAction | ColorSelectedAction;\n\n// Use a reducer function to manage InputColorState.\nconst inputColorReducer = (\n state: InputColorState,\n action: InputColorReducerAction\n): InputColorState => {\n switch (action.type) {\n case 'colorChanged': {\n return {\n ...state,\n colorValue: action.data\n };\n }\n case 'colorSelected': {\n return { ...state, colorValue: action.data };\n }\n case 'reset': {\n return {\n colorValue: action.data\n };\n }\n default:\n return state;\n }\n};\n\ntype Props = {\n /**\n * The value of the InputColor, or undefined.\n */\n value?: ColorValue;\n};\n\n/**\n * useInputColorState calls useReducer to determine the initial state. Any changes to that state\n * are managed by dispatching actions to the reducer function.\n */\nconst useInputColorState = ({ value }: Props) => {\n const [state, dispatch] = useReducer(inputColorReducer, {\n colorValue: value\n });\n\n return { state, dispatch };\n};\n\nexport { useInputColorState };\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 { useCallback, useEffect, useRef, useState } from 'preact/hooks';\nimport { ElementRef } from 'preact/compat';\nimport { colorsAreDifferent, type ColorValue } from '#utils/UNSAFE_color';\nimport { ColorPicker } from '#UNSAFE_ColorPicker';\nimport { ColorSwatch } from '#UNSAFE_ColorSwatch';\nimport { CloseDetail, InputColorPickerDropdown } from './InputColorPickerDropdown';\nimport { useInputColorState } from './useInputColorState';\nimport type { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\nimport { useDownToggle } from '#hooks/UNSAFE_useDownToggle';\nimport { InputColorPublicProps as InputColorProps } from './InputColor.types';\n\ntype SwatchHandle = ElementRef<typeof ColorSwatch>;\n\ntype ColorPickerProps = ComponentProps<typeof ColorPicker>;\ntype ColorSwatchProps = ComponentProps<typeof ColorSwatch>;\ntype DropdownProps = ComponentProps<typeof InputColorPickerDropdown>;\n\ntype Props = {\n onCommit: InputColorProps['onCommit'];\n onInput: InputColorProps['onInput'];\n value: InputColorProps['value'];\n};\n\n/**\n * Hook that provides handlers and other functionality for InputColor.\n */\nconst useInputColor = ({ onCommit, onInput, value: currentValue }: Props) => {\n // Whether the dropdown is open.\n const [isOpen, setIsOpen] = useState<boolean>(false);\n\n // Ref to the swatch icon button.\n const iconRef: RefObject<SwatchHandle> = useRef<SwatchHandle>(null);\n\n // Ref to the text input which holds color value\n const colorRef: RefObject<HTMLInputElement> = useRef<HTMLInputElement>(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 color values passed to onInput and onCommit.\n const lastCommittedColorRef = useRef<ColorValue | undefined>(currentValue);\n const lastColorRef = useRef<ColorValue | 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<ColorValue | undefined>(currentValue);\n\n // Keep track of whether a color was selected in the color picker.\n const colorSelectedRef = useRef<boolean>(false);\n\n const { state, dispatch } = useInputColorState({ 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 (colorsAreDifferent(lastValueFromParentRef.current, currentValue)) {\n lastValueFromParentRef.current = currentValue;\n if (colorsAreDifferent(currentValue, state.colorValue)) {\n dispatch({ type: 'reset', data: currentValue });\n lastColorRef.current = currentValue;\n lastCommittedColorRef.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 (colorsAreDifferent(state.colorValue, lastColorRef.current)) {\n onInput({ previousValue: lastColorRef.current, value: state.colorValue });\n lastColorRef.current = state.colorValue;\n }\n if (\n colorSelectedRef.current &&\n colorsAreDifferent(state.colorValue, lastCommittedColorRef.current)\n ) {\n onCommit?.({ previousValue: lastCommittedColorRef.current, value: state.colorValue });\n lastCommittedColorRef.current = state.colorValue;\n colorSelectedRef.current = false;\n }\n }, [onCommit, onInput, state.colorValue]);\n\n // Handle onInput from InputColor as values are entered in the input field.\n // We wait for the state to update before calling onInput.\n const colorInputHandler = useCallback<InputColorProps['onInput']>(\n (detail: ValueUpdateDetail<ColorValue>) => {\n dispatch({ type: 'colorChanged', data: detail.value });\n },\n [dispatch]\n );\n\n // Handle onCommit from InputColor, which is called when the user presses Enter or the field is blurred.\n const colorCommitHandler = useCallback<NonNullable<InputColorProps['onCommit']>>(() => {\n // If the current color value differs from the last committed value, then call onCommit.\n if (colorsAreDifferent(lastCommittedColorRef.current, state.colorValue)) {\n onCommit?.({ value: state.colorValue, previousValue: lastCommittedColorRef.current });\n lastCommittedColorRef.current = state.colorValue;\n }\n }, [onCommit, state.colorValue]);\n\n // Respond to onAction event from the swatch icon button. Toggles the color picker dropdown.\n const colorIconActionHandler = useCallback<NonNullable<ColorSwatchProps['onToggle']>>(() => {\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 swatch 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 swatch icon when the dropdown is closed.\n iconRef.current?.focus();\n }\n setIsOpen(false);\n },\n []\n );\n\n // Handle color selection in the picker.\n // - Updates the value in state.\n // - Closes the dropdown.\n // - Sets focus to the color field.\n const colorPickerCommitHandler = useCallback<ColorPickerProps['onCommit']>(\n (detail: ValueUpdateDetail<ColorValue>) => {\n // Set focus to the swatch when a color is selected.\n iconRef.current?.focus();\n\n // Set a ref indicating a color was selected.\n colorSelectedRef.current = true;\n dispatch({ type: 'colorSelected', data: detail.value });\n setIsOpen(false);\n },\n [dispatch]\n );\n\n // The Redwood UX design calls for the dropdown to open when the down arrow is pressed.\n // Handle opening the dropdown when the down arrow is pressed in the text edit field.\n const colorPickerDownHandler = useCallback(() => {\n setIsOpen(true);\n }, []);\n\n const { triggerProps: containerDropdownProps } = useDownToggle({\n isOpen,\n onToggle: colorPickerDownHandler\n });\n\n return {\n colorIconActionHandler,\n colorPickerCommitHandler,\n dropdownCloseHandler,\n containerDropdownProps,\n colorValue: state.colorValue,\n iconRef,\n isOpen,\n colorCommitHandler,\n colorInputHandler,\n colorRef\n };\n};\n\nexport { useInputColor };\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 { Ref } from 'preact';\nimport { forwardRef, ElementRef } from 'preact/compat';\nimport { useCallback, useImperativeHandle, useRef } from 'preact/hooks';\nimport { type BundleType } from '../resources/nls/bundle';\nimport { type ColorValue, isValidColorValue } from '#utils/UNSAFE_color';\nimport { InputColorPickerDropdown } from './InputColorPickerDropdown';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\nimport { ColorSwatch } from '#UNSAFE_ColorSwatch';\nimport { useInputColor } from './useInputColor';\n\nimport { useClearIcon } from '../hooks/UNSAFE_useClearIcon';\nimport { FocusableHandle, useFocusableTextField } from '../hooks/UNSAFE_useFocusableTextField';\nimport { useFormContext } from '../hooks/UNSAFE_useFormContext';\nimport { FormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { useHover } from '../hooks/UNSAFE_useHover';\nimport { useTextField } from '../hooks/UNSAFE_useTextField';\nimport { Label } from '../UNSAFE_Label';\n\nimport {\n ReadonlyTextField,\n ReadonlyTextFieldInput,\n TextField,\n TextFieldInput\n} from '../UNSAFE_TextField';\nimport { CompactUserAssistance, InlineUserAssistance } from '../UNSAFE_UserAssistance';\nimport { getClientHints } from '../utils/PRIVATE_clientHints';\nimport { ClearIcon } from '../PRIVATE_ClearIcon/ClearIcon';\nimport { useCurrentValueReducer } from '../hooks/UNSAFE_useCurrentValueReducer';\nimport { SelectableHandle, useSelectableTextField } from '#hooks/UNSAFE_useSelectableTextField';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\nimport { InputColorPublicProps as Props } from './InputColor.types';\n\ntype SwatchHandle = ElementRef<typeof ColorSwatch>;\n\ntype FocusSelectHandle = FocusableHandle & SelectableHandle;\n\n/**\n * An Input Color is a form field that allows users to select or input a color value,\n * using a color picker or by enterihg a HEX code.\n */\nexport const InputColor = forwardRef(\n (\n {\n 'aria-describedby': ariaDescribedBy,\n swatchSize,\n palette,\n value,\n isDisabled: propIsDisabled,\n isReadonly: propIsReadonly,\n labelEdge: propLabelEdge,\n labelStartWidth: propLabelStartWidth,\n isRequiredShown = false,\n isRequired = false,\n placeholder,\n hasClearIcon,\n columnSpan,\n textAlign: propTextAlign,\n autoComplete,\n messages,\n assistiveText,\n helpSourceLink,\n helpSourceText,\n label,\n onCommit,\n onInput,\n testId,\n variant,\n userAssistanceDensity: propUserAssistanceDensity\n }: Props,\n ref?: Ref<FocusSelectHandle>\n ) => {\n const {\n colorIconActionHandler,\n colorPickerCommitHandler,\n dropdownCloseHandler,\n colorValue,\n containerDropdownProps,\n iconRef,\n isOpen,\n colorCommitHandler,\n colorInputHandler,\n colorRef: enabledElementRef\n } = useInputColor({\n onCommit,\n onInput,\n value\n });\n\n const mainFieldRef = useRef<HTMLDivElement>(null);\n const { inputColor_selectColor } = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const colorIconAriaLabel = inputColor_selectColor();\n const { onKeyDown, ...inputContainerAriaProps } = containerDropdownProps;\n\n const { currentCommitValue, dispatch } = useCurrentValueReducer({ value: colorValue });\n const onInputAndDispatch = useCallback(\n (detail: ValueUpdateDetail<ColorValue>) => {\n // Should dispatch happen first? This will queue up a re-render, ordering should not cause issues (this is async)\n dispatch({ type: 'input', payload: detail.value });\n colorInputHandler?.(detail);\n },\n [colorInputHandler, dispatch]\n );\n const onCommitAndDispatch = useCallback(\n (detail: ValueUpdateDetail<ColorValue>) => {\n // Should dispatch happen first? This will queue up a re-render, ordering should not cause issues (this is async)\n dispatch({ type: 'commit', payload: detail.value });\n colorCommitHandler?.(detail);\n },\n [colorCommitHandler, dispatch]\n );\n\n const startContent = () => (\n <ColorSwatch\n size=\"xs\"\n aria-haspopup={palette ? 'grid' : undefined} // with only palette, grid is a better choice than dialog for now.\n aria-label={palette ? colorIconAriaLabel : undefined}\n isDisabled={isDisabled}\n isButton={true}\n isTooltipDisabled={isOpen}\n ref={iconRef as Ref<SwatchHandle>}\n testId={testId ? testId + '_colorIcon' : undefined}\n value={currentCommitValue as ColorValue}\n onToggle={isDisabled || !palette ? undefined : colorIconActionHandler}\n />\n );\n const {\n isDisabled: isFormDisabled,\n isReadonly: isFormReadonly,\n labelEdge: formLabelEdge,\n labelStartWidth: formLabelStartWidth,\n textAlign: formTextAlign,\n userAssistanceDensity: formUserAssistanceDensity\n } = useFormContext();\n // default to FormContext values if component properties are not specified\n const isDisabled = propIsDisabled ?? isFormDisabled;\n const isReadonly = propIsReadonly ?? isFormReadonly;\n const labelEdge = propLabelEdge ?? formLabelEdge;\n const labelStartWidth = propLabelStartWidth ?? formLabelStartWidth;\n const textAlign = propTextAlign ?? formTextAlign;\n const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;\n\n const readonlyElementRef = useRef<HTMLDivElement>(null);\n\n const {\n focusProps,\n isFocused,\n methods: focusMethods\n } = useFocusableTextField<HTMLInputElement, HTMLDivElement>({\n isDisabled,\n isReadonly,\n enabledElementRef,\n readonlyElementRef\n });\n\n const { methods: selectMethods } = useSelectableTextField<HTMLInputElement>(enabledElementRef);\n\n useImperativeHandle(ref!, () => mergeProps(focusMethods, selectMethods), [\n focusMethods,\n selectMethods\n ]);\n\n const { hoverProps, isHover } = useHover({ isDisabled: isReadonly || isDisabled || false });\n\n const { formFieldContext, inputProps, labelProps, textFieldProps, userAssistanceProps } =\n useTextField({\n ariaDescribedBy,\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isFocused: isFocused || isOpen,\n isReadonly,\n isRequiredShown,\n labelEdge,\n messages,\n styleVariant: variant,\n userAssistanceDensity,\n value: colorValue\n });\n\n const onClickClearIcon = useCallback(() => {\n // Clicking the clear icon should put the focus on the input field\n enabledElementRef.current?.focus();\n // Send an event to clear the field's value if the value is not already cleared\n const nextValue = undefined;\n if (colorValue === nextValue) return;\n onInputAndDispatch?.({ previousValue: colorValue, value: nextValue });\n }, [onInputAndDispatch, colorValue, enabledElementRef]);\n\n const maybeClearIcon = useClearIcon({\n clearIcon: <ClearIcon onClick={onClickClearIcon} testId={`${testId}_clearicon`} />,\n display: hasClearIcon,\n hasValue: formFieldContext.hasValue,\n isFocused,\n isEnabled: !isReadonly && !isDisabled,\n isHover\n });\n\n const hasInsideLabel = label !== undefined && labelEdge === 'inside';\n\n const labelComp = labelEdge !== 'none' ? <Label {...labelProps}>{label}</Label> : undefined;\n\n const fieldLabelProps = {\n label: labelEdge !== 'none' ? labelComp : undefined,\n labelEdge: labelEdge !== 'none' ? labelEdge : undefined,\n labelStartWidth: labelEdge !== 'none' ? labelStartWidth : undefined\n };\n\n const ariaLabel = labelEdge === 'none' ? label : undefined;\n const isInlineDensity =\n userAssistanceDensity === 'efficient' || userAssistanceDensity === 'reflow';\n\n const inlineUserAssistance = isInlineDensity ? (\n isDisabled || isReadonly ? (\n // save space for user assistance if density is 'efficient', even though we don't\n // render user assistance for disabled or readonly fields\n userAssistanceDensity !== 'efficient' ? undefined : (\n <InlineUserAssistance\n userAssistanceDensity={userAssistanceDensity}\n {...userAssistanceProps}\n />\n )\n ) : (\n <InlineUserAssistance\n assistiveText={assistiveText}\n fieldLabel={label}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n messages={messages}\n isRequiredShown={isRequiredShown}\n userAssistanceDensity={userAssistanceDensity}\n {...userAssistanceProps}\n />\n )\n ) : undefined;\n\n const aRef = useRef<HTMLDivElement>(null);\n const anchorRef = mainFieldRef ?? aRef;\n\n const compactUserAssistance =\n userAssistanceDensity === 'compact' ? (\n <CompactUserAssistance\n anchorRef={anchorRef}\n messages={messages}\n assistiveText={assistiveText}\n {...userAssistanceProps}\n />\n ) : undefined;\n\n const mainContent = isReadonly ? (\n <ReadonlyTextFieldInput\n aria-describedby={inputProps['aria-describedby']}\n aria-label={ariaLabel}\n aria-labelledby={labelProps.id}\n as=\"div\"\n elementRef={readonlyElementRef}\n textAlign={textAlign}\n value={colorValue}\n hasEmptyLabel={label === '' && labelEdge === 'none'}\n hasInsideLabel={hasInsideLabel}\n />\n ) : (\n <TextFieldInput\n aria-labelledby={labelProps.id}\n aria-label={ariaLabel}\n autoComplete={autoComplete}\n currentCommitValue={currentCommitValue}\n hasEmptyLabel={label === '' && labelEdge === 'none'}\n hasEndContent={false}\n hasInsideLabel={labelComp !== undefined && labelEdge === 'inside'}\n hasStartContent={true}\n inputRef={enabledElementRef}\n isRequired={isRequired}\n placeholder={placeholder}\n textAlign={textAlign}\n type={isMobile() ? 'text' : undefined}\n value={colorValue}\n onCommit={\n onCommitAndDispatch as (detail: ValueUpdateDetail<string>) => {\n value: string;\n }\n }\n onInput={\n onInputAndDispatch as (detail: ValueUpdateDetail<string>) => {\n value: string;\n }\n }\n onKeyDown={onKeyDown}\n {...inputProps}\n />\n );\n\n return (\n <>\n <FormFieldContext.Provider value={formFieldContext}>\n {isReadonly ? (\n <ReadonlyTextField\n role=\"presentation\"\n columnSpan={columnSpan}\n compactUserAssistance={compactUserAssistance}\n inlineUserAssistance={inlineUserAssistance}\n onBlur={focusProps.onFocusOut}\n onFocus={focusProps.onFocusIn}\n ref={anchorRef}\n mainContent={mainContent}\n testId={testId}\n {...fieldLabelProps}></ReadonlyTextField>\n ) : (\n <TextField\n endContent={maybeClearIcon}\n columnSpan={columnSpan}\n compactUserAssistance={compactUserAssistance}\n inlineUserAssistance={inlineUserAssistance}\n mainContent={mainContent}\n onBlur={focusProps.onFocusOut}\n onFocus={focusProps.onFocusIn}\n startContent={startContent()}\n mainFieldRef={anchorRef}\n hasZeroStartMargin={true}\n testId={testId}\n {...textFieldProps}\n {...fieldLabelProps}\n {...hoverProps}\n {...inputContainerAriaProps}\n />\n )}\n </FormFieldContext.Provider>\n\n {isOpen && !isReadonly && !isDisabled && (\n <InputColorPickerDropdown\n anchorRef={mainFieldRef}\n assistiveText={assistiveText}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n isDisabled={isDisabled}\n isReadonly={isReadonly}\n isOpen={isOpen}\n label={label}\n onClose={dropdownCloseHandler}\n onCommit={colorPickerCommitHandler}\n messages={messages}\n testId={testId ? testId + '_colorPicker' : undefined}\n userAssistanceDensity={userAssistanceDensity}\n // memoize this for performance\n value={colorValue && isValidColorValue(colorValue) ? colorValue : undefined}\n palette={palette}\n swatchSize={swatchSize}\n />\n )}\n </>\n );\n }\n);\n\n/**\n * Helper function to determine whether the current device is a mobile device\n * @returns true if running on a mobile device, false otherwise\n */\nfunction isMobile() {\n const deviceType = getClientHints().deviceType;\n return deviceType === 'phone' || deviceType === 'tablet';\n}\nInputColor.displayName = 'InputColor';\n"],"names":["InputColorPickerDropdown","anchorRef","assistiveText","swatchSize","palette","helpSourceLink","helpSourceText","isDisabled","isOpen","isReadonly","label","onClose","onCommit","messages","testId","userAssistanceDensity","value","isDropdownAbove","setDropdownAbove","useState","prevIsOpen","setPrevIsOpen","handleDropdownPosition","useCallback","data","placement","startsWith","shouldShowSheet","isPhone","colorPicker_label","useTranslationBundle","colorPickerAriaLabel","colorPickerMainContent","_jsx","ColorPicker","height","undefined","maxWidth","width","inlineUserAssistanceFooter","length","FormFieldContext","Provider","isFocused","children","jsx","class","userAssistanceStyles","InlineUserAssistance","fieldLabel","contentTestId","dropdownContent","dropdownStyles","SectionedContent","paddingBlockEnd","paddingBlockStart","paddingInlineEnd","paddingInlineStart","footer","hasFocusTrap","main","role","Sheet","StickyPositioningDropdown","onPosition","sizeOptions","isMaxWidthAdjusted","isMaxHeightAdjusted","getClientHints","deviceType","inputColorReducer","state","action","type","colorValue","useInputColor","onInput","currentValue","setIsOpen","iconRef","useRef","colorRef","outsideMousedownRef","outsideMousedownTimerRef","lastCommittedColorRef","lastColorRef","lastValueFromParentRef","colorSelectedRef","dispatch","useReducer","useInputColorState","colorsAreDifferent","current","useEffect","previousValue","colorInputHandler","detail","colorCommitHandler","colorIconActionHandler","dropdownCloseHandler","reason","clearTimeout","setTimeout","focus","colorPickerCommitHandler","colorPickerDownHandler","triggerProps","containerDropdownProps","useDownToggle","onToggle","InputColor","forwardRef","ariaDescribedBy","propIsDisabled","propIsReadonly","labelEdge","propLabelEdge","labelStartWidth","propLabelStartWidth","isRequiredShown","isRequired","placeholder","hasClearIcon","columnSpan","textAlign","propTextAlign","autoComplete","variant","propUserAssistanceDensity","ref","enabledElementRef","mainFieldRef","inputColor_selectColor","colorIconAriaLabel","onKeyDown","inputContainerAriaProps","currentCommitValue","useCurrentValueReducer","onInputAndDispatch","payload","onCommitAndDispatch","isFormDisabled","isFormReadonly","formLabelEdge","formLabelStartWidth","formTextAlign","formUserAssistanceDensity","useFormContext","readonlyElementRef","focusProps","methods","focusMethods","useFocusableTextField","selectMethods","useSelectableTextField","useImperativeHandle","mergeProps","hoverProps","isHover","useHover","formFieldContext","inputProps","labelProps","textFieldProps","userAssistanceProps","useTextField","styleVariant","onClickClearIcon","nextValue","maybeClearIcon","useClearIcon","clearIcon","ClearIcon","onClick","display","hasValue","isEnabled","hasInsideLabel","labelComp","Label","fieldLabelProps","ariaLabel","inlineUserAssistance","aRef","compactUserAssistance","CompactUserAssistance","mainContent","ReadonlyTextFieldInput","id","as","elementRef","hasEmptyLabel","TextFieldInput","hasEndContent","hasStartContent","inputRef","isMobile","_jsxs","ReadonlyTextField","onBlur","onFocusOut","onFocus","onFocusIn","TextField","endContent","startContent","ColorSwatch","size","isButton","isTooltipDisabled","hasZeroStartMargin","isValidColorValue","displayName"],"mappings":"ixFAwEA,MAAMA,GAA2B,EAC/BC,YACAC,gBACAC,aACAC,UACAC,iBACAC,iBACAC,aACAC,SACAC,aACAC,QACAC,UACAC,WACAC,WACAC,SACAC,wBACAC,YAGA,MAAOC,EAAiBC,GAAoB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'./Calendar-feffa985', './HiddenAccessible-037ef42d', './IconButton-dc1be00e', './clientHints-6d361eaa', './FormFieldContext-a024b891', './logger-0f873e29', './TabbableModeContext-a9c97640', './useTranslationBundle-e4dd341e', 'css!./UserAssistanceStyles.styles.css', 'module', './UNSAFE_UserAssistance/themes/redwood/UserAssistanceVariants.css', './InlineUserAssistance-a59440e5', './Flex-4b81b412', 'css!./MessageBannerStyles.styles.css', 'module', './UNSAFE_MessageBanner/themes/redwood/MessageBannerVariants.css', 'preact', './LayerHost-0b288129', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-2bb62284', 'css!./IconStyle.styles.css', 'css!./MessageStyles.styles.css', './MessageFormattingUtils-ea0be23e', './TransitionGroup-3b9d81b6', './MessagesContext-602a69a2', 'css!./HiddenAccessibleStyles.styles.css', 'css!./ComponentMessageStyles.styles.css', 'module', './UNSAFE_ComponentMessage/themes/redwood/ComponentMessageVariants.css', './Popup-6b57cc3e', './UNSAFE_Separator/themes/SeparatorStyles.css', 'css!./LabelStyles.styles.css', 'module', './UNSAFE_Label/themes/redwood/LabelVariants.css', './InputGroupContext-372087af', 'module', './UNSAFE_Popup/themes/redwood/PopupVariants.css', './UNSAFE_InputDatePicker/themes/InputDatePickerDropdownStyles.css', './Sheet-1d02491d', './DatePicker-
|
|
2
|
-
//# sourceMappingURL=InputDatePicker-
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact/compat', 'preact/hooks', './Calendar-feffa985', './HiddenAccessible-037ef42d', './IconButton-dc1be00e', './clientHints-6d361eaa', './FormFieldContext-a024b891', './logger-0f873e29', './TabbableModeContext-a9c97640', './useTranslationBundle-e4dd341e', 'css!./UserAssistanceStyles.styles.css', 'module', './UNSAFE_UserAssistance/themes/redwood/UserAssistanceVariants.css', './InlineUserAssistance-a59440e5', './Flex-4b81b412', 'css!./MessageBannerStyles.styles.css', 'module', './UNSAFE_MessageBanner/themes/redwood/MessageBannerVariants.css', 'preact', './LayerHost-0b288129', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-2bb62284', 'css!./IconStyle.styles.css', 'css!./MessageStyles.styles.css', './MessageFormattingUtils-ea0be23e', './TransitionGroup-3b9d81b6', './MessagesContext-602a69a2', 'css!./HiddenAccessibleStyles.styles.css', 'css!./ComponentMessageStyles.styles.css', 'module', './UNSAFE_ComponentMessage/themes/redwood/ComponentMessageVariants.css', './Popup-6b57cc3e', './UNSAFE_Separator/themes/SeparatorStyles.css', 'css!./LabelStyles.styles.css', 'module', './UNSAFE_Label/themes/redwood/LabelVariants.css', './InputGroupContext-372087af', 'module', './UNSAFE_Popup/themes/redwood/PopupVariants.css', './UNSAFE_InputDatePicker/themes/InputDatePickerDropdownStyles.css', './Sheet-1d02491d', './DatePicker-bf521b1c', './SectionedContent-74559d9d', './stringUtils-4ffd9d59', './FormContext-6b0879a0', './useFormContext-b8cbbb21', './useId-c9578d26', './getFormatParse-918996fc', './maskUtils-339ed9b6', './useHiddenTestMethod-8321d341', './calendarDateUtils-ab83f6b1', './useTestId-f4240cbd', './InputDateMask-c91323d7'], (function(e,s,t,a,n,o,r,i,l,d,c,u,m,p,h,y,b,f,C,D,v,S,k,x,A,T,g,F,I,V,P,R,w,M,U,_,j,H,B,E,N,L,O,Y,Z,W,z,G,q,J,K,Q,X,$,ee,se,te){"use strict";const ae=({anchorRef:e,assistiveText:t,dayFormatter:n,daysOutsideMonth:o,helpSourceLink:r,helpSourceText:i,isDisabled:d,isOpen:c,isReadonly:m,label:p,onClose:h,onCommit:b,max:f,messages:C,min:D,monthAndYearPicker:v,testId:S,todayButton:k,todayTimeZone:x,userAssistanceDensity:A,value:T,weekDisplay:g})=>{const[F,I]=a.useState(!1),[V,P]=a.useState(c),R=a.useCallback((e=>{I(e.placement.startsWith("top"))}),[]);V!==c&&(P(c),c||I(!1));const w=ne(),{datePicker_label:M}=u.useTranslationBundle("@oracle/oraclejet-preact"),U=M(),_=s.jsx(W.DatePicker,{dayFormatter:n,daysOutsideMonth:o,height:w?void 0:"auto",onCommit:b,max:f,min:D,maxWidth:w?"100%":void 0,width:"100%",monthAndYearPicker:v,testId:S,todayTimeZone:x,todayButton:k,value:T,weekDisplay:g}),j=!c||F&&!w||d||m||!(t||r||C&&C.length>0)||"efficient"!==A&&"reflow"!==A?void 0:s.jsx(l.FormFieldContext.Provider,{value:{isFocused:!0},children:s.jsx("div",{class:Y.userAssistanceStyles,children:s.jsx(y.InlineUserAssistance,{assistiveText:t,fieldLabel:p,helpSourceLink:r,helpSourceText:i,messages:C,userAssistanceDensity:A})})}),H=S?S+(w?"_sheet":"_dropdown"):void 0,B=s.jsx("div",{class:Y.dropdownStyles,children:s.jsx(z.SectionedContent,{"aria-label":U,footer:j,hasFocusTrap:!0,main:_,role:"dialog",testId:H})});return w?s.jsx(Z.Sheet,{initialFocus:"firstFocusable",isOpen:c,onClose:h,children:s.jsx(z.SectionedContent,{"aria-label":U,footer:j,hasFocusTrap:!0,main:_,role:"dialog",testId:H})}):s.jsx(z.StickyPositioningDropdown,{anchorRef:e,initialFocus:"firstFocusable",isOpen:c,onClose:h,onPosition:R,sizeOptions:{isMaxWidthAdjusted:!1,isMaxHeightAdjusted:!0},children:B})},ne=()=>"phone"===i.getClientHints().deviceType,oe=e=>e&&ee.isCompleteCalendarDate(e)?e:void 0,re=(e,s)=>{switch(s.type){case"dateChanged":return{...e,dateValue:s.data,completeDateValue:oe(s.data)};case"dateSelected":return{...e,dateValue:s.data,completeDateValue:s.data};case"reset":return{completeDateValue:oe(s.data),dateValue:s.data};default:return e}},ie=({isDisabled:e,isReadonly:s,onCommit:t,onInput:n,rootRef:o,value:r})=>{const[i,l]=a.useState(!1),d=a.useRef(null),c=a.useRef(null),u=a.useRef(!1),m=a.useRef(),p=a.useRef(r),h=a.useRef(r),y=a.useRef(r),b=a.useRef(!1),{state:f,dispatch:C}=(({value:e})=>{const[s,t]=a.useReducer(re,{completeDateValue:oe(e),dateValue:e});return{state:s,dispatch:t}})({value:r});X.calendarDatesAreDifferent(y.current,r)&&(y.current=r,X.calendarDatesAreDifferent(r,f.dateValue)&&(C({type:"reset",data:r}),h.current=r,p.current=r)),a.useEffect((()=>{X.calendarDatesAreDifferent(f.dateValue,h.current)&&(n({previousValue:h.current,value:f.dateValue}),h.current=f.dateValue),b.current&&X.calendarDatesAreDifferent(f.dateValue,p.current)&&(t?.({previousValue:p.current,value:f.dateValue}),p.current=f.dateValue,b.current=!1)}),[t,n,f.dateValue]);const D=a.useCallback((e=>{C({type:"dateChanged",data:e.value})}),[C]),v=a.useCallback((e=>{X.calendarDatesAreDifferent(p.current,e.value)&&(t?.({value:e.value,previousValue:p.current}),p.current=e.value)}),[t]),S=a.useCallback((()=>{u.current||l((e=>!e)),u.current=!1}),[]),k=a.useCallback((e=>{"outsideMousedown"===e.reason?(u.current=!0,clearTimeout(m.current),m.current=setTimeout((()=>{u.current=!1}),200)):"dismissed"!==e.reason&&"keyboardDismissed"!==e.reason||d.current?.focus(),l(!1)}),[]),x=a.useCallback((e=>{d.current?.focus(),b.current=!0,C({type:"dateSelected",data:e.value}),l(!1)}),[C]),A=a.useCallback((a=>s||e?Promise.reject("Component is readonly or disabled"):(n({value:a,previousValue:r}),t?.({value:a,previousValue:r}),Promise.resolve())),[r,e,s,t,n]);return $.useHiddenTestMethod({elementRef:o,method:A,name:"_changeValue"}),{calendarIconActionHandler:S,datePickerCommitHandler:x,dropdownCloseHandler:k,completeDateValue:f.completeDateValue,dateValue:f.dateValue,iconRef:d,isOpen:i,maskCommitHandler:v,maskInputHandler:D,maskRef:c}},le=t.forwardRef((({"aria-describedby":e,assistiveText:t,dayFormatter:i,daysOutsideMonth:l,helpSourceLink:d,helpSourceText:c,isDisabled:m,isReadonly:p,label:h,max:y,messages:b,min:f,monthAndYearPicker:C,todayTimeZone:D,todayButton:v,value:S,onCommit:k,onInput:x,testId:A,userAssistanceDensity:T,weekDisplay:g,...F},I)=>{const V=se.useTestId(A),P=a.useRef(null),{calendarIconActionHandler:R,datePickerCommitHandler:w,completeDateValue:M,dateValue:U,dropdownCloseHandler:_,iconRef:j,isOpen:H,maskCommitHandler:B,maskInputHandler:E,maskRef:N}=ie({isDisabled:m,isReadonly:p,onCommit:k,onInput:x,rootRef:P,value:S}),L=a.useRef(null),{inputDatePicker_selectDate:O,inputDatePicker_instruction:Y}=u.useTranslationBundle("@oracle/oraclejet-preact"),Z=O(),{userAssistanceDensity:W}=J.useFormContext(),z=T??W;a.useImperativeHandle(I,(()=>({focus:()=>{N.current?.focus()},blur:()=>{N.current?.blur()}})));const q=K.useId(),Q=Y(),X=m||p?void 0:s.jsx(o.HiddenAccessible,{id:q,isHidden:!0,children:Q}),$=m||p?e:G.l([e,q]),ee=s.jsx(r.IconButton,{"aria-haspopup":"dialog","aria-label":Z,isDisabled:m,ref:j,size:"sm",testId:A?A+"_calendarIcon":void 0,variant:"ghost",onAction:R,children:s.jsx(n.SvgCalendar,{})}),ne=H;return s.jsxs("div",{...V,ref:P,children:[s.jsx(te.InputDateMaskContext.Provider,{value:{isDropdownOpen:H,isInputDatePickerParent:!0},children:s.jsx(te.InputDateMask,{"aria-describedby":$,assistiveText:t,endContent:ee,helpSourceLink:d,helpSourceText:c,isDisabled:m,isReadonly:p,label:h,onCommit:B,onInput:E,mainFieldRef:L,messages:b,testId:A?A+"_mask":void 0,ref:N,userAssistanceDensity:T,value:U,...F})}),X,ne&&s.jsx(ae,{anchorRef:L,assistiveText:t,dayFormatter:i,daysOutsideMonth:l,helpSourceLink:d,helpSourceText:c,isDisabled:m,isReadonly:p,isOpen:H,label:h,onClose:_,onCommit:w,max:y,messages:b,min:f,monthAndYearPicker:C,testId:A?A+"_datePicker":void 0,todayTimeZone:D,todayButton:v,userAssistanceDensity:z,value:M,weekDisplay:g})]})}));e.InputDatePicker=le}));
|
|
2
|
+
//# sourceMappingURL=InputDatePicker-030e345a.js.map
|