@cloudscape-design/components 3.0.1289 → 3.0.1291
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app-layout/visual-refresh-toolbar/skeleton/index.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/skeleton/index.js +8 -2
- package/app-layout/visual-refresh-toolbar/skeleton/index.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/skeleton/multi-layout.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/skeleton/multi-layout.js +5 -2
- package/app-layout/visual-refresh-toolbar/skeleton/multi-layout.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/skeleton/skeleton-parts.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/skeleton/skeleton-parts.js +12 -3
- package/app-layout/visual-refresh-toolbar/skeleton/skeleton-parts.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.d.ts +5 -0
- package/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.js +13 -4
- package/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.js.map +1 -1
- package/autosuggest/autosuggest-option.d.ts.map +1 -1
- package/autosuggest/autosuggest-option.js +19 -19
- package/autosuggest/autosuggest-option.js.map +1 -1
- package/internal/base-component/styles.scoped.css +1 -1
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/property-filter/controller.d.ts +1 -0
- package/property-filter/controller.d.ts.map +1 -1
- package/property-filter/controller.js +7 -4
- package/property-filter/controller.js.map +1 -1
- package/property-filter/interfaces.d.ts +10 -2
- package/property-filter/interfaces.d.ts.map +1 -1
- package/property-filter/interfaces.js.map +1 -1
- package/property-filter/token-editor-inputs.d.ts.map +1 -1
- package/property-filter/token-editor-inputs.js +3 -2
- package/property-filter/token-editor-inputs.js.map +1 -1
- package/property-filter/token-editor.d.ts.map +1 -1
- package/property-filter/token-editor.js +4 -2
- package/property-filter/token-editor.js.map +1 -1
- package/test-utils/dom/autosuggest/index.js +4 -4
- package/test-utils/dom/autosuggest/index.js.map +1 -1
- package/test-utils/dom/internal/dropdown-host.js +1 -1
- package/test-utils/dom/internal/dropdown-host.js.map +1 -1
- package/test-utils/dom/prompt-input/index.js +3 -3
- package/test-utils/dom/prompt-input/index.js.map +1 -1
- package/test-utils/selectors/autosuggest/index.js +4 -4
- package/test-utils/selectors/autosuggest/index.js.map +1 -1
- package/test-utils/selectors/internal/dropdown-host.js +1 -1
- package/test-utils/selectors/internal/dropdown-host.js.map +1 -1
- package/test-utils/selectors/prompt-input/index.js +3 -3
- package/test-utils/selectors/prompt-input/index.js.map +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { PropertyFilterOperation, PropertyFilterOperator, PropertyFilterOperatorExtended, PropertyFilterOperatorForm, PropertyFilterOperatorFormat, PropertyFilterOperatorFormProps, PropertyFilterOption, PropertyFilterProperty, PropertyFilterQuery, PropertyFilterToken, PropertyFilterTokenGroup, PropertyFilterTokenType } from '@cloudscape-design/collection-hooks';
|
|
3
3
|
import { AutosuggestProps } from '../autosuggest/interfaces';
|
|
4
4
|
import { ExpandToViewport } from '../dropdown/interfaces';
|
|
5
5
|
import { BaseComponentProps } from '../internal/base-component';
|
|
@@ -213,6 +213,14 @@ export interface PropertyFilterProps extends BaseComponentProps, ExpandToViewpor
|
|
|
213
213
|
*/
|
|
214
214
|
tokenLimitShowMoreAriaLabel?: string;
|
|
215
215
|
}
|
|
216
|
+
export interface PropertyFilterTextOperatorExtended {
|
|
217
|
+
operator: PropertyFilterOperator;
|
|
218
|
+
match?: (item: unknown, text: string) => boolean;
|
|
219
|
+
}
|
|
220
|
+
export interface PropertyFilterFreeTextFiltering {
|
|
221
|
+
operators?: readonly (PropertyFilterOperator | PropertyFilterTextOperatorExtended)[];
|
|
222
|
+
defaultOperator?: PropertyFilterOperator;
|
|
223
|
+
}
|
|
216
224
|
export declare namespace PropertyFilterProps {
|
|
217
225
|
type Token = PropertyFilterToken;
|
|
218
226
|
type TokenGroup = PropertyFilterTokenGroup;
|
|
@@ -346,7 +354,7 @@ export interface InternalFilteringOption {
|
|
|
346
354
|
}
|
|
347
355
|
export interface InternalFreeTextFiltering {
|
|
348
356
|
disabled: boolean;
|
|
349
|
-
operators: readonly PropertyFilterOperator[];
|
|
357
|
+
operators: readonly (PropertyFilterOperator | PropertyFilterTextOperatorExtended)[];
|
|
350
358
|
defaultOperator: PropertyFilterOperator;
|
|
351
359
|
}
|
|
352
360
|
export interface InternalToken<TokenValue = any> {
|
|
@@ -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
|
|
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,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,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,y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AQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC,sBAAsB,GAAG,kCAAkC,CAAC,EAAE,CAAC;IACpF,eAAe,EAAE,sBAAsB,CAAC;CACzC;AAED,MAAM,WAAW,aAAa,CAAC,UAAU,GAAG,GAAG;IAC7C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,IAAI,GAAG,yBAAyB,CAAC,UAAU,CAAC,CAAC;IACvD,QAAQ,EAAE,sBAAsB,CAAC;IACjC,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB,CAAC,UAAU,GAAG,GAAG;IAClD,SAAS,EAAE,uBAAuB,CAAC;IACnC,MAAM,EAAE,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;CACjF;AAED,MAAM,MAAM,aAAa,GAAG,kBAAkB,CAAC;AAE/C,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,yBAAyB,CAAC;IAAC,QAAQ,EAAE,kBAAkB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACtG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,yBAAyB,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,GACjF;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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 { ExpandToViewport } from '../dropdown/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\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 * * `tags` [string[]]: Optional list of tags giving further guidance about the option.\n * * `filteringTags` [string[]]: Optional list of additional tags used for automatic filtering.\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?: PropertyFilterProps.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 export type StatusType = DropdownStatusProps.StatusType;\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 tags?: ReadonlyArray<string>;\n filteringTags?: ReadonlyArray<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 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 { ExpandToViewport } from '../dropdown/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\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 * * `tags` [string[]]: Optional list of tags giving further guidance about the option.\n * * `filteringTags` [string[]]: Optional list of additional tags used for automatic filtering.\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?: PropertyFilterProps.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\n// TODO: replace with PropertyFilterTextOperatorExtended from collection-hooks once it is released\nexport interface PropertyFilterTextOperatorExtended {\n operator: PropertyFilterOperator;\n match?: (item: unknown, text: string) => boolean;\n}\n// TODO: replace with PropertyFilterFreeTextFiltering from collection-hooks once it is released\nexport interface PropertyFilterFreeTextFiltering {\n operators?: readonly (PropertyFilterOperator | PropertyFilterTextOperatorExtended)[];\n defaultOperator?: PropertyFilterOperator;\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 export type StatusType = DropdownStatusProps.StatusType;\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 tags?: ReadonlyArray<string>;\n filteringTags?: ReadonlyArray<string>;\n}\n\nexport interface InternalFreeTextFiltering {\n disabled: boolean;\n operators: readonly (PropertyFilterOperator | PropertyFilterTextOperatorExtended)[];\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-editor-inputs.d.ts","sourceRoot":"","sources":["../../../src/property-filter/token-editor-inputs.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,EAAE,yBAAyB,EAAE,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5B,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,cAAc,GACf,EAAE,kBAAkB,eAuBpB;AAED,UAAU,eAAe;IACvB,UAAU,EAAE,mBAAmB,CAAC;IAChC,gBAAgB,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACrD,WAAW,EAAE,mBAAmB,CAAC;IACjC,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,CAAC;IACzD,QAAQ,EAAE,SAAS,GAAG,kBAAkB,CAAC;IACzC,QAAQ,EAAE,IAAI,GAAG,yBAAyB,CAAC;IAC3C,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,eAWhD"}
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import InternalAutosuggest from '../autosuggest/internal.js';
|
|
5
5
|
import InternalMultiselect from '../multiselect/internal.js';
|
|
6
6
|
import InternalSelect from '../select/internal.js';
|
|
7
|
-
import { getAllowedOperators, getPropertySuggestions } from './controller.js';
|
|
7
|
+
import { getAllowedFreeTextOperators, getAllowedOperators, getPropertySuggestions } from './controller.js';
|
|
8
8
|
import { operatorToDescription } from './i18n-utils.js';
|
|
9
9
|
import { useLoadItems } from './use-load-items.js';
|
|
10
10
|
import styles from './styles.css.js';
|
|
@@ -32,7 +32,8 @@ export function PropertyInput({ property, onChangePropertyKey, asyncProps, filte
|
|
|
32
32
|
: allPropertiesOption, onChange: e => onChangePropertyKey(e.detail.selectedOption.value), ...asyncPropertySelectProps }));
|
|
33
33
|
}
|
|
34
34
|
export function OperatorInput({ property, operator, onChangeOperator, i18nStrings, freeTextFiltering, triggerVariant, }) {
|
|
35
|
-
const
|
|
35
|
+
const operators = property ? getAllowedOperators(property) : getAllowedFreeTextOperators(freeTextFiltering);
|
|
36
|
+
const operatorOptions = operators.map(operator => ({
|
|
36
37
|
value: operator,
|
|
37
38
|
label: operator,
|
|
38
39
|
description: operatorToDescription(operator, i18nStrings),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-editor-inputs.js","sourceRoot":"","sources":["../../../src/property-filter/token-editor-inputs.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAG7D,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAE7D,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAuB,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAS7E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAarC,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,EACR,mBAAmB,EACnB,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,iBAAiB,GACE;;IACnB,MAAM,sBAAsB,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IACzD,MAAM,wBAAwB,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,UAAU,EAAE,GAAG,sBAAsB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAChG,MAAM,eAAe,GAAqD,sBAAsB,CAC9F,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC;QACnC,KAAK,EAAE,WAAW;QAClB,KAAK,EAAE,aAAa;QACpB,iBAAiB,EAAE,IAAI;KACxB,CAAC,CACH,CAAC;IAEF,MAAM,mBAAmB,GAAG;QAC1B,KAAK,EAAE,WAAW,CAAC,kBAAkB;QACrC,K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AE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EACxE,OAAO,EAAE,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,KACjG,0BAA0B,EAC9B,YAAY,EAAE,IAAI,EAClB,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,IAAI,GACd,CACE,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\n\nimport InternalAutosuggest from '../autosuggest/internal.js';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces.js';\nimport { NonCancelableEventHandler } from '../internal/events/index.js';\nimport InternalMultiselect from '../multiselect/internal.js';\nimport { SelectProps } from '../select/interfaces.js';\nimport InternalSelect from '../select/internal.js';\nimport { getAllowedOperators, getPropertySuggestions } from './controller.js';\nimport { I18nStringsInternal, operatorToDescription } from './i18n-utils.js';\nimport {\n ComparisonOperator,\n GroupText,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n LoadItemsDetail,\n} from './interfaces.js';\nimport { useLoadItems } from './use-load-items.js';\n\nimport styles from './styles.css.js';\n\ninterface PropertyInputProps {\n asyncProps: null | DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n freeTextFiltering: InternalFreeTextFiltering;\n filteringProperties: readonly InternalFilteringProperty[];\n i18nStrings: I18nStringsInternal;\n onChangePropertyKey: (propertyKey: undefined | string) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n property: null | InternalFilteringProperty;\n}\n\nexport function PropertyInput({\n property,\n onChangePropertyKey,\n asyncProps,\n filteringProperties,\n onLoadItems,\n customGroupsText,\n i18nStrings,\n freeTextFiltering,\n}: PropertyInputProps) {\n const propertySelectHandlers = useLoadItems(onLoadItems);\n const asyncPropertySelectProps = asyncProps ? { ...asyncProps, ...propertySelectHandlers } : {};\n const propertyOptions: (SelectProps.Option | SelectProps.OptionGroup)[] = getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n ({ propertyKey, propertyLabel }) => ({\n value: propertyKey,\n label: propertyLabel,\n dontCloseOnSelect: true,\n })\n );\n\n const allPropertiesOption = {\n label: i18nStrings.allPropertiesLabel,\n value: undefined,\n };\n if (!freeTextFiltering.disabled) {\n propertyOptions.unshift(allPropertiesOption);\n }\n return (\n <InternalSelect\n filteringType=\"auto\"\n options={propertyOptions}\n selectedOption={\n property\n ? {\n value: property.propertyKey ?? undefined,\n label: property.propertyLabel,\n }\n : allPropertiesOption\n }\n onChange={e => onChangePropertyKey(e.detail.selectedOption.value)}\n {...asyncPropertySelectProps}\n />\n );\n}\n\ninterface OperatorInputProps {\n i18nStrings: I18nStringsInternal;\n onChangeOperator: (operator: ComparisonOperator) => void;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n freeTextFiltering: InternalFreeTextFiltering;\n triggerVariant: 'option' | 'label';\n}\n\nexport function OperatorInput({\n property,\n operator,\n onChangeOperator,\n i18nStrings,\n freeTextFiltering,\n triggerVariant,\n}: OperatorInputProps) {\n const operatorOptions = (property ? getAllowedOperators(property) : freeTextFiltering.operators).map(operator => ({\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }));\n return (\n <InternalSelect\n options={operatorOptions}\n triggerVariant={triggerVariant}\n selectedOption={\n operator\n ? {\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }\n : null\n }\n onChange={e => onChangeOperator(e.detail.selectedOption.value as ComparisonOperator)}\n />\n );\n}\n\ninterface ValueInputProps {\n asyncProps: DropdownStatusProps;\n filteringOptions: readonly InternalFilteringOption[];\n i18nStrings: I18nStringsInternal;\n onChangeValue: (value: unknown) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n value: unknown;\n}\n\nexport function ValueInput(props: ValueInputProps) {\n const { property, operator, value, onChangeValue } = props;\n const OperatorForm = property?.propertyKey && operator && property?.getValueFormRenderer(operator);\n\n if (OperatorForm) {\n return <OperatorForm value={value} onChange={onChangeValue} operator={operator} />;\n }\n if (property && operator && property.getTokenType(operator) === 'enum') {\n return <ValueInputEnum {...props} property={property} operator={operator} />;\n }\n return <ValueInputAuto {...props} />;\n}\n\nfunction ValueInputAuto({\n property,\n operator,\n value: unknownValue,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n i18nStrings,\n}: ValueInputProps) {\n const value = (unknownValue ?? '') + '';\n const valueOptions = property\n ? filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value, tags, filteringTags }) => ({ label, value, tags, filteringTags }))\n : [];\n\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property?.externalProperty, value, operator);\n const asyncValueAutosuggestProps = property?.propertyKey\n ? { ...valueAutosuggestHandlers, ...asyncProps }\n : { empty: asyncProps.empty };\n const [matchedOption] = valueOptions.filter(option => option.value === value);\n\n return (\n <InternalAutosuggest\n enteredTextLabel={i18nStrings.enteredTextLabel}\n value={matchedOption?.label ?? value}\n clearAriaLabel={i18nStrings.clearAriaLabel}\n onChange={e => onChangeValue(e.detail.value)}\n disabled={!operator}\n options={valueOptions}\n {...asyncValueAutosuggestProps}\n virtualScroll={true}\n />\n );\n}\n\ninterface ValueInputPropsEnum extends ValueInputProps {\n property: InternalFilteringProperty;\n operator: ComparisonOperator;\n}\n\nfunction ValueInputEnum({\n property,\n operator,\n value: unknownValue,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n}: ValueInputPropsEnum) {\n const valueOptions = filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value, tags, filteringTags }) => ({ label, value, tags, filteringTags }));\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property.externalProperty, undefined, operator);\n const asyncValueAutosuggestProps = { statusType: 'finished' as const, ...valueAutosuggestHandlers, ...asyncProps };\n const value = !unknownValue ? [] : Array.isArray(unknownValue) ? unknownValue : [unknownValue];\n const selectedOptions = valueOptions.filter(option => value.includes(option.value));\n return (\n <div className={styles['token-editor-multiselect-wrapper']}>\n <div className={styles['token-editor-multiselect-wrapper-inner']}>\n <InternalMultiselect\n filteringType=\"auto\"\n selectedOptions={selectedOptions}\n onChange={e => onChangeValue(e.detail.selectedOptions.map(o => o.value))}\n options={valueOptions.length > 0 ? [{ options: valueOptions, label: property.groupValuesLabel }] : []}\n {...asyncValueAutosuggestProps}\n inlineTokens={true}\n hideTokens={true}\n keepOpen={true}\n />\n </div>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"token-editor-inputs.js","sourceRoot":"","sources":["../../../src/property-filter/token-editor-inputs.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAG7D,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAE7D,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC3G,OAAO,EAAuB,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAS7E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAarC,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,EACR,mBAAmB,EACnB,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,iBAAiB,GACE;;IACnB,MAAM,sBAAsB,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IACzD,MAAM,wBAAwB,GAAG,UAAU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;IAC/F,MAAM,eAAe,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACpF,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,kCAAkC,CAAC;QACxD,6BAAK,SAAS,EAAE,MAAM,CAAC,wCAAwC,CAAC;YAC9D,oBAAC,mBAAmB,IAClB,aAAa,EAAC,MAAM,EACpB,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EACxE,OAAO,EAAE,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,KACjG,0BAA0B,EAC9B,YAAY,EAAE,IAAI,EAClB,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,IAAI,GACd,CACE,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\n\nimport InternalAutosuggest from '../autosuggest/internal.js';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces.js';\nimport { NonCancelableEventHandler } from '../internal/events/index.js';\nimport InternalMultiselect from '../multiselect/internal.js';\nimport { SelectProps } from '../select/interfaces.js';\nimport InternalSelect from '../select/internal.js';\nimport { getAllowedFreeTextOperators, getAllowedOperators, getPropertySuggestions } from './controller.js';\nimport { I18nStringsInternal, operatorToDescription } from './i18n-utils.js';\nimport {\n ComparisonOperator,\n GroupText,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n LoadItemsDetail,\n} from './interfaces.js';\nimport { useLoadItems } from './use-load-items.js';\n\nimport styles from './styles.css.js';\n\ninterface PropertyInputProps {\n asyncProps: null | DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n freeTextFiltering: InternalFreeTextFiltering;\n filteringProperties: readonly InternalFilteringProperty[];\n i18nStrings: I18nStringsInternal;\n onChangePropertyKey: (propertyKey: undefined | string) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n property: null | InternalFilteringProperty;\n}\n\nexport function PropertyInput({\n property,\n onChangePropertyKey,\n asyncProps,\n filteringProperties,\n onLoadItems,\n customGroupsText,\n i18nStrings,\n freeTextFiltering,\n}: PropertyInputProps) {\n const propertySelectHandlers = useLoadItems(onLoadItems);\n const asyncPropertySelectProps = asyncProps ? { ...asyncProps, ...propertySelectHandlers } : {};\n const propertyOptions: (SelectProps.Option | SelectProps.OptionGroup)[] = getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n ({ propertyKey, propertyLabel }) => ({\n value: propertyKey,\n label: propertyLabel,\n dontCloseOnSelect: true,\n })\n );\n\n const allPropertiesOption = {\n label: i18nStrings.allPropertiesLabel,\n value: undefined,\n };\n if (!freeTextFiltering.disabled) {\n propertyOptions.unshift(allPropertiesOption);\n }\n return (\n <InternalSelect\n filteringType=\"auto\"\n options={propertyOptions}\n selectedOption={\n property\n ? {\n value: property.propertyKey ?? undefined,\n label: property.propertyLabel,\n }\n : allPropertiesOption\n }\n onChange={e => onChangePropertyKey(e.detail.selectedOption.value)}\n {...asyncPropertySelectProps}\n />\n );\n}\n\ninterface OperatorInputProps {\n i18nStrings: I18nStringsInternal;\n onChangeOperator: (operator: ComparisonOperator) => void;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n freeTextFiltering: InternalFreeTextFiltering;\n triggerVariant: 'option' | 'label';\n}\n\nexport function OperatorInput({\n property,\n operator,\n onChangeOperator,\n i18nStrings,\n freeTextFiltering,\n triggerVariant,\n}: OperatorInputProps) {\n const operators = property ? getAllowedOperators(property) : getAllowedFreeTextOperators(freeTextFiltering);\n const operatorOptions = operators.map(operator => ({\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }));\n return (\n <InternalSelect\n options={operatorOptions}\n triggerVariant={triggerVariant}\n selectedOption={\n operator\n ? {\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }\n : null\n }\n onChange={e => onChangeOperator(e.detail.selectedOption.value as ComparisonOperator)}\n />\n );\n}\n\ninterface ValueInputProps {\n asyncProps: DropdownStatusProps;\n filteringOptions: readonly InternalFilteringOption[];\n i18nStrings: I18nStringsInternal;\n onChangeValue: (value: unknown) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n value: unknown;\n}\n\nexport function ValueInput(props: ValueInputProps) {\n const { property, operator, value, onChangeValue } = props;\n const OperatorForm = property?.propertyKey && operator && property?.getValueFormRenderer(operator);\n\n if (OperatorForm) {\n return <OperatorForm value={value} onChange={onChangeValue} operator={operator} />;\n }\n if (property && operator && property.getTokenType(operator) === 'enum') {\n return <ValueInputEnum {...props} property={property} operator={operator} />;\n }\n return <ValueInputAuto {...props} />;\n}\n\nfunction ValueInputAuto({\n property,\n operator,\n value: unknownValue,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n i18nStrings,\n}: ValueInputProps) {\n const value = (unknownValue ?? '') + '';\n const valueOptions = property\n ? filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value, tags, filteringTags }) => ({ label, value, tags, filteringTags }))\n : [];\n\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property?.externalProperty, value, operator);\n const asyncValueAutosuggestProps = property?.propertyKey\n ? { ...valueAutosuggestHandlers, ...asyncProps }\n : { empty: asyncProps.empty };\n const [matchedOption] = valueOptions.filter(option => option.value === value);\n\n return (\n <InternalAutosuggest\n enteredTextLabel={i18nStrings.enteredTextLabel}\n value={matchedOption?.label ?? value}\n clearAriaLabel={i18nStrings.clearAriaLabel}\n onChange={e => onChangeValue(e.detail.value)}\n disabled={!operator}\n options={valueOptions}\n {...asyncValueAutosuggestProps}\n virtualScroll={true}\n />\n );\n}\n\ninterface ValueInputPropsEnum extends ValueInputProps {\n property: InternalFilteringProperty;\n operator: ComparisonOperator;\n}\n\nfunction ValueInputEnum({\n property,\n operator,\n value: unknownValue,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n}: ValueInputPropsEnum) {\n const valueOptions = filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value, tags, filteringTags }) => ({ label, value, tags, filteringTags }));\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property.externalProperty, undefined, operator);\n const asyncValueAutosuggestProps = { statusType: 'finished' as const, ...valueAutosuggestHandlers, ...asyncProps };\n const value = !unknownValue ? [] : Array.isArray(unknownValue) ? unknownValue : [unknownValue];\n const selectedOptions = valueOptions.filter(option => value.includes(option.value));\n return (\n <div className={styles['token-editor-multiselect-wrapper']}>\n <div className={styles['token-editor-multiselect-wrapper-inner']}>\n <InternalMultiselect\n filteringType=\"auto\"\n selectedOptions={selectedOptions}\n onChange={e => onChangeValue(e.detail.selectedOptions.map(o => o.value))}\n options={valueOptions.length > 0 ? [{ options: valueOptions, label: property.groupValuesLabel }] : []}\n {...asyncValueAutosuggestProps}\n inlineTokens={true}\n hideTokens={true}\n keepOpen={true}\n />\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-editor.d.ts","sourceRoot":"","sources":["../../../src/property-filter/token-editor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAE3F,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAQxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAEL,SAAS,EACT,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,aAAa,EACb,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAMzB,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,mBAAmB,CAAC;IAChC,gBAAgB,EAAE,SAAS,SAAS,EAAE,CAAC;IACvC,iBAAiB,EAAE,yBAAyB,CAAC;IAC7C,mBAAmB,EAAE,SAAS,yBAAyB,EAAE,CAAC;IAC1D,gBAAgB,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACrD,WAAW,EAAE,mBAAmB,CAAC;IACjC,WAAW,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,CAAC;IACzD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,eAAe,EAAE,aAAa,EAAE,CAAC;IACjC,cAAc,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC/C,cAAc,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC/C,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,iBAAiB,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;CACrD;AAED,wBAAgB,WAAW,CAAC,EAC1B,cAAc,EACd,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,QAAQ,EACR,SAAS,EACT,eAAe,EACf,cAAc,EACd,cAAc,EACd,SAAS,EACT,iBAAiB,GAClB,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"token-editor.d.ts","sourceRoot":"","sources":["../../../src/property-filter/token-editor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,mBAAmB,EAAE,MAAM,s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 -10,7 +10,7 @@ import InternalFormField from '../form-field/internal.js';
|
|
|
10
10
|
import { FormFieldContext } from '../internal/context/form-field-context.js';
|
|
11
11
|
import { useListFocusController } from '../internal/hooks/use-list-focus-controller.js';
|
|
12
12
|
import { useMobile } from '../internal/hooks/use-mobile/index.js';
|
|
13
|
-
import { getAllowedOperators } from './controller.js';
|
|
13
|
+
import { getAllowedFreeTextOperators, getAllowedOperators } from './controller.js';
|
|
14
14
|
import { OperatorInput, PropertyInput, ValueInput } from './token-editor-inputs.js';
|
|
15
15
|
import styles from './styles.css.js';
|
|
16
16
|
import testUtilStyles from './test-classes/styles.css.js';
|
|
@@ -40,7 +40,9 @@ export function TokenEditor({ supportsGroups, asyncProperties, asyncProps, custo
|
|
|
40
40
|
const onChangePropertyKey = (newPropertyKey) => {
|
|
41
41
|
var _a;
|
|
42
42
|
const filteringProperty = filteringProperties.reduce((acc, property) => (property.propertyKey === newPropertyKey ? property : acc), undefined);
|
|
43
|
-
const allowedOperators = filteringProperty
|
|
43
|
+
const allowedOperators = filteringProperty
|
|
44
|
+
? getAllowedOperators(filteringProperty)
|
|
45
|
+
: getAllowedFreeTextOperators(freeTextFiltering);
|
|
44
46
|
const operator = temporaryToken.operator && allowedOperators.indexOf(temporaryToken.operator) !== -1
|
|
45
47
|
? temporaryToken.operator
|
|
46
48
|
: allowedOperators[0];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-editor.js","sourceRoot":"","sources":["../../../src/property-filter/token-editor.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAEnD,OAAO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,CAAC,CAChB,oBAAC,sBAAsB,IACrB,OAAO,EAAC,QAAQ,EAChB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EACrB,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,EACnD,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE;YACV,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;YACnB,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACvC,QAAQ;YACR,SAAS,EAAE,mBAAmB;SAC/B,EACD,SAAS,EAAE,cAAc,CAAC,mCAAmC,CAAC,oBAC9C,KAAK,GACrB,CACH,CAAC,CAAC,CAAC,CACF,oBAAC,sBAAsB,IACrB,OAAO,EAAC,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,EACnD,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,cAAc,CAAC,mCAAmC,CAAC,oBAC9C,KAAK,GACrB,CACH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalButton from '../button/internal.js';\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces.js';\nimport InternalButtonDropdown from '../button-dropdown/internal.js';\nimport InternalFormField from '../form-field/internal.js';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces.js';\nimport { FormFieldContext } from '../internal/context/form-field-context.js';\nimport { NonCancelableEventHandler } from '../internal/events/index.js';\nimport { useListFocusController } from '../internal/hooks/use-list-focus-controller.js';\nimport { useMobile } from '../internal/hooks/use-mobile/index.js';\nimport {\n GeneratedAnalyticsMetadataPropertyEditCancel,\n GeneratedAnalyticsMetadataPropertyEditConfirm,\n} from './analytics-metadata/interfaces';\nimport { getAllowedOperators } from './controller.js';\nimport { I18nStringsInternal } from './i18n-utils.js';\nimport {\n ComparisonOperator,\n GroupText,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n InternalToken,\n LoadItemsDetail,\n} from './interfaces.js';\nimport { OperatorInput, PropertyInput, ValueInput } from './token-editor-inputs.js';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport interface TokenEditorProps {\n supportsGroups: boolean;\n asyncProperties?: boolean;\n asyncProps: DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n freeTextFiltering: InternalFreeTextFiltering;\n filteringProperties: readonly InternalFilteringProperty[];\n filteringOptions: readonly InternalFilteringOption[];\n i18nStrings: I18nStringsInternal;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n onSubmit: () => void;\n onDismiss: () => void;\n tokensToCapture: InternalToken[];\n onTokenCapture: (token: InternalToken) => void;\n onTokenRelease: (token: InternalToken) => void;\n tempGroup: InternalToken[];\n onChangeTempGroup: (token: InternalToken[]) => void;\n}\n\nexport function TokenEditor({\n supportsGroups,\n asyncProperties,\n asyncProps,\n customGroupsText,\n freeTextFiltering,\n filteringProperties,\n filteringOptions,\n i18nStrings,\n onLoadItems,\n onSubmit,\n onDismiss,\n tokensToCapture,\n onTokenCapture,\n onTokenRelease,\n tempGroup,\n onChangeTempGroup,\n}: TokenEditorProps) {\n const [nextFocusIndex, setNextFocusIndex] = useState<null | number>(null);\n const tokenListRef = useListFocusController({\n nextFocusIndex,\n onFocusMoved: target => {\n target.focus();\n setNextFocusIndex(null);\n },\n listItemSelector: `.${styles['token-editor-field-property']}`,\n fallbackSelector: `.${styles['token-editor-add-token']}`,\n });\n\n const groups = tempGroup.map((temporaryToken, index) => {\n const setTemporaryToken = (newToken: InternalToken) => {\n const copy = [...tempGroup];\n copy[index] = newToken;\n if (newToken.property?.getTokenType(newToken.operator) === 'enum' && newToken.value === null) {\n newToken.value = [];\n }\n onChangeTempGroup(copy);\n };\n const property = temporaryToken.property;\n const onChangePropertyKey = (newPropertyKey: undefined | string) => {\n const filteringProperty = filteringProperties.reduce<InternalFilteringProperty | undefined>(\n (acc, property) => (property.propertyKey === newPropertyKey ? property : acc),\n undefined\n );\n const allowedOperators = filteringProperty ? getAllowedOperators(filteringProperty) : freeTextFiltering.operators;\n const operator =\n temporaryToken.operator && allowedOperators.indexOf(temporaryToken.operator) !== -1\n ? temporaryToken.operator\n : allowedOperators[0];\n const matchedProperty = filteringProperties.find(property => property.propertyKey === newPropertyKey) ?? null;\n const isCustomType = !!matchedProperty?.getValueFormRenderer(operator);\n const value = isCustomType || matchedProperty?.getTokenType(operator) === 'enum' ? null : '';\n setTemporaryToken({ ...temporaryToken, property: matchedProperty, operator, value });\n };\n\n const operator = temporaryToken.operator;\n const onChangeOperator = (newOperator: ComparisonOperator) => {\n const currentOperatorTokenType = property?.getTokenType(operator);\n const newOperatorTokenType = property?.getTokenType(newOperator);\n const shouldClearValue = currentOperatorTokenType !== newOperatorTokenType;\n const value = shouldClearValue ? null : temporaryToken.value;\n setTemporaryToken({ ...temporaryToken, operator: newOperator, value });\n };\n\n const value = temporaryToken.value;\n const onChangeValue = (newValue: unknown) => {\n setTemporaryToken({ ...temporaryToken, value: newValue });\n };\n\n return { token: temporaryToken, property, onChangePropertyKey, operator, onChangeOperator, value, onChangeValue };\n });\n\n return (\n <div className={styles['token-editor']} ref={tokenListRef}>\n <TokenEditorFields\n supportsGroups={supportsGroups}\n tokens={groups.map(group => group.token)}\n onRemove={index => {\n const updated = tempGroup.filter((_, existingIndex) => existingIndex !== index);\n onChangeTempGroup(updated);\n setNextFocusIndex(index);\n }}\n onRemoveFromGroup={index => {\n const releasedToken = tempGroup[index];\n const updated = tempGroup.filter((_, existingIndex) => existingIndex !== index);\n onChangeTempGroup(updated);\n onTokenRelease(releasedToken);\n setNextFocusIndex(index);\n }}\n onSubmit={onSubmit}\n renderProperty={index => (\n <PropertyInput\n property={groups[index].property}\n onChangePropertyKey={groups[index].onChangePropertyKey}\n asyncProps={asyncProperties ? asyncProps : null}\n filteringProperties={filteringProperties}\n onLoadItems={onLoadItems}\n customGroupsText={customGroupsText}\n i18nStrings={i18nStrings}\n freeTextFiltering={freeTextFiltering}\n />\n )}\n renderOperator={index => (\n <OperatorInput\n property={groups[index].property}\n operator={groups[index].operator}\n onChangeOperator={groups[index].onChangeOperator}\n i18nStrings={i18nStrings}\n freeTextFiltering={freeTextFiltering}\n triggerVariant={supportsGroups ? 'label' : 'option'}\n />\n )}\n renderValue={index => (\n <ValueInput\n property={groups[index].property}\n operator={groups[index].operator}\n value={groups[index].value}\n onChangeValue={groups[index].onChangeValue}\n asyncProps={asyncProps}\n filteringOptions={filteringOptions}\n onLoadItems={onLoadItems}\n i18nStrings={i18nStrings}\n />\n )}\n i18nStrings={i18nStrings}\n />\n\n {supportsGroups && (\n <div className={clsx(styles['token-editor-add-token'], testUtilStyles['token-editor-token-add-actions'])}>\n <InternalButtonDropdown\n variant=\"normal\"\n ariaLabel={i18nStrings.tokenEditorAddTokenActionsAriaLabel}\n items={tokensToCapture.map((token, index) => {\n return {\n id: index.toString(),\n text: i18nStrings.tokenEditorAddExistingTokenLabel?.(token) ?? '',\n ariaLabel: i18nStrings.tokenEditorAddExistingTokenAriaLabel?.(token) ?? '',\n };\n })}\n onItemClick={({ detail }) => {\n const index = parseInt(detail.id);\n if (!isNaN(index) && tokensToCapture[index]) {\n onChangeTempGroup([...tempGroup, { ...tokensToCapture[index] }]);\n setNextFocusIndex(groups.length);\n onTokenCapture(tokensToCapture[index]);\n }\n }}\n disabled={tokensToCapture.length === 0}\n showMainActionOnly={tokensToCapture.length === 0}\n mainAction={{\n text: i18nStrings.tokenEditorAddNewTokenLabel ?? '',\n onClick: () => {\n const lastTokenInGroup = tempGroup[tempGroup.length - 1];\n const property = lastTokenInGroup ? lastTokenInGroup.property : null;\n const operator = property?.defaultOperator ?? ':';\n onChangeTempGroup([...tempGroup, { property, operator, value: null }]);\n setNextFocusIndex(groups.length);\n },\n }}\n />\n </div>\n )}\n\n <div className={styles['token-editor-actions']}>\n <span\n {...getAnalyticsMetadataAttribute({\n action: 'editCancel',\n } as Partial<GeneratedAnalyticsMetadataPropertyEditCancel>)}\n >\n <InternalButton\n formAction=\"none\"\n variant=\"link\"\n className={clsx(styles['token-editor-cancel'], testUtilStyles['token-editor-cancel'])}\n onClick={onDismiss}\n >\n {i18nStrings.cancelActionText}\n </InternalButton>\n </span>\n <span\n {...getAnalyticsMetadataAttribute({\n action: 'editConfirm',\n } as Partial<GeneratedAnalyticsMetadataPropertyEditConfirm>)}\n >\n <InternalButton\n className={clsx(styles['token-editor-submit'], testUtilStyles['token-editor-submit'])}\n formAction=\"none\"\n onClick={onSubmit}\n >\n {i18nStrings.applyActionText}\n </InternalButton>\n </span>\n </div>\n </div>\n );\n}\n\ninterface TokenEditorLayout {\n tokens: InternalToken[];\n supportsGroups: boolean;\n onRemove: (index: number) => void;\n onRemoveFromGroup: (index: number) => void;\n onSubmit: () => void;\n renderProperty: (index: number) => React.ReactNode;\n renderOperator: (index: number) => React.ReactNode;\n renderValue: (index: number) => React.ReactNode;\n i18nStrings: I18nStringsInternal;\n}\n\nfunction TokenEditorFields({\n tokens,\n supportsGroups,\n onRemove,\n onRemoveFromGroup,\n onSubmit,\n renderProperty,\n renderOperator,\n renderValue,\n i18nStrings,\n}: TokenEditorLayout) {\n const isMobile = useMobile();\n const isNarrow = isMobile || !supportsGroups;\n\n const propertyLabelId = useUniqueId();\n const operatorLabelId = useUniqueId();\n const valueLabelId = useUniqueId();\n const headers = (\n <div className={styles['token-editor-grid-group']}>\n <div id={propertyLabelId} className={styles['token-editor-grid-header']}>\n {i18nStrings.propertyText}\n </div>\n <div id={operatorLabelId} className={styles['token-editor-grid-header']}>\n {i18nStrings.operatorText}\n </div>\n <div id={valueLabelId} className={styles['token-editor-grid-header']}>\n {i18nStrings.valueText}\n </div>\n <div className={styles['token-editor-grid-header']}></div>\n </div>\n );\n\n return (\n <form\n className={clsx(\n styles['token-editor-grid'],\n isNarrow && styles['token-editor-narrow'],\n styles['token-editor-form']\n )}\n onSubmit={event => {\n event.preventDefault();\n onSubmit();\n }}\n >\n {!isNarrow && headers}\n\n {tokens.map((token, index) => (\n <div\n key={index}\n role=\"group\"\n aria-label={i18nStrings.formatToken(token).formattedText}\n className={clsx(styles['token-editor-grid-group'], supportsGroups && styles['token-editor-supports-groups'])}\n >\n <div className={clsx(styles['token-editor-grid-cell'], isNarrow && styles['token-editor-narrow'])}>\n <TokenEditorField\n isNarrow={isNarrow}\n label={i18nStrings.propertyText}\n labelId={propertyLabelId}\n className={clsx(styles['token-editor-field-property'], testUtilStyles['token-editor-field-property'])}\n index={index}\n >\n {renderProperty(index)}\n </TokenEditorField>\n </div>\n\n <div className={clsx(styles['token-editor-grid-cell'], isNarrow && styles['token-editor-narrow'])}>\n <TokenEditorField\n isNarrow={isNarrow}\n label={i18nStrings.operatorText}\n labelId={operatorLabelId}\n className={clsx(styles['token-editor-field-operator'], testUtilStyles['token-editor-field-operator'])}\n index={index}\n >\n {renderOperator(index)}\n </TokenEditorField>\n </div>\n\n <div className={clsx(styles['token-editor-grid-cell'], isNarrow && styles['token-editor-narrow'])}>\n <TokenEditorField\n isNarrow={isNarrow}\n label={i18nStrings.valueText}\n labelId={valueLabelId}\n className={clsx(styles['token-editor-field-value'], testUtilStyles['token-editor-field-value'])}\n index={index}\n >\n {renderValue(index)}\n </TokenEditorField>\n </div>\n\n {supportsGroups && (\n <div className={clsx(styles['token-editor-grid-cell'], isNarrow && styles['token-editor-narrow'])}>\n <div className={styles['token-editor-remove-token']}>\n <TokenEditorRemoveActions\n isNarrow={isNarrow}\n ariaLabel={i18nStrings.tokenEditorTokenActionsAriaLabel?.(token) ?? ''}\n mainActionAriaLabel={i18nStrings.tokenEditorTokenRemoveAriaLabel?.(token) ?? ''}\n disabled={tokens.length === 1}\n items={[\n {\n id: 'remove',\n text: i18nStrings.tokenEditorTokenRemoveLabel ?? '',\n disabled: token.standaloneIndex !== undefined,\n },\n { id: 'remove-from-group', text: i18nStrings.tokenEditorTokenRemoveFromGroupLabel ?? '' },\n ]}\n onItemClick={itemId => {\n switch (itemId) {\n case 'remove':\n return onRemove(index);\n case 'remove-from-group':\n return onRemoveFromGroup(index);\n }\n }}\n index={index}\n />\n </div>\n </div>\n )}\n </div>\n ))}\n </form>\n );\n}\n\nfunction TokenEditorField({\n isNarrow,\n label,\n labelId,\n children,\n className,\n index,\n}: {\n isNarrow: boolean;\n label: React.ReactNode;\n labelId: string;\n children: React.ReactNode;\n className: string;\n index: number;\n}) {\n return isNarrow ? (\n <InternalFormField label={label} className={className} stretch={true} data-testindex={index}>\n {children}\n </InternalFormField>\n ) : (\n <FormFieldContext.Provider value={{ ariaLabelledby: labelId }}>\n <InternalFormField className={className} data-testindex={index}>\n {children}\n </InternalFormField>\n </FormFieldContext.Provider>\n );\n}\n\nfunction TokenEditorRemoveActions({\n isNarrow,\n ariaLabel,\n mainActionAriaLabel,\n disabled,\n items,\n onItemClick,\n index,\n}: {\n isNarrow: boolean;\n ariaLabel: string;\n mainActionAriaLabel: string;\n disabled: boolean;\n items: ButtonDropdownProps.Item[];\n onItemClick: (itemId: string) => void;\n index: number;\n}) {\n return isNarrow ? (\n <InternalButtonDropdown\n variant=\"normal\"\n ariaLabel={ariaLabel}\n items={items.slice(1)}\n onItemClick={({ detail }) => onItemClick(detail.id)}\n disabled={disabled}\n mainAction={{\n text: items[0].text,\n onClick: () => onItemClick(items[0].id),\n disabled,\n ariaLabel: mainActionAriaLabel,\n }}\n className={testUtilStyles['token-editor-token-remove-actions']}\n data-testindex={index}\n />\n ) : (\n <InternalButtonDropdown\n variant=\"icon\"\n ariaLabel={ariaLabel}\n items={items}\n onItemClick={({ detail }) => onItemClick(detail.id)}\n disabled={disabled}\n className={testUtilStyles['token-editor-token-remove-actions']}\n data-testindex={index}\n />\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"token-editor.js","sourceRoot":"","sources":["../../../src/property-filter/token-editor.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAEnD,OAAO,sBAAsB,MAAM,gCAAgC,CAAC;AACpE,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAE7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAKlE,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAWnF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEpF,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAqB1D,MAAM,UAAU,WAAW,CAAC,EAC1B,cAAc,EACd,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,QAAQ,EACR,SAAS,EACT,eAAe,EACf,cAAc,EACd,cAAc,EACd,S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AAK,EACZ,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,EACnD,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,cAAc,CAAC,mCAAmC,CAAC,oBAC9C,KAAK,GACrB,CACH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalButton from '../button/internal.js';\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces.js';\nimport InternalButtonDropdown from '../button-dropdown/internal.js';\nimport InternalFormField from '../form-field/internal.js';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces.js';\nimport { FormFieldContext } from '../internal/context/form-field-context.js';\nimport { NonCancelableEventHandler } from '../internal/events/index.js';\nimport { useListFocusController } from '../internal/hooks/use-list-focus-controller.js';\nimport { useMobile } from '../internal/hooks/use-mobile/index.js';\nimport {\n GeneratedAnalyticsMetadataPropertyEditCancel,\n GeneratedAnalyticsMetadataPropertyEditConfirm,\n} from './analytics-metadata/interfaces';\nimport { getAllowedFreeTextOperators, getAllowedOperators } from './controller.js';\nimport { I18nStringsInternal } from './i18n-utils.js';\nimport {\n ComparisonOperator,\n GroupText,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n InternalToken,\n LoadItemsDetail,\n} from './interfaces.js';\nimport { OperatorInput, PropertyInput, ValueInput } from './token-editor-inputs.js';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport interface TokenEditorProps {\n supportsGroups: boolean;\n asyncProperties?: boolean;\n asyncProps: DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n freeTextFiltering: InternalFreeTextFiltering;\n filteringProperties: readonly InternalFilteringProperty[];\n filteringOptions: readonly InternalFilteringOption[];\n i18nStrings: I18nStringsInternal;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n onSubmit: () => void;\n onDismiss: () => void;\n tokensToCapture: InternalToken[];\n onTokenCapture: (token: InternalToken) => void;\n onTokenRelease: (token: InternalToken) => void;\n tempGroup: InternalToken[];\n onChangeTempGroup: (token: InternalToken[]) => void;\n}\n\nexport function TokenEditor({\n supportsGroups,\n asyncProperties,\n asyncProps,\n customGroupsText,\n freeTextFiltering,\n filteringProperties,\n filteringOptions,\n i18nStrings,\n onLoadItems,\n onSubmit,\n onDismiss,\n tokensToCapture,\n onTokenCapture,\n onTokenRelease,\n tempGroup,\n onChangeTempGroup,\n}: TokenEditorProps) {\n const [nextFocusIndex, setNextFocusIndex] = useState<null | number>(null);\n const tokenListRef = useListFocusController({\n nextFocusIndex,\n onFocusMoved: target => {\n target.focus();\n setNextFocusIndex(null);\n },\n listItemSelector: `.${styles['token-editor-field-property']}`,\n fallbackSelector: `.${styles['token-editor-add-token']}`,\n });\n\n const groups = tempGroup.map((temporaryToken, index) => {\n const setTemporaryToken = (newToken: InternalToken) => {\n const copy = [...tempGroup];\n copy[index] = newToken;\n if (newToken.property?.getTokenType(newToken.operator) === 'enum' && newToken.value === null) {\n newToken.value = [];\n }\n onChangeTempGroup(copy);\n };\n const property = temporaryToken.property;\n const onChangePropertyKey = (newPropertyKey: undefined | string) => {\n const filteringProperty = filteringProperties.reduce<InternalFilteringProperty | undefined>(\n (acc, property) => (property.propertyKey === newPropertyKey ? property : acc),\n undefined\n );\n const allowedOperators = filteringProperty\n ? getAllowedOperators(filteringProperty)\n : getAllowedFreeTextOperators(freeTextFiltering);\n const operator =\n temporaryToken.operator && allowedOperators.indexOf(temporaryToken.operator) !== -1\n ? temporaryToken.operator\n : allowedOperators[0];\n const matchedProperty = filteringProperties.find(property => property.propertyKey === newPropertyKey) ?? null;\n const isCustomType = !!matchedProperty?.getValueFormRenderer(operator);\n const value = isCustomType || matchedProperty?.getTokenType(operator) === 'enum' ? null : '';\n setTemporaryToken({ ...temporaryToken, property: matchedProperty, operator, value });\n };\n\n const operator = temporaryToken.operator;\n const onChangeOperator = (newOperator: ComparisonOperator) => {\n const currentOperatorTokenType = property?.getTokenType(operator);\n const newOperatorTokenType = property?.getTokenType(newOperator);\n const shouldClearValue = currentOperatorTokenType !== newOperatorTokenType;\n const value = shouldClearValue ? null : temporaryToken.value;\n setTemporaryToken({ ...temporaryToken, operator: newOperator, value });\n };\n\n const value = temporaryToken.value;\n const onChangeValue = (newValue: unknown) => {\n setTemporaryToken({ ...temporaryToken, value: newValue });\n };\n\n return { token: temporaryToken, property, onChangePropertyKey, operator, onChangeOperator, value, onChangeValue };\n });\n\n return (\n <div className={styles['token-editor']} ref={tokenListRef}>\n <TokenEditorFields\n supportsGroups={supportsGroups}\n tokens={groups.map(group => group.token)}\n onRemove={index => {\n const updated = tempGroup.filter((_, existingIndex) => existingIndex !== index);\n onChangeTempGroup(updated);\n setNextFocusIndex(index);\n }}\n onRemoveFromGroup={index => {\n const releasedToken = tempGroup[index];\n const updated = tempGroup.filter((_, existingIndex) => existingIndex !== index);\n onChangeTempGroup(updated);\n onTokenRelease(releasedToken);\n setNextFocusIndex(index);\n }}\n onSubmit={onSubmit}\n renderProperty={index => (\n <PropertyInput\n property={groups[index].property}\n onChangePropertyKey={groups[index].onChangePropertyKey}\n asyncProps={asyncProperties ? asyncProps : null}\n filteringProperties={filteringProperties}\n onLoadItems={onLoadItems}\n customGroupsText={customGroupsText}\n i18nStrings={i18nStrings}\n freeTextFiltering={freeTextFiltering}\n />\n )}\n renderOperator={index => (\n <OperatorInput\n property={groups[index].property}\n operator={groups[index].operator}\n onChangeOperator={groups[index].onChangeOperator}\n i18nStrings={i18nStrings}\n freeTextFiltering={freeTextFiltering}\n triggerVariant={supportsGroups ? 'label' : 'option'}\n />\n )}\n renderValue={index => (\n <ValueInput\n property={groups[index].property}\n operator={groups[index].operator}\n value={groups[index].value}\n onChangeValue={groups[index].onChangeValue}\n asyncProps={asyncProps}\n filteringOptions={filteringOptions}\n onLoadItems={onLoadItems}\n i18nStrings={i18nStrings}\n />\n )}\n i18nStrings={i18nStrings}\n />\n\n {supportsGroups && (\n <div className={clsx(styles['token-editor-add-token'], testUtilStyles['token-editor-token-add-actions'])}>\n <InternalButtonDropdown\n variant=\"normal\"\n ariaLabel={i18nStrings.tokenEditorAddTokenActionsAriaLabel}\n items={tokensToCapture.map((token, index) => {\n return {\n id: index.toString(),\n text: i18nStrings.tokenEditorAddExistingTokenLabel?.(token) ?? '',\n ariaLabel: i18nStrings.tokenEditorAddExistingTokenAriaLabel?.(token) ?? '',\n };\n })}\n onItemClick={({ detail }) => {\n const index = parseInt(detail.id);\n if (!isNaN(index) && tokensToCapture[index]) {\n onChangeTempGroup([...tempGroup, { ...tokensToCapture[index] }]);\n setNextFocusIndex(groups.length);\n onTokenCapture(tokensToCapture[index]);\n }\n }}\n disabled={tokensToCapture.length === 0}\n showMainActionOnly={tokensToCapture.length === 0}\n mainAction={{\n text: i18nStrings.tokenEditorAddNewTokenLabel ?? '',\n onClick: () => {\n const lastTokenInGroup = tempGroup[tempGroup.length - 1];\n const property = lastTokenInGroup ? lastTokenInGroup.property : null;\n const operator = property?.defaultOperator ?? ':';\n onChangeTempGroup([...tempGroup, { property, operator, value: null }]);\n setNextFocusIndex(groups.length);\n },\n }}\n />\n </div>\n )}\n\n <div className={styles['token-editor-actions']}>\n <span\n {...getAnalyticsMetadataAttribute({\n action: 'editCancel',\n } as Partial<GeneratedAnalyticsMetadataPropertyEditCancel>)}\n >\n <InternalButton\n formAction=\"none\"\n variant=\"link\"\n className={clsx(styles['token-editor-cancel'], testUtilStyles['token-editor-cancel'])}\n onClick={onDismiss}\n >\n {i18nStrings.cancelActionText}\n </InternalButton>\n </span>\n <span\n {...getAnalyticsMetadataAttribute({\n action: 'editConfirm',\n } as Partial<GeneratedAnalyticsMetadataPropertyEditConfirm>)}\n >\n <InternalButton\n className={clsx(styles['token-editor-submit'], testUtilStyles['token-editor-submit'])}\n formAction=\"none\"\n onClick={onSubmit}\n >\n {i18nStrings.applyActionText}\n </InternalButton>\n </span>\n </div>\n </div>\n );\n}\n\ninterface TokenEditorLayout {\n tokens: InternalToken[];\n supportsGroups: boolean;\n onRemove: (index: number) => void;\n onRemoveFromGroup: (index: number) => void;\n onSubmit: () => void;\n renderProperty: (index: number) => React.ReactNode;\n renderOperator: (index: number) => React.ReactNode;\n renderValue: (index: number) => React.ReactNode;\n i18nStrings: I18nStringsInternal;\n}\n\nfunction TokenEditorFields({\n tokens,\n supportsGroups,\n onRemove,\n onRemoveFromGroup,\n onSubmit,\n renderProperty,\n renderOperator,\n renderValue,\n i18nStrings,\n}: TokenEditorLayout) {\n const isMobile = useMobile();\n const isNarrow = isMobile || !supportsGroups;\n\n const propertyLabelId = useUniqueId();\n const operatorLabelId = useUniqueId();\n const valueLabelId = useUniqueId();\n const headers = (\n <div className={styles['token-editor-grid-group']}>\n <div id={propertyLabelId} className={styles['token-editor-grid-header']}>\n {i18nStrings.propertyText}\n </div>\n <div id={operatorLabelId} className={styles['token-editor-grid-header']}>\n {i18nStrings.operatorText}\n </div>\n <div id={valueLabelId} className={styles['token-editor-grid-header']}>\n {i18nStrings.valueText}\n </div>\n <div className={styles['token-editor-grid-header']}></div>\n </div>\n );\n\n return (\n <form\n className={clsx(\n styles['token-editor-grid'],\n isNarrow && styles['token-editor-narrow'],\n styles['token-editor-form']\n )}\n onSubmit={event => {\n event.preventDefault();\n onSubmit();\n }}\n >\n {!isNarrow && headers}\n\n {tokens.map((token, index) => (\n <div\n key={index}\n role=\"group\"\n aria-label={i18nStrings.formatToken(token).formattedText}\n className={clsx(styles['token-editor-grid-group'], supportsGroups && styles['token-editor-supports-groups'])}\n >\n <div className={clsx(styles['token-editor-grid-cell'], isNarrow && styles['token-editor-narrow'])}>\n <TokenEditorField\n isNarrow={isNarrow}\n label={i18nStrings.propertyText}\n labelId={propertyLabelId}\n className={clsx(styles['token-editor-field-property'], testUtilStyles['token-editor-field-property'])}\n index={index}\n >\n {renderProperty(index)}\n </TokenEditorField>\n </div>\n\n <div className={clsx(styles['token-editor-grid-cell'], isNarrow && styles['token-editor-narrow'])}>\n <TokenEditorField\n isNarrow={isNarrow}\n label={i18nStrings.operatorText}\n labelId={operatorLabelId}\n className={clsx(styles['token-editor-field-operator'], testUtilStyles['token-editor-field-operator'])}\n index={index}\n >\n {renderOperator(index)}\n </TokenEditorField>\n </div>\n\n <div className={clsx(styles['token-editor-grid-cell'], isNarrow && styles['token-editor-narrow'])}>\n <TokenEditorField\n isNarrow={isNarrow}\n label={i18nStrings.valueText}\n labelId={valueLabelId}\n className={clsx(styles['token-editor-field-value'], testUtilStyles['token-editor-field-value'])}\n index={index}\n >\n {renderValue(index)}\n </TokenEditorField>\n </div>\n\n {supportsGroups && (\n <div className={clsx(styles['token-editor-grid-cell'], isNarrow && styles['token-editor-narrow'])}>\n <div className={styles['token-editor-remove-token']}>\n <TokenEditorRemoveActions\n isNarrow={isNarrow}\n ariaLabel={i18nStrings.tokenEditorTokenActionsAriaLabel?.(token) ?? ''}\n mainActionAriaLabel={i18nStrings.tokenEditorTokenRemoveAriaLabel?.(token) ?? ''}\n disabled={tokens.length === 1}\n items={[\n {\n id: 'remove',\n text: i18nStrings.tokenEditorTokenRemoveLabel ?? '',\n disabled: token.standaloneIndex !== undefined,\n },\n { id: 'remove-from-group', text: i18nStrings.tokenEditorTokenRemoveFromGroupLabel ?? '' },\n ]}\n onItemClick={itemId => {\n switch (itemId) {\n case 'remove':\n return onRemove(index);\n case 'remove-from-group':\n return onRemoveFromGroup(index);\n }\n }}\n index={index}\n />\n </div>\n </div>\n )}\n </div>\n ))}\n </form>\n );\n}\n\nfunction TokenEditorField({\n isNarrow,\n label,\n labelId,\n children,\n className,\n index,\n}: {\n isNarrow: boolean;\n label: React.ReactNode;\n labelId: string;\n children: React.ReactNode;\n className: string;\n index: number;\n}) {\n return isNarrow ? (\n <InternalFormField label={label} className={className} stretch={true} data-testindex={index}>\n {children}\n </InternalFormField>\n ) : (\n <FormFieldContext.Provider value={{ ariaLabelledby: labelId }}>\n <InternalFormField className={className} data-testindex={index}>\n {children}\n </InternalFormField>\n </FormFieldContext.Provider>\n );\n}\n\nfunction TokenEditorRemoveActions({\n isNarrow,\n ariaLabel,\n mainActionAriaLabel,\n disabled,\n items,\n onItemClick,\n index,\n}: {\n isNarrow: boolean;\n ariaLabel: string;\n mainActionAriaLabel: string;\n disabled: boolean;\n items: ButtonDropdownProps.Item[];\n onItemClick: (itemId: string) => void;\n index: number;\n}) {\n return isNarrow ? (\n <InternalButtonDropdown\n variant=\"normal\"\n ariaLabel={ariaLabel}\n items={items.slice(1)}\n onItemClick={({ detail }) => onItemClick(detail.id)}\n disabled={disabled}\n mainAction={{\n text: items[0].text,\n onClick: () => onItemClick(items[0].id),\n disabled,\n ariaLabel: mainActionAriaLabel,\n }}\n className={testUtilStyles['token-editor-token-remove-actions']}\n data-testindex={index}\n />\n ) : (\n <InternalButtonDropdown\n variant=\"icon\"\n ariaLabel={ariaLabel}\n items={items}\n onItemClick={({ detail }) => onItemClick(detail.id)}\n disabled={disabled}\n className={testUtilStyles['token-editor-token-remove-actions']}\n data-testindex={index}\n />\n );\n}\n"]}
|
|
@@ -24,7 +24,7 @@ const styles_selectors_js_5 = require("../../../internal/components/option/style
|
|
|
24
24
|
const styles_selectors_js_6 = require("../../../internal/components/selectable-item/styles.selectors.js");
|
|
25
25
|
class AutosuggestDropdownWrapper extends dom_1.ComponentWrapper {
|
|
26
26
|
findOptions() {
|
|
27
|
-
return this.findAll(`.${styles_selectors_js_6.default['selectable-item']}[data-test-index]`).map((elementWrapper) => new option_1.default(elementWrapper.getElement()));
|
|
27
|
+
return this.findAll(`.${styles_selectors_js_6.default['selectable-item']}[data-test-index] .${option_1.default.rootSelector}`).map((elementWrapper) => new option_1.default(elementWrapper.getElement()));
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Returns an option from the dropdown.
|
|
@@ -32,7 +32,7 @@ class AutosuggestDropdownWrapper extends dom_1.ComponentWrapper {
|
|
|
32
32
|
* @param optionIndex 1-based index of the option to select.
|
|
33
33
|
*/
|
|
34
34
|
findOption(optionIndex) {
|
|
35
|
-
return this.findComponent(`.${styles_selectors_js_6.default['selectable-item']}[data-test-index="${optionIndex}"]`, option_1.default);
|
|
35
|
+
return this.findComponent(`.${styles_selectors_js_6.default['selectable-item']}[data-test-index="${optionIndex}"] .${option_1.default.rootSelector}`, option_1.default);
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Returns an option from the autosuggest by it's value
|
|
@@ -41,7 +41,7 @@ class AutosuggestDropdownWrapper extends dom_1.ComponentWrapper {
|
|
|
41
41
|
*/
|
|
42
42
|
findOptionByValue(value) {
|
|
43
43
|
const toReplace = (0, utils_1.escapeSelector)(value);
|
|
44
|
-
return this.findComponent(`.${option_1.default.rootSelector}[data-value="${toReplace}"]`, option_1.default);
|
|
44
|
+
return this.findComponent(`.${styles_selectors_js_6.default['selectable-item']} .${option_1.default.rootSelector}[data-value="${toReplace}"]`, option_1.default);
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* Returns an option from the dropdown.
|
|
@@ -50,7 +50,7 @@ class AutosuggestDropdownWrapper extends dom_1.ComponentWrapper {
|
|
|
50
50
|
* @param optionIndex 1-based index of the option to select.
|
|
51
51
|
*/
|
|
52
52
|
findOptionInGroup(groupIndex, optionIndex) {
|
|
53
|
-
return this.findComponent(`.${styles_selectors_js_6.default['selectable-item']}[data-group-index="${groupIndex}"][data-in-group-index="${optionIndex}"]`, option_1.default);
|
|
53
|
+
return this.findComponent(`.${styles_selectors_js_6.default['selectable-item']}[data-group-index="${groupIndex}"][data-in-group-index="${optionIndex}"] .${option_1.default.rootSelector}`, option_1.default);
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
56
|
* Use this element to scroll through the list of options
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/autosuggest/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAAkH;AAClH,oEAA0E;AAC1E,4EAAmE;AAEnE,oCAAoC;AACpC,mDAAmD;AACnD,+CAA+C;AAC/C,2DAA0D;AAE1D,kFAAkE;AAClE,+EAAmE;AACnE,0GAAoG;AACpG,0GAA4F;AAC5F,iGAAmF;AACnF,0GAAgG;AAEhG,MAAa,0BAA2B,SAAQ,sBAAgB;IAC9D,WAAW;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,6BAAgB,CAAC,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/autosuggest/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAAkH;AAClH,oEAA0E;AAC1E,4EAAmE;AAEnE,oCAAoC;AACpC,mDAAmD;AACnD,+CAA+C;AAC/C,2DAA0D;AAE1D,kFAAkE;AAClE,+EAAmE;AACnE,0GAAoG;AACpG,0GAA4F;AAC5F,iGAAmF;AACnF,0GAAgG;AAEhG,MAAa,0BAA2B,SAAQ,sBAAgB;IAC9D,WAAW;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,6BAAgB,CAAC,iBAAiB,CAAC,sBAAsB,gBAAa,CAAC,YAAY,EAAE,CAAC,CAAC,GAAG,CAChH,CAAC,cAA8B,EAAE,EAAE,CAAC,IAAI,gBAAa,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CACnF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,UAAU,CAAC,WAAmB;QAC5B,OAAO,IAAI,CAAC,aAAa,CACvB,IAAI,6BAAgB,CAAC,iBAAiB,CAAC,qBAAqB,WAAW,OAAO,gBAAa,CAAC,YAAY,EAA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IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,6BAAgB,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACxF,CAAC;IAED;;;;;;OAMG;IAEH,gBAAgB,CAAC,KAAa,EAAE,OAAO,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE;QACnE,IAAA,eAAG,EAAC,GAAG,EAAE;;YACP,MAAA,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,0CACtB,UAAU,CAAC,KAAK,EACjB,SAAS,CAAC,IAAI,UAAU,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IAEH,uBAAuB,CAAC,KAAa,EAAE,OAAO,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE;QAC1E,IAAA,eAAG,EAAC,GAAG,EAAE;;YACP,MAAA,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,0CACtB,iBAAiB,CAAC,KAAK,EACxB,SAAS,CAAC,IAAI,UAAU,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC;;AAlEM,+BAAY,GAAW,6BAAU,CAAC,IAAI,CAAC;kBAD3B,kBAAkB;AA6CrC;IADC,aAAO;0DAOP;AAUD;IADC,aAAO;iEAOP"}
|
|
@@ -189,7 +189,7 @@ class OptionsDropdownContentWrapper extends dom_1.ComponentWrapper {
|
|
|
189
189
|
}
|
|
190
190
|
findOptionByValue(value) {
|
|
191
191
|
const toReplace = (0, utils_1.escapeSelector)(value);
|
|
192
|
-
return this.findComponent(`.${option_1.default.rootSelector}[data-value="${toReplace}"]`, option_1.default);
|
|
192
|
+
return this.findComponent(`.${styles_selectors_js_4.default['selectable-item']} .${option_1.default.rootSelector}[data-value="${toReplace}"]`, option_1.default);
|
|
193
193
|
}
|
|
194
194
|
/**
|
|
195
195
|
* Returns an option from the dropdown.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-host.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/internal/dropdown-host.ts"],"names":[],"mappings":";;;;;;;;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAAkH;AAClH,oEAA0E;AAC1E,4EAAmE;AAEnE,yCAAyC;AACzC,qCAAqC;AACrC,iDAAgD;AAEhD,+EAAmE;AACnE,0GAA4F;AAC5F,iGAAmF;AACnF,0GAAgG;AAEhG,MAA8B,4BAA6B,SAAQ,sBAAgB;IAGjF;;;OAGG;IACK,kBAAkB,CAAC,OAAO,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE;;QAC9D,MAAM,MAAM,GAAG,CAAC,CAAC,CAAA,MAAA,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,0CAAE,gBAAgB,EAAE,CAAA,CAAC;QAChE,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,YAAY,CAAC,OAAO,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE;QAChD,OAAO,OAAO,CAAC,gBAAgB;YAC7B,CAAC,CAAC,IAAA,mBAAa,GAAE,CAAC,aAAa,CAAC,IAAI,6BAAc,CAAC,QAAQ,kBAAkB,EAAE,4BAA4B,CAAE;YAC7G,CAAC,CAAC,IAAI,6BAA6B,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IAC3D,CAAC;IAGD,YAAY;QACV,IAAA,eAAG,EAAC,GAAG,EAAE;YACP,IAAI,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,IAAI,UAAU,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC/E,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IAEH,aAAa,CA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AC,UAAU,EAAE,CAAC,CACnF,CAAC;IACJ,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAY,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IAED,6BAA6B;;QAC3B,OAAO,MAAA,MAAA,IAAI,CAAC,qBAAqB,EAAE,0CAAE,eAAe,CAAC,6BAAgB,CAAC,sBAAsB,CAAC,CAAC,mCAAI,IAAI,CAAC;IACzG,CAAC;IAED;;;OAGG;IACH,sBAAsB;QACpB,OAAO,IAAI,CAAC,kBAAkB,CAAC,6BAAY,CAAC,2BAA2B,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,qBAAqB;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAgB,CAAC,WAAW,EAAE,EAAE,gBAAa,CAAC,CAAC;IAC/E,CAAC;IAED,gBAAgB;QACd,MAAM,QAAQ,GAAG,IAAI,kBAAe,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QACxD,OAAO,QAAQ,CAAC,gBAAgB,EAAE,CAAC;IACrC,CAAC;IACD;;;;OAIG;IACH,UAAU,CAAC,WAAmB;QAC5B,OAAO,IAAI,CAAC,aAAa,CACvB,IAAI,6BAAgB,CAAC,iBAAiB,CAAC,qBAAqB,WAAW,OAAO,gBAAa,CAAC,YAAY,EAAE,EAC1G,gBAAa,CACd,CAAC;IACJ,CAAC;IAED,iBAAiB,CAAC,KAAa;QAC7B,MAAM,SAAS,GAAG,IAAA,sBAAc,EAAC,KAAK,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"dropdown-host.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/internal/dropdown-host.ts"],"names":[],"mappings":";;;;;;;;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAAkH;AAClH,oEAA0E;AAC1E,4EAAmE;AAEnE,yCAAyC;AACzC,qCAAqC;AACrC,iDAAgD;AAEhD,+EAAmE;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c,CAAC,UAAU,EAAE,CAAC,CACnF,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,oBAAoB;QAClB,OAAO,IAAI,CAAC,eAAe,CAAC,sBAAkB,CAAC,YAAY,CAAC,CAAC;IAC/D,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,kBAAkB,CAAC,6BAAgB,CAAC,QAAQ,CAAC,CAAC,GAAG,CAC3D,CAAC,cAA8B,EAAE,EAAE,CAAC,IAAI,gBAAa,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CACnF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,KAAa;QACrB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,6BAAgB,CAAC,iBAAiB,CAAC,sBAAsB,KAAK,IAAI,CAAC,CAAC;IAC3F,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,6BAAgB,CAAC,iBAAiB,CAAC,2CAA2C,CAAC,CAAC;IAC1G,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,6BAAgB,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IACzD,CAAC;CACF;AAzGD,sEAyGC;AAED,MAAa,4BAA6B,SAAQ,6BAA6B;IAC7E,gBAAgB;QACd,OAAO,IAAA,mBAAa,GAAE,CAAC,aAAa,CAAC,IAAI,6BAAc,CAAC,QAAQ,kBAAkB,EAAE,kBAAe,CAAC,CAAC;IACvG,CAAC;CACF;AAJD,oEAIC"}
|
|
@@ -18,7 +18,7 @@ const styles_selectors_js_2 = require("../../../internal/components/selectable-i
|
|
|
18
18
|
const styles_selectors_js_3 = require("../../../prompt-input/test-classes/styles.selectors.js");
|
|
19
19
|
class PromptInputMenuWrapper extends dom_1.ComponentWrapper {
|
|
20
20
|
findOptions() {
|
|
21
|
-
return this.findAll(`.${styles_selectors_js_2.default['selectable-item']}[data-test-index]`).map((elementWrapper) => new option_1.default(elementWrapper.getElement()));
|
|
21
|
+
return this.findAll(`.${styles_selectors_js_2.default['selectable-item']}[data-test-index] .${option_1.default.rootSelector}`).map((elementWrapper) => new option_1.default(elementWrapper.getElement()));
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Returns an option from the menu.
|
|
@@ -26,7 +26,7 @@ class PromptInputMenuWrapper extends dom_1.ComponentWrapper {
|
|
|
26
26
|
* @param optionIndex 1-based index of the option to select.
|
|
27
27
|
*/
|
|
28
28
|
findOption(optionIndex) {
|
|
29
|
-
return this.findComponent(`.${styles_selectors_js_2.default['selectable-item']}[data-test-index="${optionIndex}"]`, option_1.default);
|
|
29
|
+
return this.findComponent(`.${styles_selectors_js_2.default['selectable-item']}[data-test-index="${optionIndex}"] .${option_1.default.rootSelector}`, option_1.default);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* Returns an option from the menu by its value
|
|
@@ -35,7 +35,7 @@ class PromptInputMenuWrapper extends dom_1.ComponentWrapper {
|
|
|
35
35
|
*/
|
|
36
36
|
findOptionByValue(value) {
|
|
37
37
|
const toReplace = (0, utils_1.escapeSelector)(value);
|
|
38
|
-
return this.findComponent(`.${option_1.default.rootSelector}[data-value="${toReplace}"]`, option_1.default);
|
|
38
|
+
return this.findComponent(`.${styles_selectors_js_2.default['selectable-item']} .${option_1.default.rootSelector}[data-value="${toReplace}"]`, option_1.default);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
exports.PromptInputMenuWrapper = PromptInputMenuWrapper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/prompt-input/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;;;;;;;AAEtC,gEAAkH;AAClH,oEAA0E;AAC1E,4EAAmF;AAEnF,+CAA+C;AAE/C,+EAAmE;AACnE,0GAAgG;AAChG,gGAAoF;AAEpF,MAAa,sBAAuB,SA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