@cloudscape-design/components 3.0.1083 → 3.0.1085
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/autosuggest/plain-list.js +1 -1
- package/autosuggest/plain-list.js.map +1 -1
- package/autosuggest/virtual-list.js +1 -1
- package/autosuggest/virtual-list.js.map +1 -1
- package/button-dropdown/internal.d.ts.map +1 -1
- package/button-dropdown/internal.js +1 -1
- package/button-dropdown/internal.js.map +1 -1
- package/button-group/internal.d.ts.map +1 -1
- package/button-group/internal.js +5 -87
- package/button-group/internal.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/internal/base-component/styles.scoped.css +1 -1
- package/internal/components/option/index.d.ts +0 -1
- package/internal/components/option/index.d.ts.map +1 -1
- package/internal/components/option/index.js +2 -11
- package/internal/components/option/index.js.map +1 -1
- package/internal/components/option/interfaces.d.ts +0 -1
- package/internal/components/option/interfaces.d.ts.map +1 -1
- package/internal/components/option/interfaces.js.map +1 -1
- package/internal/components/option/option-parts.d.ts.map +1 -1
- package/internal/components/option/option-parts.js +1 -1
- package/internal/components/option/option-parts.js.map +1 -1
- package/internal/components/option/utils/unflatten-options.d.ts +15 -0
- package/internal/components/option/utils/unflatten-options.d.ts.map +1 -0
- package/internal/components/option/utils/unflatten-options.js +23 -0
- package/internal/components/option/utils/unflatten-options.js.map +1 -0
- package/internal/components/options-list/index.d.ts +2 -1
- package/internal/components/options-list/index.d.ts.map +1 -1
- package/internal/components/options-list/index.js +2 -2
- package/internal/components/options-list/index.js.map +1 -1
- package/internal/components/selectable-item/index.d.ts.map +1 -1
- package/internal/components/selectable-item/index.js +23 -20
- package/internal/components/selectable-item/index.js.map +1 -1
- package/internal/components/selectable-item/interfaces.d.ts +1 -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 +22 -21
- package/internal/components/selectable-item/styles.scoped.css +42 -42
- package/internal/components/selectable-item/styles.selectors.js +22 -21
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/manifest.json +1 -1
- package/multiselect/use-multiselect.d.ts +2 -1
- package/multiselect/use-multiselect.d.ts.map +1 -1
- package/navigable-group/index.d.ts +8 -0
- package/navigable-group/index.d.ts.map +1 -0
- package/navigable-group/index.js +23 -0
- package/navigable-group/index.js.map +1 -0
- package/navigable-group/interfaces.d.ts +37 -0
- package/navigable-group/interfaces.d.ts.map +1 -0
- package/navigable-group/interfaces.js +4 -0
- package/navigable-group/interfaces.js.map +1 -0
- package/navigable-group/internal.d.ts +4 -0
- package/navigable-group/internal.d.ts.map +1 -0
- package/navigable-group/internal.js +125 -0
- package/navigable-group/internal.js.map +1 -0
- package/navigable-group/styles.css.js +6 -0
- package/navigable-group/styles.scoped.css +7 -0
- package/navigable-group/styles.selectors.js +7 -0
- package/navigable-group/test-classes/styles.css.js +6 -0
- package/navigable-group/test-classes/styles.scoped.css +7 -0
- package/navigable-group/test-classes/styles.selectors.js +7 -0
- package/package.json +2 -1
- package/select/internal.js +1 -1
- package/select/internal.js.map +1 -1
- package/select/parts/item.d.ts +1 -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/option-group.d.ts +14 -0
- package/select/parts/option-group.d.ts.map +1 -0
- package/select/parts/option-group.js +9 -0
- package/select/parts/option-group.js.map +1 -0
- package/select/parts/plain-list.d.ts.map +1 -1
- package/select/parts/plain-list.js +4 -2
- package/select/parts/plain-list.js.map +1 -1
- package/select/parts/styles.css.js +22 -21
- package/select/parts/styles.scoped.css +26 -22
- package/select/parts/styles.selectors.js +22 -21
- package/select/parts/virtual-list.d.ts.map +1 -1
- package/select/parts/virtual-list.js +5 -3
- package/select/parts/virtual-list.js.map +1 -1
- package/select/utils/render-options.d.ts +2 -0
- package/select/utils/render-options.d.ts.map +1 -1
- package/select/utils/render-options.js +23 -3
- package/select/utils/render-options.js.map +1 -1
- package/select/utils/use-select.d.ts +1 -1
- package/select/utils/use-select.d.ts.map +1 -1
- package/select/utils/use-select.js +6 -1
- package/select/utils/use-select.js.map +1 -1
- package/test-utils/dom/index.d.ts +20 -0
- package/test-utils/dom/index.js +12 -1
- package/test-utils/dom/index.js.map +1 -1
- package/test-utils/dom/navigable-group/index.d.ts +5 -0
- package/test-utils/dom/navigable-group/index.js +14 -0
- package/test-utils/dom/navigable-group/index.js.map +1 -0
- package/test-utils/selectors/index.d.ts +18 -0
- package/test-utils/selectors/index.js +12 -1
- package/test-utils/selectors/index.js.map +1 -1
- package/test-utils/selectors/navigable-group/index.d.ts +5 -0
- package/test-utils/selectors/navigable-group/index.js +14 -0
- package/test-utils/selectors/navigable-group/index.js.map +1 -0
- package/token-group/internal.js +1 -1
- package/token-group/internal.js.map +1 -1
package/package.json
CHANGED
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"./mixed-line-bar-chart": "./mixed-line-bar-chart/index.js",
|
|
80
80
|
"./modal": "./modal/index.js",
|
|
81
81
|
"./multiselect": "./multiselect/index.js",
|
|
82
|
+
"./navigable-group": "./navigable-group/index.js",
|
|
82
83
|
"./pagination": "./pagination/index.js",
|
|
83
84
|
"./pie-chart": "./pie-chart/index.js",
|
|
84
85
|
"./popover": "./popover/index.js",
|
|
@@ -150,7 +151,7 @@
|
|
|
150
151
|
"./internal/base-component/index.js",
|
|
151
152
|
"./internal/base-component/styles.css.js"
|
|
152
153
|
],
|
|
153
|
-
"version": "3.0.
|
|
154
|
+
"version": "3.0.1085",
|
|
154
155
|
"repository": {
|
|
155
156
|
"type": "git",
|
|
156
157
|
"url": "https://github.com/cloudscape-design/components.git"
|
package/select/internal.js
CHANGED
|
@@ -9,7 +9,7 @@ import { getBaseProps } from '../internal/base-component';
|
|
|
9
9
|
import Dropdown from '../internal/components/dropdown';
|
|
10
10
|
import DropdownFooter from '../internal/components/dropdown-footer';
|
|
11
11
|
import { useDropdownStatus } from '../internal/components/dropdown-status';
|
|
12
|
-
import { prepareOptions } from '../internal/components/option/utils/prepare-options';
|
|
12
|
+
import { prepareOptions } from '../internal/components/option/utils/prepare-options.js';
|
|
13
13
|
import { useFormFieldContext } from '../internal/context/form-field-context';
|
|
14
14
|
import { fireNonCancelableEvent } from '../internal/events';
|
|
15
15
|
import checkControlled from '../internal/hooks/check-controlled';
|
package/select/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEpG,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;AAGjE,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAExE,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OA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EAAE,IAAI,EAC/B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,eAAe,EAC5B,MAAM,EACJ,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CACxB,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,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 { useMergeRefs, useUniqueId, 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 { 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,\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"]}
|
|
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,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEpG,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,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,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 { useMergeRefs, useUniqueId, 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.js';\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 { 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,\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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAA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AO,CAAC;IAC7B,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;;AAmGD,wBAAkD"}
|
package/select/parts/item.js
CHANGED
|
@@ -13,7 +13,7 @@ import Tooltip from '../../internal/components/tooltip';
|
|
|
13
13
|
import useHiddenDescription from '../../internal/hooks/use-hidden-description';
|
|
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, withScrollbar, sticky } = _a, restProps = __rest(_a, ["option", "highlighted", "selected", "filteringValue", "hasCheckbox", "virtualPosition", "padBottom", "isNextSelected", "screenReaderContent", "ariaPosinset", "ariaSetsize", "highlightType", "withScrollbar", "sticky"]);
|
|
16
|
+
var { option, highlighted, selected, filteringValue, hasCheckbox, virtualPosition, padBottom, isNextSelected, isPreviousSelected, screenReaderContent, ariaPosinset, ariaSetsize, highlightType, withScrollbar, sticky } = _a, restProps = __rest(_a, ["option", "highlighted", "selected", "filteringValue", "hasCheckbox", "virtualPosition", "padBottom", "isNextSelected", "isPreviousSelected", "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, withScrollbar: withScrollbar, sticky: sticky }, baseProps),
|
|
28
|
+
return (React.createElement(SelectableItem, Object.assign({ ariaSelected: Boolean(selected), selected: selected, isNextSelected: isNextSelected, isPreviousSelected: isPreviousSelected, 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,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,YAAY,MAAM,wBAAw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I,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,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';\nimport clsx from 'clsx';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\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';\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 isPreviousSelected?: 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 isPreviousSelected,\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 isPreviousSelected={isPreviousSelected}\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;AAW3D,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;AAW3D,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGnC,UAAU,oBAAqB,SAAQ,SAAS;IAC9C,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;;AA0GD,wBAA6D"}
|
|
@@ -11,7 +11,7 @@ import Tooltip from '../../internal/components/tooltip';
|
|
|
11
11
|
import useHiddenDescription from '../../internal/hooks/use-hidden-description';
|
|
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, withScrollbar, sticky } = _a, restProps = __rest(_a, ["option", "highlighted", "selected", "filteringValue", "hasCheckbox", "virtualPosition", "padBottom", "isNextSelected", "indeterminate", "screenReaderContent", "ariaPosinset", "ariaSetsize", "highlightType", "withScrollbar", "sticky"]);
|
|
14
|
+
var { option, highlighted, selected, filteringValue, hasCheckbox, virtualPosition, padBottom, isNextSelected, isPreviousSelected, indeterminate, screenReaderContent, ariaPosinset, ariaSetsize, highlightType, withScrollbar, sticky } = _a, restProps = __rest(_a, ["option", "highlighted", "selected", "filteringValue", "hasCheckbox", "virtualPosition", "padBottom", "isNextSelected", "isPreviousSelected", "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';
|
|
@@ -27,7 +27,7 @@ const MultiSelectItem = (_a, ref) => {
|
|
|
27
27
|
const { descriptionId, descriptionEl } = useHiddenDescription(disabledReason);
|
|
28
28
|
const [canShowTooltip, setCanShowTooltip] = useState(true);
|
|
29
29
|
useEffect(() => setCanShowTooltip(true), [highlighted]);
|
|
30
|
-
return (React.createElement(SelectableItem, Object.assign({ ariaChecked: isParent && indeterminate ? 'mixed' : Boolean(selected), selected: selected, isNextSelected: isNextSelected, highlighted: highlighted, disabled: disabled, isParent: isParent, isChild: isChild, isSelectAll: isSelectAll, 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
|
+
return (React.createElement(SelectableItem, Object.assign({ ariaChecked: isParent && indeterminate ? 'mixed' : Boolean(selected), selected: selected, isNextSelected: isNextSelected, isPreviousSelected: isPreviousSelected, highlighted: highlighted, disabled: disabled, isParent: isParent, isChild: isChild, isSelectAll: isSelectAll, 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),
|
|
31
31
|
React.createElement("div", { className: className },
|
|
32
32
|
hasCheckbox && (React.createElement("div", { className: styles.checkbox },
|
|
33
33
|
React.createElement(CheckboxIcon, { checked: selected, indeterminate: (isParent || isSelectAll) && indeterminate, disabled: 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,+CAA+C,CAAC;AAE7E,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;AAG/E,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,+CAA+C,CAAC;AAE7E,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;AAG/E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAKrC,MAAM,eAAe,GAAG,CACtB,EAkBuB,EACvB,GAA8B,EAC9B,EAAE;QApBF,EACE,MAAM,EACN,WAAW,EACX,QAAQ,EACR,cAAc,EACd,WAAW,EACX,eAAe,EACf,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACn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AO,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 { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\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 { 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 isPreviousSelected,\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 isSelectAll = option.type === 'select-all';\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 return (\n <SelectableItem\n ariaChecked={isParent && indeterminate ? 'mixed' : Boolean(selected)}\n selected={selected}\n isNextSelected={isNextSelected}\n isPreviousSelected={isPreviousSelected}\n highlighted={highlighted}\n disabled={disabled}\n isParent={isParent}\n isChild={isChild}\n isSelectAll={isSelectAll}\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\n checked={selected}\n indeterminate={(isParent || isSelectAll) && indeterminate}\n disabled={disabled}\n />\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"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface OptionGroupProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
virtual: boolean;
|
|
5
|
+
ariaLabelledby: string;
|
|
6
|
+
ariaDisabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export default function OptionGroup({
|
|
9
|
+
children,
|
|
10
|
+
virtual,
|
|
11
|
+
ariaLabelledby,
|
|
12
|
+
ariaDisabled
|
|
13
|
+
}: OptionGroupProps): JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"option-group.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/option-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,gBAAgB;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,EAAE,gBAAgB,eAWxG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import styles from './styles.css.js';
|
|
6
|
+
export default function OptionGroup({ children, virtual, ariaLabelledby, ariaDisabled }) {
|
|
7
|
+
return (React.createElement("div", { role: "group", className: clsx(styles['option-group'], virtual && styles.virtual), "aria-labelledby": ariaLabelledby, "aria-disabled": ariaDisabled }, children));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=option-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"option-group.js","sourceRoot":"","sources":["../../../../src/select/parts/option-group.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AASrC,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAoB;IACvG,OAAO,CACL,6BACE,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,qBACjD,cAAc,mBAChB,YAAY,IAE1B,QAAQ,CACL,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport styles from './styles.css.js';\n\ninterface OptionGroupProps {\n children: React.ReactNode;\n virtual: boolean;\n ariaLabelledby: string;\n ariaDisabled?: boolean;\n}\n\nexport default function OptionGroup({ children, virtual, ariaLabelledby, ariaDisabled }: OptionGroupProps) {\n return (\n <div\n role=\"group\"\n className={clsx(styles['option-group'], virtual && styles.virtual)}\n aria-labelledby={ariaLabelledby}\n aria-disabled={ariaDisabled}\n >\n {children}\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plain-list.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/plain-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAKjF,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,mEAAmE,CAAC;AAGlG,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAKhE,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,CA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ier: Apache-2.0
|
|
3
3
|
import React, { forwardRef, useImperativeHandle, useRef, useState } from 'react';
|
|
4
4
|
import { useContainerQuery } from '@cloudscape-design/component-toolkit';
|
|
5
|
-
import { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';
|
|
5
|
+
import { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';
|
|
6
6
|
import OptionsList from '../../internal/components/options-list';
|
|
7
7
|
import { renderOptions } from '../utils/render-options';
|
|
8
8
|
import scrollToIndex from '../utils/scroll-to-index';
|
|
9
9
|
import { fallbackItemHeight } from './common';
|
|
10
10
|
import styles from './styles.css.js';
|
|
11
11
|
const PlainList = ({ menuProps, getOptionProps, filteredOptions, filteringValue, highlightType, checkboxes, hasDropdownStatus, listBottom, useInteractiveGroups, screenReaderContent, firstOptionSticky, }, ref) => {
|
|
12
|
+
const idPrefix = useUniqueId('select-list-');
|
|
12
13
|
const stickyOptionRef = useRef(null);
|
|
13
14
|
const [stickyOptionBlockSize, setStickyOptionBlockSize] = useState(firstOptionSticky ? fallbackItemHeight : 0);
|
|
14
15
|
const [width, menuMeasureRef] = useContainerQuery(rect => {
|
|
@@ -35,6 +36,7 @@ const PlainList = ({ menuProps, getOptionProps, filteredOptions, filteringValue,
|
|
|
35
36
|
options: filteredOptions,
|
|
36
37
|
getOptionProps,
|
|
37
38
|
filteringValue,
|
|
39
|
+
idPrefix,
|
|
38
40
|
highlightType,
|
|
39
41
|
checkboxes,
|
|
40
42
|
hasDropdownStatus,
|
|
@@ -44,7 +46,7 @@ const PlainList = ({ menuProps, getOptionProps, filteredOptions, filteringValue,
|
|
|
44
46
|
stickyOptionRef,
|
|
45
47
|
withScrollbar,
|
|
46
48
|
}),
|
|
47
|
-
listBottom ? (React.createElement("
|
|
49
|
+
listBottom ? (React.createElement("div", { role: "option", className: styles['list-bottom'] }, listBottom)) : null));
|
|
48
50
|
};
|
|
49
51
|
export default forwardRef(PlainList);
|
|
50
52
|
//# sourceMappingURL=plain-list.js.map
|
|
@@ -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,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,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,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAG1F,OAAO,WAAW,MAAM,wCAAwC,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,aAAa,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAoBrC,MAAM,SAAS,GAAG,CAChB,EACE,SAAS,EACT,cAAc,EACd,eAAe,EACf,cAAc,EACd,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,GACD,EAClB,GAA6C,EAC7C,EAAE;IACF,MAAM,QAAQ,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC;IAC7C,MAAM,eAAe,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACrD,MAAM,CAAC,qBAAqB,EAA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cAAc;YACd,QAAQ;YACR,aAAa;YACb,UAAU;YACV,iBAAiB;YACjB,oBAAoB;YACpB,mBAAmB;YACnB,iBAAiB;YACjB,eAAe;YACf,aAAa;SACd,CAAC;QACD,UAAU,CAAC,CAAC,CAAC,CACZ,6BAAK,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,IAChD,UAAU,CACP,CACP,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, useRef, useState } from 'react';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\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 { renderOptions } from '../utils/render-options';\nimport scrollToIndex from '../utils/scroll-to-index';\nimport { GetOptionProps, MenuProps } from '../utils/use-select';\nimport { fallbackItemHeight } from './common';\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 idPrefix = useUniqueId('select-list-');\n const stickyOptionRef = useRef<HTMLDivElement>(null);\n const [stickyOptionBlockSize, setStickyOptionBlockSize] = useState(firstOptionSticky ? fallbackItemHeight : 0);\n\n const [width, menuMeasureRef] = useContainerQuery(rect => {\n if (stickyOptionRef.current) {\n // Cannot use container query on the sticky option individually because it is not rendered until the dropdown is open.\n // Not expecting the sticky option to change size without the dropdown also changing size.\n\n // The effects of using the sticky option block size to set the menu scroll padding are covered by integration tests.\n // istanbul ignore next\n setStickyOptionBlockSize(stickyOptionRef.current.clientHeight);\n }\n return { inner: rect.contentBoxWidth, outer: rect.borderBoxWidth };\n });\n\n const menuRef = menuProps.ref;\n\n const mergedRef = useMergeRefs(menuMeasureRef, menuRef);\n\n useImperativeHandle(\n ref,\n () => (index: number) => {\n const isSticky = firstOptionSticky && index === 0;\n if (highlightType.moveFocus && menuRef.current && !isSticky) {\n scrollToIndex({ index, menuEl: menuRef.current });\n }\n },\n [firstOptionSticky, highlightType.moveFocus, menuRef]\n );\n\n const withScrollbar = !!width && width.inner < width.outer;\n\n return (\n <OptionsList {...menuProps} ref={mergedRef} stickyItemBlockSize={stickyOptionBlockSize}>\n {renderOptions({\n options: filteredOptions,\n getOptionProps,\n filteringValue,\n idPrefix,\n highlightType,\n checkboxes,\n hasDropdownStatus,\n useInteractiveGroups,\n screenReaderContent,\n firstOptionSticky,\n stickyOptionRef,\n withScrollbar,\n })}\n {listBottom ? (\n <div role=\"option\" className={styles['list-bottom']}>\n {listBottom}\n </div>\n ) : null}\n </OptionsList>\n );\n};\n\nexport default forwardRef(PlainList);\n"]}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"placeholder": "
|
|
5
|
-
"item": "
|
|
6
|
-
"checkbox": "
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"inline-token-
|
|
15
|
-
"inline-token": "awsui_inline-
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"inline-token-
|
|
19
|
-
"inline-token-
|
|
20
|
-
"inline-
|
|
21
|
-
"inline-label-wrapper": "awsui_inline-label-
|
|
22
|
-
"inline-label": "awsui_inline-
|
|
23
|
-
"inline-label
|
|
24
|
-
"
|
|
4
|
+
"placeholder": "awsui_placeholder_dwuol_1tb10_145",
|
|
5
|
+
"item": "awsui_item_dwuol_1tb10_150",
|
|
6
|
+
"checkbox": "awsui_checkbox_dwuol_1tb10_154",
|
|
7
|
+
"option-group": "awsui_option-group_dwuol_1tb10_163",
|
|
8
|
+
"filter": "awsui_filter_dwuol_1tb10_167",
|
|
9
|
+
"trigger": "awsui_trigger_dwuol_1tb10_172",
|
|
10
|
+
"layout-strut": "awsui_layout-strut_dwuol_1tb10_178",
|
|
11
|
+
"list-bottom": "awsui_list-bottom_dwuol_1tb10_184",
|
|
12
|
+
"selected-icon": "awsui_selected-icon_dwuol_1tb10_188",
|
|
13
|
+
"show-label-tag": "awsui_show-label-tag_dwuol_1tb10_192",
|
|
14
|
+
"inline-token-trigger": "awsui_inline-token-trigger_dwuol_1tb10_196",
|
|
15
|
+
"inline-token-list": "awsui_inline-token-list_dwuol_1tb10_203",
|
|
16
|
+
"inline-token": "awsui_inline-token_dwuol_1tb10_196",
|
|
17
|
+
"visual-refresh": "awsui_visual-refresh_dwuol_1tb10_233",
|
|
18
|
+
"inline-token-hidden-placeholder": "awsui_inline-token-hidden-placeholder_dwuol_1tb10_240",
|
|
19
|
+
"inline-token-counter": "awsui_inline-token-counter_dwuol_1tb10_246",
|
|
20
|
+
"inline-token-trigger--disabled": "awsui_inline-token-trigger--disabled_dwuol_1tb10_250",
|
|
21
|
+
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-wrapper_dwuol_1tb10_256",
|
|
22
|
+
"inline-label-wrapper": "awsui_inline-label-wrapper_dwuol_1tb10_260",
|
|
23
|
+
"inline-label": "awsui_inline-label_dwuol_1tb10_256",
|
|
24
|
+
"inline-label-inline-tokens": "awsui_inline-label-inline-tokens_dwuol_1tb10_286",
|
|
25
|
+
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_dwuol_1tb10_291"
|
|
25
26
|
};
|
|
26
27
|
|
|
@@ -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_1tb10_145:not(#\9) {
|
|
146
146
|
color: var(--color-text-input-placeholder-dclg8u, #656871);
|
|
147
147
|
font-style: italic;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
.
|
|
150
|
+
.awsui_item_dwuol_1tb10_150:not(#\9) {
|
|
151
151
|
display: flex;
|
|
152
152
|
align-items: center;
|
|
153
153
|
}
|
|
154
|
-
.
|
|
154
|
+
.awsui_item_dwuol_1tb10_150 > .awsui_checkbox_dwuol_1tb10_154:not(#\9) {
|
|
155
155
|
position: relative;
|
|
156
156
|
min-block-size: var(--size-control-adm93y, 16px);
|
|
157
157
|
min-inline-size: var(--size-control-adm93y, 16px);
|
|
@@ -160,43 +160,47 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
160
160
|
margin-inline-end: var(--space-field-horizontal-0aq2ch, 12px);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
.
|
|
163
|
+
.awsui_option-group_dwuol_1tb10_163:not(#\9):not(:first-child) {
|
|
164
|
+
margin-block-start: calc(-1 * var(--border-item-width-miijiw, 2px));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.awsui_filter_dwuol_1tb10_167:not(#\9) {
|
|
164
168
|
z-index: 4;
|
|
165
169
|
flex-shrink: 0;
|
|
166
170
|
}
|
|
167
171
|
|
|
168
|
-
.
|
|
172
|
+
.awsui_trigger_dwuol_1tb10_172:not(#\9) {
|
|
169
173
|
white-space: nowrap;
|
|
170
174
|
overflow: hidden;
|
|
171
175
|
text-overflow: ellipsis;
|
|
172
176
|
}
|
|
173
177
|
|
|
174
|
-
.awsui_layout-
|
|
178
|
+
.awsui_layout-strut_dwuol_1tb10_178:not(#\9) {
|
|
175
179
|
inline-size: 100%;
|
|
176
180
|
position: relative;
|
|
177
181
|
transform: translate3d(0, 0, 0);
|
|
178
182
|
}
|
|
179
183
|
|
|
180
|
-
.awsui_list-
|
|
184
|
+
.awsui_list-bottom_dwuol_1tb10_184:not(#\9) {
|
|
181
185
|
/* used in unit-tests */
|
|
182
186
|
}
|
|
183
187
|
|
|
184
|
-
.awsui_selected-
|
|
188
|
+
.awsui_selected-icon_dwuol_1tb10_188:not(#\9) {
|
|
185
189
|
color: var(--color-border-item-focused-uk47pl, #006ce0);
|
|
186
190
|
}
|
|
187
191
|
|
|
188
|
-
.awsui_show-label-
|
|
192
|
+
.awsui_show-label-tag_dwuol_1tb10_192 > .awsui_selected-icon_dwuol_1tb10_188:not(#\9) {
|
|
189
193
|
padding-inline-start: var(--space-scaled-s-8ozaad, 12px);
|
|
190
194
|
}
|
|
191
195
|
|
|
192
|
-
.awsui_inline-token-
|
|
196
|
+
.awsui_inline-token-trigger_dwuol_1tb10_196:not(#\9) {
|
|
193
197
|
display: flex;
|
|
194
198
|
flex-wrap: nowrap;
|
|
195
199
|
column-gap: var(--space-xxs-hwfkai, 4px);
|
|
196
200
|
inline-size: 100%;
|
|
197
201
|
}
|
|
198
202
|
|
|
199
|
-
.awsui_inline-token-
|
|
203
|
+
.awsui_inline-token-list_dwuol_1tb10_203:not(#\9) {
|
|
200
204
|
display: flex;
|
|
201
205
|
flex-wrap: nowrap;
|
|
202
206
|
align-items: center;
|
|
@@ -206,10 +210,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
206
210
|
mask-image: linear-gradient(270deg, transparent, white 20px, white);
|
|
207
211
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
208
212
|
}
|
|
209
|
-
.awsui_inline-token-
|
|
213
|
+
.awsui_inline-token-list_dwuol_1tb10_203:not(#\9):dir(rtl) {
|
|
210
214
|
mask-image: linear-gradient(-270deg, transparent, white 20px, white);
|
|
211
215
|
}
|
|
212
|
-
.awsui_inline-token-
|
|
216
|
+
.awsui_inline-token-list_dwuol_1tb10_203 > .awsui_inline-token_dwuol_1tb10_196:not(#\9) {
|
|
213
217
|
display: flex;
|
|
214
218
|
align-items: center;
|
|
215
219
|
min-inline-size: max-content;
|
|
@@ -226,38 +230,38 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
226
230
|
color: var(--color-text-body-default-vvtq8u, #0f141a);
|
|
227
231
|
}
|
|
228
232
|
|
|
229
|
-
.awsui_visual-
|
|
233
|
+
.awsui_visual-refresh_dwuol_1tb10_233 > .awsui_inline-token-list_dwuol_1tb10_203 > .awsui_inline-token_dwuol_1tb10_196:not(#\9) {
|
|
230
234
|
border-start-start-radius: var(--border-radius-badge-exolfb, 4px);
|
|
231
235
|
border-start-end-radius: var(--border-radius-badge-exolfb, 4px);
|
|
232
236
|
border-end-start-radius: var(--border-radius-badge-exolfb, 4px);
|
|
233
237
|
border-end-end-radius: var(--border-radius-badge-exolfb, 4px);
|
|
234
238
|
}
|
|
235
239
|
|
|
236
|
-
.awsui_inline-token-hidden-
|
|
240
|
+
.awsui_inline-token-hidden-placeholder_dwuol_1tb10_240:not(#\9) {
|
|
237
241
|
position: absolute !important;
|
|
238
242
|
inset-block-start: -9999px !important;
|
|
239
243
|
inset-inline-start: -9999px !important;
|
|
240
244
|
}
|
|
241
245
|
|
|
242
|
-
.awsui_inline-token-
|
|
246
|
+
.awsui_inline-token-counter_dwuol_1tb10_246:not(#\9) {
|
|
243
247
|
white-space: nowrap;
|
|
244
248
|
}
|
|
245
249
|
|
|
246
|
-
.awsui_inline-token-trigger--
|
|
250
|
+
.awsui_inline-token-trigger--disabled_dwuol_1tb10_250 > .awsui_inline-token-list_dwuol_1tb10_203 > .awsui_inline-token_dwuol_1tb10_196:not(#\9) {
|
|
247
251
|
border-color: var(--color-border-control-disabled-uj7t08, #dedee3);
|
|
248
252
|
background-color: var(--color-background-container-content-6u8rvp, #ffffff);
|
|
249
253
|
color: var(--color-text-disabled-rox5hg, #b4b4bb);
|
|
250
254
|
}
|
|
251
255
|
|
|
252
|
-
.awsui_inline-label-trigger-
|
|
256
|
+
.awsui_inline-label-trigger-wrapper_dwuol_1tb10_256:not(#\9) {
|
|
253
257
|
margin-block-start: -7px;
|
|
254
258
|
}
|
|
255
259
|
|
|
256
|
-
.awsui_inline-label-
|
|
260
|
+
.awsui_inline-label-wrapper_dwuol_1tb10_260:not(#\9) {
|
|
257
261
|
margin-block-start: calc(var(--space-scaled-xs-xwoogq, 8px) * -1);
|
|
258
262
|
}
|
|
259
263
|
|
|
260
|
-
.awsui_inline-
|
|
264
|
+
.awsui_inline-label_dwuol_1tb10_256:not(#\9) {
|
|
261
265
|
background: linear-gradient(to bottom, var(--color-background-layout-main-5ilwcb, #ffffff), var(--color-background-input-default-ifz5bb, #ffffff));
|
|
262
266
|
border-start-start-radius: 2px;
|
|
263
267
|
border-start-end-radius: 2px;
|
|
@@ -279,11 +283,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
279
283
|
z-index: 1;
|
|
280
284
|
}
|
|
281
285
|
|
|
282
|
-
.awsui_inline-label-inline-
|
|
286
|
+
.awsui_inline-label-inline-tokens_dwuol_1tb10_286:not(#\9) {
|
|
283
287
|
padding-block-end: 0;
|
|
284
288
|
transform: translateY(-1.5px);
|
|
285
289
|
}
|
|
286
290
|
|
|
287
|
-
.awsui_disabled-reason-
|
|
291
|
+
.awsui_disabled-reason-tooltip_dwuol_1tb10_291:not(#\9) {
|
|
288
292
|
/* used in test-utils or tests */
|
|
289
293
|
}
|