@cloudscape-design/components 3.0.928 → 3.0.930
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/index.d.ts.map +1 -1
- package/app-layout/drawer/index.js +1 -1
- package/app-layout/drawer/index.js.map +1 -1
- package/app-layout/mobile-toolbar/index.d.ts.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.d.ts.map +1 -1
- package/app-layout/visual-refresh/drawers.js +2 -2
- package/app-layout/visual-refresh/drawers.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js +2 -2
- package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js.map +1 -1
- package/internal/components/option/interfaces.d.ts +1 -0
- package/internal/components/option/interfaces.d.ts.map +1 -1
- package/internal/components/option/interfaces.js.map +1 -1
- package/internal/components/option/utils/filter-options.d.ts.map +1 -1
- package/internal/components/option/utils/filter-options.js +1 -1
- package/internal/components/option/utils/filter-options.js.map +1 -1
- package/internal/components/option/utils/flatten-options.d.ts.map +1 -1
- package/internal/components/option/utils/flatten-options.js +2 -1
- package/internal/components/option/utils/flatten-options.js.map +1 -1
- package/internal/components/selectable-item/index.d.ts.map +1 -1
- package/internal/components/selectable-item/index.js +5 -2
- package/internal/components/selectable-item/index.js.map +1 -1
- package/internal/components/selectable-item/interfaces.d.ts +3 -0
- package/internal/components/selectable-item/interfaces.d.ts.map +1 -1
- package/internal/components/selectable-item/interfaces.js.map +1 -1
- package/internal/components/selectable-item/styles.css.js +19 -16
- package/internal/components/selectable-item/styles.scoped.css +62 -29
- package/internal/components/selectable-item/styles.selectors.js +19 -16
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/hooks/use-virtual/index.d.ts +2 -1
- package/internal/hooks/use-virtual/index.d.ts.map +1 -1
- package/internal/hooks/use-virtual/index.js +9 -2
- package/internal/hooks/use-virtual/index.js.map +1 -1
- package/internal/hooks/use-virtual/sticky-range-extractor.d.ts +9 -0
- package/internal/hooks/use-virtual/sticky-range-extractor.d.ts.map +1 -0
- package/internal/hooks/use-virtual/sticky-range-extractor.js +8 -0
- package/internal/hooks/use-virtual/sticky-range-extractor.js.map +1 -0
- package/internal/manifest.json +1 -1
- package/internal/vendor/react-virtual.js +1 -1
- package/package.json +1 -1
- package/select/internal.js +1 -1
- package/select/internal.js.map +1 -1
- package/select/parts/item.d.ts +2 -0
- package/select/parts/item.d.ts.map +1 -1
- package/select/parts/item.js +2 -2
- package/select/parts/item.js.map +1 -1
- package/select/parts/multiselect-item.d.ts.map +1 -1
- package/select/parts/multiselect-item.js +2 -2
- package/select/parts/multiselect-item.js.map +1 -1
- package/select/parts/plain-list.d.ts +1 -0
- package/select/parts/plain-list.d.ts.map +1 -1
- package/select/parts/plain-list.js +9 -2
- package/select/parts/plain-list.js.map +1 -1
- package/select/parts/styles.css.js +20 -21
- package/select/parts/styles.scoped.css +26 -30
- package/select/parts/styles.selectors.js +20 -21
- package/select/parts/trigger.d.ts.map +1 -1
- package/select/parts/trigger.js +1 -1
- package/select/parts/trigger.js.map +1 -1
- package/select/parts/virtual-list.d.ts.map +1 -1
- package/select/parts/virtual-list.js +12 -6
- package/select/parts/virtual-list.js.map +1 -1
- package/select/utils/render-options.d.ts +3 -1
- package/select/utils/render-options.d.ts.map +1 -1
- package/select/utils/render-options.js +3 -2
- package/select/utils/render-options.js.map +1 -1
- package/table/interfaces.d.ts +4 -1
- package/table/interfaces.d.ts.map +1 -1
- package/table/interfaces.js.map +1 -1
- package/table/internal.d.ts.map +1 -1
- package/table/internal.js +10 -7
- package/table/internal.js.map +1 -1
- package/table/use-cell-editing.d.ts +4 -4
- package/table/use-cell-editing.d.ts.map +1 -1
- package/table/use-cell-editing.js +2 -2
- package/table/use-cell-editing.js.map +1 -1
package/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,CAAC,CAAC,IAAI,EAEV,gBAAgB,EAAE,gBAAgB;YAElC,oBAAC,aAAa,IACZ,UAAU,EACR,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CACzB,oBAAC,cAAc,IAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,GAAI,CAClF,CAAC,CAAC,CAAC,IAAI,EAEV,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,EAC9B,GAAG,EAAE,aAAa,EAClB,iBAAiB,EAAE,cAAc,CAAC,OAAO,KAAK,IAAI,EAClD,mBAAmB,EAAE,YAAY,EACjC,aAAa,EAAE,aAAa,GAC5B,CACO;QACX,6BAAK,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,iBAAiB,IACrC,SAAS,IAAI,eAAe,CACzB,CACF,CACP,CAAC;AACJ,CAAC,CACF,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, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useInternalI18n } from '../i18n/context.js';\nimport { getBaseProps } from '../internal/base-component';\nimport Dropdown from '../internal/components/dropdown';\nimport DropdownFooter from '../internal/components/dropdown-footer';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport { OptionGroup } from '../internal/components/option/interfaces.js';\nimport { prepareOptions } from '../internal/components/option/utils/prepare-options';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { SomeRequired } from '../internal/types';\nimport { joinStrings } from '../internal/utils/strings/join-strings.js';\nimport { SelectProps } from './interfaces';\nimport Filter from './parts/filter';\nimport PlainList, { SelectListProps } from './parts/plain-list';\nimport Trigger from './parts/trigger';\nimport VirtualList from './parts/virtual-list';\nimport { checkOptionValueField } from './utils/check-option-value-field';\nimport { useAnnouncement } from './utils/use-announcement';\nimport { useLoadItems } from './utils/use-load-items';\nimport { useNativeSearch } from './utils/use-native-search';\nimport { useSelect } from './utils/use-select';\n\nimport styles from './styles.css.js';\n\nexport interface InternalSelectProps extends SomeRequired<SelectProps, 'options'>, InternalBaseComponentProps {\n __inFilteringToken?: 'root' | 'nested';\n}\n\nconst InternalSelect = React.forwardRef(\n (\n {\n options,\n filteringType = 'none',\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n filteringResultsText,\n inlineLabelText,\n ariaRequired,\n placeholder,\n disabled,\n readOnly,\n ariaLabel,\n statusType = 'finished',\n empty,\n loadingText,\n finishedText,\n errorText,\n noMatch,\n triggerVariant = 'label',\n renderHighlightedAriaLive,\n selectedOption,\n onBlur,\n onFocus,\n onLoadItems,\n onChange,\n virtualScroll,\n expandToViewport,\n autoFocus,\n __inFilteringToken,\n __internalRootRef = null,\n ...restProps\n }: InternalSelectProps,\n externalRef: React.Ref<SelectProps.Ref>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n\n const i18n = useInternalI18n('select');\n const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);\n const recoveryText = i18n('recoveryText', restProps.recoveryText);\n\n if (restProps.recoveryText && !onLoadItems) {\n warnOnce('Select', '`onLoadItems` must be provided for `recoveryText` to be displayed.');\n }\n\n const { handleLoadMore, handleRecoveryClick, fireLoadItems } = useLoadItems({\n onLoadItems,\n options,\n statusType,\n });\n\n checkControlled('Select', 'selectedOption', selectedOption, 'onChange', onChange);\n\n checkOptionValueField('Select', 'options', options);\n\n const [filteringValue, setFilteringValue] = useState('');\n\n const { filteredOptions, parentMap, totalCount, matchesCount } = prepareOptions(\n options,\n filteringType,\n filteringValue\n );\n\n const rootRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n\n const selfControlId = useUniqueId('trigger');\n const controlId = formFieldContext.controlId ?? selfControlId;\n\n const scrollToIndex = useRef<SelectListProps.SelectListRef>(null);\n const {\n isOpen,\n highlightType,\n highlightedOption,\n highlightedIndex,\n getTriggerProps,\n getDropdownProps,\n getFilterProps,\n getMenuProps,\n getOptionProps,\n highlightOption,\n selectOption,\n announceSelected,\n } = useSelect({\n selectedOptions: selectedOption ? [selectedOption] : [],\n updateSelectedOption: option => fireNonCancelableEvent(onChange, { selectedOption: option }),\n options: filteredOptions,\n filteringType,\n onBlur,\n onFocus,\n externalRef,\n fireLoadItems,\n setFilteringValue,\n statusType,\n });\n\n const handleNativeSearch = useNativeSearch({\n isEnabled: filteringType === 'none',\n options: filteredOptions,\n highlightOption: !isOpen ? selectOption : highlightOption,\n highlightedOption: !isOpen ? selectedOption : highlightedOption?.option,\n });\n\n const selectAriaLabelId = useUniqueId('select-arialabel-');\n const footerId = useUniqueId('footer');\n\n useEffect(() => {\n scrollToIndex.current?.(highlightedIndex);\n }, [highlightedIndex]);\n\n const filter = (\n <Filter\n clearAriaLabel={filteringClearAriaLabel}\n filteringType={filteringType}\n placeholder={filteringPlaceholder}\n ariaLabel={filteringAriaLabel}\n ariaRequired={ariaRequired}\n value={filteringValue}\n {...getFilterProps()}\n />\n );\n\n const trigger = (\n <Trigger\n ref={triggerRef}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n triggerVariant={triggerVariant}\n triggerProps={getTriggerProps(disabled, autoFocus)}\n selectedOption={selectedOption}\n isOpen={isOpen}\n inFilteringToken={__inFilteringToken}\n inlineLabelText={inlineLabelText}\n {...formFieldContext}\n controlId={controlId}\n ariaLabelledby={joinStrings(formFieldContext.ariaLabelledby, selectAriaLabelId)}\n />\n );\n\n const isEmpty = !options || options.length === 0;\n const isNoMatch = filteredOptions && filteredOptions.length === 0;\n const isFiltered =\n filteringType !== 'none' && filteringValue.length > 0 && filteredOptions && filteredOptions.length > 0;\n const filteredText = isFiltered ? filteringResultsText?.(matchesCount, totalCount) : undefined;\n\n const dropdownStatus = useDropdownStatus({\n statusType,\n empty,\n loadingText,\n finishedText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n noMatch,\n isFiltered,\n filteringResultsText: filteredText,\n errorIconAriaLabel,\n onRecoveryClick: handleRecoveryClick,\n hasRecoveryCallback: !!onLoadItems,\n });\n\n const menuProps = {\n ...getMenuProps(),\n onLoadMore: handleLoadMore,\n ariaLabelledby: joinStrings(selectAriaLabelId, controlId),\n ariaDescribedby: dropdownStatus.content ? footerId : undefined,\n };\n\n const announcement = useAnnouncement({\n announceSelected,\n highlightedOption,\n getParent: option => parentMap.get(option)?.option as undefined | OptionGroup,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n });\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const handleMouseDown = (event: React.MouseEvent) => {\n const target = event.target as HTMLElement;\n\n if (target !== document.activeElement) {\n // prevent currently focused element from losing it\n event.preventDefault();\n }\n };\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n const dropdownProps = getDropdownProps();\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(styles.root, baseProps.className)}\n onKeyDown={handleNativeSearch}\n >\n <Dropdown\n {...dropdownProps}\n ariaLabelledby={dropdownProps.dropdownContentRole ? joinStrings(selectAriaLabelId, controlId) : undefined}\n ariaDescribedby={\n dropdownProps.dropdownContentRole ? (dropdownStatus.content ? footerId : undefined) : undefined\n }\n open={isOpen}\n stretchTriggerHeight={!!__inFilteringToken}\n stretchBeyondTriggerWidth={true}\n trigger={trigger}\n header={filter}\n onMouseDown={handleMouseDown}\n footer={\n dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n expandToViewport={expandToViewport}\n >\n <ListComponent\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n menuProps={menuProps}\n getOptionProps={getOptionProps}\n filteredOptions={filteredOptions}\n filteringValue={filteringValue}\n ref={scrollToIndex}\n hasDropdownStatus={dropdownStatus.content !== null}\n screenReaderContent={announcement}\n highlightType={highlightType}\n />\n </Dropdown>\n <div hidden={true} id={selectAriaLabelId}>\n {ariaLabel || inlineLabelText}\n </div>\n </div>\n );\n }\n);\n\nexport default InternalSelect;\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/select/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,cAAc,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE3E,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,oCAAoC,CAAC;AAEjE,OAAO,EAAE,YAA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import React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useInternalI18n } from '../i18n/context.js';\nimport { getBaseProps } from '../internal/base-component';\nimport Dropdown from '../internal/components/dropdown';\nimport DropdownFooter from '../internal/components/dropdown-footer';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport { OptionGroup } from '../internal/components/option/interfaces.js';\nimport { prepareOptions } from '../internal/components/option/utils/prepare-options';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { SomeRequired } from '../internal/types';\nimport { joinStrings } from '../internal/utils/strings/join-strings.js';\nimport { SelectProps } from './interfaces';\nimport Filter from './parts/filter';\nimport PlainList, { SelectListProps } from './parts/plain-list';\nimport Trigger from './parts/trigger';\nimport VirtualList from './parts/virtual-list';\nimport { checkOptionValueField } from './utils/check-option-value-field';\nimport { useAnnouncement } from './utils/use-announcement';\nimport { useLoadItems } from './utils/use-load-items';\nimport { useNativeSearch } from './utils/use-native-search';\nimport { useSelect } from './utils/use-select';\n\nimport styles from './styles.css.js';\n\nexport interface InternalSelectProps extends SomeRequired<SelectProps, 'options'>, InternalBaseComponentProps {\n __inFilteringToken?: 'root' | 'nested';\n}\n\nconst InternalSelect = React.forwardRef(\n (\n {\n options,\n filteringType = 'none',\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n filteringResultsText,\n inlineLabelText,\n ariaRequired,\n placeholder,\n disabled,\n readOnly,\n ariaLabel,\n statusType = 'finished',\n empty,\n loadingText,\n finishedText,\n errorText,\n noMatch,\n triggerVariant = 'label',\n renderHighlightedAriaLive,\n selectedOption,\n onBlur,\n onFocus,\n onLoadItems,\n onChange,\n virtualScroll,\n expandToViewport,\n autoFocus,\n __inFilteringToken,\n __internalRootRef = null,\n ...restProps\n }: InternalSelectProps,\n externalRef: React.Ref<SelectProps.Ref>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n\n const i18n = useInternalI18n('select');\n const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);\n const recoveryText = i18n('recoveryText', restProps.recoveryText);\n\n if (restProps.recoveryText && !onLoadItems) {\n warnOnce('Select', '`onLoadItems` must be provided for `recoveryText` to be displayed.');\n }\n\n const { handleLoadMore, handleRecoveryClick, fireLoadItems } = useLoadItems({\n onLoadItems,\n options,\n statusType,\n });\n\n checkControlled('Select', 'selectedOption', selectedOption, 'onChange', onChange);\n\n checkOptionValueField('Select', 'options', options);\n\n const [filteringValue, setFilteringValue] = useState('');\n\n const { filteredOptions, parentMap, totalCount, matchesCount } = prepareOptions(\n options,\n filteringType,\n filteringValue\n );\n\n const rootRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n\n const selfControlId = useUniqueId('trigger');\n const controlId = formFieldContext.controlId ?? selfControlId;\n\n const scrollToIndex = useRef<SelectListProps.SelectListRef>(null);\n const {\n isOpen,\n highlightType,\n highlightedOption,\n highlightedIndex,\n getTriggerProps,\n getDropdownProps,\n getFilterProps,\n getMenuProps,\n getOptionProps,\n highlightOption,\n selectOption,\n announceSelected,\n } = useSelect({\n selectedOptions: selectedOption ? [selectedOption] : [],\n updateSelectedOption: option => fireNonCancelableEvent(onChange, { selectedOption: option }),\n options: filteredOptions,\n filteringType,\n onBlur,\n onFocus,\n externalRef,\n fireLoadItems,\n setFilteringValue,\n statusType,\n });\n\n const handleNativeSearch = useNativeSearch({\n isEnabled: filteringType === 'none' && !readOnly,\n options: filteredOptions,\n highlightOption: !isOpen ? selectOption : highlightOption,\n highlightedOption: !isOpen ? selectedOption : highlightedOption?.option,\n });\n\n const selectAriaLabelId = useUniqueId('select-arialabel-');\n const footerId = useUniqueId('footer');\n\n useEffect(() => {\n scrollToIndex.current?.(highlightedIndex);\n }, [highlightedIndex]);\n\n const filter = (\n <Filter\n clearAriaLabel={filteringClearAriaLabel}\n filteringType={filteringType}\n placeholder={filteringPlaceholder}\n ariaLabel={filteringAriaLabel}\n ariaRequired={ariaRequired}\n value={filteringValue}\n {...getFilterProps()}\n />\n );\n\n const trigger = (\n <Trigger\n ref={triggerRef}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n triggerVariant={triggerVariant}\n triggerProps={getTriggerProps(disabled, autoFocus)}\n selectedOption={selectedOption}\n isOpen={isOpen}\n inFilteringToken={__inFilteringToken}\n inlineLabelText={inlineLabelText}\n {...formFieldContext}\n controlId={controlId}\n ariaLabelledby={joinStrings(formFieldContext.ariaLabelledby, selectAriaLabelId)}\n />\n );\n\n const isEmpty = !options || options.length === 0;\n const isNoMatch = filteredOptions && filteredOptions.length === 0;\n const isFiltered =\n filteringType !== 'none' && filteringValue.length > 0 && filteredOptions && filteredOptions.length > 0;\n const filteredText = isFiltered ? filteringResultsText?.(matchesCount, totalCount) : undefined;\n\n const dropdownStatus = useDropdownStatus({\n statusType,\n empty,\n loadingText,\n finishedText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n noMatch,\n isFiltered,\n filteringResultsText: filteredText,\n errorIconAriaLabel,\n onRecoveryClick: handleRecoveryClick,\n hasRecoveryCallback: !!onLoadItems,\n });\n\n const menuProps = {\n ...getMenuProps(),\n onLoadMore: handleLoadMore,\n ariaLabelledby: joinStrings(selectAriaLabelId, controlId),\n ariaDescribedby: dropdownStatus.content ? footerId : undefined,\n };\n\n const announcement = useAnnouncement({\n announceSelected,\n highlightedOption,\n getParent: option => parentMap.get(option)?.option as undefined | OptionGroup,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n });\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const handleMouseDown = (event: React.MouseEvent) => {\n const target = event.target as HTMLElement;\n\n if (target !== document.activeElement) {\n // prevent currently focused element from losing it\n event.preventDefault();\n }\n };\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n const dropdownProps = getDropdownProps();\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(styles.root, baseProps.className)}\n onKeyDown={handleNativeSearch}\n >\n <Dropdown\n {...dropdownProps}\n ariaLabelledby={dropdownProps.dropdownContentRole ? joinStrings(selectAriaLabelId, controlId) : undefined}\n ariaDescribedby={\n dropdownProps.dropdownContentRole ? (dropdownStatus.content ? footerId : undefined) : undefined\n }\n open={isOpen}\n stretchTriggerHeight={!!__inFilteringToken}\n stretchBeyondTriggerWidth={true}\n trigger={trigger}\n header={filter}\n onMouseDown={handleMouseDown}\n footer={\n dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n expandToViewport={expandToViewport}\n >\n <ListComponent\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n menuProps={menuProps}\n getOptionProps={getOptionProps}\n filteredOptions={filteredOptions}\n filteringValue={filteringValue}\n ref={scrollToIndex}\n hasDropdownStatus={dropdownStatus.content !== null}\n screenReaderContent={announcement}\n highlightType={highlightType}\n />\n </Dropdown>\n <div hidden={true} id={selectAriaLabelId}>\n {ariaLabel || inlineLabelText}\n </div>\n </div>\n );\n }\n);\n\nexport default InternalSelect;\n"]}
|
package/select/parts/item.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export interface ItemProps {
|
|
|
14
14
|
ariaPosinset?: number;
|
|
15
15
|
ariaSetsize?: number;
|
|
16
16
|
highlightType?: HighlightType['type'];
|
|
17
|
+
withScrollbar?: boolean;
|
|
18
|
+
sticky?: boolean;
|
|
17
19
|
}
|
|
18
20
|
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<ItemProps & React.RefAttributes<HTMLDivElement>>>;
|
|
19
21
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAO3D,OAAO,EAAE,cAAc,EAAoB,MAAM,6CAA6C,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,sEAAsE,CAAC;AAQrG,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,cAAc,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAO3D,OAAO,EAAE,cAAc,EAAoB,MAAM,6CAA6C,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,sEAAsE,CAAC;AAQrG,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,cAAc,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;;AAiGD,wBAAkD"}
|
package/select/parts/item.js
CHANGED
|
@@ -13,7 +13,7 @@ import useHiddenDescription from '../../internal/hooks/use-hidden-description';
|
|
|
13
13
|
import { useMergeRefs } from '../../internal/hooks/use-merge-refs';
|
|
14
14
|
import styles from './styles.css.js';
|
|
15
15
|
const Item = (_a, ref) => {
|
|
16
|
-
var { option, highlighted, selected, filteringValue, hasCheckbox, virtualPosition, padBottom, isNextSelected, screenReaderContent, ariaPosinset, ariaSetsize, highlightType } = _a, restProps = __rest(_a, ["option", "highlighted", "selected", "filteringValue", "hasCheckbox", "virtualPosition", "padBottom", "isNextSelected", "screenReaderContent", "ariaPosinset", "ariaSetsize", "highlightType"]);
|
|
16
|
+
var { option, highlighted, selected, filteringValue, hasCheckbox, virtualPosition, padBottom, isNextSelected, screenReaderContent, ariaPosinset, ariaSetsize, highlightType, withScrollbar, sticky } = _a, restProps = __rest(_a, ["option", "highlighted", "selected", "filteringValue", "hasCheckbox", "virtualPosition", "padBottom", "isNextSelected", "screenReaderContent", "ariaPosinset", "ariaSetsize", "highlightType", "withScrollbar", "sticky"]);
|
|
17
17
|
const baseProps = getBaseProps(restProps);
|
|
18
18
|
const isParent = option.type === 'parent';
|
|
19
19
|
const isChild = option.type === 'child';
|
|
@@ -25,7 +25,7 @@ const Item = (_a, ref) => {
|
|
|
25
25
|
const { descriptionEl, descriptionId } = useHiddenDescription(disabledReason);
|
|
26
26
|
const [canShowTooltip, setCanShowTooltip] = useState(true);
|
|
27
27
|
useEffect(() => setCanShowTooltip(true), [highlighted]);
|
|
28
|
-
return (React.createElement(SelectableItem, Object.assign({ ariaSelected: Boolean(selected), selected: selected, isNextSelected: isNextSelected, highlighted: highlighted, disabled: option.disabled, isParent: isParent, isChild: isChild, ref: useMergeRefs(ref, internalRef), virtualPosition: virtualPosition, padBottom: padBottom, screenReaderContent: screenReaderContent, ariaPosinset: ariaPosinset, ariaSetsize: ariaSetsize, highlightType: highlightType, ariaDescribedby: isDisabledWithReason ? descriptionId : '', value: option.option.value }, baseProps),
|
|
28
|
+
return (React.createElement(SelectableItem, Object.assign({ ariaSelected: Boolean(selected), selected: selected, isNextSelected: isNextSelected, highlighted: highlighted, disabled: option.disabled, isParent: isParent, isChild: isChild, ref: useMergeRefs(ref, internalRef), virtualPosition: virtualPosition, padBottom: padBottom, screenReaderContent: screenReaderContent, ariaPosinset: ariaPosinset, ariaSetsize: ariaSetsize, highlightType: highlightType, ariaDescribedby: isDisabledWithReason ? descriptionId : '', value: option.option.value, withScrollbar: withScrollbar, sticky: sticky }, baseProps),
|
|
29
29
|
React.createElement("div", { className: clsx(styles.item, !isParent && wrappedOption.labelTag && styles['show-label-tag']) },
|
|
30
30
|
hasCheckbox && !isParent && (React.createElement("div", { className: styles.checkbox },
|
|
31
31
|
React.createElement(CheckboxIcon, { checked: selected || false, disabled: option.disabled }))),
|
package/select/parts/item.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sourceRoot":"","sources":["../../../../src/select/parts/item.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;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AAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport InternalIcon from '../../icon/internal.js';\nimport { getBaseProps } from '../../internal/base-component';\nimport CheckboxIcon from '../../internal/components/checkbox-icon';\nimport Option from '../../internal/components/option';\nimport { DropdownOption, OptionDefinition } from '../../internal/components/option/interfaces';\nimport { HighlightType } from '../../internal/components/options-list/utils/use-highlight-option.js';\nimport SelectableItem from '../../internal/components/selectable-item';\nimport Tooltip from '../../internal/components/tooltip';\nimport useHiddenDescription from '../../internal/hooks/use-hidden-description';\nimport { useMergeRefs } from '../../internal/hooks/use-merge-refs';\n\nimport styles from './styles.css.js';\n\nexport interface ItemProps {\n option: DropdownOption;\n highlighted?: boolean;\n selected?: boolean;\n filteringValue?: string;\n hasCheckbox?: boolean;\n virtualPosition?: number;\n padBottom?: boolean;\n isNextSelected?: boolean;\n screenReaderContent?: string;\n ariaPosinset?: number;\n ariaSetsize?: number;\n highlightType?: HighlightType['type'];\n withScrollbar?: boolean;\n sticky?: boolean;\n}\n\nconst Item = (\n {\n option,\n highlighted,\n selected,\n filteringValue,\n hasCheckbox,\n virtualPosition,\n padBottom,\n isNextSelected,\n screenReaderContent,\n ariaPosinset,\n ariaSetsize,\n highlightType,\n withScrollbar,\n sticky,\n ...restProps\n }: ItemProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const baseProps = getBaseProps(restProps);\n\n const isParent = option.type === 'parent';\n const isChild = option.type === 'child';\n const wrappedOption: OptionDefinition = option.option;\n const disabled = option.disabled || wrappedOption.disabled;\n const disabledReason = disabled && wrappedOption.disabledReason ? wrappedOption.disabledReason : '';\n const isDisabledWithReason = !!disabledReason;\n const internalRef = useRef<HTMLDivElement>(null);\n\n const { descriptionEl, descriptionId } = useHiddenDescription(disabledReason);\n\n const [canShowTooltip, setCanShowTooltip] = useState(true);\n useEffect(() => setCanShowTooltip(true), [highlighted]);\n\n return (\n <SelectableItem\n ariaSelected={Boolean(selected)}\n selected={selected}\n isNextSelected={isNextSelected}\n highlighted={highlighted}\n disabled={option.disabled}\n isParent={isParent}\n isChild={isChild}\n ref={useMergeRefs(ref, internalRef)}\n virtualPosition={virtualPosition}\n padBottom={padBottom}\n screenReaderContent={screenReaderContent}\n ariaPosinset={ariaPosinset}\n ariaSetsize={ariaSetsize}\n highlightType={highlightType}\n ariaDescribedby={isDisabledWithReason ? descriptionId : ''}\n value={option.option.value}\n withScrollbar={withScrollbar}\n sticky={sticky}\n {...baseProps}\n >\n <div className={clsx(styles.item, !isParent && wrappedOption.labelTag && styles['show-label-tag'])}>\n {hasCheckbox && !isParent && (\n <div className={styles.checkbox}>\n <CheckboxIcon checked={selected || false} disabled={option.disabled} />\n </div>\n )}\n <Option\n option={{ ...wrappedOption, disabled }}\n highlightedOption={highlighted}\n selectedOption={selected}\n highlightText={filteringValue}\n isGroupOption={isParent}\n />\n {!hasCheckbox && !isParent && selected && (\n <div className={styles['selected-icon']}>\n <InternalIcon name=\"check\" />\n </div>\n )}\n {isDisabledWithReason && (\n <>\n {descriptionEl}\n {highlighted && canShowTooltip && (\n <Tooltip\n className={styles['disabled-reason-tooltip']}\n trackRef={internalRef}\n value={disabledReason!}\n position=\"right\"\n hideOnOverscroll={true}\n onDismiss={() => setCanShowTooltip(false)}\n />\n )}\n </>\n )}\n </div>\n </SelectableItem>\n );\n};\n\nexport default React.memo(React.forwardRef(Item));\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiselect-item.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/multiselect-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAU3D,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGnC,UAAU,oBAAqB,SAAQ,SAAS;IAC9C,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;;
|
|
1
|
+
{"version":3,"file":"multiselect-item.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/multiselect-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAU3D,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGnC,UAAU,oBAAqB,SAAQ,SAAS;IAC9C,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;;AAmGD,wBAA6D"}
|
|
@@ -11,7 +11,7 @@ import useHiddenDescription from '../../internal/hooks/use-hidden-description';
|
|
|
11
11
|
import { useMergeRefs } from '../../internal/hooks/use-merge-refs';
|
|
12
12
|
import styles from './styles.css.js';
|
|
13
13
|
const MultiSelectItem = (_a, ref) => {
|
|
14
|
-
var { option, highlighted, selected, filteringValue, hasCheckbox, virtualPosition, padBottom, isNextSelected, indeterminate, screenReaderContent, ariaPosinset, ariaSetsize, highlightType } = _a, restProps = __rest(_a, ["option", "highlighted", "selected", "filteringValue", "hasCheckbox", "virtualPosition", "padBottom", "isNextSelected", "indeterminate", "screenReaderContent", "ariaPosinset", "ariaSetsize", "highlightType"]);
|
|
14
|
+
var { option, highlighted, selected, filteringValue, hasCheckbox, virtualPosition, padBottom, isNextSelected, indeterminate, screenReaderContent, ariaPosinset, ariaSetsize, highlightType, withScrollbar, sticky } = _a, restProps = __rest(_a, ["option", "highlighted", "selected", "filteringValue", "hasCheckbox", "virtualPosition", "padBottom", "isNextSelected", "indeterminate", "screenReaderContent", "ariaPosinset", "ariaSetsize", "highlightType", "withScrollbar", "sticky"]);
|
|
15
15
|
const baseProps = getBaseProps(restProps);
|
|
16
16
|
const isParent = option.type === 'parent';
|
|
17
17
|
const isChild = option.type === 'child';
|
|
@@ -26,7 +26,7 @@ const MultiSelectItem = (_a, ref) => {
|
|
|
26
26
|
const { descriptionId, descriptionEl } = useHiddenDescription(disabledReason);
|
|
27
27
|
const [canShowTooltip, setCanShowTooltip] = useState(true);
|
|
28
28
|
useEffect(() => setCanShowTooltip(true), [highlighted]);
|
|
29
|
-
return (React.createElement(SelectableItem, Object.assign({ ariaChecked: isParent && indeterminate ? 'mixed' : Boolean(selected), selected: selected, isNextSelected: isNextSelected, highlighted: highlighted, disabled: disabled, isParent: isParent, isChild: isChild, highlightType: highlightType, ref: useMergeRefs(ref, internalRef), virtualPosition: virtualPosition, padBottom: padBottom, useInteractiveGroups: true, screenReaderContent: screenReaderContent, ariaPosinset: ariaPosinset, ariaSetsize: ariaSetsize, ariaDescribedby: isDisabledWithReason ? descriptionId : '', value: option.option.value }, baseProps),
|
|
29
|
+
return (React.createElement(SelectableItem, Object.assign({ ariaChecked: isParent && indeterminate ? 'mixed' : Boolean(selected), selected: selected, isNextSelected: isNextSelected, highlighted: highlighted, disabled: disabled, isParent: isParent, isChild: isChild, highlightType: highlightType, ref: useMergeRefs(ref, internalRef), virtualPosition: virtualPosition, padBottom: padBottom, useInteractiveGroups: true, screenReaderContent: screenReaderContent, ariaPosinset: ariaPosinset, ariaSetsize: ariaSetsize, ariaDescribedby: isDisabledWithReason ? descriptionId : '', value: option.option.value, afterHeader: option.afterHeader, withScrollbar: withScrollbar, sticky: sticky }, baseProps),
|
|
30
30
|
React.createElement("div", { className: className },
|
|
31
31
|
hasCheckbox && (React.createElement("div", { className: styles.checkbox },
|
|
32
32
|
React.createElement(CheckboxIcon, { checked: selected, indeterminate: isParent && indeterminate, disabled: option.disabled }))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiselect-item.js","sourceRoot":"","sources":["../../../../src/select/parts/multiselect-item.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,MAAM,MAAM,kCAAkC,CAAC;AAEtD,OAAO,cAAc,MAAM,2CAA2C,CAAC;AACvE,OAAO,OAAO,MAAM,mCAAmC,CAAC;AACxD,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAGnE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAKrC,MAAM,eAAe,GAAG,CACtB,
|
|
1
|
+
{"version":3,"file":"multiselect-item.js","sourceRoot":"","sources":["../../../../src/select/parts/multiselect-item.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,MAAM,MAAM,kCAAkC,CAAC;AAEtD,OAAO,cAAc,MAAM,2CAA2C,CAAC;AACvE,OAAO,OAAO,MAAM,mCAAmC,CAAC;AACxD,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAGnE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAKrC,MAAM,eAAe,GAAG,CACtB,EAiBuB,EACvB,GAA8B,EAC9B,EAAE;QAnBF,EACE,MAAM,EACN,WAAW,EACX,QAAQ,EACR,cAAc,EACd,WAAW,EACX,eAAe,EACf,SAAS,EACT,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,aAAa,EACb,aAAa,EACb,MAAM,OAEe,EADlB,SAAS,cAhBd,2OAiBC,CADa;IAId,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAE1C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC;IAC1C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC;IACxC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AAE,WAAW,EACxB,eAAe,EAAE,oBAAoB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EAC1D,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,EAC1B,WAAW,EAAE,MAAM,CAAC,WAAW,EAC/B,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,IACV,SAAS;QAEb,6BAAK,SAAS,EAAE,SAAS;YACtB,WAAW,IAAI,CACd,6BAAK,SAAS,EAAE,MAAM,CAAC,QAAQ;gBAC7B,oBAAC,YAAY,IAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,IAAI,aAAa,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,GAAI,CACpG,CACP;YACD,oBAAC,MAAM,IACL,MAAM,kCAAO,aAAa,KAAE,QAAQ,KACpC,iBAAiB,EAAE,WAAW,EAC9B,cAAc,EAAE,QAAQ,EACxB,aAAa,EAAE,cAAc,EAC7B,aAAa,EAAE,QAAQ,GACvB,CACE;QACL,oBAAoB,IAAI,CACvB;YACG,aAAa;YACb,WAAW,IAAI,cAAc,IAAI,CAChC,oBAAC,OAAO,IACN,SAAS,EAAE,MAAM,CAAC,yBAAyB,CAAC,EAC5C,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,cAAe,EACtB,QAAQ,EAAC,OAAO,EAChB,gBAAgB,EAAE,IAAI,EACtB,SAAS,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,GACzC,CACH,CACA,CACJ,CACc,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { getBaseProps } from '../../internal/base-component';\nimport CheckboxIcon from '../../internal/components/checkbox-icon';\nimport Option from '../../internal/components/option';\nimport { OptionDefinition } from '../../internal/components/option/interfaces';\nimport SelectableItem from '../../internal/components/selectable-item';\nimport Tooltip from '../../internal/components/tooltip';\nimport useHiddenDescription from '../../internal/hooks/use-hidden-description';\nimport { useMergeRefs } from '../../internal/hooks/use-merge-refs';\nimport { ItemProps } from './item';\n\nimport styles from './styles.css.js';\ninterface MultiselectItemProps extends ItemProps {\n indeterminate?: boolean;\n}\n\nconst MultiSelectItem = (\n {\n option,\n highlighted,\n selected,\n filteringValue,\n hasCheckbox,\n virtualPosition,\n padBottom,\n isNextSelected,\n indeterminate,\n screenReaderContent,\n ariaPosinset,\n ariaSetsize,\n highlightType,\n withScrollbar,\n sticky,\n ...restProps\n }: MultiselectItemProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const baseProps = getBaseProps(restProps);\n\n const isParent = option.type === 'parent';\n const isChild = option.type === 'child';\n const wrappedOption: OptionDefinition = option.option;\n const disabled = option.disabled || wrappedOption.disabled;\n const disabledReason =\n disabled && (option.disabledReason || wrappedOption.disabledReason)\n ? option.disabledReason || wrappedOption.disabledReason\n : '';\n const isDisabledWithReason = !!disabledReason;\n const internalRef = useRef<HTMLDivElement>(null);\n const className = styles.item;\n\n const { descriptionId, descriptionEl } = useHiddenDescription(disabledReason);\n\n const [canShowTooltip, setCanShowTooltip] = useState(true);\n useEffect(() => setCanShowTooltip(true), [highlighted]);\n\n return (\n <SelectableItem\n ariaChecked={isParent && indeterminate ? 'mixed' : Boolean(selected)}\n selected={selected}\n isNextSelected={isNextSelected}\n highlighted={highlighted}\n disabled={disabled}\n isParent={isParent}\n isChild={isChild}\n highlightType={highlightType}\n ref={useMergeRefs(ref, internalRef)}\n virtualPosition={virtualPosition}\n padBottom={padBottom}\n useInteractiveGroups={true}\n screenReaderContent={screenReaderContent}\n ariaPosinset={ariaPosinset}\n ariaSetsize={ariaSetsize}\n ariaDescribedby={isDisabledWithReason ? descriptionId : ''}\n value={option.option.value}\n afterHeader={option.afterHeader}\n withScrollbar={withScrollbar}\n sticky={sticky}\n {...baseProps}\n >\n <div className={className}>\n {hasCheckbox && (\n <div className={styles.checkbox}>\n <CheckboxIcon checked={selected} indeterminate={isParent && indeterminate} disabled={option.disabled} />\n </div>\n )}\n <Option\n option={{ ...wrappedOption, disabled }}\n highlightedOption={highlighted}\n selectedOption={selected}\n highlightText={filteringValue}\n isGroupOption={isParent}\n />\n </div>\n {isDisabledWithReason && (\n <>\n {descriptionEl}\n {highlighted && canShowTooltip && (\n <Tooltip\n className={styles['disabled-reason-tooltip']}\n trackRef={internalRef}\n value={disabledReason!}\n position=\"right\"\n hideOnOverscroll={true}\n onDismiss={() => setCanShowTooltip(false)}\n />\n )}\n </>\n )}\n </SelectableItem>\n );\n};\n\nexport default React.memo(React.forwardRef(MultiSelectItem));\n"]}
|
|
@@ -13,6 +13,7 @@ export interface SelectListProps {
|
|
|
13
13
|
listBottom?: React.ReactNode;
|
|
14
14
|
useInteractiveGroups?: boolean;
|
|
15
15
|
screenReaderContent?: string;
|
|
16
|
+
firstOptionSticky?: boolean;
|
|
16
17
|
}
|
|
17
18
|
export declare namespace SelectListProps {
|
|
18
19
|
type SelectListRef = (index: number) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plain-list.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/plain-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA0C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"plain-list.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/plain-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAI/D,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,mEAAmE,CAAC;AAIlG,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIhE,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,cAAc,CAAC;IAC/B,eAAe,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IAC/C,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,yBAAiB,eAAe,CAAC;IAC/B,KAAY,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACrD;;AAmED,wBAAqC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import React, { forwardRef, useImperativeHandle } from 'react';
|
|
4
|
+
import { useContainerQuery } from '@cloudscape-design/component-toolkit';
|
|
4
5
|
import OptionsList from '../../internal/components/options-list';
|
|
6
|
+
import { useMergeRefs } from '../../internal/hooks/use-merge-refs';
|
|
5
7
|
import { scrollElementIntoView } from '../../internal/utils/scrollable-containers';
|
|
6
8
|
import { renderOptions } from '../utils/render-options';
|
|
7
9
|
import styles from './styles.css.js';
|
|
8
|
-
const PlainList = ({ menuProps, getOptionProps, filteredOptions, filteringValue, highlightType, checkboxes, hasDropdownStatus, listBottom, useInteractiveGroups, screenReaderContent, }, ref) => {
|
|
10
|
+
const PlainList = ({ menuProps, getOptionProps, filteredOptions, filteringValue, highlightType, checkboxes, hasDropdownStatus, listBottom, useInteractiveGroups, screenReaderContent, firstOptionSticky, }, ref) => {
|
|
11
|
+
const [width, menuMeasureRef] = useContainerQuery(rect => ({ inner: rect.contentBoxWidth, outer: rect.borderBoxWidth }), []);
|
|
9
12
|
const menuRef = menuProps.ref;
|
|
13
|
+
const mergedRef = useMergeRefs(menuMeasureRef, menuRef);
|
|
10
14
|
useImperativeHandle(ref, () => (index) => {
|
|
11
15
|
var _a, _b, _c;
|
|
12
16
|
const item = (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`[data-mouse-target="${index}"]`);
|
|
@@ -18,7 +22,8 @@ const PlainList = ({ menuProps, getOptionProps, filteredOptions, filteringValue,
|
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
}, [highlightType, menuRef]);
|
|
21
|
-
|
|
25
|
+
const withScrollbar = !!width && width.inner < width.outer;
|
|
26
|
+
return (React.createElement(OptionsList, Object.assign({}, menuProps, { ref: mergedRef }),
|
|
22
27
|
renderOptions({
|
|
23
28
|
options: filteredOptions,
|
|
24
29
|
getOptionProps,
|
|
@@ -28,6 +33,8 @@ const PlainList = ({ menuProps, getOptionProps, filteredOptions, filteringValue,
|
|
|
28
33
|
hasDropdownStatus,
|
|
29
34
|
useInteractiveGroups,
|
|
30
35
|
screenReaderContent,
|
|
36
|
+
withScrollbar: withScrollbar,
|
|
37
|
+
firstOptionSticky,
|
|
31
38
|
}),
|
|
32
39
|
listBottom ? (React.createElement("li", { role: "option", className: styles['list-bottom'] }, listBottom)) : null));
|
|
33
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plain-list.js","sourceRoot":"","sources":["../../../../src/select/parts/plain-list.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"plain-list.js","sourceRoot":"","sources":["../../../../src/select/parts/plain-list.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,OA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CAAC;aAC7B;SACF;IACH,CAAC,EACD,CAAC,aAAa,EAAE,OAAO,CAAC,CACzB,CAAC;IAEF,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAE3D,OAAO,CACL,oBAAC,WAAW,oBAAK,SAAS,IAAE,GAAG,EAAE,SAAS;QACvC,aAAa,CAAC;YACb,OAAO,EAAE,eAAe;YACxB,cAAc;YACd,cAAc;YACd,aAAa;YACb,UAAU;YACV,iBAAiB;YACjB,oBAAoB;YACpB,mBAAmB;YACnB,aAAa,EAAE,aAAa;YAC5B,iBAAiB;SAClB,CAAC;QACD,UAAU,CAAC,CAAC,CAAC,CACZ,4BAAI,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,IAC/C,UAAU,CACR,CACN,CAAC,CAAC,CAAC,IAAI,CACI,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC,SAAS,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useImperativeHandle } from 'react';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\n\nimport { DropdownOption } from '../../internal/components/option/interfaces';\nimport OptionsList from '../../internal/components/options-list';\nimport { HighlightType } from '../../internal/components/options-list/utils/use-highlight-option';\nimport { useMergeRefs } from '../../internal/hooks/use-merge-refs';\nimport { scrollElementIntoView } from '../../internal/utils/scrollable-containers';\nimport { renderOptions } from '../utils/render-options';\nimport { GetOptionProps, MenuProps } from '../utils/use-select';\n\nimport styles from './styles.css.js';\n\nexport interface SelectListProps {\n menuProps: MenuProps;\n getOptionProps: GetOptionProps;\n filteredOptions: ReadonlyArray<DropdownOption>;\n filteringValue: string;\n highlightType: HighlightType;\n checkboxes?: boolean;\n hasDropdownStatus?: boolean;\n listBottom?: React.ReactNode;\n useInteractiveGroups?: boolean;\n screenReaderContent?: string;\n firstOptionSticky?: boolean;\n}\n\nexport namespace SelectListProps {\n export type SelectListRef = (index: number) => void;\n}\n\nconst PlainList = (\n {\n menuProps,\n getOptionProps,\n filteredOptions,\n filteringValue,\n highlightType,\n checkboxes,\n hasDropdownStatus,\n listBottom,\n useInteractiveGroups,\n screenReaderContent,\n firstOptionSticky,\n }: SelectListProps,\n ref: React.Ref<SelectListProps.SelectListRef>\n) => {\n const [width, menuMeasureRef] = useContainerQuery(\n rect => ({ inner: rect.contentBoxWidth, outer: rect.borderBoxWidth }),\n []\n );\n\n const menuRef = menuProps.ref;\n\n const mergedRef = useMergeRefs(menuMeasureRef, menuRef);\n\n useImperativeHandle(\n ref,\n () => (index: number) => {\n const item = menuRef.current?.querySelector<HTMLElement>(`[data-mouse-target=\"${index}\"]`);\n if (highlightType.moveFocus && item) {\n // In edge case dropdown can be very small, scrolling can cause side effect AWSUI-60318\n if (menuRef.current?.clientHeight !== undefined && menuRef.current?.clientHeight > 15) {\n /* istanbul ignore next: clientHeight always returns 0 in JSDOM, the line is covered by integ tests */\n scrollElementIntoView(item);\n }\n }\n },\n [highlightType, menuRef]\n );\n\n const withScrollbar = !!width && width.inner < width.outer;\n\n return (\n <OptionsList {...menuProps} ref={mergedRef}>\n {renderOptions({\n options: filteredOptions,\n getOptionProps,\n filteringValue,\n highlightType,\n checkboxes,\n hasDropdownStatus,\n useInteractiveGroups,\n screenReaderContent,\n withScrollbar: withScrollbar,\n firstOptionSticky,\n })}\n {listBottom ? (\n <li role=\"option\" className={styles['list-bottom']}>\n {listBottom}\n </li>\n ) : null}\n </OptionsList>\n );\n};\n\nexport default forwardRef(PlainList);\n"]}
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"placeholder": "
|
|
5
|
-
"item": "
|
|
6
|
-
"checkbox": "
|
|
7
|
-
"filter": "
|
|
8
|
-
"trigger": "
|
|
9
|
-
"layout-strut": "awsui_layout-
|
|
10
|
-
"list-bottom": "awsui_list-
|
|
11
|
-
"selected-icon": "awsui_selected-
|
|
12
|
-
"show-label-tag": "awsui_show-label-
|
|
13
|
-
"inline-token-trigger": "awsui_inline-token-
|
|
14
|
-
"inline-token-list": "awsui_inline-token-
|
|
15
|
-
"inline-token": "awsui_inline-
|
|
16
|
-
"visual-refresh": "awsui_visual-
|
|
17
|
-
"inline-token-hidden-placeholder": "awsui_inline-token-hidden-
|
|
18
|
-
"inline-token-counter": "awsui_inline-token-
|
|
19
|
-
"inline-token-trigger--disabled": "awsui_inline-token-trigger--
|
|
20
|
-
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-
|
|
21
|
-
"inline-label-wrapper": "awsui_inline-label-
|
|
22
|
-
"inline-label": "awsui_inline-
|
|
23
|
-
"
|
|
24
|
-
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_dwuol_etz7p_286"
|
|
4
|
+
"placeholder": "awsui_placeholder_dwuol_ti6bo_145",
|
|
5
|
+
"item": "awsui_item_dwuol_ti6bo_150",
|
|
6
|
+
"checkbox": "awsui_checkbox_dwuol_ti6bo_154",
|
|
7
|
+
"filter": "awsui_filter_dwuol_ti6bo_163",
|
|
8
|
+
"trigger": "awsui_trigger_dwuol_ti6bo_168",
|
|
9
|
+
"layout-strut": "awsui_layout-strut_dwuol_ti6bo_174",
|
|
10
|
+
"list-bottom": "awsui_list-bottom_dwuol_ti6bo_180",
|
|
11
|
+
"selected-icon": "awsui_selected-icon_dwuol_ti6bo_184",
|
|
12
|
+
"show-label-tag": "awsui_show-label-tag_dwuol_ti6bo_188",
|
|
13
|
+
"inline-token-trigger": "awsui_inline-token-trigger_dwuol_ti6bo_192",
|
|
14
|
+
"inline-token-list": "awsui_inline-token-list_dwuol_ti6bo_199",
|
|
15
|
+
"inline-token": "awsui_inline-token_dwuol_ti6bo_192",
|
|
16
|
+
"visual-refresh": "awsui_visual-refresh_dwuol_ti6bo_229",
|
|
17
|
+
"inline-token-hidden-placeholder": "awsui_inline-token-hidden-placeholder_dwuol_ti6bo_236",
|
|
18
|
+
"inline-token-counter": "awsui_inline-token-counter_dwuol_ti6bo_242",
|
|
19
|
+
"inline-token-trigger--disabled": "awsui_inline-token-trigger--disabled_dwuol_ti6bo_246",
|
|
20
|
+
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-wrapper_dwuol_ti6bo_252",
|
|
21
|
+
"inline-label-wrapper": "awsui_inline-label-wrapper_dwuol_ti6bo_256",
|
|
22
|
+
"inline-label": "awsui_inline-label_dwuol_ti6bo_252",
|
|
23
|
+
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_dwuol_ti6bo_282"
|
|
25
24
|
};
|
|
26
25
|
|
|
@@ -142,16 +142,16 @@
|
|
|
142
142
|
*/
|
|
143
143
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
144
144
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
145
|
-
.
|
|
145
|
+
.awsui_placeholder_dwuol_ti6bo_145:not(#\9) {
|
|
146
146
|
color: var(--color-text-input-placeholder-f3x213, #656871);
|
|
147
147
|
font-style: italic;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
.
|
|
150
|
+
.awsui_item_dwuol_ti6bo_150:not(#\9) {
|
|
151
151
|
display: flex;
|
|
152
152
|
align-items: center;
|
|
153
153
|
}
|
|
154
|
-
.
|
|
154
|
+
.awsui_item_dwuol_ti6bo_150 > .awsui_checkbox_dwuol_ti6bo_154:not(#\9) {
|
|
155
155
|
position: relative;
|
|
156
156
|
min-block-size: var(--size-control-28i7hr, 16px);
|
|
157
157
|
min-inline-size: var(--size-control-28i7hr, 16px);
|
|
@@ -160,43 +160,43 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
160
160
|
margin-inline-end: var(--space-field-horizontal-gg19kw, 12px);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
.
|
|
163
|
+
.awsui_filter_dwuol_ti6bo_163:not(#\9) {
|
|
164
164
|
z-index: 4;
|
|
165
165
|
flex-shrink: 0;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
.
|
|
168
|
+
.awsui_trigger_dwuol_ti6bo_168:not(#\9) {
|
|
169
169
|
white-space: nowrap;
|
|
170
170
|
overflow: hidden;
|
|
171
171
|
text-overflow: ellipsis;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
.awsui_layout-
|
|
174
|
+
.awsui_layout-strut_dwuol_ti6bo_174:not(#\9) {
|
|
175
175
|
inline-size: 100%;
|
|
176
176
|
position: relative;
|
|
177
177
|
transform: translate3d(0, 0, 0);
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
.awsui_list-
|
|
180
|
+
.awsui_list-bottom_dwuol_ti6bo_180:not(#\9) {
|
|
181
181
|
/* used in unit-tests */
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
.awsui_selected-
|
|
184
|
+
.awsui_selected-icon_dwuol_ti6bo_184:not(#\9) {
|
|
185
185
|
color: var(--color-border-item-focused-nv6mhz, #006ce0);
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
.awsui_show-label-
|
|
188
|
+
.awsui_show-label-tag_dwuol_ti6bo_188 > .awsui_selected-icon_dwuol_ti6bo_184:not(#\9) {
|
|
189
189
|
padding-inline-start: var(--space-scaled-s-aqzyko, 12px);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
.awsui_inline-token-
|
|
192
|
+
.awsui_inline-token-trigger_dwuol_ti6bo_192:not(#\9) {
|
|
193
193
|
display: flex;
|
|
194
194
|
flex-wrap: nowrap;
|
|
195
195
|
column-gap: var(--space-xxs-p8yyaw, 4px);
|
|
196
196
|
inline-size: 100%;
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
.awsui_inline-token-
|
|
199
|
+
.awsui_inline-token-list_dwuol_ti6bo_199:not(#\9) {
|
|
200
200
|
display: flex;
|
|
201
201
|
flex-wrap: nowrap;
|
|
202
202
|
align-items: center;
|
|
@@ -207,11 +207,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
207
207
|
mask-image: linear-gradient(270deg, transparent, white 20px, white);
|
|
208
208
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
209
209
|
}
|
|
210
|
-
.awsui_inline-token-
|
|
210
|
+
.awsui_inline-token-list_dwuol_ti6bo_199:not(#\9):dir(rtl) {
|
|
211
211
|
-webkit-mask-image: linear-gradient(-270deg, transparent, white 20px, white);
|
|
212
212
|
mask-image: linear-gradient(-270deg, transparent, white 20px, white);
|
|
213
213
|
}
|
|
214
|
-
.awsui_inline-token-
|
|
214
|
+
.awsui_inline-token-list_dwuol_ti6bo_199 > .awsui_inline-token_dwuol_ti6bo_192:not(#\9) {
|
|
215
215
|
display: flex;
|
|
216
216
|
align-items: center;
|
|
217
217
|
min-inline-size: max-content;
|
|
@@ -228,40 +228,43 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
228
228
|
color: var(--color-text-body-default-7v1jfn, #0f141a);
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
.awsui_visual-
|
|
231
|
+
.awsui_visual-refresh_dwuol_ti6bo_229 > .awsui_inline-token-list_dwuol_ti6bo_199 > .awsui_inline-token_dwuol_ti6bo_192:not(#\9) {
|
|
232
232
|
border-start-start-radius: var(--border-radius-badge-0z09dt, 4px);
|
|
233
233
|
border-start-end-radius: var(--border-radius-badge-0z09dt, 4px);
|
|
234
234
|
border-end-start-radius: var(--border-radius-badge-0z09dt, 4px);
|
|
235
235
|
border-end-end-radius: var(--border-radius-badge-0z09dt, 4px);
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
.awsui_inline-token-hidden-
|
|
238
|
+
.awsui_inline-token-hidden-placeholder_dwuol_ti6bo_236:not(#\9) {
|
|
239
239
|
position: absolute !important;
|
|
240
240
|
inset-block-start: -9999px !important;
|
|
241
241
|
inset-inline-start: -9999px !important;
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
-
.awsui_inline-token-
|
|
244
|
+
.awsui_inline-token-counter_dwuol_ti6bo_242:not(#\9) {
|
|
245
245
|
white-space: nowrap;
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
.awsui_inline-token-trigger--
|
|
248
|
+
.awsui_inline-token-trigger--disabled_dwuol_ti6bo_246 > .awsui_inline-token-list_dwuol_ti6bo_199 > .awsui_inline-token_dwuol_ti6bo_192:not(#\9) {
|
|
249
249
|
border-color: var(--color-border-control-disabled-qc5csz, #dedee3);
|
|
250
250
|
background-color: var(--color-background-container-content-z79u4u, #ffffff);
|
|
251
251
|
color: var(--color-text-disabled-e4vsj4, #b4b4bb);
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
.awsui_inline-label-trigger-
|
|
254
|
+
.awsui_inline-label-trigger-wrapper_dwuol_ti6bo_252:not(#\9) {
|
|
255
255
|
margin-block-start: -7px;
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
.awsui_inline-label-
|
|
258
|
+
.awsui_inline-label-wrapper_dwuol_ti6bo_256:not(#\9) {
|
|
259
259
|
margin-block-start: calc(var(--space-scaled-xs-26e2du, 8px) * -1);
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
.awsui_inline-
|
|
263
|
-
background
|
|
264
|
-
|
|
262
|
+
.awsui_inline-label_dwuol_ti6bo_252:not(#\9) {
|
|
263
|
+
background: var(--color-background-container-header-clzg6q, #ffffff);
|
|
264
|
+
border-start-start-radius: 2px;
|
|
265
|
+
border-start-end-radius: 2px;
|
|
266
|
+
border-end-start-radius: 2px;
|
|
267
|
+
border-end-end-radius: 2px;
|
|
265
268
|
box-sizing: border-box;
|
|
266
269
|
display: inline-block;
|
|
267
270
|
color: var(--color-text-form-label-5nbxa6, #0f141a);
|
|
@@ -277,14 +280,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
277
280
|
max-inline-size: calc(100% - 2 * var(--space-field-horizontal-gg19kw, 12px));
|
|
278
281
|
z-index: 1;
|
|
279
282
|
}
|
|
280
|
-
.awsui_inline-label_dwuol_etz7p_252.awsui_inline-label-disabled_dwuol_etz7p_278:not(#\9) {
|
|
281
|
-
background: var(--color-background-container-header-clzg6q, #ffffff);
|
|
282
|
-
border-start-start-radius: 2px;
|
|
283
|
-
border-start-end-radius: 2px;
|
|
284
|
-
border-end-start-radius: 2px;
|
|
285
|
-
border-end-end-radius: 2px;
|
|
286
|
-
}
|
|
287
283
|
|
|
288
|
-
.awsui_disabled-reason-
|
|
284
|
+
.awsui_disabled-reason-tooltip_dwuol_ti6bo_282:not(#\9) {
|
|
289
285
|
/* used in test-utils or tests */
|
|
290
286
|
}
|
|
@@ -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
|
-
"placeholder": "
|
|
6
|
-
"item": "
|
|
7
|
-
"checkbox": "
|
|
8
|
-
"filter": "
|
|
9
|
-
"trigger": "
|
|
10
|
-
"layout-strut": "awsui_layout-
|
|
11
|
-
"list-bottom": "awsui_list-
|
|
12
|
-
"selected-icon": "awsui_selected-
|
|
13
|
-
"show-label-tag": "awsui_show-label-
|
|
14
|
-
"inline-token-trigger": "awsui_inline-token-
|
|
15
|
-
"inline-token-list": "awsui_inline-token-
|
|
16
|
-
"inline-token": "awsui_inline-
|
|
17
|
-
"visual-refresh": "awsui_visual-
|
|
18
|
-
"inline-token-hidden-placeholder": "awsui_inline-token-hidden-
|
|
19
|
-
"inline-token-counter": "awsui_inline-token-
|
|
20
|
-
"inline-token-trigger--disabled": "awsui_inline-token-trigger--
|
|
21
|
-
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-
|
|
22
|
-
"inline-label-wrapper": "awsui_inline-label-
|
|
23
|
-
"inline-label": "awsui_inline-
|
|
24
|
-
"
|
|
25
|
-
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_dwuol_etz7p_286"
|
|
5
|
+
"placeholder": "awsui_placeholder_dwuol_ti6bo_145",
|
|
6
|
+
"item": "awsui_item_dwuol_ti6bo_150",
|
|
7
|
+
"checkbox": "awsui_checkbox_dwuol_ti6bo_154",
|
|
8
|
+
"filter": "awsui_filter_dwuol_ti6bo_163",
|
|
9
|
+
"trigger": "awsui_trigger_dwuol_ti6bo_168",
|
|
10
|
+
"layout-strut": "awsui_layout-strut_dwuol_ti6bo_174",
|
|
11
|
+
"list-bottom": "awsui_list-bottom_dwuol_ti6bo_180",
|
|
12
|
+
"selected-icon": "awsui_selected-icon_dwuol_ti6bo_184",
|
|
13
|
+
"show-label-tag": "awsui_show-label-tag_dwuol_ti6bo_188",
|
|
14
|
+
"inline-token-trigger": "awsui_inline-token-trigger_dwuol_ti6bo_192",
|
|
15
|
+
"inline-token-list": "awsui_inline-token-list_dwuol_ti6bo_199",
|
|
16
|
+
"inline-token": "awsui_inline-token_dwuol_ti6bo_192",
|
|
17
|
+
"visual-refresh": "awsui_visual-refresh_dwuol_ti6bo_229",
|
|
18
|
+
"inline-token-hidden-placeholder": "awsui_inline-token-hidden-placeholder_dwuol_ti6bo_236",
|
|
19
|
+
"inline-token-counter": "awsui_inline-token-counter_dwuol_ti6bo_242",
|
|
20
|
+
"inline-token-trigger--disabled": "awsui_inline-token-trigger--disabled_dwuol_ti6bo_246",
|
|
21
|
+
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-wrapper_dwuol_ti6bo_252",
|
|
22
|
+
"inline-label-wrapper": "awsui_inline-label-wrapper_dwuol_ti6bo_256",
|
|
23
|
+
"inline-label": "awsui_inline-label_dwuol_ti6bo_252",
|
|
24
|
+
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_dwuol_ti6bo_282"
|
|
26
25
|
};
|
|
27
26
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/trigger.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAK5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAIzD,MAAM,WAAW,YAAa,SAAQ,+BAA+B;IACnE,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,kBAAkB,CAAC;IACjC,cAAc,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,WAAW,CAAC,cAAc,GAAG,gBAAgB,CAAC,cAAc,CAAC;IAC9E,gBAAgB,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACrC,eAAe,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACnD;AAED,QAAA,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/trigger.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAK5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAIzD,MAAM,WAAW,YAAa,SAAQ,+BAA+B;IACnE,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,kBAAkB,CAAC;IACjC,cAAc,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,WAAW,CAAC,cAAc,GAAG,gBAAgB,CAAC,cAAc,CAAC;IAC9E,gBAAgB,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACrC,eAAe,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACnD;AAED,QAAA,MAAM,OAAO,wFA8GZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/select/parts/trigger.js
CHANGED
|
@@ -44,7 +44,7 @@ const Trigger = React.forwardRef(({ ariaLabelledby, ariaDescribedby, controlId,
|
|
|
44
44
|
const mergedRef = useMergeRefs(triggerProps.ref, ref);
|
|
45
45
|
const triggerButton = (React.createElement(ButtonTrigger, Object.assign({}, triggerProps, { id: id, ref: mergedRef, pressed: !!isOpen, disabled: disabled, readOnly: readOnly, invalid: invalid, warning: warning && !invalid, inFilteringToken: inFilteringToken, inlineTokens: triggerVariant === 'tokens', ariaDescribedby: ariaDescribedby, ariaLabelledby: ariaLabelledbyIds }), triggerContent));
|
|
46
46
|
return (React.createElement(React.Fragment, null, inlineLabelText ? (React.createElement("div", { className: styles['inline-label-wrapper'] },
|
|
47
|
-
React.createElement("label", { htmlFor: controlId, className:
|
|
47
|
+
React.createElement("label", { htmlFor: controlId, className: styles['inline-label'] }, inlineLabelText),
|
|
48
48
|
React.createElement("div", { className: styles['inline-label-trigger-wrapper'] }, triggerButton))) : (React.createElement(React.Fragment, null, triggerButton))));
|
|
49
49
|
});
|
|
50
50
|
export default Trigger;
|