@cloudscape-design/components 3.0.391 → 3.0.392
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app-layout/drawer/drawers-helpers.d.ts +1 -1
- package/app-layout/drawer/drawers-helpers.d.ts.map +1 -1
- package/app-layout/drawer/drawers-helpers.js +4 -8
- package/app-layout/drawer/drawers-helpers.js.map +1 -1
- package/app-layout/drawer/index.d.ts.map +1 -1
- package/app-layout/drawer/index.js +13 -4
- package/app-layout/drawer/index.js.map +1 -1
- package/app-layout/drawer/styles.css.js +11 -10
- package/app-layout/drawer/styles.scoped.css +24 -17
- package/app-layout/drawer/styles.selectors.js +11 -10
- package/app-layout/index.d.ts.map +1 -1
- package/app-layout/index.js +3 -0
- package/app-layout/index.js.map +1 -1
- package/app-layout/mobile-toolbar/index.js +1 -1
- package/app-layout/mobile-toolbar/index.js.map +1 -1
- package/app-layout/visual-refresh/drawers.js +1 -1
- package/app-layout/visual-refresh/drawers.js.map +1 -1
- package/autosuggest/internal.d.ts.map +1 -1
- package/autosuggest/internal.js +5 -3
- package/autosuggest/internal.js.map +1 -1
- package/button-dropdown/interfaces.d.ts +2 -1
- package/button-dropdown/interfaces.d.ts.map +1 -1
- package/button-dropdown/interfaces.js.map +1 -1
- package/button-dropdown/internal.js +4 -4
- package/button-dropdown/internal.js.map +1 -1
- package/internal/components/dropdown/index.d.ts.map +1 -1
- package/internal/components/dropdown/index.js +6 -8
- package/internal/components/dropdown/index.js.map +1 -1
- package/internal/components/dropdown/styles.css.js +20 -21
- package/internal/components/dropdown/styles.scoped.css +37 -41
- package/internal/components/dropdown/styles.selectors.js +20 -21
- package/internal/components/dropdown-status/index.d.ts +6 -1
- package/internal/components/dropdown-status/index.d.ts.map +1 -1
- package/internal/components/dropdown-status/index.js +2 -2
- package/internal/components/dropdown-status/index.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/hooks/use-visual-mode/index.d.ts +0 -2
- package/internal/hooks/use-visual-mode/index.d.ts.map +1 -1
- package/internal/hooks/use-visual-mode/index.js +2 -31
- package/internal/hooks/use-visual-mode/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/multiselect/internal.d.ts.map +1 -1
- package/multiselect/internal.js +7 -2
- package/multiselect/internal.js.map +1 -1
- package/package.json +1 -1
- package/property-filter/controller.d.ts.map +1 -1
- package/property-filter/controller.js +23 -11
- package/property-filter/controller.js.map +1 -1
- package/property-filter/index.d.ts.map +1 -1
- package/property-filter/index.js +26 -11
- package/property-filter/index.js.map +1 -1
- package/property-filter/property-filter-autosuggest.d.ts.map +1 -1
- package/property-filter/property-filter-autosuggest.js +1 -1
- package/property-filter/property-filter-autosuggest.js.map +1 -1
- package/select/internal.d.ts.map +1 -1
- package/select/internal.js +3 -1
- package/select/internal.js.map +1 -1
- package/table/sticky-scrollbar/sticky-scrollbar.js +1 -1
- package/table/sticky-scrollbar/sticky-scrollbar.js.map +1 -1
- package/table/sticky-scrollbar/use-sticky-scrollbar.d.ts +1 -1
- package/table/sticky-scrollbar/use-sticky-scrollbar.d.ts.map +1 -1
- package/table/sticky-scrollbar/use-sticky-scrollbar.js +10 -2
- package/table/sticky-scrollbar/use-sticky-scrollbar.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/dropdown/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CA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EAClC,yBAAyB,EAAE,yBAAyB,EACpD,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,oBAAoB,EAAE,oBAAoB,EAC1C,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,iBAAiB,EACrB,IAAI,EAAE,mBAAmB,EACzB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,IAE/B,QAAQ,CACS;gBAEpB,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,MAAM,KAAK,SAAS,CAAC;AAEvG,eAAe,QAAQ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport styles from './styles.css.js';\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../../hooks/use-merge-refs';\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { fireNonCancelableEvent } from '../../events';\nimport { DropdownProps } from './interfaces';\nimport {\n DropdownPosition,\n InteriorDropdownPosition,\n calculatePosition,\n defaultMaxDropdownWidth,\n hasEnoughSpaceToStretchBeyondTriggerWidth,\n} from './dropdown-fit-handler';\nimport { Transition, TransitionStatus } from '../transition';\nimport { useVisualRefresh } from '../../hooks/use-visual-mode';\nimport { usePortalModeClasses } from '../../hooks/use-portal-mode-classes';\nimport { DropdownContextProvider, DropdownContextProviderProps } from './context';\nimport { useMobile } from '../../hooks/use-mobile';\nimport TabTrap from '../tab-trap/index.js';\nimport { getFirstFocusable, getLastFocusable } from '../focus-lock/utils.js';\nimport { useUniqueId } from '../../hooks/use-unique-id/index.js';\nimport customCssProps from '../../generated/custom-css-properties';\n\ninterface DropdownContainerProps {\n children?: React.ReactNode;\n renderWithPortal?: boolean;\n id?: string;\n referrerId?: string;\n open?: boolean;\n}\n\nconst DropdownContainer = ({ children, renderWithPortal = false, id, referrerId, open }: DropdownContainerProps) => {\n if (renderWithPortal) {\n if (open) {\n return createPortal(\n <div id={id} data-awsui-referrer-id={referrerId}>\n {children}\n </div>,\n document.body\n );\n } else {\n return null;\n }\n } else {\n return <>{children}</>;\n }\n};\n\ninterface TransitionContentProps {\n state: TransitionStatus;\n transitionRef: React.MutableRefObject<any>;\n dropdownClasses: string;\n stretchWidth: boolean;\n interior: boolean;\n isRefresh: boolean;\n dropdownRef: React.RefObject<HTMLDivElement>;\n verticalContainerRef: React.RefObject<HTMLDivElement>;\n expandToViewport?: boolean;\n stretchBeyondTriggerWidth?: boolean;\n header?: React.ReactNode;\n children?: React.ReactNode;\n footer?: React.ReactNode;\n position?: DropdownContextProviderProps['position'];\n open?: boolean;\n onMouseDown?: React.MouseEventHandler<Element>;\n id?: string;\n role?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n}\n\nconst TransitionContent = ({\n state,\n transitionRef,\n dropdownClasses,\n stretchWidth,\n interior,\n isRefresh,\n dropdownRef,\n verticalContainerRef,\n expandToViewport,\n stretchBeyondTriggerWidth,\n header,\n children,\n footer,\n position,\n open,\n onMouseDown,\n id,\n role,\n ariaLabelledby,\n ariaDescribedby,\n}: TransitionContentProps) => {\n const contentRef = useMergeRefs(dropdownRef, transitionRef);\n return (\n <div\n className={clsx(styles.dropdown, dropdownClasses, {\n [styles.open]: open,\n [styles['with-limited-width']]: !stretchWidth,\n [styles['hide-upper-border']]: stretchWidth,\n [styles.interior]: interior,\n [styles['is-empty']]: !header && !children,\n [styles.refresh]: isRefresh,\n [styles['use-portal']]: expandToViewport && !interior,\n [styles['stretch-beyond-trigger-width']]: stretchBeyondTriggerWidth,\n })}\n ref={contentRef}\n id={id}\n role={role}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n data-open={open}\n data-animating={state !== 'exited'}\n aria-hidden={!open}\n style={\n stretchBeyondTriggerWidth ? { [customCssProps.dropdownDefaultMaxWidth]: `${defaultMaxDropdownWidth}px` } : {}\n }\n onMouseDown={onMouseDown}\n >\n <div className={clsx(styles['dropdown-content-wrapper'], isRefresh && styles.refresh)}>\n <div className={styles['ie11-wrapper']}>\n <div ref={verticalContainerRef} className={styles['dropdown-content']}>\n <DropdownContextProvider position={position}>\n {header}\n {children}\n {footer}\n </DropdownContextProvider>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nconst Dropdown = ({\n children,\n trigger,\n open,\n onDropdownClose,\n onMouseDown,\n header,\n footer,\n dropdownId,\n stretchTriggerHeight = false,\n stretchWidth = true,\n stretchHeight = false,\n stretchToTriggerWidth = true,\n stretchBeyondTriggerWidth = false,\n expandToViewport = false,\n preferCenter = false,\n interior = false,\n minWidth,\n scrollable = true,\n loopFocus = expandToViewport,\n onFocus,\n onBlur,\n contentKey,\n dropdownContentId,\n dropdownContentRole,\n ariaLabelledby,\n ariaDescribedby,\n}: DropdownProps) => {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLDivElement | null>(null);\n const dropdownRef = useRef<HTMLDivElement | null>(null);\n const dropdownContainerRef = useRef<HTMLDivElement | null>(null);\n // This container is only needed to apply max-height to. We can't move max-height to it's parent\n // because of an IE11 issue with flexbox. https://github.com/philipwalton/flexbugs/issues/216\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 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 const setDropdownPosition = (\n position: DropdownPosition | InteriorDropdownPosition,\n triggerBox: DOMRect,\n target: HTMLDivElement,\n verticalContainer: HTMLDivElement\n ) => {\n const entireWidth = !interior && stretchWidth;\n if (!stretchWidth) {\n // 1px offset for dropdowns where the dropdown itself needs a border, rather than on the items\n verticalContainer.style.maxHeight = `${parseInt(position.height) + 1}px`;\n } else {\n verticalContainer.style.maxHeight = position.height;\n }\n\n if (entireWidth && !expandToViewport) {\n if (stretchToTriggerWidth) {\n target.classList.add(styles['occupy-entire-width']);\n }\n } else {\n target.style.width = position.width;\n }\n\n // Using styles for main dropdown to adjust its position as preferred alternative\n if (position.dropUp && !interior) {\n target.classList.add(styles['dropdown-drop-up']);\n if (!expandToViewport) {\n target.style.bottom = '100%';\n }\n } else {\n target.classList.remove(styles['dropdown-drop-up']);\n }\n target.classList.add(position.dropLeft ? styles['dropdown-drop-left'] : styles['dropdown-drop-right']);\n\n if (position.left && position.left !== 'auto') {\n target.style.left = position.left;\n }\n\n // Position normal overflow dropdowns with fixed positioning relative to viewport\n if (expandToViewport && !interior) {\n target.style.position = 'fixed';\n if (position.dropUp) {\n target.style.bottom = `calc(100% - ${triggerBox.top}px)`;\n } else {\n target.style.top = `${triggerBox.bottom}px`;\n }\n if (position.dropLeft) {\n target.style.left = `calc(${triggerBox.right}px - ${position.width})`;\n } else {\n target.style.left = `${triggerBox.left}px`;\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.dropUp) {\n target.style.bottom = position.bottom;\n } else {\n target.style.top = position.top;\n }\n target.style.left = position.left;\n }\n\n if (position.dropUp && position.dropLeft) {\n setPosition('top-left');\n } else if (position.dropUp) {\n setPosition('top-right');\n } else if (position.dropLeft) {\n setPosition('bottom-left');\n } else {\n setPosition('bottom-right');\n }\n };\n\n const isOutsideDropdown = (element: Element) =>\n (!wrapperRef.current || !wrapperRef.current.contains(element)) &&\n (!dropdownContainerRef.current || !dropdownContainerRef.current.contains(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 useLayoutEffect(() => {\n const onDropdownOpen = () => {\n if (open && dropdownRef.current && triggerRef.current && verticalContainerRef.current) {\n // calculate scroll width only for dropdowns that has a scrollbar and ignore it for date picker components\n if (scrollable) {\n dropdownRef.current.classList.add(styles.nowrap);\n }\n setDropdownPosition(\n ...calculatePosition(\n dropdownRef.current,\n triggerRef.current,\n verticalContainerRef.current,\n interior,\n expandToViewport,\n preferCenter,\n stretchWidth,\n stretchHeight,\n isMobile,\n minWidth,\n stretchBeyondTriggerWidth\n ),\n dropdownRef.current,\n verticalContainerRef.current\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, stretchWidth, isMobile, contentKey]);\n\n // Prevent the dropdown width from stretching beyond the trigger width\n // if that is going to cause the dropdown to be cropped because of overflow\n useLayoutEffect(() => {\n if (stretchBeyondTriggerWidth && dropdownRef.current && triggerRef.current && verticalContainerRef.current) {\n if (\n !hasEnoughSpaceToStretchBeyondTriggerWidth({\n triggerElement: triggerRef.current,\n dropdownElement: dropdownRef.current,\n desiredMinWidth: minWidth,\n expandToViewport,\n stretchWidth,\n stretchHeight,\n isMobile,\n })\n ) {\n dropdownRef.current.classList.remove(styles['stretch-beyond-trigger-width']);\n }\n }\n });\n\n // subscribe to outside click\n useEffect(() => {\n if (!open) {\n return;\n }\n const clickListener = (e: MouseEvent) => {\n if (!dropdownRef.current?.contains(e.target as Node) && !triggerRef.current?.contains(e.target as Node)) {\n fireNonCancelableEvent(onDropdownClose);\n }\n };\n window.addEventListener('click', clickListener, true);\n\n return () => {\n window.removeEventListener('click', clickListener, true);\n };\n }, [open, onDropdownClose]);\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) {\n const triggerRect = triggerRef.current.getBoundingClientRect();\n const target = dropdownRef.current;\n if (fixedPosition.current) {\n if (fixedPosition.current.dropUp) {\n dropdownRef.current.style.bottom = `calc(100% - ${triggerRect.top}px)`;\n } else {\n target.style.top = `${triggerRect.bottom}px`;\n }\n if (fixedPosition.current.dropLeft) {\n target.style.left = `calc(${triggerRect.right}px - ${fixedPosition.current.width})`;\n } else {\n target.style.left = `${triggerRect.left}px`;\n }\n }\n }\n };\n\n updateDropdownPosition();\n\n window.addEventListener('scroll', updateDropdownPosition, true);\n window.addEventListener('resize', updateDropdownPosition, true);\n return () => {\n window.removeEventListener('scroll', updateDropdownPosition, true);\n window.removeEventListener('resize', updateDropdownPosition, true);\n };\n }, [open, expandToViewport]);\n\n const referrerId = useUniqueId();\n\n return (\n <div\n className={clsx(\n styles.root,\n interior && styles.interior,\n stretchTriggerHeight && styles['stretch-trigger-height']\n )}\n ref={wrapperRef}\n onFocus={focusHandler}\n onBlur={blurHandler}\n >\n <div id={referrerId} className={clsx(stretchTriggerHeight && styles['stretch-trigger-height'])} ref={triggerRef}>\n {trigger}\n </div>\n\n <TabTrap\n focusNextCallback={() => dropdownRef.current && getFirstFocusable(dropdownRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <DropdownContainer\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 stretchWidth={stretchWidth}\n interior={interior}\n header={header}\n expandToViewport={expandToViewport}\n stretchBeyondTriggerWidth={stretchBeyondTriggerWidth}\n footer={footer}\n onMouseDown={onMouseDown}\n isRefresh={isRefresh}\n dropdownRef={dropdownRef}\n verticalContainerRef={verticalContainerRef}\n position={position}\n id={dropdownContentId}\n role={dropdownContentRole}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n >\n {children}\n </TransitionContent>\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).bottom !== undefined;\n\nexport default Dropdown;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/dropdown/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,Y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GAAG,EAClB,eAAe,EAAE,eAAe,EAChC,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,gBAAgB,EAClC,yBAAyB,EAAE,yBAAyB,EACpD,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,oBAAoB,EAAE,oBAAoB,EAC1C,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,iBAAiB,EACrB,IAAI,EAAE,mBAAmB,EACzB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,IAE/B,QAAQ,CACS;gBAEpB,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,MAAM,KAAK,SAAS,CAAC;AAEvG,eAAe,QAAQ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport styles from './styles.css.js';\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../../hooks/use-merge-refs';\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { fireNonCancelableEvent } from '../../events';\nimport { DropdownProps } from './interfaces';\nimport {\n DropdownPosition,\n InteriorDropdownPosition,\n calculatePosition,\n defaultMaxDropdownWidth,\n hasEnoughSpaceToStretchBeyondTriggerWidth,\n} from './dropdown-fit-handler';\nimport { Transition, TransitionStatus } from '../transition';\nimport { useVisualRefresh } from '../../hooks/use-visual-mode';\nimport { usePortalModeClasses } from '../../hooks/use-portal-mode-classes';\nimport { DropdownContextProvider, DropdownContextProviderProps } from './context';\nimport { useMobile } from '../../hooks/use-mobile';\nimport TabTrap from '../tab-trap/index.js';\nimport { getFirstFocusable, getLastFocusable } from '../focus-lock/utils.js';\nimport { useUniqueId } from '../../hooks/use-unique-id/index.js';\nimport customCssProps from '../../generated/custom-css-properties';\n\ninterface DropdownContainerProps {\n children?: React.ReactNode;\n renderWithPortal?: boolean;\n id?: string;\n referrerId?: string;\n open?: boolean;\n}\n\nconst DropdownContainer = ({ children, renderWithPortal = false, id, referrerId, open }: DropdownContainerProps) => {\n if (renderWithPortal) {\n if (open) {\n return createPortal(\n <div id={id} data-awsui-referrer-id={referrerId}>\n {children}\n </div>,\n document.body\n );\n } else {\n return null;\n }\n } else {\n return <>{children}</>;\n }\n};\n\ninterface TransitionContentProps {\n state: TransitionStatus;\n transitionRef: React.MutableRefObject<any>;\n dropdownClasses: string;\n stretchWidth: boolean;\n interior: boolean;\n isRefresh: boolean;\n dropdownRef: React.RefObject<HTMLDivElement>;\n verticalContainerRef: React.RefObject<HTMLDivElement>;\n expandToViewport?: boolean;\n stretchBeyondTriggerWidth?: boolean;\n header?: React.ReactNode;\n children?: React.ReactNode;\n footer?: React.ReactNode;\n position?: DropdownContextProviderProps['position'];\n open?: boolean;\n onMouseDown?: React.MouseEventHandler<Element>;\n id?: string;\n role?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n}\n\nconst TransitionContent = ({\n state,\n transitionRef,\n dropdownClasses,\n stretchWidth,\n interior,\n isRefresh,\n dropdownRef,\n verticalContainerRef,\n expandToViewport,\n stretchBeyondTriggerWidth,\n header,\n children,\n footer,\n position,\n open,\n onMouseDown,\n id,\n role,\n ariaLabelledby,\n ariaDescribedby,\n}: TransitionContentProps) => {\n const contentRef = useMergeRefs(dropdownRef, transitionRef);\n return (\n <div\n className={clsx(styles.dropdown, dropdownClasses, {\n [styles.open]: open,\n [styles['with-limited-width']]: !stretchWidth,\n [styles['hide-upper-border']]: stretchWidth,\n [styles.interior]: interior,\n [styles.refresh]: isRefresh,\n [styles['use-portal']]: expandToViewport && !interior,\n [styles['stretch-beyond-trigger-width']]: stretchBeyondTriggerWidth,\n })}\n ref={contentRef}\n id={id}\n role={role}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n data-open={open}\n data-animating={state !== 'exited'}\n aria-hidden={!open}\n style={\n stretchBeyondTriggerWidth ? { [customCssProps.dropdownDefaultMaxWidth]: `${defaultMaxDropdownWidth}px` } : {}\n }\n onMouseDown={onMouseDown}\n >\n <div\n className={clsx(\n styles['dropdown-content-wrapper'],\n !header && !children && styles['is-empty'],\n isRefresh && styles.refresh\n )}\n >\n <div ref={verticalContainerRef} className={styles['dropdown-content']}>\n <DropdownContextProvider position={position}>\n {header}\n {children}\n {footer}\n </DropdownContextProvider>\n </div>\n </div>\n </div>\n );\n};\n\nconst Dropdown = ({\n children,\n trigger,\n open,\n onDropdownClose,\n onMouseDown,\n header,\n footer,\n dropdownId,\n stretchTriggerHeight = false,\n stretchWidth = true,\n stretchHeight = false,\n stretchToTriggerWidth = true,\n stretchBeyondTriggerWidth = false,\n expandToViewport = false,\n preferCenter = false,\n interior = false,\n minWidth,\n scrollable = true,\n loopFocus = expandToViewport,\n onFocus,\n onBlur,\n contentKey,\n dropdownContentId,\n dropdownContentRole,\n ariaLabelledby,\n ariaDescribedby,\n}: DropdownProps) => {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLDivElement | null>(null);\n const dropdownRef = useRef<HTMLDivElement | null>(null);\n const dropdownContainerRef = useRef<HTMLDivElement | null>(null);\n // This container is only needed to apply max-height to. We can't move max-height to it's parent\n // because of an IE11 issue with flexbox. https://github.com/philipwalton/flexbugs/issues/216\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 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 const setDropdownPosition = (\n position: DropdownPosition | InteriorDropdownPosition,\n triggerBox: DOMRect,\n target: HTMLDivElement,\n verticalContainer: HTMLDivElement\n ) => {\n const entireWidth = !interior && stretchWidth;\n if (!stretchWidth) {\n // 1px offset for dropdowns where the dropdown itself needs a border, rather than on the items\n verticalContainer.style.maxHeight = `${parseInt(position.height) + 1}px`;\n } else {\n verticalContainer.style.maxHeight = position.height;\n }\n\n if (entireWidth && !expandToViewport) {\n if (stretchToTriggerWidth) {\n target.classList.add(styles['occupy-entire-width']);\n }\n } else {\n target.style.width = position.width;\n }\n\n // Using styles for main dropdown to adjust its position as preferred alternative\n if (position.dropUp && !interior) {\n target.classList.add(styles['dropdown-drop-up']);\n if (!expandToViewport) {\n target.style.bottom = '100%';\n }\n } else {\n target.classList.remove(styles['dropdown-drop-up']);\n }\n target.classList.add(position.dropLeft ? styles['dropdown-drop-left'] : styles['dropdown-drop-right']);\n\n if (position.left && position.left !== 'auto') {\n target.style.left = position.left;\n }\n\n // Position normal overflow dropdowns with fixed positioning relative to viewport\n if (expandToViewport && !interior) {\n target.style.position = 'fixed';\n if (position.dropUp) {\n target.style.bottom = `calc(100% - ${triggerBox.top}px)`;\n } else {\n target.style.top = `${triggerBox.bottom}px`;\n }\n if (position.dropLeft) {\n target.style.left = `calc(${triggerBox.right}px - ${position.width})`;\n } else {\n target.style.left = `${triggerBox.left}px`;\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.dropUp) {\n target.style.bottom = position.bottom;\n } else {\n target.style.top = position.top;\n }\n target.style.left = position.left;\n }\n\n if (position.dropUp && position.dropLeft) {\n setPosition('top-left');\n } else if (position.dropUp) {\n setPosition('top-right');\n } else if (position.dropLeft) {\n setPosition('bottom-left');\n } else {\n setPosition('bottom-right');\n }\n };\n\n const isOutsideDropdown = (element: Element) =>\n (!wrapperRef.current || !wrapperRef.current.contains(element)) &&\n (!dropdownContainerRef.current || !dropdownContainerRef.current.contains(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 useLayoutEffect(() => {\n const onDropdownOpen = () => {\n if (open && dropdownRef.current && triggerRef.current && verticalContainerRef.current) {\n // calculate scroll width only for dropdowns that has a scrollbar and ignore it for date picker components\n if (scrollable) {\n dropdownRef.current.classList.add(styles.nowrap);\n }\n setDropdownPosition(\n ...calculatePosition(\n dropdownRef.current,\n triggerRef.current,\n verticalContainerRef.current,\n interior,\n expandToViewport,\n preferCenter,\n stretchWidth,\n stretchHeight,\n isMobile,\n minWidth,\n stretchBeyondTriggerWidth\n ),\n dropdownRef.current,\n verticalContainerRef.current\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, stretchWidth, isMobile, contentKey]);\n\n // Prevent the dropdown width from stretching beyond the trigger width\n // if that is going to cause the dropdown to be cropped because of overflow\n useLayoutEffect(() => {\n if (stretchBeyondTriggerWidth && dropdownRef.current && triggerRef.current && verticalContainerRef.current) {\n if (\n !hasEnoughSpaceToStretchBeyondTriggerWidth({\n triggerElement: triggerRef.current,\n dropdownElement: dropdownRef.current,\n desiredMinWidth: minWidth,\n expandToViewport,\n stretchWidth,\n stretchHeight,\n isMobile,\n })\n ) {\n dropdownRef.current.classList.remove(styles['stretch-beyond-trigger-width']);\n }\n }\n });\n\n // subscribe to outside click\n useEffect(() => {\n if (!open) {\n return;\n }\n const clickListener = (e: MouseEvent) => {\n if (!dropdownRef.current?.contains(e.target as Node) && !triggerRef.current?.contains(e.target as Node)) {\n fireNonCancelableEvent(onDropdownClose);\n }\n };\n window.addEventListener('click', clickListener, true);\n\n return () => {\n window.removeEventListener('click', clickListener, true);\n };\n }, [open, onDropdownClose]);\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) {\n const triggerRect = triggerRef.current.getBoundingClientRect();\n const target = dropdownRef.current;\n if (fixedPosition.current) {\n if (fixedPosition.current.dropUp) {\n dropdownRef.current.style.bottom = `calc(100% - ${triggerRect.top}px)`;\n } else {\n target.style.top = `${triggerRect.bottom}px`;\n }\n if (fixedPosition.current.dropLeft) {\n target.style.left = `calc(${triggerRect.right}px - ${fixedPosition.current.width})`;\n } else {\n target.style.left = `${triggerRect.left}px`;\n }\n }\n }\n };\n\n updateDropdownPosition();\n\n window.addEventListener('scroll', updateDropdownPosition, true);\n window.addEventListener('resize', updateDropdownPosition, true);\n return () => {\n window.removeEventListener('scroll', updateDropdownPosition, true);\n window.removeEventListener('resize', updateDropdownPosition, true);\n };\n }, [open, expandToViewport]);\n\n const referrerId = useUniqueId();\n\n return (\n <div\n className={clsx(\n styles.root,\n interior && styles.interior,\n stretchTriggerHeight && styles['stretch-trigger-height']\n )}\n ref={wrapperRef}\n onFocus={focusHandler}\n onBlur={blurHandler}\n >\n <div id={referrerId} className={clsx(stretchTriggerHeight && styles['stretch-trigger-height'])} ref={triggerRef}>\n {trigger}\n </div>\n\n <TabTrap\n focusNextCallback={() => dropdownRef.current && getFirstFocusable(dropdownRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <DropdownContainer\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 stretchWidth={stretchWidth}\n interior={interior}\n header={header}\n expandToViewport={expandToViewport}\n stretchBeyondTriggerWidth={stretchBeyondTriggerWidth}\n footer={footer}\n onMouseDown={onMouseDown}\n isRefresh={isRefresh}\n dropdownRef={dropdownRef}\n verticalContainerRef={verticalContainerRef}\n position={position}\n id={dropdownContentId}\n role={dropdownContentRole}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n >\n {children}\n </TransitionContent>\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).bottom !== undefined;\n\nexport default Dropdown;\n"]}
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"dropdown-content-wrapper": "awsui_dropdown-content-
|
|
5
|
-
"awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-
|
|
6
|
-
"refresh": "
|
|
7
|
-
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-
|
|
8
|
-
"root": "
|
|
9
|
-
"interior": "
|
|
10
|
-
"dropdown": "
|
|
11
|
-
"use-portal": "awsui_use-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"dropdown-drop-
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"dropdown-content": "awsui_dropdown-
|
|
23
|
-
"
|
|
24
|
-
"stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_ai07r_267"
|
|
4
|
+
"dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_siz4n_93",
|
|
5
|
+
"awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_siz4n_1",
|
|
6
|
+
"refresh": "awsui_refresh_qwoo0_siz4n_114",
|
|
7
|
+
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_siz4n_1",
|
|
8
|
+
"root": "awsui_root_qwoo0_siz4n_143",
|
|
9
|
+
"interior": "awsui_interior_qwoo0_siz4n_157",
|
|
10
|
+
"dropdown": "awsui_dropdown_qwoo0_siz4n_93",
|
|
11
|
+
"use-portal": "awsui_use-portal_qwoo0_siz4n_168",
|
|
12
|
+
"is-empty": "awsui_is-empty_qwoo0_siz4n_213",
|
|
13
|
+
"dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_siz4n_216",
|
|
14
|
+
"with-limited-width": "awsui_with-limited-width_qwoo0_siz4n_220",
|
|
15
|
+
"dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_siz4n_223",
|
|
16
|
+
"dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_siz4n_226",
|
|
17
|
+
"occupy-entire-width": "awsui_occupy-entire-width_qwoo0_siz4n_229",
|
|
18
|
+
"stretch-beyond-trigger-width": "awsui_stretch-beyond-trigger-width_qwoo0_siz4n_232",
|
|
19
|
+
"hide-upper-border": "awsui_hide-upper-border_qwoo0_siz4n_236",
|
|
20
|
+
"open": "awsui_open_qwoo0_siz4n_243",
|
|
21
|
+
"nowrap": "awsui_nowrap_qwoo0_siz4n_252",
|
|
22
|
+
"dropdown-content": "awsui_dropdown-content_qwoo0_siz4n_93",
|
|
23
|
+
"stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_siz4n_263"
|
|
25
24
|
};
|
|
26
25
|
|
|
@@ -90,10 +90,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
90
90
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
|
-
.awsui_dropdown-content-
|
|
94
|
-
animation: awsui_awsui-motion-fade-in-
|
|
93
|
+
.awsui_dropdown-content-wrapper_qwoo0_siz4n_93:not(#\9) {
|
|
94
|
+
animation: awsui_awsui-motion-fade-in-dropdown_qwoo0_siz4n_1 var(--motion-duration-show-quick-aq3ump, 135ms) var(--motion-easing-show-quick-vc5zgd, ease-out);
|
|
95
95
|
}
|
|
96
|
-
@keyframes awsui_awsui-motion-fade-in-
|
|
96
|
+
@keyframes awsui_awsui-motion-fade-in-dropdown_qwoo0_siz4n_1 {
|
|
97
97
|
from {
|
|
98
98
|
opacity: 0.4;
|
|
99
99
|
}
|
|
@@ -102,22 +102,22 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
@media (prefers-reduced-motion: reduce) {
|
|
105
|
-
.awsui_dropdown-content-
|
|
105
|
+
.awsui_dropdown-content-wrapper_qwoo0_siz4n_93:not(#\9) {
|
|
106
106
|
animation: none;
|
|
107
107
|
transition: none;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
.awsui-motion-disabled .awsui_dropdown-content-
|
|
110
|
+
.awsui-motion-disabled .awsui_dropdown-content-wrapper_qwoo0_siz4n_93:not(#\9), .awsui-mode-entering .awsui_dropdown-content-wrapper_qwoo0_siz4n_93:not(#\9) {
|
|
111
111
|
animation: none;
|
|
112
112
|
transition: none;
|
|
113
113
|
}
|
|
114
|
-
.awsui_dropdown-content-
|
|
114
|
+
.awsui_dropdown-content-wrapper_qwoo0_siz4n_93.awsui_refresh_qwoo0_siz4n_114:not(#\9) {
|
|
115
115
|
transform-origin: top;
|
|
116
|
-
animation-name: awsui_awsui-motion-fade-in-
|
|
116
|
+
animation-name: awsui_awsui-motion-fade-in-0_qwoo0_siz4n_1;
|
|
117
117
|
animation-duration: var(--motion-duration-show-quick-aq3ump, 135ms);
|
|
118
118
|
animation-timing-function: var(--motion-easing-show-quick-vc5zgd, ease-out);
|
|
119
119
|
}
|
|
120
|
-
@keyframes awsui_awsui-motion-fade-in-
|
|
120
|
+
@keyframes awsui_awsui-motion-fade-in-0_qwoo0_siz4n_1 {
|
|
121
121
|
from {
|
|
122
122
|
opacity: 0;
|
|
123
123
|
}
|
|
@@ -126,12 +126,12 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
@media (prefers-reduced-motion: reduce) {
|
|
129
|
-
.awsui_dropdown-content-
|
|
129
|
+
.awsui_dropdown-content-wrapper_qwoo0_siz4n_93.awsui_refresh_qwoo0_siz4n_114:not(#\9) {
|
|
130
130
|
animation: none;
|
|
131
131
|
transition: none;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
.awsui-motion-disabled .awsui_dropdown-content-
|
|
134
|
+
.awsui-motion-disabled .awsui_dropdown-content-wrapper_qwoo0_siz4n_93.awsui_refresh_qwoo0_siz4n_114:not(#\9), .awsui-mode-entering .awsui_dropdown-content-wrapper_qwoo0_siz4n_93.awsui_refresh_qwoo0_siz4n_114:not(#\9) {
|
|
135
135
|
animation: none;
|
|
136
136
|
transition: none;
|
|
137
137
|
}
|
|
@@ -140,7 +140,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
140
140
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
141
141
|
SPDX-License-Identifier: Apache-2.0
|
|
142
142
|
*/
|
|
143
|
-
.
|
|
143
|
+
.awsui_root_qwoo0_siz4n_143:not(#\9) {
|
|
144
144
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
145
145
|
border-collapse: separate;
|
|
146
146
|
border-spacing: 0;
|
|
@@ -180,11 +180,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
180
180
|
position: relative;
|
|
181
181
|
white-space: inherit;
|
|
182
182
|
}
|
|
183
|
-
.
|
|
183
|
+
.awsui_root_qwoo0_siz4n_143.awsui_interior_qwoo0_siz4n_157:not(#\9) {
|
|
184
184
|
position: static;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
.
|
|
187
|
+
.awsui_dropdown_qwoo0_siz4n_93:not(#\9) {
|
|
188
188
|
position: absolute;
|
|
189
189
|
display: none;
|
|
190
190
|
z-index: 2000;
|
|
@@ -192,24 +192,24 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
192
192
|
user-select: none;
|
|
193
193
|
transform-origin: top;
|
|
194
194
|
}
|
|
195
|
-
.
|
|
195
|
+
.awsui_dropdown_qwoo0_siz4n_93.awsui_use-portal_qwoo0_siz4n_168:not(#\9) {
|
|
196
196
|
z-index: 7000;
|
|
197
197
|
}
|
|
198
|
-
.
|
|
198
|
+
.awsui_dropdown_qwoo0_siz4n_93:not(#\9):not(.awsui_interior_qwoo0_siz4n_157) {
|
|
199
199
|
transform: translateY(0px);
|
|
200
200
|
transition: transform var(--motion-duration-show-quick-aq3ump, 135ms);
|
|
201
201
|
}
|
|
202
202
|
@media (prefers-reduced-motion: reduce) {
|
|
203
|
-
.
|
|
203
|
+
.awsui_dropdown_qwoo0_siz4n_93:not(#\9):not(.awsui_interior_qwoo0_siz4n_157) {
|
|
204
204
|
animation: none;
|
|
205
205
|
transition: none;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
.awsui-motion-disabled .
|
|
208
|
+
.awsui-motion-disabled .awsui_dropdown_qwoo0_siz4n_93:not(#\9):not(.awsui_interior_qwoo0_siz4n_157), .awsui-mode-entering .awsui_dropdown_qwoo0_siz4n_93:not(#\9):not(.awsui_interior_qwoo0_siz4n_157) {
|
|
209
209
|
animation: none;
|
|
210
210
|
transition: none;
|
|
211
211
|
}
|
|
212
|
-
.awsui_dropdown-content-
|
|
212
|
+
.awsui_dropdown-content-wrapper_qwoo0_siz4n_93:not(#\9) {
|
|
213
213
|
position: relative;
|
|
214
214
|
background-color: var(--color-background-dropdown-item-default-be16w5, #ffffff);
|
|
215
215
|
outline: none;
|
|
@@ -219,7 +219,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
219
219
|
box-sizing: border-box;
|
|
220
220
|
border-bottom: none;
|
|
221
221
|
}
|
|
222
|
-
.awsui_dropdown-content-
|
|
222
|
+
.awsui_dropdown-content-wrapper_qwoo0_siz4n_93:not(#\9)::after {
|
|
223
223
|
content: "";
|
|
224
224
|
position: absolute;
|
|
225
225
|
z-index: 1;
|
|
@@ -233,64 +233,60 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
233
233
|
pointer-events: none;
|
|
234
234
|
}
|
|
235
235
|
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
|
236
|
-
.awsui_dropdown-content-
|
|
236
|
+
.awsui_dropdown-content-wrapper_qwoo0_siz4n_93:not(#\9) {
|
|
237
237
|
border: var(--border-field-width-09w7vk, 2px) solid var(--color-border-container-top-736buh, transparent);
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
.awsui_dropdown-
|
|
240
|
+
.awsui_dropdown-content-wrapper_qwoo0_siz4n_93.awsui_is-empty_qwoo0_siz4n_213:not(#\9)::after {
|
|
241
|
+
display: none;
|
|
242
|
+
}
|
|
243
|
+
.awsui_dropdown-drop-up_qwoo0_siz4n_216 > .awsui_dropdown-content-wrapper_qwoo0_siz4n_93:not(#\9) {
|
|
241
244
|
transform-origin: bottom;
|
|
242
245
|
box-shadow: var(--shadow-dropup-7m0sn5, 0px 4px 20px 1px rgba(0, 7, 22, 0.1));
|
|
243
246
|
}
|
|
244
|
-
.awsui_dropdown-drop-
|
|
247
|
+
.awsui_dropdown-drop-up_qwoo0_siz4n_216.awsui_with-limited-width_qwoo0_siz4n_220 > .awsui_dropdown-content-wrapper_qwoo0_siz4n_93:not(#\9) {
|
|
245
248
|
border-top: none;
|
|
246
249
|
}
|
|
247
|
-
.awsui_dropdown-drop-
|
|
250
|
+
.awsui_dropdown-drop-left_qwoo0_siz4n_223:not(#\9) {
|
|
248
251
|
right: 0;
|
|
249
252
|
}
|
|
250
|
-
.awsui_dropdown-drop-
|
|
253
|
+
.awsui_dropdown-drop-right_qwoo0_siz4n_226:not(#\9) {
|
|
251
254
|
left: 0;
|
|
252
255
|
}
|
|
253
|
-
.
|
|
256
|
+
.awsui_dropdown_qwoo0_siz4n_93.awsui_occupy-entire-width_qwoo0_siz4n_229:not(#\9) {
|
|
254
257
|
min-width: 100%;
|
|
255
258
|
}
|
|
256
|
-
.
|
|
259
|
+
.awsui_dropdown_qwoo0_siz4n_93.awsui_stretch-beyond-trigger-width_qwoo0_siz4n_232:not(#\9) {
|
|
257
260
|
width: max-content;
|
|
258
261
|
max-width: var(--awsui-dropdown-default-max-width-y98gph, 100%);
|
|
259
262
|
}
|
|
260
|
-
.
|
|
263
|
+
.awsui_dropdown_qwoo0_siz4n_93.awsui_hide-upper-border_qwoo0_siz4n_236 > .awsui_dropdown-content-wrapper_qwoo0_siz4n_93:not(#\9) {
|
|
261
264
|
border-top: none;
|
|
262
265
|
}
|
|
263
|
-
.
|
|
266
|
+
.awsui_dropdown_qwoo0_siz4n_93.awsui_interior_qwoo0_siz4n_157 > .awsui_dropdown-content-wrapper_qwoo0_siz4n_93:not(#\9) {
|
|
264
267
|
margin-top: -1px;
|
|
265
268
|
border-top: var(--border-divider-list-width-27y3k5, 1px) solid var(--color-border-container-top-736buh, transparent);
|
|
266
269
|
}
|
|
267
|
-
.
|
|
270
|
+
.awsui_dropdown_qwoo0_siz4n_93.awsui_open_qwoo0_siz4n_243:not(#\9) {
|
|
268
271
|
display: block;
|
|
269
272
|
}
|
|
270
|
-
.
|
|
273
|
+
.awsui_dropdown_qwoo0_siz4n_93.awsui_open_qwoo0_siz4n_243:not(#\9):not(.awsui_interior_qwoo0_siz4n_157).awsui_refresh_qwoo0_siz4n_114[data-animating=true] {
|
|
271
274
|
transform: translateY(4px);
|
|
272
275
|
}
|
|
273
|
-
.
|
|
276
|
+
.awsui_dropdown_qwoo0_siz4n_93.awsui_open_qwoo0_siz4n_243:not(#\9):not(.awsui_interior_qwoo0_siz4n_157).awsui_refresh_qwoo0_siz4n_114[data-animating=true].awsui_dropdown-drop-up_qwoo0_siz4n_216 {
|
|
274
277
|
transform: translateY(-4px);
|
|
275
278
|
}
|
|
276
|
-
.
|
|
279
|
+
.awsui_dropdown_qwoo0_siz4n_93.awsui_open_qwoo0_siz4n_243.awsui_nowrap_qwoo0_siz4n_252:not(#\9) {
|
|
277
280
|
white-space: nowrap;
|
|
278
281
|
overflow: scroll;
|
|
279
282
|
}
|
|
280
|
-
.awsui_dropdown_qwoo0_ai07r_93.awsui_is-empty_qwoo0_ai07r_253:not(#\9)::after {
|
|
281
|
-
display: none;
|
|
282
|
-
}
|
|
283
283
|
|
|
284
|
-
.awsui_dropdown-
|
|
284
|
+
.awsui_dropdown-content_qwoo0_siz4n_93:not(#\9) {
|
|
285
285
|
display: flex;
|
|
286
286
|
flex-direction: column;
|
|
287
287
|
width: 100%;
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
-
.
|
|
291
|
-
display: flex;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
.awsui_stretch-trigger-height_qwoo0_ai07r_267:not(#\9) {
|
|
290
|
+
.awsui_stretch-trigger-height_qwoo0_siz4n_263:not(#\9) {
|
|
295
291
|
height: 100%;
|
|
296
292
|
}
|
|
@@ -2,26 +2,25 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"dropdown-content-wrapper": "awsui_dropdown-content-
|
|
6
|
-
"awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-
|
|
7
|
-
"refresh": "
|
|
8
|
-
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-
|
|
9
|
-
"root": "
|
|
10
|
-
"interior": "
|
|
11
|
-
"dropdown": "
|
|
12
|
-
"use-portal": "awsui_use-
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"dropdown-drop-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"dropdown-content": "awsui_dropdown-
|
|
24
|
-
"
|
|
25
|
-
"stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_ai07r_267"
|
|
5
|
+
"dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_siz4n_93",
|
|
6
|
+
"awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_siz4n_1",
|
|
7
|
+
"refresh": "awsui_refresh_qwoo0_siz4n_114",
|
|
8
|
+
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_siz4n_1",
|
|
9
|
+
"root": "awsui_root_qwoo0_siz4n_143",
|
|
10
|
+
"interior": "awsui_interior_qwoo0_siz4n_157",
|
|
11
|
+
"dropdown": "awsui_dropdown_qwoo0_siz4n_93",
|
|
12
|
+
"use-portal": "awsui_use-portal_qwoo0_siz4n_168",
|
|
13
|
+
"is-empty": "awsui_is-empty_qwoo0_siz4n_213",
|
|
14
|
+
"dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_siz4n_216",
|
|
15
|
+
"with-limited-width": "awsui_with-limited-width_qwoo0_siz4n_220",
|
|
16
|
+
"dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_siz4n_223",
|
|
17
|
+
"dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_siz4n_226",
|
|
18
|
+
"occupy-entire-width": "awsui_occupy-entire-width_qwoo0_siz4n_229",
|
|
19
|
+
"stretch-beyond-trigger-width": "awsui_stretch-beyond-trigger-width_qwoo0_siz4n_232",
|
|
20
|
+
"hide-upper-border": "awsui_hide-upper-border_qwoo0_siz4n_236",
|
|
21
|
+
"open": "awsui_open_qwoo0_siz4n_243",
|
|
22
|
+
"nowrap": "awsui_nowrap_qwoo0_siz4n_252",
|
|
23
|
+
"dropdown-content": "awsui_dropdown-content_qwoo0_siz4n_93",
|
|
24
|
+
"stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_siz4n_263"
|
|
26
25
|
};
|
|
27
26
|
|
|
@@ -15,11 +15,16 @@ export interface DropdownStatusPropsExtended extends DropdownStatusProps {
|
|
|
15
15
|
* to recover from the error.
|
|
16
16
|
*/
|
|
17
17
|
onRecoveryClick?: NonCancelableEventHandler;
|
|
18
|
+
/**
|
|
19
|
+
* Determines if retry button should be rendered
|
|
20
|
+
* in case recoveryText was automatically provided by i18n.
|
|
21
|
+
*/
|
|
22
|
+
hasRecoveryCallback?: boolean;
|
|
18
23
|
}
|
|
19
24
|
declare function DropdownStatus({ children }: {
|
|
20
25
|
children: React.ReactNode;
|
|
21
26
|
}): JSX.Element;
|
|
22
|
-
type UseDropdownStatus = ({ statusType, empty, loadingText, finishedText, filteringResultsText, errorText, recoveryText, isEmpty, isNoMatch, isFiltered, noMatch, onRecoveryClick, }: DropdownStatusPropsExtended) => DropdownStatusResult;
|
|
27
|
+
type UseDropdownStatus = ({ statusType, empty, loadingText, finishedText, filteringResultsText, errorText, recoveryText, isEmpty, isNoMatch, isFiltered, noMatch, hasRecoveryCallback, onRecoveryClick, }: DropdownStatusPropsExtended) => DropdownStatusResult;
|
|
23
28
|
interface DropdownStatusResult {
|
|
24
29
|
isSticky: boolean;
|
|
25
30
|
content: React.ReactNode | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/components/dropdown-status/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,yBAAyB,EAA0B,MAAM,cAAc,CAAC;AAGjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAE/B,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/components/dropdown-status/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,yBAAyB,EAA0B,MAAM,cAAc,CAAC;AAGjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAE/B,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,yBAAyB,CAAC;IAC5C;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,iBAAS,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,eAElE;AAED,KAAK,iBAAiB,GAAG,CAAC,EACxB,UAAU,EACV,KAAK,EACL,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,YAAY,EACZ,OAAO,EACP,SAAS,EACT,UAAU,EACV,OAAO,EACP,mBAAmB,EACnB,eAAe,GAChB,EAAE,2BAA2B,KAAK,oBAAoB,CAAC;AAExD,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;CACjC;AAED,eAAO,MAAM,iBAAiB,EAAE,iBAuD/B,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -9,7 +9,7 @@ import styles from './styles.css.js';
|
|
|
9
9
|
function DropdownStatus({ children }) {
|
|
10
10
|
return React.createElement("div", { className: styles.root }, children);
|
|
11
11
|
}
|
|
12
|
-
export const useDropdownStatus = ({ statusType, empty, loadingText, finishedText, filteringResultsText, errorText, recoveryText, isEmpty, isNoMatch, isFiltered, noMatch, onRecoveryClick, errorIconAriaLabel, }) => {
|
|
12
|
+
export const useDropdownStatus = ({ statusType, empty, loadingText, finishedText, filteringResultsText, errorText, recoveryText, isEmpty, isNoMatch, isFiltered, noMatch, onRecoveryClick, hasRecoveryCallback = false, errorIconAriaLabel, }) => {
|
|
13
13
|
const previousStatusType = usePrevious(statusType);
|
|
14
14
|
const statusResult = { isSticky: true, content: null };
|
|
15
15
|
if (statusType === 'loading') {
|
|
@@ -19,7 +19,7 @@ export const useDropdownStatus = ({ statusType, empty, loadingText, finishedText
|
|
|
19
19
|
statusResult.content = (React.createElement("span", null,
|
|
20
20
|
React.createElement(InternalStatusIndicator, { type: "error", __display: "inline", __animate: previousStatusType !== 'error', iconAriaLabel: errorIconAriaLabel }, errorText),
|
|
21
21
|
' ',
|
|
22
|
-
recoveryText && (React.createElement(InternalLink, { onFollow: () => fireNonCancelableEvent(onRecoveryClick), variant: "recovery", className: styles.recovery }, recoveryText))));
|
|
22
|
+
!!recoveryText && hasRecoveryCallback && (React.createElement(InternalLink, { onFollow: () => fireNonCancelableEvent(onRecoveryClick), variant: "recovery", className: styles.recovery }, recoveryText))));
|
|
23
23
|
}
|
|
24
24
|
else if (isEmpty && empty) {
|
|
25
25
|
statusResult.content = empty;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/dropdown-status/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAElD,OAAO,uBAAuB,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAA6B,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,MAAM,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/dropdown-status/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAA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AO,EAAC,UAAU,EAClB,SAAS,EAAE,MAAM,CAAC,QAAQ,IAEzB,YAAY,CACA,CAChB,CACI,CACR,CAAC;KACH;SAAM,IAAI,OAAO,IAAI,KAAK,EAAE;QAC3B,YAAY,CAAC,OAAO,GAAG,KAAK,CAAC;KAC9B;SAAM,IAAI,SAAS,IAAI,OAAO,EAAE;QAC/B,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC;KAChC;SAAM,IAAI,UAAU,IAAI,oBAAoB,EAAE;QAC7C,YAAY,CAAC,OAAO,GAAG,oBAAoB,CAAC;KAC7C;SAAM,IAAI,UAAU,KAAK,UAAU,IAAI,YAAY,EAAE;QACpD,YAAY,CAAC,OAAO,GAAG,YAAY,CAAC;QACpC,YAAY,CAAC,QAAQ,GAAG,KAAK,CAAC;KAC/B;IAED,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport InternalLink from '../../../link/internal';\n\nimport InternalStatusIndicator from '../../../status-indicator/internal';\nimport { NonCancelableEventHandler, fireNonCancelableEvent } from '../../events';\nimport { usePrevious } from '../../hooks/use-previous';\n\nimport { DropdownStatusProps } from './interfaces';\nimport styles from './styles.css.js';\n\nexport { DropdownStatusProps };\n\nexport interface DropdownStatusPropsExtended extends DropdownStatusProps {\n isEmpty?: boolean;\n isNoMatch?: boolean;\n isFiltered?: boolean;\n noMatch?: React.ReactNode;\n filteringResultsText?: string;\n /**\n * Called when the user clicks the recovery button placed at the\n * bottom of the dropdown list in the error state. Use this to\n * retry a failed request or provide another option for the user\n * to recover from the error.\n */\n onRecoveryClick?: NonCancelableEventHandler;\n /**\n * Determines if retry button should be rendered\n * in case recoveryText was automatically provided by i18n.\n */\n hasRecoveryCallback?: boolean;\n}\n\nfunction DropdownStatus({ children }: { children: React.ReactNode }) {\n return <div className={styles.root}>{children}</div>;\n}\n\ntype UseDropdownStatus = ({\n statusType,\n empty,\n loadingText,\n finishedText,\n filteringResultsText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n isFiltered,\n noMatch,\n hasRecoveryCallback,\n onRecoveryClick,\n}: DropdownStatusPropsExtended) => DropdownStatusResult;\n\ninterface DropdownStatusResult {\n isSticky: boolean;\n content: React.ReactNode | null;\n}\n\nexport const useDropdownStatus: UseDropdownStatus = ({\n statusType,\n empty,\n loadingText,\n finishedText,\n filteringResultsText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n isFiltered,\n noMatch,\n onRecoveryClick,\n hasRecoveryCallback = false,\n errorIconAriaLabel,\n}) => {\n const previousStatusType = usePrevious(statusType);\n const statusResult: DropdownStatusResult = { isSticky: true, content: null };\n\n if (statusType === 'loading') {\n statusResult.content = <InternalStatusIndicator type={'loading'}>{loadingText}</InternalStatusIndicator>;\n } else if (statusType === 'error') {\n statusResult.content = (\n <span>\n <InternalStatusIndicator\n type=\"error\"\n __display=\"inline\"\n __animate={previousStatusType !== 'error'}\n iconAriaLabel={errorIconAriaLabel}\n >\n {errorText}\n </InternalStatusIndicator>{' '}\n {!!recoveryText && hasRecoveryCallback && (\n <InternalLink\n onFollow={() => fireNonCancelableEvent(onRecoveryClick)}\n variant=\"recovery\"\n className={styles.recovery}\n >\n {recoveryText}\n </InternalLink>\n )}\n </span>\n );\n } else if (isEmpty && empty) {\n statusResult.content = empty;\n } else if (isNoMatch && noMatch) {\n statusResult.content = noMatch;\n } else if (isFiltered && filteringResultsText) {\n statusResult.content = filteringResultsText;\n } else if (statusType === 'finished' && finishedText) {\n statusResult.content = finishedText;\n statusResult.isSticky = false;\n }\n\n return statusResult;\n};\n\nexport default DropdownStatus;\n"]}
|
package/internal/environment.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/hooks/use-visual-mode/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/hooks/use-visual-mode/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,eAA+D,CAAC"}
|
|
@@ -1,35 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { ALWAYS_VISUAL_REFRESH } from '../../environment';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const awsuiVisualRefreshFlag = Symbol.for('awsui-visual-refresh-flag');
|
|
7
|
-
export const useVisualRefresh = ALWAYS_VISUAL_REFRESH ? () => true : useVisualRefreshDynamic;
|
|
8
|
-
// We expect VR is to be set only once and before the application is rendered.
|
|
9
|
-
let visualRefreshState = undefined;
|
|
10
|
-
// for testing
|
|
11
|
-
export function clearVisualRefreshState() {
|
|
12
|
-
visualRefreshState = undefined;
|
|
13
|
-
}
|
|
14
|
-
function detectVisualRefresh() {
|
|
15
|
-
return typeof document !== 'undefined' && !!document.querySelector('.awsui-visual-refresh');
|
|
16
|
-
}
|
|
17
|
-
export function useVisualRefreshDynamic() {
|
|
18
|
-
var _a;
|
|
19
|
-
if (visualRefreshState === undefined) {
|
|
20
|
-
visualRefreshState = detectVisualRefresh();
|
|
21
|
-
if (!visualRefreshState && typeof window !== 'undefined' && ((_a = window[awsuiVisualRefreshFlag]) === null || _a === void 0 ? void 0 : _a.call(window))) {
|
|
22
|
-
document.body.classList.add('awsui-visual-refresh');
|
|
23
|
-
visualRefreshState = true;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (isDevelopment) {
|
|
27
|
-
const newVisualRefreshState = detectVisualRefresh();
|
|
28
|
-
if (newVisualRefreshState !== visualRefreshState) {
|
|
29
|
-
warnOnce('Visual Refresh', 'Dynamic visual refresh change detected. This is not supported. ' +
|
|
30
|
-
'Make sure `awsui-visual-refresh` is attached to the `<body>` element before initial React render');
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return visualRefreshState;
|
|
34
|
-
}
|
|
4
|
+
import { useRuntimeVisualRefresh } from '@cloudscape-design/component-toolkit/internal';
|
|
5
|
+
export const useVisualRefresh = ALWAYS_VISUAL_REFRESH ? () => true : useRuntimeVisualRefresh;
|
|
35
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/hooks/use-visual-mode/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/hooks/use-visual-mode/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AAExF,MAAM,CAAC,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,uBAAuB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ALWAYS_VISUAL_REFRESH } from '../../environment';\nimport { useRuntimeVisualRefresh } from '@cloudscape-design/component-toolkit/internal';\n\nexport const useVisualRefresh = ALWAYS_VISUAL_REFRESH ? () => true : useRuntimeVisualRefresh;\n"]}
|
package/internal/manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["multiselect/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAIxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AA2B3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAQhD,QAAA,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["multiselect/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAIxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AA2B3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAQhD,QAAA,MAAM,mBAAmB,4HA0TxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|