@cloudscape-design/components 3.0.20 → 3.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/annotation-context/annotation/annotation-popover.d.ts.map +1 -1
  2. package/annotation-context/annotation/annotation-popover.js +12 -16
  3. package/annotation-context/annotation/annotation-popover.js.map +1 -1
  4. package/app-layout/index.d.ts.map +1 -1
  5. package/app-layout/index.js +6 -4
  6. package/app-layout/index.js.map +1 -1
  7. package/autosuggest/internal.d.ts.map +1 -1
  8. package/autosuggest/internal.js +2 -7
  9. package/autosuggest/internal.js.map +1 -1
  10. package/date-picker/calendar/index.d.ts.map +1 -1
  11. package/date-picker/calendar/index.js +2 -2
  12. package/date-picker/calendar/index.js.map +1 -1
  13. package/date-picker/calendar/utils/locales.d.ts +2 -0
  14. package/date-picker/calendar/utils/locales.d.ts.map +1 -1
  15. package/date-picker/calendar/utils/locales.js +4 -0
  16. package/date-picker/calendar/utils/locales.js.map +1 -1
  17. package/date-range-picker/calendar/index.d.ts +1 -1
  18. package/date-range-picker/calendar/index.d.ts.map +1 -1
  19. package/date-range-picker/calendar/index.js +3 -1
  20. package/date-range-picker/calendar/index.js.map +1 -1
  21. package/date-range-picker/dropdown.d.ts +1 -2
  22. package/date-range-picker/dropdown.d.ts.map +1 -1
  23. package/date-range-picker/dropdown.js.map +1 -1
  24. package/date-range-picker/index.d.ts.map +1 -1
  25. package/date-range-picker/index.js +1 -3
  26. package/date-range-picker/index.js.map +1 -1
  27. package/internal/components/dropdown/index.d.ts +1 -1
  28. package/internal/components/dropdown/index.d.ts.map +1 -1
  29. package/internal/components/dropdown/index.js +9 -3
  30. package/internal/components/dropdown/index.js.map +1 -1
  31. package/internal/components/dropdown/interfaces.d.ts +4 -0
  32. package/internal/components/dropdown/interfaces.d.ts.map +1 -1
  33. package/internal/components/dropdown/interfaces.js.map +1 -1
  34. package/internal/components/option/index.js +3 -3
  35. package/internal/components/option/index.js.map +1 -1
  36. package/internal/components/option/option-parts.js +3 -3
  37. package/internal/components/option/option-parts.js.map +1 -1
  38. package/internal/environment.js +1 -1
  39. package/package.json +1 -1
  40. package/progress-bar/internal.d.ts.map +1 -1
  41. package/progress-bar/internal.js +1 -1
  42. package/progress-bar/internal.js.map +1 -1
  43. package/property-filter/controller.d.ts +3 -3
  44. package/property-filter/controller.d.ts.map +1 -1
  45. package/property-filter/controller.js +16 -26
  46. package/property-filter/controller.js.map +1 -1
  47. package/property-filter/interfaces.d.ts +7 -20
  48. package/property-filter/interfaces.d.ts.map +1 -1
  49. package/property-filter/interfaces.js.map +1 -1
  50. package/property-filter/use-load-items.d.ts +1 -1
  51. package/property-filter/utils.d.ts +7 -0
  52. package/property-filter/utils.d.ts.map +1 -0
  53. package/property-filter/utils.js +62 -0
  54. package/property-filter/utils.js.map +1 -0
  55. package/tabs/tab-header-bar.d.ts.map +1 -1
  56. package/tabs/tab-header-bar.js +3 -1
  57. package/tabs/tab-header-bar.js.map +1 -1
  58. package/test-utils/dom/split-panel/index.d.ts +1 -0
  59. package/test-utils/dom/split-panel/index.js +3 -0
  60. package/test-utils/dom/split-panel/index.js.map +1 -1
  61. package/test-utils/selectors/split-panel/index.d.ts +1 -0
  62. package/test-utils/selectors/split-panel/index.js +3 -0
  63. package/test-utils/selectors/split-panel/index.js.map +1 -1
  64. package/test-utils/tsconfig.tsbuildinfo +1 -1
@@ -3,6 +3,7 @@ import { NonCancelableEventHandler } from '../internal/events';
3
3
  import { DropdownStatusProps } from '../internal/components/dropdown-status';
4
4
  import { AutosuggestProps } from '../autosuggest/interfaces';
5
5
  import { ExpandToViewport } from '../internal/components/dropdown/interfaces';
6
+ import { PropertyFilterOperator, PropertyFilterOperation, PropertyFilterToken, PropertyFilterProperty, PropertyFilterOption } from '@cloudscape-design/collection-hooks';
6
7
  export interface PropertyFilterProps extends BaseComponentProps, ExpandToViewport {
7
8
  /**
8
9
  * If set to `true`, the filtering input will be disabled.
@@ -139,11 +140,15 @@ export interface PropertyFilterProps extends BaseComponentProps, ExpandToViewpor
139
140
  filteringStatusType?: DropdownStatusProps.StatusType;
140
141
  }
141
142
  export declare namespace PropertyFilterProps {
143
+ type Token = PropertyFilterToken;
144
+ type JoinOperation = PropertyFilterOperation;
145
+ type ComparisonOperator = PropertyFilterOperator;
146
+ type FilteringProperty = PropertyFilterProperty;
147
+ type FilteringOption = PropertyFilterOption;
142
148
  interface Query {
143
- tokens: readonly PropertyFilterProps.Token[];
149
+ tokens: ReadonlyArray<PropertyFilterProps.Token>;
144
150
  operation: PropertyFilterProps.JoinOperation;
145
151
  }
146
- type JoinOperation = 'and' | 'or';
147
152
  interface LoadItemsDetail {
148
153
  filteringProperty?: FilteringProperty;
149
154
  filteringOperator?: ComparisonOperator;
@@ -185,24 +190,11 @@ export declare namespace PropertyFilterProps {
185
190
  removeTokenButtonAriaLabel: (token: PropertyFilterProps.Token) => string;
186
191
  enteredTextLabel: AutosuggestProps.EnteredTextLabel;
187
192
  }
188
- type ComparisonOperator = '<' | '<=' | '>' | '>=' | ':' | '!:' | '=' | '!=';
189
- interface FilteringProperty {
190
- key: string;
191
- groupValuesLabel: string;
192
- propertyLabel: string;
193
- operators?: readonly ComparisonOperator[];
194
- defaultOperator?: ComparisonOperator;
195
- group?: string;
196
- }
197
193
  interface GroupText {
198
194
  properties: string;
199
195
  values: string;
200
196
  group: string;
201
197
  }
202
- interface FilteringOption {
203
- propertyKey: string;
204
- value: string;
205
- }
206
198
  interface FilteringChangeDetail {
207
199
  filteringText: string;
208
200
  filteringProperty?: FilteringProperty;
@@ -213,10 +205,5 @@ export declare namespace PropertyFilterProps {
213
205
  */
214
206
  focus(): void;
215
207
  }
216
- interface Token {
217
- value: string;
218
- propertyKey?: string;
219
- operator: ComparisonOperator;
220
- }
221
208
  }
222
209
  //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/property-filter/interfaces.ts"],"names":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AM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf;IAED,UAAiB,qBAAqB;QACpC,aAAa,EAAE,MAAM,CAAC;QACtB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;KACvC;IAED,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,IAAI,IAAI,CAAC;KACf;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/property-filter/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status';\nimport { AutosuggestProps } from '../autosuggest/interfaces';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\n\nexport interface PropertyFilterProps extends BaseComponentProps, ExpandToViewport {\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 */\n i18nStrings: PropertyFilterProps.I18nStrings;\n /**\n * Accepts a human-readable, localized string that indicates the number of results. For example, \"1 match\" or \"165 matches.\"\n * If the total number of results is unknown, also include an indication that there may be more results than\n * the number listed. For example, \"25+ matches.\"\n *\n * The count text is only displayed when `query.tokens` isn't empty.\n */\n countText?: string;\n /**\n * An object representing the current query displayed in the property filter. Has two properties: `tokens` and `operation`.\n * `tokens` is an array of objects that will be displayed to the user beneath the filtering input.\n * Each token has the following properties:\n *\n * * value [string]: The string value of the token to be used as a filter.\n * * propertyKey [string]: The key of the corresponding property in filteringProperties.\n * * operator ['<' | '<=' | '>' | '>=' | ':' | '!:' | '=' | '!=']: The operator which indicates how to filter the dataset using this token.\n *\n * `operation` has two valid values [and, or] and controls the join operation to be applied between tokens when filtering the items.\n */\n query: PropertyFilterProps.Query;\n /**\n * If hideOperations it set, the indicator of the operation (that is, `and` or `or`) and the selection of operations\n * (applied to the property and value token) are hidden from the user. Only use when you have a custom\n * filtering logic which combines tokens in different way than the default one. When used, ensure that\n * operations are communicated to the user in another way.\n */\n hideOperations?: boolean;\n /**\n * Fired when the `query` gets changed. Filter the dataset in response to this event using the values in the `detail` object.\n */\n onChange: NonCancelableEventHandler<PropertyFilterProps.Query>;\n /**\n * An array of properties by which the data set can be filtered. Each element has the following properties:\n *\n * * groupValuesLabel [string]: Localized string to display for the 'Values' group label for a specific property.\n * * key [string]: The identifier of this property.\n * * propertyLabel [string]: A human-readable string for the property.\n * * operators [Array]: A list of all operators supported by this property. If you omit the equals operator because your API does not support it, make sure to set `defaultOperator` to a supported operator from this list.\n * * group [string]: Optional identifier of a custom group that this filtering option is assigned to. Use to create additional groups below the default one. Make sure to also define labels for the group in the customGroupsText property. Notice that only one level of options nesting is supported.\n * * defaultOperator [ComparisonOperator]: Optional parameter that changes the default operator used with this filtering property. Use it only if your API does not support \"equals\" filtering terms with this property.\n */\n filteringProperties: ReadonlyArray<PropertyFilterProps.FilteringProperty>;\n /**\n * An array of possible values of the individual `filteringProperties`. Each element has the following properties:\n *\n * * `propertyKey` [string]: The key of the corresponding filtering property in the `filteringProperties` array.\n * * `value` [string]: The value that will be used as a suggestion when creating or modifying a filtering token.\n */\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 * 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 * Set `asyncProperties` if you need to load `filteringProperties` asynchronousely. This would cause extra `onLoadMore`\n * events to fire calling for more properties.\n */\n asyncProperties?: boolean;\n /**\n * Specifies the maximum number of displayed tokens. If the property isn't set, all of the tokens are displayed.\n */\n tokenLimit?: number;\n /**\n * 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 * Specifies the current status of loading more options.\n * * `pending` - Indicates that no request in progress, but more options may be loaded.\n * * `loading` - Indicates that data fetching is in progress.\n * * `finished` - Indicates that pagination has finished and no more requests are expected.\n * * `error` - Indicates that an error occurred during fetch. You should use `recoveryText` to enable the user to recover.\n **/\n filteringStatusType?: DropdownStatusProps.StatusType;\n}\n\nexport namespace PropertyFilterProps {\n export interface Query {\n tokens: readonly PropertyFilterProps.Token[];\n operation: PropertyFilterProps.JoinOperation;\n }\n\n export type JoinOperation = 'and' | 'or';\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 * Label that will be passed down to the Autosuggest `ariaLabel` property.\n * See the [Autosuggest API](/system/components/autosuggest/?tabId=api) page for more details.\n */\n filteringAriaLabel: string;\n dismissAriaLabel: string;\n\n filteringPlaceholder?: 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\n editTokenHeader: string;\n propertyText: string;\n operatorText: string;\n valueText: string;\n cancelActionText: string;\n applyActionText: string;\n allPropertiesLabel: string;\n\n tokenLimitShowMore?: string;\n tokenLimitShowFewer?: string;\n clearFiltersText: string;\n removeTokenButtonAriaLabel: (token: PropertyFilterProps.Token) => string;\n enteredTextLabel: AutosuggestProps.EnteredTextLabel;\n }\n\n export type ComparisonOperator = '<' | '<=' | '>' | '>=' | ':' | '!:' | '=' | '!=';\n\n export interface FilteringProperty {\n key: string;\n groupValuesLabel: string;\n propertyLabel: string;\n operators?: readonly ComparisonOperator[];\n defaultOperator?: ComparisonOperator;\n group?: string;\n }\n\n export interface GroupText {\n properties: string;\n values: string;\n group: string;\n }\n\n export interface FilteringOption {\n propertyKey: string;\n value: 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 export interface Token {\n value: string;\n propertyKey?: string;\n operator: ComparisonOperator;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/property-filter/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status';\nimport { AutosuggestProps } from '../autosuggest/interfaces';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\nimport {\n PropertyFilterOperator,\n PropertyFilterOperation,\n PropertyFilterToken,\n PropertyFilterProperty,\n PropertyFilterOption,\n} from '@cloudscape-design/collection-hooks';\n\nexport interface PropertyFilterProps extends BaseComponentProps, ExpandToViewport {\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 */\n i18nStrings: PropertyFilterProps.I18nStrings;\n /**\n * Accepts a human-readable, localized string that indicates the number of results. For example, \"1 match\" or \"165 matches.\"\n * If the total number of results is unknown, also include an indication that there may be more results than\n * the number listed. For example, \"25+ matches.\"\n *\n * The count text is only displayed when `query.tokens` isn't empty.\n */\n countText?: string;\n /**\n * An object representing the current query displayed in the property filter. Has two properties: `tokens` and `operation`.\n * `tokens` is an array of objects that will be displayed to the user beneath the filtering input.\n * Each token has the following properties:\n *\n * * value [string]: The string value of the token to be used as a filter.\n * * propertyKey [string]: The key of the corresponding property in filteringProperties.\n * * operator ['<' | '<=' | '>' | '>=' | ':' | '!:' | '=' | '!=']: The operator which indicates how to filter the dataset using this token.\n *\n * `operation` has two valid values [and, or] and controls the join operation to be applied between tokens when filtering the items.\n */\n query: PropertyFilterProps.Query;\n /**\n * If hideOperations it set, the indicator of the operation (that is, `and` or `or`) and the selection of operations\n * (applied to the property and value token) are hidden from the user. Only use when you have a custom\n * filtering logic which combines tokens in different way than the default one. When used, ensure that\n * operations are communicated to the user in another way.\n */\n hideOperations?: boolean;\n /**\n * Fired when the `query` gets changed. Filter the dataset in response to this event using the values in the `detail` object.\n */\n onChange: NonCancelableEventHandler<PropertyFilterProps.Query>;\n /**\n * An array of properties by which the data set can be filtered. Each element has the following properties:\n *\n * * groupValuesLabel [string]: Localized string to display for the 'Values' group label for a specific property.\n * * key [string]: The identifier of this property.\n * * propertyLabel [string]: A human-readable string for the property.\n * * operators [Array]: A list of all operators supported by this property. If you omit the equals operator because your API does not support it, make sure to set `defaultOperator` to a supported operator from this list.\n * * group [string]: Optional identifier of a custom group that this filtering option is assigned to. Use to create additional groups below the default one. Make sure to also define labels for the group in the customGroupsText property. Notice that only one level of options nesting is supported.\n * * defaultOperator [ComparisonOperator]: Optional parameter that changes the default operator used with this filtering property. Use it only if your API does not support \"equals\" filtering terms with this property.\n */\n filteringProperties: ReadonlyArray<PropertyFilterProps.FilteringProperty>;\n /**\n * An array of possible values of the individual `filteringProperties`. Each element has the following properties:\n *\n * * `propertyKey` [string]: The key of the corresponding filtering property in the `filteringProperties` array.\n * * `value` [string]: The value that will be used as a suggestion when creating or modifying a filtering token.\n */\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 * 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 * Set `asyncProperties` if you need to load `filteringProperties` asynchronousely. This would cause extra `onLoadMore`\n * events to fire calling for more properties.\n */\n asyncProperties?: boolean;\n /**\n * Specifies the maximum number of displayed tokens. If the property isn't set, all of the tokens are displayed.\n */\n tokenLimit?: number;\n /**\n * 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 * Specifies the current status of loading more options.\n * * `pending` - Indicates that no request in progress, but more options may be loaded.\n * * `loading` - Indicates that data fetching is in progress.\n * * `finished` - Indicates that pagination has finished and no more requests are expected.\n * * `error` - Indicates that an error occurred during fetch. You should use `recoveryText` to enable the user to recover.\n **/\n filteringStatusType?: DropdownStatusProps.StatusType;\n}\n\nexport namespace PropertyFilterProps {\n export type Token = PropertyFilterToken;\n export type JoinOperation = PropertyFilterOperation;\n export type ComparisonOperator = PropertyFilterOperator;\n export type FilteringProperty = PropertyFilterProperty;\n export type FilteringOption = PropertyFilterOption;\n export interface Query {\n tokens: ReadonlyArray<PropertyFilterProps.Token>;\n operation: PropertyFilterProps.JoinOperation;\n }\n\n export interface LoadItemsDetail {\n filteringProperty?: FilteringProperty;\n filteringOperator?: ComparisonOperator;\n filteringText: string;\n firstPage: boolean;\n samePage: boolean;\n }\n\n export interface I18nStrings {\n /**\n * Label that will be passed down to the Autosuggest `ariaLabel` property.\n * See the [Autosuggest API](/system/components/autosuggest/?tabId=api) page for more details.\n */\n filteringAriaLabel: string;\n dismissAriaLabel: string;\n\n filteringPlaceholder?: 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\n editTokenHeader: string;\n propertyText: string;\n operatorText: string;\n valueText: string;\n cancelActionText: string;\n applyActionText: string;\n allPropertiesLabel: string;\n\n tokenLimitShowMore?: string;\n tokenLimitShowFewer?: string;\n clearFiltersText: string;\n removeTokenButtonAriaLabel: (token: PropertyFilterProps.Token) => string;\n enteredTextLabel: AutosuggestProps.EnteredTextLabel;\n }\n\n export interface GroupText {\n properties: string;\n values: string;\n group: string;\n }\n\n export interface FilteringChangeDetail {\n filteringText: string;\n filteringProperty?: FilteringProperty;\n }\n\n export interface Ref {\n /**\n * Sets focus on the underlying input control.\n */\n focus(): void;\n }\n}\n"]}
@@ -7,7 +7,7 @@ import { PropertyFilterProps } from './interfaces';
7
7
  * the same event from firing twice in a row. This means, refocusing the control sometimes results in
8
8
  * `onLoadItems` firing, but sometimes not.
9
9
  */
10
- export declare const useLoadItems: (onLoadItems: PropertyFilterProps['onLoadItems'], focusFilteringText?: string | undefined, currentFilteringProperty?: PropertyFilterProps.FilteringProperty | undefined, currentFilteringText?: string | undefined, currentFilteringOperator?: PropertyFilterProps.ComparisonOperator | undefined) => {
10
+ export declare const useLoadItems: (onLoadItems: PropertyFilterProps['onLoadItems'], focusFilteringText?: string | undefined, currentFilteringProperty?: import("@cloudscape-design/collection-hooks").PropertyFilterProperty | undefined, currentFilteringText?: string | undefined, currentFilteringOperator?: import("@cloudscape-design/collection-hooks").PropertyFilterOperator | undefined) => {
11
11
  onBlur: () => void;
12
12
  onFocus: () => void;
13
13
  onLoadItems: NonCancelableEventHandler<import("../internal/components/dropdown/interfaces").OptionsLoadItemsDetail>;
@@ -0,0 +1,7 @@
1
+ import { PropertyFilterProps } from './interfaces';
2
+ export declare function matchFilteringProperty(filteringProperties: readonly PropertyFilterProps.FilteringProperty[], filteringText: string): null | PropertyFilterProps.FilteringProperty;
3
+ export declare function matchOperator(allowedOperators: readonly PropertyFilterProps.ComparisonOperator[], filteringText: string): null | PropertyFilterProps.ComparisonOperator;
4
+ export declare function matchOperatorPrefix(allowedOperators: readonly PropertyFilterProps.ComparisonOperator[], filteringText: string): null | string;
5
+ export declare function trimStart(source: string): string;
6
+ export declare function trimFirstSpace(source: string): string;
7
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/property-filter/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,wBAAgB,sBAAsB,CACpC,mBAAmB,EAAE,SAAS,mBAAmB,CAAC,iBAAiB,EAAE,EACrE,aAAa,EAAE,MAAM,GACpB,IAAI,GAAG,mBAAmB,CAAC,iBAAiB,CAc9C;AAGD,wBAAgB,aAAa,CAC3B,gBAAgB,EAAE,SAAS,mBAAmB,CAAC,kBAAkB,EAAE,EACnE,aAAa,EAAE,MAAM,GACpB,IAAI,GAAG,mBAAmB,CAAC,kBAAkB,CAc/C;AAGD,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,SAAS,mBAAmB,CAAC,kBAAkB,EAAE,EACnE,aAAa,EAAE,MAAM,GACpB,IAAI,GAAG,MAAM,CAUf;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAUhD;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD"}
@@ -0,0 +1,62 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // Finds the longest property the filtering text starts from.
4
+ export function matchFilteringProperty(filteringProperties, filteringText) {
5
+ filteringText = filteringText.toLowerCase();
6
+ var maxLength = 0;
7
+ var matchedProperty = null;
8
+ for (var _i = 0, filteringProperties_1 = filteringProperties; _i < filteringProperties_1.length; _i++) {
9
+ var property = filteringProperties_1[_i];
10
+ if (property.propertyLabel.length > maxLength && startsWith(filteringText, property.propertyLabel.toLowerCase())) {
11
+ maxLength = property.propertyLabel.length;
12
+ matchedProperty = property;
13
+ }
14
+ }
15
+ return matchedProperty;
16
+ }
17
+ // Finds the longest operator the filtering text starts from.
18
+ export function matchOperator(allowedOperators, filteringText) {
19
+ filteringText = filteringText.toLowerCase();
20
+ var maxLength = 0;
21
+ var matchedOperator = null;
22
+ for (var _i = 0, allowedOperators_1 = allowedOperators; _i < allowedOperators_1.length; _i++) {
23
+ var operator = allowedOperators_1[_i];
24
+ if (operator.length > maxLength && startsWith(filteringText, operator.toLowerCase())) {
25
+ maxLength = operator.length;
26
+ matchedOperator = operator;
27
+ }
28
+ }
29
+ return matchedOperator;
30
+ }
31
+ // Finds if the filtering text matches any operator prefix.
32
+ export function matchOperatorPrefix(allowedOperators, filteringText) {
33
+ if (filteringText.trim().length === 0) {
34
+ return '';
35
+ }
36
+ for (var _i = 0, allowedOperators_2 = allowedOperators; _i < allowedOperators_2.length; _i++) {
37
+ var operator = allowedOperators_2[_i];
38
+ if (startsWith(operator.toLowerCase(), filteringText.toLowerCase())) {
39
+ return filteringText;
40
+ }
41
+ }
42
+ return null;
43
+ }
44
+ export function trimStart(source) {
45
+ var spacesLength = 0;
46
+ for (var i = 0; i < source.length; i++) {
47
+ if (source[i] === ' ') {
48
+ spacesLength++;
49
+ }
50
+ else {
51
+ break;
52
+ }
53
+ }
54
+ return source.slice(spacesLength);
55
+ }
56
+ export function trimFirstSpace(source) {
57
+ return source[0] === ' ' ? source.slice(1) : source;
58
+ }
59
+ function startsWith(source, target) {
60
+ return source.indexOf(target) === 0;
61
+ }
62
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/property-filter/utils.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,6DAA6D;AAC7D,MAAM,UAAU,sBAAsB,CACpC,mBAAqE,EACrE,aAAqB;IAErB,aAAa,GAAG,aAAa,CAAC,WAAW,EAAE,CAAC;IAE5C,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,eAAe,GAAiD,IAAI,CAAC;IAEzE,KAAuB,UAAmB,EAAnB,2CAAmB,EAAnB,iCAAmB,EAAnB,IAAmB,EAAE;QAAvC,IAAM,QAAQ,4BAAA;QACjB,IAAI,QAAQ,CAAC,aAAa,CAAC,MAAM,GAAG,SAAS,IAAI,UAAU,CAAC,aAAa,EAAE,QAAQ,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,EAAE;YAChH,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC;YAC1C,eAAe,GAAG,QAAQ,CAAC;SAC5B;KACF;IAED,OAAO,eAAe,CAAC;AACzB,CA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AAO,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AACtD,CAAC;AAED,SAAS,UAAU,CAAC,MAAc,EAAE,MAAc;IAChD,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PropertyFilterProps } from './interfaces';\n\n// Finds the longest property the filtering text starts from.\nexport function matchFilteringProperty(\n filteringProperties: readonly PropertyFilterProps.FilteringProperty[],\n filteringText: string\n): null | PropertyFilterProps.FilteringProperty {\n filteringText = filteringText.toLowerCase();\n\n let maxLength = 0;\n let matchedProperty: null | PropertyFilterProps.FilteringProperty = null;\n\n for (const property of filteringProperties) {\n if (property.propertyLabel.length > maxLength && startsWith(filteringText, property.propertyLabel.toLowerCase())) {\n maxLength = property.propertyLabel.length;\n matchedProperty = property;\n }\n }\n\n return matchedProperty;\n}\n\n// Finds the longest operator the filtering text starts from.\nexport function matchOperator(\n allowedOperators: readonly PropertyFilterProps.ComparisonOperator[],\n filteringText: string\n): null | PropertyFilterProps.ComparisonOperator {\n filteringText = filteringText.toLowerCase();\n\n let maxLength = 0;\n let matchedOperator: null | PropertyFilterProps.ComparisonOperator = null;\n\n for (const operator of allowedOperators) {\n if (operator.length > maxLength && startsWith(filteringText, operator.toLowerCase())) {\n maxLength = operator.length;\n matchedOperator = operator;\n }\n }\n\n return matchedOperator;\n}\n\n// Finds if the filtering text matches any operator prefix.\nexport function matchOperatorPrefix(\n allowedOperators: readonly PropertyFilterProps.ComparisonOperator[],\n filteringText: string\n): null | string {\n if (filteringText.trim().length === 0) {\n return '';\n }\n for (const operator of allowedOperators) {\n if (startsWith(operator.toLowerCase(), filteringText.toLowerCase())) {\n return filteringText;\n }\n }\n return null;\n}\n\nexport function trimStart(source: string): string {\n let spacesLength = 0;\n for (let i = 0; i < source.length; i++) {\n if (source[i] === ' ') {\n spacesLength++;\n } else {\n break;\n }\n }\n return source.slice(spacesLength);\n}\n\nexport function trimFirstSpace(source: string): string {\n return source[0] === ' ' ? source.slice(1) : source;\n}\n\nfunction startsWith(source: string, target: string): boolean {\n return source.indexOf(target) === 0;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"tab-header-bar.d.ts","sourceRoot":"","sources":["../../../src/tabs/tab-header-bar.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAiBzC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,YAAY,KAAK,IAAI,CAAC;IACzD,WAAW,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;IACtC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACxB,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,OAAO,EACP,WAAW,EACX,SAAS,EACT,cAAc,GACf,EAAE,iBAAiB,eAiRnB"}
1
+ {"version":3,"file":"tab-header-bar.d.ts","sourceRoot":"","sources":["../../../src/tabs/tab-header-bar.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAiBzC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,YAAY,KAAK,IAAI,CAAC;IACzD,WAAW,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;IACtC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACxB,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,OAAO,EACP,WAAW,EACX,SAAS,EACT,cAAc,GACf,EAAE,iBAAiB,eAkRnB"}
@@ -91,7 +91,9 @@ export function TabHeaderBar(_a) {
91
91
  'aria-hidden': true,
92
92
  tabIndex: -1
93
93
  };
94
- return (React.createElement("span", { className: classes, ref: containerRef },
94
+ return (
95
+ //converted span to div as list should not be a child of span for HTML validation
96
+ React.createElement("div", { className: classes, ref: containerRef },
95
97
  horizontalOverflow && (React.createElement("span", { ref: leftOverflowButton, className: leftButtonClasses },
96
98
  React.createElement(InternalButton, { variant: "icon", iconName: "angle-left", __nativeAttributes: paginationButtonAttributes, disabled: !leftOverflow, onClick: function () { return onPaginationClick(headerBarRef, -1); } }))),
97
99
  React.createElement("ul", { role: "tablist", className: styles['tabs-header-list'], "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ref: headerBarRef, onScroll: onScroll }, tabs.map(renderTabHeader)),
@@ -1 +1 @@
1
- {"version":3,"file":"tab-header-bar.js","sourceRoot":"","sources":["../../../src/tabs/tab-header-bar.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,eAAe,MAAM,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,WAAW,EAAI,CAAC;SACvC;QAED,OAAO,CACL,4BACE,GAAG,EAAE,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,OAAsB,CAAC,EAAnD,CAAmD,EACnE,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,EAC7B,IAAI,EAAC,cAAc,EACnB,GAAG,EAAE,GAAG,CAAC,EAAE,IAEV,OAAO,CACL,CACN,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef, useState, useEffect } from 'react';\nimport { TabsProps } from './interfaces';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { InternalButton } from '../button/internal';\nimport useFocusVisible from '../internal/hooks/focus-visible';\nimport { useContainerQuery } from '../internal/hooks/container-queries';\nimport { KeyCode } from '../internal/keycode';\nimport {\n onPaginationClick,\n hasHorizontalOverflow,\n hasLeftOverflow,\n hasRightOverflow,\n scrollIntoView,\n} from './scroll-utils';\nimport { isPlainLeftClick } from '../internal/events';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\n\nexport interface TabHeaderBarProps {\n onChange: (changeDetail: TabsProps.ChangeDetail) => void;\n activeTabId: TabsProps['activeTabId'];\n tabs: TabsProps['tabs'];\n variant: TabsProps['variant'];\n idNamespace: string;\n ariaLabel?: string;\n ariaLabelledby?: string;\n}\n\nexport function TabHeaderBar({\n onChange,\n activeTabId,\n tabs,\n variant,\n idNamespace,\n ariaLabel,\n ariaLabelledby,\n}: TabHeaderBarProps) {\n const focusVisible = useFocusVisible();\n\n const headerBarRef = useRef<HTMLUListElement>(null);\n const activeTabHeaderRef = useRef<HTMLAnchorElement>(null);\n const leftOverflowButton = useRef<HTMLElement>(null);\n\n const isVisualRefresh = useVisualRefresh(headerBarRef);\n\n const [widthChange, containerRef] = useContainerQuery<number>(rect => rect.width);\n const tabRefs = useRef<Map<string, HTMLElement>>(new Map());\n const [horizontalOverflow, setHorizontalOverflow] = useState(false);\n const [leftOverflow, setLeftOverflow] = useState(false);\n const [rightOverflow, setRightOverflow] = useState(false);\n\n useEffect(() => {\n if (headerBarRef.current) {\n setHorizontalOverflow(hasHorizontalOverflow(headerBarRef.current, leftOverflowButton));\n setLeftOverflow(hasLeftOverflow(headerBarRef.current));\n setRightOverflow(hasRightOverflow(headerBarRef.current));\n }\n }, [widthChange, tabs]);\n\n const scrollIntoViewIfPossible = (smooth: boolean) => {\n if (!activeTabId) {\n return;\n }\n const activeTabRef = tabRefs.current.get(activeTabId);\n if (activeTabRef && headerBarRef.current) {\n scrollIntoView(activeTabRef, headerBarRef.current, smooth);\n }\n };\n\n useEffect(() => {\n // Delay scrollIntoView as the position is depending on parent elements\n // (effects are called inside-out in the component tree).\n // Wait one frame to allow parents to complete it's calculation.\n requestAnimationFrame(() => {\n scrollIntoViewIfPossible(false);\n });\n // Non-smooth scrolling should not be called upon activeId change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [horizontalOverflow, widthChange, tabs.length]);\n\n useEffect(() => {\n scrollIntoViewIfPossible(true);\n // Smooth scrolling should only be called upon activeId change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeTabId]);\n\n useEffect(() => {\n /*\n When the selected tab changes and we are currently already focused on a tab,\n move the focus to the newly selected tab.\n */\n if (headerBarRef.current?.contains(document.activeElement)) {\n if (document.activeElement !== activeTabHeaderRef.current) {\n activeTabHeaderRef.current?.focus({ preventScroll: true });\n }\n }\n }, [activeTabId]);\n\n const onScroll = () => {\n if (headerBarRef.current) {\n setLeftOverflow(hasLeftOverflow(headerBarRef.current));\n setRightOverflow(hasRightOverflow(headerBarRef.current));\n }\n };\n\n const classes = clsx({\n [styles['tabs-header']]: true,\n [styles['tabs-header-with-divider']]: variant === 'default' || isVisualRefresh,\n });\n\n const leftButtonClasses = clsx({\n [styles['pagination-button']]: true,\n [styles['pagination-button-left']]: true,\n [styles['pagination-button-left-scrollable']]: leftOverflow,\n });\n\n const rightButtonClasses = clsx({\n [styles['pagination-button']]: true,\n [styles['pagination-button-right']]: true,\n [styles['pagination-button-right-scrollable']]: rightOverflow,\n });\n\n const paginationButtonAttributes = {\n 'aria-hidden': true,\n tabIndex: -1,\n };\n\n return (\n <span className={classes} ref={containerRef}>\n {horizontalOverflow && (\n <span ref={leftOverflowButton} className={leftButtonClasses}>\n <InternalButton\n variant=\"icon\"\n iconName=\"angle-left\"\n __nativeAttributes={paginationButtonAttributes}\n disabled={!leftOverflow}\n onClick={() => onPaginationClick(headerBarRef, -1)}\n />\n </span>\n )}\n <ul\n role=\"tablist\"\n className={styles['tabs-header-list']}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n ref={headerBarRef}\n onScroll={onScroll}\n >\n {tabs.map(renderTabHeader)}\n </ul>\n {horizontalOverflow && (\n <span className={rightButtonClasses}>\n <InternalButton\n variant=\"icon\"\n iconName=\"angle-right\"\n __nativeAttributes={paginationButtonAttributes}\n disabled={!rightOverflow}\n onClick={() => onPaginationClick(headerBarRef, 1)}\n />\n </span>\n )}\n </span>\n );\n\n function renderTabHeader(tab: TabsProps.Tab) {\n const enabledTabsWithCurrentTab = tabs.filter(tab => !tab.disabled || tab.id === activeTabId);\n\n const highlightTab = function (enabledTabIndex: number) {\n const tab = enabledTabsWithCurrentTab[enabledTabIndex];\n if (tab.id === activeTabId) {\n return;\n }\n\n onChange({ activeTabId: tab.id, activeTabHref: tab.href });\n };\n\n const handleKeyDown = function (\n event: React.KeyboardEvent<HTMLAnchorElement> | React.KeyboardEvent<HTMLButtonElement>\n ) {\n const { keyCode } = event;\n const specialKeys = [KeyCode.right, KeyCode.left, KeyCode.end, KeyCode.home, KeyCode.pageUp, KeyCode.pageDown];\n if (specialKeys.indexOf(keyCode) === -1) {\n return;\n }\n event.preventDefault();\n const activeIndex = enabledTabsWithCurrentTab.indexOf(tab);\n switch (keyCode) {\n case KeyCode.right:\n if (activeIndex + 1 === enabledTabsWithCurrentTab.length) {\n highlightTab(0);\n } else {\n highlightTab(activeIndex + 1);\n }\n return;\n case KeyCode.left:\n if (activeIndex === 0) {\n highlightTab(enabledTabsWithCurrentTab.length - 1);\n } else {\n highlightTab(activeIndex - 1);\n }\n return;\n case KeyCode.end:\n highlightTab(enabledTabsWithCurrentTab.length - 1);\n return;\n case KeyCode.home:\n highlightTab(0);\n return;\n case KeyCode.pageDown:\n if (rightOverflow) {\n onPaginationClick(headerBarRef, 1);\n }\n return;\n case KeyCode.pageUp:\n if (leftOverflow) {\n onPaginationClick(headerBarRef, -1);\n }\n return;\n }\n };\n\n const clickTab = (event: React.MouseEvent) => {\n if (tab.disabled) {\n event.preventDefault();\n return;\n }\n\n // if the primary mouse button is clicked with a modifier key, the browser will handle opening a new tab\n const specialKey = !isPlainLeftClick(event);\n if (specialKey && tab.href) {\n return;\n }\n\n event.preventDefault();\n // for browsers that do not focus buttons on button click\n if (!tab.href) {\n const clickedTabRef = tabRefs.current.get(tab.id);\n if (clickedTabRef) {\n const childElement = clickedTabRef.firstChild as HTMLButtonElement;\n if (childElement && childElement !== document.activeElement) {\n childElement.focus({ preventScroll: true });\n }\n }\n }\n\n if (tab.id === activeTabId) {\n return;\n }\n\n onChange({ activeTabId: tab.id, activeTabHref: tab.href });\n };\n\n const classes = clsx({\n [styles['tabs-tab-link']]: true,\n [styles.refresh]: isVisualRefresh,\n [styles['tabs-tab-active']]: activeTabId === tab.id && !tab.disabled,\n [styles['tabs-tab-disabled']]: tab.disabled,\n });\n\n const commonProps: (JSX.IntrinsicElements['a'] | JSX.IntrinsicElements['button']) & { 'data-testid': string } = {\n className: classes,\n ...focusVisible,\n role: 'tab',\n 'aria-selected': tab.id === activeTabId,\n 'aria-controls': `${idNamespace}-${tab.id}-panel`,\n 'data-testid': tab.id,\n children: <span className={styles['tabs-tab-label']}>{tab.label}</span>,\n };\n\n if (tab.disabled) {\n commonProps['aria-disabled'] = 'true';\n } else {\n commonProps.onClick = clickTab;\n }\n\n if (tab.id === activeTabId) {\n commonProps.ref = activeTabHeaderRef;\n commonProps.tabIndex = 0;\n commonProps.onKeyDown = (\n event: React.KeyboardEvent<HTMLAnchorElement> | React.KeyboardEvent<HTMLButtonElement>\n ) => handleKeyDown(event);\n } else {\n commonProps.tabIndex = -1;\n }\n\n let trigger = null;\n if (tab.href) {\n const anchorProps = commonProps as JSX.IntrinsicElements['a'];\n anchorProps.href = tab.href;\n trigger = <a {...anchorProps} />;\n } else {\n const buttonProps = commonProps as JSX.IntrinsicElements['button'];\n buttonProps.type = 'button';\n if (tab.disabled) {\n buttonProps.disabled = true;\n }\n trigger = <button {...buttonProps} />;\n }\n\n return (\n <li\n ref={element => tabRefs.current.set(tab.id, element as HTMLElement)}\n className={styles['tabs-tab']}\n role=\"presentation\"\n key={tab.id}\n >\n {trigger}\n </li>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"tab-header-bar.js","sourceRoot":"","sources":["../../../src/tabs/tab-header-bar.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,C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AAC;AACH,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef, useState, useEffect } from 'react';\nimport { TabsProps } from './interfaces';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { InternalButton } from '../button/internal';\nimport useFocusVisible from '../internal/hooks/focus-visible';\nimport { useContainerQuery } from '../internal/hooks/container-queries';\nimport { KeyCode } from '../internal/keycode';\nimport {\n onPaginationClick,\n hasHorizontalOverflow,\n hasLeftOverflow,\n hasRightOverflow,\n scrollIntoView,\n} from './scroll-utils';\nimport { isPlainLeftClick } from '../internal/events';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\n\nexport interface TabHeaderBarProps {\n onChange: (changeDetail: TabsProps.ChangeDetail) => void;\n activeTabId: TabsProps['activeTabId'];\n tabs: TabsProps['tabs'];\n variant: TabsProps['variant'];\n idNamespace: string;\n ariaLabel?: string;\n ariaLabelledby?: string;\n}\n\nexport function TabHeaderBar({\n onChange,\n activeTabId,\n tabs,\n variant,\n idNamespace,\n ariaLabel,\n ariaLabelledby,\n}: TabHeaderBarProps) {\n const focusVisible = useFocusVisible();\n\n const headerBarRef = useRef<HTMLUListElement>(null);\n const activeTabHeaderRef = useRef<HTMLAnchorElement>(null);\n const leftOverflowButton = useRef<HTMLElement>(null);\n\n const isVisualRefresh = useVisualRefresh(headerBarRef);\n\n const [widthChange, containerRef] = useContainerQuery<number>(rect => rect.width);\n const tabRefs = useRef<Map<string, HTMLElement>>(new Map());\n const [horizontalOverflow, setHorizontalOverflow] = useState(false);\n const [leftOverflow, setLeftOverflow] = useState(false);\n const [rightOverflow, setRightOverflow] = useState(false);\n\n useEffect(() => {\n if (headerBarRef.current) {\n setHorizontalOverflow(hasHorizontalOverflow(headerBarRef.current, leftOverflowButton));\n setLeftOverflow(hasLeftOverflow(headerBarRef.current));\n setRightOverflow(hasRightOverflow(headerBarRef.current));\n }\n }, [widthChange, tabs]);\n\n const scrollIntoViewIfPossible = (smooth: boolean) => {\n if (!activeTabId) {\n return;\n }\n const activeTabRef = tabRefs.current.get(activeTabId);\n if (activeTabRef && headerBarRef.current) {\n scrollIntoView(activeTabRef, headerBarRef.current, smooth);\n }\n };\n\n useEffect(() => {\n // Delay scrollIntoView as the position is depending on parent elements\n // (effects are called inside-out in the component tree).\n // Wait one frame to allow parents to complete it's calculation.\n requestAnimationFrame(() => {\n scrollIntoViewIfPossible(false);\n });\n // Non-smooth scrolling should not be called upon activeId change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [horizontalOverflow, widthChange, tabs.length]);\n\n useEffect(() => {\n scrollIntoViewIfPossible(true);\n // Smooth scrolling should only be called upon activeId change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeTabId]);\n\n useEffect(() => {\n /*\n When the selected tab changes and we are currently already focused on a tab,\n move the focus to the newly selected tab.\n */\n if (headerBarRef.current?.contains(document.activeElement)) {\n if (document.activeElement !== activeTabHeaderRef.current) {\n activeTabHeaderRef.current?.focus({ preventScroll: true });\n }\n }\n }, [activeTabId]);\n\n const onScroll = () => {\n if (headerBarRef.current) {\n setLeftOverflow(hasLeftOverflow(headerBarRef.current));\n setRightOverflow(hasRightOverflow(headerBarRef.current));\n }\n };\n\n const classes = clsx({\n [styles['tabs-header']]: true,\n [styles['tabs-header-with-divider']]: variant === 'default' || isVisualRefresh,\n });\n\n const leftButtonClasses = clsx({\n [styles['pagination-button']]: true,\n [styles['pagination-button-left']]: true,\n [styles['pagination-button-left-scrollable']]: leftOverflow,\n });\n\n const rightButtonClasses = clsx({\n [styles['pagination-button']]: true,\n [styles['pagination-button-right']]: true,\n [styles['pagination-button-right-scrollable']]: rightOverflow,\n });\n\n const paginationButtonAttributes = {\n 'aria-hidden': true,\n tabIndex: -1,\n };\n\n return (\n //converted span to div as list should not be a child of span for HTML validation\n <div className={classes} ref={containerRef}>\n {horizontalOverflow && (\n <span ref={leftOverflowButton} className={leftButtonClasses}>\n <InternalButton\n variant=\"icon\"\n iconName=\"angle-left\"\n __nativeAttributes={paginationButtonAttributes}\n disabled={!leftOverflow}\n onClick={() => onPaginationClick(headerBarRef, -1)}\n />\n </span>\n )}\n <ul\n role=\"tablist\"\n className={styles['tabs-header-list']}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n ref={headerBarRef}\n onScroll={onScroll}\n >\n {tabs.map(renderTabHeader)}\n </ul>\n {horizontalOverflow && (\n <span className={rightButtonClasses}>\n <InternalButton\n variant=\"icon\"\n iconName=\"angle-right\"\n __nativeAttributes={paginationButtonAttributes}\n disabled={!rightOverflow}\n onClick={() => onPaginationClick(headerBarRef, 1)}\n />\n </span>\n )}\n </div>\n );\n\n function renderTabHeader(tab: TabsProps.Tab) {\n const enabledTabsWithCurrentTab = tabs.filter(tab => !tab.disabled || tab.id === activeTabId);\n\n const highlightTab = function (enabledTabIndex: number) {\n const tab = enabledTabsWithCurrentTab[enabledTabIndex];\n if (tab.id === activeTabId) {\n return;\n }\n\n onChange({ activeTabId: tab.id, activeTabHref: tab.href });\n };\n\n const handleKeyDown = function (\n event: React.KeyboardEvent<HTMLAnchorElement> | React.KeyboardEvent<HTMLButtonElement>\n ) {\n const { keyCode } = event;\n const specialKeys = [KeyCode.right, KeyCode.left, KeyCode.end, KeyCode.home, KeyCode.pageUp, KeyCode.pageDown];\n if (specialKeys.indexOf(keyCode) === -1) {\n return;\n }\n event.preventDefault();\n const activeIndex = enabledTabsWithCurrentTab.indexOf(tab);\n switch (keyCode) {\n case KeyCode.right:\n if (activeIndex + 1 === enabledTabsWithCurrentTab.length) {\n highlightTab(0);\n } else {\n highlightTab(activeIndex + 1);\n }\n return;\n case KeyCode.left:\n if (activeIndex === 0) {\n highlightTab(enabledTabsWithCurrentTab.length - 1);\n } else {\n highlightTab(activeIndex - 1);\n }\n return;\n case KeyCode.end:\n highlightTab(enabledTabsWithCurrentTab.length - 1);\n return;\n case KeyCode.home:\n highlightTab(0);\n return;\n case KeyCode.pageDown:\n if (rightOverflow) {\n onPaginationClick(headerBarRef, 1);\n }\n return;\n case KeyCode.pageUp:\n if (leftOverflow) {\n onPaginationClick(headerBarRef, -1);\n }\n return;\n }\n };\n\n const clickTab = (event: React.MouseEvent) => {\n if (tab.disabled) {\n event.preventDefault();\n return;\n }\n\n // if the primary mouse button is clicked with a modifier key, the browser will handle opening a new tab\n const specialKey = !isPlainLeftClick(event);\n if (specialKey && tab.href) {\n return;\n }\n\n event.preventDefault();\n // for browsers that do not focus buttons on button click\n if (!tab.href) {\n const clickedTabRef = tabRefs.current.get(tab.id);\n if (clickedTabRef) {\n const childElement = clickedTabRef.firstChild as HTMLButtonElement;\n if (childElement && childElement !== document.activeElement) {\n childElement.focus({ preventScroll: true });\n }\n }\n }\n\n if (tab.id === activeTabId) {\n return;\n }\n\n onChange({ activeTabId: tab.id, activeTabHref: tab.href });\n };\n\n const classes = clsx({\n [styles['tabs-tab-link']]: true,\n [styles.refresh]: isVisualRefresh,\n [styles['tabs-tab-active']]: activeTabId === tab.id && !tab.disabled,\n [styles['tabs-tab-disabled']]: tab.disabled,\n });\n\n const commonProps: (JSX.IntrinsicElements['a'] | JSX.IntrinsicElements['button']) & { 'data-testid': string } = {\n className: classes,\n ...focusVisible,\n role: 'tab',\n 'aria-selected': tab.id === activeTabId,\n 'aria-controls': `${idNamespace}-${tab.id}-panel`,\n 'data-testid': tab.id,\n children: <span className={styles['tabs-tab-label']}>{tab.label}</span>,\n };\n\n if (tab.disabled) {\n commonProps['aria-disabled'] = 'true';\n } else {\n commonProps.onClick = clickTab;\n }\n\n if (tab.id === activeTabId) {\n commonProps.ref = activeTabHeaderRef;\n commonProps.tabIndex = 0;\n commonProps.onKeyDown = (\n event: React.KeyboardEvent<HTMLAnchorElement> | React.KeyboardEvent<HTMLButtonElement>\n ) => handleKeyDown(event);\n } else {\n commonProps.tabIndex = -1;\n }\n\n let trigger = null;\n if (tab.href) {\n const anchorProps = commonProps as JSX.IntrinsicElements['a'];\n anchorProps.href = tab.href;\n trigger = <a {...anchorProps} />;\n } else {\n const buttonProps = commonProps as JSX.IntrinsicElements['button'];\n buttonProps.type = 'button';\n if (tab.disabled) {\n buttonProps.disabled = true;\n }\n trigger = <button {...buttonProps} />;\n }\n\n return (\n <li\n ref={element => tabRefs.current.set(tab.id, element as HTMLElement)}\n className={styles['tabs-tab']}\n role=\"presentation\"\n key={tab.id}\n >\n {trigger}\n </li>\n );\n }\n}\n"]}
@@ -2,6 +2,7 @@ import { ComponentWrapper, ElementWrapper } from '@cloudscape-design/test-utils-
2
2
  import ButtonWrapper from '../button';
3
3
  export default class SplitPanelWrapper extends ComponentWrapper {
4
4
  static rootSelector: string;
5
+ findHeader(): ElementWrapper;
5
6
  findPreferencesButton(): ButtonWrapper | null;
6
7
  findCloseButton(): ButtonWrapper | null;
7
8
  findOpenButton(): ButtonWrapper | null;
@@ -25,6 +25,9 @@ var SplitPanelWrapper = /** @class */ (function (_super) {
25
25
  function SplitPanelWrapper() {
26
26
  return _super !== null && _super.apply(this, arguments) || this;
27
27
  }
28
+ SplitPanelWrapper.prototype.findHeader = function () {
29
+ return this.find(".".concat(styles_selectors_js_1.default['header-text']));
30
+ };
28
31
  SplitPanelWrapper.prototype.findPreferencesButton = function () {
29
32
  return this.findComponent(".".concat(styles_selectors_js_1.default['preferences-button']), button_1.default);
30
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/split-panel/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,8DAA0F;AAC1F,oCAAsC;AACtC,gFAA8D;AAE9D;IAA+C,qCAAgB;IAA/D;;IAkCA,CAAC;IA/BC,iDAAqB,GAArB;QACE,OAAO,IAAI,CAAC,aAAa,CAAC,WAAI,6BAAM,CAAC,oBAAoB,CAAC,CAAE,EAAE,gBAAa,CAAC,CAAC;IAC/E,CAAC;IAED,2CAAe,GAAf;QACE,OAAO,IAA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C;IAED,2CAAe,GAAf;QACE,OAAO,IAAI,CAAC,aAAa,CAAC,WAAI,6BAAM,CAAC,cAAc,CAAC,CAAE,EAAE,gBAAa,CAAC,CAAC;IACzE,CAAC;IAED,0CAAc,GAAd;QACE,OAAO,IAAI,CAAC,aAAa,CAAC,WAAI,6BAAM,CAAC,aAAa,CAAC,CAAE,EAAE,gBAAa,CAAC,CAAC;IACxE,CAAC;IAED,sCAAU,GAAV;QACE,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAM,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACH,+CAAmB,GAAnB;QACE,OAAO,IAAI,CAAC,OAAO,CAAC,WAAI,6BAAM,CAAC,iBAAiB,CAAC,mBAAS,6BAAM,CAAC,eAAe,CAAC,MAAG,CAAC,CAAC;IACxF,CAAC;IAED;;;OAGG;IACH,6CAAiB,GAAjB;QACE,OAAO,IAAI,CAAC,OAAO,CAAC,WAAI,6BAAM,CAAC,eAAe,CAAC,mBAAS,6BAAM,CAAC,eAAe,CAAC,MAAG,CAAC,CAAC;IACtF,CAAC;IApCM,8BAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;IAqC5C,wBAAC;CAAA,AAtCD,CAA+C,sBAAgB,GAsC9D;kBAtCoB,iBAAiB"}
@@ -2,6 +2,7 @@ import { ComponentWrapper, ElementWrapper } from "@cloudscape-design/test-utils-
2
2
  import ButtonWrapper from '../button';
3
3
  export default class SplitPanelWrapper extends ComponentWrapper {
4
4
  static rootSelector: string;
5
+ findHeader(): ElementWrapper;
5
6
  findPreferencesButton(): ButtonWrapper;
6
7
  findCloseButton(): ButtonWrapper;
7
8
  findOpenButton(): ButtonWrapper;
@@ -25,6 +25,9 @@ var SplitPanelWrapper = /** @class */ (function (_super) {
25
25
  function SplitPanelWrapper() {
26
26
  return _super !== null && _super.apply(this, arguments) || this;
27
27
  }
28
+ SplitPanelWrapper.prototype.findHeader = function () {
29
+ return this.find(".".concat(styles_selectors_js_1.default['header-text']));
30
+ };
28
31
  SplitPanelWrapper.prototype.findPreferencesButton = function () {
29
32
  return this.findComponent(".".concat(styles_selectors_js_1.default['preferences-button']), button_1.default);
30
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/split-panel/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,0EAAgG;AAChG,oCAAsC;AACtC,gFAA8D;AAC9D;IAA+C,qCAAgB;IAA/D;;IAqCA,CAAC;IAlCC,iDAAqB,GAArB;QACE,OAAO,IAAI,CAAC,aAAa,CAAC,WAAI,6BAAM,CAAC,oBAAoB,CAAC,CAAE,EAAE,gBAAa,CAAC,CAAC;IAC/E,CAAC;IAED,2CAAe,GAAf;QACE,OAAO,IAAI,CAAC,aAAa,CAAC,WAAI,6BAAM,CAAC,cAAc,CAAC,CAAE,EAAE,gBAAa,CAAC,CAAC;IACzE,CAAC;IAED,0CAAc,GAAd;QACE,OAAO,IAAI,CAAC,aAAa,CAAC,WAAI,6BAAM,CAAC,aAAa,CAAC,CAAE,EAAE,gBAAa,CAAC,CAAC;IACxE,CAAC;IAED,sCAAU,GAAV;QACE,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAM,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IACD;;;OAGG;IAGH,+CAAmB,GAAnB;QACE,OAAO,IAAI,CAAC,OAAO,CAAC,WAAI,6BAAM,CAAC,iBAAiB,CAAC,mBAAS,6BAAM,CAAC,eAAe,CAAC,MAAG,CAAC,CAAC;IACxF,CAAC;IACD;;;OAGG;IAGH,6CAAiB,GAAjB;QACE,OAAO,IAAI,CAAC,OAAO,CAAC,WAAI,6BAAM,CAAC,eAAe,CAAC,mBAAS,6BAAM,CAAC,eAAe,CAAC,MAAG,CAAC,CAAC;IACtF,CAAC;IAlCM,8BAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;IAoC5C,wBAAC;CAAA,AArCD,CAA+C,4BAAgB,GAqC9D;kBArCoB,iBAAiB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/split-panel/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,0EAAgG;AAChG,oCAAsC;AACtC,gFAA8D;AAC9D;IAA+C,qCAAgB;IAA/D;;IAyCA,CAAC;IAtCC,sCAAU,GAAV;QACE,OAAO,IAAI,CAAC,IAAI,CAAC,WAAI,6BAAM,CAAC,aAAa,CAAC,CAAE,CAAE,CAAC;IACjD,CAAC;IAED,iDAAqB,GAArB;QACE,OAAO,IAAI,CAAC,aAAa,CAAC,WAAI,6BAAM,CAAC,oBAAoB,CAAC,CAAE,EAAE,gBAAa,CAAC,CAAC;IAC/E,CAAC;IAED,2CAAe,GAAf;QACE,OAAO,IAAI,CAAC,aAAa,CAAC,WAAI,6BAAM,CAAC,cAAc,CAAC,CAAE,EAAE,gBAAa,CAAC,CAAC;IACzE,CAAC;IAED,0CAAc,GAAd;QACE,OAAO,IAAI,CAAC,aAAa,CAAC,WAAI,6BAAM,CAAC,aAAa,CAAC,CAAE,EAAE,gBAAa,CAAC,CAAC;IACxE,CAAC;IAED,sCAAU,GAAV;QACE,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAM,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IACD;;;OAGG;IAGH,+CAAmB,GAAnB;QACE,OAAO,IAAI,CAAC,OAAO,CAAC,WAAI,6BAAM,CAAC,iBAAiB,CAAC,mBAAS,6BAAM,CAAC,eAAe,CAAC,MAAG,CAAC,CAAC;IACxF,CAAC;IACD;;;OAGG;IAGH,6CAAiB,GAAjB;QACE,OAAO,IAAI,CAAC,OAAO,CAAC,WAAI,6BAAM,CAAC,eAAe,CAAC,mBAAS,6BAAM,CAAC,eAAe,CAAC,MAAG,CAAC,CAAC;IACtF,CAAC;IAtCM,8BAAY,GAAW,6BAAM,CAAC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