@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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact/hooks', './Text-cd61a065', './useNavigationListItem-17b77626', './Flex-56ecdf4c', './useComponentTheme-5aa41a8f', './classNames-08d99695', './WarningS-3ecba583', './ErrorS-d2efaf06', './InformationS-2f6b535d', './SuccessS-c5d520d2', './UNSAFE_NavigationListCommon/themes/redwood/NavigationListItemTheme', './Badge-b28ef084'], (function(e,s,a,n,t,i,r,o,c,l,d,m,u,g){"use strict";e.BaseNavigationListItem=function({itemKey:e,label:h,badge:x,metadata:f,severity:v="none",removeIcon:S}){const j=a.useRef(null),{itemId:p,itemHandlers:I,itemClasses:N,isSelected:b,labelContainerClasses:C,labelContainerStyle:y}=t.useNavigationListItem({itemKey:e}),T=!("none"===v||void 0===v),{styles:{iconLabelContainer:L,iconContainer:w,navigationItemMetadata:R}}=r.useComponentTheme(u.NavigationListItemRedwoodTheme),B=o.classNames([R]),E=o.classNames([L,w]),{styles:{navigationlistRemoveIcon:F}}=r.useComponentTheme(u.NavigationListItemRedwoodTheme),k=o.classNames([F]);return s.jsxs("li",{role:"tab",...I,"data-oj-key":e,id:p,class:N,"aria-selected":b,ref:j,children:[h&&s.jsx("span",{class:C,style:y,children:s.jsx(n.Text,{size:"inherit",weight:"inherit",variant:"inherit",children:h})}),(f||T||x||S)&&s.jsxs(i.Flex,{gap:"2x",align:"center",justify:"end",flex:"1 1 auto",children:[" ",x&&s.jsx("span",{class:E,children:s.jsx(g.Badge,{size:"md",variant:"neutralSubtle",children:x})}),f&&s.jsx("span",{class:B,children:s.jsx(n.Text,{children:"( "+f+" )"})}),T&&s.jsx("span",{class:E,children:(e=>{switch(e){case"error":return s.jsx(l.SvgErrorS,{color:"danger"});case"warning":return s.jsx(c.SvgWarningS,{color:"warning"});case"info":return s.jsx(d.SvgInformationS,{color:"info"});case"confirmation":return s.jsx(m.SvgSuccessS,{color:"success"});default:return null}})(v)}),S&&s.jsx("span",{class:k,children:S})]})]})}}));
|
|
2
|
+
//# sourceMappingURL=BaseNavigationListItem-5765a81f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseNavigationListItem-5765a81f.js","sources":["../../src/UNSAFE_NavigationListCommon/BaseNavigationListItem.tsx"],"sourcesContent":["import { useRef } from 'preact/hooks';\n\nimport { Text } from '../UNSAFE_Text';\n\nimport { useNavigationListItem } from './useNavigationListItem';\nimport { Flex } from '../UNSAFE_Flex';\nimport { Badge } from '../UNSAFE_Badge';\nimport { useComponentTheme } from '../hooks/UNSAFE_useComponentTheme';\nimport { classNames } from '../utils/UNSAFE_classNames';\nimport { WarningS } from '../UNSAFE_RedwoodIcons/WarningS';\nimport { ErrorS } from '../UNSAFE_RedwoodIcons/ErrorS';\nimport { InformationS } from '../UNSAFE_RedwoodIcons/InformationS';\nimport { SuccessS } from '../UNSAFE_RedwoodIcons/SuccessS';\nimport {\n NavigationListItemStyles,\n NavigationListItemVariantOptions\n} from '../UNSAFE_NavigationList/themes/NavigationListItemStyles.css';\nimport { NavigationListItemRedwoodTheme } from './themes/redwood/NavigationListItemTheme';\nimport { ComponentChildren } from 'preact';\n\ntype Severity = 'warning' | 'info' | 'none' | 'error' | 'confirmation';\n\nexport type BaseNavigationListItemProps<K extends string | number> = {\n /**\n * Key of the NavigationListItem.\n */\n itemKey: K;\n /**\n * Label of the NavigationListItem.\n */\n label?: string;\n /**\n * The content to be rendered inside the Badge component.\n */\n badge?: string;\n /**\n * The content to be rendered inside the Text component as a metadata.\n */\n metadata?: string;\n /**\n * The status icon to be rendered after the label.\n */\n severity?: Severity;\n /**\n * The content to be rendered for remove icon\n */\n removeIcon?: ComponentChildren;\n};\n\n/*TODO: JET-58535. Add ripple effect when touching navigationListItem. */\nexport function BaseNavigationListItem<K extends string | number>({\n itemKey,\n label,\n badge,\n metadata,\n severity = 'none',\n removeIcon\n}: BaseNavigationListItemProps<K>) {\n const itemRef = useRef<HTMLLIElement | null>(null);\n\n //Logic of the component handled here\n const {\n itemId,\n itemHandlers,\n itemClasses,\n isSelected,\n labelContainerClasses,\n labelContainerStyle\n } = useNavigationListItem({\n itemKey\n });\n\n const severityRequirement = !(severity === 'none' || severity === undefined);\n\n const IconComponent = (severityValue: Severity) => {\n switch (severityValue) {\n case 'error':\n return <ErrorS color=\"danger\" />;\n case 'warning':\n return <WarningS color=\"warning\" />;\n case 'info':\n return <InformationS color=\"info\" />;\n case 'confirmation':\n return <SuccessS color=\"success\" />;\n default:\n return null;\n }\n };\n\n const {\n styles: { iconLabelContainer, iconContainer, navigationItemMetadata }\n } = useComponentTheme<NavigationListItemVariantOptions, NavigationListItemStyles>(\n NavigationListItemRedwoodTheme\n );\n\n const navigationItemMatadata = classNames([navigationItemMetadata]);\n\n const endIconContainerClasses = classNames([iconLabelContainer, iconContainer]);\n const {\n styles: { navigationlistRemoveIcon }\n } = useComponentTheme<NavigationListItemVariantOptions, NavigationListItemStyles>(\n NavigationListItemRedwoodTheme\n );\n\n const removeClass = classNames([navigationlistRemoveIcon]);\n\n return (\n <li\n role=\"tab\"\n {...itemHandlers}\n data-oj-key={itemKey}\n id={itemId}\n class={itemClasses}\n aria-selected={isSelected}\n ref={itemRef}>\n {label && (\n <span class={labelContainerClasses} style={labelContainerStyle}>\n <Text size=\"inherit\" weight=\"inherit\" variant=\"inherit\">\n {label}\n </Text>\n </span>\n )}\n {(metadata || severityRequirement || badge || removeIcon) && (\n <Flex gap=\"2x\" align=\"center\" justify=\"end\" flex=\"1 1 auto\">\n {' '}\n {badge && (\n <span class={endIconContainerClasses}>\n <Badge size=\"md\" variant=\"neutralSubtle\">\n {badge}\n </Badge>\n </span>\n )}\n {metadata && (\n <span class={navigationItemMatadata}>\n <Text>{'( ' + metadata + ' )'}</Text>\n </span>\n )}\n {severityRequirement && (\n <span class={endIconContainerClasses}>{IconComponent(severity)}</span>\n )}\n {removeIcon && <span class={removeClass}>{removeIcon}</span>}\n </Flex>\n )}\n </li>\n );\n}\n"],"names":["itemKey","label","badge","metadata","severity","removeIcon","itemRef","useRef","itemId","itemHandlers","itemClasses","isSelected","labelContainerClasses","labelContainerStyle","useNavigationListItem","severityRequirement","undefined","styles","iconLabelContainer","iconContainer","navigationItemMetadata","useComponentTheme","NavigationListItemRedwoodTheme","navigationItemMatadata","classNames","endIconContainerClasses","navigationlistRemoveIcon","removeClass","_jsxs","jsxs","role","id","class","ref","children","_jsx","jsx","style","Text","size","weight","variant","Flex","gap","align","justify","flex","Badge","severityValue","ErrorS","SvgErrorS","color","WarningS","SvgWarningS","InformationS","SvgInformationS","SuccessS","SvgSuccessS","IconComponent"],"mappings":"gcAkDkEA,QAChEA,EAAOC,MACPA,EAAKC,MACLA,EAAKC,SACLA,EAAQC,SACRA,EAAW,OAAMC,WACjBA,IAEA,MAAMC,EAAUC,SAA6B,OAGvCC,OACJA,EAAMC,aACNA,EAAYC,YACZA,EAAWC,WACXA,EAAUC,sBACVA,EAAqBC,oBACrBA,GACEC,wBAAsB,CACxBd,YAGIe,IAAqC,SAAbX,QAAoCY,IAAbZ,IAkBnDa,QAAQC,mBAAEA,EAAkBC,cAAEA,EAAaC,uBAAEA,IAC3CC,oBACFC,EAAAA,gCAGIC,EAAyBC,EAAAA,WAAW,CAACJ,IAErCK,EAA0BD,EAAUA,WAAC,CAACN,EAAoBC,KAE9DF,QAAQS,yBAAEA,IACRL,EAAAA,kBACFC,EAAAA,gCAGIK,EAAcH,EAAAA,WAAW,CAACE,IAEhC,OACEE,EACEC,KAAA,KAAA,CAAAC,KAAK,SACDrB,EAAY,cACHT,EACb+B,GAAIvB,EACJwB,MAAOtB,EAAW,gBACHC,EACfsB,IAAK3B,EACJ4B,SAAA,CAAAjC,GACCkC,EAAAC,IAAA,OAAA,CAAMJ,MAAOpB,EAAuByB,MAAOxB,EAAmBqB,SAC5DC,MAACG,OAAI,CAACC,KAAK,UAAUC,OAAO,UAAUC,QAAQ,UAASP,SACpDjC,OAILE,GAAYY,GAAuBb,GAASG,IAC5CuB,EAACC,KAAAa,OAAK,CAAAC,IAAI,KAAKC,MAAM,SAASC,QAAQ,MAAMC,KAAK,WAC9CZ,SAAA,CAAA,IACAhC,GACCiC,EAAAA,IAAA,OAAA,CAAMH,MAAOP,EACXS,SAAAC,EAAAC,IAACW,EAAKA,MAAC,CAAAR,KAAK,KAAKE,QAAQ,gBAAeP,SACrChC,MAINC,GACCgC,EAAAA,YAAMH,MAAOT,EACXW,SAAAC,EAAAA,IAACG,EAAAA,KAAI,CAAAJ,SAAE,KAAO/B,EAAW,SAG5BY,GACCoB,EAAAA,IAAA,OAAA,CAAMH,MAAOP,EAA0BS,SAhE3B,CAACc,IACrB,OAAQA,GACN,IAAK,QACH,OAAOb,MAACc,EAAMC,UAAA,CAACC,MAAM,WACvB,IAAK,UACH,OAAOhB,MAACiB,EAAQC,YAAA,CAACF,MAAM,YACzB,IAAK,OACH,OAAOhB,MAACmB,EAAYC,gBAAA,CAACJ,MAAM,SAC7B,IAAK,eACH,OAAOhB,MAACqB,EAAQC,YAAA,CAACN,MAAM,YACzB,QACE,OAAO,KACV,EAoD8CO,CAActD,KAEtDC,GAAc8B,EAAAA,IAAM,OAAA,CAAAH,MAAOL,WAActB,SAKpD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact', 'preact/hooks', 'preact/compat', './FormContext-5130e198', './useFormContext-30acdd33', './FormFieldContext-3c44aaaa', './useFormFieldContextProps-4e36b4c3', 'css!./CheckboxSetStyles.styles.css', './useId-c9578d26', './CheckboxRadioField-9733dd24'], (function(e,s,t,i,o,a,l,r,d,n,c,u){"use strict";const x=t.createContext({});var b="CheckboxSetStyles_styles_ul__68p6630";const h=o.forwardRef((({"aria-describedby":e,assistiveText:o,columnSpan:a,direction:n="column",helpSourceLink:h,helpSourceText:m,isDisabled:C,isReadonly:p,isRequired:S=!1,label:y,labelEdge:F,labelStartWidth:k,messages:v,onCommit:R,userAssistanceDensity:D,value:f,children:g,testId:j},I)=>{const A=void 0!==f&&f.size>0,P=c.useId(),{isDisabled:T,isReadonly:_,labelEdge:E,labelStartWidth:V,userAssistanceDensity:W}=l.useFormContext(),q=C??T,L=p??_,w=F??E,z=k??V,B=D??W,M=d.useFormFieldContextProps({hasValue:A,isDisabled:q,isReadonly:L}),N=i.useMemo((()=>({name:P,value:f,onCommit:R})),[P,R,f]),G=t.toChildArray(g).filter(Boolean).map((e=>s.jsx("li",{children:e})));return s.jsx(r.FormFieldContext.Provider,{value:M,children:s.jsx(u.CheckboxRadioField,{"aria-describedby":e,assistiveText:o,baseId:P,columnSpan:a,direction:n,helpSourceLink:h,helpSourceText:m,isDisabled:q,isReadonly:L,isRequired:S,label:y,labelEdge:w,labelStartWidth:z,parentComponentVariant:"checkboxSet",messages:v,userAssistanceDensity:B,hasValue:A,role:"group",testId:j,ref:I,children:s.jsx(x.Provider,{value:N,children:s.jsx("ul",{className:b,children:G})})})})}));e.CheckboxSet=h,e.CheckboxSetContext=x,e.useCheckboxSetContext=()=>i.useContext(x)}));
|
|
2
|
+
//# sourceMappingURL=CheckboxSet-4582f29e.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxSet-
|
|
1
|
+
{"version":3,"file":"CheckboxSet-4582f29e.js","sources":["../../src/UNSAFE_CheckboxSet/CheckboxSetContext.ts","../../src/UNSAFE_CheckboxSet/CheckboxSet.tsx"],"sourcesContent":["import { createContext } from 'preact';\nimport { useContext } from 'preact/hooks';\n\nimport { ValueUpdateDetail } from '../utils/UNSAFE_valueUpdateDetail';\n\ntype CheckboxSetContextValue = {\n name: string;\n value?: Set<string | number>;\n onCommit?: (detail: ValueUpdateDetail<Set<string | number>>) => void;\n};\n\nconst CheckboxSetContext = createContext<CheckboxSetContextValue>({} as CheckboxSetContextValue);\nconst useCheckboxSetContext = () => useContext(CheckboxSetContext);\n\nexport { CheckboxSetContext, useCheckboxSetContext };\n","import { ComponentChildren, ComponentProps, Ref, toChildArray } from 'preact';\nimport { useMemo } from 'preact/hooks';\nimport { forwardRef } from 'preact/compat';\n\nimport { CheckboxSetContext } from './CheckboxSetContext';\nimport { CheckboxRadioField } from '#PRIVATE_CheckboxRadioField';\nimport { InlineUserAssistance, UserAssistanceDensityType } from '#UNSAFE_UserAssistance';\nimport { useFormContext } from '#hooks/UNSAFE_useFormContext';\nimport { FormFieldContext } from '#hooks/UNSAFE_useFormFieldContext';\nimport { useFormFieldContextProps } from '#hooks/UNSAFE_useFormFieldContextProps';\nimport { FlexboxProps } from '#utils/UNSAFE_interpolations/flexbox';\nimport { Size } from '#utils/UNSAFE_size';\nimport { ValueUpdateDetail } from '#utils/UNSAFE_valueUpdateDetail';\nimport { FocusableHandle } from '#hooks/UNSAFE_useFocusableTextField';\nimport { styles } from './CheckboxSetStyles.css';\nimport { AriaAttributesSignalExcluded } from '#utils/UNSAFE_attributeUtils';\nimport { useId } from '#hooks/UNSAFE_useId';\nimport { LayoutColumnSpan } from '#utils/UNSAFE_styles/Layout';\nimport { TestIdProps } from '#hooks/UNSAFE_useTestId';\n\ntype InlineUserAssistanceProps = ComponentProps<typeof InlineUserAssistance>;\n\ntype Props = {\n /**\n * The ID of an element (or space separated IDs of multiple elements) that\n * describes the input.\n */\n 'aria-describedby'?: AriaAttributesSignalExcluded['aria-describedby'];\n /**\n * Text to provide guidance to help the user understand what data to enter.\n */\n assistiveText?: InlineUserAssistanceProps['assistiveText'];\n /**\n * set of CheckboxItems\n */\n children: ComponentChildren;\n /**\n * Specifies how many columns to span in a FormLayout with direction === 'row'\n */\n columnSpan?: LayoutColumnSpan;\n /**\n * layout direction of the children elements\n */\n direction?: FlexboxProps['direction'];\n /**\n * Help source URL associated with the component.\n */\n helpSourceLink?: InlineUserAssistanceProps['helpSourceLink'];\n /**\n * Custom text to be rendered for the <code>helpSourceLink</code>.\n */\n helpSourceText?: InlineUserAssistanceProps['helpSourceText'];\n /**\n * Specifies whether the checkbox set requires a selection to be made.\n */\n isRequired?: boolean;\n /**\n * Specifies if the checkbox set is read-only.\n */\n isReadonly?: boolean;\n /**\n * Specifies if the checkbox set is disabled.\n */\n isDisabled?: boolean;\n /**\n * Label text for the group of checkbox items.\n */\n label: string;\n /**\n * Specifies where the label is positioned relative to the field.\n */\n labelEdge?: 'none' | 'top' | 'start' | 'inside';\n /**\n * Specifies the width of the label when <code>labelEdge</code> is <code>\"start\"</code>.\n */\n labelStartWidth?: Size;\n /**\n * Messages to show on screen that are associated with the component.\n */\n messages?: InlineUserAssistanceProps['messages'];\n /**\n * Callback invoked each time the user changes selected option.\n */\n onCommit: (detail: ValueUpdateDetail<Set<string | number>>) => void;\n /**\n * Specifies the density of the user assistance presentation. It can be set to:\n * <ul>\n * <li><code>'reflow'</code>: Show inline. Layout will reflow when text is displayed.</li>\n * <li><code>'efficient'</code>: Show inline and reserve space to prevent layout reflow when user\n * assistance text is displayed.</li>\n * <li><code>'compact'</code>: Show inline and reserve space to prevent layout reflow when user\n * assistance text is displayed.</li>\n * </ul>\n */\n userAssistanceDensity?: UserAssistanceDensityType;\n /**\n * Value of the selected checkbox option.\n */\n value?: Set<string | number>;\n} & TestIdProps;\n/**\n * A CheckboxSet set allows the user to select one or more options from a set.\n */\nexport const CheckboxSet = forwardRef(\n (\n {\n 'aria-describedby': ariaDescribedBy,\n assistiveText,\n columnSpan,\n direction = 'column',\n helpSourceLink,\n helpSourceText,\n isDisabled: propIsDisabled,\n isReadonly: propIsReadonly,\n isRequired = false,\n label,\n labelEdge: propLabelEdge,\n labelStartWidth: propLabelStartWidth,\n messages,\n onCommit,\n userAssistanceDensity: propUserAssistanceDensity,\n value,\n children,\n testId\n }: Props,\n ref?: Ref<FocusableHandle>\n ) => {\n const hasValue = value !== undefined ? value.size > 0 : false;\n const baseId = useId();\n\n const {\n isDisabled: isFormDisabled,\n isReadonly: isFormReadonly,\n labelEdge: formLabelEdge,\n labelStartWidth: formLabelStartWidth,\n userAssistanceDensity: formUserAssistanceDensity\n } = useFormContext();\n\n // default to FormContext values if component properties are not specified\n const isDisabled = propIsDisabled ?? isFormDisabled;\n const isReadonly = propIsReadonly ?? isFormReadonly;\n const labelEdge = propLabelEdge ?? formLabelEdge;\n const labelStartWidth = propLabelStartWidth ?? formLabelStartWidth;\n const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;\n\n const formFieldContext = useFormFieldContextProps({\n hasValue,\n isDisabled,\n isReadonly\n });\n\n const checkboxSetContext = useMemo(\n () => ({\n name: baseId,\n value,\n onCommit\n }),\n [baseId, onCommit, value]\n );\n\n // wrap each CheckboxItem in an <li> tag and the entire set with <ul>\n const childrenArray = toChildArray(children).filter(Boolean);\n const wrappedChildren = childrenArray.map((item) => <li>{item}</li>);\n\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n <CheckboxRadioField\n aria-describedby={ariaDescribedBy}\n assistiveText={assistiveText}\n baseId={baseId}\n columnSpan={columnSpan}\n direction={direction}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n isDisabled={isDisabled}\n isReadonly={isReadonly}\n isRequired={isRequired}\n label={label}\n labelEdge={labelEdge}\n labelStartWidth={labelStartWidth}\n parentComponentVariant=\"checkboxSet\"\n messages={messages}\n userAssistanceDensity={userAssistanceDensity}\n hasValue={hasValue}\n role=\"group\"\n testId={testId}\n ref={ref}>\n <CheckboxSetContext.Provider value={checkboxSetContext}>\n <ul className={styles.ul}>{wrappedChildren}</ul>\n </CheckboxSetContext.Provider>\n </CheckboxRadioField>\n </FormFieldContext.Provider>\n );\n }\n);\n"],"names":["CheckboxSetContext","createContext","CheckboxSet","forwardRef","ariaDescribedBy","assistiveText","columnSpan","direction","helpSourceLink","helpSourceText","isDisabled","propIsDisabled","isReadonly","propIsReadonly","isRequired","label","labelEdge","propLabelEdge","labelStartWidth","propLabelStartWidth","messages","onCommit","userAssistanceDensity","propUserAssistanceDensity","value","children","testId","ref","hasValue","undefined","size","baseId","useId","isFormDisabled","isFormReadonly","formLabelEdge","formLabelStartWidth","formUserAssistanceDensity","useFormContext","formFieldContext","useFormFieldContextProps","checkboxSetContext","useMemo","name","wrappedChildren","toChildArray","filter","Boolean","map","item","_jsx","FormFieldContext","Provider","CheckboxRadioField","parentComponentVariant","role","jsx","className","styles","useContext"],"mappings":"6UAWA,MAAMA,EAAqBC,EAAaA,cAA0B,iDC4F3D,MAAMC,EAAcC,EAAUA,YACnC,EAEI,mBAAoBC,EACpBC,gBACAC,aACAC,YAAY,SACZC,iBACAC,iBACAC,WAAYC,EACZC,WAAYC,EACZC,cAAa,EACbC,QACAC,UAAWC,EACXC,gBAAiBC,EACjBC,WACAC,WACAC,sBAAuBC,EACvBC,QACAC,WACAC,UAEFC,KAEA,MAAMC,OAAqBC,IAAVL,GAAsBA,EAAMM,KAAO,EAC9CC,EAASC,EAAAA,SAGbtB,WAAYuB,EACZrB,WAAYsB,EACZlB,UAAWmB,EACXjB,gBAAiBkB,EACjBd,sBAAuBe,GACrBC,EAAcA,iBAGZ5B,EAAaC,GAAkBsB,EAC/BrB,EAAaC,GAAkBqB,EAC/BlB,EAAYC,GAAiBkB,EAC7BjB,EAAkBC,GAAuBiB,EACzCd,EAAwBC,GAA6Bc,EAErDE,EAAmBC,EAAAA,yBAAyB,CAChDZ,WACAlB,aACAE,eAGI6B,EAAqBC,EAAAA,SACzB,KAAO,CACLC,KAAMZ,EACNP,QACAH,cAEF,CAACU,EAAQV,EAAUG,IAKfoB,EADgBC,EAAAA,aAAapB,GAAUqB,OAAOC,SACdC,KAAKC,GAASC,MAAA,KAAA,CAAAzB,SAAKwB,MAEzD,OACEC,EAAAA,IAACC,EAAAA,iBAAiBC,UAAS5B,MAAOe,EAAgBd,SAChDyB,EAAAA,IAACG,EAAAA,uCACmBjD,EAClBC,cAAeA,EACf0B,OAAQA,EACRzB,WAAYA,EACZC,UAAWA,EACXC,eAAgBA,EAChBC,eAAgBA,EAChBC,WAAYA,EACZE,WAAYA,EACZE,WAAYA,EACZC,MAAOA,EACPC,UAAWA,EACXE,gBAAiBA,EACjBoC,uBAAuB,cACvBlC,SAAUA,EACVE,sBAAuBA,EACvBM,SAAUA,EACV2B,KAAK,QACL7B,OAAQA,EACRC,IAAKA,EACLF,SAAAyB,EAAAM,IAACxD,EAAmBoD,SAAQ,CAAC5B,MAAOiB,EAAkBhB,SACpDyB,EAAAA,UAAIO,UAAWC,EAASjC,SAAGmB,SAIjC,mEDpLwB,IAAMe,EAAAA,WAAW3D"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact/hooks', './classNames-08d99695', './usePress-949a0d03', './FormFieldContext-3c44aaaa', './useFormFieldContext-8196183c', 'css!./MaxLengthCounterStyles.styles.css'], (function(s,e,n,t,a,r,l,c){"use strict";var o="MaxLengthCounterStyles_spanStyles__7dy9j72";const u=()=>{};s.MaxLengthCounter=function({maxLength:s,valueLength:r=0,onClick:c}){const{isFocused:d}=l.useFormFieldContext(),i=n.useCallback((s=>s.preventDefault()),[]),x=t.classNames([!d&&"MaxLengthCounterStyles_hide__7dy9j71"]),{pressProps:h}=a.usePress(c??u);return e.jsx("div",{class:"MaxLengthCounterStyles_maxLengthCounterBase__7dy9j70",onMouseDown:i,...h,children:e.jsxs("span",{class:x,children:[e.jsx("span",{class:o,children:r}),e.jsx("span",{class:o,children:"/"}),e.jsx("span",{class:o,children:s})]})})}}));
|
|
2
|
+
//# sourceMappingURL=MaxLengthCounter-9a95922c.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaxLengthCounter-
|
|
1
|
+
{"version":3,"file":"MaxLengthCounter-9a95922c.js","sources":["../../src/UNSAFE_TextArea/MaxLengthCounter.tsx"],"sourcesContent":["import { useCallback } from 'preact/hooks';\n\nimport { classNames } from '../utils/UNSAFE_classNames';\nimport { usePress } from '../hooks/UNSAFE_usePress';\nimport { useFormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { hide, maxLengthCounterBase, spanStyles } from './MaxLengthCounterStyles.css';\n\ntype Props = {\n maxLength: number;\n valueLength?: number;\n onClick?: () => void; // the calling component should focus on the appropriate element when clicked.\n};\n\nconst noop = () => {};\n\nexport function MaxLengthCounter({ maxLength, valueLength = 0, onClick }: Props) {\n const { isFocused } = useFormFieldContext();\n // We don't want mousedown on this component to do anything, so prevent the default behavior.\n const killEvent = useCallback((event: Event) => event.preventDefault(), []);\n const textClasses = classNames([!isFocused && hide]);\n const { pressProps } = usePress(onClick ?? noop);\n return (\n <div class={maxLengthCounterBase} onMouseDown={killEvent} {...pressProps}>\n <span class={textClasses}>\n <span class={spanStyles}>{valueLength}</span>\n <span class={spanStyles}>/</span>\n <span class={spanStyles}>{maxLength}</span>\n </span>\n </div>\n );\n}\n"],"names":["noop","maxLength","valueLength","onClick","isFocused","useFormFieldContext","killEvent","useCallback","event","preventDefault","textClasses","classNames","pressProps","usePress","_jsx","jsx","class","onMouseDown","_jsxs","jsxs","children","spanStyles"],"mappings":"qSAaA,MAAMA,EAAO,0BAEP,UAA2BC,UAAEA,EAASC,YAAEA,EAAc,EAACC,QAAEA,IAC7D,MAAMC,UAAEA,GAAcC,EAAAA,sBAEhBC,EAAYC,EAAAA,aAAaC,GAAiBA,EAAMC,kBAAkB,IAClEC,EAAcC,EAAAA,WAAW,EAAEP,6CAC3BQ,WAAEA,GAAeC,EAAQA,SAACV,GAAWH,GAC3C,OACEc,EAAKC,IAAA,MAAA,CAAAC,6DAA6BC,YAAaX,KAAeM,WAC5DM,EAAMC,KAAA,OAAA,CAAAH,MAAON,EAAWU,SAAA,CACtBN,cAAME,MAAOK,EAAUD,SAAGlB,IAC1BY,EAAAA,YAAME,MAAOK,EAAoBD,SAAA,MACjCN,cAAME,MAAOK,EAAaD,SAAAnB,QAIlC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact/hooks', './mergeProps-bcfa6a92', './classNames-08d99695', './useId-c9578d26', './UNSAFE_NavigationList/themes/NavigationListStyles.css', './collectionUtils-17f5cc64', './useCollectionFocusRing-66a6fc12', './useCurrentKey-31c18053', 'preact/compat', './useTestId-3a316499', './useNavigationListItem-17b77626'], (function(e,n,t,r,o,s,c,i,a,l,u,d,y){"use strict";const f=(e,n,t)=>{const r=e.closest(n),o=e.closest(t);return r?.contains(o)?null:i.keyExtractor(e,n)},g=(e,n,t)=>{const r=t.indexOf(e);if(r>0){const e=t[r===t.length-1?r-1:r+1];if(-1!==n.indexOf(e))return e}return n[0]},v=u.forwardRef((({children:e,selection:v,onSelectionChange:m,onRemove:h,"aria-label":b,"aria-labelledby":C,testId:K},R)=>{const x=t.useRef(null),{showFocusRing:k,currentKey:I,onCurrentKeyChange:w,containerHandlers:N,onKeyDown:p}=function({containerRef:e,selection:n,onRemove:o,onSelectionChange:s,children:c}){const u='[role="tab"]',[d,y]=t.useState(n),v=t.useCallback((e=>{y(e.value)}),[]),{currentKeyProps:m}=l.useCurrentKey((e=>o?f(e,u,"[data-oj-navigationlist-item-remove-icon]"):i.keyExtractor(e,u)),!1,i.getPrevNextKeyUsingRef(e,d,!0,u),i.getPrevNextKeyUsingRef(e,d,!1,u),void 0,void 0,d,v),[h,b]=a.useCollectionFocusRing(e,["Home","End","ArrowUp","ArrowDown"]),C={onFocus:t.useCallback((()=>{if(e.current&&void 0===d){const n=i.getFirstVisibleKey(e.current,u);n&&y(n)}}),[d,e])},K=t.useRef();t.useEffect((()=>{if(e.current){const n=Array.from(e.current.querySelectorAll(u),(e=>i.getKey(e)));if(null!=d&&-1!==n.indexOf(d)){const n=i.findElementByKey(e.current,d,u);n.scrollIntoViewIfNeeded?n.scrollIntoViewIfNeeded():n.scrollIntoView({block:"nearest"})}else d&&-1===n.indexOf(d)&&(K.current?y(g(d,n,K.current)):y(n[0])),K.current=n}}),[c,d,e]);const R=t.useCallback((n=>{if(("Home"===n.key||"End"===n.key)&&e.current&&d){const t=Array.from(e.current.querySelectorAll(u),(e=>i.getKey(e)));v?.({value:t["Home"===n.key?0:t.length-1]})}!d||"Enter"!==n.key&&" "!==n.key||s?.({value:d,reason:"keyboard"}),d&&"Delete"===n.key&&o?.({value:d})}),[d,s,o,v,e]);return{showFocusRing:h,currentKey:d,onCurrentKeyChange:v,onKeyDown:R,containerHandlers:r.mergeProps(b,m,C)}}({containerRef:x,selection:v,onRemove:h,onSelectionChange:m,children:e}),S={onKeyDown:p},E=o.classNames([c.navigationListStyles.uListStyle]),F=s.useId()+"_",L=d.useTestId(K);return u.useImperativeHandle(R,(()=>({focus:()=>{x.current&&x.current.focus()},blur:()=>{x.current&&x.current.focus()}}))),n.jsx("ul",{"aria-label":b,"aria-labelledby":C,role:"tablist",ref:x,"aria-orientation":"vertical",tabIndex:0,"aria-activedescendant":I?F+I:"",...r.mergeProps(S,N),...L,class:E,children:n.jsx(y.NavigationListContext.Provider,{value:{selection:v,onSelectionChange:m,onCurrentKeyChange:w,currentKey:I,showFocusRing:k,navigationListItemPrefix:F,onRemove:h},children:e})})}));e.NavigationList=v}));
|
|
2
|
+
//# sourceMappingURL=NavigationList-f1b80e54.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationList-f1b80e54.js","sources":["../../src/UNSAFE_NavigationList/useNavigationList.ts","../../src/UNSAFE_NavigationList/NavigationList.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"],"names":["extractOnlyItemKey","element","itemSelector","itemEliminator","navigationListItem","closest","removeButton","contains","keyExtractor","findNextCurrentKey","currentKey","currNavs","prevNavs","index","indexOf","nextKey","length","NavigationList","forwardRef","children","selection","onSelectionChange","onRemove","ariaLabel","ariaLabelLedBy","testId","ref","containerRef","useRef","showFocusRing","onCurrentKeyChange","containerHandlers","onKeyDown","ITEM_SELECTOR","setCurrentKey","useState","useCallback","detail","value","currentKeyProps","useCurrentKey","getPrevNextKeyUsingRef","undefined","focusRingProps","useCollectionFocusRing","onFocusProps","onFocus","current","key","getFirstVisibleKey","prevNavItems","useEffect","navListItemKeys","Array","from","querySelectorAll","elem","getKey","navListItem","findElementByKey","scrollIntoViewIfNeeded","scrollIntoView","block","event","navListItemKey","reason","mergeProps","useNavigationList","eventProps","navigationListClass","classNames","navigationListStyles","uListStyle","navigationListItemPrefix","useId","testIdProps","useTestId","useImperativeHandle","focus","blur","_jsx","role","tabIndex","class","NavigationListContext","Provider"],"mappings":"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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', './BaseNavigationListItem-5765a81f'], (function(e,t,a){"use strict";e.NavigationListItem=function({itemKey:e,label:i,badge:s,metadata:n,severity:m}){return t.jsx(a.BaseNavigationListItem,{itemKey:e,label:i,badge:s,metadata:n,severity:m})}}));
|
|
2
|
+
//# sourceMappingURL=NavigationListItem-12919fe5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationListItem-12919fe5.js","sources":["../../src/UNSAFE_NavigationList/NavigationListItem.tsx"],"sourcesContent":["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":["itemKey","label","badge","metadata","severity","_jsx","jsx","BaseNavigationListItem"],"mappings":"+HAUgB,UAA8CA,QAC5DA,EAAOC,MACPA,EAAKC,MACLA,EAAKC,SACLA,EAAQC,SACRA,IAEA,OACEC,EAACC,IAAAC,EAAsBA,uBACrB,CAAAP,QAASA,EACTC,MAAOA,EACPC,MAAOA,EACPC,SAAUA,EACVC,SAAUA,GAGhB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
define(['exports', 'preact/jsx-runtime', 'preact', 'preact/hooks', './classNames-08d99695', './TabBar-
|
|
2
|
-
//# sourceMappingURL=OverflowTabBar-
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact', 'preact/hooks', './classNames-08d99695', './TabBar-93811d2c', './UNSAFE_OverflowTabBar/themes/OverflowTabBarStyles.css', './useDetectHorizontalOverflow-c90aa487', './RemovableTabBarItem-29b54206', './TabBarItem-547825e2', './OverflowTabBarItem-17b2920a'], (function(e,a,t,l,s,r,o,i,n,c,m){"use strict";e.OverflowTabBar=function({items:e,layout:d="stretch",display:b="standard",size:u="md",edge:y="top",selection:v,truncation:f,onSelect:I,onRemove:B,"aria-label":T,"aria-labelledby":p,testId:w}){const K="stacked"===b?{display:b}:{display:b,size:u},g=l.useRef(null),h=t.createRef(),[x,R]=l.useState(!1),O=l.useRef(!1),j=l.useCallback((e=>{"more"===e.value?O.current?R(!1):R(!0):I?.(e),O.current=!1}),[I]),S=l.useMemo((()=>e.map((e=>e.itemKey))),[e]),{visibleItemKeys:k,overflowItemKeys:z,maxWidths:M}=i.useDetectHorizontalOverflow({rootRef:h,keysArray:S,isTruncationDisabled:!(f&&"progressive"===f)}),A=s.classNames([o.styles.overflowTabBarBase]);return a.jsx("div",{ref:g,class:A,children:a.jsxs(r.TabBar,{ref:h,selection:v,onSelect:j,...K,layout:d,edge:y,onRemove:B,"aria-label":T,"aria-labelledby":p,testId:w,children:[null!=k&&k.length>0&&e.filter((e=>k?.includes(e.itemKey))).map((e=>e.isRemovable?a.jsx(n.RemovableTabBarItem,{itemKey:e.itemKey,label:e.label,icon:e.icon,badge:e.badge,metadata:e.metadata,severity:e.severity,"aria-controls":e.tabPanelId,labelMaxWidth:M?.get(e.itemKey)}):a.jsx(c.TabBarItem,{itemKey:e.itemKey,label:e.label,icon:e.icon,badge:e.badge,metadata:e.metadata,severity:e.severity,"aria-controls":e.tabPanelId,labelMaxWidth:M?.get(e.itemKey)}))),null!=z&&z.length>0&&a.jsx(m.OverflowTabBarItem,{isOpen:x,onClose:e=>{h.current&&["itemAction","dismissed"].includes(e.reason)&&h?.current?.focus(),"outsideMousedown"===e.reason&&(O.current=!0),R(!1)},overflowItemKey:"more",overflowItems:e.filter((e=>z?.includes(e.itemKey)))})]})})}}));
|
|
2
|
+
//# sourceMappingURL=OverflowTabBar-dfcce021.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverflowTabBar-
|
|
1
|
+
{"version":3,"file":"OverflowTabBar-dfcce021.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":["items","layout","display","size","edge","selection","truncation","onSelect","onRemove","ariaLabel","ariaLabelledby","testId","displayProps","rootRef","useRef","tabBarRef","createRef","isDropDownOpen","setIsDropDownOpen","useState","isOutsideMouseDown","handleSelect","useCallback","e","value","current","keysArray","useMemo","map","item","itemKey","visibleItemKeys","overflowItemKeys","maxWidths","useDetectHorizontalOverflow","isTruncationDisabled","overflowTabBarClass","classNames","styles","overflowTabBarBase","_jsx","ref","class","children","_jsxs","TabBar","length","filter","includes","isRemovable","RemovableTabBarItem","label","icon","badge","metadata","severity","tabPanelId","labelMaxWidth","get","TabBarItem","OverflowTabBarItem","isOpen","onClose","reason","focus","overflowItemKey","overflowItems"],"mappings":"iXA0B0DA,MACxDA,EAAKC,OACLA,EAAS,UAASC,QAClBA,EAAU,WAAUC,KACpBA,EAAO,KAAIC,KACXA,EAAO,MAAKC,UACZA,EAASC,WACTA,EAAUC,SACVA,EAAQC,SACRA,EACA,aAAcC,EACd,kBAAmBC,EAAcC,OACjCA,IAEA,MAQMC,EAA2B,YAAZV,EARK,CACxBA,QAASA,GAEkB,CAC3BA,QAASA,EACTC,KAAMA,GAIFU,EAAUC,SAAuB,MACjCC,EAAYC,EAAAA,aAEXC,EAAgBC,GAAqBC,EAAQA,UAAU,GAExDC,EAAqBN,UAAgB,GAYrCO,EAAeC,eAClBC,IACiB,SAAZA,EAAEC,MAEAJ,EAAmBK,QACrBP,GAAkB,GAElBA,GAAkB,GAGpBX,IAAWgB,GAEbH,EAAmBK,SAAU,CAAK,GAEpC,CAAClB,IAKGmB,EAAYC,EAAAA,SAAQ,IAAM3B,EAAM4B,KAAKC,GAASA,EAAKC,WAAiB,CAAC9B,KAErE+B,gBAAEA,EAAeC,iBAAEA,EAAgBC,UAAEA,GAAcC,EAAAA,4BAA4B,CACnFrB,QAASE,EACTW,YACAS,uBAAwB7B,GAA6B,gBAAfA,KAGlC8B,EAAsBC,EAAUA,WAAC,CAACC,EAAAA,OAAOC,qBAE/C,OACEC,EAAAA,WAAKC,IAAK5B,EAAS6B,MAAON,EACxBO,SAAAC,EAAAA,KAACC,EAAAA,OACC,CAAAJ,IAAK1B,EACLV,UAAWA,EACXE,SAAUc,KACNT,EACJX,OAAQA,EACRG,KAAMA,EACNI,SAAUA,EACE,aAAAC,EACK,kBAAAC,EACjBC,OAAQA,EAAMgC,SAAA,CACM,MAAnBZ,GACCA,EAAgBe,OAAS,GACzB9C,EACG+C,QAAQlB,GAASE,GAAiBiB,SAASnB,EAAKC,WAChDF,KAAKC,GACJA,EAAKoB,YACHT,MAACU,EAAAA,qBACCpB,QAASD,EAAKC,QACdqB,MAAOtB,EAAKsB,MACZC,KAAMvB,EAAKuB,KACXC,MAAOxB,EAAKwB,MACZC,SAAUzB,EAAKyB,SACfC,SAAU1B,EAAK0B,SAAQ,gBACR1B,EAAK2B,WACpBC,cAAexB,GAAWyB,IAAI7B,EAAKC,WAGrCU,MAACmB,aAAU,CACT7B,QAASD,EAAKC,QACdqB,MAAOtB,EAAKsB,MACZC,KAAMvB,EAAKuB,KACXC,MAAOxB,EAAKwB,MACZC,SAAUzB,EAAKyB,SACfC,SAAU1B,EAAK0B,yBACA1B,EAAK2B,WACpBC,cAAexB,GAAWyB,IAAI7B,EAAKC,aAIxB,MAApBE,GAA4BA,EAAiBc,OAAS,GACrDN,MAACoB,EAAAA,mBACC,CAAAC,OAAQ5C,EACR6C,QApFWvC,IACfR,EAAUU,SAAW,CAAC,aAAc,aAAauB,SAASzB,EAAEwC,SAC9DhD,GAAWU,SAASuC,QAEL,qBAAbzC,EAAEwC,SACJ3C,EAAmBK,SAAU,GAE/BP,GAAkB,EAAM,EA8EhB+C,gBA1Dc,OA2DdC,cAAelE,EAAM+C,QAAQlB,GAASG,GAAkBgB,SAASnB,EAAKC,iBAMlF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact', 'preact/hooks', './useTranslationBundle-516b1b83', './clientHints-4f5a07b0', './mergeInterpolations-9ede4cf7', './flexitem-5db48325', './classNames-08d99695', './NavigationList-f1b80e54', './NavigationListItem-12919fe5', './Icon-2d38c876', './useTabBarContext-15a23bb6', './Dropdown-4b421eff', './Sheet-46782f99', './TabBarItem-547825e2', './UNSAFE_TabBarCommon/themes/OverflowTabBarItemStyles.css', './RemovableNavigationListItem-c486140e'], (function(e,a,t,n,s,o,i,l,r,c,m,d,b,u,v,f,p,g){"use strict";const x=e=>a.jsx(d.Icon,{viewBox:"0 0 24 24",...e,children:a.jsx("g",{fill:"none",children:a.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"})})});const h=()=>{const{deviceType:e}=o.getClientHints();return"phone"===e};e.OverflowTabBarItem=function({overflowItemKey:e,icon:o,badge:d,overflowItems:y,isOpen:I,onClose:j}){const{selection:C,showFocusRing:w,isEdgeBottom:B,onSelect:R,onRemove:T,layout:K}=b.useTabBarContext(),N=n.useRef(!1),O=n.useRef(null),k=t.createRef(),L=n.useCallback((e=>{"pointer"===e.reason&&(N.current=!0),R?.({value:e.value}),j?.({reason:"itemAction"})}),[R,j]),F=n.useCallback((e=>{j?.({reason:e.reason})}),[j]),S=n.useCallback((()=>{j?.({reason:"dismissed"})}),[j]),D=w&&!N.current&&!h(),z=y?.find((e=>e.itemKey===C))?.tabPanelId,A=s.useTranslationBundle("@oracle/oraclejet-preact"),E=void 0!==C&&(H=C,null!=y?.find((e=>e.itemKey===H)));var H;const M=i.mergeInterpolations([...Object.values(l.flexitemInterpolations)])({flex:"stretch"===K?"1 0 auto":"0 0 auto"}),P=r.classNames([p.styles.navContainerBase]),U=n.useRef(null),_=n.useCallback((e=>{"ArrowDown"===e.key&&(e.preventDefault(),k.current?.focus())}),[k]),q=n.useCallback((()=>a.jsx("div",{onKeyDown:_,tabIndex:0,ref:U,class:P,children:a.jsx(c.NavigationList,{ref:k,selection:C,onSelectionChange:L,onRemove:T,children:y?.map((e=>e.isRemovable?a.jsx(g.RemovableNavigationListItem,{itemKey:e.itemKey,label:e.label,badge:e.badge,metadata:e.metadata,severity:e.severity}):a.jsx(m.NavigationListItem,{itemKey:e.itemKey,label:e.label,badge:e.badge,metadata:e.metadata,severity:e.severity})))})})),[_,P,k,C,L,T,y]);return a.jsxs(a.Fragment,{children:[y&&y.length>0&&a.jsx("div",{ref:O,style:M,children:a.jsx(f.BaseTabBarItem,{"aria-controls":z,itemKey:e,label:A.overflowItemLabel(),icon:o||a.jsx(x,{}),badge:d,showFocusRingOverride:D,selectionOverride:E,displayOverride:"icons","aria-haspopup":!0})}),h()?a.jsx(v.Sheet,{isOpen:I,onClose:S,children:q()}):a.jsx(u.Dropdown,{initialFocus:"firstFocusable",isOpen:I,onClose:F,placement:B?"top-end":"bottom-end",anchorRef:O,children:q()})]})}}));
|
|
2
|
+
//# sourceMappingURL=OverflowTabBarItem-17b2920a.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverflowTabBarItem-c59db4a2.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":["SvgOverflowH","props","_jsx","jsx","Icon","viewBox","children","fill","d","getIsMobile","deviceType","getClientHints","overflowItemKey","icon","badge","overflowItems","isOpen","onClose","selection","showFocusRing","isEdgeBottom","onSelect","onRemove","layout","useTabBarContext","isPointerSelection","useRef","overflowTabBarItemRef","navigationListRef","createRef","handleSelectionChange","useCallback","detail","reason","current","value","handleDropdownClose","e","handleSheetClose","focusRingRequirement","currentPanelId","find","item","itemKey","tabPanelId","translations","useTranslationBundle","isSelected","undefined","searchKey","flexDimensions","mergeInterpolations","Object","values","flexitemInterpolations","styleInterpolations","flex","navContainerClasses","classNames","styles","navContainerBase","navContainerRef","handleKeyDown","event","key","preventDefault","focus","getNavigationList","onKeyDown","tabIndex","ref","class","NavigationList","onSelectionChange","map","isRemovable","RemovableNavigationListItem","label","metadata","severity","NavigationListItem","_jsxs","_Fragment","length","style","BaseTabBarItem","overflowItemLabel","OverflowH","showFocusRingOverride","selectionOverride","displayOverride","Sheet","Dropdown","initialFocus","placement","anchorRef"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"OverflowTabBarItem-17b2920a.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":["SvgOverflowH","props","_jsx","jsx","Icon","viewBox","children","fill","d","getIsMobile","deviceType","getClientHints","overflowItemKey","icon","badge","overflowItems","isOpen","onClose","selection","showFocusRing","isEdgeBottom","onSelect","onRemove","layout","useTabBarContext","isPointerSelection","useRef","overflowTabBarItemRef","navigationListRef","createRef","handleSelectionChange","useCallback","detail","reason","current","value","handleDropdownClose","e","handleSheetClose","focusRingRequirement","currentPanelId","find","item","itemKey","tabPanelId","translations","useTranslationBundle","isSelected","undefined","searchKey","flexDimensions","mergeInterpolations","Object","values","flexitemInterpolations","styleInterpolations","flex","navContainerClasses","classNames","styles","navContainerBase","navContainerRef","handleKeyDown","event","key","preventDefault","focus","getNavigationList","onKeyDown","tabIndex","ref","class","NavigationList","onSelectionChange","map","isRemovable","RemovableNavigationListItem","label","metadata","severity","NavigationListItem","_jsxs","_Fragment","length","style","BaseTabBarItem","overflowItemLabel","OverflowH","showFocusRingOverride","selectionOverride","displayOverride","Sheet","Dropdown","initialFocus","placement","anchorRef"],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
1
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_insideNonReadonlyForm_isInsideNonReadonlyForm__ck0nxo0 {
|
|
2
2
|
border-width: var(--borderWidth__w6gg1y1);
|
|
3
3
|
border-color: var(--borderColorDisabled__w6gg1yd);
|
|
4
4
|
background-color: transparent;
|
|
@@ -6,72 +6,72 @@
|
|
|
6
6
|
min-width: 1em;
|
|
7
7
|
flex: 1;
|
|
8
8
|
}
|
|
9
|
-
.
|
|
9
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_insideNonReadonlyForm_notInsideNonReadonlyForm__ck0nxo1 {
|
|
10
10
|
border-width: 0;
|
|
11
11
|
background-color: transparent;
|
|
12
12
|
height: auto;
|
|
13
13
|
vertical-align: top;
|
|
14
14
|
}
|
|
15
|
-
.
|
|
15
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_textarea_isTextArea__ck0nxo4 {
|
|
16
16
|
height: auto;
|
|
17
17
|
}
|
|
18
|
-
.
|
|
18
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_resize_horizontal__ck0nxoc {
|
|
19
19
|
resize: horizontal;
|
|
20
20
|
}
|
|
21
|
-
.
|
|
21
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_resize_vertical__ck0nxod {
|
|
22
22
|
resize: vertical;
|
|
23
23
|
}
|
|
24
|
-
.
|
|
24
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_resize_both__ck0nxoe {
|
|
25
25
|
resize: both;
|
|
26
26
|
}
|
|
27
|
-
.
|
|
27
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_resize_none__ck0nxof {
|
|
28
28
|
max-width: 100%;
|
|
29
29
|
overflow: visible;
|
|
30
30
|
}
|
|
31
|
-
.
|
|
31
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_0__ck0nxog {
|
|
32
32
|
padding-top: 0;
|
|
33
33
|
padding-bottom: 0;
|
|
34
34
|
}
|
|
35
|
-
.
|
|
35
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_1__ck0nxoh {
|
|
36
36
|
min-height: var(--insideEdgeHeight__w6gg1yh);
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_2__ck0nxoi {
|
|
39
39
|
height: auto;
|
|
40
40
|
}
|
|
41
|
-
.
|
|
41
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_3__ck0nxoj {
|
|
42
42
|
min-height: calc(var(--oj-c-EXPERIMENTAL-DO-NOT-USE-body-md-line-height) * var(--oj-c-EXPERIMENTAL-DO-NOT-USE-body-md-font-size));
|
|
43
43
|
}
|
|
44
|
-
.
|
|
44
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_4__ck0nxok {
|
|
45
45
|
min-height: calc(var(--oj-c-EXPERIMENTAL-DO-NOT-USE-body-md-line-height) * var(--oj-c-EXPERIMENTAL-DO-NOT-USE-body-md-font-size));
|
|
46
46
|
}
|
|
47
|
-
.
|
|
47
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_5__ck0nxol {
|
|
48
48
|
min-height: calc((var(--oj-c-EXPERIMENTAL-DO-NOT-USE-body-md-line-height) + var(--insideEdgeLineHeight__kn3t7f6)) * var(--oj-c-EXPERIMENTAL-DO-NOT-USE-body-md-font-size));
|
|
49
49
|
}
|
|
50
|
-
.
|
|
50
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_6__ck0nxom {
|
|
51
51
|
min-height: calc((var(--oj-c-EXPERIMENTAL-DO-NOT-USE-body-md-line-height) + var(--insideEdgeLineHeight__kn3t7f6)) * var(--oj-c-EXPERIMENTAL-DO-NOT-USE-body-md-font-size));
|
|
52
52
|
}
|
|
53
|
-
.
|
|
53
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_7__ck0nxon {
|
|
54
54
|
min-height: var(--height__w6gg1yg);
|
|
55
55
|
}
|
|
56
|
-
.
|
|
56
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_8__ck0nxoo {
|
|
57
57
|
min-height: var(--height__w6gg1yg);
|
|
58
58
|
}
|
|
59
|
-
.
|
|
59
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_9__ck0nxop {
|
|
60
60
|
border-top-right-radius: 0;
|
|
61
61
|
border-bottom-right-radius: 0;
|
|
62
62
|
}
|
|
63
|
-
.
|
|
63
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_10__ck0nxoq {
|
|
64
64
|
border-top-left-radius: 0;
|
|
65
65
|
border-bottom-left-radius: 0;
|
|
66
66
|
margin-left: -1px;
|
|
67
67
|
}
|
|
68
|
-
.
|
|
68
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_11__ck0nxor {
|
|
69
69
|
border-top-right-radius: 0;
|
|
70
70
|
border-bottom-right-radius: 0;
|
|
71
71
|
border-top-left-radius: 0;
|
|
72
72
|
border-bottom-left-radius: 0;
|
|
73
73
|
margin-left: -1px;
|
|
74
74
|
}
|
|
75
|
-
.
|
|
75
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_12__ck0nxos {
|
|
76
76
|
min-height: var(--insideEdgeHeight__w6gg1yh);
|
|
77
77
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
1
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_insideNonReadonlyForm_isInsideNonReadonlyForm__a11ehs0 {
|
|
2
2
|
border-width: var(--borderWidth__w6gg1y1);
|
|
3
3
|
border-color: var(--borderColorDisabled__w6gg1yd);
|
|
4
4
|
background-color: transparent;
|
|
@@ -6,72 +6,72 @@
|
|
|
6
6
|
min-width: 1em;
|
|
7
7
|
flex: 1;
|
|
8
8
|
}
|
|
9
|
-
.
|
|
9
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_insideNonReadonlyForm_notInsideNonReadonlyForm__a11ehs1 {
|
|
10
10
|
border-width: 0;
|
|
11
11
|
background-color: transparent;
|
|
12
12
|
height: auto;
|
|
13
13
|
vertical-align: top;
|
|
14
14
|
}
|
|
15
|
-
.
|
|
15
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_textarea_isTextArea__a11ehs4 {
|
|
16
16
|
height: auto;
|
|
17
17
|
}
|
|
18
|
-
.
|
|
18
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_resize_horizontal__a11ehsc {
|
|
19
19
|
resize: horizontal;
|
|
20
20
|
}
|
|
21
|
-
.
|
|
21
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_resize_vertical__a11ehsd {
|
|
22
22
|
resize: vertical;
|
|
23
23
|
}
|
|
24
|
-
.
|
|
24
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_resize_both__a11ehse {
|
|
25
25
|
resize: both;
|
|
26
26
|
}
|
|
27
|
-
.
|
|
27
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_resize_none__a11ehsf {
|
|
28
28
|
max-width: 100%;
|
|
29
29
|
overflow: visible;
|
|
30
30
|
}
|
|
31
|
-
.
|
|
31
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_0__a11ehsg {
|
|
32
32
|
padding-top: 0;
|
|
33
33
|
padding-bottom: 0;
|
|
34
34
|
}
|
|
35
|
-
.
|
|
35
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_1__a11ehsh {
|
|
36
36
|
min-height: var(--insideEdgeHeight__w6gg1yh);
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_2__a11ehsi {
|
|
39
39
|
height: auto;
|
|
40
40
|
}
|
|
41
|
-
.
|
|
41
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_3__a11ehsj {
|
|
42
42
|
min-height: calc(var(--oj-c-EXPERIMENTAL-DO-NOT-USE-body-md-line-height) * var(--oj-c-EXPERIMENTAL-DO-NOT-USE-body-md-font-size));
|
|
43
43
|
}
|
|
44
|
-
.
|
|
44
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_4__a11ehsk {
|
|
45
45
|
min-height: calc(var(--oj-c-EXPERIMENTAL-DO-NOT-USE-body-md-line-height) * var(--oj-c-EXPERIMENTAL-DO-NOT-USE-body-md-font-size));
|
|
46
46
|
}
|
|
47
|
-
.
|
|
47
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_5__a11ehsl {
|
|
48
48
|
min-height: calc((var(--oj-c-EXPERIMENTAL-DO-NOT-USE-body-md-line-height) + var(--insideEdgeLineHeight__kn3t7f6)) * var(--oj-c-EXPERIMENTAL-DO-NOT-USE-body-md-font-size));
|
|
49
49
|
}
|
|
50
|
-
.
|
|
50
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_6__a11ehsm {
|
|
51
51
|
min-height: calc((var(--oj-c-EXPERIMENTAL-DO-NOT-USE-body-md-line-height) + var(--insideEdgeLineHeight__kn3t7f6)) * var(--oj-c-EXPERIMENTAL-DO-NOT-USE-body-md-font-size));
|
|
52
52
|
}
|
|
53
|
-
.
|
|
53
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_7__a11ehsn {
|
|
54
54
|
min-height: var(--height__w6gg1yg);
|
|
55
55
|
}
|
|
56
|
-
.
|
|
56
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_8__a11ehso {
|
|
57
57
|
min-height: var(--height__w6gg1yg);
|
|
58
58
|
}
|
|
59
|
-
.
|
|
59
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_9__a11ehsp {
|
|
60
60
|
border-top-right-radius: 0;
|
|
61
61
|
border-bottom-right-radius: 0;
|
|
62
62
|
}
|
|
63
|
-
.
|
|
63
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_10__a11ehsq {
|
|
64
64
|
border-top-left-radius: 0;
|
|
65
65
|
border-bottom-left-radius: 0;
|
|
66
66
|
margin-left: -1px;
|
|
67
67
|
}
|
|
68
|
-
.
|
|
68
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_11__a11ehsr {
|
|
69
69
|
border-top-right-radius: 0;
|
|
70
70
|
border-bottom-right-radius: 0;
|
|
71
71
|
border-top-left-radius: 0;
|
|
72
72
|
border-bottom-left-radius: 0;
|
|
73
73
|
margin-left: -1px;
|
|
74
74
|
}
|
|
75
|
-
.
|
|
75
|
+
.ReadonlyTextFieldVariants_multiVariantStyles_compound_12__a11ehss {
|
|
76
76
|
min-height: var(--insideEdgeHeight__w6gg1yh);
|
|
77
77
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', './BaseNavigationListItem-5765a81f', './useNavigationListItem-17b77626', './Close-04d8a398', 'preact/hooks', './useHover-7964884c', './useTranslationBundle-516b1b83', './EmbeddedIconButton-bad166c7'], (function(e,t,a,i,o,s,n,r,l){"use strict";e.RemovableNavigationListItem=function({itemKey:e,label:c,badge:v,metadata:d,severity:u}){const{selection:m,currentKey:b,onRemove:g}=i.useNavigationListContext(),x=m===e,j=b===e,B=s.useCallback((()=>{g?.({value:e})}),[g,e]),{hoverProps:I,isHover:p}=n.useHover({}),L=r.useTranslationBundle("@oracle/oraclejet-preact");return t.jsx("div",{...I,children:t.jsx(a.BaseNavigationListItem,{itemKey:e,label:c,badge:v,metadata:d,severity:u,removeIcon:t.jsx("span",{"data-oj-navigationlist-item-remove-icon":!0,children:t.jsx(l.EmbeddedIconButton,{"aria-label":L.tabBarNavigationList_removeCueText(),size:"xs",onAction:B,children:(p||x||j)&&t.jsx(o.SvgClose,{})})})})})}}));
|
|
2
|
+
//# sourceMappingURL=RemovableNavigationListItem-c486140e.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemovableNavigationListItem-
|
|
1
|
+
{"version":3,"file":"RemovableNavigationListItem-c486140e.js","sources":["../../src/UNSAFE_NavigationListCommon/RemovableNavigationListItem.tsx"],"sourcesContent":["import { BaseNavigationListItem, BaseNavigationListItemProps } from './BaseNavigationListItem';\nimport { useNavigationListContext } from './useNavigationListContext';\nimport { Close } from '../UNSAFE_RedwoodIcons/Close';\nimport { EmbeddedIconButton } from '../PRIVATE_EmbeddedIconButton';\nimport { useCallback } from 'preact/hooks';\nimport { useHover } from '#hooks/UNSAFE_useHover';\nimport { useTranslationBundle } from '../hooks/UNSAFE_useTranslationBundle';\nimport type { BundleType } from '../resources/nls/bundle';\n\ntype RemovableNavigationListItemProps<K extends string | number> = Omit<\n BaseNavigationListItemProps<K>,\n 'removeIcon'\n>;\n\nexport function RemovableNavigationListItem<K extends string | number>({\n itemKey,\n label,\n badge,\n metadata,\n severity\n}: RemovableNavigationListItemProps<K>) {\n const { selection, currentKey, onRemove } = useNavigationListContext();\n const isSelected = selection === itemKey;\n const isCurrent = currentKey === itemKey;\n\n const handleRemove = useCallback(() => {\n onRemove?.({ value: itemKey as K });\n }, [onRemove, itemKey]);\n\n const { hoverProps, isHover } = useHover({});\n\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n\n //instead of specifying flex: '1 0 auto' in cssProps var\n return (\n <div {...hoverProps}>\n <BaseNavigationListItem\n itemKey={itemKey}\n label={label}\n badge={badge}\n metadata={metadata}\n severity={severity}\n removeIcon={\n <span data-oj-navigationlist-item-remove-icon={true}>\n <EmbeddedIconButton\n aria-label={translations.tabBarNavigationList_removeCueText()}\n size=\"xs\"\n onAction={handleRemove}>\n {(isHover || isSelected || isCurrent) && <Close />}\n </EmbeddedIconButton>\n </span>\n }\n />\n </div>\n );\n}\n"],"names":["itemKey","label","badge","metadata","severity","selection","currentKey","onRemove","useNavigationListContext","isSelected","isCurrent","handleRemove","useCallback","value","hoverProps","isHover","useHover","translations","useTranslationBundle","_jsx","children","jsx","BaseNavigationListItem","removeIcon","EmbeddedIconButton","tabBarNavigationList_removeCueText","size","onAction","Close","SvgClose"],"mappings":"iTAcgB,UAAuDA,QACrEA,EAAOC,MACPA,EAAKC,MACLA,EAAKC,SACLA,EAAQC,SACRA,IAEA,MAAMC,UAAEA,EAASC,WAAEA,EAAUC,SAAEA,GAAaC,EAAwBA,2BAC9DC,EAAaJ,IAAcL,EAC3BU,EAAYJ,IAAeN,EAE3BW,EAAeC,EAAAA,aAAY,KAC/BL,IAAW,CAAEM,MAAOb,GAAe,GAClC,CAACO,EAAUP,KAERc,WAAEA,EAAUC,QAAEA,GAAYC,EAAQA,SAAC,CAAE,GAErCC,EAAeC,uBAAiC,4BAGtD,OACEC,MAAA,MAAA,IAASL,EAAUM,SACjBD,EAACE,IAAAC,yBACC,CAAAtB,QAASA,EACTC,MAAOA,EACPC,MAAOA,EACPC,SAAUA,EACVC,SAAUA,EACVmB,WACEJ,yDAA+C,EAAIC,SACjDD,MAACK,EAAAA,mBACa,CAAA,aAAAP,EAAaQ,qCACzBC,KAAK,KACLC,SAAUhB,EACTS,UAACL,GAAWN,GAAcC,IAAcS,EAAAA,IAACS,EAAKC,SAAA,WAO7D"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
define(['exports', 'preact/jsx-runtime', 'preact', 'preact/compat', 'preact/hooks', './HiddenAccessible-037ef42d', './LiveRegion-8142ed0d', './TabBar-
|
|
2
|
-
//# sourceMappingURL=ReorderableTabBar-
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact', 'preact/compat', 'preact/hooks', './HiddenAccessible-037ef42d', './LiveRegion-8142ed0d', './TabBar-93811d2c', './mergeInterpolations-9ede4cf7', './flexitem-5db48325', './collectionUtils-17f5cc64', './LayerHost-e95c5f30', './useReorderableItem-4c4779f7', './ReorderableContext-6d10a1b7', './UNSAFE_ReorderableTabBar/themes/ReorderableTabBarItemStyles.css', './keys-4755c121', 'css!./DragAndDropStyles.styles.css', 'css!./ReorderableItemStyles.styles.css'], (function(e,r,t,s,o,a,l,d,n,i,c,b,y,u,f,R,m,g){"use strict";const p='[role="tab"]';function x({children:e,dragKey:t,setDragKey:s,onReorder:a,layout:l,rootRef:d}){const b=o.useRef(null),u=o.useCallback((()=>b?.current?.querySelector(p)),[]),m=o.useCallback((e=>{e.dataTransfer?.setData("text/tabbar-item-key",c.getKey(u())+"")}),[u]),{rootProps:g,isDragged:x,overlayZoneBeforeProps:h,overlayZoneAfterProps:v}=y.useReorderableItem({isDisabled:!a,dragKey:t,setDragKey:s,onReorder:a,rootRef:d,ref:b,getItem:u,setTransferData:m,itemStyles:f.styles,itemSelector:p}),j=n.mergeInterpolations([...Object.values(i.flexitemInterpolations)])({flex:"stretch"===l?"1 0 auto":"0 0 auto"});return r.jsxs("div",{...g,draggable:!!a,style:j,children:[e,!x&&R.isKeyDefined(t)&&r.jsxs(r.Fragment,{children:[r.jsx("div",{...h}),r.jsx("div",{...v})]})]})}const h=s.forwardRef((({"aria-label":e,"aria-labelledby":s,children:n,layout:i="stretch",display:c="standard",size:b="md",edge:f="top",selection:R,onSelect:m,onRemove:g,onReorder:h,testId:v},j)=>{const I=o.useRef(null),[S,D]=o.useState(void 0),K="stacked"===c?{display:c}:{display:c,size:b},{reorderProps:T,reorderContext:k,reorderInstructionsId:A,reorderStatus:B,reorderInstructions:C}=y.useReorderable({onReorder:h,rootRef:I,itemSelector:p});return r.jsxs("div",{ref:I,...T,children:[r.jsx(u.ReorderableContext.Provider,{value:k,children:r.jsx(d.TabBar,{ref:j,"aria-label":e,"aria-labelledby":s,layout:i,edge:f,selection:R,onSelect:m,onRemove:g,testId:v,...K,"aria-describedby":A,children:t.toChildArray(n).map((e=>r.jsx(x,{dragKey:S,setDragKey:D,onReorder:h,layout:i,rootRef:I,children:e})))})}),r.jsx("span",{id:A,children:r.jsx(a.HiddenAccessible,{children:C})}),r.jsx(l.LiveRegion,{children:B})]})}));e.ReorderableTabBar=h}));
|
|
2
|
+
//# sourceMappingURL=ReorderableTabBar-b92a434e.js.map
|