@cloudscape-design/components-themeable 3.0.1341 → 3.0.1343
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/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/expandable-section/styles.scss +142 -0
- package/lib/internal/scss/input/styles.scss +2 -5
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/multiselect/styles.scss +14 -0
- package/lib/internal/scss/pagination/styles.scss +9 -2
- package/lib/internal/scss/pagination/test-classes/styles.scss +8 -0
- package/lib/internal/scss/select/styles.scss +14 -1
- package/lib/internal/scss/side-navigation/styles.scss +62 -24
- package/lib/internal/scss/textarea/styles.scss +21 -2
- package/lib/internal/template/expandable-section/expandable-section-header.d.ts +2 -1
- package/lib/internal/template/expandable-section/expandable-section-header.d.ts.map +1 -1
- package/lib/internal/template/expandable-section/expandable-section-header.js +57 -13
- package/lib/internal/template/expandable-section/expandable-section-header.js.map +1 -1
- package/lib/internal/template/expandable-section/interfaces.d.ts +1 -1
- package/lib/internal/template/expandable-section/interfaces.js.map +1 -1
- package/lib/internal/template/expandable-section/internal.d.ts +14 -1
- package/lib/internal/template/expandable-section/internal.d.ts.map +1 -1
- package/lib/internal/template/expandable-section/internal.js +3 -3
- package/lib/internal/template/expandable-section/internal.js.map +1 -1
- package/lib/internal/template/expandable-section/styles.css.js +42 -35
- package/lib/internal/template/expandable-section/styles.scoped.css +177 -69
- package/lib/internal/template/expandable-section/styles.selectors.js +42 -35
- package/lib/internal/template/i18n/messages/all.all.js +1 -1
- package/lib/internal/template/i18n/messages/all.all.json +1 -1
- package/lib/internal/template/i18n/messages/all.ar.js +1 -1
- package/lib/internal/template/i18n/messages/all.ar.json +1 -1
- package/lib/internal/template/i18n/messages/all.de.js +1 -1
- package/lib/internal/template/i18n/messages/all.de.json +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.js +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.json +1 -1
- package/lib/internal/template/i18n/messages/all.en.js +1 -1
- package/lib/internal/template/i18n/messages/all.en.json +1 -1
- package/lib/internal/template/i18n/messages/all.es.js +1 -1
- package/lib/internal/template/i18n/messages/all.es.json +1 -1
- package/lib/internal/template/i18n/messages/all.fr.js +1 -1
- package/lib/internal/template/i18n/messages/all.fr.json +1 -1
- package/lib/internal/template/i18n/messages/all.id.js +1 -1
- package/lib/internal/template/i18n/messages/all.id.json +1 -1
- package/lib/internal/template/i18n/messages/all.it.js +1 -1
- package/lib/internal/template/i18n/messages/all.it.json +1 -1
- package/lib/internal/template/i18n/messages/all.ja.js +1 -1
- package/lib/internal/template/i18n/messages/all.ja.json +1 -1
- package/lib/internal/template/i18n/messages/all.ko.js +1 -1
- package/lib/internal/template/i18n/messages/all.ko.json +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.js +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.json +1 -1
- package/lib/internal/template/i18n/messages/all.tr.js +1 -1
- package/lib/internal/template/i18n/messages/all.tr.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.json +1 -1
- package/lib/internal/template/i18n/messages-types.d.ts +5 -0
- package/lib/internal/template/i18n/messages-types.d.ts.map +1 -1
- package/lib/internal/template/i18n/messages-types.js.map +1 -1
- package/lib/internal/template/input/styles.css.js +28 -28
- package/lib/internal/template/input/styles.scoped.css +70 -70
- package/lib/internal/template/input/styles.selectors.js +28 -28
- package/lib/internal/template/internal/base-component/styles.scoped.css +305 -297
- package/lib/internal/template/internal/components/cartesian-chart/styles.css.js +28 -28
- package/lib/internal/template/internal/components/cartesian-chart/styles.scoped.css +35 -35
- package/lib/internal/template/internal/components/cartesian-chart/styles.selectors.js +28 -28
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/generated/styles/tokens.d.ts +1 -0
- package/lib/internal/template/internal/generated/styles/tokens.js +2 -1
- package/lib/internal/template/internal/generated/theming/index.cjs +46 -15
- package/lib/internal/template/internal/generated/theming/index.js +46 -15
- package/lib/internal/template/multiselect/index.d.ts.map +1 -1
- package/lib/internal/template/multiselect/index.js +4 -0
- package/lib/internal/template/multiselect/index.js.map +1 -1
- package/lib/internal/template/multiselect/interfaces.d.ts +8 -1
- package/lib/internal/template/multiselect/interfaces.d.ts.map +1 -1
- package/lib/internal/template/multiselect/interfaces.js.map +1 -1
- package/lib/internal/template/multiselect/internal.d.ts.map +1 -1
- package/lib/internal/template/multiselect/internal.js +22 -2
- package/lib/internal/template/multiselect/internal.js.map +1 -1
- package/lib/internal/template/multiselect/styles.css.js +5 -3
- package/lib/internal/template/multiselect/styles.scoped.css +13 -3
- package/lib/internal/template/multiselect/styles.selectors.js +5 -3
- package/lib/internal/template/multiselect/use-multiselect.d.ts +3 -2
- package/lib/internal/template/multiselect/use-multiselect.d.ts.map +1 -1
- package/lib/internal/template/multiselect/use-multiselect.js +5 -3
- package/lib/internal/template/multiselect/use-multiselect.js.map +1 -1
- package/lib/internal/template/package.json +94 -0
- package/lib/internal/template/pagination/index.d.ts.map +1 -1
- package/lib/internal/template/pagination/index.js +3 -3
- package/lib/internal/template/pagination/index.js.map +1 -1
- package/lib/internal/template/pagination/interfaces.d.ts +19 -3
- package/lib/internal/template/pagination/interfaces.d.ts.map +1 -1
- package/lib/internal/template/pagination/interfaces.js.map +1 -1
- package/lib/internal/template/pagination/internal.d.ts.map +1 -1
- package/lib/internal/template/pagination/internal.js +18 -6
- package/lib/internal/template/pagination/internal.js.map +1 -1
- package/lib/internal/template/pagination/styles.css.js +12 -11
- package/lib/internal/template/pagination/styles.scoped.css +34 -25
- package/lib/internal/template/pagination/styles.selectors.js +12 -11
- package/lib/internal/template/pagination/test-classes/styles.css.js +6 -0
- package/lib/internal/template/pagination/test-classes/styles.scoped.css +7 -0
- package/lib/internal/template/pagination/test-classes/styles.selectors.js +7 -0
- package/lib/internal/template/prompt-input/internal.d.ts.map +1 -1
- package/lib/internal/template/prompt-input/internal.js +14 -2
- package/lib/internal/template/prompt-input/internal.js.map +1 -1
- package/lib/internal/template/select/index.d.ts.map +1 -1
- package/lib/internal/template/select/index.js +4 -0
- package/lib/internal/template/select/index.js.map +1 -1
- package/lib/internal/template/select/interfaces.d.ts +39 -0
- package/lib/internal/template/select/interfaces.d.ts.map +1 -1
- package/lib/internal/template/select/interfaces.js.map +1 -1
- package/lib/internal/template/select/internal.d.ts.map +1 -1
- package/lib/internal/template/select/internal.js +20 -4
- package/lib/internal/template/select/internal.js.map +1 -1
- package/lib/internal/template/select/styles.css.js +3 -1
- package/lib/internal/template/select/styles.scoped.css +11 -1
- package/lib/internal/template/select/styles.selectors.js +3 -1
- package/lib/internal/template/select/utils/dropdown-customization.d.ts +20 -0
- package/lib/internal/template/select/utils/dropdown-customization.d.ts.map +1 -0
- package/lib/internal/template/select/utils/dropdown-customization.js +22 -0
- package/lib/internal/template/select/utils/dropdown-customization.js.map +1 -0
- package/lib/internal/template/select/utils/use-select.d.ts +4 -1
- package/lib/internal/template/select/utils/use-select.d.ts.map +1 -1
- package/lib/internal/template/select/utils/use-select.js +21 -4
- package/lib/internal/template/select/utils/use-select.js.map +1 -1
- package/lib/internal/template/side-navigation/parts.d.ts.map +1 -1
- package/lib/internal/template/side-navigation/parts.js +3 -2
- package/lib/internal/template/side-navigation/parts.js.map +1 -1
- package/lib/internal/template/side-navigation/styles.css.js +50 -48
- package/lib/internal/template/side-navigation/styles.scoped.css +106 -93
- package/lib/internal/template/side-navigation/styles.selectors.js +50 -48
- package/lib/internal/template/skeleton/styles.css.js +15 -15
- package/lib/internal/template/skeleton/styles.scoped.css +26 -26
- package/lib/internal/template/skeleton/styles.selectors.js +15 -15
- package/lib/internal/template/test-utils/dom/multiselect/index.d.ts +16 -0
- package/lib/internal/template/test-utils/dom/multiselect/index.js +16 -0
- package/lib/internal/template/test-utils/dom/multiselect/index.js.map +1 -1
- package/lib/internal/template/test-utils/dom/pagination/index.d.ts +5 -1
- package/lib/internal/template/test-utils/dom/pagination/index.js +7 -0
- package/lib/internal/template/test-utils/dom/pagination/index.js.map +1 -1
- package/lib/internal/template/test-utils/dom/select/index.d.ts +16 -0
- package/lib/internal/template/test-utils/dom/select/index.js +16 -0
- package/lib/internal/template/test-utils/dom/select/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/multiselect/index.d.ts +16 -0
- package/lib/internal/template/test-utils/selectors/multiselect/index.js +20 -0
- package/lib/internal/template/test-utils/selectors/multiselect/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/pagination/index.d.ts +5 -1
- package/lib/internal/template/test-utils/selectors/pagination/index.js +7 -0
- package/lib/internal/template/test-utils/selectors/pagination/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/select/index.d.ts +16 -0
- package/lib/internal/template/test-utils/selectors/select/index.js +20 -0
- package/lib/internal/template/test-utils/selectors/select/index.js.map +1 -1
- package/lib/internal/template/textarea/index.d.ts.map +1 -1
- package/lib/internal/template/textarea/index.js +11 -3
- package/lib/internal/template/textarea/index.js.map +1 -1
- package/lib/internal/template/textarea/interfaces.d.ts +12 -0
- package/lib/internal/template/textarea/interfaces.d.ts.map +1 -1
- package/lib/internal/template/textarea/interfaces.js.map +1 -1
- package/lib/internal/template/textarea/styles.css.js +9 -5
- package/lib/internal/template/textarea/styles.scoped.css +26 -14
- package/lib/internal/template/textarea/styles.selectors.js +9 -5
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-multiselect.js","sourceRoot":"","sources":["../../../src/multiselect/use-multiselect.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,Q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,CAAC,OAAO,EAAE,CAAC;YACtB,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,MAAM;QACN,YAAY;QACZ,cAAc;QACd,cAAc;QACd,eAAe,EAAE,cAAc;QAC/B,aAAa;QACb,aAAa;QACb,cAAc;QACd,eAAe;QACf,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC;YACnB,GAAG,YAAY,EAAE;YACjB,UAAU,EAAE,cAAc;YAC1B,cAAc,EAAE,WAAW,CAAC,WAAW,EAAE,SAAS,CAAC;YACnD,eAAe,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;YAC9D,QAAQ;SACT,CAAC;QACF,cAAc;QACd,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;QACpD,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,gBAAgB,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;QACrF,eAAe,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;QACxD,gBAAgB;KACjB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useInternalI18n } from '../i18n/context';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport { DropdownOption } from '../internal/components/option/interfaces';\nimport { isGroup } from '../internal/components/option/utils/filter-options';\nimport { prepareOptions } from '../internal/components/option/utils/prepare-options';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { SomeRequired } from '../internal/types';\nimport { joinStrings } from '../internal/utils/strings';\nimport { SelectListProps } from '../select/parts/plain-list';\nimport { checkOptionValueField } from '../select/utils/check-option-value-field.js';\nimport { findOptionIndex } from '../select/utils/connect-options';\nimport { useAnnouncement } from '../select/utils/use-announcement';\nimport { useLoadItems } from '../select/utils/use-load-items';\nimport { useNativeSearch } from '../select/utils/use-native-search';\nimport { useSelect } from '../select/utils/use-select';\nimport { TokenGroupProps } from '../token-group/interfaces';\nimport { DropdownStatusProps } from '../types/dropdown-status';\nimport { OptionDefinition, OptionGroup } from '../types/option';\nimport { MultiselectProps } from './interfaces';\n\ntype UseMultiselectOptions = SomeRequired<\n Pick<\n MultiselectProps,\n | 'options'\n | 'selectedOptions'\n | 'filteringType'\n | 'filteringResultsText'\n | 'disabled'\n | 'noMatch'\n | 'renderHighlightedAriaLive'\n | 'deselectAriaLabel'\n | 'keepOpen'\n | 'onBlur'\n | 'onFocus'\n | 'onLoadItems'\n | 'onChange'\n | 'selectedAriaLabel'\n | 'enableSelectAll'\n | 'i18nStrings'\n > &\n DropdownStatusProps & {\n controlId?: string;\n ariaLabelId: string;\n footerId: string;\n filteringValue: string;\n setFilteringValue?: (value: string) => void;\n externalRef: React.Ref<MultiselectProps.Ref>;\n },\n 'options' | 'selectedOptions' | 'filteringType' | 'statusType' | 'keepOpen'\n> & { embedded?: boolean };\n\nexport function useMultiselect({\n options,\n filteringType,\n filteringResultsText,\n disabled,\n statusType,\n empty,\n loadingText,\n finishedText,\n errorText,\n noMatch,\n renderHighlightedAriaLive,\n selectedOptions,\n deselectAriaLabel,\n keepOpen,\n onBlur,\n onFocus,\n onLoadItems,\n onChange,\n controlId,\n ariaLabelId,\n footerId,\n filteringValue,\n setFilteringValue,\n externalRef,\n embedded,\n enableSelectAll,\n i18nStrings,\n ...restProps\n}: UseMultiselectOptions) {\n checkOptionValueField('Multiselect', 'options', options);\n\n const i18n = useInternalI18n('multiselect');\n const i18nCommon = useInternalI18n('select');\n const recoveryText = i18nCommon('recoveryText', restProps.recoveryText);\n const errorIconAriaLabel = i18nCommon('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18nCommon('selectedAriaLabel', restProps.selectedAriaLabel);\n\n if (restProps.recoveryText && !onLoadItems) {\n warnOnce('Multiselect', '`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 const useInteractiveGroups = true;\n const { flatOptions, filteredOptions, parentMap, totalCount, matchesCount } = prepareOptions(\n options,\n filteringType,\n filteringValue\n );\n\n const selectAllOption: DropdownOption = {\n type: 'select-all',\n afterHeader: filteringType !== 'none',\n option: { label: i18n('i18nStrings.selectAllText', i18nStrings?.selectAllText) },\n };\n\n const visibleOptions =\n enableSelectAll && filteredOptions.length ? [selectAllOption, ...filteredOptions] : filteredOptions;\n\n // Includes visible and non-visible (filtered out) options\n const allNonParentOptions = flatOptions.filter(item => item.type !== 'parent').map(option => option.option);\n\n const filteredNonParentOptions = filteredOptions.filter(item => item.type !== 'parent').map(item => item.option);\n\n const selectedValues = useMemo(() => new Set(selectedOptions.map(option => option.value)), [selectedOptions]);\n\n const isSomeSelected = selectedOptions.length > 0;\n const isAllVisibleSelectableSelected =\n isSomeSelected && filteredNonParentOptions.every(option => option.disabled || selectedValues.has(option.value));\n const isAllSelected = allNonParentOptions.every(option => selectedValues.has(option.value));\n\n const toggleAll = () => {\n const filteredNonParentOptionValues = new Set(filteredNonParentOptions.map(option => option.value));\n fireNonCancelableEvent(onChange, {\n selectedOptions: isAllVisibleSelectableSelected\n ? selectedOptions.filter(option => !filteredNonParentOptionValues.has(option.value))\n : allNonParentOptions.filter(\n ({ disabled, value }) =>\n selectedValues.has(value) || (!disabled && filteredNonParentOptionValues.has(value))\n ),\n });\n };\n\n const updateSelectedOption = useCallback(\n (option: OptionDefinition | OptionGroup) => {\n // switch between selection and deselection behavior, ignores disabled options to prevent\n // getting stuck on one behavior when an option is disabled and its state cannot be changed\n const isAllChildrenSelected = (optionsArray: OptionDefinition[]) =>\n optionsArray.every(item => findOptionIndex(selectedOptions, item) > -1 || item.disabled);\n const intersection = (visibleOptions: OptionDefinition[], options: OptionDefinition[]) =>\n visibleOptions.filter(item => findOptionIndex(options, item) > -1 && !item.disabled);\n const union = (visibleOptions: OptionDefinition[], options: OptionDefinition[]) =>\n visibleOptions.filter(item => findOptionIndex(options, item) === -1).concat(options);\n const select = (options: OptionDefinition[], selectedOptions: OptionDefinition[]) => {\n return union(selectedOptions, options);\n };\n const unselect = (options: OptionDefinition[], selectedOptions: OptionDefinition[]) => {\n return selectedOptions.filter(option => findOptionIndex(options, option) === -1);\n };\n let newSelectedOptions = [...selectedOptions];\n\n if (isGroup(option)) {\n const visibleOptions = intersection([...option.options], filteredNonParentOptions);\n newSelectedOptions = isAllChildrenSelected(visibleOptions)\n ? unselect(visibleOptions, newSelectedOptions)\n : select(visibleOptions, newSelectedOptions);\n } else {\n newSelectedOptions = isAllChildrenSelected([option])\n ? unselect([option], newSelectedOptions)\n : select([option], newSelectedOptions);\n }\n\n fireNonCancelableEvent(onChange, {\n selectedOptions: newSelectedOptions,\n });\n },\n [selectedOptions, onChange, filteredNonParentOptions]\n );\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 announceSelected,\n focusActiveRef,\n } = useSelect({\n selectedOptions,\n updateSelectedOption,\n options: visibleOptions,\n filteringType,\n onFocus,\n onBlur,\n externalRef,\n keepOpen,\n fireLoadItems,\n setFilteringValue,\n useInteractiveGroups,\n statusType,\n embedded,\n isAllSelected,\n isSomeSelected,\n toggleAll,\n });\n\n const wrapperOnKeyDown = useNativeSearch({\n isEnabled: filteringType === 'none' && isOpen,\n options: visibleOptions,\n highlightOption: highlightOption,\n highlightedOption: highlightedOption?.option,\n useInteractiveGroups,\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 const dropdownStatus = useDropdownStatus({\n statusType,\n empty,\n loadingText,\n finishedText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n noMatch,\n filteringResultsText: filteredText,\n onRecoveryClick: () => {\n handleRecoveryClick();\n focusActiveRef();\n },\n errorIconAriaLabel: errorIconAriaLabel,\n hasRecoveryCallback: !!onLoadItems,\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 tokens: TokenGroupProps['items'] = selectedOptions.map(option => ({\n label: option.label,\n disabled: disabled || option.disabled,\n labelTag: option.labelTag,\n description: option.description,\n iconAlt: option.iconAlt,\n iconName: option.iconName,\n iconUrl: option.iconUrl,\n iconSvg: option.iconSvg,\n tags: option.tags,\n dismissLabel: i18n('deselectAriaLabel', deselectAriaLabel?.(option), format =>\n format({ option__label: option.label ?? '' })\n ),\n }));\n\n useEffect(() => {\n scrollToIndex.current?.(highlightedIndex);\n }, [highlightedIndex]);\n\n const dropdownOnMouseDown = (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 tokenOnDismiss: TokenGroupProps['onDismiss'] = ({ detail }) => {\n const optionToDeselect = selectedOptions[detail.itemIndex];\n updateSelectedOption(optionToDeselect);\n const targetRef = getTriggerProps().ref;\n if (targetRef.current) {\n targetRef.current.focus();\n }\n };\n\n return {\n isOpen,\n tokens,\n announcement,\n dropdownStatus,\n filteringValue,\n filteredOptions: visibleOptions,\n highlightType,\n scrollToIndex,\n getFilterProps,\n getTriggerProps,\n getMenuProps: () => ({\n ...getMenuProps(),\n onLoadMore: handleLoadMore,\n ariaLabelledby: joinStrings(ariaLabelId, controlId),\n ariaDescribedby: dropdownStatus.content ? footerId : undefined,\n embedded,\n }),\n getOptionProps,\n getTokenProps: () => ({ onDismiss: tokenOnDismiss }),\n getDropdownProps: () => ({ ...getDropdownProps(), onMouseDown: dropdownOnMouseDown }),\n getWrapperProps: () => ({ onKeyDown: wrapperOnKeyDown }),\n highlightedIndex,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"use-multiselect.js","sourceRoot":"","sources":["../../../src/multiselect/use-multiselect.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE3E,OAAO,EAAE,OAAO,EAAE,MAAM,oDAAoD,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAuCvD,MAAM,UAAU,cAAc,CAAC,EAC7B,OAAO,EACP,aAAa,EACb,oBAAoB,EACpB,QAAQ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AAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;QACrF,eAAe,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;QACxD,gBAAgB;QAChB,aAAa;KACd,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useInternalI18n } from '../i18n/context';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport { DropdownOption } from '../internal/components/option/interfaces';\nimport { isGroup } from '../internal/components/option/utils/filter-options';\nimport { prepareOptions } from '../internal/components/option/utils/prepare-options';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { SomeRequired } from '../internal/types';\nimport { joinStrings } from '../internal/utils/strings';\nimport { SelectListProps } from '../select/parts/plain-list';\nimport { checkOptionValueField } from '../select/utils/check-option-value-field.js';\nimport { findOptionIndex } from '../select/utils/connect-options';\nimport { useAnnouncement } from '../select/utils/use-announcement';\nimport { useLoadItems } from '../select/utils/use-load-items';\nimport { useNativeSearch } from '../select/utils/use-native-search';\nimport { useSelect } from '../select/utils/use-select';\nimport { TokenGroupProps } from '../token-group/interfaces';\nimport { DropdownStatusProps } from '../types/dropdown-status';\nimport { OptionDefinition, OptionGroup } from '../types/option';\nimport { MultiselectProps } from './interfaces';\n\ntype UseMultiselectOptions = SomeRequired<\n Pick<\n MultiselectProps,\n | 'options'\n | 'selectedOptions'\n | 'filteringType'\n | 'filteringResultsText'\n | 'disabled'\n | 'noMatch'\n | 'renderHighlightedAriaLive'\n | 'deselectAriaLabel'\n | 'keepOpen'\n | 'onBlur'\n | 'onFocus'\n | 'onLoadItems'\n | 'onChange'\n | 'selectedAriaLabel'\n | 'enableSelectAll'\n | 'i18nStrings'\n | 'dropdownRole'\n | 'dropdownAriaDescribedby'\n > &\n DropdownStatusProps & {\n controlId?: string;\n ariaLabelId: string;\n footerId: string;\n filteringValue: string;\n setFilteringValue?: (value: string) => void;\n externalRef: React.Ref<MultiselectProps.Ref>;\n },\n 'options' | 'selectedOptions' | 'filteringType' | 'statusType' | 'keepOpen'\n> & { embedded?: boolean };\n\nexport function useMultiselect({\n options,\n filteringType,\n filteringResultsText,\n disabled,\n statusType,\n empty,\n loadingText,\n finishedText,\n errorText,\n noMatch,\n renderHighlightedAriaLive,\n selectedOptions,\n deselectAriaLabel,\n keepOpen,\n onBlur,\n onFocus,\n onLoadItems,\n onChange,\n controlId,\n ariaLabelId,\n footerId,\n filteringValue,\n setFilteringValue,\n externalRef,\n embedded,\n enableSelectAll,\n i18nStrings,\n dropdownRole,\n dropdownAriaDescribedby,\n ...restProps\n}: UseMultiselectOptions) {\n checkOptionValueField('Multiselect', 'options', options);\n\n const i18n = useInternalI18n('multiselect');\n const i18nCommon = useInternalI18n('select');\n const recoveryText = i18nCommon('recoveryText', restProps.recoveryText);\n const errorIconAriaLabel = i18nCommon('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18nCommon('selectedAriaLabel', restProps.selectedAriaLabel);\n\n if (restProps.recoveryText && !onLoadItems) {\n warnOnce('Multiselect', '`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 const useInteractiveGroups = true;\n const { flatOptions, filteredOptions, parentMap, totalCount, matchesCount } = prepareOptions(\n options,\n filteringType,\n filteringValue\n );\n\n const selectAllOption: DropdownOption = {\n type: 'select-all',\n afterHeader: filteringType !== 'none',\n option: { label: i18n('i18nStrings.selectAllText', i18nStrings?.selectAllText) },\n };\n\n const visibleOptions =\n enableSelectAll && filteredOptions.length ? [selectAllOption, ...filteredOptions] : filteredOptions;\n\n // Includes visible and non-visible (filtered out) options\n const allNonParentOptions = flatOptions.filter(item => item.type !== 'parent').map(option => option.option);\n\n const filteredNonParentOptions = filteredOptions.filter(item => item.type !== 'parent').map(item => item.option);\n\n const selectedValues = useMemo(() => new Set(selectedOptions.map(option => option.value)), [selectedOptions]);\n\n const isSomeSelected = selectedOptions.length > 0;\n const isAllVisibleSelectableSelected =\n isSomeSelected && filteredNonParentOptions.every(option => option.disabled || selectedValues.has(option.value));\n const isAllSelected = allNonParentOptions.every(option => selectedValues.has(option.value));\n\n const toggleAll = () => {\n const filteredNonParentOptionValues = new Set(filteredNonParentOptions.map(option => option.value));\n fireNonCancelableEvent(onChange, {\n selectedOptions: isAllVisibleSelectableSelected\n ? selectedOptions.filter(option => !filteredNonParentOptionValues.has(option.value))\n : allNonParentOptions.filter(\n ({ disabled, value }) =>\n selectedValues.has(value) || (!disabled && filteredNonParentOptionValues.has(value))\n ),\n });\n };\n\n const updateSelectedOption = useCallback(\n (option: OptionDefinition | OptionGroup) => {\n // switch between selection and deselection behavior, ignores disabled options to prevent\n // getting stuck on one behavior when an option is disabled and its state cannot be changed\n const isAllChildrenSelected = (optionsArray: OptionDefinition[]) =>\n optionsArray.every(item => findOptionIndex(selectedOptions, item) > -1 || item.disabled);\n const intersection = (visibleOptions: OptionDefinition[], options: OptionDefinition[]) =>\n visibleOptions.filter(item => findOptionIndex(options, item) > -1 && !item.disabled);\n const union = (visibleOptions: OptionDefinition[], options: OptionDefinition[]) =>\n visibleOptions.filter(item => findOptionIndex(options, item) === -1).concat(options);\n const select = (options: OptionDefinition[], selectedOptions: OptionDefinition[]) => {\n return union(selectedOptions, options);\n };\n const unselect = (options: OptionDefinition[], selectedOptions: OptionDefinition[]) => {\n return selectedOptions.filter(option => findOptionIndex(options, option) === -1);\n };\n let newSelectedOptions = [...selectedOptions];\n\n if (isGroup(option)) {\n const visibleOptions = intersection([...option.options], filteredNonParentOptions);\n newSelectedOptions = isAllChildrenSelected(visibleOptions)\n ? unselect(visibleOptions, newSelectedOptions)\n : select(visibleOptions, newSelectedOptions);\n } else {\n newSelectedOptions = isAllChildrenSelected([option])\n ? unselect([option], newSelectedOptions)\n : select([option], newSelectedOptions);\n }\n\n fireNonCancelableEvent(onChange, {\n selectedOptions: newSelectedOptions,\n });\n },\n [selectedOptions, onChange, filteredNonParentOptions]\n );\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 announceSelected,\n focusActiveRef,\n closeDropdown,\n } = useSelect({\n selectedOptions,\n updateSelectedOption,\n options: visibleOptions,\n filteringType,\n onFocus,\n onBlur,\n externalRef,\n keepOpen,\n fireLoadItems,\n setFilteringValue,\n useInteractiveGroups,\n statusType,\n embedded,\n isAllSelected,\n isSomeSelected,\n toggleAll,\n dropdownRole,\n });\n\n const wrapperOnKeyDown = useNativeSearch({\n isEnabled: filteringType === 'none' && isOpen,\n options: visibleOptions,\n highlightOption: highlightOption,\n highlightedOption: highlightedOption?.option,\n useInteractiveGroups,\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 const dropdownStatus = useDropdownStatus({\n statusType,\n empty,\n loadingText,\n finishedText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n noMatch,\n filteringResultsText: filteredText,\n onRecoveryClick: () => {\n handleRecoveryClick();\n focusActiveRef();\n },\n errorIconAriaLabel: errorIconAriaLabel,\n hasRecoveryCallback: !!onLoadItems,\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 tokens: TokenGroupProps['items'] = selectedOptions.map(option => ({\n label: option.label,\n disabled: disabled || option.disabled,\n labelTag: option.labelTag,\n description: option.description,\n iconAlt: option.iconAlt,\n iconName: option.iconName,\n iconUrl: option.iconUrl,\n iconSvg: option.iconSvg,\n tags: option.tags,\n dismissLabel: i18n('deselectAriaLabel', deselectAriaLabel?.(option), format =>\n format({ option__label: option.label ?? '' })\n ),\n }));\n\n useEffect(() => {\n scrollToIndex.current?.(highlightedIndex);\n }, [highlightedIndex]);\n\n const dropdownOnMouseDown = (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 tokenOnDismiss: TokenGroupProps['onDismiss'] = ({ detail }) => {\n const optionToDeselect = selectedOptions[detail.itemIndex];\n updateSelectedOption(optionToDeselect);\n const targetRef = getTriggerProps().ref;\n if (targetRef.current) {\n targetRef.current.focus();\n }\n };\n\n return {\n isOpen,\n tokens,\n announcement,\n dropdownStatus,\n filteringValue,\n filteredOptions: visibleOptions,\n highlightType,\n scrollToIndex,\n getFilterProps,\n getTriggerProps,\n getMenuProps: () => ({\n ...getMenuProps(),\n onLoadMore: handleLoadMore,\n ariaLabelledby: joinStrings(ariaLabelId, controlId),\n ariaDescribedby: joinStrings(dropdownStatus.content ? footerId : undefined, dropdownAriaDescribedby),\n embedded,\n }),\n getOptionProps,\n getTokenProps: () => ({ onDismiss: tokenOnDismiss }),\n getDropdownProps: () => ({ ...getDropdownProps(), onMouseDown: dropdownOnMouseDown }),\n getWrapperProps: () => ({ onKeyDown: wrapperOnKeyDown }),\n highlightedIndex,\n closeDropdown,\n };\n}\n"]}
|
|
@@ -128,99 +128,193 @@
|
|
|
128
128
|
"./tutorial-panel": "./tutorial-panel/index.js",
|
|
129
129
|
"./wizard": "./wizard/index.js",
|
|
130
130
|
"./test-utils/dom/action-card": "./test-utils/dom/action-card/index.js",
|
|
131
|
+
"./test-utils/selectors/action-card": "./test-utils/selectors/action-card/index.js",
|
|
131
132
|
"./test-utils/dom/alert": "./test-utils/dom/alert/index.js",
|
|
133
|
+
"./test-utils/selectors/alert": "./test-utils/selectors/alert/index.js",
|
|
132
134
|
"./test-utils/dom/anchor-navigation": "./test-utils/dom/anchor-navigation/index.js",
|
|
135
|
+
"./test-utils/selectors/anchor-navigation": "./test-utils/selectors/anchor-navigation/index.js",
|
|
133
136
|
"./test-utils/dom/annotation": "./test-utils/dom/annotation/index.js",
|
|
137
|
+
"./test-utils/selectors/annotation": "./test-utils/selectors/annotation/index.js",
|
|
134
138
|
"./test-utils/dom/app-layout": "./test-utils/dom/app-layout/index.js",
|
|
139
|
+
"./test-utils/selectors/app-layout": "./test-utils/selectors/app-layout/index.js",
|
|
135
140
|
"./test-utils/dom/app-layout-toolbar": "./test-utils/dom/app-layout-toolbar/index.js",
|
|
141
|
+
"./test-utils/selectors/app-layout-toolbar": "./test-utils/selectors/app-layout-toolbar/index.js",
|
|
136
142
|
"./test-utils/dom/area-chart": "./test-utils/dom/area-chart/index.js",
|
|
143
|
+
"./test-utils/selectors/area-chart": "./test-utils/selectors/area-chart/index.js",
|
|
137
144
|
"./test-utils/dom/attribute-editor": "./test-utils/dom/attribute-editor/index.js",
|
|
145
|
+
"./test-utils/selectors/attribute-editor": "./test-utils/selectors/attribute-editor/index.js",
|
|
138
146
|
"./test-utils/dom/autosuggest": "./test-utils/dom/autosuggest/index.js",
|
|
147
|
+
"./test-utils/selectors/autosuggest": "./test-utils/selectors/autosuggest/index.js",
|
|
139
148
|
"./test-utils/dom/badge": "./test-utils/dom/badge/index.js",
|
|
149
|
+
"./test-utils/selectors/badge": "./test-utils/selectors/badge/index.js",
|
|
140
150
|
"./test-utils/dom/bar-chart": "./test-utils/dom/bar-chart/index.js",
|
|
151
|
+
"./test-utils/selectors/bar-chart": "./test-utils/selectors/bar-chart/index.js",
|
|
141
152
|
"./test-utils/dom/box": "./test-utils/dom/box/index.js",
|
|
153
|
+
"./test-utils/selectors/box": "./test-utils/selectors/box/index.js",
|
|
142
154
|
"./test-utils/dom/breadcrumb-group": "./test-utils/dom/breadcrumb-group/index.js",
|
|
155
|
+
"./test-utils/selectors/breadcrumb-group": "./test-utils/selectors/breadcrumb-group/index.js",
|
|
143
156
|
"./test-utils/dom/button": "./test-utils/dom/button/index.js",
|
|
157
|
+
"./test-utils/selectors/button": "./test-utils/selectors/button/index.js",
|
|
144
158
|
"./test-utils/dom/button-dropdown": "./test-utils/dom/button-dropdown/index.js",
|
|
159
|
+
"./test-utils/selectors/button-dropdown": "./test-utils/selectors/button-dropdown/index.js",
|
|
145
160
|
"./test-utils/dom/button-group": "./test-utils/dom/button-group/index.js",
|
|
161
|
+
"./test-utils/selectors/button-group": "./test-utils/selectors/button-group/index.js",
|
|
146
162
|
"./test-utils/dom/calendar": "./test-utils/dom/calendar/index.js",
|
|
163
|
+
"./test-utils/selectors/calendar": "./test-utils/selectors/calendar/index.js",
|
|
147
164
|
"./test-utils/dom/cards": "./test-utils/dom/cards/index.js",
|
|
165
|
+
"./test-utils/selectors/cards": "./test-utils/selectors/cards/index.js",
|
|
148
166
|
"./test-utils/dom/checkbox": "./test-utils/dom/checkbox/index.js",
|
|
167
|
+
"./test-utils/selectors/checkbox": "./test-utils/selectors/checkbox/index.js",
|
|
149
168
|
"./test-utils/dom/code-editor": "./test-utils/dom/code-editor/index.js",
|
|
169
|
+
"./test-utils/selectors/code-editor": "./test-utils/selectors/code-editor/index.js",
|
|
150
170
|
"./test-utils/dom/collection-preferences": "./test-utils/dom/collection-preferences/index.js",
|
|
171
|
+
"./test-utils/selectors/collection-preferences": "./test-utils/selectors/collection-preferences/index.js",
|
|
151
172
|
"./test-utils/dom/column-layout": "./test-utils/dom/column-layout/index.js",
|
|
173
|
+
"./test-utils/selectors/column-layout": "./test-utils/selectors/column-layout/index.js",
|
|
152
174
|
"./test-utils/dom/container": "./test-utils/dom/container/index.js",
|
|
175
|
+
"./test-utils/selectors/container": "./test-utils/selectors/container/index.js",
|
|
153
176
|
"./test-utils/dom/content-layout": "./test-utils/dom/content-layout/index.js",
|
|
177
|
+
"./test-utils/selectors/content-layout": "./test-utils/selectors/content-layout/index.js",
|
|
154
178
|
"./test-utils/dom/copy-to-clipboard": "./test-utils/dom/copy-to-clipboard/index.js",
|
|
179
|
+
"./test-utils/selectors/copy-to-clipboard": "./test-utils/selectors/copy-to-clipboard/index.js",
|
|
155
180
|
"./test-utils/dom/date-input": "./test-utils/dom/date-input/index.js",
|
|
181
|
+
"./test-utils/selectors/date-input": "./test-utils/selectors/date-input/index.js",
|
|
156
182
|
"./test-utils/dom/date-picker": "./test-utils/dom/date-picker/index.js",
|
|
183
|
+
"./test-utils/selectors/date-picker": "./test-utils/selectors/date-picker/index.js",
|
|
157
184
|
"./test-utils/dom/date-range-picker": "./test-utils/dom/date-range-picker/index.js",
|
|
185
|
+
"./test-utils/selectors/date-range-picker": "./test-utils/selectors/date-range-picker/index.js",
|
|
158
186
|
"./test-utils/dom/divider": "./test-utils/dom/divider/index.js",
|
|
187
|
+
"./test-utils/selectors/divider": "./test-utils/selectors/divider/index.js",
|
|
159
188
|
"./test-utils/dom/drawer": "./test-utils/dom/drawer/index.js",
|
|
189
|
+
"./test-utils/selectors/drawer": "./test-utils/selectors/drawer/index.js",
|
|
160
190
|
"./test-utils/dom/dropdown": "./test-utils/dom/dropdown/index.js",
|
|
191
|
+
"./test-utils/selectors/dropdown": "./test-utils/selectors/dropdown/index.js",
|
|
161
192
|
"./test-utils/dom/error-boundary": "./test-utils/dom/error-boundary/index.js",
|
|
193
|
+
"./test-utils/selectors/error-boundary": "./test-utils/selectors/error-boundary/index.js",
|
|
162
194
|
"./test-utils/dom/expandable-section": "./test-utils/dom/expandable-section/index.js",
|
|
195
|
+
"./test-utils/selectors/expandable-section": "./test-utils/selectors/expandable-section/index.js",
|
|
163
196
|
"./test-utils/dom/file-dropzone": "./test-utils/dom/file-dropzone/index.js",
|
|
197
|
+
"./test-utils/selectors/file-dropzone": "./test-utils/selectors/file-dropzone/index.js",
|
|
164
198
|
"./test-utils/dom/file-input": "./test-utils/dom/file-input/index.js",
|
|
199
|
+
"./test-utils/selectors/file-input": "./test-utils/selectors/file-input/index.js",
|
|
165
200
|
"./test-utils/dom/file-token-group": "./test-utils/dom/file-token-group/index.js",
|
|
201
|
+
"./test-utils/selectors/file-token-group": "./test-utils/selectors/file-token-group/index.js",
|
|
166
202
|
"./test-utils/dom/file-upload": "./test-utils/dom/file-upload/index.js",
|
|
203
|
+
"./test-utils/selectors/file-upload": "./test-utils/selectors/file-upload/index.js",
|
|
167
204
|
"./test-utils/dom/flashbar": "./test-utils/dom/flashbar/index.js",
|
|
205
|
+
"./test-utils/selectors/flashbar": "./test-utils/selectors/flashbar/index.js",
|
|
168
206
|
"./test-utils/dom/form": "./test-utils/dom/form/index.js",
|
|
207
|
+
"./test-utils/selectors/form": "./test-utils/selectors/form/index.js",
|
|
169
208
|
"./test-utils/dom/form-field": "./test-utils/dom/form-field/index.js",
|
|
209
|
+
"./test-utils/selectors/form-field": "./test-utils/selectors/form-field/index.js",
|
|
170
210
|
"./test-utils/dom/grid": "./test-utils/dom/grid/index.js",
|
|
211
|
+
"./test-utils/selectors/grid": "./test-utils/selectors/grid/index.js",
|
|
171
212
|
"./test-utils/dom/header": "./test-utils/dom/header/index.js",
|
|
213
|
+
"./test-utils/selectors/header": "./test-utils/selectors/header/index.js",
|
|
172
214
|
"./test-utils/dom/help-panel": "./test-utils/dom/help-panel/index.js",
|
|
215
|
+
"./test-utils/selectors/help-panel": "./test-utils/selectors/help-panel/index.js",
|
|
173
216
|
"./test-utils/dom/hotspot": "./test-utils/dom/hotspot/index.js",
|
|
217
|
+
"./test-utils/selectors/hotspot": "./test-utils/selectors/hotspot/index.js",
|
|
174
218
|
"./test-utils/dom/icon": "./test-utils/dom/icon/index.js",
|
|
219
|
+
"./test-utils/selectors/icon": "./test-utils/selectors/icon/index.js",
|
|
175
220
|
"./test-utils/dom/input": "./test-utils/dom/input/index.js",
|
|
221
|
+
"./test-utils/selectors/input": "./test-utils/selectors/input/index.js",
|
|
176
222
|
"./test-utils/dom/item-card": "./test-utils/dom/item-card/index.js",
|
|
223
|
+
"./test-utils/selectors/item-card": "./test-utils/selectors/item-card/index.js",
|
|
177
224
|
"./test-utils/dom/key-value-pairs": "./test-utils/dom/key-value-pairs/index.js",
|
|
225
|
+
"./test-utils/selectors/key-value-pairs": "./test-utils/selectors/key-value-pairs/index.js",
|
|
178
226
|
"./test-utils/dom/line-chart": "./test-utils/dom/line-chart/index.js",
|
|
227
|
+
"./test-utils/selectors/line-chart": "./test-utils/selectors/line-chart/index.js",
|
|
179
228
|
"./test-utils/dom/link": "./test-utils/dom/link/index.js",
|
|
229
|
+
"./test-utils/selectors/link": "./test-utils/selectors/link/index.js",
|
|
180
230
|
"./test-utils/dom/list": "./test-utils/dom/list/index.js",
|
|
231
|
+
"./test-utils/selectors/list": "./test-utils/selectors/list/index.js",
|
|
181
232
|
"./test-utils/dom/live-region": "./test-utils/dom/live-region/index.js",
|
|
233
|
+
"./test-utils/selectors/live-region": "./test-utils/selectors/live-region/index.js",
|
|
182
234
|
"./test-utils/dom/mixed-line-bar-chart": "./test-utils/dom/mixed-line-bar-chart/index.js",
|
|
235
|
+
"./test-utils/selectors/mixed-line-bar-chart": "./test-utils/selectors/mixed-line-bar-chart/index.js",
|
|
183
236
|
"./test-utils/dom/modal": "./test-utils/dom/modal/index.js",
|
|
237
|
+
"./test-utils/selectors/modal": "./test-utils/selectors/modal/index.js",
|
|
184
238
|
"./test-utils/dom/multiselect": "./test-utils/dom/multiselect/index.js",
|
|
239
|
+
"./test-utils/selectors/multiselect": "./test-utils/selectors/multiselect/index.js",
|
|
185
240
|
"./test-utils/dom/navigable-group": "./test-utils/dom/navigable-group/index.js",
|
|
241
|
+
"./test-utils/selectors/navigable-group": "./test-utils/selectors/navigable-group/index.js",
|
|
186
242
|
"./test-utils/dom/pagination": "./test-utils/dom/pagination/index.js",
|
|
243
|
+
"./test-utils/selectors/pagination": "./test-utils/selectors/pagination/index.js",
|
|
187
244
|
"./test-utils/dom/panel-layout": "./test-utils/dom/panel-layout/index.js",
|
|
245
|
+
"./test-utils/selectors/panel-layout": "./test-utils/selectors/panel-layout/index.js",
|
|
188
246
|
"./test-utils/dom/pie-chart": "./test-utils/dom/pie-chart/index.js",
|
|
247
|
+
"./test-utils/selectors/pie-chart": "./test-utils/selectors/pie-chart/index.js",
|
|
189
248
|
"./test-utils/dom/popover": "./test-utils/dom/popover/index.js",
|
|
249
|
+
"./test-utils/selectors/popover": "./test-utils/selectors/popover/index.js",
|
|
190
250
|
"./test-utils/dom/progress-bar": "./test-utils/dom/progress-bar/index.js",
|
|
251
|
+
"./test-utils/selectors/progress-bar": "./test-utils/selectors/progress-bar/index.js",
|
|
191
252
|
"./test-utils/dom/prompt-input": "./test-utils/dom/prompt-input/index.js",
|
|
253
|
+
"./test-utils/selectors/prompt-input": "./test-utils/selectors/prompt-input/index.js",
|
|
192
254
|
"./test-utils/dom/property-filter": "./test-utils/dom/property-filter/index.js",
|
|
255
|
+
"./test-utils/selectors/property-filter": "./test-utils/selectors/property-filter/index.js",
|
|
193
256
|
"./test-utils/dom/radio-button": "./test-utils/dom/radio-button/index.js",
|
|
257
|
+
"./test-utils/selectors/radio-button": "./test-utils/selectors/radio-button/index.js",
|
|
194
258
|
"./test-utils/dom/radio-group": "./test-utils/dom/radio-group/index.js",
|
|
259
|
+
"./test-utils/selectors/radio-group": "./test-utils/selectors/radio-group/index.js",
|
|
195
260
|
"./test-utils/dom/s3-resource-selector": "./test-utils/dom/s3-resource-selector/index.js",
|
|
261
|
+
"./test-utils/selectors/s3-resource-selector": "./test-utils/selectors/s3-resource-selector/index.js",
|
|
196
262
|
"./test-utils/dom/segmented-control": "./test-utils/dom/segmented-control/index.js",
|
|
263
|
+
"./test-utils/selectors/segmented-control": "./test-utils/selectors/segmented-control/index.js",
|
|
197
264
|
"./test-utils/dom/select": "./test-utils/dom/select/index.js",
|
|
265
|
+
"./test-utils/selectors/select": "./test-utils/selectors/select/index.js",
|
|
198
266
|
"./test-utils/dom/side-navigation": "./test-utils/dom/side-navigation/index.js",
|
|
267
|
+
"./test-utils/selectors/side-navigation": "./test-utils/selectors/side-navigation/index.js",
|
|
199
268
|
"./test-utils/dom/skeleton": "./test-utils/dom/skeleton/index.js",
|
|
269
|
+
"./test-utils/selectors/skeleton": "./test-utils/selectors/skeleton/index.js",
|
|
200
270
|
"./test-utils/dom/slider": "./test-utils/dom/slider/index.js",
|
|
271
|
+
"./test-utils/selectors/slider": "./test-utils/selectors/slider/index.js",
|
|
201
272
|
"./test-utils/dom/space-between": "./test-utils/dom/space-between/index.js",
|
|
273
|
+
"./test-utils/selectors/space-between": "./test-utils/selectors/space-between/index.js",
|
|
202
274
|
"./test-utils/dom/spinner": "./test-utils/dom/spinner/index.js",
|
|
275
|
+
"./test-utils/selectors/spinner": "./test-utils/selectors/spinner/index.js",
|
|
203
276
|
"./test-utils/dom/split-panel": "./test-utils/dom/split-panel/index.js",
|
|
277
|
+
"./test-utils/selectors/split-panel": "./test-utils/selectors/split-panel/index.js",
|
|
204
278
|
"./test-utils/dom/status-indicator": "./test-utils/dom/status-indicator/index.js",
|
|
279
|
+
"./test-utils/selectors/status-indicator": "./test-utils/selectors/status-indicator/index.js",
|
|
205
280
|
"./test-utils/dom/steps": "./test-utils/dom/steps/index.js",
|
|
281
|
+
"./test-utils/selectors/steps": "./test-utils/selectors/steps/index.js",
|
|
206
282
|
"./test-utils/dom/table": "./test-utils/dom/table/index.js",
|
|
283
|
+
"./test-utils/selectors/table": "./test-utils/selectors/table/index.js",
|
|
207
284
|
"./test-utils/dom/tabs": "./test-utils/dom/tabs/index.js",
|
|
285
|
+
"./test-utils/selectors/tabs": "./test-utils/selectors/tabs/index.js",
|
|
208
286
|
"./test-utils/dom/tag-editor": "./test-utils/dom/tag-editor/index.js",
|
|
287
|
+
"./test-utils/selectors/tag-editor": "./test-utils/selectors/tag-editor/index.js",
|
|
209
288
|
"./test-utils/dom/text-content": "./test-utils/dom/text-content/index.js",
|
|
289
|
+
"./test-utils/selectors/text-content": "./test-utils/selectors/text-content/index.js",
|
|
210
290
|
"./test-utils/dom/text-filter": "./test-utils/dom/text-filter/index.js",
|
|
291
|
+
"./test-utils/selectors/text-filter": "./test-utils/selectors/text-filter/index.js",
|
|
211
292
|
"./test-utils/dom/textarea": "./test-utils/dom/textarea/index.js",
|
|
293
|
+
"./test-utils/selectors/textarea": "./test-utils/selectors/textarea/index.js",
|
|
212
294
|
"./test-utils/dom/tiles": "./test-utils/dom/tiles/index.js",
|
|
295
|
+
"./test-utils/selectors/tiles": "./test-utils/selectors/tiles/index.js",
|
|
213
296
|
"./test-utils/dom/time-input": "./test-utils/dom/time-input/index.js",
|
|
297
|
+
"./test-utils/selectors/time-input": "./test-utils/selectors/time-input/index.js",
|
|
214
298
|
"./test-utils/dom/toggle": "./test-utils/dom/toggle/index.js",
|
|
299
|
+
"./test-utils/selectors/toggle": "./test-utils/selectors/toggle/index.js",
|
|
215
300
|
"./test-utils/dom/toggle-button": "./test-utils/dom/toggle-button/index.js",
|
|
301
|
+
"./test-utils/selectors/toggle-button": "./test-utils/selectors/toggle-button/index.js",
|
|
216
302
|
"./test-utils/dom/token": "./test-utils/dom/token/index.js",
|
|
303
|
+
"./test-utils/selectors/token": "./test-utils/selectors/token/index.js",
|
|
217
304
|
"./test-utils/dom/token-group": "./test-utils/dom/token-group/index.js",
|
|
305
|
+
"./test-utils/selectors/token-group": "./test-utils/selectors/token-group/index.js",
|
|
218
306
|
"./test-utils/dom/tooltip": "./test-utils/dom/tooltip/index.js",
|
|
307
|
+
"./test-utils/selectors/tooltip": "./test-utils/selectors/tooltip/index.js",
|
|
219
308
|
"./test-utils/dom/top-navigation": "./test-utils/dom/top-navigation/index.js",
|
|
309
|
+
"./test-utils/selectors/top-navigation": "./test-utils/selectors/top-navigation/index.js",
|
|
220
310
|
"./test-utils/dom/tree-view": "./test-utils/dom/tree-view/index.js",
|
|
311
|
+
"./test-utils/selectors/tree-view": "./test-utils/selectors/tree-view/index.js",
|
|
221
312
|
"./test-utils/dom/truncated-text": "./test-utils/dom/truncated-text/index.js",
|
|
313
|
+
"./test-utils/selectors/truncated-text": "./test-utils/selectors/truncated-text/index.js",
|
|
222
314
|
"./test-utils/dom/tutorial-panel": "./test-utils/dom/tutorial-panel/index.js",
|
|
315
|
+
"./test-utils/selectors/tutorial-panel": "./test-utils/selectors/tutorial-panel/index.js",
|
|
223
316
|
"./test-utils/dom/wizard": "./test-utils/dom/wizard/index.js",
|
|
317
|
+
"./test-utils/selectors/wizard": "./test-utils/selectors/wizard/index.js",
|
|
224
318
|
"./i18n": "./i18n/index.js",
|
|
225
319
|
"./i18n/messages/all.all": "./i18n/messages/all.all.js",
|
|
226
320
|
"./i18n/messages/all.all.json": "./i18n/messages/all.all.json",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pagination/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pagination/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,6FA0Bf,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -6,12 +6,12 @@ import { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-tool
|
|
|
6
6
|
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
7
7
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
8
8
|
import InternalPagination from './internal';
|
|
9
|
-
const Pagination = React.forwardRef((props, ref) => {
|
|
9
|
+
const Pagination = React.forwardRef(({ pagesVariant = 'normal', ...props }, ref) => {
|
|
10
10
|
const baseComponentProps = useBaseComponent('Pagination', {
|
|
11
|
-
props: { openEnd: props.openEnd },
|
|
11
|
+
props: { openEnd: props.openEnd, pagesVariant },
|
|
12
12
|
metadata: { hasJumpToPage: !!props.jumpToPage },
|
|
13
13
|
});
|
|
14
|
-
return (React.createElement(InternalPagination, { ...props, ...baseComponentProps, ref: ref, ...getAnalyticsMetadataAttribute({
|
|
14
|
+
return (React.createElement(InternalPagination, { pagesVariant: pagesVariant, ...props, ...baseComponentProps, ref: ref, ...getAnalyticsMetadataAttribute({
|
|
15
15
|
component: {
|
|
16
16
|
name: 'awsui.Pagination',
|
|
17
17
|
label: { root: 'self' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pagination/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,kBAAkB,MAAM,YAAY,CAAC;AAI5C,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pagination/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,kBAAkB,MAAM,YAAY,CAAC;AAI5C,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CACjC,CAAC,EAAE,YAAY,GAAG,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,YAAY,EAAE;QACxD,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,YAAY,EAAE;QAC/C,QAAQ,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,EAAE;KAChD,CAAC,CAAC;IACH,OAAO,CACL,oBAAC,kBAAkB,IACjB,YAAY,EAAE,YAAY,KACtB,KAAK,KACL,kBAAkB,EACtB,GAAG,EAAE,GAAG,KACJ,6BAA6B,CAAC;YAChC,SAAS,EAAE;gBACT,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;gBACvB,UAAU,EAAE;oBACV,OAAO,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE;oBAC7B,UAAU,EAAE,GAAG,KAAK,CAAC,UAAU,IAAI,EAAE,EAAE;oBACvC,gBAAgB,EAAE,GAAG,KAAK,CAAC,gBAAgB,EAAE;iBAC9C;aAC+C;SACnD,CAAC,GACF,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAE3C,eAAe,UAAU,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { GeneratedAnalyticsMetadataPaginationComponent } from './analytics-metadata/interfaces';\nimport { PaginationProps } from './interfaces';\nimport InternalPagination from './internal';\n\nexport { PaginationProps };\n\nconst Pagination = React.forwardRef<PaginationProps.Ref, PaginationProps>(\n ({ pagesVariant = 'normal', ...props }, ref) => {\n const baseComponentProps = useBaseComponent('Pagination', {\n props: { openEnd: props.openEnd, pagesVariant },\n metadata: { hasJumpToPage: !!props.jumpToPage },\n });\n return (\n <InternalPagination\n pagesVariant={pagesVariant}\n {...props}\n {...baseComponentProps}\n ref={ref}\n {...getAnalyticsMetadataAttribute({\n component: {\n name: 'awsui.Pagination',\n label: { root: 'self' },\n properties: {\n openEnd: `${!!props.openEnd}`,\n pagesCount: `${props.pagesCount || ''}`,\n currentPageIndex: `${props.currentPageIndex}`,\n },\n } as GeneratedAnalyticsMetadataPaginationComponent,\n })}\n />\n );\n }\n);\n\napplyDisplayName(Pagination, 'Pagination');\n\nexport default Pagination;\n"]}
|
|
@@ -16,6 +16,12 @@ export interface PaginationProps {
|
|
|
16
16
|
* `onNextPageClick` handler is called with `requestedPageAvailable: false` in the event detail.
|
|
17
17
|
*/
|
|
18
18
|
openEnd?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Specifies how pages are displayed:
|
|
21
|
+
* * `normal` - Displays page number buttons. For larger page ranges, the displayed range is truncated with ellipses.
|
|
22
|
+
* * `compact` - Displays the current page and page count between the previous and next buttons. When `openEnd` is `true`, a plus sign after the page count indicates that more pages are available.
|
|
23
|
+
*/
|
|
24
|
+
pagesVariant?: PaginationProps.PagesVariant;
|
|
19
25
|
/**
|
|
20
26
|
* If set to `true`, the pagination links will be disabled. Use it, for example, if you want to prevent the user
|
|
21
27
|
* from changing page before items are loaded.
|
|
@@ -42,6 +48,13 @@ export interface PaginationProps {
|
|
|
42
48
|
*/
|
|
43
49
|
ariaLabels?: PaginationProps.Labels;
|
|
44
50
|
/**
|
|
51
|
+
* An object containing all the necessary localized strings required by the component:
|
|
52
|
+
* * `jumpToPageInputLabel` (string) - Accessible label for the jump-to-page number input.
|
|
53
|
+
* * `jumpToPageError` (string) - Error message displayed when the entered page number is invalid.
|
|
54
|
+
* * `jumpToPageLoadingText` (string) - Loading text displayed while the jump-to-page action is in progress.
|
|
55
|
+
* * `pagesCompactText` ((options: { currentPage: number; pagesCount: number; openEnd: boolean }) => string) -
|
|
56
|
+
* Provides the visible text for compact pages, for example `3 of 12`, or `3 of 12+` when `openEnd` is `true`.
|
|
57
|
+
* Receives the current page, page count, and whether pagination is open-ended.
|
|
45
58
|
* @i18n
|
|
46
59
|
*/
|
|
47
60
|
i18nStrings?: PaginationProps.I18nStrings;
|
|
@@ -68,6 +81,7 @@ export interface PaginationProps {
|
|
|
68
81
|
jumpToPage?: PaginationProps.JumpToPageProps;
|
|
69
82
|
}
|
|
70
83
|
export declare namespace PaginationProps {
|
|
84
|
+
type PagesVariant = 'normal' | 'compact';
|
|
71
85
|
interface Labels {
|
|
72
86
|
nextPageLabel?: string;
|
|
73
87
|
paginationLabel?: string;
|
|
@@ -76,12 +90,14 @@ export declare namespace PaginationProps {
|
|
|
76
90
|
jumpToPageButton?: string;
|
|
77
91
|
}
|
|
78
92
|
interface I18nStrings {
|
|
79
|
-
/** @i18n */
|
|
80
93
|
jumpToPageInputLabel?: string;
|
|
81
|
-
/** @i18n */
|
|
82
94
|
jumpToPageError?: string;
|
|
83
|
-
/** @i18n */
|
|
84
95
|
jumpToPageLoadingText?: string;
|
|
96
|
+
pagesCompactText?: (options: {
|
|
97
|
+
currentPage: number;
|
|
98
|
+
pagesCount: number;
|
|
99
|
+
openEnd: boolean;
|
|
100
|
+
}) => string;
|
|
85
101
|
}
|
|
86
102
|
interface ChangeDetail {
|
|
87
103
|
currentPageIndex: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/pagination/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,UAAU,EAAE,MA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vB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;QAC3C,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B;IAED,UAAiB,WAAW;QAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAC/B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE;YAAE,WAAW,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,OAAO,CAAA;SAAE,KAAK,MAAM,CAAC;KACvG;IAED,UAAiB,YAAY;QAC3B,gBAAgB,EAAE,MAAM,CAAC;KAC1B;IAED,UAAiB,eAAe;QAC9B,sBAAsB,EAAE,OAAO,CAAC;QAChC,kBAAkB,EAAE,MAAM,CAAC;KAC5B;IAED,UAAiB,eAAe;QAC9B;;WAEG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB;IAED,UAAiB,GAAG;QAClB;;WAEG;QACH,QAAQ,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;KACvC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/pagination/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { NonCancelableEventHandler } from '../types/events';\n\nexport interface PaginationProps {\n /**\n * Index of the current page. The first page has an index of 1.\n */\n currentPageIndex: number;\n\n /**\n * Sets the total number of pages. Only positive integers are allowed.\n */\n pagesCount: number;\n\n /**\n * Sets the pagination variant. It can be either default (when setting it to `false`) or open ended (when setting it\n * to `true`). Default pagination navigates you through the items list. The open-end variant enables you\n * to lazy-load your items because it always displays three dots before the next page icon. The next page button is\n * never disabled. When the user clicks on it but there are no more items to show, the\n * `onNextPageClick` handler is called with `requestedPageAvailable: false` in the event detail.\n */\n openEnd?: boolean;\n\n /**\n * If set to `true`, the pagination links will be disabled. Use it, for example, if you want to prevent the user\n * from changing page before items are loaded.\n */\n disabled?: boolean;\n\n /**\n * Adds aria-labels to the pagination buttons:\n * * `paginationLabel` (string) - Label for the entire pagination group. It allows users to distinguish context\n * * in cases of multiple pagination components in a page.\n * * `previousPageLabel` (string) - Previous page button.\n * * `pageLabel` (number => string) - Individual page button, this function is called for every page number that's rendered.\n * * `nextPageLabel` (string) - Next page button\n *\n * Example:\n * ```\n * {\n * nextPageLabel: 'Next page',\n * paginationLabel: 'Table pagination',\n * previousPageLabel: 'Previous page',\n * pageLabel: pageNumber => `Page ${pageNumber}`\n * }\n * ```\n * @i18n\n */\n ariaLabels?: PaginationProps.Labels;\n /**\n * @i18n\n */\n i18nStrings?: PaginationProps.I18nStrings;\n\n /**\n * Called when a user interaction causes a pagination change. The event `detail` contains the new `currentPageIndex`.\n */\n onChange?: NonCancelableEventHandler<PaginationProps.ChangeDetail>;\n\n /**\n * Called when the previous page arrow is clicked. The event `detail` contains the following:\n * * `requestedPageAvailable` (boolean) - Always set to `true`.\n * * `requestedPageIndex` (integer) - The index of the requested page.\n */\n onPreviousPageClick?: NonCancelableEventHandler<PaginationProps.PageClickDetail>;\n\n /**\n * Called when the next page arrow is clicked. The event `detail` contains the following:\n * * `requestedPageAvailable` (boolean) - Indicates whether the requested page is available for display.\n * The value can be `false` when the `openEnd` property is set to `true`.\n * * `requestedPageIndex` (integer) - The index of the requested page.\n */\n onNextPageClick?: NonCancelableEventHandler<PaginationProps.PageClickDetail>;\n /**\n * Jump to page configuration\n */\n jumpToPage?: PaginationProps.JumpToPageProps;\n}\n\nexport namespace PaginationProps {\n export interface Labels {\n nextPageLabel?: string;\n paginationLabel?: string;\n previousPageLabel?: string;\n pageLabel?: (pageNumber: number) => string;\n jumpToPageButton?: string;\n }\n\n export interface I18nStrings {\n
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/pagination/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { NonCancelableEventHandler } from '../types/events';\n\nexport interface PaginationProps {\n /**\n * Index of the current page. The first page has an index of 1.\n */\n currentPageIndex: number;\n\n /**\n * Sets the total number of pages. Only positive integers are allowed.\n */\n pagesCount: number;\n\n /**\n * Sets the pagination variant. It can be either default (when setting it to `false`) or open ended (when setting it\n * to `true`). Default pagination navigates you through the items list. The open-end variant enables you\n * to lazy-load your items because it always displays three dots before the next page icon. The next page button is\n * never disabled. When the user clicks on it but there are no more items to show, the\n * `onNextPageClick` handler is called with `requestedPageAvailable: false` in the event detail.\n */\n openEnd?: boolean;\n\n /**\n * Specifies how pages are displayed:\n * * `normal` - Displays page number buttons. For larger page ranges, the displayed range is truncated with ellipses.\n * * `compact` - Displays the current page and page count between the previous and next buttons. When `openEnd` is `true`, a plus sign after the page count indicates that more pages are available.\n */\n pagesVariant?: PaginationProps.PagesVariant;\n\n /**\n * If set to `true`, the pagination links will be disabled. Use it, for example, if you want to prevent the user\n * from changing page before items are loaded.\n */\n disabled?: boolean;\n\n /**\n * Adds aria-labels to the pagination buttons:\n * * `paginationLabel` (string) - Label for the entire pagination group. It allows users to distinguish context\n * * in cases of multiple pagination components in a page.\n * * `previousPageLabel` (string) - Previous page button.\n * * `pageLabel` (number => string) - Individual page button, this function is called for every page number that's rendered.\n * * `nextPageLabel` (string) - Next page button\n *\n * Example:\n * ```\n * {\n * nextPageLabel: 'Next page',\n * paginationLabel: 'Table pagination',\n * previousPageLabel: 'Previous page',\n * pageLabel: pageNumber => `Page ${pageNumber}`\n * }\n * ```\n * @i18n\n */\n ariaLabels?: PaginationProps.Labels;\n /**\n * An object containing all the necessary localized strings required by the component:\n * * `jumpToPageInputLabel` (string) - Accessible label for the jump-to-page number input.\n * * `jumpToPageError` (string) - Error message displayed when the entered page number is invalid.\n * * `jumpToPageLoadingText` (string) - Loading text displayed while the jump-to-page action is in progress.\n * * `pagesCompactText` ((options: { currentPage: number; pagesCount: number; openEnd: boolean }) => string) -\n * Provides the visible text for compact pages, for example `3 of 12`, or `3 of 12+` when `openEnd` is `true`.\n * Receives the current page, page count, and whether pagination is open-ended.\n * @i18n\n */\n i18nStrings?: PaginationProps.I18nStrings;\n\n /**\n * Called when a user interaction causes a pagination change. The event `detail` contains the new `currentPageIndex`.\n */\n onChange?: NonCancelableEventHandler<PaginationProps.ChangeDetail>;\n\n /**\n * Called when the previous page arrow is clicked. The event `detail` contains the following:\n * * `requestedPageAvailable` (boolean) - Always set to `true`.\n * * `requestedPageIndex` (integer) - The index of the requested page.\n */\n onPreviousPageClick?: NonCancelableEventHandler<PaginationProps.PageClickDetail>;\n\n /**\n * Called when the next page arrow is clicked. The event `detail` contains the following:\n * * `requestedPageAvailable` (boolean) - Indicates whether the requested page is available for display.\n * The value can be `false` when the `openEnd` property is set to `true`.\n * * `requestedPageIndex` (integer) - The index of the requested page.\n */\n onNextPageClick?: NonCancelableEventHandler<PaginationProps.PageClickDetail>;\n /**\n * Jump to page configuration\n */\n jumpToPage?: PaginationProps.JumpToPageProps;\n}\n\nexport namespace PaginationProps {\n export type PagesVariant = 'normal' | 'compact';\n\n export interface Labels {\n nextPageLabel?: string;\n paginationLabel?: string;\n previousPageLabel?: string;\n pageLabel?: (pageNumber: number) => string;\n jumpToPageButton?: string;\n }\n\n export interface I18nStrings {\n jumpToPageInputLabel?: string;\n jumpToPageError?: string;\n jumpToPageLoadingText?: string;\n pagesCompactText?: (options: { currentPage: number; pagesCount: number; openEnd: boolean }) => string;\n }\n\n export interface ChangeDetail {\n currentPageIndex: number;\n }\n\n export interface PageClickDetail {\n requestedPageAvailable: boolean;\n requestedPageIndex: number;\n }\n\n export interface JumpToPageProps {\n /**\n * User controlled loading state when jump to page callback is executing\n */\n loading?: boolean;\n }\n\n export interface Ref {\n /**\n * Set error state for jump to page. Component will auto-clear when user types or navigates.\n */\n setError: (hasError: boolean) => void;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/pagination/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAgBhD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAMlF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/pagination/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAgBhD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAMlF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAoF/C,QAAA,MAAM,kBAAkB,0HAmQvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -15,6 +15,7 @@ import InternalPopover from '../popover/internal';
|
|
|
15
15
|
import InternalSpaceBetween from '../space-between/internal';
|
|
16
16
|
import { getPaginationState, range } from './utils';
|
|
17
17
|
import styles from './styles.css.js';
|
|
18
|
+
import testUtilStyles from './test-classes/styles.css.js';
|
|
18
19
|
function PageButton({ className, ariaLabel, disabled, pageIndex, isCurrent = false, children, onClick, ...rest }) {
|
|
19
20
|
function handleClick(event) {
|
|
20
21
|
if (disabled) {
|
|
@@ -42,7 +43,7 @@ function PageNumber({ pageIndex, ...rest }) {
|
|
|
42
43
|
},
|
|
43
44
|
})) }, pageIndex));
|
|
44
45
|
}
|
|
45
|
-
const InternalPagination = React.forwardRef(({ openEnd, currentPageIndex, ariaLabels, i18nStrings, pagesCount, disabled, onChange, onNextPageClick, onPreviousPageClick, __internalRootRef, jumpToPage, ...rest }, ref) => {
|
|
46
|
+
const InternalPagination = React.forwardRef(({ openEnd, currentPageIndex, ariaLabels, i18nStrings, pagesCount, disabled, pagesVariant = 'normal', onChange, onNextPageClick, onPreviousPageClick, __internalRootRef, jumpToPage, ...rest }, ref) => {
|
|
46
47
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
47
48
|
const baseProps = getBaseProps(rest);
|
|
48
49
|
const { leftDots, leftIndex, rightIndex, rightDots } = getPaginationState(currentPageIndex, pagesCount, openEnd);
|
|
@@ -65,6 +66,11 @@ const InternalPagination = React.forwardRef(({ openEnd, currentPageIndex, ariaLa
|
|
|
65
66
|
const nextPageLabel = (_b = i18n('ariaLabels.nextPageLabel', ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.nextPageLabel)) !== null && _b !== void 0 ? _b : '';
|
|
66
67
|
const previousPageLabel = (_c = i18n('ariaLabels.previousPageLabel', ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.previousPageLabel)) !== null && _c !== void 0 ? _c : '';
|
|
67
68
|
const pageNumberLabelFn = (_d = i18n('ariaLabels.pageLabel', ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.pageLabel, format => pageNumber => format({ pageNumber }))) !== null && _d !== void 0 ? _d : ((pageNumber) => `${pageNumber}`);
|
|
69
|
+
const pagesCompactText = i18n('i18nStrings.pagesCompactText', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.pagesCompactText, format => options => format({
|
|
70
|
+
currentPage: options.currentPage,
|
|
71
|
+
pagesCount: options.pagesCount,
|
|
72
|
+
openEnd: options.openEnd ? 'true' : 'false',
|
|
73
|
+
}));
|
|
68
74
|
const jumpToPageLabel = (_e = i18n('i18nStrings.jumpToPageInputLabel', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.jumpToPageInputLabel)) !== null && _e !== void 0 ? _e : '';
|
|
69
75
|
const jumpToPageButtonLabel = (_f = i18n('ariaLabels.jumpToPageButtonLabel', ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.jumpToPageButton)) !== null && _f !== void 0 ? _f : '';
|
|
70
76
|
const jumpToPageError = (_g = i18n('i18nStrings.jumpToPageError', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.jumpToPageError)) !== null && _g !== void 0 ? _g : '';
|
|
@@ -132,11 +138,17 @@ const InternalPagination = React.forwardRef(({ openEnd, currentPageIndex, ariaLa
|
|
|
132
138
|
},
|
|
133
139
|
})) },
|
|
134
140
|
React.createElement(InternalIcon, { name: "angle-left", variant: disabled ? 'disabled' : 'normal' })),
|
|
135
|
-
React.createElement(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
141
|
+
pagesVariant === 'compact' ? (React.createElement("li", { "aria-disabled": disabled ? true : undefined, className: styles['pages-compact'] },
|
|
142
|
+
React.createElement("span", { className: testUtilStyles['pages-compact-text'] }, pagesCompactText === null || pagesCompactText === void 0 ? void 0 : pagesCompactText({
|
|
143
|
+
currentPage: currentPageIndex,
|
|
144
|
+
pagesCount,
|
|
145
|
+
openEnd: !!openEnd,
|
|
146
|
+
})))) : (React.createElement(React.Fragment, null,
|
|
147
|
+
React.createElement(PageNumber, { pageIndex: 1, isCurrent: currentPageIndex === 1, disabled: disabled, ariaLabel: pageNumberLabelFn(1), onClick: handlePageClick }),
|
|
148
|
+
leftDots && React.createElement("li", { className: styles.dots }, "..."),
|
|
149
|
+
range(leftIndex, rightIndex).map(pageIndex => (React.createElement(PageNumber, { key: pageIndex, isCurrent: currentPageIndex === pageIndex, pageIndex: pageIndex, disabled: disabled, ariaLabel: pageNumberLabelFn(pageIndex), onClick: handlePageClick }))),
|
|
150
|
+
rightDots && React.createElement("li", { className: styles.dots }, "..."),
|
|
151
|
+
!openEnd && pagesCount > 1 && (React.createElement(PageNumber, { isCurrent: currentPageIndex === pagesCount, pageIndex: pagesCount, disabled: disabled, ariaLabel: pageNumberLabelFn(pagesCount), onClick: handlePageClick })))),
|
|
140
152
|
React.createElement(PageButton, { className: styles.arrow, pageIndex: currentPageIndex + 1, ariaLabel: nextPageLabel, disabled: nextButtonDisabled, onClick: handleNextPageClick, ...(nextButtonDisabled
|
|
141
153
|
? {}
|
|
142
154
|
: getAnalyticsMetadataAttribute({
|