@cloudscape-design/components 3.0.1094 → 3.0.1096
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/button-dropdown/item-element/styles.css.js +16 -16
- package/button-dropdown/item-element/styles.scoped.css +25 -25
- package/button-dropdown/item-element/styles.selectors.js +16 -16
- package/flashbar/collapsible-flashbar.d.ts +2 -2
- package/flashbar/collapsible-flashbar.d.ts.map +1 -1
- package/flashbar/collapsible-flashbar.js.map +1 -1
- package/flashbar/common.d.ts +3 -2
- package/flashbar/common.d.ts.map +1 -1
- package/flashbar/common.js +8 -13
- package/flashbar/common.js.map +1 -1
- package/flashbar/implementation.d.ts +4 -0
- package/flashbar/implementation.d.ts.map +1 -0
- package/flashbar/implementation.js +16 -0
- package/flashbar/implementation.js.map +1 -0
- package/flashbar/index.d.ts.map +1 -1
- package/flashbar/interfaces.d.ts +3 -1
- package/flashbar/interfaces.d.ts.map +1 -1
- package/flashbar/interfaces.js.map +1 -1
- package/flashbar/internal-do-not-use-core.js +6 -8
- package/flashbar/internal-do-not-use-core.js.map +1 -1
- package/flashbar/internal.d.ts +1 -0
- package/flashbar/internal.d.ts.map +1 -0
- package/flashbar/internal.js +5 -0
- package/flashbar/internal.js.map +1 -0
- package/flashbar/non-collapsible-flashbar.d.ts +2 -2
- package/flashbar/non-collapsible-flashbar.d.ts.map +1 -1
- package/flashbar/non-collapsible-flashbar.js.map +1 -1
- package/header/index.d.ts.map +1 -1
- package/header/index.js +6 -1
- package/header/index.js.map +1 -1
- package/internal/base-component/styles.scoped.css +6 -1
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/generated/styles/tokens.d.ts +1 -0
- package/internal/generated/styles/tokens.js +1 -0
- package/internal/generated/theming/index.cjs +47 -14
- package/internal/generated/theming/index.cjs.d.ts +9 -0
- package/internal/generated/theming/index.d.ts +9 -0
- package/internal/generated/theming/index.js +47 -14
- package/internal/manifest.json +1 -1
- package/internal/widget-exports.d.ts +1 -0
- package/internal/widget-exports.d.ts.map +1 -1
- package/internal/widget-exports.js +1 -0
- package/internal/widget-exports.js.map +1 -1
- package/package.json +1 -1
- package/property-filter/controller.d.ts +2 -0
- package/property-filter/controller.d.ts.map +1 -1
- package/property-filter/controller.js +5 -1
- package/property-filter/controller.js.map +1 -1
- package/property-filter/filter-options.js +5 -2
- package/property-filter/filter-options.js.map +1 -1
- package/property-filter/interfaces.d.ts +2 -0
- package/property-filter/interfaces.d.ts.map +1 -1
- package/property-filter/interfaces.js.map +1 -1
- package/property-filter/internal.d.ts.map +1 -1
- package/property-filter/internal.js +3 -1
- package/property-filter/internal.js.map +1 -1
- package/property-filter/property-editor.d.ts.map +1 -1
- package/property-filter/property-editor.js +1 -1
- package/property-filter/property-editor.js.map +1 -1
- package/property-filter/token-editor-inputs.js +2 -2
- package/property-filter/token-editor-inputs.js.map +1 -1
- package/select/parts/styles.css.js +22 -22
- package/select/parts/styles.scoped.css +24 -24
- package/select/parts/styles.selectors.js +22 -22
- package/test-utils/dom/index.js +332 -83
- package/test-utils/dom/index.js.map +1 -1
- package/test-utils/selectors/index.js +332 -83
- package/test-utils/selectors/index.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/property-filter/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzF,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AA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AE,KAAK,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;4BACrD,CAAC,EACD,SAAS,EAAE,MAAM,CAAC,YAAY,CAAC,EAC/B,QAAQ,EAAE,QAAQ,IAEjB,WAAW,CAAC,gBAAgB,CACd,CACZ,CACR,GAEH,CACmB,CACnB,CACP,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { PropertyFilterOperator } from '@cloudscape-design/collection-hooks';\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { AutosuggestInputRef } from '../internal/components/autosuggest-input';\nimport TokenList from '../internal/components/token-list';\nimport { useTableComponentsContext } from '../internal/context/table-component-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useListFocusController } from '../internal/hooks/use-list-focus-controller';\nimport { SomeRequired } from '../internal/types';\nimport { joinStrings } from '../internal/utils/strings';\nimport { InternalLiveRegionRef } from '../live-region/internal';\nimport InternalSpaceBetween from '../space-between/internal';\nimport { SearchResults } from '../text-filter/search-results';\nimport useDebounceSearchResultCallback from '../text-filter/use-debounce-search-result-callback';\nimport { GeneratedAnalyticsMetadataPropertyFilterClearFilters } from './analytics-metadata/interfaces';\nimport { getAllowedOperators, getAutosuggestOptions, getQueryActions, parseText } from './controller';\nimport { usePropertyFilterI18n } from './i18n-utils';\nimport {\n ComparisonOperator,\n ExtendedOperator,\n FilteringProperty,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n InternalQuery,\n InternalToken,\n InternalTokenGroup,\n ParsedText,\n PropertyFilterProps,\n Ref,\n Token,\n TokenGroup,\n} from './interfaces';\nimport { PropertyEditorContentCustom, PropertyEditorContentEnum, PropertyEditorFooter } from './property-editor';\nimport PropertyFilterAutosuggest, { PropertyFilterAutosuggestProps } from './property-filter-autosuggest';\nimport { TokenButton } from './token';\nimport { useLoadItems } from './use-load-items';\nimport { tokenGroupToTokens } from './utils';\n\nimport tokenListStyles from '../internal/components/token-list/styles.css.js';\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\ntype PropertyFilterInternalProps = SomeRequired<\n PropertyFilterProps,\n | 'filteringOptions'\n | 'customGroupsText'\n | 'enableTokenGroups'\n | 'disableFreeTextFiltering'\n | 'hideOperations'\n | 'readOnlyOperations'\n> &\n InternalBaseComponentProps;\n\nconst PropertyFilterInternal = React.forwardRef(\n (\n {\n disabled,\n countText,\n query,\n hideOperations,\n readOnlyOperations,\n onChange,\n filteringProperties,\n filteringOptions,\n customGroupsText,\n disableFreeTextFiltering,\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 enableTokenGroups,\n loading = false,\n __internalRootRef,\n ...rest\n }: PropertyFilterInternalProps,\n ref: React.Ref<Ref>\n ) => {\n const [nextFocusIndex, setNextFocusIndex] = useState<null | number>(null);\n const tokenListRef = useListFocusController({\n nextFocusIndex,\n onFocusMoved: (target, targetType) => {\n if (targetType === 'fallback') {\n inputRef.current?.focus({ preventDropdown: true });\n } else {\n target.focus();\n }\n setNextFocusIndex(null);\n },\n listItemSelector: `.${tokenListStyles['list-item']}`,\n showMoreSelector: `.${tokenListStyles.toggle}`,\n fallbackSelector: `.${styles.input}`,\n });\n\n const mergedRef = useMergeRefs(tokenListRef, __internalRootRef);\n const inputRef = useRef<AutosuggestInputRef>(null);\n const searchResultsRef = useRef<InternalLiveRegionRef>(null);\n const baseProps = getBaseProps(rest);\n\n const i18nStrings = usePropertyFilterI18n(rest.i18nStrings);\n\n useImperativeHandle(ref, () => ({ focus: () => inputRef.current?.focus() }), []);\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 getTokenType: operator => (operator ? (extendedOperators.get(operator)?.tokenType ?? 'value') : 'value'),\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 function transformToken(\n tokenOrGroup: Token | TokenGroup,\n standaloneIndex?: number\n ): InternalToken | InternalTokenGroup {\n return 'operation' in tokenOrGroup\n ? {\n operation: tokenOrGroup.operation,\n tokens: tokenOrGroup.tokens.map(token => transformToken(token)),\n }\n : {\n standaloneIndex,\n property: tokenOrGroup.propertyKey ? getProperty(tokenOrGroup.propertyKey) : null,\n operator: tokenOrGroup.operator,\n value: tokenOrGroup.value,\n };\n }\n\n const internalQuery: InternalQuery = {\n operation: query.operation,\n tokens: (enableTokenGroups && query.tokenGroups ? query.tokenGroups : query.tokens).map(transformToken),\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 countValue = useMemo(() => {\n if (!countText || typeof countText !== 'string') {\n return undefined;\n }\n\n const m = countText.match(/\\d+/);\n return m ? parseInt(m[0]) : undefined;\n }, [countText]);\n\n const tableComponentContext = useTableComponentsContext();\n\n useEffect(() => {\n if (tableComponentContext?.filterRef?.current) {\n const groupedTokens = tokenGroupToTokens<InternalToken>(internalQuery.tokens);\n const filteredBy = groupedTokens\n .map(token => token.property?.propertyKey)\n .filter((propertyKey): propertyKey is string => typeof propertyKey === 'string');\n\n tableComponentContext.filterRef.current.filterCount = countValue;\n tableComponentContext.filterRef.current.filteredBy = filteredBy;\n tableComponentContext.filterRef.current.filtered = groupedTokens.length > 0;\n\n return () => {\n delete tableComponentContext.filterRef.current?.filterCount;\n delete tableComponentContext.filterRef.current?.filteredBy;\n delete tableComponentContext.filterRef.current?.filtered;\n };\n }\n }, [tableComponentContext?.filterRef, countValue, internalQuery.tokens]);\n\n const { addToken, updateToken, updateOperation, removeToken, removeAllTokens } = getQueryActions({\n query: internalQuery,\n filteringOptions: internalOptions,\n onChange,\n enableTokenGroups,\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: InternalToken;\n switch (parsedText.step) {\n case 'property': {\n newToken = {\n property: parsedText.property,\n operator: parsedText.operator,\n value: parsedText.value,\n };\n break;\n }\n case 'free-text': {\n newToken = {\n property: null,\n operator: parsedText.operator || internalFreeText.defaultOperator,\n value: parsedText.value,\n };\n break;\n }\n case 'operator': {\n newToken = {\n property: null,\n operator: internalFreeText.defaultOperator,\n value: currentText,\n };\n break;\n }\n }\n if (internalFreeText.disabled && !newToken.property) {\n return;\n }\n addToken(newToken);\n setFilteringText('');\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 const { detail: option } = event;\n const value = option.value || '';\n if (!value) {\n return;\n }\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 useDebounceSearchResultCallback({\n searchQuery: query,\n countText,\n loading,\n announceCallback: () => {\n searchResultsRef.current?.reannounce();\n },\n });\n\n const propertyStep = parsedText.step === 'property' ? parsedText : null;\n const customValueKey = propertyStep ? propertyStep.property.propertyKey + ':' + propertyStep.operator : '';\n const [customFormValueRecord, setCustomFormValueRecord] = useState<Record<string, any>>({});\n const customFormValue = customValueKey in customFormValueRecord ? customFormValueRecord[customValueKey] : null;\n const setCustomFormValue = (value: null | any) => setCustomFormValueRecord({ [customValueKey]: value });\n const operatorForm = propertyStep && propertyStep.property.getValueFormRenderer(propertyStep.operator);\n const isEnumValue = propertyStep?.property.getTokenType(propertyStep.operator) === 'enum';\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 const showResults = !!internalQuery.tokens?.length && !disabled && !!countText;\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={mergedRef}>\n <div className={clsx(styles['search-field'], analyticsSelectors['search-field'])}>\n {customControl && <div className={styles['custom-control']}>{customControl}</div>}\n <div className={styles['input-wrapper']}>\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 {...autosuggestOptions}\n onChange={event => setFilteringText(event.detail.value)}\n empty={filteringEmpty}\n {...asyncAutosuggestProps}\n expandToViewport={expandToViewport}\n onOptionClick={handleSelected}\n customForm={\n operatorForm || isEnumValue\n ? {\n content: operatorForm ? (\n <PropertyEditorContentCustom\n key={customValueKey}\n property={propertyStep.property}\n operator={propertyStep.operator}\n filter={propertyStep.value}\n operatorForm={operatorForm}\n value={customFormValue}\n onChange={setCustomFormValue}\n />\n ) : (\n <PropertyEditorContentEnum\n key={customValueKey}\n property={propertyStep.property}\n filter={propertyStep.value}\n value={customFormValue}\n onChange={setCustomFormValue}\n asyncProps={asyncProps}\n filteringOptions={internalOptions}\n onLoadItems={inputLoadItemsHandlers.onLoadItems}\n />\n ),\n footer: (\n <PropertyEditorFooter\n key={customValueKey}\n property={propertyStep.property}\n operator={propertyStep.operator}\n value={customFormValue}\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 : undefined\n }\n onCloseDropdown={() => setCustomFormValueRecord({})}\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} renderLiveRegion={!loading} ref={searchResultsRef}>\n {countText}\n </SearchResults>\n </div>\n ) : null}\n </div>\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={(_, tokenIndex) => (\n <TokenButton\n query={internalQuery}\n tokenIndex={tokenIndex}\n onUpdateToken={(token, releasedTokens) => {\n updateToken(tokenIndex, token, releasedTokens);\n }}\n onUpdateOperation={updateOperation}\n onRemoveToken={() => {\n removeToken(tokenIndex);\n setNextFocusIndex(tokenIndex);\n }}\n filteringProperties={internalProperties}\n filteringOptions={internalOptions}\n asyncProps={asyncProps}\n onLoadItems={onLoadItems}\n i18nStrings={i18nStrings}\n asyncProperties={asyncProperties}\n hideOperations={hideOperations}\n readOnlyOperations={readOnlyOperations}\n customGroupsText={customGroupsText}\n freeTextFiltering={internalFreeText}\n disabled={disabled}\n expandToViewport={expandToViewport}\n enableTokenGroups={enableTokenGroups}\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 <span\n {...getAnalyticsMetadataAttribute({\n action: 'clearFilters',\n } as Partial<GeneratedAnalyticsMetadataPropertyFilterClearFilters>)}\n >\n <InternalButton\n formAction=\"none\"\n onClick={() => {\n removeAllTokens();\n inputRef.current?.focus({ preventDropdown: true });\n }}\n className={styles['remove-all']}\n disabled={disabled}\n >\n {i18nStrings.clearFiltersText}\n </InternalButton>\n </span>\n )\n }\n />\n </InternalSpaceBetween>\n </div>\n )}\n </div>\n );\n }\n);\n\nexport default PropertyFilterInternal;\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/property-filter/internal.tsx"],"names":[],"mappings":";AAAA,qEAA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,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,iBAAiB,GACpC,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,8CACM,6BAA6B,CAAC;wBAChC,MAAM,EAAE,cAAc;qBAC0C,CAAC;wBAEnE,oBAAC,cAAc,IACb,UAAU,EAAC,MAAM,EACjB,OAAO,EAAE,GAAG,EAAE;;gCACZ,eAAe,EAAE,CAAC;gCAClB,MAAA,QAAQ,CAAC,OAAO,0CAAE,KAAK,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;4BACrD,CAAC,EACD,SAAS,EAAE,MAAM,CAAC,YAAY,CAAC,EAC/B,QAAQ,EAAE,QAAQ,IAEjB,WAAW,CAAC,gBAAgB,CACd,CACZ,CACR,GAEH,CACmB,CACnB,CACP,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { PropertyFilterOperator } from '@cloudscape-design/collection-hooks';\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { AutosuggestInputRef } from '../internal/components/autosuggest-input';\nimport TokenList from '../internal/components/token-list';\nimport { useTableComponentsContext } from '../internal/context/table-component-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useListFocusController } from '../internal/hooks/use-list-focus-controller';\nimport { SomeRequired } from '../internal/types';\nimport { joinStrings } from '../internal/utils/strings';\nimport { InternalLiveRegionRef } from '../live-region/internal';\nimport InternalSpaceBetween from '../space-between/internal';\nimport { SearchResults } from '../text-filter/search-results';\nimport useDebounceSearchResultCallback from '../text-filter/use-debounce-search-result-callback';\nimport { GeneratedAnalyticsMetadataPropertyFilterClearFilters } from './analytics-metadata/interfaces';\nimport { getAllowedOperators, getAutosuggestOptions, getQueryActions, parseText } from './controller';\nimport { usePropertyFilterI18n } from './i18n-utils';\nimport {\n ComparisonOperator,\n ExtendedOperator,\n FilteringProperty,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n InternalQuery,\n InternalToken,\n InternalTokenGroup,\n ParsedText,\n PropertyFilterProps,\n Ref,\n Token,\n TokenGroup,\n} from './interfaces';\nimport { PropertyEditorContentCustom, PropertyEditorContentEnum, PropertyEditorFooter } from './property-editor';\nimport PropertyFilterAutosuggest, { PropertyFilterAutosuggestProps } from './property-filter-autosuggest';\nimport { TokenButton } from './token';\nimport { useLoadItems } from './use-load-items';\nimport { tokenGroupToTokens } from './utils';\n\nimport tokenListStyles from '../internal/components/token-list/styles.css.js';\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\ntype PropertyFilterInternalProps = SomeRequired<\n PropertyFilterProps,\n | 'filteringOptions'\n | 'customGroupsText'\n | 'enableTokenGroups'\n | 'disableFreeTextFiltering'\n | 'hideOperations'\n | 'readOnlyOperations'\n> &\n InternalBaseComponentProps;\n\nconst PropertyFilterInternal = React.forwardRef(\n (\n {\n disabled,\n countText,\n query,\n hideOperations,\n readOnlyOperations,\n onChange,\n filteringProperties,\n filteringOptions,\n customGroupsText,\n disableFreeTextFiltering,\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 enableTokenGroups,\n loading = false,\n __internalRootRef,\n ...rest\n }: PropertyFilterInternalProps,\n ref: React.Ref<Ref>\n ) => {\n const [nextFocusIndex, setNextFocusIndex] = useState<null | number>(null);\n const tokenListRef = useListFocusController({\n nextFocusIndex,\n onFocusMoved: (target, targetType) => {\n if (targetType === 'fallback') {\n inputRef.current?.focus({ preventDropdown: true });\n } else {\n target.focus();\n }\n setNextFocusIndex(null);\n },\n listItemSelector: `.${tokenListStyles['list-item']}`,\n showMoreSelector: `.${tokenListStyles.toggle}`,\n fallbackSelector: `.${styles.input}`,\n });\n\n const mergedRef = useMergeRefs(tokenListRef, __internalRootRef);\n const inputRef = useRef<AutosuggestInputRef>(null);\n const searchResultsRef = useRef<InternalLiveRegionRef>(null);\n const baseProps = getBaseProps(rest);\n\n const i18nStrings = usePropertyFilterI18n(rest.i18nStrings);\n\n useImperativeHandle(ref, () => ({ focus: () => inputRef.current?.focus() }), []);\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 getTokenType: operator => (operator ? (extendedOperators.get(operator)?.tokenType ?? 'value') : 'value'),\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 tags: option.tags ?? [],\n filteringTags: option.filteringTags ?? [],\n }));\n\n function transformToken(\n tokenOrGroup: Token | TokenGroup,\n standaloneIndex?: number\n ): InternalToken | InternalTokenGroup {\n return 'operation' in tokenOrGroup\n ? {\n operation: tokenOrGroup.operation,\n tokens: tokenOrGroup.tokens.map(token => transformToken(token)),\n }\n : {\n standaloneIndex,\n property: tokenOrGroup.propertyKey ? getProperty(tokenOrGroup.propertyKey) : null,\n operator: tokenOrGroup.operator,\n value: tokenOrGroup.value,\n };\n }\n\n const internalQuery: InternalQuery = {\n operation: query.operation,\n tokens: (enableTokenGroups && query.tokenGroups ? query.tokenGroups : query.tokens).map(transformToken),\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 countValue = useMemo(() => {\n if (!countText || typeof countText !== 'string') {\n return undefined;\n }\n\n const m = countText.match(/\\d+/);\n return m ? parseInt(m[0]) : undefined;\n }, [countText]);\n\n const tableComponentContext = useTableComponentsContext();\n\n useEffect(() => {\n if (tableComponentContext?.filterRef?.current) {\n const groupedTokens = tokenGroupToTokens<InternalToken>(internalQuery.tokens);\n const filteredBy = groupedTokens\n .map(token => token.property?.propertyKey)\n .filter((propertyKey): propertyKey is string => typeof propertyKey === 'string');\n\n tableComponentContext.filterRef.current.filterCount = countValue;\n tableComponentContext.filterRef.current.filteredBy = filteredBy;\n tableComponentContext.filterRef.current.filtered = groupedTokens.length > 0;\n\n return () => {\n delete tableComponentContext.filterRef.current?.filterCount;\n delete tableComponentContext.filterRef.current?.filteredBy;\n delete tableComponentContext.filterRef.current?.filtered;\n };\n }\n }, [tableComponentContext?.filterRef, countValue, internalQuery.tokens]);\n\n const { addToken, updateToken, updateOperation, removeToken, removeAllTokens } = getQueryActions({\n query: internalQuery,\n filteringOptions: internalOptions,\n onChange,\n enableTokenGroups,\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: InternalToken;\n switch (parsedText.step) {\n case 'property': {\n newToken = {\n property: parsedText.property,\n operator: parsedText.operator,\n value: parsedText.value,\n };\n break;\n }\n case 'free-text': {\n newToken = {\n property: null,\n operator: parsedText.operator || internalFreeText.defaultOperator,\n value: parsedText.value,\n };\n break;\n }\n case 'operator': {\n newToken = {\n property: null,\n operator: internalFreeText.defaultOperator,\n value: currentText,\n };\n break;\n }\n }\n if (internalFreeText.disabled && !newToken.property) {\n return;\n }\n addToken(newToken);\n setFilteringText('');\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 const { detail: option } = event;\n const value = option.value || '';\n if (!value) {\n return;\n }\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 useDebounceSearchResultCallback({\n searchQuery: query,\n countText,\n loading,\n announceCallback: () => {\n searchResultsRef.current?.reannounce();\n },\n });\n\n const propertyStep = parsedText.step === 'property' ? parsedText : null;\n const customValueKey = propertyStep ? propertyStep.property.propertyKey + ':' + propertyStep.operator : '';\n const [customFormValueRecord, setCustomFormValueRecord] = useState<Record<string, any>>({});\n const customFormValue = customValueKey in customFormValueRecord ? customFormValueRecord[customValueKey] : null;\n const setCustomFormValue = (value: null | any) => setCustomFormValueRecord({ [customValueKey]: value });\n const operatorForm = propertyStep && propertyStep.property.getValueFormRenderer(propertyStep.operator);\n const isEnumValue = propertyStep?.property.getTokenType(propertyStep.operator) === 'enum';\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 const showResults = !!internalQuery.tokens?.length && !disabled && !!countText;\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={mergedRef}>\n <div className={clsx(styles['search-field'], analyticsSelectors['search-field'])}>\n {customControl && <div className={styles['custom-control']}>{customControl}</div>}\n <div className={styles['input-wrapper']}>\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 {...autosuggestOptions}\n onChange={event => setFilteringText(event.detail.value)}\n empty={filteringEmpty}\n {...asyncAutosuggestProps}\n expandToViewport={expandToViewport}\n onOptionClick={handleSelected}\n customForm={\n operatorForm || isEnumValue\n ? {\n content: operatorForm ? (\n <PropertyEditorContentCustom\n key={customValueKey}\n property={propertyStep.property}\n operator={propertyStep.operator}\n filter={propertyStep.value}\n operatorForm={operatorForm}\n value={customFormValue}\n onChange={setCustomFormValue}\n />\n ) : (\n <PropertyEditorContentEnum\n key={customValueKey}\n property={propertyStep.property}\n filter={propertyStep.value}\n value={customFormValue}\n onChange={setCustomFormValue}\n asyncProps={asyncProps}\n filteringOptions={internalOptions}\n onLoadItems={inputLoadItemsHandlers.onLoadItems}\n />\n ),\n footer: (\n <PropertyEditorFooter\n key={customValueKey}\n property={propertyStep.property}\n operator={propertyStep.operator}\n value={customFormValue}\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 : undefined\n }\n onCloseDropdown={() => setCustomFormValueRecord({})}\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} renderLiveRegion={!loading} ref={searchResultsRef}>\n {countText}\n </SearchResults>\n </div>\n ) : null}\n </div>\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={(_, tokenIndex) => (\n <TokenButton\n query={internalQuery}\n tokenIndex={tokenIndex}\n onUpdateToken={(token, releasedTokens) => {\n updateToken(tokenIndex, token, releasedTokens);\n }}\n onUpdateOperation={updateOperation}\n onRemoveToken={() => {\n removeToken(tokenIndex);\n setNextFocusIndex(tokenIndex);\n }}\n filteringProperties={internalProperties}\n filteringOptions={internalOptions}\n asyncProps={asyncProps}\n onLoadItems={onLoadItems}\n i18nStrings={i18nStrings}\n asyncProperties={asyncProperties}\n hideOperations={hideOperations}\n readOnlyOperations={readOnlyOperations}\n customGroupsText={customGroupsText}\n freeTextFiltering={internalFreeText}\n disabled={disabled}\n expandToViewport={expandToViewport}\n enableTokenGroups={enableTokenGroups}\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 <span\n {...getAnalyticsMetadataAttribute({\n action: 'clearFilters',\n } as Partial<GeneratedAnalyticsMetadataPropertyFilterClearFilters>)}\n >\n <InternalButton\n formAction=\"none\"\n onClick={() => {\n removeAllTokens();\n inputRef.current?.focus({ preventDropdown: true });\n }}\n className={styles['remove-all']}\n disabled={disabled}\n >\n {i18nStrings.clearFiltersText}\n </InternalButton>\n </span>\n )\n }\n />\n </InternalSpaceBetween>\n </div>\n )}\n </div>\n );\n }\n);\n\nexport default PropertyFilterInternal;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-editor.d.ts","sourceRoot":"","sources":["../../../src/property-filter/property-editor.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAE7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAG/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,aAAa,EACb,eAAe,EAChB,MAAM,cAAc,CAAC;AAMtB,wBAAgB,2BAA2B,CAAC,UAAU,GAAG,GAAG,EAAE,EAC5D,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,EACR,YAAY,GACb,EAAE;IACD,QAAQ,EAAE,yBAAyB,CAAC;IACpC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,IAAI,GAAG,UAAU,CAAC;IACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,UAAU,KAAK,IAAI,CAAC;IAC7C,YAAY,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC;CAChD,eAeA;AAED,wBAAgB,yBAAyB,CAAC,EACxC,QAAQ,EACR,MAAM,EACN,KAAK,EAAE,YAAY,EACnB,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,WAAW,GACZ,EAAE;IACD,QAAQ,EAAE,yBAAyB,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;IAC3C,UAAU,EAAE,mBAAmB,CAAC;IAChC,gBAAgB,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACrD,WAAW,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,CAAC;CAC1D,
|
|
1
|
+
{"version":3,"file":"property-editor.d.ts","sourceRoot":"","sources":["../../../src/property-filter/property-editor.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAE7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAG/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,aAAa,EACb,eAAe,EAChB,MAAM,cAAc,CAAC;AAMtB,wBAAgB,2BAA2B,CAAC,UAAU,GAAG,GAAG,EAAE,EAC5D,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,EACR,YAAY,GACb,EAAE;IACD,QAAQ,EAAE,yBAAyB,CAAC;IACpC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,IAAI,GAAG,UAAU,CAAC;IACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,UAAU,KAAK,IAAI,CAAC;IAC7C,YAAY,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC;CAChD,eAeA;AAED,wBAAgB,yBAAyB,CAAC,EACxC,QAAQ,EACR,MAAM,EACN,KAAK,EAAE,YAAY,EACnB,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,WAAW,GACZ,EAAE;IACD,QAAQ,EAAE,yBAAyB,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;IAC3C,UAAU,EAAE,mBAAmB,CAAC;IAChC,gBAAgB,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACrD,WAAW,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,CAAC;CAC1D,eAoCA;AAED,wBAAgB,oBAAoB,CAAC,UAAU,GAAG,GAAG,EAAE,EACrD,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,GACZ,EAAE;IACD,QAAQ,EAAE,yBAAyB,CAAC;IACpC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,KAAK,EAAE,IAAI,GAAG,UAAU,CAAC;IACzB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC,WAAW,EAAE,mBAAmB,CAAC;CAClC,eAgBA"}
|
|
@@ -21,7 +21,7 @@ export function PropertyEditorContentCustom({ property, operator, filter, value,
|
|
|
21
21
|
export function PropertyEditorContentEnum({ property, filter, value: unknownValue, onChange, asyncProps, filteringOptions, onLoadItems, }) {
|
|
22
22
|
const valueOptions = filteringOptions
|
|
23
23
|
.filter(option => { var _a; return ((_a = option.property) === null || _a === void 0 ? void 0 : _a.propertyKey) === property.propertyKey; })
|
|
24
|
-
.map(({ label, value }) => ({ label, value }));
|
|
24
|
+
.map(({ label, value, tags, filteringTags }) => ({ label, value, tags, filteringTags }));
|
|
25
25
|
const valueHandlers = useLoadItems(onLoadItems, '', property.externalProperty);
|
|
26
26
|
const value = !unknownValue ? [] : Array.isArray(unknownValue) ? unknownValue : [unknownValue];
|
|
27
27
|
const selectedOptions = valueOptions.filter(option => value.includes(option.value));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-editor.js","sourceRoot":"","sources":["../../../src/property-filter/property-editor.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5E,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAE1E,OAAO,mBAAmB,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAUjD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAE1D,MAAM,UAAU,2BAA2B,CAAmB,EAC5D,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,EACR,YAAY,GAQb;IACC,MAAM,OAAO,GAAG,WAAW,EAAE,CAAC;IAC9B,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC;QACvC,6BAAK,SAAS,EAAE,MAAM,CAAC,wBAAwB,CAAC,EAAE,EAAE,EAAE,OAAO,IAC1D,QAAQ,CAAC,gBAAgB,CACtB;QAEN,6BAAK,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC;YAC5C,oBAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,IAC1D,YAAY,CAA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c,CAAC,wBAAwB,CAAC,CAAC,EAC3F,OAAO,EAAE,QAAQ,IAEhB,WAAW,CAAC,gBAAgB,CACd;QACjB,oBAAC,cAAc,IAAC,SAAS,EAAE,cAAc,CAAC,wBAAwB,CAAC,EAAE,OAAO,EAAE,WAAW,IACtF,WAAW,CAAC,eAAe,CACb,CACb,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalButton from '../button/internal';\nimport InternalCheckbox from '../checkbox/internal';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status';\nimport { FormFieldContext } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport EmbeddedMultiselect from '../multiselect/embedded';\nimport { filterOptions } from './filter-options';\nimport { I18nStringsInternal } from './i18n-utils';\nimport {\n ComparisonOperator,\n ExtendedOperatorForm,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalToken,\n LoadItemsDetail,\n} from './interfaces';\nimport { useLoadItems } from './use-load-items';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport function PropertyEditorContentCustom<TokenValue = any>({\n property,\n operator,\n filter,\n value,\n onChange,\n operatorForm,\n}: {\n property: InternalFilteringProperty;\n operator: ComparisonOperator;\n filter: string;\n value: null | TokenValue;\n onChange: (value: null | TokenValue) => void;\n operatorForm: ExtendedOperatorForm<TokenValue>;\n}) {\n const labelId = useUniqueId();\n return (\n <div className={styles['property-editor']}>\n <div className={styles['property-editor-header']} id={labelId}>\n {property.groupValuesLabel}\n </div>\n\n <div className={styles['property-editor-form']}>\n <FormFieldContext.Provider value={{ ariaLabelledby: labelId }}>\n {operatorForm({ value, onChange, operator, filter })}\n </FormFieldContext.Provider>\n </div>\n </div>\n );\n}\n\nexport function PropertyEditorContentEnum({\n property,\n filter,\n value: unknownValue,\n onChange,\n asyncProps,\n filteringOptions,\n onLoadItems,\n}: {\n property: InternalFilteringProperty;\n filter: string;\n value: unknown;\n onChange: (value: null | string[]) => void;\n asyncProps: DropdownStatusProps;\n filteringOptions: readonly InternalFilteringOption[];\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n}) {\n const valueOptions: readonly {\n value: string;\n label: string;\n tags?: readonly string[];\n filteringTags?: readonly string[];\n }[] = filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value, tags, filteringTags }) => ({ label, value, tags, filteringTags }));\n const valueHandlers = useLoadItems(onLoadItems, '', property.externalProperty);\n const value = !unknownValue ? [] : Array.isArray(unknownValue) ? unknownValue : [unknownValue];\n const selectedOptions = valueOptions.filter(option => value.includes(option.value));\n const filteredOptions = filterOptions(valueOptions, filter);\n return (\n <div className={clsx(styles['property-editor'], styles['property-editor-enum'])}>\n {filteredOptions.length === 0 && (\n <div className={styles['property-editor-header-enum']}>\n <InternalCheckbox checked={false} readOnly={true} />\n {property.groupValuesLabel}\n </div>\n )}\n\n <EmbeddedMultiselect\n filteringType=\"manual\"\n selectedOptions={selectedOptions}\n onChange={e => onChange(e.detail.selectedOptions.map(o => o.value!))}\n options={filteredOptions.length > 0 ? [{ options: filteredOptions, label: property.groupValuesLabel }] : []}\n filteringText={filter}\n ariaLabel={property.groupValuesLabel}\n statusType=\"finished\"\n noMatch={asyncProps.empty}\n {...valueHandlers}\n {...asyncProps}\n />\n </div>\n );\n}\n\nexport function PropertyEditorFooter<TokenValue = any>({\n property,\n operator,\n value,\n onCancel,\n onSubmit,\n i18nStrings,\n}: {\n property: InternalFilteringProperty;\n operator: ComparisonOperator;\n value: null | TokenValue;\n onCancel: () => void;\n onSubmit: (value: InternalToken) => void;\n i18nStrings: I18nStringsInternal;\n}) {\n const submitToken = () => onSubmit({ property, operator, value });\n return (\n <div className={styles['property-editor-actions']}>\n <InternalButton\n variant=\"link\"\n className={clsx(styles['property-editor-cancel'], testUtilStyles['property-editor-cancel'])}\n onClick={onCancel}\n >\n {i18nStrings.cancelActionText}\n </InternalButton>\n <InternalButton className={testUtilStyles['property-editor-submit']} onClick={submitToken}>\n {i18nStrings.applyActionText}\n </InternalButton>\n </div>\n );\n}\n"]}
|
|
@@ -62,7 +62,7 @@ function ValueInputAuto({ property, operator, value: unknownValue, onChangeValue
|
|
|
62
62
|
const valueOptions = property
|
|
63
63
|
? filteringOptions
|
|
64
64
|
.filter(option => { var _a; return ((_a = option.property) === null || _a === void 0 ? void 0 : _a.propertyKey) === property.propertyKey; })
|
|
65
|
-
.map(({ label, value }) => ({ label, value }))
|
|
65
|
+
.map(({ label, value, tags, filteringTags }) => ({ label, value, tags, filteringTags }))
|
|
66
66
|
: [];
|
|
67
67
|
const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property === null || property === void 0 ? void 0 : property.externalProperty, value, operator);
|
|
68
68
|
const asyncValueAutosuggestProps = (property === null || property === void 0 ? void 0 : property.propertyKey)
|
|
@@ -73,7 +73,7 @@ function ValueInputAuto({ property, operator, value: unknownValue, onChangeValue
|
|
|
73
73
|
function ValueInputEnum({ property, operator, value: unknownValue, onChangeValue, asyncProps, filteringOptions, onLoadItems, }) {
|
|
74
74
|
const valueOptions = filteringOptions
|
|
75
75
|
.filter(option => { var _a; return ((_a = option.property) === null || _a === void 0 ? void 0 : _a.propertyKey) === property.propertyKey; })
|
|
76
|
-
.map(({ label, value }) => ({ label, value }));
|
|
76
|
+
.map(({ label, value, tags, filteringTags }) => ({ label, value, tags, filteringTags }));
|
|
77
77
|
const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property.externalProperty, undefined, operator);
|
|
78
78
|
const asyncValueAutosuggestProps = Object.assign(Object.assign({ statusType: 'finished' }, valueAutosuggestHandlers), asyncProps);
|
|
79
79
|
const value = !unknownValue ? [] : Array.isArray(unknownValue) ? unknownValue : [unknownValue];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version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J,CAAC","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 InternalAutosuggest from '../autosuggest/internal.js';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces.js';\nimport { NonCancelableEventHandler } from '../internal/events/index.js';\nimport InternalMultiselect from '../multiselect/internal.js';\nimport { SelectProps } from '../select/interfaces.js';\nimport InternalSelect from '../select/internal.js';\nimport { getAllowedOperators, getPropertySuggestions } from './controller.js';\nimport { I18nStringsInternal, operatorToDescription } from './i18n-utils.js';\nimport {\n ComparisonOperator,\n GroupText,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n LoadItemsDetail,\n} from './interfaces.js';\nimport { useLoadItems } from './use-load-items.js';\n\nimport styles from './styles.css.js';\n\ninterface PropertyInputProps {\n asyncProps: null | DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n freeTextFiltering: InternalFreeTextFiltering;\n filteringProperties: readonly InternalFilteringProperty[];\n i18nStrings: I18nStringsInternal;\n onChangePropertyKey: (propertyKey: undefined | string) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n property: null | InternalFilteringProperty;\n}\n\nexport function PropertyInput({\n property,\n onChangePropertyKey,\n asyncProps,\n filteringProperties,\n onLoadItems,\n customGroupsText,\n i18nStrings,\n freeTextFiltering,\n}: PropertyInputProps) {\n const propertySelectHandlers = useLoadItems(onLoadItems);\n const asyncPropertySelectProps = asyncProps ? { ...asyncProps, ...propertySelectHandlers } : {};\n const propertyOptions: (SelectProps.Option | SelectProps.OptionGroup)[] = getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n ({ propertyKey, propertyLabel }) => ({\n value: propertyKey,\n label: propertyLabel,\n dontCloseOnSelect: true,\n })\n );\n\n const allPropertiesOption = {\n label: i18nStrings.allPropertiesLabel,\n value: undefined,\n };\n if (!freeTextFiltering.disabled) {\n propertyOptions.unshift(allPropertiesOption);\n }\n return (\n <InternalSelect\n options={propertyOptions}\n selectedOption={\n property\n ? {\n value: property.propertyKey ?? undefined,\n label: property.propertyLabel,\n }\n : allPropertiesOption\n }\n onChange={e => onChangePropertyKey(e.detail.selectedOption.value)}\n {...asyncPropertySelectProps}\n />\n );\n}\n\ninterface OperatorInputProps {\n i18nStrings: I18nStringsInternal;\n onChangeOperator: (operator: ComparisonOperator) => void;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n freeTextFiltering: InternalFreeTextFiltering;\n triggerVariant: 'option' | 'label';\n}\n\nexport function OperatorInput({\n property,\n operator,\n onChangeOperator,\n i18nStrings,\n freeTextFiltering,\n triggerVariant,\n}: OperatorInputProps) {\n const operatorOptions = (property ? getAllowedOperators(property) : freeTextFiltering.operators).map(operator => ({\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }));\n return (\n <InternalSelect\n options={operatorOptions}\n triggerVariant={triggerVariant}\n selectedOption={\n operator\n ? {\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }\n : null\n }\n onChange={e => onChangeOperator(e.detail.selectedOption.value as ComparisonOperator)}\n />\n );\n}\n\ninterface ValueInputProps {\n asyncProps: DropdownStatusProps;\n filteringOptions: readonly InternalFilteringOption[];\n i18nStrings: I18nStringsInternal;\n onChangeValue: (value: unknown) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n value: unknown;\n}\n\nexport function ValueInput(props: ValueInputProps) {\n const { property, operator, value, onChangeValue } = props;\n const OperatorForm = property?.propertyKey && operator && property?.getValueFormRenderer(operator);\n\n if (OperatorForm) {\n return <OperatorForm value={value} onChange={onChangeValue} operator={operator} />;\n }\n if (property && operator && property.getTokenType(operator) === 'enum') {\n return <ValueInputEnum {...props} property={property} operator={operator} />;\n }\n return <ValueInputAuto {...props} />;\n}\n\nfunction ValueInputAuto({\n property,\n operator,\n value: unknownValue,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n i18nStrings,\n}: ValueInputProps) {\n const value = (unknownValue ?? '') + '';\n const valueOptions = property\n ? filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value }) => ({ label, value }))\n : [];\n\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property?.externalProperty, value, operator);\n const asyncValueAutosuggestProps = property?.propertyKey\n ? { ...valueAutosuggestHandlers, ...asyncProps }\n : { empty: asyncProps.empty };\n const [matchedOption] = valueOptions.filter(option => option.value === value);\n\n return (\n <InternalAutosuggest\n enteredTextLabel={i18nStrings.enteredTextLabel}\n value={matchedOption?.label ?? value}\n clearAriaLabel={i18nStrings.clearAriaLabel}\n onChange={e => onChangeValue(e.detail.value)}\n disabled={!operator}\n options={valueOptions}\n {...asyncValueAutosuggestProps}\n virtualScroll={true}\n />\n );\n}\n\ninterface ValueInputPropsEnum extends ValueInputProps {\n property: InternalFilteringProperty;\n operator: ComparisonOperator;\n}\n\nfunction ValueInputEnum({\n property,\n operator,\n value: unknownValue,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n}: ValueInputPropsEnum) {\n const valueOptions = filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value }) => ({ label, value }));\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property.externalProperty, undefined, operator);\n const asyncValueAutosuggestProps = { statusType: 'finished' as const, ...valueAutosuggestHandlers, ...asyncProps };\n const value = !unknownValue ? [] : Array.isArray(unknownValue) ? unknownValue : [unknownValue];\n const selectedOptions = valueOptions.filter(option => value.includes(option.value));\n return (\n <div className={styles['token-editor-multiselect-wrapper']}>\n <div className={styles['token-editor-multiselect-wrapper-inner']}>\n <InternalMultiselect\n filteringType=\"auto\"\n selectedOptions={selectedOptions}\n onChange={e => onChangeValue(e.detail.selectedOptions.map(o => o.value))}\n options={valueOptions.length > 0 ? [{ options: valueOptions, label: property.groupValuesLabel }] : []}\n {...asyncValueAutosuggestProps}\n inlineTokens={true}\n hideTokens={true}\n keepOpen={true}\n />\n </div>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"token-editor-inputs.js","sourceRoot":"","sources":["../../../src/property-filter/token-editor-inputs.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAG7D,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAE7D,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAuB,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAS7E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAarC,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,EACR,mBAAmB,EACnB,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,iBAAiB,GACE;;IACnB,MAAM,sBAAsB,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IACzD,MAAM,wBAAwB,GAAG,UAAU,CAAC,CAAC,iCAAM,UAAU,GAAK,sBAAsB,EAAG,CAAC,CAAC,EAAE,CAAC;IAChG,MAAM,eAAe,GAAqD,sBAAsB,CAC9F,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC;QACnC,KAAK,EAAE,WAAW;QAClB,KAAK,EAAE,aAAa;QACpB,iBAAiB,EAAE,IAAI;KACxB,CAAC,CACH,CAAC;IAEF,MAAM,mBAAmB,GAAG;QAC1B,KAAK,EAAE,WAAW,CAAC,kBAAkB;QACrC,KAAK,EAAE,SAAS;KAC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,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IACjG,0BAA0B,IAC9B,YAAY,EAAE,IAAI,EAClB,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,IAAI,IACd,CACE,CACF,CACP,CAAC;AACJ,CAAC","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 InternalAutosuggest from '../autosuggest/internal.js';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces.js';\nimport { NonCancelableEventHandler } from '../internal/events/index.js';\nimport InternalMultiselect from '../multiselect/internal.js';\nimport { SelectProps } from '../select/interfaces.js';\nimport InternalSelect from '../select/internal.js';\nimport { getAllowedOperators, getPropertySuggestions } from './controller.js';\nimport { I18nStringsInternal, operatorToDescription } from './i18n-utils.js';\nimport {\n ComparisonOperator,\n GroupText,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n LoadItemsDetail,\n} from './interfaces.js';\nimport { useLoadItems } from './use-load-items.js';\n\nimport styles from './styles.css.js';\n\ninterface PropertyInputProps {\n asyncProps: null | DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n freeTextFiltering: InternalFreeTextFiltering;\n filteringProperties: readonly InternalFilteringProperty[];\n i18nStrings: I18nStringsInternal;\n onChangePropertyKey: (propertyKey: undefined | string) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n property: null | InternalFilteringProperty;\n}\n\nexport function PropertyInput({\n property,\n onChangePropertyKey,\n asyncProps,\n filteringProperties,\n onLoadItems,\n customGroupsText,\n i18nStrings,\n freeTextFiltering,\n}: PropertyInputProps) {\n const propertySelectHandlers = useLoadItems(onLoadItems);\n const asyncPropertySelectProps = asyncProps ? { ...asyncProps, ...propertySelectHandlers } : {};\n const propertyOptions: (SelectProps.Option | SelectProps.OptionGroup)[] = getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n ({ propertyKey, propertyLabel }) => ({\n value: propertyKey,\n label: propertyLabel,\n dontCloseOnSelect: true,\n })\n );\n\n const allPropertiesOption = {\n label: i18nStrings.allPropertiesLabel,\n value: undefined,\n };\n if (!freeTextFiltering.disabled) {\n propertyOptions.unshift(allPropertiesOption);\n }\n return (\n <InternalSelect\n options={propertyOptions}\n selectedOption={\n property\n ? {\n value: property.propertyKey ?? undefined,\n label: property.propertyLabel,\n }\n : allPropertiesOption\n }\n onChange={e => onChangePropertyKey(e.detail.selectedOption.value)}\n {...asyncPropertySelectProps}\n />\n );\n}\n\ninterface OperatorInputProps {\n i18nStrings: I18nStringsInternal;\n onChangeOperator: (operator: ComparisonOperator) => void;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n freeTextFiltering: InternalFreeTextFiltering;\n triggerVariant: 'option' | 'label';\n}\n\nexport function OperatorInput({\n property,\n operator,\n onChangeOperator,\n i18nStrings,\n freeTextFiltering,\n triggerVariant,\n}: OperatorInputProps) {\n const operatorOptions = (property ? getAllowedOperators(property) : freeTextFiltering.operators).map(operator => ({\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }));\n return (\n <InternalSelect\n options={operatorOptions}\n triggerVariant={triggerVariant}\n selectedOption={\n operator\n ? {\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }\n : null\n }\n onChange={e => onChangeOperator(e.detail.selectedOption.value as ComparisonOperator)}\n />\n );\n}\n\ninterface ValueInputProps {\n asyncProps: DropdownStatusProps;\n filteringOptions: readonly InternalFilteringOption[];\n i18nStrings: I18nStringsInternal;\n onChangeValue: (value: unknown) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n value: unknown;\n}\n\nexport function ValueInput(props: ValueInputProps) {\n const { property, operator, value, onChangeValue } = props;\n const OperatorForm = property?.propertyKey && operator && property?.getValueFormRenderer(operator);\n\n if (OperatorForm) {\n return <OperatorForm value={value} onChange={onChangeValue} operator={operator} />;\n }\n if (property && operator && property.getTokenType(operator) === 'enum') {\n return <ValueInputEnum {...props} property={property} operator={operator} />;\n }\n return <ValueInputAuto {...props} />;\n}\n\nfunction ValueInputAuto({\n property,\n operator,\n value: unknownValue,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n i18nStrings,\n}: ValueInputProps) {\n const value = (unknownValue ?? '') + '';\n const valueOptions = property\n ? filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value, tags, filteringTags }) => ({ label, value, tags, filteringTags }))\n : [];\n\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property?.externalProperty, value, operator);\n const asyncValueAutosuggestProps = property?.propertyKey\n ? { ...valueAutosuggestHandlers, ...asyncProps }\n : { empty: asyncProps.empty };\n const [matchedOption] = valueOptions.filter(option => option.value === value);\n\n return (\n <InternalAutosuggest\n enteredTextLabel={i18nStrings.enteredTextLabel}\n value={matchedOption?.label ?? value}\n clearAriaLabel={i18nStrings.clearAriaLabel}\n onChange={e => onChangeValue(e.detail.value)}\n disabled={!operator}\n options={valueOptions}\n {...asyncValueAutosuggestProps}\n virtualScroll={true}\n />\n );\n}\n\ninterface ValueInputPropsEnum extends ValueInputProps {\n property: InternalFilteringProperty;\n operator: ComparisonOperator;\n}\n\nfunction ValueInputEnum({\n property,\n operator,\n value: unknownValue,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n}: ValueInputPropsEnum) {\n const valueOptions = filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value, tags, filteringTags }) => ({ label, value, tags, filteringTags }));\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property.externalProperty, undefined, operator);\n const asyncValueAutosuggestProps = { statusType: 'finished' as const, ...valueAutosuggestHandlers, ...asyncProps };\n const value = !unknownValue ? [] : Array.isArray(unknownValue) ? unknownValue : [unknownValue];\n const selectedOptions = valueOptions.filter(option => value.includes(option.value));\n return (\n <div className={styles['token-editor-multiselect-wrapper']}>\n <div className={styles['token-editor-multiselect-wrapper-inner']}>\n <InternalMultiselect\n filteringType=\"auto\"\n selectedOptions={selectedOptions}\n onChange={e => onChangeValue(e.detail.selectedOptions.map(o => o.value))}\n options={valueOptions.length > 0 ? [{ options: valueOptions, label: property.groupValuesLabel }] : []}\n {...asyncValueAutosuggestProps}\n inlineTokens={true}\n hideTokens={true}\n keepOpen={true}\n />\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"placeholder": "
|
|
5
|
-
"item": "
|
|
6
|
-
"checkbox": "
|
|
7
|
-
"option-group": "awsui_option-
|
|
8
|
-
"filter": "
|
|
9
|
-
"trigger": "
|
|
10
|
-
"layout-strut": "awsui_layout-
|
|
11
|
-
"list-bottom": "awsui_list-
|
|
12
|
-
"selected-icon": "awsui_selected-
|
|
13
|
-
"show-label-tag": "awsui_show-label-
|
|
14
|
-
"inline-token-trigger": "awsui_inline-token-
|
|
15
|
-
"inline-token-list": "awsui_inline-token-
|
|
16
|
-
"inline-token": "awsui_inline-
|
|
17
|
-
"visual-refresh": "awsui_visual-
|
|
18
|
-
"inline-token-hidden-placeholder": "awsui_inline-token-hidden-
|
|
19
|
-
"inline-token-counter": "awsui_inline-token-
|
|
20
|
-
"inline-token-trigger--disabled": "awsui_inline-token-trigger--
|
|
21
|
-
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-
|
|
22
|
-
"inline-label-wrapper": "awsui_inline-label-
|
|
23
|
-
"inline-label": "awsui_inline-
|
|
24
|
-
"inline-label-inline-tokens": "awsui_inline-label-inline-
|
|
25
|
-
"disabled-reason-tooltip": "awsui_disabled-reason-
|
|
4
|
+
"placeholder": "awsui_placeholder_dwuol_1ao0e_145",
|
|
5
|
+
"item": "awsui_item_dwuol_1ao0e_150",
|
|
6
|
+
"checkbox": "awsui_checkbox_dwuol_1ao0e_154",
|
|
7
|
+
"option-group": "awsui_option-group_dwuol_1ao0e_163",
|
|
8
|
+
"filter": "awsui_filter_dwuol_1ao0e_167",
|
|
9
|
+
"trigger": "awsui_trigger_dwuol_1ao0e_172",
|
|
10
|
+
"layout-strut": "awsui_layout-strut_dwuol_1ao0e_178",
|
|
11
|
+
"list-bottom": "awsui_list-bottom_dwuol_1ao0e_184",
|
|
12
|
+
"selected-icon": "awsui_selected-icon_dwuol_1ao0e_188",
|
|
13
|
+
"show-label-tag": "awsui_show-label-tag_dwuol_1ao0e_192",
|
|
14
|
+
"inline-token-trigger": "awsui_inline-token-trigger_dwuol_1ao0e_196",
|
|
15
|
+
"inline-token-list": "awsui_inline-token-list_dwuol_1ao0e_203",
|
|
16
|
+
"inline-token": "awsui_inline-token_dwuol_1ao0e_196",
|
|
17
|
+
"visual-refresh": "awsui_visual-refresh_dwuol_1ao0e_233",
|
|
18
|
+
"inline-token-hidden-placeholder": "awsui_inline-token-hidden-placeholder_dwuol_1ao0e_240",
|
|
19
|
+
"inline-token-counter": "awsui_inline-token-counter_dwuol_1ao0e_246",
|
|
20
|
+
"inline-token-trigger--disabled": "awsui_inline-token-trigger--disabled_dwuol_1ao0e_250",
|
|
21
|
+
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-wrapper_dwuol_1ao0e_256",
|
|
22
|
+
"inline-label-wrapper": "awsui_inline-label-wrapper_dwuol_1ao0e_260",
|
|
23
|
+
"inline-label": "awsui_inline-label_dwuol_1ao0e_256",
|
|
24
|
+
"inline-label-inline-tokens": "awsui_inline-label-inline-tokens_dwuol_1ao0e_286",
|
|
25
|
+
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_dwuol_1ao0e_291"
|
|
26
26
|
};
|
|
27
27
|
|
|
@@ -142,16 +142,16 @@
|
|
|
142
142
|
*/
|
|
143
143
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
144
144
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
145
|
-
.
|
|
145
|
+
.awsui_placeholder_dwuol_1ao0e_145:not(#\9) {
|
|
146
146
|
color: var(--color-text-input-placeholder-dclg8u, #656871);
|
|
147
147
|
font-style: italic;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
.
|
|
150
|
+
.awsui_item_dwuol_1ao0e_150:not(#\9) {
|
|
151
151
|
display: flex;
|
|
152
152
|
align-items: center;
|
|
153
153
|
}
|
|
154
|
-
.
|
|
154
|
+
.awsui_item_dwuol_1ao0e_150 > .awsui_checkbox_dwuol_1ao0e_154:not(#\9) {
|
|
155
155
|
position: relative;
|
|
156
156
|
min-block-size: var(--size-control-adm93y, 16px);
|
|
157
157
|
min-inline-size: var(--size-control-adm93y, 16px);
|
|
@@ -160,47 +160,47 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
160
160
|
margin-inline-end: var(--space-field-horizontal-0aq2ch, 12px);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
.awsui_option-
|
|
163
|
+
.awsui_option-group_dwuol_1ao0e_163:not(#\9):not(:first-child) {
|
|
164
164
|
margin-block-start: calc(-1 * var(--border-item-width-miijiw, 2px));
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
.
|
|
167
|
+
.awsui_filter_dwuol_1ao0e_167:not(#\9) {
|
|
168
168
|
z-index: 4;
|
|
169
169
|
flex-shrink: 0;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
.
|
|
172
|
+
.awsui_trigger_dwuol_1ao0e_172:not(#\9) {
|
|
173
173
|
white-space: nowrap;
|
|
174
174
|
overflow: hidden;
|
|
175
175
|
text-overflow: ellipsis;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
.awsui_layout-
|
|
178
|
+
.awsui_layout-strut_dwuol_1ao0e_178:not(#\9) {
|
|
179
179
|
inline-size: 100%;
|
|
180
180
|
position: relative;
|
|
181
181
|
transform: translate3d(0, 0, 0);
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
.awsui_list-
|
|
184
|
+
.awsui_list-bottom_dwuol_1ao0e_184:not(#\9) {
|
|
185
185
|
/* used in unit-tests */
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
.awsui_selected-
|
|
189
|
-
color: var(--color-
|
|
188
|
+
.awsui_selected-icon_dwuol_1ao0e_188:not(#\9) {
|
|
189
|
+
color: var(--color-item-selected-72rnwy, #006ce0);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
.awsui_show-label-
|
|
192
|
+
.awsui_show-label-tag_dwuol_1ao0e_192 > .awsui_selected-icon_dwuol_1ao0e_188:not(#\9) {
|
|
193
193
|
padding-inline-start: var(--space-scaled-s-8ozaad, 12px);
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
.awsui_inline-token-
|
|
196
|
+
.awsui_inline-token-trigger_dwuol_1ao0e_196:not(#\9) {
|
|
197
197
|
display: flex;
|
|
198
198
|
flex-wrap: nowrap;
|
|
199
199
|
column-gap: var(--space-xxs-hwfkai, 4px);
|
|
200
200
|
inline-size: 100%;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
.awsui_inline-token-
|
|
203
|
+
.awsui_inline-token-list_dwuol_1ao0e_203:not(#\9) {
|
|
204
204
|
display: flex;
|
|
205
205
|
flex-wrap: nowrap;
|
|
206
206
|
align-items: center;
|
|
@@ -210,10 +210,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
210
210
|
mask-image: linear-gradient(270deg, transparent, white 20px, white);
|
|
211
211
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
212
212
|
}
|
|
213
|
-
.awsui_inline-token-
|
|
213
|
+
.awsui_inline-token-list_dwuol_1ao0e_203:not(#\9):dir(rtl) {
|
|
214
214
|
mask-image: linear-gradient(-270deg, transparent, white 20px, white);
|
|
215
215
|
}
|
|
216
|
-
.awsui_inline-token-
|
|
216
|
+
.awsui_inline-token-list_dwuol_1ao0e_203 > .awsui_inline-token_dwuol_1ao0e_196:not(#\9) {
|
|
217
217
|
display: flex;
|
|
218
218
|
align-items: center;
|
|
219
219
|
min-inline-size: max-content;
|
|
@@ -230,38 +230,38 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
230
230
|
color: var(--color-text-body-default-vvtq8u, #0f141a);
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
.awsui_visual-
|
|
233
|
+
.awsui_visual-refresh_dwuol_1ao0e_233 > .awsui_inline-token-list_dwuol_1ao0e_203 > .awsui_inline-token_dwuol_1ao0e_196:not(#\9) {
|
|
234
234
|
border-start-start-radius: var(--border-radius-badge-exolfb, 4px);
|
|
235
235
|
border-start-end-radius: var(--border-radius-badge-exolfb, 4px);
|
|
236
236
|
border-end-start-radius: var(--border-radius-badge-exolfb, 4px);
|
|
237
237
|
border-end-end-radius: var(--border-radius-badge-exolfb, 4px);
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
.awsui_inline-token-hidden-
|
|
240
|
+
.awsui_inline-token-hidden-placeholder_dwuol_1ao0e_240:not(#\9) {
|
|
241
241
|
position: absolute !important;
|
|
242
242
|
inset-block-start: -9999px !important;
|
|
243
243
|
inset-inline-start: -9999px !important;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
.awsui_inline-token-
|
|
246
|
+
.awsui_inline-token-counter_dwuol_1ao0e_246:not(#\9) {
|
|
247
247
|
white-space: nowrap;
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
.awsui_inline-token-trigger--
|
|
250
|
+
.awsui_inline-token-trigger--disabled_dwuol_1ao0e_250 > .awsui_inline-token-list_dwuol_1ao0e_203 > .awsui_inline-token_dwuol_1ao0e_196:not(#\9) {
|
|
251
251
|
border-color: var(--color-border-control-disabled-uj7t08, #dedee3);
|
|
252
252
|
background-color: var(--color-background-container-content-6u8rvp, #ffffff);
|
|
253
253
|
color: var(--color-text-disabled-rox5hg, #b4b4bb);
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
.awsui_inline-label-trigger-
|
|
256
|
+
.awsui_inline-label-trigger-wrapper_dwuol_1ao0e_256:not(#\9) {
|
|
257
257
|
margin-block-start: -7px;
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
-
.awsui_inline-label-
|
|
260
|
+
.awsui_inline-label-wrapper_dwuol_1ao0e_260:not(#\9) {
|
|
261
261
|
margin-block-start: calc(var(--space-scaled-xs-xwoogq, 8px) * -1);
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
.awsui_inline-
|
|
264
|
+
.awsui_inline-label_dwuol_1ao0e_256:not(#\9) {
|
|
265
265
|
background: linear-gradient(to bottom, var(--color-background-layout-main-5ilwcb, #ffffff), var(--color-background-input-default-ifz5bb, #ffffff));
|
|
266
266
|
border-start-start-radius: 2px;
|
|
267
267
|
border-start-end-radius: 2px;
|
|
@@ -283,11 +283,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
283
283
|
z-index: 1;
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
-
.awsui_inline-label-inline-
|
|
286
|
+
.awsui_inline-label-inline-tokens_dwuol_1ao0e_286:not(#\9) {
|
|
287
287
|
padding-block-end: 0;
|
|
288
288
|
transform: translateY(-1.5px);
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
.awsui_disabled-reason-
|
|
291
|
+
.awsui_disabled-reason-tooltip_dwuol_1ao0e_291:not(#\9) {
|
|
292
292
|
/* used in test-utils or tests */
|
|
293
293
|
}
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"placeholder": "
|
|
6
|
-
"item": "
|
|
7
|
-
"checkbox": "
|
|
8
|
-
"option-group": "awsui_option-
|
|
9
|
-
"filter": "
|
|
10
|
-
"trigger": "
|
|
11
|
-
"layout-strut": "awsui_layout-
|
|
12
|
-
"list-bottom": "awsui_list-
|
|
13
|
-
"selected-icon": "awsui_selected-
|
|
14
|
-
"show-label-tag": "awsui_show-label-
|
|
15
|
-
"inline-token-trigger": "awsui_inline-token-
|
|
16
|
-
"inline-token-list": "awsui_inline-token-
|
|
17
|
-
"inline-token": "awsui_inline-
|
|
18
|
-
"visual-refresh": "awsui_visual-
|
|
19
|
-
"inline-token-hidden-placeholder": "awsui_inline-token-hidden-
|
|
20
|
-
"inline-token-counter": "awsui_inline-token-
|
|
21
|
-
"inline-token-trigger--disabled": "awsui_inline-token-trigger--
|
|
22
|
-
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-
|
|
23
|
-
"inline-label-wrapper": "awsui_inline-label-
|
|
24
|
-
"inline-label": "awsui_inline-
|
|
25
|
-
"inline-label-inline-tokens": "awsui_inline-label-inline-
|
|
26
|
-
"disabled-reason-tooltip": "awsui_disabled-reason-
|
|
5
|
+
"placeholder": "awsui_placeholder_dwuol_1ao0e_145",
|
|
6
|
+
"item": "awsui_item_dwuol_1ao0e_150",
|
|
7
|
+
"checkbox": "awsui_checkbox_dwuol_1ao0e_154",
|
|
8
|
+
"option-group": "awsui_option-group_dwuol_1ao0e_163",
|
|
9
|
+
"filter": "awsui_filter_dwuol_1ao0e_167",
|
|
10
|
+
"trigger": "awsui_trigger_dwuol_1ao0e_172",
|
|
11
|
+
"layout-strut": "awsui_layout-strut_dwuol_1ao0e_178",
|
|
12
|
+
"list-bottom": "awsui_list-bottom_dwuol_1ao0e_184",
|
|
13
|
+
"selected-icon": "awsui_selected-icon_dwuol_1ao0e_188",
|
|
14
|
+
"show-label-tag": "awsui_show-label-tag_dwuol_1ao0e_192",
|
|
15
|
+
"inline-token-trigger": "awsui_inline-token-trigger_dwuol_1ao0e_196",
|
|
16
|
+
"inline-token-list": "awsui_inline-token-list_dwuol_1ao0e_203",
|
|
17
|
+
"inline-token": "awsui_inline-token_dwuol_1ao0e_196",
|
|
18
|
+
"visual-refresh": "awsui_visual-refresh_dwuol_1ao0e_233",
|
|
19
|
+
"inline-token-hidden-placeholder": "awsui_inline-token-hidden-placeholder_dwuol_1ao0e_240",
|
|
20
|
+
"inline-token-counter": "awsui_inline-token-counter_dwuol_1ao0e_246",
|
|
21
|
+
"inline-token-trigger--disabled": "awsui_inline-token-trigger--disabled_dwuol_1ao0e_250",
|
|
22
|
+
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-wrapper_dwuol_1ao0e_256",
|
|
23
|
+
"inline-label-wrapper": "awsui_inline-label-wrapper_dwuol_1ao0e_260",
|
|
24
|
+
"inline-label": "awsui_inline-label_dwuol_1ao0e_256",
|
|
25
|
+
"inline-label-inline-tokens": "awsui_inline-label-inline-tokens_dwuol_1ao0e_286",
|
|
26
|
+
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_dwuol_1ao0e_291"
|
|
27
27
|
};
|
|
28
28
|
|