@cloudscape-design/components-themeable 3.0.958 → 3.0.960

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.
Files changed (92) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/copy-to-clipboard/test-classes/styles.scss +3 -0
  3. package/lib/internal/scss/internal/components/button-trigger/styles.scss +3 -1
  4. package/lib/internal/scss/tree-view/test-classes/styles.scss +8 -0
  5. package/lib/internal/template/annotation-context/annotation/annotation-popover.d.ts.map +1 -1
  6. package/lib/internal/template/annotation-context/annotation/annotation-popover.js +1 -1
  7. package/lib/internal/template/annotation-context/annotation/annotation-popover.js.map +1 -1
  8. package/lib/internal/template/annotation-context/annotation/open-annotation.d.ts.map +1 -1
  9. package/lib/internal/template/annotation-context/annotation/open-annotation.js +3 -1
  10. package/lib/internal/template/annotation-context/annotation/open-annotation.js.map +1 -1
  11. package/lib/internal/template/copy-to-clipboard/interfaces.d.ts +5 -1
  12. package/lib/internal/template/copy-to-clipboard/interfaces.d.ts.map +1 -1
  13. package/lib/internal/template/copy-to-clipboard/interfaces.js.map +1 -1
  14. package/lib/internal/template/copy-to-clipboard/internal.d.ts +1 -1
  15. package/lib/internal/template/copy-to-clipboard/internal.d.ts.map +1 -1
  16. package/lib/internal/template/copy-to-clipboard/internal.js +2 -2
  17. package/lib/internal/template/copy-to-clipboard/internal.js.map +1 -1
  18. package/lib/internal/template/copy-to-clipboard/test-classes/styles.css.js +3 -2
  19. package/lib/internal/template/copy-to-clipboard/test-classes/styles.scoped.css +6 -2
  20. package/lib/internal/template/copy-to-clipboard/test-classes/styles.selectors.js +3 -2
  21. package/lib/internal/template/index.d.ts +1 -0
  22. package/lib/internal/template/index.d.ts.map +1 -1
  23. package/lib/internal/template/index.js +1 -0
  24. package/lib/internal/template/index.js.map +1 -1
  25. package/lib/internal/template/internal/components/button-trigger/styles.css.js +13 -13
  26. package/lib/internal/template/internal/components/button-trigger/styles.scoped.css +27 -27
  27. package/lib/internal/template/internal/components/button-trigger/styles.selectors.js +13 -13
  28. package/lib/internal/template/internal/components/drag-handle/button.d.ts.map +1 -1
  29. package/lib/internal/template/internal/components/drag-handle/button.js +2 -2
  30. package/lib/internal/template/internal/components/drag-handle/button.js.map +1 -1
  31. package/lib/internal/template/internal/components/drag-handle/index.d.ts.map +1 -1
  32. package/lib/internal/template/internal/components/drag-handle/index.js +2 -2
  33. package/lib/internal/template/internal/components/drag-handle/index.js.map +1 -1
  34. package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts +1 -0
  35. package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts.map +1 -1
  36. package/lib/internal/template/internal/components/drag-handle/interfaces.js.map +1 -1
  37. package/lib/internal/template/internal/environment.js +1 -1
  38. package/lib/internal/template/internal/environment.json +1 -1
  39. package/lib/internal/template/package.json +1 -0
  40. package/lib/internal/template/property-filter/filtering-token/index.d.ts +1 -0
  41. package/lib/internal/template/property-filter/filtering-token/index.d.ts.map +1 -1
  42. package/lib/internal/template/property-filter/filtering-token/index.js +5 -5
  43. package/lib/internal/template/property-filter/filtering-token/index.js.map +1 -1
  44. package/lib/internal/template/property-filter/index.d.ts.map +1 -1
  45. package/lib/internal/template/property-filter/index.js +3 -2
  46. package/lib/internal/template/property-filter/index.js.map +1 -1
  47. package/lib/internal/template/property-filter/interfaces.d.ts +6 -1
  48. package/lib/internal/template/property-filter/interfaces.d.ts.map +1 -1
  49. package/lib/internal/template/property-filter/interfaces.js.map +1 -1
  50. package/lib/internal/template/property-filter/internal.d.ts +1 -0
  51. package/lib/internal/template/property-filter/internal.d.ts.map +1 -1
  52. package/lib/internal/template/property-filter/internal.js +2 -2
  53. package/lib/internal/template/property-filter/internal.js.map +1 -1
  54. package/lib/internal/template/property-filter/token.d.ts +2 -1
  55. package/lib/internal/template/property-filter/token.d.ts.map +1 -1
  56. package/lib/internal/template/property-filter/token.js +2 -2
  57. package/lib/internal/template/property-filter/token.js.map +1 -1
  58. package/lib/internal/template/test-utils/dom/copy-to-clipboard/index.d.ts +8 -0
  59. package/lib/internal/template/test-utils/dom/copy-to-clipboard/index.js +10 -0
  60. package/lib/internal/template/test-utils/dom/copy-to-clipboard/index.js.map +1 -1
  61. package/lib/internal/template/test-utils/dom/hotspot/index.js +2 -1
  62. package/lib/internal/template/test-utils/dom/hotspot/index.js.map +1 -1
  63. package/lib/internal/template/test-utils/dom/index.d.ts +20 -0
  64. package/lib/internal/template/test-utils/dom/index.js +12 -1
  65. package/lib/internal/template/test-utils/dom/index.js.map +1 -1
  66. package/lib/internal/template/test-utils/dom/tree-view/index.d.ts +4 -0
  67. package/lib/internal/template/test-utils/dom/tree-view/index.js +11 -0
  68. package/lib/internal/template/test-utils/dom/tree-view/index.js.map +1 -0
  69. package/lib/internal/template/test-utils/selectors/copy-to-clipboard/index.d.ts +8 -0
  70. package/lib/internal/template/test-utils/selectors/copy-to-clipboard/index.js +10 -0
  71. package/lib/internal/template/test-utils/selectors/copy-to-clipboard/index.js.map +1 -1
  72. package/lib/internal/template/test-utils/selectors/hotspot/index.js +2 -1
  73. package/lib/internal/template/test-utils/selectors/hotspot/index.js.map +1 -1
  74. package/lib/internal/template/test-utils/selectors/index.d.ts +18 -0
  75. package/lib/internal/template/test-utils/selectors/index.js +12 -1
  76. package/lib/internal/template/test-utils/selectors/index.js.map +1 -1
  77. package/lib/internal/template/test-utils/selectors/tree-view/index.d.ts +4 -0
  78. package/lib/internal/template/test-utils/selectors/tree-view/index.js +11 -0
  79. package/lib/internal/template/test-utils/selectors/tree-view/index.js.map +1 -0
  80. package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
  81. package/lib/internal/template/tree-view/index.d.ts +8 -0
  82. package/lib/internal/template/tree-view/index.d.ts.map +1 -0
  83. package/lib/internal/template/tree-view/index.js +22 -0
  84. package/lib/internal/template/tree-view/index.js.map +1 -0
  85. package/lib/internal/template/tree-view/interfaces.d.ts +6 -0
  86. package/lib/internal/template/tree-view/interfaces.d.ts.map +1 -0
  87. package/lib/internal/template/tree-view/interfaces.js +4 -0
  88. package/lib/internal/template/tree-view/interfaces.js.map +1 -0
  89. package/lib/internal/template/tree-view/test-classes/styles.css.js +6 -0
  90. package/lib/internal/template/tree-view/test-classes/styles.scoped.css +7 -0
  91. package/lib/internal/template/tree-view/test-classes/styles.selectors.js +7 -0
  92. package/package.json +1 -1
@@ -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,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACxB,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;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;;;;;OAUG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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 PropertyFilterQuery,\n PropertyFilterToken,\n PropertyFilterTokenGroup,\n PropertyFilterTokenType,\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 * When the `countText` or `query` changes, it will be announced to assistive technologies.\n */\n countText?: string;\n\n /**\n * Set to `true` while the related collection is loading (e.g. during an async filtering action).\n * If set to `true`, the live announcement of countText by assistive technologies will be paused until it changes back to `false`.\n */\n loading?: boolean;\n\n /**\n * An object representing the current query displayed in the property filter, which has three properties: `operation`, `tokens`, and `tokenGroups`.\n * The `operation` property has two valid values: \"and\", \"or\", and controls the join operation to be applied between tokens when filtering the items.\n * The `tokens` property is an array of objects that will be displayed to the user beneath the filtering input. When `enableTokenGroups=true`, the\n * `tokenGroups` property is used instead, which supports nested tokens.\n *\n * Each token has the following properties:\n * * value [unknown]: The value of the token to be used as a filter. Can be null or string for default tokens, string[] for enum tokens, and anything for tokens with custom forms.\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 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 * This property cannot be set when `enableTokenGroups=true`.\n */\n hideOperations?: boolean;\n /**\n * Activates token grouping mechanism to support token nesting (up to one level).\n * When `true`, the `query.tokens` property is ignored and `query.tokenGroups` is used instead.\n */\n enableTokenGroups?: 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` asynchronously. 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 TokenGroup = PropertyFilterTokenGroup;\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 export type Query = PropertyFilterQuery;\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 formatToken?: (token: FormattedToken) => 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 groupEditAriaLabel?: (group: FormattedTokenGroup) => string;\n tokenEditorTokenActionsAriaLabel?: (token: FormattedToken) => string;\n tokenEditorTokenRemoveAriaLabel?: (token: FormattedToken) => string;\n tokenEditorTokenRemoveLabel?: string;\n tokenEditorTokenRemoveFromGroupLabel?: string;\n tokenEditorAddNewTokenLabel?: string;\n tokenEditorAddTokenActionsAriaLabel?: string;\n tokenEditorAddExistingTokenAriaLabel?: (token: FormattedToken) => string;\n tokenEditorAddExistingTokenLabel?: (token: FormattedToken) => string;\n }\n\n export interface FormattedToken {\n propertyKey?: string;\n propertyLabel: string;\n operator: ComparisonOperator;\n value: string;\n }\n\n export interface FormattedTokenGroup {\n tokens: FormattedToken[];\n operation: string;\n operationLabel: 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 TokenGroup = PropertyFilterProps.TokenGroup;\nexport type JoinOperation = PropertyFilterProps.JoinOperation;\nexport type ComparisonOperator = PropertyFilterProps.ComparisonOperator;\nexport type ExtendedOperator<TokenValue> = PropertyFilterOperatorExtended<TokenValue>;\nexport type ExtendedOperatorForm<TokenValue> = PropertyFilterOperatorForm<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 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 getTokenType: (operator?: PropertyFilterOperator) => PropertyFilterTokenType;\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 standaloneIndex?: number;\n property: null | InternalFilteringProperty<TokenValue>;\n operator: PropertyFilterOperator;\n value: TokenValue;\n}\n\nexport interface InternalTokenGroup<TokenValue = any> {\n operation: PropertyFilterOperation;\n tokens: readonly (InternalToken<TokenValue> | InternalTokenGroup<TokenValue>)[];\n}\n\nexport type InternalQuery = InternalTokenGroup;\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 PropertyFilterQuery,\n PropertyFilterToken,\n PropertyFilterTokenGroup,\n PropertyFilterTokenType,\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 * When the `countText` or `query` changes, it will be announced to assistive technologies.\n */\n countText?: string;\n\n /**\n * Set to `true` while the related collection is loading (e.g. during an async filtering action).\n * If set to `true`, the live announcement of countText by assistive technologies will be paused until it changes back to `false`.\n */\n loading?: boolean;\n\n /**\n * An object representing the current query displayed in the property filter, which has three properties: `operation`, `tokens`, and `tokenGroups`.\n * The `operation` property has two valid values: \"and\", \"or\", and controls the join operation to be applied between tokens when filtering the items.\n * The `tokens` property is an array of objects that will be displayed to the user beneath the filtering input. When `enableTokenGroups=true`, the\n * `tokenGroups` property is used instead, which supports nested tokens.\n *\n * Each token has the following properties:\n * * value [unknown]: The value of the token to be used as a filter. Can be null or string for default tokens, string[] for enum tokens, and anything for tokens with custom forms.\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 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, or use `readOnlyOperations`.\n *\n * This property cannot be set when `enableTokenGroups=true`.\n */\n hideOperations?: boolean;\n /**\n * If readOnlyOperations it set, the indicator of the operation (that is, `and` or `or`) is shown, but the\n * operation cannot be changed. This is also supported for nested tokens when `enableTokenGroups=true`.\n */\n readOnlyOperations?: boolean;\n /**\n * Activates token grouping mechanism to support token nesting (up to one level).\n * When `true`, the `query.tokens` property is ignored and `query.tokenGroups` is used instead.\n */\n enableTokenGroups?: 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` asynchronously. 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 TokenGroup = PropertyFilterTokenGroup;\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 export type Query = PropertyFilterQuery;\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 formatToken?: (token: FormattedToken) => 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 groupEditAriaLabel?: (group: FormattedTokenGroup) => string;\n tokenEditorTokenActionsAriaLabel?: (token: FormattedToken) => string;\n tokenEditorTokenRemoveAriaLabel?: (token: FormattedToken) => string;\n tokenEditorTokenRemoveLabel?: string;\n tokenEditorTokenRemoveFromGroupLabel?: string;\n tokenEditorAddNewTokenLabel?: string;\n tokenEditorAddTokenActionsAriaLabel?: string;\n tokenEditorAddExistingTokenAriaLabel?: (token: FormattedToken) => string;\n tokenEditorAddExistingTokenLabel?: (token: FormattedToken) => string;\n }\n\n export interface FormattedToken {\n propertyKey?: string;\n propertyLabel: string;\n operator: ComparisonOperator;\n value: string;\n }\n\n export interface FormattedTokenGroup {\n tokens: FormattedToken[];\n operation: string;\n operationLabel: 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 TokenGroup = PropertyFilterProps.TokenGroup;\nexport type JoinOperation = PropertyFilterProps.JoinOperation;\nexport type ComparisonOperator = PropertyFilterProps.ComparisonOperator;\nexport type ExtendedOperator<TokenValue> = PropertyFilterOperatorExtended<TokenValue>;\nexport type ExtendedOperatorForm<TokenValue> = PropertyFilterOperatorForm<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 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 getTokenType: (operator?: PropertyFilterOperator) => PropertyFilterTokenType;\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 standaloneIndex?: number;\n property: null | InternalFilteringProperty<TokenValue>;\n operator: PropertyFilterOperator;\n value: TokenValue;\n}\n\nexport interface InternalTokenGroup<TokenValue = any> {\n operation: PropertyFilterOperation;\n tokens: readonly (InternalToken<TokenValue> | InternalTokenGroup<TokenValue>)[];\n}\n\nexport type InternalQuery = InternalTokenGroup;\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"]}
@@ -3,6 +3,7 @@ import { InternalBaseComponentProps } from '../internal/hooks/use-base-component
3
3
  import { PropertyFilterProps } from './interfaces';
4
4
  declare const PropertyFilterInternal: React.ForwardRefExoticComponent<PropertyFilterProps & {
5
5
  hideOperations: boolean;
6
+ readOnlyOperations: boolean;
6
7
  enableTokenGroups: boolean;
7
8
  filteringOptions: readonly import("@cloudscape-design/collection-hooks").PropertyFilterOption[];
8
9
  customGroupsText: PropertyFilterProps.GroupText[];
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/property-filter/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAgD,MAAM,OAAO,CAAC;AAWrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAalF,OAAO,EAWL,mBAAmB,EAIpB,MAAM,cAAc,CAAC;AAgBtB,QAAA,MAAM,sBAAsB;;;;;;mFA8a3B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/property-filter/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAgD,MAAM,OAAO,CAAC;AAWrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAalF,OAAO,EAWL,mBAAmB,EAIpB,MAAM,cAAc,CAAC;AAqBtB,QAAA,MAAM,sBAAsB;;;;;;;mFAgb3B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -26,7 +26,7 @@ import analyticsSelectors from './analytics-metadata/styles.css.js';
26
26
  import styles from './styles.css.js';
27
27
  const PropertyFilterInternal = React.forwardRef((_a, ref) => {
28
28
  var _b;
29
- var { disabled, countText, query, hideOperations, onChange, filteringProperties, filteringOptions, customGroupsText, disableFreeTextFiltering, freeTextFiltering, onLoadItems, virtualScroll, customControl, customFilterActions, filteringPlaceholder, filteringAriaLabel, filteringEmpty, filteringLoadingText, filteringFinishedText, filteringErrorText, filteringRecoveryText, filteringConstraintText, filteringStatusType, asyncProperties, tokenLimit, expandToViewport, tokenLimitShowFewerAriaLabel, tokenLimitShowMoreAriaLabel, enableTokenGroups, loading = false, __internalRootRef } = _a, rest = __rest(_a, ["disabled", "countText", "query", "hideOperations", "onChange", "filteringProperties", "filteringOptions", "customGroupsText", "disableFreeTextFiltering", "freeTextFiltering", "onLoadItems", "virtualScroll", "customControl", "customFilterActions", "filteringPlaceholder", "filteringAriaLabel", "filteringEmpty", "filteringLoadingText", "filteringFinishedText", "filteringErrorText", "filteringRecoveryText", "filteringConstraintText", "filteringStatusType", "asyncProperties", "tokenLimit", "expandToViewport", "tokenLimitShowFewerAriaLabel", "tokenLimitShowMoreAriaLabel", "enableTokenGroups", "loading", "__internalRootRef"]);
29
+ var { disabled, countText, query, hideOperations, readOnlyOperations, onChange, filteringProperties, filteringOptions, customGroupsText, disableFreeTextFiltering, freeTextFiltering, onLoadItems, virtualScroll, customControl, customFilterActions, filteringPlaceholder, filteringAriaLabel, filteringEmpty, filteringLoadingText, filteringFinishedText, filteringErrorText, filteringRecoveryText, filteringConstraintText, filteringStatusType, asyncProperties, tokenLimit, expandToViewport, tokenLimitShowFewerAriaLabel, tokenLimitShowMoreAriaLabel, enableTokenGroups, loading = false, __internalRootRef } = _a, rest = __rest(_a, ["disabled", "countText", "query", "hideOperations", "readOnlyOperations", "onChange", "filteringProperties", "filteringOptions", "customGroupsText", "disableFreeTextFiltering", "freeTextFiltering", "onLoadItems", "virtualScroll", "customControl", "customFilterActions", "filteringPlaceholder", "filteringAriaLabel", "filteringEmpty", "filteringLoadingText", "filteringFinishedText", "filteringErrorText", "filteringRecoveryText", "filteringConstraintText", "filteringStatusType", "asyncProperties", "tokenLimit", "expandToViewport", "tokenLimitShowFewerAriaLabel", "tokenLimitShowMoreAriaLabel", "enableTokenGroups", "loading", "__internalRootRef"]);
30
30
  const [nextFocusIndex, setNextFocusIndex] = useState(null);
31
31
  const tokenListRef = useListFocusController({
32
32
  nextFocusIndex,
@@ -251,7 +251,7 @@ const PropertyFilterInternal = React.forwardRef((_a, ref) => {
251
251
  }, onUpdateOperation: updateOperation, onRemoveToken: () => {
252
252
  removeToken(tokenIndex);
253
253
  setNextFocusIndex(tokenIndex);
254
- }, filteringProperties: internalProperties, filteringOptions: internalOptions, asyncProps: asyncProps, onLoadItems: onLoadItems, i18nStrings: i18nStrings, asyncProperties: asyncProperties, hideOperations: hideOperations, customGroupsText: customGroupsText, freeTextFiltering: internalFreeText, disabled: disabled, expandToViewport: expandToViewport, enableTokenGroups: enableTokenGroups })), i18nStrings: {
254
+ }, filteringProperties: internalProperties, filteringOptions: internalOptions, asyncProps: asyncProps, onLoadItems: onLoadItems, i18nStrings: i18nStrings, asyncProperties: asyncProperties, hideOperations: hideOperations, readOnlyOperations: readOnlyOperations, customGroupsText: customGroupsText, freeTextFiltering: internalFreeText, disabled: disabled, expandToViewport: expandToViewport, enableTokenGroups: enableTokenGroups })), i18nStrings: {
255
255
  limitShowFewer: i18nStrings.tokenLimitShowFewer,
256
256
  limitShowMore: i18nStrings.tokenLimitShowMore,
257
257
  }, after: customFilterActions ? (React.createElement("div", { className: styles['custom-filter-actions'] }, customFilterActions)) : (React.createElement("span", Object.assign({}, getAnalyticsMetadataAttribute({
@@ -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,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,SAAS,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,+BAA+B,MAAM,oDAAoD,CAAC;AAEjG,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACtG,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAiBrD,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACjH,OAAO,yBAA6D,MAAM,+BAA+B,CAAC;AAC1G,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM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AM,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, { useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { PropertyFilterOperator } from '@cloudscape-design/collection-hooks';\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 { fireNonCancelableEvent } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useListFocusController } from '../internal/hooks/use-list-focus-controller';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useUniqueId } from '../internal/hooks/use-unique-id/index';\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';\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' | 'customGroupsText' | 'enableTokenGroups' | 'disableFreeTextFiltering' | 'hideOperations'\n> &\n InternalBaseComponentProps;\n\nconst PropertyFilterInternal = React.forwardRef(\n (\n {\n disabled,\n countText,\n query,\n hideOperations,\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 { 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 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,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,SAAS,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,WAAW,EA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BAAgB,EAAE,eAAe,EACjC,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,EAC9B,kBAAkB,EAAE,kBAAkB,EACtC,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,gBAAgB,EACnC,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,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, { useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { PropertyFilterOperator } from '@cloudscape-design/collection-hooks';\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 { fireNonCancelableEvent } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useListFocusController } from '../internal/hooks/use-list-focus-controller';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useUniqueId } from '../internal/hooks/use-unique-id/index';\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';\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 { 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"]}
@@ -18,10 +18,11 @@ interface TokenProps {
18
18
  filteringProperties: readonly InternalFilteringProperty[];
19
19
  filteringOptions: readonly InternalFilteringOption[];
20
20
  hideOperations?: boolean;
21
+ readOnlyOperations?: boolean;
21
22
  i18nStrings: I18nStringsInternal;
22
23
  onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;
23
24
  enableTokenGroups: boolean;
24
25
  }
25
- export declare const TokenButton: ({ query, onUpdateToken, onUpdateOperation, onRemoveToken, tokenIndex, filteringProperties, filteringOptions, asyncProps, onLoadItems, i18nStrings, asyncProperties, hideOperations, customGroupsText, disabled, freeTextFiltering, expandToViewport, enableTokenGroups, }: TokenProps) => JSX.Element;
26
+ export declare const TokenButton: ({ query, onUpdateToken, onUpdateOperation, onRemoveToken, tokenIndex, filteringProperties, filteringOptions, asyncProps, onLoadItems, i18nStrings, asyncProperties, hideOperations, readOnlyOperations, customGroupsText, disabled, freeTextFiltering, expandToViewport, enableTokenGroups, }: TokenProps) => JSX.Element;
26
27
  export {};
27
28
  //# sourceMappingURL=token.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../src/property-filter/token.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAEL,SAAS,EACT,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,eAAe,EAChB,MAAM,cAAc,CAAC;AAOtB,UAAU,UAAU;IAClB,KAAK,EAAE,aAAa,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,CAAC,YAAY,EAAE,aAAa,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E,cAAc,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;IAC3G,iBAAiB,EAAE,CAAC,gBAAgB,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7D,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,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,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,mBAAmB,CAAC;IACjC,WAAW,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,CAAC;IACzD,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,WAAW,kSAmBrB,UAAU,gBA2GZ,CAAC"}
@@ -8,7 +8,7 @@ import { TokenEditor } from './token-editor';
8
8
  import { tokenGroupToTokens } from './utils';
9
9
  import analyticsSelectors from './analytics-metadata/styles.css.js';
10
10
  import styles from './styles.css.js';
11
- export const TokenButton = ({ query, onUpdateToken, onUpdateOperation, onRemoveToken, tokenIndex, filteringProperties, filteringOptions, asyncProps, onLoadItems, i18nStrings, asyncProperties, hideOperations, customGroupsText, disabled, freeTextFiltering, expandToViewport, enableTokenGroups, }) => {
11
+ export const TokenButton = ({ query, onUpdateToken, onUpdateOperation, onRemoveToken, tokenIndex, filteringProperties, filteringOptions, asyncProps, onLoadItems, i18nStrings, asyncProperties, hideOperations, readOnlyOperations, customGroupsText, disabled, freeTextFiltering, expandToViewport, enableTokenGroups, }) => {
12
12
  var _a, _b, _c, _d;
13
13
  const tokenRef = useRef(null);
14
14
  const hasGroups = query.tokens.some(tokenOrGroup => 'operation' in tokenOrGroup);
@@ -36,7 +36,7 @@ export const TokenButton = ({ query, onUpdateToken, onUpdateOperation, onRemoveT
36
36
  ariaLabel: formattedToken.formattedText,
37
37
  dismissAriaLabel: i18nStrings.removeTokenButtonAriaLabel(token),
38
38
  };
39
- }), showOperation: !first && !hideOperations, operation: operation, andText: (_a = i18nStrings.operationAndText) !== null && _a !== void 0 ? _a : '', orText: (_b = i18nStrings.operationOrText) !== null && _b !== void 0 ? _b : '', operationAriaLabel: (_c = i18nStrings.tokenOperatorAriaLabel) !== null && _c !== void 0 ? _c : '', onChangeOperation: onUpdateOperation, onDismissToken: (removeIndex) => {
39
+ }), showOperation: !first && !hideOperations, readOnlyOperations: !!readOnlyOperations, operation: operation, andText: (_a = i18nStrings.operationAndText) !== null && _a !== void 0 ? _a : '', orText: (_b = i18nStrings.operationOrText) !== null && _b !== void 0 ? _b : '', operationAriaLabel: (_c = i18nStrings.tokenOperatorAriaLabel) !== null && _c !== void 0 ? _c : '', onChangeOperation: onUpdateOperation, onDismissToken: (removeIndex) => {
40
40
  if (tokens.length === 1) {
41
41
  onRemoveToken();
42
42
  }
@@ -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;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAIjH,OAAO,cAAqC,MAAM,mBAAmB,CAAC;AActE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AACpE,OAAO,MAAM,MAA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aAAa,EAAE,GAAG,UAAU,GAAG,CAAC,EAAE;YAClC,UAAU,EAAE,IAAI,kBAAkB,CAAC,eAAe,CAAC,EAAE;SACtD;KACF,CAAC,EACF,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';\nimport clsx from 'clsx';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport FilteringToken, { FilteringTokenRef } from './filtering-token';\nimport { I18nStringsInternal } from './i18n-utils';\nimport {\n FormattedToken,\n GroupText,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n InternalQuery,\n InternalToken,\n InternalTokenGroup,\n JoinOperation,\n LoadItemsDetail,\n} from './interfaces';\nimport { TokenEditor } from './token-editor';\nimport { tokenGroupToTokens } from './utils';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface TokenProps {\n query: InternalQuery;\n tokenIndex: number;\n onUpdateToken: (updatedToken: InternalToken | InternalTokenGroup, releasedTokens: InternalToken[]) => void;\n onUpdateOperation: (updatedOperation: JoinOperation) => void;\n onRemoveToken: () => void;\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 hideOperations?: boolean;\n i18nStrings: I18nStringsInternal;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n enableTokenGroups: boolean;\n}\n\nexport const TokenButton = ({\n query,\n onUpdateToken,\n onUpdateOperation,\n onRemoveToken,\n tokenIndex,\n filteringProperties,\n filteringOptions,\n asyncProps,\n onLoadItems,\n i18nStrings,\n asyncProperties,\n hideOperations,\n customGroupsText,\n disabled,\n freeTextFiltering,\n expandToViewport,\n enableTokenGroups,\n}: TokenProps) => {\n const tokenRef = useRef<FilteringTokenRef>(null);\n\n const hasGroups = query.tokens.some(tokenOrGroup => 'operation' in tokenOrGroup);\n const first = tokenIndex === 0;\n\n const tokenOrGroup = query.tokens[tokenIndex];\n const tokens = tokenGroupToTokens<InternalToken>([tokenOrGroup]).map(t => ({ ...t, standaloneIndex: undefined }));\n const operation = query.operation;\n const groupOperation = 'operation' in tokenOrGroup ? tokenOrGroup.operation : operation === 'and' ? 'or' : 'and';\n\n const [tempTokens, setTempTokens] = useState<InternalToken[]>(tokens);\n const capturedTokenIndices = tempTokens.map(token => token.standaloneIndex).filter(index => index !== undefined);\n const tokensToCapture: InternalToken[] = [];\n for (let index = 0; index < query.tokens.length; index++) {\n const token = query.tokens[index];\n if ('operator' in token && token !== tokenOrGroup && !capturedTokenIndices.includes(index)) {\n tokensToCapture.push(token);\n }\n }\n const [tempReleasedTokens, setTempReleasedTokens] = useState<InternalToken[]>([]);\n tokensToCapture.push(...tempReleasedTokens);\n\n return (\n <FilteringToken\n ref={tokenRef}\n tokens={tokens.map(token => {\n const formattedToken = i18nStrings.formatToken(token);\n return {\n content: (\n <span className={clsx(styles['token-trigger'], analyticsSelectors['token-trigger'])}>\n <TokenTrigger token={formattedToken} allProperties={token.property === null} />\n </span>\n ),\n ariaLabel: formattedToken.formattedText,\n dismissAriaLabel: i18nStrings.removeTokenButtonAriaLabel(token),\n };\n })}\n showOperation={!first && !hideOperations}\n operation={operation}\n andText={i18nStrings.operationAndText ?? ''}\n orText={i18nStrings.operationOrText ?? ''}\n operationAriaLabel={i18nStrings.tokenOperatorAriaLabel ?? ''}\n onChangeOperation={onUpdateOperation}\n onDismissToken={(removeIndex: number) => {\n if (tokens.length === 1) {\n onRemoveToken();\n } else {\n const newTokens = tokens.filter((_, index) => index !== removeIndex);\n const updatedToken = newTokens.length === 1 ? newTokens[0] : { operation: groupOperation, tokens: newTokens };\n onUpdateToken(updatedToken, []);\n }\n }}\n disabled={disabled}\n editorContent={\n <TokenEditor\n supportsGroups={enableTokenGroups}\n filteringProperties={filteringProperties}\n filteringOptions={filteringOptions}\n tempGroup={tempTokens}\n onChangeTempGroup={setTempTokens}\n tokensToCapture={tokensToCapture}\n onTokenCapture={capturedToken => setTempReleasedTokens(prev => prev.filter(token => token !== capturedToken))}\n onTokenRelease={releasedToken => {\n if (releasedToken.standaloneIndex === undefined) {\n setTempReleasedTokens(prev => [...prev, releasedToken]);\n }\n }}\n asyncProps={asyncProps}\n onLoadItems={onLoadItems}\n i18nStrings={i18nStrings}\n asyncProperties={asyncProperties}\n customGroupsText={customGroupsText}\n freeTextFiltering={freeTextFiltering}\n onDismiss={() => {\n tokenRef.current?.closeEditor();\n }}\n onSubmit={() => {\n const updatedToken =\n tempTokens.length === 1 ? tempTokens[0] : { operation: groupOperation, tokens: tempTokens };\n onUpdateToken(updatedToken, tempReleasedTokens);\n tokenRef.current?.closeEditor();\n }}\n />\n }\n editorHeader={i18nStrings.editTokenHeader ?? ''}\n editorDismissAriaLabel={i18nStrings.dismissAriaLabel}\n editorExpandToViewport={!!expandToViewport}\n onEditorOpen={() => {\n setTempTokens(tokens);\n setTempReleasedTokens([]);\n }}\n groupOperation={groupOperation}\n onChangeGroupOperation={operation => onUpdateToken({ operation, tokens }, [])}\n groupAriaLabel={i18nStrings.groupAriaLabel({ operation: groupOperation, tokens })}\n groupEditAriaLabel={i18nStrings.groupEditAriaLabel({ operation: groupOperation, tokens })}\n hasGroups={hasGroups}\n popoverSize={enableTokenGroups ? 'content' : 'large'}\n {...getAnalyticsMetadataAttribute({\n detail: {\n tokenPosition: `${tokenIndex + 1}`,\n tokenLabel: `.${analyticsSelectors['token-trigger']}`,\n },\n })}\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"]}
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;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAIjH,OAAO,cAAqC,MAAM,mBAAmB,CAAC;AActE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AACpE,OAAO,MAAM,MAAM,iBAAiB,CAAC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D,6BAA6B,CAAC;QAChC,MAAM,EAAE;YACN,aAAa,EAAE,GAAG,UAAU,GAAG,CAAC,EAAE;YAClC,UAAU,EAAE,IAAI,kBAAkB,CAAC,eAAe,CAAC,EAAE;SACtD;KACF,CAAC,EACF,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';\nimport clsx from 'clsx';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport FilteringToken, { FilteringTokenRef } from './filtering-token';\nimport { I18nStringsInternal } from './i18n-utils';\nimport {\n FormattedToken,\n GroupText,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n InternalQuery,\n InternalToken,\n InternalTokenGroup,\n JoinOperation,\n LoadItemsDetail,\n} from './interfaces';\nimport { TokenEditor } from './token-editor';\nimport { tokenGroupToTokens } from './utils';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface TokenProps {\n query: InternalQuery;\n tokenIndex: number;\n onUpdateToken: (updatedToken: InternalToken | InternalTokenGroup, releasedTokens: InternalToken[]) => void;\n onUpdateOperation: (updatedOperation: JoinOperation) => void;\n onRemoveToken: () => void;\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 hideOperations?: boolean;\n readOnlyOperations?: boolean;\n i18nStrings: I18nStringsInternal;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n enableTokenGroups: boolean;\n}\n\nexport const TokenButton = ({\n query,\n onUpdateToken,\n onUpdateOperation,\n onRemoveToken,\n tokenIndex,\n filteringProperties,\n filteringOptions,\n asyncProps,\n onLoadItems,\n i18nStrings,\n asyncProperties,\n hideOperations,\n readOnlyOperations,\n customGroupsText,\n disabled,\n freeTextFiltering,\n expandToViewport,\n enableTokenGroups,\n}: TokenProps) => {\n const tokenRef = useRef<FilteringTokenRef>(null);\n\n const hasGroups = query.tokens.some(tokenOrGroup => 'operation' in tokenOrGroup);\n const first = tokenIndex === 0;\n\n const tokenOrGroup = query.tokens[tokenIndex];\n const tokens = tokenGroupToTokens<InternalToken>([tokenOrGroup]).map(t => ({ ...t, standaloneIndex: undefined }));\n const operation = query.operation;\n const groupOperation = 'operation' in tokenOrGroup ? tokenOrGroup.operation : operation === 'and' ? 'or' : 'and';\n\n const [tempTokens, setTempTokens] = useState<InternalToken[]>(tokens);\n const capturedTokenIndices = tempTokens.map(token => token.standaloneIndex).filter(index => index !== undefined);\n const tokensToCapture: InternalToken[] = [];\n for (let index = 0; index < query.tokens.length; index++) {\n const token = query.tokens[index];\n if ('operator' in token && token !== tokenOrGroup && !capturedTokenIndices.includes(index)) {\n tokensToCapture.push(token);\n }\n }\n const [tempReleasedTokens, setTempReleasedTokens] = useState<InternalToken[]>([]);\n tokensToCapture.push(...tempReleasedTokens);\n\n return (\n <FilteringToken\n ref={tokenRef}\n tokens={tokens.map(token => {\n const formattedToken = i18nStrings.formatToken(token);\n return {\n content: (\n <span className={clsx(styles['token-trigger'], analyticsSelectors['token-trigger'])}>\n <TokenTrigger token={formattedToken} allProperties={token.property === null} />\n </span>\n ),\n ariaLabel: formattedToken.formattedText,\n dismissAriaLabel: i18nStrings.removeTokenButtonAriaLabel(token),\n };\n })}\n showOperation={!first && !hideOperations}\n readOnlyOperations={!!readOnlyOperations}\n operation={operation}\n andText={i18nStrings.operationAndText ?? ''}\n orText={i18nStrings.operationOrText ?? ''}\n operationAriaLabel={i18nStrings.tokenOperatorAriaLabel ?? ''}\n onChangeOperation={onUpdateOperation}\n onDismissToken={(removeIndex: number) => {\n if (tokens.length === 1) {\n onRemoveToken();\n } else {\n const newTokens = tokens.filter((_, index) => index !== removeIndex);\n const updatedToken = newTokens.length === 1 ? newTokens[0] : { operation: groupOperation, tokens: newTokens };\n onUpdateToken(updatedToken, []);\n }\n }}\n disabled={disabled}\n editorContent={\n <TokenEditor\n supportsGroups={enableTokenGroups}\n filteringProperties={filteringProperties}\n filteringOptions={filteringOptions}\n tempGroup={tempTokens}\n onChangeTempGroup={setTempTokens}\n tokensToCapture={tokensToCapture}\n onTokenCapture={capturedToken => setTempReleasedTokens(prev => prev.filter(token => token !== capturedToken))}\n onTokenRelease={releasedToken => {\n if (releasedToken.standaloneIndex === undefined) {\n setTempReleasedTokens(prev => [...prev, releasedToken]);\n }\n }}\n asyncProps={asyncProps}\n onLoadItems={onLoadItems}\n i18nStrings={i18nStrings}\n asyncProperties={asyncProperties}\n customGroupsText={customGroupsText}\n freeTextFiltering={freeTextFiltering}\n onDismiss={() => {\n tokenRef.current?.closeEditor();\n }}\n onSubmit={() => {\n const updatedToken =\n tempTokens.length === 1 ? tempTokens[0] : { operation: groupOperation, tokens: tempTokens };\n onUpdateToken(updatedToken, tempReleasedTokens);\n tokenRef.current?.closeEditor();\n }}\n />\n }\n editorHeader={i18nStrings.editTokenHeader ?? ''}\n editorDismissAriaLabel={i18nStrings.dismissAriaLabel}\n editorExpandToViewport={!!expandToViewport}\n onEditorOpen={() => {\n setTempTokens(tokens);\n setTempReleasedTokens([]);\n }}\n groupOperation={groupOperation}\n onChangeGroupOperation={operation => onUpdateToken({ operation, tokens }, [])}\n groupAriaLabel={i18nStrings.groupAriaLabel({ operation: groupOperation, tokens })}\n groupEditAriaLabel={i18nStrings.groupEditAriaLabel({ operation: groupOperation, tokens })}\n hasGroups={hasGroups}\n popoverSize={enableTokenGroups ? 'content' : 'large'}\n {...getAnalyticsMetadataAttribute({\n detail: {\n tokenPosition: `${tokenIndex + 1}`,\n tokenLabel: `.${analyticsSelectors['token-trigger']}`,\n },\n })}\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"]}
@@ -6,5 +6,13 @@ export default class CopyToClipboardWrapper extends ComponentWrapper {
6
6
  findStatusText(options?: {
7
7
  popoverRenderWithPortal: boolean;
8
8
  }): null | ElementWrapper;
9
+ /**
10
+ * @deprecated Use `findDisplayedText` instead.
11
+ */
9
12
  findTextToCopy(): null | ElementWrapper;
13
+ /**
14
+ * Used to get the text displayed next to the copy icon button when `variant='inline'`.
15
+ * Returns either the `textToCopy` value or the `textToDisplay` value if it has been set.
16
+ */
17
+ findDisplayedText(): null | ElementWrapper;
10
18
  }
@@ -15,9 +15,19 @@ class CopyToClipboardWrapper extends dom_1.ComponentWrapper {
15
15
  renderWithPortal: options.popoverRenderWithPortal,
16
16
  });
17
17
  }
18
+ /**
19
+ * @deprecated Use `findDisplayedText` instead.
20
+ */
18
21
  findTextToCopy() {
19
22
  return this.findByClassName(styles_selectors_js_1.default['text-to-copy']);
20
23
  }
24
+ /**
25
+ * Used to get the text displayed next to the copy icon button when `variant='inline'`.
26
+ * Returns either the `textToCopy` value or the `textToDisplay` value if it has been set.
27
+ */
28
+ findDisplayedText() {
29
+ return this.findByClassName(styles_selectors_js_1.default['text-to-display']);
30
+ }
21
31
  }
22
32
  exports.default = CopyToClipboardWrapper;
23
33
  CopyToClipboardWrapper.rootSelector = styles_selectors_js_1.default.root;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/copy-to-clipboard/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,sCAAsC;AACtC,wCAAwC;AAExC,qGAAqF;AAErF,MAAqB,sBAAuB,SAAQ,sBAAgB;IAGlE,cAAc;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,gBAAa,CAAC,YAAY,EAAE,EAAE,gBAAa,CAAE,CAAC;IAC9E,CAAC;IAED,cAAc,CAAC,OAAO,GAAG,EAAE,uBAAuB,EAAE,KAAK,EAAE;QACzD,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,iBAAc,CAAC,YAAY,EAAE,EAAE,iBAAc,CAAE,CAAC,WAAW,CAAC;YACxF,gBAAgB,EAAE,OAAO,CAAC,uBAAuB;SAClD,CAAC,CAAC;IACL,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IAC1D,CAAC;;AAfH,yCAgBC;AAfQ,mCAAY,GAAW,6BAAU,CAAC,IAAI,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/copy-to-clipboard/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,sCAAsC;AACtC,wCAAwC;AAExC,qGAAqF;AAErF,MAAqB,sBAAuB,SAAQ,sBAAgB;IAGlE,cAAc;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,gBAAa,CAAC,YAAY,EAAE,EAAE,gBAAa,CAAE,CAAC;IAC9E,CAAC;IAED,cAAc,CAAC,OAAO,GAAG,EAAE,uBAAuB,EAAE,KAAK,EAAE;QACzD,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,iBAAc,CAAC,YAAY,EAAE,EAAE,iBAAc,CAAE,CAAC,WAAW,CAAC;YACxF,gBAAgB,EAAE,OAAO,CAAC,uBAAuB;SAClD,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED;;;OAGG;IACH,iBAAiB;QACf,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC7D,CAAC;;AA1BH,yCA2BC;AA1BQ,mCAAY,GAAW,6BAAU,CAAC,IAAI,CAAC"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  const dom_1 = require("@cloudscape-design/test-utils-core/dom");
6
+ const index_1 = require("../index");
6
7
  const index_js_1 = require("../index.js");
7
8
  const styles_selectors_js_1 = require("../../../annotation-context/annotation/styles.selectors.js");
8
9
  const styles_selectors_js_2 = require("../../../hotspot/styles.selectors.js");
@@ -11,7 +12,7 @@ class HotspotWrapper extends dom_1.ComponentWrapper {
11
12
  return this.findByClassName(styles_selectors_js_1.default.hotspot);
12
13
  }
13
14
  findAnnotation() {
14
- return this.findComponent(`.${styles_selectors_js_1.default.annotation}`, index_js_1.AnnotationWrapper);
15
+ return (0, index_1.default)().findComponent(`.${styles_selectors_js_1.default.annotation}`, index_js_1.AnnotationWrapper);
15
16
  }
16
17
  }
17
18
  exports.default = HotspotWrapper;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/hotspot/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,0CAAgD;AAEhD,oGAA0F;AAC1F,8EAAiE;AAEjE,MAAqB,cAAe,SAAQ,sBAAgB;IAG1D,WAAW;QACT,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAgB,CAAC,OAAO,CAAE,CAAC;IACzD,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAgB,CAAC,UAAU,EAAE,EAAE,4BAAiB,CAAC,CAAC;IAClF,CAAC;;AATH,iCAUC;AATQ,2BAAY,GAAW,6BAAa,CAAC,IAAI,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/hotspot/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,oCAAqC;AACrC,0CAAgD;AAEhD,oGAA0F;AAC1F,8EAAiE;AAEjE,MAAqB,cAAe,SAAQ,sBAAgB;IAG1D,WAAW;QACT,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAgB,CAAC,OAAO,CAAE,CAAC;IACzD,CAAC;IAED,cAAc;QACZ,OAAO,IAAA,eAAa,GAAE,CAAC,aAAa,CAAC,IAAI,6BAAgB,CAAC,UAAU,EAAE,EAAE,4BAAiB,CAAE,CAAC;IAC9F,CAAC;;AATH,iCAUC;AATQ,2BAAY,GAAW,6BAAa,CAAC,IAAI,CAAC"}
@@ -78,6 +78,7 @@ import ToggleWrapper from './toggle';
78
78
  import ToggleButtonWrapper from './toggle-button';
79
79
  import TokenGroupWrapper from './token-group';
80
80
  import TopNavigationWrapper from './top-navigation';
81
+ import TreeViewWrapper from './tree-view';
81
82
  import TutorialPanelWrapper from './tutorial-panel';
82
83
  import WizardWrapper from './wizard';
83
84
  export { AlertWrapper };
@@ -158,6 +159,7 @@ export { ToggleWrapper };
158
159
  export { ToggleButtonWrapper };
159
160
  export { TokenGroupWrapper };
160
161
  export { TopNavigationWrapper };
162
+ export { TreeViewWrapper };
161
163
  export { TutorialPanelWrapper };
162
164
  export { WizardWrapper };
163
165
  declare module '@cloudscape-design/test-utils-core/dist/dom' {
@@ -1566,6 +1568,24 @@ declare module '@cloudscape-design/test-utils-core/dist/dom' {
1566
1568
  * @returns {Array<TopNavigationWrapper>}
1567
1569
  */
1568
1570
  findAllTopNavigations(selector?: string): Array<TopNavigationWrapper>;
1571
+ /**
1572
+ * Returns the wrapper of the first TreeView that matches the specified CSS selector.
1573
+ * If no CSS selector is specified, returns the wrapper of the first TreeView.
1574
+ * If no matching TreeView is found, returns `null`.
1575
+ *
1576
+ * @param {string} [selector] CSS Selector
1577
+ * @returns {TreeViewWrapper | null}
1578
+ */
1579
+ findTreeView(selector?: string): TreeViewWrapper | null;
1580
+ /**
1581
+ * Returns an array of TreeView wrapper that matches the specified CSS selector.
1582
+ * If no CSS selector is specified, returns all of the TreeViews inside the current wrapper.
1583
+ * If no matching TreeView is found, returns an empty array.
1584
+ *
1585
+ * @param {string} [selector] CSS Selector
1586
+ * @returns {Array<TreeViewWrapper>}
1587
+ */
1588
+ findAllTreeViews(selector?: string): Array<TreeViewWrapper>;
1569
1589
  /**
1570
1590
  * Returns the wrapper of the first TutorialPanel that matches the specified CSS selector.
1571
1591
  * If no CSS selector is specified, returns the wrapper of the first TutorialPanel.