@oracle/oraclejet-preact 20.0.1 → 20.0.2
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/CheckboxSetContext-2e486ea8.js +2 -0
- package/amd/CheckboxSetContext-2e486ea8.js.map +1 -0
- package/amd/ColorPicker-141fa49d.js +2 -0
- package/amd/{ColorPicker-e3167e4c.js.map → ColorPicker-141fa49d.js.map} +1 -1
- package/amd/ExpandableList-a9a86ad8.js +2 -0
- package/amd/{ExpandableList-233c279e.js.map → ExpandableList-a9a86ad8.js.map} +1 -1
- package/amd/{InlineSelectSingle-f4438110.js → InlineSelectSingle-7c1cc5b5.js} +2 -2
- package/amd/{InlineSelectSingle-f4438110.js.map → InlineSelectSingle-7c1cc5b5.js.map} +1 -1
- package/amd/{InputColor-51d7e40c.js → InputColor-58e3fce3.js} +2 -2
- package/amd/{InputColor-51d7e40c.js.map → InputColor-58e3fce3.js.map} +1 -1
- package/amd/InputDatePicker-7227a858.js +2 -0
- package/amd/{InputDatePicker-030e345a.js.map → InputDatePicker-7227a858.js.map} +1 -1
- package/amd/ListView-6d21e8f9.js +2 -0
- package/amd/{ListView-02a92d18.js.map → ListView-6d21e8f9.js.map} +1 -1
- package/amd/PRIVATE_SelectCommon.js +1 -1
- package/amd/{SelectMobileFieldInput-83f56b22.js → SelectMobileFieldInput-d499ef86.js} +2 -2
- package/amd/{SelectMobileFieldInput-83f56b22.js.map → SelectMobileFieldInput-d499ef86.js.map} +1 -1
- package/amd/{SelectMultiple-cb5fdd20.js → SelectMultiple-cc9bffc6.js} +2 -2
- package/amd/{SelectMultiple-cb5fdd20.js.map → SelectMultiple-cc9bffc6.js.map} +1 -1
- package/amd/{SelectSingle-02e85b6e.js → SelectSingle-2bb35b67.js} +2 -2
- package/amd/{SelectSingle-02e85b6e.js.map → SelectSingle-2bb35b67.js.map} +1 -1
- package/amd/TextArea-4a3b8b56.js +2 -0
- package/amd/TextArea-4a3b8b56.js.map +1 -0
- package/amd/TextAreaAutosize-3a13ebb2.js +2 -0
- package/amd/{TextAreaAutosize-01dfd98e.js.map → TextAreaAutosize-3a13ebb2.js.map} +1 -1
- package/amd/Theme-redwood/theme.css +94 -94
- package/amd/Theme-stable/theme.css +263 -263
- package/amd/UNSAFE_CheckboxItem.js +1 -1
- package/amd/UNSAFE_CheckboxItem.js.map +1 -1
- package/amd/UNSAFE_CheckboxSet.js +1 -1
- package/amd/UNSAFE_CheckboxSet.js.map +1 -1
- package/amd/UNSAFE_ColorPicker.js +1 -1
- package/amd/UNSAFE_ExpandableList.js +1 -1
- package/amd/UNSAFE_InlineSelectSingle.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_RichCheckboxSet.js +1 -1
- package/amd/UNSAFE_RichCheckboxSet.js.map +1 -1
- package/amd/UNSAFE_RichSelectionItem.js +1 -1
- package/amd/UNSAFE_RichSelectionItem.js.map +1 -1
- package/amd/UNSAFE_SelectMultiple.js +1 -1
- package/amd/UNSAFE_SelectSingle.js +1 -1
- package/amd/UNSAFE_TextArea.js +1 -1
- package/amd/UNSAFE_TextAreaAutosize.js +1 -1
- package/amd/UNSAFE_VirtualizedListView.js +1 -1
- package/amd/VirtualizedListView-1ae7151d.js +2 -0
- package/amd/{VirtualizedListView-a0f338c2.js.map → VirtualizedListView-1ae7151d.js.map} +1 -1
- package/amd/{useDisplayValue-e70c76d8.js → useDisplayValue-0e90bf4c.js} +2 -2
- package/amd/{useDisplayValue-e70c76d8.js.map → useDisplayValue-0e90bf4c.js.map} +1 -1
- package/amd/useSelectCommon-a02ddf3c.js +2 -0
- package/amd/useSelectCommon-a02ddf3c.js.map +1 -0
- package/amd/useTextAreaAltEnter-32272da6.js +2 -0
- package/amd/useTextAreaAltEnter-32272da6.js.map +1 -0
- package/cjs/{Chart-13a198f3.js → Chart-966da017.js} +2 -2
- package/cjs/{Chart-13a198f3.js.map → Chart-966da017.js.map} +1 -1
- package/cjs/{ColorPicker-2c99c0fb.js → ColorPicker-8f0b6000.js} +2 -2
- package/cjs/{ColorPicker-2c99c0fb.js.map → ColorPicker-8f0b6000.js.map} +1 -1
- package/cjs/{NavigationListItem-cdfd0740.js → NavigationListItem-3b9eb0fb.js} +1 -19
- package/cjs/{NavigationListItem-cdfd0740.js.map → NavigationListItem-3b9eb0fb.js.map} +1 -1
- package/cjs/{OverflowTabBarItem-4bbd5830.js → OverflowTabBarItem-abcd2327.js} +2 -2
- package/cjs/{OverflowTabBarItem-4bbd5830.js.map → OverflowTabBarItem-abcd2327.js.map} +1 -1
- package/cjs/PRIVATE_Chart.js +4 -4
- package/cjs/PRIVATE_SelectCommon.js +2 -2
- package/cjs/{SelectMobileFieldInput-111a95a5.js → SelectMobileFieldInput-cbf57541.js} +2 -2
- package/cjs/{SelectMobileFieldInput-111a95a5.js.map → SelectMobileFieldInput-cbf57541.js.map} +1 -1
- package/cjs/{TabBarLinkItem-891a5f10.js → TabBarLinkItem-b0c4b100.js} +2 -2
- package/cjs/{TabBarLinkItem-891a5f10.js.map → TabBarLinkItem-b0c4b100.js.map} +1 -1
- package/cjs/Theme-redwood/theme.css +104 -104
- package/cjs/Theme-stable/theme.css +236 -236
- package/cjs/UNSAFE_BarChart.js +4 -4
- package/cjs/UNSAFE_ColorPicker.js +25 -25
- package/cjs/UNSAFE_ComboChart.js +4 -4
- package/cjs/UNSAFE_InlineSelectSingle.js +2 -2
- package/cjs/UNSAFE_InputColor.js +2 -2
- package/cjs/UNSAFE_LineAreaChart.js +4 -4
- package/cjs/UNSAFE_NavigationList.js +12 -12
- package/cjs/UNSAFE_OverflowTabBar.js +3 -3
- package/cjs/UNSAFE_ScatterChart.js +4 -4
- package/cjs/UNSAFE_SelectMultiple.js +2 -2
- package/cjs/UNSAFE_SelectSingle.js +3 -3
- package/cjs/UNSAFE_TabBar.js +3 -3
- package/cjs/UNSAFE_TabBarCommon.js +3 -3
- package/cjs/UNSAFE_TabBarMixed.js +2 -2
- package/cjs/{useDisplayValue-60dbe1c3.js → useDisplayValue-4ace417c.js} +2 -2
- package/cjs/{useDisplayValue-60dbe1c3.js.map → useDisplayValue-4ace417c.js.map} +1 -1
- package/cjs/{useSelectCommon-b0d7feb3.js → useSelectCommon-27afecfa.js} +8 -3
- package/cjs/useSelectCommon-27afecfa.js.map +1 -0
- package/es/{BaseButton-243d200f.js → BaseButton-41068c85.js} +2 -2
- package/es/{BaseButton-243d200f.js.map → BaseButton-41068c85.js.map} +1 -1
- package/es/BaseCardView-b3d8bae0.js +6 -6
- 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-a76ecfa8.js → Button-956f51c7.js} +2 -2
- package/es/{Button-a76ecfa8.js.map → Button-956f51c7.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-3860fe60.js → Center-71a03e65.js} +2 -2
- package/es/{Center-3860fe60.js.map → Center-71a03e65.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-8c297849.js → ColorPicker-ae648c4c.js} +3 -3
- package/es/{ColorPicker-8c297849.js.map → ColorPicker-ae648c4c.js.map} +1 -1
- package/es/ColorSwatch-8339ee2f.js +4 -4
- package/es/{CompactLabelAssistance-50ff3f7e.js → CompactLabelAssistance-e2fcfcab.js} +6 -6
- package/es/{CompactLabelAssistance-50ff3f7e.js.map → CompactLabelAssistance-e2fcfcab.js.map} +1 -1
- package/es/CompactUserAssistance-6aa8894b.js +5 -5
- package/es/ComponentMessageContainer-d16c8b1f.js +4 -4
- package/es/{DatePicker-fa7d39a7.js → DatePicker-7287f0f9.js} +8 -8
- package/es/{DatePicker-fa7d39a7.js.map → DatePicker-7287f0f9.js.map} +1 -1
- package/es/DatePickerHeader-f8cf86bb.js +3 -3
- package/es/DiagramStyles.styles2.css +16 -10
- package/es/DiagramStyles.styles3.css +10 -16
- package/es/{Dialog-d1de5b06.js → Dialog-83368f52.js} +7 -7
- package/es/{Dialog-d1de5b06.js.map → Dialog-83368f52.js.map} +1 -1
- package/es/DirectionalCollapseArrowIcon-132761da.js +1 -1
- package/es/DirectionalExpandArrowIcon-5bc45cad.js +1 -1
- package/es/{Dropdown-9d9813a9.js → Dropdown-019aba37.js} +6 -6
- package/es/{Dropdown-9d9813a9.js.map → Dropdown-019aba37.js.map} +1 -1
- package/es/{EmbeddedIconButton-9f0e56b7.js → EmbeddedIconButton-46434710.js} +2 -2
- package/es/{EmbeddedIconButton-9f0e56b7.js.map → EmbeddedIconButton-46434710.js.map} +1 -1
- package/es/{EnvironmentProvider-6cf8ed37.js → EnvironmentProvider-6a0a8212.js} +3 -3
- package/es/{EnvironmentProvider-6cf8ed37.js.map → EnvironmentProvider-6a0a8212.js.map} +1 -1
- package/es/Expander-1347e769.js +1 -1
- package/es/{Flex-fc483125.js → Flex-03129963.js} +2 -2
- package/es/{Flex-fc483125.js.map → Flex-03129963.js.map} +1 -1
- package/es/{Floating-be4c0cb6.js → Floating-4a82db94.js} +4 -4
- package/es/{Floating-be4c0cb6.js.map → Floating-4a82db94.js.map} +1 -1
- package/es/{Grid-6f92d323.js → Grid-9e4b4f19.js} +2 -2
- package/es/{Grid-6f92d323.js.map → Grid-9e4b4f19.js.map} +1 -1
- package/es/GroupLoadingIndicator-19c6545a.js +1 -1
- package/es/{HighlightText-dd484ffd.js → HighlightText-0205faef.js} +2 -2
- package/es/{HighlightText-dd484ffd.js.map → HighlightText-0205faef.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-6abc7837.js → IconUserAssistance-61978211.js} +3 -3
- package/es/{IconUserAssistance-6abc7837.js.map → IconUserAssistance-61978211.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-6c27170e.js → Layer-535577b5.js} +3 -3
- package/es/{Layer-6c27170e.js.map → Layer-535577b5.js.map} +1 -1
- package/es/{LayerHost-3cf255a6.js → LayerHost-7931b424.js} +2 -2
- package/es/{LayerHost-3cf255a6.js.map → LayerHost-7931b424.js.map} +1 -1
- package/es/{LayerManager-e30fbfd6.js → LayerManager-52a26c55.js} +2 -2
- package/es/{LayerManager-e30fbfd6.js.map → LayerManager-52a26c55.js.map} +1 -1
- package/es/Link-8503aab2.js +1 -1
- package/es/List-4636ba9b.js +5 -5
- package/es/{LiveRegion-2e8830ae.js → LiveRegion-cebac18d.js} +2 -2
- package/es/{LiveRegion-2e8830ae.js.map → LiveRegion-cebac18d.js.map} +1 -1
- package/es/{MaxLengthLiveRegion-8f552ae2.js → MaxLengthLiveRegion-8099fde5.js} +3 -3
- package/es/{MaxLengthLiveRegion-8f552ae2.js.map → MaxLengthLiveRegion-8099fde5.js.map} +1 -1
- package/es/Message-510c2db8.js +2 -2
- package/es/{MessageLayer-1dbdc0b6.js → MessageLayer-2a7fdec7.js} +6 -6
- package/es/{MessageLayer-1dbdc0b6.js.map → MessageLayer-2a7fdec7.js.map} +1 -1
- package/es/MessagesManager-47000438.js +3 -3
- package/es/Modal-c0f730b8.js +3 -3
- package/es/{MonthView-4e05e712.js → MonthView-4b2b483a.js} +4 -4
- package/es/{MonthView-4e05e712.js.map → MonthView-4b2b483a.js.map} +1 -1
- package/es/NavigationListItem-340ab770.js +8 -8
- package/es/NavigationListLinkItem-e28fd846.js +5 -5
- package/es/NumberInputText-60be5757.js +6 -6
- package/es/OverflowTabBarItem-aa0ce915.js +5 -5
- package/es/PRIVATE_BaseCardView.js +22 -22
- 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 +20 -20
- 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 +7 -7
- package/es/PRIVATE_MonthYearGridView.js +7 -7
- 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 +33 -33
- package/es/PRIVATE_StyledCard.js +3 -3
- package/es/PRIVATE_StyledCheckbox.js +16 -16
- 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 +26 -26
- 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-22d51095.js → Popup-992b6c27.js} +10 -10
- package/es/{Popup-22d51095.js.map → Popup-992b6c27.js.map} +1 -1
- package/es/ProgressButtonLabelLayout-69549cf9.js +3 -3
- package/es/{ProgressCircle-bce87dad.js → ProgressCircle-46084d0b.js} +2 -2
- package/es/{ProgressCircle-bce87dad.js.map → ProgressCircle-46084d0b.js.map} +1 -1
- package/es/RadioItem-94909632.js +6 -6
- package/es/ReadonlyTextFieldInput-106ce959.js +1 -1
- package/es/{ReferenceLineArea-cc72b070.js → ReferenceLineArea-53129f72.js} +3 -3
- package/es/{ReferenceLineArea-cc72b070.js.map → ReferenceLineArea-53129f72.js.map} +1 -1
- package/es/RevealToggleIcon-2d622d8f.js +1 -1
- package/es/{SectionedContent-897e9c4e.js → SectionedContent-30e5bf98.js} +5 -5
- package/es/{SectionedContent-897e9c4e.js.map → SectionedContent-30e5bf98.js.map} +1 -1
- package/es/SelectMenuGroupContext-aa1fe822.js +6 -6
- package/es/{SelectMobileFieldInput-0a7c968c.js → SelectMobileFieldInput-345c4d45.js} +10 -10
- package/es/{SelectMobileFieldInput-0a7c968c.js.map → SelectMobileFieldInput-345c4d45.js.map} +1 -1
- package/es/{SelectorAll-3d39196b.js → SelectorAll-de7ba2e1.js} +5 -5
- package/es/{SelectorAll-3d39196b.js.map → SelectorAll-de7ba2e1.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/{StyledLabelValueLayout-bddfb884.js → StyledLabelValueLayout-bb05f474.js} +2 -2
- package/es/{StyledLabelValueLayout-bddfb884.js.map → StyledLabelValueLayout-bb05f474.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-67ca442c.js +6 -6
- package/es/TabBarContextMenu-c3326d67.js +2 -2
- package/es/TabBarLayout-9b67d1b6.js +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 +454 -454
- package/es/Theme-stable/theme.css +588 -588
- package/es/TimeComponentCanvas2D-cfb0066d.js +6 -6
- package/es/ToggleButton-bb69cf10.js +1 -1
- 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 +22 -22
- package/es/UNSAFE_CardGridView.js +22 -22
- 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 +27 -27
- 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 +25 -25
- 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 +34 -34
- package/es/UNSAFE_InputColor.js +32 -32
- package/es/UNSAFE_InputDateMask.js +26 -26
- package/es/UNSAFE_InputDatePicker.js +36 -36
- 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.js +26 -26
- 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 +28 -28
- 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 +28 -28
- package/es/UNSAFE_NavigationListCommon.js +20 -20
- package/es/UNSAFE_NumberInputText.js +28 -28
- package/es/UNSAFE_OverflowTabBar.js +27 -27
- 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.js +25 -25
- package/es/UNSAFE_RadioSet.js +27 -27
- package/es/UNSAFE_RatingGauge.js +18 -18
- package/es/UNSAFE_ReorderableTabBar.js +27 -27
- package/es/UNSAFE_RichCheckboxSet.js +28 -28
- package/es/UNSAFE_RichRadioSet.js +29 -29
- package/es/UNSAFE_RichSelectionItem.js +30 -30
- package/es/UNSAFE_ScatterChart.js +35 -35
- package/es/UNSAFE_SectionalLegend.js +27 -27
- package/es/UNSAFE_SelectMultiple.js +37 -37
- package/es/UNSAFE_SelectSingle.js +37 -37
- 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 +28 -28
- package/es/UNSAFE_TabBarCommon.js +28 -28
- package/es/UNSAFE_TabBarMixed.js +28 -28
- package/es/UNSAFE_TableView.js +35 -35
- package/es/UNSAFE_TagCloud.js +26 -26
- package/es/UNSAFE_TextArea.js +27 -27
- package/es/UNSAFE_TextAreaAutosize.js +27 -27
- 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.js +17 -17
- 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-818f2f31.js → View-5bdd9b3c.js} +5 -5
- package/es/{View-818f2f31.js.map → View-5bdd9b3c.js.map} +1 -1
- package/es/{VisStatusMessage-09c532e3.js → VisStatusMessage-e2d629bb.js} +2 -2
- package/es/{VisStatusMessage-09c532e3.js.map → VisStatusMessage-e2d629bb.js.map} +1 -1
- package/es/{VisTabularDatatip-f45069f1.js → VisTabularDatatip-85b00c1b.js} +2 -2
- package/es/{VisTabularDatatip-f45069f1.js.map → VisTabularDatatip-85b00c1b.js.map} +1 -1
- package/es/{WindowOverlay-467c2d12.js → WindowOverlay-7264c44a.js} +2 -2
- package/es/{WindowOverlay-467c2d12.js.map → WindowOverlay-7264c44a.js.map} +1 -1
- package/es/{YearsGridView-5286a756.js → YearsGridView-6c18094a.js} +4 -4
- package/es/{YearsGridView-5286a756.js.map → YearsGridView-6c18094a.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-7774330e.js → popupUtils-51366a29.js} +2 -2
- package/es/{popupUtils-7774330e.js.map → popupUtils-51366a29.js.map} +1 -1
- package/es/{tooltipUtils-90fb656f.js → tooltipUtils-af0abd38.js} +5 -5
- package/es/{tooltipUtils-90fb656f.js.map → tooltipUtils-af0abd38.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-cba78e0f.js → useChartDatatip-8dd22b71.js} +4 -4
- package/es/{useChartDatatip-cba78e0f.js.map → useChartDatatip-8dd22b71.js.map} +1 -1
- package/es/{useColorScheme-67245285.js → useColorScheme-c4f6caab.js} +2 -2
- package/es/{useColorScheme-67245285.js.map → useColorScheme-c4f6caab.js.map} +1 -1
- package/es/useContextMenu-730d6c12.js +2 -2
- package/es/{useCssVars-048a52d8.js → useCssVars-bc2527ac.js} +5 -5
- package/es/{useCssVars-048a52d8.js.map → useCssVars-bc2527ac.js.map} +1 -1
- package/es/{useCurrentKey-38e5f097.js → useCurrentKey-5f865bbd.js} +2 -2
- package/es/{useCurrentKey-38e5f097.js.map → useCurrentKey-5f865bbd.js.map} +1 -1
- package/es/{useDatatip-ef5c47a7.js → useDatatip-4895a07a.js} +4 -4
- package/es/{useDatatip-ef5c47a7.js.map → useDatatip-4895a07a.js.map} +1 -1
- package/es/{useDensity-969273f3.js → useDensity-1acb0153.js} +2 -2
- package/es/{useDensity-969273f3.js.map → useDensity-1acb0153.js.map} +1 -1
- package/es/{useDisplayValue-5bbf2830.js → useDisplayValue-65bbc74e.js} +7 -7
- package/es/{useDisplayValue-5bbf2830.js.map → useDisplayValue-65bbc74e.js.map} +1 -1
- package/es/{useExpandCollapse-51f9bb4b.js → useExpandCollapse-5739cfd2.js} +2 -2
- package/es/{useExpandCollapse-51f9bb4b.js.map → useExpandCollapse-5739cfd2.js.map} +1 -1
- package/es/{useFloating-c74a7f54.js → useFloating-b9d680f7.js} +2 -2
- package/es/{useFloating-c74a7f54.js.map → useFloating-b9d680f7.js.map} +1 -1
- package/es/{useHiddenTestMethod-ec7b3989.js → useHiddenTestMethod-f3f25093.js} +2 -2
- package/es/{useHiddenTestMethod-ec7b3989.js.map → useHiddenTestMethod-f3f25093.js.map} +1 -1
- package/es/{useKeyboardEvents-a1495728.js → useKeyboardEvents-9aae7ea3.js} +2 -2
- package/es/{useKeyboardEvents-a1495728.js.map → useKeyboardEvents-9aae7ea3.js.map} +1 -1
- package/es/useLegendContextMenu-a678b26f.js +4 -4
- package/es/{useMeterDatatip-f61ca3e0.js → useMeterDatatip-538a4d53.js} +3 -3
- package/es/{useMeterDatatip-f61ca3e0.js.map → useMeterDatatip-538a4d53.js.map} +1 -1
- package/es/useNavigation-b257c33a.js +1 -1
- package/es/{useOutsideClick-01f3d3e1.js → useOutsideClick-b777a43e.js} +2 -2
- package/es/{useOutsideClick-01f3d3e1.js.map → useOutsideClick-b777a43e.js.map} +1 -1
- package/es/{useOutsideMousedown-e0866d58.js → useOutsideMousedown-c45c22c0.js} +2 -2
- package/es/{useOutsideMousedown-e0866d58.js.map → useOutsideMousedown-c45c22c0.js.map} +1 -1
- package/es/{usePopupAnimation-7c5db425.js → usePopupAnimation-96d2bc83.js} +2 -2
- package/es/{usePopupAnimation-7c5db425.js.map → usePopupAnimation-96d2bc83.js.map} +1 -1
- package/es/{usePrefixSuffix-95fc00fd.js → usePrefixSuffix-f981b65f.js} +2 -2
- package/es/{usePrefixSuffix-95fc00fd.js.map → usePrefixSuffix-f981b65f.js.map} +1 -1
- package/es/{useRadioFocusManager-d9eecfb4.js → useRadioFocusManager-36eb283e.js} +2 -2
- package/es/{useRadioFocusManager-d9eecfb4.js.map → useRadioFocusManager-36eb283e.js.map} +1 -1
- package/es/{useReorderableItem-06bd7a7b.js → useReorderableItem-857636b7.js} +3 -3
- package/es/{useReorderableItem-06bd7a7b.js.map → useReorderableItem-857636b7.js.map} +1 -1
- package/es/{useRovingTabIndexContainer-c0356f5d.js → useRovingTabIndexContainer-5992e107.js} +2 -2
- package/es/{useRovingTabIndexContainer-c0356f5d.js.map → useRovingTabIndexContainer-5992e107.js.map} +1 -1
- package/es/{useScale-93490e54.js → useScale-434ad939.js} +2 -2
- package/es/{useScale-93490e54.js.map → useScale-434ad939.js.map} +1 -1
- package/es/{useSelectCommon-309d0f07.js → useSelectCommon-a3c69d60.js} +13 -8
- package/es/useSelectCommon-a3c69d60.js.map +1 -0
- package/es/{useSelectDrill-2f855daa.js → useSelectDrill-f669e729.js} +3 -3
- package/es/{useSelectDrill-2f855daa.js.map → useSelectDrill-f669e729.js.map} +1 -1
- package/es/{useSelection-d6fefa3d.js → useSelection-65134722.js} +2 -2
- package/es/{useSelection-d6fefa3d.js.map → useSelection-65134722.js.map} +1 -1
- package/es/{useSelection-10ed8060.js → useSelection-82bec039.js} +6 -6
- package/es/{useSelection-10ed8060.js.map → useSelection-82bec039.js.map} +1 -1
- package/es/useTabBar-c5558e77.js +3 -3
- package/es/{useTestId-ab1bede6.js → useTestId-f24ac480.js} +2 -2
- package/es/{useTestId-ab1bede6.js.map → useTestId-f24ac480.js.map} +1 -1
- package/es/{useTheme-c2cfbc29.js → useTheme-0e7497db.js} +2 -2
- package/es/{useTheme-c2cfbc29.js.map → useTheme-0e7497db.js.map} +1 -1
- package/es/{useThemeInterpolations-5f358139.js → useThemeInterpolations-e144e8ec.js} +5 -5
- package/es/{useThemeInterpolations-5f358139.js.map → useThemeInterpolations-e144e8ec.js.map} +1 -1
- package/es/{useTooltip-ab739df0.js → useTooltip-94af94d4.js} +2 -2
- package/es/{useTooltip-ab739df0.js.map → useTooltip-94af94d4.js.map} +1 -1
- package/es/{useTooltipControlled-b7f30aee.js → useTooltipControlled-f2cfa454.js} +5 -5
- package/es/{useTooltipControlled-b7f30aee.js.map → useTooltipControlled-f2cfa454.js.map} +1 -1
- package/es/{useTooltipOnTruncation-31afc3f2.js → useTooltipOnTruncation-94282e75.js} +4 -4
- package/es/{useTooltipOnTruncation-31afc3f2.js.map → useTooltipOnTruncation-94282e75.js.map} +1 -1
- package/es/{useTranslationBundle-bc6e0896.js → useTranslationBundle-4822502f.js} +2 -2
- package/es/{useTranslationBundle-bc6e0896.js.map → useTranslationBundle-4822502f.js.map} +1 -1
- package/es/{useUser-e543b73c.js → useUser-06d34d19.js} +2 -2
- package/es/{useUser-e543b73c.js.map → useUser-06d34d19.js.map} +1 -1
- package/es/useVisDragModeControls-af64848c.js +1 -1
- package/es/{useVisEvents-0edc925f.js → useVisEvents-256dee29.js} +2 -2
- package/es/{useVisEvents-0edc925f.js.map → useVisEvents-256dee29.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-b725a6d7.js → withDirectionIcon-a8d84a3d.js} +2 -2
- package/es/{withDirectionIcon-b725a6d7.js.map → withDirectionIcon-a8d84a3d.js.map} +1 -1
- package/es/withThemeProps-dbd4fedf.js +2 -2
- package/package.json +2 -2
- package/amd/CheckboxSet-f000e5c2.js +0 -2
- package/amd/CheckboxSet-f000e5c2.js.map +0 -1
- package/amd/ColorPicker-e3167e4c.js +0 -2
- package/amd/ExpandableList-233c279e.js +0 -2
- package/amd/InputDatePicker-030e345a.js +0 -2
- package/amd/ListView-02a92d18.js +0 -2
- package/amd/TextArea-345f89d4.js +0 -2
- package/amd/TextArea-345f89d4.js.map +0 -1
- package/amd/TextAreaAutosize-01dfd98e.js +0 -2
- package/amd/VirtualizedListView-a0f338c2.js +0 -2
- package/amd/useSelectCommon-28307b63.js +0 -2
- package/amd/useSelectCommon-28307b63.js.map +0 -1
- package/cjs/useSelectCommon-b0d7feb3.js.map +0 -1
- package/es/useSelectCommon-309d0f07.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
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,GAAoBC,EAAQA,UAAC,IAC9CC,EAAYC,GAAiBF,EAAQA,SAACX,GACvCc,EAAyBC,eAE5BC,IACDN,EAAiBM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lD,GAAWmD,WACnBC,QAASpD,GAAWqD,UACpBzE,IAAKhI,GACLyL,YAAaA,GACb5K,OAAQA,KACJsK,KAENnJ,EAAAA,IAAC0K,GAAAA,UACC,CAAAC,WAAYnC,GACZ9C,WAAYA,EACZ6D,sBAAuBA,GACvBF,qBAAsBA,GACtBI,YAAaA,GACba,OAAQlD,GAAWmD,WACnBC,QAASpD,GAAWqD,UACpBG,aA3MR5K,MAAC6K,EAAAA,YACC,CAAAC,KAAK,KAAI,gBACM3M,EAAU,YAASgC,EACtB,aAAAhC,EAAUiI,OAAqBjG,EAC3C7B,WAAYA,GACZyM,UAAU,EACVC,kBAAmBzM,EACnByH,IAAKlD,EACLjE,OAAQA,EAASA,EAAS,kBAAesB,EACzCpB,MAAOwH,EACP3B,SAAUtG,KAAeH,OAAUgC,EAAY8D,IAkMzCiC,aAAclI,GACdiN,oBAAoB,EACpBpM,OAAQA,KACJqJ,MACAiB,MACAvB,MACAtB,MAKT/H,IAAWC,KAAeF,IACzB0B,EAAAA,IAACjC,GAAwB,CACvBC,UAAWkI,EACXjI,cAAeA,EACfG,eAAgBA,EAChBC,eAAgBA,EAChBC,WAAYA,GACZE,WAAYA,GACZD,OAAQA,EACRE,MAAOA,EACPC,QAASwF,EACTvF,SAAU4F,EACV3F,SAAUA,EACVC,OAAQA,EAASA,EAAS,oBAAiBsB,EAC3CrB,sBAAuBA,GAEvBC,MAAO0D,GAAcyI,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-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,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R5K,MAAC6K,EAAAA,YACC,CAAAC,KAAK,KAAI,gBACM3M,EAAU,YAASgC,EACtB,aAAAhC,EAAUiI,OAAqBjG,EAC3C7B,WAAYA,GACZyM,UAAU,EACVC,kBAAmBzM,EACnByH,IAAKlD,EACLjE,OAAQA,EAASA,EAAS,kBAAesB,EACzCpB,MAAOwH,EACP3B,SAAUtG,KAAeH,OAAUgC,EAAY8D,IAkMzCiC,aAAclI,GACdiN,oBAAoB,EACpBpM,OAAQA,KACJqJ,MACAiB,MACAvB,MACAtB,MAKT/H,IAAWC,KAAeF,IACzB0B,EAAAA,IAACjC,GAAwB,CACvBC,UAAWkI,EACXjI,cAAeA,EACfG,eAAgBA,EAChBC,eAAgBA,EAChBC,WAAYA,GACZE,WAAYA,GACZD,OAAQA,EACRE,MAAOA,EACPC,QAASwF,EACTvF,SAAU4F,EACV3F,SAAUA,EACVC,OAAQA,EAASA,EAAS,oBAAiBsB,EAC3CrB,sBAAuBA,GAEvBC,MAAO0D,GAAcyI,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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact/compat', 'preact/hooks', './Calendar-feffa985', './InputDateMask-c91323d7', './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'], (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:l,isOpen:c,isReadonly:u,label:p,onClose:h,onCommit:y,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}=m.useTranslationBundle("@oracle/oraclejet-preact"),U=M(),_=s.jsx(z.DatePicker,{dayFormatter:n,daysOutsideMonth:o,height:w?void 0:"auto",onCommit:y,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||l||u||!(t||r||C&&C.length>0)||"efficient"!==A&&"reflow"!==A?void 0:s.jsx(d.FormFieldContext.Provider,{value:{isFocused:!0},children:s.jsx("div",{class:Z.userAssistanceStyles,children:s.jsx(b.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:Z.dropdownStyles,children:s.jsx(G.SectionedContent,{"aria-label":U,footer:j,hasFocusTrap:!0,main:_,role:"dialog",testId:H})});return w?s.jsx(W.Sheet,{initialFocus:"firstFocusable",isOpen:c,onClose:h,children:s.jsx(G.SectionedContent,{"aria-label":U,footer:j,hasFocusTrap:!0,main:_,role:"dialog",testId:H})}):s.jsx(G.StickyPositioningDropdown,{anchorRef:e,initialFocus:"firstFocusable",isOpen:c,onClose:h,onPosition:R,sizeOptions:{isMaxWidthAdjusted:!1,isMaxHeightAdjusted:!0},children:B})},ne=()=>"phone"===l.getClientHints().deviceType,oe=e=>e&&se.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});$.calendarDatesAreDifferent(y.current,r)&&(y.current=r,$.calendarDatesAreDifferent(r,f.dateValue)&&(C({type:"reset",data:r}),h.current=r,p.current=r)),a.useEffect((()=>{$.calendarDatesAreDifferent(f.dateValue,h.current)&&(n({previousValue:h.current,value:f.dateValue}),h.current=f.dateValue),b.current&&$.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=>{$.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 ee.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:l,daysOutsideMonth:d,helpSourceLink:c,helpSourceText:u,isDisabled:p,isReadonly:h,label:y,max:b,messages:f,min:C,monthAndYearPicker:D,todayTimeZone:v,todayButton:S,value:k,onCommit:x,onInput:A,testId:T,userAssistanceDensity:g,weekDisplay:F,...I},V)=>{const P=te.useTestId(T),R=a.useRef(null),{calendarIconActionHandler:w,datePickerCommitHandler:M,completeDateValue:U,dateValue:_,dropdownCloseHandler:j,iconRef:H,isOpen:B,maskCommitHandler:E,maskInputHandler:N,maskRef:L}=ie({isDisabled:p,isReadonly:h,onCommit:x,onInput:A,rootRef:R,value:k}),O=a.useRef(null),{inputDatePicker_selectDate:Y,inputDatePicker_instruction:Z}=m.useTranslationBundle("@oracle/oraclejet-preact"),W=Y(),{userAssistanceDensity:z}=K.useFormContext(),G=g??z;a.useImperativeHandle(V,(()=>({focus:()=>{L.current?.focus()},blur:()=>{L.current?.blur()}})));const J=Q.useId(),X=Z(),$=p||h?void 0:s.jsx(r.HiddenAccessible,{id:J,isHidden:!0,children:X}),ee=p||h?e:q.l([e,J]),se=s.jsx(i.IconButton,{"aria-haspopup":"dialog","aria-label":W,isDisabled:p,ref:H,size:"sm",testId:T?T+"_calendarIcon":void 0,variant:"ghost",onAction:w,children:s.jsx(n.SvgCalendar,{})}),ne=B;return s.jsxs("div",{...P,ref:R,children:[s.jsx(o.InputDateMaskContext.Provider,{value:{isDropdownOpen:B,isInputDatePickerParent:!0},children:s.jsx(o.InputDateMask,{"aria-describedby":ee,assistiveText:t,endContent:se,helpSourceLink:c,helpSourceText:u,isDisabled:p,isReadonly:h,label:y,onCommit:E,onInput:N,mainFieldRef:O,messages:f,testId:T?T+"_mask":void 0,ref:L,userAssistanceDensity:g,value:_,...I})}),$,ne&&s.jsx(ae,{anchorRef:O,assistiveText:t,dayFormatter:l,daysOutsideMonth:d,helpSourceLink:c,helpSourceText:u,isDisabled:p,isReadonly:h,isOpen:B,label:y,onClose:j,onCommit:M,max:b,messages:f,min:C,monthAndYearPicker:D,testId:T?T+"_datePicker":void 0,todayTimeZone:v,todayButton:S,userAssistanceDensity:G,value:U,weekDisplay:F})]})}));e.InputDatePicker=le}));
|
|
2
|
+
//# sourceMappingURL=InputDatePicker-7227a858.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputDatePicker-030e345a.js","sources":["../../src/UNSAFE_InputDatePicker/InputDatePickerDropdown.tsx","../../src/UNSAFE_InputDatePicker/useInputDatePickerState.ts","../../src/UNSAFE_InputDatePicker/useInputDatePicker.ts","../../src/UNSAFE_InputDatePicker/InputDatePicker.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { ComponentProps } from 'preact';\nimport { useCallback, useState } from 'preact/hooks';\nimport { BundleType } from '../resources/nls/bundle';\nimport { DatePicker } from '#UNSAFE_DatePicker';\nimport { type CloseDetail as DropdownCloseDetail } from '#UNSAFE_Dropdown';\nimport { getClientHints } from '#utils/PRIVATE_clientHints';\nimport { FormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { InlineUserAssistance } from '../UNSAFE_UserAssistance';\nimport { InputDatePicker } from './InputDatePicker';\nimport { dropdownStyles, userAssistanceStyles } from './themes/InputDatePickerDropdownStyles.css';\nimport { PositionData } from '../UNSAFE_Floating';\nimport { StickyPositioningDropdown } from '#PRIVATE_FormControls';\nimport { SectionedContent } from '#PRIVATE_FormControls';\nimport { type CloseDetail as SheetCloseDetail, Sheet } from '#UNSAFE_Sheet';\nimport type { TestIdProps } from '#hooks/UNSAFE_useTestId';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport { SizeOptions } from '#UNSAFE_Floating/Floating';\n\ntype StickyPositioningDropdownProps = ComponentProps<typeof StickyPositioningDropdown>;\ntype InputDatePickerProps = ComponentProps<typeof InputDatePicker>;\ntype PickedPropsFromInputDatePicker = Pick<\n InputDatePickerProps,\n | 'assistiveText'\n | 'dayFormatter'\n | 'daysOutsideMonth'\n | 'helpSourceLink'\n | 'helpSourceText'\n | 'isDisabled'\n | 'isReadonly'\n | 'label'\n | 'messages'\n | 'min'\n | 'max'\n | 'monthAndYearPicker'\n | 'todayButton'\n | 'todayTimeZone'\n | 'userAssistanceDensity'\n | 'value'\n | 'weekDisplay'\n>;\ntype DatePickerProps = ComponentProps<typeof DatePicker>;\ntype PickedPropsFromDatePicker = Pick<DatePickerProps, 'value' | 'onCommit'>;\ntype PickedPropsFromDropdown = Omit<StickyPositioningDropdownProps, 'onClose'>;\ntype CloseDetail = SheetCloseDetail | DropdownCloseDetail;\n\ntype Props = PickedPropsFromDatePicker &\n PickedPropsFromInputDatePicker &\n PickedPropsFromDropdown &\n TestIdProps & {\n /**\n * Called when the dropdown or sheet is supposed to be closed.\n */\n onClose?: (detail: CloseDetail) => void;\n };\n\n/**\n * Component that renders DatePicker either inside a dropdown or sheet; at small screen\n * widths, it renders inside a sheet. Additionally, when a dropdown is being shown beneath\n * the component, we also show any user assistance text or messages below the picker\n * because otherwise that information would be obscured from view. When a sheet is being\n * shown, it will always display UA and messages at the bottom of the sheet.\n */\nconst InputDatePickerDropdown = ({\n anchorRef,\n assistiveText,\n dayFormatter,\n daysOutsideMonth,\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isOpen,\n isReadonly,\n label,\n onClose,\n onCommit,\n max,\n messages,\n min,\n monthAndYearPicker,\n testId,\n todayButton,\n todayTimeZone,\n userAssistanceDensity,\n value,\n weekDisplay\n}: Props) => {\n // If the dropdown opens above the component, we don't want to show UA or messages.\n const [isDropdownAbove, setDropdownAbove] = useState(false);\n const [prevIsOpen, setPrevIsOpen] = useState(isOpen);\n const handleDropdownPosition = useCallback<\n NonNullable<StickyPositioningDropdownProps['onPosition']>\n >((data: PositionData) => {\n setDropdownAbove(data.placement.startsWith('top'));\n }, []);\n // Reset the flag when the dropdown is closed.\n if (prevIsOpen !== isOpen) {\n setPrevIsOpen(isOpen);\n if (!isOpen) {\n setDropdownAbove(false);\n }\n }\n\n const sizeOptions: SizeOptions = {\n isMaxWidthAdjusted: false,\n isMaxHeightAdjusted: true\n };\n\n // On mobile phones, the dropdown becomes a sheet.\n const shouldShowSheet = isPhone();\n\n const { datePicker_label } = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const datePickerAriaLabel = datePicker_label();\n\n const datePickerMainContent = (\n <DatePicker\n dayFormatter={dayFormatter}\n daysOutsideMonth={daysOutsideMonth}\n height={!shouldShowSheet ? 'auto' : undefined}\n onCommit={onCommit}\n max={max}\n min={min}\n // for sheet, we want the width to grow to the width of the sheet, otherwise it will use the theme default.\n maxWidth={shouldShowSheet ? '100%' : undefined}\n width=\"100%\"\n monthAndYearPicker={monthAndYearPicker}\n testId={testId}\n todayTimeZone={todayTimeZone}\n todayButton={todayButton}\n value={value}\n weekDisplay={weekDisplay}\n />\n );\n\n const inlineUserAssistanceFooter =\n isOpen &&\n (!isDropdownAbove || shouldShowSheet) &&\n !isDisabled &&\n !isReadonly &&\n (assistiveText || helpSourceLink || (messages && messages.length > 0)) &&\n (userAssistanceDensity === 'efficient' || userAssistanceDensity === 'reflow') ? (\n <FormFieldContext.Provider value={{ isFocused: true }}>\n <div class={userAssistanceStyles}>\n <InlineUserAssistance\n assistiveText={assistiveText}\n fieldLabel={label}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n messages={messages}\n userAssistanceDensity={userAssistanceDensity}\n />\n </div>\n </FormFieldContext.Provider>\n ) : undefined;\n\n const contentTestId = testId ? testId + (shouldShowSheet ? '_sheet' : '_dropdown') : undefined;\n\n // The same content is displayed either in a dropdown or sheet: date picker and inline UA.\n // Add styling to the dropdown to enforce a fixed width.\n const dropdownContent = (\n <div class={dropdownStyles}>\n <SectionedContent\n aria-label={datePickerAriaLabel}\n footer={inlineUserAssistanceFooter}\n hasFocusTrap={true}\n main={datePickerMainContent}\n role=\"dialog\"\n testId={contentTestId}\n />\n </div>\n );\n\n const dropdown = shouldShowSheet ? (\n <Sheet initialFocus=\"firstFocusable\" isOpen={isOpen} onClose={onClose}>\n <SectionedContent\n aria-label={datePickerAriaLabel}\n footer={inlineUserAssistanceFooter}\n hasFocusTrap={true}\n main={datePickerMainContent}\n role=\"dialog\"\n testId={contentTestId}\n />\n </Sheet>\n ) : (\n <StickyPositioningDropdown\n anchorRef={anchorRef}\n initialFocus=\"firstFocusable\"\n isOpen={isOpen}\n onClose={onClose}\n onPosition={handleDropdownPosition}\n sizeOptions={sizeOptions}>\n {dropdownContent}\n </StickyPositioningDropdown>\n );\n\n return dropdown;\n};\n\nconst isPhone = () => {\n return getClientHints().deviceType === 'phone';\n};\n\nexport { InputDatePickerDropdown, type CloseDetail };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { useReducer } from 'preact/hooks';\nimport type { CalendarDate, CalendarDateRequired } from '#utils/UNSAFE_calendarDateUtils';\nimport { isCompleteCalendarDate } from '#utils/UNSAFE_calendarDateUtils';\n\ntype InputDatePickerState = {\n /**\n * If dateValue is a complete date, then completeDateValue is the same as dateValue\n * otherwise is is undefined. We need to maintain separate states because\n * InputDateMask uses CalendarDate, but DatePicker uses CalendarDateRequired.\n * If the user types a partial date then opens the picker, we treat that as\n * no selection. The picker opens to the current month showing today.\n */\n completeDateValue?: CalendarDateRequired;\n\n /**\n * Represents the current date value of the component. The user either selected\n * the date in the picker, or typed it into the date field.\n */\n dateValue?: CalendarDate;\n};\n\ntype DateChangedAction = { type: 'dateChanged'; data?: CalendarDate };\ntype DateResetAction = { type: 'reset'; data?: CalendarDate };\ntype DateSelectedAction = { type: 'dateSelected'; data?: CalendarDateRequired };\ntype InputDatePickerReducerAction = DateChangedAction | DateResetAction | DateSelectedAction;\n\n// If dateVal is a complete date, return it as a CalendarDateRequired\n// otherwise return undefined.\nconst convertToCalendarDateRequired = (dateVal?: CalendarDate) => {\n return !dateVal || !isCompleteCalendarDate(dateVal)\n ? undefined\n : (dateVal as CalendarDateRequired);\n};\n\n// Use a reducer function to manage InputDatePickerState.\nconst inputDatePickerReducer = (\n state: InputDatePickerState,\n action: InputDatePickerReducerAction\n): InputDatePickerState => {\n switch (action.type) {\n case 'dateChanged': {\n return {\n ...state,\n dateValue: action.data,\n completeDateValue: convertToCalendarDateRequired(action.data)\n };\n }\n case 'dateSelected': {\n return { ...state, dateValue: action.data, completeDateValue: action.data };\n }\n case 'reset': {\n return {\n completeDateValue: convertToCalendarDateRequired(action.data),\n dateValue: action.data\n };\n }\n default:\n return state;\n }\n};\n\ntype Props = {\n /**\n * The value of the InputDatePicker, or undefined.\n */\n value?: CalendarDate;\n};\n\n/**\n * useInputDatePickerState calls useReducer to determine the initial state. Any changes to that state\n * are managed by dispatching actions to the reducer function.\n */\nconst useInputDatePickerState = ({ value }: Props) => {\n const [state, dispatch] = useReducer(inputDatePickerReducer, {\n completeDateValue: convertToCalendarDateRequired(value),\n dateValue: value\n });\n\n return { state, dispatch };\n};\n\nexport { useInputDatePickerState };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport type { ComponentProps, RefObject } from 'preact';\nimport type { ElementRef } from 'preact/compat';\nimport { useCallback, useEffect, useRef, useState } from 'preact/hooks';\nimport type { CalendarDate, CalendarDateRequired } from '#utils/UNSAFE_calendarDateUtils';\nimport { calendarDatesAreDifferent } from '#utils/PRIVATE_dayUtils';\nimport { DatePicker } from '#UNSAFE_DatePicker';\nimport { CloseDetail, InputDatePickerDropdown } from './InputDatePickerDropdown';\nimport { IconButton } from '#UNSAFE_IconButton';\nimport { InputDateMask } from '#UNSAFE_InputDateMask';\nimport { InputDatePicker } from './InputDatePicker';\nimport { useHiddenTestMethod } from '#hooks/UNSAFE_useHiddenTestMethod';\nimport { useInputDatePickerState } from './useInputDatePickerState';\nimport type { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\n\ntype InputDatePickerProps = ComponentProps<typeof InputDatePicker>;\ntype InputDateMaskProps = ComponentProps<typeof InputDateMask>;\ntype DatePickerProps = ComponentProps<typeof DatePicker>;\ntype IconButtonProps = ComponentProps<typeof IconButton>;\ntype DropdownProps = ComponentProps<typeof InputDatePickerDropdown>;\n\ntype IconButtonHandle = ElementRef<typeof IconButton>;\n\ntype Props = {\n isDisabled: InputDatePickerProps['isDisabled'];\n isReadonly: InputDatePickerProps['isReadonly'];\n onCommit: InputDatePickerProps['onCommit'];\n onInput: InputDatePickerProps['onInput'];\n rootRef: RefObject<HTMLElement>;\n value: InputDatePickerProps['value'];\n};\n\n/**\n * Hook that provides handlers and other functionality for InputDatePicker.\n */\nconst useInputDatePicker = ({\n isDisabled,\n isReadonly,\n onCommit,\n onInput,\n rootRef,\n value: currentValue\n}: Props) => {\n // Whether the dropdown is open.\n const [isOpen, setIsOpen] = useState(false);\n\n // Ref to the calendar icon button.\n const iconRef = useRef<IconButtonHandle>(null);\n\n // Ref to the InputDateMask component.\n const maskRef: RefObject<HTMLElement> = useRef<HTMLElement>(null);\n\n // Keep track of whether the dropdown was just dismissed from an outside mousedown event.\n const outsideMousedownRef = useRef<boolean>(false);\n const outsideMousedownTimerRef = useRef<ReturnType<typeof setTimeout> | undefined>();\n\n // Keep track of the last date values passed to onInput and onCommit.\n const lastCommittedDateRef = useRef<CalendarDate | undefined>(currentValue);\n const lastDateRef = useRef<CalendarDate | undefined>(currentValue);\n\n // Keep track of the last controlled value passed from the parent, so we can detect a programmatic change.\n const lastValueFromParentRef = useRef<CalendarDate | undefined>(currentValue);\n\n // Keep track of whether a date was selected in the date picker.\n const dateSelectedRef = useRef<boolean>(false);\n\n const { state, dispatch } = useInputDatePickerState({ value: currentValue });\n\n // If a new value is being pushed from the parent, and that value differs from\n // the current value of the reducer, then this is a programmatic update\n // and we need to call 'reset' to update the reducer state. Otherwise, the only\n // time the reducer state is updated from the value is on mount.\n if (calendarDatesAreDifferent(lastValueFromParentRef.current, currentValue)) {\n lastValueFromParentRef.current = currentValue;\n if (calendarDatesAreDifferent(currentValue, state.dateValue)) {\n dispatch({ type: 'reset', data: currentValue });\n lastDateRef.current = currentValue;\n lastCommittedDateRef.current = currentValue;\n }\n }\n\n // Reducer updates are async, so wait until the state updates and then call our callbacks.\n useEffect(() => {\n if (calendarDatesAreDifferent(state.dateValue, lastDateRef.current)) {\n onInput({ previousValue: lastDateRef.current, value: state.dateValue });\n lastDateRef.current = state.dateValue;\n }\n if (\n dateSelectedRef.current &&\n calendarDatesAreDifferent(state.dateValue, lastCommittedDateRef.current)\n ) {\n onCommit?.({ previousValue: lastCommittedDateRef.current, value: state.dateValue });\n lastCommittedDateRef.current = state.dateValue;\n dateSelectedRef.current = false;\n }\n }, [onCommit, onInput, state.dateValue]);\n\n // Handle onInput from InputDateMask as segment values are being added or changed in the input field.\n // We wait for the state to update before calling onInput.\n const maskInputHandler = useCallback<InputDateMaskProps['onInput']>(\n (detail: ValueUpdateDetail<CalendarDate>) => {\n dispatch({ type: 'dateChanged', data: detail.value });\n },\n [dispatch]\n );\n\n // Handle onCommit from InputDateMask, which is called when the user presses Enter or the field is blurred.\n const maskCommitHandler = useCallback<NonNullable<InputDateMaskProps['onCommit']>>(\n (detail: ValueUpdateDetail<CalendarDate>) => {\n // If the value we get from InputDateMask's onCommit differs from the last committed value, then call onCommit.\n if (calendarDatesAreDifferent(lastCommittedDateRef.current, detail.value)) {\n onCommit?.({ value: detail.value, previousValue: lastCommittedDateRef.current });\n lastCommittedDateRef.current = detail.value;\n }\n },\n [onCommit]\n );\n\n // Respond to onAction event from the calendar icon button. Toggles the date picker dropdown.\n const calendarIconActionHandler = useCallback<NonNullable<IconButtonProps['onAction']>>(() => {\n // Only toggle the value of isOpen if we didn't just dismiss the dropdown.\n if (!outsideMousedownRef.current) {\n setIsOpen((prevIsOpen) => !prevIsOpen);\n }\n outsideMousedownRef.current = false;\n }, []);\n\n const dropdownCloseHandler = useCallback<NonNullable<DropdownProps['onClose']>>(\n (detail: CloseDetail) => {\n // Keep track of when the dropdown is closed via outside mousedown, including when the calendar icon\n // is clicked. We need this in order to toggle visibility of the picker and dropdown.\n if (detail.reason === 'outsideMousedown') {\n outsideMousedownRef.current = true;\n clearTimeout(outsideMousedownTimerRef.current);\n\n // Clear the flag after a short delay to ensure the dropdown can be opened again.\n outsideMousedownTimerRef.current = setTimeout(() => {\n outsideMousedownRef.current = false;\n }, 200);\n } else if (detail.reason === 'dismissed' || detail.reason === 'keyboardDismissed') {\n // Focus the calendar icon when the dropdown is closed.\n iconRef.current?.focus();\n }\n setIsOpen(false);\n },\n []\n );\n\n // Handle date selection in the picker.\n // - Updates the value in state.\n // - Closes the dropdown.\n // - Sets focus to the date field.\n const datePickerCommitHandler = useCallback<DatePickerProps['onCommit']>(\n (detail: ValueUpdateDetail<CalendarDateRequired>) => {\n // Set focus to the calendar icon when a date is selected.\n iconRef.current?.focus();\n\n // Set a ref indicating a date was selected.\n dateSelectedRef.current = true;\n dispatch({ type: 'dateSelected', data: detail.value });\n setIsOpen(false);\n },\n [dispatch]\n );\n\n // Create a changeValue method that can be called by a test adapter to simulate a user\n // changing the value and committing it.\n const changeValue = useCallback(\n (newValue?: CalendarDate) => {\n // We always want this method available on the DOM element so that a test can call it,\n // but we only want it to change the value when the component is enabled because that's\n // the only time the user could change the value through the UI.\n if (!isReadonly && !isDisabled) {\n onInput({ value: newValue, previousValue: currentValue });\n onCommit?.({ value: newValue, previousValue: currentValue });\n return Promise.resolve();\n }\n return Promise.reject('Component is readonly or disabled');\n },\n [currentValue, isDisabled, isReadonly, onCommit, onInput]\n );\n // Expose _changeValue as a hidden method on the root DOM.\n useHiddenTestMethod({\n elementRef: rootRef,\n method: changeValue,\n name: '_changeValue'\n });\n\n return {\n calendarIconActionHandler,\n datePickerCommitHandler,\n dropdownCloseHandler,\n completeDateValue: state.completeDateValue,\n dateValue: state.dateValue,\n iconRef,\n isOpen,\n maskCommitHandler,\n maskInputHandler,\n maskRef\n };\n};\n\nexport { useInputDatePicker };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { ComponentProps, Ref } from 'preact';\nimport { forwardRef } from 'preact/compat';\nimport { useImperativeHandle, useRef } from 'preact/hooks';\nimport { BundleType } from '../resources/nls/bundle';\nimport { CalendarIcon } from '#PRIVATE_ThemedIcons/CalendarIcon';\nimport {\n CalendarDate,\n CalendarDatePlaceholders,\n InputDateMask,\n InputDateMaskContext\n} from '#UNSAFE_InputDateMask';\nimport { DatePicker } from '#UNSAFE_DatePicker';\nimport { HiddenAccessible } from '#UNSAFE_HiddenAccessible';\nimport { IconButton } from '#UNSAFE_IconButton';\nimport { InputDatePickerDropdown } from './InputDatePickerDropdown';\nimport { FocusableHandle } from '#hooks/UNSAFE_useFocusableTextField';\nimport { merge } from '@oracle/oraclejet-internal-utilities/stringUtils';\nimport { useFormContext } from '#hooks/UNSAFE_useFormContext';\nimport { useId } from '#hooks/UNSAFE_useId';\nimport { useInputDatePicker } from './useInputDatePicker';\nimport { useTestId } from '#hooks/UNSAFE_useTestId';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\n\ntype InputDateMaskProps = ComponentProps<typeof InputDateMask>;\ntype PickedPropsFromInputDateMask = Pick<\n InputDateMaskProps,\n | 'aria-describedby'\n | 'assistiveText'\n | 'columnSpan'\n | 'helpSourceLink'\n | 'helpSourceText'\n | 'isDisabled'\n | 'isReadonly'\n | 'isRequired'\n | 'isRequiredShown'\n | 'label'\n | 'labelEdge'\n | 'labelStartWidth'\n | 'messages'\n | 'textAlign'\n | 'testId'\n | 'userAssistanceDensity'\n | 'variant'\n>;\n\ntype DatePickerProps = ComponentProps<typeof DatePicker>;\ntype PickedPropsFromDatePicker = Pick<\n DatePickerProps,\n | 'dayFormatter'\n | 'daysOutsideMonth'\n | 'max'\n | 'min'\n | 'monthAndYearPicker'\n | 'todayTimeZone'\n | 'todayButton'\n | 'weekDisplay'\n>;\n\ntype Props = PickedPropsFromInputDateMask &\n PickedPropsFromDatePicker & {\n /**\n * If specified, overrides the locale specific order of the individual date segments\n * in the date field as well as the locale specific separator. The value of each placeholder\n * is only used when the type is 'literal', otherwise it is replaced with a translated\n * placeholder for month, day, or year. The placeholders must include month, day, and year.\n */\n masks?: CalendarDatePlaceholders;\n\n /**\n * The current display value of the component.\n * This is a CalendarDate, not CalendarDateRequired, because this is a controlled component and\n * the user may type the month, day, and year separately. If a selection is made in the date\n * picker, then the value is a complete date.\n */\n value?: CalendarDate;\n\n /**\n * Callback invoked when the user commits the entered value by blurring or hitting the enter key.\n * It is also called when a selection is made in the date picker.\n */\n onCommit?: (detail: ValueUpdateDetail<CalendarDate>) => void;\n\n /**\n * Callback invoked each time the user changes the value of a segment. For example, if the user\n * types '12' into the month segment, this callback will be called twice to change the month\n * first to '1' and then '12'.\n */\n onInput: (detail: ValueUpdateDetail<CalendarDate>) => void;\n };\n\n/**\n * InputDatePicker allows users to enter or select a single date using a calendar interface.\n */\nexport const InputDatePicker = forwardRef(\n (\n {\n 'aria-describedby': propDescribedBy,\n assistiveText,\n dayFormatter,\n daysOutsideMonth,\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isReadonly,\n label,\n max,\n messages,\n min,\n monthAndYearPicker,\n todayTimeZone,\n todayButton,\n value,\n onCommit,\n onInput,\n testId,\n userAssistanceDensity: propUserAssistanceDensity,\n weekDisplay,\n ...dateMaskProps\n }: Props,\n ref?: Ref<FocusableHandle>\n ) => {\n const testIdProps = useTestId(testId);\n const rootRef = useRef<HTMLDivElement>(null);\n\n const {\n calendarIconActionHandler,\n datePickerCommitHandler,\n completeDateValue,\n dateValue,\n dropdownCloseHandler,\n iconRef,\n isOpen,\n maskCommitHandler,\n maskInputHandler,\n maskRef\n } = useInputDatePicker({\n isDisabled,\n isReadonly,\n onCommit,\n onInput,\n rootRef,\n value\n });\n\n const mainFieldRef = useRef<HTMLDivElement>(null);\n const { inputDatePicker_selectDate, inputDatePicker_instruction } =\n useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const calendarIconAriaLabel = inputDatePicker_selectDate();\n\n // We need this to determine if UA/messaging should be shown in the dropdown.\n const { userAssistanceDensity: formUserAssistanceDensity } = useFormContext();\n const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;\n\n useImperativeHandle(ref!, () => ({\n focus: () => {\n maskRef.current?.focus();\n },\n blur: () => {\n maskRef.current?.blur();\n }\n }));\n\n const maskFieldInstructionId = useId();\n const maskFieldInstructionText = inputDatePicker_instruction();\n const maskFieldInstruction =\n !isDisabled && !isReadonly ? (\n <HiddenAccessible id={maskFieldInstructionId} isHidden={true}>\n {maskFieldInstructionText}\n </HiddenAccessible>\n ) : undefined;\n const ariaDescribedBy =\n !isDisabled && !isReadonly\n ? merge([propDescribedBy, maskFieldInstructionId])\n : propDescribedBy;\n\n const endContent = (\n <IconButton\n aria-haspopup=\"dialog\"\n aria-label={calendarIconAriaLabel}\n isDisabled={isDisabled}\n ref={iconRef}\n size=\"sm\"\n testId={testId ? testId + '_calendarIcon' : undefined}\n variant=\"ghost\"\n onAction={calendarIconActionHandler}>\n <CalendarIcon />\n </IconButton>\n );\n\n const shouldShowDropdown = isOpen as boolean;\n\n return (\n <div {...testIdProps} ref={rootRef}>\n <InputDateMaskContext.Provider\n value={{ isDropdownOpen: isOpen, isInputDatePickerParent: true }}>\n <InputDateMask\n aria-describedby={ariaDescribedBy}\n assistiveText={assistiveText}\n endContent={endContent}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n isDisabled={isDisabled}\n isReadonly={isReadonly}\n label={label}\n onCommit={maskCommitHandler}\n onInput={maskInputHandler}\n mainFieldRef={mainFieldRef}\n messages={messages}\n testId={testId ? testId + '_mask' : undefined}\n ref={maskRef}\n userAssistanceDensity={propUserAssistanceDensity}\n value={dateValue}\n {...dateMaskProps}\n />\n </InputDateMaskContext.Provider>\n\n {maskFieldInstruction}\n\n {shouldShowDropdown && (\n <InputDatePickerDropdown\n anchorRef={mainFieldRef}\n assistiveText={assistiveText}\n dayFormatter={dayFormatter}\n daysOutsideMonth={daysOutsideMonth}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n isDisabled={isDisabled}\n isReadonly={isReadonly}\n isOpen={isOpen}\n label={label}\n onClose={dropdownCloseHandler}\n onCommit={datePickerCommitHandler}\n max={max}\n messages={messages}\n min={min}\n monthAndYearPicker={monthAndYearPicker}\n testId={testId ? testId + '_datePicker' : undefined}\n todayTimeZone={todayTimeZone}\n todayButton={todayButton}\n userAssistanceDensity={userAssistanceDensity}\n value={completeDateValue}\n weekDisplay={weekDisplay}\n />\n )}\n </div>\n );\n }\n);\n"],"names":["InputDatePickerDropdown","anchorRef","assistiveText","dayFormatter","daysOutsideMonth","helpSourceLink","helpSourceText","isDisabled","isOpen","isReadonly","label","onClose","onCommit","max","messages","min","monthAndYearPicker","testId","todayButton","todayTimeZone","userAssistanceDensity","value","weekDisplay","isDropdownAbove","setDropdownAbove","useState","prevIsOpen","setPrevIsOpen","handleDropdownPosition","useCallback","data","placement","startsWith","shouldShowSheet","isPhone","datePicker_label","useTranslationBundle","datePickerAriaLabel","datePickerMainContent","_jsx","DatePicker","height","undefined","maxWidth","width","inlineUserAssistanceFooter","length","FormFieldContext","Provider","isFocused","children","jsx","class","userAssistanceStyles","InlineUserAssistance","fieldLabel","contentTestId","dropdownContent","dropdownStyles","SectionedContent","footer","hasFocusTrap","main","role","Sheet","initialFocus","StickyPositioningDropdown","onPosition","sizeOptions","isMaxWidthAdjusted","isMaxHeightAdjusted","getClientHints","deviceType","convertToCalendarDateRequired","dateVal","isCompleteCalendarDate","inputDatePickerReducer","state","action","type","dateValue","completeDateValue","useInputDatePicker","onInput","rootRef","currentValue","setIsOpen","iconRef","useRef","maskRef","outsideMousedownRef","outsideMousedownTimerRef","lastCommittedDateRef","lastDateRef","lastValueFromParentRef","dateSelectedRef","dispatch","useReducer","useInputDatePickerState","calendarDatesAreDifferent","current","useEffect","previousValue","maskInputHandler","detail","maskCommitHandler","calendarIconActionHandler","dropdownCloseHandler","reason","clearTimeout","setTimeout","focus","datePickerCommitHandler","changeValue","newValue","Promise","reject","resolve","useHiddenTestMethod","elementRef","method","name","InputDatePicker","forwardRef","propDescribedBy","propUserAssistanceDensity","dateMaskProps","ref","testIdProps","useTestId","mainFieldRef","inputDatePicker_selectDate","inputDatePicker_instruction","calendarIconAriaLabel","formUserAssistanceDensity","useFormContext","useImperativeHandle","blur","maskFieldInstructionId","useId","maskFieldInstructionText","maskFieldInstruction","HiddenAccessible","id","isHidden","ariaDescribedBy","merge","endContent","IconButton","size","variant","onAction","CalendarIcon","shouldShowDropdown","_jsxs","InputDateMaskContext","isDropdownOpen","isInputDatePickerParent","InputDateMask"],"mappings":"upEAsEA,MAAMA,GAA0B,EAC9BC,YACAC,gBACAC,eACAC,mBACAC,iBACAC,iBACAC,aACAC,SACAC,aACAC,QACAC,UACAC,WACAC,MACAC,WACAC,MACAC,qBACAC,SACAC,cACAC,gBACAC,wBACAC,QACAC,kBAGA,MAAOC,EAAiBC,GAAoBC,EAAQA,UAAC,IAC9CC,EAAYC,GAAiBF,EAAQA,SAACjB,GACvCoB,EAAyBC,eAE5BC,IACDN,EAAiBM,EAAKC,UAAUC,WAAW,OAAO,GACjD,IAECN,IAAelB,IACjBmB,EAAcnB,GACTA,GACHgB,GAAiB,IAIrB,MAMMS,EAAkBC,MAElBC,iBAAEA,GAAqBC,EAAoBA,qBAAa,4BACxDC,EAAsBF,IAEtBG,EACJC,EAAAA,IAACC,EAAUA,YACTrC,aAAcA,EACdC,iBAAkBA,EAClBqC,OAASR,OAA2BS,EAAT,OAC3B9B,SAAUA,EACVC,IAAKA,EACLE,IAAKA,EAEL4B,SAAUV,EAAkB,YAASS,EACrCE,MAAM,OACN5B,mBAAoBA,EACpBC,OAAQA,EACRE,cAAeA,EACfD,YAAa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EAAAA,YAAY,CAAA,KAIXC,GAAqBjJ,EAE3B,OACEkJ,iBAAS1B,EAAaD,IAAK3C,EACzBlC,SAAA,CAAAX,EAAAA,IAACoH,GAAAA,qBAAqB3G,SACpB,CAAA3B,MAAO,CAAEuI,eAAgBpJ,EAAQqJ,yBAAyB,GAAM3G,SAChEX,EAAAA,IAACuH,GAAAA,cAAa,CAAA,mBACMb,EAClB/I,cAAeA,EACfiJ,WAAYA,GACZ9I,eAAgBA,EAChBC,eAAgBA,EAChBC,WAAYA,EACZE,WAAYA,EACZC,MAAOA,EACPE,SAAU6F,EACVtB,QAASoB,EACT2B,aAAcA,EACdpH,SAAUA,EACVG,OAAQA,EAASA,EAAS,aAAUyB,EACpCqF,IAAKtC,EACLrE,sBAAuByG,EACvBxG,MAAO2D,KACH8C,MAIPe,EAEAY,IACClH,MAACvC,GAAuB,CACtBC,UAAWiI,EACXhI,cAAeA,EACfC,aAAcA,EACdC,iBAAkBA,EAClBC,eAAgBA,EAChBC,eAAgBA,EAChBC,WAAYA,EACZE,WAAYA,EACZD,OAAQA,EACRE,MAAOA,EACPC,QAASgG,EACT/F,SAAUoG,EACVnG,IAAKA,EACLC,SAAUA,EACVC,IAAKA,EACLC,mBAAoBA,EACpBC,OAAQA,EAASA,EAAS,mBAAgByB,EAC1CvB,cAAeA,EACfD,YAAaA,EACbE,sBAAuBA,EACvBC,MAAO4D,EACP3D,YAAaA,MAInB"}
|
|
1
|
+
{"version":3,"file":"InputDatePicker-7227a858.js","sources":["../../src/UNSAFE_InputDatePicker/InputDatePickerDropdown.tsx","../../src/UNSAFE_InputDatePicker/useInputDatePickerState.ts","../../src/UNSAFE_InputDatePicker/useInputDatePicker.ts","../../src/UNSAFE_InputDatePicker/InputDatePicker.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { ComponentProps } from 'preact';\nimport { useCallback, useState } from 'preact/hooks';\nimport { BundleType } from '../resources/nls/bundle';\nimport { DatePicker } from '#UNSAFE_DatePicker';\nimport { type CloseDetail as DropdownCloseDetail } from '#UNSAFE_Dropdown';\nimport { getClientHints } from '#utils/PRIVATE_clientHints';\nimport { FormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { InlineUserAssistance } from '../UNSAFE_UserAssistance';\nimport { InputDatePicker } from './InputDatePicker';\nimport { dropdownStyles, userAssistanceStyles } from './themes/InputDatePickerDropdownStyles.css';\nimport { PositionData } from '../UNSAFE_Floating';\nimport { StickyPositioningDropdown } from '#PRIVATE_FormControls';\nimport { SectionedContent } from '#PRIVATE_FormControls';\nimport { type CloseDetail as SheetCloseDetail, Sheet } from '#UNSAFE_Sheet';\nimport type { TestIdProps } from '#hooks/UNSAFE_useTestId';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport { SizeOptions } from '#UNSAFE_Floating/Floating';\n\ntype StickyPositioningDropdownProps = ComponentProps<typeof StickyPositioningDropdown>;\ntype InputDatePickerProps = ComponentProps<typeof InputDatePicker>;\ntype PickedPropsFromInputDatePicker = Pick<\n InputDatePickerProps,\n | 'assistiveText'\n | 'dayFormatter'\n | 'daysOutsideMonth'\n | 'helpSourceLink'\n | 'helpSourceText'\n | 'isDisabled'\n | 'isReadonly'\n | 'label'\n | 'messages'\n | 'min'\n | 'max'\n | 'monthAndYearPicker'\n | 'todayButton'\n | 'todayTimeZone'\n | 'userAssistanceDensity'\n | 'value'\n | 'weekDisplay'\n>;\ntype DatePickerProps = ComponentProps<typeof DatePicker>;\ntype PickedPropsFromDatePicker = Pick<DatePickerProps, 'value' | 'onCommit'>;\ntype PickedPropsFromDropdown = Omit<StickyPositioningDropdownProps, 'onClose'>;\ntype CloseDetail = SheetCloseDetail | DropdownCloseDetail;\n\ntype Props = PickedPropsFromDatePicker &\n PickedPropsFromInputDatePicker &\n PickedPropsFromDropdown &\n TestIdProps & {\n /**\n * Called when the dropdown or sheet is supposed to be closed.\n */\n onClose?: (detail: CloseDetail) => void;\n };\n\n/**\n * Component that renders DatePicker either inside a dropdown or sheet; at small screen\n * widths, it renders inside a sheet. Additionally, when a dropdown is being shown beneath\n * the component, we also show any user assistance text or messages below the picker\n * because otherwise that information would be obscured from view. When a sheet is being\n * shown, it will always display UA and messages at the bottom of the sheet.\n */\nconst InputDatePickerDropdown = ({\n anchorRef,\n assistiveText,\n dayFormatter,\n daysOutsideMonth,\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isOpen,\n isReadonly,\n label,\n onClose,\n onCommit,\n max,\n messages,\n min,\n monthAndYearPicker,\n testId,\n todayButton,\n todayTimeZone,\n userAssistanceDensity,\n value,\n weekDisplay\n}: Props) => {\n // If the dropdown opens above the component, we don't want to show UA or messages.\n const [isDropdownAbove, setDropdownAbove] = useState(false);\n const [prevIsOpen, setPrevIsOpen] = useState(isOpen);\n const handleDropdownPosition = useCallback<\n NonNullable<StickyPositioningDropdownProps['onPosition']>\n >((data: PositionData) => {\n setDropdownAbove(data.placement.startsWith('top'));\n }, []);\n // Reset the flag when the dropdown is closed.\n if (prevIsOpen !== isOpen) {\n setPrevIsOpen(isOpen);\n if (!isOpen) {\n setDropdownAbove(false);\n }\n }\n\n const sizeOptions: SizeOptions = {\n isMaxWidthAdjusted: false,\n isMaxHeightAdjusted: true\n };\n\n // On mobile phones, the dropdown becomes a sheet.\n const shouldShowSheet = isPhone();\n\n const { datePicker_label } = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const datePickerAriaLabel = datePicker_label();\n\n const datePickerMainContent = (\n <DatePicker\n dayFormatter={dayFormatter}\n daysOutsideMonth={daysOutsideMonth}\n height={!shouldShowSheet ? 'auto' : undefined}\n onCommit={onCommit}\n max={max}\n min={min}\n // for sheet, we want the width to grow to the width of the sheet, otherwise it will use the theme default.\n maxWidth={shouldShowSheet ? '100%' : undefined}\n width=\"100%\"\n monthAndYearPicker={monthAndYearPicker}\n testId={testId}\n todayTimeZone={todayTimeZone}\n todayButton={todayButton}\n value={value}\n weekDisplay={weekDisplay}\n />\n );\n\n const inlineUserAssistanceFooter =\n isOpen &&\n (!isDropdownAbove || shouldShowSheet) &&\n !isDisabled &&\n !isReadonly &&\n (assistiveText || helpSourceLink || (messages && messages.length > 0)) &&\n (userAssistanceDensity === 'efficient' || userAssistanceDensity === 'reflow') ? (\n <FormFieldContext.Provider value={{ isFocused: true }}>\n <div class={userAssistanceStyles}>\n <InlineUserAssistance\n assistiveText={assistiveText}\n fieldLabel={label}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n messages={messages}\n userAssistanceDensity={userAssistanceDensity}\n />\n </div>\n </FormFieldContext.Provider>\n ) : undefined;\n\n const contentTestId = testId ? testId + (shouldShowSheet ? '_sheet' : '_dropdown') : undefined;\n\n // The same content is displayed either in a dropdown or sheet: date picker and inline UA.\n // Add styling to the dropdown to enforce a fixed width.\n const dropdownContent = (\n <div class={dropdownStyles}>\n <SectionedContent\n aria-label={datePickerAriaLabel}\n footer={inlineUserAssistanceFooter}\n hasFocusTrap={true}\n main={datePickerMainContent}\n role=\"dialog\"\n testId={contentTestId}\n />\n </div>\n );\n\n const dropdown = shouldShowSheet ? (\n <Sheet initialFocus=\"firstFocusable\" isOpen={isOpen} onClose={onClose}>\n <SectionedContent\n aria-label={datePickerAriaLabel}\n footer={inlineUserAssistanceFooter}\n hasFocusTrap={true}\n main={datePickerMainContent}\n role=\"dialog\"\n testId={contentTestId}\n />\n </Sheet>\n ) : (\n <StickyPositioningDropdown\n anchorRef={anchorRef}\n initialFocus=\"firstFocusable\"\n isOpen={isOpen}\n onClose={onClose}\n onPosition={handleDropdownPosition}\n sizeOptions={sizeOptions}>\n {dropdownContent}\n </StickyPositioningDropdown>\n );\n\n return dropdown;\n};\n\nconst isPhone = () => {\n return getClientHints().deviceType === 'phone';\n};\n\nexport { InputDatePickerDropdown, type CloseDetail };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { useReducer } from 'preact/hooks';\nimport type { CalendarDate, CalendarDateRequired } from '#utils/UNSAFE_calendarDateUtils';\nimport { isCompleteCalendarDate } from '#utils/UNSAFE_calendarDateUtils';\n\ntype InputDatePickerState = {\n /**\n * If dateValue is a complete date, then completeDateValue is the same as dateValue\n * otherwise is is undefined. We need to maintain separate states because\n * InputDateMask uses CalendarDate, but DatePicker uses CalendarDateRequired.\n * If the user types a partial date then opens the picker, we treat that as\n * no selection. The picker opens to the current month showing today.\n */\n completeDateValue?: CalendarDateRequired;\n\n /**\n * Represents the current date value of the component. The user either selected\n * the date in the picker, or typed it into the date field.\n */\n dateValue?: CalendarDate;\n};\n\ntype DateChangedAction = { type: 'dateChanged'; data?: CalendarDate };\ntype DateResetAction = { type: 'reset'; data?: CalendarDate };\ntype DateSelectedAction = { type: 'dateSelected'; data?: CalendarDateRequired };\ntype InputDatePickerReducerAction = DateChangedAction | DateResetAction | DateSelectedAction;\n\n// If dateVal is a complete date, return it as a CalendarDateRequired\n// otherwise return undefined.\nconst convertToCalendarDateRequired = (dateVal?: CalendarDate) => {\n return !dateVal || !isCompleteCalendarDate(dateVal)\n ? undefined\n : (dateVal as CalendarDateRequired);\n};\n\n// Use a reducer function to manage InputDatePickerState.\nconst inputDatePickerReducer = (\n state: InputDatePickerState,\n action: InputDatePickerReducerAction\n): InputDatePickerState => {\n switch (action.type) {\n case 'dateChanged': {\n return {\n ...state,\n dateValue: action.data,\n completeDateValue: convertToCalendarDateRequired(action.data)\n };\n }\n case 'dateSelected': {\n return { ...state, dateValue: action.data, completeDateValue: action.data };\n }\n case 'reset': {\n return {\n completeDateValue: convertToCalendarDateRequired(action.data),\n dateValue: action.data\n };\n }\n default:\n return state;\n }\n};\n\ntype Props = {\n /**\n * The value of the InputDatePicker, or undefined.\n */\n value?: CalendarDate;\n};\n\n/**\n * useInputDatePickerState calls useReducer to determine the initial state. Any changes to that state\n * are managed by dispatching actions to the reducer function.\n */\nconst useInputDatePickerState = ({ value }: Props) => {\n const [state, dispatch] = useReducer(inputDatePickerReducer, {\n completeDateValue: convertToCalendarDateRequired(value),\n dateValue: value\n });\n\n return { state, dispatch };\n};\n\nexport { useInputDatePickerState };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport type { ComponentProps, RefObject } from 'preact';\nimport type { ElementRef } from 'preact/compat';\nimport { useCallback, useEffect, useRef, useState } from 'preact/hooks';\nimport type { CalendarDate, CalendarDateRequired } from '#utils/UNSAFE_calendarDateUtils';\nimport { calendarDatesAreDifferent } from '#utils/PRIVATE_dayUtils';\nimport { DatePicker } from '#UNSAFE_DatePicker';\nimport { CloseDetail, InputDatePickerDropdown } from './InputDatePickerDropdown';\nimport { IconButton } from '#UNSAFE_IconButton';\nimport { InputDateMask } from '#UNSAFE_InputDateMask';\nimport { InputDatePicker } from './InputDatePicker';\nimport { useHiddenTestMethod } from '#hooks/UNSAFE_useHiddenTestMethod';\nimport { useInputDatePickerState } from './useInputDatePickerState';\nimport type { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\n\ntype InputDatePickerProps = ComponentProps<typeof InputDatePicker>;\ntype InputDateMaskProps = ComponentProps<typeof InputDateMask>;\ntype DatePickerProps = ComponentProps<typeof DatePicker>;\ntype IconButtonProps = ComponentProps<typeof IconButton>;\ntype DropdownProps = ComponentProps<typeof InputDatePickerDropdown>;\n\ntype IconButtonHandle = ElementRef<typeof IconButton>;\n\ntype Props = {\n isDisabled: InputDatePickerProps['isDisabled'];\n isReadonly: InputDatePickerProps['isReadonly'];\n onCommit: InputDatePickerProps['onCommit'];\n onInput: InputDatePickerProps['onInput'];\n rootRef: RefObject<HTMLElement>;\n value: InputDatePickerProps['value'];\n};\n\n/**\n * Hook that provides handlers and other functionality for InputDatePicker.\n */\nconst useInputDatePicker = ({\n isDisabled,\n isReadonly,\n onCommit,\n onInput,\n rootRef,\n value: currentValue\n}: Props) => {\n // Whether the dropdown is open.\n const [isOpen, setIsOpen] = useState(false);\n\n // Ref to the calendar icon button.\n const iconRef = useRef<IconButtonHandle>(null);\n\n // Ref to the InputDateMask component.\n const maskRef: RefObject<HTMLElement> = useRef<HTMLElement>(null);\n\n // Keep track of whether the dropdown was just dismissed from an outside mousedown event.\n const outsideMousedownRef = useRef<boolean>(false);\n const outsideMousedownTimerRef = useRef<ReturnType<typeof setTimeout> | undefined>();\n\n // Keep track of the last date values passed to onInput and onCommit.\n const lastCommittedDateRef = useRef<CalendarDate | undefined>(currentValue);\n const lastDateRef = useRef<CalendarDate | undefined>(currentValue);\n\n // Keep track of the last controlled value passed from the parent, so we can detect a programmatic change.\n const lastValueFromParentRef = useRef<CalendarDate | undefined>(currentValue);\n\n // Keep track of whether a date was selected in the date picker.\n const dateSelectedRef = useRef<boolean>(false);\n\n const { state, dispatch } = useInputDatePickerState({ value: currentValue });\n\n // If a new value is being pushed from the parent, and that value differs from\n // the current value of the reducer, then this is a programmatic update\n // and we need to call 'reset' to update the reducer state. Otherwise, the only\n // time the reducer state is updated from the value is on mount.\n if (calendarDatesAreDifferent(lastValueFromParentRef.current, currentValue)) {\n lastValueFromParentRef.current = currentValue;\n if (calendarDatesAreDifferent(currentValue, state.dateValue)) {\n dispatch({ type: 'reset', data: currentValue });\n lastDateRef.current = currentValue;\n lastCommittedDateRef.current = currentValue;\n }\n }\n\n // Reducer updates are async, so wait until the state updates and then call our callbacks.\n useEffect(() => {\n if (calendarDatesAreDifferent(state.dateValue, lastDateRef.current)) {\n onInput({ previousValue: lastDateRef.current, value: state.dateValue });\n lastDateRef.current = state.dateValue;\n }\n if (\n dateSelectedRef.current &&\n calendarDatesAreDifferent(state.dateValue, lastCommittedDateRef.current)\n ) {\n onCommit?.({ previousValue: lastCommittedDateRef.current, value: state.dateValue });\n lastCommittedDateRef.current = state.dateValue;\n dateSelectedRef.current = false;\n }\n }, [onCommit, onInput, state.dateValue]);\n\n // Handle onInput from InputDateMask as segment values are being added or changed in the input field.\n // We wait for the state to update before calling onInput.\n const maskInputHandler = useCallback<InputDateMaskProps['onInput']>(\n (detail: ValueUpdateDetail<CalendarDate>) => {\n dispatch({ type: 'dateChanged', data: detail.value });\n },\n [dispatch]\n );\n\n // Handle onCommit from InputDateMask, which is called when the user presses Enter or the field is blurred.\n const maskCommitHandler = useCallback<NonNullable<InputDateMaskProps['onCommit']>>(\n (detail: ValueUpdateDetail<CalendarDate>) => {\n // If the value we get from InputDateMask's onCommit differs from the last committed value, then call onCommit.\n if (calendarDatesAreDifferent(lastCommittedDateRef.current, detail.value)) {\n onCommit?.({ value: detail.value, previousValue: lastCommittedDateRef.current });\n lastCommittedDateRef.current = detail.value;\n }\n },\n [onCommit]\n );\n\n // Respond to onAction event from the calendar icon button. Toggles the date picker dropdown.\n const calendarIconActionHandler = useCallback<NonNullable<IconButtonProps['onAction']>>(() => {\n // Only toggle the value of isOpen if we didn't just dismiss the dropdown.\n if (!outsideMousedownRef.current) {\n setIsOpen((prevIsOpen) => !prevIsOpen);\n }\n outsideMousedownRef.current = false;\n }, []);\n\n const dropdownCloseHandler = useCallback<NonNullable<DropdownProps['onClose']>>(\n (detail: CloseDetail) => {\n // Keep track of when the dropdown is closed via outside mousedown, including when the calendar icon\n // is clicked. We need this in order to toggle visibility of the picker and dropdown.\n if (detail.reason === 'outsideMousedown') {\n outsideMousedownRef.current = true;\n clearTimeout(outsideMousedownTimerRef.current);\n\n // Clear the flag after a short delay to ensure the dropdown can be opened again.\n outsideMousedownTimerRef.current = setTimeout(() => {\n outsideMousedownRef.current = false;\n }, 200);\n } else if (detail.reason === 'dismissed' || detail.reason === 'keyboardDismissed') {\n // Focus the calendar icon when the dropdown is closed.\n iconRef.current?.focus();\n }\n setIsOpen(false);\n },\n []\n );\n\n // Handle date selection in the picker.\n // - Updates the value in state.\n // - Closes the dropdown.\n // - Sets focus to the date field.\n const datePickerCommitHandler = useCallback<DatePickerProps['onCommit']>(\n (detail: ValueUpdateDetail<CalendarDateRequired>) => {\n // Set focus to the calendar icon when a date is selected.\n iconRef.current?.focus();\n\n // Set a ref indicating a date was selected.\n dateSelectedRef.current = true;\n dispatch({ type: 'dateSelected', data: detail.value });\n setIsOpen(false);\n },\n [dispatch]\n );\n\n // Create a changeValue method that can be called by a test adapter to simulate a user\n // changing the value and committing it.\n const changeValue = useCallback(\n (newValue?: CalendarDate) => {\n // We always want this method available on the DOM element so that a test can call it,\n // but we only want it to change the value when the component is enabled because that's\n // the only time the user could change the value through the UI.\n if (!isReadonly && !isDisabled) {\n onInput({ value: newValue, previousValue: currentValue });\n onCommit?.({ value: newValue, previousValue: currentValue });\n return Promise.resolve();\n }\n return Promise.reject('Component is readonly or disabled');\n },\n [currentValue, isDisabled, isReadonly, onCommit, onInput]\n );\n // Expose _changeValue as a hidden method on the root DOM.\n useHiddenTestMethod({\n elementRef: rootRef,\n method: changeValue,\n name: '_changeValue'\n });\n\n return {\n calendarIconActionHandler,\n datePickerCommitHandler,\n dropdownCloseHandler,\n completeDateValue: state.completeDateValue,\n dateValue: state.dateValue,\n iconRef,\n isOpen,\n maskCommitHandler,\n maskInputHandler,\n maskRef\n };\n};\n\nexport { useInputDatePicker };\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { ComponentProps, Ref } from 'preact';\nimport { forwardRef } from 'preact/compat';\nimport { useImperativeHandle, useRef } from 'preact/hooks';\nimport { BundleType } from '../resources/nls/bundle';\nimport { CalendarIcon } from '#PRIVATE_ThemedIcons/CalendarIcon';\nimport {\n CalendarDate,\n CalendarDatePlaceholders,\n InputDateMask,\n InputDateMaskContext\n} from '#UNSAFE_InputDateMask';\nimport { DatePicker } from '#UNSAFE_DatePicker';\nimport { HiddenAccessible } from '#UNSAFE_HiddenAccessible';\nimport { IconButton } from '#UNSAFE_IconButton';\nimport { InputDatePickerDropdown } from './InputDatePickerDropdown';\nimport { FocusableHandle } from '#hooks/UNSAFE_useFocusableTextField';\nimport { merge } from '@oracle/oraclejet-internal-utilities/stringUtils';\nimport { useFormContext } from '#hooks/UNSAFE_useFormContext';\nimport { useId } from '#hooks/UNSAFE_useId';\nimport { useInputDatePicker } from './useInputDatePicker';\nimport { useTestId } from '#hooks/UNSAFE_useTestId';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\n\ntype InputDateMaskProps = ComponentProps<typeof InputDateMask>;\ntype PickedPropsFromInputDateMask = Pick<\n InputDateMaskProps,\n | 'aria-describedby'\n | 'assistiveText'\n | 'columnSpan'\n | 'helpSourceLink'\n | 'helpSourceText'\n | 'isDisabled'\n | 'isReadonly'\n | 'isRequired'\n | 'isRequiredShown'\n | 'label'\n | 'labelEdge'\n | 'labelStartWidth'\n | 'messages'\n | 'textAlign'\n | 'testId'\n | 'userAssistanceDensity'\n | 'variant'\n>;\n\ntype DatePickerProps = ComponentProps<typeof DatePicker>;\ntype PickedPropsFromDatePicker = Pick<\n DatePickerProps,\n | 'dayFormatter'\n | 'daysOutsideMonth'\n | 'max'\n | 'min'\n | 'monthAndYearPicker'\n | 'todayTimeZone'\n | 'todayButton'\n | 'weekDisplay'\n>;\n\ntype Props = PickedPropsFromInputDateMask &\n PickedPropsFromDatePicker & {\n /**\n * If specified, overrides the locale specific order of the individual date segments\n * in the date field as well as the locale specific separator. The value of each placeholder\n * is only used when the type is 'literal', otherwise it is replaced with a translated\n * placeholder for month, day, or year. The placeholders must include month, day, and year.\n */\n masks?: CalendarDatePlaceholders;\n\n /**\n * The current display value of the component.\n * This is a CalendarDate, not CalendarDateRequired, because this is a controlled component and\n * the user may type the month, day, and year separately. If a selection is made in the date\n * picker, then the value is a complete date.\n */\n value?: CalendarDate;\n\n /**\n * Callback invoked when the user commits the entered value by blurring or hitting the enter key.\n * It is also called when a selection is made in the date picker.\n */\n onCommit?: (detail: ValueUpdateDetail<CalendarDate>) => void;\n\n /**\n * Callback invoked each time the user changes the value of a segment. For example, if the user\n * types '12' into the month segment, this callback will be called twice to change the month\n * first to '1' and then '12'.\n */\n onInput: (detail: ValueUpdateDetail<CalendarDate>) => void;\n };\n\n/**\n * InputDatePicker allows users to enter or select a single date using a calendar interface.\n */\nexport const InputDatePicker = forwardRef(\n (\n {\n 'aria-describedby': propDescribedBy,\n assistiveText,\n dayFormatter,\n daysOutsideMonth,\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isReadonly,\n label,\n max,\n messages,\n min,\n monthAndYearPicker,\n todayTimeZone,\n todayButton,\n value,\n onCommit,\n onInput,\n testId,\n userAssistanceDensity: propUserAssistanceDensity,\n weekDisplay,\n ...dateMaskProps\n }: Props,\n ref?: Ref<FocusableHandle>\n ) => {\n const testIdProps = useTestId(testId);\n const rootRef = useRef<HTMLDivElement>(null);\n\n const {\n calendarIconActionHandler,\n datePickerCommitHandler,\n completeDateValue,\n dateValue,\n dropdownCloseHandler,\n iconRef,\n isOpen,\n maskCommitHandler,\n maskInputHandler,\n maskRef\n } = useInputDatePicker({\n isDisabled,\n isReadonly,\n onCommit,\n onInput,\n rootRef,\n value\n });\n\n const mainFieldRef = useRef<HTMLDivElement>(null);\n const { inputDatePicker_selectDate, inputDatePicker_instruction } =\n useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const calendarIconAriaLabel = inputDatePicker_selectDate();\n\n // We need this to determine if UA/messaging should be shown in the dropdown.\n const { userAssistanceDensity: formUserAssistanceDensity } = useFormContext();\n const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;\n\n useImperativeHandle(ref!, () => ({\n focus: () => {\n maskRef.current?.focus();\n },\n blur: () => {\n maskRef.current?.blur();\n }\n }));\n\n const maskFieldInstructionId = useId();\n const maskFieldInstructionText = inputDatePicker_instruction();\n const maskFieldInstruction =\n !isDisabled && !isReadonly ? (\n <HiddenAccessible id={maskFieldInstructionId} isHidden={true}>\n {maskFieldInstructionText}\n </HiddenAccessible>\n ) : undefined;\n const ariaDescribedBy =\n !isDisabled && !isReadonly\n ? merge([propDescribedBy, maskFieldInstructionId])\n : propDescribedBy;\n\n const endContent = (\n <IconButton\n aria-haspopup=\"dialog\"\n aria-label={calendarIconAriaLabel}\n isDisabled={isDisabled}\n ref={iconRef}\n size=\"sm\"\n testId={testId ? testId + '_calendarIcon' : undefined}\n variant=\"ghost\"\n onAction={calendarIconActionHandler}>\n <CalendarIcon />\n </IconButton>\n );\n\n const shouldShowDropdown = isOpen as boolean;\n\n return (\n <div {...testIdProps} ref={rootRef}>\n <InputDateMaskContext.Provider\n value={{ isDropdownOpen: isOpen, isInputDatePickerParent: true }}>\n <InputDateMask\n aria-describedby={ariaDescribedBy}\n assistiveText={assistiveText}\n endContent={endContent}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n isDisabled={isDisabled}\n isReadonly={isReadonly}\n label={label}\n onCommit={maskCommitHandler}\n onInput={maskInputHandler}\n mainFieldRef={mainFieldRef}\n messages={messages}\n testId={testId ? testId + '_mask' : undefined}\n ref={maskRef}\n userAssistanceDensity={propUserAssistanceDensity}\n value={dateValue}\n {...dateMaskProps}\n />\n </InputDateMaskContext.Provider>\n\n {maskFieldInstruction}\n\n {shouldShowDropdown && (\n <InputDatePickerDropdown\n anchorRef={mainFieldRef}\n assistiveText={assistiveText}\n dayFormatter={dayFormatter}\n daysOutsideMonth={daysOutsideMonth}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n isDisabled={isDisabled}\n isReadonly={isReadonly}\n isOpen={isOpen}\n label={label}\n onClose={dropdownCloseHandler}\n onCommit={datePickerCommitHandler}\n max={max}\n messages={messages}\n min={min}\n monthAndYearPicker={monthAndYearPicker}\n testId={testId ? testId + '_datePicker' : undefined}\n todayTimeZone={todayTimeZone}\n todayButton={todayButton}\n userAssistanceDensity={userAssistanceDensity}\n value={completeDateValue}\n weekDisplay={weekDisplay}\n />\n )}\n </div>\n );\n }\n);\n"],"names":["InputDatePickerDropdown","anchorRef","assistiveText","dayFormatter","daysOutsideMonth","helpSourceLink","helpSourceText","isDisabled","isOpen","isReadonly","label","onClose","onCommit","max","messages","min","monthAndYearPicker","testId","todayButton","todayTimeZone","userAssistanceDensity","value","weekDisplay","isDropdownAbove","setDropdownAbove","useState","prevIsOpen","setPrevIsOpen","handleDropdownPosition","useCallback","data","placement","startsWith","shouldShowSheet","isPhone","datePicker_label","useTranslationBundle","datePickerAriaLabel","datePickerMainContent","_jsx","DatePicker","height","undefined","maxWidth","width","inlineUserAssistanceFooter","length","FormFieldContext","Provider","isFocused","children","jsx","class","userAssistanceStyles","InlineUserAssistance","fieldLabel","contentTestId","dropdownContent","dropdownStyles","SectionedContent","footer","hasFocusTrap","main","role","Sheet","initialFocus","StickyPositioningDropdown","onPosition","sizeOptions","isMaxWidthAdjusted","isMaxHeightAdjusted","getClientHints","deviceType","convertToCalendarDateRequired","dateVal","isCompleteCalendarDate","inputDatePickerReducer","state","action","type","dateValue","completeDateValue","useInputDatePicker","onInput","rootRef","currentValue","setIsOpen","iconRef","useRef","maskRef","outsideMousedownRef","outsideMousedownTimerRef","lastCommittedDateRef","lastDateRef","lastValueFromParentRef","dateSelectedRef","dispatch","useReducer","useInputDatePickerState","calendarDatesAreDifferent","current","useEffect","previousValue","maskInputHandler","detail","maskCommitHandler","calendarIconActionHandler","dropdownCloseHandler","reason","clearTimeout","setTimeout","focus","datePickerCommitHandler","changeValue","newValue","Promise","reject","resolve","useHiddenTestMethod","elementRef","method","name","InputDatePicker","forwardRef","propDescribedBy","propUserAssistanceDensity","dateMaskProps","ref","testIdProps","useTestId","mainFieldRef","inputDatePicker_selectDate","inputDatePicker_instruction","calendarIconAriaLabel","formUserAssistanceDensity","useFormContext","useImperativeHandle","blur","maskFieldInstructionId","useId","maskFieldInstructionText","maskFieldInstruction","HiddenAccessible","id","isHidden","ariaDescribedBy","merge","endContent","IconButton","size","variant","onAction","CalendarIcon","shouldShowDropdown","_jsxs","InputDateMaskContext","isDropdownOpen","isInputDatePickerParent","InputDateMask"],"mappings":"upEAsEA,MAAMA,GAA0B,EAC9BC,YACAC,gBACAC,eACAC,mBACAC,iBACAC,iBACAC,aACAC,SACAC,aACAC,QACAC,UACAC,WACAC,MACAC,WACAC,MACAC,qBACAC,SACAC,cACAC,gBACAC,wBACAC,QACAC,kBAGA,MAAOC,EAAiBC,GAAoBC,EAAQA,UAAC,IAC9CC,EAAYC,GAAiBF,EAAQA,SAACjB,GACvCoB,EAAyBC,eAE5BC,IACDN,EAAiBM,EAAKC,UAAUC,WAAW,OAAO,GACjD,IAECN,IAAelB,IACjBmB,EAAcnB,GACTA,GACHgB,GAAiB,IAIrB,MAMMS,EAAkBC,MAElBC,iBAAEA,GAAqBC,EAAoBA,qBAAa,4BACxDC,EAAsBF,IAEtBG,EACJC,EAAAA,IAACC,EAAUA,YACTrC,aAAcA,EACdC,iBAAkBA,EAClBqC,OAASR,OAA2BS,EAAT,OAC3B9B,SAAUA,EACVC,IAAKA,EACLE,IAAKA,EAEL4B,SAAUV,EAAkB,YAASS,EACrCE,MAAM,OACN5B,mBAAoBA,EACpBC,OAAQA,EACRE,cAAeA,EACfD,YAAaA,EACbG,MAAOA,EACPC,YAAaA,IAIXuB,GACJrC,GACEe,IAAmBU,GACpB1B,GACAE,KACAP,GAAiBG,GAAmBS,GAAYA,EAASgC,OAAS,IACxC,cAA1B1B,GAAmE,WAA1BA,OAatCsB,EAZFH,MAACQ,EAAAA,iBAAiBC,SAAQ,CAAC3B,MAAO,CAAE4B,WAAW,GAAMC,SACnDX,EAAKY,IAAA,MAAA,CAAAC,MAAOC,gCACVd,EAAAA,IAACe,EAA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AChBC,eAAgBA,EAChBC,WAAYA,EACZE,WAAYA,EACZC,MAAOA,EACPE,SAAU6F,EACVtB,QAASoB,EACT2B,aAAcA,EACdpH,SAAUA,EACVG,OAAQA,EAASA,EAAS,aAAUyB,EACpCqF,IAAKtC,EACLrE,sBAAuByG,EACvBxG,MAAO2D,KACH8C,MAIPe,EAEAY,IACClH,MAACvC,GAAuB,CACtBC,UAAWiI,EACXhI,cAAeA,EACfC,aAAcA,EACdC,iBAAkBA,EAClBC,eAAgBA,EAChBC,eAAgBA,EAChBC,WAAYA,EACZE,WAAYA,EACZD,OAAQA,EACRE,MAAOA,EACPC,QAASgG,EACT/F,SAAUoG,EACVnG,IAAKA,EACLC,SAAUA,EACVC,IAAKA,EACLC,mBAAoBA,EACpBC,OAAQA,EAASA,EAAS,mBAAgByB,EAC1CvB,cAAeA,EACfD,YAAaA,EACbE,sBAAuBA,EACvBC,MAAO4D,EACP3D,YAAaA,MAInB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact/compat', 'preact/hooks', './LayerHost-0b288129', './StyledCheckbox-368fed68', 'css!./SelectorStyles.styles.css', './CollectionInteractionContext-0b4ed98b', 'css!./DragAndDropStyles.styles.css', 'css!./ReorderableItemStyles.styles.css', './ReorderableContext-6d10a1b7', './HiddenAccessible-037ef42d', './List-daac1169', './TabbableModeContext-a9c97640', './logger-0f873e29', './flexitem-5db48325', './PRIVATE_List/themes/ListStyles.css', './UNSAFE_GroupedList/themes/GroupedListStyles.css', 'module', './Flex-4b81b412', './Skeleton-3e52c94a', './keys-4755c121', './useReorderableItem-7b4b2c3d', './classNames-08d99695', './useNavigation-4d87e7e6', './UNSAFE_ListView/themes/ListViewStyles.css', './mergeProps-bcfa6a92', './collectionUtils-77dc5fa1', './Menu-1b8fefc5', './MenuItem-85e4ffdc', 'preact', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-2bb62284', 'css!./IconStyle.styles.css', './SelectMenuGroupContext-67f24a8f', './UNSAFE_Menu/themes/MenuItemStyles.css', './UNSAFE_Separator/themes/SeparatorStyles.css', 'css!./MenuSeparatorStyles.styles.css', 'module', './UNSAFE_Menu/themes/redwood/MenuSeparatorVariants.css', './menuUtils-8e42385f', 'css!./MenuStyles.styles.css', './useItemAction-3616efde', './useContextMenuGesture-750ef2c6', './LoadMoreCollection-895f1ed5'], (function(e,t,r,o,s,n,i,a,l,c,d,u,m,f,y,I,S,p,C,g,x,R,b,h,M,v,L,T,E,P,k,O,_,K,w,A,D,F,j,N,U,V,G,B,H,z,Z){"use strict";const J=r.memo((function({children:e,dragKey:r,setDragKey:s,onReorder:n,rootRef:i,itemKey:a}){const l=o.useRef(null),c={itemOverlayFront:v.styles.reorderableItemOverlayFront,itemOverlayRear:v.styles.reorderableItemOverlayRear,itemDragger:v.styles.reorderableItemDragger},d=o.useCallback((e=>{e.dataTransfer?.setData("text/listview-items-key",JSON.stringify(a))}),[a]),{rootProps:u,isDragged:m,overlayZoneBeforeProps:f,overlayZoneAfterProps:y}=b.useReorderableItem({isDisabled:!n,dragKey:r,setDragKey:s,onReorder:n,rootRef:i,ref:l,getItem:()=>l?.current?.closest(M.LIST_ITEM_SELECTOR),setTransferData:d,itemStyles:c,itemSelector:M.LIST_ITEM_SELECTOR,isVertical:!0}),I=h.classNames([u?.class,v.styles.reorderableItemDnd]);return t.jsxs("div",{...u,class:I,children:[e,!m&&R.isKeyDefined(r)&&t.jsxs(t.Fragment,{children:[t.jsx("div",{...f}),t.jsx("div",{...y})]})]})}),((e,t)=>!(!e||!t)&&(e.children===t.children&&e.dragKey===t.dragKey)));function Y({contextMenuConfig:e,testId:r,contextMenuContext:o,...s}){const n=e.accessibleLabel;let i;if(s.isOpen){if(i=e.itemsRenderer(o),G.isMenuChildrenFalsy(i))return null}else i=null;return t.jsx(E.Menu,{...s,...n&&{"aria-label":n},testId:r,children:i})}const q={mouse:{initialFocus:"menu",placement:"bottom-start",offsetValue:0},keyboard:{initialFocus:"firstItem",placement:"bottom-start",offsetValue:0},touch:{initialFocus:"firstItem",placement:"end",offsetValue:40}},Q={isOpen:!1,initialFocus:"menu",placement:"bottom-start",offsetValue:0,anchorRef:{current:null}},W=r.forwardRef((({children:e,...r},s)=>{const{contextMenuConfig:n}=r,i=o.useRef(null),{currentItemOverride:a,updateCurrentItemOverride:l}=(e=>{const t=o.useRef(),r=o.useRef();r.current!==e&&(r.current=e,t.current=e);const s=o.useCallback((e=>{t.current={rowKey:e}}),[]);return{currentItemOverride:t.current,updateCurrentItemOverride:s}})(r.currentItemOverride),c=r.data?r.data.map((e=>({data:e,metadata:{key:r.getRowKey(e)}}))):null,f=r.onLoadMore?r.onLoadMore:()=>{},y=c?{offset:0,data:c,sizePrecision:r.hasMore?"atLeast":"exact",totalSize:c.length}:null;o.useImperativeHandle(s,(()=>({getScrollPosition:()=>i.current?m.getScrollPosition(i.current):{y:0},focus:()=>{i.current&&i.current.focus()}})));const I=null!=r.onReorder,{reorderProps:S,reorderItemProps:p,reorderContext:C,reorderInstructionsId:g,reorderInstructions:x}=(({onReorder:e,rootRef:t,viewportConfig:r})=>{const s=null!=e,[n,i]=o.useState(void 0),{reorderProps:a,reorderContext:l,reorderInstructionsId:c,reorderInstructions:d}=b.useReorderable({onReorder:e,rootRef:t,itemSelector:M.LIST_ITEM_SELECTOR,isDisabled:!s,columns:1}),u=o.useRef(!1);o.useEffect((()=>{if(s&&u.current){const e=t.current,o=T.findElementByKey(e,l.currentItemKey.current,M.LIST_ITEM_SELECTOR);if(o){const t=r?.scrollerRef.current||e;M.scrollToVisible(o,t,0),u.current=!1}}}));const m=o.useMemo((()=>({dragKey:n,setDragKey:i,onReorder:e,rootRef:t})),[n,e,t]);return s?{reorderProps:L.mergeProps({onKeyDown:e=>{s&&("ArrowUp"===e.key||"ArrowDown"===e.key)&&(e.metaKey||e.ctrlKey)&&e.shiftKey&&(u.current=!0,a.onKeyDown?.(e))},onDragOver:e=>{void 0!==n&&(u.current=!1,T.dragToScroll(e,void 0!==n,t.current))}}),reorderItemProps:m,reorderContext:l,reorderInstructionsId:c,reorderInstructions:d}:{reorderProps:a,reorderContext:l,reorderInstructionsId:c,reorderInstructions:d}})({onReorder:r.onReorder,rootRef:i,viewportConfig:r.viewportConfig}),{triggerProps:R,menuProps:h,contextMenuContext:v,notifyCurrentKeyChanged:E}=((e,t,r,s)=>{const[n,i]=o.useState(),[a,l]=o.useState(Q),c=o.useRef(),{triggerProps:d}=z.useContextMenuGesture((({gesture:t,anchor:o,target:n})=>{let a=o;if("keyboard"===t){a=T.findElementByKey(r.current,c.current,M.LIST_ITEM_SELECTOR)||o;const t=H.findItemContext(c.current,e);i(t)}else{const t=T.keyExtractor(n,M.LIST_ITEM_SELECTOR),r=H.findItemContext(t,e);i(r),s(t)}l({...q[t],anchorRef:{current:a},isOpen:!0})}),{isDisabled:!t}),u=o.useCallback((e=>{"dismissed"!==e.reason&&"itemAction"!==e.reason||r.current?.focus({preventScroll:!0}),l({...Q})}),[r]);return{menuProps:{...a,onClose:u},onClose:u,contextMenuContext:n,triggerProps:d,notifyCurrentKeyChanged:e=>{c.current=e.value}}})(y,n,i,l),P=e=>{r.onPersistCurrentItem?.(e),E(e)},k=o.useCallback((r=>t.jsx(J,{...p,itemKey:r.metadata.key,children:e(r)})),[e,p]);if(I&&p)return t.jsxs(t.Fragment,{children:[t.jsxs(d.ReorderableContext.Provider,{value:C,children:[t.jsx(m.List,{...r,"aria-describedby":g,contextMenuTriggerProps:R,reorderProps:S,onLoadRange:f,scrollerRef:i,data:y,currentItemOverride:a,onPersistCurrentItem:P,children:k}),t.jsx("span",{id:g,children:t.jsx(u.HiddenAccessible,{children:x})})]}),n&&t.jsx(Y,{...h,testId:r.testId?r.testId+"-menu":void 0,contextMenuConfig:n,contextMenuContext:v})]});return t.jsxs(t.Fragment,{children:[t.jsx(m.List,{...r,loadingIndicator:r.skeletonRenderer?(O=r.skeletonRenderer,t.jsx(m.SkeletonContainer,{minimumCount:25,children:e=>O({loadingStatus:"initial",index:e})})):void 0,loadMoreIndicator:r.skeletonRenderer?(e=>t.jsx("div",{class:Z.LOADMORE_STYLE_CLASS,children:t.jsx(m.SkeletonContainer,{minimumCount:3,children:t=>e({loadingStatus:"loadMore",index:t})})}))(r.skeletonRenderer):void 0,onLoadRange:f,scrollerRef:i,data:y,contextMenuTriggerProps:R,currentItemOverride:a,onPersistCurrentItem:P,children:e}),n&&t.jsx(Y,{...h,contextMenuConfig:n,contextMenuContext:v,testId:r.testId?r.testId+"-menu":void 0})]});var O}));e.ListView=W}));
|
|
2
|
+
//# sourceMappingURL=ListView-6d21e8f9.js.map
|