@cloudscape-design/components 3.0.1257 → 3.0.1258

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.
Files changed (60) hide show
  1. package/calendar/grid/index.d.ts +3 -1
  2. package/calendar/grid/index.d.ts.map +1 -1
  3. package/calendar/grid/index.js +6 -6
  4. package/calendar/grid/index.js.map +1 -1
  5. package/calendar/internal.d.ts +6 -1
  6. package/calendar/internal.d.ts.map +1 -1
  7. package/calendar/internal.js +2 -2
  8. package/calendar/internal.js.map +1 -1
  9. package/date-picker/index.d.ts.map +1 -1
  10. package/date-picker/index.js +3 -2
  11. package/date-picker/index.js.map +1 -1
  12. package/date-range-picker/calendar/grids/grid-cell.d.ts +1 -0
  13. package/date-range-picker/calendar/grids/grid-cell.d.ts.map +1 -1
  14. package/date-range-picker/calendar/grids/grid-cell.js +2 -2
  15. package/date-range-picker/calendar/grids/grid-cell.js.map +1 -1
  16. package/date-range-picker/calendar/grids/grid.d.ts +2 -1
  17. package/date-range-picker/calendar/grids/grid.d.ts.map +1 -1
  18. package/date-range-picker/calendar/grids/grid.js +2 -2
  19. package/date-range-picker/calendar/grids/grid.js.map +1 -1
  20. package/date-range-picker/calendar/grids/index.d.ts +2 -1
  21. package/date-range-picker/calendar/grids/index.d.ts.map +1 -1
  22. package/date-range-picker/calendar/grids/index.js +3 -3
  23. package/date-range-picker/calendar/grids/index.js.map +1 -1
  24. package/date-range-picker/calendar/grids/interfaces.d.ts +2 -0
  25. package/date-range-picker/calendar/grids/interfaces.d.ts.map +1 -1
  26. package/date-range-picker/calendar/grids/interfaces.js.map +1 -1
  27. package/date-range-picker/calendar/index.d.ts +2 -1
  28. package/date-range-picker/calendar/index.d.ts.map +1 -1
  29. package/date-range-picker/calendar/index.js +2 -2
  30. package/date-range-picker/calendar/index.js.map +1 -1
  31. package/date-range-picker/calendar/interfaces.d.ts +1 -0
  32. package/date-range-picker/calendar/interfaces.d.ts.map +1 -1
  33. package/date-range-picker/calendar/interfaces.js.map +1 -1
  34. package/date-range-picker/dropdown.d.ts +3 -1
  35. package/date-range-picker/dropdown.d.ts.map +1 -1
  36. package/date-range-picker/dropdown.js +2 -2
  37. package/date-range-picker/dropdown.js.map +1 -1
  38. package/date-range-picker/index.d.ts.map +1 -1
  39. package/date-range-picker/index.js +3 -2
  40. package/date-range-picker/index.js.map +1 -1
  41. package/dropdown/interfaces.d.ts +0 -16
  42. package/dropdown/interfaces.d.ts.map +1 -1
  43. package/dropdown/interfaces.js.map +1 -1
  44. package/dropdown/internal.d.ts +3 -0
  45. package/dropdown/internal.d.ts.map +1 -1
  46. package/dropdown/internal.js +2 -2
  47. package/dropdown/internal.js.map +1 -1
  48. package/internal/base-component/styles.scoped.css +1 -1
  49. package/internal/components/dropdown/interfaces.d.ts +1 -0
  50. package/internal/components/dropdown/interfaces.d.ts.map +1 -0
  51. package/internal/components/dropdown/interfaces.js +2 -0
  52. package/internal/components/dropdown/interfaces.js.map +1 -0
  53. package/internal/environment.js +2 -2
  54. package/internal/environment.json +2 -2
  55. package/internal/manifest.json +1 -1
  56. package/package.json +1 -1
  57. package/tooltip/internal.d.ts +4 -1
  58. package/tooltip/internal.d.ts.map +1 -1
  59. package/tooltip/internal.js +2 -2
  60. package/tooltip/internal.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/date-range-picker/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,EAAE,EAAO,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEpG,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAA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,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,0BAA0B,EAAE,0BAA0B,EACtD,wBAAwB,EAAE,wBAAwB,EAClD,0BAA0B,EAAE,0BAA0B,EACtD,WAAW,EAAE,WAAW,GACxB,CACH,CACqB,GAE1B;QACF,6BAAK,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,IAC/B,SAAS,KAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,CAAA,CAChC,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;AACrD,eAAe,eAAe,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React, { Ref, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport Dropdown from '../dropdown/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport InternalIcon from '../icon/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport ButtonTrigger from '../internal/components/button-trigger';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal.js';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { usePrevious } from '../internal/hooks/use-previous';\nimport { isDevelopment } from '../internal/is-development.js';\nimport { KeyCode } from '../internal/keycode';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { formatDateTimeWithOffset } from '../internal/utils/date-time/format-date-time-with-offset';\nimport { normalizeLocale } from '../internal/utils/locale';\nimport { joinStrings } from '../internal/utils/strings/join-strings';\nimport { DateRangePickerDropdown } from './dropdown';\nimport { DateRangePickerProps } from './interfaces';\nimport { normalizeTimeOffset } from './time-offset';\nimport { formatInitialValue, formatValue } from './utils';\n\nimport styles from './styles.css.js';\nimport testutilStyles from './test-classes/styles.css.js';\n\nexport { DateRangePickerProps };\n\nfunction renderDateRange({\n locale,\n range,\n placeholder = '',\n formatRelativeRange,\n absoluteFormat,\n hideTimeOffset,\n timeOffset,\n}: {\n locale?: string;\n range: null | DateRangePickerProps.Value;\n placeholder?: string;\n formatRelativeRange: DateRangePickerProps.I18nStrings['formatRelativeRange'];\n absoluteFormat: DateRangePickerProps.AbsoluteFormat;\n hideTimeOffset?: boolean;\n timeOffset: { startDate?: number; endDate?: number };\n}) {\n const firstPart = range\n ? range.type === 'relative'\n ? (formatRelativeRange?.(range) ?? '')\n : formatDateTimeWithOffset({\n date: range.startDate,\n timeOffset: timeOffset.startDate,\n hideTimeOffset,\n format: absoluteFormat,\n locale,\n })\n : placeholder;\n\n const secondPart =\n range?.type === 'absolute'\n ? formatDateTimeWithOffset({\n date: range.endDate,\n timeOffset: timeOffset.endDate,\n hideTimeOffset,\n format: absoluteFormat,\n locale,\n })\n : '';\n\n return (\n <span className={(!range && styles['label-text']) || undefined} aria-disabled={!range}>\n <span className={range?.type === 'absolute' ? styles['label-token-nowrap'] : undefined}>{firstPart}</span>\n <span>{secondPart && ' — '}</span>\n <span className={styles['label-token-nowrap']}>{secondPart}</span>\n </span>\n );\n}\n\nconst DateRangePicker = React.forwardRef(\n (\n {\n locale = '',\n startOfWeek,\n isDateEnabled = () => true,\n dateDisabledReason,\n value,\n placeholder,\n readOnly = false,\n disabled = false,\n onChange,\n onBlur,\n onFocus,\n relativeOptions = [],\n i18nStrings,\n isValidRange = () => ({ valid: true }),\n showClearButton = true,\n dateOnly = false,\n ariaLabel,\n timeOffset,\n getTimeOffset,\n timeInputFormat = 'hh:mm:ss',\n dateInputFormat = 'slashed',\n expandToViewport = false,\n rangeSelectorMode = 'default',\n customAbsoluteRangeControl,\n absoluteFormat = 'iso',\n hideTimeOffset,\n customRelativeRangeUnits,\n renderRelativeRangeContent,\n granularity = 'day',\n ...rest\n }: DateRangePickerProps,\n ref: Ref<DateRangePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DateRangePicker', {\n props: {\n absoluteFormat,\n dateOnly,\n expandToViewport,\n rangeSelectorMode,\n readOnly,\n showClearButton,\n timeInputFormat,\n dateInputFormat,\n hideTimeOffset,\n granularity,\n },\n metadata: { hasDisabledReasons: Boolean(dateDisabledReason) },\n });\n const isMonthOnly = granularity === 'month';\n const hideTime = dateOnly || isMonthOnly;\n checkControlled('DateRangePicker', 'value', value, 'onChange', onChange);\n\n const normalizedTimeOffset = hideTime\n ? { startDate: undefined, endDate: undefined }\n : normalizeTimeOffset(value, getTimeOffset, timeOffset);\n value = formatInitialValue(value, dateOnly, isMonthOnly, normalizedTimeOffset);\n\n const baseProps = getBaseProps(rest);\n const ariaLabelId = useUniqueId('date-range-picker-arialabel-');\n const {\n invalid,\n warning,\n controlId,\n ariaDescribedby,\n ariaLabelledby: contextAriaLabelledby,\n } = useFormFieldContext({\n ariaLabelledby: rest.ariaLabelledby ?? i18nStrings?.ariaLabelledby,\n ariaDescribedby: rest.ariaDescribedby ?? i18nStrings?.ariaDescribedby,\n ...rest,\n });\n const ariaLabelledby = joinStrings(contextAriaLabelledby, ariaLabelId);\n\n const isSingleGrid = useMobile();\n\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n useForwardFocus(ref, triggerRef);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const dropdownId = useUniqueId('date-range-picker-dropdown');\n const triggerContentId = useUniqueId('date-range-picker-trigger');\n\n useFocusTracker({ rootRef, onBlur, onFocus });\n\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n\n const normalizedLocale = normalizeLocale('DateRangePicker', locale);\n\n const closeDropdown = (focusTrigger = false) => {\n setIsDropDownOpen(false);\n if (focusTrigger) {\n triggerRef.current?.focus();\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.keyCode === KeyCode.escape) {\n if (isDropDownOpen) {\n event.stopPropagation();\n }\n closeDropdown(true);\n }\n };\n\n const onClear = () => {\n fireNonCancelableEvent(onChange, { value: null });\n };\n\n const onApply = (newValue: null | DateRangePickerProps.Value): DateRangePickerProps.ValidationResult => {\n const formattedValue = formatValue(newValue, {\n dateOnly,\n monthOnly: isMonthOnly,\n timeOffset: hideTime\n ? { startDate: undefined, endDate: undefined }\n : normalizeTimeOffset(newValue, getTimeOffset, timeOffset),\n });\n\n const validationResult = isValidRange(formattedValue);\n if (validationResult?.valid === false) {\n return validationResult;\n }\n\n if (isDevelopment) {\n if (newValue?.type === 'absolute') {\n const [startDateWithoutTime] = newValue.startDate.split('T');\n const [endDateWithoutTime] = newValue.endDate.split('T');\n if (!startDateWithoutTime || !endDateWithoutTime) {\n warnOnce(\n 'DateRangePicker',\n 'You have provided an `isValidRange` prop that did not catch a missing start or end date.'\n );\n }\n }\n }\n fireNonCancelableEvent(onChange, { value: formattedValue });\n return validationResult || { valid: true };\n };\n\n const prevDateOnly = usePrevious(dateOnly);\n useEffect(() => {\n if (prevDateOnly !== undefined && prevDateOnly !== dateOnly) {\n warnOnce(\n 'DateRangePicker',\n `The provided \\`dateOnly\\` flag has been changed from \"${prevDateOnly}\" to \"${dateOnly}\" which can lead to unexpected value format. Consider using separate components.`\n );\n }\n }, [prevDateOnly, dateOnly]);\n\n if (value && value.type !== 'absolute' && value.type !== 'relative') {\n warnOnce('DateRangePicker', 'You provided an invalid value. Reverting back to default.');\n value = null;\n }\n\n if (\n (value?.type === 'absolute' && rangeSelectorMode === 'relative-only') ||\n (value?.type === 'relative' && rangeSelectorMode === 'absolute-only')\n ) {\n warnOnce(\n 'DateRangePicker',\n 'The provided value does not correspond to the current range selector mode. Reverting back to default.'\n );\n value = null;\n }\n\n const i18n = useInternalI18n('date-range-picker');\n const formatRelativeRange = i18n(\n 'i18nStrings.formatRelativeRange',\n i18nStrings?.formatRelativeRange,\n format =>\n ({ amount, unit }) =>\n format({ amount, unit })\n );\n\n if (isDevelopment) {\n if (!formatRelativeRange && rangeSelectorMode !== 'absolute-only') {\n warnOnce(\n 'DateRangePicker',\n 'A function for i18nStrings.formatRelativeRange was not provided. Relative ranges will not be correctly rendered.'\n );\n }\n }\n\n const formattedDate: string | JSX.Element = renderDateRange({\n locale: normalizedLocale,\n range: value,\n placeholder,\n formatRelativeRange,\n absoluteFormat,\n hideTimeOffset: hideTime || hideTimeOffset,\n timeOffset: normalizedTimeOffset,\n });\n\n const trigger = (\n <ButtonTrigger\n ref={triggerRef}\n id={controlId}\n invalid={invalid}\n warning={warning}\n ariaLabelledby={joinStrings(ariaLabelledby, triggerContentId)}\n ariaDescribedby={ariaDescribedby}\n className={clsx(testutilStyles.label, styles.label, {\n [styles['label-enabled']]: !readOnly && !disabled,\n })}\n hideCaret={true}\n onClick={() => {\n setIsDropDownOpen(true);\n }}\n disabled={disabled}\n readOnly={readOnly}\n ariaHasPopup=\"dialog\"\n >\n <span className={styles['trigger-flexbox']}>\n <span className={styles['icon-wrapper']}>\n <InternalIcon name=\"calendar\" variant={disabled || readOnly ? 'disabled' : 'normal'} />\n </span>\n <span id={triggerContentId}>{formattedDate}</span>\n </span>\n </ButtonTrigger>\n );\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(\n baseProps.className,\n styles.root,\n testutilStyles.root,\n absoluteFormat === 'long-localized' && !dateOnly && !isMonthOnly && styles.wide\n )}\n onKeyDown={onWrapperKeyDownHandler}\n >\n <Dropdown\n stretchHeight={true}\n open={isDropDownOpen}\n onOutsideClick={() => closeDropdown()}\n trigger={trigger}\n expandToViewport={expandToViewport}\n dropdownId={dropdownId}\n content={\n /* Reset form field context to prevent a wrapper form field from labelling all inputs inside the dropdown. */\n <ResetContextsForModal>\n {isDropDownOpen && (\n <DateRangePickerDropdown\n startOfWeek={startOfWeek}\n locale={normalizedLocale}\n isSingleGrid={isSingleGrid}\n onOutsideClick={() => closeDropdown(true)}\n value={value}\n showClearButton={showClearButton}\n isDateEnabled={isDateEnabled}\n dateDisabledReason={dateDisabledReason}\n i18nStrings={i18nStrings}\n onClear={onClear}\n onApply={onApply}\n getTimeOffset={getTimeOffset}\n timeOffset={timeOffset}\n relativeOptions={relativeOptions}\n isValidRange={isValidRange}\n dateOnly={dateOnly}\n absoluteFormat={absoluteFormat}\n timeInputFormat={timeInputFormat}\n dateInputFormat={dateInputFormat}\n rangeSelectorMode={rangeSelectorMode}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n customAbsoluteRangeControl={customAbsoluteRangeControl}\n customRelativeRangeUnits={customRelativeRangeUnits}\n renderRelativeRangeContent={renderRelativeRangeContent}\n granularity={granularity}\n />\n )}\n </ResetContextsForModal>\n }\n />\n <div id={ariaLabelId} hidden={true}>\n {ariaLabel || i18nStrings?.ariaLabel}\n </div>\n </div>\n );\n }\n);\n\napplyDisplayName(DateRangePicker, 'DateRangePicker');\nexport default DateRangePicker;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/date-range-picker/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,EAAE,EAAO,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OA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AAuB,IACtB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EACzC,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EAAE,kBAAkB,EACtC,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,0BAA0B,EAAE,0BAA0B,EACtD,wBAAwB,EAAE,wBAAwB,EAClD,0BAA0B,EAAE,0BAA0B,EACtD,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACtB,CACH,CACqB,GAE1B;QACF,6BAAK,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,IAC/B,SAAS,KAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,CAAA,CAChC,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;AACrD,eAAe,eAAe,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React, { Ref, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport Dropdown from '../dropdown/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport InternalIcon from '../icon/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport ButtonTrigger from '../internal/components/button-trigger';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal.js';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { usePrevious } from '../internal/hooks/use-previous';\nimport { isDevelopment } from '../internal/is-development.js';\nimport { KeyCode } from '../internal/keycode';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { formatDateTimeWithOffset } from '../internal/utils/date-time/format-date-time-with-offset';\nimport { normalizeLocale } from '../internal/utils/locale';\nimport { joinStrings } from '../internal/utils/strings/join-strings';\nimport { DateRangePickerDropdown } from './dropdown';\nimport { DateRangePickerProps } from './interfaces';\nimport { normalizeTimeOffset } from './time-offset';\nimport { formatInitialValue, formatValue } from './utils';\n\nimport styles from './styles.css.js';\nimport testutilStyles from './test-classes/styles.css.js';\n\nexport { DateRangePickerProps };\n\nfunction renderDateRange({\n locale,\n range,\n placeholder = '',\n formatRelativeRange,\n absoluteFormat,\n hideTimeOffset,\n timeOffset,\n}: {\n locale?: string;\n range: null | DateRangePickerProps.Value;\n placeholder?: string;\n formatRelativeRange: DateRangePickerProps.I18nStrings['formatRelativeRange'];\n absoluteFormat: DateRangePickerProps.AbsoluteFormat;\n hideTimeOffset?: boolean;\n timeOffset: { startDate?: number; endDate?: number };\n}) {\n const firstPart = range\n ? range.type === 'relative'\n ? (formatRelativeRange?.(range) ?? '')\n : formatDateTimeWithOffset({\n date: range.startDate,\n timeOffset: timeOffset.startDate,\n hideTimeOffset,\n format: absoluteFormat,\n locale,\n })\n : placeholder;\n\n const secondPart =\n range?.type === 'absolute'\n ? formatDateTimeWithOffset({\n date: range.endDate,\n timeOffset: timeOffset.endDate,\n hideTimeOffset,\n format: absoluteFormat,\n locale,\n })\n : '';\n\n return (\n <span className={(!range && styles['label-text']) || undefined} aria-disabled={!range}>\n <span className={range?.type === 'absolute' ? styles['label-token-nowrap'] : undefined}>{firstPart}</span>\n <span>{secondPart && ' — '}</span>\n <span className={styles['label-token-nowrap']}>{secondPart}</span>\n </span>\n );\n}\n\nconst DateRangePicker = React.forwardRef(\n (\n {\n locale = '',\n startOfWeek,\n isDateEnabled = () => true,\n dateDisabledReason,\n value,\n placeholder,\n readOnly = false,\n disabled = false,\n onChange,\n onBlur,\n onFocus,\n relativeOptions = [],\n i18nStrings,\n isValidRange = () => ({ valid: true }),\n showClearButton = true,\n dateOnly = false,\n ariaLabel,\n timeOffset,\n getTimeOffset,\n timeInputFormat = 'hh:mm:ss',\n dateInputFormat = 'slashed',\n expandToViewport = false,\n rangeSelectorMode = 'default',\n customAbsoluteRangeControl,\n absoluteFormat = 'iso',\n hideTimeOffset,\n customRelativeRangeUnits,\n renderRelativeRangeContent,\n granularity = 'day',\n ...rest\n }: DateRangePickerProps,\n ref: Ref<DateRangePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DateRangePicker', {\n props: {\n absoluteFormat,\n dateOnly,\n expandToViewport,\n rangeSelectorMode,\n readOnly,\n showClearButton,\n timeInputFormat,\n dateInputFormat,\n hideTimeOffset,\n granularity,\n },\n metadata: { hasDisabledReasons: Boolean(dateDisabledReason) },\n });\n const isMonthOnly = granularity === 'month';\n const hideTime = dateOnly || isMonthOnly;\n checkControlled('DateRangePicker', 'value', value, 'onChange', onChange);\n\n const normalizedTimeOffset = hideTime\n ? { startDate: undefined, endDate: undefined }\n : normalizeTimeOffset(value, getTimeOffset, timeOffset);\n value = formatInitialValue(value, dateOnly, isMonthOnly, normalizedTimeOffset);\n\n const baseProps = getBaseProps(rest);\n const ariaLabelId = useUniqueId('date-range-picker-arialabel-');\n const {\n invalid,\n warning,\n controlId,\n ariaDescribedby,\n ariaLabelledby: contextAriaLabelledby,\n } = useFormFieldContext({\n ariaLabelledby: rest.ariaLabelledby ?? i18nStrings?.ariaLabelledby,\n ariaDescribedby: rest.ariaDescribedby ?? i18nStrings?.ariaDescribedby,\n ...rest,\n });\n const ariaLabelledby = joinStrings(contextAriaLabelledby, ariaLabelId);\n\n const isSingleGrid = useMobile();\n\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n useForwardFocus(ref, triggerRef);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const dropdownId = useUniqueId('date-range-picker-dropdown');\n const triggerContentId = useUniqueId('date-range-picker-trigger');\n\n useFocusTracker({ rootRef, onBlur, onFocus });\n\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n\n const normalizedLocale = normalizeLocale('DateRangePicker', locale);\n\n const closeDropdown = (focusTrigger = false) => {\n setIsDropDownOpen(false);\n if (focusTrigger) {\n triggerRef.current?.focus();\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.keyCode === KeyCode.escape) {\n if (isDropDownOpen) {\n event.stopPropagation();\n }\n closeDropdown(true);\n }\n };\n\n const onClear = () => {\n fireNonCancelableEvent(onChange, { value: null });\n };\n\n const onApply = (newValue: null | DateRangePickerProps.Value): DateRangePickerProps.ValidationResult => {\n const formattedValue = formatValue(newValue, {\n dateOnly,\n monthOnly: isMonthOnly,\n timeOffset: hideTime\n ? { startDate: undefined, endDate: undefined }\n : normalizeTimeOffset(newValue, getTimeOffset, timeOffset),\n });\n\n const validationResult = isValidRange(formattedValue);\n if (validationResult?.valid === false) {\n return validationResult;\n }\n\n if (isDevelopment) {\n if (newValue?.type === 'absolute') {\n const [startDateWithoutTime] = newValue.startDate.split('T');\n const [endDateWithoutTime] = newValue.endDate.split('T');\n if (!startDateWithoutTime || !endDateWithoutTime) {\n warnOnce(\n 'DateRangePicker',\n 'You have provided an `isValidRange` prop that did not catch a missing start or end date.'\n );\n }\n }\n }\n fireNonCancelableEvent(onChange, { value: formattedValue });\n return validationResult || { valid: true };\n };\n\n const prevDateOnly = usePrevious(dateOnly);\n useEffect(() => {\n if (prevDateOnly !== undefined && prevDateOnly !== dateOnly) {\n warnOnce(\n 'DateRangePicker',\n `The provided \\`dateOnly\\` flag has been changed from \"${prevDateOnly}\" to \"${dateOnly}\" which can lead to unexpected value format. Consider using separate components.`\n );\n }\n }, [prevDateOnly, dateOnly]);\n\n if (value && value.type !== 'absolute' && value.type !== 'relative') {\n warnOnce('DateRangePicker', 'You provided an invalid value. Reverting back to default.');\n value = null;\n }\n\n if (\n (value?.type === 'absolute' && rangeSelectorMode === 'relative-only') ||\n (value?.type === 'relative' && rangeSelectorMode === 'absolute-only')\n ) {\n warnOnce(\n 'DateRangePicker',\n 'The provided value does not correspond to the current range selector mode. Reverting back to default.'\n );\n value = null;\n }\n\n const i18n = useInternalI18n('date-range-picker');\n const formatRelativeRange = i18n(\n 'i18nStrings.formatRelativeRange',\n i18nStrings?.formatRelativeRange,\n format =>\n ({ amount, unit }) =>\n format({ amount, unit })\n );\n\n if (isDevelopment) {\n if (!formatRelativeRange && rangeSelectorMode !== 'absolute-only') {\n warnOnce(\n 'DateRangePicker',\n 'A function for i18nStrings.formatRelativeRange was not provided. Relative ranges will not be correctly rendered.'\n );\n }\n }\n\n const formattedDate: string | JSX.Element = renderDateRange({\n locale: normalizedLocale,\n range: value,\n placeholder,\n formatRelativeRange,\n absoluteFormat,\n hideTimeOffset: hideTime || hideTimeOffset,\n timeOffset: normalizedTimeOffset,\n });\n\n const trigger = (\n <ButtonTrigger\n ref={triggerRef}\n id={controlId}\n invalid={invalid}\n warning={warning}\n ariaLabelledby={joinStrings(ariaLabelledby, triggerContentId)}\n ariaDescribedby={ariaDescribedby}\n className={clsx(testutilStyles.label, styles.label, {\n [styles['label-enabled']]: !readOnly && !disabled,\n })}\n hideCaret={true}\n onClick={() => {\n setIsDropDownOpen(true);\n }}\n disabled={disabled}\n readOnly={readOnly}\n ariaHasPopup=\"dialog\"\n >\n <span className={styles['trigger-flexbox']}>\n <span className={styles['icon-wrapper']}>\n <InternalIcon name=\"calendar\" variant={disabled || readOnly ? 'disabled' : 'normal'} />\n </span>\n <span id={triggerContentId}>{formattedDate}</span>\n </span>\n </ButtonTrigger>\n );\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n const referrerId = useUniqueId();\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(\n baseProps.className,\n styles.root,\n testutilStyles.root,\n absoluteFormat === 'long-localized' && !dateOnly && !isMonthOnly && styles.wide\n )}\n onKeyDown={onWrapperKeyDownHandler}\n >\n <Dropdown\n stretchHeight={true}\n open={isDropDownOpen}\n onOutsideClick={() => closeDropdown()}\n trigger={trigger}\n expandToViewport={expandToViewport}\n dropdownId={dropdownId}\n triggerId={referrerId}\n content={\n /* Reset form field context to prevent a wrapper form field from labelling all inputs inside the dropdown. */\n <ResetContextsForModal>\n {isDropDownOpen && (\n <DateRangePickerDropdown\n startOfWeek={startOfWeek}\n locale={normalizedLocale}\n isSingleGrid={isSingleGrid}\n onOutsideClick={() => closeDropdown(true)}\n value={value}\n showClearButton={showClearButton}\n isDateEnabled={isDateEnabled}\n dateDisabledReason={dateDisabledReason}\n i18nStrings={i18nStrings}\n onClear={onClear}\n onApply={onApply}\n getTimeOffset={getTimeOffset}\n timeOffset={timeOffset}\n relativeOptions={relativeOptions}\n isValidRange={isValidRange}\n dateOnly={dateOnly}\n absoluteFormat={absoluteFormat}\n timeInputFormat={timeInputFormat}\n dateInputFormat={dateInputFormat}\n rangeSelectorMode={rangeSelectorMode}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n customAbsoluteRangeControl={customAbsoluteRangeControl}\n customRelativeRangeUnits={customRelativeRangeUnits}\n renderRelativeRangeContent={renderRelativeRangeContent}\n granularity={granularity}\n referrerId={referrerId}\n />\n )}\n </ResetContextsForModal>\n }\n />\n <div id={ariaLabelId} hidden={true}>\n {ariaLabel || i18nStrings?.ariaLabel}\n </div>\n </div>\n );\n }\n);\n\napplyDisplayName(DateRangePicker, 'DateRangePicker');\nexport default DateRangePicker;\n"]}
@@ -72,17 +72,6 @@ export interface DropdownProps extends ExpandToViewport {
72
72
  * The trigger element that opens/closes the dropdown.
73
73
  */
74
74
  trigger: React.ReactNode;
75
- /**
76
- * Optional ref to an external element used for positioning calculations.
77
- * When provided, the `trigger` prop is not rendered and this ref's element
78
- * is used as the positioning anchor for the dropdown instead.
79
- */
80
- triggerRef?: React.RefObject<HTMLElement>;
81
- /**
82
- * Explicit ID for the trigger element, used as the referrer ID for portal mode.
83
- * Use this when `triggerRef` is provided.
84
- */
85
- triggerId?: string;
86
75
  /**
87
76
  * Optional header content that stays fixed at the top while
88
77
  * scrolling dropdown content.
@@ -118,11 +107,6 @@ export interface DropdownProps extends ExpandToViewport {
118
107
  * dropdown will expand to fit its content.
119
108
  */
120
109
  maxWidth?: number;
121
- /**
122
- * Maximum height constraint for the dropdown content in pixels.
123
- * When set, constrains the calculated height to not exceed this value.
124
- */
125
- maxHeight?: number;
126
110
  /**
127
111
  * Called when the user presses the Escape key while the dropdown is open.
128
112
  * The dropdown does not close automatically - the `open` prop needs to be
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/dropdown/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE9D,yBAAiB,aAAa,CAAC;IAC7B,UAAiB,KAAK;QACpB,QAAQ,CAAC,EAAE;YACT;;eAEG;YACH,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB;;eAEG;YACH,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB;;eAEG;YACH,YAAY,CAAC,E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G;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/dropdown/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport type OptionsFilteringType = 'none' | 'auto' | 'manual';\n\nexport namespace DropdownProps {\n export interface Style {\n dropdown?: {\n /**\n * Background color of the dropdown content wrapper.\n */\n background?: string;\n /**\n * Border color of the dropdown content wrapper.\n */\n borderColor?: string;\n /**\n * Border radius of the dropdown content wrapper.\n */\n borderRadius?: string;\n /**\n * Border width of the dropdown content wrapper.\n */\n borderWidth?: string;\n };\n }\n}\n\n/**\n * Alignment of the dropdown relative to its trigger.\n */\nexport type DropdownAlignment =\n | 'start' // Aligns to the start edge of trigger (default)\n | 'center'; // Centers dropdown on trigger\n\n/**\n * Width constraint for the dropdown.\n * - 'trigger': references the trigger element's width\n * - number: width in pixels\n */\nexport type DropdownWidthConstraint = 'trigger' | number;\n\nexport interface OptionsLoadItemsDetail {\n filteringText: string;\n firstPage: boolean;\n samePage: boolean;\n}\n\nexport interface BaseDropdownHostProps extends ExpandToViewport {\n /**\n * If you have more than 500 options, enable this flag to apply a performance optimization\n * that makes the filtering experience smoother. We don't recommend enabling the feature if you\n * have less than 500 options, because the improvements to performance are offset by a\n * visible scrolling lag.\n *\n * When you set this flag to `true`, it removes options that are not currently in view from the DOM.\n * If your test accesses such options, you need to first scroll the options container\n * to the correct offset, before performing any operations on them. Use the element returned\n * by the `findOptionsContainer` test utility for this.\n */\n virtualScroll?: boolean;\n\n /**\n * Use this event to implement the asynchronous behavior for the component.\n *\n * The event is called in the following situations:\n * * The user scrolls to the end of the list of options, if `statusType` is set to `pending`.\n * * The user clicks on the recovery button in the error state.\n * * The user types inside the input field.\n * * The user focuses the input field.\n *\n * The detail object contains the following properties:\n * * `filteringText` - The value that you need to use to fetch options.\n * * `firstPage` - Indicates that you should fetch the first page of options that match the `filteringText`.\n * * `samePage` - Indicates that you should fetch the same page that you have previously fetched (for example, when the user clicks on the recovery button).\n **/\n onLoadItems?: NonCancelableEventHandler<OptionsLoadItemsDetail>;\n}\n\nexport interface DropdownProps extends ExpandToViewport {\n /**\n * The trigger element that opens/closes the dropdown.\n */\n trigger: React.ReactNode;\n\n /**\n * Optional ref to an external element used for positioning calculations.\n * When provided, the `trigger` prop is not rendered and this ref's element\n * is used as the positioning anchor for the dropdown instead.\n */\n triggerRef?: React.RefObject<HTMLElement>;\n\n /**\n * Explicit ID for the trigger element, used as the referrer ID for portal mode.\n * Use this when `triggerRef` is provided.\n */\n triggerId?: string;\n\n /**\n * Optional header content that stays fixed at the top while\n * scrolling dropdown content.\n */\n header?: React.ReactNode;\n\n /**\n * Optional footer content that stays fixed at the bottom while\n * scrolling dropdown content.\n * Typically used to display loading status or action buttons.\n */\n footer?: React.ReactNode;\n\n /**\n * Main content of the dropdown.\n */\n content?: React.ReactNode;\n\n /**\n * Open state of the dropdown.\n */\n open?: boolean;\n\n /**\n * Called when the user clicks outside the dropdown. The dropdown does not\n * close automatically - the `open` prop needs to be updated to actually close\n * the dropdown.\n */\n onOutsideClick?: NonCancelableEventHandler<null>;\n\n /**\n * Minimum width for the dropdown in pixels. If no value is specified, the\n * dropdown will shrink to fit its content.\n */\n minWidth?: number;\n\n /**\n * Maximum width for the dropdown in pixels. If no value is specified, the\n * dropdown will expand to fit its content.\n */\n maxWidth?: number;\n\n /**\n * Maximum height constraint for the dropdown content in pixels.\n * When set, constrains the calculated height to not exceed this value.\n */\n maxHeight?: number;\n\n /**\n * Called when the user presses the Escape key while the dropdown is open.\n * The dropdown does not close automatically - the `open` prop needs to be\n * updated to actually close the dropdown.\n */\n onEscape?: NonCancelableEventHandler;\n\n /**\n * Called when any element inside the dropdown content gains focus.\n * This includes nested interactive elements like buttons, links, or inputs.\n */\n onFocusEnter?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;\n\n /**\n * Called when focus leaves the dropdown content entirely.\n */\n onFocusLeave?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;\n\n /**\n * Adds `role` to the dropdown content element.\n */\n ariaRole?: string;\n\n /**\n * Adds `aria-label` to the dropdown content element.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-labelledby` to the dropdown content element.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the dropdown content element.\n */\n ariaDescribedby?: string;\n\n /**\n * An object containing CSS properties to customize the dropdown's visual appearance.\n * @awsuiSystem core\n */\n style?: DropdownProps.Style;\n}\n\nexport interface ExpandToViewport {\n /**\n * By default, the dropdown height is constrained to fit inside the height of its next scrollable container element.\n * Enabling this property will allow the dropdown to extend beyond that container by using fixed positioning and\n * [React Portals](https://reactjs.org/docs/portals.html).\n *\n * Set this property if the dropdown would otherwise be constrained by a scrollable container,\n * for example inside table and split view layouts.\n *\n * We recommend you use discretion, and don't enable this property unless necessary\n * because fixed positioning results in a slight, visible lag when scrolling complex pages.\n */\n expandToViewport?: boolean;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/dropdown/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport type OptionsFilteringType = 'none' | 'auto' | 'manual';\n\nexport namespace DropdownProps {\n export interface Style {\n dropdown?: {\n /**\n * Background color of the dropdown content wrapper.\n */\n background?: string;\n /**\n * Border color of the dropdown content wrapper.\n */\n borderColor?: string;\n /**\n * Border radius of the dropdown content wrapper.\n */\n borderRadius?: string;\n /**\n * Border width of the dropdown content wrapper.\n */\n borderWidth?: string;\n };\n }\n}\n\n/**\n * Alignment of the dropdown relative to its trigger.\n */\nexport type DropdownAlignment =\n | 'start' // Aligns to the start edge of trigger (default)\n | 'center'; // Centers dropdown on trigger\n\n/**\n * Width constraint for the dropdown.\n * - 'trigger': references the trigger element's width\n * - number: width in pixels\n */\nexport type DropdownWidthConstraint = 'trigger' | number;\n\nexport interface OptionsLoadItemsDetail {\n filteringText: string;\n firstPage: boolean;\n samePage: boolean;\n}\n\nexport interface BaseDropdownHostProps extends ExpandToViewport {\n /**\n * If you have more than 500 options, enable this flag to apply a performance optimization\n * that makes the filtering experience smoother. We don't recommend enabling the feature if you\n * have less than 500 options, because the improvements to performance are offset by a\n * visible scrolling lag.\n *\n * When you set this flag to `true`, it removes options that are not currently in view from the DOM.\n * If your test accesses such options, you need to first scroll the options container\n * to the correct offset, before performing any operations on them. Use the element returned\n * by the `findOptionsContainer` test utility for this.\n */\n virtualScroll?: boolean;\n\n /**\n * Use this event to implement the asynchronous behavior for the component.\n *\n * The event is called in the following situations:\n * * The user scrolls to the end of the list of options, if `statusType` is set to `pending`.\n * * The user clicks on the recovery button in the error state.\n * * The user types inside the input field.\n * * The user focuses the input field.\n *\n * The detail object contains the following properties:\n * * `filteringText` - The value that you need to use to fetch options.\n * * `firstPage` - Indicates that you should fetch the first page of options that match the `filteringText`.\n * * `samePage` - Indicates that you should fetch the same page that you have previously fetched (for example, when the user clicks on the recovery button).\n **/\n onLoadItems?: NonCancelableEventHandler<OptionsLoadItemsDetail>;\n}\n\nexport interface DropdownProps extends ExpandToViewport {\n /**\n * The trigger element that opens/closes the dropdown.\n */\n trigger: React.ReactNode;\n\n /**\n * Optional header content that stays fixed at the top while\n * scrolling dropdown content.\n */\n header?: React.ReactNode;\n\n /**\n * Optional footer content that stays fixed at the bottom while\n * scrolling dropdown content.\n * Typically used to display loading status or action buttons.\n */\n footer?: React.ReactNode;\n\n /**\n * Main content of the dropdown.\n */\n content?: React.ReactNode;\n\n /**\n * Open state of the dropdown.\n */\n open?: boolean;\n\n /**\n * Called when the user clicks outside the dropdown. The dropdown does not\n * close automatically - the `open` prop needs to be updated to actually close\n * the dropdown.\n */\n onOutsideClick?: NonCancelableEventHandler<null>;\n\n /**\n * Minimum width for the dropdown in pixels. If no value is specified, the\n * dropdown will shrink to fit its content.\n */\n minWidth?: number;\n\n /**\n * Maximum width for the dropdown in pixels. If no value is specified, the\n * dropdown will expand to fit its content.\n */\n maxWidth?: number;\n\n /**\n * Called when the user presses the Escape key while the dropdown is open.\n * The dropdown does not close automatically - the `open` prop needs to be\n * updated to actually close the dropdown.\n */\n onEscape?: NonCancelableEventHandler;\n\n /**\n * Called when any element inside the dropdown content gains focus.\n * This includes nested interactive elements like buttons, links, or inputs.\n */\n onFocusEnter?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;\n\n /**\n * Called when focus leaves the dropdown content entirely.\n */\n onFocusLeave?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;\n\n /**\n * Adds `role` to the dropdown content element.\n */\n ariaRole?: string;\n\n /**\n * Adds `aria-label` to the dropdown content element.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-labelledby` to the dropdown content element.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the dropdown content element.\n */\n ariaDescribedby?: string;\n\n /**\n * An object containing CSS properties to customize the dropdown's visual appearance.\n * @awsuiSystem core\n */\n style?: DropdownProps.Style;\n}\n\nexport interface ExpandToViewport {\n /**\n * By default, the dropdown height is constrained to fit inside the height of its next scrollable container element.\n * Enabling this property will allow the dropdown to extend beyond that container by using fixed positioning and\n * [React Portals](https://reactjs.org/docs/portals.html).\n *\n * Set this property if the dropdown would otherwise be constrained by a scrollable container,\n * for example inside table and split view layouts.\n *\n * We recommend you use discretion, and don't enable this property unless necessary\n * because fixed positioning results in a slight, visible lag when scrolling complex pages.\n */\n expandToViewport?: boolean;\n}\n"]}
@@ -14,10 +14,13 @@ export interface InternalDropdownProps extends Omit<DropdownProps, 'minWidth' |
14
14
  loopFocus?: boolean;
15
15
  minWidth?: DropdownWidthConstraint;
16
16
  maxWidth?: DropdownWidthConstraint;
17
+ maxHeight?: number;
17
18
  preferredAlignment?: DropdownAlignment;
18
19
  hideBlockBorder?: boolean;
19
20
  onFocus?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;
20
21
  onBlur?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;
22
+ triggerRef?: React.RefObject<HTMLElement>;
23
+ triggerId?: string;
21
24
  }
22
25
  declare const InternalDropdown: ({
23
26
  content,
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/dropdown/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAW5E,OAAO,EAA0B,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAEvF,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAalF,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAGzF,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,UAAU,CAAC,EAClD,0BAA0B;IAC5B,WAAW,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC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3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,uBAAuB,CAAC;IACnC,QAAQ,CAAC,EAAE,uBAAuB,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,iBAAiB,CAAC;IACvC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC;IACxF,MAAM,CAAC,EAAE,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC;IACvF,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAmJD,QAAA,MAAM,gBAAgB,GAAI,meAoCvB,qBAAqB,gBA8XvB,CAAC;AAMF,eAAe,gBAAgB,CAAC"}
@@ -274,8 +274,8 @@ const InternalDropdown = ({ content, trigger, triggerRef: externalTriggerRef, tr
274
274
  controller.abort();
275
275
  };
276
276
  }, [open, expandToViewport, isMobile, triggerRef]);
277
- const generatedReferrerId = useUniqueId();
278
- const referrerId = externalTriggerId || generatedReferrerId;
277
+ const internalReferrerId = useUniqueId();
278
+ const referrerId = externalTriggerId !== null && externalTriggerId !== void 0 ? externalTriggerId : internalReferrerId;
279
279
  // Compute CSS variable values for min/max width
280
280
  // These will be used by the use-flexible-width CSS class
281
281
  const getMinWidthCssValue = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/dropdown/internal.tsx"],"names":[],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e,EAAE,eAAe,EAChC,aAAa,EAAE,iBAAiB,CAAC,KAAK,CAAC,GACvC;gBAEF,oBAAC,OAAO,IACN,iBAAiB,EAAE,GAAG,EAAE,WAAC,OAAA,UAAU,CAAC,OAAO,KAAI,MAAA,iBAAiB,CAAC,UAAU,CAAC,OAAO,CAAC,0CAAE,KAAK,EAAE,CAAA,CAAA,EAAA,EAC7F,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,GAC7B,CACE,CACP,CACU,CACK,CAChB,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CACzB,QAAqD,EACf,EAAE,CAAE,QAAqC,CAAC,aAAa,KAAK,SAAS,CAAC;AAE9G,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useResizeObserver, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { getFirstFocusable, getLastFocusable } from '../internal/components/focus-lock/utils.js';\nimport TabTrap from '../internal/components/tab-trap/index.js';\nimport { Transition, TransitionStatus } from '../internal/components/transition';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport customCssProps from '../internal/generated/custom-css-properties';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { usePortalModeClasses } from '../internal/hooks/use-portal-mode-classes';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { nodeBelongs } from '../internal/utils/node-belongs';\nimport { DropdownContextProvider, DropdownContextProviderProps } from './context';\nimport {\n calculatePosition,\n DropdownPosition,\n hasEnoughSpaceForFlexibleWidth,\n InteriorDropdownPosition,\n} from './dropdown-fit-handler';\nimport { applyDropdownPositionRelativeToViewport, LogicalDOMRect } from './dropdown-position';\nimport { DropdownAlignment, DropdownProps, DropdownWidthConstraint } from './interfaces';\nimport { getDropdownStyles } from './style';\n\nexport interface InternalDropdownProps\n extends Omit<DropdownProps, 'minWidth' | 'maxWidth'>,\n InternalBaseComponentProps {\n onMouseDown?: React.MouseEventHandler;\n contentKey?: string;\n dropdownId?: string;\n dropdownContentId?: string;\n stretchHeight?: boolean;\n stretchTriggerHeight?: boolean;\n interior?: boolean;\n scrollable?: boolean;\n loopFocus?: boolean;\n minWidth?: DropdownWidthConstraint;\n maxWidth?: DropdownWidthConstraint;\n preferredAlignment?: DropdownAlignment;\n hideBlockBorder?: boolean;\n onFocus?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;\n onBlur?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;\n}\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ninterface DropdownContainerProps {\n triggerRef: React.RefObject<HTMLElement>;\n children?: React.ReactNode;\n renderWithPortal: boolean;\n id?: string;\n referrerId?: string;\n open?: boolean;\n}\n\nconst DropdownContainer = ({\n triggerRef,\n children,\n renderWithPortal,\n id,\n referrerId,\n open,\n}: DropdownContainerProps) => {\n if (!renderWithPortal) {\n return <>{children}</>;\n }\n if (!open) {\n return null;\n }\n const currentDocument = triggerRef.current?.ownerDocument ?? document;\n return createPortal(\n <div id={id} data-awsui-referrer-id={referrerId}>\n {children}\n </div>,\n currentDocument.body\n );\n};\n\ninterface TransitionContentProps {\n state: TransitionStatus;\n transitionRef: React.MutableRefObject<any>;\n dropdownClasses: string;\n matchTriggerWidth: boolean;\n hideBlockBorder: boolean;\n interior: boolean;\n isRefresh: boolean;\n dropdownRef: React.RefObject<HTMLDivElement>;\n verticalContainerRef: React.RefObject<HTMLDivElement>;\n expandToViewport?: boolean;\n minWidth?: string;\n maxWidth?: string;\n header?: React.ReactNode;\n content?: React.ReactNode;\n footer?: React.ReactNode;\n position?: DropdownContextProviderProps['position'];\n open?: boolean;\n onMouseDown?: React.MouseEventHandler<Element>;\n onFocusEnter?: React.FocusEventHandler<Element>;\n onFocusLeave?: React.FocusEventHandler<Element>;\n id?: string;\n ariaRole?: string;\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n dropdownStyle?: React.CSSProperties;\n}\n\nconst TransitionContent = ({\n state,\n transitionRef,\n dropdownClasses,\n matchTriggerWidth,\n hideBlockBorder,\n interior,\n isRefresh,\n dropdownRef,\n verticalContainerRef,\n expandToViewport,\n minWidth,\n maxWidth,\n header,\n content,\n footer,\n position,\n open,\n onMouseDown,\n onFocusEnter,\n onFocusLeave,\n id,\n ariaRole,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n dropdownStyle,\n}: TransitionContentProps) => {\n const contentRef = useMergeRefs(dropdownRef, transitionRef);\n const dropdownStyles: Record<string, string> = {};\n if (minWidth) {\n dropdownStyles[customCssProps.dropdownDefaultMinWidth] = minWidth;\n }\n if (maxWidth) {\n dropdownStyles[customCssProps.dropdownDefaultMaxWidth] = maxWidth;\n }\n return (\n <div\n className={clsx(styles.dropdown, dropdownClasses, {\n [styles.open]: open,\n [styles['with-limited-width']]: !matchTriggerWidth,\n [styles['hide-block-border']]: hideBlockBorder,\n [styles.interior]: interior,\n [styles.refresh]: isRefresh,\n [styles['use-portal']]: expandToViewport && !interior,\n [styles['use-flexible-width']]: !matchTriggerWidth && !interior,\n })}\n ref={contentRef}\n id={id}\n role={ariaRole}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n data-open={open}\n data-animating={state !== 'exited'}\n aria-hidden={!open}\n style={dropdownStyles}\n onMouseDown={onMouseDown}\n onFocus={onFocusEnter}\n onBlur={onFocusLeave}\n >\n <div\n className={clsx(\n styles['dropdown-content-wrapper'],\n !header && !content && styles['is-empty'],\n isRefresh && styles.refresh\n )}\n style={dropdownStyle}\n >\n <div ref={verticalContainerRef} className={styles['dropdown-content']}>\n <DropdownContextProvider position={position}>\n {header && <div className={testUtilStyles.header}>{header}</div>}\n {content}\n {footer && <div className={testUtilStyles.footer}>{footer}</div>}\n </DropdownContextProvider>\n </div>\n </div>\n </div>\n );\n};\n\nconst InternalDropdown = ({\n content,\n trigger,\n triggerRef: externalTriggerRef,\n triggerId: externalTriggerId,\n open,\n onOutsideClick,\n onMouseDown,\n header,\n footer,\n dropdownId,\n stretchTriggerHeight = false,\n stretchHeight = false,\n minWidth,\n maxWidth,\n maxHeight,\n hideBlockBorder = true,\n expandToViewport = false,\n preferredAlignment = 'start',\n interior = false,\n scrollable = true,\n loopFocus = expandToViewport,\n onFocus,\n onBlur,\n onFocusEnter,\n onFocusLeave,\n onEscape,\n contentKey,\n dropdownContentId,\n ariaRole,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n style,\n __internalRootRef,\n ...restProps\n}: InternalDropdownProps) => {\n const baseProps = getBaseProps(restProps);\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const mergedRef = useMergeRefs(wrapperRef, __internalRootRef);\n const internalTriggerRef = useRef<HTMLDivElement | null>(null);\n const dropdownRef = useRef<HTMLDivElement | null>(null);\n const dropdownContainerRef = useRef<HTMLDivElement | null>(null);\n const verticalContainerRef = useRef<HTMLDivElement>(null);\n // To keep track of the initial position (drop up/down) which is kept the same during fixed repositioning\n const fixedPosition = useRef<DropdownPosition | null>(null);\n\n // Use external trigger ref if provided, otherwise use internal ref\n const triggerRef = externalTriggerRef || internalTriggerRef;\n\n const isRefresh = useVisualRefresh();\n\n const dropdownClasses = usePortalModeClasses(triggerRef);\n const [position, setPosition] = useState<DropdownContextProviderProps['position']>('bottom-right');\n\n const isMobile = useMobile();\n\n // Derive if dropdown should match trigger width exactly\n // This happens when both minWidth and maxWidth are explicitly set to 'trigger'\n const matchTriggerWidth = minWidth === 'trigger' && maxWidth === 'trigger';\n\n // Convert preferredAlignment to boolean for internal positioning logic\n const preferCenter = preferredAlignment === 'center';\n\n const setDropdownPosition = (\n position: DropdownPosition | InteriorDropdownPosition,\n triggerBox: LogicalDOMRect,\n target: HTMLDivElement,\n verticalContainer: HTMLDivElement\n ) => {\n verticalContainer.style.maxBlockSize = position.blockSize;\n\n // Only apply occupy-entire-width when matching trigger width exactly and not in portal mode\n if (!interior && matchTriggerWidth && !expandToViewport) {\n target.classList.add(styles['occupy-entire-width']);\n } else {\n target.style.inlineSize = position.inlineSize;\n }\n\n // Using styles for main dropdown to adjust its position as preferred alternative\n if (position.dropBlockStart && !interior) {\n target.classList.add(styles['dropdown-drop-up']);\n if (!expandToViewport) {\n target.style.insetBlockEnd = '100%';\n }\n } else {\n target.classList.remove(styles['dropdown-drop-up']);\n }\n target.classList.add(position.dropInlineStart ? styles['dropdown-drop-left'] : styles['dropdown-drop-right']);\n\n if (position.insetInlineStart && position.insetInlineStart !== 'auto') {\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n // Position normal overflow dropdowns with fixed positioning relative to viewport\n if (expandToViewport && !interior) {\n applyDropdownPositionRelativeToViewport({\n position,\n dropdownElement: target,\n triggerRect: triggerBox,\n isMobile,\n });\n // Keep track of the initial dropdown position and direction.\n // Dropdown direction doesn't need to change as the user scrolls, just needs to stay attached to the trigger.\n fixedPosition.current = position;\n return;\n }\n\n // For an interior dropdown (the fly out) we need exact values for positioning\n // and classes are not enough\n // usage of relative position is impossible due to overwrite of overflow-x\n if (interior && isInteriorPosition(position)) {\n if (position.dropBlockStart) {\n target.style.insetBlockEnd = position.insetBlockEnd;\n } else {\n target.style.insetBlockStart = position.insetBlockStart;\n }\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n if (position.dropBlockStart && position.dropInlineStart) {\n setPosition('top-left');\n } else if (position.dropBlockStart) {\n setPosition('top-right');\n } else if (position.dropInlineStart) {\n setPosition('bottom-left');\n } else {\n setPosition('bottom-right');\n }\n };\n\n const isOutsideDropdown = (element: Element) =>\n (!wrapperRef.current || !nodeBelongs(wrapperRef.current, element)) &&\n (!dropdownContainerRef.current || !nodeBelongs(dropdownContainerRef.current, element));\n\n const focusHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onFocus, event);\n }\n };\n\n const blurHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onBlur, event);\n }\n };\n\n const isOutsideDropdownContent = (element: Element) =>\n !dropdownRef.current || !nodeBelongs(dropdownRef.current, element);\n\n const focusEnterHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdownContent(event.relatedTarget)) {\n fireNonCancelableEvent(onFocusEnter, event);\n }\n };\n\n const focusLeaveHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdownContent(event.relatedTarget)) {\n fireNonCancelableEvent(onFocusLeave, event);\n }\n };\n\n // Check if the dropdown has enough space to fit with its desired width constraints\n // If not, remove the class that allows flexible width sizing\n const fixStretching = () => {\n const classNameToRemove = styles['use-flexible-width'];\n if (\n open &&\n dropdownRef.current &&\n triggerRef.current &&\n dropdownRef.current.classList.contains(classNameToRemove) &&\n !hasEnoughSpaceForFlexibleWidth({\n triggerElement: triggerRef.current,\n dropdownElement: dropdownRef.current,\n minWidthConstraint: minWidth,\n maxWidthConstraint: maxWidth,\n expandToViewport,\n stretchHeight,\n isMobile,\n })\n ) {\n dropdownRef.current.classList.remove(classNameToRemove);\n }\n };\n\n useResizeObserver(() => dropdownRef.current, fixStretching);\n\n useLayoutEffect(() => {\n const onDropdownOpen = () => {\n if (open && dropdownRef.current && triggerRef.current && verticalContainerRef.current) {\n if (scrollable) {\n dropdownRef.current.classList.add(styles.nowrap);\n }\n\n setDropdownPosition(\n ...calculatePosition(\n dropdownRef.current,\n triggerRef.current,\n verticalContainerRef.current,\n interior,\n expandToViewport,\n preferCenter,\n matchTriggerWidth,\n stretchHeight,\n isMobile,\n minWidth,\n maxWidth,\n maxHeight\n ),\n dropdownRef.current,\n verticalContainerRef.current\n );\n\n if (scrollable) {\n dropdownRef.current.classList.remove(styles.nowrap);\n }\n }\n };\n onDropdownOpen();\n\n if (open) {\n // window may scroll when dropdown opens, for example when soft keyboard shows up\n window.addEventListener('scroll', onDropdownOpen);\n // only listen to window scroll within very short time after the dropdown opens\n // do not want to interfere dropdown position on scroll afterwards\n const timeoutId = setTimeout(() => {\n window.removeEventListener('scroll', onDropdownOpen);\n }, 500);\n\n return () => {\n clearTimeout(timeoutId);\n window.removeEventListener('scroll', onDropdownOpen);\n };\n }\n // See AWSUI-13040\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, dropdownRef, triggerRef, verticalContainerRef, interior, matchTriggerWidth, isMobile, contentKey]);\n\n // subscribe to outside click\n useEffect(() => {\n if (!open) {\n return;\n }\n const clickListener = (event: MouseEvent) => {\n // Since the listener is registered on the window, `event.target` will incorrectly point at the\n // shadow root if the component is rendered inside shadow DOM.\n const target = event.composedPath ? event.composedPath()[0] : event.target;\n // For internal triggers, the wrapper div itself counts as outside — only its children are the trigger.\n // For external triggers, the ref is the trigger element directly, so it counts as inside.\n const isOutsideTrigger =\n !nodeBelongs(triggerRef.current, target) || (!externalTriggerRef && target === triggerRef.current);\n\n if (!nodeBelongs(dropdownRef.current, target) && isOutsideTrigger) {\n fireNonCancelableEvent(onOutsideClick);\n }\n };\n window.addEventListener('click', clickListener, true);\n\n return () => {\n window.removeEventListener('click', clickListener, true);\n };\n }, [open, onOutsideClick, triggerRef, externalTriggerRef]);\n\n // subscribe to Escape key press\n useEffect(() => {\n // Only add the listener if onEscape callback is provided\n if (!open || !onEscape) {\n return;\n }\n const keydownListener = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n // Prevent any surrounding modals or dialogs from acting on this Escape key\n event.stopPropagation();\n fireNonCancelableEvent(onEscape);\n }\n };\n window.addEventListener('keydown', keydownListener, true);\n\n return () => {\n window.removeEventListener('keydown', keydownListener, true);\n };\n }, [open, onEscape]);\n\n // sync dropdown position on scroll and resize\n useLayoutEffect(() => {\n if (!expandToViewport || !open) {\n return;\n }\n const updateDropdownPosition = () => {\n if (triggerRef.current && dropdownRef.current && verticalContainerRef.current && fixedPosition.current) {\n applyDropdownPositionRelativeToViewport({\n position: fixedPosition.current,\n dropdownElement: dropdownRef.current,\n triggerRect: getLogicalBoundingClientRect(triggerRef.current),\n isMobile,\n });\n }\n };\n\n updateDropdownPosition();\n\n const controller = new AbortController();\n window.addEventListener('scroll', updateDropdownPosition, { capture: true, signal: controller.signal });\n window.addEventListener('resize', updateDropdownPosition, { capture: true, signal: controller.signal });\n return () => {\n controller.abort();\n };\n }, [open, expandToViewport, isMobile, triggerRef]);\n\n const generatedReferrerId = useUniqueId();\n const referrerId = externalTriggerId || generatedReferrerId;\n\n // Compute CSS variable values for min/max width\n // These will be used by the use-flexible-width CSS class\n const getMinWidthCssValue = (): string | undefined => {\n if (minWidth === undefined) {\n return undefined;\n }\n if (typeof minWidth === 'number') {\n return `${minWidth}px`;\n }\n // 'trigger' maps to 100% (relative to parent)\n return '100%';\n };\n\n const getMaxWidthCssValue = (): string | undefined => {\n if (maxWidth === undefined) {\n return 'none';\n }\n if (typeof maxWidth === 'number') {\n return `${maxWidth}px`;\n }\n // 'trigger' maps to 100% (relative to parent)\n return '100%';\n };\n\n return (\n <div\n {...baseProps}\n className={clsx(\n styles.root,\n interior && styles.interior,\n stretchTriggerHeight && styles['stretch-trigger-height'],\n baseProps.className\n )}\n ref={mergedRef}\n onFocus={focusHandler}\n onBlur={blurHandler}\n >\n {!externalTriggerRef && (\n <div\n id={referrerId}\n className={clsx(stretchTriggerHeight && styles['stretch-trigger-height'], testUtilStyles.trigger)}\n ref={internalTriggerRef}\n >\n {trigger}\n </div>\n )}\n\n <TabTrap\n focusNextCallback={() => dropdownRef.current && getFirstFocusable(dropdownRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <DropdownContainer\n triggerRef={triggerRef}\n renderWithPortal={expandToViewport && !interior}\n id={dropdownId}\n referrerId={referrerId}\n open={open}\n >\n <Transition in={open ?? false} exit={false}>\n {(state, ref) => (\n <div ref={dropdownContainerRef}>\n <TabTrap\n focusNextCallback={() => triggerRef.current && getLastFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <TransitionContent\n state={state}\n transitionRef={ref}\n dropdownClasses={dropdownClasses}\n open={open}\n matchTriggerWidth={matchTriggerWidth}\n hideBlockBorder={hideBlockBorder}\n interior={interior}\n header={header}\n content={content}\n expandToViewport={expandToViewport}\n minWidth={getMinWidthCssValue()}\n maxWidth={getMaxWidthCssValue()}\n footer={footer}\n onMouseDown={onMouseDown}\n onFocusEnter={focusEnterHandler}\n onFocusLeave={focusLeaveHandler}\n isRefresh={isRefresh}\n dropdownRef={dropdownRef}\n verticalContainerRef={verticalContainerRef}\n position={position}\n id={dropdownContentId}\n ariaRole={ariaRole}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n dropdownStyle={getDropdownStyles(style)}\n />\n\n <TabTrap\n focusNextCallback={() => triggerRef.current && getFirstFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n </div>\n )}\n </Transition>\n </DropdownContainer>\n </div>\n );\n};\n\nconst isInteriorPosition = (\n position: DropdownPosition | InteriorDropdownPosition\n): position is InteriorDropdownPosition => (position as InteriorDropdownPosition).insetBlockEnd !== undefined;\n\nexport default InternalDropdown;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/dropdown/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;A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AA,iBAAiB,CAAC,UAAU,CAAC,OAAO,CAAC,0CAAE,KAAK,EAAE,CAAA,CAAA,EAAA,EAC7F,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,GAC7B,CACE,CACP,CACU,CACK,CAChB,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CACzB,QAAqD,EACf,EAAE,CAAE,QAAqC,CAAC,aAAa,KAAK,SAAS,CAAC;AAE9G,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useResizeObserver, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { getFirstFocusable, getLastFocusable } from '../internal/components/focus-lock/utils.js';\nimport TabTrap from '../internal/components/tab-trap/index.js';\nimport { Transition, TransitionStatus } from '../internal/components/transition';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport customCssProps from '../internal/generated/custom-css-properties';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { usePortalModeClasses } from '../internal/hooks/use-portal-mode-classes';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { nodeBelongs } from '../internal/utils/node-belongs';\nimport { DropdownContextProvider, DropdownContextProviderProps } from './context';\nimport {\n calculatePosition,\n DropdownPosition,\n hasEnoughSpaceForFlexibleWidth,\n InteriorDropdownPosition,\n} from './dropdown-fit-handler';\nimport { applyDropdownPositionRelativeToViewport, LogicalDOMRect } from './dropdown-position';\nimport { DropdownAlignment, DropdownProps, DropdownWidthConstraint } from './interfaces';\nimport { getDropdownStyles } from './style';\n\nexport interface InternalDropdownProps\n extends Omit<DropdownProps, 'minWidth' | 'maxWidth'>,\n InternalBaseComponentProps {\n onMouseDown?: React.MouseEventHandler;\n contentKey?: string;\n dropdownId?: string;\n dropdownContentId?: string;\n stretchHeight?: boolean;\n stretchTriggerHeight?: boolean;\n interior?: boolean;\n scrollable?: boolean;\n loopFocus?: boolean;\n minWidth?: DropdownWidthConstraint;\n maxWidth?: DropdownWidthConstraint;\n maxHeight?: number;\n preferredAlignment?: DropdownAlignment;\n hideBlockBorder?: boolean;\n onFocus?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;\n onBlur?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;\n triggerRef?: React.RefObject<HTMLElement>;\n triggerId?: string;\n}\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ninterface DropdownContainerProps {\n triggerRef: React.RefObject<HTMLElement>;\n children?: React.ReactNode;\n renderWithPortal: boolean;\n id?: string;\n referrerId?: string;\n open?: boolean;\n}\n\nconst DropdownContainer = ({\n triggerRef,\n children,\n renderWithPortal,\n id,\n referrerId,\n open,\n}: DropdownContainerProps) => {\n if (!renderWithPortal) {\n return <>{children}</>;\n }\n if (!open) {\n return null;\n }\n const currentDocument = triggerRef.current?.ownerDocument ?? document;\n return createPortal(\n <div id={id} data-awsui-referrer-id={referrerId}>\n {children}\n </div>,\n currentDocument.body\n );\n};\n\ninterface TransitionContentProps {\n state: TransitionStatus;\n transitionRef: React.MutableRefObject<any>;\n dropdownClasses: string;\n matchTriggerWidth: boolean;\n hideBlockBorder: boolean;\n interior: boolean;\n isRefresh: boolean;\n dropdownRef: React.RefObject<HTMLDivElement>;\n verticalContainerRef: React.RefObject<HTMLDivElement>;\n expandToViewport?: boolean;\n minWidth?: string;\n maxWidth?: string;\n header?: React.ReactNode;\n content?: React.ReactNode;\n footer?: React.ReactNode;\n position?: DropdownContextProviderProps['position'];\n open?: boolean;\n onMouseDown?: React.MouseEventHandler<Element>;\n onFocusEnter?: React.FocusEventHandler<Element>;\n onFocusLeave?: React.FocusEventHandler<Element>;\n id?: string;\n ariaRole?: string;\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n dropdownStyle?: React.CSSProperties;\n}\n\nconst TransitionContent = ({\n state,\n transitionRef,\n dropdownClasses,\n matchTriggerWidth,\n hideBlockBorder,\n interior,\n isRefresh,\n dropdownRef,\n verticalContainerRef,\n expandToViewport,\n minWidth,\n maxWidth,\n header,\n content,\n footer,\n position,\n open,\n onMouseDown,\n onFocusEnter,\n onFocusLeave,\n id,\n ariaRole,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n dropdownStyle,\n}: TransitionContentProps) => {\n const contentRef = useMergeRefs(dropdownRef, transitionRef);\n const dropdownStyles: Record<string, string> = {};\n if (minWidth) {\n dropdownStyles[customCssProps.dropdownDefaultMinWidth] = minWidth;\n }\n if (maxWidth) {\n dropdownStyles[customCssProps.dropdownDefaultMaxWidth] = maxWidth;\n }\n return (\n <div\n className={clsx(styles.dropdown, dropdownClasses, {\n [styles.open]: open,\n [styles['with-limited-width']]: !matchTriggerWidth,\n [styles['hide-block-border']]: hideBlockBorder,\n [styles.interior]: interior,\n [styles.refresh]: isRefresh,\n [styles['use-portal']]: expandToViewport && !interior,\n [styles['use-flexible-width']]: !matchTriggerWidth && !interior,\n })}\n ref={contentRef}\n id={id}\n role={ariaRole}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n data-open={open}\n data-animating={state !== 'exited'}\n aria-hidden={!open}\n style={dropdownStyles}\n onMouseDown={onMouseDown}\n onFocus={onFocusEnter}\n onBlur={onFocusLeave}\n >\n <div\n className={clsx(\n styles['dropdown-content-wrapper'],\n !header && !content && styles['is-empty'],\n isRefresh && styles.refresh\n )}\n style={dropdownStyle}\n >\n <div ref={verticalContainerRef} className={styles['dropdown-content']}>\n <DropdownContextProvider position={position}>\n {header && <div className={testUtilStyles.header}>{header}</div>}\n {content}\n {footer && <div className={testUtilStyles.footer}>{footer}</div>}\n </DropdownContextProvider>\n </div>\n </div>\n </div>\n );\n};\n\nconst InternalDropdown = ({\n content,\n trigger,\n triggerRef: externalTriggerRef,\n triggerId: externalTriggerId,\n open,\n onOutsideClick,\n onMouseDown,\n header,\n footer,\n dropdownId,\n stretchTriggerHeight = false,\n stretchHeight = false,\n minWidth,\n maxWidth,\n maxHeight,\n hideBlockBorder = true,\n expandToViewport = false,\n preferredAlignment = 'start',\n interior = false,\n scrollable = true,\n loopFocus = expandToViewport,\n onFocus,\n onBlur,\n onFocusEnter,\n onFocusLeave,\n onEscape,\n contentKey,\n dropdownContentId,\n ariaRole,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n style,\n __internalRootRef,\n ...restProps\n}: InternalDropdownProps) => {\n const baseProps = getBaseProps(restProps);\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const mergedRef = useMergeRefs(wrapperRef, __internalRootRef);\n const internalTriggerRef = useRef<HTMLDivElement | null>(null);\n const dropdownRef = useRef<HTMLDivElement | null>(null);\n const dropdownContainerRef = useRef<HTMLDivElement | null>(null);\n const verticalContainerRef = useRef<HTMLDivElement>(null);\n // To keep track of the initial position (drop up/down) which is kept the same during fixed repositioning\n const fixedPosition = useRef<DropdownPosition | null>(null);\n\n // Use external trigger ref if provided, otherwise use internal ref\n const triggerRef = externalTriggerRef || internalTriggerRef;\n\n const isRefresh = useVisualRefresh();\n\n const dropdownClasses = usePortalModeClasses(triggerRef);\n const [position, setPosition] = useState<DropdownContextProviderProps['position']>('bottom-right');\n\n const isMobile = useMobile();\n\n // Derive if dropdown should match trigger width exactly\n // This happens when both minWidth and maxWidth are explicitly set to 'trigger'\n const matchTriggerWidth = minWidth === 'trigger' && maxWidth === 'trigger';\n\n // Convert preferredAlignment to boolean for internal positioning logic\n const preferCenter = preferredAlignment === 'center';\n\n const setDropdownPosition = (\n position: DropdownPosition | InteriorDropdownPosition,\n triggerBox: LogicalDOMRect,\n target: HTMLDivElement,\n verticalContainer: HTMLDivElement\n ) => {\n verticalContainer.style.maxBlockSize = position.blockSize;\n\n // Only apply occupy-entire-width when matching trigger width exactly and not in portal mode\n if (!interior && matchTriggerWidth && !expandToViewport) {\n target.classList.add(styles['occupy-entire-width']);\n } else {\n target.style.inlineSize = position.inlineSize;\n }\n\n // Using styles for main dropdown to adjust its position as preferred alternative\n if (position.dropBlockStart && !interior) {\n target.classList.add(styles['dropdown-drop-up']);\n if (!expandToViewport) {\n target.style.insetBlockEnd = '100%';\n }\n } else {\n target.classList.remove(styles['dropdown-drop-up']);\n }\n target.classList.add(position.dropInlineStart ? styles['dropdown-drop-left'] : styles['dropdown-drop-right']);\n\n if (position.insetInlineStart && position.insetInlineStart !== 'auto') {\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n // Position normal overflow dropdowns with fixed positioning relative to viewport\n if (expandToViewport && !interior) {\n applyDropdownPositionRelativeToViewport({\n position,\n dropdownElement: target,\n triggerRect: triggerBox,\n isMobile,\n });\n // Keep track of the initial dropdown position and direction.\n // Dropdown direction doesn't need to change as the user scrolls, just needs to stay attached to the trigger.\n fixedPosition.current = position;\n return;\n }\n\n // For an interior dropdown (the fly out) we need exact values for positioning\n // and classes are not enough\n // usage of relative position is impossible due to overwrite of overflow-x\n if (interior && isInteriorPosition(position)) {\n if (position.dropBlockStart) {\n target.style.insetBlockEnd = position.insetBlockEnd;\n } else {\n target.style.insetBlockStart = position.insetBlockStart;\n }\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n if (position.dropBlockStart && position.dropInlineStart) {\n setPosition('top-left');\n } else if (position.dropBlockStart) {\n setPosition('top-right');\n } else if (position.dropInlineStart) {\n setPosition('bottom-left');\n } else {\n setPosition('bottom-right');\n }\n };\n\n const isOutsideDropdown = (element: Element) =>\n (!wrapperRef.current || !nodeBelongs(wrapperRef.current, element)) &&\n (!dropdownContainerRef.current || !nodeBelongs(dropdownContainerRef.current, element));\n\n const focusHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onFocus, event);\n }\n };\n\n const blurHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onBlur, event);\n }\n };\n\n const isOutsideDropdownContent = (element: Element) =>\n !dropdownRef.current || !nodeBelongs(dropdownRef.current, element);\n\n const focusEnterHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdownContent(event.relatedTarget)) {\n fireNonCancelableEvent(onFocusEnter, event);\n }\n };\n\n const focusLeaveHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdownContent(event.relatedTarget)) {\n fireNonCancelableEvent(onFocusLeave, event);\n }\n };\n\n // Check if the dropdown has enough space to fit with its desired width constraints\n // If not, remove the class that allows flexible width sizing\n const fixStretching = () => {\n const classNameToRemove = styles['use-flexible-width'];\n if (\n open &&\n dropdownRef.current &&\n triggerRef.current &&\n dropdownRef.current.classList.contains(classNameToRemove) &&\n !hasEnoughSpaceForFlexibleWidth({\n triggerElement: triggerRef.current,\n dropdownElement: dropdownRef.current,\n minWidthConstraint: minWidth,\n maxWidthConstraint: maxWidth,\n expandToViewport,\n stretchHeight,\n isMobile,\n })\n ) {\n dropdownRef.current.classList.remove(classNameToRemove);\n }\n };\n\n useResizeObserver(() => dropdownRef.current, fixStretching);\n\n useLayoutEffect(() => {\n const onDropdownOpen = () => {\n if (open && dropdownRef.current && triggerRef.current && verticalContainerRef.current) {\n if (scrollable) {\n dropdownRef.current.classList.add(styles.nowrap);\n }\n\n setDropdownPosition(\n ...calculatePosition(\n dropdownRef.current,\n triggerRef.current,\n verticalContainerRef.current,\n interior,\n expandToViewport,\n preferCenter,\n matchTriggerWidth,\n stretchHeight,\n isMobile,\n minWidth,\n maxWidth,\n maxHeight\n ),\n dropdownRef.current,\n verticalContainerRef.current\n );\n\n if (scrollable) {\n dropdownRef.current.classList.remove(styles.nowrap);\n }\n }\n };\n onDropdownOpen();\n\n if (open) {\n // window may scroll when dropdown opens, for example when soft keyboard shows up\n window.addEventListener('scroll', onDropdownOpen);\n // only listen to window scroll within very short time after the dropdown opens\n // do not want to interfere dropdown position on scroll afterwards\n const timeoutId = setTimeout(() => {\n window.removeEventListener('scroll', onDropdownOpen);\n }, 500);\n\n return () => {\n clearTimeout(timeoutId);\n window.removeEventListener('scroll', onDropdownOpen);\n };\n }\n // See AWSUI-13040\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, dropdownRef, triggerRef, verticalContainerRef, interior, matchTriggerWidth, isMobile, contentKey]);\n\n // subscribe to outside click\n useEffect(() => {\n if (!open) {\n return;\n }\n const clickListener = (event: MouseEvent) => {\n // Since the listener is registered on the window, `event.target` will incorrectly point at the\n // shadow root if the component is rendered inside shadow DOM.\n const target = event.composedPath ? event.composedPath()[0] : event.target;\n // For internal triggers, the wrapper div itself counts as outside — only its children are the trigger.\n // For external triggers, the ref is the trigger element directly, so it counts as inside.\n const isOutsideTrigger =\n !nodeBelongs(triggerRef.current, target) || (!externalTriggerRef && target === triggerRef.current);\n\n if (!nodeBelongs(dropdownRef.current, target) && isOutsideTrigger) {\n fireNonCancelableEvent(onOutsideClick);\n }\n };\n window.addEventListener('click', clickListener, true);\n\n return () => {\n window.removeEventListener('click', clickListener, true);\n };\n }, [open, onOutsideClick, triggerRef, externalTriggerRef]);\n\n // subscribe to Escape key press\n useEffect(() => {\n // Only add the listener if onEscape callback is provided\n if (!open || !onEscape) {\n return;\n }\n const keydownListener = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n // Prevent any surrounding modals or dialogs from acting on this Escape key\n event.stopPropagation();\n fireNonCancelableEvent(onEscape);\n }\n };\n window.addEventListener('keydown', keydownListener, true);\n\n return () => {\n window.removeEventListener('keydown', keydownListener, true);\n };\n }, [open, onEscape]);\n\n // sync dropdown position on scroll and resize\n useLayoutEffect(() => {\n if (!expandToViewport || !open) {\n return;\n }\n const updateDropdownPosition = () => {\n if (triggerRef.current && dropdownRef.current && verticalContainerRef.current && fixedPosition.current) {\n applyDropdownPositionRelativeToViewport({\n position: fixedPosition.current,\n dropdownElement: dropdownRef.current,\n triggerRect: getLogicalBoundingClientRect(triggerRef.current),\n isMobile,\n });\n }\n };\n\n updateDropdownPosition();\n\n const controller = new AbortController();\n window.addEventListener('scroll', updateDropdownPosition, { capture: true, signal: controller.signal });\n window.addEventListener('resize', updateDropdownPosition, { capture: true, signal: controller.signal });\n return () => {\n controller.abort();\n };\n }, [open, expandToViewport, isMobile, triggerRef]);\n\n const internalReferrerId = useUniqueId();\n const referrerId = externalTriggerId ?? internalReferrerId;\n\n // Compute CSS variable values for min/max width\n // These will be used by the use-flexible-width CSS class\n const getMinWidthCssValue = (): string | undefined => {\n if (minWidth === undefined) {\n return undefined;\n }\n if (typeof minWidth === 'number') {\n return `${minWidth}px`;\n }\n // 'trigger' maps to 100% (relative to parent)\n return '100%';\n };\n\n const getMaxWidthCssValue = (): string | undefined => {\n if (maxWidth === undefined) {\n return 'none';\n }\n if (typeof maxWidth === 'number') {\n return `${maxWidth}px`;\n }\n // 'trigger' maps to 100% (relative to parent)\n return '100%';\n };\n\n return (\n <div\n {...baseProps}\n className={clsx(\n styles.root,\n interior && styles.interior,\n stretchTriggerHeight && styles['stretch-trigger-height'],\n baseProps.className\n )}\n ref={mergedRef}\n onFocus={focusHandler}\n onBlur={blurHandler}\n >\n {!externalTriggerRef && (\n <div\n id={referrerId}\n className={clsx(stretchTriggerHeight && styles['stretch-trigger-height'], testUtilStyles.trigger)}\n ref={internalTriggerRef}\n >\n {trigger}\n </div>\n )}\n\n <TabTrap\n focusNextCallback={() => dropdownRef.current && getFirstFocusable(dropdownRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <DropdownContainer\n triggerRef={triggerRef}\n renderWithPortal={expandToViewport && !interior}\n id={dropdownId}\n referrerId={referrerId}\n open={open}\n >\n <Transition in={open ?? false} exit={false}>\n {(state, ref) => (\n <div ref={dropdownContainerRef}>\n <TabTrap\n focusNextCallback={() => triggerRef.current && getLastFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <TransitionContent\n state={state}\n transitionRef={ref}\n dropdownClasses={dropdownClasses}\n open={open}\n matchTriggerWidth={matchTriggerWidth}\n hideBlockBorder={hideBlockBorder}\n interior={interior}\n header={header}\n content={content}\n expandToViewport={expandToViewport}\n minWidth={getMinWidthCssValue()}\n maxWidth={getMaxWidthCssValue()}\n footer={footer}\n onMouseDown={onMouseDown}\n onFocusEnter={focusEnterHandler}\n onFocusLeave={focusLeaveHandler}\n isRefresh={isRefresh}\n dropdownRef={dropdownRef}\n verticalContainerRef={verticalContainerRef}\n position={position}\n id={dropdownContentId}\n ariaRole={ariaRole}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n dropdownStyle={getDropdownStyles(style)}\n />\n\n <TabTrap\n focusNextCallback={() => triggerRef.current && getFirstFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n </div>\n )}\n </Transition>\n </DropdownContainer>\n </div>\n );\n};\n\nconst isInteriorPosition = (\n position: DropdownPosition | InteriorDropdownPosition\n): position is InteriorDropdownPosition => (position as InteriorDropdownPosition).insetBlockEnd !== undefined;\n\nexport default InternalDropdown;\n"]}
@@ -2061,5 +2061,5 @@ body {
2061
2061
  }
2062
2062
  }
2063
2063
  :root {
2064
- --awsui-version-info-33f2523c: true;
2064
+ --awsui-version-info-470a8cb4: true;
2065
2065
  }
@@ -0,0 +1 @@
1
+ export { OptionsFilteringType, OptionsLoadItemsDetail } from '../../../dropdown/interfaces';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport { OptionsFilteringType, OptionsLoadItemsDetail } from '../../../dropdown/interfaces';\n"]}
@@ -1,6 +1,6 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (33f2523c)";
3
- export var GIT_SHA = "33f2523c";
2
+ export var PACKAGE_VERSION = "3.0.0 (470a8cb4)";
3
+ export var GIT_SHA = "470a8cb4";
4
4
  export var THEME = "open-source-visual-refresh";
5
5
  export var SYSTEM = "core";
6
6
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (33f2523c)",
4
- "GIT_SHA": "33f2523c",
3
+ "PACKAGE_VERSION": "3.0.0 (470a8cb4)",
4
+ "GIT_SHA": "470a8cb4",
5
5
  "THEME": "open-source-visual-refresh",
6
6
  "SYSTEM": "core",
7
7
  "ALWAYS_VISUAL_REFRESH": true
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "33f2523c55fe0f0cf46e67e6a21043494f41ac82"
2
+ "commit": "470a8cb4e376dc6342bcb1ec93f51f2fe3579cb8"
3
3
  }
package/package.json CHANGED
@@ -163,7 +163,7 @@
163
163
  "./internal/base-component/index.js",
164
164
  "./internal/base-component/styles.css.js"
165
165
  ],
166
- "version": "3.0.1257",
166
+ "version": "3.0.1258",
167
167
  "repository": {
168
168
  "type": "git",
169
169
  "url": "https://github.com/cloudscape-design/components.git"
@@ -1,12 +1,15 @@
1
1
  import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
2
2
  import { InternalTooltipProps } from './interfaces';
3
- type InternalTooltipComponentProps = InternalTooltipProps & InternalBaseComponentProps;
3
+ type InternalTooltipComponentProps = InternalTooltipProps & InternalBaseComponentProps & {
4
+ referrerId?: string;
5
+ };
4
6
  export default function InternalTooltip({
5
7
  content,
6
8
  getTrack,
7
9
  className,
8
10
  position,
9
11
  onEscape,
12
+ referrerId,
10
13
  __internalRootRef,
11
14
  ...restProps
12
15
  }: InternalTooltipComponentProps): JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/tooltip/internal.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAIlF,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAIpD,KAAK,6BAA6B,GAAG,oBAAoB,GAAG,0BAA0B,CAAC;AAEvF,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAgB,EAChB,QAAQ,EACR,iBAAiB,EACjB,GAAG,SAAS,EACb,EAAE,6BAA6B,eA+D/B"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/tooltip/internal.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAIlF,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAIpD,KAAK,6BAA6B,GAAG,oBAAoB,GACvD,0BAA0B,GAAG;IAG3B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEJ,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAgB,EAChB,QAAQ,EACR,UAAU,EACV,iBAAiB,EACjB,GAAG,SAAS,EACb,EAAE,6BAA6B,eAgE/B"}
@@ -10,7 +10,7 @@ import PopoverArrow from '../popover/arrow';
10
10
  import PopoverBody from '../popover/body';
11
11
  import PopoverContainer from '../popover/container';
12
12
  import testUtilStyles from './test-classes/styles.css.js';
13
- export default function InternalTooltip({ content, getTrack, className, position = 'top', onEscape, __internalRootRef, ...restProps }) {
13
+ export default function InternalTooltip({ content, getTrack, className, position = 'top', onEscape, referrerId, __internalRootRef, ...restProps }) {
14
14
  const baseProps = getBaseProps(restProps);
15
15
  const trackRef = React.useRef(null);
16
16
  // Update the ref with the current tracked element
@@ -38,7 +38,7 @@ export default function InternalTooltip({ content, getTrack, className, position
38
38
  };
39
39
  }, [onEscape]);
40
40
  return (React.createElement(Portal, null,
41
- React.createElement("div", { ...baseProps, className: clsx(testUtilStyles.root, baseProps.className), ref: __internalRootRef, role: "tooltip" },
41
+ React.createElement("div", { ...baseProps, className: clsx(testUtilStyles.root, baseProps.className), ref: __internalRootRef, "data-awsui-referrer-id": referrerId, role: "tooltip" },
42
42
  React.createElement(Transition, { in: true }, () => (React.createElement(PopoverContainer, { getTrack: getTrack, size: "medium", fixedWidth: false, position: position, zIndex: 7000, arrow: position => React.createElement(PopoverArrow, { position: position }), hideOnOverscroll: true, className: className },
43
43
  React.createElement(PopoverBody, { dismissButton: false, dismissAriaLabel: undefined, onDismiss: undefined, header: undefined }, content)))))));
44
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/tooltip/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,+CAA+C,CAAC;AAEvE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,YAAY,MAA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AAS,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,EACzD,GAAG,EAAE,iBAAiB,EACtB,IAAI,EAAC,SAAS;YAEd,oBAAC,UAAU,IAAC,EAAE,EAAE,IAAI,IACjB,GAAG,EAAE,CAAC,CACL,oBAAC,gBAAgB,IACf,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,QAAQ,EACb,UAAU,EAAE,KAAK,EACjB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC,oBAAC,YAAY,IAAC,QAAQ,EAAE,QAAQ,GAAI,EACvD,gBAAgB,EAAE,IAAI,EACtB,SAAS,EAAE,SAAS;gBAEpB,oBAAC,WAAW,IAAC,aAAa,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,IACpG,OAAO,CACI,CACG,CACpB,CACU,CACT,CACC,CACV,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport clsx from 'clsx';\n\nimport { Portal } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { Transition } from '../internal/components/transition';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport PopoverArrow from '../popover/arrow';\nimport PopoverBody from '../popover/body';\nimport PopoverContainer from '../popover/container';\nimport { InternalTooltipProps } from './interfaces';\n\nimport testUtilStyles from './test-classes/styles.css.js';\n\ntype InternalTooltipComponentProps = InternalTooltipProps & InternalBaseComponentProps;\n\nexport default function InternalTooltip({\n content,\n getTrack,\n className,\n position = 'top',\n onEscape,\n __internalRootRef,\n ...restProps\n}: InternalTooltipComponentProps) {\n const baseProps = getBaseProps(restProps);\n const trackRef = React.useRef<HTMLElement | SVGElement | null>(null);\n\n // Update the ref with the current tracked element\n React.useEffect(() => {\n const element = getTrack();\n trackRef.current = element;\n }, [getTrack]);\n\n useEffect(() => {\n const controller = new AbortController();\n window.addEventListener(\n 'keydown',\n (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n // Prevent any surrounding modals or dialogs from acting on this Esc.\n event.stopPropagation();\n fireNonCancelableEvent(onEscape);\n }\n },\n {\n // The tooltip is often activated on mouseover, which means the focus can\n // be anywhere else on the page. Capture also means that this gets called\n // before any wrapper modals or dialogs can detect it and act on it.\n capture: true,\n signal: controller.signal,\n }\n );\n return () => {\n controller.abort();\n };\n }, [onEscape]);\n\n return (\n <Portal>\n <div\n {...baseProps}\n className={clsx(testUtilStyles.root, baseProps.className)}\n ref={__internalRootRef}\n role=\"tooltip\"\n >\n <Transition in={true}>\n {() => (\n <PopoverContainer\n getTrack={getTrack}\n size=\"medium\"\n fixedWidth={false}\n position={position}\n zIndex={7000}\n arrow={position => <PopoverArrow position={position} />}\n hideOnOverscroll={true}\n className={className}\n >\n <PopoverBody dismissButton={false} dismissAriaLabel={undefined} onDismiss={undefined} header={undefined}>\n {content}\n </PopoverBody>\n </PopoverContainer>\n )}\n </Transition>\n </div>\n </Portal>\n );\n}\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/tooltip/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,+CAA+C,CAAC;AAEvE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,YAAY,MAAM,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S,EACb,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,EACzD,GAAG,EAAE,iBAAiB,4BACE,UAAU,EAClC,IAAI,EAAC,SAAS;YAEd,oBAAC,UAAU,IAAC,EAAE,EAAE,IAAI,IACjB,GAAG,EAAE,CAAC,CACL,oBAAC,gBAAgB,IACf,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,QAAQ,EACb,UAAU,EAAE,KAAK,EACjB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC,oBAAC,YAAY,IAAC,QAAQ,EAAE,QAAQ,GAAI,EACvD,gBAAgB,EAAE,IAAI,EACtB,SAAS,EAAE,SAAS;gBAEpB,oBAAC,WAAW,IAAC,aAAa,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,IACpG,OAAO,CACI,CACG,CACpB,CACU,CACT,CACC,CACV,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport clsx from 'clsx';\n\nimport { Portal } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { Transition } from '../internal/components/transition';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport PopoverArrow from '../popover/arrow';\nimport PopoverBody from '../popover/body';\nimport PopoverContainer from '../popover/container';\nimport { InternalTooltipProps } from './interfaces';\n\nimport testUtilStyles from './test-classes/styles.css.js';\n\ntype InternalTooltipComponentProps = InternalTooltipProps &\n InternalBaseComponentProps & {\n // ID of the associated trigger. When the trigger and the tooltip are connected via referrer ID, the\n // nodeBelongs(triggerNode, tooltipNode) returns true.\n referrerId?: string;\n };\n\nexport default function InternalTooltip({\n content,\n getTrack,\n className,\n position = 'top',\n onEscape,\n referrerId,\n __internalRootRef,\n ...restProps\n}: InternalTooltipComponentProps) {\n const baseProps = getBaseProps(restProps);\n const trackRef = React.useRef<HTMLElement | SVGElement | null>(null);\n\n // Update the ref with the current tracked element\n React.useEffect(() => {\n const element = getTrack();\n trackRef.current = element;\n }, [getTrack]);\n\n useEffect(() => {\n const controller = new AbortController();\n window.addEventListener(\n 'keydown',\n (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n // Prevent any surrounding modals or dialogs from acting on this Esc.\n event.stopPropagation();\n fireNonCancelableEvent(onEscape);\n }\n },\n {\n // The tooltip is often activated on mouseover, which means the focus can\n // be anywhere else on the page. Capture also means that this gets called\n // before any wrapper modals or dialogs can detect it and act on it.\n capture: true,\n signal: controller.signal,\n }\n );\n return () => {\n controller.abort();\n };\n }, [onEscape]);\n\n return (\n <Portal>\n <div\n {...baseProps}\n className={clsx(testUtilStyles.root, baseProps.className)}\n ref={__internalRootRef}\n data-awsui-referrer-id={referrerId}\n role=\"tooltip\"\n >\n <Transition in={true}>\n {() => (\n <PopoverContainer\n getTrack={getTrack}\n size=\"medium\"\n fixedWidth={false}\n position={position}\n zIndex={7000}\n arrow={position => <PopoverArrow position={position} />}\n hideOnOverscroll={true}\n className={className}\n >\n <PopoverBody dismissButton={false} dismissAriaLabel={undefined} onDismiss={undefined} header={undefined}>\n {content}\n </PopoverBody>\n </PopoverContainer>\n )}\n </Transition>\n </div>\n </Portal>\n );\n}\n"]}