@oracle/oraclejet-preact 18.0.8 → 18.0.10
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/BaseNavigationListItem-5765a81f.js +2 -0
- package/amd/BaseNavigationListItem-5765a81f.js.map +1 -0
- package/amd/CheckboxSet-4582f29e.js +2 -0
- package/{cjs/CheckboxSet-1bdbc419.js.map → amd/CheckboxSet-4582f29e.js.map} +1 -1
- package/amd/MaxLengthCounter-9a95922c.js +2 -0
- package/{es/MaxLengthCounter-181b4fc9.js.map → amd/MaxLengthCounter-9a95922c.js.map} +1 -1
- package/amd/NavigationList-f1b80e54.js +2 -0
- package/amd/NavigationList-f1b80e54.js.map +1 -0
- package/amd/NavigationListItem-12919fe5.js +2 -0
- package/amd/NavigationListItem-12919fe5.js.map +1 -0
- package/amd/{OverflowTabBar-339f34cf.js → OverflowTabBar-dfcce021.js} +2 -2
- package/amd/{OverflowTabBar-339f34cf.js.map → OverflowTabBar-dfcce021.js.map} +1 -1
- package/amd/OverflowTabBarItem-17b2920a.js +2 -0
- package/amd/{OverflowTabBarItem-c59db4a2.js.map → OverflowTabBarItem-17b2920a.js.map} +1 -1
- package/amd/ReadonlyTextFieldVariants.styles.css +20 -20
- package/amd/ReadonlyTextFieldVariants.styles2.css +20 -20
- package/amd/RemovableNavigationListItem-c486140e.js +2 -0
- package/amd/{RemovableNavigationListItem-e01b6693.js.map → RemovableNavigationListItem-c486140e.js.map} +1 -1
- package/amd/{ReorderableTabBar-462d357c.js → ReorderableTabBar-b92a434e.js} +2 -2
- package/amd/{ReorderableTabBar-462d357c.js.map → ReorderableTabBar-b92a434e.js.map} +1 -1
- package/amd/TabBar-93811d2c.js +2 -0
- package/amd/{TabBar-d8890a47.js.map → TabBar-93811d2c.js.map} +1 -1
- package/amd/TabBarMixed-ad59654b.js +2 -0
- package/amd/{TabBarMixed-a75796a6.js.map → TabBarMixed-ad59654b.js.map} +1 -1
- package/amd/TextArea-89b9ed65.js +2 -0
- package/{es/TextArea-7230675f.js.map → amd/TextArea-89b9ed65.js.map} +1 -1
- package/amd/TextAreaAutosize-81449e46.js +2 -0
- package/amd/{TextAreaAutosize-9cd2c1e8.js.map → TextAreaAutosize-81449e46.js.map} +1 -1
- package/amd/Theme-redwood/theme.css +165 -165
- package/amd/Theme-stable/theme.css +347 -347
- package/amd/UNSAFE_CheckboxItem.js +1 -1
- package/amd/UNSAFE_CheckboxItem.js.map +1 -1
- package/amd/UNSAFE_CheckboxSet.js +1 -1
- package/amd/UNSAFE_CheckboxSet.js.map +1 -1
- package/amd/UNSAFE_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_NavigationList.js +1 -1
- package/amd/UNSAFE_NavigationListCommon.js +1 -1
- package/amd/UNSAFE_NumberInputText.js +1 -1
- package/amd/UNSAFE_OverflowTabBar.js +1 -1
- package/amd/UNSAFE_ReorderableTabBar.js +1 -1
- package/amd/UNSAFE_RichCheckboxSet.js +1 -1
- package/amd/UNSAFE_RichCheckboxSet.js.map +1 -1
- package/amd/UNSAFE_RichSelectionItem.js +1 -1
- package/amd/UNSAFE_RichSelectionItem.js.map +1 -1
- package/amd/UNSAFE_SelectMultiple.js +1 -1
- package/amd/UNSAFE_SelectSingle.js +1 -1
- package/amd/UNSAFE_TabBar.js +1 -1
- package/amd/UNSAFE_TabBarCommon.js +1 -1
- package/amd/UNSAFE_TabBarMixed.js +1 -1
- package/amd/UNSAFE_TextArea.js +1 -1
- package/amd/UNSAFE_TextAreaAutosize.js +1 -1
- package/amd/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/useNavigationListItem-17b77626.js +2 -0
- package/amd/useNavigationListItem-17b77626.js.map +1 -0
- package/cjs/{BaseCardView-5a45e588.js → BaseCardView-ade994f5.js} +2 -2
- package/cjs/{BaseCardView-5a45e588.js.map → BaseCardView-ade994f5.js.map} +1 -1
- package/cjs/{CardFlexView-58228ce4.js → CardFlexView-6492d995.js} +2 -2
- package/cjs/{CardFlexView-58228ce4.js.map → CardFlexView-6492d995.js.map} +1 -1
- package/cjs/{CardGridView-17683602.js → CardGridView-d98aa089.js} +2 -2
- package/cjs/{CardGridView-17683602.js.map → CardGridView-d98aa089.js.map} +1 -1
- package/cjs/CheckboxSetContext-c62db26d.js +12 -0
- package/{amd/CheckboxSetContext-2e486ea8.js.map → cjs/CheckboxSetContext-c62db26d.js.map} +1 -1
- package/cjs/ExpandableList-be84ca8e.js +1 -1
- package/cjs/GroupLoadingIndicator-5940d185.js +1 -1
- package/cjs/{Indexer-b5ca1d0c.js → Indexer-72430806.js} +2 -2
- package/cjs/{Indexer-b5ca1d0c.js.map → Indexer-72430806.js.map} +1 -1
- package/cjs/{InputDatePicker-4d36637f.js → InputDatePicker-bc2c534a.js} +2 -2
- package/cjs/{InputDatePicker-4d36637f.js.map → InputDatePicker-bc2c534a.js.map} +1 -1
- package/cjs/{List-877077ab.js → List-0dc2c4c4.js} +4 -3
- package/cjs/{List-877077ab.js.map → List-0dc2c4c4.js.map} +1 -1
- package/cjs/{ListView-98983aa2.js → ListView-17b8250d.js} +2 -2
- package/cjs/{ListView-98983aa2.js.map → ListView-17b8250d.js.map} +1 -1
- package/cjs/{LoadMoreCollection-69bc038c.js → LoadMoreCollection-73112ff0.js} +2 -2
- package/cjs/{LoadMoreCollection-69bc038c.js.map → LoadMoreCollection-73112ff0.js.map} +1 -1
- package/cjs/{NavigationListItem-4c4e804d.js → NavigationListItem-7947af0e.js} +1 -14
- package/cjs/{NavigationListItem-4c4e804d.js.map → NavigationListItem-7947af0e.js.map} +1 -1
- package/cjs/{OverflowTabBar-428798a0.js → OverflowTabBar-27ad6d1f.js} +2 -2
- package/cjs/{OverflowTabBar-428798a0.js.map → OverflowTabBar-27ad6d1f.js.map} +1 -1
- package/cjs/{OverflowTabBarItem-3c7adb01.js → OverflowTabBarItem-57537ebe.js} +2 -2
- package/cjs/{OverflowTabBarItem-3c7adb01.js.map → OverflowTabBarItem-57537ebe.js.map} +1 -1
- package/cjs/PRIVATE_BaseCardView.js +3 -3
- package/cjs/PRIVATE_List.js +4 -4
- package/cjs/PRIVATE_LoadMoreCollection.js +2 -2
- package/cjs/PRIVATE_SelectCommon.js +5 -5
- package/cjs/PRIVATE_Table.js +3 -3
- package/cjs/PRIVATE_VirtualizedCollection.js +2 -2
- package/cjs/{SelectMultiple-94ab1de5.js → SelectMultiple-b1f05b9f.js} +2 -2
- package/cjs/{SelectMultiple-94ab1de5.js.map → SelectMultiple-b1f05b9f.js.map} +1 -1
- package/cjs/{SelectSingle-52c5cb94.js → SelectSingle-84b0b3eb.js} +2 -2
- package/cjs/{SelectSingle-52c5cb94.js.map → SelectSingle-84b0b3eb.js.map} +1 -1
- package/cjs/{Table-15a64988.js → Table-90fe7ad8.js} +2 -2
- package/cjs/{Table-15a64988.js.map → Table-90fe7ad8.js.map} +1 -1
- package/cjs/{TableView-37d6f731.js → TableView-3cc9d3be.js} +2 -2
- package/cjs/{TableView-37d6f731.js.map → TableView-3cc9d3be.js.map} +1 -1
- package/cjs/Theme-redwood/theme.css +128 -128
- package/cjs/Theme-stable/theme.css +197 -197
- package/cjs/UNSAFE_CardFlexView.js +4 -4
- package/cjs/UNSAFE_CardGridView.js +4 -4
- package/cjs/UNSAFE_CheckboxItem.js +30 -81
- package/cjs/UNSAFE_CheckboxItem.js.map +1 -1
- package/cjs/UNSAFE_CheckboxSet.js +44 -15
- package/cjs/UNSAFE_CheckboxSet.js.map +1 -1
- package/cjs/UNSAFE_ExpandableList.js +3 -3
- package/cjs/UNSAFE_Indexer.js +2 -2
- package/cjs/UNSAFE_InputDatePicker.js +90 -90
- package/cjs/UNSAFE_ListView.js +5 -5
- package/cjs/UNSAFE_NavigationList.js +4 -4
- package/cjs/UNSAFE_OverflowTabBar.js +3 -3
- package/cjs/UNSAFE_RichCheckboxSet.js +13 -15
- package/cjs/UNSAFE_RichCheckboxSet.js.map +1 -1
- package/cjs/UNSAFE_RichSelectionItem.js +44 -181
- package/cjs/UNSAFE_RichSelectionItem.js.map +1 -1
- package/cjs/UNSAFE_SelectMultiple.js +6 -6
- package/cjs/UNSAFE_SelectSingle.js +6 -6
- package/cjs/UNSAFE_TabBar.js +2 -2
- package/cjs/UNSAFE_TabBarCommon.js +2 -2
- package/cjs/UNSAFE_TabBarMixed.js +2 -2
- package/cjs/UNSAFE_TableView.js +4 -4
- package/cjs/UNSAFE_VirtualizedListView.js +5 -5
- package/cjs/{VirtualizedCollection-9e8c48b9.js → VirtualizedCollection-00aedb8b.js} +2 -2
- package/cjs/{VirtualizedCollection-9e8c48b9.js.map → VirtualizedCollection-00aedb8b.js.map} +1 -1
- package/cjs/{VirtualizedListView-03fa4758.js → VirtualizedListView-9bfaf4e2.js} +2 -2
- package/cjs/{VirtualizedListView-03fa4758.js.map → VirtualizedListView-9bfaf4e2.js.map} +1 -1
- package/cjs/{useSelectCommon-a0a800fd.js → useSelectCommon-5b46ac60.js} +2 -2
- package/cjs/{useSelectCommon-a0a800fd.js.map → useSelectCommon-5b46ac60.js.map} +1 -1
- package/es/{BaseCardView-229fa119.js → BaseCardView-c5a8ee6a.js} +2 -2
- package/es/{BaseCardView-229fa119.js.map → BaseCardView-c5a8ee6a.js.map} +1 -1
- package/es/{CardFlexView-3ef6bf4d.js → CardFlexView-529906e0.js} +2 -2
- package/es/{CardFlexView-3ef6bf4d.js.map → CardFlexView-529906e0.js.map} +1 -1
- package/es/{CardGridView-e15226c9.js → CardGridView-ec18c929.js} +2 -2
- package/es/{CardGridView-e15226c9.js.map → CardGridView-ec18c929.js.map} +1 -1
- package/es/ExpandableList-478db30a.js +1 -1
- package/es/GroupLoadingIndicator-63035d08.js +1 -1
- package/es/{Indexer-eb00ba0b.js → Indexer-ba2c7593.js} +2 -2
- package/es/{Indexer-eb00ba0b.js.map → Indexer-ba2c7593.js.map} +1 -1
- package/es/LabelledLinkVariants.styles.css +3 -3
- package/es/LabelledLinkVariants.styles2.css +3 -3
- package/es/{List-e6886091.js → List-97b7be70.js} +4 -3
- package/es/{List-e6886091.js.map → List-97b7be70.js.map} +1 -1
- package/es/{ListView-137e31fd.js → ListView-936d8a4f.js} +2 -2
- package/es/{ListView-137e31fd.js.map → ListView-936d8a4f.js.map} +1 -1
- package/es/{LoadMoreCollection-7df1be36.js → LoadMoreCollection-95a49d2a.js} +2 -2
- package/es/{LoadMoreCollection-7df1be36.js.map → LoadMoreCollection-95a49d2a.js.map} +1 -1
- package/es/MeterCircleVariants.styles.css +8 -8
- package/es/MeterCircleVariants.styles2.css +8 -8
- 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-488a49d1.js → SelectMultiple-ad8fc99a.js} +2 -2
- package/es/{SelectMultiple-488a49d1.js.map → SelectMultiple-ad8fc99a.js.map} +1 -1
- package/es/{SelectSingle-e8b9a33a.js → SelectSingle-abaf271c.js} +2 -2
- package/es/{SelectSingle-e8b9a33a.js.map → SelectSingle-abaf271c.js.map} +1 -1
- package/es/SplitMenuButtonTheme.styles.css +4 -4
- package/es/SplitMenuButtonTheme.styles2.css +4 -4
- package/es/TabBarItemVariants.styles.css +3 -3
- package/es/TabBarItemVariants.styles2.css +3 -3
- package/es/{Table-3cfb9443.js → Table-1ba124ec.js} +2 -2
- package/es/{Table-3cfb9443.js.map → Table-1ba124ec.js.map} +1 -1
- package/es/{TableView-fd5104cd.js → TableView-20223ba6.js} +2 -2
- package/es/{TableView-fd5104cd.js.map → TableView-20223ba6.js.map} +1 -1
- package/es/{TextArea-7230675f.js → TextArea-64b4e972.js} +25 -8
- package/{amd/TextArea-a7a3d82f.js.map → es/TextArea-64b4e972.js.map} +1 -1
- package/es/{TextAreaAutosize-0d293016.js → TextAreaAutosize-4e0f60ef.js} +2 -2
- package/es/{TextAreaAutosize-0d293016.js.map → TextAreaAutosize-4e0f60ef.js.map} +1 -1
- package/es/Theme-redwood/theme.css +634 -634
- package/es/Theme-stable/theme.css +446 -446
- 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_ExpandableList.js +3 -3
- package/es/UNSAFE_Indexer.js +2 -2
- package/es/UNSAFE_LabelledLink/themes/redwood/LabelledLinkTheme.js +1 -1
- package/es/UNSAFE_LabelledLink/themes/redwood/LabelledLinkVariants.css.js +1 -1
- package/es/UNSAFE_LabelledLink/themes/stable/LabelledLinkTheme.js +1 -1
- package/es/UNSAFE_LabelledLink/themes/stable/LabelledLinkVariants.css.js +1 -1
- package/es/UNSAFE_LabelledLink.js +1 -1
- package/es/UNSAFE_ListView.js +5 -5
- package/es/UNSAFE_MeterCircle/themes/redwood/MeterCircleTheme.js +1 -1
- package/es/UNSAFE_MeterCircle/themes/redwood/MeterCircleVariants.css.js +1 -1
- package/es/UNSAFE_MeterCircle/themes/stable/MeterCircleTheme.js +1 -1
- package/es/UNSAFE_MeterCircle/themes/stable/MeterCircleVariants.css.js +1 -1
- package/es/UNSAFE_MeterCircle.js +1 -1
- package/es/UNSAFE_OverflowTabBar.js +1 -1
- package/es/UNSAFE_ReorderableTabBar.js +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 +1 -1
- package/es/UNSAFE_TabBarCommon/themes/redwood/TabBarItemTheme.js +1 -1
- package/es/UNSAFE_TabBarCommon/themes/redwood/TabBarItemVariants.css.js +1 -1
- package/es/UNSAFE_TabBarCommon/themes/stable/TabBarItemTheme.js +1 -1
- package/es/UNSAFE_TabBarCommon/themes/stable/TabBarItemVariants.css.js +1 -1
- package/es/UNSAFE_TabBarCommon.js +1 -1
- package/es/UNSAFE_TabBarMixed.js +1 -1
- package/es/UNSAFE_TableView.js +4 -4
- package/es/UNSAFE_TextArea.js +2 -3
- package/es/UNSAFE_TextArea.js.map +1 -1
- package/es/UNSAFE_TextAreaAutosize.js +3 -3
- package/es/UNSAFE_Toolbar/tests/Toolbar.spec.js +1 -1
- package/es/UNSAFE_VirtualizedListView.js +5 -5
- package/es/{VirtualizedCollection-f048fbb8.js → VirtualizedCollection-e73890a1.js} +2 -2
- package/es/{VirtualizedCollection-f048fbb8.js.map → VirtualizedCollection-e73890a1.js.map} +1 -1
- package/es/{VirtualizedListView-0532e46c.js → VirtualizedListView-3ef40bde.js} +2 -2
- package/es/{VirtualizedListView-0532e46c.js.map → VirtualizedListView-3ef40bde.js.map} +1 -1
- package/es/{useSelectCommon-af8e715e.js → useSelectCommon-1dafa6f9.js} +2 -2
- package/es/{useSelectCommon-af8e715e.js.map → useSelectCommon-1dafa6f9.js.map} +1 -1
- package/package.json +2 -2
- package/amd/BaseNavigationListItem-fe9cb691.js +0 -2
- package/amd/BaseNavigationListItem-fe9cb691.js.map +0 -1
- package/amd/CheckboxSetContext-2e486ea8.js +0 -2
- package/amd/NavigationListItem-044a79fd.js +0 -2
- package/amd/NavigationListItem-044a79fd.js.map +0 -1
- package/amd/OverflowTabBarItem-c59db4a2.js +0 -2
- package/amd/RemovableNavigationListItem-e01b6693.js +0 -2
- package/amd/TabBar-d8890a47.js +0 -2
- package/amd/TabBarMixed-a75796a6.js +0 -2
- package/amd/TextArea-a7a3d82f.js +0 -2
- package/amd/TextAreaAutosize-9cd2c1e8.js +0 -2
- package/cjs/CheckboxSet-1bdbc419.js +0 -53
- package/es/MaxLengthCounter-181b4fc9.js +0 -25
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadMoreCollection-
|
|
1
|
+
{"version":3,"file":"LoadMoreCollection-73112ff0.js","sources":["../../src/PRIVATE_LoadMoreCollection/LoadMoreCollection.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { ComponentChildren, Fragment } from 'preact';\nimport { ItemContext } from '../UNSAFE_Collection';\nimport { Collection } from '../PRIVATE_Collection';\nimport { useViewportIntersect, ViewportConfig } from '../hooks/UNSAFE_useViewportIntersect';\n\n/**\n * Props for the LoadMoreCollection component\n */\ntype Props<D> = {\n /**\n * A DataState object that provide information including data and metadata to the LoadMoreCollection.\n */\n data: D[] | null;\n\n /**\n * Renderer callback used to render each item\n */\n children: (context: ItemContext<D>) => ComponentChildren;\n\n /**\n * Viewport configuration including specifying the element which is used to determine what range\n * of data to render\n */\n viewportConfig: ViewportConfig;\n\n /**\n * Whether there are still more data to load. Internally, LoadMoreCollection will render the load\n * more indicator at the bottom if this is true\n */\n hasMore: boolean;\n\n /**\n * Callback function to handle when user scrolls to the end of the component and there are more items to load.\n * The function should update data prop on the component to include the next set of items fetched.\n */\n onLoadMore: () => void;\n\n /**\n * Optionally specify the custom load more indicator\n */\n loadMoreIndicator?: ComponentChildren;\n\n /**\n * Optionally provide the suggestion indicator sparkle\n */\n suggestions?: ComponentChildren;\n\n /**\n * Optionally specify how far in pixel from the bottom should load more occurs\n */\n loadMoreThreshold?: number;\n};\n\nexport const LOADMORE_STYLE_CLASS = 'oj-collection-loadmore';\n\nconst DEFAULT_MARGIN = 1;\nconst LOAD_MORE_SELECTOR = `.${LOADMORE_STYLE_CLASS}`;\n\n/**\n * Component that only render items in the specified viewport.\n * @param props\n */\nexport function LoadMoreCollection<D>({\n data,\n children,\n viewportConfig,\n hasMore,\n onLoadMore,\n loadMoreIndicator,\n suggestions,\n loadMoreThreshold = DEFAULT_MARGIN\n}: Props<D>) {\n // detect if viewport has changed and it needs to re-render based on a new range\n useViewportIntersect(\n viewportConfig,\n Math.max(loadMoreThreshold, DEFAULT_MARGIN),\n 0,\n LOAD_MORE_SELECTOR,\n () => {\n if (data) {\n onLoadMore();\n }\n }\n );\n\n // if DataState is invalid (including not specified), just render blank\n if (!data) {\n return <div />;\n }\n\n // might need to support elementType prop in the future to allow customization of what\n // type of element to render for the root\n return (\n <Fragment>\n {suggestions}\n <Collection items={data}>{children}</Collection>\n {hasMore && loadMoreIndicator}\n </Fragment>\n );\n}\n"],"names":["useViewportIntersect","_jsx","_jsxs","Fragment","Collection"],"mappings":";;;;;;;;AA4DO,MAAM,oBAAoB,GAAG,yBAAyB;AAE7D,MAAM,cAAc,GAAG,CAAC,CAAC;AACzB,MAAM,kBAAkB,GAAG,CAAI,CAAA,EAAA,oBAAoB,EAAE,CAAC;AAEtD;;;AAGG;AACG,SAAU,kBAAkB,CAAI,EACpC,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,OAAO,EACP,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,iBAAiB,GAAG,cAAc,EACzB,EAAA;;AAET,IAAAA,yCAAoB,CAClB,cAAc,EACd,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,cAAc,CAAC,EAC3C,CAAC,EACD,kBAAkB,EAClB,MAAK;QACH,IAAI,IAAI,EAAE;AACR,YAAA,UAAU,EAAE,CAAC;SACd;AACH,KAAC,CACF,CAAC;;IAGF,IAAI,CAAC,IAAI,EAAE;AACT,QAAA,OAAOC,yBAAO,CAAC;KAChB;;;IAID,QACEC,gBAACC,eAAQ,EAAA,EAAA,QAAA,EAAA,CACN,WAAW,EACZF,cAAA,CAACG,qBAAU,EAAC,EAAA,KAAK,EAAE,IAAI,EAAA,QAAA,EAAG,QAAQ,EAAc,CAAA,EAC/C,OAAO,IAAI,iBAAiB,CACpB,EAAA,CAAA,EACX;AACJ;;;;;"}
|
|
@@ -12,20 +12,7 @@ var useCollectionFocusRing = require('./useCollectionFocusRing-5af82f66.js');
|
|
|
12
12
|
var useCurrentKey = require('./useCurrentKey-88495da2.js');
|
|
13
13
|
var compat = require('preact/compat');
|
|
14
14
|
var useTestId = require('./useTestId-5e6af45d.js');
|
|
15
|
-
require('./UNSAFE_Text/themes/TextStyles.css.js');
|
|
16
15
|
var BaseNavigationListItem = require('./BaseNavigationListItem-50e4c603.js');
|
|
17
|
-
require('./Flex-e7a85bef.js');
|
|
18
|
-
require('./logger-2b636482.js');
|
|
19
|
-
require('preact');
|
|
20
|
-
require('./LayerHost-a8c7f182.js');
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
require('./hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css.js');
|
|
24
|
-
require('./tooltipUtils-669c2ae0.js');
|
|
25
|
-
|
|
26
|
-
require('./UNSAFE_NavigationList/themes/NavigationListItemStyles.css.js');
|
|
27
|
-
|
|
28
|
-
require('./UNSAFE_NavigationList/themes/redwood/NavigationListItemVariants.css.js');
|
|
29
16
|
|
|
30
17
|
/*TODO: JET-58534. Create a hook to share some logic between navlist and tabbar. Hook will be used inside this one. */
|
|
31
18
|
function useNavigationList({ containerRef, selection, onRemove, onSelectionChange, children }) {
|
|
@@ -163,4 +150,4 @@ function NavigationListItem({ itemKey, label, badge, metadata, severity }) {
|
|
|
163
150
|
|
|
164
151
|
exports.NavigationList = NavigationList;
|
|
165
152
|
exports.NavigationListItem = NavigationListItem;
|
|
166
|
-
//# sourceMappingURL=NavigationListItem-
|
|
153
|
+
//# sourceMappingURL=NavigationListItem-7947af0e.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationListItem-4c4e804d.js","sources":["../../src/UNSAFE_NavigationList/useNavigationList.ts","../../src/UNSAFE_NavigationList/NavigationList.tsx","../../src/UNSAFE_NavigationList/NavigationListItem.tsx"],"sourcesContent":["import { useState, useCallback, MutableRef, useRef, useEffect } from 'preact/hooks';\nimport {\n keyExtractor,\n getFirstVisibleKey,\n getKey,\n getPrevNextKeyUsingRef,\n findElementByKey\n} from '../utils/PRIVATE_collectionUtils';\nimport { mergeProps } from '../utils/UNSAFE_mergeProps';\nimport { useCollectionFocusRing } from '../hooks/PRIVATE_useCollectionFocusRing';\nimport { useCurrentKey } from '../hooks/PRIVATE_useCurrentKey';\nimport { NavigationListContextProps } from '../UNSAFE_NavigationListCommon';\n\nimport { ComponentChildren } from 'preact';\n\n/**\n * type for payload of current key change event handler\n */\ntype CurrentKeyDetail<K> = {\n value: K;\n};\n/**\n * type for payload of selection change event handler\n */\ntype SelectionDetail<K> = {\n value: K;\n reason: 'pointer' | 'keyboard';\n};\n/**\n * type for payload of remove event handler\n */\ntype RemoveDetail<K> = {\n value: K;\n};\n\n/*TODO: JET-58534. Create a hook to share some logic between navlist and tabbar. Hook will be used inside this one. */\nexport function useNavigationList<K extends string | number>({\n containerRef,\n selection,\n onRemove,\n onSelectionChange,\n children\n}: {\n containerRef: MutableRef<HTMLUListElement>;\n selection?: K;\n onRemove?: <K extends string | number>(detail: RemoveDetail<K>) => void;\n onSelectionChange?: <K extends string | number>(detail: SelectionDetail<K>) => void;\n children: ComponentChildren;\n}) {\n const ITEM_SELECTOR = '[role=\"tab\"]';\n const REMOVAL_ICON_SELECTOR = '[data-oj-navigationlist-item-remove-icon]';\n const [currentKey, setCurrentKey] = useState<K | undefined>(selection);\n\n const onCurrentKeyChange = useCallback((detail: CurrentKeyDetail<K | undefined>) => {\n setCurrentKey(detail.value);\n }, []) as NavigationListContextProps<K>['onCurrentKeyChange'];\n\n const { currentKeyProps } = useCurrentKey(\n (element) =>\n onRemove\n ? (extractOnlyItemKey(element, ITEM_SELECTOR, REMOVAL_ICON_SELECTOR) as K)\n : keyExtractor(element, ITEM_SELECTOR),\n false,\n getPrevNextKeyUsingRef(containerRef, currentKey, true, ITEM_SELECTOR),\n getPrevNextKeyUsingRef(containerRef, currentKey, false, ITEM_SELECTOR),\n undefined,\n undefined,\n currentKey,\n onCurrentKeyChange\n );\n\n const [showFocusRing, focusRingProps] = useCollectionFocusRing(containerRef, [\n 'Home',\n 'End',\n 'ArrowUp',\n 'ArrowDown'\n ]);\n\n const onFocus = useCallback(() => {\n if (containerRef.current && currentKey === undefined) {\n const key = getFirstVisibleKey(containerRef.current, ITEM_SELECTOR);\n if (key) {\n setCurrentKey(key as K);\n }\n }\n }, [currentKey, containerRef]);\n\n const onFocusProps = { onFocus };\n const prevNavItems = useRef<K[]>();\n\n useEffect(() => {\n if (containerRef.current) {\n const navListItemKeys = Array.from(\n containerRef.current.querySelectorAll(ITEM_SELECTOR),\n (elem) => getKey(elem as HTMLElement) as K\n );\n if (currentKey != null && navListItemKeys.indexOf(currentKey) !== -1) {\n const navListItem = findElementByKey(\n containerRef.current,\n currentKey,\n ITEM_SELECTOR\n ) as any;\n if (navListItem.scrollIntoViewIfNeeded) {\n // for some browsers, we'll need the non-standard scrollIntoViewIfNeeded\n navListItem.scrollIntoViewIfNeeded();\n } else {\n navListItem.scrollIntoView({ block: 'nearest' });\n }\n } else {\n if (currentKey && navListItemKeys.indexOf(currentKey) === -1) {\n prevNavItems.current\n ? setCurrentKey(findNextCurrentKey(currentKey, navListItemKeys, prevNavItems.current))\n : setCurrentKey(navListItemKeys[0] as K);\n }\n prevNavItems.current = navListItemKeys;\n }\n }\n }, [children, currentKey, containerRef]);\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if ((event.key === 'Home' || event.key === 'End') && containerRef.current && currentKey) {\n const navListItemKey = Array.from(\n containerRef.current.querySelectorAll(ITEM_SELECTOR),\n (elem) => getKey(elem as HTMLElement) as K\n );\n onCurrentKeyChange?.({\n value: navListItemKey[event.key === 'Home' ? 0 : navListItemKey.length - 1] as K\n });\n }\n if (currentKey && (event.key === 'Enter' || event.key === ' ')) {\n onSelectionChange?.({\n value: currentKey as K,\n reason: 'keyboard'\n });\n }\n if (currentKey && event.key === 'Delete') {\n onRemove?.({ value: currentKey as K });\n }\n },\n [currentKey, onSelectionChange, onRemove, onCurrentKeyChange, containerRef]\n );\n\n return {\n showFocusRing,\n currentKey,\n onCurrentKeyChange,\n onKeyDown,\n containerHandlers: mergeProps(focusRingProps, currentKeyProps, onFocusProps)\n };\n}\n\nconst extractOnlyItemKey = (element: HTMLElement, itemSelector: string, itemEliminator: string) => {\n const navigationListItem = element.closest(itemSelector);\n const removeButton = element.closest(itemEliminator);\n return navigationListItem?.contains(removeButton) ? null : keyExtractor(element, itemSelector);\n};\n\nconst findNextCurrentKey = <K>(currentKey: K, currNavs: K[], prevNavs: K[]) => {\n const index = prevNavs.indexOf(currentKey);\n if (index > 0) {\n const nextIndex = index === prevNavs.length - 1 ? index - 1 : index + 1;\n const nextKey = prevNavs[nextIndex];\n if (currNavs.indexOf(nextKey) !== -1) {\n return nextKey;\n }\n }\n // update current key to be the first one if we can't find a suitable next key\n return currNavs[0];\n};\n","import { Ref } from 'preact';\nimport { MutableRef, useRef } from 'preact/hooks';\nimport { mergeProps } from '../utils/UNSAFE_mergeProps';\nimport { classNames } from '../utils/UNSAFE_classNames';\nimport { useId } from '../hooks/UNSAFE_useId';\nimport { navigationListStyles } from './themes/NavigationListStyles.css';\nimport { useNavigationList } from './useNavigationList';\nimport { forwardRef, useImperativeHandle } from 'preact/compat';\nimport { useTestId, TestIdProps } from '../hooks/UNSAFE_useTestId';\nimport { NavigationListProps, NavigationListContext } from '../UNSAFE_NavigationListCommon';\nexport { RemovableNavigationListItem } from '../UNSAFE_NavigationListCommon';\n\nexport type FocusableHandle = {\n focus: () => void;\n blur: () => void;\n};\n\nexport const NavigationList = forwardRef(\n <K extends string | number>(\n {\n children,\n selection,\n onSelectionChange,\n onRemove,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelLedBy,\n testId\n }: NavigationListProps<K> & TestIdProps,\n ref?: Ref<FocusableHandle>\n ) => {\n const containerRef = useRef<HTMLUListElement>(null);\n\n const { showFocusRing, currentKey, onCurrentKeyChange, containerHandlers, onKeyDown } =\n useNavigationList({\n containerRef: containerRef as MutableRef<HTMLUListElement>,\n selection,\n onRemove,\n onSelectionChange,\n children\n });\n\n const eventProps = { onKeyDown };\n const navigationListClass = classNames([navigationListStyles.uListStyle]);\n const navigationListItemPrefix = useId() + '_';\n const testIdProps = useTestId(testId);\n\n //Allows to call focus on rootRef without having to expose it\n useImperativeHandle(ref!, () => ({\n focus: () => {\n if (containerRef.current) {\n containerRef.current.focus();\n }\n },\n blur: () => {\n if (containerRef.current) {\n containerRef.current.focus();\n }\n }\n }));\n\n return (\n <ul\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelLedBy}\n role=\"tablist\"\n ref={containerRef}\n aria-orientation={'vertical'}\n tabIndex={0}\n aria-activedescendant={currentKey ? navigationListItemPrefix + currentKey : ''}\n {...mergeProps(eventProps, containerHandlers)}\n {...testIdProps}\n class={navigationListClass}>\n <NavigationListContext.Provider\n value={{\n selection,\n onSelectionChange,\n onCurrentKeyChange,\n currentKey,\n showFocusRing,\n navigationListItemPrefix,\n onRemove\n }}>\n {children}\n </NavigationListContext.Provider>\n </ul>\n );\n }\n);\n","import {\n BaseNavigationListItem,\n BaseNavigationListItemProps\n} from '../UNSAFE_NavigationListCommon/BaseNavigationListItem';\n\nexport type NavigationListItemProps<K extends string | number> = Omit<\n BaseNavigationListItemProps<K>,\n 'removeIcon'\n>;\n\nexport function NavigationListItem<K extends string | number>({\n itemKey,\n label,\n badge,\n metadata,\n severity\n}: NavigationListItemProps<K>) {\n return (\n <BaseNavigationListItem\n itemKey={itemKey}\n label={label}\n badge={badge}\n metadata={metadata}\n severity={severity}\n />\n );\n}\n"],"names":["useState","useCallback","useCurrentKey","keyExtractor","getPrevNextKeyUsingRef","useCollectionFocusRing","getFirstVisibleKey","useRef","useEffect","getKey","findElementByKey","mergeProps","forwardRef","classNames","navigationListStyles","useId","useTestId","useImperativeHandle","_jsx","NavigationListContext","BaseNavigationListItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA;AACgB,SAAA,iBAAiB,CAA4B,EAC3D,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,iBAAiB,EACjB,QAAQ,EAOT,EAAA;IACC,MAAM,aAAa,GAAG,cAAc,CAAC;IACrC,MAAM,qBAAqB,GAAG,2CAA2C,CAAC;IAC1E,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAGA,cAAQ,CAAgB,SAAS,CAAC,CAAC;AAEvE,IAAA,MAAM,kBAAkB,GAAGC,iBAAW,CAAC,CAAC,MAAuC,KAAI;AACjF,QAAA,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;KAC7B,EAAE,EAAE,CAAwD,CAAC;IAE9D,MAAM,EAAE,eAAe,EAAE,GAAGC,2BAAa,CACvC,CAAC,OAAO,KACN,QAAQ;UACH,kBAAkB,CAAC,OAAO,EAAE,aAAa,EAAE,qBAAqB,CAAO;AAC1E,UAAEC,4BAAY,CAAC,OAAO,EAAE,aAAa,CAAC,EAC1C,KAAK,EACLC,sCAAsB,CAAC,Y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B,IAAI,EAAC,SAAS,EACd,GAAG,EAAE,YAAY,EAAA,kBAAA,EACC,UAAU,EAC5B,QAAQ,EAAE,CAAC,EACY,uBAAA,EAAA,UAAU,GAAG,wBAAwB,GAAG,UAAU,GAAG,EAAE,EAAA,GAC1EP,qBAAU,CAAC,UAAU,EAAE,iBAAiB,CAAC,EAAA,GACzC,WAAW,EACf,KAAK,EAAE,mBAAmB,EAC1B,QAAA,EAAAO,cAAA,CAACC,4CAAqB,CAAC,QAAQ,EAC7B,EAAA,KAAK,EAAE;gBACL,SAAS;gBACT,iBAAiB;gBACjB,kBAAkB;gBAClB,UAAU;gBACV,aAAa;gBACb,wBAAwB;gBACxB,QAAQ;AACT,aAAA,EAAA,QAAA,EACA,QAAQ,EAAA,CACsB,EAC9B,CAAA,EACL;AACJ,CAAC;;AC5Ea,SAAA,kBAAkB,CAA4B,EAC5D,OAAO,EACP,KAAK,EACL,KAAK,EACL,QAAQ,EACR,QAAQ,EACmB,EAAA;IAC3B,QACED,cAAC,CAAAE,6CAAsB,EACrB,EAAA,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,CAAA,EACF;AACJ;;;;;"}
|
|
1
|
+
{"version":3,"file":"NavigationListItem-7947af0e.js","sources":["../../src/UNSAFE_NavigationList/useNavigationList.ts","../../src/UNSAFE_NavigationList/NavigationList.tsx","../../src/UNSAFE_NavigationList/NavigationListItem.tsx"],"sourcesContent":["import { useState, useCallback, MutableRef, useRef, useEffect } from 'preact/hooks';\nimport {\n keyExtractor,\n getFirstVisibleKey,\n getKey,\n getPrevNextKeyUsingRef,\n findElementByKey\n} from '../utils/PRIVATE_collectionUtils';\nimport { mergeProps } from '../utils/UNSAFE_mergeProps';\nimport { useCollectionFocusRing } from '../hooks/PRIVATE_useCollectionFocusRing';\nimport { useCurrentKey } from '../hooks/PRIVATE_useCurrentKey';\nimport { NavigationListContextProps } from '../UNSAFE_NavigationListCommon';\n\nimport { ComponentChildren } from 'preact';\n\n/**\n * type for payload of current key change event handler\n */\ntype CurrentKeyDetail<K> = {\n value: K;\n};\n/**\n * type for payload of selection change event handler\n */\ntype SelectionDetail<K> = {\n value: K;\n reason: 'pointer' | 'keyboard';\n};\n/**\n * type for payload of remove event handler\n */\ntype RemoveDetail<K> = {\n value: K;\n};\n\n/*TODO: JET-58534. Create a hook to share some logic between navlist and tabbar. Hook will be used inside this one. */\nexport function useNavigationList<K extends string | number>({\n containerRef,\n selection,\n onRemove,\n onSelectionChange,\n children\n}: {\n containerRef: MutableRef<HTMLUListElement>;\n selection?: K;\n onRemove?: <K extends string | number>(detail: RemoveDetail<K>) => void;\n onSelectionChange?: <K extends string | number>(detail: SelectionDetail<K>) => void;\n children: ComponentChildren;\n}) {\n const ITEM_SELECTOR = '[role=\"tab\"]';\n const REMOVAL_ICON_SELECTOR = '[data-oj-navigationlist-item-remove-icon]';\n const [currentKey, setCurrentKey] = useState<K | undefined>(selection);\n\n const onCurrentKeyChange = useCallback((detail: CurrentKeyDetail<K | undefined>) => {\n setCurrentKey(detail.value);\n }, []) as NavigationListContextProps<K>['onCurrentKeyChange'];\n\n const { currentKeyProps } = useCurrentKey(\n (element) =>\n onRemove\n ? (extractOnlyItemKey(element, ITEM_SELECTOR, REMOVAL_ICON_SELECTOR) as K)\n : keyExtractor(element, ITEM_SELECTOR),\n false,\n getPrevNextKeyUsingRef(containerRef, currentKey, true, ITEM_SELECTOR),\n getPrevNextKeyUsingRef(containerRef, currentKey, false, ITEM_SELECTOR),\n undefined,\n undefined,\n currentKey,\n onCurrentKeyChange\n );\n\n const [showFocusRing, focusRingProps] = useCollectionFocusRing(containerRef, [\n 'Home',\n 'End',\n 'ArrowUp',\n 'ArrowDown'\n ]);\n\n const onFocus = useCallback(() => {\n if (containerRef.current && currentKey === undefined) {\n const key = getFirstVisibleKey(containerRef.current, ITEM_SELECTOR);\n if (key) {\n setCurrentKey(key as K);\n }\n }\n }, [currentKey, containerRef]);\n\n const onFocusProps = { onFocus };\n const prevNavItems = useRef<K[]>();\n\n useEffect(() => {\n if (containerRef.current) {\n const navListItemKeys = Array.from(\n containerRef.current.querySelectorAll(ITEM_SELECTOR),\n (elem) => getKey(elem as HTMLElement) as K\n );\n if (currentKey != null && navListItemKeys.indexOf(currentKey) !== -1) {\n const navListItem = findElementByKey(\n containerRef.current,\n currentKey,\n ITEM_SELECTOR\n ) as any;\n if (navListItem.scrollIntoViewIfNeeded) {\n // for some browsers, we'll need the non-standard scrollIntoViewIfNeeded\n navListItem.scrollIntoViewIfNeeded();\n } else {\n navListItem.scrollIntoView({ block: 'nearest' });\n }\n } else {\n if (currentKey && navListItemKeys.indexOf(currentKey) === -1) {\n prevNavItems.current\n ? setCurrentKey(findNextCurrentKey(currentKey, navListItemKeys, prevNavItems.current))\n : setCurrentKey(navListItemKeys[0] as K);\n }\n prevNavItems.current = navListItemKeys;\n }\n }\n }, [children, currentKey, containerRef]);\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if ((event.key === 'Home' || event.key === 'End') && containerRef.current && currentKey) {\n const navListItemKey = Array.from(\n containerRef.current.querySelectorAll(ITEM_SELECTOR),\n (elem) => getKey(elem as HTMLElement) as K\n );\n onCurrentKeyChange?.({\n value: navListItemKey[event.key === 'Home' ? 0 : navListItemKey.length - 1] as K\n });\n }\n if (currentKey && (event.key === 'Enter' || event.key === ' ')) {\n onSelectionChange?.({\n value: currentKey as K,\n reason: 'keyboard'\n });\n }\n if (currentKey && event.key === 'Delete') {\n onRemove?.({ value: currentKey as K });\n }\n },\n [currentKey, onSelectionChange, onRemove, onCurrentKeyChange, containerRef]\n );\n\n return {\n showFocusRing,\n currentKey,\n onCurrentKeyChange,\n onKeyDown,\n containerHandlers: mergeProps(focusRingProps, currentKeyProps, onFocusProps)\n };\n}\n\nconst extractOnlyItemKey = (element: HTMLElement, itemSelector: string, itemEliminator: string) => {\n const navigationListItem = element.closest(itemSelector);\n const removeButton = element.closest(itemEliminator);\n return navigationListItem?.contains(removeButton) ? null : keyExtractor(element, itemSelector);\n};\n\nconst findNextCurrentKey = <K>(currentKey: K, currNavs: K[], prevNavs: K[]) => {\n const index = prevNavs.indexOf(currentKey);\n if (index > 0) {\n const nextIndex = index === prevNavs.length - 1 ? index - 1 : index + 1;\n const nextKey = prevNavs[nextIndex];\n if (currNavs.indexOf(nextKey) !== -1) {\n return nextKey;\n }\n }\n // update current key to be the first one if we can't find a suitable next key\n return currNavs[0];\n};\n","import { Ref } from 'preact';\nimport { MutableRef, useRef } from 'preact/hooks';\nimport { mergeProps } from '../utils/UNSAFE_mergeProps';\nimport { classNames } from '../utils/UNSAFE_classNames';\nimport { useId } from '../hooks/UNSAFE_useId';\nimport { navigationListStyles } from './themes/NavigationListStyles.css';\nimport { useNavigationList } from './useNavigationList';\nimport { forwardRef, useImperativeHandle } from 'preact/compat';\nimport { useTestId, TestIdProps } from '../hooks/UNSAFE_useTestId';\nimport { NavigationListProps, NavigationListContext } from '../UNSAFE_NavigationListCommon';\nexport { RemovableNavigationListItem } from '../UNSAFE_NavigationListCommon';\n\nexport type FocusableHandle = {\n focus: () => void;\n blur: () => void;\n};\n\nexport const NavigationList = forwardRef(\n <K extends string | number>(\n {\n children,\n selection,\n onSelectionChange,\n onRemove,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelLedBy,\n testId\n }: NavigationListProps<K> & TestIdProps,\n ref?: Ref<FocusableHandle>\n ) => {\n const containerRef = useRef<HTMLUListElement>(null);\n\n const { showFocusRing, currentKey, onCurrentKeyChange, containerHandlers, onKeyDown } =\n useNavigationList({\n containerRef: containerRef as MutableRef<HTMLUListElement>,\n selection,\n onRemove,\n onSelectionChange,\n children\n });\n\n const eventProps = { onKeyDown };\n const navigationListClass = classNames([navigationListStyles.uListStyle]);\n const navigationListItemPrefix = useId() + '_';\n const testIdProps = useTestId(testId);\n\n //Allows to call focus on rootRef without having to expose it\n useImperativeHandle(ref!, () => ({\n focus: () => {\n if (containerRef.current) {\n containerRef.current.focus();\n }\n },\n blur: () => {\n if (containerRef.current) {\n containerRef.current.focus();\n }\n }\n }));\n\n return (\n <ul\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelLedBy}\n role=\"tablist\"\n ref={containerRef}\n aria-orientation={'vertical'}\n tabIndex={0}\n aria-activedescendant={currentKey ? navigationListItemPrefix + currentKey : ''}\n {...mergeProps(eventProps, containerHandlers)}\n {...testIdProps}\n class={navigationListClass}>\n <NavigationListContext.Provider\n value={{\n selection,\n onSelectionChange,\n onCurrentKeyChange,\n currentKey,\n showFocusRing,\n navigationListItemPrefix,\n onRemove\n }}>\n {children}\n </NavigationListContext.Provider>\n </ul>\n );\n }\n);\n","import {\n BaseNavigationListItem,\n BaseNavigationListItemProps\n} from '../UNSAFE_NavigationListCommon/BaseNavigationListItem';\n\nexport type NavigationListItemProps<K extends string | number> = Omit<\n BaseNavigationListItemProps<K>,\n 'removeIcon'\n>;\n\nexport function NavigationListItem<K extends string | number>({\n itemKey,\n label,\n badge,\n metadata,\n severity\n}: NavigationListItemProps<K>) {\n return (\n <BaseNavigationListItem\n itemKey={itemKey}\n label={label}\n badge={badge}\n metadata={metadata}\n severity={severity}\n />\n );\n}\n"],"names":["useState","useCallback","useCurrentKey","keyExtractor","getPrevNextKeyUsingRef","useCollectionFocusRing","getFirstVisibleKey","useRef","useEffect","getKey","findElementByKey","mergeProps","forwardRef","classNames","navigationListStyles","useId","useTestId","useImperativeHandle","_jsx","NavigationListContext","BaseNavigationListItem"],"mappings":";;;;;;;;;;;;;;;;AAmCA;AACgB,SAAA,iBAAiB,CAA4B,EAC3D,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,iBAAiB,EACjB,QAAQ,EAOT,EAAA;IACC,MAAM,aAAa,GAAG,cAAc,CAAC;IACrC,MAAM,qBAAqB,GAAG,2CAA2C,CAAC;IAC1E,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAGA,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@@ var UNSAFE_OverflowTabBar_themes_OverflowTabBarStyles_css = require('./UNSAFE_Ov
|
|
|
10
10
|
var useDetectHorizontalOverflow = require('./useDetectHorizontalOverflow-003f7c4a.js');
|
|
11
11
|
var RemovableTabBarItem = require('./RemovableTabBarItem-ff408dff.js');
|
|
12
12
|
var TabBarItem = require('./TabBarItem-00fcf601.js');
|
|
13
|
-
var OverflowTabBarItem = require('./OverflowTabBarItem-
|
|
13
|
+
var OverflowTabBarItem = require('./OverflowTabBarItem-57537ebe.js');
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* OverflowTabBar handles the rendering of overflowing tab items.
|
|
@@ -68,4 +68,4 @@ function OverflowTabBar({ items, layout = 'stretch', display = 'standard', size
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
exports.OverflowTabBar = OverflowTabBar;
|
|
71
|
-
//# sourceMappingURL=OverflowTabBar-
|
|
71
|
+
//# sourceMappingURL=OverflowTabBar-27ad6d1f.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverflowTabBar-
|
|
1
|
+
{"version":3,"file":"OverflowTabBar-27ad6d1f.js","sources":["../../src/UNSAFE_OverflowTabBar/OverflowTabBar.tsx"],"sourcesContent":["import { ComponentProps, createRef } from 'preact';\nimport { useCallback, useMemo, useRef, useState } from 'preact/hooks';\nimport { classNames } from '../utils/UNSAFE_classNames';\nimport { TestIdProps } from '../hooks/UNSAFE_useTestId';\nimport { OverflowTabBarItem, RemovableTabBarItem, TabBar, TabBarItem } from '../UNSAFE_TabBar';\nimport { CloseDetail, Item } from '../UNSAFE_TabBarCommon';\nimport { styles } from './themes/OverflowTabBarStyles.css';\nimport { useDetectHorizontalOverflow } from '../hooks/PRIVATE_useDetectHorizontalOverflow';\n\ntype OverflowTabBarProps<K extends string | number> = {\n /**\n * An array of data to render individual tabs\n */\n items: Item<K>[];\n /**\n * The truncation configuration for tab labels.\n * 'progressive' will restrict the width of each tab label to allow all tabs to fit if enough space is not available to display all of the tabs.\n * Labels that are truncated are displayed with ellipses. However the width of each tab label will not be truncated below a specific threshold.\n * 'none' tabs always take up the space needed by the labels even if enough space is not available to display all of the tabs.\n */\n truncation?: 'none' | 'progressive';\n} & Omit<ComponentProps<typeof TabBar>, 'children' | 'aria-describedby' | 'ref'>;\n\n/**\n * OverflowTabBar handles the rendering of overflowing tab items.\n */\nexport function OverflowTabBar<K extends string | number>({\n items,\n layout = 'stretch',\n display = 'standard',\n size = 'md',\n edge = 'top',\n selection,\n truncation,\n onSelect,\n onRemove,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n testId\n}: OverflowTabBarProps<K> & TestIdProps) {\n const displayStackProps = {\n display: display\n };\n const displayNonStackProps = {\n display: display,\n size: size\n };\n\n const displayProps = display === 'stacked' ? displayStackProps : displayNonStackProps;\n const rootRef = useRef<HTMLDivElement>(null);\n const tabBarRef = createRef<HTMLDivElement>();\n\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n\n const isOutsideMouseDown = useRef<boolean>(false);\n\n const handleClose = (e: CloseDetail) => {\n if (tabBarRef.current && ['itemAction', 'dismissed'].includes(e.reason)) {\n tabBarRef?.current?.focus();\n }\n if (e.reason === 'outsideMousedown') {\n isOutsideMouseDown.current = true;\n }\n setIsDropDownOpen(false);\n };\n\n const handleSelect = useCallback<Required<ComponentProps<typeof TabBar>>['onSelect']>(\n (e: { value: string | number }) => {\n if (e.value === 'more') {\n //If overflow item is clicked after dropdown is open, the reason is outsideMouseDown and it needs to be closed\n if (isOutsideMouseDown.current) {\n setIsDropDownOpen(false);\n } else {\n setIsDropDownOpen(true);\n }\n } else {\n onSelect?.(e);\n }\n isOutsideMouseDown.current = false;\n },\n [onSelect]\n );\n\n const overflowItemKey = 'more' as K;\n\n const keysArray = useMemo(() => items.map((item) => item.itemKey) as K[], [items]);\n\n const { visibleItemKeys, overflowItemKeys, maxWidths } = useDetectHorizontalOverflow({\n rootRef: tabBarRef,\n keysArray,\n isTruncationDisabled: !(truncation && truncation === 'progressive')\n });\n\n const overflowTabBarClass = classNames([styles.overflowTabBarBase]);\n\n return (\n <div ref={rootRef} class={overflowTabBarClass}>\n <TabBar\n ref={tabBarRef}\n selection={selection}\n onSelect={handleSelect}\n {...displayProps}\n layout={layout}\n edge={edge}\n onRemove={onRemove}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n testId={testId}>\n {visibleItemKeys != null &&\n visibleItemKeys.length > 0 &&\n items\n .filter((item) => visibleItemKeys?.includes(item.itemKey))\n .map((item: Item<K>) =>\n item.isRemovable ? (\n <RemovableTabBarItem\n itemKey={item.itemKey}\n label={item.label}\n icon={item.icon}\n badge={item.badge}\n metadata={item.metadata}\n severity={item.severity}\n aria-controls={item.tabPanelId}\n labelMaxWidth={maxWidths?.get(item.itemKey)}\n />\n ) : (\n <TabBarItem\n itemKey={item.itemKey}\n label={item.label}\n icon={item.icon}\n badge={item.badge}\n metadata={item.metadata}\n severity={item.severity}\n aria-controls={item.tabPanelId}\n labelMaxWidth={maxWidths?.get(item.itemKey)}\n />\n )\n )}\n {overflowItemKeys != null && overflowItemKeys.length > 0 && (\n <OverflowTabBarItem\n isOpen={isDropDownOpen}\n onClose={handleClose}\n overflowItemKey={overflowItemKey}\n overflowItems={items.filter((item) => overflowItemKeys?.includes(item.itemKey))}\n />\n )}\n </TabBar>\n </div>\n );\n}\n"],"names":["useRef","createRef","useState","useCallback","useMemo","useDetectHorizontalOverflow","classNames","styles","_jsx","_jsxs","TabBar","RemovableTabBarItem","TabBarItem","OverflowTabBarItem"],"mappings":";;;;;;;;;;;;;;AAuBA;;AAEG;SACa,cAAc,CAA4B,EACxD,KAAK,EACL,MAAM,GAAG,SAAS,EAClB,OAAO,GAAG,UAAU,EACpB,IAAI,GAAG,IAAI,EACX,IAAI,GAAG,KAAK,EACZ,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,E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AClB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAA,eAAA,EACR,IAAI,CAAC,UAAU,EAC9B,aAAa,EAAE,SAAS,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAA,CAC3C,KAEFH,eAACI,qBAAU,EAAA,EACT,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,mBACR,IAAI,CAAC,UAAU,EAC9B,aAAa,EAAE,SAAS,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAC3C,CAAA,CACH,CACF,EACJ,gBAAgB,IAAI,IAAI,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,KACtDJ,cAAA,CAACK,qCAAkB,EACjB,EAAA,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,WAAW,EACpB,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,gBAAgB,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAA,CAC/E,CACH,CACM,EAAA,CAAA,EAAA,CACL,EACN;AACJ;;;;"}
|
|
@@ -15,7 +15,7 @@ var Dropdown = require('./Dropdown-34b8f141.js');
|
|
|
15
15
|
var Sheet = require('./Sheet-86989265.js');
|
|
16
16
|
var TabBarItem = require('./TabBarItem-00fcf601.js');
|
|
17
17
|
var UNSAFE_TabBarCommon_themes_OverflowTabBarItemStyles_css = require('./UNSAFE_TabBarCommon/themes/OverflowTabBarItemStyles.css.js');
|
|
18
|
-
var NavigationListItem = require('./NavigationListItem-
|
|
18
|
+
var NavigationListItem = require('./NavigationListItem-7947af0e.js');
|
|
19
19
|
var RemovableNavigationListItem = require('./RemovableNavigationListItem-0eea31bc.js');
|
|
20
20
|
|
|
21
21
|
const SvgOverflowH = (props) => (jsxRuntime.jsx(Icon.Icon, { viewBox: "0 0 24 24", ...props, children: jsxRuntime.jsx("g", { fill: "none", children: jsxRuntime.jsx("path", { d: "M6 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm8 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm8 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0z", fill: "currentcolor" }) }) }));
|
|
@@ -85,4 +85,4 @@ const getIsMobile = () => {
|
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
exports.OverflowTabBarItem = OverflowTabBarItem;
|
|
88
|
-
//# sourceMappingURL=OverflowTabBarItem-
|
|
88
|
+
//# sourceMappingURL=OverflowTabBarItem-57537ebe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverflowTabBarItem-3c7adb01.js","sources":["../../src/UNSAFE_RedwoodIcons/OverflowH/OverflowH.tsx","../../src/UNSAFE_TabBarCommon/OverflowTabBarItem.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates. All rights reserved.\n * https://www.oracle.com/contracts/docs/cloud_csa_online_v062223_us_eng.pdf?download=false&er=221886\n * @ignore\n */\n// DO NOT MODIFY THIS FILE MANUALLY!\n// This file is automatically generated based on the corresponding SVG image in\n// the packages/oraclejet-preact/resources/icons folder.\nimport { ComponentProps } from 'preact';\nimport { Icon } from '../../UNSAFE_Icon';\ntype Props = Omit<ComponentProps<typeof Icon>, 'viewBox' | 'children'>;\nconst SvgOverflowH = (props: Props) => (\n <Icon viewBox=\"0 0 24 24\" {...props}>\n <g fill=\"none\">\n <path\n d=\"M6 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm8 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm8 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0z\"\n fill=\"currentcolor\"\n />\n </g>\n </Icon>\n);\nexport { SvgOverflowH as OverflowH };\n","import { ComponentChild, ComponentProps, createRef } from 'preact';\nimport { useCallback, useRef } from 'preact/hooks';\nimport type { BundleType } from '../resources/nls/bundle';\nimport { useTranslationBundle } from '../hooks/UNSAFE_useTranslationBundle';\nimport { getClientHints } from '../utils/PRIVATE_clientHints';\nimport { mergeInterpolations } from '../utils/UNSAFE_mergeInterpolations';\nimport { flexitemInterpolations } from '../utils/UNSAFE_interpolations/flexitem';\nimport type { FlexitemProps } from '../utils/UNSAFE_interpolations/flexitem';\nimport { classNames } from '../utils/UNSAFE_classNames';\nimport {\n NavigationListItem,\n NavigationList,\n RemovableNavigationListItem,\n FocusableHandle\n} from '../UNSAFE_NavigationList';\nimport { OverflowH } from '../UNSAFE_RedwoodIcons/OverflowH';\nimport { useTabBarContext } from './useTabBarContext';\nimport { Dropdown } from '../UNSAFE_Dropdown';\nimport { Sheet } from '../UNSAFE_Sheet';\nimport { BaseTabBarItem } from './BaseTabBarItem';\nimport { styles } from './themes/OverflowTabBarItemStyles.css';\nimport { TabBarItem } from './TabBarItem';\n\nexport type OverflowSelectionDetail<K> = {\n value: K;\n};\n\nexport type CloseDetail = {\n /**\n * dismissed represents dismissing the DropDown\n */\n reason: 'dismissed' | 'itemAction' | 'outsideMousedown';\n};\n\nexport type Item<K extends string | number> = Omit<\n ComponentProps<typeof TabBarItem<K>>,\n 'testId' | 'aria-controls'\n> & {\n isRemovable?: boolean;\n /**\n * Accepts the tabpanel element's ID associated with the tab item\n **/\n tabPanelId?: string;\n};\n\nexport type OverflowTabBarItemProps<K extends string | number> = {\n /**\n * Key of the TabBarItem\n */\n overflowItemKey: K;\n /**\n * Whether to open the popup\n */\n isOpen: boolean;\n /**\n * Property that triggers a callback when DropDown is supposed to be closed.\n */\n onClose?: (detail: CloseDetail) => void;\n /**\n * The icon of the OverflowTabBarItem\n */\n icon?: ComponentChild;\n /**\n * The content to be rendered inside the Badge component.\n */\n badge?: string;\n /**\n * An array of data used by NavigationList to render individual overflow items.\n */\n overflowItems?: Item<K>[];\n};\n\n/**\n * An OverflowTabBarItem renders TabBarItems in a device appropriate popup. OverflowTabBarItem is used internally in an OverflowTabBar.\n */\n\nexport function OverflowTabBarItem<K extends string | number>({\n overflowItemKey,\n icon,\n badge,\n overflowItems,\n isOpen,\n onClose\n}: OverflowTabBarItemProps<K>) {\n const { selection, showFocusRing, isEdgeBottom, onSelect, onRemove, layout } = useTabBarContext();\n\n const isPointerSelection = useRef<boolean>(false);\n\n const overflowTabBarItemRef = useRef<HTMLDivElement>(null);\n const navigationListRef = createRef<FocusableHandle>();\n\n const handleSelectionChange = useCallback<\n Required<ComponentProps<typeof NavigationList>>['onSelectionChange']\n >(\n (detail: { value: string | number; reason?: 'pointer' | 'keyboard' }) => {\n if (detail.reason === 'pointer') {\n isPointerSelection.current = true;\n }\n onSelect?.({ value: detail.value });\n onClose?.({ reason: 'itemAction' });\n },\n [onSelect, onClose]\n );\n\n const handleDropdownClose = useCallback(\n (e: CloseDetail) => {\n onClose?.({ reason: e.reason });\n },\n [onClose]\n );\n\n const handleSheetClose = useCallback(() => {\n onClose?.({ reason: 'dismissed' });\n }, [onClose]);\n\n //When NavigationList steals focus the app resets it. Not always would it be reset to\n //parent of OverflowTabBarItem. Though currentKey would be correct, but focusRing would would not be visible\n //Hence we check for isPointerSelection.current\n\n const focusRingRequirement = showFocusRing && !isPointerSelection.current && !getIsMobile();\n\n const overflowContainsKey = (searchKey: K) => {\n return overflowItems?.find((item) => item.itemKey === searchKey) != null;\n };\n\n const currentPanelId = overflowItems?.find((item) => item.itemKey === selection)?.tabPanelId;\n\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n\n const isSelected = selection !== undefined && overflowContainsKey(selection as K);\n\n //instead of specifying flex: '1 0 auto' in cssProps var\n const styleInterpolations = mergeInterpolations<FlexitemProps>([\n ...Object.values(flexitemInterpolations)\n ]);\n const flexDimensions = styleInterpolations({\n flex: layout === 'stretch' ? '1 0 auto' : '0 0 auto'\n });\n\n const navContainerClasses = classNames([styles.navContainerBase]);\n\n const navContainerRef = useRef<HTMLDivElement>(null);\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n navigationListRef.current?.focus();\n }\n },\n [navigationListRef]\n );\n const getNavigationList = useCallback(() => {\n return (\n <div onKeyDown={handleKeyDown} tabIndex={0} ref={navContainerRef} class={navContainerClasses}>\n <NavigationList\n ref={navigationListRef}\n selection={selection}\n onSelectionChange={handleSelectionChange}\n onRemove={onRemove}>\n {overflowItems?.map((item) =>\n item.isRemovable ? (\n <RemovableNavigationListItem\n itemKey={item.itemKey}\n label={item.label}\n badge={item.badge}\n metadata={item.metadata}\n severity={item.severity}\n />\n ) : (\n <NavigationListItem\n itemKey={item.itemKey}\n label={item.label}\n badge={item.badge}\n metadata={item.metadata}\n severity={item.severity}\n />\n )\n )}\n </NavigationList>\n </div>\n );\n }, [\n handleKeyDown,\n navContainerClasses,\n navigationListRef,\n selection,\n handleSelectionChange,\n onRemove,\n overflowItems\n ]);\n\n return (\n <>\n {overflowItems && overflowItems.length > 0 && (\n <div ref={overflowTabBarItemRef} style={flexDimensions}>\n <BaseTabBarItem\n aria-controls={currentPanelId}\n itemKey={overflowItemKey}\n label={translations.overflowItemLabel()}\n icon={icon ? icon : <OverflowH />}\n badge={badge}\n showFocusRingOverride={focusRingRequirement}\n selectionOverride={isSelected}\n displayOverride={'icons'}\n aria-haspopup={true}\n />\n </div>\n )}\n {getIsMobile() ? (\n <Sheet isOpen={isOpen} onClose={handleSheetClose}>\n {getNavigationList()}\n </Sheet>\n ) : (\n <Dropdown\n initialFocus=\"firstFocusable\"\n isOpen={isOpen}\n onClose={handleDropdownClose}\n placement={isEdgeBottom ? 'top-end' : 'bottom-end'}\n anchorRef={overflowTabBarItemRef}>\n {getNavigationList()}\n </Dropdown>\n )}\n </>\n );\n}\n\nconst getIsMobile = () => {\n const { deviceType } = getClientHints();\n return deviceType === 'phone';\n};\n"],"names":["_jsx","Icon","useTabBarContext","useRef","createRef","useCallback","useTranslationBundle","mergeInterpolations","flexitemInterpolations","classNames","styles","NavigationList","RemovableNavigationListItem","NavigationListItem","_jsxs","_Fragment","BaseTabBarItem","OverflowH","Sheet","Dropdown","getClientHints"],"mappings":";;;;;;;;;;;;;;;;;;;;AAYA,MAAM,YAAY,GAAG,CAAC,KAAY,MAChCA,cAAA,CAACC,SAAI,EAAC,EAAA,OAAO,EAAC,WAAW,KAAK,KAAK,EAAA,QAAA,EACjCD,cAAG,CAAA,GAAA,EAAA,EAAA,IAAI,EAAC,MAAM,EACZ,QAAA,EAAAA,cAAA,CAAA,MAAA,EAAA,EACE,CAAC,EAAC,sGAAsG,EACxG,IAAI,EAAC,cAAc,EAAA,CACnB,EACA,CAAA,EAAA,CACC,CACR;;ACmDD;;AAEG;AAEa,SAAA,kBAAkB,CAA4B,EAC5D,eAAe,EACf,IAAI,EACJ,KAAK,EACL,aAAa,EACb,MAAM,EACN,OAAO,EACoB,EAAA;AAC3B,IAAA,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAGE,iCAAgB,EAAE,CAAC;AAElG,IAAA,MAAM,kBAAkB,GAAGC,YAAM,CAAU,KAAK,CAAC,CAAC;AAElD,IAAA,MAAM,qBAAqB,GAAGA,YAAM,CAAiB,IAAI,CAAC,CAAC;AAC3D,IAAA,MAAM,iBAAiB,GAAGC,gBAAS,EAAmB,CAAC;AAEvD,IAAA,MAAM,qBAAqB,GAAGC,iBAAW,CAGvC,CAAC,MAAmE,KAAI;AACtE,QAAA,IAAI,MAAM,CAA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EACd,OAAO,EAAE,mBAAmB,EAC5B,SAAS,EAAE,YAAY,GAAG,SAAS,GAAG,YAAY,EAClD,SAAS,EAAE,qBAAqB,EAC/B,QAAA,EAAA,iBAAiB,EAAE,EAAA,CACX,CACZ,CAAA,EAAA,CACA,EACH;AACJ,CAAC;AAED,MAAM,WAAW,GAAG,MAAK;AACvB,IAAA,MAAM,EAAE,UAAU,EAAE,GAAGC,0BAAc,EAAE,CAAC;IACxC,OAAO,UAAU,KAAK,OAAO,CAAC;AAChC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"OverflowTabBarItem-57537ebe.js","sources":["../../src/UNSAFE_RedwoodIcons/OverflowH/OverflowH.tsx","../../src/UNSAFE_TabBarCommon/OverflowTabBarItem.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates. All rights reserved.\n * https://www.oracle.com/contracts/docs/cloud_csa_online_v062223_us_eng.pdf?download=false&er=221886\n * @ignore\n */\n// DO NOT MODIFY THIS FILE MANUALLY!\n// This file is automatically generated based on the corresponding SVG image in\n// the packages/oraclejet-preact/resources/icons folder.\nimport { ComponentProps } from 'preact';\nimport { Icon } from '../../UNSAFE_Icon';\ntype Props = Omit<ComponentProps<typeof Icon>, 'viewBox' | 'children'>;\nconst SvgOverflowH = (props: Props) => (\n <Icon viewBox=\"0 0 24 24\" {...props}>\n <g fill=\"none\">\n <path\n d=\"M6 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm8 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm8 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0z\"\n fill=\"currentcolor\"\n />\n </g>\n </Icon>\n);\nexport { SvgOverflowH as OverflowH };\n","import { ComponentChild, ComponentProps, createRef } from 'preact';\nimport { useCallback, useRef } from 'preact/hooks';\nimport type { BundleType } from '../resources/nls/bundle';\nimport { useTranslationBundle } from '../hooks/UNSAFE_useTranslationBundle';\nimport { getClientHints } from '../utils/PRIVATE_clientHints';\nimport { mergeInterpolations } from '../utils/UNSAFE_mergeInterpolations';\nimport { flexitemInterpolations } from '../utils/UNSAFE_interpolations/flexitem';\nimport type { FlexitemProps } from '../utils/UNSAFE_interpolations/flexitem';\nimport { classNames } from '../utils/UNSAFE_classNames';\nimport {\n NavigationListItem,\n NavigationList,\n RemovableNavigationListItem,\n FocusableHandle\n} from '../UNSAFE_NavigationList';\nimport { OverflowH } from '../UNSAFE_RedwoodIcons/OverflowH';\nimport { useTabBarContext } from './useTabBarContext';\nimport { Dropdown } from '../UNSAFE_Dropdown';\nimport { Sheet } from '../UNSAFE_Sheet';\nimport { BaseTabBarItem } from './BaseTabBarItem';\nimport { styles } from './themes/OverflowTabBarItemStyles.css';\nimport { TabBarItem } from './TabBarItem';\n\nexport type OverflowSelectionDetail<K> = {\n value: K;\n};\n\nexport type CloseDetail = {\n /**\n * dismissed represents dismissing the DropDown\n */\n reason: 'dismissed' | 'itemAction' | 'outsideMousedown';\n};\n\nexport type Item<K extends string | number> = Omit<\n ComponentProps<typeof TabBarItem<K>>,\n 'testId' | 'aria-controls'\n> & {\n isRemovable?: boolean;\n /**\n * Accepts the tabpanel element's ID associated with the tab item\n **/\n tabPanelId?: string;\n};\n\nexport type OverflowTabBarItemProps<K extends string | number> = {\n /**\n * Key of the TabBarItem\n */\n overflowItemKey: K;\n /**\n * Whether to open the popup\n */\n isOpen: boolean;\n /**\n * Property that triggers a callback when DropDown is supposed to be closed.\n */\n onClose?: (detail: CloseDetail) => void;\n /**\n * The icon of the OverflowTabBarItem\n */\n icon?: ComponentChild;\n /**\n * The content to be rendered inside the Badge component.\n */\n badge?: string;\n /**\n * An array of data used by NavigationList to render individual overflow items.\n */\n overflowItems?: Item<K>[];\n};\n\n/**\n * An OverflowTabBarItem renders TabBarItems in a device appropriate popup. OverflowTabBarItem is used internally in an OverflowTabBar.\n */\n\nexport function OverflowTabBarItem<K extends string | number>({\n overflowItemKey,\n icon,\n badge,\n overflowItems,\n isOpen,\n onClose\n}: OverflowTabBarItemProps<K>) {\n const { selection, showFocusRing, isEdgeBottom, onSelect, onRemove, layout } = useTabBarContext();\n\n const isPointerSelection = useRef<boolean>(false);\n\n const overflowTabBarItemRef = useRef<HTMLDivElement>(null);\n const navigationListRef = createRef<FocusableHandle>();\n\n const handleSelectionChange = useCallback<\n Required<ComponentProps<typeof NavigationList>>['onSelectionChange']\n >(\n (detail: { value: string | number; reason?: 'pointer' | 'keyboard' }) => {\n if (detail.reason === 'pointer') {\n isPointerSelection.current = true;\n }\n onSelect?.({ value: detail.value });\n onClose?.({ reason: 'itemAction' });\n },\n [onSelect, onClose]\n );\n\n const handleDropdownClose = useCallback(\n (e: CloseDetail) => {\n onClose?.({ reason: e.reason });\n },\n [onClose]\n );\n\n const handleSheetClose = useCallback(() => {\n onClose?.({ reason: 'dismissed' });\n }, [onClose]);\n\n //When NavigationList steals focus the app resets it. Not always would it be reset to\n //parent of OverflowTabBarItem. Though currentKey would be correct, but focusRing would would not be visible\n //Hence we check for isPointerSelection.current\n\n const focusRingRequirement = showFocusRing && !isPointerSelection.current && !getIsMobile();\n\n const overflowContainsKey = (searchKey: K) => {\n return overflowItems?.find((item) => item.itemKey === searchKey) != null;\n };\n\n const currentPanelId = overflowItems?.find((item) => item.itemKey === selection)?.tabPanelId;\n\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n\n const isSelected = selection !== undefined && overflowContainsKey(selection as K);\n\n //instead of specifying flex: '1 0 auto' in cssProps var\n const styleInterpolations = mergeInterpolations<FlexitemProps>([\n ...Object.values(flexitemInterpolations)\n ]);\n const flexDimensions = styleInterpolations({\n flex: layout === 'stretch' ? '1 0 auto' : '0 0 auto'\n });\n\n const navContainerClasses = classNames([styles.navContainerBase]);\n\n const navContainerRef = useRef<HTMLDivElement>(null);\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n navigationListRef.current?.focus();\n }\n },\n [navigationListRef]\n );\n const getNavigationList = useCallback(() => {\n return (\n <div onKeyDown={handleKeyDown} tabIndex={0} ref={navContainerRef} class={navContainerClasses}>\n <NavigationList\n ref={navigationListRef}\n selection={selection}\n onSelectionChange={handleSelectionChange}\n onRemove={onRemove}>\n {overflowItems?.map((item) =>\n item.isRemovable ? (\n <RemovableNavigationListItem\n itemKey={item.itemKey}\n label={item.label}\n badge={item.badge}\n metadata={item.metadata}\n severity={item.severity}\n />\n ) : (\n <NavigationListItem\n itemKey={item.itemKey}\n label={item.label}\n badge={item.badge}\n metadata={item.metadata}\n severity={item.severity}\n />\n )\n )}\n </NavigationList>\n </div>\n );\n }, [\n handleKeyDown,\n navContainerClasses,\n navigationListRef,\n selection,\n handleSelectionChange,\n onRemove,\n overflowItems\n ]);\n\n return (\n <>\n {overflowItems && overflowItems.length > 0 && (\n <div ref={overflowTabBarItemRef} style={flexDimensions}>\n <BaseTabBarItem\n aria-controls={currentPanelId}\n itemKey={overflowItemKey}\n label={translations.overflowItemLabel()}\n icon={icon ? icon : <OverflowH />}\n badge={badge}\n showFocusRingOverride={focusRingRequirement}\n selectionOverride={isSelected}\n displayOverride={'icons'}\n aria-haspopup={true}\n />\n </div>\n )}\n {getIsMobile() ? (\n <Sheet isOpen={isOpen} onClose={handleSheetClose}>\n {getNavigationList()}\n </Sheet>\n ) : (\n <Dropdown\n initialFocus=\"firstFocusable\"\n isOpen={isOpen}\n onClose={handleDropdownClose}\n placement={isEdgeBottom ? 'top-end' : 'bottom-end'}\n anchorRef={overflowTabBarItemRef}>\n {getNavigationList()}\n </Dropdown>\n )}\n </>\n );\n}\n\nconst getIsMobile = () => {\n const { deviceType } = getClientHints();\n return deviceType === 'phone';\n};\n"],"names":["_jsx","Icon","useTabBarContext","useRef","createRef","useCallback","useTranslationBundle","mergeInterpolations","flexitemInterpolations","classNames","styles","NavigationList","RemovableNavigationListItem","NavigationListItem","_jsxs","_Fragment","BaseTabBarItem","OverflowH","Sheet","Dropdown","getClientHints"],"mapp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
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var BaseCardView = require('./BaseCardView-
|
|
6
|
+
var BaseCardView = require('./BaseCardView-ade994f5.js');
|
|
7
7
|
require('preact/jsx-runtime');
|
|
8
8
|
require('preact');
|
|
9
9
|
require('preact/compat');
|
|
@@ -107,9 +107,9 @@ require('./useTabbableMode-5c8fd9e5.js');
|
|
|
107
107
|
require('./CollectionInteractionContext-f84ff7a1.js');
|
|
108
108
|
require('./useCollectionInteractionContext-6fc0200e.js');
|
|
109
109
|
require('./useActive-6770f917.js');
|
|
110
|
-
require('./LoadMoreCollection-
|
|
111
|
-
require('./useViewportIntersect-ca1f958b.js');
|
|
110
|
+
require('./LoadMoreCollection-73112ff0.js');
|
|
112
111
|
require('./Collection-9880039f.js');
|
|
112
|
+
require('./useViewportIntersect-ca1f958b.js');
|
|
113
113
|
require('./PRIVATE_BaseCardView/themes/BaseCardViewStyles.css.js');
|
|
114
114
|
|
|
115
115
|
require('./tabbableUtils-39e647b7.js');
|
package/cjs/PRIVATE_List.js
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var List = require('./List-
|
|
6
|
+
var List = require('./List-0dc2c4c4.js');
|
|
7
7
|
var GroupLoadingIndicator = require('./GroupLoadingIndicator-5940d185.js');
|
|
8
8
|
require('preact/jsx-runtime');
|
|
9
9
|
require('preact/hooks');
|
|
10
10
|
require('./classNames-c14c6ef3.js');
|
|
11
11
|
require('./mergeProps-e3da7237.js');
|
|
12
12
|
require('./keys-25710458.js');
|
|
13
|
-
require('./LoadMoreCollection-
|
|
13
|
+
require('./LoadMoreCollection-73112ff0.js');
|
|
14
14
|
require('preact');
|
|
15
|
-
require('./useViewportIntersect-ca1f958b.js');
|
|
16
15
|
require('./Collection-9880039f.js');
|
|
17
|
-
require('./
|
|
16
|
+
require('./useViewportIntersect-ca1f958b.js');
|
|
17
|
+
require('./VirtualizedCollection-00aedb8b.js');
|
|
18
18
|
require('preact/compat');
|
|
19
19
|
require('./TabbableModeContext-e99d527e.js');
|
|
20
20
|
require('./useId-6c0eeb27.js');
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var LoadMoreCollection = require('./LoadMoreCollection-
|
|
6
|
+
var LoadMoreCollection = require('./LoadMoreCollection-73112ff0.js');
|
|
7
7
|
require('preact/jsx-runtime');
|
|
8
8
|
require('preact');
|
|
9
|
+
require('./Collection-9880039f.js');
|
|
9
10
|
require('./useViewportIntersect-ca1f958b.js');
|
|
10
11
|
require('preact/hooks');
|
|
11
|
-
require('./Collection-9880039f.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var useSelectCommon = require('./useSelectCommon-
|
|
6
|
+
var useSelectCommon = require('./useSelectCommon-5b46ac60.js');
|
|
7
7
|
require('preact/jsx-runtime');
|
|
8
8
|
require('./Flex-e7a85bef.js');
|
|
9
9
|
require('./useTestId-5e6af45d.js');
|
|
@@ -60,13 +60,13 @@ require('./UNSAFE_Skeleton/themes/redwood/SkeletonBaseTheme.css.js');
|
|
|
60
60
|
require('./UNSAFE_Skeleton/themes/redwood/SkeletonVariants.css.js');
|
|
61
61
|
require('./PRIVATE_SelectCommon/themes/dropdownStyles.css.js');
|
|
62
62
|
|
|
63
|
-
require('./List-
|
|
63
|
+
require('./List-0dc2c4c4.js');
|
|
64
64
|
require('./mergeProps-e3da7237.js');
|
|
65
65
|
require('./keys-25710458.js');
|
|
66
|
-
require('./LoadMoreCollection-
|
|
67
|
-
require('./useViewportIntersect-ca1f958b.js');
|
|
66
|
+
require('./LoadMoreCollection-73112ff0.js');
|
|
68
67
|
require('./Collection-9880039f.js');
|
|
69
|
-
require('./
|
|
68
|
+
require('./useViewportIntersect-ca1f958b.js');
|
|
69
|
+
require('./VirtualizedCollection-00aedb8b.js');
|
|
70
70
|
require('./FocusTrap-bfe96498.js');
|
|
71
71
|
require('./tabbableUtils-39e647b7.js');
|
|
72
72
|
require('./head-68d0992f.js');
|
package/cjs/PRIVATE_Table.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var Table = require('./Table-
|
|
6
|
+
var Table = require('./Table-90fe7ad8.js');
|
|
7
7
|
require('preact/jsx-runtime');
|
|
8
8
|
require('preact/hooks');
|
|
9
9
|
require('preact/compat');
|
|
@@ -15,9 +15,9 @@ require('./useUser-a4bfc560.js');
|
|
|
15
15
|
require('./LayerHost-a8c7f182.js');
|
|
16
16
|
require('./Common/themes/redwood/theme.js');
|
|
17
17
|
require('./Common/themes/themeContract.css.js');
|
|
18
|
-
require('./LoadMoreCollection-
|
|
19
|
-
require('./useViewportIntersect-ca1f958b.js');
|
|
18
|
+
require('./LoadMoreCollection-73112ff0.js');
|
|
20
19
|
require('./Collection-9880039f.js');
|
|
20
|
+
require('./useViewportIntersect-ca1f958b.js');
|
|
21
21
|
require('./useTranslationBundle-51f4c22c.js');
|
|
22
22
|
require('./PRIVATE_Table/themes/TableSkeletonStyles.css.js');
|
|
23
23
|
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var VirtualizedCollection = require('./VirtualizedCollection-
|
|
6
|
+
var VirtualizedCollection = require('./VirtualizedCollection-00aedb8b.js');
|
|
7
7
|
require('preact/jsx-runtime');
|
|
8
8
|
require('preact/hooks');
|
|
9
|
-
require('./useViewportIntersect-ca1f958b.js');
|
|
10
9
|
require('./Collection-9880039f.js');
|
|
11
10
|
require('preact');
|
|
11
|
+
require('./useViewportIntersect-ca1f958b.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -56,7 +56,7 @@ require('./UNSAFE_Popup/themes/redwood/PopupVariants.css.js');
|
|
|
56
56
|
var useFocusableTextField = require('./useFocusableTextField-2c36840d.js');
|
|
57
57
|
var useLoadingIndicatorTimer = require('./useLoadingIndicatorTimer-128b4b14.js');
|
|
58
58
|
var useTextField = require('./useTextField-3ce8f0d0.js');
|
|
59
|
-
var useSelectCommon = require('./useSelectCommon-
|
|
59
|
+
var useSelectCommon = require('./useSelectCommon-5b46ac60.js');
|
|
60
60
|
require('./useAccessibleContext-c49d8d1b.js');
|
|
61
61
|
require('./textAlign-f41f49db.js');
|
|
62
62
|
var useFormFieldContext = require('./useFormFieldContext-20f419ef.js');
|
|
@@ -1302,4 +1302,4 @@ const SelectMultiple = compat.forwardRef(({ addToList = 'off', 'aria-describedby
|
|
|
1302
1302
|
}); // forwardRef will remove generics, so we cast it explicitly to preserve generics.
|
|
1303
1303
|
|
|
1304
1304
|
exports.SelectMultiple = SelectMultiple;
|
|
1305
|
-
//# sourceMappingURL=SelectMultiple-
|
|
1305
|
+
//# sourceMappingURL=SelectMultiple-b1f05b9f.js.map
|