@oracle/oraclejet-preact 18.1.4 → 18.1.5
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/InputDatePicker-ecd4a7ce.js +2 -0
- package/amd/{InputDatePicker-cf7e7ea3.js.map → InputDatePicker-ecd4a7ce.js.map} +1 -1
- package/amd/Legend-6fa54628.js +2 -0
- package/amd/Legend-6fa54628.js.map +1 -0
- package/amd/LegendRendered-d8626509.js.map +1 -1
- package/amd/MaxLengthCounter-9a95922c.js +2 -0
- package/amd/MaxLengthCounter-9a95922c.js.map +1 -0
- package/amd/TextArea-f6b13c73.js +2 -0
- package/amd/TextArea-f6b13c73.js.map +1 -0
- package/amd/TextAreaAutosize-af350c32.js +2 -0
- package/amd/{TextAreaAutosize-b7e56051.js.map → TextAreaAutosize-af350c32.js.map} +1 -1
- package/amd/Theme-redwood/theme.css +130 -130
- package/amd/Theme-stable/theme.css +254 -254
- package/amd/UNSAFE_InputDatePicker.js +1 -1
- package/amd/UNSAFE_Legend.js +1 -1
- package/amd/UNSAFE_TextArea.js +1 -1
- package/amd/UNSAFE_TextAreaAutosize.js +1 -1
- package/cjs/CheckboxSetContext-c62db26d.js +12 -0
- package/{es/CheckboxSetContext-1be56556.js.map → cjs/CheckboxSetContext-c62db26d.js.map} +1 -1
- package/cjs/{InputDatePicker-6c8cbbf7.js → InputDatePicker-3dace90c.js} +2 -2
- package/cjs/{InputDatePicker-6c8cbbf7.js.map → InputDatePicker-3dace90c.js.map} +1 -1
- package/cjs/{Legend-743ebb76.js → Legend-7e72e911.js} +4 -4
- package/cjs/Legend-7e72e911.js.map +1 -0
- package/cjs/LegendRendered-c12152bc.js.map +1 -1
- package/cjs/MaxLengthCounter-9ab3f74b.js +27 -0
- package/cjs/MaxLengthCounter-9ab3f74b.js.map +1 -0
- package/cjs/{TextArea-f4a84aab.js → TextArea-a11875f3.js} +4 -22
- package/cjs/TextArea-a11875f3.js.map +1 -0
- package/cjs/{TextAreaAutosize-08ca17cf.js → TextAreaAutosize-5a8e8335.js} +3 -3
- package/cjs/{TextAreaAutosize-08ca17cf.js.map → TextAreaAutosize-5a8e8335.js.map} +1 -1
- package/cjs/Theme-redwood/theme.css +182 -182
- package/cjs/Theme-stable/theme.css +205 -205
- package/cjs/UNSAFE_CheckboxItem.js +30 -82
- 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_InputDatePicker.js +90 -90
- package/cjs/UNSAFE_Legend.js +1 -1
- package/cjs/UNSAFE_RichCheckboxSet.js +26 -29
- package/cjs/UNSAFE_RichCheckboxSet.js.map +1 -1
- package/cjs/UNSAFE_RichSelectionItem.js +46 -184
- package/cjs/UNSAFE_RichSelectionItem.js.map +1 -1
- package/cjs/UNSAFE_TextArea.js +4 -3
- package/cjs/UNSAFE_TextArea.js.map +1 -1
- package/cjs/UNSAFE_TextAreaAutosize.js +3 -3
- package/es/CheckboxSet-28953b25.js +49 -0
- package/{cjs/CheckboxSet-abbf7a03.js.map → es/CheckboxSet-28953b25.js.map} +1 -1
- package/es/InputPassword-fa63ac17.js +1 -1
- package/es/{Legend-a60126aa.js → Legend-0e274097.js} +4 -4
- package/es/Legend-0e274097.js.map +1 -0
- package/es/LegendRendered-65a3684e.js.map +1 -1
- package/es/MaxLengthCounter-181b4fc9.js +25 -0
- package/es/MaxLengthCounter-181b4fc9.js.map +1 -0
- package/es/{NavigationListItem-07f041e6.js → NavigationListItem-37edc23b.js} +1 -14
- package/es/{NavigationListItem-07f041e6.js.map → NavigationListItem-37edc23b.js.map} +1 -1
- package/es/{OverflowTabBar-c920e944.js → OverflowTabBar-87b36877.js} +2 -2
- package/es/{OverflowTabBar-c920e944.js.map → OverflowTabBar-87b36877.js.map} +1 -1
- package/es/{OverflowTabBarItem-ccfa49a3.js → OverflowTabBarItem-a2684d2b.js} +2 -2
- package/es/{OverflowTabBarItem-ccfa49a3.js.map → OverflowTabBarItem-a2684d2b.js.map} +1 -1
- package/es/PRIVATE_RevealToggleIcon.js +2 -2
- package/es/{RevealToggleIcon-2f49fd19.js → RevealToggleIcon-35baaadf.js} +2 -2
- package/es/{RevealToggleIcon-2f49fd19.js.map → RevealToggleIcon-35baaadf.js.map} +1 -1
- package/es/SplitMenuButtonTheme.styles.css +4 -4
- package/es/SplitMenuButtonTheme.styles2.css +4 -4
- package/es/{TextArea-d7eb6b00.js → TextArea-2eb362ec.js} +8 -25
- package/es/TextArea-2eb362ec.js.map +1 -0
- package/es/{TextAreaAutosize-301eb2b7.js → TextAreaAutosize-35a923c3.js} +2 -2
- package/es/{TextAreaAutosize-301eb2b7.js.map → TextAreaAutosize-35a923c3.js.map} +1 -1
- package/es/Theme-redwood/theme.css +545 -545
- package/es/Theme-stable/theme.css +483 -483
- package/es/UNSAFE_ButtonLayout/tests/ButtonLayout.spec.js +1 -1
- package/es/UNSAFE_CheckboxItem.js +82 -30
- package/es/UNSAFE_CheckboxItem.js.map +1 -1
- package/es/UNSAFE_CheckboxSet.js +10 -44
- package/es/UNSAFE_CheckboxSet.js.map +1 -1
- package/es/UNSAFE_InputPassword.js +1 -1
- package/es/UNSAFE_InputSensitiveText.js +1 -1
- package/es/UNSAFE_Legend.js +1 -1
- package/es/UNSAFE_NavigationList.js +4 -4
- package/es/UNSAFE_OverflowTabBar.js +3 -3
- package/es/UNSAFE_RichCheckboxSet.js +28 -25
- package/es/UNSAFE_RichCheckboxSet.js.map +1 -1
- package/es/UNSAFE_RichSelectionItem.js +182 -44
- package/es/UNSAFE_RichSelectionItem.js.map +1 -1
- package/es/UNSAFE_SplitMenuButton/themes/redwood/SplitMenuButtonTheme.css.js +1 -1
- package/es/UNSAFE_SplitMenuButton/themes/stable/SplitMenuButtonTheme.css.js +1 -1
- package/es/UNSAFE_SplitMenuButton.js +1 -1
- package/es/UNSAFE_TabBar.js +2 -2
- package/es/UNSAFE_TabBarCommon.js +2 -2
- package/es/UNSAFE_TabBarMixed.js +2 -2
- package/es/UNSAFE_TextArea.js +3 -2
- 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/package.json +2 -2
- package/types/hooks/UNSAFE_useLegendPreferredSize/LegendRendered.d.ts +1 -1
- package/amd/InputDatePicker-cf7e7ea3.js +0 -2
- package/amd/Legend-76df298c.js +0 -2
- package/amd/Legend-76df298c.js.map +0 -1
- package/amd/TextArea-d69acd23.js +0 -2
- package/amd/TextArea-d69acd23.js.map +0 -1
- package/amd/TextAreaAutosize-b7e56051.js +0 -2
- package/cjs/CheckboxSet-abbf7a03.js +0 -53
- package/cjs/Legend-743ebb76.js.map +0 -1
- package/cjs/TextArea-f4a84aab.js.map +0 -1
- package/es/CheckboxSetContext-1be56556.js +0 -9
- package/es/Legend-a60126aa.js.map +0 -1
- package/es/TextArea-d7eb6b00.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Legend-7e72e911.js","sources":["../../src/UNSAFE_Legend/legendNavUtils.ts","../../src/UNSAFE_Legend/getLegendLayout.ts","../../src/UNSAFE_Legend/Legend.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 {\n ItemActionDetail,\n ItemFocusDetail,\n ItemHoverDetail,\n ItemInfo,\n LegendItemData\n} from '#utils/UNSAFE_visTypes/legend';\n\nfunction getItem<K, D extends LegendItemData<K>>(itemInfo: ItemInfo, items: D[]) {\n const { itemIdx } = itemInfo;\n\n if (itemIdx == -1) {\n return items[items.length - 1];\n }\n return items[itemIdx];\n}\n\nfunction getNextItemInfo<K>(itemInfo: ItemInfo, items: LegendItemData<K>[]) {\n let itemIdx = itemInfo.itemIdx;\n\n if (itemIdx == -1) {\n itemIdx = items.length - 1;\n }\n\n itemIdx = Math.min(items.length - 1, itemIdx + 1);\n if (items[itemIdx].actionable !== 'off') {\n return { sectionIdx: 0, itemIdx };\n } else if (itemIdx === items.length - 1) {\n itemIdx = itemIdx - 1;\n return { sectionIdx: 0, itemIdx };\n }\n\n return getNextItemInfo({ sectionIdx: 0, itemIdx }, items);\n}\n\nfunction getPrevItemInfo<K>(itemInfo: ItemInfo, items: LegendItemData<K>[]) {\n let itemIdx = itemInfo.itemIdx;\n\n if (itemIdx == -1) {\n itemIdx = items.length - 1;\n }\n\n itemIdx = Math.max(0, itemIdx - 1);\n if (items[itemIdx].actionable !== 'off') {\n return { sectionIdx: 0, itemIdx };\n }\n\n return getPrevItemInfo({ sectionIdx: 0, itemIdx }, items);\n}\n\n/**\n * Returns utils functions for navigation in simple legend.\n * @param items\n * @returns\n */\nexport function getLegendNavUtils<K extends string | number, D extends LegendItemData<K>>(\n items: D[]\n) {\n return {\n getItem: (itemInfo: ItemInfo) => {\n return getItem(itemInfo, items);\n },\n getDetailFromInfo: (\n itemInfo?: ItemInfo\n ): ItemFocusDetail<K, D> | ItemHoverDetail<K, D> | ItemActionDetail<K, D> => {\n if (!itemInfo || items.length === 0) {\n return { itemId: undefined, data: undefined };\n }\n const item = getItem(itemInfo, items);\n return { itemId: item.id, data: item };\n },\n getPrevItemInfo: (itemInfo: ItemInfo) => {\n return getPrevItemInfo(itemInfo, items);\n },\n getNextItemInfo: (itemInfo: ItemInfo) => {\n return getNextItemInfo(itemInfo, items);\n }\n };\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 { LegendItemData } from '#utils/UNSAFE_visTypes/legend';\nimport { Font, TextDimensions, useTextDimensions } from '#hooks/PRIVATE_useTextDimensions';\nimport { getGridNums } from '#utils/PRIVATE_legendUtils/legendUtils';\n\ntype Props<K> = {\n width: number;\n getTextDimensions?: ((textString: string, font?: Font | undefined) => TextDimensions) | undefined;\n resolvedVars: Record<string, any>;\n orientation?: 'vertical' | 'horizontal';\n legendFontStylesObj?: Font;\n symbolWidth?: number;\n symbolHeight?: number;\n items: LegendItemData<K>[];\n};\nexport type LayoutInfo = {\n totalWidth: number;\n maxItemWidth: number;\n maxItemHeight: number;\n itemsPerRow: number;\n isWrapped?: boolean;\n};\ntype getTextDimensionsType = NonNullable<\n NonNullable<ReturnType<typeof useTextDimensions>>['getTextDimensions']\n>;\n\nexport const getLinearLegendLayoutInfo = <K>({\n width,\n getTextDimensions,\n resolvedVars,\n orientation,\n legendFontStylesObj = {},\n symbolWidth,\n items\n}: Props<K>) => {\n let maxWidth = 0;\n let maxHeight = 0;\n let totalWidth = 0;\n let isWrapped = false;\n\n const containerWidth = width;\n\n if (!Object.keys(resolvedVars).length || !getTextDimensions) {\n return;\n }\n\n const unitLength = parseFloat(resolvedVars['unit']);\n\n const { maxItemWidth, maxItemHeight, horizontalSectionWidth } = getMaxWidth(\n items,\n unitLength,\n getTextDimensions,\n legendFontStylesObj,\n symbolWidth\n );\n totalWidth = horizontalSectionWidth;\n maxWidth = maxItemWidth;\n maxHeight = maxItemHeight;\n isWrapped = horizontalSectionWidth > containerWidth!;\n\n const legendLayoutInfo = {\n totalWidth,\n maxItemWidth: Math.min(maxWidth, containerWidth!),\n maxItemHeight: maxHeight,\n itemsPerRow:\n orientation === 'vertical' ? 1 : Math.max(1, Math.floor(containerWidth / maxWidth)),\n isWrapped\n };\n\n return legendLayoutInfo;\n};\n\n/**\n * Returns maximum of the width among the items in a section of legend also return the width of the entire section.\n * @param items Legend items array\n * @param unitLength Base element\n * @param getTextDimensions Text width measurement function\n * @param legendFontStylesObj Legend text font style properties object\n * @param symbolWidth Width of legend symbol\n *\n * @returns\n */\nconst getMaxWidth = <K>(\n items: LegendItemData<K>[],\n unitLength: number,\n getTextDimensions: getTextDimensionsType,\n legendFontStylesObj?: Font,\n symbolWidth?: number,\n symbolHeight?: number\n) => {\n let maxItemWidth = 0;\n let maxItemHeight = 0;\n let horizontalSectionWidth = 0;\n let itemSymbolWidth = 0;\n let itemSymbolHeight = 0;\n if (symbolWidth) {\n itemSymbolWidth = unitLength * 1.5 + symbolWidth;\n } else {\n //itemSymbolWidth = marginLeft + marginRight + width below expression is simplified\n itemSymbolWidth = 4 * unitLength;\n }\n\n if (symbolHeight) {\n // symbolHeight/defaultSymbolHeight + symbolPaddingTopBottom\n itemSymbolHeight = symbolHeight + unitLength * 1.7;\n } else {\n // symbolHeight/defaultSymbolHeight + symbolPaddingTopBottom\n itemSymbolHeight = 2.5 * unitLength + unitLength * 1.7;\n }\n\n items?.forEach((item) => {\n const legendItem = item as LegendItemData<K>;\n const { width, height } = getTextDimensions(legendItem.text, legendFontStylesObj);\n //itemTextWidth = paddingLeft + paddingRight + width\n const itemTextWidth = unitLength * 2.5 + width;\n //horizontalSectionWidth = total width of the section\n horizontalSectionWidth += itemSymbolWidth + itemTextWidth;\n maxItemWidth = Math.max(maxItemWidth, itemSymbolWidth + itemTextWidth);\n maxItemHeight = Math.max(maxItemHeight, height, itemSymbolHeight);\n });\n\n return { maxItemWidth, maxItemHeight, horizontalSectionWidth };\n};\n\nexport function _getPreferredSize<K>(\n _width: number,\n _height: number,\n items: LegendItemData<K>[],\n resolvedVars: Record<string, any>,\n orientation: 'vertical' | 'horizontal',\n legendFontStylesObj: Record<string, any>,\n symbolWidth?: number,\n symbolHeight?: number,\n getTextDimensions?: (textString: string, font?: Font | undefined) => TextDimensions\n) {\n if (!getTextDimensions) {\n return undefined;\n }\n const layoutInfo = getLinearLegendLayoutInfo({\n width: _width,\n getTextDimensions,\n resolvedVars,\n orientation,\n legendFontStylesObj,\n symbolWidth: symbolWidth,\n symbolHeight: symbolHeight,\n items\n });\n const { itemsPerCol, itemsPerRow } = getGridNums(items.length, layoutInfo, orientation);\n const unitLength = parseFloat(resolvedVars['unit']);\n const preferredWidth = Math.min(\n _width,\n itemsPerCol === 1\n ? layoutInfo!.totalWidth\n : itemsPerRow\n ? layoutInfo!.maxItemWidth * itemsPerRow!\n : layoutInfo!.totalWidth\n );\n const paddingLegendItems = 0.8 * unitLength;\n const paddingLegendTopBottom = 1.5 * unitLength;\n\n const legendHeight = itemsPerCol\n ? layoutInfo!.maxItemHeight * itemsPerCol! +\n (itemsPerCol! - 1) * paddingLegendItems +\n paddingLegendTopBottom\n : layoutInfo!.maxItemHeight + paddingLegendTopBottom;\n const preferredHeight = Math.min(_height, legendHeight);\n\n return { width: Math.ceil(preferredWidth), height: Math.ceil(preferredHeight) };\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { Ref, VNode } from 'preact';\nimport { useContext, useMemo, useRef, useState } from 'preact/hooks';\nimport { BaseLegend } from '#PRIVATE_BaseLegend/BaseLegend';\nimport { useVisEvent } from '#hooks/PRIVATE_useVisEvents/useVisEvents';\nimport { LegendProps, LegendDragStartDetail } from './legend.type';\nimport { getLegendNavUtils } from './legendNavUtils';\nimport {\n getAriaProps,\n getDatatipText,\n getGridNums,\n getIsLegendItemActionable,\n getItemInfo,\n getLegendTextStyle,\n isEqualItem\n} from '#utils/PRIVATE_legendUtils/legendUtils';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\nimport { useLegendDatatip } from './useLegendDatatip';\nimport { useItemFocus } from '#hooks/PRIVATE_useVisEvents';\nimport { styles } from '#PRIVATE_BaseLegend/themes/LegendStyles.css';\nimport { useCssVars } from '#hooks/PRIVATE_useCssVars';\nimport { legendVars, getKeyUpHandler } from '#utils/PRIVATE_legendUtils/legendUtils';\nimport { classNames } from '#utils/UNSAFE_classNames';\nimport { useTestId } from '#hooks/UNSAFE_useTestId';\nimport { useLegendContextMenu } from '#PRIVATE_BaseLegend/useLegendContextMenu';\nimport {\n ItemFocusDetail,\n ItemActionDetail,\n ItemInfo,\n LegendItemData\n} from '#utils/UNSAFE_visTypes/legend';\nimport { useVisTouchResponse } from '#hooks/PRIVATE_useVisTouchResponse';\nimport { merge } from '#utils/UNSAFE_stringUtils';\nimport { forwardRef, useImperativeHandle } from 'preact/compat';\nimport { TrackResizeContainer } from '#UNSAFE_TrackResizeContainer';\nimport { useTextDimensions } from '#hooks/PRIVATE_useTextDimensions';\nimport { _getPreferredSize, getLinearLegendLayoutInfo } from './getLegendLayout';\nimport { useLegendDnd } from '#hooks/PRIVATE_useLegendDnD/useLegendDnd';\nimport { styles as VisDndStyles } from '#hooks/PRIVATE_useVisDnd/themes/VisDndStyles.css';\nimport { LegendRenderedContext } from '#hooks/UNSAFE_useLegendPreferredSize';\n\nexport type SizeHandle = {\n _getPreferredSize: (\n _width: number,\n _height: number\n ) => { width: number; height: number } | undefined;\n};\n\ntype ForwardRefLegend = <K extends string | number, D extends LegendItemData<K>>(\n props: LegendProps<K, D> & { ref?: Ref<SizeHandle> }\n) => VNode | null;\n\n/**\n * A legend displays an interactive description of symbols, colors, etc., used in graphical information representations.\n */\nexport const Legend = forwardRef(\n <K extends string | number, D extends LegendItemData<K>>(\n {\n orientation = 'horizontal',\n items,\n isReadOnly = true,\n onItemAction,\n onItemHover,\n onItemFocus,\n testId,\n contextMenuConfig,\n hideAndShowBehavior = 'off',\n hoverBehavior = 'none',\n halign = 'start',\n valign = 'top',\n ...props\n }: LegendProps<K, D>,\n ref: Ref<SizeHandle> = null\n ) => {\n // Use the context\n const { isGetPreferredSizeReady, width, height } = useContext(LegendRenderedContext);\n const { textMeasureContent, getTextDimensions } = useTextDimensions();\n const { resolvedVars, cssContent } = useCssVars(legendVars);\n\n const legendFontStylesObj = getLegendTextStyle(\n {\n fontStyle: props.textFontStyle,\n fontSize: props.textFontSize?.toString(),\n fontWeight: props.textFontWeight?.toString(),\n fontFamily: props.textFontFamily\n },\n resolvedVars\n );\n const rootRef = useRef<HTMLDivElement>(null);\n\n useImperativeHandle(\n ref!,\n () => ({\n _getPreferredSize: (_width: number, _height: number) => {\n return _getPreferredSize(\n _width,\n _height,\n items,\n resolvedVars,\n orientation,\n legendFontStylesObj,\n props.symbolWidth,\n props.symbolHeight,\n getTextDimensions\n );\n }\n }),\n [\n getTextDimensions,\n resolvedVars,\n orientation,\n legendFontStylesObj,\n props.symbolWidth,\n props.symbolHeight,\n items\n ]\n );\n\n if (\n getTextDimensions &&\n resolvedVars['unit'] != undefined &&\n resolvedVars['fontSize'] != undefined\n ) {\n isGetPreferredSizeReady?.(true);\n }\n\n const testIdProps = useTestId(testId);\n const isTestEnv = testIdProps['data-testid'] !== undefined;\n const rootDimsRef = useRef<DOMRect>();\n const { getItem, getDetailFromInfo, getPrevItemInfo, getNextItemInfo } = getLegendNavUtils<\n K,\n D\n >(items);\n\n const isLegendItemActionable = getIsLegendItemActionable(items, isReadOnly);\n const hasData = items.length > 0;\n\n const legendKeyUpHandler = (\n triggerOnAction: () => void,\n updatefocusedItemInfo: (itemInfo: ItemInfo) => void,\n focusedItemInfo: ItemInfo\n ) =>\n getKeyUpHandler(\n triggerOnAction,\n updatefocusedItemInfo,\n focusedItemInfo,\n props.hiddenIds != null\n );\n\n const { touchResponse, touchResponseStyle } = useVisTouchResponse({\n type: 'touchStart'\n });\n const { focusedItemInfo, hoveredItemInfo, onContextMenuDismissed, activeId, eventsProps } =\n useVisEvent<ItemInfo, ItemActionDetail<K, D>, ItemFocusDetail<K, D>, D>(\n touchResponse,\n !isReadOnly,\n isLegendItemActionable,\n legendKeyUpHandler,\n getDetailFromInfo,\n getPrevItemInfo,\n getNextItemInfo,\n onItemAction,\n onItemHover,\n onItemFocus,\n isEqualItem,\n getItemInfo,\n { itemIdx: 0, sectionIdx: 0 },\n props.hiddenIds != null\n );\n\n const { focusedItemRef } = useItemFocus(focusedItemInfo);\n const datatipText = getDatatipText(items, getItem, focusedItemInfo, hoveredItemInfo);\n const [datatipDisabled, setDatatipDisabled] = useState(false);\n const {\n datatipContent,\n datatipProps: { 'aria-describedby': datatipAriaDescribedby, ...datatipProps }\n } = useLegendDatatip({\n text: datatipText,\n rootDimsRef,\n focusedItemInfo,\n focusedItemRef,\n touchResponse,\n isDisabled: datatipDisabled\n });\n\n const ariaProps = getAriaProps<K>(\n isReadOnly,\n props['aria-label'],\n props.hiddenIds,\n merge([props['aria-describedby'], datatipAriaDescribedby]),\n props['aria-labelledby']\n );\n\n const { contextMenuContent, contextMenuProps } = useLegendContextMenu<D>({\n rootRef,\n contextMenuConfig: hasData ? contextMenuConfig : undefined,\n focusedItemInfo,\n items,\n isReadOnly,\n onContextMenuDismissed\n });\n\n const [dragOver, setDragOver] = useState<boolean>();\n\n const { draggable, dndProps, dndContent } = useLegendDnd<K, D, LegendDragStartDetail<D>>({\n onDrag: props.onDrag,\n onDragStart: props.onDragStart,\n onDragEnd: props.onDragEnd,\n onDragEnter: props.onDragEnter,\n onDragLeave: props.onDragLeave,\n onDragOver: props.onDragOver,\n onDrop: props.onDrop,\n items,\n setDragOver,\n setDatatipDisabled,\n itemDraggable: props.itemDraggable\n });\n\n const mergedProps = mergeProps(eventsProps, datatipProps, contextMenuProps, dndProps);\n const { legendStyle, renderedLegendStyle } = styles;\n\n return (\n <>\n {!isGetPreferredSizeReady && (\n <TrackResizeContainer\n width={width ? `${width}px` : '100%'}\n height={height ? `${height}px` : '100%'}\n class={classNames([\n styles.flexStyle,\n styles[`${halign}HAlign`],\n styles[`${valign}VAlign`]\n ])}>\n {function _(width) {\n const layoutInfo = useMemo(\n () =>\n getLinearLegendLayoutInfo<K>({\n width,\n getTextDimensions,\n resolvedVars,\n orientation,\n legendFontStylesObj,\n symbolWidth: props.symbolWidth,\n symbolHeight: props.symbolHeight,\n items\n }),\n [width]\n );\n const { itemsPerCol, itemsPerRow } = getGridNums(items.length, layoutInfo);\n return (\n <>\n <div\n ref={rootRef}\n tabIndex={isReadOnly ? undefined : 0}\n role=\"application\"\n draggable={draggable}\n class={classNames([\n legendStyle,\n renderedLegendStyle,\n dragOver\n ? VisDndStyles.dndDragOverHTMLStyle\n : dragOver === false\n ? VisDndStyles.dndRejectedStyle\n : undefined\n ])}\n style={touchResponseStyle}\n {...testIdProps}\n {...ariaProps}\n {...mergedProps}\n aria-activedescendant={activeId}>\n <BaseLegend\n {...props}\n focusedItemRef={focusedItemRef}\n items={items}\n isReadOnly={isReadOnly}\n orientation={orientation}\n sectionIdx={0}\n itemsPerRow={itemsPerRow}\n itemsPerCol={itemsPerCol}\n itemWidth={layoutInfo?.isWrapped ? layoutInfo?.maxItemWidth : undefined}\n focusedItemInfo={focusedItemInfo}\n hoveredItemInfo={hoveredItemInfo}\n activeId={activeId}\n hideAndShowBehavior={hideAndShowBehavior}\n hoverBehavior={hoverBehavior}\n isTestEnv={isTestEnv}\n />\n </div>\n {datatipContent}\n {contextMenuContent}\n {dndContent}\n </>\n );\n }}\n </TrackResizeContainer>\n )}\n {textMeasureContent}\n {cssContent}\n </>\n );\n }\n) as ForwardRefLegend;\n"],"names":["getGridNums","forwardRef","useContext","LegendRenderedContext","useTextDimensions","useCssVars","legendVars","getLegendTextStyle","useRef","useImperativeHandle","useTestId","getIsLegendItemActionable","getKeyUpHandler","useVisTouchResponse","useVisEvent","isEqualItem","getItemInfo","useItemFocus","getDatatipText","useState","useLegendDatatip","getAriaProps","merge","useLegendContextMenu","useLegendDnd","mergeProps","styles","_jsxs","_Fragment","_jsx","TrackResizeContainer","classNames","useMemo","VisDndStyles","BaseLegend"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAMG;AAUH,SAAS,OAAO,CAAiC,QAAkB,EAAE,KAAU,EAAA;AAC7E,IAAA,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC;AAE7B,IAAA,IAAI,OAAO,IAAI,CAAC,CAAC,EAAE;QACjB,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC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QACE2B,eAAA,CAAAC,mBAAA,EAAA,EAAA,QAAA,EAAA,CACEC,cACE,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,UAAU,GAAG,SAAS,GAAG,CAAC,EACpC,IAAI,EAAC,aAAa,EAClB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAEE,qBAAU,CAAC;oCAChB,WAAW;oCACX,mBAAmB;oCACnB,QAAQ;0CACJE,sDAAY,CAAC,oBAAoB;0CACjC,QAAQ,KAAK,KAAK;8CAClBA,sDAAY,CAAC,gBAAgB;AAC/B,8CAAE,SAAS;iCACd,CAAC,EACF,KAAK,EAAE,kBAAkB,KACrB,WAAW,EAAA,GACX,SAAS,EACT,GAAA,WAAW,2BACQ,QAAQ,EAAA,QAAA,EAC/BJ,eAACK,+BAAU,EAAA,EAAA,GACL,KAAK,EACT,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,CAAC,EACb,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,UAAU,EAAE,SAAS,GAAG,UAAU,EAAE,YAAY,GAAG,SAAS,EACvE,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,EAAE,mBAAmB,EACxC,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,CAAA,EAAA,CACE,EACL,cAAc,EACd,kBAAkB,EAClB,UAAU,CACV,EAAA,CAAA,EACH;iBACH,EAAA,CACoB,CACxB,EACA,kBAAkB,EAClB,UAAU,CAAA,EAAA,CACV,EACH;AACJ,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendRendered-c12152bc.js","sources":["../../src/hooks/UNSAFE_useLegendPreferredSize/LegendRendered.ts"],"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 { createContext } from 'preact/compat';\n\ntype LegendRenderedContextType = {\n
|
|
1
|
+
{"version":3,"file":"LegendRendered-c12152bc.js","sources":["../../src/hooks/UNSAFE_useLegendPreferredSize/LegendRendered.ts"],"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 { createContext } from 'preact/compat';\n\ntype LegendRenderedContextType = {\n isGetPreferredSizeReady?: (isReady: boolean) => void;\n width?: number;\n height?: number;\n};\n\nexport const LegendRenderedContext = createContext<LegendRenderedContextType>({});\n"],"names":["createContext"],"mappings":";;;;;AAAA;;;;;;AAMG;MAUU,qBAAqB,GAAGA,oBAAa,CAA4B,EAAE;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* @oracle/oraclejet-preact: undefined */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('preact/jsx-runtime');
|
|
5
|
+
var hooks = require('preact/hooks');
|
|
6
|
+
var classNames = require('./classNames-c14c6ef3.js');
|
|
7
|
+
var usePress = require('./usePress-886180e4.js');
|
|
8
|
+
require('./FormFieldContext-8418dc68.js');
|
|
9
|
+
var useFormFieldContext = require('./useFormFieldContext-20f419ef.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var hide = 'MaxLengthCounterStyles_hide__7dy9j71';
|
|
13
|
+
var maxLengthCounterBase = 'MaxLengthCounterStyles_maxLengthCounterBase__7dy9j70';
|
|
14
|
+
var spanStyles = 'MaxLengthCounterStyles_spanStyles__7dy9j72';
|
|
15
|
+
|
|
16
|
+
const noop = () => { };
|
|
17
|
+
function MaxLengthCounter({ maxLength, valueLength = 0, onClick }) {
|
|
18
|
+
const { isFocused } = useFormFieldContext.useFormFieldContext();
|
|
19
|
+
// We don't want mousedown on this component to do anything, so prevent the default behavior.
|
|
20
|
+
const killEvent = hooks.useCallback((event) => event.preventDefault(), []);
|
|
21
|
+
const textClasses = classNames.classNames([!isFocused && hide]);
|
|
22
|
+
const { pressProps } = usePress.usePress(onClick ?? noop);
|
|
23
|
+
return (jsxRuntime.jsx("div", { class: maxLengthCounterBase, onMouseDown: killEvent, ...pressProps, children: jsxRuntime.jsxs("span", { class: textClasses, children: [jsxRuntime.jsx("span", { class: spanStyles, children: valueLength }), jsxRuntime.jsx("span", { class: spanStyles, children: "/" }), jsxRuntime.jsx("span", { class: spanStyles, children: maxLength })] }) }));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
exports.MaxLengthCounter = MaxLengthCounter;
|
|
27
|
+
//# sourceMappingURL=MaxLengthCounter-9ab3f74b.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaxLengthCounter-9ab3f74b.js","sources":["../../src/UNSAFE_TextArea/MaxLengthCounter.tsx"],"sourcesContent":["import { useCallback } from 'preact/hooks';\n\nimport { classNames } from '../utils/UNSAFE_classNames';\nimport { usePress } from '../hooks/UNSAFE_usePress';\nimport { useFormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { hide, maxLengthCounterBase, spanStyles } from './MaxLengthCounterStyles.css';\n\ntype Props = {\n maxLength: number;\n valueLength?: number;\n onClick?: () => void; // the calling component should focus on the appropriate element when clicked.\n};\n\nconst noop = () => {};\n\nexport function MaxLengthCounter({ maxLength, valueLength = 0, onClick }: Props) {\n const { isFocused } = useFormFieldContext();\n // We don't want mousedown on this component to do anything, so prevent the default behavior.\n const killEvent = useCallback((event: Event) => event.preventDefault(), []);\n const textClasses = classNames([!isFocused && hide]);\n const { pressProps } = usePress(onClick ?? noop);\n return (\n <div class={maxLengthCounterBase} onMouseDown={killEvent} {...pressProps}>\n <span class={textClasses}>\n <span class={spanStyles}>{valueLength}</span>\n <span class={spanStyles}>/</span>\n <span class={spanStyles}>{maxLength}</span>\n </span>\n </div>\n );\n}\n"],"names":["useFormFieldContext","useCallback","classNames","usePress","_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAM,IAAI,GAAG,MAAK,GAAG,CAAC;AAEhB,SAAU,gBAAgB,CAAC,EAAE,SAAS,EAAE,WAAW,GAAG,CAAC,EAAE,OAAO,EAAS,EAAA;AAC7E,IAAA,MAAM,EAAE,SAAS,EAAE,GAAGA,uCAAmB,EAAE,CAAC;;AAE5C,IAAA,MAAM,SAAS,GAAGC,iBAAW,CAAC,CAAC,KAAY,KAAK,KAAK,CAAC,cAAc,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5E,MAAM,WAAW,GAAGC,qBAAU,CAAC,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC;IACrD,MAAM,EAAE,UAAU,EAAE,GAAGC,iBAAQ,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC;AACjD,IAAA,QACEC,cAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,SAAS,EAAM,GAAA,UAAU,YACtEC,eAAM,CAAA,MAAA,EAAA,EAAA,KAAK,EAAE,WAAW,EAAA,QAAA,EAAA,CACtBD,yBAAM,KAAK,EAAE,UAAU,EAAA,QAAA,EAAG,WAAW,EAAQ,CAAA,EAC7CA,yBAAM,KAAK,EAAE,UAAU,EAAU,QAAA,EAAA,GAAA,EAAA,CAAA,EACjCA,yBAAM,KAAK,EAAE,UAAU,EAAG,QAAA,EAAA,SAAS,GAAQ,CACtC,EAAA,CAAA,EAAA,CACH,EACN;AACJ;;;;"}
|
|
@@ -6,7 +6,7 @@ var compat = require('preact/compat');
|
|
|
6
6
|
require('./FormContext-9452bd30.js');
|
|
7
7
|
var useFormContext = require('./useFormContext-4c3091dc.js');
|
|
8
8
|
var FormFieldContext = require('./FormFieldContext-8418dc68.js');
|
|
9
|
-
|
|
9
|
+
require('preact/hooks');
|
|
10
10
|
var useFocusableTextField = require('./useFocusableTextField-2c36840d.js');
|
|
11
11
|
var Label = require('./Label-2e05c87f.js');
|
|
12
12
|
require('./keyboardUtils-c071859a.js');
|
|
@@ -43,27 +43,10 @@ var HiddenAccessible = require('./HiddenAccessible-087eb49a.js');
|
|
|
43
43
|
|
|
44
44
|
require('./UNSAFE_Popup/themes/redwood/PopupVariants.css.js');
|
|
45
45
|
var useLengthFilter = require('./useLengthFilter-d4cb6f47.js');
|
|
46
|
-
var
|
|
47
|
-
var usePress = require('./usePress-886180e4.js');
|
|
48
|
-
var useFormFieldContext = require('./useFormFieldContext-20f419ef.js');
|
|
49
|
-
|
|
46
|
+
var MaxLengthCounter = require('./MaxLengthCounter-9ab3f74b.js');
|
|
50
47
|
var useCurrentValueReducer = require('./useCurrentValueReducer-f37ac024.js');
|
|
51
48
|
var useSelectableTextField = require('./useSelectableTextField-892b62db.js');
|
|
52
49
|
|
|
53
|
-
var hide = 'MaxLengthCounterStyles_hide__7dy9j71';
|
|
54
|
-
var maxLengthCounterBase = 'MaxLengthCounterStyles_maxLengthCounterBase__7dy9j70';
|
|
55
|
-
var spanStyles = 'MaxLengthCounterStyles_spanStyles__7dy9j72';
|
|
56
|
-
|
|
57
|
-
const noop = () => { };
|
|
58
|
-
function MaxLengthCounter({ maxLength, valueLength = 0, onClick }) {
|
|
59
|
-
const { isFocused } = useFormFieldContext.useFormFieldContext();
|
|
60
|
-
// We don't want mousedown on this component to do anything, so prevent the default behavior.
|
|
61
|
-
const killEvent = hooks.useCallback((event) => event.preventDefault(), []);
|
|
62
|
-
const textClasses = classNames.classNames([!isFocused && hide]);
|
|
63
|
-
const { pressProps } = usePress.usePress(onClick ?? noop);
|
|
64
|
-
return (jsxRuntime.jsx("div", { class: maxLengthCounterBase, onMouseDown: killEvent, ...pressProps, children: jsxRuntime.jsxs("span", { class: textClasses, children: [jsxRuntime.jsx("span", { class: spanStyles, children: valueLength }), jsxRuntime.jsx("span", { class: spanStyles, children: "/" }), jsxRuntime.jsx("span", { class: spanStyles, children: maxLength })] }) }));
|
|
65
|
-
}
|
|
66
|
-
|
|
67
50
|
/**
|
|
68
51
|
* A text area displays a field that allows a user to enter a multi-line text value.
|
|
69
52
|
*/
|
|
@@ -169,12 +152,11 @@ const TextArea = compat.forwardRef(({ 'aria-describedby': ariaDescribedBy, assis
|
|
|
169
152
|
return (jsxRuntime.jsx(FormFieldContext.FormFieldContext.Provider, { value: formFieldContext, children: jsxRuntime.jsx(StyledTextField.ReadonlyTextField, { role: "presentation", columnSpan: columnSpan, compactUserAssistance: compactUserAssistance, inlineUserAssistance: inlineUserAssistance, ref: anchorRef, testId: testId, variant: "textarea", mainContent: mainContent, resize: resize, ...fieldLabelProps }) }));
|
|
170
153
|
}
|
|
171
154
|
const hasMaxLength = maxLength !== undefined;
|
|
172
|
-
const mainContent = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(TextFieldInput.TextFieldInput, { as: "textarea", "aria-label": ariaLabel, autoComplete: autoComplete, autoFocus: autoFocus, currentCommitValue: currentCommitValue, hasEmptyLabel: label === '' && labelEdge === 'none', hasInsideLabel: labelComp !== undefined && labelEdge === 'inside', isRequired: isRequired, inputRef: enabledElementRef, onCommit: onCommitAndDispatch, onInput: onFilteredInput, placeholder: placeholder, role: role, rows: rows, textAlign: textAlign, value: value, ...inputProps }), maxLengthCounter === 'remaining' && hasMaxLength && (jsxRuntime.jsx(MaxLengthCounter, { maxLength: maxLength, valueLength: valueLength, onClick: onClickCounter })), hasMaxLength && (jsxRuntime.jsx(HiddenAccessible.HiddenAccessible, { id: maxLengthDescribedByIdRef.current, isHidden: true, children: translations.formControl_maxLength({
|
|
155
|
+
const mainContent = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(TextFieldInput.TextFieldInput, { as: "textarea", "aria-label": ariaLabel, autoComplete: autoComplete, autoFocus: autoFocus, currentCommitValue: currentCommitValue, hasEmptyLabel: label === '' && labelEdge === 'none', hasInsideLabel: labelComp !== undefined && labelEdge === 'inside', isRequired: isRequired, inputRef: enabledElementRef, onCommit: onCommitAndDispatch, onInput: onFilteredInput, placeholder: placeholder, role: role, rows: rows, textAlign: textAlign, value: value, ...inputProps }), maxLengthCounter === 'remaining' && hasMaxLength && (jsxRuntime.jsx(MaxLengthCounter.MaxLengthCounter, { maxLength: maxLength, valueLength: valueLength, onClick: onClickCounter })), hasMaxLength && (jsxRuntime.jsx(HiddenAccessible.HiddenAccessible, { id: maxLengthDescribedByIdRef.current, isHidden: true, children: translations.formControl_maxLength({
|
|
173
156
|
MAX_LENGTH: `${maxLength}`
|
|
174
157
|
}) })), hasMaxLength && isFocused && (jsxRuntime.jsx(MaxLengthLiveRegion.MaxLengthLiveRegion, { maxLength: maxLength, valueLength: valueLength, testId: testId + '_remainingChars' }))] }));
|
|
175
158
|
return (jsxRuntime.jsx(FormFieldContext.FormFieldContext.Provider, { value: formFieldContext, children: jsxRuntime.jsx(TextField.TextField, { mainContent: mainContent, columnSpan: columnSpan, compactUserAssistance: compactUserAssistance, inlineUserAssistance: inlineUserAssistance, onBlur: focusProps?.onFocusOut, onFocus: focusProps?.onFocusIn, mainFieldRef: anchorRef, resize: resize, testId: testId, ...textFieldProps, ...fieldLabelProps }) }));
|
|
176
159
|
});
|
|
177
160
|
|
|
178
|
-
exports.MaxLengthCounter = MaxLengthCounter;
|
|
179
161
|
exports.TextArea = TextArea;
|
|
180
|
-
//# sourceMappingURL=TextArea-
|
|
162
|
+
//# sourceMappingURL=TextArea-a11875f3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextArea-a11875f3.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":["forwardRef","useTranslationBundle","useCurrentValueReducer","useCallback","useFormContext","useRef","useId","useFocusableTextField","useSelectableTextField","useImperativeHandle","mergeProps","useLengthFilter","useTextField","_jsx","Label","InlineUserAssistance","CompactUserAssistance","ReadonlyTextFieldInput","FormFieldContext","ReadonlyTextField","_jsxs","_Fragment","TextFieldInput","MaxLengthCounter","HiddenAccessible","MaxLengthLiveRegion","TextField"],"mappings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Z,cAAC,CAAAK,iCAAgB,CAAC,QAAQ,EAAC,EAAA,KAAK,EAAE,gBAAgB,EAChD,QAAA,EAAAL,cAAA,CAACa,mBAAS,EAAA,EACR,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,qBAAqB,EAAE,qBAAqB,EAC5C,oBAAoB,EAAE,oBAAoB,EAC1C,MAAM,EAAE,UAAU,EAAE,UAAU,EAC9B,OAAO,EAAE,UAAU,EAAE,SAAS,EAC9B,YAAY,EAAE,SAAS,EACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EAAA,GACV,cAAc,EAAA,GACd,eAAe,EAAA,CAAc,EACT,CAAA,EAC5B;AACJ,CAAC;;;;"}
|
|
@@ -44,8 +44,8 @@ var HiddenAccessible = require('./HiddenAccessible-087eb49a.js');
|
|
|
44
44
|
require('./UNSAFE_Popup/themes/redwood/PopupVariants.css.js');
|
|
45
45
|
var useLengthFilter = require('./useLengthFilter-d4cb6f47.js');
|
|
46
46
|
var useCurrentValueReducer = require('./useCurrentValueReducer-f37ac024.js');
|
|
47
|
-
var TextArea = require('./TextArea-f4a84aab.js');
|
|
48
47
|
var useSelectableTextField = require('./useSelectableTextField-892b62db.js');
|
|
48
|
+
var MaxLengthCounter = require('./MaxLengthCounter-9ab3f74b.js');
|
|
49
49
|
|
|
50
50
|
// returns the lineHeight as a number of pixels.
|
|
51
51
|
const calculateLineHeight = (textarea) => {
|
|
@@ -236,11 +236,11 @@ textAlign: propTextAlign, userAssistanceDensity: propUserAssistanceDensity, valu
|
|
|
236
236
|
return (jsxRuntime.jsx(FormFieldContext.FormFieldContext.Provider, { value: formFieldContext, children: jsxRuntime.jsx(StyledTextField.ReadonlyTextField, { role: "presentation", columnSpan: columnSpan, compactUserAssistance: compactUserAssistance, inlineUserAssistance: inlineUserAssistance, variant: "textarea", mainContent: mainContent, ref: anchorRef, testId: testId, ...fieldLabelProps }) }));
|
|
237
237
|
}
|
|
238
238
|
const hasMaxLength = maxLength !== undefined;
|
|
239
|
-
const mainContent = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(TextFieldInput.TextFieldInput, { as: "textarea", "aria-label": ariaLabel, autoComplete: autoComplete, autoFocus: autoFocus, currentCommitValue: currentCommitValue, hasEmptyLabel: label === '' && labelEdge === 'none', hasInsideLabel: labelComp !== undefined && labelEdge === 'inside', isRequired: isRequired, inputRef: enabledElementRef, onCommit: onCommitAndDispatch, onInput: onFilteredInput, placeholder: placeholder, role: role, rows: minRows, textAlign: textAlign, value: value, ...inputProps }), maxLengthCounter === 'remaining' && hasMaxLength && (jsxRuntime.jsx(
|
|
239
|
+
const mainContent = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(TextFieldInput.TextFieldInput, { as: "textarea", "aria-label": ariaLabel, autoComplete: autoComplete, autoFocus: autoFocus, currentCommitValue: currentCommitValue, hasEmptyLabel: label === '' && labelEdge === 'none', hasInsideLabel: labelComp !== undefined && labelEdge === 'inside', isRequired: isRequired, inputRef: enabledElementRef, onCommit: onCommitAndDispatch, onInput: onFilteredInput, placeholder: placeholder, role: role, rows: minRows, textAlign: textAlign, value: value, ...inputProps }), maxLengthCounter === 'remaining' && hasMaxLength && (jsxRuntime.jsx(MaxLengthCounter.MaxLengthCounter, { maxLength: maxLength, valueLength: valueLength, onClick: onClickCounter })), hasMaxLength && (jsxRuntime.jsx(HiddenAccessible.HiddenAccessible, { id: maxLengthDescribedByIdRef.current, children: translations.formControl_maxLength({
|
|
240
240
|
MAX_LENGTH: `${maxLength}`
|
|
241
241
|
}) })), hasMaxLength && isFocused && (jsxRuntime.jsx(MaxLengthLiveRegion.MaxLengthLiveRegion, { maxLength: maxLength, valueLength: valueLength, testId: testId + '_remainingChars' }))] }));
|
|
242
242
|
return (jsxRuntime.jsx(FormFieldContext.FormFieldContext.Provider, { value: formFieldContext, children: jsxRuntime.jsx(TextField.TextField, { mainContent: mainContent, columnSpan: columnSpan, compactUserAssistance: compactUserAssistance, inlineUserAssistance: inlineUserAssistance, onBlur: focusProps?.onFocusOut, onFocus: focusProps?.onFocusIn, mainFieldRef: anchorRef, testId: testId, ...textFieldProps, ...fieldLabelProps }) }));
|
|
243
243
|
});
|
|
244
244
|
|
|
245
245
|
exports.TextAreaAutosize = TextAreaAutosize;
|
|
246
|
-
//# sourceMappingURL=TextAreaAutosize-
|
|
246
|
+
//# sourceMappingURL=TextAreaAutosize-5a8e8335.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextAreaAutosize-08ca17cf.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":["useLayoutEffect","forwardRef","useTranslationBundle","useCurrentValueReducer","useCallback","useFormContext","useRef","useId","useFocusableTextField","useSelectableTextField","useImperativeHandle","mergeProps","useLengthFilter","useTextField","_jsx","Label","InlineUserAssistance","CompactUserAssistance","ReadonlyTextFieldInput","FormFieldContext","ReadonlyTextField","_jsxs","_Fragment","TextFieldInput","MaxLengthCounter","HiddenAccessible","MaxLengthLiveRegion","TextField"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACO,MAAM,mBAAmB,GAAG,CAAC,QAA6B,KAAY;IAC3E,MAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AACxD,IAAA,MAAM,kBAAkB,GAAG,aAAa,CAAC,UAAU,CAAC;AACpD,IAAA,IAAI,kBAAkB,KAAK,QAAQ,EAAE;;;;;QAKnC,MAAM,QAAQ,GAAG,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QACpD,OAAO,GAAG,GAAG,QAAQ,CAAC;KACvB;AACD,IAAA,OAAO,UAAU,CAAC,kBAAkB,CAAC,CAAC;AACxC,CAAC,CAAC;AACK,MAAM,gBAAgB,GAAG,CAAC,QAA6B,KAAI;IAChE,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IACnD,MAAM,aAAa,GAAG,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IACzD,MAAM,SAAS,GAAG,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,YAAY,GAAG,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AACvD,IAAA,OAAO,EAAE,aAAa,EAAE,U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gB,EACf,EAAA,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,cAAc,EACvB,CAAA,CACH,EACA,YAAY,KACXV,cAAC,CAAAW,iCAAgB,EAAC,EAAA,EAAE,EAAE,yBAAyB,CAAC,OAAO,EACpD,QAAA,EAAA,YAAY,CAAC,qBAAqB,CAAC;oBAClC,UAAU,EAAE,CAAG,EAAA,SAAS,CAAE,CAAA;AAC3B,iBAAA,CAAC,EACe,CAAA,CACpB,EACA,YAAY,IAAI,SAAS,KACxBX,cAAC,CAAAY,uCAAmB,EAClB,EAAA,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,GAAG,iBAAiB,EAClC,CAAA,CACH,CACA,EAAA,CAAA,CACJ,CAAC;IAEF,QACEZ,cAAC,CAAAK,iCAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,gBAAgB,EAAA,QAAA,EAChDL,cAAC,CAAAa,mBAAS,IACR,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,qBAAqB,EAAE,qBAAqB,EAC5C,oBAAoB,EAAE,oBAAoB,EAC1C,MAAM,EAAE,UAAU,EAAE,UAAU,EAC9B,OAAO,EAAE,UAAU,EAAE,SAAS,EAC9B,YAAY,EAAE,SAAS,EACvB,MAAM,EAAE,MAAM,EAAA,GACV,cAAc,EAAA,GACd,eAAe,EAAA,CACnB,EACwB,CAAA,EAC5B;AACJ,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"TextAreaAutosize-5a8e8335.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":["useLayoutEffect","forwardRef","useTranslationBundle","useCurrentValueReducer","useCallback","useFormContext","useRef","useId","useFocusableTextField","useSelectableTextField","useImperativeHandle","mergeProps","useLengthFilter","useTextField","_jsx","Label","InlineUserAssistance","CompactUserAssistance","ReadonlyTextFieldInput","FormFieldContext","ReadonlyTextField","_jsxs","_Fragment","TextFieldInput","MaxLengthCounter","HiddenAccessible","MaxLengthLiveRegion","TextField"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACO,MAAM,mBAAmB,GAAG,CAAC,QAA6B,KAAY;IAC3E,MAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AACxD,IAAA,MAAM,kBAAkB,GAAG,aAAa,CAAC,UAAU,CAAC;AACpD,IAAA,IAAI,kBAAkB,KAAK,QA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