@cloudscape-design/components 3.0.705 → 3.0.707
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/i18n/messages/all.all.js +1 -1
- package/i18n/messages/all.all.json +1 -1
- package/i18n/messages/all.ar.js +1 -1
- package/i18n/messages/all.ar.json +1 -1
- package/i18n/messages/all.de.js +1 -1
- package/i18n/messages/all.de.json +1 -1
- package/i18n/messages/all.en-GB.js +1 -1
- package/i18n/messages/all.en-GB.json +1 -1
- package/i18n/messages/all.en.js +1 -1
- package/i18n/messages/all.en.json +1 -1
- package/i18n/messages/all.es.js +1 -1
- package/i18n/messages/all.es.json +1 -1
- package/i18n/messages/all.fr.js +1 -1
- package/i18n/messages/all.fr.json +1 -1
- package/i18n/messages/all.id.js +1 -1
- package/i18n/messages/all.id.json +1 -1
- package/i18n/messages/all.it.js +1 -1
- package/i18n/messages/all.it.json +1 -1
- package/i18n/messages/all.ja.js +1 -1
- package/i18n/messages/all.ja.json +1 -1
- package/i18n/messages/all.ko.js +1 -1
- package/i18n/messages/all.ko.json +1 -1
- package/i18n/messages/all.pt-BR.js +1 -1
- package/i18n/messages/all.pt-BR.json +1 -1
- package/i18n/messages/all.th.js +1 -1
- package/i18n/messages/all.th.json +1 -1
- package/i18n/messages/all.tr.js +1 -1
- package/i18n/messages/all.tr.json +1 -1
- package/i18n/messages/all.zh-CN.js +1 -1
- package/i18n/messages/all.zh-CN.json +1 -1
- package/i18n/messages/all.zh-TW.js +1 -1
- package/i18n/messages/all.zh-TW.json +1 -1
- package/i18n/messages-types.d.ts +1 -1
- package/i18n/messages-types.d.ts.map +1 -1
- package/i18n/messages-types.js.map +1 -1
- package/internal/components/token-list/styles.css.js +9 -9
- package/internal/components/token-list/styles.scoped.css +22 -22
- package/internal/components/token-list/styles.selectors.js +9 -9
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/property-filter/i18n-utils.d.ts +9 -0
- package/property-filter/i18n-utils.d.ts.map +1 -0
- package/property-filter/i18n-utils.js +48 -0
- package/property-filter/i18n-utils.js.map +1 -0
- package/property-filter/index.d.ts.map +1 -1
- package/property-filter/index.js +5 -38
- package/property-filter/index.js.map +1 -1
- package/property-filter/interfaces.d.ts +8 -1
- package/property-filter/interfaces.d.ts.map +1 -1
- package/property-filter/interfaces.js.map +1 -1
- package/property-filter/token.d.ts.map +1 -1
- package/property-filter/token.js +12 -13
- package/property-filter/token.js.map +1 -1
- package/property-filter/utils.d.ts +0 -6
- package/property-filter/utils.d.ts.map +1 -1
- package/property-filter/utils.js +0 -8
- package/property-filter/utils.js.map +1 -1
- package/tabs/styles.css.js +28 -28
- package/tabs/styles.scoped.css +49 -54
- package/tabs/styles.selectors.js +28 -28
- package/tabs/tab-header-bar.d.ts.map +1 -1
- package/tabs/tab-header-bar.js +4 -3
- package/tabs/tab-header-bar.js.map +1 -1
- package/tabs/test-classes/styles.css.js +6 -0
- package/tabs/test-classes/styles.scoped.css +7 -0
- package/tabs/test-classes/styles.selectors.js +7 -0
- package/test-utils/dom/pagination/index.d.ts +1 -0
- package/test-utils/dom/pagination/index.js +13 -1
- package/test-utils/dom/pagination/index.js.map +1 -1
- package/test-utils/dom/tabs/index.js +4 -3
- package/test-utils/dom/tabs/index.js.map +1 -1
- package/test-utils/selectors/tabs/index.js +4 -3
- package/test-utils/selectors/tabs/index.js.map +1 -1
- package/test-utils/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/property-filter/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD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B,gBAAgB,EAAE,gBAAgB,GAClC,CACH,EACD,WAAW,EAAE;wBACX,cAAc,EAAE,WAAW,CAAC,mBAAmB;wBAC/C,aAAa,EAAE,WAAW,CAAC,kBAAkB;qBAC9C,EACD,KAAK,EACH,mBAAmB,CAAC,CAAC,CAAC,CACpB,6BAAK,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC,IAAG,mBAAmB,CAAO,CAC7E,CAAC,CAAC,CAAC,CACF,oBAAC,cAAc,IACb,UAAU,EAAC,MAAM,EACjB,OAAO,EAAE,eAAe,EACxB,SAAS,EAAE,MAAM,CAAC,YAAY,CAAC,EAC/B,QAAQ,EAAE,QAAQ,IAEjB,WAAW,CAAC,gBAAgB,CACd,CAClB,EAEH,oBAAoB,EAAE,iBAAiB,GACvC,CACmB,CACnB,CACP,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AACnD,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { PropertyFilterOperator } from '@cloudscape-design/collection-hooks';\n\nimport { InternalButton } from '../button/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { AutosuggestInputRef } from '../internal/components/autosuggest-input';\nimport TokenList from '../internal/components/token-list';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useUniqueId } from '../internal/hooks/use-unique-id/index';\nimport { KeyCode } from '../internal/keycode';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { joinStrings } from '../internal/utils/strings';\nimport InternalSpaceBetween from '../space-between/internal';\nimport { SearchResults } from '../text-filter/search-results';\nimport { getAllowedOperators, getAutosuggestOptions, getQueryActions, parseText } from './controller';\nimport {\n ComparisonOperator,\n ExtendedOperator,\n FilteringProperty,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n InternalQuery,\n ParsedText,\n PropertyFilterProps,\n Ref,\n Token,\n} from './interfaces';\nimport { PropertyEditor } from './property-editor';\nimport PropertyFilterAutosuggest, { PropertyFilterAutosuggestProps } from './property-filter-autosuggest';\nimport { TokenButton } from './token';\nimport { useLoadItems } from './use-load-items';\nimport { matchTokenValue } from './utils';\n\nimport styles from './styles.css.js';\n\nexport { PropertyFilterProps };\n\nfunction getOperatorI18nString(operator: ComparisonOperator): string {\n switch (operator) {\n case '=':\n return 'equals';\n case '!=':\n return 'not_equals';\n case '>':\n return 'greater_than';\n case '>=':\n return 'greater_than_equal';\n case '<':\n return 'less_than';\n case '<=':\n return 'less_than_equal';\n case ':':\n return 'contains';\n case '!:':\n return 'not_contains';\n case '^':\n return 'starts_with';\n case '!^':\n return 'not_starts_with';\n // The line is ignored from coverage because it is not reachable.\n // The purpose of it is to prevent TS errors if ComparisonOperator type gets extended.\n /* istanbul ignore next */\n default:\n return operator;\n }\n}\n\nconst PropertyFilter = React.forwardRef(\n (\n {\n disabled,\n countText,\n query,\n hideOperations,\n onChange,\n filteringProperties,\n filteringOptions = [],\n customGroupsText = [],\n disableFreeTextFiltering = false,\n freeTextFiltering,\n onLoadItems,\n virtualScroll,\n customControl,\n customFilterActions,\n filteringPlaceholder,\n filteringAriaLabel,\n filteringEmpty,\n filteringLoadingText,\n filteringFinishedText,\n filteringErrorText,\n filteringRecoveryText,\n filteringConstraintText,\n filteringStatusType,\n asyncProperties,\n tokenLimit,\n expandToViewport,\n tokenLimitShowFewerAriaLabel,\n tokenLimitShowMoreAriaLabel,\n ...rest\n }: PropertyFilterProps,\n ref: React.Ref<Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('PropertyFilter', {\n props: { asyncProperties, disableFreeTextFiltering, expandToViewport, hideOperations, tokenLimit, virtualScroll },\n });\n const [removedTokenIndex, setRemovedTokenIndex] = useState<null | number>(null);\n\n const inputRef = useRef<AutosuggestInputRef>(null);\n const baseProps = getBaseProps(rest);\n\n const i18n = useInternalI18n('property-filter');\n const i18nStrings: PropertyFilterProps.I18nStrings = {\n ...rest.i18nStrings,\n allPropertiesLabel: i18n('i18nStrings.allPropertiesLabel', rest.i18nStrings?.allPropertiesLabel),\n applyActionText: i18n('i18nStrings.applyActionText', rest.i18nStrings?.applyActionText),\n cancelActionText: i18n('i18nStrings.cancelActionText', rest.i18nStrings?.cancelActionText),\n clearFiltersText: i18n('i18nStrings.clearFiltersText', rest.i18nStrings?.clearFiltersText),\n editTokenHeader: i18n('i18nStrings.editTokenHeader', rest.i18nStrings?.editTokenHeader),\n groupPropertiesText: i18n('i18nStrings.groupPropertiesText', rest.i18nStrings?.groupPropertiesText),\n groupValuesText: i18n('i18nStrings.groupValuesText', rest.i18nStrings?.groupValuesText),\n operationAndText: i18n('i18nStrings.operationAndText', rest.i18nStrings?.operationAndText),\n operationOrText: i18n('i18nStrings.operationOrText', rest.i18nStrings?.operationOrText),\n operatorContainsText: i18n('i18nStrings.operatorContainsText', rest.i18nStrings?.operatorContainsText),\n operatorDoesNotContainText: i18n(\n 'i18nStrings.operatorDoesNotContainText',\n rest.i18nStrings?.operatorDoesNotContainText\n ),\n operatorDoesNotEqualText: i18n(\n 'i18nStrings.operatorDoesNotEqualText',\n rest.i18nStrings?.operatorDoesNotEqualText\n ),\n operatorEqualsText: i18n('i18nStrings.operatorEqualsText', rest.i18nStrings?.operatorEqualsText),\n operatorGreaterOrEqualText: i18n(\n 'i18nStrings.operatorGreaterOrEqualText',\n rest.i18nStrings?.operatorGreaterOrEqualText\n ),\n operatorGreaterText: i18n('i18nStrings.operatorGreaterText', rest.i18nStrings?.operatorGreaterText),\n operatorLessOrEqualText: i18n('i18nStrings.operatorLessOrEqualText', rest.i18nStrings?.operatorLessOrEqualText),\n operatorLessText: i18n('i18nStrings.operatorLessText', rest.i18nStrings?.operatorLessText),\n operatorStartsWithText: i18n('i18nStrings.operatorStartsWithText', rest.i18nStrings?.operatorStartsWithText),\n operatorDoesNotStartWithText: i18n(\n 'i18nStrings.operatorDoesNotStartWithText',\n rest.i18nStrings?.operatorDoesNotStartWithText\n ),\n operatorText: i18n('i18nStrings.operatorText', rest.i18nStrings?.operatorText),\n operatorsText: i18n('i18nStrings.operatorsText', rest.i18nStrings?.operatorsText),\n propertyText: i18n('i18nStrings.propertyText', rest.i18nStrings?.propertyText),\n tokenLimitShowFewer: i18n('i18nStrings.tokenLimitShowFewer', rest.i18nStrings?.tokenLimitShowFewer),\n tokenLimitShowMore: i18n('i18nStrings.tokenLimitShowMore', rest.i18nStrings?.tokenLimitShowMore),\n valueText: i18n('i18nStrings.valueText', rest.i18nStrings?.valueText),\n removeTokenButtonAriaLabel: i18n(\n 'i18nStrings.removeTokenButtonAriaLabel',\n rest.i18nStrings?.removeTokenButtonAriaLabel,\n format => token =>\n format({\n token__operator: getOperatorI18nString(token.operator),\n token__propertyKey: token.propertyKey ?? '',\n token__value: token.value,\n })\n ),\n };\n\n useImperativeHandle(ref, () => ({ focus: () => inputRef.current?.focus() }), []);\n const showResults = !!query.tokens?.length && !disabled && !!countText;\n const { addToken, removeToken, setToken, setOperation, removeAllTokens } = getQueryActions(\n query,\n onChange,\n inputRef\n );\n const [filteringText, setFilteringText] = useState<string>('');\n\n const { internalProperties, internalOptions, internalQuery, internalFreeText } = (() => {\n const propertyByKey = filteringProperties.reduce((acc, property) => {\n const extendedOperators = (property?.operators ?? []).reduce(\n (acc, operator) => (typeof operator === 'object' ? acc.set(operator.operator, operator) : acc),\n new Map<PropertyFilterOperator, null | ExtendedOperator<any>>()\n );\n acc.set(property.key, {\n propertyKey: property.key,\n propertyLabel: property?.propertyLabel ?? '',\n groupValuesLabel: property?.groupValuesLabel ?? '',\n propertyGroup: property?.group,\n operators: (property?.operators ?? []).map(op => (typeof op === 'string' ? op : op.operator)),\n defaultOperator: property?.defaultOperator ?? '=',\n getValueFormatter: operator => (operator ? extendedOperators.get(operator)?.format ?? null : null),\n getValueFormRenderer: operator => (operator ? extendedOperators.get(operator)?.form ?? null : null),\n externalProperty: property,\n });\n return acc;\n }, new Map<string, InternalFilteringProperty>());\n const getProperty = (propertyKey: string): null | InternalFilteringProperty =>\n propertyByKey.get(propertyKey) ?? null;\n\n const internalOptions: readonly InternalFilteringOption[] = filteringOptions.map(option => ({\n property: getProperty(option.propertyKey),\n value: option.value,\n label: option.label ?? option.value ?? '',\n }));\n\n const internalQuery: InternalQuery = {\n operation: query.operation,\n tokens: query.tokens.map(token => ({\n property: token.propertyKey ? getProperty(token.propertyKey) : null,\n operator: token.operator,\n value: token.value,\n })),\n };\n\n const internalFreeText: InternalFreeTextFiltering = {\n disabled: disableFreeTextFiltering,\n operators: freeTextFiltering?.operators ?? [':', '!:'],\n defaultOperator: freeTextFiltering?.defaultOperator ?? ':',\n };\n\n return { internalProperties: [...propertyByKey.values()], internalOptions, internalQuery, internalFreeText };\n })();\n\n const parsedText = parseText(filteringText, internalProperties, internalFreeText);\n const autosuggestOptions = getAutosuggestOptions(\n parsedText,\n internalProperties,\n internalOptions,\n customGroupsText,\n i18nStrings\n );\n\n const createToken = (currentText: string) => {\n const parsedText = parseText(currentText, internalProperties, internalFreeText);\n let newToken: Token;\n switch (parsedText.step) {\n case 'property': {\n newToken = matchTokenValue(\n {\n property: parsedText.property,\n operator: parsedText.operator,\n value: parsedText.value,\n },\n internalOptions\n );\n break;\n }\n case 'free-text': {\n newToken = {\n operator: parsedText.operator || internalFreeText.defaultOperator,\n value: parsedText.value,\n };\n break;\n }\n case 'operator': {\n newToken = {\n operator: internalFreeText.defaultOperator,\n value: currentText,\n };\n break;\n }\n }\n if (internalFreeText.disabled && !('propertyKey' in newToken)) {\n return;\n }\n addToken(newToken);\n setFilteringText('');\n };\n const ignoreKeyDown = useRef<boolean>(false);\n const handleKeyDown: PropertyFilterAutosuggestProps['onKeyDown'] = event => {\n if (filteringText && !ignoreKeyDown.current && event.detail.keyCode === KeyCode.enter) {\n createToken(filteringText);\n }\n };\n const getLoadMoreDetail = (parsedText: ParsedText, filteringText: string) => {\n const loadMoreDetail: {\n filteringProperty: FilteringProperty | undefined;\n filteringText: string;\n filteringOperator: ComparisonOperator | undefined;\n } = {\n filteringProperty: undefined,\n filteringText,\n filteringOperator: undefined,\n };\n if (parsedText.step === 'property') {\n loadMoreDetail.filteringProperty = parsedText.property.externalProperty;\n loadMoreDetail.filteringText = parsedText.value;\n loadMoreDetail.filteringOperator = parsedText.operator;\n }\n return loadMoreDetail;\n };\n const loadMoreDetail = getLoadMoreDetail(parsedText, filteringText);\n const inputLoadItemsHandlers = useLoadItems(\n onLoadItems,\n loadMoreDetail.filteringText,\n loadMoreDetail.filteringProperty,\n loadMoreDetail.filteringText,\n loadMoreDetail.filteringOperator\n );\n const asyncProps = {\n empty: filteringEmpty,\n loadingText: filteringLoadingText,\n finishedText: filteringFinishedText,\n errorText: filteringErrorText,\n recoveryText: filteringRecoveryText,\n statusType: filteringStatusType,\n };\n const asyncAutosuggestProps =\n !!filteringText.length || asyncProperties\n ? {\n ...inputLoadItemsHandlers,\n ...asyncProps,\n }\n : {};\n const handleSelected: PropertyFilterAutosuggestProps['onOptionClick'] = event => {\n // The ignoreKeyDown flag makes sure `createToken` routine runs only once. Autosuggest's `onKeyDown` fires,\n // when an item is selected from the list using \"enter\" key.\n ignoreKeyDown.current = true;\n setTimeout(() => {\n ignoreKeyDown.current = false;\n }, 0);\n const { detail: option } = event;\n const value = option.value || '';\n\n if (!('keepOpenOnSelect' in option)) {\n createToken(value);\n return;\n }\n\n // stop dropdown from closing\n event.preventDefault();\n\n const parsedText = parseText(value, internalProperties, internalFreeText);\n const loadMoreDetail = getLoadMoreDetail(parsedText, value);\n\n // Insert operator automatically if only one operator is defined for the given property.\n if (parsedText.step === 'operator') {\n const operators = getAllowedOperators(parsedText.property);\n if (value.trim() === parsedText.property.propertyLabel && operators.length === 1) {\n loadMoreDetail.filteringProperty = parsedText.property.externalProperty ?? undefined;\n loadMoreDetail.filteringOperator = operators[0];\n loadMoreDetail.filteringText = '';\n setFilteringText(parsedText.property.propertyLabel + ' ' + operators[0] + ' ');\n }\n }\n\n fireNonCancelableEvent(onLoadItems, { ...loadMoreDetail, firstPage: true, samePage: false });\n };\n\n const operatorForm =\n parsedText.step === 'property' && parsedText.property.getValueFormRenderer(parsedText.operator);\n\n const searchResultsId = useUniqueId('property-filter-search-results');\n const constraintTextId = useUniqueId('property-filter-constraint');\n const textboxAriaDescribedBy = filteringConstraintText\n ? joinStrings(rest.ariaDescribedby, constraintTextId)\n : rest.ariaDescribedby;\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={__internalRootRef}>\n <div className={styles['search-field']}>\n {customControl && <div className={styles['custom-control']}>{customControl}</div>}\n <PropertyFilterAutosuggest\n ref={inputRef}\n virtualScroll={virtualScroll}\n enteredTextLabel={i18nStrings.enteredTextLabel}\n ariaLabel={filteringAriaLabel ?? i18nStrings.filteringAriaLabel}\n placeholder={filteringPlaceholder ?? i18nStrings.filteringPlaceholder}\n ariaLabelledby={rest.ariaLabelledby}\n ariaDescribedby={textboxAriaDescribedBy}\n controlId={rest.controlId}\n value={filteringText}\n disabled={disabled}\n onKeyDown={handleKeyDown}\n {...autosuggestOptions}\n onChange={event => setFilteringText(event.detail.value)}\n empty={filteringEmpty}\n {...asyncAutosuggestProps}\n expandToViewport={expandToViewport}\n onOptionClick={handleSelected}\n customForm={\n operatorForm && (\n <PropertyEditor\n property={parsedText.property}\n operator={parsedText.operator}\n filter={parsedText.value}\n operatorForm={operatorForm}\n i18nStrings={i18nStrings}\n onCancel={() => {\n setFilteringText('');\n inputRef.current?.close();\n inputRef.current?.focus({ preventDropdown: true });\n }}\n onSubmit={token => {\n addToken(token);\n setFilteringText('');\n inputRef.current?.focus({ preventDropdown: true });\n inputRef.current?.close();\n }}\n />\n )\n }\n hideEnteredTextOption={internalFreeText.disabled && parsedText.step !== 'property'}\n clearAriaLabel={i18nStrings.clearAriaLabel}\n searchResultsId={showResults ? searchResultsId : undefined}\n />\n {showResults ? (\n <div className={styles.results}>\n <SearchResults id={searchResultsId}>{countText}</SearchResults>\n </div>\n ) : null}\n </div>\n {filteringConstraintText && (\n <div id={constraintTextId} className={styles.constraint}>\n {filteringConstraintText}\n </div>\n )}\n {internalQuery.tokens && internalQuery.tokens.length > 0 && (\n <div className={styles.tokens}>\n <InternalSpaceBetween size=\"xs\" direction=\"horizontal\">\n <TokenList\n alignment=\"inline\"\n limit={tokenLimit}\n items={internalQuery.tokens}\n limitShowFewerAriaLabel={tokenLimitShowFewerAriaLabel}\n limitShowMoreAriaLabel={tokenLimitShowMoreAriaLabel}\n renderItem={(token, tokenIndex) => (\n <TokenButton\n token={token}\n first={tokenIndex === 0}\n operation={internalQuery.operation}\n removeToken={() => {\n removeToken(tokenIndex);\n setRemovedTokenIndex(tokenIndex);\n }}\n setToken={(newToken: Token) => setToken(tokenIndex, newToken)}\n setOperation={setOperation}\n filteringProperties={internalProperties}\n filteringOptions={internalOptions}\n asyncProps={asyncProps}\n onLoadItems={onLoadItems}\n i18nStrings={i18nStrings}\n asyncProperties={asyncProperties}\n hideOperations={hideOperations}\n customGroupsText={customGroupsText}\n freeTextFiltering={internalFreeText}\n disabled={disabled}\n expandToViewport={expandToViewport}\n />\n )}\n i18nStrings={{\n limitShowFewer: i18nStrings.tokenLimitShowFewer,\n limitShowMore: i18nStrings.tokenLimitShowMore,\n }}\n after={\n customFilterActions ? (\n <div className={styles['custom-filter-actions']}>{customFilterActions}</div>\n ) : (\n <InternalButton\n formAction=\"none\"\n onClick={removeAllTokens}\n className={styles['remove-all']}\n disabled={disabled}\n >\n {i18nStrings.clearFiltersText}\n </InternalButton>\n )\n }\n moveFocusNextToIndex={removedTokenIndex}\n />\n </InternalSpaceBetween>\n </div>\n )}\n </div>\n );\n }\n);\n\napplyDisplayName(PropertyFilter, 'PropertyFilter');\nexport default PropertyFilter;\n"]}
|
|
1
|
+
{"version":3,"file":"index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,CAAC,YAAY,CAAC,EAC/B,QAAQ,EAAE,QAAQ,IAEjB,WAAW,CAAC,gBAAgB,CACd,CAClB,EAEH,oBAAoB,EAAE,iBAAiB,GACvC,CACmB,CACnB,CACP,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AACnD,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { PropertyFilterOperator } from '@cloudscape-design/collection-hooks';\n\nimport { InternalButton } from '../button/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { AutosuggestInputRef } from '../internal/components/autosuggest-input';\nimport TokenList from '../internal/components/token-list';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useUniqueId } from '../internal/hooks/use-unique-id/index';\nimport { KeyCode } from '../internal/keycode';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { joinStrings } from '../internal/utils/strings';\nimport InternalSpaceBetween from '../space-between/internal';\nimport { SearchResults } from '../text-filter/search-results';\nimport { getAllowedOperators, getAutosuggestOptions, getQueryActions, parseText } from './controller';\nimport { getI18nToken } from './i18n-utils';\nimport {\n ComparisonOperator,\n ExtendedOperator,\n FilteringProperty,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n InternalQuery,\n ParsedText,\n PropertyFilterProps,\n Ref,\n Token,\n} from './interfaces';\nimport { PropertyEditor } from './property-editor';\nimport PropertyFilterAutosuggest, { PropertyFilterAutosuggestProps } from './property-filter-autosuggest';\nimport { TokenButton } from './token';\nimport { useLoadItems } from './use-load-items';\nimport { matchTokenValue } from './utils';\n\nimport styles from './styles.css.js';\n\nexport { PropertyFilterProps };\n\nconst PropertyFilter = React.forwardRef(\n (\n {\n disabled,\n countText,\n query,\n hideOperations,\n onChange,\n filteringProperties,\n filteringOptions = [],\n customGroupsText = [],\n disableFreeTextFiltering = false,\n freeTextFiltering,\n onLoadItems,\n virtualScroll,\n customControl,\n customFilterActions,\n filteringPlaceholder,\n filteringAriaLabel,\n filteringEmpty,\n filteringLoadingText,\n filteringFinishedText,\n filteringErrorText,\n filteringRecoveryText,\n filteringConstraintText,\n filteringStatusType,\n asyncProperties,\n tokenLimit,\n expandToViewport,\n tokenLimitShowFewerAriaLabel,\n tokenLimitShowMoreAriaLabel,\n ...rest\n }: PropertyFilterProps,\n ref: React.Ref<Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('PropertyFilter', {\n props: { asyncProperties, disableFreeTextFiltering, expandToViewport, hideOperations, tokenLimit, virtualScroll },\n });\n const [removedTokenIndex, setRemovedTokenIndex] = useState<null | number>(null);\n\n const inputRef = useRef<AutosuggestInputRef>(null);\n const baseProps = getBaseProps(rest);\n\n const i18n = useInternalI18n('property-filter');\n const i18nStrings: PropertyFilterProps.I18nStrings = {\n ...rest.i18nStrings,\n allPropertiesLabel: i18n('i18nStrings.allPropertiesLabel', rest.i18nStrings?.allPropertiesLabel),\n applyActionText: i18n('i18nStrings.applyActionText', rest.i18nStrings?.applyActionText),\n cancelActionText: i18n('i18nStrings.cancelActionText', rest.i18nStrings?.cancelActionText),\n clearFiltersText: i18n('i18nStrings.clearFiltersText', rest.i18nStrings?.clearFiltersText),\n editTokenHeader: i18n('i18nStrings.editTokenHeader', rest.i18nStrings?.editTokenHeader),\n groupPropertiesText: i18n('i18nStrings.groupPropertiesText', rest.i18nStrings?.groupPropertiesText),\n groupValuesText: i18n('i18nStrings.groupValuesText', rest.i18nStrings?.groupValuesText),\n operationAndText: i18n('i18nStrings.operationAndText', rest.i18nStrings?.operationAndText),\n operationOrText: i18n('i18nStrings.operationOrText', rest.i18nStrings?.operationOrText),\n operatorContainsText: i18n('i18nStrings.operatorContainsText', rest.i18nStrings?.operatorContainsText),\n operatorDoesNotContainText: i18n(\n 'i18nStrings.operatorDoesNotContainText',\n rest.i18nStrings?.operatorDoesNotContainText\n ),\n operatorDoesNotEqualText: i18n(\n 'i18nStrings.operatorDoesNotEqualText',\n rest.i18nStrings?.operatorDoesNotEqualText\n ),\n operatorEqualsText: i18n('i18nStrings.operatorEqualsText', rest.i18nStrings?.operatorEqualsText),\n operatorGreaterOrEqualText: i18n(\n 'i18nStrings.operatorGreaterOrEqualText',\n rest.i18nStrings?.operatorGreaterOrEqualText\n ),\n operatorGreaterText: i18n('i18nStrings.operatorGreaterText', rest.i18nStrings?.operatorGreaterText),\n operatorLessOrEqualText: i18n('i18nStrings.operatorLessOrEqualText', rest.i18nStrings?.operatorLessOrEqualText),\n operatorLessText: i18n('i18nStrings.operatorLessText', rest.i18nStrings?.operatorLessText),\n operatorStartsWithText: i18n('i18nStrings.operatorStartsWithText', rest.i18nStrings?.operatorStartsWithText),\n operatorDoesNotStartWithText: i18n(\n 'i18nStrings.operatorDoesNotStartWithText',\n rest.i18nStrings?.operatorDoesNotStartWithText\n ),\n operatorText: i18n('i18nStrings.operatorText', rest.i18nStrings?.operatorText),\n operatorsText: i18n('i18nStrings.operatorsText', rest.i18nStrings?.operatorsText),\n propertyText: i18n('i18nStrings.propertyText', rest.i18nStrings?.propertyText),\n tokenLimitShowFewer: i18n('i18nStrings.tokenLimitShowFewer', rest.i18nStrings?.tokenLimitShowFewer),\n tokenLimitShowMore: i18n('i18nStrings.tokenLimitShowMore', rest.i18nStrings?.tokenLimitShowMore),\n valueText: i18n('i18nStrings.valueText', rest.i18nStrings?.valueText),\n };\n\n useImperativeHandle(ref, () => ({ focus: () => inputRef.current?.focus() }), []);\n const showResults = !!query.tokens?.length && !disabled && !!countText;\n const { addToken, removeToken, setToken, setOperation, removeAllTokens } = getQueryActions(\n query,\n onChange,\n inputRef\n );\n const [filteringText, setFilteringText] = useState<string>('');\n\n const { internalProperties, internalOptions, internalQuery, internalFreeText } = (() => {\n const propertyByKey = filteringProperties.reduce((acc, property) => {\n const extendedOperators = (property?.operators ?? []).reduce(\n (acc, operator) => (typeof operator === 'object' ? acc.set(operator.operator, operator) : acc),\n new Map<PropertyFilterOperator, null | ExtendedOperator<any>>()\n );\n acc.set(property.key, {\n propertyKey: property.key,\n propertyLabel: property?.propertyLabel ?? '',\n groupValuesLabel: property?.groupValuesLabel ?? '',\n propertyGroup: property?.group,\n operators: (property?.operators ?? []).map(op => (typeof op === 'string' ? op : op.operator)),\n defaultOperator: property?.defaultOperator ?? '=',\n getValueFormatter: operator => (operator ? extendedOperators.get(operator)?.format ?? null : null),\n getValueFormRenderer: operator => (operator ? extendedOperators.get(operator)?.form ?? null : null),\n externalProperty: property,\n });\n return acc;\n }, new Map<string, InternalFilteringProperty>());\n const getProperty = (propertyKey: string): null | InternalFilteringProperty =>\n propertyByKey.get(propertyKey) ?? null;\n\n const internalOptions: readonly InternalFilteringOption[] = filteringOptions.map(option => ({\n property: getProperty(option.propertyKey),\n value: option.value,\n label: option.label ?? option.value ?? '',\n }));\n\n const internalQuery: InternalQuery = {\n operation: query.operation,\n tokens: query.tokens.map(token => ({\n property: token.propertyKey ? getProperty(token.propertyKey) : null,\n operator: token.operator,\n value: token.value,\n __source: token,\n })),\n };\n\n const internalFreeText: InternalFreeTextFiltering = {\n disabled: disableFreeTextFiltering,\n operators: freeTextFiltering?.operators ?? [':', '!:'],\n defaultOperator: freeTextFiltering?.defaultOperator ?? ':',\n };\n\n return { internalProperties: [...propertyByKey.values()], internalOptions, internalQuery, internalFreeText };\n })();\n\n i18nStrings.removeTokenButtonAriaLabel = i18n(\n 'i18nStrings.removeTokenButtonAriaLabel',\n rest.i18nStrings?.removeTokenButtonAriaLabel,\n format => token => format(getI18nToken(token))\n );\n\n const parsedText = parseText(filteringText, internalProperties, internalFreeText);\n const autosuggestOptions = getAutosuggestOptions(\n parsedText,\n internalProperties,\n internalOptions,\n customGroupsText,\n i18nStrings\n );\n\n const createToken = (currentText: string) => {\n const parsedText = parseText(currentText, internalProperties, internalFreeText);\n let newToken: Token;\n switch (parsedText.step) {\n case 'property': {\n newToken = matchTokenValue(\n {\n property: parsedText.property,\n operator: parsedText.operator,\n value: parsedText.value,\n },\n internalOptions\n );\n break;\n }\n case 'free-text': {\n newToken = {\n operator: parsedText.operator || internalFreeText.defaultOperator,\n value: parsedText.value,\n };\n break;\n }\n case 'operator': {\n newToken = {\n operator: internalFreeText.defaultOperator,\n value: currentText,\n };\n break;\n }\n }\n if (internalFreeText.disabled && !('propertyKey' in newToken)) {\n return;\n }\n addToken(newToken);\n setFilteringText('');\n };\n const ignoreKeyDown = useRef<boolean>(false);\n const handleKeyDown: PropertyFilterAutosuggestProps['onKeyDown'] = event => {\n if (filteringText && !ignoreKeyDown.current && event.detail.keyCode === KeyCode.enter) {\n createToken(filteringText);\n }\n };\n const getLoadMoreDetail = (parsedText: ParsedText, filteringText: string) => {\n const loadMoreDetail: {\n filteringProperty: FilteringProperty | undefined;\n filteringText: string;\n filteringOperator: ComparisonOperator | undefined;\n } = {\n filteringProperty: undefined,\n filteringText,\n filteringOperator: undefined,\n };\n if (parsedText.step === 'property') {\n loadMoreDetail.filteringProperty = parsedText.property.externalProperty;\n loadMoreDetail.filteringText = parsedText.value;\n loadMoreDetail.filteringOperator = parsedText.operator;\n }\n return loadMoreDetail;\n };\n const loadMoreDetail = getLoadMoreDetail(parsedText, filteringText);\n const inputLoadItemsHandlers = useLoadItems(\n onLoadItems,\n loadMoreDetail.filteringText,\n loadMoreDetail.filteringProperty,\n loadMoreDetail.filteringText,\n loadMoreDetail.filteringOperator\n );\n const asyncProps = {\n empty: filteringEmpty,\n loadingText: filteringLoadingText,\n finishedText: filteringFinishedText,\n errorText: filteringErrorText,\n recoveryText: filteringRecoveryText,\n statusType: filteringStatusType,\n };\n const asyncAutosuggestProps =\n !!filteringText.length || asyncProperties\n ? {\n ...inputLoadItemsHandlers,\n ...asyncProps,\n }\n : {};\n const handleSelected: PropertyFilterAutosuggestProps['onOptionClick'] = event => {\n // The ignoreKeyDown flag makes sure `createToken` routine runs only once. Autosuggest's `onKeyDown` fires,\n // when an item is selected from the list using \"enter\" key.\n ignoreKeyDown.current = true;\n setTimeout(() => {\n ignoreKeyDown.current = false;\n }, 0);\n const { detail: option } = event;\n const value = option.value || '';\n\n if (!('keepOpenOnSelect' in option)) {\n createToken(value);\n return;\n }\n\n // stop dropdown from closing\n event.preventDefault();\n\n const parsedText = parseText(value, internalProperties, internalFreeText);\n const loadMoreDetail = getLoadMoreDetail(parsedText, value);\n\n // Insert operator automatically if only one operator is defined for the given property.\n if (parsedText.step === 'operator') {\n const operators = getAllowedOperators(parsedText.property);\n if (value.trim() === parsedText.property.propertyLabel && operators.length === 1) {\n loadMoreDetail.filteringProperty = parsedText.property.externalProperty ?? undefined;\n loadMoreDetail.filteringOperator = operators[0];\n loadMoreDetail.filteringText = '';\n setFilteringText(parsedText.property.propertyLabel + ' ' + operators[0] + ' ');\n }\n }\n\n fireNonCancelableEvent(onLoadItems, { ...loadMoreDetail, firstPage: true, samePage: false });\n };\n\n const operatorForm =\n parsedText.step === 'property' && parsedText.property.getValueFormRenderer(parsedText.operator);\n\n const searchResultsId = useUniqueId('property-filter-search-results');\n const constraintTextId = useUniqueId('property-filter-constraint');\n const textboxAriaDescribedBy = filteringConstraintText\n ? joinStrings(rest.ariaDescribedby, constraintTextId)\n : rest.ariaDescribedby;\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={__internalRootRef}>\n <div className={styles['search-field']}>\n {customControl && <div className={styles['custom-control']}>{customControl}</div>}\n <PropertyFilterAutosuggest\n ref={inputRef}\n virtualScroll={virtualScroll}\n enteredTextLabel={i18nStrings.enteredTextLabel}\n ariaLabel={filteringAriaLabel ?? i18nStrings.filteringAriaLabel}\n placeholder={filteringPlaceholder ?? i18nStrings.filteringPlaceholder}\n ariaLabelledby={rest.ariaLabelledby}\n ariaDescribedby={textboxAriaDescribedBy}\n controlId={rest.controlId}\n value={filteringText}\n disabled={disabled}\n onKeyDown={handleKeyDown}\n {...autosuggestOptions}\n onChange={event => setFilteringText(event.detail.value)}\n empty={filteringEmpty}\n {...asyncAutosuggestProps}\n expandToViewport={expandToViewport}\n onOptionClick={handleSelected}\n customForm={\n operatorForm && (\n <PropertyEditor\n property={parsedText.property}\n operator={parsedText.operator}\n filter={parsedText.value}\n operatorForm={operatorForm}\n i18nStrings={i18nStrings}\n onCancel={() => {\n setFilteringText('');\n inputRef.current?.close();\n inputRef.current?.focus({ preventDropdown: true });\n }}\n onSubmit={token => {\n addToken(token);\n setFilteringText('');\n inputRef.current?.focus({ preventDropdown: true });\n inputRef.current?.close();\n }}\n />\n )\n }\n hideEnteredTextOption={internalFreeText.disabled && parsedText.step !== 'property'}\n clearAriaLabel={i18nStrings.clearAriaLabel}\n searchResultsId={showResults ? searchResultsId : undefined}\n />\n {showResults ? (\n <div className={styles.results}>\n <SearchResults id={searchResultsId}>{countText}</SearchResults>\n </div>\n ) : null}\n </div>\n {filteringConstraintText && (\n <div id={constraintTextId} className={styles.constraint}>\n {filteringConstraintText}\n </div>\n )}\n {internalQuery.tokens && internalQuery.tokens.length > 0 && (\n <div className={styles.tokens}>\n <InternalSpaceBetween size=\"xs\" direction=\"horizontal\">\n <TokenList\n alignment=\"inline\"\n limit={tokenLimit}\n items={internalQuery.tokens}\n limitShowFewerAriaLabel={tokenLimitShowFewerAriaLabel}\n limitShowMoreAriaLabel={tokenLimitShowMoreAriaLabel}\n renderItem={(token, tokenIndex) => (\n <TokenButton\n token={token}\n first={tokenIndex === 0}\n operation={internalQuery.operation}\n removeToken={() => {\n removeToken(tokenIndex);\n setRemovedTokenIndex(tokenIndex);\n }}\n setToken={(newToken: Token) => setToken(tokenIndex, newToken)}\n setOperation={setOperation}\n filteringProperties={internalProperties}\n filteringOptions={internalOptions}\n asyncProps={asyncProps}\n onLoadItems={onLoadItems}\n i18nStrings={i18nStrings}\n asyncProperties={asyncProperties}\n hideOperations={hideOperations}\n customGroupsText={customGroupsText}\n freeTextFiltering={internalFreeText}\n disabled={disabled}\n expandToViewport={expandToViewport}\n />\n )}\n i18nStrings={{\n limitShowFewer: i18nStrings.tokenLimitShowFewer,\n limitShowMore: i18nStrings.tokenLimitShowMore,\n }}\n after={\n customFilterActions ? (\n <div className={styles['custom-filter-actions']}>{customFilterActions}</div>\n ) : (\n <InternalButton\n formAction=\"none\"\n onClick={removeAllTokens}\n className={styles['remove-all']}\n disabled={disabled}\n >\n {i18nStrings.clearFiltersText}\n </InternalButton>\n )\n }\n moveFocusNextToIndex={removedTokenIndex}\n />\n </InternalSpaceBetween>\n </div>\n )}\n </div>\n );\n }\n);\n\napplyDisplayName(PropertyFilter, 'PropertyFilter');\nexport default PropertyFilter;\n"]}
|
|
@@ -252,9 +252,15 @@ export declare namespace PropertyFilterProps {
|
|
|
252
252
|
tokenLimitShowFewer?: string;
|
|
253
253
|
clearFiltersText?: string;
|
|
254
254
|
tokenOperatorAriaLabel?: string;
|
|
255
|
-
removeTokenButtonAriaLabel?: (token:
|
|
255
|
+
removeTokenButtonAriaLabel?: (token: FormattedToken) => string;
|
|
256
256
|
enteredTextLabel?: AutosuggestProps.EnteredTextLabel;
|
|
257
257
|
}
|
|
258
|
+
interface FormattedToken {
|
|
259
|
+
propertyKey?: string;
|
|
260
|
+
propertyLabel: string;
|
|
261
|
+
operator: ComparisonOperator;
|
|
262
|
+
value: string;
|
|
263
|
+
}
|
|
258
264
|
interface GroupText {
|
|
259
265
|
properties: string;
|
|
260
266
|
values: string;
|
|
@@ -285,6 +291,7 @@ export type LoadItemsDetail = PropertyFilterProps.LoadItemsDetail;
|
|
|
285
291
|
export type I18nStrings = PropertyFilterProps.I18nStrings;
|
|
286
292
|
export type GroupText = PropertyFilterProps.GroupText;
|
|
287
293
|
export type FilteringChangeDetail = PropertyFilterProps.FilteringChangeDetail;
|
|
294
|
+
export type FormattedToken = PropertyFilterProps.FormattedToken;
|
|
288
295
|
export type Ref = PropertyFilterProps.Ref;
|
|
289
296
|
export interface InternalFilteringProperty<TokenValue = any> {
|
|
290
297
|
propertyKey: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/property-filter/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,+BAA+B,EAC/B,uBAAuB,EACvB,sBAAsB,EACtB,8BAA8B,EAC9B,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,EAC/B,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB,EAAE,gBAAgB,EAAE,qBAAqB;IACtG;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC,WAAW,CAAC;IAC9C;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;OAUG;IACH,KAAK,EAAE,mBAAmB,CAAC,KAAK,CAAC;IACjC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,QAAQ,EAAE,yBAAyB,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC/D;;;;;;;;;OASG;IACH,mBAAmB,EAAE,aAAa,CAAC,mBAAmB,CAAC,iB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"interfaces.js","sourceRoot":"","sources":["../../../src/property-filter/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\n\nimport {\n PropertyFilterFreeTextFiltering,\n PropertyFilterOperation,\n PropertyFilterOperator,\n PropertyFilterOperatorExtended,\n PropertyFilterOperatorForm,\n PropertyFilterOperatorFormat,\n PropertyFilterOperatorFormProps,\n PropertyFilterOption,\n PropertyFilterProperty,\n PropertyFilterToken,\n} from '@cloudscape-design/collection-hooks';\n\nimport { AutosuggestProps } from '../autosuggest/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status';\nimport { FormFieldControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface PropertyFilterProps extends BaseComponentProps, ExpandToViewport, FormFieldControlProps {\n /**\n * If set to `true`, the filtering input will be disabled.\n * Use it, for example, if you are fetching new items upon filtering change\n * in order to prevent the user from changing the filtering query.\n */\n disabled?: boolean;\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: PropertyFilterProps.I18nStrings;\n /**\n * Accepts a human-readable, localized string that indicates the number of results. For example, \"1 match\" or \"165 matches.\"\n * If the total number of results is unknown, also include an indication that there may be more results than\n * the number listed. For example, \"25+ matches.\"\n *\n * The count text is only displayed when `query.tokens` isn't empty.\n */\n countText?: string;\n /**\n * An object representing the current query displayed in the property filter. Has two properties: `tokens` and `operation`.\n * `tokens` is an array of objects that will be displayed to the user beneath the filtering input.\n * Each token has the following properties:\n *\n * * value [string]: The string value of the token to be used as a filter.\n * * propertyKey [string]: The key of the corresponding property in filteringProperties.\n * * operator ['<' | '<=' | '>' | '>=' | ':' | '!:' | '=' | '!=' | '^' | '!^']: The operator which indicates how to filter the dataset using this token.\n *\n * `operation` has two valid values [and, or] and controls the join operation to be applied between tokens when filtering the items.\n */\n query: PropertyFilterProps.Query;\n /**\n * If hideOperations it set, the indicator of the operation (that is, `and` or `or`) and the selection of operations\n * (applied to the property and value token) are hidden from the user. Only use when you have a custom\n * filtering logic which combines tokens in different way than the default one. When used, ensure that\n * operations are communicated to the user in another way.\n */\n hideOperations?: boolean;\n /**\n * Fired when the `query` gets changed. Filter the dataset in response to this event using the values in the `detail` object.\n */\n onChange: NonCancelableEventHandler<PropertyFilterProps.Query>;\n /**\n * An array of properties by which the data set can be filtered. Each element has the following properties:\n *\n * * groupValuesLabel [string]: Localized string to display for the 'Values' group label for a specific property.\n * * key [string]: The identifier of this property.\n * * propertyLabel [string]: A human-readable string for the property.\n * * operators [Array]: A list of all operators supported by this property. If you omit the equals operator because your API does not support it, make sure to set `defaultOperator` to a supported operator from this list.\n * * group [string]: Optional identifier of a custom group that this filtering option is assigned to. Use to create additional groups below the default one. Make sure to also define labels for the group in the customGroupsText property. Notice that only one level of options nesting is supported.\n * * defaultOperator [ComparisonOperator]: Optional parameter that changes the default operator used with this filtering property. Use it only if your API does not support \"equals\" filtering terms with this property.\n */\n filteringProperties: ReadonlyArray<PropertyFilterProps.FilteringProperty>;\n /**\n * An array of possible values of the individual `filteringProperties`. Each element has the following properties:\n *\n * * `propertyKey` [string]: The key of the corresponding filtering property in the `filteringProperties` array.\n * * `value` [string]: The value that will be used as a suggestion when creating or modifying a filtering token.\n * * `label` [string]: Optional suggestion label to be matched instead of the value.\n *\n * Filtering options that require labels can only use `=` and `!=` operators. The token value must be labelled separately, for example:\n * ```\n * const filteringProperty = {\n * key: 'state',\n * propertyLabel: 'State',\n * operators: ['=', '!='].map(operator => ({ operator, format: getStateLabel }))\n * }\n * const filteringOptions = [\n * { propertyKey: 'state', value: 'STOPPED', label: getStateLabel('STOPPED') },\n * { propertyKey: 'state', value: 'STOPPING', label: getStateLabel('STOPPING') },\n * { propertyKey: 'state', value: 'RUNNING', label: getStateLabel('RUNNING') },\n * ]\n * ```\n */\n filteringOptions?: ReadonlyArray<PropertyFilterProps.FilteringOption>;\n /**\n * An array of objects that contain localized, human-readable strings for the labels of custom groups within the filtering dropdown. Use group property to associate the strings with your custom group of options. Define the following values for each group:\n *\n * * properties [string]: The group label in the filtering dropdown that contains the list of properties from this group. For example: Tags.\n * * values [string]: The group label in the filtering dropdown that contains the list of values from this group. For example: Tags values.\n * * group [string]: The identifier of a custom group.\n */\n customGroupsText?: PropertyFilterProps.GroupText[];\n /**\n * Set `disableFreeTextFiltering` only if you can’t filter the dataset using a filter that is applied to every column,\n * instead of a specific property. This would stop the user from creating such tokens.\n */\n disableFreeTextFiltering?: boolean;\n /**\n * An object configuring the operators for free text filtering, which has the following properties:\n *\n * * operators [Array]: A list of all operators supported for free text filtering. If you omit the contains operator because your API does not support it, make sure to set `defaultOperator` to a supported operator from this list.\n * * defaultOperator [ComparisonOperator]: An optional parameter that changes the default operator used for free text filtering. Use this parameter only if your API does not support \"contains\" free test filtering terms.\n */\n freeTextFiltering?: PropertyFilterProps.FreeTextFiltering;\n /**\n * Use this event to asynchronously load filteringOptions, component currently needs. The detail object contains following properties:\n *\n * * `filteringProperty` - The property for which you need to fetch the options.\n * * `filteringOperator` - The operator for which you need to fetch the options.\n * * `filteringText` - The value that you need to use to fetch options.\n * * `firstPage` - Indicates that you should fetch the first page of options for a `filteringProperty` that match the `filteringText`.\n * * `samePage` - Indicates that you should fetch the same page that you have previously fetched (for example, when the user clicks on the recovery button).\n */\n onLoadItems?: NonCancelableEventHandler<PropertyFilterProps.LoadItemsDetail>;\n /**\n * If you have more than 500 `filteringOptions`, enable this flag to apply a performance optimization that makes\n * the filtering experience smoother. We don't recommend enabling the feature if you have less than 500 options,\n * because the improvements to performance are offset by a visible scrolling lag. When you set this flag to true,\n * it removes options that are not currently in view from the DOM.\n */\n virtualScroll?: boolean;\n /**\n * A slot located before the filtering input. Use it if for a Select component if your dataset supports property\n * filter queries only after an initial filter is applied.\n */\n customControl?: React.ReactNode;\n /**\n * A slot that replaces the standard \"Clear filter\" button.\n * When using this slot, make sure to still provide a mechanism to clear all filters.\n */\n customFilterActions?: React.ReactNode;\n /**\n * Set `asyncProperties` if you need to load `filteringProperties` asynchronousely. This would cause extra `onLoadMore`\n * events to fire calling for more properties.\n */\n asyncProperties?: boolean;\n /**\n * Specifies the maximum number of displayed tokens. If the property isn't set, all of the tokens are displayed.\n */\n tokenLimit?: number;\n /**\n * The label that will be passed down to the Autosuggest `ariaLabel` property.\n * See the [Autosuggest API](/components/autosuggest/?tabId=api) page for more details.\n */\n filteringAriaLabel?: string;\n /**\n * Placeholder for the filtering input.\n */\n filteringPlaceholder?: string;\n /**\n * Displayed when there are no options to display.\n * This is only shown when `statusType` is set to `finished` or not set at all.\n */\n filteringEmpty?: React.ReactNode;\n /**\n * Specifies the text to display when in the loading state.\n **/\n filteringLoadingText?: string;\n /**\n * Specifies the text to display at the bottom of the dropdown menu after pagination has reached the end.\n **/\n filteringFinishedText?: string;\n /**\n * Specifies the text to display when a data fetching error occurs. Make sure that you provide `recoveryText`.\n **/\n filteringErrorText?: string;\n /**\n * Specifies the text for the recovery button. The text is displayed next to the error text.\n * Use the `onLoadItems` event to perform a recovery action (for example, retrying the request).\n **/\n filteringRecoveryText?: string;\n /**\n * Constraint text that's displayed below the filtering input.\n * Use this to provide additional information about supported filters.\n */\n filteringConstraintText?: React.ReactNode;\n /**\n * Specifies the current status of loading more options.\n * * `pending` - Indicates that no request in progress, but more options may be loaded.\n * * `loading` - Indicates that data fetching is in progress.\n * * `finished` - Indicates that pagination has finished and no more requests are expected.\n * * `error` - Indicates that an error occurred during fetch. You should use `recoveryText` to enable the user to recover.\n **/\n filteringStatusType?: DropdownStatusProps.StatusType;\n\n /**\n * Adds an aria-label to the \"Show fewer\" button for the token group control.\n * Use to assign unique labels when there are multiple token groups with the same `tokenLimitShowFewer` label on one page.\n */\n tokenLimitShowFewerAriaLabel?: string;\n /**\n * Adds an aria-label to the \"Show more\" button for the token group control.\n * Use to assign unique labels when there are multiple token groups with the same `tokenLimitShowMore` label on one page.\n */\n tokenLimitShowMoreAriaLabel?: string;\n}\n\nexport namespace PropertyFilterProps {\n export type Token = PropertyFilterToken;\n export type JoinOperation = PropertyFilterOperation;\n export type ComparisonOperator = PropertyFilterOperator;\n export type ExtendedOperator<TokenValue> = PropertyFilterOperatorExtended<TokenValue>;\n export type ExtendedOperatorFormProps<TokenValue> = PropertyFilterOperatorFormProps<TokenValue>;\n export type ExtendedOperatorForm<TokenValue> = PropertyFilterOperatorForm<TokenValue>;\n export type ExtendedOperatorFormat<TokenValue> = PropertyFilterOperatorFormat<TokenValue>;\n export type FilteringOption = PropertyFilterOption;\n export type FilteringProperty = PropertyFilterProperty;\n export type FreeTextFiltering = PropertyFilterFreeTextFiltering;\n\n export interface Query {\n tokens: ReadonlyArray<PropertyFilterProps.Token>;\n operation: PropertyFilterProps.JoinOperation;\n }\n\n export interface LoadItemsDetail {\n filteringProperty?: FilteringProperty;\n filteringOperator?: ComparisonOperator;\n filteringText: string;\n firstPage: boolean;\n samePage: boolean;\n }\n\n export interface I18nStrings {\n /**\n * @deprecated Use `filteringAriaLabel` on the component instead.\n */\n filteringAriaLabel?: string;\n\n /**\n * @deprecated Use `filteringPlaceholder` on the component instead.\n */\n filteringPlaceholder?: string;\n\n dismissAriaLabel?: string;\n clearAriaLabel?: string;\n groupValuesText?: string;\n groupPropertiesText?: string;\n operatorsText?: string;\n\n operationAndText?: string;\n operationOrText?: string;\n\n operatorLessText?: string;\n operatorLessOrEqualText?: string;\n operatorGreaterText?: string;\n operatorGreaterOrEqualText?: string;\n operatorContainsText?: string;\n operatorDoesNotContainText?: string;\n operatorEqualsText?: string;\n operatorDoesNotEqualText?: string;\n operatorStartsWithText?: string;\n operatorDoesNotStartWithText?: string;\n\n editTokenHeader?: string;\n propertyText?: string;\n operatorText?: string;\n valueText?: string;\n cancelActionText?: string;\n applyActionText?: string;\n allPropertiesLabel?: string;\n\n tokenLimitShowMore?: string;\n tokenLimitShowFewer?: string;\n clearFiltersText?: string;\n tokenOperatorAriaLabel?: string;\n removeTokenButtonAriaLabel?: (token: PropertyFilterProps.Token) => string;\n enteredTextLabel?: AutosuggestProps.EnteredTextLabel;\n }\n\n export interface GroupText {\n properties: string;\n values: string;\n group: string;\n }\n\n export interface FilteringChangeDetail {\n filteringText: string;\n filteringProperty?: FilteringProperty;\n }\n\n export interface Ref {\n /**\n * Sets focus on the underlying input control.\n */\n focus(): void;\n }\n}\n\n// Re-exported namespace interfaces to use module-style imports internally\n\nexport type Token = PropertyFilterProps.Token;\nexport type JoinOperation = PropertyFilterProps.JoinOperation;\nexport type ComparisonOperator = PropertyFilterProps.ComparisonOperator;\nexport type ExtendedOperator<TokenValue> = PropertyFilterOperatorExtended<TokenValue>;\nexport type ExtendedOperatorFormProps<TokenValue> = PropertyFilterOperatorFormProps<TokenValue>;\nexport type ExtendedOperatorForm<TokenValue> = PropertyFilterOperatorForm<TokenValue>;\nexport type ExtendedOperatorFormat<TokenValue> = PropertyFilterOperatorFormat<TokenValue>;\nexport type FilteringOption = PropertyFilterProps.FilteringOption;\nexport type FilteringProperty = PropertyFilterProps.FilteringProperty;\nexport type Query = PropertyFilterProps.Query;\nexport type LoadItemsDetail = PropertyFilterProps.LoadItemsDetail;\nexport type I18nStrings = PropertyFilterProps.I18nStrings;\nexport type GroupText = PropertyFilterProps.GroupText;\nexport type FilteringChangeDetail = PropertyFilterProps.FilteringChangeDetail;\nexport type Ref = PropertyFilterProps.Ref;\n\n// Utility types\n\nexport interface InternalFilteringProperty<TokenValue = any> {\n propertyKey: string;\n propertyLabel: string;\n groupValuesLabel: string;\n propertyGroup?: string;\n operators: readonly PropertyFilterOperator[];\n defaultOperator: PropertyFilterOperator;\n getValueFormatter: (operator?: PropertyFilterOperator) => null | ((value: any) => string);\n getValueFormRenderer: (operator?: PropertyFilterOperator) => null | PropertyFilterOperatorForm<TokenValue>;\n // Original property used in callbacks.\n externalProperty: PropertyFilterProperty;\n}\n\nexport interface InternalFilteringOption {\n property: null | InternalFilteringProperty;\n value: string;\n label: string;\n}\n\nexport interface InternalFreeTextFiltering {\n disabled: boolean;\n operators: readonly PropertyFilterOperator[];\n defaultOperator: PropertyFilterOperator;\n}\n\nexport interface InternalToken<TokenValue = any> {\n property: null | InternalFilteringProperty<TokenValue>;\n operator: PropertyFilterOperator;\n value: TokenValue;\n}\n\nexport interface InternalQuery {\n operation: PropertyFilterOperation;\n tokens: readonly InternalToken[];\n}\n\nexport type ParsedText =\n | { step: 'property'; property: InternalFilteringProperty; operator: ComparisonOperator; value: string }\n | { step: 'operator'; property: InternalFilteringProperty; operatorPrefix: string }\n | { step: 'free-text'; operator?: ComparisonOperator; value: string };\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/property-filter/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\n\nimport {\n PropertyFilterFreeTextFiltering,\n PropertyFilterOperation,\n PropertyFilterOperator,\n PropertyFilterOperatorExtended,\n PropertyFilterOperatorForm,\n PropertyFilterOperatorFormat,\n PropertyFilterOperatorFormProps,\n PropertyFilterOption,\n PropertyFilterProperty,\n PropertyFilterToken,\n} from '@cloudscape-design/collection-hooks';\n\nimport { AutosuggestProps } from '../autosuggest/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status';\nimport { FormFieldControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface PropertyFilterProps extends BaseComponentProps, ExpandToViewport, FormFieldControlProps {\n /**\n * If set to `true`, the filtering input will be disabled.\n * Use it, for example, if you are fetching new items upon filtering change\n * in order to prevent the user from changing the filtering query.\n */\n disabled?: boolean;\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: PropertyFilterProps.I18nStrings;\n /**\n * Accepts a human-readable, localized string that indicates the number of results. For example, \"1 match\" or \"165 matches.\"\n * If the total number of results is unknown, also include an indication that there may be more results than\n * the number listed. For example, \"25+ matches.\"\n *\n * The count text is only displayed when `query.tokens` isn't empty.\n */\n countText?: string;\n /**\n * An object representing the current query displayed in the property filter. Has two properties: `tokens` and `operation`.\n * `tokens` is an array of objects that will be displayed to the user beneath the filtering input.\n * Each token has the following properties:\n *\n * * value [string]: The string value of the token to be used as a filter.\n * * propertyKey [string]: The key of the corresponding property in filteringProperties.\n * * operator ['<' | '<=' | '>' | '>=' | ':' | '!:' | '=' | '!=' | '^' | '!^']: The operator which indicates how to filter the dataset using this token.\n *\n * `operation` has two valid values [and, or] and controls the join operation to be applied between tokens when filtering the items.\n */\n query: PropertyFilterProps.Query;\n /**\n * If hideOperations it set, the indicator of the operation (that is, `and` or `or`) and the selection of operations\n * (applied to the property and value token) are hidden from the user. Only use when you have a custom\n * filtering logic which combines tokens in different way than the default one. When used, ensure that\n * operations are communicated to the user in another way.\n */\n hideOperations?: boolean;\n /**\n * Fired when the `query` gets changed. Filter the dataset in response to this event using the values in the `detail` object.\n */\n onChange: NonCancelableEventHandler<PropertyFilterProps.Query>;\n /**\n * An array of properties by which the data set can be filtered. Each element has the following properties:\n *\n * * groupValuesLabel [string]: Localized string to display for the 'Values' group label for a specific property.\n * * key [string]: The identifier of this property.\n * * propertyLabel [string]: A human-readable string for the property.\n * * operators [Array]: A list of all operators supported by this property. If you omit the equals operator because your API does not support it, make sure to set `defaultOperator` to a supported operator from this list.\n * * group [string]: Optional identifier of a custom group that this filtering option is assigned to. Use to create additional groups below the default one. Make sure to also define labels for the group in the customGroupsText property. Notice that only one level of options nesting is supported.\n * * defaultOperator [ComparisonOperator]: Optional parameter that changes the default operator used with this filtering property. Use it only if your API does not support \"equals\" filtering terms with this property.\n */\n filteringProperties: ReadonlyArray<PropertyFilterProps.FilteringProperty>;\n /**\n * An array of possible values of the individual `filteringProperties`. Each element has the following properties:\n *\n * * `propertyKey` [string]: The key of the corresponding filtering property in the `filteringProperties` array.\n * * `value` [string]: The value that will be used as a suggestion when creating or modifying a filtering token.\n * * `label` [string]: Optional suggestion label to be matched instead of the value.\n *\n * Filtering options that require labels can only use `=` and `!=` operators. The token value must be labelled separately, for example:\n * ```\n * const filteringProperty = {\n * key: 'state',\n * propertyLabel: 'State',\n * operators: ['=', '!='].map(operator => ({ operator, format: getStateLabel }))\n * }\n * const filteringOptions = [\n * { propertyKey: 'state', value: 'STOPPED', label: getStateLabel('STOPPED') },\n * { propertyKey: 'state', value: 'STOPPING', label: getStateLabel('STOPPING') },\n * { propertyKey: 'state', value: 'RUNNING', label: getStateLabel('RUNNING') },\n * ]\n * ```\n */\n filteringOptions?: ReadonlyArray<PropertyFilterProps.FilteringOption>;\n /**\n * An array of objects that contain localized, human-readable strings for the labels of custom groups within the filtering dropdown. Use group property to associate the strings with your custom group of options. Define the following values for each group:\n *\n * * properties [string]: The group label in the filtering dropdown that contains the list of properties from this group. For example: Tags.\n * * values [string]: The group label in the filtering dropdown that contains the list of values from this group. For example: Tags values.\n * * group [string]: The identifier of a custom group.\n */\n customGroupsText?: PropertyFilterProps.GroupText[];\n /**\n * Set `disableFreeTextFiltering` only if you can’t filter the dataset using a filter that is applied to every column,\n * instead of a specific property. This would stop the user from creating such tokens.\n */\n disableFreeTextFiltering?: boolean;\n /**\n * An object configuring the operators for free text filtering, which has the following properties:\n *\n * * operators [Array]: A list of all operators supported for free text filtering. If you omit the contains operator because your API does not support it, make sure to set `defaultOperator` to a supported operator from this list.\n * * defaultOperator [ComparisonOperator]: An optional parameter that changes the default operator used for free text filtering. Use this parameter only if your API does not support \"contains\" free test filtering terms.\n */\n freeTextFiltering?: PropertyFilterProps.FreeTextFiltering;\n /**\n * Use this event to asynchronously load filteringOptions, component currently needs. The detail object contains following properties:\n *\n * * `filteringProperty` - The property for which you need to fetch the options.\n * * `filteringOperator` - The operator for which you need to fetch the options.\n * * `filteringText` - The value that you need to use to fetch options.\n * * `firstPage` - Indicates that you should fetch the first page of options for a `filteringProperty` that match the `filteringText`.\n * * `samePage` - Indicates that you should fetch the same page that you have previously fetched (for example, when the user clicks on the recovery button).\n */\n onLoadItems?: NonCancelableEventHandler<PropertyFilterProps.LoadItemsDetail>;\n /**\n * If you have more than 500 `filteringOptions`, enable this flag to apply a performance optimization that makes\n * the filtering experience smoother. We don't recommend enabling the feature if you have less than 500 options,\n * because the improvements to performance are offset by a visible scrolling lag. When you set this flag to true,\n * it removes options that are not currently in view from the DOM.\n */\n virtualScroll?: boolean;\n /**\n * A slot located before the filtering input. Use it if for a Select component if your dataset supports property\n * filter queries only after an initial filter is applied.\n */\n customControl?: React.ReactNode;\n /**\n * A slot that replaces the standard \"Clear filter\" button.\n * When using this slot, make sure to still provide a mechanism to clear all filters.\n */\n customFilterActions?: React.ReactNode;\n /**\n * Set `asyncProperties` if you need to load `filteringProperties` asynchronousely. This would cause extra `onLoadMore`\n * events to fire calling for more properties.\n */\n asyncProperties?: boolean;\n /**\n * Specifies the maximum number of displayed tokens. If the property isn't set, all of the tokens are displayed.\n */\n tokenLimit?: number;\n /**\n * The label that will be passed down to the Autosuggest `ariaLabel` property.\n * See the [Autosuggest API](/components/autosuggest/?tabId=api) page for more details.\n */\n filteringAriaLabel?: string;\n /**\n * Placeholder for the filtering input.\n */\n filteringPlaceholder?: string;\n /**\n * Displayed when there are no options to display.\n * This is only shown when `statusType` is set to `finished` or not set at all.\n */\n filteringEmpty?: React.ReactNode;\n /**\n * Specifies the text to display when in the loading state.\n **/\n filteringLoadingText?: string;\n /**\n * Specifies the text to display at the bottom of the dropdown menu after pagination has reached the end.\n **/\n filteringFinishedText?: string;\n /**\n * Specifies the text to display when a data fetching error occurs. Make sure that you provide `recoveryText`.\n **/\n filteringErrorText?: string;\n /**\n * Specifies the text for the recovery button. The text is displayed next to the error text.\n * Use the `onLoadItems` event to perform a recovery action (for example, retrying the request).\n **/\n filteringRecoveryText?: string;\n /**\n * Constraint text that's displayed below the filtering input.\n * Use this to provide additional information about supported filters.\n */\n filteringConstraintText?: React.ReactNode;\n /**\n * Specifies the current status of loading more options.\n * * `pending` - Indicates that no request in progress, but more options may be loaded.\n * * `loading` - Indicates that data fetching is in progress.\n * * `finished` - Indicates that pagination has finished and no more requests are expected.\n * * `error` - Indicates that an error occurred during fetch. You should use `recoveryText` to enable the user to recover.\n **/\n filteringStatusType?: DropdownStatusProps.StatusType;\n\n /**\n * Adds an aria-label to the \"Show fewer\" button for the token group control.\n * Use to assign unique labels when there are multiple token groups with the same `tokenLimitShowFewer` label on one page.\n */\n tokenLimitShowFewerAriaLabel?: string;\n /**\n * Adds an aria-label to the \"Show more\" button for the token group control.\n * Use to assign unique labels when there are multiple token groups with the same `tokenLimitShowMore` label on one page.\n */\n tokenLimitShowMoreAriaLabel?: string;\n}\n\nexport namespace PropertyFilterProps {\n export type Token = PropertyFilterToken;\n export type JoinOperation = PropertyFilterOperation;\n export type ComparisonOperator = PropertyFilterOperator;\n export type ExtendedOperator<TokenValue> = PropertyFilterOperatorExtended<TokenValue>;\n export type ExtendedOperatorFormProps<TokenValue> = PropertyFilterOperatorFormProps<TokenValue>;\n export type ExtendedOperatorForm<TokenValue> = PropertyFilterOperatorForm<TokenValue>;\n export type ExtendedOperatorFormat<TokenValue> = PropertyFilterOperatorFormat<TokenValue>;\n export type FilteringOption = PropertyFilterOption;\n export type FilteringProperty = PropertyFilterProperty;\n export type FreeTextFiltering = PropertyFilterFreeTextFiltering;\n\n export interface Query {\n tokens: ReadonlyArray<PropertyFilterProps.Token>;\n operation: PropertyFilterProps.JoinOperation;\n }\n\n export interface LoadItemsDetail {\n filteringProperty?: FilteringProperty;\n filteringOperator?: ComparisonOperator;\n filteringText: string;\n firstPage: boolean;\n samePage: boolean;\n }\n\n export interface I18nStrings {\n /**\n * @deprecated Use `filteringAriaLabel` on the component instead.\n */\n filteringAriaLabel?: string;\n\n /**\n * @deprecated Use `filteringPlaceholder` on the component instead.\n */\n filteringPlaceholder?: string;\n\n dismissAriaLabel?: string;\n clearAriaLabel?: string;\n groupValuesText?: string;\n groupPropertiesText?: string;\n operatorsText?: string;\n\n operationAndText?: string;\n operationOrText?: string;\n\n operatorLessText?: string;\n operatorLessOrEqualText?: string;\n operatorGreaterText?: string;\n operatorGreaterOrEqualText?: string;\n operatorContainsText?: string;\n operatorDoesNotContainText?: string;\n operatorEqualsText?: string;\n operatorDoesNotEqualText?: string;\n operatorStartsWithText?: string;\n operatorDoesNotStartWithText?: string;\n\n editTokenHeader?: string;\n propertyText?: string;\n operatorText?: string;\n valueText?: string;\n cancelActionText?: string;\n applyActionText?: string;\n allPropertiesLabel?: string;\n\n tokenLimitShowMore?: string;\n tokenLimitShowFewer?: string;\n clearFiltersText?: string;\n tokenOperatorAriaLabel?: string;\n removeTokenButtonAriaLabel?: (token: FormattedToken) => string;\n enteredTextLabel?: AutosuggestProps.EnteredTextLabel;\n }\n\n export interface FormattedToken {\n propertyKey?: string;\n propertyLabel: string;\n operator: ComparisonOperator;\n value: string;\n }\n\n export interface GroupText {\n properties: string;\n values: string;\n group: string;\n }\n\n export interface FilteringChangeDetail {\n filteringText: string;\n filteringProperty?: FilteringProperty;\n }\n\n export interface Ref {\n /**\n * Sets focus on the underlying input control.\n */\n focus(): void;\n }\n}\n\n// Re-exported namespace interfaces to use module-style imports internally\n\nexport type Token = PropertyFilterProps.Token;\nexport type JoinOperation = PropertyFilterProps.JoinOperation;\nexport type ComparisonOperator = PropertyFilterProps.ComparisonOperator;\nexport type ExtendedOperator<TokenValue> = PropertyFilterOperatorExtended<TokenValue>;\nexport type ExtendedOperatorFormProps<TokenValue> = PropertyFilterOperatorFormProps<TokenValue>;\nexport type ExtendedOperatorForm<TokenValue> = PropertyFilterOperatorForm<TokenValue>;\nexport type ExtendedOperatorFormat<TokenValue> = PropertyFilterOperatorFormat<TokenValue>;\nexport type FilteringOption = PropertyFilterProps.FilteringOption;\nexport type FilteringProperty = PropertyFilterProps.FilteringProperty;\nexport type Query = PropertyFilterProps.Query;\nexport type LoadItemsDetail = PropertyFilterProps.LoadItemsDetail;\nexport type I18nStrings = PropertyFilterProps.I18nStrings;\nexport type GroupText = PropertyFilterProps.GroupText;\nexport type FilteringChangeDetail = PropertyFilterProps.FilteringChangeDetail;\nexport type FormattedToken = PropertyFilterProps.FormattedToken;\nexport type Ref = PropertyFilterProps.Ref;\n\n// Utility types\n\nexport interface InternalFilteringProperty<TokenValue = any> {\n propertyKey: string;\n propertyLabel: string;\n groupValuesLabel: string;\n propertyGroup?: string;\n operators: readonly PropertyFilterOperator[];\n defaultOperator: PropertyFilterOperator;\n getValueFormatter: (operator?: PropertyFilterOperator) => null | ((value: any) => string);\n getValueFormRenderer: (operator?: PropertyFilterOperator) => null | PropertyFilterOperatorForm<TokenValue>;\n // Original property used in callbacks.\n externalProperty: PropertyFilterProperty;\n}\n\nexport interface InternalFilteringOption {\n property: null | InternalFilteringProperty;\n value: string;\n label: string;\n}\n\nexport interface InternalFreeTextFiltering {\n disabled: boolean;\n operators: readonly PropertyFilterOperator[];\n defaultOperator: PropertyFilterOperator;\n}\n\nexport interface InternalToken<TokenValue = any> {\n property: null | InternalFilteringProperty<TokenValue>;\n operator: PropertyFilterOperator;\n value: TokenValue;\n}\n\nexport interface InternalQuery {\n operation: PropertyFilterOperation;\n tokens: readonly InternalToken[];\n}\n\nexport type ParsedText =\n | { step: 'property'; property: InternalFilteringProperty; operator: ComparisonOperator; value: string }\n | { step: 'operator'; property: InternalFilteringProperty; operatorPrefix: string }\n | { step: 'free-text'; operator?: ComparisonOperator; value: string };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../src/property-filter/token.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../src/property-filter/token.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAG/D,OAAO,EAEL,SAAS,EACT,WAAW,EACX,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,aAAa,EACb,aAAa,EACb,eAAe,EACf,KAAK,EACN,MAAM,cAAc,CAAC;AAKtB,UAAU,UAAU;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,mBAAmB,CAAC;IAChC,gBAAgB,EAAE,SAAS,SAAS,EAAE,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,yBAAyB,CAAC;IAC7C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,mBAAmB,EAAE,SAAS,yBAAyB,EAAE,CAAC;IAC1D,gBAAgB,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,CAAC;IACzD,SAAS,EAAE,aAAa,CAAC;IACzB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,EAAE,CAAC,YAAY,EAAE,aAAa,KAAK,IAAI,CAAC;IACpD,QAAQ,EAAE,CAAC,QAAQ,EAAE,KAAK,KAAK,IAAI,CAAC;IACpC,KAAK,EAAE,aAAa,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,qPAkBrB,UAAU,gBAuDZ,CAAC"}
|
package/property-filter/token.js
CHANGED
|
@@ -2,35 +2,34 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import React, { useRef, useState } from 'react';
|
|
4
4
|
import FilteringToken from './filtering-token';
|
|
5
|
+
import { getFormattedToken } from './i18n-utils';
|
|
5
6
|
import { TokenEditor } from './token-editor';
|
|
6
|
-
import { getFormattedToken } from './utils';
|
|
7
7
|
import styles from './styles.css.js';
|
|
8
8
|
export const TokenButton = ({ token, operation = 'and', first, removeToken, setToken, setOperation, filteringProperties, filteringOptions, asyncProps, onLoadItems, i18nStrings, asyncProperties, hideOperations, customGroupsText, disabled, freeTextFiltering, expandToViewport, }) => {
|
|
9
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
9
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
10
10
|
const tokenRef = useRef(null);
|
|
11
|
-
const
|
|
12
|
-
const formattedToken = getFormattedToken(token);
|
|
11
|
+
const formattedToken = getFormattedToken(token, i18nStrings);
|
|
13
12
|
const [temporaryToken, setTemporaryToken] = useState(token);
|
|
14
13
|
return (React.createElement(FilteringToken, { ref: tokenRef, tokens: [
|
|
15
14
|
{
|
|
16
15
|
content: (React.createElement("span", { className: styles['token-trigger'] },
|
|
17
|
-
React.createElement(TokenTrigger, {
|
|
18
|
-
ariaLabel: formattedToken.
|
|
19
|
-
dismissAriaLabel: (
|
|
16
|
+
React.createElement(TokenTrigger, { token: formattedToken, allProperties: token.property === null }))),
|
|
17
|
+
ariaLabel: `${formattedToken.propertyLabel} ${formattedToken.operator} ${formattedToken.value}`,
|
|
18
|
+
dismissAriaLabel: (_b = (_a = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.removeTokenButtonAriaLabel) === null || _a === void 0 ? void 0 : _a.call(i18nStrings, formattedToken)) !== null && _b !== void 0 ? _b : '',
|
|
20
19
|
},
|
|
21
|
-
], showOperation: !first && !hideOperations, operation: operation, andText: (
|
|
20
|
+
], showOperation: !first && !hideOperations, operation: operation, andText: (_c = i18nStrings.operationAndText) !== null && _c !== void 0 ? _c : '', orText: (_d = i18nStrings.operationOrText) !== null && _d !== void 0 ? _d : '', operationAriaLabel: (_e = i18nStrings.tokenOperatorAriaLabel) !== null && _e !== void 0 ? _e : '', onChangeOperation: setOperation, onDismissToken: removeToken, disabled: disabled, editorContent: React.createElement(TokenEditor, { setToken: setToken, filteringProperties: filteringProperties, filteringOptions: filteringOptions, temporaryToken: temporaryToken, onChangeTemporaryToken: setTemporaryToken, asyncProps: asyncProps, onLoadItems: onLoadItems, i18nStrings: i18nStrings, asyncProperties: asyncProperties, customGroupsText: customGroupsText, freeTextFiltering: freeTextFiltering, onDismiss: () => { var _a; return (_a = tokenRef.current) === null || _a === void 0 ? void 0 : _a.closeEditor(); } }), editorHeader: (_f = i18nStrings.editTokenHeader) !== null && _f !== void 0 ? _f : '', editorDismissAriaLabel: (_g = i18nStrings.dismissAriaLabel) !== null && _g !== void 0 ? _g : '', editorExpandToViewport: !!expandToViewport, onEditorOpen: () => setTemporaryToken(token),
|
|
22
21
|
// The properties below are only relevant for grouped tokens that are not supported
|
|
23
22
|
// by the property filter component yet.
|
|
24
23
|
groupOperation: operation, groupAriaLabel: '', groupEditAriaLabel: '', onChangeGroupOperation: () => { }, hasGroups: false }));
|
|
25
24
|
};
|
|
26
|
-
const TokenTrigger = ({
|
|
27
|
-
if (
|
|
28
|
-
|
|
25
|
+
const TokenTrigger = ({ token: { propertyLabel, operator, value }, allProperties, }) => {
|
|
26
|
+
if (propertyLabel) {
|
|
27
|
+
propertyLabel += ' ';
|
|
29
28
|
}
|
|
30
|
-
const freeTextContainsToken = operator === ':' &&
|
|
29
|
+
const freeTextContainsToken = operator === ':' && allProperties;
|
|
31
30
|
const operatorText = freeTextContainsToken ? '' : operator + ' ';
|
|
32
31
|
return (React.createElement(React.Fragment, null,
|
|
33
|
-
|
|
32
|
+
allProperties ? '' : propertyLabel,
|
|
34
33
|
React.createElement("span", { className: styles['token-operator'] }, operatorText),
|
|
35
34
|
value));
|
|
36
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../src/property-filter/token.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIhD,OAAO,cAAqC,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../src/property-filter/token.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIhD,OAAO,cAAqC,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAajD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAsBrC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,KAAK,EACL,SAAS,GAAG,KAAK,EACjB,KAAK,EACL,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,WAAW,EACX,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,GACL,EAAE,EAAE;;IACf,MAAM,QAAQ,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IACjD,MAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IAC7D,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAgB,KAAK,CAAC,CAAC;IAC3E,OAAO,CACL,oBAAC,cAAc,IACb,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE;YACN;gBACE,OAAO,EAAE,CACP,8BAAM,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC;oBACtC,oBAAC,YAAY,IAAC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,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC;QAC5C,mFAAmF;QACnF,wCAAwC;QACxC,cAAc,EAAE,SAAS,EACzB,cAAc,EAAE,EAAE,EAClB,kBAAkB,EAAE,EAAE,EACtB,sBAAsB,EAAE,GAAG,EAAE,GAAE,CAAC,EAChC,SAAS,EAAE,KAAK,GAChB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,EACpB,KAAK,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,EACzC,aAAa,GAId,EAAE,EAAE;IACH,IAAI,aAAa,EAAE;QACjB,aAAa,IAAI,GAAG,CAAC;KACtB;IACD,MAAM,qBAAqB,GAAG,QAAQ,KAAK,GAAG,IAAI,aAAa,CAAC;IAChE,MAAM,YAAY,GAAG,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,GAAG,CAAC;IACjE,OAAO,CACL;QACG,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa;QACnC,8BAAM,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,IAAG,YAAY,CAAQ;QAC/D,KAAK,CACL,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useRef, useState } from 'react';\n\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport FilteringToken, { FilteringTokenRef } from './filtering-token';\nimport { getFormattedToken } from './i18n-utils';\nimport {\n FormattedToken,\n GroupText,\n I18nStrings,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n InternalToken,\n JoinOperation,\n LoadItemsDetail,\n Token,\n} from './interfaces';\nimport { TokenEditor } from './token-editor';\n\nimport styles from './styles.css.js';\n\ninterface TokenProps {\n asyncProperties?: boolean;\n asyncProps: DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n disabled?: boolean;\n freeTextFiltering: InternalFreeTextFiltering;\n expandToViewport?: boolean;\n filteringProperties: readonly InternalFilteringProperty[];\n filteringOptions: readonly InternalFilteringOption[];\n first?: boolean;\n hideOperations?: boolean;\n i18nStrings: I18nStrings;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n operation: JoinOperation;\n removeToken: () => void;\n setOperation: (newOperation: JoinOperation) => void;\n setToken: (newToken: Token) => void;\n token: InternalToken;\n}\n\nexport const TokenButton = ({\n token,\n operation = 'and',\n first,\n removeToken,\n setToken,\n setOperation,\n filteringProperties,\n filteringOptions,\n asyncProps,\n onLoadItems,\n i18nStrings,\n asyncProperties,\n hideOperations,\n customGroupsText,\n disabled,\n freeTextFiltering,\n expandToViewport,\n}: TokenProps) => {\n const tokenRef = useRef<FilteringTokenRef>(null);\n const formattedToken = getFormattedToken(token, i18nStrings);\n const [temporaryToken, setTemporaryToken] = useState<InternalToken>(token);\n return (\n <FilteringToken\n ref={tokenRef}\n tokens={[\n {\n content: (\n <span className={styles['token-trigger']}>\n <TokenTrigger token={formattedToken} allProperties={token.property === null} />\n </span>\n ),\n ariaLabel: `${formattedToken.propertyLabel} ${formattedToken.operator} ${formattedToken.value}`,\n dismissAriaLabel: i18nStrings?.removeTokenButtonAriaLabel?.(formattedToken) ?? '',\n },\n ]}\n showOperation={!first && !hideOperations}\n operation={operation}\n andText={i18nStrings.operationAndText ?? ''}\n orText={i18nStrings.operationOrText ?? ''}\n operationAriaLabel={i18nStrings.tokenOperatorAriaLabel ?? ''}\n onChangeOperation={setOperation}\n onDismissToken={removeToken}\n disabled={disabled}\n editorContent={\n <TokenEditor\n setToken={setToken}\n filteringProperties={filteringProperties}\n filteringOptions={filteringOptions}\n temporaryToken={temporaryToken}\n onChangeTemporaryToken={setTemporaryToken}\n asyncProps={asyncProps}\n onLoadItems={onLoadItems}\n i18nStrings={i18nStrings}\n asyncProperties={asyncProperties}\n customGroupsText={customGroupsText}\n freeTextFiltering={freeTextFiltering}\n onDismiss={() => tokenRef.current?.closeEditor()}\n />\n }\n editorHeader={i18nStrings.editTokenHeader ?? ''}\n editorDismissAriaLabel={i18nStrings.dismissAriaLabel ?? ''}\n editorExpandToViewport={!!expandToViewport}\n onEditorOpen={() => setTemporaryToken(token)}\n // The properties below are only relevant for grouped tokens that are not supported\n // by the property filter component yet.\n groupOperation={operation}\n groupAriaLabel={''}\n groupEditAriaLabel={''}\n onChangeGroupOperation={() => {}}\n hasGroups={false}\n />\n );\n};\n\nconst TokenTrigger = ({\n token: { propertyLabel, operator, value },\n allProperties,\n}: {\n token: FormattedToken;\n allProperties: boolean;\n}) => {\n if (propertyLabel) {\n propertyLabel += ' ';\n }\n const freeTextContainsToken = operator === ':' && allProperties;\n const operatorText = freeTextContainsToken ? '' : operator + ' ';\n return (\n <>\n {allProperties ? '' : propertyLabel}\n <span className={styles['token-operator']}>{operatorText}</span>\n {value}\n </>\n );\n};\n"]}
|
|
@@ -3,12 +3,6 @@ export declare function matchFilteringProperty(filteringProperties: readonly Int
|
|
|
3
3
|
export declare function matchOperator(allowedOperators: readonly ComparisonOperator[], filteringText: string): null | ComparisonOperator;
|
|
4
4
|
export declare function matchOperatorPrefix(allowedOperators: readonly ComparisonOperator[], filteringText: string): null | string;
|
|
5
5
|
export declare function matchTokenValue({ property, operator, value }: InternalToken, filteringOptions: readonly InternalFilteringOption[]): Token;
|
|
6
|
-
export declare function getFormattedToken(token: InternalToken): {
|
|
7
|
-
property: string;
|
|
8
|
-
operator: string;
|
|
9
|
-
value: any;
|
|
10
|
-
label: string;
|
|
11
|
-
};
|
|
12
6
|
export declare function trimStart(source: string): string;
|
|
13
7
|
export declare function trimFirstSpace(source: string): string;
|
|
14
8
|
export declare function removeOperator(source: string, operator: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/property-filter/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,EACzB,aAAa,EACb,KAAK,EACN,MAAM,cAAc,CAAC;AAGtB,wBAAgB,sBAAsB,CACpC,mBAAmB,EAAE,SAAS,yBAAyB,EAAE,EACzD,aAAa,EAAE,MAAM,GACpB,IAAI,GAAG,yBAAyB,CAgBlC;AAGD,wBAAgB,aAAa,CAC3B,gBAAgB,EAAE,SAAS,kBAAkB,EAAE,EAC/C,aAAa,EAAE,MAAM,GACpB,IAAI,GAAG,kBAAkB,CAc3B;AAGD,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,SAAS,kBAAkB,EAAE,EAC/C,aAAa,EAAE,MAAM,GACpB,IAAI,GAAG,MAAM,CAUf;AAED,wBAAgB,eAAe,CAC7B,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,aAAa,EAC5C,gBAAgB,EAAE,SAAS,uBAAuB,EAAE,GACnD,KAAK,CAkBP;AAED,wBAAgB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/property-filter/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,EACzB,aAAa,EACb,KAAK,EACN,MAAM,cAAc,CAAC;AAGtB,wBAAgB,sBAAsB,CACpC,mBAAmB,EAAE,SAAS,yBAAyB,EAAE,EACzD,aAAa,EAAE,MAAM,GACpB,IAAI,GAAG,yBAAyB,CAgBlC;AAGD,wBAAgB,aAAa,CAC3B,gBAAgB,EAAE,SAAS,kBAAkB,EAAE,EAC/C,aAAa,EAAE,MAAM,GACpB,IAAI,GAAG,kBAAkB,CAc3B;AAGD,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,SAAS,kBAAkB,EAAE,EAC/C,aAAa,EAAE,MAAM,GACpB,IAAI,GAAG,MAAM,CAUf;AAED,wBAAgB,eAAe,CAC7B,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,aAAa,EAC5C,gBAAgB,EAAE,SAAS,uBAAuB,EAAE,GACnD,KAAK,CAkBP;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAUhD;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAQ9D"}
|
package/property-filter/utils.js
CHANGED
|
@@ -57,14 +57,6 @@ export function matchTokenValue({ property, operator, value }, filteringOptions)
|
|
|
57
57
|
}
|
|
58
58
|
return bestMatch;
|
|
59
59
|
}
|
|
60
|
-
export function getFormattedToken(token) {
|
|
61
|
-
var _a;
|
|
62
|
-
const valueFormatter = (_a = token.property) === null || _a === void 0 ? void 0 : _a.getValueFormatter(token.operator);
|
|
63
|
-
const propertyLabel = token.property && token.property.propertyLabel;
|
|
64
|
-
const tokenValue = valueFormatter ? valueFormatter(token.value) : token.value;
|
|
65
|
-
const label = `${propertyLabel !== null && propertyLabel !== void 0 ? propertyLabel : ''} ${token.operator} ${tokenValue}`;
|
|
66
|
-
return { property: propertyLabel !== null && propertyLabel !== void 0 ? propertyLabel : '', operator: token.operator, value: tokenValue, label };
|
|
67
|
-
}
|
|
68
60
|
export function trimStart(source) {
|
|
69
61
|
let spacesLength = 0;
|
|
70
62
|
for (let i = 0; i < source.length; i++) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/property-filter/utils.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAUtC,6DAA6D;AAC7D,MAAM,UAAU,sBAAsB,CACpC,mBAAyD,EACzD,aAAqB;IAErB,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,eAAe,GAAqC,IAAI,CAAC;IAE7D,KAAK,MAAM,QAAQ,IAAI,mBAAmB,EAAE;QA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AI,YAAY,GAAG,CAAC,CAAC;IACrB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YACrB,YAAY,EAAE,CAAC;SAChB;aAAM;YACL,MAAM;SACP;KACF;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAc,EAAE,QAAgB;IAC7D,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC;IACrE,MAAM,mBAAmB,GAAG,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC5D,2EAA2E;IAC3E,kFAAkF;IAClF,oFAAoF;IACpF,6BAA6B;IAC7B,OAAO,cAAc,CAAC,mBAAmB,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,UAAU,CAAC,MAAc,EAAE,MAAc;IAChD,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n ComparisonOperator,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalToken,\n Token,\n} from './interfaces';\n\n// Finds the longest property the filtering text starts from.\nexport function matchFilteringProperty(\n filteringProperties: readonly InternalFilteringProperty[],\n filteringText: string\n): null | InternalFilteringProperty {\n let maxLength = 0;\n let matchedProperty: null | InternalFilteringProperty = null;\n\n for (const property of filteringProperties) {\n if (\n (property.propertyLabel.length >= maxLength && startsWith(filteringText, property.propertyLabel)) ||\n (property.propertyLabel.length > maxLength &&\n startsWith(filteringText.toLowerCase(), property.propertyLabel.toLowerCase()))\n ) {\n maxLength = property.propertyLabel.length;\n matchedProperty = property;\n }\n }\n\n return matchedProperty;\n}\n\n// Finds the longest operator the filtering text starts from.\nexport function matchOperator(\n allowedOperators: readonly ComparisonOperator[],\n filteringText: string\n): null | ComparisonOperator {\n filteringText = filteringText.toLowerCase();\n\n let maxLength = 0;\n let matchedOperator: null | ComparisonOperator = null;\n\n for (const operator of allowedOperators) {\n if (operator.length > maxLength && startsWith(filteringText, operator.toLowerCase())) {\n maxLength = operator.length;\n matchedOperator = operator;\n }\n }\n\n return matchedOperator;\n}\n\n// Finds if the filtering text matches any operator prefix.\nexport function matchOperatorPrefix(\n allowedOperators: readonly ComparisonOperator[],\n filteringText: string\n): null | string {\n if (filteringText.trim().length === 0) {\n return '';\n }\n for (const operator of allowedOperators) {\n if (startsWith(operator.toLowerCase(), filteringText.toLowerCase())) {\n return filteringText;\n }\n }\n return null;\n}\n\nexport function matchTokenValue(\n { property, operator, value }: InternalToken,\n filteringOptions: readonly InternalFilteringOption[]\n): Token {\n const propertyOptions = filteringOptions.filter(option => option.property === property);\n const bestMatch: Token = { propertyKey: property?.propertyKey, operator, value };\n for (const option of propertyOptions) {\n if ((option.label && option.label === value) || (!option.label && option.value === value)) {\n // exact match found: return it\n return { propertyKey: property?.propertyKey, operator, value: option.value };\n }\n\n // By default, the token value is a string, but when a custom property is used,\n // the token value can be any, therefore we need to check for its type before calling toLowerCase()\n if (typeof value === 'string' && value.toLowerCase() === (option.label ?? option.value ?? '').toLowerCase()) {\n // non-exact match: save and keep running in case exact match found later\n bestMatch.value = option.value;\n }\n }\n\n return bestMatch;\n}\n\nexport function trimStart(source: string): string {\n let spacesLength = 0;\n for (let i = 0; i < source.length; i++) {\n if (source[i] === ' ') {\n spacesLength++;\n } else {\n break;\n }\n }\n return source.slice(spacesLength);\n}\n\nexport function trimFirstSpace(source: string): string {\n return source[0] === ' ' ? source.slice(1) : source;\n}\n\nexport function removeOperator(source: string, operator: string) {\n const operatorLastIndex = source.indexOf(operator) + operator.length;\n const textWithoutOperator = source.slice(operatorLastIndex);\n // We need to remove the first leading space in case the user presses space\n // after the operator, for example: Owner: admin, will result in value of ` admin`\n // and we need to remove the first space, if the user added any more spaces only the\n // first one will be removed.\n return trimFirstSpace(textWithoutOperator);\n}\n\nfunction startsWith(source: string, target: string): boolean {\n return source.indexOf(target) === 0;\n}\n"]}
|
package/tabs/styles.css.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"tabs-header": "awsui_tabs-
|
|
5
|
-
"tabs-header-list": "awsui_tabs-header-
|
|
6
|
-
"pagination-button": "awsui_pagination-
|
|
7
|
-
"pagination-button-left": "awsui_pagination-button-
|
|
8
|
-
"pagination-button-left-scrollable": "awsui_pagination-button-left-
|
|
9
|
-
"pagination-button-right": "awsui_pagination-button-
|
|
10
|
-
"pagination-button-right-scrollable": "awsui_pagination-button-right-
|
|
11
|
-
"tabs-tab": "awsui_tabs-
|
|
12
|
-
"tabs-tab-label": "awsui_tabs-tab-
|
|
13
|
-
"tabs-tab-
|
|
14
|
-
"tabs-tab-
|
|
15
|
-
"tabs-tab-
|
|
16
|
-
"refresh": "
|
|
17
|
-
"tabs-tab-disabled": "awsui_tabs-tab-
|
|
18
|
-
"tabs-tab-link": "awsui_tabs-tab-
|
|
19
|
-
"tabs-tab-active": "awsui_tabs-tab-
|
|
20
|
-
"tabs-header-with-divider": "awsui_tabs-header-with-
|
|
21
|
-
"tabs-tab-focusable": "awsui_tabs-tab-
|
|
22
|
-
"root": "
|
|
23
|
-
"tabs": "
|
|
24
|
-
"tabs-content": "awsui_tabs-
|
|
25
|
-
"fit-height": "awsui_fit-
|
|
26
|
-
"tabs-content-active": "awsui_tabs-content-
|
|
27
|
-
"tabs-content-wrapper": "awsui_tabs-content-
|
|
28
|
-
"with-paddings": "awsui_with-
|
|
29
|
-
"tabs-container-content-wrapper": "awsui_tabs-container-content-
|
|
30
|
-
"disabled-reason-tooltip": "awsui_disabled-reason-
|
|
31
|
-
"tabs-tab-focused": "awsui_tabs-tab-
|
|
4
|
+
"tabs-header": "awsui_tabs-header_14rmt_1wcao_194",
|
|
5
|
+
"tabs-header-list": "awsui_tabs-header-list_14rmt_1wcao_202",
|
|
6
|
+
"pagination-button": "awsui_pagination-button_14rmt_1wcao_219",
|
|
7
|
+
"pagination-button-left": "awsui_pagination-button-left_14rmt_1wcao_226",
|
|
8
|
+
"pagination-button-left-scrollable": "awsui_pagination-button-left-scrollable_14rmt_1wcao_229",
|
|
9
|
+
"pagination-button-right": "awsui_pagination-button-right_14rmt_1wcao_233",
|
|
10
|
+
"pagination-button-right-scrollable": "awsui_pagination-button-right-scrollable_14rmt_1wcao_236",
|
|
11
|
+
"tabs-tab": "awsui_tabs-tab_14rmt_1wcao_241",
|
|
12
|
+
"tabs-tab-label": "awsui_tabs-tab-label_14rmt_1wcao_250",
|
|
13
|
+
"tabs-tab-header-container": "awsui_tabs-tab-header-container_14rmt_1wcao_261",
|
|
14
|
+
"tabs-tab-dismiss": "awsui_tabs-tab-dismiss_14rmt_1wcao_272",
|
|
15
|
+
"tabs-tab-action": "awsui_tabs-tab-action_14rmt_1wcao_272",
|
|
16
|
+
"refresh": "awsui_refresh_14rmt_1wcao_276",
|
|
17
|
+
"tabs-tab-disabled": "awsui_tabs-tab-disabled_14rmt_1wcao_280",
|
|
18
|
+
"tabs-tab-link": "awsui_tabs-tab-link_14rmt_1wcao_322",
|
|
19
|
+
"tabs-tab-active": "awsui_tabs-tab-active_14rmt_1wcao_398",
|
|
20
|
+
"tabs-header-with-divider": "awsui_tabs-header-with-divider_14rmt_1wcao_405",
|
|
21
|
+
"tabs-tab-focusable": "awsui_tabs-tab-focusable_14rmt_1wcao_409",
|
|
22
|
+
"root": "awsui_root_14rmt_1wcao_413",
|
|
23
|
+
"tabs": "awsui_tabs_14rmt_1wcao_194",
|
|
24
|
+
"tabs-content": "awsui_tabs-content_14rmt_1wcao_454",
|
|
25
|
+
"fit-height": "awsui_fit-height_14rmt_1wcao_458",
|
|
26
|
+
"tabs-content-active": "awsui_tabs-content-active_14rmt_1wcao_464",
|
|
27
|
+
"tabs-content-wrapper": "awsui_tabs-content-wrapper_14rmt_1wcao_478",
|
|
28
|
+
"with-paddings": "awsui_with-paddings_14rmt_1wcao_478",
|
|
29
|
+
"tabs-container-content-wrapper": "awsui_tabs-container-content-wrapper_14rmt_1wcao_489",
|
|
30
|
+
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_14rmt_1wcao_500",
|
|
31
|
+
"tabs-tab-focused": "awsui_tabs-tab-focused_14rmt_1wcao_504"
|
|
32
32
|
};
|
|
33
33
|
|