@oracle/oraclejet-preact 18.0.8 → 18.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/amd/BaseNavigationListItem-5765a81f.js +2 -0
- package/amd/BaseNavigationListItem-5765a81f.js.map +1 -0
- package/amd/CheckboxSet-4582f29e.js +2 -0
- package/{cjs/CheckboxSet-1bdbc419.js.map → amd/CheckboxSet-4582f29e.js.map} +1 -1
- package/amd/MaxLengthCounter-9a95922c.js +2 -0
- package/{es/MaxLengthCounter-181b4fc9.js.map → amd/MaxLengthCounter-9a95922c.js.map} +1 -1
- package/amd/NavigationList-f1b80e54.js +2 -0
- package/amd/NavigationList-f1b80e54.js.map +1 -0
- package/amd/NavigationListItem-12919fe5.js +2 -0
- package/amd/NavigationListItem-12919fe5.js.map +1 -0
- package/amd/{OverflowTabBar-339f34cf.js → OverflowTabBar-dfcce021.js} +2 -2
- package/amd/{OverflowTabBar-339f34cf.js.map → OverflowTabBar-dfcce021.js.map} +1 -1
- package/amd/OverflowTabBarItem-17b2920a.js +2 -0
- package/amd/{OverflowTabBarItem-c59db4a2.js.map → OverflowTabBarItem-17b2920a.js.map} +1 -1
- package/amd/ReadonlyTextFieldVariants.styles.css +20 -20
- package/amd/ReadonlyTextFieldVariants.styles2.css +20 -20
- package/amd/RemovableNavigationListItem-c486140e.js +2 -0
- package/amd/{RemovableNavigationListItem-e01b6693.js.map → RemovableNavigationListItem-c486140e.js.map} +1 -1
- package/amd/{ReorderableTabBar-462d357c.js → ReorderableTabBar-b92a434e.js} +2 -2
- package/amd/{ReorderableTabBar-462d357c.js.map → ReorderableTabBar-b92a434e.js.map} +1 -1
- package/amd/TabBar-93811d2c.js +2 -0
- package/amd/{TabBar-d8890a47.js.map → TabBar-93811d2c.js.map} +1 -1
- package/amd/TabBarMixed-ad59654b.js +2 -0
- package/amd/{TabBarMixed-a75796a6.js.map → TabBarMixed-ad59654b.js.map} +1 -1
- package/amd/TextArea-89b9ed65.js +2 -0
- package/{es/TextArea-7230675f.js.map → amd/TextArea-89b9ed65.js.map} +1 -1
- package/amd/TextAreaAutosize-81449e46.js +2 -0
- package/amd/{TextAreaAutosize-9cd2c1e8.js.map → TextAreaAutosize-81449e46.js.map} +1 -1
- package/amd/Theme-redwood/theme.css +165 -165
- package/amd/Theme-stable/theme.css +347 -347
- package/amd/UNSAFE_CheckboxItem.js +1 -1
- package/amd/UNSAFE_CheckboxItem.js.map +1 -1
- package/amd/UNSAFE_CheckboxSet.js +1 -1
- package/amd/UNSAFE_CheckboxSet.js.map +1 -1
- package/amd/UNSAFE_InputDateMask.js +1 -1
- package/amd/UNSAFE_InputDatePicker.js +1 -1
- package/amd/UNSAFE_InputPassword.js +1 -1
- package/amd/UNSAFE_InputSensitiveText.js +1 -1
- package/amd/UNSAFE_InputSensitiveText.js.map +1 -1
- package/amd/UNSAFE_InputText.js +1 -1
- package/amd/UNSAFE_InputTimeMask.js +1 -1
- package/amd/UNSAFE_InputTimeMask.js.map +1 -1
- package/amd/UNSAFE_LabelledLink.js +1 -1
- package/amd/UNSAFE_LabelledLink.js.map +1 -1
- package/amd/UNSAFE_NavigationList.js +1 -1
- package/amd/UNSAFE_NavigationListCommon.js +1 -1
- package/amd/UNSAFE_NumberInputText.js +1 -1
- package/amd/UNSAFE_OverflowTabBar.js +1 -1
- package/amd/UNSAFE_ReorderableTabBar.js +1 -1
- package/amd/UNSAFE_RichCheckboxSet.js +1 -1
- package/amd/UNSAFE_RichCheckboxSet.js.map +1 -1
- package/amd/UNSAFE_RichSelectionItem.js +1 -1
- package/amd/UNSAFE_RichSelectionItem.js.map +1 -1
- package/amd/UNSAFE_SelectMultiple.js +1 -1
- package/amd/UNSAFE_SelectSingle.js +1 -1
- package/amd/UNSAFE_TabBar.js +1 -1
- package/amd/UNSAFE_TabBarCommon.js +1 -1
- package/amd/UNSAFE_TabBarMixed.js +1 -1
- package/amd/UNSAFE_TextArea.js +1 -1
- package/amd/UNSAFE_TextAreaAutosize.js +1 -1
- package/amd/UNSAFE_TextField/themes/redwood/ReadonlyTextFieldTheme.js +1 -1
- package/amd/UNSAFE_TextField/themes/redwood/ReadonlyTextFieldTheme.js.map +1 -1
- package/amd/UNSAFE_TextField/themes/redwood/ReadonlyTextFieldVariants.css.js +1 -1
- package/amd/UNSAFE_TextField/themes/stable/ReadonlyTextFieldTheme.js +1 -1
- package/amd/UNSAFE_TextField/themes/stable/ReadonlyTextFieldTheme.js.map +1 -1
- package/amd/UNSAFE_TextField/themes/stable/ReadonlyTextFieldVariants.css.js +1 -1
- package/amd/UNSAFE_TextField.js +1 -1
- package/amd/useNavigationListItem-17b77626.js +2 -0
- package/amd/useNavigationListItem-17b77626.js.map +1 -0
- package/cjs/{BaseCardView-5a45e588.js → BaseCardView-ade994f5.js} +2 -2
- package/cjs/{BaseCardView-5a45e588.js.map → BaseCardView-ade994f5.js.map} +1 -1
- package/cjs/{CardFlexView-58228ce4.js → CardFlexView-6492d995.js} +2 -2
- package/cjs/{CardFlexView-58228ce4.js.map → CardFlexView-6492d995.js.map} +1 -1
- package/cjs/{CardGridView-17683602.js → CardGridView-d98aa089.js} +2 -2
- package/cjs/{CardGridView-17683602.js.map → CardGridView-d98aa089.js.map} +1 -1
- package/cjs/CheckboxSetContext-c62db26d.js +12 -0
- package/{amd/CheckboxSetContext-2e486ea8.js.map → cjs/CheckboxSetContext-c62db26d.js.map} +1 -1
- package/cjs/ExpandableList-be84ca8e.js +1 -1
- package/cjs/GroupLoadingIndicator-5940d185.js +1 -1
- package/cjs/{Indexer-b5ca1d0c.js → Indexer-72430806.js} +2 -2
- package/cjs/{Indexer-b5ca1d0c.js.map → Indexer-72430806.js.map} +1 -1
- package/cjs/{InputDatePicker-4d36637f.js → InputDatePicker-bc2c534a.js} +2 -2
- package/cjs/{InputDatePicker-4d36637f.js.map → InputDatePicker-bc2c534a.js.map} +1 -1
- package/cjs/{List-877077ab.js → List-0dc2c4c4.js} +4 -3
- package/cjs/{List-877077ab.js.map → List-0dc2c4c4.js.map} +1 -1
- package/cjs/{ListView-98983aa2.js → ListView-17b8250d.js} +2 -2
- package/cjs/{ListView-98983aa2.js.map → ListView-17b8250d.js.map} +1 -1
- package/cjs/{LoadMoreCollection-69bc038c.js → LoadMoreCollection-73112ff0.js} +2 -2
- package/cjs/{LoadMoreCollection-69bc038c.js.map → LoadMoreCollection-73112ff0.js.map} +1 -1
- package/cjs/{NavigationListItem-4c4e804d.js → NavigationListItem-7947af0e.js} +1 -14
- package/cjs/{NavigationListItem-4c4e804d.js.map → NavigationListItem-7947af0e.js.map} +1 -1
- package/cjs/{OverflowTabBar-428798a0.js → OverflowTabBar-27ad6d1f.js} +2 -2
- package/cjs/{OverflowTabBar-428798a0.js.map → OverflowTabBar-27ad6d1f.js.map} +1 -1
- package/cjs/{OverflowTabBarItem-3c7adb01.js → OverflowTabBarItem-57537ebe.js} +2 -2
- package/cjs/{OverflowTabBarItem-3c7adb01.js.map → OverflowTabBarItem-57537ebe.js.map} +1 -1
- package/cjs/PRIVATE_BaseCardView.js +3 -3
- package/cjs/PRIVATE_List.js +4 -4
- package/cjs/PRIVATE_LoadMoreCollection.js +2 -2
- package/cjs/PRIVATE_SelectCommon.js +5 -5
- package/cjs/PRIVATE_Table.js +3 -3
- package/cjs/PRIVATE_VirtualizedCollection.js +2 -2
- package/cjs/{SelectMultiple-94ab1de5.js → SelectMultiple-b1f05b9f.js} +2 -2
- package/cjs/{SelectMultiple-94ab1de5.js.map → SelectMultiple-b1f05b9f.js.map} +1 -1
- package/cjs/{SelectSingle-52c5cb94.js → SelectSingle-84b0b3eb.js} +2 -2
- package/cjs/{SelectSingle-52c5cb94.js.map → SelectSingle-84b0b3eb.js.map} +1 -1
- package/cjs/{Table-15a64988.js → Table-90fe7ad8.js} +2 -2
- package/cjs/{Table-15a64988.js.map → Table-90fe7ad8.js.map} +1 -1
- package/cjs/{TableView-37d6f731.js → TableView-3cc9d3be.js} +2 -2
- package/cjs/{TableView-37d6f731.js.map → TableView-3cc9d3be.js.map} +1 -1
- package/cjs/Theme-redwood/theme.css +128 -128
- package/cjs/Theme-stable/theme.css +197 -197
- package/cjs/UNSAFE_CardFlexView.js +4 -4
- package/cjs/UNSAFE_CardGridView.js +4 -4
- package/cjs/UNSAFE_CheckboxItem.js +30 -81
- package/cjs/UNSAFE_CheckboxItem.js.map +1 -1
- package/cjs/UNSAFE_CheckboxSet.js +44 -15
- package/cjs/UNSAFE_CheckboxSet.js.map +1 -1
- package/cjs/UNSAFE_ExpandableList.js +3 -3
- package/cjs/UNSAFE_Indexer.js +2 -2
- package/cjs/UNSAFE_InputDatePicker.js +90 -90
- package/cjs/UNSAFE_ListView.js +5 -5
- package/cjs/UNSAFE_NavigationList.js +4 -4
- package/cjs/UNSAFE_OverflowTabBar.js +3 -3
- package/cjs/UNSAFE_RichCheckboxSet.js +13 -15
- package/cjs/UNSAFE_RichCheckboxSet.js.map +1 -1
- package/cjs/UNSAFE_RichSelectionItem.js +44 -181
- package/cjs/UNSAFE_RichSelectionItem.js.map +1 -1
- package/cjs/UNSAFE_SelectMultiple.js +6 -6
- package/cjs/UNSAFE_SelectSingle.js +6 -6
- package/cjs/UNSAFE_TabBar.js +2 -2
- package/cjs/UNSAFE_TabBarCommon.js +2 -2
- package/cjs/UNSAFE_TabBarMixed.js +2 -2
- package/cjs/UNSAFE_TableView.js +4 -4
- package/cjs/UNSAFE_VirtualizedListView.js +5 -5
- package/cjs/{VirtualizedCollection-9e8c48b9.js → VirtualizedCollection-00aedb8b.js} +2 -2
- package/cjs/{VirtualizedCollection-9e8c48b9.js.map → VirtualizedCollection-00aedb8b.js.map} +1 -1
- package/cjs/{VirtualizedListView-03fa4758.js → VirtualizedListView-9bfaf4e2.js} +2 -2
- package/cjs/{VirtualizedListView-03fa4758.js.map → VirtualizedListView-9bfaf4e2.js.map} +1 -1
- package/cjs/{useSelectCommon-a0a800fd.js → useSelectCommon-5b46ac60.js} +2 -2
- package/cjs/{useSelectCommon-a0a800fd.js.map → useSelectCommon-5b46ac60.js.map} +1 -1
- package/es/{BaseCardView-229fa119.js → BaseCardView-c5a8ee6a.js} +2 -2
- package/es/{BaseCardView-229fa119.js.map → BaseCardView-c5a8ee6a.js.map} +1 -1
- package/es/{CardFlexView-3ef6bf4d.js → CardFlexView-529906e0.js} +2 -2
- package/es/{CardFlexView-3ef6bf4d.js.map → CardFlexView-529906e0.js.map} +1 -1
- package/es/{CardGridView-e15226c9.js → CardGridView-ec18c929.js} +2 -2
- package/es/{CardGridView-e15226c9.js.map → CardGridView-ec18c929.js.map} +1 -1
- package/es/ExpandableList-478db30a.js +1 -1
- package/es/GroupLoadingIndicator-63035d08.js +1 -1
- package/es/{Indexer-eb00ba0b.js → Indexer-ba2c7593.js} +2 -2
- package/es/{Indexer-eb00ba0b.js.map → Indexer-ba2c7593.js.map} +1 -1
- package/es/LabelledLinkVariants.styles.css +3 -3
- package/es/LabelledLinkVariants.styles2.css +3 -3
- package/es/{List-e6886091.js → List-97b7be70.js} +4 -3
- package/es/{List-e6886091.js.map → List-97b7be70.js.map} +1 -1
- package/es/{ListView-137e31fd.js → ListView-936d8a4f.js} +2 -2
- package/es/{ListView-137e31fd.js.map → ListView-936d8a4f.js.map} +1 -1
- package/es/{LoadMoreCollection-7df1be36.js → LoadMoreCollection-95a49d2a.js} +2 -2
- package/es/{LoadMoreCollection-7df1be36.js.map → LoadMoreCollection-95a49d2a.js.map} +1 -1
- package/es/MeterCircleVariants.styles.css +8 -8
- package/es/MeterCircleVariants.styles2.css +8 -8
- package/es/PRIVATE_BaseCardView.js +3 -3
- package/es/PRIVATE_List.js +4 -4
- package/es/PRIVATE_LoadMoreCollection.js +2 -2
- package/es/PRIVATE_SelectCommon.js +5 -5
- package/es/PRIVATE_Table.js +3 -3
- package/es/PRIVATE_VirtualizedCollection.js +2 -2
- package/es/{SelectMultiple-488a49d1.js → SelectMultiple-ad8fc99a.js} +2 -2
- package/es/{SelectMultiple-488a49d1.js.map → SelectMultiple-ad8fc99a.js.map} +1 -1
- package/es/{SelectSingle-e8b9a33a.js → SelectSingle-abaf271c.js} +2 -2
- package/es/{SelectSingle-e8b9a33a.js.map → SelectSingle-abaf271c.js.map} +1 -1
- package/es/SplitMenuButtonTheme.styles.css +4 -4
- package/es/SplitMenuButtonTheme.styles2.css +4 -4
- package/es/TabBarItemVariants.styles.css +3 -3
- package/es/TabBarItemVariants.styles2.css +3 -3
- package/es/{Table-3cfb9443.js → Table-1ba124ec.js} +2 -2
- package/es/{Table-3cfb9443.js.map → Table-1ba124ec.js.map} +1 -1
- package/es/{TableView-fd5104cd.js → TableView-20223ba6.js} +2 -2
- package/es/{TableView-fd5104cd.js.map → TableView-20223ba6.js.map} +1 -1
- package/es/{TextArea-7230675f.js → TextArea-64b4e972.js} +25 -8
- package/{amd/TextArea-a7a3d82f.js.map → es/TextArea-64b4e972.js.map} +1 -1
- package/es/{TextAreaAutosize-0d293016.js → TextAreaAutosize-4e0f60ef.js} +2 -2
- package/es/{TextAreaAutosize-0d293016.js.map → TextAreaAutosize-4e0f60ef.js.map} +1 -1
- package/es/Theme-redwood/theme.css +634 -634
- package/es/Theme-stable/theme.css +446 -446
- package/es/UNSAFE_ButtonLayout/tests/ButtonLayout.spec.js +1 -1
- package/es/UNSAFE_CardFlexView.js +4 -4
- package/es/UNSAFE_CardGridView.js +4 -4
- package/es/UNSAFE_ExpandableList.js +3 -3
- package/es/UNSAFE_Indexer.js +2 -2
- package/es/UNSAFE_LabelledLink/themes/redwood/LabelledLinkTheme.js +1 -1
- package/es/UNSAFE_LabelledLink/themes/redwood/LabelledLinkVariants.css.js +1 -1
- package/es/UNSAFE_LabelledLink/themes/stable/LabelledLinkTheme.js +1 -1
- package/es/UNSAFE_LabelledLink/themes/stable/LabelledLinkVariants.css.js +1 -1
- package/es/UNSAFE_LabelledLink.js +1 -1
- package/es/UNSAFE_ListView.js +5 -5
- package/es/UNSAFE_MeterCircle/themes/redwood/MeterCircleTheme.js +1 -1
- package/es/UNSAFE_MeterCircle/themes/redwood/MeterCircleVariants.css.js +1 -1
- package/es/UNSAFE_MeterCircle/themes/stable/MeterCircleTheme.js +1 -1
- package/es/UNSAFE_MeterCircle/themes/stable/MeterCircleVariants.css.js +1 -1
- package/es/UNSAFE_MeterCircle.js +1 -1
- package/es/UNSAFE_OverflowTabBar.js +1 -1
- package/es/UNSAFE_ReorderableTabBar.js +1 -1
- package/es/UNSAFE_SelectMultiple.js +6 -6
- package/es/UNSAFE_SelectSingle.js +6 -6
- package/es/UNSAFE_SplitMenuButton/themes/redwood/SplitMenuButtonTheme.css.js +1 -1
- package/es/UNSAFE_SplitMenuButton/themes/stable/SplitMenuButtonTheme.css.js +1 -1
- package/es/UNSAFE_SplitMenuButton.js +1 -1
- package/es/UNSAFE_TabBar.js +1 -1
- package/es/UNSAFE_TabBarCommon/themes/redwood/TabBarItemTheme.js +1 -1
- package/es/UNSAFE_TabBarCommon/themes/redwood/TabBarItemVariants.css.js +1 -1
- package/es/UNSAFE_TabBarCommon/themes/stable/TabBarItemTheme.js +1 -1
- package/es/UNSAFE_TabBarCommon/themes/stable/TabBarItemVariants.css.js +1 -1
- package/es/UNSAFE_TabBarCommon.js +1 -1
- package/es/UNSAFE_TabBarMixed.js +1 -1
- package/es/UNSAFE_TableView.js +4 -4
- package/es/UNSAFE_TextArea.js +2 -3
- package/es/UNSAFE_TextArea.js.map +1 -1
- package/es/UNSAFE_TextAreaAutosize.js +3 -3
- package/es/UNSAFE_Toolbar/tests/Toolbar.spec.js +1 -1
- package/es/UNSAFE_VirtualizedListView.js +5 -5
- package/es/{VirtualizedCollection-f048fbb8.js → VirtualizedCollection-e73890a1.js} +2 -2
- package/es/{VirtualizedCollection-f048fbb8.js.map → VirtualizedCollection-e73890a1.js.map} +1 -1
- package/es/{VirtualizedListView-0532e46c.js → VirtualizedListView-3ef40bde.js} +2 -2
- package/es/{VirtualizedListView-0532e46c.js.map → VirtualizedListView-3ef40bde.js.map} +1 -1
- package/es/{useSelectCommon-af8e715e.js → useSelectCommon-1dafa6f9.js} +2 -2
- package/es/{useSelectCommon-af8e715e.js.map → useSelectCommon-1dafa6f9.js.map} +1 -1
- package/package.json +2 -2
- package/amd/BaseNavigationListItem-fe9cb691.js +0 -2
- package/amd/BaseNavigationListItem-fe9cb691.js.map +0 -1
- package/amd/CheckboxSetContext-2e486ea8.js +0 -2
- package/amd/NavigationListItem-044a79fd.js +0 -2
- package/amd/NavigationListItem-044a79fd.js.map +0 -1
- package/amd/OverflowTabBarItem-c59db4a2.js +0 -2
- package/amd/RemovableNavigationListItem-e01b6693.js +0 -2
- package/amd/TabBar-d8890a47.js +0 -2
- package/amd/TabBarMixed-a75796a6.js +0 -2
- package/amd/TextArea-a7a3d82f.js +0 -2
- package/amd/TextAreaAutosize-9cd2c1e8.js +0 -2
- package/cjs/CheckboxSet-1bdbc419.js +0 -53
- package/es/MaxLengthCounter-181b4fc9.js +0 -25
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReorderableTabBar-
|
|
1
|
+
{"version":3,"file":"ReorderableTabBar-b92a434e.js","sources":["../../src/UNSAFE_ReorderableTabBar/ReorderableTabBarItem.tsx","../../src/UNSAFE_ReorderableTabBar/ReorderableTabBar.tsx"],"sourcesContent":["import { useRef, useCallback } from 'preact/hooks';\nimport { mergeInterpolations } from '../utils/UNSAFE_mergeInterpolations';\nimport { flexitemInterpolations } from '../utils/UNSAFE_interpolations/flexitem';\nimport type { FlexitemProps } from '../utils/UNSAFE_interpolations/flexitem';\nimport { getKey } from '../utils/PRIVATE_collectionUtils';\nimport { useReorderableItem } from '../hooks/PRIVATE_useReorderable';\nimport { ReorderableItemProps } from '../UNSAFE_Collection/Reorderable.types';\nimport { styles } from './themes/ReorderableTabBarItemStyles.css';\nimport { isKeyDefined } from '../utils/UNSAFE_keys';\n\nexport const ITEM_SELECTOR = '[role=\"tab\"]';\n\ntype ReorderableTabBarItem<K extends string | number> = ReorderableItemProps<K> & {\n layout: 'stretch' | 'condense' | undefined;\n};\n\n/**\n * A private item that will be used by ReorderableTabBar, location TBD (could be moved to PRIVATE_TabBar)\n */\nexport function ReorderableTabBarItem<K extends string | number>({\n children,\n dragKey,\n setDragKey,\n onReorder,\n layout,\n rootRef\n}: ReorderableTabBarItem<K>) {\n const tabBarItemRef = useRef<HTMLDivElement | null>(null);\n const getItem = useCallback(\n () => tabBarItemRef?.current?.querySelector(ITEM_SELECTOR) as HTMLElement,\n []\n );\n const setTransferData = useCallback(\n (event: DragEvent) => {\n event.dataTransfer?.setData('text/tabbar-item-key', getKey(getItem()) + '');\n },\n [getItem]\n );\n\n const { rootProps, isDragged, overlayZoneBeforeProps, overlayZoneAfterProps } =\n useReorderableItem({\n isDisabled: onReorder ? false : true,\n dragKey,\n setDragKey,\n onReorder,\n rootRef,\n ref: tabBarItemRef,\n getItem,\n setTransferData,\n itemStyles: styles,\n itemSelector: ITEM_SELECTOR\n });\n\n //instead of specifying flex: '1 0 auto' in style\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 return (\n <div {...rootProps} draggable={onReorder ? true : false} style={flexDimensions}>\n {children}\n {!isDragged && isKeyDefined(dragKey) && (\n <>\n <div {...overlayZoneBeforeProps}></div>\n <div {...overlayZoneAfterProps}></div>\n </>\n )}\n </div>\n );\n}\n","import { toChildArray, Ref } from 'preact';\nimport { forwardRef } from 'preact/compat';\nimport { useRef, useState } from 'preact/hooks';\nimport { HiddenAccessible } from '../UNSAFE_HiddenAccessible';\nimport { LiveRegion } from '../UNSAFE_LiveRegion';\nimport { TestIdProps } from '../hooks/UNSAFE_useTestId';\nimport { TabBar, TabBarProps } from '../UNSAFE_TabBar';\nimport { ReorderableTabBarItem, ITEM_SELECTOR } from './ReorderableTabBarItem';\nimport { ReorderableContext, useReorderable } from '../hooks/PRIVATE_useReorderable';\nimport { ReorderProps } from '../UNSAFE_Collection/Reorderable.types';\n\nexport type ReorderableTabBarProps<K extends string | number> = Omit<\n TabBarProps<K>,\n 'aria-describedby'\n> &\n ReorderProps<K> &\n TestIdProps;\n\n/**\n * A component that allows reordering of tabs within a TabBar.\n */\nexport const ReorderableTabBar = forwardRef(\n <K extends string | number>(\n {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n children,\n layout = 'stretch',\n display = 'standard',\n size = 'md',\n edge = 'top',\n selection,\n onSelect,\n onRemove,\n onReorder,\n testId\n }: ReorderableTabBarProps<K>,\n ref: Ref<HTMLDivElement>\n ) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const [dragKey, setDragKey] = useState<K | undefined>(undefined);\n\n const displayStackProps = {\n display: display\n };\n const displayNonStackProps = {\n display: display,\n size: size\n };\n const displayProps = display === 'stacked' ? displayStackProps : displayNonStackProps;\n\n const {\n reorderProps,\n reorderContext,\n reorderInstructionsId,\n reorderStatus,\n reorderInstructions\n } = useReorderable({\n onReorder,\n rootRef,\n itemSelector: ITEM_SELECTOR\n });\n\n return (\n <div ref={rootRef} {...reorderProps}>\n <ReorderableContext.Provider value={reorderContext}>\n <TabBar\n ref={ref}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n layout={layout}\n edge={edge}\n selection={selection}\n onSelect={onSelect}\n onRemove={onRemove}\n testId={testId}\n {...displayProps}\n aria-describedby={reorderInstructionsId}>\n {toChildArray(children).map((child) => {\n return (\n <ReorderableTabBarItem\n dragKey={dragKey}\n setDragKey={setDragKey}\n onReorder={onReorder}\n layout={layout}\n rootRef={rootRef}>\n {child}\n </ReorderableTabBarItem>\n );\n })}\n </TabBar>\n </ReorderableContext.Provider>\n <span id={reorderInstructionsId}>\n <HiddenAccessible>{reorderInstructions}</HiddenAccessible>\n </span>\n <LiveRegion>{reorderStatus}</LiveRegion>\n </div>\n );\n }\n);\n"],"names":["ITEM_SELECTOR","ReorderableTabBarItem","children","dragKey","setDragKey","onReorder","layout","rootRef","tabBarItemRef","useRef","getItem","useCallback","current","querySelector","setTransferData","event","dataTransfer","setData","getKey","rootProps","isDragged","overlayZoneBeforeProps","overlayZoneAfterProps","useReorderableItem","isDisabled","ref","itemStyles","styles","itemSelector","flexDimensions","mergeInterpolations","Object","values","flexitemInterpolations","styleInterpolations","flex","_jsxs","draggable","style","isKeyDefined","jsxs","_Fragment","Fragment","_jsx","ReorderableTabBar","forwardRef","ariaLabel","ariaLabelledby","display","size","edge","selection","onSelect","onRemove","testId","useState","undefined","displayProps","reorderProps","reorderContext","reorderInstructionsId","reorderStatus","reorderInstructions","useReorderable","jsx","ReorderableContext","Provider","value","TabBar","toChildArray","map","child","id","HiddenAccessible","LiveRegion"],"mappings":"6hBAUO,MAAMA,EAAgB,eASb,SAAAC,GAAiDC,SAC/DA,EAAQC,QACRA,EAAOC,WACPA,EAAUC,UACVA,EAASC,OACTA,EAAMC,QACNA,IAEA,MAAMC,EAAgBC,SAA8B,MAC9CC,EAAUC,EAAWA,aACzB,IAAMH,GAAeI,SAASC,cAAcb,IAC5C,IAEIc,EAAkBH,eACrBI,IACCA,EAAMC,cAAcC,QAAQ,uBAAwBC,EAAMA,OAACR,KAAa,GAAG,GAE7E,CAACA,KAGGS,UAAEA,EAASC,UAAEA,EAASC,uBAAEA,EAAsBC,sBAAEA,GACpDC,EAAAA,mBAAmB,CACjBC,YAAYnB,EACZF,UACAC,aACAC,YACAE,UACAkB,IAAKjB,EACLE,UACAI,kBACAY,WAAYC,EAAMA,OAClBC,aAAc5B,IAOZ6B,EAHsBC,EAAAA,oBAAmC,IAC1DC,OAAOC,OAAOC,2BAEIC,CAAoB,CACzCC,KAAiB,YAAX7B,EAAuB,WAAa,aAG5C,OACE8B,EAAAA,KAAS,MAAA,IAAAjB,EAAWkB,YAAWhC,EAA0BiC,MAAOT,EAC7D3B,SAAA,CAAAA,GACCkB,GAAamB,EAAYA,aAACpC,IAC1BiC,EACEI,KAAAC,EAAAC,SAAA,CAAAxC,SAAA,CAAAyC,EAAAA,IAAA,MAAA,IAAStB,IACTsB,gBAASrB,SAKnB,CCnDa,MAAAsB,EAAoBC,EAAUA,YACzC,EAEI,aAAcC,EACd,kBAAmBC,EACnB7C,WACAI,SAAS,UACT0C,UAAU,WACVC,OAAO,KACPC,OAAO,MACPC,YACAC,WACAC,WACAhD,YACAiD,UAEF7B,KAEA,MAAMlB,EAAUE,SAAuB,OAChCN,EAASC,GAAcmD,EAAQA,cAAgBC,GAShDC,EAA2B,YAAZT,EAPK,CACxBA,QAASA,GAEkB,CAC3BA,QAASA,EACTC,KAAMA,IAIFS,aACJA,EAAYC,eACZA,EAAcC,sBACdA,EAAqBC,cACrBA,EAAaC,oBACbA,GACEC,iBAAe,CACjB1D,YACAE,UACAqB,aAAc5B,IAGhB,OACEoC,EAAAI,KAAA,MAAA,CAAKf,IAAKlB,KAAamD,EAAYxD,SAAA,CACjCyC,EAACqB,IAAAC,qBAAmBC,UAASC,MAAOR,EAAczD,SAChDyC,MAACyB,EAAAA,OACC,CAAA3C,IAAKA,EAAG,aACIqB,EAAS,kBACJC,EACjBzC,OAAQA,EACR4C,KAAMA,EACNC,UAAWA,EACXC,SAAUA,EACVC,SAAUA,EACVC,OAAQA,KACJG,EAAY,mBACEG,EAAqB1D,SACtCmE,EAAYA,aAACnE,GAAUoE,KAAKC,GAEzB5B,EAAAA,IAAC1C,EACC,CAAAE,QAASA,EACTC,WAAYA,EACZC,UAAWA,EACXC,OAAQA,EACRC,QAASA,EACRL,SAAAqE,UAMX5B,cAAM6B,GAAIZ,EAAqB1D,SAC7ByC,EAAAA,IAAC8B,EAAgBA,2BAAEX,MAErBnB,MAAC+B,EAAAA,qBAAYb,MAEf"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact/hooks', './LayerHost-e95c5f30', 'preact/compat', './UNSAFE_Text/themes/TextStyles.css', './Flex-56ecdf4c', './useTabBarContext-15a23bb6', './flexitem-5db48325', './dimensions-60420dbb', './boxalignment-905057dc', './logger-0f873e29', 'css!./TabBarItemStyles.styles.css', 'module', './UNSAFE_TabBarCommon/themes/redwood/TabBarItemVariants.css', './ConveyorBeltContext-d8653090', './VisBusyStateContext-63467849', 'preact', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-69ce0a2d', 'css!./IconStyle.styles.css', './NavigationList-f1b80e54', './useNavigationListItem-17b77626', './UNSAFE_NavigationList/themes/NavigationListItemStyles.css', 'module', './UNSAFE_NavigationList/themes/redwood/NavigationListItemVariants.css', './Floating-1ec5ec2a', 'css!./LayerStyles.styles.css', './keyboardUtils-fbb389f8', './tabbableUtils-85aa6918', './CollectionInteractionContext-0b4ed98b', 'css!./dropdownStyles.styles.css', './Sheet-46782f99', 'css!./OverflowTabBarItemStyles.styles.css', './TabBarLayout-685ac295', './UNSAFE_TabBar/themes/TabBarStyles.css', './useTabBar-2c4573fe', './Menu-5d447084', './MenuItem-87cd59b8', './SelectMenuGroupContext-67f24a8f', './UNSAFE_Separator/themes/SeparatorStyles.css', 'css!./MenuSeparatorStyles.styles.css', 'module', './UNSAFE_Menu/themes/redwood/MenuSeparatorVariants.css'], (function(e,t,s,a,o,n,r,i,l,c,d,b,m,u,y,S,x,h,T,p,B,f,C,g,N,F,M,v,U,L,A,E,_,w,I,j,R,V,k,P,z,O,G,H,q,D){"use strict";function J({contextMenuConfig:e,contextMenuContext:s,...a}){const o=e.accessibleLabel;return null==e.itemsRenderer(s)?null:t.jsx(t.Fragment,{children:t.jsx(P.Menu,{...a,...o&&{"aria-label":o},children:a.isOpen&&e.itemsRenderer(s)})})}const K=o.forwardRef((({children:e,layout:s="stretch",display:a="standard",size:o="md",edge:n="top",selection:r,onSelect:l,onRemove:c,"aria-describedby":d,"aria-label":b,"aria-labelledby":m,contextMenuConfig:u},y)=>{const S=y,{rootProps:x,tabBarContext:h,menuProps:T,contextMenuContext:p}=k.useTabBar({class:V.styles.tabBarBase,edge:n,onRemove:c,onSelect:l,ref:S,selection:r,size:o,children:e,contextMenuConfig:u});return t.jsxs(t.Fragment,{children:[t.jsx(i.TabBarContext.Provider,{value:h,children:t.jsx("div",{...x,"aria-label":b,"aria-labelledby":m,"aria-describedby":d,children:t.jsx(R.TabBarLayout,{layout:s,display:a,children:e})})}),u&&t.jsx(J,{...T,contextMenuConfig:u,contextMenuContext:p})]})}));e.TabBar=K}));
|
|
2
|
+
//# sourceMappingURL=TabBar-93811d2c.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBar-
|
|
1
|
+
{"version":3,"file":"TabBar-93811d2c.js","sources":["../../src/UNSAFE_TabBar/TabBarContextMenu.tsx","../../src/UNSAFE_TabBar/TabBar.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { ComponentProps } from 'preact';\nimport { Menu } from '../UNSAFE_Menu';\nimport { TabBarContextMenuConfig, TabBarItemContext } from '#UNSAFE_TabBarCommon';\n\nexport type Props<K extends string | number> = Omit<ComponentProps<typeof Menu>, 'children'> & {\n contextMenuConfig: TabBarContextMenuConfig<K>;\n} & { contextMenuContext: TabBarItemContext<K> };\n\n/**\n * The internal component used to render a custom context menu\n */\nexport function TabBarContextMenu<K extends string | number>({\n contextMenuConfig,\n contextMenuContext,\n ...menuProps\n}: Props<K>) {\n const accessibleLabel = contextMenuConfig.accessibleLabel;\n\n const menuItems = contextMenuConfig.itemsRenderer(contextMenuContext);\n if (menuItems == null) {\n return null;\n }\n return (\n <>\n <Menu\n {...menuProps}\n {...(accessibleLabel && {\n 'aria-label': accessibleLabel\n })}>\n {menuProps.isOpen && contextMenuConfig.itemsRenderer(contextMenuContext)}\n </Menu>\n </>\n );\n}\n","import type { ComponentChildren, Ref, RefObject } from 'preact';\nimport { TabBarContext, TabBarLayout, TabBarContextMenuConfig } from '../UNSAFE_TabBarCommon';\nimport { styles } from './themes/TabBarStyles.css';\nimport { TestIdProps } from '../hooks/UNSAFE_useTestId';\nimport { useTabBar } from '../hooks/PRIVATE_useTabBar';\nimport { forwardRef } from 'preact/compat';\nimport { TabBarContextMenu } from './TabBarContextMenu';\nexport {\n TabBarItem,\n RemovableTabBarItem,\n OverflowTabBarItem,\n TabBarContext,\n useTabBarContext,\n TabBarLayout,\n useProgressiveTruncation,\n TabBarLinkItem\n} from '../UNSAFE_TabBarCommon';\n\n/**\n * type for payload of current key change event handler\n */\nexport type CurrentKeyDetail<K> = {\n value: K;\n};\n\n/**\n * type for payload of selection change event handler\n */\ntype SelectionDetail<K> = {\n value: K;\n};\n\n/**\n * type for payload of remove event handler\n */\ntype RemoveDetail<K> = {\n value: K;\n};\n\ntype DisplayProps =\n | {\n /**\n * Controls the content layout of the TabBarItem: 'standard' lays out the contents horizontally,\n *'icons' hides the label,\n */\n display?: 'standard' | 'icons';\n /**\n * The size indicates how tall the TabBarItem is rendered.\n * Note: It is not possible to specify 'size' when 'display=\"stacked\".\n */\n size?: 'md' | 'lg';\n }\n | {\n /**\n *'stacked' stacks the icon on top of the label.\n * Note: It is not possible to specify 'size' when 'display=\"stacked\".\n */\n display?: 'stacked';\n size?: 'never';\n };\n\nexport type TabBarProps<K extends string | number> = DisplayProps & {\n /**\n * A set of TabBarItem(s) that TabBar will hold\n */\n children: ComponentChildren;\n /**\n * Whether to stretch the tab bar items to occupy available space or to condense items\n */\n layout?: 'stretch' | 'condense';\n /**\n * The position of the TabBar. Valid Values: top and bottom.\n * 'top' is used when TabBar is placed on top of content section and the selection\n * indicator would be placed below the TabBarItem.\n * 'bottom' is used when TabBar is placed on bottom of content section and the selection\n * indicator would be placed above the TabBarItem.\n */\n edge?: 'top' | 'bottom';\n /**\n * Key of the selected item.\n */\n selection?: K;\n /**\n * Callback function to handle when user selects a tab.\n * The callback is also invoked when a user selects a tab that is already selected.\n */\n onSelect?: <K extends string | number>(detail: SelectionDetail<K>) => void;\n /**\n * Callback function to handle remove\n */\n onRemove?: <K extends string | number>(detail: RemoveDetail<K>) => void;\n /**\n * Accepts the ID of an element that provides instructions for interaction with the TabBar.\n */\n 'aria-describedby'?: string;\n /**\n * An aria-label which defines a string value that labels this TabBar.\n * Either aria-label or aria-labelledby should be specified in order to make TabBar accessible.\n */\n 'aria-label'?: string;\n\n /**\n * An aria-labelledby which identifies the element(s) that labels this TabBar.\n * Either aria-label or aria-labelledby should be specified in order to make TabBar accessible.\n */\n 'aria-labelledby'?: string;\n\n /**\n * Configuration used to specify a context menu.\n */\n contextMenuConfig?: TabBarContextMenuConfig<K>;\n};\n/**\n * A tab bar allows navigation between different content sections.\n */\nexport const TabBar = forwardRef(\n <K extends string | number>(\n {\n children,\n layout = 'stretch',\n display = 'standard',\n size = 'md',\n edge = 'top',\n selection,\n onSelect,\n onRemove,\n 'aria-describedby': ariaDescribedBy,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n contextMenuConfig\n }: TabBarProps<K> & TestIdProps,\n ref?: Ref<HTMLDivElement>\n ) => {\n const rootRef = ref as RefObject<HTMLDivElement>;\n\n const { rootProps, tabBarContext, menuProps, contextMenuContext } = useTabBar({\n class: styles.tabBarBase,\n edge: edge,\n onRemove,\n onSelect,\n ref: rootRef,\n selection,\n size,\n children,\n contextMenuConfig\n });\n\n return (\n <>\n <TabBarContext.Provider value={tabBarContext}>\n <div\n {...rootProps}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedBy}>\n <TabBarLayout layout={layout} display={display}>\n {children}\n </TabBarLayout>\n </div>\n </TabBarContext.Provider>\n {contextMenuConfig && (\n <TabBarContextMenu\n {...menuProps}\n contextMenuConfig={contextMenuConfig}\n contextMenuContext={contextMenuContext!}\n />\n )}\n </>\n );\n }\n);\n"],"names":["TabBarContextMenu","contextMenuConfig","contextMenuContext","menuProps","accessibleLabel","itemsRenderer","_jsx","Menu","children","isOpen","TabBar","forwardRef","layout","display","size","edge","selection","onSelect","onRemove","ariaDescribedBy","ariaLabel","ariaLabelledby","ref","rootRef","rootProps","tabBarContext","useTabBar","class","styles","tabBarBase","_jsxs","jsxs","_Fragment","TabBarContext","Provider","value","jsx","TabBarLayout"],"mappings":"itDAkBM,SAAUA,GAA6CC,kBAC3DA,EAAiBC,mBACjBA,KACGC,IAEH,MAAMC,EAAkBH,EAAkBG,gBAG1C,OAAiB,MADCH,EAAkBI,cAAcH,GAEzC,KAGPI,2BACEA,EAAAA,IAACC,EAAAA,SACKJ,KACCC,GAAmB,CACtB,aAAcA,GAEfI,SAAAL,EAAUM,QAAUR,EAAkBI,cAAcH,MAI7D,CC2Ea,MAAAQ,EAASC,EAAUA,YAC9B,EAEIH,WACAI,SAAS,UACTC,UAAU,WACVC,OAAO,KACPC,OAAO,MACPC,YACAC,WACAC,WACA,mBAAoBC,EACpB,aAAcC,EACd,kBAAmBC,EACnBpB,qBAEFqB,KAEA,MAAMC,EAAUD,GAEVE,UAAEA,EAASC,cAAEA,EAAatB,UAAEA,EAASD,mBAAEA,GAAuBwB,EAAAA,UAAU,CAC5EC,MAAOC,EAAMA,OAACC,WACdd,KAAMA,EACNG,WACAD,WACAK,IAAKC,EACLP,YACAF,OACAN,WACAP,sBAGF,OACE6B,EACEC,KAAAC,WAAA,CAAAxB,SAAA,CAAAF,MAAC2B,EAAAA,cAAcC,SAAS,CAAAC,MAAOV,EAC7BjB,SAAAF,EAAA8B,IAAA,MAAA,IACMZ,EACQ,aAAAJ,EACK,kBAAAC,EACC,mBAAAF,EAClBX,SAAAF,EAAAA,IAAC+B,EAAAA,aAAY,CAACzB,OAAQA,EAAQC,QAASA,EACpCL,SAAAA,QAINP,GACCK,EAAA8B,IAACpC,EAAiB,IACZG,EACJF,kBAAmBA,EACnBC,mBAAoBA,MAI1B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact/hooks', 'preact/compat', './LayerHost-e95c5f30', './UNSAFE_Text/themes/TextStyles.css', './Flex-56ecdf4c', './useTabBarContext-15a23bb6', './flexitem-5db48325', './dimensions-60420dbb', './boxalignment-905057dc', './logger-0f873e29', 'css!./TabBarItemStyles.styles.css', 'module', './UNSAFE_TabBarCommon/themes/redwood/TabBarItemVariants.css', './ConveyorBeltContext-d8653090', './VisBusyStateContext-63467849', 'preact', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-69ce0a2d', 'css!./IconStyle.styles.css', './NavigationList-f1b80e54', './useNavigationListItem-17b77626', './UNSAFE_NavigationList/themes/NavigationListItemStyles.css', 'module', './UNSAFE_NavigationList/themes/redwood/NavigationListItemVariants.css', './Floating-1ec5ec2a', 'css!./LayerStyles.styles.css', './keyboardUtils-fbb389f8', './tabbableUtils-85aa6918', './CollectionInteractionContext-0b4ed98b', 'css!./dropdownStyles.styles.css', './Sheet-46782f99', 'css!./OverflowTabBarItemStyles.styles.css', './UNSAFE_TabBarMixed/themes/TabBarMixedStyles.css', './useTabBar-2c4573fe'], (function(e,t,s,a,o,r,i,l,n,c,b,d,m,y,u,T,S,B,h,f,x,v,N,p,g,C,U,F,I,L,w,A,E,_,k,R,V,j){"use strict";const M=a.forwardRef(((e,o)=>{const{children:r,onRemove:i,onSelect:n,selection:c,size:b,"aria-label":d,"aria-labelledby":m}=e,y=s.useRef(null),{rootProps:u,tabBarContext:T}=(S={class:V.styles.tabBarBase,edge:"bottom",onRemove:i,onSelect:n,ref:y,selection:c,size:b,children:r},j.useTabBar(S));var S;return a.useImperativeHandle(o,(()=>({focus:()=>{y.current&&y.current.focus()},blur:()=>{y.current&&y.current.blur()}}))),t.jsx(l.TabBarContext.Provider,{value:T,children:t.jsx("div",{"aria-label":d,"aria-labelledby":m,...u,children:r})})}));e.TabBarMixed=M}));
|
|
2
|
+
//# sourceMappingURL=TabBarMixed-ad59654b.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBarMixed-
|
|
1
|
+
{"version":3,"file":"TabBarMixed-ad59654b.js","sources":["../../src/UNSAFE_TabBarMixed/TabBarMixed.tsx","../../src/UNSAFE_TabBarMixed/useTabBarMixed.ts"],"sourcesContent":["import type { ComponentChildren } from 'preact';\nimport { useRef } from 'preact/hooks';\nimport { Ref } from 'preact';\nimport { forwardRef, useImperativeHandle } from 'preact/compat';\nimport { TabBarContext } from '../UNSAFE_TabBarCommon';\nimport { styles } from './themes/TabBarMixedStyles.css';\nimport { useTabBarMixed as useTabBar } from './useTabBarMixed';\n\ntype UseTabBarOptions = Parameters<typeof useTabBar>[0];\n\n/**\n * Component props expected to be pased to **TabBarMixed**.\n *\n * @see {@link TabBarMixed}\n */\ntype TabBarMixedProps<K extends string | number> = {\n /**\n * Component children that will be rendered within the **TabBarMixed**\n * root element.\n *\n * It is expected that **TabBarLayout** and **ConveyorBelt** elements are\n * provided. The same **TabBarItem**, **RemovableTabBarItem**,\n * and **OverflowTabBarItem** elements should also be used.\n */\n children?: ComponentChildren;\n /**\n * Callback fired when a tab item is removed.\n */\n onRemove?: UseTabBarOptions['onRemove'];\n /**\n * Callback fired when a tab item is selected.\n */\n onSelect?: UseTabBarOptions['onSelect'];\n /**\n * The item key of the selected tab item.\n */\n selection?: K;\n /**\n * The height of the the tab bar.\n *\n * @default \"md\"\n */\n size?: UseTabBarOptions['size'];\n /**\n * An aria-label which defines a string value that labels this TabBarMixed.\n * Either aria-label or aria-labelledby should be specified in order to make TabBarMixed accessible.\n */\n 'aria-label'?: string;\n\n /**\n * An aria-labelledby which identifies the element(s) that labels this TabBarMixed.\n * Either aria-label or aria-labelledby should be specified in order to make TabBarMixed accessible.\n */\n 'aria-labelledby'?: string;\n};\n\nexport type FocusableHandle = {\n focus: () => void;\n blur: () => void;\n};\n\n/**\n * A navigation component that enables horizontal navigation between distinct content with a mixture of static and dynamic tabs.\n *\n * @param {TabBarMixedProps} props TabBarMixed component props.\n * @returns {JSX.Element} TabBarMixed component element.\n */\nexport const TabBarMixed = forwardRef(\n <K extends string | number>(\n props: TabBarMixedProps<K>,\n focusHandleRef?: Ref<FocusableHandle>\n ) => {\n const {\n children,\n onRemove,\n onSelect,\n selection,\n size,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby\n } = props;\n\n const rootRef = useRef<HTMLDivElement>(null);\n\n const { rootProps, tabBarContext } = useTabBar({\n class: styles.tabBarBase,\n edge: 'bottom',\n onRemove,\n onSelect,\n ref: rootRef,\n selection,\n size,\n children\n });\n\n //Allows to call focus on rootRef without having to expose it\n useImperativeHandle(focusHandleRef!, () => ({\n focus: () => {\n if (rootRef.current) {\n rootRef.current.focus();\n }\n },\n blur: () => {\n if (rootRef.current) {\n rootRef.current.blur();\n }\n }\n }));\n\n return (\n <TabBarContext.Provider value={tabBarContext}>\n <div aria-label={ariaLabel} aria-labelledby={ariaLabelledby} {...rootProps}>\n {children}\n </div>\n </TabBarContext.Provider>\n );\n }\n);\n","import type { ComponentProps, ContextType, RefObject } from 'preact';\nimport type { TabBarContext, TabBarLayout } from '../UNSAFE_TabBarCommon';\n\nimport { useTabBar } from '../hooks/PRIVATE_useTabBar';\n\ntype TabBarContextValue = ContextType<typeof TabBarContext>;\n\nexport type useTabBarOptions = {\n class?: string;\n display?: TabBarContextValue['display'];\n edge?: 'bottom' | 'top';\n onRemove?: TabBarContextValue['onRemove'];\n onSelect?: TabBarContextValue['onSelect'];\n ref?: RefObject<HTMLDivElement>;\n selection?: TabBarContextValue['selection'];\n size?: TabBarContextValue['size'];\n children?: ComponentProps<typeof TabBarLayout>['children'];\n};\n\n/**\n * A thin wrapper around useTabBar hook\n */\nexport function useTabBarMixed(options: useTabBarOptions) {\n return useTabBar(options);\n}\n"],"names":["TabBarMixed","forwardRef","props","focusHandleRef","children","onRemove","onSelect","selection","size","ariaLabel","ariaLabelledby","rootRef","useRef","rootProps","tabBarContext","options","class","styles","tabBarBase","edge","ref","useTabBar","useImperativeHandle","focus","current","blur","_jsx","TabBarContext","Provider","value"],"mappings":"w5CAmEa,MAAAA,EAAcC,EAAUA,YACnC,CACEC,EACAC,KAEA,MAAMC,SACJA,EAAQC,SACRA,EAAQC,SACRA,EAAQC,UACRA,EAASC,KACTA,EACA,aAAcC,EACd,kBAAmBC,GACjBR,EAEES,EAAUC,SAAuB,OAEjCC,UAAEA,EAASC,cAAEA,IC9DQC,ED8DoB,CAC7CC,MAAOC,EAAMA,OAACC,WACdC,KAAM,SACNd,WACAC,WACAc,IAAKT,EACLJ,YACAC,OACAJ,YCrEGiB,EAAAA,UAAUN,IADb,IAAyBA,EDuF3B,OAbAO,EAAmBA,oBAACnB,GAAiB,KAAO,CAC1CoB,MAAO,KACDZ,EAAQa,SACVb,EAAQa,QAAQD,OACjB,EAEHE,KAAM,KACAd,EAAQa,SACVb,EAAQa,QAAQC,MACjB,MAKHC,MAACC,EAAaA,cAACC,SAAS,CAAAC,MAAOf,EAAaV,SAC1CsB,EAAAA,wBAAiBjB,EAAS,kBAAmBC,KAAoBG,WAC9DT,KAGL"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact/compat', './FormContext-5130e198', './useFormContext-30acdd33', './FormFieldContext-3c44aaaa', 'preact/hooks', './useFocusableTextField-8b755b15', './Label-3912beb2', './keyboardUtils-fbb389f8', './TextFieldInput-ba4e508c', 'css!./ObfuscatedTextFieldInputStyles.styles.css', './ReadonlyTextFieldInput-608bddc1', './StyledTextField-b4278437', './TextField-1021f00b', './MaxLengthLiveRegion-8954fc30', './useTextField-e6877c79', './logger-0f873e29', './TabbableModeContext-a9c97640', './useId-c9578d26', './useTranslationBundle-516b1b83', 'css!./UserAssistanceStyles.styles.css', 'module', './UNSAFE_UserAssistance/themes/redwood/UserAssistanceVariants.css', './InlineUserAssistance-4656c2a6', './CompactUserAssistance-3370a318', './mergeProps-bcfa6a92', './LayerHost-e95c5f30', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-69ce0a2d', 'preact', 'css!./IconStyle.styles.css', './Popup-d51bf3f4', 'css!./LabelStyles.styles.css', 'module', './UNSAFE_Label/themes/redwood/LabelVariants.css', './InputGroupContext-372087af', './HiddenAccessible-037ef42d', 'module', './UNSAFE_Popup/themes/redwood/PopupVariants.css', './useLengthFilter-ed8959a4', './MaxLengthCounter-9a95922c', './useCurrentValueReducer-faded381', './useSelectableTextField-900d2860'], (function(e,s,t,a,n,i,o,l,r,d,c,u,m,p,x,b,h,F,f,y,g,A,L,v,C,T,R,S,I,U,E,j,w,P,_,k,D,V,N,B,M,H,q,z,W,$){"use strict";const G=t.forwardRef((({"aria-describedby":e,assistiveText:a,autoComplete:o="off",autoFocus:d=!1,columnSpan:u,helpSourceLink:F,helpSourceText:f,isDisabled:A,isReadonly:L,isRequired:v=!1,isRequiredShown:S,label:I,labelEdge:U,labelStartWidth:E,maxLength:j,maxLengthCounter:w="remaining",maxLengthUnit:P,messages:_,placeholder:k,resize:D,role:V,rows:N,textAlign:M,userAssistanceDensity:H,value:G,variant:O="default",onInput:X,onCommit:J,testId:K},Q)=>{const Y=g.useTranslationBundle("@oracle/oraclejet-preact"),Z=j?Y.formControl_limitReached({CHARACTER_LIMIT:j}):"",{currentCommitValue:ee,dispatch:se}=W.useCurrentValueReducer({value:G}),te=t.useCallback((e=>{se({type:"input",payload:e.value}),X?.(e)}),[X,se]),ae=t.useCallback((e=>{se({type:"commit",payload:e.value}),J?.(e)}),[J,se]),{isDisabled:ne,isReadonly:ie,labelEdge:oe,labelStartWidth:le,textAlign:re,userAssistanceDensity:de}=n.useFormContext(),ce=A??ne,ue=L??ie,me=U??oe,pe=E??le,xe=M??re,be=H??de,he=t.useRef(y.useId()),Fe=e?`${e} ${he.current}`:he.current,fe=t.useRef(null),ye=t.useRef(null),{focusProps:ge,isFocused:Ae,methods:Le}=l.useFocusableTextField({isDisabled:ce,isReadonly:ue,enabledElementRef:fe,readonlyElementRef:ye}),{methods:ve}=$.useSelectableTextField(fe);t.useImperativeHandle(Q,(()=>R.mergeProps(Le,ve)),[Le,ve]);const{isMaxLengthReached:Ce,valueLength:Te,onFilteredInput:Re}=q.useLengthFilter({maxLength:j,maxLengthUnit:P,value:G,onInput:te,onCommit:ae}),Se=[..._??[],...Ce?[{detail:Z,severity:"info"}]:[]],{formFieldContext:Ie,inputProps:Ue,labelProps:Ee,textFieldProps:je,userAssistanceProps:we}=h.useTextField({ariaDescribedBy:ue||ce?e:Fe,contentVariant:"textarea",helpSourceLink:F,helpSourceText:f,isDisabled:ce,isFocused:Ae,isReadonly:ue,isRequiredShown:S,labelEdge:me,messages:Se,styleVariant:O,userAssistanceDensity:be,value:G}),Pe=t.useCallback((()=>{const e=fe.current,s=e?e.value.length:null;fe.current?.setSelectionRange(s,s),fe.current?.focus()}),[fe]),_e="none"!==me?s.jsx(r.Label,{...Ee,children:I}):void 0,ke={label:"none"!==me?_e:void 0,labelEdge:"none"!==me?me:void 0,labelStartWidth:"none"!==me?pe:void 0},De="none"===me?I:void 0,Ve="efficient"===be||"reflow"===be?ce||ue?"efficient"!==be?void 0:s.jsx(C.InlineUserAssistance,{userAssistanceDensity:be,...we}):s.jsx(C.InlineUserAssistance,{assistiveText:a,fieldLabel:I,helpSourceLink:F,helpSourceText:f,messages:Se,isRequiredShown:S,userAssistanceDensity:be,...we}):void 0,Ne=t.useRef(null),Be="compact"===be?s.jsx(T.CompactUserAssistance,{anchorRef:Ne,messages:Se,assistiveText:a,...we}):void 0;if(ue){const e=s.jsx(m.ReadonlyTextFieldInput,{"aria-describedby":Ue["aria-describedby"],"aria-label":De,"aria-labelledby":Ee.id,as:"textarea",elementRef:ye,rows:N,autoFocus:d,textAlign:xe,value:G,variant:"textarea",hasEmptyLabel:""===I&&"none"===me,hasInsideLabel:void 0!==I&&"inside"===me});return s.jsx(i.FormFieldContext.Provider,{value:Ie,children:s.jsx(p.ReadonlyTextField,{role:"presentation",columnSpan:u,compactUserAssistance:Be,inlineUserAssistance:Ve,ref:Ne,testId:K,variant:"textarea",mainContent:e,resize:D,...ke})})}const Me=void 0!==j,He=s.jsxs(s.Fragment,{children:[s.jsx(c.TextFieldInput,{as:"textarea","aria-label":De,autoComplete:o,autoFocus:d,currentCommitValue:ee,hasEmptyLabel:""===I&&"none"===me,hasInsideLabel:void 0!==_e&&"inside"===me,isRequired:v,inputRef:fe,onCommit:ae,onInput:Re,placeholder:k,role:V,rows:N,textAlign:xe,value:G,...Ue}),"remaining"===w&&Me&&s.jsx(z.MaxLengthCounter,{maxLength:j,valueLength:Te,onClick:Pe}),Me&&s.jsx(B.HiddenAccessible,{id:he.current,isHidden:!0,children:Y.formControl_maxLength({MAX_LENGTH:`${j}`})}),Me&&Ae&&s.jsx(b.MaxLengthLiveRegion,{maxLength:j,valueLength:Te,testId:K+"_remainingChars"})]});return s.jsx(i.FormFieldContext.Provider,{value:Ie,children:s.jsx(x.TextField,{mainContent:He,columnSpan:u,compactUserAssistance:Be,inlineUserAssistance:Ve,onBlur:ge?.onFocusOut,onFocus:ge?.onFocusIn,mainFieldRef:Ne,resize:D,testId:K,...je,...ke})})}));e.TextArea=G}));
|
|
2
|
+
//# sourceMappingURL=TextArea-89b9ed65.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea-7230675f.js","sources":["../../src/UNSAFE_TextArea/TextArea.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { ComponentProps, Ref } from 'preact';\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from 'preact/compat';\nimport { useFormContext } from '../hooks/UNSAFE_useFormContext';\nimport { FormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { FocusableHandle, useFocusableTextField } from '../hooks/UNSAFE_useFocusableTextField';\nimport { Label } from '../UNSAFE_Label';\nimport {\n ReadonlyTextField,\n ReadonlyTextFieldInput,\n TextField,\n TextFieldInput\n} from '../UNSAFE_TextField';\nimport { useTextField } from '../hooks/UNSAFE_useTextField';\nimport {\n CompactUserAssistance,\n InlineUserAssistance,\n UserAssistanceDensityType\n} from '../UNSAFE_UserAssistance';\nimport { CountUnit, useLengthFilter } from '../hooks/UNSAFE_useLengthFilter';\nimport { MaxLengthLiveRegion } from '../UNSAFE_TextField';\nimport { MaxLengthCounter } from './MaxLengthCounter';\nimport { Size } from '../utils/UNSAFE_size';\nimport { useCurrentValueReducer } from '../hooks/UNSAFE_useCurrentValueReducer';\nimport { ValueUpdateDetail } from '../utils/UNSAFE_valueUpdateDetail';\nimport { ComponentMessageItem } from '../UNSAFE_ComponentMessage';\nimport { useTranslationBundle } from '../hooks/UNSAFE_useTranslationBundle';\nimport { BundleType } from '../resources/nls/bundle';\nimport { LayoutColumnSpan } from '../utils/UNSAFE_styles/Layout';\nimport type { TestIdProps } from '#hooks/UNSAFE_useTestId';\nimport { HiddenAccessible } from '../UNSAFE_HiddenAccessible';\nimport { useId } from '../hooks/UNSAFE_useId';\nimport { SelectableHandle, useSelectableTextField } from '#hooks/UNSAFE_useSelectableTextField';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\n\ntype TextFieldProps = ComponentProps<typeof TextField>;\ntype TextFieldInputProps = ComponentProps<typeof TextFieldInput>;\ntype InlineUserAssistanceProps = ComponentProps<typeof InlineUserAssistance>;\n\ntype Props = TestIdProps & {\n /**\n * The ID of an element (or space separated IDs of multiple elements) that\n * describes the input.\n */\n 'aria-describedby'?: TextFieldInputProps['aria-describedby'];\n\n /**\n * Text to provide guidance to help the user understand what to enter.\n */\n assistiveText?: InlineUserAssistanceProps['assistiveText'];\n /**\n * Dictates component's autocomplete state.\n * This attribute indicates whether the value of the control can be automatically completed by the browser.\n * The common values are \"on\" and \"off\".\n */\n autoComplete?: TextFieldInputProps['autoComplete'];\n /**\n * Autofocus specifies whether the component will get focus when the page is loaded.\n * If it is set to true then the associated component will get input focus when the page is loaded.\n * Setting this property doesn't set the focus to the component; it tells the browser to focus\n * to it when the element is inserted in the document.\n */\n autoFocus?: TextFieldInputProps['autoFocus'];\n /**\n * Specifies how many columns to span in a FormLayout with direction === 'row'\n */\n columnSpan?: LayoutColumnSpan;\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 component is disabled.\n */\n isDisabled?: boolean;\n /**\n * Specifies whether the component is readonly.\n */\n isReadonly?: boolean;\n /**\n * Specifies for accessibility purposes whether a value is required.\n *\n * Setting this property to <code>false</code> means that a value is not required to be\n * committed by the user. Setting this property to <code>true</code> means that a value\n * is required to be committed by the user.\n */\n isRequired?: TextFieldInputProps['isRequired'];\n /**\n * Specifies whether to show an indicator on screen that a value is required, for example\n * before the user has committed a value.\n */\n isRequiredShown?: InlineUserAssistanceProps['isRequiredShown'];\n /**\n * Specifies the label associated with the field.\n */\n label: string;\n /**\n * Specifies where the label is positioned relative to the field.\n */\n labelEdge?: 'inside' | 'start' | 'top' | 'none';\n /**\n * Specifies the width of the label when <code>labelEdge</code> is <code>\"start\"</code>\n */\n labelStartWidth?: Size;\n /**\n * Specifies the maximum number of characters that can be entered in the input field.\n */\n maxLength?: number;\n /**\n * Determines whether the remaining number of characters that can be entered is shown or not.\n */\n maxLengthCounter?: 'none' | 'remaining';\n /**\n * Specifies how the input text characters are to be counted when maxLength is specified.\n */\n maxLengthUnit?: CountUnit;\n /**\n * Messages to show on screen that are associated with the component.\n */\n messages?: InlineUserAssistanceProps['messages'];\n /**\n * A short hint to display before the user enters a value.\n */\n placeholder?: TextFieldInputProps['placeholder'];\n /**\n * Specifies how the user is allowed to manually resize the TextArea component.\n */\n resize?: TextFieldProps['resize'];\n /**\n * Specifies the ARIA role type.\n */\n role?: TextFieldInputProps['role'];\n /**\n * Specifies the number of rows to display\n */\n rows?: TextFieldInputProps['rows'];\n /**\n * Specifies how to align text within the field.\n */\n textAlign?: TextFieldInputProps['textAlign'];\n /**\n * Specifies the density of the user assistance presentation. It can be set to:\n * <ul>\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>'reflow'</code>: Show inline. Layout will reflow when text is displayed.</li>\n * <li><code>'compact'</code>: Messages, help, hints, and required will not be shown inline; they will show in a mode that keeps the screen more compact, like a popup for the messages, and a required icon to indicate Required. </li>\n * </ul>\n */\n userAssistanceDensity?: UserAssistanceDensityType;\n /**\n * The current display value of the component.\n */\n value?: TextFieldInputProps['value'];\n /**\n * The style variant of the component.\n */\n variant?: TextFieldInputProps['variant'];\n /**\n * Callback invoked when the user commits the entered value by blurring out of the field.\n */\n onCommit?: TextFieldInputProps['onCommit'];\n /**\n * Callback invoked each time the user changes the value of the field. For example, if the user\n * types 'abcd', this callback will be called four times with the value as 'a', 'ab', 'abc' and 'abcd'\n * respectively.\n */\n onInput: TextFieldInputProps['onInput'];\n};\n\ntype FocusSelectHandle = FocusableHandle & SelectableHandle;\n\n/**\n * A text area displays a field that allows a user to enter a multi-line text value.\n */\nexport const TextArea = forwardRef(\n (\n {\n 'aria-describedby': ariaDescribedBy,\n assistiveText,\n autoComplete = 'off',\n autoFocus = false,\n columnSpan,\n helpSourceLink,\n helpSourceText,\n isDisabled: propIsDisabled,\n isReadonly: propIsReadonly,\n isRequired = false,\n isRequiredShown,\n label,\n labelEdge: propLabelEdge,\n labelStartWidth: propLabelStartWidth,\n maxLength,\n maxLengthCounter = 'remaining',\n maxLengthUnit,\n messages,\n placeholder,\n resize,\n role,\n rows,\n textAlign: propTextAlign,\n userAssistanceDensity: propUserAssistanceDensity,\n value,\n variant = 'default',\n onInput,\n onCommit,\n testId\n }: Props,\n ref?: Ref<FocusSelectHandle>\n ) => {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const formControl_limitReached = maxLength\n ? translations.formControl_limitReached({\n CHARACTER_LIMIT: maxLength\n })\n : '';\n\n const { currentCommitValue, dispatch } = useCurrentValueReducer({ value });\n const onInputAndDispatch = useCallback(\n (detail: ValueUpdateDetail<string>) => {\n // Should dispatch happen first? This will queue up a re-render, ordering should not cause issues (this is async)\n dispatch({ type: 'input', payload: detail.value });\n onInput?.(detail);\n },\n [onInput, dispatch]\n );\n const onCommitAndDispatch = useCallback(\n (detail: ValueUpdateDetail<string>) => {\n // Should dispatch happen first? This will queue up a re-render, ordering should not cause issues (this is async)\n dispatch({ type: 'commit', payload: detail.value });\n onCommit?.(detail);\n },\n [onCommit, dispatch]\n );\n const {\n isDisabled: isFormDisabled,\n isReadonly: isFormReadonly,\n labelEdge: formLabelEdge,\n labelStartWidth: formLabelStartWidth,\n textAlign: formTextAlign,\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 textAlign = propTextAlign ?? formTextAlign;\n const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;\n const maxLengthDescribedByIdRef = useRef<string>(useId());\n // The enabledAriaDescribedBy includes the maxLengthDescribedById in addition to what was passed in to aria-describedby.\n // We don't need to announce the max length message for readonly, as it only applies when editing the value.\n const enabledAriaDescribedBy = ariaDescribedBy\n ? `${ariaDescribedBy} ${maxLengthDescribedByIdRef.current}`\n : maxLengthDescribedByIdRef.current;\n\n const enabledElementRef = useRef<HTMLTextAreaElement>(null);\n const readonlyElementRef = useRef<HTMLTextAreaElement>(null);\n\n const {\n focusProps,\n isFocused,\n methods: focusMethods\n } = useFocusableTextField<HTMLTextAreaElement, HTMLTextAreaElement>({\n isDisabled,\n isReadonly,\n enabledElementRef,\n readonlyElementRef\n });\n\n const { methods: selectMethods } =\n useSelectableTextField<HTMLTextAreaElement>(enabledElementRef);\n\n useImperativeHandle(ref!, () => mergeProps(focusMethods, selectMethods), [\n focusMethods,\n selectMethods\n ]);\n\n // Handle length filter for user-typed inputs and controlled inputs\n const { isMaxLengthReached, valueLength, onFilteredInput } = useLengthFilter({\n maxLength,\n maxLengthUnit,\n value,\n onInput: onInputAndDispatch,\n onCommit: onCommitAndDispatch\n });\n\n const limitMessage = [{ detail: formControl_limitReached, severity: 'info' }];\n const allMessages = [\n ...(messages ?? []),\n ...(isMaxLengthReached ? limitMessage : [])\n ] as ComponentMessageItem[];\n\n const { formFieldContext, inputProps, labelProps, textFieldProps, userAssistanceProps } =\n useTextField({\n ariaDescribedBy: isReadonly || isDisabled ? ariaDescribedBy : enabledAriaDescribedBy,\n contentVariant: 'textarea',\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isFocused,\n isReadonly,\n isRequiredShown,\n labelEdge,\n messages: allMessages,\n styleVariant: variant,\n userAssistanceDensity,\n value\n });\n\n const onClickCounter = useCallback(() => {\n const elm = enabledElementRef.current;\n // for setSelectionRange(), len needs to be a number or null.\n const len = elm ? elm.value.length : null;\n // Since the counter element is after the text, clicking in this\n // should put the selection at the end of the text\n enabledElementRef.current?.setSelectionRange(len, len);\n // Clicking the counter should put the focus on the input field\n enabledElementRef.current?.focus();\n }, [enabledElementRef]);\n\n const labelComp = labelEdge !== 'none' ? <Label {...labelProps}>{label}</Label> : undefined;\n\n const fieldLabelProps = {\n label: labelEdge !== 'none' ? labelComp : undefined,\n labelEdge: labelEdge !== 'none' ? labelEdge : undefined,\n labelStartWidth: labelEdge !== 'none' ? labelStartWidth : undefined\n };\n\n const ariaLabel = labelEdge === 'none' ? label : undefined;\n const isInlineDensity =\n userAssistanceDensity === 'efficient' || userAssistanceDensity === 'reflow';\n\n const inlineUserAssistance = isInlineDensity ? (\n isDisabled || isReadonly ? (\n // save space for user assistance if density is 'efficient', even though we don't\n // render user assistance for disabled or readonly fields\n userAssistanceDensity !== 'efficient' ? undefined : (\n <InlineUserAssistance\n userAssistanceDensity={userAssistanceDensity}\n {...userAssistanceProps}\n />\n )\n ) : (\n <InlineUserAssistance\n assistiveText={assistiveText}\n fieldLabel={label}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n messages={allMessages}\n isRequiredShown={isRequiredShown}\n userAssistanceDensity={userAssistanceDensity}\n {...userAssistanceProps}\n />\n )\n ) : undefined;\n\n const anchorRef = useRef<HTMLDivElement>(null);\n\n const compactUserAssistance =\n userAssistanceDensity === 'compact' ? (\n <CompactUserAssistance\n anchorRef={anchorRef}\n messages={allMessages}\n assistiveText={assistiveText}\n {...userAssistanceProps}\n />\n ) : undefined;\n\n if (isReadonly) {\n const mainContent = (\n <ReadonlyTextFieldInput\n aria-describedby={inputProps['aria-describedby']}\n aria-label={ariaLabel}\n aria-labelledby={labelProps.id}\n as=\"textarea\"\n elementRef={readonlyElementRef}\n rows={rows}\n autoFocus={autoFocus}\n textAlign={textAlign}\n value={value}\n variant=\"textarea\"\n hasEmptyLabel={label === '' && labelEdge === 'none'}\n hasInsideLabel={label !== undefined && labelEdge === 'inside'}\n />\n );\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n <ReadonlyTextField\n role=\"presentation\"\n columnSpan={columnSpan}\n compactUserAssistance={compactUserAssistance}\n inlineUserAssistance={inlineUserAssistance}\n ref={anchorRef}\n testId={testId}\n variant=\"textarea\"\n mainContent={mainContent}\n resize={resize}\n {...fieldLabelProps}\n />\n </FormFieldContext.Provider>\n );\n }\n const hasMaxLength = maxLength !== undefined;\n const mainContent = (\n <>\n <TextFieldInput\n as=\"textarea\"\n aria-label={ariaLabel}\n autoComplete={autoComplete}\n autoFocus={autoFocus}\n currentCommitValue={currentCommitValue}\n hasEmptyLabel={label === '' && labelEdge === 'none'}\n hasInsideLabel={labelComp !== undefined && labelEdge === 'inside'}\n isRequired={isRequired}\n inputRef={enabledElementRef}\n onCommit={onCommitAndDispatch}\n onInput={onFilteredInput}\n placeholder={placeholder}\n role={role}\n rows={rows}\n textAlign={textAlign}\n value={value}\n {...inputProps}\n />\n {maxLengthCounter === 'remaining' && hasMaxLength && (\n <MaxLengthCounter\n maxLength={maxLength}\n valueLength={valueLength}\n onClick={onClickCounter}\n />\n )}\n {hasMaxLength && (\n <HiddenAccessible id={maxLengthDescribedByIdRef.current} isHidden={true}>\n {translations.formControl_maxLength({\n MAX_LENGTH: `${maxLength}`\n })}\n </HiddenAccessible>\n )}\n {hasMaxLength && isFocused && (\n <MaxLengthLiveRegion\n maxLength={maxLength}\n valueLength={valueLength}\n testId={testId + '_remainingChars'}\n />\n )}\n </>\n );\n\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n <TextField\n mainContent={mainContent}\n columnSpan={columnSpan}\n compactUserAssistance={compactUserAssistance}\n inlineUserAssistance={inlineUserAssistance}\n onBlur={focusProps?.onFocusOut}\n onFocus={focusProps?.onFocusIn}\n mainFieldRef={anchorRef}\n resize={resize}\n testId={testId}\n {...textFieldProps}\n {...fieldLabelProps}></TextField>\n </FormFieldContext.Provider>\n );\n }\n);\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuLA;;AAEG;MACU,QAAQ,GAAG,UAAU,CAChC,CACE,EACE,kBAAkB,EAAE,eAAe,EACnC,aAAa,EACb,YAAY,GAAG,KAAK,EACpB,SAAS,GAAG,KAAK,EACjB,UAAU,EACV,cAAc,EACd,cAAc,EACd,UAAU,EAAE,cAAc,EAC1B,UAAU,EAAE,cAAc,EAC1B,UAAU,GAAG,KAAK,EAClB,eAAe,EACf,KAAK,EACL,SAAS,EAAE,aAAa,EACxB,eAAe,EAAE,mBAAmB,EACpC,SAAS,EACT,gBAAgB,GAAG,WAAW,EAC9B,aAAa,EACb,QAAQ,EACR,WAAW,EACX,MAAM,EACN,IAAI,EACJ,I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.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { ComponentProps, Ref } from 'preact';\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from 'preact/compat';\nimport { useFormContext } from '../hooks/UNSAFE_useFormContext';\nimport { FormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { FocusableHandle, useFocusableTextField } from '../hooks/UNSAFE_useFocusableTextField';\nimport { Label } from '../UNSAFE_Label';\nimport {\n ReadonlyTextField,\n ReadonlyTextFieldInput,\n TextField,\n TextFieldInput\n} from '../UNSAFE_TextField';\nimport { useTextField } from '../hooks/UNSAFE_useTextField';\nimport {\n CompactUserAssistance,\n InlineUserAssistance,\n UserAssistanceDensityType\n} from '../UNSAFE_UserAssistance';\nimport { CountUnit, useLengthFilter } from '../hooks/UNSAFE_useLengthFilter';\nimport { MaxLengthLiveRegion } from '../UNSAFE_TextField';\nimport { MaxLengthCounter } from './MaxLengthCounter';\nimport { Size } from '../utils/UNSAFE_size';\nimport { useCurrentValueReducer } from '../hooks/UNSAFE_useCurrentValueReducer';\nimport { ValueUpdateDetail } from '../utils/UNSAFE_valueUpdateDetail';\nimport { ComponentMessageItem } from '../UNSAFE_ComponentMessage';\nimport { useTranslationBundle } from '../hooks/UNSAFE_useTranslationBundle';\nimport { BundleType } from '../resources/nls/bundle';\nimport { LayoutColumnSpan } from '../utils/UNSAFE_styles/Layout';\nimport type { TestIdProps } from '#hooks/UNSAFE_useTestId';\nimport { HiddenAccessible } from '../UNSAFE_HiddenAccessible';\nimport { useId } from '../hooks/UNSAFE_useId';\nimport { SelectableHandle, useSelectableTextField } from '#hooks/UNSAFE_useSelectableTextField';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\n\ntype TextFieldProps = ComponentProps<typeof TextField>;\ntype TextFieldInputProps = ComponentProps<typeof TextFieldInput>;\ntype InlineUserAssistanceProps = ComponentProps<typeof InlineUserAssistance>;\n\ntype Props = TestIdProps & {\n /**\n * The ID of an element (or space separated IDs of multiple elements) that\n * describes the input.\n */\n 'aria-describedby'?: TextFieldInputProps['aria-describedby'];\n\n /**\n * Text to provide guidance to help the user understand what to enter.\n */\n assistiveText?: InlineUserAssistanceProps['assistiveText'];\n /**\n * Dictates component's autocomplete state.\n * This attribute indicates whether the value of the control can be automatically completed by the browser.\n * The common values are \"on\" and \"off\".\n */\n autoComplete?: TextFieldInputProps['autoComplete'];\n /**\n * Autofocus specifies whether the component will get focus when the page is loaded.\n * If it is set to true then the associated component will get input focus when the page is loaded.\n * Setting this property doesn't set the focus to the component; it tells the browser to focus\n * to it when the element is inserted in the document.\n */\n autoFocus?: TextFieldInputProps['autoFocus'];\n /**\n * Specifies how many columns to span in a FormLayout with direction === 'row'\n */\n columnSpan?: LayoutColumnSpan;\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 component is disabled.\n */\n isDisabled?: boolean;\n /**\n * Specifies whether the component is readonly.\n */\n isReadonly?: boolean;\n /**\n * Specifies for accessibility purposes whether a value is required.\n *\n * Setting this property to <code>false</code> means that a value is not required to be\n * committed by the user. Setting this property to <code>true</code> means that a value\n * is required to be committed by the user.\n */\n isRequired?: TextFieldInputProps['isRequired'];\n /**\n * Specifies whether to show an indicator on screen that a value is required, for example\n * before the user has committed a value.\n */\n isRequiredShown?: InlineUserAssistanceProps['isRequiredShown'];\n /**\n * Specifies the label associated with the field.\n */\n label: string;\n /**\n * Specifies where the label is positioned relative to the field.\n */\n labelEdge?: 'inside' | 'start' | 'top' | 'none';\n /**\n * Specifies the width of the label when <code>labelEdge</code> is <code>\"start\"</code>\n */\n labelStartWidth?: Size;\n /**\n * Specifies the maximum number of characters that can be entered in the input field.\n */\n maxLength?: number;\n /**\n * Determines whether the remaining number of characters that can be entered is shown or not.\n */\n maxLengthCounter?: 'none' | 'remaining';\n /**\n * Specifies how the input text characters are to be counted when maxLength is specified.\n */\n maxLengthUnit?: CountUnit;\n /**\n * Messages to show on screen that are associated with the component.\n */\n messages?: InlineUserAssistanceProps['messages'];\n /**\n * A short hint to display before the user enters a value.\n */\n placeholder?: TextFieldInputProps['placeholder'];\n /**\n * Specifies how the user is allowed to manually resize the TextArea component.\n */\n resize?: TextFieldProps['resize'];\n /**\n * Specifies the ARIA role type.\n */\n role?: TextFieldInputProps['role'];\n /**\n * Specifies the number of rows to display\n */\n rows?: TextFieldInputProps['rows'];\n /**\n * Specifies how to align text within the field.\n */\n textAlign?: TextFieldInputProps['textAlign'];\n /**\n * Specifies the density of the user assistance presentation. It can be set to:\n * <ul>\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>'reflow'</code>: Show inline. Layout will reflow when text is displayed.</li>\n * <li><code>'compact'</code>: Messages, help, hints, and required will not be shown inline; they will show in a mode that keeps the screen more compact, like a popup for the messages, and a required icon to indicate Required. </li>\n * </ul>\n */\n userAssistanceDensity?: UserAssistanceDensityType;\n /**\n * The current display value of the component.\n */\n value?: TextFieldInputProps['value'];\n /**\n * The style variant of the component.\n */\n variant?: TextFieldInputProps['variant'];\n /**\n * Callback invoked when the user commits the entered value by blurring out of the field.\n */\n onCommit?: TextFieldInputProps['onCommit'];\n /**\n * Callback invoked each time the user changes the value of the field. For example, if the user\n * types 'abcd', this callback will be called four times with the value as 'a', 'ab', 'abc' and 'abcd'\n * respectively.\n */\n onInput: TextFieldInputProps['onInput'];\n};\n\ntype FocusSelectHandle = FocusableHandle & SelectableHandle;\n\n/**\n * A text area displays a field that allows a user to enter a multi-line text value.\n */\nexport const TextArea = forwardRef(\n (\n {\n 'aria-describedby': ariaDescribedBy,\n assistiveText,\n autoComplete = 'off',\n autoFocus = false,\n columnSpan,\n helpSourceLink,\n helpSourceText,\n isDisabled: propIsDisabled,\n isReadonly: propIsReadonly,\n isRequired = false,\n isRequiredShown,\n label,\n labelEdge: propLabelEdge,\n labelStartWidth: propLabelStartWidth,\n maxLength,\n maxLengthCounter = 'remaining',\n maxLengthUnit,\n messages,\n placeholder,\n resize,\n role,\n rows,\n textAlign: propTextAlign,\n userAssistanceDensity: propUserAssistanceDensity,\n value,\n variant = 'default',\n onInput,\n onCommit,\n testId\n }: Props,\n ref?: Ref<FocusSelectHandle>\n ) => {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const formControl_limitReached = maxLength\n ? translations.formControl_limitReached({\n CHARACTER_LIMIT: maxLength\n })\n : '';\n\n const { currentCommitValue, dispatch } = useCurrentValueReducer({ value });\n const onInputAndDispatch = useCallback(\n (detail: ValueUpdateDetail<string>) => {\n // Should dispatch happen first? This will queue up a re-render, ordering should not cause issues (this is async)\n dispatch({ type: 'input', payload: detail.value });\n onInput?.(detail);\n },\n [onInput, dispatch]\n );\n const onCommitAndDispatch = useCallback(\n (detail: ValueUpdateDetail<string>) => {\n // Should dispatch happen first? This will queue up a re-render, ordering should not cause issues (this is async)\n dispatch({ type: 'commit', payload: detail.value });\n onCommit?.(detail);\n },\n [onCommit, dispatch]\n );\n const {\n isDisabled: isFormDisabled,\n isReadonly: isFormReadonly,\n labelEdge: formLabelEdge,\n labelStartWidth: formLabelStartWidth,\n textAlign: formTextAlign,\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 textAlign = propTextAlign ?? formTextAlign;\n const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;\n const maxLengthDescribedByIdRef = useRef<string>(useId());\n // The enabledAriaDescribedBy includes the maxLengthDescribedById in addition to what was passed in to aria-describedby.\n // We don't need to announce the max length message for readonly, as it only applies when editing the value.\n const enabledAriaDescribedBy = ariaDescribedBy\n ? `${ariaDescribedBy} ${maxLengthDescribedByIdRef.current}`\n : maxLengthDescribedByIdRef.current;\n\n const enabledElementRef = useRef<HTMLTextAreaElement>(null);\n const readonlyElementRef = useRef<HTMLTextAreaElement>(null);\n\n const {\n focusProps,\n isFocused,\n methods: focusMethods\n } = useFocusableTextField<HTMLTextAreaElement, HTMLTextAreaElement>({\n isDisabled,\n isReadonly,\n enabledElementRef,\n readonlyElementRef\n });\n\n const { methods: selectMethods } =\n useSelectableTextField<HTMLTextAreaElement>(enabledElementRef);\n\n useImperativeHandle(ref!, () => mergeProps(focusMethods, selectMethods), [\n focusMethods,\n selectMethods\n ]);\n\n // Handle length filter for user-typed inputs and controlled inputs\n const { isMaxLengthReached, valueLength, onFilteredInput } = useLengthFilter({\n maxLength,\n maxLengthUnit,\n value,\n onInput: onInputAndDispatch,\n onCommit: onCommitAndDispatch\n });\n\n const limitMessage = [{ detail: formControl_limitReached, severity: 'info' }];\n const allMessages = [\n ...(messages ?? []),\n ...(isMaxLengthReached ? limitMessage : [])\n ] as ComponentMessageItem[];\n\n const { formFieldContext, inputProps, labelProps, textFieldProps, userAssistanceProps } =\n useTextField({\n ariaDescribedBy: isReadonly || isDisabled ? ariaDescribedBy : enabledAriaDescribedBy,\n contentVariant: 'textarea',\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isFocused,\n isReadonly,\n isRequiredShown,\n labelEdge,\n messages: allMessages,\n styleVariant: variant,\n userAssistanceDensity,\n value\n });\n\n const onClickCounter = useCallback(() => {\n const elm = enabledElementRef.current;\n // for setSelectionRange(), len needs to be a number or null.\n const len = elm ? elm.value.length : null;\n // Since the counter element is after the text, clicking in this\n // should put the selection at the end of the text\n enabledElementRef.current?.setSelectionRange(len, len);\n // Clicking the counter should put the focus on the input field\n enabledElementRef.current?.focus();\n }, [enabledElementRef]);\n\n const labelComp = labelEdge !== 'none' ? <Label {...labelProps}>{label}</Label> : undefined;\n\n const fieldLabelProps = {\n label: labelEdge !== 'none' ? labelComp : undefined,\n labelEdge: labelEdge !== 'none' ? labelEdge : undefined,\n labelStartWidth: labelEdge !== 'none' ? labelStartWidth : undefined\n };\n\n const ariaLabel = labelEdge === 'none' ? label : undefined;\n const isInlineDensity =\n userAssistanceDensity === 'efficient' || userAssistanceDensity === 'reflow';\n\n const inlineUserAssistance = isInlineDensity ? (\n isDisabled || isReadonly ? (\n // save space for user assistance if density is 'efficient', even though we don't\n // render user assistance for disabled or readonly fields\n userAssistanceDensity !== 'efficient' ? undefined : (\n <InlineUserAssistance\n userAssistanceDensity={userAssistanceDensity}\n {...userAssistanceProps}\n />\n )\n ) : (\n <InlineUserAssistance\n assistiveText={assistiveText}\n fieldLabel={label}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n messages={allMessages}\n isRequiredShown={isRequiredShown}\n userAssistanceDensity={userAssistanceDensity}\n {...userAssistanceProps}\n />\n )\n ) : undefined;\n\n const anchorRef = useRef<HTMLDivElement>(null);\n\n const compactUserAssistance =\n userAssistanceDensity === 'compact' ? (\n <CompactUserAssistance\n anchorRef={anchorRef}\n messages={allMessages}\n assistiveText={assistiveText}\n {...userAssistanceProps}\n />\n ) : undefined;\n\n if (isReadonly) {\n const mainContent = (\n <ReadonlyTextFieldInput\n aria-describedby={inputProps['aria-describedby']}\n aria-label={ariaLabel}\n aria-labelledby={labelProps.id}\n as=\"textarea\"\n elementRef={readonlyElementRef}\n rows={rows}\n autoFocus={autoFocus}\n textAlign={textAlign}\n value={value}\n variant=\"textarea\"\n hasEmptyLabel={label === '' && labelEdge === 'none'}\n hasInsideLabel={label !== undefined && labelEdge === 'inside'}\n />\n );\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n <ReadonlyTextField\n role=\"presentation\"\n columnSpan={columnSpan}\n compactUserAssistance={compactUserAssistance}\n inlineUserAssistance={inlineUserAssistance}\n ref={anchorRef}\n testId={testId}\n variant=\"textarea\"\n mainContent={mainContent}\n resize={resize}\n {...fieldLabelProps}\n />\n </FormFieldContext.Provider>\n );\n }\n const hasMaxLength = maxLength !== undefined;\n const mainContent = (\n <>\n <TextFieldInput\n as=\"textarea\"\n aria-label={ariaLabel}\n autoComplete={autoComplete}\n autoFocus={autoFocus}\n currentCommitValue={currentCommitValue}\n hasEmptyLabel={label === '' && labelEdge === 'none'}\n hasInsideLabel={labelComp !== undefined && labelEdge === 'inside'}\n isRequired={isRequired}\n inputRef={enabledElementRef}\n onCommit={onCommitAndDispatch}\n onInput={onFilteredInput}\n placeholder={placeholder}\n role={role}\n rows={rows}\n textAlign={textAlign}\n value={value}\n {...inputProps}\n />\n {maxLengthCounter === 'remaining' && hasMaxLength && (\n <MaxLengthCounter\n maxLength={maxLength}\n valueLength={valueLength}\n onClick={onClickCounter}\n />\n )}\n {hasMaxLength && (\n <HiddenAccessible id={maxLengthDescribedByIdRef.current} isHidden={true}>\n {translations.formControl_maxLength({\n MAX_LENGTH: `${maxLength}`\n })}\n </HiddenAccessible>\n )}\n {hasMaxLength && isFocused && (\n <MaxLengthLiveRegion\n maxLength={maxLength}\n valueLength={valueLength}\n testId={testId + '_remainingChars'}\n />\n )}\n </>\n );\n\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n <TextField\n mainContent={mainContent}\n columnSpan={columnSpan}\n compactUserAssistance={compactUserAssistance}\n inlineUserAssistance={inlineUserAssistance}\n onBlur={focusProps?.onFocusOut}\n onFocus={focusProps?.onFocusIn}\n mainFieldRef={anchorRef}\n resize={resize}\n testId={testId}\n {...textFieldProps}\n {...fieldLabelProps}></TextField>\n </FormFieldContext.Provider>\n );\n }\n);\n"],"names":["TextArea","forwardRef","ariaDescribedBy","assistiveText","autoComplete","autoFocus","columnSpan","helpSourceLink","helpSourceText","isDisabled","propIsDisabled","isReadonly","propIsReadonly","isRequired","isRequiredShown","label","labelEdge","propLabelEdge","labelStartWidth","propLabelStartWidth","maxLength","maxLengthCounter","maxLengthUnit","messages","placeholder","resize","role","rows","textAlign","propTextAlign","userAssistanceDensity","propUserAssistanceDensity","value","variant","onInput","onCommit","testId","ref","translations","useTranslationBundle","formControl_limitReached","CHARACTER_LIMIT","currentCommitValue","dispatch","useCurrentValueReducer","onInputAndDispatch","useCallback","detail","type","payload","onCommitAndDispatch","isFormDisabled","isFormReadonly","formLabelEdge","formLabelStartWidth","formTextAlign","formUserAssistanceDensity","useFormContext","maxLengthDescribedByIdRef","useRef","useId","enabledAriaDescribedBy","current","enabledElementRef","readonlyElementRef","focusProps","isFocused","methods","focusMethods","useFocusableTextField","selectMethods","useSelectableTextField","useImperativeHandle","mergeProps","isMaxLengthReached","valueLength","onFilteredInput","useLengthFilter","allMessages","severity","formFieldContext","inputProps","labelProps","textFieldProps","userAssistanceProps","useTextField","contentVariant","styleVariant","onClickCounter","elm","len","length","setSelectionRange","focus","labelComp","_jsx","jsx","Label","undefined","fieldLabelProps","ariaLabel","inlineUserAssistance","InlineUserAssistance","fieldLabel","anchorRef","compactUserAssistance","CompactUserAssistance","mainContent","ReadonlyTextFieldInput","id","as","elementRef","hasEmptyLabel","hasInsideLabel","FormFieldContext","Provider","children","ReadonlyTextField","hasMaxLength","_jsxs","_Fragment","Fragment","TextFieldInput","inputRef","MaxLengthCounter","onClick","HiddenAccessible","isHidden","formControl_maxLength","MAX_LENGTH","MaxLengthLiveRegion","TextField","onBlur","onFocusOut","onFocus","onFocusIn","mainFieldRef"],"mappings":"8oDA0LaA,EAAWC,EAAAA,YACtB,EAEI,mBAAoBC,EACpBC,gBACAC,eAAe,MACfC,aAAY,EACZC,aACAC,iBACAC,iBACAC,WAAYC,EACZC,WAAYC,EACZC,cAAa,EACbC,kBACAC,QACAC,UAAWC,EACXC,gBAAiBC,EACjBC,YACAC,mBAAmB,YACnBC,gBACAC,WACAC,cACAC,SACAC,OACAC,OACAC,UAAWC,EACXC,sBAAuBC,EACvBC,QACAC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S,uBAMzB,OACE2D,EAAAA,IAACmB,EAAAA,iBAAiBC,SAAS,CAAAnF,MAAOgD,GAChCoC,SAAArB,EAAAC,IAACmC,EAASA,UAAA,CACRxB,YAAaA,GACbrG,WAAYA,EACZmG,sBAAuBA,GACvBJ,qBAAsBA,GACtB+B,OAAQnE,IAAYoE,WACpBC,QAASrE,IAAYsE,UACrBC,aAAchC,GACd/E,OAAQA,EACRW,OAAQA,KACJ+C,MACAgB,MAER"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(['exports', 'preact/jsx-runtime', 'preact/compat', './FormContext-5130e198', './useFormContext-30acdd33', './FormFieldContext-3c44aaaa', 'preact/hooks', './useFocusableTextField-8b755b15', './Label-3912beb2', './keyboardUtils-fbb389f8', './TextFieldInput-ba4e508c', 'css!./ObfuscatedTextFieldInputStyles.styles.css', './ReadonlyTextFieldInput-608bddc1', './StyledTextField-b4278437', './TextField-1021f00b', './MaxLengthLiveRegion-8954fc30', './useTextField-e6877c79', './logger-0f873e29', './TabbableModeContext-a9c97640', './useId-c9578d26', './useTranslationBundle-516b1b83', 'css!./UserAssistanceStyles.styles.css', 'module', './UNSAFE_UserAssistance/themes/redwood/UserAssistanceVariants.css', './InlineUserAssistance-4656c2a6', './CompactUserAssistance-3370a318', './mergeProps-bcfa6a92', './LayerHost-e95c5f30', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-69ce0a2d', 'preact', 'css!./IconStyle.styles.css', './Popup-d51bf3f4', 'css!./LabelStyles.styles.css', 'module', './UNSAFE_Label/themes/redwood/LabelVariants.css', './InputGroupContext-372087af', './HiddenAccessible-037ef42d', 'module', './UNSAFE_Popup/themes/redwood/PopupVariants.css', './useLengthFilter-ed8959a4', './useCurrentValueReducer-faded381', './useSelectableTextField-900d2860', './MaxLengthCounter-9a95922c'], (function(e,s,t,a,n,o,i,l,r,d,u,c,m,p,h,x,b,f,g,F,y,R,v,L,T,A,C,S,I,U,w,E,j,P,H,_,k,D,B,V,M,N,q,W,$,z){"use strict";const G=({isReadonly:e,enabledElementRef:s,readonlyElementRef:t,minRows:a=2,maxRows:n,value:o})=>{i.useLayoutEffect((()=>{const o=e?t:s;if(null===o.current)return;if(o.current instanceof HTMLDivElement)return;const i=o.current,l=(e=>{const s=window.getComputedStyle(e),t=s.lineHeight;if("normal"===t)return 1.2*parseFloat(s.fontSize);return parseFloat(t)})(i);i.style.height="0";const{paddingHeight:r,borderHeight:d}=(e=>{const s=window.getComputedStyle(e);return{paddingHeight:parseFloat(s.paddingTop)+parseFloat(s.paddingBottom),borderHeight:parseFloat(s.borderTop)+parseFloat(s.borderBottom)}})(i),u=l*a+r+d,c=i.scrollHeight+d;let m=0;if(void 0===n)m=c<u?u:c;else if(n>a){const e=l*n+r+d;m=c>e?e:c<u?u:c}else m=u;i.style.height=m+.5+"px"}),[o,a,n,e,s,t])},O=t.forwardRef((({"aria-describedby":e,assistiveText:a,autoComplete:i="off",autoFocus:d=!1,columnSpan:c,helpSourceLink:f,helpSourceText:g,isDisabled:R,isReadonly:v,isRequired:L=!1,isRequiredShown:S,label:I,labelEdge:U,labelStartWidth:w,maxLength:E,maxLengthCounter:j="remaining",maxLengthUnit:P,maxRows:H,messages:_,minRows:k=2,placeholder:D,role:B,textAlign:M,userAssistanceDensity:N,value:O,variant:X="default",onInput:J,onCommit:K,testId:Q},Y)=>{const Z=y.useTranslationBundle("@oracle/oraclejet-preact"),ee=E?Z.formControl_limitReached({CHARACTER_LIMIT:E}):"",{currentCommitValue:se,dispatch:te}=W.useCurrentValueReducer({value:O}),ae=t.useCallback((e=>{te({type:"input",payload:e.value}),J?.(e)}),[J,te]),ne=t.useCallback((e=>{te({type:"commit",payload:e.value}),K?.(e)}),[K,te]),{isDisabled:oe,isReadonly:ie,labelEdge:le,labelStartWidth:re,textAlign:de,userAssistanceDensity:ue}=n.useFormContext(),ce=R??oe,me=v??ie,pe=U??le,he=w??re,xe=M??de,be=N??ue,fe=t.useRef(F.useId()),ge=e?`${e} ${fe.current}`:fe.current,Fe=t.useRef(null),ye=t.useRef(null),{focusProps:Re,isFocused:ve,methods:Le}=l.useFocusableTextField({isDisabled:ce,isReadonly:me,enabledElementRef:Fe,readonlyElementRef:ye}),{methods:Te}=$.useSelectableTextField(Fe);t.useImperativeHandle(Y,(()=>C.mergeProps(Le,Te)),[Le,Te]);const{isMaxLengthReached:Ae,valueLength:Ce,onFilteredInput:Se}=q.useLengthFilter({maxLength:E,maxLengthUnit:P,value:O,onInput:ae,onCommit:ne}),Ie=[..._??[],...Ae?[{detail:ee,severity:"info"}]:[]],{formFieldContext:Ue,inputProps:we,labelProps:Ee,textFieldProps:je,userAssistanceProps:Pe}=b.useTextField({ariaDescribedBy:me||ce?e:ge,contentVariant:"textarea",helpSourceLink:f,helpSourceText:g,isDisabled:ce,isFocused:ve,isReadonly:me,isRequiredShown:S,labelEdge:pe,messages:Ie,styleVariant:X,userAssistanceDensity:be,value:O}),He=t.useCallback((()=>{const e=Fe.current,s=e?e.value.length:null;Fe.current?.setSelectionRange(s,s),Fe.current?.focus()}),[Fe]),_e="none"!==pe?s.jsx(r.Label,{...Ee,children:I}):void 0,ke={label:"none"!==pe?_e:void 0,labelEdge:"none"!==pe?pe:void 0,labelStartWidth:"none"!==pe?he:void 0},De="none"===pe?I:void 0,Be="efficient"===be||"reflow"===be?ce||me?"efficient"!==be?void 0:s.jsx(T.InlineUserAssistance,{userAssistanceDensity:be,...Pe}):s.jsx(T.InlineUserAssistance,{assistiveText:a,fieldLabel:I,helpSourceLink:f,helpSourceText:g,messages:Ie,isRequiredShown:S,userAssistanceDensity:be,...Pe}):void 0,Ve=t.useRef(null),Me="compact"===be?s.jsx(A.CompactUserAssistance,{anchorRef:Ve,messages:Ie,assistiveText:a,...Pe}):void 0;if(G({isReadonly:me,enabledElementRef:Fe,readonlyElementRef:ye,minRows:k,maxRows:H,value:O}),me){const e=s.jsx(m.ReadonlyTextFieldInput,{"aria-describedby":we["aria-describedby"],"aria-label":De,"aria-labelledby":Ee.id,elementRef:ye,...H?{as:"textarea",rows:k}:{as:"div"},autoFocus:d,textAlign:xe,value:O,variant:"textarea",hasEmptyLabel:""===I&&"none"===pe,hasInsideLabel:void 0!==I&&"inside"===pe});return s.jsx(o.FormFieldContext.Provider,{value:Ue,children:s.jsx(p.ReadonlyTextField,{role:"presentation",columnSpan:c,compactUserAssistance:Me,inlineUserAssistance:Be,variant:"textarea",mainContent:e,ref:Ve,testId:Q,...ke})})}const Ne=void 0!==E,qe=s.jsxs(s.Fragment,{children:[s.jsx(u.TextFieldInput,{as:"textarea","aria-label":De,autoComplete:i,autoFocus:d,currentCommitValue:se,hasEmptyLabel:""===I&&"none"===pe,hasInsideLabel:void 0!==_e&&"inside"===pe,isRequired:L,inputRef:Fe,onCommit:ne,onInput:Se,placeholder:D,role:B,rows:k,textAlign:xe,value:O,...we}),"remaining"===j&&Ne&&s.jsx(z.MaxLengthCounter,{maxLength:E,valueLength:Ce,onClick:He}),Ne&&s.jsx(V.HiddenAccessible,{id:fe.current,children:Z.formControl_maxLength({MAX_LENGTH:`${E}`})}),Ne&&ve&&s.jsx(x.MaxLengthLiveRegion,{maxLength:E,valueLength:Ce,testId:Q+"_remainingChars"})]});return s.jsx(o.FormFieldContext.Provider,{value:Ue,children:s.jsx(h.TextField,{mainContent:qe,columnSpan:c,compactUserAssistance:Me,inlineUserAssistance:Be,onBlur:Re?.onFocusOut,onFocus:Re?.onFocusIn,mainFieldRef:Ve,testId:Q,...je,...ke})})}));e.TextAreaAutosize=O}));
|
|
2
|
+
//# sourceMappingURL=TextAreaAutosize-81449e46.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextAreaAutosize-9cd2c1e8.js","sources":["../../src/UNSAFE_TextAreaAutosize/ScrollHeightUtils.tsx","../../src/UNSAFE_TextAreaAutosize/useTextAreaAutosizing.tsx","../../src/UNSAFE_TextAreaAutosize/TextAreaAutosize.tsx"],"sourcesContent":["// returns the lineHeight as a number of pixels.\nexport const calculateLineHeight = (textarea: HTMLTextAreaElement): number => {\n const computedStyle = window.getComputedStyle(textarea);\n const computedlineHeight = computedStyle.lineHeight;\n if (computedlineHeight === 'normal') {\n // We get 'normal' for values 'initial', 'inherit', 'unset' and 'normal'\n // TODO: Unclear if we need this.\n // getComputedStyle always return fontSize in pixels. Not likely a float, but since it's legal\n // we use parseFloat()\n const fontSize = parseFloat(computedStyle.fontSize);\n return 1.2 * fontSize;\n }\n return parseFloat(computedlineHeight);\n};\nexport const getStylingHeight = (textarea: HTMLTextAreaElement) => {\n const cssStyle = window.getComputedStyle(textarea);\n const paddingTop = parseFloat(cssStyle.paddingTop);\n const paddingBottom = parseFloat(cssStyle.paddingBottom);\n const borderTop = parseFloat(cssStyle.borderTop);\n const borderBottom = parseFloat(cssStyle.borderBottom);\n return { paddingHeight: paddingTop + paddingBottom, borderHeight: borderTop + borderBottom };\n};\n","import type { ComponentProps, RefObject } from 'preact';\nimport { useLayoutEffect } from 'preact/hooks';\nimport { calculateLineHeight, getStylingHeight } from './ScrollHeightUtils';\nimport { TextAreaAutosize } from './TextAreaAutosize';\n\ntype PickedPropsFromTextAreaAutosize = Pick<\n ComponentProps<typeof TextAreaAutosize>,\n 'minRows' | 'maxRows' | 'value'\n>;\ntype Props = PickedPropsFromTextAreaAutosize & {\n isReadonly?: boolean;\n enabledElementRef: RefObject<HTMLTextAreaElement>;\n readonlyElementRef: RefObject<HTMLTextAreaElement | HTMLDivElement>;\n};\n\n// TODO: Make this fire when the container resizes - JET-50840\nexport const useTextAreaAutosizing = ({\n isReadonly,\n enabledElementRef,\n readonlyElementRef,\n minRows = 2,\n maxRows,\n value\n}: Props) => {\n useLayoutEffect(() => {\n const textareaRef = isReadonly ? readonlyElementRef : enabledElementRef;\n if (textareaRef.current === null) return;\n if (textareaRef.current instanceof HTMLDivElement) return; // We don't need to do anything if the readonlyElement is a DIV.\n const textarea = textareaRef.current;\n const lineHeight = calculateLineHeight(textarea);\n textarea.style.height = '0';\n const { paddingHeight, borderHeight } = getStylingHeight(textarea);\n const heightForMinRows = lineHeight * minRows + paddingHeight + borderHeight;\n const scrollHeight = textarea.scrollHeight + borderHeight;\n let resizedHeight = 0;\n // if maxRows is -1 the textarea will grow or shrink to fit all the content.\n // it won't shrink any less than rows.\n if (maxRows === undefined) {\n // we want to fit the entire scrollHeight, but we don't want\n // to shrink smaller than the height for rows.\n if (scrollHeight < heightForMinRows) {\n resizedHeight = heightForMinRows;\n } else {\n resizedHeight = scrollHeight;\n }\n } else if (maxRows > minRows) {\n // if maxRows is positive and greater than rows, the textarea will grow to fit the content\n // up to maxrows, or shrink to fit the content and down to rows.\n const heightForMaxRows = lineHeight * maxRows + paddingHeight + borderHeight;\n if (scrollHeight > heightForMaxRows) {\n resizedHeight = heightForMaxRows;\n } else if (scrollHeight < heightForMinRows) {\n resizedHeight = heightForMinRows;\n } else {\n resizedHeight = scrollHeight;\n }\n } else {\n resizedHeight = heightForMinRows;\n }\n // The 0.5 gaurantees that the clientHeight will be bigger than the scrollHeight, so no scrollbar appears.\n textarea.style.height = resizedHeight + 0.5 + 'px';\n }, [value, minRows, maxRows, isReadonly, enabledElementRef, readonlyElementRef]);\n};\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { ComponentProps, Ref } from 'preact';\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from 'preact/compat';\nimport { useFormContext } from '../hooks/UNSAFE_useFormContext';\nimport { FormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { FocusableHandle, useFocusableTextField } from '../hooks/UNSAFE_useFocusableTextField';\nimport { Label } from '../UNSAFE_Label';\nimport {\n ReadonlyTextField,\n ReadonlyTextFieldInput,\n TextField,\n TextFieldInput\n} from '../UNSAFE_TextField';\nimport { useTextField } from '../hooks/UNSAFE_useTextField';\nimport {\n CompactUserAssistance,\n InlineUserAssistance,\n UserAssistanceDensityType\n} from '../UNSAFE_UserAssistance';\nimport { CountUnit, useLengthFilter } from '../hooks/UNSAFE_useLengthFilter';\nimport { MaxLengthLiveRegion } from '../UNSAFE_TextField';\nimport { useTextAreaAutosizing } from './useTextAreaAutosizing';\nimport { Size } from '../utils/UNSAFE_size';\nimport { useCurrentValueReducer } from '../hooks/UNSAFE_useCurrentValueReducer';\nimport { ValueUpdateDetail } from '../utils/UNSAFE_valueUpdateDetail';\nimport { MaxLengthCounter } from '../UNSAFE_TextArea';\nimport { useTranslationBundle } from '../hooks/UNSAFE_useTranslationBundle';\nimport { BundleType } from '../resources/nls/bundle';\nimport { ComponentMessageItem } from '../UNSAFE_ComponentMessage';\nimport { LayoutColumnSpan } from '../utils/UNSAFE_styles/Layout';\nimport type { TestIdProps } from '#hooks/UNSAFE_useTestId';\nimport { HiddenAccessible } from '../UNSAFE_HiddenAccessible';\nimport { useId } from '../hooks/UNSAFE_useId';\nimport { SelectableHandle, useSelectableTextField } from '#hooks/UNSAFE_useSelectableTextField';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\n\ntype TextFieldInputProps = ComponentProps<typeof TextFieldInput>;\ntype InlineUserAssistanceProps = ComponentProps<typeof InlineUserAssistance>;\n\ntype Props = TestIdProps & {\n /**\n * The ID of an element (or space separated IDs of multiple elements) that\n * describes the input.\n */\n 'aria-describedby'?: TextFieldInputProps['aria-describedby'];\n /**\n * Text to provide guidance to help the user understand what to enter.\n */\n assistiveText?: InlineUserAssistanceProps['assistiveText'];\n /**\n * Dictates component's autocomplete state.\n * This attribute indicates whether the value of the control can be automatically completed by the browser.\n * The common values are \"on\" and \"off\".\n */\n autoComplete?: TextFieldInputProps['autoComplete'];\n /**\n * Autofocus specifies whether the component will get focus when the page is loaded.\n * If it is set to true then the associated component will get input focus when the page is loaded.\n * Setting this property doesn't set the focus to the component; it tells the browser to focus\n * to it when the element is inserted in the document.\n */\n autoFocus?: TextFieldInputProps['autoFocus'];\n /**\n * Specifies how many columns to span in a FormLayout with direction === 'row'\n */\n columnSpan?: LayoutColumnSpan;\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 component is disabled.\n */\n isDisabled?: boolean;\n /**\n * Specifies whether the component is readonly.\n */\n isReadonly?: boolean;\n /**\n * Specifies for accessibility purposes whether a value is required.\n *\n * Setting this property to <code>false</code> means that a value is not required to be\n * committed by the user. Setting this property to <code>true</code> means that a value\n * is required to be committed by the user.\n */\n isRequired?: TextFieldInputProps['isRequired'];\n /**\n * Specifies whether to show an indicator on screen that a value is required, for example\n * before the user has committed a value.\n */\n isRequiredShown?: InlineUserAssistanceProps['isRequiredShown'];\n /**\n * Specifies the label associated with the field.\n */\n label: string;\n /**\n * Specifies where the label is positioned relative to the field.\n */\n labelEdge?: 'inside' | 'start' | 'top' | 'none';\n /**\n * Specifies the width of the label when <code>labelEdge</code> is <code>\"start\"</code>\n */\n labelStartWidth?: Size;\n /**\n * Specifies the maximum number of characters that can be entered in the input field.\n */\n maxLength?: number;\n /**\n * Determines whether the remaining number of characters that can be entered is shown or not.\n */\n maxLengthCounter?: 'none' | 'remaining';\n /**\n * Specifies how the input text characters are to be counted when maxLength is specified.\n */\n maxLengthUnit?: CountUnit;\n /**\n * Specifies the maximum number of rows that the TextAreaAutosize is allowed to grow to.\n * If maxRows is less than minRows, it is ignored.\n */\n maxRows?: number;\n /**\n * Messages to show on screen that are associated with the component.\n */\n messages?: InlineUserAssistanceProps['messages'];\n /**\n * Specifies the minimum number of rows that the TextAreaAutosize is allowed to shrink to.\n */\n minRows?: number;\n /**\n * A short hint to display before the user enters a value.\n */\n placeholder?: TextFieldInputProps['placeholder'];\n /**\n * Specifies how the user is allowed to manually resize the TextArea component.\n */\n role?: TextFieldInputProps['role'];\n /**\n * Specifies the number of rows to display\n */\n textAlign?: TextFieldInputProps['textAlign'];\n /**\n * Specifies the density of the user assistance presentation. It can be set to:\n * <ul>\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>'reflow'</code>: Show inline. Layout will reflow when text is displayed.</li>\n * <li><code>'compact'</code>: Messages, help, hints, and required will not be shown inline; they will show in a mode that keeps the screen more compact, like a popup for the messages, and a required icon to indicate Required. </li>\n * </ul>\n */\n userAssistanceDensity?: UserAssistanceDensityType;\n /**\n * The current display value of the component.\n */\n value?: TextFieldInputProps['value'];\n /**\n * The style variant of the component.\n */\n variant?: TextFieldInputProps['variant'];\n /**\n * Callback invoked when the user commits the entered value by blurring out of the field.\n *\n */\n onCommit?: TextFieldInputProps['onCommit'];\n\n /**\n * Callback invoked when the user inputs a value.\n *\n */\n onInput: TextFieldInputProps['onInput'];\n};\ntype FocusSelectHandle = FocusableHandle & SelectableHandle;\n/**\n * A text area auto size displays a field that allows a user to enter a multi-line text value, and will adjust its height based on its content.\n */\nexport const TextAreaAutosize = forwardRef(\n (\n {\n 'aria-describedby': ariaDescribedBy,\n assistiveText,\n autoComplete = 'off',\n autoFocus = false,\n columnSpan,\n helpSourceLink,\n helpSourceText,\n isDisabled: propIsDisabled,\n isReadonly: propIsReadonly,\n isRequired = false,\n isRequiredShown,\n label,\n labelEdge: propLabelEdge,\n labelStartWidth: propLabelStartWidth,\n maxLength,\n maxLengthCounter = 'remaining',\n maxLengthUnit,\n maxRows,\n messages,\n minRows = 2,\n placeholder,\n role,\n //TODO: Add counter to show the length remaining - JET-50752\n textAlign: propTextAlign,\n userAssistanceDensity: propUserAssistanceDensity,\n value,\n variant = 'default',\n onInput,\n onCommit,\n testId\n }: Props,\n ref?: Ref<FocusSelectHandle>\n ) => {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const formControl_limitReached = maxLength\n ? translations.formControl_limitReached({\n CHARACTER_LIMIT: maxLength\n })\n : '';\n\n const { currentCommitValue, dispatch } = useCurrentValueReducer({ value });\n const onInputAndDispatch = useCallback(\n (detail: ValueUpdateDetail<string>) => {\n // Should dispatch happen first? This will queue up a re-render, ordering should not cause issues (this is async)\n dispatch({ type: 'input', payload: detail.value });\n onInput?.(detail);\n },\n [onInput, dispatch]\n );\n const onCommitAndDispatch = useCallback(\n (detail: ValueUpdateDetail<string>) => {\n // Should dispatch happen first? This will queue up a re-render, ordering should not cause issues (this is async)\n dispatch({ type: 'commit', payload: detail.value });\n onCommit?.(detail);\n },\n [onCommit, dispatch]\n );\n const {\n isDisabled: isFormDisabled,\n isReadonly: isFormReadonly,\n labelEdge: formLabelEdge,\n labelStartWidth: formLabelStartWidth,\n textAlign: formTextAlign,\n userAssistanceDensity: formUserAssistanceDensity\n } = useFormContext();\n // default to FormContext values if component properties are not specified\n const isDisabled = propIsDisabled ?? isFormDisabled;\n const isReadonly = propIsReadonly ?? isFormReadonly;\n const labelEdge = propLabelEdge ?? formLabelEdge;\n const labelStartWidth = propLabelStartWidth ?? formLabelStartWidth;\n const textAlign = propTextAlign ?? formTextAlign;\n const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;\n const maxLengthDescribedByIdRef = useRef<string>(useId());\n // The enabledAriaDescribedBy includes the maxLengthDescribedById in addition to what was passed in to aria-describedby.\n // We don't need to announce the max length message for readonly, as it only applies when editing the value.\n const enabledAriaDescribedBy = ariaDescribedBy\n ? `${ariaDescribedBy} ${maxLengthDescribedByIdRef.current}`\n : maxLengthDescribedByIdRef.current;\n\n const enabledElementRef = useRef<HTMLTextAreaElement>(null);\n const readonlyElementRef = useRef<HTMLTextAreaElement | HTMLDivElement>(null);\n\n const {\n focusProps,\n isFocused,\n methods: focusMethods\n } = useFocusableTextField<HTMLTextAreaElement, HTMLTextAreaElement | HTMLDivElement>({\n isDisabled,\n isReadonly,\n enabledElementRef,\n readonlyElementRef\n });\n\n const { methods: selectMethods } =\n useSelectableTextField<HTMLTextAreaElement>(enabledElementRef);\n\n useImperativeHandle(ref!, () => mergeProps(focusMethods, selectMethods), [\n focusMethods,\n selectMethods\n ]);\n\n // Handle length filter for user-typed inputs and controlled inputs\n const { isMaxLengthReached, valueLength, onFilteredInput } = useLengthFilter({\n maxLength,\n maxLengthUnit,\n value,\n onInput: onInputAndDispatch,\n onCommit: onCommitAndDispatch\n });\n\n const limitMessage = [{ detail: formControl_limitReached, severity: 'info' }];\n const allMessages = [\n ...(messages ?? []),\n ...(isMaxLengthReached ? limitMessage : [])\n ] as ComponentMessageItem[];\n\n const { formFieldContext, inputProps, labelProps, textFieldProps, userAssistanceProps } =\n useTextField({\n ariaDescribedBy: isReadonly || isDisabled ? ariaDescribedBy : enabledAriaDescribedBy,\n contentVariant: 'textarea',\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isFocused,\n isReadonly,\n isRequiredShown,\n labelEdge,\n messages: allMessages,\n styleVariant: variant,\n userAssistanceDensity,\n value\n });\n\n const onClickCounter = useCallback(() => {\n const elm = enabledElementRef.current;\n // for setSelectionRange(), len needs to be a number or null.\n const len = elm ? elm.value.length : null;\n // Since the counter element is after the text, clicking in this\n // should put the selection at the end of the text\n enabledElementRef.current?.setSelectionRange(len, len);\n // Clicking the counter should put the focus on the input field\n enabledElementRef.current?.focus();\n }, [enabledElementRef]);\n\n const labelComp = labelEdge !== 'none' ? <Label {...labelProps}>{label}</Label> : undefined;\n\n const fieldLabelProps = {\n label: labelEdge !== 'none' ? labelComp : undefined,\n labelEdge: labelEdge !== 'none' ? labelEdge : undefined,\n labelStartWidth: labelEdge !== 'none' ? labelStartWidth : undefined\n };\n\n const ariaLabel = labelEdge === 'none' ? label : undefined;\n const isInlineDensity =\n userAssistanceDensity === 'efficient' || userAssistanceDensity === 'reflow';\n\n const inlineUserAssistance = isInlineDensity ? (\n isDisabled || isReadonly ? (\n // save space for user assistance if density is 'efficient', even though we don't\n // render user assistance for disabled or readonly fields\n userAssistanceDensity !== 'efficient' ? undefined : (\n <InlineUserAssistance\n userAssistanceDensity={userAssistanceDensity}\n {...userAssistanceProps}\n />\n )\n ) : (\n <InlineUserAssistance\n assistiveText={assistiveText}\n fieldLabel={label}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n messages={allMessages}\n isRequiredShown={isRequiredShown}\n userAssistanceDensity={userAssistanceDensity}\n {...userAssistanceProps}\n />\n )\n ) : undefined;\n\n const anchorRef = useRef<HTMLDivElement>(null);\n\n const compactUserAssistance =\n userAssistanceDensity === 'compact' ? (\n <CompactUserAssistance\n anchorRef={anchorRef}\n messages={allMessages}\n assistiveText={assistiveText}\n {...userAssistanceProps}\n />\n ) : undefined;\n\n useTextAreaAutosizing({\n isReadonly,\n enabledElementRef,\n readonlyElementRef,\n minRows,\n maxRows,\n value\n });\n\n if (isReadonly) {\n // TODO: should be able to configure whether start/end content is shown when readonly\n // JET-49916 - Preact InputText: show start/end content when readonly\n const mainContent = (\n <ReadonlyTextFieldInput\n aria-describedby={inputProps['aria-describedby']}\n aria-label={ariaLabel}\n aria-labelledby={labelProps.id}\n elementRef={readonlyElementRef}\n {...(maxRows ? { as: 'textarea', rows: minRows } : { as: 'div' })}\n autoFocus={autoFocus}\n textAlign={textAlign}\n value={value}\n variant=\"textarea\"\n hasEmptyLabel={label === '' && labelEdge === 'none'}\n hasInsideLabel={label !== undefined && labelEdge === 'inside'}\n />\n );\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n <ReadonlyTextField\n role=\"presentation\"\n columnSpan={columnSpan}\n compactUserAssistance={compactUserAssistance}\n inlineUserAssistance={inlineUserAssistance}\n variant=\"textarea\"\n mainContent={mainContent}\n ref={anchorRef}\n testId={testId}\n {...fieldLabelProps}\n />\n </FormFieldContext.Provider>\n );\n }\n const hasMaxLength = maxLength !== undefined;\n const mainContent = (\n <>\n <TextFieldInput\n as=\"textarea\"\n aria-label={ariaLabel}\n autoComplete={autoComplete}\n autoFocus={autoFocus}\n currentCommitValue={currentCommitValue}\n hasEmptyLabel={label === '' && labelEdge === 'none'}\n hasInsideLabel={labelComp !== undefined && labelEdge === 'inside'}\n isRequired={isRequired}\n inputRef={enabledElementRef}\n onCommit={onCommitAndDispatch}\n onInput={onFilteredInput}\n placeholder={placeholder}\n role={role}\n rows={minRows}\n textAlign={textAlign}\n value={value}\n {...inputProps}\n />\n {maxLengthCounter === 'remaining' && hasMaxLength && (\n <MaxLengthCounter\n maxLength={maxLength}\n valueLength={valueLength}\n onClick={onClickCounter}\n />\n )}\n {hasMaxLength && (\n <HiddenAccessible id={maxLengthDescribedByIdRef.current}>\n {translations.formControl_maxLength({\n MAX_LENGTH: `${maxLength}`\n })}\n </HiddenAccessible>\n )}\n {hasMaxLength && isFocused && (\n <MaxLengthLiveRegion\n maxLength={maxLength}\n valueLength={valueLength}\n testId={testId + '_remainingChars'}\n />\n )}\n </>\n );\n\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n <TextField\n mainContent={mainContent}\n columnSpan={columnSpan}\n compactUserAssistance={compactUserAssistance}\n inlineUserAssistance={inlineUserAssistance}\n onBlur={focusProps?.onFocusOut}\n onFocus={focusProps?.onFocusIn}\n mainFieldRef={anchorRef}\n testId={testId}\n {...textFieldProps}\n {...fieldLabelProps}\n />\n </FormFieldContext.Provider>\n );\n }\n);\n"],"names":["useTextAreaAutosizing","isReadonly","enabledElementRef","readonlyElementRef","minRows","maxRows","value","useLayoutEffect","textareaRef","current","HTMLDivElement","textarea","lineHeight","computedStyle","window","getComputedStyle","computedlineHeight","parseFloat","fontSize","calculateLineHeight","style","height","paddingHeight","borderHeight","cssStyle","paddingTop","paddingBottom","borderTop","borderBottom","getStylingHeight","heightForMinRows","scrollHeight","resizedHeight","undefined","heightForMaxRows","TextAreaAutosize","forwardRef","ariaDescribedBy","assistiveText","autoComplete","autoFocus","columnSpan","helpSourceLink","helpSourceText","isDisabled","propIsDisabled","propIsReadonly","isRequired","isRequiredShown","label","labelEdge","propLabelEdge","labelStartWidth","propLabelStartWidth","maxLength","maxLengthCounter","maxLengthUnit","messages","placeholder","role","textAlign","propTextAlign","userAssistanceDensity","propUserAssistanceDensity","variant","onInput","onCommit","testId","ref","translations","useTranslationBundle","formControl_limitReached","CHARACTER_LIMIT","currentCommitValue","dispatch","useCurrentValueReducer","onInputAndDispatch","useCallback","detail","type","payload","onCommitAndDispatch","isFormDisabled","isFormReadonly","formLabelEdge","formLabelStartWidth","formTextAlign","formUserAssistanceDensity","useFormContext","maxLengthDescribedByIdRef","useRef","useId","enabledAriaDescribedBy","focusProps","isFocused","methods","focusMethods","useFocusableTextField","selectMethods","useSelectableTextField","useImperativeHandle","mergeProps","isMaxLengthReached","valueLength","onFilteredInput","useLengthFilter","allMessages","severity","formFieldContext","inputProps","labelProps","textFieldProps","userAssistanceProps","useTextField","contentVariant","styleVariant","onClickCounter","elm","len","length","setSelectionRange","focus","labelComp","_jsx","jsx","Label","fieldLabelProps","ariaLabel","inlineUserAssistance","InlineUserAssistance","fieldLabel","anchorRef","compactUserAssistance","CompactUserAssistance","mainContent","ReadonlyTextFieldInput","id","elementRef","as","rows","hasEmptyLabel","hasInsideLabel","FormFieldContext","Provider","children","ReadonlyTextField","hasMaxLength","_jsxs","_Fragment","Fragment","TextFieldInput","inputRef","MaxLengthCounter","onClick","HiddenAccessible","formControl_maxLength","MAX_LENGTH","MaxLengthLiveRegion","TextField","onBlur","onFocusOut","onFocus","onFocusIn","mainFieldRef"],"mappings":"goDACO,MCeMA,EAAwB,EACnCC,aACAC,oBACAC,qBACAC,UAAU,EACVC,UACAC,YAEAC,EAAAA,iBAAgB,KACd,MAAMC,EAAcP,EAAaE,EAAqBD,EACtD,GAA4B,OAAxBM,EAAYC,QAAkB,OAClC,GAAID,EAAYC,mBAAmBC,eAAgB,OACnD,MAAMC,EAAWH,EAAYC,QACvBG,ED5ByB,CAACD,IAClC,MAAME,EAAgBC,OAAOC,iBAAiBJ,GACxCK,EAAqBH,EAAcD,WACzC,GAA2B,WAAvBI,EAMF,OAAO,I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YAAaA,GACb7F,WAAYA,EACZ2F,sBAAuBA,GACvBJ,qBAAsBA,GACtB+B,OAAQlE,IAAYmE,WACpBC,QAASpE,IAAYqE,UACrBC,aAAchC,GACdhE,OAAQA,KACJ4C,MACAe,MAGR"}
|
|
1
|
+
{"version":3,"file":"TextAreaAutosize-81449e46.js","sources":["../../src/UNSAFE_TextAreaAutosize/ScrollHeightUtils.tsx","../../src/UNSAFE_TextAreaAutosize/useTextAreaAutosizing.tsx","../../src/UNSAFE_TextAreaAutosize/TextAreaAutosize.tsx"],"sourcesContent":["// returns the lineHeight as a number of pixels.\nexport const calculateLineHeight = (textarea: HTMLTextAreaElement): number => {\n const computedStyle = window.getComputedStyle(textarea);\n const computedlineHeight = computedStyle.lineHeight;\n if (computedlineHeight === 'normal') {\n // We get 'normal' for values 'initial', 'inherit', 'unset' and 'normal'\n // TODO: Unclear if we need this.\n // getComputedStyle always return fontSize in pixels. Not likely a float, but since it's legal\n // we use parseFloat()\n const fontSize = parseFloat(computedStyle.fontSize);\n return 1.2 * fontSize;\n }\n return parseFloat(computedlineHeight);\n};\nexport const getStylingHeight = (textarea: HTMLTextAreaElement) => {\n const cssStyle = window.getComputedStyle(textarea);\n const paddingTop = parseFloat(cssStyle.paddingTop);\n const paddingBottom = parseFloat(cssStyle.paddingBottom);\n const borderTop = parseFloat(cssStyle.borderTop);\n const borderBottom = parseFloat(cssStyle.borderBottom);\n return { paddingHeight: paddingTop + paddingBottom, borderHeight: borderTop + borderBottom };\n};\n","import type { ComponentProps, RefObject } from 'preact';\nimport { useLayoutEffect } from 'preact/hooks';\nimport { calculateLineHeight, getStylingHeight } from './ScrollHeightUtils';\nimport { TextAreaAutosize } from './TextAreaAutosize';\n\ntype PickedPropsFromTextAreaAutosize = Pick<\n ComponentProps<typeof TextAreaAutosize>,\n 'minRows' | 'maxRows' | 'value'\n>;\ntype Props = PickedPropsFromTextAreaAutosize & {\n isReadonly?: boolean;\n enabledElementRef: RefObject<HTMLTextAreaElement>;\n readonlyElementRef: RefObject<HTMLTextAreaElement | HTMLDivElement>;\n};\n\n// TODO: Make this fire when the container resizes - JET-50840\nexport const useTextAreaAutosizing = ({\n isReadonly,\n enabledElementRef,\n readonlyElementRef,\n minRows = 2,\n maxRows,\n value\n}: Props) => {\n useLayoutEffect(() => {\n const textareaRef = isReadonly ? readonlyElementRef : enabledElementRef;\n if (textareaRef.current === null) return;\n if (textareaRef.current instanceof HTMLDivElement) return; // We don't need to do anything if the readonlyElement is a DIV.\n const textarea = textareaRef.current;\n const lineHeight = calculateLineHeight(textarea);\n textarea.style.height = '0';\n const { paddingHeight, borderHeight } = getStylingHeight(textarea);\n const heightForMinRows = lineHeight * minRows + paddingHeight + borderHeight;\n const scrollHeight = textarea.scrollHeight + borderHeight;\n let resizedHeight = 0;\n // if maxRows is -1 the textarea will grow or shrink to fit all the content.\n // it won't shrink any less than rows.\n if (maxRows === undefined) {\n // we want to fit the entire scrollHeight, but we don't want\n // to shrink smaller than the height for rows.\n if (scrollHeight < heightForMinRows) {\n resizedHeight = heightForMinRows;\n } else {\n resizedHeight = scrollHeight;\n }\n } else if (maxRows > minRows) {\n // if maxRows is positive and greater than rows, the textarea will grow to fit the content\n // up to maxrows, or shrink to fit the content and down to rows.\n const heightForMaxRows = lineHeight * maxRows + paddingHeight + borderHeight;\n if (scrollHeight > heightForMaxRows) {\n resizedHeight = heightForMaxRows;\n } else if (scrollHeight < heightForMinRows) {\n resizedHeight = heightForMinRows;\n } else {\n resizedHeight = scrollHeight;\n }\n } else {\n resizedHeight = heightForMinRows;\n }\n // The 0.5 gaurantees that the clientHeight will be bigger than the scrollHeight, so no scrollbar appears.\n textarea.style.height = resizedHeight + 0.5 + 'px';\n }, [value, minRows, maxRows, isReadonly, enabledElementRef, readonlyElementRef]);\n};\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { ComponentProps, Ref } from 'preact';\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from 'preact/compat';\nimport { useFormContext } from '../hooks/UNSAFE_useFormContext';\nimport { FormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { FocusableHandle, useFocusableTextField } from '../hooks/UNSAFE_useFocusableTextField';\nimport { Label } from '../UNSAFE_Label';\nimport {\n ReadonlyTextField,\n ReadonlyTextFieldInput,\n TextField,\n TextFieldInput\n} from '../UNSAFE_TextField';\nimport { useTextField } from '../hooks/UNSAFE_useTextField';\nimport {\n CompactUserAssistance,\n InlineUserAssistance,\n UserAssistanceDensityType\n} from '../UNSAFE_UserAssistance';\nimport { CountUnit, useLengthFilter } from '../hooks/UNSAFE_useLengthFilter';\nimport { MaxLengthLiveRegion } from '../UNSAFE_TextField';\nimport { useTextAreaAutosizing } from './useTextAreaAutosizing';\nimport { Size } from '../utils/UNSAFE_size';\nimport { useCurrentValueReducer } from '../hooks/UNSAFE_useCurrentValueReducer';\nimport { ValueUpdateDetail } from '../utils/UNSAFE_valueUpdateDetail';\nimport { MaxLengthCounter } from '../UNSAFE_TextArea';\nimport { useTranslationBundle } from '../hooks/UNSAFE_useTranslationBundle';\nimport { BundleType } from '../resources/nls/bundle';\nimport { ComponentMessageItem } from '../UNSAFE_ComponentMessage';\nimport { LayoutColumnSpan } from '../utils/UNSAFE_styles/Layout';\nimport type { TestIdProps } from '#hooks/UNSAFE_useTestId';\nimport { HiddenAccessible } from '../UNSAFE_HiddenAccessible';\nimport { useId } from '../hooks/UNSAFE_useId';\nimport { SelectableHandle, useSelectableTextField } from '#hooks/UNSAFE_useSelectableTextField';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\n\ntype TextFieldInputProps = ComponentProps<typeof TextFieldInput>;\ntype InlineUserAssistanceProps = ComponentProps<typeof InlineUserAssistance>;\n\ntype Props = TestIdProps & {\n /**\n * The ID of an element (or space separated IDs of multiple elements) that\n * describes the input.\n */\n 'aria-describedby'?: TextFieldInputProps['aria-describedby'];\n /**\n * Text to provide guidance to help the user understand what to enter.\n */\n assistiveText?: InlineUserAssistanceProps['assistiveText'];\n /**\n * Dictates component's autocomplete state.\n * This attribute indicates whether the value of the control can be automatically completed by the browser.\n * The common values are \"on\" and \"off\".\n */\n autoComplete?: TextFieldInputProps['autoComplete'];\n /**\n * Autofocus specifies whether the component will get focus when the page is loaded.\n * If it is set to true then the associated component will get input focus when the page is loaded.\n * Setting this property doesn't set the focus to the component; it tells the browser to focus\n * to it when the element is inserted in the document.\n */\n autoFocus?: TextFieldInputProps['autoFocus'];\n /**\n * Specifies how many columns to span in a FormLayout with direction === 'row'\n */\n columnSpan?: LayoutColumnSpan;\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 component is disabled.\n */\n isDisabled?: boolean;\n /**\n * Specifies whether the component is readonly.\n */\n isReadonly?: boolean;\n /**\n * Specifies for accessibility purposes whether a value is required.\n *\n * Setting this property to <code>false</code> means that a value is not required to be\n * committed by the user. Setting this property to <code>true</code> means that a value\n * is required to be committed by the user.\n */\n isRequired?: TextFieldInputProps['isRequired'];\n /**\n * Specifies whether to show an indicator on screen that a value is required, for example\n * before the user has committed a value.\n */\n isRequiredShown?: InlineUserAssistanceProps['isRequiredShown'];\n /**\n * Specifies the label associated with the field.\n */\n label: string;\n /**\n * Specifies where the label is positioned relative to the field.\n */\n labelEdge?: 'inside' | 'start' | 'top' | 'none';\n /**\n * Specifies the width of the label when <code>labelEdge</code> is <code>\"start\"</code>\n */\n labelStartWidth?: Size;\n /**\n * Specifies the maximum number of characters that can be entered in the input field.\n */\n maxLength?: number;\n /**\n * Determines whether the remaining number of characters that can be entered is shown or not.\n */\n maxLengthCounter?: 'none' | 'remaining';\n /**\n * Specifies how the input text characters are to be counted when maxLength is specified.\n */\n maxLengthUnit?: CountUnit;\n /**\n * Specifies the maximum number of rows that the TextAreaAutosize is allowed to grow to.\n * If maxRows is less than minRows, it is ignored.\n */\n maxRows?: number;\n /**\n * Messages to show on screen that are associated with the component.\n */\n messages?: InlineUserAssistanceProps['messages'];\n /**\n * Specifies the minimum number of rows that the TextAreaAutosize is allowed to shrink to.\n */\n minRows?: number;\n /**\n * A short hint to display before the user enters a value.\n */\n placeholder?: TextFieldInputProps['placeholder'];\n /**\n * Specifies how the user is allowed to manually resize the TextArea component.\n */\n role?: TextFieldInputProps['role'];\n /**\n * Specifies the number of rows to display\n */\n textAlign?: TextFieldInputProps['textAlign'];\n /**\n * Specifies the density of the user assistance presentation. It can be set to:\n * <ul>\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>'reflow'</code>: Show inline. Layout will reflow when text is displayed.</li>\n * <li><code>'compact'</code>: Messages, help, hints, and required will not be shown inline; they will show in a mode that keeps the screen more compact, like a popup for the messages, and a required icon to indicate Required. </li>\n * </ul>\n */\n userAssistanceDensity?: UserAssistanceDensityType;\n /**\n * The current display value of the component.\n */\n value?: TextFieldInputProps['value'];\n /**\n * The style variant of the component.\n */\n variant?: TextFieldInputProps['variant'];\n /**\n * Callback invoked when the user commits the entered value by blurring out of the field.\n *\n */\n onCommit?: TextFieldInputProps['onCommit'];\n\n /**\n * Callback invoked when the user inputs a value.\n *\n */\n onInput: TextFieldInputProps['onInput'];\n};\ntype FocusSelectHandle = FocusableHandle & SelectableHandle;\n/**\n * A text area auto size displays a field that allows a user to enter a multi-line text value, and will adjust its height based on its content.\n */\nexport const TextAreaAutosize = forwardRef(\n (\n {\n 'aria-describedby': ariaDescribedBy,\n assistiveText,\n autoComplete = 'off',\n autoFocus = false,\n columnSpan,\n helpSourceLink,\n helpSourceText,\n isDisabled: propIsDisabled,\n isReadonly: propIsReadonly,\n isRequired = false,\n isRequiredShown,\n label,\n labelEdge: propLabelEdge,\n labelStartWidth: propLabelStartWidth,\n maxLength,\n maxLengthCounter = 'remaining',\n maxLengthUnit,\n maxRows,\n messages,\n minRows = 2,\n placeholder,\n role,\n //TODO: Add counter to show the length remaining - JET-50752\n textAlign: propTextAlign,\n userAssistanceDensity: propUserAssistanceDensity,\n value,\n variant = 'default',\n onInput,\n onCommit,\n testId\n }: Props,\n ref?: Ref<FocusSelectHandle>\n ) => {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const formControl_limitReached = maxLength\n ? translations.formControl_limitReached({\n CHARACTER_LIMIT: maxLength\n })\n : '';\n\n const { currentCommitValue, dispatch } = useCurrentValueReducer({ value });\n const onInputAndDispatch = useCallback(\n (detail: ValueUpdateDetail<string>) => {\n // Should dispatch happen first? This will queue up a re-render, ordering should not cause issues (this is async)\n dispatch({ type: 'input', payload: detail.value });\n onInput?.(detail);\n },\n [onInput, dispatch]\n );\n const onCommitAndDispatch = useCallback(\n (detail: ValueUpdateDetail<string>) => {\n // Should dispatch happen first? This will queue up a re-render, ordering should not cause issues (this is async)\n dispatch({ type: 'commit', payload: detail.value });\n onCommit?.(detail);\n },\n [onCommit, dispatch]\n );\n const {\n isDisabled: isFormDisabled,\n isReadonly: isFormReadonly,\n labelEdge: formLabelEdge,\n labelStartWidth: formLabelStartWidth,\n textAlign: formTextAlign,\n userAssistanceDensity: formUserAssistanceDensity\n } = useFormContext();\n // default to FormContext values if component properties are not specified\n const isDisabled = propIsDisabled ?? isFormDisabled;\n const isReadonly = propIsReadonly ?? isFormReadonly;\n const labelEdge = propLabelEdge ?? formLabelEdge;\n const labelStartWidth = propLabelStartWidth ?? formLabelStartWidth;\n const textAlign = propTextAlign ?? formTextAlign;\n const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;\n const maxLengthDescribedByIdRef = useRef<string>(useId());\n // The enabledAriaDescribedBy includes the maxLengthDescribedById in addition to what was passed in to aria-describedby.\n // We don't need to announce the max length message for readonly, as it only applies when editing the value.\n const enabledAriaDescribedBy = ariaDescribedBy\n ? `${ariaDescribedBy} ${maxLengthDescribedByIdRef.current}`\n : maxLengthDescribedByIdRef.current;\n\n const enabledElementRef = useRef<HTMLTextAreaElement>(null);\n const readonlyElementRef = useRef<HTMLTextAreaElement | HTMLDivElement>(null);\n\n const {\n focusProps,\n isFocused,\n methods: focusMethods\n } = useFocusableTextField<HTMLTextAreaElement, HTMLTextAreaElement | HTMLDivElement>({\n isDisabled,\n isReadonly,\n enabledElementRef,\n readonlyElementRef\n });\n\n const { methods: selectMethods } =\n useSelectableTextField<HTMLTextAreaElement>(enabledElementRef);\n\n useImperativeHandle(ref!, () => mergeProps(focusMethods, selectMethods), [\n focusMethods,\n selectMethods\n ]);\n\n // Handle length filter for user-typed inputs and controlled inputs\n const { isMaxLengthReached, valueLength, onFilteredInput } = useLengthFilter({\n maxLength,\n maxLengthUnit,\n value,\n onInput: onInputAndDispatch,\n onCommit: onCommitAndDispatch\n });\n\n const limitMessage = [{ detail: formControl_limitReached, severity: 'info' }];\n const allMessages = [\n ...(messages ?? []),\n ...(isMaxLengthReached ? limitMessage : [])\n ] as ComponentMessageItem[];\n\n const { formFieldContext, inputProps, labelProps, textFieldProps, userAssistanceProps } =\n useTextField({\n ariaDescribedBy: isReadonly || isDisabled ? ariaDescribedBy : enabledAriaDescribedBy,\n contentVariant: 'textarea',\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isFocused,\n isReadonly,\n isRequiredShown,\n labelEdge,\n messages: allMessages,\n styleVariant: variant,\n userAssistanceDensity,\n value\n });\n\n const onClickCounter = useCallback(() => {\n const elm = enabledElementRef.current;\n // for setSelectionRange(), len needs to be a number or null.\n const len = elm ? elm.value.length : null;\n // Since the counter element is after the text, clicking in this\n // should put the selection at the end of the text\n enabledElementRef.current?.setSelectionRange(len, len);\n // Clicking the counter should put the focus on the input field\n enabledElementRef.current?.focus();\n }, [enabledElementRef]);\n\n const labelComp = labelEdge !== 'none' ? <Label {...labelProps}>{label}</Label> : undefined;\n\n const fieldLabelProps = {\n label: labelEdge !== 'none' ? labelComp : undefined,\n labelEdge: labelEdge !== 'none' ? labelEdge : undefined,\n labelStartWidth: labelEdge !== 'none' ? labelStartWidth : undefined\n };\n\n const ariaLabel = labelEdge === 'none' ? label : undefined;\n const isInlineDensity =\n userAssistanceDensity === 'efficient' || userAssistanceDensity === 'reflow';\n\n const inlineUserAssistance = isInlineDensity ? (\n isDisabled || isReadonly ? (\n // save space for user assistance if density is 'efficient', even though we don't\n // render user assistance for disabled or readonly fields\n userAssistanceDensity !== 'efficient' ? undefined : (\n <InlineUserAssistance\n userAssistanceDensity={userAssistanceDensity}\n {...userAssistanceProps}\n />\n )\n ) : (\n <InlineUserAssistance\n assistiveText={assistiveText}\n fieldLabel={label}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n messages={allMessages}\n isRequiredShown={isRequiredShown}\n userAssistanceDensity={userAssistanceDensity}\n {...userAssistanceProps}\n />\n )\n ) : undefined;\n\n const anchorRef = useRef<HTMLDivElement>(null);\n\n const compactUserAssistance =\n userAssistanceDensity === 'compact' ? (\n <CompactUserAssistance\n anchorRef={anchorRef}\n messages={allMessages}\n assistiveText={assistiveText}\n {...userAssistanceProps}\n />\n ) : undefined;\n\n useTextAreaAutosizing({\n isReadonly,\n enabledElementRef,\n readonlyElementRef,\n minRows,\n maxRows,\n value\n });\n\n if (isReadonly) {\n // TODO: should be able to configure whether start/end content is shown when readonly\n // JET-49916 - Preact InputText: show start/end content when readonly\n const mainContent = (\n <ReadonlyTextFieldInput\n aria-describedby={inputProps['aria-describedby']}\n aria-label={ariaLabel}\n aria-labelledby={labelProps.id}\n elementRef={readonlyElementRef}\n {...(maxRows ? { as: 'textarea', rows: minRows } : { as: 'div' })}\n autoFocus={autoFocus}\n textAlign={textAlign}\n value={value}\n variant=\"textarea\"\n hasEmptyLabel={label === '' && labelEdge === 'none'}\n hasInsideLabel={label !== undefined && labelEdge === 'inside'}\n />\n );\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n <ReadonlyTextField\n role=\"presentation\"\n columnSpan={columnSpan}\n compactUserAssistance={compactUserAssistance}\n inlineUserAssistance={inlineUserAssistance}\n variant=\"textarea\"\n mainContent={mainContent}\n ref={anchorRef}\n testId={testId}\n {...fieldLabelProps}\n />\n </FormFieldContext.Provider>\n );\n }\n const hasMaxLength = maxLength !== undefined;\n const mainContent = (\n <>\n <TextFieldInput\n as=\"textarea\"\n aria-label={ariaLabel}\n autoComplete={autoComplete}\n autoFocus={autoFocus}\n currentCommitValue={currentCommitValue}\n hasEmptyLabel={label === '' && labelEdge === 'none'}\n hasInsideLabel={labelComp !== undefined && labelEdge === 'inside'}\n isRequired={isRequired}\n inputRef={enabledElementRef}\n onCommit={onCommitAndDispatch}\n onInput={onFilteredInput}\n placeholder={placeholder}\n role={role}\n rows={minRows}\n textAlign={textAlign}\n value={value}\n {...inputProps}\n />\n {maxLengthCounter === 'remaining' && hasMaxLength && (\n <MaxLengthCounter\n maxLength={maxLength}\n valueLength={valueLength}\n onClick={onClickCounter}\n />\n )}\n {hasMaxLength && (\n <HiddenAccessible id={maxLengthDescribedByIdRef.current}>\n {translations.formControl_maxLength({\n MAX_LENGTH: `${maxLength}`\n })}\n </HiddenAccessible>\n )}\n {hasMaxLength && isFocused && (\n <MaxLengthLiveRegion\n maxLength={maxLength}\n valueLength={valueLength}\n testId={testId + '_remainingChars'}\n />\n )}\n </>\n );\n\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n <TextField\n mainContent={mainContent}\n columnSpan={columnSpan}\n compactUserAssistance={compactUserAssistance}\n inlineUserAssistance={inlineUserAssistance}\n onBlur={focusProps?.onFocusOut}\n onFocus={focusProps?.onFocusIn}\n mainFieldRef={anchorRef}\n testId={testId}\n {...textFieldProps}\n {...fieldLabelProps}\n />\n </FormFieldContext.Provider>\n );\n }\n);\n"],"names":["useTextAreaAutosizing","isReadonly","enabledElementRef","readonlyElementRef","minRows","maxRows","value","useLayoutEffect","textareaRef","current","HTMLDivElement","textarea","lineHeight","computedStyle","window","getComputedStyle","computedlineHeight","parseFloat","fontSize","calculateLineHeight","style","height","paddingHeight","borderHeight","cssStyle","paddingTop","paddingBottom","borderTop","borderBottom","getStylingHeight","heightForMinRows","scrollHeight","resizedHeight","undefined","heightForMaxRows","TextAreaAutosize","forwardRef","ariaDescribedBy","assistiveText","autoComplete","autoFocus","columnSpan","helpSourceLink","helpSourceText","isDisabled","propIsDisabled","propIsReadonly","isRequired","isRequiredShown","label","labelEdge","propLabelEdge","labelStartWidth","propLabelStartWidth","maxLength","maxLengthCounter","maxLengthUnit","messages","placeholder","role","textAlign","propTextAlign","userAssistanceDensity","propUserAssistanceDensity","variant","onInput","onCommit","testId","ref","translations","useTranslationBundle","formControl_limitReached","CHARACTER_LIMIT","currentCommitValue","dispatch","useCurrentValueReducer","onInputAndDispatch","useCallback","detail","type","payload","onCommitAndDispatch","isFormDisabled","isFormReadonly","formLabelEdge","formLabelStartWidth","formTextAlign","formUserAssistanceDensity","useFormContext","maxLengthDescribedByIdRef","useRef","useId","enabledAriaDescribedBy","focusProps","isFocused","methods","focusMethods","useFocusableTextField","selectMethods","useSelectableTextField","useImperativeHandle","mergeProps","isMaxLengthReached","valueLength","onFilteredInput","useLengthFilter","allMessages","severity","formFieldContext","inputProps","labelProps","textFieldProps","userAssistanceProps","useTextField","contentVariant","styleVariant","onClickCounter","elm","len","length","setSelectionRange","focus","labelComp","_jsx","jsx","Label","fieldLabelProps","ariaLabel","inlineUserAssistance","InlineUserAssistance","fieldLabel","anchorRef","compactUserAssistance","CompactUserAssistance","mainContent","ReadonlyTextFieldInput","id","elementRef","as","rows","hasEmptyLabel","hasInsideLabel","FormFieldContext","Provider","children","ReadonlyTextField","hasMaxLength","_jsxs","_Fragment","Fragment","TextFieldInput","inputRef","MaxLengthCounter","onClick","HiddenAccessible","formControl_maxLength","MAX_LENGTH","MaxLengthLiveRegion","TextField","onBlur","onFocusOut","onFocus","onFocusIn","mainFieldRef"],"mappings":"woDAC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