@oracle/oraclejet-preact 18.0.6 → 18.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/amd/{BarChart-077c5f02.js → BarChart-5e9f46b4.js} +2 -2
- package/amd/{BarChart-077c5f02.js.map → BarChart-5e9f46b4.js.map} +1 -1
- package/amd/{BaseCardView-70b177ed.js → BaseCardView-ab799b69.js} +2 -2
- package/amd/{BaseCardView-70b177ed.js.map → BaseCardView-ab799b69.js.map} +1 -1
- package/amd/CardFlexView-296f97f5.js +2 -0
- package/amd/{CardFlexView-bb5c4369.js.map → CardFlexView-296f97f5.js.map} +1 -1
- package/amd/{CardGridView-c28ff2f7.js → CardGridView-054ffc3f.js} +2 -2
- package/amd/{CardGridView-c28ff2f7.js.map → CardGridView-054ffc3f.js.map} +1 -1
- package/amd/{Chart-3621e125.js → Chart-e2807ff7.js} +2 -2
- package/amd/{Chart-3621e125.js.map → Chart-e2807ff7.js.map} +1 -1
- package/amd/{ComboChart-fd7da90e.js → ComboChart-71c0f51f.js} +2 -2
- package/amd/{ComboChart-fd7da90e.js.map → ComboChart-71c0f51f.js.map} +1 -1
- package/amd/ExpandableList-dd3a05b4.js +1 -1
- package/amd/GroupLoadingIndicator-6b2ab709.js +1 -1
- package/amd/{Indexer-357554c4.js → Indexer-1531dbc3.js} +2 -2
- package/amd/{Indexer-357554c4.js.map → Indexer-1531dbc3.js.map} +1 -1
- package/amd/InputDatePicker-18e2546b.js +2 -0
- package/amd/{InputDatePicker-fc39f0a6.js.map → InputDatePicker-18e2546b.js.map} +1 -1
- package/amd/{LineAreaChart-4140d004.js → LineAreaChart-b4acee62.js} +2 -2
- package/amd/{LineAreaChart-4140d004.js.map → LineAreaChart-b4acee62.js.map} +1 -1
- package/amd/List-0b764e84.js +2 -0
- package/amd/{List-04c4fed0.js.map → List-0b764e84.js.map} +1 -1
- package/amd/{ListView-bf740071.js → ListView-5bb45f81.js} +2 -2
- package/amd/{ListView-bf740071.js.map → ListView-5bb45f81.js.map} +1 -1
- package/amd/LoadMoreCollection-83413a59.js +2 -0
- package/amd/{LoadMoreCollection-a6adbc3f.js.map → LoadMoreCollection-83413a59.js.map} +1 -1
- package/amd/PRIVATE_BaseCardView.js +1 -1
- package/amd/PRIVATE_Chart.js +1 -1
- package/amd/PRIVATE_List.js +1 -1
- package/amd/PRIVATE_LoadMoreCollection.js +1 -1
- package/amd/PRIVATE_SelectCommon.js +1 -1
- package/amd/PRIVATE_Table.js +1 -1
- package/amd/PRIVATE_VirtualizedCollection.js +1 -1
- package/amd/ReadonlyTextFieldVariants.styles.css +20 -20
- package/amd/ReadonlyTextFieldVariants.styles2.css +20 -20
- package/amd/{ScatterChart-88304601.js → ScatterChart-0ca7c658.js} +2 -2
- package/amd/{ScatterChart-88304601.js.map → ScatterChart-0ca7c658.js.map} +1 -1
- package/amd/{SelectMultiple-e3a6732b.js → SelectMultiple-7e9bd455.js} +2 -2
- package/amd/{SelectMultiple-e3a6732b.js.map → SelectMultiple-7e9bd455.js.map} +1 -1
- package/amd/{SelectSingle-9d0dca8f.js → SelectSingle-466bcd67.js} +2 -2
- package/amd/{SelectSingle-9d0dca8f.js.map → SelectSingle-466bcd67.js.map} +1 -1
- package/amd/{Table-31cc83c6.js → Table-87f7e3c4.js} +2 -2
- package/amd/{Table-31cc83c6.js.map → Table-87f7e3c4.js.map} +1 -1
- package/amd/{TableView-ab5d0c12.js → TableView-2b884e2c.js} +2 -2
- package/amd/{TableView-ab5d0c12.js.map → TableView-2b884e2c.js.map} +1 -1
- package/amd/TextArea-a7a3d82f.js +2 -0
- package/amd/TextArea-a7a3d82f.js.map +1 -0
- package/amd/TextAreaAutosize-9cd2c1e8.js +2 -0
- package/amd/{TextAreaAutosize-81449e46.js.map → TextAreaAutosize-9cd2c1e8.js.map} +1 -1
- package/amd/Theme-redwood/theme.css +254 -254
- package/amd/Theme-stable/theme.css +393 -393
- package/amd/UNSAFE_BarChart/__test__/BarChart.spec.js +1 -1
- package/amd/UNSAFE_BarChart.js +1 -1
- package/amd/UNSAFE_CardFlexView.js +1 -1
- package/amd/UNSAFE_CardGridView.js +1 -1
- package/amd/UNSAFE_ComboChart.js +1 -1
- package/amd/UNSAFE_ExpandableList.js +1 -1
- package/amd/UNSAFE_Indexer.js +1 -1
- package/amd/UNSAFE_InputDateMask.js +1 -1
- package/amd/UNSAFE_InputDatePicker.js +1 -1
- package/amd/UNSAFE_InputPassword.js +1 -1
- package/amd/UNSAFE_InputSensitiveText.js +1 -1
- package/amd/UNSAFE_InputSensitiveText.js.map +1 -1
- package/amd/UNSAFE_InputText.js +1 -1
- package/amd/UNSAFE_InputTimeMask.js +1 -1
- package/amd/UNSAFE_InputTimeMask.js.map +1 -1
- package/amd/UNSAFE_LabelledLink.js +1 -1
- package/amd/UNSAFE_LabelledLink.js.map +1 -1
- package/amd/UNSAFE_LineAreaChart.js +1 -1
- package/amd/UNSAFE_ListView.js +1 -1
- package/amd/UNSAFE_NumberInputText.js +1 -1
- package/amd/UNSAFE_ScatterChart.js +1 -1
- package/amd/UNSAFE_SelectMultiple.js +1 -1
- package/amd/UNSAFE_SelectSingle.js +1 -1
- package/amd/UNSAFE_TableView.js +1 -1
- package/amd/UNSAFE_TextArea.js +1 -1
- package/amd/UNSAFE_TextAreaAutosize.js +1 -1
- package/amd/UNSAFE_TextField/themes/redwood/ReadonlyTextFieldTheme.js +1 -1
- package/amd/UNSAFE_TextField/themes/redwood/ReadonlyTextFieldTheme.js.map +1 -1
- package/amd/UNSAFE_TextField/themes/redwood/ReadonlyTextFieldVariants.css.js +1 -1
- package/amd/UNSAFE_TextField/themes/stable/ReadonlyTextFieldTheme.js +1 -1
- package/amd/UNSAFE_TextField/themes/stable/ReadonlyTextFieldTheme.js.map +1 -1
- package/amd/UNSAFE_TextField/themes/stable/ReadonlyTextFieldVariants.css.js +1 -1
- package/amd/UNSAFE_TextField.js +1 -1
- package/amd/UNSAFE_VirtualizedListView.js +1 -1
- package/amd/{VirtualizedCollection-63223f5e.js → VirtualizedCollection-897516a5.js} +2 -2
- package/amd/{VirtualizedCollection-63223f5e.js.map → VirtualizedCollection-897516a5.js.map} +1 -1
- package/amd/{VirtualizedListView-554eaee6.js → VirtualizedListView-cbe87ec2.js} +2 -2
- package/amd/{VirtualizedListView-554eaee6.js.map → VirtualizedListView-cbe87ec2.js.map} +1 -1
- package/amd/{useSelectCommon-e7f123ce.js → useSelectCommon-d9c4a7bd.js} +2 -2
- package/amd/{useSelectCommon-e7f123ce.js.map → useSelectCommon-d9c4a7bd.js.map} +1 -1
- package/cjs/ActionCard-61b21d6c.js +1 -1
- package/cjs/BarChart-ca7f8ed5.js +1 -1
- package/cjs/BarGroup-4a24a995.js +1 -1
- package/cjs/BaseButton-3a0bf8e4.js +2 -2
- package/cjs/{BaseCardView-ade994f5.js → BaseCardView-5a45e588.js} +9 -9
- package/cjs/{BaseCardView-ade994f5.js.map → BaseCardView-5a45e588.js.map} +1 -1
- package/cjs/{BaseCardViewSelectionTest-c6f05079.js → BaseCardViewSelectionTest-df948f2c.js} +7 -7
- package/cjs/{BaseCardViewSelectionTest-c6f05079.js.map → BaseCardViewSelectionTest-df948f2c.js.map} +1 -1
- package/cjs/BaseNavigationListItem-50e4c603.js +1 -1
- package/cjs/BaseRichSelection-e73cac1d.js +8 -8
- package/cjs/ButtonSet-90db1168.js +2 -2
- package/cjs/ButtonSetIconButton-f3b4a721.js +3 -3
- package/cjs/{Card-a0dadf5f.js → Card-a6693442.js} +2 -2
- package/cjs/{Card-a0dadf5f.js.map → Card-a6693442.js.map} +1 -1
- package/cjs/{CardFlexView-6492d995.js → CardFlexView-58228ce4.js} +2 -2
- package/cjs/{CardFlexView-6492d995.js.map → CardFlexView-58228ce4.js.map} +1 -1
- package/cjs/{CardGridView-d98aa089.js → CardGridView-17683602.js} +2 -2
- package/cjs/{CardGridView-d98aa089.js.map → CardGridView-17683602.js.map} +1 -1
- package/cjs/{Center-9f407cb2.js → Center-c0baccb0.js} +2 -2
- package/cjs/{Center-9f407cb2.js.map → Center-c0baccb0.js.map} +1 -1
- package/cjs/Chart-fbbd3329.js +8 -8
- package/cjs/CheckboxControl-5beb656d.js +6 -6
- package/cjs/CheckboxRadioField-0d5c9def.js +6 -6
- package/cjs/Chip-f12bb8cd.js +1 -1
- package/cjs/ClearIcon-edcc3f6e.js +1 -1
- package/cjs/CollapseIcon-2394e7ea.js +1 -1
- package/cjs/Collapsible-41311eb0.js +2 -2
- package/cjs/ComboChart-95863e7a.js +2 -2
- package/cjs/CompactHelpSource-61ead0c7.js +2 -2
- package/cjs/{CompactLabelAssistance-ec1e72af.js → CompactLabelAssistance-fd841834.js} +5 -5
- package/cjs/{CompactLabelAssistance-ec1e72af.js.map → CompactLabelAssistance-fd841834.js.map} +1 -1
- package/cjs/CompactUserAssistance-391bf7ca.js +4 -4
- package/cjs/ComponentMessageContainer-24e79106.js +4 -4
- package/cjs/ConveyorBeltItem-ac146ef0.js +2 -2
- package/cjs/{DatePicker-d99097e4.js → DatePicker-65b047ad.js} +6 -6
- package/cjs/{DatePicker-d99097e4.js.map → DatePicker-65b047ad.js.map} +1 -1
- package/cjs/DatePickerHeader-0938a3aa.js +3 -3
- package/cjs/{Diagram-aceccb23.js → Diagram-2e66a8cb.js} +5 -5
- package/cjs/{Diagram-aceccb23.js.map → Diagram-2e66a8cb.js.map} +1 -1
- package/cjs/{Dialog-2219a24f.js → Dialog-4160338c.js} +8 -8
- package/cjs/{Dialog-2219a24f.js.map → Dialog-4160338c.js.map} +1 -1
- package/cjs/DirectionalCollapseArrowIcon-0cf2279a.js +1 -1
- package/cjs/DirectionalExpandArrowIcon-a362cb2f.js +1 -1
- package/cjs/{DragHandle-951c36ef.js → DragHandle-67b6118b.js} +2 -2
- package/cjs/{DragHandle-951c36ef.js.map → DragHandle-67b6118b.js.map} +1 -1
- package/cjs/{Dropdown-00e73e4d.js → Dropdown-34b8f141.js} +5 -5
- package/cjs/{Dropdown-00e73e4d.js.map → Dropdown-34b8f141.js.map} +1 -1
- package/cjs/{EnvironmentProvider-bfd5febc.js → EnvironmentProvider-75eb79f3.js} +3 -3
- package/cjs/{EnvironmentProvider-bfd5febc.js.map → EnvironmentProvider-75eb79f3.js.map} +1 -1
- package/cjs/ExpandableList-be84ca8e.js +4 -4
- package/cjs/FilePicker-f93470cf.js +2 -2
- package/cjs/{Flex-ce16a2fa.js → Flex-e7a85bef.js} +2 -2
- package/cjs/{Flex-ce16a2fa.js.map → Flex-e7a85bef.js.map} +1 -1
- package/cjs/{Floating-3a80c067.js → Floating-56621d20.js} +4 -4
- package/cjs/{Floating-3a80c067.js.map → Floating-56621d20.js.map} +1 -1
- package/cjs/FormLayout-86e60b6c.js +1 -1
- package/cjs/Gantt-7b6b99a0.js +9 -9
- package/cjs/{Grid-b8fadf4a.js → Grid-a7316edd.js} +2 -2
- package/cjs/{Grid-b8fadf4a.js.map → Grid-a7316edd.js.map} +1 -1
- package/cjs/{Gridlines-22c46764.js → Gridlines-ef3af190.js} +2 -2
- package/cjs/{Gridlines-22c46764.js.map → Gridlines-ef3af190.js.map} +1 -1
- package/cjs/GroupLoadingIndicator-5940d185.js +2 -2
- package/cjs/{HighlightText-2061d12d.js → HighlightText-dd11dd32.js} +2 -2
- package/cjs/{HighlightText-2061d12d.js.map → HighlightText-dd11dd32.js.map} +1 -1
- package/cjs/Icon-c024b93c.js +3 -3
- package/cjs/IconButton-28559efb.js +3 -3
- package/cjs/IconMenuButton-2a108d43.js +3 -3
- package/cjs/IconProgressButton-01d95e57.js +3 -3
- package/cjs/IconSwitchButton-a1016218.js +3 -3
- package/cjs/IconToggleButton-52f6f126.js +3 -3
- package/cjs/{IconUserAssistance-3faf6a09.js → IconUserAssistance-52208fde.js} +3 -3
- package/cjs/{IconUserAssistance-3faf6a09.js.map → IconUserAssistance-52208fde.js.map} +1 -1
- package/cjs/{Indexer-72430806.js → Indexer-b5ca1d0c.js} +6 -6
- package/cjs/{Indexer-72430806.js.map → Indexer-b5ca1d0c.js.map} +1 -1
- package/cjs/InlineHelpSource-0549100d.js +1 -1
- package/cjs/InlineUserAssistance-820162f4.js +5 -5
- package/cjs/InputDateMask-a7575cef.js +7 -7
- package/cjs/InputDatePicker-4d36637f.js +8 -8
- package/cjs/InputPassword-eb6d227b.js +4 -4
- package/cjs/InputText-a9c423c3.js +6 -6
- package/cjs/Label-e0d15892.js +5 -5
- package/cjs/LabelValueLayout-4049c1a1.js +1 -1
- package/cjs/{Layer-49394ca6.js → Layer-0053053a.js} +3 -3
- package/cjs/{Layer-49394ca6.js.map → Layer-0053053a.js.map} +1 -1
- package/cjs/{LayerHost-7182bfaf.js → LayerHost-a8c7f182.js} +2 -2
- package/cjs/{LayerHost-7182bfaf.js.map → LayerHost-a8c7f182.js.map} +1 -1
- package/cjs/{LayerManager-db087520.js → LayerManager-2d0b83ac.js} +2 -2
- package/cjs/{LayerManager-db087520.js.map → LayerManager-2d0b83ac.js.map} +1 -1
- package/cjs/Legend-33a7824e.js +3 -3
- package/cjs/{LineAreaChart-46dde5d3.js → LineAreaChart-506308c1.js} +3 -3
- package/cjs/{LineAreaChart-46dde5d3.js.map → LineAreaChart-506308c1.js.map} +1 -1
- package/cjs/{LineSeries-995be81c.js → LineSeries-0e984080.js} +2 -2
- package/cjs/{LineSeries-995be81c.js.map → LineSeries-0e984080.js.map} +1 -1
- package/cjs/Link-b8435440.js +1 -1
- package/cjs/{List-0dc2c4c4.js → List-877077ab.js} +8 -9
- package/cjs/{List-0dc2c4c4.js.map → List-877077ab.js.map} +1 -1
- package/cjs/{ListItemLayout-bc581097.js → ListItemLayout-ec53f199.js} +2 -2
- package/cjs/{ListItemLayout-bc581097.js.map → ListItemLayout-ec53f199.js.map} +1 -1
- package/cjs/{ListView-17b8250d.js → ListView-98983aa2.js} +5 -5
- package/cjs/{ListView-17b8250d.js.map → ListView-98983aa2.js.map} +1 -1
- package/cjs/{LiveRegion-3bc583c6.js → LiveRegion-567427c5.js} +2 -2
- package/cjs/{LiveRegion-3bc583c6.js.map → LiveRegion-567427c5.js.map} +1 -1
- package/cjs/{LoadMoreCollection-73112ff0.js → LoadMoreCollection-69bc038c.js} +2 -2
- package/cjs/{LoadMoreCollection-73112ff0.js.map → LoadMoreCollection-69bc038c.js.map} +1 -1
- package/cjs/{MaxLengthLiveRegion-5e31c44e.js → MaxLengthLiveRegion-f03f07c6.js} +3 -3
- package/cjs/{MaxLengthLiveRegion-5e31c44e.js.map → MaxLengthLiveRegion-f03f07c6.js.map} +1 -1
- package/cjs/Menu-658212ed.js +6 -6
- package/cjs/MenuButton-1599ce50.js +2 -2
- package/cjs/MenuItem-c459d748.js +1 -1
- package/cjs/Message-33a66325.js +2 -2
- package/cjs/{MessageLayer-fc21a223.js → MessageLayer-f9aa9828.js} +6 -6
- package/cjs/{MessageLayer-fc21a223.js.map → MessageLayer-f9aa9828.js.map} +1 -1
- package/cjs/MessageToast-0b1d66ed.js +8 -8
- package/cjs/MessagesManager-1ae749bf.js +3 -3
- package/cjs/MeterBar-0adbe81a.js +5 -5
- package/cjs/MeterCircle-97a75b35.js +5 -5
- package/cjs/{Modal-76b3a4d9.js → Modal-b9987f2d.js} +3 -3
- package/cjs/{Modal-76b3a4d9.js.map → Modal-b9987f2d.js.map} +1 -1
- package/cjs/{MonthView-458d3d61.js → MonthView-9c2819f0.js} +4 -4
- package/cjs/{MonthView-458d3d61.js.map → MonthView-9c2819f0.js.map} +1 -1
- package/cjs/NavigationListItem-4c4e804d.js +5 -5
- package/cjs/NumberInputText-3f25f408.js +6 -6
- package/cjs/OverflowTabBarItem-3c7adb01.js +3 -3
- package/cjs/PRIVATE_BaseCardView.js +25 -25
- package/cjs/PRIVATE_Chart.js +31 -31
- package/cjs/PRIVATE_CheckboxControl.js +23 -23
- package/cjs/PRIVATE_CheckboxRadioField.js +24 -24
- package/cjs/PRIVATE_ClearIcon.js +18 -18
- package/cjs/PRIVATE_DatePickerHeader.js +19 -19
- package/cjs/PRIVATE_DatePickerLayout.js +4 -4
- package/cjs/PRIVATE_EmbeddedIconButton.js +3 -3
- package/cjs/PRIVATE_FormControls.js +19 -19
- package/cjs/PRIVATE_IconSwitchButton.js +16 -16
- package/cjs/PRIVATE_Icons/CheckboxMixed.js +16 -16
- package/cjs/PRIVATE_Icons/CheckboxOff.js +16 -16
- package/cjs/PRIVATE_Icons/CheckboxOn.js +16 -16
- package/cjs/PRIVATE_Icons/DragV.js +16 -16
- package/cjs/PRIVATE_Icons/WarningS.js +16 -16
- package/cjs/PRIVATE_List.js +24 -24
- package/cjs/PRIVATE_LoadMoreCollection.js +2 -2
- package/cjs/PRIVATE_Message.js +19 -19
- package/cjs/PRIVATE_MessageLayer.js +12 -12
- package/cjs/PRIVATE_MonthView.js +7 -7
- package/cjs/PRIVATE_MonthYearGridView.js +7 -7
- package/cjs/PRIVATE_PlotArea.js +4 -4
- package/cjs/PRIVATE_RevealToggleIcon.js +17 -17
- package/cjs/PRIVATE_RichSelectionCommon.js +25 -25
- package/cjs/PRIVATE_SelectCommon.js +33 -33
- package/cjs/PRIVATE_StyledCard.js +4 -4
- package/cjs/PRIVATE_StyledCheckbox.js +16 -16
- package/cjs/PRIVATE_Table.js +27 -27
- package/cjs/PRIVATE_ThemedIcons/CalendarIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/ChartMarqueeSelectIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/ChartPanIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/ChartZoomIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/CheckIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/CheckboxMixedIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/CheckboxOffIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/CheckboxOnIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/CloseIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/CollapseIcon.js +17 -17
- package/cjs/PRIVATE_ThemedIcons/CollapseUpIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/DecrementIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/DeleteIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/DirectionalCollapseArrowIcon.js +17 -17
- package/cjs/PRIVATE_ThemedIcons/DirectionalExpandArrowIcon.js +17 -17
- package/cjs/PRIVATE_ThemedIcons/DragHandleIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/DropdownArrowIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/ExpandIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/HelpIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/IncrementIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/MenuButtonDropdownIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/MessageConfirmationIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/MessageErrorIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/MessageInfoIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/MessageWarningIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/MinusIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/NavDownIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/OverviewHorizontalDragHandleIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/PlusIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/RadioOffIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/RadioOnIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/SortAscendingIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/SortDescendingIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/ViewHideIcon.js +16 -16
- package/cjs/PRIVATE_ThemedIcons/ViewIcon.js +16 -16
- package/cjs/PRIVATE_TimeComponent.js +18 -18
- package/cjs/PRIVATE_VirtualizedCollection.js +2 -2
- package/cjs/PRIVATE_VisOverview.js +16 -16
- package/cjs/PRIVATE_VisTabularDatatip.js +4 -4
- package/cjs/PictoChart-292f6c54.js +6 -6
- package/cjs/PieChart-411377a1.js +6 -6
- package/cjs/{Popup-3e6b37ba.js → Popup-84ce41d3.js} +9 -9
- package/cjs/{Popup-3e6b37ba.js.map → Popup-84ce41d3.js.map} +1 -1
- package/cjs/{ProgressBar-ee008afc.js → ProgressBar-aa9edb7a.js} +3 -3
- package/cjs/{ProgressBar-ee008afc.js.map → ProgressBar-aa9edb7a.js.map} +1 -1
- package/cjs/ProgressButton-433a67b5.js +3 -3
- package/cjs/ProgressButtonLabelLayout-13908869.js +3 -3
- package/cjs/{ProgressCircle-e91f65f3.js → ProgressCircle-1d9fbade.js} +2 -2
- package/cjs/{ProgressCircle-e91f65f3.js.map → ProgressCircle-1d9fbade.js.map} +1 -1
- package/cjs/RadioItem-c6ada23a.js +6 -6
- package/cjs/RatingGauge-4f129f42.js +7 -7
- package/cjs/ReadonlyTextFieldInput-af4ddced.js +1 -1
- package/cjs/RemovableNavigationListItem-0eea31bc.js +1 -1
- package/cjs/RemovableTabBarItem-ff408dff.js +2 -2
- package/cjs/ReorderableTabBar-344938e7.js +3 -3
- package/cjs/RevealToggleIcon-2e88a00a.js +1 -1
- package/cjs/{ScatterChart-0497f41a.js → ScatterChart-80ef4bee.js} +3 -3
- package/cjs/{ScatterChart-0497f41a.js.map → ScatterChart-80ef4bee.js.map} +1 -1
- package/cjs/SectionalLegend-da9d7dc4.js +4 -4
- package/cjs/{SectionedContent-2210037c.js → SectionedContent-06dc071c.js} +5 -5
- package/cjs/{SectionedContent-2210037c.js.map → SectionedContent-06dc071c.js.map} +1 -1
- package/cjs/{SelectMultiple-b1f05b9f.js → SelectMultiple-94ab1de5.js} +10 -10
- package/cjs/{SelectMultiple-b1f05b9f.js.map → SelectMultiple-94ab1de5.js.map} +1 -1
- package/cjs/{SelectSingle-84b0b3eb.js → SelectSingle-52c5cb94.js} +9 -9
- package/cjs/{SelectSingle-84b0b3eb.js.map → SelectSingle-52c5cb94.js.map} +1 -1
- package/cjs/{SelectionCard-e26feb4d.js → SelectionCard-67f7003e.js} +2 -2
- package/cjs/{SelectionCard-e26feb4d.js.map → SelectionCard-67f7003e.js.map} +1 -1
- package/cjs/Selector-565b3810.js +1 -1
- package/cjs/{SelectorAll-e81b943f.js → SelectorAll-b55e1b61.js} +7 -7
- package/cjs/{SelectorAll-e81b943f.js.map → SelectorAll-b55e1b61.js.map} +1 -1
- package/cjs/{Sheet-73cb51b2.js → Sheet-86989265.js} +3 -3
- package/cjs/{Sheet-73cb51b2.js.map → Sheet-86989265.js.map} +1 -1
- package/cjs/SplitMenuButton-de680884.js +2 -2
- package/cjs/{StyledCard-f6b7f046.js → StyledCard-a0496c88.js} +2 -2
- package/cjs/{StyledCard-f6b7f046.js.map → StyledCard-a0496c88.js.map} +1 -1
- package/cjs/StyledTextField-3289e35c.js +3 -3
- package/cjs/TabBar-bf94b95a.js +5 -5
- package/cjs/TabBarItem-00fcf601.js +3 -3
- package/cjs/TabBarLayout-846a4d9a.js +1 -1
- package/cjs/TabBarMixed-975141a6.js +5 -5
- package/cjs/{TabBarMixedSeparator-0f55c6f6.js → TabBarMixedSeparator-0e258647.js} +2 -2
- package/cjs/{TabBarMixedSeparator-0f55c6f6.js.map → TabBarMixedSeparator-0e258647.js.map} +1 -1
- package/cjs/{Table-90fe7ad8.js → Table-15a64988.js} +11 -11
- package/cjs/{Table-90fe7ad8.js.map → Table-15a64988.js.map} +1 -1
- package/cjs/{TableView-3cc9d3be.js → TableView-37d6f731.js} +2 -2
- package/cjs/{TableView-3cc9d3be.js.map → TableView-37d6f731.js.map} +1 -1
- package/cjs/TagCloud-ff6f5158.js +8 -8
- package/cjs/{TextArea-e7f98e9f.js → TextArea-4c8f0284.js} +27 -9
- package/cjs/TextArea-4c8f0284.js.map +1 -0
- package/cjs/{TextAreaAutosize-d96c7038.js → TextAreaAutosize-466a21cc.js} +8 -8
- package/cjs/{TextAreaAutosize-d96c7038.js.map → TextAreaAutosize-466a21cc.js.map} +1 -1
- package/cjs/TextField-976ee745.js +3 -3
- package/cjs/TextFieldInput-e83921a4.js +1 -1
- package/cjs/Theme-redwood/theme.css +105 -105
- package/cjs/Theme-stable/theme.css +297 -297
- package/cjs/TimeComponentCanvas2D-952a80c3.js +5 -5
- package/cjs/Toolbar-f94296cb.js +1 -1
- package/cjs/{TruncatingBadge-3a82f13b.js → TruncatingBadge-efe34bb7.js} +4 -4
- package/cjs/{TruncatingBadge-3a82f13b.js.map → TruncatingBadge-efe34bb7.js.map} +1 -1
- package/cjs/{TruncatingText-df3db482.js → TruncatingText-33c06a6c.js} +4 -4
- package/cjs/{TruncatingText-df3db482.js.map → TruncatingText-33c06a6c.js.map} +1 -1
- package/cjs/UNSAFE_ActionCard.js +3 -3
- package/cjs/UNSAFE_BarChart/__test__/BarChart.spec.js +31 -31
- package/cjs/UNSAFE_BarChart.js +31 -31
- package/cjs/UNSAFE_BaseButton.js +3 -3
- package/cjs/UNSAFE_Button.js +3 -3
- package/cjs/UNSAFE_ButtonLayout/tests/ButtonLayout.spec.js +21 -21
- package/cjs/UNSAFE_ButtonSet.js +4 -4
- package/cjs/UNSAFE_ButtonSetButton.js +3 -3
- package/cjs/UNSAFE_ButtonSetIconButton.js +16 -16
- package/cjs/UNSAFE_ButtonSetItem.js +16 -16
- package/cjs/UNSAFE_ButtonSetMultiple.js +4 -4
- package/cjs/UNSAFE_ButtonSetSingle.js +4 -4
- package/cjs/UNSAFE_Card.js +5 -5
- package/cjs/UNSAFE_CardFlexView.js +26 -26
- package/cjs/UNSAFE_CardGridView.js +26 -26
- package/cjs/UNSAFE_Center.js +5 -5
- package/cjs/UNSAFE_ChartWithLegend.js +4 -4
- package/cjs/UNSAFE_Checkbox.js +23 -23
- package/cjs/UNSAFE_CheckboxItem.js +24 -24
- package/cjs/UNSAFE_CheckboxSet.js +23 -23
- package/cjs/UNSAFE_Chip.js +2 -2
- package/cjs/UNSAFE_Collapsible.js +18 -18
- package/cjs/UNSAFE_ComboChart.js +33 -33
- package/cjs/UNSAFE_ComponentMessage.js +19 -19
- package/cjs/UNSAFE_ConveyorBelt.js +16 -16
- package/cjs/UNSAFE_DatePicker.js +24 -24
- package/cjs/UNSAFE_Diagram.js +21 -21
- package/cjs/UNSAFE_Dialog.js +21 -21
- package/cjs/UNSAFE_DragHandle.js +18 -18
- package/cjs/UNSAFE_DrawerLayout.js +12 -12
- package/cjs/UNSAFE_DrawerPopup.js +11 -11
- package/cjs/UNSAFE_Dropdown.js +13 -13
- package/cjs/UNSAFE_Environment.js +4 -4
- package/cjs/UNSAFE_ExpandableList.js +26 -26
- package/cjs/UNSAFE_FilePicker.js +4 -4
- package/cjs/UNSAFE_Flex.js +4 -4
- package/cjs/UNSAFE_Floating.js +11 -11
- package/cjs/UNSAFE_FormLayout.js +2 -2
- package/cjs/UNSAFE_Gantt.js +23 -23
- package/cjs/UNSAFE_Grid.js +4 -4
- package/cjs/UNSAFE_HighlightText.js +4 -4
- package/cjs/UNSAFE_Icon.js +16 -16
- package/cjs/UNSAFE_IconButton.js +16 -16
- package/cjs/UNSAFE_IconMenuButton.js +21 -21
- package/cjs/UNSAFE_IconProgressButton.js +19 -19
- package/cjs/UNSAFE_IconToggleButton.js +16 -16
- package/cjs/UNSAFE_Indexer.js +8 -8
- package/cjs/UNSAFE_InputDateMask.js +24 -24
- package/cjs/UNSAFE_InputDatePicker.js +32 -32
- package/cjs/UNSAFE_InputPassword.js +23 -23
- package/cjs/UNSAFE_InputSensitiveText.js +25 -25
- package/cjs/UNSAFE_InputText.js +26 -26
- package/cjs/UNSAFE_InputTimeMask.js +24 -24
- package/cjs/UNSAFE_Label.js +23 -23
- package/cjs/UNSAFE_LabelValueLayout.js +4 -4
- package/cjs/UNSAFE_LabelledLink.js +24 -24
- package/cjs/UNSAFE_Layer.js +8 -8
- package/cjs/UNSAFE_Legend.js +24 -24
- package/cjs/UNSAFE_LineAreaChart.js +34 -34
- package/cjs/UNSAFE_Link.js +2 -2
- package/cjs/UNSAFE_ListItemLayout.js +5 -5
- package/cjs/UNSAFE_ListView.js +33 -33
- package/cjs/UNSAFE_LiveRegion.js +4 -4
- package/cjs/UNSAFE_Menu.js +23 -23
- package/cjs/UNSAFE_MenuButton.js +21 -21
- package/cjs/UNSAFE_MessageBanner.js +19 -19
- package/cjs/UNSAFE_MessageToast.js +22 -22
- package/cjs/UNSAFE_MeterBar.js +16 -16
- package/cjs/UNSAFE_MeterCircle.js +17 -17
- package/cjs/UNSAFE_Modal.js +8 -8
- package/cjs/UNSAFE_NavigationList.js +20 -20
- package/cjs/UNSAFE_NavigationListCommon.js +18 -18
- package/cjs/UNSAFE_NumberInputText.js +25 -25
- package/cjs/UNSAFE_OverflowTabBar.js +24 -24
- package/cjs/UNSAFE_PictoChart.js +14 -14
- package/cjs/UNSAFE_PieChart/__test__/PieChart.spec.js +21 -21
- package/cjs/UNSAFE_PieChart.js +21 -21
- package/cjs/UNSAFE_Popup.js +16 -16
- package/cjs/UNSAFE_ProgressBar.js +5 -5
- package/cjs/UNSAFE_ProgressButton.js +19 -19
- package/cjs/UNSAFE_ProgressButtonLabelLayout.js +10 -10
- package/cjs/UNSAFE_ProgressCircle.js +4 -4
- package/cjs/UNSAFE_RadioItem.js +23 -23
- package/cjs/UNSAFE_RadioSet.js +23 -23
- package/cjs/UNSAFE_RatingGauge.js +17 -17
- package/cjs/UNSAFE_ReorderableTabBar.js +24 -24
- package/cjs/UNSAFE_RichCheckboxSet.js +25 -25
- package/cjs/UNSAFE_RichRadioSet.js +25 -25
- package/cjs/UNSAFE_RichSelectionItem.js +27 -27
- package/cjs/UNSAFE_ScatterChart.js +34 -34
- package/cjs/UNSAFE_SectionalLegend.js +25 -25
- package/cjs/UNSAFE_SelectMultiple.js +36 -36
- package/cjs/UNSAFE_SelectSingle.js +36 -36
- package/cjs/UNSAFE_SelectionCard.js +5 -5
- package/cjs/UNSAFE_Selector.js +16 -16
- package/cjs/UNSAFE_SelectorAll.js +20 -20
- package/cjs/UNSAFE_Sheet/__test__/Sheet.spec.js +14 -14
- package/cjs/UNSAFE_Sheet.js +11 -11
- package/cjs/UNSAFE_SplitMenuButton.js +21 -21
- package/cjs/UNSAFE_TabBar.js +25 -25
- package/cjs/UNSAFE_TabBarCommon.js +25 -25
- package/cjs/UNSAFE_TabBarMixed.js +26 -26
- package/cjs/UNSAFE_TableView.js +28 -28
- package/cjs/UNSAFE_TagCloud.js +23 -23
- package/cjs/UNSAFE_TextArea.js +28 -29
- package/cjs/UNSAFE_TextArea.js.map +1 -1
- package/cjs/UNSAFE_TextAreaAutosize.js +28 -28
- package/cjs/UNSAFE_TextField.js +7 -7
- package/cjs/UNSAFE_ToggleButton.js +3 -3
- package/cjs/UNSAFE_Toolbar/tests/Toolbar.spec.js +23 -23
- package/cjs/UNSAFE_Toolbar.js +4 -4
- package/cjs/UNSAFE_Train.js +17 -17
- package/cjs/UNSAFE_TruncatingBadge.js +18 -18
- package/cjs/UNSAFE_TruncatingText.js +17 -17
- package/cjs/UNSAFE_UserAssistance.js +24 -24
- package/cjs/UNSAFE_View.js +7 -7
- package/cjs/UNSAFE_VirtualizedListView.js +25 -25
- package/cjs/UNSAFE_VisProgressiveLoader/__test__/VisProgressiveLoader.spec.js +8 -8
- package/cjs/UNSAFE_VisProgressiveLoader.js +6 -6
- package/cjs/UNSAFE_VisStatusMessage.js +6 -6
- package/cjs/UNSAFE_WindowOverlay.js +4 -4
- package/cjs/{View-145a402d.js → View-5930179e.js} +5 -5
- package/cjs/{View-145a402d.js.map → View-5930179e.js.map} +1 -1
- package/cjs/{VirtualizedCollection-00aedb8b.js → VirtualizedCollection-9e8c48b9.js} +2 -2
- package/cjs/{VirtualizedCollection-00aedb8b.js.map → VirtualizedCollection-9e8c48b9.js.map} +1 -1
- package/cjs/{VirtualizedListView-9bfaf4e2.js → VirtualizedListView-03fa4758.js} +2 -2
- package/cjs/{VirtualizedListView-9bfaf4e2.js.map → VirtualizedListView-03fa4758.js.map} +1 -1
- package/cjs/{VisNoData-210b0385.js → VisNoData-5b2aa6a2.js} +3 -3
- package/cjs/{VisNoData-210b0385.js.map → VisNoData-5b2aa6a2.js.map} +1 -1
- package/cjs/{VisProgressiveLoader-5ed4eb9d.js → VisProgressiveLoader-dacfe618.js} +3 -3
- package/cjs/{VisProgressiveLoader-5ed4eb9d.js.map → VisProgressiveLoader-dacfe618.js.map} +1 -1
- package/cjs/{VisTabularDatatip-a06f4ca3.js → VisTabularDatatip-eca8aa8f.js} +2 -2
- package/cjs/{VisTabularDatatip-a06f4ca3.js.map → VisTabularDatatip-eca8aa8f.js.map} +1 -1
- package/cjs/{WindowOverlay-de3bd373.js → WindowOverlay-06408f56.js} +2 -2
- package/cjs/{WindowOverlay-de3bd373.js.map → WindowOverlay-06408f56.js.map} +1 -1
- package/cjs/{YearsGridView-e8d7a02c.js → YearsGridView-09f2f6c4.js} +4 -4
- package/cjs/{YearsGridView-e8d7a02c.js.map → YearsGridView-09f2f6c4.js.map} +1 -1
- package/cjs/hoc/PRIVATE_withDirectionIcon.js +4 -4
- package/cjs/hoc/PRIVATE_withThemeIcon.js +3 -3
- package/cjs/hoc/UNSAFE_withThemeProps.js +3 -3
- package/cjs/hooks/PRIVATE_useChartContextMenu.js +20 -20
- package/cjs/hooks/PRIVATE_useChartDatatip.js +14 -14
- package/cjs/hooks/PRIVATE_useChartEvents.js +18 -18
- package/cjs/hooks/PRIVATE_useChartMarquee.js +18 -18
- package/cjs/hooks/PRIVATE_useCssVars.js +7 -7
- package/cjs/hooks/PRIVATE_useCurrentKey.js +4 -4
- package/cjs/hooks/PRIVATE_useDatatip.js +12 -12
- package/cjs/hooks/PRIVATE_useFloating.js +4 -4
- package/cjs/hooks/PRIVATE_useReorderable.js +5 -5
- package/cjs/hooks/PRIVATE_useRovingTabIndexContainer.js +4 -4
- package/cjs/hooks/PRIVATE_useSelection.js +4 -4
- package/cjs/hooks/PRIVATE_useTabBar.js +4 -4
- package/cjs/hooks/PRIVATE_useVisContextMenu.js +20 -20
- package/cjs/hooks/PRIVATE_useVisDragModeControls.js +18 -18
- package/cjs/hooks/PRIVATE_useVisEvents.js +4 -4
- package/cjs/hooks/PRIVATE_useVisMeterEvents.js +14 -14
- package/cjs/hooks/PRIVATE_useVisSelection.js +13 -13
- package/cjs/hooks/UNSAFE_useColorScheme.js +3 -3
- package/cjs/hooks/UNSAFE_useCurrentBgColor.js +3 -3
- package/cjs/hooks/UNSAFE_useDensity.js +3 -3
- package/cjs/hooks/UNSAFE_useOutsideClick.js +8 -8
- package/cjs/hooks/UNSAFE_usePrefixSuffix.js +4 -4
- package/cjs/hooks/UNSAFE_useScale.js +3 -3
- package/cjs/hooks/UNSAFE_useTestId.js +3 -3
- package/cjs/hooks/UNSAFE_useTheme.js +3 -3
- package/cjs/hooks/UNSAFE_useThemeInterpolations.js +6 -6
- package/cjs/hooks/UNSAFE_useTooltip.js +17 -17
- package/cjs/hooks/UNSAFE_useTranslationBundle.js +3 -3
- package/cjs/hooks/UNSAFE_useUser.js +3 -3
- package/cjs/{index-8c93d858.js → index-ce6f9627.js} +2 -2
- package/cjs/index-ce6f9627.js.map +1 -0
- package/cjs/listViewSelectionTests-858bb12a.js +3 -3
- package/cjs/{render-bc47fc7e.js → render-9767e967.js} +3 -3
- package/cjs/{render-bc47fc7e.js.map → render-9767e967.js.map} +1 -1
- package/cjs/{tabbableUtils-b14a04ea.js → tabbableUtils-a38b7148.js} +3 -3
- package/cjs/{tabbableUtils-b14a04ea.js.map → tabbableUtils-a38b7148.js.map} +1 -1
- package/cjs/{testData-c996c33b.js → testData-7439df49.js} +3 -3
- package/cjs/{testData-c996c33b.js.map → testData-7439df49.js.map} +1 -1
- package/cjs/{tooltipUtils-2228b0f7.js → tooltipUtils-669c2ae0.js} +5 -5
- package/cjs/{tooltipUtils-2228b0f7.js.map → tooltipUtils-669c2ae0.js.map} +1 -1
- package/cjs/useCellNavigation-6f7cd4c8.js +1 -1
- package/cjs/useChartContextMenu-d114824a.js +2 -2
- package/cjs/{useChartDatatip-538a4577.js → useChartDatatip-c6107d63.js} +4 -4
- package/cjs/{useChartDatatip-538a4577.js.map → useChartDatatip-c6107d63.js.map} +1 -1
- package/cjs/{useColorScheme-e6bef5a4.js → useColorScheme-ce2a88b1.js} +2 -2
- package/cjs/{useColorScheme-e6bef5a4.js.map → useColorScheme-ce2a88b1.js.map} +1 -1
- package/cjs/useContextMenu-3ebf8f80.js +2 -2
- package/cjs/{useCssVars-9bea15a9.js → useCssVars-bd95e715.js} +5 -5
- package/cjs/{useCssVars-9bea15a9.js.map → useCssVars-bd95e715.js.map} +1 -1
- package/cjs/{useCurrentBgColor-6835bf45.js → useCurrentBgColor-6e39eb3a.js} +2 -2
- package/cjs/{useCurrentBgColor-6835bf45.js.map → useCurrentBgColor-6e39eb3a.js.map} +1 -1
- package/cjs/{useCurrentKey-d8d41864.js → useCurrentKey-88495da2.js} +2 -2
- package/cjs/{useCurrentKey-d8d41864.js.map → useCurrentKey-88495da2.js.map} +1 -1
- package/cjs/{useDatatip-1dda9a86.js → useDatatip-83ab0540.js} +4 -4
- package/cjs/{useDatatip-1dda9a86.js.map → useDatatip-83ab0540.js.map} +1 -1
- package/cjs/{useDensity-38283c57.js → useDensity-1f8cc921.js} +2 -2
- package/cjs/{useDensity-38283c57.js.map → useDensity-1f8cc921.js.map} +1 -1
- package/cjs/{useFloating-c9e127d3.js → useFloating-480d365a.js} +2 -2
- package/cjs/{useFloating-c9e127d3.js.map → useFloating-480d365a.js.map} +1 -1
- package/cjs/{useKeyboardEvents-7ab0d8ee.js → useKeyboardEvents-5e808fe3.js} +2 -2
- package/cjs/{useKeyboardEvents-7ab0d8ee.js.map → useKeyboardEvents-5e808fe3.js.map} +1 -1
- package/cjs/useLegendContextMenu-82be007a.js +4 -4
- package/cjs/{useMeterDatatip-945883f5.js → useMeterDatatip-641afcc6.js} +3 -3
- package/cjs/{useMeterDatatip-945883f5.js.map → useMeterDatatip-641afcc6.js.map} +1 -1
- package/cjs/{useOutsideClick-ad999b14.js → useOutsideClick-03a6c38c.js} +2 -2
- package/cjs/{useOutsideClick-ad999b14.js.map → useOutsideClick-03a6c38c.js.map} +1 -1
- package/cjs/{usePopupAnimation-b911e9ed.js → usePopupAnimation-2afacc4b.js} +2 -2
- package/cjs/{usePopupAnimation-b911e9ed.js.map → usePopupAnimation-2afacc4b.js.map} +1 -1
- package/cjs/{usePrefixSuffix-1de3a724.js → usePrefixSuffix-23341de3.js} +2 -2
- package/cjs/{usePrefixSuffix-1de3a724.js.map → usePrefixSuffix-23341de3.js.map} +1 -1
- package/cjs/{useReorderableItem-5fc4d599.js → useReorderableItem-0dbb8843.js} +3 -3
- package/cjs/{useReorderableItem-5fc4d599.js.map → useReorderableItem-0dbb8843.js.map} +1 -1
- package/cjs/{useRovingTabIndexContainer-bbdf3acd.js → useRovingTabIndexContainer-dc12b802.js} +2 -2
- package/cjs/{useRovingTabIndexContainer-bbdf3acd.js.map → useRovingTabIndexContainer-dc12b802.js.map} +1 -1
- package/cjs/{useScale-a47864b4.js → useScale-a681a5cb.js} +2 -2
- package/cjs/{useScale-a47864b4.js.map → useScale-a681a5cb.js.map} +1 -1
- package/cjs/{useSelectCommon-5b46ac60.js → useSelectCommon-a0a800fd.js} +13 -13
- package/cjs/{useSelectCommon-5b46ac60.js.map → useSelectCommon-a0a800fd.js.map} +1 -1
- package/cjs/{useSelectDrill-51fdccac.js → useSelectDrill-c95b1a51.js} +3 -3
- package/cjs/{useSelectDrill-51fdccac.js.map → useSelectDrill-c95b1a51.js.map} +1 -1
- package/cjs/{useSelection-0dbc2f40.js → useSelection-228ef3ce.js} +2 -2
- package/cjs/{useSelection-0dbc2f40.js.map → useSelection-228ef3ce.js.map} +1 -1
- package/cjs/{useSelection-8362b6c6.js → useSelection-efdf0e84.js} +5 -5
- package/cjs/{useSelection-8362b6c6.js.map → useSelection-efdf0e84.js.map} +1 -1
- package/cjs/useTabBar-048ffd9f.js +1 -1
- package/cjs/{useTestId-e267a39d.js → useTestId-5e6af45d.js} +2 -2
- package/cjs/{useTestId-e267a39d.js.map → useTestId-5e6af45d.js.map} +1 -1
- package/cjs/{useTheme-6cedf9c8.js → useTheme-8fb5546b.js} +2 -2
- package/cjs/{useTheme-6cedf9c8.js.map → useTheme-8fb5546b.js.map} +1 -1
- package/cjs/{useThemeInterpolations-316c1636.js → useThemeInterpolations-28ca9a13.js} +5 -5
- package/cjs/{useThemeInterpolations-316c1636.js.map → useThemeInterpolations-28ca9a13.js.map} +1 -1
- package/cjs/{useTooltip-ea036f82.js → useTooltip-81b7b753.js} +2 -2
- package/cjs/{useTooltip-ea036f82.js.map → useTooltip-81b7b753.js.map} +1 -1
- package/cjs/{useTooltipControlled-61581889.js → useTooltipControlled-33832163.js} +5 -5
- package/cjs/{useTooltipControlled-61581889.js.map → useTooltipControlled-33832163.js.map} +1 -1
- package/cjs/{useTranslationBundle-6b0281a9.js → useTranslationBundle-51f4c22c.js} +2 -2
- package/cjs/{useTranslationBundle-6b0281a9.js.map → useTranslationBundle-51f4c22c.js.map} +1 -1
- package/cjs/{useUser-8aaad5a7.js → useUser-a4bfc560.js} +2 -2
- package/cjs/{useUser-8aaad5a7.js.map → useUser-a4bfc560.js.map} +1 -1
- package/cjs/useVisDragModeControls-95caebc9.js +1 -1
- package/cjs/{useVisEvents-99f1bf51.js → useVisEvents-e48065f4.js} +2 -2
- package/cjs/{useVisEvents-99f1bf51.js.map → useVisEvents-e48065f4.js.map} +1 -1
- package/cjs/utils/PRIVATE_tooltipUtils.js +14 -14
- package/cjs/utils/PRIVATE_visTestUtils.js +5 -5
- package/cjs/{withDirectionIcon-7f758093.js → withDirectionIcon-1affce30.js} +2 -2
- package/cjs/{withDirectionIcon-7f758093.js.map → withDirectionIcon-1affce30.js.map} +1 -1
- package/cjs/withThemeProps-6e15f1c3.js +2 -2
- package/es/{BaseCardView-c5a8ee6a.js → BaseCardView-229fa119.js} +2 -2
- package/es/{BaseCardView-c5a8ee6a.js.map → BaseCardView-229fa119.js.map} +1 -1
- package/es/{CardFlexView-529906e0.js → CardFlexView-3ef6bf4d.js} +2 -2
- package/es/{CardFlexView-529906e0.js.map → CardFlexView-3ef6bf4d.js.map} +1 -1
- package/es/{CardGridView-ec18c929.js → CardGridView-e15226c9.js} +2 -2
- package/es/{CardGridView-ec18c929.js.map → CardGridView-e15226c9.js.map} +1 -1
- package/es/CheckboxSetContext-1be56556.js +9 -0
- package/es/CheckboxSetContext-1be56556.js.map +1 -0
- package/es/ExpandableList-478db30a.js +1 -1
- package/es/GroupLoadingIndicator-63035d08.js +1 -1
- package/es/{Indexer-ba2c7593.js → Indexer-eb00ba0b.js} +2 -2
- package/es/{Indexer-ba2c7593.js.map → Indexer-eb00ba0b.js.map} +1 -1
- package/es/{List-97b7be70.js → List-e6886091.js} +3 -4
- package/es/{List-97b7be70.js.map → List-e6886091.js.map} +1 -1
- package/es/{ListView-936d8a4f.js → ListView-137e31fd.js} +2 -2
- package/es/{ListView-936d8a4f.js.map → ListView-137e31fd.js.map} +1 -1
- package/es/{LoadMoreCollection-95a49d2a.js → LoadMoreCollection-7df1be36.js} +2 -2
- package/es/{LoadMoreCollection-95a49d2a.js.map → LoadMoreCollection-7df1be36.js.map} +1 -1
- package/es/{NavigationListItem-5b25b2f5.js → NavigationListItem-57a7cf4b.js} +1 -14
- package/es/{NavigationListItem-5b25b2f5.js.map → NavigationListItem-57a7cf4b.js.map} +1 -1
- package/es/{OverflowTabBar-47a03b1f.js → OverflowTabBar-9df72c15.js} +2 -2
- package/es/{OverflowTabBar-47a03b1f.js.map → OverflowTabBar-9df72c15.js.map} +1 -1
- package/es/{OverflowTabBarItem-08625093.js → OverflowTabBarItem-0d925d02.js} +2 -2
- package/es/{OverflowTabBarItem-08625093.js.map → OverflowTabBarItem-0d925d02.js.map} +1 -1
- package/es/PRIVATE_BaseCardView.js +3 -3
- package/es/PRIVATE_List.js +4 -4
- package/es/PRIVATE_LoadMoreCollection.js +2 -2
- package/es/PRIVATE_SelectCommon.js +5 -5
- package/es/PRIVATE_Table.js +3 -3
- package/es/PRIVATE_VirtualizedCollection.js +2 -2
- package/es/{SelectMultiple-ad8fc99a.js → SelectMultiple-488a49d1.js} +2 -2
- package/es/{SelectMultiple-ad8fc99a.js.map → SelectMultiple-488a49d1.js.map} +1 -1
- package/es/{SelectSingle-abaf271c.js → SelectSingle-e8b9a33a.js} +2 -2
- package/es/{SelectSingle-abaf271c.js.map → SelectSingle-e8b9a33a.js.map} +1 -1
- package/es/SplitMenuButtonTheme.styles.css +4 -4
- package/es/SplitMenuButtonTheme.styles2.css +4 -4
- package/es/{Table-1ba124ec.js → Table-3cfb9443.js} +2 -2
- package/es/{Table-1ba124ec.js.map → Table-3cfb9443.js.map} +1 -1
- package/es/{TableView-20223ba6.js → TableView-fd5104cd.js} +2 -2
- package/es/{TableView-20223ba6.js.map → TableView-fd5104cd.js.map} +1 -1
- package/es/Theme-redwood/theme.css +489 -489
- package/es/Theme-stable/theme.css +443 -443
- package/es/UNSAFE_ButtonLayout/tests/ButtonLayout.spec.js +1 -1
- package/es/UNSAFE_CardFlexView.js +4 -4
- package/es/UNSAFE_CardGridView.js +4 -4
- package/es/UNSAFE_CheckboxItem.js +30 -81
- package/es/UNSAFE_CheckboxItem.js.map +1 -1
- package/es/UNSAFE_CheckboxSet.js +44 -10
- package/es/UNSAFE_CheckboxSet.js.map +1 -1
- package/es/UNSAFE_ExpandableList.js +3 -3
- package/es/UNSAFE_Indexer.js +2 -2
- package/es/UNSAFE_ListView.js +5 -5
- package/es/UNSAFE_NavigationList.js +4 -4
- package/es/UNSAFE_OverflowTabBar.js +3 -3
- package/es/UNSAFE_RichCheckboxSet.js +12 -14
- package/es/UNSAFE_RichCheckboxSet.js.map +1 -1
- package/es/UNSAFE_RichSelectionItem.js +42 -179
- package/es/UNSAFE_RichSelectionItem.js.map +1 -1
- package/es/UNSAFE_SelectMultiple.js +6 -6
- package/es/UNSAFE_SelectSingle.js +6 -6
- 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 +1 -1
- package/es/UNSAFE_TabBar.js +2 -2
- package/es/UNSAFE_TabBarCommon.js +2 -2
- package/es/UNSAFE_TabBarMixed.js +2 -2
- package/es/UNSAFE_TableView.js +4 -4
- package/es/UNSAFE_Toolbar/tests/Toolbar.spec.js +1 -1
- package/es/UNSAFE_VirtualizedListView.js +5 -5
- package/es/{VirtualizedCollection-e73890a1.js → VirtualizedCollection-f048fbb8.js} +2 -2
- package/es/{VirtualizedCollection-e73890a1.js.map → VirtualizedCollection-f048fbb8.js.map} +1 -1
- package/es/{VirtualizedListView-3ef40bde.js → VirtualizedListView-0532e46c.js} +2 -2
- package/es/{VirtualizedListView-3ef40bde.js.map → VirtualizedListView-0532e46c.js.map} +1 -1
- package/es/{useSelectCommon-1dafa6f9.js → useSelectCommon-af8e715e.js} +2 -2
- package/es/{useSelectCommon-1dafa6f9.js.map → useSelectCommon-af8e715e.js.map} +1 -1
- package/package.json +2 -2
- package/amd/CardFlexView-bb5c4369.js +0 -2
- package/amd/InputDatePicker-fc39f0a6.js +0 -2
- package/amd/List-04c4fed0.js +0 -2
- package/amd/LoadMoreCollection-a6adbc3f.js +0 -2
- package/amd/MaxLengthCounter-9a95922c.js +0 -2
- package/amd/MaxLengthCounter-9a95922c.js.map +0 -1
- package/amd/TextArea-89b9ed65.js +0 -2
- package/amd/TextArea-89b9ed65.js.map +0 -1
- package/amd/TextAreaAutosize-81449e46.js +0 -2
- package/cjs/MaxLengthCounter-9ab3f74b.js +0 -27
- package/cjs/MaxLengthCounter-9ab3f74b.js.map +0 -1
- package/cjs/TextArea-e7f98e9f.js.map +0 -1
- package/cjs/index-8c93d858.js.map +0 -1
- package/es/CheckboxSet-3c3b7c71.js +0 -49
- package/es/CheckboxSet-3c3b7c71.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Indexer-357554c4.js","sources":["../../src/UNSAFE_Indexer/IndexerItems.tsx","../../src/UNSAFE_Indexer/Indexer.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { Fragment } from 'preact';\nimport { classNames } from '../utils/UNSAFE_classNames';\nimport { Flex } from '../UNSAFE_Flex';\nimport { useTranslationBundle } from '../hooks/UNSAFE_useTranslationBundle';\nimport type { BundleType } from '../resources/nls/bundle';\nimport { ItemContext } from 'src/UNSAFE_Collection';\nimport { forwardRef, ForwardedRef } from 'preact/compat';\nimport { useComponentTheme } from '../hooks/UNSAFE_useComponentTheme';\nimport { IndexerStyles, IndexerItemVariantOptions } from './themes/IndexerStyles.css';\nimport { IndexerRedwoodTheme } from './themes/redwood/IndexerTheme';\n\n/**\n * Type of a section\n */\nexport type Section<K> = {\n /**\n * The key of each section\n */\n key: K;\n /**\n * The label of each section\n */\n label?: string;\n /**\n * A property that indicates whether the section\n * is disabled or not. Typically, when Indexer is\n * used with ListView, a disabled section implies\n * that there's no corresponding items in the ListView\n */\n isDisabled?: boolean;\n};\n\n/**\n * The others section variable that application could use\n * to compare value\n */\n// const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\nexport const SECTION_OTHERS: Section<string> = Object.freeze({\n key: '__others__',\n label: '#'\n});\n\nexport const ITEM_SELECTOR = '[data-oj-key]';\n\nexport type SectionProps<K> = {\n context: ItemContext<Section<K>>;\n currentKey: K;\n selectedKey: K;\n valueNow: number; // the index of an item within currently visible sections\n isFocusRingVisible: boolean;\n};\n\nexport const SectionItem = forwardRef(\n <K extends string | number>(props: SectionProps<K>, ref: ForwardedRef<HTMLLIElement>) => {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n\n const { context, selectedKey } = props;\n const isSelected = context.data.key === selectedKey;\n const commonProps = getCommonProps(props, ref);\n\n const { classes } = useComponentTheme<IndexerItemVariantOptions, IndexerStyles>(\n IndexerRedwoodTheme,\n {\n focused: commonProps.ref && commonProps.isFocusRingVisible ? 'isFocused' : 'notFocused',\n disabled: context.data.isDisabled ? 'isDisabled' : 'notDisabled',\n selected: isSelected ? 'isSelected' : 'notSelected'\n }\n );\n const itemClasses = classNames([classes]);\n\n const sectionLabel = context.data.label || context.data.key;\n const valueText = context.data.isDisabled\n ? translations.indexer_disabledLabel({ SECTION: `${sectionLabel}` })\n : `${sectionLabel}`;\n\n return (\n <li\n {...commonProps}\n class={itemClasses}\n data-oj-valuetext={valueText}\n data-oj-disabled={context.data.isDisabled}>\n {context.data.label || context.data.key}\n </li>\n );\n }\n);\n\nfunction getCommonProps<K>(\n { context, currentKey, valueNow, isFocusRingVisible }: SectionProps<K>,\n ref: ForwardedRef<HTMLLIElement>\n) {\n const isCurrent = context.data.key === currentKey;\n return {\n ...(isCurrent && { ref }),\n key: context.data.key,\n 'data-oj-key': context.data.key,\n 'data-oj-key-type': typeof context.data.key,\n 'data-oj-valuenow': valueNow,\n isFocusRingVisible: !!isFocusRingVisible\n };\n}\n\ntype LastSectionProps<K> = SectionProps<K> & {\n lastValueNow: number;\n};\n\n// render the last section, that contains the last character and others character\nexport const LastSectionItem = forwardRef(\n <K extends string | number>(\n { lastValueNow, ...sectionProps }: LastSectionProps<K>,\n ref: ForwardedRef<HTMLLIElement>\n ) => {\n const commonProps = { ...sectionProps, ref };\n return (\n <Fragment>\n <SectionItem {...commonProps} />\n <OthersItem\n {...commonProps}\n ref={ref}\n context={{ index: -1, data: SECTION_OTHERS } as ItemContext<Section<K>>}\n valueNow={lastValueNow}\n />\n </Fragment>\n );\n }\n);\n\nconst OthersItem = forwardRef(<K,>(props: SectionProps<K>, ref: ForwardedRef<HTMLLIElement>) => {\n const { context, selectedKey } = props;\n const commonProps = getCommonProps(props, ref);\n\n const isSelected = context.data.key === selectedKey;\n const { classes } = useComponentTheme<IndexerItemVariantOptions>(IndexerRedwoodTheme, {\n focused: commonProps.ref && commonProps.isFocusRingVisible ? 'isFocused' : 'notFocused',\n selected: isSelected ? 'isSelected' : 'notSelected'\n });\n const othersClasses = classNames([classes]);\n const othersValueText = SECTION_OTHERS.label;\n\n return (\n <li {...commonProps} class={othersClasses} data-oj-valuetext={othersValueText}>\n {context.data.label}\n </li>\n );\n});\n\ntype SeparatorProps<K> = SectionProps<K> & {\n sectionsPerTruncation: number;\n last: number;\n sections: Section<K>[];\n};\n\nexport const SeparatorItem = forwardRef(\n <K extends string | number>(props: SeparatorProps<K>, ref: ForwardedRef<HTMLLIElement>) => {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n\n const { context, sections } = props;\n const commonProps = getCommonProps(props, ref);\n const { from, to } = getSeparatorRange(props);\n const {\n classes,\n styles: { dotStyle }\n } = useComponentTheme<IndexerItemVariantOptions, IndexerStyles>(IndexerRedwoodTheme, {\n focused: commonProps.ref && commonProps.isFocusRingVisible ? 'isFocused' : 'notFocused'\n });\n\n if (!isInSeparatorMiddle(context.index, from, to)) {\n return null;\n }\n\n const fromText = sections[from].label || sections[from].key;\n const toText = sections[to].label || sections[to].key;\n\n const separatorClasses = classNames([classes]);\n\n const separatorValueText = translations.indexer_separatorLabel({\n FROM_SECTION: `${fromText}`,\n TO_SECTION: `${toText}`\n });\n\n return (\n <li {...commonProps} class={separatorClasses} data-oj-valuetext={separatorValueText}>\n <Flex align=\"center\" justify=\"center\">\n <div class={dotStyle}></div>\n </Flex>\n </li>\n );\n }\n);\n\nexport function hasSeparator<K>(props: SeparatorProps<K>) {\n const { from, to } = getSeparatorRange(props);\n return isInSeparatorMiddle(props.context.index, from, to);\n}\n\nfunction getSeparatorRange<K>({ context, sectionsPerTruncation, last }: SeparatorProps<K>) {\n const from = context.index - (context.index % sectionsPerTruncation) + 1;\n let to = from + sectionsPerTruncation - 2;\n to = to >= last ? last - 1 : to;\n\n return { from, to };\n}\n\nfunction isInSeparatorMiddle(index: number, from: number, to: number) {\n return index === Math.floor((from + to) / 2);\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { ComponentChildren, createRef, type RefObject } from 'preact';\nimport { useEffect, useRef, useState, StateUpdater, useCallback, Dispatch } from 'preact/hooks';\nimport { Flex } from '../UNSAFE_Flex';\nimport { mergeProps } from '../utils/UNSAFE_mergeProps';\nimport { useSingleSelection } from '../hooks/PRIVATE_useSingleSelection/useSingleSelection';\nimport { useCurrentKey } from '../hooks/PRIVATE_useCurrentKey';\nimport { useCollectionFocusRing } from '../hooks/PRIVATE_useCollectionFocusRing';\nimport { keyExtractor, getPrevNextKey, isMobile } from '../utils/PRIVATE_collectionUtils';\nimport { useId } from '../hooks/UNSAFE_useId';\nimport { useTranslationBundle } from '../hooks/UNSAFE_useTranslationBundle';\nimport type { BundleType } from '../resources/nls/bundle';\nimport { HiddenAccessible } from '../UNSAFE_HiddenAccessible';\nimport { ItemContext, CurrentKeyDetail, SingleSelectionDetail } from '../UNSAFE_Collection';\nimport { Collection } from '../PRIVATE_Collection';\nimport {\n Section,\n SectionItem,\n LastSectionItem,\n SeparatorItem,\n SECTION_OTHERS,\n hasSeparator,\n ITEM_SELECTOR\n} from './IndexerItems';\nimport { useComponentTheme } from '../hooks/UNSAFE_useComponentTheme';\nimport { IndexerStyles } from './themes/IndexerStyles.css';\nimport { IndexerRedwoodTheme } from './themes/redwood/IndexerTheme';\nimport { useTestId, TestIdProps } from '../hooks/UNSAFE_useTestId';\n\nexport type CommitDetail<K> = {\n value: K;\n};\n\ntype Props<K> = {\n /**\n * An array of sections, the default sections is an\n * array of 26 English alphabets and the # others character\n */\n sections?: Section<K>[];\n\n /**\n * The currently selected Section\n */\n value?: K;\n\n /**\n * A function that will be invoked when selection happens,\n * no matter the Section was selected before or not.\n */\n onCommit?: (detail: CommitDetail<K>) => void;\n};\n\nconst defaultSections: Section<string>[] = [\n { key: 'A' },\n { key: 'B' },\n { key: 'C' },\n { key: 'D' },\n { key: 'E' },\n { key: 'F' },\n { key: 'G' },\n { key: 'H' },\n { key: 'I' },\n { key: 'J' },\n { key: 'K' },\n { key: 'L' },\n { key: 'M' },\n { key: 'N' },\n { key: 'O' },\n { key: 'P' },\n { key: 'Q' },\n { key: 'R' },\n { key: 'S' },\n { key: 'T' },\n { key: 'U' },\n { key: 'V' },\n { key: 'W' },\n { key: 'X' },\n { key: 'Y' },\n { key: 'Z' }\n];\n\n/**\n * Pure Preact based component that consumes Collection component\n * and renders an indexer.\n */\nexport function Indexer<K extends string | number>({\n sections = defaultSections as Section<K>[],\n value,\n onCommit = () => {},\n testId\n}: Props<K> & TestIdProps) {\n const rootRef = useRef<HTMLDivElement>(null);\n const ulRef = useRef<HTMLUListElement>(null);\n const currElementRef = createRef<HTMLLIElement>();\n const [current, setCurrent] = useState<K | undefined>(sections[0]?.key);\n // the number of sections in each truncation\n const [sectionsPerTruncation, setSectionsPerTruncation] = useState<number>(-1);\n // the total number of rendered sections and separators\n const renderedSectionsCount = useRef<number>(-1);\n const itemHeightRef = useRef<number>(0);\n // the id for aria describedby\n const uniqueId = useId();\n\n const [showFocusRing, focusRingProps] = useCollectionFocusRing(rootRef, ['ArrowUp', 'ArrowDown']);\n\n const { currentKeyProps } = useCurrentKey(\n (element) => keyExtractor(element, ITEM_SELECTOR),\n true,\n getPrevNextKey(rootRef.current, current, true, ITEM_SELECTOR),\n getPrevNextKey(rootRef.current, current, false, ITEM_SELECTOR),\n undefined,\n undefined,\n current,\n (detail: CurrentKeyDetail<K>) => setCurrent(detail.value)\n );\n\n const { selectionProps } = useSingleSelection(\n (element) => handleKeyExtract(element, ulRef, current as K),\n // pass in undefined so onCommit handler will be called\n // no matter whether the Section was selected before or not\n undefined,\n (detail: SingleSelectionDetail<K>) => handleSelection(detail, onCommit, sections)\n );\n\n /**\n * Item renderer that will return a section item or a section separator\n * based on the sectionsPerTruncation and item context index.\n * @param context item context\n */\n const itemRenderer = (context: ItemContext<Section<K>>): ComponentChildren => {\n const last = sections.length - 1;\n renderedSectionsCount.current += 1;\n\n const commonProps = {\n context,\n ref: currElementRef,\n currentKey: current as K,\n selectedKey: value as K,\n valueNow: renderedSectionsCount.current,\n isFocusRingVisible: !!showFocusRing\n };\n\n // render the last and the others character, they are always present\n if (context.index === last) {\n return <LastSectionItem {...commonProps} lastValueNow={renderedSectionsCount.current + 1} />;\n }\n\n // render a section, in the non-truncation case or when it is the first in a truncation\n if (sectionsPerTruncation <= 1 || context.index % sectionsPerTruncation === 0) {\n return <SectionItem {...commonProps} />;\n }\n\n // render the separator in the middle of a truncation\n const separatorProps = { ...commonProps, sectionsPerTruncation, last, sections };\n if (hasSeparator(separatorProps)) {\n return <SeparatorItem {...separatorProps} />;\n }\n\n // remove the count for truncated sections\n renderedSectionsCount.current -= 1;\n\n return null;\n };\n\n // truncate the Indexer during resize\n const handleResize = useCallback(\n (entries: ResizeObserverEntry[]) => {\n for (const entry of entries) {\n updateSectionsPerTruncation(\n entry.contentRect.height,\n itemHeightRef.current,\n sections.length,\n sections[0]?.key,\n sectionsPerTruncation,\n setSectionsPerTruncation,\n setCurrent\n );\n }\n },\n [sections, sectionsPerTruncation]\n );\n\n useEffect(() => {\n if (ulRef.current) {\n // Get aria values from IndexerItem to update aria values on Indexer ul element\n ulRef.current.setAttribute('aria-valuemax', renderedSectionsCount.current + 1 + '');\n ulRef.current.setAttribute(\n 'aria-valuetext',\n currElementRef.current?.dataset?.['ojValuetext'] || ''\n );\n ulRef.current.setAttribute(\n 'aria-valuenow',\n currElementRef.current?.dataset?.['ojValuenow'] || ''\n );\n }\n renderedSectionsCount.current = -1;\n });\n\n /**\n * Set up the initial values for sectionsPerTruncation and event listeners\n */\n useEffect(() => {\n const root = rootRef.current;\n if (root) {\n itemHeightRef.current = root.querySelector('li')?.offsetHeight || 0;\n updateSectionsPerTruncation(\n root.offsetHeight,\n itemHeightRef.current,\n sections.length,\n sections[0]?.key,\n sectionsPerTruncation,\n setSectionsPerTruncation,\n setCurrent\n );\n }\n }, [sections, sectionsPerTruncation]);\n\n /**\n * Set up resize observer and refresh the resize observer when\n * sectionsPerTruncation is changed, otherwise it will only have the\n * old copy of sectionsPerTruncation.\n */\n useEffect(() => {\n const root = rootRef.current;\n if (root) {\n const resizeObserver = new ResizeObserver((entries: ResizeObserverEntry[]) => {\n handleResize(entries);\n });\n resizeObserver.observe(root);\n return () => {\n resizeObserver.unobserve(root);\n };\n }\n return undefined;\n }, [sectionsPerTruncation, handleResize]);\n\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const {\n styles: { baseStyle, innerStyle }\n } = useComponentTheme<never, IndexerStyles>(IndexerRedwoodTheme);\n const testIdProps = useTestId(testId);\n\n return (\n <div ref={rootRef} class={baseStyle} {...testIdProps}>\n <Flex align=\"center\" width=\"6x\" height=\"100%\">\n <ul\n {...mergeProps(currentKeyProps, focusRingProps, selectionProps)}\n ref={ulRef}\n tabIndex={0}\n aria-label=\"Indexer\"\n aria-orientation=\"vertical\"\n aria-valuemin={0}\n aria-describedby={uniqueId}\n role=\"slider\"\n class={innerStyle}>\n <Collection items={sections}>{itemRenderer}</Collection>\n </ul>\n </Flex>\n <HiddenAccessible>\n <span id={uniqueId}>{getIndexerDescription(translations)}</span>\n </HiddenAccessible>\n </div>\n );\n}\n\n// A function to extract key for selection\nconst handleKeyExtract = <K extends string | number>(\n element: HTMLElement,\n rootRef: RefObject<HTMLElement>,\n current: K\n) => {\n if (element === rootRef.current) {\n return current === undefined ? null : current;\n }\n return keyExtractor(element, ITEM_SELECTOR) as K;\n};\n\nconst handleSelection = <K extends string | number>(\n detail: SingleSelectionDetail<K>,\n onCommit: (value: CommitDetail<K>) => void,\n sections: Section<K>[]\n) => {\n if (detail.value === SECTION_OTHERS.key) {\n onCommit({ value: SECTION_OTHERS.key as K });\n } else {\n const selectedSection = sections.find((section) => section.key === detail.value) as Section<K>;\n onCommit({ value: selectedSection.key as K });\n }\n};\n\n/**\n * A function that calculates the section count, based on\n * the container height and the number of sections\n * @param height height of Indexer container\n */\nconst updateSectionsPerTruncation = <K extends string | number>(\n height: number,\n itemHeight: number,\n sectionsLength: number,\n firstSectionKey: K,\n sectionsPerTruncation: number,\n setSectionsPerTruncation: Dispatch<StateUpdater<number>>,\n setCurrent: Dispatch<StateUpdater<K | undefined>>\n) => {\n if (height === 0 || itemHeight === 0) {\n return;\n }\n\n const maxSections = height / itemHeight;\n const last = sectionsLength - 1;\n\n // when the container size is too small to hold two sections\n if (maxSections < 2) {\n if (sectionsPerTruncation !== last) {\n setSectionsPerTruncation(last);\n setCurrent(firstSectionKey);\n }\n\n // no truncation\n // compare with < 0.01 for the deviation from calculation, when sectionsLength and maxSections\n // are about the same, maxNum === sectionsLength doesn't work\n } else if (maxSections > sectionsLength || sectionsLength - maxSections < 0.01) {\n if (sectionsPerTruncation > 1) {\n setSectionsPerTruncation(1);\n setCurrent(firstSectionKey);\n }\n\n // need truncation\n } else {\n const tempSectionCount = findSectionCount(maxSections, last);\n if (tempSectionCount !== sectionsPerTruncation && tempSectionCount < sectionsLength) {\n setSectionsPerTruncation(tempSectionCount);\n setCurrent(firstSectionKey);\n }\n }\n};\n\n/**\n * A helper function to find the best section count\n * in a truncation\n *\n * @param maxSections maximum number of sections allowed in a truncation\n * @param last the index of last section\n */\nconst findSectionCount = (maxSections: number, last: number) => {\n // need truncation\n maxSections -= 2; // minus the last character and the others character\n maxSections /= 2; // each truncation has a section and a separator\n\n const newSectionCount = Math.round(last / maxSections) + 1;\n const truncationLeftover = last % newSectionCount;\n const truncationCount = Math.floor(last / newSectionCount) + (truncationLeftover > 1 ? 1 : 0);\n\n // When the sectionCount becomes greater, it will result in\n // same truncations but with different sections appearing.\n // The following is to find the best sectionCount in this case\n // and prevent unnecessary truncations.\n let tempLeftover = last - (truncationCount - 1) * newSectionCount;\n let tempSectionCount = newSectionCount;\n while (tempSectionCount > tempLeftover) {\n tempSectionCount -= 1;\n tempLeftover = last - (truncationCount - 1) * tempSectionCount;\n }\n if (tempSectionCount != newSectionCount) {\n tempSectionCount += 1;\n }\n\n return tempSectionCount;\n};\n\n/**\n * Helper function to find the aria description for Indexer,\n * based on whether current device is a mobile device\n */\nfunction getIndexerDescription(translations: any) {\n if (isMobile()) {\n return translations.indexer_touchInstructionText();\n } else {\n return translations.indexer_keyboardInstructionText();\n }\n}\n"],"names":["SECTION_OTHERS","Object","freeze","key","label","ITEM_SELECTOR","SectionItem","forwardRef","props","ref","translations","useTranslationBundle","context","selectedKey","isSelected","data","commonProps","getCommonProps","classes","useComponentTheme","IndexerRedwoodTheme","focused","isFocusRingVisible","disabled","isDisabled","selected","itemClasses","classNames","sectionLabel","valueText","indexer_disabledLabel","SECTION","_jsx","jsx","class","children","currentKey","valueNow","LastSectionItem","lastValueNow","sectionProps","_jsxs","jsxs","Fragment","OthersItem","index","othersClasses","othersValueText","SeparatorItem","sections","from","to","getSeparatorRange","styles","dotStyle","isInSeparatorMiddle","fromText","toText","separatorClasses","separatorValueText","indexer_separatorLabel","FROM_SECTION","TO_SECTION","Flex","align","justify","sectionsPerTruncation","last","Math","floor","defaultSections","handleKeyExtract","element","rootRef","current","undefined","keyExtractor","handleSelection","detail","onCommit","value","find","section","updateSectionsPerTruncation","height","itemHeight","sectionsLength","firstSectionKey","setSectionsPerTruncation","setCurrent","maxSections","tempSectionCount","findSectionCount","newSectionCount","round","truncationLeftover","truncationCount","tempLeftover","getIndexerDescription","isMobile","indexer_touchInstructionText","indexer_keyboardInstructionText","testId","useRef","ulRef","currElementRef","createRef","useState","renderedSectionsCount","itemHeightRef","uniqueId","useId","showFocusRing","focusRingProps","useCollectionFocusRing","currentKeyProps","useCurrentKey","getPrevNextKey","selectionProps","useSingleSelection","handleResize","useCallback","entries","entry","contentRect","length","useEffect","setAttribute","dataset","root","querySelector","offsetHeight","resizeObserver","ResizeObserver","observe","unobserve","baseStyle","innerStyle","testIdProps","useTestId","width","m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,GACvC,OAAO+C,EAAoB/C,EAAMI,QAAQiC,MAAOK,EAAMC,EACxD,CCxCQgG,CAAaD,GACRlH,EAACC,IAAAe,EAAkB,IAAAkG,KAI5BtC,EAAsBlC,SAAW,EAE1B,KAAI,QAiGT1C,MAACoH,EAAgBA,iBAAA,CAAAjH,SACfH,EAAAA,YAAMqH,GAAIvC,EAAW3E,SAAA+D,EAAsBxF,SAInD"}
|
|
1
|
+
{"version":3,"file":"Indexer-1531dbc3.js","sources":["../../src/UNSAFE_Indexer/IndexerItems.tsx","../../src/UNSAFE_Indexer/Indexer.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { Fragment } from 'preact';\nimport { classNames } from '../utils/UNSAFE_classNames';\nimport { Flex } from '../UNSAFE_Flex';\nimport { useTranslationBundle } from '../hooks/UNSAFE_useTranslationBundle';\nimport type { BundleType } from '../resources/nls/bundle';\nimport { ItemContext } from 'src/UNSAFE_Collection';\nimport { forwardRef, ForwardedRef } from 'preact/compat';\nimport { useComponentTheme } from '../hooks/UNSAFE_useComponentTheme';\nimport { IndexerStyles, IndexerItemVariantOptions } from './themes/IndexerStyles.css';\nimport { IndexerRedwoodTheme } from './themes/redwood/IndexerTheme';\n\n/**\n * Type of a section\n */\nexport type Section<K> = {\n /**\n * The key of each section\n */\n key: K;\n /**\n * The label of each section\n */\n label?: string;\n /**\n * A property that indicates whether the section\n * is disabled or not. Typically, when Indexer is\n * used with ListView, a disabled section implies\n * that there's no corresponding items in the ListView\n */\n isDisabled?: boolean;\n};\n\n/**\n * The others section variable that application could use\n * to compare value\n */\n// const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\nexport const SECTION_OTHERS: Section<string> = Object.freeze({\n key: '__others__',\n label: '#'\n});\n\nexport const ITEM_SELECTOR = '[data-oj-key]';\n\nexport type SectionProps<K> = {\n context: ItemContext<Section<K>>;\n currentKey: K;\n selectedKey: K;\n valueNow: number; // the index of an item within currently visible sections\n isFocusRingVisible: boolean;\n};\n\nexport const SectionItem = forwardRef(\n <K extends string | number>(props: SectionProps<K>, ref: ForwardedRef<HTMLLIElement>) => {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n\n const { context, selectedKey } = props;\n const isSelected = context.data.key === selectedKey;\n const commonProps = getCommonProps(props, ref);\n\n const { classes } = useComponentTheme<IndexerItemVariantOptions, IndexerStyles>(\n IndexerRedwoodTheme,\n {\n focused: commonProps.ref && commonProps.isFocusRingVisible ? 'isFocused' : 'notFocused',\n disabled: context.data.isDisabled ? 'isDisabled' : 'notDisabled',\n selected: isSelected ? 'isSelected' : 'notSelected'\n }\n );\n const itemClasses = classNames([classes]);\n\n const sectionLabel = context.data.label || context.data.key;\n const valueText = context.data.isDisabled\n ? translations.indexer_disabledLabel({ SECTION: `${sectionLabel}` })\n : `${sectionLabel}`;\n\n return (\n <li\n {...commonProps}\n class={itemClasses}\n data-oj-valuetext={valueText}\n data-oj-disabled={context.data.isDisabled}>\n {context.data.label || context.data.key}\n </li>\n );\n }\n);\n\nfunction getCommonProps<K>(\n { context, currentKey, valueNow, isFocusRingVisible }: SectionProps<K>,\n ref: ForwardedRef<HTMLLIElement>\n) {\n const isCurrent = context.data.key === currentKey;\n return {\n ...(isCurrent && { ref }),\n key: context.data.key,\n 'data-oj-key': context.data.key,\n 'data-oj-key-type': typeof context.data.key,\n 'data-oj-valuenow': valueNow,\n isFocusRingVisible: !!isFocusRingVisible\n };\n}\n\ntype LastSectionProps<K> = SectionProps<K> & {\n lastValueNow: number;\n};\n\n// render the last section, that contains the last character and others character\nexport const LastSectionItem = forwardRef(\n <K extends string | number>(\n { lastValueNow, ...sectionProps }: LastSectionProps<K>,\n ref: ForwardedRef<HTMLLIElement>\n ) => {\n const commonProps = { ...sectionProps, ref };\n return (\n <Fragment>\n <SectionItem {...commonProps} />\n <OthersItem\n {...commonProps}\n ref={ref}\n context={{ index: -1, data: SECTION_OTHERS } as ItemContext<Section<K>>}\n valueNow={lastValueNow}\n />\n </Fragment>\n );\n }\n);\n\nconst OthersItem = forwardRef(<K,>(props: SectionProps<K>, ref: ForwardedRef<HTMLLIElement>) => {\n const { context, selectedKey } = props;\n const commonProps = getCommonProps(props, ref);\n\n const isSelected = context.data.key === selectedKey;\n const { classes } = useComponentTheme<IndexerItemVariantOptions>(IndexerRedwoodTheme, {\n focused: commonProps.ref && commonProps.isFocusRingVisible ? 'isFocused' : 'notFocused',\n selected: isSelected ? 'isSelected' : 'notSelected'\n });\n const othersClasses = classNames([classes]);\n const othersValueText = SECTION_OTHERS.label;\n\n return (\n <li {...commonProps} class={othersClasses} data-oj-valuetext={othersValueText}>\n {context.data.label}\n </li>\n );\n});\n\ntype SeparatorProps<K> = SectionProps<K> & {\n sectionsPerTruncation: number;\n last: number;\n sections: Section<K>[];\n};\n\nexport const SeparatorItem = forwardRef(\n <K extends string | number>(props: SeparatorProps<K>, ref: ForwardedRef<HTMLLIElement>) => {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n\n const { context, sections } = props;\n const commonProps = getCommonProps(props, ref);\n const { from, to } = getSeparatorRange(props);\n const {\n classes,\n styles: { dotStyle }\n } = useComponentTheme<IndexerItemVariantOptions, IndexerStyles>(IndexerRedwoodTheme, {\n focused: commonProps.ref && commonProps.isFocusRingVisible ? 'isFocused' : 'notFocused'\n });\n\n if (!isInSeparatorMiddle(context.index, from, to)) {\n return null;\n }\n\n const fromText = sections[from].label || sections[from].key;\n const toText = sections[to].label || sections[to].key;\n\n const separatorClasses = classNames([classes]);\n\n const separatorValueText = translations.indexer_separatorLabel({\n FROM_SECTION: `${fromText}`,\n TO_SECTION: `${toText}`\n });\n\n return (\n <li {...commonProps} class={separatorClasses} data-oj-valuetext={separatorValueText}>\n <Flex align=\"center\" justify=\"center\">\n <div class={dotStyle}></div>\n </Flex>\n </li>\n );\n }\n);\n\nexport function hasSeparator<K>(props: SeparatorProps<K>) {\n const { from, to } = getSeparatorRange(props);\n return isInSeparatorMiddle(props.context.index, from, to);\n}\n\nfunction getSeparatorRange<K>({ context, sectionsPerTruncation, last }: SeparatorProps<K>) {\n const from = context.index - (context.index % sectionsPerTruncation) + 1;\n let to = from + sectionsPerTruncation - 2;\n to = to >= last ? last - 1 : to;\n\n return { from, to };\n}\n\nfunction isInSeparatorMiddle(index: number, from: number, to: number) {\n return index === Math.floor((from + to) / 2);\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { ComponentChildren, createRef, type RefObject } from 'preact';\nimport { useEffect, useRef, useState, StateUpdater, useCallback, Dispatch } from 'preact/hooks';\nimport { Flex } from '../UNSAFE_Flex';\nimport { mergeProps } from '../utils/UNSAFE_mergeProps';\nimport { useSingleSelection } from '../hooks/PRIVATE_useSingleSelection/useSingleSelection';\nimport { useCurrentKey } from '../hooks/PRIVATE_useCurrentKey';\nimport { useCollectionFocusRing } from '../hooks/PRIVATE_useCollectionFocusRing';\nimport { keyExtractor, getPrevNextKey, isMobile } from '../utils/PRIVATE_collectionUtils';\nimport { useId } from '../hooks/UNSAFE_useId';\nimport { useTranslationBundle } from '../hooks/UNSAFE_useTranslationBundle';\nimport type { BundleType } from '../resources/nls/bundle';\nimport { HiddenAccessible } from '../UNSAFE_HiddenAccessible';\nimport { ItemContext, CurrentKeyDetail, SingleSelectionDetail } from '../UNSAFE_Collection';\nimport { Collection } from '../PRIVATE_Collection';\nimport {\n Section,\n SectionItem,\n LastSectionItem,\n SeparatorItem,\n SECTION_OTHERS,\n hasSeparator,\n ITEM_SELECTOR\n} from './IndexerItems';\nimport { useComponentTheme } from '../hooks/UNSAFE_useComponentTheme';\nimport { IndexerStyles } from './themes/IndexerStyles.css';\nimport { IndexerRedwoodTheme } from './themes/redwood/IndexerTheme';\nimport { useTestId, TestIdProps } from '../hooks/UNSAFE_useTestId';\n\nexport type CommitDetail<K> = {\n value: K;\n};\n\ntype Props<K> = {\n /**\n * An array of sections, the default sections is an\n * array of 26 English alphabets and the # others character\n */\n sections?: Section<K>[];\n\n /**\n * The currently selected Section\n */\n value?: K;\n\n /**\n * A function that will be invoked when selection happens,\n * no matter the Section was selected before or not.\n */\n onCommit?: (detail: CommitDetail<K>) => void;\n};\n\nconst defaultSections: Section<string>[] = [\n { key: 'A' },\n { key: 'B' },\n { key: 'C' },\n { key: 'D' },\n { key: 'E' },\n { key: 'F' },\n { key: 'G' },\n { key: 'H' },\n { key: 'I' },\n { key: 'J' },\n { key: 'K' },\n { key: 'L' },\n { key: 'M' },\n { key: 'N' },\n { key: 'O' },\n { key: 'P' },\n { key: 'Q' },\n { key: 'R' },\n { key: 'S' },\n { key: 'T' },\n { key: 'U' },\n { key: 'V' },\n { key: 'W' },\n { key: 'X' },\n { key: 'Y' },\n { key: 'Z' }\n];\n\n/**\n * Pure Preact based component that consumes Collection component\n * and renders an indexer.\n */\nexport function Indexer<K extends string | number>({\n sections = defaultSections as Section<K>[],\n value,\n onCommit = () => {},\n testId\n}: Props<K> & TestIdProps) {\n const rootRef = useRef<HTMLDivElement>(null);\n const ulRef = useRef<HTMLUListElement>(null);\n const currElementRef = createRef<HTMLLIElement>();\n const [current, setCurrent] = useState<K | undefined>(sections[0]?.key);\n // the number of sections in each truncation\n const [sectionsPerTruncation, setSectionsPerTruncation] = useState<number>(-1);\n // the total number of rendered sections and separators\n const renderedSectionsCount = useRef<number>(-1);\n const itemHeightRef = useRef<number>(0);\n // the id for aria describedby\n const uniqueId = useId();\n\n const [showFocusRing, focusRingProps] = useCollectionFocusRing(rootRef, ['ArrowUp', 'ArrowDown']);\n\n const { currentKeyProps } = useCurrentKey(\n (element) => keyExtractor(element, ITEM_SELECTOR),\n true,\n getPrevNextKey(rootRef.current, current, true, ITEM_SELECTOR),\n getPrevNextKey(rootRef.current, current, false, ITEM_SELECTOR),\n undefined,\n undefined,\n current,\n (detail: CurrentKeyDetail<K>) => setCurrent(detail.value)\n );\n\n const { selectionProps } = useSingleSelection(\n (element) => handleKeyExtract(element, ulRef, current as K),\n // pass in undefined so onCommit handler will be called\n // no matter whether the Section was selected before or not\n undefined,\n (detail: SingleSelectionDetail<K>) => handleSelection(detail, onCommit, sections)\n );\n\n /**\n * Item renderer that will return a section item or a section separator\n * based on the sectionsPerTruncation and item context index.\n * @param context item context\n */\n const itemRenderer = (context: ItemContext<Section<K>>): ComponentChildren => {\n const last = sections.length - 1;\n renderedSectionsCount.current += 1;\n\n const commonProps = {\n context,\n ref: currElementRef,\n currentKey: current as K,\n selectedKey: value as K,\n valueNow: renderedSectionsCount.current,\n isFocusRingVisible: !!showFocusRing\n };\n\n // render the last and the others character, they are always present\n if (context.index === last) {\n return <LastSectionItem {...commonProps} lastValueNow={renderedSectionsCount.current + 1} />;\n }\n\n // render a section, in the non-truncation case or when it is the first in a truncation\n if (sectionsPerTruncation <= 1 || context.index % sectionsPerTruncation === 0) {\n return <SectionItem {...commonProps} />;\n }\n\n // render the separator in the middle of a truncation\n const separatorProps = { ...commonProps, sectionsPerTruncation, last, sections };\n if (hasSeparator(separatorProps)) {\n return <SeparatorItem {...separatorProps} />;\n }\n\n // remove the count for truncated sections\n renderedSectionsCount.current -= 1;\n\n return null;\n };\n\n // truncate the Indexer during resize\n const handleResize = useCallback(\n (entries: ResizeObserverEntry[]) => {\n for (const entry of entries) {\n updateSectionsPerTruncation(\n entry.contentRect.height,\n itemHeightRef.current,\n sections.length,\n sections[0]?.key,\n sectionsPerTruncation,\n setSectionsPerTruncation,\n setCurrent\n );\n }\n },\n [sections, sectionsPerTruncation]\n );\n\n useEffect(() => {\n if (ulRef.current) {\n // Get aria values from IndexerItem to update aria values on Indexer ul element\n ulRef.current.setAttribute('aria-valuemax', renderedSectionsCount.current + 1 + '');\n ulRef.current.setAttribute(\n 'aria-valuetext',\n currElementRef.current?.dataset?.['ojValuetext'] || ''\n );\n ulRef.current.setAttribute(\n 'aria-valuenow',\n currElementRef.current?.dataset?.['ojValuenow'] || ''\n );\n }\n renderedSectionsCount.current = -1;\n });\n\n /**\n * Set up the initial values for sectionsPerTruncation and event listeners\n */\n useEffect(() => {\n const root = rootRef.current;\n if (root) {\n itemHeightRef.current = root.querySelector('li')?.offsetHeight || 0;\n updateSectionsPerTruncation(\n root.offsetHeight,\n itemHeightRef.current,\n sections.length,\n sections[0]?.key,\n sectionsPerTruncation,\n setSectionsPerTruncation,\n setCurrent\n );\n }\n }, [sections, sectionsPerTruncation]);\n\n /**\n * Set up resize observer and refresh the resize observer when\n * sectionsPerTruncation is changed, otherwise it will only have the\n * old copy of sectionsPerTruncation.\n */\n useEffect(() => {\n const root = rootRef.current;\n if (root) {\n const resizeObserver = new ResizeObserver((entries: ResizeObserverEntry[]) => {\n handleResize(entries);\n });\n resizeObserver.observe(root);\n return () => {\n resizeObserver.unobserve(root);\n };\n }\n return undefined;\n }, [sectionsPerTruncation, handleResize]);\n\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const {\n styles: { baseStyle, innerStyle }\n } = useComponentTheme<never, IndexerStyles>(IndexerRedwoodTheme);\n const testIdProps = useTestId(testId);\n\n return (\n <div ref={rootRef} class={baseStyle} {...testIdProps}>\n <Flex align=\"center\" width=\"6x\" height=\"100%\">\n <ul\n {...mergeProps(currentKeyProps, focusRingProps, selectionProps)}\n ref={ulRef}\n tabIndex={0}\n aria-label=\"Indexer\"\n aria-orientation=\"vertical\"\n aria-valuemin={0}\n aria-describedby={uniqueId}\n role=\"slider\"\n class={innerStyle}>\n <Collection items={sections}>{itemRenderer}</Collection>\n </ul>\n </Flex>\n <HiddenAccessible>\n <span id={uniqueId}>{getIndexerDescription(translations)}</span>\n </HiddenAccessible>\n </div>\n );\n}\n\n// A function to extract key for selection\nconst handleKeyExtract = <K extends string | number>(\n element: HTMLElement,\n rootRef: RefObject<HTMLElement>,\n current: K\n) => {\n if (element === rootRef.current) {\n return current === undefined ? null : current;\n }\n return keyExtractor(element, ITEM_SELECTOR) as K;\n};\n\nconst handleSelection = <K extends string | number>(\n detail: SingleSelectionDetail<K>,\n onCommit: (value: CommitDetail<K>) => void,\n sections: Section<K>[]\n) => {\n if (detail.value === SECTION_OTHERS.key) {\n onCommit({ value: SECTION_OTHERS.key as K });\n } else {\n const selectedSection = sections.find((section) => section.key === detail.value) as Section<K>;\n onCommit({ value: selectedSection.key as K });\n }\n};\n\n/**\n * A function that calculates the section count, based on\n * the container height and the number of sections\n * @param height height of Indexer container\n */\nconst updateSectionsPerTruncation = <K extends string | number>(\n height: number,\n itemHeight: number,\n sectionsLength: number,\n firstSectionKey: K,\n sectionsPerTruncation: number,\n setSectionsPerTruncation: Dispatch<StateUpdater<number>>,\n setCurrent: Dispatch<StateUpdater<K | undefined>>\n) => {\n if (height === 0 || itemHeight === 0) {\n return;\n }\n\n const maxSections = height / itemHeight;\n const last = sectionsLength - 1;\n\n // when the container size is too small to hold two sections\n if (maxSections < 2) {\n if (sectionsPerTruncation !== last) {\n setSectionsPerTruncation(last);\n setCurrent(firstSectionKey);\n }\n\n // no truncation\n // compare with < 0.01 for the deviation from calculation, when sectionsLength and maxSections\n // are about the same, maxNum === sectionsLength doesn't work\n } else if (maxSections > sectionsLength || sectionsLength - maxSections < 0.01) {\n if (sectionsPerTruncation > 1) {\n setSectionsPerTruncation(1);\n setCurrent(firstSectionKey);\n }\n\n // need truncation\n } else {\n const tempSectionCount = findSectionCount(maxSections, last);\n if (tempSectionCount !== sectionsPerTruncation && tempSectionCount < sectionsLength) {\n setSectionsPerTruncation(tempSectionCount);\n setCurrent(firstSectionKey);\n }\n }\n};\n\n/**\n * A helper function to find the best section count\n * in a truncation\n *\n * @param maxSections maximum number of sections allowed in a truncation\n * @param last the index of last section\n */\nconst findSectionCount = (maxSections: number, last: number) => {\n // need truncation\n maxSections -= 2; // minus the last character and the others character\n maxSections /= 2; // each truncation has a section and a separator\n\n const newSectionCount = Math.round(last / maxSections) + 1;\n const truncationLeftover = last % newSectionCount;\n const truncationCount = Math.floor(last / newSectionCount) + (truncationLeftover > 1 ? 1 : 0);\n\n // When the sectionCount becomes greater, it will result in\n // same truncations but with different sections appearing.\n // The following is to find the best sectionCount in this case\n // and prevent unnecessary truncations.\n let tempLeftover = last - (truncationCount - 1) * newSectionCount;\n let tempSectionCount = newSectionCount;\n while (tempSectionCount > tempLeftover) {\n tempSectionCount -= 1;\n tempLeftover = last - (truncationCount - 1) * tempSectionCount;\n }\n if (tempSectionCount != newSectionCount) {\n tempSectionCount += 1;\n }\n\n return tempSectionCount;\n};\n\n/**\n * Helper function to find the aria description for Indexer,\n * based on whether current device is a mobile device\n */\nfunction getIndexerDescription(translations: any) {\n if (isMobile()) {\n return translations.indexer_touchInstructionText();\n } else {\n return translations.indexer_keyboardInstructionText();\n }\n}\n"],"names":["SECTION_OTHERS","Object","freeze","key","label","ITEM_SELECTOR","SectionItem","forwardRef","props","ref","translations","useTranslationBundle","context","selectedKey","isSelected","data","commonProps","getCommonProps","classes","useComponentTheme","IndexerRedwoodTheme","focused","isFocusRingVisible","disabled","isDisabled","selected","itemClasses","classNames","sectionLabel","valueText","indexer_disabledLabel","SECTION","_jsx","jsx","class","children","currentKey","valueNow","LastSectionItem","lastValueNow","sectionProps","_jsxs","jsxs","Fragment","OthersItem","index","othersClasses","othersValueText","SeparatorItem","sections","from","to","getSeparatorRange","styles","dotStyle","isInSeparatorMiddle","fromText","toText","separatorClasses","separatorValueText","indexer_separatorLabel","FROM_SECTION","TO_SECTION","Flex","align","justify","sectionsPerTruncation","last","Math","floor","defaultSections","handleKeyExtract","element","rootRef","current","undefined","keyExtractor","handleSelection","detail","onCommit","value","find","section","updateSectionsPerTruncation","height","itemHeight","sectionsLength","firstSectionKey","setSectionsPerTruncation","setCurrent","maxSections","tempSectionCount","findSectionCount","newSectionCount","round","truncationLeftover","truncationCount","tempLeftover","getIndexerDescription","isMobile","indexer_touchInstructionText","indexer_keyboardInstructionText","testId","useRef","ulRef","currElementRef","createRef","useState","renderedSectionsCount","itemHeightRef","uniqueId","useId","showFocusRing","focusRingProps","useCollectionFocusRing","currentKeyProps","useCurrentKey","getPrevNextKey","selectionProps","useSingleSelection","handleResize","useCallback","entries","entry","contentRect","length","useEffect","setAttribute","dataset","root","querySelector","offsetHeight","resizeObserver","ResizeObserver","observe","unobserve","baseStyle","innerStyle","testIdProps","useTestId","width","mergeProps","tabIndex","role","Collection","items","separatorProps","hasSeparator","HiddenAccessible","id"],"mappings":"4hBA4Ca,MAAAA,EAAkCC,OAAOC,OAAO,CAC3DC,IAAK,aACLC,MAAO,MAGIC,EAAgB,gBAUhBC,EAAcC,EAAUA,YACnC,CAA4BC,EAAwBC,KAClD,MAAMC,EAAeC,uBAAiC,6BAEhDC,QAAEA,EAAOC,YAAEA,GAAgBL,EAC3BM,EAAaF,EAAQG,KAAKZ,MAAQU,EAClCG,EAAcC,EAAeT,EAAOC,IAEpCS,QAAEA,GAAYC,EAAiBA,kBACnCC,sBACA,CACEC,QAASL,EAAYP,KAAOO,EAAYM,mBAAqB,YAAc,aAC3EC,SAAUX,EAAQG,KAAKS,WAAa,aAAe,cACnDC,SAAUX,EAAa,aAAe,gBAGpCY,EAAcC,EAAAA,WAAW,CAACT,IAE1BU,EAAehB,EAAQG,KAAKX,OAASQ,EAAQG,KAAKZ,IAClD0B,EAAYjB,EAAQG,KAAKS,WAC3Bd,EAAaoB,sBAAsB,CAAEC,QAAS,GAAGH,MACjD,GAAGA,IAEP,OACEI,EAAAC,IAAA,KAAA,IACMjB,EACJkB,MAAOR,EAAW,oBACCG,EAAS,mBACVjB,EAAQG,KAAKS,WAAUW,SACxCvB,EAAQG,KAAKX,OAASQ,EAAQG,KAAKZ,KAEtC,IAIN,SAASc,GACPL,QAAEA,EAAOwB,WAAEA,EAAUC,SAAEA,EAAQf,mBAAEA,GACjCb,GAGA,MAAO,IADWG,EAAQG,K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EACpB,OAAOnC,EAACC,IAAAK,EAAoB,IAAAtB,EAAauB,aAAcqE,EAAsBlC,QAAU,IAIzF,GAAIR,GAAyB,GAAKtD,EAAQiC,MAAQqB,GAA0B,EAC1E,OAAOlC,EAACC,IAAA3B,EAAgB,IAAAU,IAI1B,MAAMkI,EAAiB,IAAKlI,EAAakD,wBAAuBC,OAAMlB,YACtE,ODqCE,SAA0BzC,GAC9B,MAAM0C,KAAEA,EAAIC,GAAEA,GAAOC,EAAkB5C,GACvC,OAAO+C,EAAoB/C,EAAMI,QAAQiC,MAAOK,EAAMC,EACxD,CCxCQgG,CAAaD,GACRlH,EAACC,IAAAe,EAAkB,IAAAkG,KAI5BtC,EAAsBlC,SAAW,EAE1B,KAAI,QAiGT1C,MAACoH,EAAgBA,iBAAA,CAAAjH,SACfH,EAAAA,YAAMqH,GAAIvC,EAAW3E,SAAA+D,EAAsBxF,SAInD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact/compat', 'preact/hooks', './Calendar-8e1177b8', './InputDateMask-6d54c3e6', './HiddenAccessible-037ef42d', './IconButton-ae9a01ce', './clientHints-4f5a07b0', './FormFieldContext-3c44aaaa', './logger-0f873e29', './TabbableModeContext-a9c97640', './useTranslationBundle-516b1b83', 'css!./UserAssistanceStyles.styles.css', 'module', './UNSAFE_UserAssistance/themes/redwood/UserAssistanceVariants.css', './InlineUserAssistance-4656c2a6', './Flex-56ecdf4c', 'css!./MessageBannerStyles.styles.css', 'module', './UNSAFE_MessageBanner/themes/redwood/MessageBannerVariants.css', 'preact', './LayerHost-e95c5f30', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-69ce0a2d', 'css!./IconStyle.styles.css', 'css!./MessageStyles.styles.css', './MessageFormattingUtils-2e19d8de', './TransitionGroup-3b9d81b6', './MessagesContext-602a69a2', 'css!./HiddenAccessibleStyles.styles.css', 'css!./ComponentMessageStyles.styles.css', 'module', './UNSAFE_ComponentMessage/themes/redwood/ComponentMessageVariants.css', './Popup-d51bf3f4', './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-46782f99', './DatePicker-2c94a3bb', './SectionedContent-2a261004', './stringUtils-0ae982c2', './FormContext-5130e198', './useFormContext-30acdd33', './useId-c9578d26', './getFormatParse-c1655d39', './maskUtils-33317129', './calendarDateUtils-1783eb17'], (function(e,s,t,a,n,o,r,i,l,d,c,u,m,p,h,y,f,C,b,D,S,k,x,A,v,g,F,T,V,I,w,P,U,M,R,j,_,B,H,E,N,L,O,Y,Z,W,z,G,q,J,K,Q,X,$,ee){"use strict";const se=({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:C,messages:b,min:D,monthAndYearPicker:S,testId:k,todayButton:x,todayTimeZone:A,userAssistanceDensity:v,value:g,weekDisplay:F})=>{const[T,V]=a.useState(!1),[I,w]=a.useState(c),P=a.useCallback((e=>{V(e.placement.startsWith("top"))}),[]);I!==c&&(w(c),c||V(!1));const U=te(),{datePicker_label:M}=m.useTranslationBundle("@oracle/oraclejet-preact"),R=M(),j=s.jsx(z.DatePicker,{dayFormatter:n,daysOutsideMonth:o,height:U?void 0:"auto",onCommit:y,max:C,min:D,maxWidth:U?"100%":void 0,width:"100%",monthAndYearPicker:S,testId:k,todayTimeZone:A,todayButton:x,value:g,weekDisplay:F}),_=!c||T&&!U||l||u||!(t||r||b&&b.length>0)||"efficient"!==v&&"reflow"!==v?void 0:s.jsx(d.FormFieldContext.Provider,{value:{isFocused:!0},children:s.jsx("div",{class:Z.userAssistanceStyles,children:s.jsx(f.InlineUserAssistance,{assistiveText:t,fieldLabel:p,helpSourceLink:r,helpSourceText:i,messages:b,userAssistanceDensity:v})})}),B=k?k+(U?"_sheet":"_dropdown"):void 0,H=s.jsx("div",{class:Z.dropdownStyles,children:s.jsx(G.SectionedContent,{"aria-label":R,footer:_,hasFocusTrap:!0,main:j,role:"dialog",testId:B})});return U?s.jsx(W.Sheet,{initialFocus:"firstFocusable",isOpen:c,onClose:h,children:s.jsx(G.SectionedContent,{"aria-label":R,footer:_,hasFocusTrap:!0,main:j,role:"dialog",testId:B})}):s.jsx(G.StickyPositioningDropdown,{anchorRef:e,initialFocus:"firstFocusable",isOpen:c,onClose:h,onPosition:P,sizeOptions:{isMaxWidthAdjusted:!1,isMaxHeightAdjusted:!0},children:H})},te=()=>"phone"===l.getClientHints().deviceType,ae=e=>e&&ee.isCompleteCalendarDate(e)?e:void 0,ne=(e,s)=>{switch(s.type){case"dateChanged":return{...e,dateValue:s.data,completeDateValue:ae(s.data)};case"dateSelected":return{...e,dateValue:s.data,completeDateValue:s.data};case"reset":return{completeDateValue:ae(s.data),dateValue:s.data};default:return e}},oe=({onCommit:e,onInput:s,value:t})=>{const[n,o]=a.useState(!1),r=a.useRef(null),i=a.useRef(null),l=a.useRef(!1),d=a.useRef(),c=a.useRef(t),u=a.useRef(t),m=a.useRef(t),p=a.useRef(!1),{state:h,dispatch:y}=(({value:e})=>{const[s,t]=a.useReducer(ne,{completeDateValue:ae(e),dateValue:e});return{state:s,dispatch:t}})({value:t});$.calendarDatesAreDifferent(m.current,t)&&(m.current=t,$.calendarDatesAreDifferent(t,h.dateValue)&&(y({type:"reset",data:t}),u.current=t,c.current=t)),a.useEffect((()=>{$.calendarDatesAreDifferent(h.dateValue,u.current)&&(s({previousValue:u.current,value:h.dateValue}),u.current=h.dateValue),p.current&&$.calendarDatesAreDifferent(h.dateValue,c.current)&&(e?.({previousValue:c.current,value:h.dateValue}),c.current=h.dateValue,p.current=!1)}),[e,s,h.dateValue]);const f=a.useCallback((e=>{y({type:"dateChanged",data:e.value})}),[y]),C=a.useCallback((()=>{$.calendarDatesAreDifferent(c.current,h.dateValue)&&(e?.({value:h.dateValue,previousValue:c.current}),c.current=h.dateValue)}),[e,h.dateValue]),b=a.useCallback((()=>{l.current||o((e=>!e)),l.current=!1}),[]),D=a.useCallback((e=>{"outsideMousedown"===e.reason?(l.current=!0,clearTimeout(d.current),d.current=setTimeout((()=>{l.current=!1}),200)):"dismissed"!==e.reason&&"keyboardDismissed"!==e.reason||r.current?.focus(),o(!1)}),[]);return{calendarIconActionHandler:b,datePickerCommitHandler:a.useCallback((e=>{r.current?.focus(),p.current=!0,y({type:"dateSelected",data:e.value}),o(!1)}),[y]),dropdownCloseHandler:D,completeDateValue:h.completeDateValue,dateValue:h.dateValue,iconRef:r,isOpen:n,maskCommitHandler:C,maskInputHandler:f,maskRef:i}},re=t.forwardRef((({"aria-describedby":e,assistiveText:t,dayFormatter:l,daysOutsideMonth:d,helpSourceLink:c,helpSourceText:u,isDisabled:p,isReadonly:h,label:y,max:f,messages:C,min:b,monthAndYearPicker:D,todayTimeZone:S,todayButton:k,value:x,onCommit:A,onInput:v,testId:g,userAssistanceDensity:F,weekDisplay:T,...V},I)=>{const{calendarIconActionHandler:w,datePickerCommitHandler:P,completeDateValue:U,dateValue:M,dropdownCloseHandler:R,iconRef:j,isOpen:_,maskCommitHandler:B,maskInputHandler:H,maskRef:E}=oe({onCommit:A,onInput:v,value:x}),N=a.useRef(null),{inputDatePicker_selectDate:L,inputDatePicker_instruction:O}=m.useTranslationBundle("@oracle/oraclejet-preact"),Y=L(),{userAssistanceDensity:Z}=K.useFormContext(),W=F??Z;a.useImperativeHandle(I,(()=>({focus:()=>{E.current?.focus()},blur:()=>{E.current?.blur()}})));const z=Q.useId(),G=O(),J=p||h?void 0:s.jsx(r.HiddenAccessible,{id:z,isHidden:!0,children:G}),X=p||h?e:q.merge([e,z]),$=s.jsx(i.IconButton,{"aria-haspopup":"dialog","aria-label":Y,isDisabled:p,ref:j,size:"sm",testId:g?g+"_calendarIcon":void 0,variant:"ghost",onAction:w,children:s.jsx(n.SvgCalendar,{})}),ee=_;return s.jsxs(s.Fragment,{children:[s.jsx(o.InputDateMaskContext.Provider,{value:{isDropdownOpen:_,isInputDatePickerParent:!0},children:s.jsx(o.InputDateMask,{"aria-describedby":X,assistiveText:t,endContent:$,helpSourceLink:c,helpSourceText:u,isDisabled:p,isReadonly:h,label:y,onCommit:B,onInput:H,mainFieldRef:N,messages:C,testId:g,ref:E,userAssistanceDensity:F,value:M,...V})}),J,ee&&s.jsx(se,{anchorRef:N,assistiveText:t,dayFormatter:l,daysOutsideMonth:d,helpSourceLink:c,helpSourceText:u,isDisabled:p,isReadonly:h,isOpen:_,label:y,onClose:R,onCommit:P,max:f,messages:C,min:b,monthAndYearPicker:D,testId:g?g+"_datePicker":void 0,todayTimeZone:S,todayButton:k,userAssistanceDensity:W,value:U,weekDisplay:T})]})}));e.InputDatePicker=re}));
|
|
2
|
+
//# sourceMappingURL=InputDatePicker-18e2546b.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputDatePicker-fc39f0a6.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 { 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 { 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 Props = {\n onCommit: InputDatePickerProps['onCommit'];\n onInput: InputDatePickerProps['onInput'];\n value: InputDatePickerProps['value'];\n};\n\n/**\n * Hook that provides handlers and other functionality for InputDatePicker.\n */\nconst useInputDatePicker = ({ onCommit, onInput, value: currentValue }: Props) => {\n // Whether the dropdown is open.\n const [isOpen, setIsOpen] = useState(false);\n\n // Ref to the calendar icon button.\n const iconRef: RefObject<HTMLButtonElement> = useRef<HTMLButtonElement>(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 // If the current date value differs from the last committed value, then call onCommit.\n if (calendarDatesAreDifferent(lastCommittedDateRef.current, state.dateValue)) {\n onCommit?.({ value: state.dateValue, previousValue: lastCommittedDateRef.current });\n lastCommittedDateRef.current = state.dateValue;\n }\n }, [onCommit, state.dateValue]);\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 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 '#utils/UNSAFE_stringUtils';\nimport { useFormContext } from '#hooks/UNSAFE_useFormContext';\nimport { useId } from '#hooks/UNSAFE_useId';\nimport { useInputDatePicker } from './useInputDatePicker';\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 {\n calendarIconActionHandler,\n datePickerCommitHandler,\n completeDateValue,\n dateValue,\n dropdownCloseHandler,\n iconRef,\n isOpen,\n maskCommitHandler,\n maskInputHandler,\n maskRef\n } = useInputDatePicker({\n onCommit,\n onInput,\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 <>\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}\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 </>\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","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","InputDatePicker","forwardRef","propDescribedBy","propUserAssistanceDensity","dateMaskProps","ref","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":"ylEAsEA,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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qH,EACXpH,cAAeA,EACfC,aAAcA,EACdC,iBAAkBA,EAClBC,eAAgBA,EAChBC,eAAgBA,EAChBC,WAAYA,EACZE,WAAYA,EACZD,OAAQA,EACRE,MAAOA,EACPC,QAAS+F,EACT9F,SAAUmG,EACVlG,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-18e2546b.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 { 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 { 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 Props = {\n onCommit: InputDatePickerProps['onCommit'];\n onInput: InputDatePickerProps['onInput'];\n value: InputDatePickerProps['value'];\n};\n\n/**\n * Hook that provides handlers and other functionality for InputDatePicker.\n */\nconst useInputDatePicker = ({ onCommit, onInput, value: currentValue }: Props) => {\n // Whether the dropdown is open.\n const [isOpen, setIsOpen] = useState(false);\n\n // Ref to the calendar icon button.\n const iconRef: RefObject<HTMLButtonElement> = useRef<HTMLButtonElement>(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 // If the current date value differs from the last committed value, then call onCommit.\n if (calendarDatesAreDifferent(lastCommittedDateRef.current, state.dateValue)) {\n onCommit?.({ value: state.dateValue, previousValue: lastCommittedDateRef.current });\n lastCommittedDateRef.current = state.dateValue;\n }\n }, [onCommit, state.dateValue]);\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 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 '#utils/UNSAFE_stringUtils';\nimport { useFormContext } from '#hooks/UNSAFE_useFormContext';\nimport { useId } from '#hooks/UNSAFE_useId';\nimport { useInputDatePicker } from './useInputDatePicker';\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 {\n calendarIconActionHandler,\n datePickerCommitHandler,\n completeDateValue,\n dateValue,\n dropdownCloseHandler,\n iconRef,\n isOpen,\n maskCommitHandler,\n maskInputHandler,\n maskRef\n } = useInputDatePicker({\n onCommit,\n onInput,\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 <>\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}\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 </>\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","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","InputDatePicker","forwardRef","propDescribedBy","propUserAssistanceDensity","dateMaskProps","ref","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":"ylEAsEA,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,EAAAA,qBACC,CAAApD,cAAeA,EACfqD,WAAY7C,EACZL,eAAgBA,EAChBC,eAAgBA,EAChBQ,SAAUA,EACVM,sBAAuBA,QAM3BoC,EAAgBvC,EAASA,GAAUgB,EAAkB,SAAW,kBAAeS,EAI/Ee,EACJlB,EAAAA,IAAA,MAAA,C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
@@ -1,2 +1,2 @@
|
|
|
1
|
-
define(['exports', 'preact/jsx-runtime', './layoutUtils-c2938c54', './chartUtils-ed1b8cf4', './useChartDnd-947ed9e4', './LineSeries-a549e727', './dataStyleUtils-7ba616b8', './useUser-85c781ea', './colorUtils-a785c4c4', './accUtils-530bdb90', './Common/themes/themeContract.css', './Chart-
|
|
2
|
-
//# sourceMappingURL=LineAreaChart-
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', './layoutUtils-c2938c54', './chartUtils-ed1b8cf4', './useChartDnd-947ed9e4', './LineSeries-a549e727', './dataStyleUtils-7ba616b8', './useUser-85c781ea', './colorUtils-a785c4c4', './accUtils-530bdb90', './Common/themes/themeContract.css', './Chart-e2807ff7'], (function(e,t,i,n,s,r,o,a,l,d,g,c){"use strict";function h(e){return t.jsx(u,{datatip:()=>({content:""}),zoomAndScroll:"off",overview:"off",plotArea:{yMajorTick:{isRendered:!1}},xAxis:{tickLabel:{autoRotate:!1,isRendered:!!e.xAxis?.timeAxisType}},series:e.series,groups:e.groups,getDataItem:e.getDataItem,yAxis:{tickLabel:{isRendered:!1}},type:e.type})}const I=.2,x=.2;function u({width:e,height:d,selectedIds:u=[],hiddenIds:m=[],highlightedIds:f,hideAndShowBehavior:p="none",orientation:v="vertical",yAxis:S,series:y,groups:C,isStacked:A=!1,getDataItem:b,selectionMode:D="none",drilling:L="off",type:T="line",overview:k="off",dataLabelEffect:M="outline",...j}){const{direction:w,forcedColors:E}=a.useUser(),U="active"===E,F=void 0!==j.testId,R="rtl"===w,z="log"===S?.scale,W=j.xAxis?.timeAxisType,H=new Set(m),P=new Set(u),N=new Set(f),q="horizontal"===v,B=l.getColorRamp(),V=A?s.getCumulativeSeries(y.length,C.length,b,H,z):s.getSeriesData(y?.length,C?.length,b,H,z),G=(e,t)=>A?{...b(e,t),value:V[e][t]}:b(e,t),O=s.getMarkers(),J="lineWithArea"===T?x:1,K="area"===T||"lineWithArea"===T,Q="area"===T,X=[];return t.jsx(c.Chart,{width:e,height:d,selectedIds:P,hiddenIds:m,hideAndShowBehavior:p,orientation:v,yAxis:S,series:y,groups:C,selectionMode:D,drilling:L,isStacked:A,getDataItem:b,findNearest:(e,t)=>i.findNearestDataPoint(y,C,e,t,G,A,(()=>({offset:0,dataWidth:0})),((e,t)=>t.transform(e)),z,0,H,W),getDataItemPos:(e,t)=>(i,s)=>n.getLineAreaChartItemPosition(i,s,V,b,C,q,e,t,W),getMarkerInfo:(e,t)=>({color:o.getItemColor(e,t,y,b),type:o.getMarkerType(e,t,b)}),renderGridLinesInFront:K,getNavUtil:(e,t)=>o.getLineAreaChartNavUtil(b,y.length,e,t,A,R,q),getGapRatio:()=>1,offset:I,isRtl:R,overview:k,defaultOverviewContentRenderer:()=>t.jsx(h,{series:y,groups:C,getDataItem:b,type:T}),...j,children:({xStartIndex:e,xEndIndex:i,xScale:o,yScale:a,activeId:l,focusedItemInfo:d,hoveredItemInfo:c,isPointInsideMarquee:h,defaultFontSize:I,getTextDimensions:x})=>t.jsxs(t.Fragment,{children:[V.map(((u,m)=>{if(0===u.length)return;const p=y[m],S=s.getLineAreaSegments(a,o,u,e,i,q,z,C,m,G,W);X[m]=S[0];const T="curved"===p.lineType&&A&&V.length>1&&m>0,k=void 0===f||0===f.length||N.has(p.id),w=A&&0!=m?X.reduce(((e,t,i)=>i>=m?e:t.length>0?i:e),0):void 0;return t.jsxs(t.Fragment,{children:[K&&t.jsx(n.AreaSeries,{yScale:a,lineType:p.lineType,color:p.areaColor||B[m%B.length],isHorizontal:q,areaColorOpacity:J,isBottomSegmentCurved:T,bottomCoords:void 0!==w&&X[w].some((e=>null!=e))?X[w]:void 0,lineSegments:S,isLog:z,isHighlighted:k,seriesIndex:m}),t.jsx(r.LineSeries,{lineType:p.lineType,lineColor:Q?g.colorSchemeVars.dvt.contrastLine:p.lineColor,lineWidth:Q?A?2.5:1.25:p.lineWidth,lineStyle:p.lineStyle,color:p.lineColor||B[m%B.length],lineSegmentCoords:S,isHorizontal:q,isHighlighted:k,seriesIndex:m}),!A&&t.jsx(r.MarkersWithLabel,{yScale:a,xScale:o,groups:C,series:p,timeAxisType:W,color:p.lineColor||p.areaColor||B[m%B.length],seriesIndex:m,startIndex:e,endIndex:i,markerType:O[m%O.length],orientation:v,isLog:z,activeId:l,getDataItem:b,isPointInsideMarquee:h,selectedIds:P,highlightedIds:void 0!==f?N:void 0,focusedItemIndex:d.seriesIndex!==m||!d.isFocusVisible||j.isDataCursorEnabled&&j.dataCursorStyle?.isMarkerDisplayed?void 0:d.groupIndex,hoveredItemIndex:c?.isCurrent&&c.seriesIndex===m?c.groupIndex:void 0,isSelectionEnabled:"single"===D||"multiple"===D,isDrillEnabled:"on"===L,defaultFontSize:I,dataLabelEffect:M,isHighContrast:U,isTestEnv:F,getTextDimensions:x})]})})),A&&V.map(((n,s)=>{if(0===n.length)return;const g=y[s];return t.jsx(r.MarkersWithLabel,{yScale:a,series:y[s],xScale:o,groups:C,timeAxisType:W,color:g.lineColor||g.areaColor||B[s%B.length],seriesIndex:s,isPointInsideMarquee:h,startIndex:e,endIndex:i,markerType:O[s%O.length],orientation:v,isLog:z,activeId:l,getDataItem:G,selectedIds:P,focusedItemIndex:d.seriesIndex===s&&d.isFocusVisible?d.groupIndex:void 0,hoveredItemIndex:c?.isCurrent&&c.seriesIndex===s?c.groupIndex:void 0,isSelectionEnabled:"single"===D||"multiple"===D,isDrillEnabled:"on"===L,defaultFontSize:I,dataLabelEffect:M,isHighContrast:U,isTestEnv:F,getTextDimensions:x})}))]})})}e.LineAreaChart=u}));
|
|
2
|
+
//# sourceMappingURL=LineAreaChart-b4acee62.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineAreaChart-4140d004.js","sources":["../../src/UNSAFE_LineAreaChart/OverviewLineWithAreaChart.tsx","../../src/UNSAFE_LineAreaChart/LineAreaChart.tsx"],"sourcesContent":["import { LineAreaChart } from './LineAreaChart';\nimport { LineAreaChartProps, LineAreaItem } from './lineAreaChart.types';\n\nexport function OverviewLineAreaChart<K extends string | number, D extends LineAreaItem<K>>(\n props: LineAreaChartProps<K, D>\n) {\n return (\n <LineAreaChart\n datatip={() => ({ content: '' })}\n zoomAndScroll=\"off\"\n overview=\"off\"\n plotArea={{\n yMajorTick: {\n isRendered: false\n }\n }}\n xAxis={{\n tickLabel: {\n autoRotate: false,\n // @ts-ignore\n isRendered: props.xAxis?.timeAxisType ? true : false\n }\n }}\n series={props.series}\n groups={props.groups}\n getDataItem={props.getDataItem}\n yAxis={{\n tickLabel: {\n isRendered: false\n }\n }}\n type={props.type}\n />\n );\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { LineAreaChartProps, LineAreaItem } from './lineAreaChart.types';\nimport { findNearestDataPoint } from '#utils/PRIVATE_chartUtils/layoutUtils';\nimport { AreaSeries } from '#PRIVATE_LineAreaComponents/AreaSeries';\nimport { getCumulativeSeries, getMarkers, getSeriesData } from '#utils/PRIVATE_chartUtils/utils';\nimport { MarkersWithLabel } from '#PRIVATE_Chart/MarkersWithLabel';\nimport { getLineAreaChartNavUtil } from '#utils/PRIVATE_chartUtils/navUtils';\nimport { Chart } from '#PRIVATE_Chart';\nimport { Scale, TimeAxisProps } from '#utils/UNSAFE_visTypes/chart';\nimport { useUser } from '#hooks/UNSAFE_useUser';\nimport { getColorRamp } from '#utils/UNSAFE_visUtils';\nimport { LineSeries } from '#PRIVATE_LineAreaComponents/LineSeries';\nimport { Point } from '#utils/PRIVATE_visSVGUtils';\nimport { getLineAreaSegments } from '#utils/PRIVATE_chartUtils/utils';\nimport { colorSchemeVars } from '#Common/themes/themeContract.css';\nimport { getItemColor, getMarkerType } from '#utils/PRIVATE_chartUtils/dataStyleUtils';\nimport { getLineAreaChartItemPosition } from '#PRIVATE_LineAreaComponents/utils/chartUtils';\nimport { OverviewLineAreaChart } from './OverviewLineWithAreaChart';\n\nconst AXIS_OFFSET = 0.2;\nconst LINE_WITH_AREA_OPACITY = 0.2;\n\n/**\n * The LineAreaChart displays information graphically using lines and filled areas, making relationships among the data easier to understand.\n */\nexport function LineAreaChart<K extends string | number, D extends LineAreaItem<K>>({\n width,\n height,\n selectedIds = [],\n hiddenIds = [],\n highlightedIds,\n hideAndShowBehavior = 'none',\n orientation = 'vertical',\n yAxis,\n series,\n groups,\n isStacked = false,\n getDataItem,\n selectionMode = 'none',\n drilling = 'off',\n type = 'line',\n overview = 'off',\n dataLabelEffect = 'outline',\n ...props\n}: LineAreaChartProps<K, D>) {\n const { direction, forcedColors } = useUser();\n const isHighContrast = forcedColors === 'active';\n const isTestEnv = props.testId !== undefined;\n const isRtl = direction === 'rtl';\n const isLog = yAxis?.scale === 'log';\n const timeAxisType = (props.xAxis as TimeAxisProps)?.timeAxisType;\n const hiddenSet = new Set(hiddenIds);\n const selectedSet = new Set(selectedIds);\n const highlightedSet = new Set(highlightedIds);\n const isHoriz = orientation === 'horizontal';\n const colors = getColorRamp();\n const renderedSeries = isStacked\n ? getCumulativeSeries(series.length, groups.length, getDataItem, hiddenSet, isLog)\n : getSeriesData(series?.length, groups?.length, getDataItem, hiddenSet, isLog);\n\n const renderedGetDataItem = (seriesIndex: number, groupIndex: number): D | undefined => {\n if (!isStacked) return getDataItem(seriesIndex, groupIndex);\n return {\n ...getDataItem(seriesIndex, groupIndex),\n value: renderedSeries[seriesIndex][groupIndex]\n } as D;\n };\n\n const getGapRatio = () => {\n return 1;\n };\n\n const getNextChartItemFunc = (startIndex: number, endIndex: number) => {\n // TODO: JET-71332\n //@ts-ignore\n return getLineAreaChartNavUtil<D>(\n getDataItem,\n series.length,\n startIndex,\n endIndex,\n isStacked,\n isRtl,\n isHoriz\n );\n };\n\n const getDataItemPos = (xScale: Scale, yScale: Scale) => {\n return (seriesIndex: number, groupIndex: number) => {\n return getLineAreaChartItemPosition(\n seriesIndex,\n groupIndex,\n renderedSeries,\n getDataItem,\n groups,\n isHoriz,\n xScale,\n yScale,\n timeAxisType\n );\n };\n };\n\n const getMarkerColorAndType = (seriesIndex: number, groupIndex: number) => {\n return {\n color: getItemColor(seriesIndex, groupIndex, series, getDataItem),\n type: getMarkerType(seriesIndex, groupIndex, getDataItem)\n };\n };\n\n const findNearest = (xScale: Scale, yScale: Scale) => {\n const getSeriesDataInfo = () => {\n return {\n offset: 0,\n dataWidth: 0\n };\n };\n\n const getYCoord = (value: number, yScale: Scale) => {\n return yScale.transform(value);\n };\n\n return findNearestDataPoint<K, D>(\n series,\n groups,\n xScale,\n yScale,\n renderedGetDataItem,\n isStacked,\n getSeriesDataInfo,\n getYCoord,\n isLog,\n 0,\n hiddenSet,\n timeAxisType\n );\n };\n const markers = getMarkers();\n const areaOpacity = type === 'lineWithArea' ? LINE_WITH_AREA_OPACITY : 1;\n const isAreaRendered = type === 'area' || type === 'lineWithArea';\n const isContrastLineNeeded = type === 'area';\n const allLineSegmentCoords: Point[][] = [];\n return (\n <Chart\n width={width}\n height={height}\n selectedIds={selectedSet}\n hiddenIds={hiddenIds}\n hideAndShowBehavior={hideAndShowBehavior}\n orientation={orientation}\n yAxis={yAxis}\n series={series}\n groups={groups}\n selectionMode={selectionMode}\n drilling={drilling}\n isStacked={isStacked}\n getDataItem={getDataItem}\n findNearest={findNearest}\n getDataItemPos={getDataItemPos}\n getMarkerInfo={getMarkerColorAndType}\n renderGridLinesInFront={isAreaRendered}\n getNavUtil={getNextChartItemFunc}\n getGapRatio={getGapRatio}\n offset={AXIS_OFFSET}\n isRtl={isRtl}\n overview={overview}\n defaultOverviewContentRenderer={() => {\n return (\n <OverviewLineAreaChart\n series={series}\n groups={groups}\n getDataItem={getDataItem}\n type={type}\n />\n );\n }}\n {...props}>\n {({\n xStartIndex,\n xEndIndex,\n xScale,\n yScale,\n activeId,\n focusedItemInfo,\n hoveredItemInfo,\n isPointInsideMarquee,\n defaultFontSize,\n getTextDimensions\n }) => {\n return (\n <>\n {renderedSeries.map((lineAreaSeries, index) => {\n if (lineAreaSeries.length === 0) {\n /* TODO: need a better way to handle when a series is hidden. */\n return;\n }\n const seriesItem = series[index];\n const lineSegmentCoords: Point[][] = getLineAreaSegments<K, D>(\n yScale,\n xScale,\n lineAreaSeries,\n xStartIndex,\n xEndIndex,\n isHoriz,\n isLog,\n groups,\n index,\n renderedGetDataItem,\n timeAxisType\n );\n allLineSegmentCoords[index] = lineSegmentCoords[0];\n const isBottomSegmentCurved =\n seriesItem.lineType === 'curved' &&\n isStacked &&\n renderedSeries.length > 1 &&\n index > 0;\n\n const isHighlighted =\n highlightedIds === undefined ||\n highlightedIds.length === 0 ||\n highlightedSet.has(seriesItem.id);\n\n const prevCoords =\n isStacked && index != 0\n ? allLineSegmentCoords.reduce((prevValue, newValue, j) => {\n // find the index i such that i < index, and series i has at least\n // one or more data item unhidden. Only such series will can be\n // used as bottomCoord for current series. Otherwise we have to use\n // baseline coord\n if (j >= index) {\n return prevValue;\n }\n if (newValue.length > 0) {\n return j;\n }\n return prevValue;\n }, 0)\n : undefined;\n\n return (\n <>\n {isAreaRendered && (\n <AreaSeries\n yScale={yScale}\n lineType={seriesItem.lineType}\n color={seriesItem.areaColor || colors[index % colors.length]}\n isHorizontal={isHoriz}\n areaColorOpacity={areaOpacity}\n isBottomSegmentCurved={isBottomSegmentCurved}\n bottomCoords={\n prevCoords !== undefined &&\n allLineSegmentCoords[prevCoords].some((value) => value != null)\n ? allLineSegmentCoords[prevCoords]\n : undefined\n }\n lineSegments={lineSegmentCoords}\n isLog={isLog}\n isHighlighted={isHighlighted}\n seriesIndex={index}\n />\n )}\n <LineSeries\n lineType={seriesItem.lineType}\n /* TODO: confirm with UX if this is contrastLine (changes depending on dark/light mode) or always white. \n It's always white in legacy.*/\n lineColor={\n isContrastLineNeeded ? colorSchemeVars.dvt.contrastLine : seriesItem.lineColor\n }\n /* The area generated in legacy are bit apart and not touching when stacked. Preact areas are a bit closer than legacy when curved. \n Increased the contrast linewidth (to 2.5 from legacy 1.25) to give legacy visual treatment.\n TODO: investivage why legacy areas are not touching. maybe we want to do the same in preact svg utils that\n generates this curve.\n */\n lineWidth={\n isContrastLineNeeded ? (isStacked ? 2.5 : 1.25) : seriesItem.lineWidth\n }\n lineStyle={seriesItem.lineStyle}\n color={seriesItem.lineColor || colors[index % colors.length]}\n lineSegmentCoords={lineSegmentCoords}\n isHorizontal={isHoriz}\n isHighlighted={isHighlighted}\n seriesIndex={index}\n />\n {\n /*for non stacked charts, markers should render in the order of series.\n some markers might get hidden behind area but this preserves the legacy behavior. */\n !isStacked && (\n <MarkersWithLabel\n yScale={yScale}\n xScale={xScale}\n groups={groups}\n series={seriesItem}\n timeAxisType={timeAxisType}\n color={\n seriesItem.lineColor ||\n seriesItem.areaColor ||\n colors[\n index % colors.length\n ] /* TODO : make this use getItemColor function from dataStyleUtils. */\n }\n seriesIndex={index}\n startIndex={xStartIndex}\n endIndex={xEndIndex}\n markerType={markers[index % markers.length]}\n orientation={orientation}\n isLog={isLog}\n activeId={activeId}\n getDataItem={getDataItem}\n isPointInsideMarquee={isPointInsideMarquee}\n selectedIds={selectedSet}\n highlightedIds={highlightedIds !== undefined ? highlightedSet : undefined}\n focusedItemIndex={\n focusedItemInfo.seriesIndex === index &&\n focusedItemInfo.isFocusVisible &&\n !(props.isDataCursorEnabled && props.dataCursorStyle?.isMarkerDisplayed)\n ? focusedItemInfo.groupIndex\n : undefined\n }\n hoveredItemIndex={\n hoveredItemInfo?.isCurrent && hoveredItemInfo.seriesIndex === index\n ? hoveredItemInfo.groupIndex\n : undefined\n }\n isSelectionEnabled={\n selectionMode === 'single' || selectionMode === 'multiple'\n }\n isDrillEnabled={drilling === 'on'}\n defaultFontSize={defaultFontSize}\n dataLabelEffect={dataLabelEffect}\n isHighContrast={isHighContrast}\n isTestEnv={isTestEnv}\n getTextDimensions={getTextDimensions}\n />\n )\n }\n </>\n );\n })}\n {isStacked &&\n renderedSeries.map((lineAreaSeries, index) => {\n if (lineAreaSeries.length === 0) {\n /* TODO: need a better way to handle when a series is hidden.*/\n return;\n }\n const seriesItem = series[index];\n return (\n <MarkersWithLabel\n yScale={yScale}\n series={series[index]}\n xScale={xScale}\n groups={groups}\n timeAxisType={timeAxisType}\n color={\n seriesItem.lineColor || seriesItem.areaColor || colors[index % colors.length]\n }\n seriesIndex={index}\n isPointInsideMarquee={isPointInsideMarquee}\n startIndex={xStartIndex}\n endIndex={xEndIndex}\n markerType={markers[index % markers.length]}\n orientation={orientation}\n isLog={isLog}\n activeId={activeId}\n getDataItem={renderedGetDataItem}\n selectedIds={selectedSet}\n focusedItemIndex={\n focusedItemInfo.seriesIndex === index && focusedItemInfo.isFocusVisible\n ? focusedItemInfo.groupIndex\n : undefined\n }\n hoveredItemIndex={\n hoveredItemInfo?.isCurrent && hoveredItemInfo.seriesIndex === index\n ? hoveredItemInfo.groupIndex\n : undefined\n }\n isSelectionEnabled={selectionMode === 'single' || selectionMode === 'multiple'}\n isDrillEnabled={drilling === 'on'}\n defaultFontSize={defaultFontSize}\n dataLabelEffect={dataLabelEffect}\n isHighContrast={isHighContrast}\n isTestEnv={isTestEnv}\n getTextDimensions={getTextDimensions}\n />\n );\n })}\n </>\n );\n }}\n </Chart>\n );\n}\n"],"names":["OverviewLineAreaChart","props","_jsx","jsx","LineAreaChart","datatip","content","zoomAndScroll","overview","plotArea","yMajorTick","isRendered","xAxis","tickLabel","autoRotate","timeAxisType","series","groups","getDataItem","yAxis","type","AXIS_OFFSET","LINE_WITH_AREA_OPACITY","width","height","selectedIds","hiddenIds","highlightedIds","hideAndShowBehavior","orientation","isStacked","selectionMode","drilling","dataLabelEffect","direction","forcedColors","useUser","isHighContrast","isTestEnv","undefined","testId","isRtl","isLog","scale","hiddenSet","Set","selectedSet","highlightedSet","isHoriz","colors","getColorRamp","renderedSeries","getCumulativeSeries","length","getSeriesData","renderedGetDataItem","seriesIndex","groupIndex","value","markers","getMarkers","areaOpacity","isAreaRendered","isContrastLineNeeded","allLineSegmentCoords","Chart","findNearest","xScale","yScale","findNearestDataPoint","offset","dataWidth","transform","getDataItemPos","getLineAreaChartItemPosition","getMarkerInfo","color","getItemColor","getMarkerType","renderGridLinesInFront","getNavUtil","startIndex","endIndex","getLineAreaChartNavUtil","getGapRatio","defaultOverviewContentRenderer","children","xStartIndex","xEndIndex","activeId","focusedItemInfo","hoveredItemInfo","isPointInsideMarquee","defaultFontSize","getTextDimensions","_jsxs","jsxs","_Fragment","Fragment","map","lineAreaSeries","index","seriesItem","lineSegmentCoords","getLineAreaSegments","isBottomSegmentCurved","lineType","isHighlighted","has","id","prevCoords","reduce","prevValue","newValue","j","AreaSeries","areaColor","isHorizontal","areaColorOpacity","bottomCoords","some","lineSegments","LineSeries","lineColor","colorSchemeVars","dvt","contrastLine","lineWidth","lineStyle","MarkersWithLabel","markerType","focusedItemIndex","isFocusVisible","isDataCursorEnabled","dataCursorStyle","isMarkerDisplayed","hoveredItemIndex","isCurrent","isSelectionEnabled","isDrillEnabled"],"mappings":"gVAGM,SAAUA,EACdC,GAEA,OACEC,EAACC,IAAAC,EACC,CAAAC,QAAS,KAAO,CAAEC,QAAS,KAC3BC,cAAc,MACdC,SAAS,MACTC,SAAU,CACRC,WAAY,CACVC,YAAY,IAGhBC,MAAO,CACLC,UAAW,CACTC,YAAY,EAEZH,aAAYV,EAAMW,OAAOG,eAG7BC,OAAQf,EAAMe,OACdC,OAAQhB,EAAMgB,OACdC,YAAajB,EAAMiB,YACnBC,MAAO,CACLN,UAAW,CACTF,YAAY,IAGhBS,KAAMnB,EAAMmB,MAGlB,CCTA,MAAMC,EAAc,GACdC,EAAyB,GAKf,SAAAlB,GAAoEmB,MAClFA,EAAKC,OACLA,EAAMC,YACNA,EAAc,GAAEC,UAChBA,EAAY,GAAEC,eACdA,EAAcC,oBACdA,EAAsB,OAAMC,YAC5BA,EAAc,WAAUV,MACxBA,EAAKH,OACLA,EAAMC,OACNA,EAAMa,UACNA,GAAY,EAAKZ,YACjBA,EAAW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tB+E,iBACE7C,GAAiB8C,WAAa9C,EAAgBnC,cAAgB6C,EAC1DV,EAAgBlC,gBAChBlB,EAENmG,mBACoB,WAAlB3G,GAAgD,aAAlBA,EAEhC4G,eAA6B,OAAb3G,EAChB6D,gBAAiBA,EACjB5D,gBAAiBA,EACjBI,eAAgBA,EAChBC,UAAWA,EACXwD,kBAAmBA,MAK3B,IAEHhE,GACCqB,EAAegD,KAAI,CAACC,EAAgBC,KAClC,GAA8B,IAA1BD,EAAe/C,OAEjB,OAEF,MAAMiD,EAAatF,EAAOqF,GAC1B,OACEnG,MAAC+H,EAAAA,iBAAgB,CACf7D,OAAQA,EACRpD,OAAQA,EAAOqF,GACflC,OAAQA,EACRlD,OAAQA,EACRF,aAAcA,EACd6D,MACE0B,EAAWqB,WAAarB,EAAWc,WAAanE,EAAOoD,EAAQpD,EAAOI,QAExEG,YAAa6C,EACbT,qBAAsBA,EACtBX,WAAYM,EACZL,SAAUM,EACV0C,WAAYvE,EAAQ0C,EAAQ1C,EAAQN,QACpCxB,YAAaA,EACba,MAAOA,EACP+C,SAAUA,EACVvE,YAAaqC,EACb9B,YAAaqB,EACbqF,iBACEzC,EAAgBlC,cAAgB6C,GAASX,EAAgB0C,eACrD1C,EAAgBjC,gBAChBlB,EAENiG,iBACE7C,GAAiB8C,WAAa9C,EAAgBnC,cAAgB6C,EAC1DV,EAAgBlC,gBAChBlB,EAENmG,mBAAsC,WAAlB3G,GAAgD,aAAlBA,EAClD4G,eAA6B,OAAb3G,EAChB6D,gBAAiBA,EACjB5D,gBAAiBA,EACjBI,eAAgBA,EAChBC,UAAWA,EACXwD,kBAAmBA,GAErB,QAOlB"}
|
|
1
|
+
{"version":3,"file":"LineAreaChart-b4acee62.js","sources":["../../src/UNSAFE_LineAreaChart/OverviewLineWithAreaChart.tsx","../../src/UNSAFE_LineAreaChart/LineAreaChart.tsx"],"sourcesContent":["import { LineAreaChart } from './LineAreaChart';\nimport { LineAreaChartProps, LineAreaItem } from './lineAreaChart.types';\n\nexport function OverviewLineAreaChart<K extends string | number, D extends LineAreaItem<K>>(\n props: LineAreaChartProps<K, D>\n) {\n return (\n <LineAreaChart\n datatip={() => ({ content: '' })}\n zoomAndScroll=\"off\"\n overview=\"off\"\n plotArea={{\n yMajorTick: {\n isRendered: false\n }\n }}\n xAxis={{\n tickLabel: {\n autoRotate: false,\n // @ts-ignore\n isRendered: props.xAxis?.timeAxisType ? true : false\n }\n }}\n series={props.series}\n groups={props.groups}\n getDataItem={props.getDataItem}\n yAxis={{\n tickLabel: {\n isRendered: false\n }\n }}\n type={props.type}\n />\n );\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { LineAreaChartProps, LineAreaItem } from './lineAreaChart.types';\nimport { findNearestDataPoint } from '#utils/PRIVATE_chartUtils/layoutUtils';\nimport { AreaSeries } from '#PRIVATE_LineAreaComponents/AreaSeries';\nimport { getCumulativeSeries, getMarkers, getSeriesData } from '#utils/PRIVATE_chartUtils/utils';\nimport { MarkersWithLabel } from '#PRIVATE_Chart/MarkersWithLabel';\nimport { getLineAreaChartNavUtil } from '#utils/PRIVATE_chartUtils/navUtils';\nimport { Chart } from '#PRIVATE_Chart';\nimport { Scale, TimeAxisProps } from '#utils/UNSAFE_visTypes/chart';\nimport { useUser } from '#hooks/UNSAFE_useUser';\nimport { getColorRamp } from '#utils/UNSAFE_visUtils';\nimport { LineSeries } from '#PRIVATE_LineAreaComponents/LineSeries';\nimport { Point } from '#utils/PRIVATE_visSVGUtils';\nimport { getLineAreaSegments } from '#utils/PRIVATE_chartUtils/utils';\nimport { colorSchemeVars } from '#Common/themes/themeContract.css';\nimport { getItemColor, getMarkerType } from '#utils/PRIVATE_chartUtils/dataStyleUtils';\nimport { getLineAreaChartItemPosition } from '#PRIVATE_LineAreaComponents/utils/chartUtils';\nimport { OverviewLineAreaChart } from './OverviewLineWithAreaChart';\n\nconst AXIS_OFFSET = 0.2;\nconst LINE_WITH_AREA_OPACITY = 0.2;\n\n/**\n * The LineAreaChart displays information graphically using lines and filled areas, making relationships among the data easier to understand.\n */\nexport function LineAreaChart<K extends string | number, D extends LineAreaItem<K>>({\n width,\n height,\n selectedIds = [],\n hiddenIds = [],\n highlightedIds,\n hideAndShowBehavior = 'none',\n orientation = 'vertical',\n yAxis,\n series,\n groups,\n isStacked = false,\n getDataItem,\n selectionMode = 'none',\n drilling = 'off',\n type = 'line',\n overview = 'off',\n dataLabelEffect = 'outline',\n ...props\n}: LineAreaChartProps<K, D>) {\n const { direction, forcedColors } = useUser();\n const isHighContrast = forcedColors === 'active';\n const isTestEnv = props.testId !== undefined;\n const isRtl = direction === 'rtl';\n const isLog = yAxis?.scale === 'log';\n const timeAxisType = (props.xAxis as TimeAxisProps)?.timeAxisType;\n const hiddenSet = new Set(hiddenIds);\n const selectedSet = new Set(selectedIds);\n const highlightedSet = new Set(highlightedIds);\n const isHoriz = orientation === 'horizontal';\n const colors = getColorRamp();\n const renderedSeries = isStacked\n ? getCumulativeSeries(series.length, groups.length, getDataItem, hiddenSet, isLog)\n : getSeriesData(series?.length, groups?.length, getDataItem, hiddenSet, isLog);\n\n const renderedGetDataItem = (seriesIndex: number, groupIndex: number): D | undefined => {\n if (!isStacked) return getDataItem(seriesIndex, groupIndex);\n return {\n ...getDataItem(seriesIndex, groupIndex),\n value: renderedSeries[seriesIndex][groupIndex]\n } as D;\n };\n\n const getGapRatio = () => {\n return 1;\n };\n\n const getNextChartItemFunc = (startIndex: number, endIndex: number) => {\n // TODO: JET-71332\n //@ts-ignore\n return getLineAreaChartNavUtil<D>(\n getDataItem,\n series.length,\n startIndex,\n endIndex,\n isStacked,\n isRtl,\n isHoriz\n );\n };\n\n const getDataItemPos = (xScale: Scale, yScale: Scale) => {\n return (seriesIndex: number, groupIndex: number) => {\n return getLineAreaChartItemPosition(\n seriesIndex,\n groupIndex,\n renderedSeries,\n getDataItem,\n groups,\n isHoriz,\n xScale,\n yScale,\n timeAxisType\n );\n };\n };\n\n const getMarkerColorAndType = (seriesIndex: number, groupIndex: number) => {\n return {\n color: getItemColor(seriesIndex, groupIndex, series, getDataItem),\n type: getMarkerType(seriesIndex, groupIndex, getDataItem)\n };\n };\n\n const findNearest = (xScale: Scale, yScale: Scale) => {\n const getSeriesDataInfo = () => {\n return {\n offset: 0,\n dataWidth: 0\n };\n };\n\n const getYCoord = (value: number, yScale: Scale) => {\n return yScale.transform(value);\n };\n\n return findNearestDataPoint<K, D>(\n series,\n groups,\n xScale,\n yScale,\n renderedGetDataItem,\n isStacked,\n getSeriesDataInfo,\n getYCoord,\n isLog,\n 0,\n hiddenSet,\n timeAxisType\n );\n };\n const markers = getMarkers();\n const areaOpacity = type === 'lineWithArea' ? LINE_WITH_AREA_OPACITY : 1;\n const isAreaRendered = type === 'area' || type === 'lineWithArea';\n const isContrastLineNeeded = type === 'area';\n const allLineSegmentCoords: Point[][] = [];\n return (\n <Chart\n width={width}\n height={height}\n selectedIds={selectedSet}\n hiddenIds={hiddenIds}\n hideAndShowBehavior={hideAndShowBehavior}\n orientation={orientation}\n yAxis={yAxis}\n series={series}\n groups={groups}\n selectionMode={selectionMode}\n drilling={drilling}\n isStacked={isStacked}\n getDataItem={getDataItem}\n findNearest={findNearest}\n getDataItemPos={getDataItemPos}\n getMarkerInfo={getMarkerColorAndType}\n renderGridLinesInFront={isAreaRendered}\n getNavUtil={getNextChartItemFunc}\n getGapRatio={getGapRatio}\n offset={AXIS_OFFSET}\n isRtl={isRtl}\n overview={overview}\n defaultOverviewContentRenderer={() => {\n return (\n <OverviewLineAreaChart\n series={series}\n groups={groups}\n getDataItem={getDataItem}\n type={type}\n />\n );\n }}\n {...props}>\n {({\n xStartIndex,\n xEndIndex,\n xScale,\n yScale,\n activeId,\n focusedItemInfo,\n hoveredItemInfo,\n isPointInsideMarquee,\n defaultFontSize,\n getTextDimensions\n }) => {\n return (\n <>\n {renderedSeries.map((lineAreaSeries, index) => {\n if (lineAreaSeries.length === 0) {\n /* TODO: need a better way to handle when a series is hidden. */\n return;\n }\n const seriesItem = series[index];\n const lineSegmentCoords: Point[][] = getLineAreaSegments<K, D>(\n yScale,\n xScale,\n lineAreaSeries,\n xStartIndex,\n xEndIndex,\n isHoriz,\n isLog,\n groups,\n index,\n renderedGetDataItem,\n timeAxisType\n );\n allLineSegmentCoords[index] = lineSegmentCoords[0];\n const isBottomSegmentCurved =\n seriesItem.lineType === 'curved' &&\n isStacked &&\n renderedSeries.length > 1 &&\n index > 0;\n\n const isHighlighted =\n highlightedIds === undefined ||\n highlightedIds.length === 0 ||\n highlightedSet.has(seriesItem.id);\n\n const prevCoords =\n isStacked && index != 0\n ? allLineSegmentCoords.reduce((prevValue, newValue, j) => {\n // find the index i such that i < index, and series i has at least\n // one or more data item unhidden. Only such series will can be\n // used as bottomCoord for current series. Otherwise we have to use\n // baseline coord\n if (j >= index) {\n return prevValue;\n }\n if (newValue.length > 0) {\n return j;\n }\n return prevValue;\n }, 0)\n : undefined;\n\n return (\n <>\n {isAreaRendered && (\n <AreaSeries\n yScale={yScale}\n lineType={seriesItem.lineType}\n color={seriesItem.areaColor || colors[index % colors.length]}\n isHorizontal={isHoriz}\n areaColorOpacity={areaOpacity}\n isBottomSegmentCurved={isBottomSegmentCurved}\n bottomCoords={\n prevCoords !== undefined &&\n allLineSegmentCoords[prevCoords].some((value) => value != null)\n ? allLineSegmentCoords[prevCoords]\n : undefined\n }\n lineSegments={lineSegmentCoords}\n isLog={isLog}\n isHighlighted={isHighlighted}\n seriesIndex={index}\n />\n )}\n <LineSeries\n lineType={seriesItem.lineType}\n /* TODO: confirm with UX if this is contrastLine (changes depending on dark/light mode) or always white. \n It's always white in legacy.*/\n lineColor={\n isContrastLineNeeded ? colorSchemeVars.dvt.contrastLine : seriesItem.lineColor\n }\n /* The area generated in legacy are bit apart and not touching when stacked. Preact areas are a bit closer than legacy when curved. \n Increased the contrast linewidth (to 2.5 from legacy 1.25) to give legacy visual treatment.\n TODO: investivage why legacy areas are not touching. maybe we want to do the same in preact svg utils that\n generates this curve.\n */\n lineWidth={\n isContrastLineNeeded ? (isStacked ? 2.5 : 1.25) : seriesItem.lineWidth\n }\n lineStyle={seriesItem.lineStyle}\n color={seriesItem.lineColor || colors[index % colors.length]}\n lineSegmentCoords={lineSegmentCoords}\n isHorizontal={isHoriz}\n isHighlighted={isHighlighted}\n seriesIndex={index}\n />\n {\n /*for non stacked charts, markers should render in the order of series.\n some markers might get hidden behind area but this preserves the legacy behavior. */\n !isStacked && (\n <MarkersWithLabel\n yScale={yScale}\n xScale={xScale}\n groups={groups}\n series={seriesItem}\n timeAxisType={timeAxisType}\n color={\n seriesItem.lineColor ||\n seriesItem.areaColor ||\n colors[\n index % colors.length\n ] /* TODO : make this use getItemColor function from dataStyleUtils. */\n }\n seriesIndex={index}\n startIndex={xStartIndex}\n endIndex={xEndIndex}\n markerType={markers[index % markers.length]}\n orientation={orientation}\n isLog={isLog}\n activeId={activeId}\n getDataItem={getDataItem}\n isPointInsideMarquee={isPointInsideMarquee}\n selectedIds={selectedSet}\n highlightedIds={highlightedIds !== undefined ? highlightedSet : undefined}\n focusedItemIndex={\n focusedItemInfo.seriesIndex === index &&\n focusedItemInfo.isFocusVisible &&\n !(props.isDataCursorEnabled && props.dataCursorStyle?.isMarkerDisplayed)\n ? focusedItemInfo.groupIndex\n : undefined\n }\n hoveredItemIndex={\n hoveredItemInfo?.isCurrent && hoveredItemInfo.seriesIndex === index\n ? hoveredItemInfo.groupIndex\n : undefined\n }\n isSelectionEnabled={\n selectionMode === 'single' || selectionMode === 'multiple'\n }\n isDrillEnabled={drilling === 'on'}\n defaultFontSize={defaultFontSize}\n dataLabelEffect={dataLabelEffect}\n isHighContrast={isHighContrast}\n isTestEnv={isTestEnv}\n getTextDimensions={getTextDimensions}\n />\n )\n }\n </>\n );\n })}\n {isStacked &&\n renderedSeries.map((lineAreaSeries, index) => {\n if (lineAreaSeries.length === 0) {\n /* TODO: need a better way to handle when a series is hidden.*/\n return;\n }\n const seriesItem = series[index];\n return (\n <MarkersWithLabel\n yScale={yScale}\n series={series[index]}\n xScale={xScale}\n groups={groups}\n timeAxisType={timeAxisType}\n color={\n seriesItem.lineColor || seriesItem.areaColor || colors[index % colors.length]\n }\n seriesIndex={index}\n isPointInsideMarquee={isPointInsideMarquee}\n startIndex={xStartIndex}\n endIndex={xEndIndex}\n markerType={markers[index % markers.length]}\n orientation={orientation}\n isLog={isLog}\n activeId={activeId}\n getDataItem={renderedGetDataItem}\n selectedIds={selectedSet}\n focusedItemIndex={\n focusedItemInfo.seriesIndex === index && focusedItemInfo.isFocusVisible\n ? focusedItemInfo.groupIndex\n : undefined\n }\n hoveredItemIndex={\n hoveredItemInfo?.isCurrent && hoveredItemInfo.seriesIndex === index\n ? hoveredItemInfo.groupIndex\n : undefined\n }\n isSelectionEnabled={selectionMode === 'single' || selectionMode === 'multiple'}\n isDrillEnabled={drilling === 'on'}\n defaultFontSize={defaultFontSize}\n dataLabelEffect={dataLabelEffect}\n isHighContrast={isHighContrast}\n isTestEnv={isTestEnv}\n getTextDimensions={getTextDimensions}\n />\n );\n })}\n </>\n );\n }}\n </Chart>\n );\n}\n"],"names":["OverviewLineAreaChart","props","_jsx","jsx","LineAreaChart","datatip","content","zoomAndScroll","overview","plotArea","yMajorTick","isRendered","xAxis","tickLabel","autoRotate","timeAxisType","series","groups","getDataItem","yAxis","type","AXIS_OFFSET","LINE_WITH_AREA_OPACITY","width","height","selectedIds","hiddenIds","highlightedIds","hideAndShowBehavior","orientation","isStacked","selectionMode","drilling","dataLabelEffect","direction","forcedColors","useUser","isHighContrast","isTestEnv","undefined","testId","isRtl","isLog","scale","hiddenSet","Set","selectedSet","highlightedSet","isHoriz","colors","getColorRamp","renderedSeries","getCumulativeSeries","length","getSeriesData","renderedGetDataItem","seriesIndex","groupIndex","value","markers","getMarkers","areaOpacity","isAreaRendered","isContrastLineNeeded","allLineSegmentCoords","Chart","findNearest","xScale","yScale","findNearestDataPoint","offset","dataWidth","transform","getDataItemPos","getLineAreaChartItemPosition","getMarkerInfo","color","getItemColor","getMarkerType","renderGridLinesInFront","getNavUtil","startIndex","endIndex","getLineAreaChartNavUtil","getGapRatio","defaultOverviewContentRenderer","children","xStartIndex","xEndIndex","activeId","focusedItemInfo","hoveredItemInfo","isPointInsideMarquee","defaultFontSize","getTextDimensions","_jsxs","jsxs","_Fragment","Fragment","map","lineAreaSeries","index","seriesItem","lineSegmentCoords","getLineAreaSegments","isBottomSegmentCurved","lineType","isHighlighted","has","id","prevCoords","reduce","prevValue","newValue","j","AreaSeries","areaColor","isHorizontal","areaColorOpacity","bottomCoords","some","lineSegments","LineSeries","lineColor","colorSchemeVars","dvt","contrastLine","lineWidth","lineStyle","MarkersWithLabel","markerType","focusedItemIndex","isFocusVisible","isDataCursorEnabled","dataCursorStyle","isMarkerDisplayed","hoveredItemIndex","isCurrent","isSelectionEnabled","isDrillEnabled"],"mappings":"gVAGM,SAAUA,EACdC,GAEA,OACEC,EAACC,IAAAC,EACC,CAAAC,QAAS,KAAO,CAAEC,QAAS,KAC3BC,cAAc,MACdC,SAAS,MACTC,SAAU,CACRC,WAAY,CACVC,YAAY,IAGhBC,MAAO,CACLC,UAAW,CACTC,YAAY,EAEZH,aAAYV,EAAMW,OAAOG,eAG7BC,OAAQf,EAAMe,OACdC,OAAQhB,EAAMgB,OACdC,YAAajB,EAAMiB,YACnBC,MAAO,CACLN,UAAW,CACTF,YAAY,IAGhBS,KAAMnB,EAAMmB,MAGlB,CCTA,MAAMC,EAAc,GACdC,EAAyB,GAKf,SAAAlB,GAAoEmB,MAClFA,EAAKC,OACLA,EAAMC,YACNA,EAAc,GAAEC,UAChBA,EAAY,GAAEC,eACdA,EAAcC,oBACdA,EAAsB,OAAMC,YAC5BA,EAAc,WAAUV,MACxBA,EAAKH,OACLA,EAAMC,OACNA,EAAMa,UACNA,GAAY,EAAKZ,YACjBA,E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WAGtB+E,iBACE7C,GAAiB8C,WAAa9C,EAAgBnC,cAAgB6C,EAC1DV,EAAgBlC,gBAChBlB,EAENmG,mBACoB,WAAlB3G,GAAgD,aAAlBA,EAEhC4G,eAA6B,OAAb3G,EAChB6D,gBAAiBA,EACjB5D,gBAAiBA,EACjBI,eAAgBA,EAChBC,UAAWA,EACXwD,kBAAmBA,MAK3B,IAEHhE,GACCqB,EAAegD,KAAI,CAACC,EAAgBC,KAClC,GAA8B,IAA1BD,EAAe/C,OAEjB,OAEF,MAAMiD,EAAatF,EAAOqF,GAC1B,OACEnG,MAAC+H,EAAAA,iBAAgB,CACf7D,OAAQA,EACRpD,OAAQA,EAAOqF,GACflC,OAAQA,EACRlD,OAAQA,EACRF,aAAcA,EACd6D,MACE0B,EAAWqB,WAAarB,EAAWc,WAAanE,EAAOoD,EAAQpD,EAAOI,QAExEG,YAAa6C,EACbT,qBAAsBA,EACtBX,WAAYM,EACZL,SAAUM,EACV0C,WAAYvE,EAAQ0C,EAAQ1C,EAAQN,QACpCxB,YAAaA,EACba,MAAOA,EACP+C,SAAUA,EACVvE,YAAaqC,EACb9B,YAAaqB,EACbqF,iBACEzC,EAAgBlC,cAAgB6C,GAASX,EAAgB0C,eACrD1C,EAAgBjC,gBAChBlB,EAENiG,iBACE7C,GAAiB8C,WAAa9C,EAAgBnC,cAAgB6C,EAC1DV,EAAgBlC,gBAChBlB,EAENmG,mBAAsC,WAAlB3G,GAAgD,aAAlBA,EAClD4G,eAA6B,OAAb3G,EAChB6D,gBAAiBA,EACjB5D,gBAAiBA,EACjBI,eAAgBA,EAChBC,UAAWA,EACXwD,kBAAmBA,GAErB,QAOlB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact/hooks', './classNames-08d99695', './mergeProps-bcfa6a92', './keys-4755c121', './LoadMoreCollection-83413a59', './VirtualizedCollection-897516a5', 'preact/compat', './TabbableModeContext-a9c97640', './useId-c9578d26', './FocusTrap-60520575', './useInteractionStyle-76a64325', './mergeInterpolations-9ede4cf7', './flexitem-5db48325', './PRIVATE_List/themes/ListStyles.css', './collectionUtils-17f5cc64', './Skeleton-5839404b', './Flex-56ecdf4c', './Selector-2b0c34a7', './ImageVars.css-17386400', './useTheme-ac980f9a', './useTestId-3a316499', './CollectionInteractionContext-0b4ed98b', './useCollectionInteractionContext-f345e8f7', 'preact', './useSelection-f0c7d74d', './useDropDownSelection-c946783d', './useCurrentKey-31c18053', './useCollectionFocusRing-66a6fc12', './useItemAction-821d1b6e', './useTabbableModeSet-dc176f1d', './useReorderableContext-a5453bd7', './Inset-a34e9c57', 'module'], (function(e,t,n,i,s,r,o,l,a,c,d,u,g,f,m,b,y,p,v,h,x,S,k,C,I,w,K,P,T,R,V,j,A,E,F){"use strict";const M=e=>{switch(e){case"listbox":return{list:"listbox",item:"presentation",cell:"option"};case"treegrid":return{list:"treegrid",item:"row",cell:"gridcell"};default:return{list:"grid",item:"row",cell:"gridcell"}}},L="[data-oj-key]";function D({children:e,context:s,itemDepth:r,isFocused:o,isFocusRingVisible:l,isActive:a,isGridlineVisible:y,isSelected:p,isTopGridlineVisible:v=!1,isTabbable:h=!1,role:x,selectionMode:S,suggestion:k,currentItemVariant:C,padding:I}){const w=n.useRef(null),K=n.useMemo((()=>M(x)),[x]),P=s.metadata.key,T=s.index,R="option"===K.cell?{role:K.cell,"aria-posinset":T+1,"aria-setsize":-1}:{role:K.cell},{interactionProps:V,applyActiveStyle:j,applyHoverStyle:A,applyPseudoHoverStyle:E}=g.useInteractionStyle(),F=b.listItemMultiVariantStyles({selectable:H(S,p)?"isSelectable":"notSelectable",selected:p?"isSelected":"notSelected",selectedSingle:p&&"single"===S?"isSelectedSingle":"notSelectedSingle",needsEventsHover:A?"isNeedsEventsHover":"notNeedsEventsHover",pseudoHover:E?"isPseudoHover":"notPseudoHover",active:j||a?"isActive":"notActive",focusHighlight:"highlight"===C&&o?"isFocusHighlight":"notFocusHighlight",focusRingVisible:l&&o?"isFocusRingVisible":"notFocusRingVisible",gridlineTop:v?"visible":"hidden",gridlineBottom:!y&&("end"!==k||y||p&&"single"===S)?"hidden":"visible"}),L=[];I&&("enabled"===I?L.push(b.paddingStyles.allPadding):"disabled"!==I&&("enabled"===I.top&&L.push(b.paddingStyles.topItemPadding),"enabled"===I.bottom&&L.push(b.paddingStyles.bottomItemPadding),"enabled"===I.start&&L.push(b.paddingStyles.startItemPadding),"enabled"===I.end&&L.push(b.paddingStyles.endItemPadding)));const D=i.classNames([F,...L]),z=f.mergeInterpolations([...Object.values(m.flexitemInterpolations)]),{class:N,...O}=z({flex:"1 1 auto",alignSelf:"center"}),G=i.classNames([N,"multiple"===S&&b.listItemStyles.checkboxContainer]);return t.jsx("div",{"aria-rowindex":"grid"===x?T+1:void 0,"aria-level":r,"data-oj-key":P,class:D,ref:w,role:K.item,...k&&{"data-oj-suggestion":!0},..."number"==typeof P&&{"data-oj-key-type":"number"},...V,children:t.jsx("div",{id:d.useId(),style:O,class:G,"aria-posinset":"grid"===x?void 0:T+1,"aria-setsize":"grid"===x?void 0:-1,onKeyDown:e=>{!h||"ArrowDown"!==e.key&&"ArrowUp"!==e.key||e.stopPropagation()},"aria-colindex":"grid"===x?1:void 0,"aria-selected":"none"!==S?p:void 0,...R,children:t.jsx(c.TabbableModeContext.Provider,{value:{isTabbable:h},children:t.jsx(u.FocusTrap,{isDisabled:!h,restoreFocusRef:!1,children:e(s)})})})})}const H=(e,t)=>"none"!==e&&("multiple"===e||!t),z=a.memo(D,((e,t)=>!(!e||!t)&&(e.children===t.children&&e.isFocused===t.isFocused&&e.isFocusRingVisible===t.isFocusRingVisible&&e.isSelected===t.isSelected&&e.isTabbable===t.isTabbable&&e.isActive===t.isActive&&e.suggestion===t.suggestion&&e.isGridlineVisible===t.isGridlineVisible&&e.isTopGridlineVisible===t.isTopGridlineVisible&&e.padding===t.padding&&y.compareListItemContext(e.context,t.context))));function N({children:e,minimumCount:s=1}){const[r,o]=n.useState(!1);n.useEffect((()=>{setTimeout((()=>{o(!0)}),50)}),[]);const l=i.classNames([b.skeletonStyles.container]);return r&&e?t.jsx("div",{class:l,role:"presentation",children:[...Array(s)].map(((t,n)=>e(n)))}):null}const O="oj-collection-sparkle";function G({sparkleHeight:e}){const{name:n}=S.useTheme();if(e<=0)return null;const s=e+"px",r=i.classNames([b.sparkleStyles.base]),o=i.classNames([b.sparkleStyles.container,O,"redwood"===n&&x.globalImages]);return t.jsx("div",{class:o,children:t.jsx("div",{class:r,style:{height:s}})},"sparkle")}const B=(e,t)=>{if(0===t)return null;return e.slice(0,t).reduce(((e,n,i)=>{const s=n.metadata.key;return i===t-1?e.set(s,"end"):e.set(s,!0),e}),new Map)},_=(e,t,n)=>{if(e&&t&&(e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded():e.scrollIntoView({block:"nearest"}),n>0)){const i=t.getBoundingClientRect(),s=e.getBoundingClientRect(),r=i.top+n-s.top;r>0&&(t.scrollTop=t.scrollTop-r)}},U=(e,t)=>{const n=t.data.map((e=>e.metadata.key)),i=n.indexOf(e.value.start),s=n.indexOf(e.value.end),r=Math.min(i,s),o=Math.max(i,s);return-1===r?{offset:0,count:t.totalSize}:n.slice(r,o+1)},q=e=>!(!e.parentElement||!e.parentElement.classList.contains("oj-listview-expander"));const Y=(e,t)=>t??{scroller:()=>e.current},$={all:!1,keys:new Set},J=t.jsx(N,{minimumCount:25,children:()=>t.jsx(E.Inset,{variant:"listview",children:t.jsx(v.Flex,{height:"6x",align:"center",children:t.jsx(p.Skeleton,{height:"4x"})})})}),Q=t.jsx("div",{class:o.LOADMORE_STYLE_CLASS,children:t.jsx(N,{minimumCount:3,children:()=>t.jsx(E.Inset,{variant:"listview",children:t.jsx(v.Flex,{height:"6x",align:"center",children:t.jsx(p.Skeleton,{height:"4x"})})})})}),W=(e,t)=>{if(t){const n=Math.min(t.offset,e.offset+e.totalSize),i=n-e.offset;i>0&&(e={offset:n,data:e.data.slice(i,i+t.count),totalSize:e.totalSize,sizePrecision:e.sizePrecision})}return e};e.List=function({"aria-label":e,"aria-labelledby":a,allowTabbableMode:c=!0,children:d,data:u,gridlines:g,loadingIndicator:f=J,currentItemOverride:m,onPersistCurrentItem:p,onLoadRange:v,onSelectionChange:x,onItemAction:S,rangeExtractor:C,role:w="grid",selectedKeys:E=$,selectionMode:F="none",viewportConfig:H,currentItemVariant:N,promotedSection:O,isVirtualized:X=!1,customItemRenderer:Z,scrollToVisibleOffset:ee,testId:te,scrollerRef:ne,reorderProps:ie,contextMenuTriggerProps:se,itemPadding:re,...oe}){const le=n.useRef(null),ae=n.useRef(!1),ce=n.useRef(),[de,ue]=n.useState(!1),ge="none"===F?void 0:"multiple"===F,fe=null===u?void 0:"exact"===u.sizePrecision?u.totalSize:-1,me=i.classNames([b.listStyles.base]),be="embedded"===I.useCollectionInteractionContext(),ye=void 0!==N?N:be?"highlight":"none",pe=n.useCallback(((e,t)=>{u&&(ce.current={detail:e,range:{offset:u.offset,count:u.data.length}},v(t))}),[u,v]),ve=n.useRef({offset:0,count:0}),he=n.useCallback((e=>{ae.current&&ve.current.offset===e.offset&&ve.current.count===e.count||(ae.current=!0,ve.current=e,v(e))}),[ae,v]);n.useEffect((()=>{ae.current=!1}),[u]);const{currentKey:xe,onCurrentKeyChange:Se,isCurrentItemOverridden:ke}=((e,t)=>{const[i,s]=n.useState(),r=n.useRef(),o=n.useRef(!1),l=A.useReorderableContext(),a=n.useMemo((()=>e=>{const n=e.value;s({rowKey:n}),t?.(e),null!=l?.currentItemKey&&(l.currentItemKey.current=n)}),[t,l?.currentItemKey]);return r.current!==e&&(r.current=e,i?.rowKey!==e?.rowKey&&(o.current=!0,a({value:e?.rowKey}))),n.useEffect((()=>{o.current=!1})),{currentKey:i?.rowKey,onCurrentKeyChange:a,isCurrentItemOverridden:o.current}})(m,p),{eventProps:Ce,showFocusRing:Ie,handleSelectionChange:we}=((e,t,i="none",o,l,a,c,d,u="grid",g,f,m,b,p)=>{const v=n.useMemo((()=>M(u)),[u]),h=n.useRef(),{currentKeyProps:x}=T.useCurrentKey((e=>y.keyExtractor(e,L)),"multiple"!==i||p,y.getPrevNextKey(f.current,e,!0,L),y.getPrevNextKey(f.current,e,!1,L),void 0,void 0,e,o),[S,k]=R.useCollectionFocusRing(f,["ArrowUp","ArrowDown"]);n.useEffect((()=>{if(null!=e&&f.current){const t=y.findElementByKey(f.current,e,L);if(t){const e=f.current.getAttribute("aria-activedescendant"),n=t.querySelector(`[role=${v.cell}]`);if(n&&e!==n.id){f.current.setAttribute("aria-activedescendant",n.id);const e=f.current?.contains(document.activeElement);if(!b&&e||p){const e=d?.scroller(),n=g?g(f.current):0;_(t,null!=e?e:f.current,n)}}}}}),[e,c,v.cell,d,g,f,b,p]);const C=n.useCallback((e=>{l&&(!1===e.value.all&&e.value.keys.size>0&&(h.current=Array.from(e.value.keys.values()).pop()),l(e))}),[h,l]),I=n.useCallback((e=>{if(c&&l){const n=U(e,c);if(Array.isArray(n))if("shiftSpace"===e.eventType?h.current=e.value.start:h.current=e.value.end,p){const e=r.addKeys(t,n);l({value:e,target:null})}else l({value:{all:!1,keys:new Set(n)},target:null});else m(e,n)}}),[c,p,t,l,m]),{selectionProps:w}=K.useSelection((t=>t===f.current?void 0===e?null:e:y.keyExtractor(t,L)),t,p?"none":i,!1,"replace",C,h.current,e,((e,t)=>y.getPrevNextKey(f.current,e,t,L)),void 0,(e=>{if(f.current){const t=y.findElementByKey(f.current,e,L);if(t){const e=d?.scroller(),n=g?g(f.current):0;_(t,null!=e?e:f.current,n)}}}),I),{dropDownSelectionProps:j}=P.useDropDownSelection((t=>t===f.current?void 0===e?null:e:y.keyExtractor(t,L)),t,p?i:"none",!1,(e=>c?c.data.findIndex((t=>t.metadata.key===e)):-1),((e,t)=>c?c.data.map((e=>e.metadata.key)).slice(e,t):[]),((e,t)=>y.getPrevNextKey(f.current,e,t,L)),e,C,I),A=V.useItemAction(e,c,a,L,p);return{eventProps:s.mergeProps(x,k,w,A,j),showFocusRing:S,handleSelectionChange:C}})(xe,E,F,Se,x,S,u,H,w,ee,le,pe,ke,be),{eventProps:Ke,isCurrentTabbableKey:Pe}=((e,t,i,o,l,a)=>{const c=n.useRef(),d=n.useRef(!0),[u,g]=j.useTabbableModeSet(o,(e=>q(e)?null:y.keyExtractor(e,L)),e,t),f=n.useCallback((()=>{if(o.current&&t&&(!i||u(void 0))){const e=c.current||y.getFirstVisibleKey(o.current,L);r.isKeyDefined(e)&&t({value:e})}}),[o,t,i,u]),m=n.useCallback((n=>{if(q(n.target)){o.current?.focus();const e=y.keyExtractor(n.target,L);t&&r.isKeyDefined(e)&&t({value:e})}else if(r.isKeyDefined(e)){if(o.current){const n=y.findElementByKey(o.current,e,L);if(n){if(d.current){const e=l?.scroller(),t=a?a(o.current):0;_(n,null!=e?e:o.current,t)}d.current=!0}else t&&f()}}else t&&f()}),[e,f,t,a,l,o]),b=n.useCallback((t=>{const n=y.keyExtractor(t.target,L);r.isKeyDefined(n)&&(c.current=n,n!==e&&(d.current=!1))}),[e]);return{eventProps:s.mergeProps(i?g:{},{onFocus:m,onPointerDown:b}),isCurrentTabbableKey:u}})(xe,Se,c,le,H,ee);if(u&&void 0!==ce.current&&x){const e=U(ce.current.detail,u);if(Array.isArray(e))if(be){x({value:r.addKeys(E,e),target:null})}else x({value:{all:!1,keys:new Set(e)},target:null});const t=ce.current?ce.current.range:{offset:u.offset,count:u.data.length};u=W(u,t),ce.current=void 0,v(t)}const{sparkleHeight:Te,suggestions:Re}=((e,t,i)=>{const[s,r]=n.useState(0),o=n.useMemo((()=>e&&t&&B(e.data,t.count)),[e,t]);return n.useEffect((()=>{if(o){const e=i.current?.querySelector("."+l.PLACEHOLDER_STYLE_CLASS);let t=e?.offsetHeight||0;const n=i.current?.querySelectorAll("[data-oj-suggestion]");n?.forEach((e=>t+=e.offsetHeight)),r(t)}}),[i,o]),{sparkleHeight:s,suggestions:o}})(u,O,le),Ve=t.jsx(G,{sparkleHeight:Te}),je=n.useCallback((e=>{const n=e.data,i="multiple"===F?()=>t.jsx(h.Selector,{onChange:we,rowKey:n.metadata.key,selectedKeys:E}):void 0;return{index:e.index,data:n.data,metadata:n.metadata,selector:i}}),[F,E,we]),Ae=X?D:z,Ee=e=>{const n=je(e),i=Re?.get(n.metadata.key),s=c&&Pe(n.metadata.key),o=xe===n.metadata.key&&!s,l=o&&de,a=r.containsKey(E,n.metadata.key),f=o&&Ie,m=(e,s)=>{return t.jsx(Ae,{context:e,isFocused:o,isFocusRingVisible:f,isActive:l,isGridlineVisible:(r=n.index,"visible"===g?.item&&(r+1!==u?.totalSize||"visible"===g?.bottom)),isSelected:a,isTabbable:c&&Pe(n.metadata.key),role:w,selectionMode:F,currentItemVariant:ye,padding:re,...i&&{suggestion:i},...0===n.index&&{isTopGridlineVisible:"visible"===g?.item&&"visible"===g?.top},...s,children:d},n.metadata.key);var r};if(Z){return Z({listItemContext:n,isFocused:o,isFocusRingVisible:f,isSelected:a,isTabbable:s,isActive:l,defaultListItem:m})}return m(n)};H=Y(le,H);const Fe=n.useCallback((e=>{" "===e.key&&r.isKeyDefined(xe)&&"none"!==F&&ue(!0)}),[xe,F,ue]),Me=n.useCallback((()=>{ue(!1)}),[ue]);n.useImperativeHandle(ne,(()=>le.current));const Le=k.useTestId(te);return t.jsx("div",{...s.mergeProps(Ce,Ke,se||{},ie||{},{onKeyDown:Fe,onKeyUp:Me},oe),...Le,role:w,"aria-rowcount":"grid"===w?fe:void 0,"aria-colcount":"grid"===w?1:void 0,ref:le,class:me,tabIndex:0,"aria-label":e,"aria-labelledby":a,"aria-multiselectable":ge,children:null==u?f:X?t.jsx(l.VirtualizedCollection,{data:u,itemSelector:L,loadMoreIndicator:Q,onLoadRange:v,rangeExtractor:C,suggestions:Ve,viewportConfig:H,children:Ee}):t.jsx(o.LoadMoreCollection,{data:u.data,loadMoreIndicator:Q,hasMore:"atLeast"===u.sizePrecision&&u.data.length<=u.totalSize,onLoadMore:()=>{u&&he({offset:0,count:u.data.length+25})},suggestions:Ve,viewportConfig:H,children:Ee})})},e.SkeletonContainer=N,e.excludeGroup=(e,t)=>{if(!t.all){const n=e.data.filter((e=>!e.metadata.isLeaf)).map((e=>e.metadata.key)),i=Array.from(t.keys.values()).filter((e=>!n.includes(e)));return{...t,keys:new Set(i)}}return t},e.scrollToVisible=_}));
|
|
2
|
+
//# sourceMappingURL=List-0b764e84.js.map
|