@cloudscape-design/components 3.0.71 → 3.0.73

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 (139) hide show
  1. package/app-layout/toggles/index.d.ts.map +1 -1
  2. package/app-layout/toggles/index.js +2 -2
  3. package/app-layout/toggles/index.js.map +1 -1
  4. package/app-layout/visual-refresh/app-bar.d.ts.map +1 -1
  5. package/app-layout/visual-refresh/app-bar.js +2 -2
  6. package/app-layout/visual-refresh/app-bar.js.map +1 -1
  7. package/app-layout/visual-refresh/navigation.d.ts.map +1 -1
  8. package/app-layout/visual-refresh/navigation.js +1 -1
  9. package/app-layout/visual-refresh/navigation.js.map +1 -1
  10. package/app-layout/visual-refresh/tools.d.ts.map +1 -1
  11. package/app-layout/visual-refresh/tools.js +1 -1
  12. package/app-layout/visual-refresh/tools.js.map +1 -1
  13. package/app-layout/visual-refresh/trigger-button.d.ts.map +1 -1
  14. package/app-layout/visual-refresh/trigger-button.js +1 -1
  15. package/app-layout/visual-refresh/trigger-button.js.map +1 -1
  16. package/breadcrumb-group/item/styles.css.js +7 -7
  17. package/breadcrumb-group/item/styles.scoped.css +16 -15
  18. package/breadcrumb-group/item/styles.selectors.js +7 -7
  19. package/calendar/grid/index.d.ts +2 -2
  20. package/calendar/grid/index.d.ts.map +1 -1
  21. package/calendar/grid/index.js +64 -23
  22. package/calendar/grid/index.js.map +1 -1
  23. package/calendar/internal.d.ts.map +1 -1
  24. package/calendar/internal.js +3 -15
  25. package/calendar/internal.js.map +1 -1
  26. package/calendar/styles.css.js +18 -20
  27. package/calendar/styles.scoped.css +46 -58
  28. package/calendar/styles.selectors.js +18 -20
  29. package/date-range-picker/calendar/grids/grid.d.ts.map +1 -1
  30. package/date-range-picker/calendar/grids/grid.js +61 -6
  31. package/date-range-picker/calendar/grids/grid.js.map +1 -1
  32. package/date-range-picker/calendar/grids/index.d.ts.map +1 -1
  33. package/date-range-picker/calendar/grids/index.js +1 -0
  34. package/date-range-picker/calendar/grids/index.js.map +1 -1
  35. package/date-range-picker/calendar/grids/styles.css.js +26 -0
  36. package/date-range-picker/calendar/grids/{day/styles.scoped.css → styles.scoped.css} +38 -38
  37. package/date-range-picker/calendar/grids/styles.selectors.js +27 -0
  38. package/date-range-picker/index.js +2 -2
  39. package/date-range-picker/index.js.map +1 -1
  40. package/date-range-picker/styles.css.js +41 -40
  41. package/date-range-picker/styles.scoped.css +56 -48
  42. package/date-range-picker/styles.selectors.js +41 -40
  43. package/expandable-section/expandable-section-header.d.ts +3 -2
  44. package/expandable-section/expandable-section-header.d.ts.map +1 -1
  45. package/expandable-section/expandable-section-header.js +3 -3
  46. package/expandable-section/expandable-section-header.js.map +1 -1
  47. package/expandable-section/interfaces.d.ts +5 -0
  48. package/expandable-section/interfaces.d.ts.map +1 -1
  49. package/expandable-section/interfaces.js.map +1 -1
  50. package/expandable-section/internal.d.ts +1 -1
  51. package/expandable-section/internal.d.ts.map +1 -1
  52. package/expandable-section/internal.js +4 -3
  53. package/expandable-section/internal.js.map +1 -1
  54. package/internal/components/dropdown-status/index.d.ts +3 -1
  55. package/internal/components/dropdown-status/index.d.ts.map +1 -1
  56. package/internal/components/dropdown-status/index.js +7 -4
  57. package/internal/components/dropdown-status/index.js.map +1 -1
  58. package/internal/components/live-region/index.d.ts.map +1 -1
  59. package/internal/components/live-region/index.js +1 -0
  60. package/internal/components/live-region/index.js.map +1 -1
  61. package/internal/environment.js +1 -1
  62. package/modal/internal.d.ts.map +1 -1
  63. package/modal/internal.js +6 -10
  64. package/modal/internal.js.map +1 -1
  65. package/multiselect/internal.d.ts.map +1 -1
  66. package/multiselect/internal.js +3 -2
  67. package/multiselect/internal.js.map +1 -1
  68. package/package.json +1 -1
  69. package/property-filter/controller.d.ts +2 -0
  70. package/property-filter/controller.d.ts.map +1 -1
  71. package/property-filter/controller.js +37 -0
  72. package/property-filter/controller.js.map +1 -1
  73. package/property-filter/index.d.ts.map +1 -1
  74. package/property-filter/index.js +25 -7
  75. package/property-filter/index.js.map +1 -1
  76. package/property-filter/interfaces.d.ts +9 -2
  77. package/property-filter/interfaces.d.ts.map +1 -1
  78. package/property-filter/interfaces.js +2 -0
  79. package/property-filter/interfaces.js.map +1 -1
  80. package/property-filter/property-editor.d.ts +13 -0
  81. package/property-filter/property-editor.d.ts.map +1 -0
  82. package/property-filter/property-editor.js +18 -0
  83. package/property-filter/property-editor.js.map +1 -0
  84. package/property-filter/property-filter-autosuggest.d.ts +1 -0
  85. package/property-filter/property-filter-autosuggest.d.ts.map +1 -1
  86. package/property-filter/property-filter-autosuggest.js +17 -3
  87. package/property-filter/property-filter-autosuggest.js.map +1 -1
  88. package/property-filter/styles.css.js +32 -24
  89. package/property-filter/styles.scoped.css +45 -27
  90. package/property-filter/styles.selectors.js +32 -24
  91. package/property-filter/token-editor.d.ts.map +1 -1
  92. package/property-filter/token-editor.js +17 -4
  93. package/property-filter/token-editor.js.map +1 -1
  94. package/property-filter/token.d.ts.map +1 -1
  95. package/property-filter/token.js +6 -3
  96. package/property-filter/token.js.map +1 -1
  97. package/select/internal.d.ts.map +1 -1
  98. package/select/internal.js +3 -2
  99. package/select/internal.js.map +1 -1
  100. package/select/parts/filter.d.ts +1 -1
  101. package/select/utils/use-select.d.ts +15 -1
  102. package/select/utils/use-select.d.ts.map +1 -1
  103. package/select/utils/use-select.js +11 -1
  104. package/select/utils/use-select.js.map +1 -1
  105. package/split-panel/index.d.ts.map +1 -1
  106. package/split-panel/index.js +8 -6
  107. package/split-panel/index.js.map +1 -1
  108. package/split-panel/interfaces.d.ts +1 -0
  109. package/split-panel/interfaces.d.ts.map +1 -1
  110. package/split-panel/interfaces.js.map +1 -1
  111. package/split-panel/utils/use-pointer-events.d.ts +1 -1
  112. package/split-panel/utils/use-pointer-events.d.ts.map +1 -1
  113. package/split-panel/utils/use-pointer-events.js +9 -5
  114. package/split-panel/utils/use-pointer-events.js.map +1 -1
  115. package/table/internal.d.ts.map +1 -1
  116. package/table/internal.js +8 -1
  117. package/table/internal.js.map +1 -1
  118. package/table/use-mouse-down-target.d.ts +6 -0
  119. package/table/use-mouse-down-target.d.ts.map +1 -0
  120. package/table/use-mouse-down-target.js +30 -0
  121. package/table/use-mouse-down-target.js.map +1 -0
  122. package/tabs/styles.css.js +21 -21
  123. package/tabs/styles.scoped.css +38 -37
  124. package/tabs/styles.selectors.js +21 -21
  125. package/test-utils/dom/date-range-picker/index.js +1 -1
  126. package/test-utils/dom/date-range-picker/index.js.map +1 -1
  127. package/test-utils/selectors/date-range-picker/index.js +1 -1
  128. package/test-utils/selectors/date-range-picker/index.js.map +1 -1
  129. package/test-utils/tsconfig.tsbuildinfo +1 -1
  130. package/calendar/grid/day/index.d.ts +0 -15
  131. package/calendar/grid/day/index.d.ts.map +0 -1
  132. package/calendar/grid/day/index.js +0 -47
  133. package/calendar/grid/day/index.js.map +0 -1
  134. package/date-range-picker/calendar/grids/day/index.d.ts +0 -27
  135. package/date-range-picker/calendar/grids/day/index.d.ts.map +0 -1
  136. package/date-range-picker/calendar/grids/day/index.js +0 -95
  137. package/date-range-picker/calendar/grids/day/index.js.map +0 -1
  138. package/date-range-picker/calendar/grids/day/styles.css.js +0 -26
  139. package/date-range-picker/calendar/grids/day/styles.selectors.js +0 -27
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/property-filter/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO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C","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef, useState, useMemo, useImperativeHandle } from 'react';\n\nimport InternalSpaceBetween from '../space-between/internal';\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { KeyCode } from '../internal/keycode';\nimport SelectToggle from '../token-group/toggle';\nimport { generateUniqueId } from '../internal/hooks/use-unique-id/index';\nimport { fireNonCancelableEvent } from '../internal/events';\n\nimport { PropertyFilterProps, ParsedText, Ref, FilteringProperty, ComparisonOperator, Token } from './interfaces';\nimport { TokenButton } from './token';\nimport { getQueryActions, parseText, getAutosuggestOptions, getAllowedOperators } from './controller';\nimport { useLoadItems } from './use-load-items';\nimport styles from './styles.css.js';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport PropertyFilterAutosuggest, { PropertyFilterAutosuggestProps } from './property-filter-autosuggest';\nimport { AutosuggestInputRef } from '../internal/components/autosuggest-input';\n\nexport { PropertyFilterProps };\n\nconst PropertyFilter = React.forwardRef(\n (\n {\n disabled,\n i18nStrings,\n countText,\n query,\n hideOperations,\n onChange,\n filteringProperties,\n filteringOptions = [],\n customGroupsText = [],\n disableFreeTextFiltering = false,\n onLoadItems,\n virtualScroll,\n customControl,\n filteringEmpty,\n filteringLoadingText,\n filteringFinishedText,\n filteringErrorText,\n filteringRecoveryText,\n filteringStatusType,\n asyncProperties,\n tokenLimit,\n expandToViewport,\n ...rest\n }: PropertyFilterProps,\n ref: React.Ref<Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('PropertyFilter');\n const inputRef = useRef<AutosuggestInputRef>(null);\n const baseProps = getBaseProps(rest);\n useImperativeHandle(ref, () => ({ focus: () => inputRef.current?.focus() }), []);\n const { tokens, operation } = query;\n const showResults = tokens?.length && !disabled;\n const { addToken, removeToken, setToken, setOperation, removeAllTokens } = getQueryActions(\n query,\n onChange,\n inputRef\n );\n const [filteringText, setFilteringText] = useState<string>('');\n const parsedText = parseText(filteringText, filteringProperties, disableFreeTextFiltering);\n const autosuggestOptions = getAutosuggestOptions(\n parsedText,\n filteringOptions,\n filteringProperties,\n customGroupsText,\n i18nStrings\n );\n\n const createToken = (currentText: string) => {\n const parsedText = parseText(currentText, filteringProperties, disableFreeTextFiltering);\n let newToken: Token;\n switch (parsedText.step) {\n case 'property': {\n newToken = {\n propertyKey: parsedText.property.key,\n operator: parsedText.operator,\n value: parsedText.value,\n };\n break;\n }\n case 'free-text': {\n newToken = {\n operator: parsedText.operator || ':',\n value: parsedText.value,\n };\n break;\n }\n case 'operator': {\n newToken = {\n operator: ':',\n value: currentText,\n };\n break;\n }\n }\n if (disableFreeTextFiltering && !('propertyKey' in newToken)) {\n return;\n }\n addToken(newToken);\n setFilteringText('');\n };\n const ignoreKeyDown = useRef<boolean>(false);\n const handleKeyDown: PropertyFilterAutosuggestProps['onKeyDown'] = event => {\n if (filteringText && !ignoreKeyDown.current && event.detail.keyCode === KeyCode.enter) {\n createToken(filteringText);\n }\n };\n const getLoadMoreDetail = (parsedText: ParsedText, filteringText: string) => {\n const loadMoreDetail: {\n filteringProperty: FilteringProperty | undefined;\n filteringText: string;\n filteringOperator: ComparisonOperator | undefined;\n } = {\n filteringProperty: undefined,\n filteringText,\n filteringOperator: undefined,\n };\n if (parsedText.step === 'property') {\n loadMoreDetail.filteringProperty = parsedText.property;\n loadMoreDetail.filteringText = parsedText.value;\n loadMoreDetail.filteringOperator = parsedText.operator;\n }\n return loadMoreDetail;\n };\n const loadMoreDetail = getLoadMoreDetail(parsedText, filteringText);\n const inputLoadItemsHandlers = useLoadItems(\n onLoadItems,\n loadMoreDetail.filteringText,\n loadMoreDetail.filteringProperty,\n loadMoreDetail.filteringText,\n loadMoreDetail.filteringOperator\n );\n const asyncProps = {\n empty: filteringEmpty,\n loadingText: filteringLoadingText,\n finishedText: filteringFinishedText,\n errorText: filteringErrorText,\n recoveryText: filteringRecoveryText,\n statusType: filteringStatusType,\n };\n const asyncAutosuggestProps =\n !!filteringText.length || asyncProperties\n ? {\n ...inputLoadItemsHandlers,\n ...asyncProps,\n }\n : {};\n const handleSelected: PropertyFilterAutosuggestProps['onOptionClick'] = event => {\n // The ignoreKeyDown flag makes sure `createToken` routine runs only once. Autosuggest's `onKeyDown` fires,\n // when an item is selected from the list using \"enter\" key.\n ignoreKeyDown.current = true;\n setTimeout(() => {\n ignoreKeyDown.current = false;\n }, 0);\n const { detail: option } = event;\n const value = option.value || '';\n if ('tokenValue' in option) {\n createToken((option as { tokenValue: string }).tokenValue);\n return;\n }\n // create a token from the 'use' option\n if (!('keepOpenOnSelect' in option)) {\n createToken(value);\n return;\n }\n\n // stop dropdown from closing\n event.preventDefault();\n const parsedText = parseText(value, filteringProperties, disableFreeTextFiltering);\n const loadMoreDetail = getLoadMoreDetail(parsedText, value);\n fireNonCancelableEvent(onLoadItems, { ...loadMoreDetail, firstPage: true, samePage: false });\n\n // Insert operator automatically if only one operator is defined for the given property.\n if (parsedText.step === 'operator') {\n const operators = getAllowedOperators(parsedText.property);\n if (value.trim() === parsedText.property.propertyLabel && operators.length === 1) {\n setFilteringText(parsedText.property.propertyLabel + ' ' + operators[0] + ' ');\n }\n }\n };\n const [tokensExpanded, setTokensExpanded] = useState(false);\n const toggleExpandedTokens = () => setTokensExpanded(!tokensExpanded);\n const hasHiddenOptions = tokenLimit !== undefined && tokens.length > tokenLimit;\n const slicedTokens = hasHiddenOptions && !tokensExpanded ? tokens.slice(0, tokenLimit) : tokens;\n const controlId = useMemo(() => generateUniqueId(), []);\n return (\n <span {...baseProps} className={clsx(baseProps.className, styles.root)} ref={__internalRootRef}>\n <div className={styles['search-field']}>\n {customControl && <div className={styles['custom-control']}>{customControl}</div>}\n <PropertyFilterAutosuggest\n ref={inputRef}\n virtualScroll={virtualScroll}\n enteredTextLabel={i18nStrings.enteredTextLabel}\n ariaLabel={i18nStrings.filteringAriaLabel}\n placeholder={i18nStrings.filteringPlaceholder}\n value={filteringText}\n disabled={disabled}\n onKeyDown={handleKeyDown}\n {...autosuggestOptions}\n onChange={event => setFilteringText(event.detail.value)}\n empty={filteringEmpty}\n {...asyncAutosuggestProps}\n expandToViewport={expandToViewport}\n onOptionClick={handleSelected}\n hideEnteredTextOption={disableFreeTextFiltering && parsedText.step !== 'property'}\n />\n <span\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className={clsx(styles.results, showResults && styles['results-visible'])}\n >\n {showResults ? countText : ''}\n </span>\n </div>\n {tokens && tokens.length > 0 && (\n <div className={styles.tokens}>\n <InternalSpaceBetween size=\"xs\" direction=\"horizontal\" id={controlId}>\n {slicedTokens.map((token, index) => (\n <TokenButton\n token={token}\n first={index === 0}\n operation={operation}\n key={index}\n removeToken={() => removeToken(index)}\n setToken={(newToken: Token) => setToken(index, newToken)}\n setOperation={setOperation}\n filteringOptions={filteringOptions}\n filteringProperties={filteringProperties}\n asyncProps={asyncProps}\n onLoadItems={onLoadItems}\n i18nStrings={i18nStrings}\n asyncProperties={asyncProperties}\n hideOperations={hideOperations}\n customGroupsText={customGroupsText}\n disableFreeTextFiltering={disableFreeTextFiltering}\n disabled={disabled}\n expandToViewport={expandToViewport}\n />\n ))}\n {hasHiddenOptions && (\n <div className={styles['toggle-collapsed']}>\n <SelectToggle\n controlId={controlId}\n allHidden={tokenLimit === 0}\n expanded={tokensExpanded}\n numberOfHiddenOptions={tokens.length - slicedTokens.length}\n i18nStrings={{\n limitShowFewer: i18nStrings.tokenLimitShowFewer,\n limitShowMore: i18nStrings.tokenLimitShowMore,\n }}\n onClick={toggleExpandedTokens}\n />\n </div>\n )}\n <div className={styles.separator} />\n <InternalButton onClick={removeAllTokens} className={styles['remove-all']} disabled={disabled}>\n {i18nStrings.clearFiltersText}\n </InternalButton>\n </InternalSpaceBetween>\n </div>\n )}\n </span>\n );\n }\n);\n\napplyDisplayName(PropertyFilter, 'PropertyFilter');\nexport default PropertyFilter;\n"]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E,oBAAoB,GAC7B,CACE,CACP;gBACD,6BAAK,SAAS,EAAE,MAAM,CAAC,SAAS,GAAI;gBACpC,oBAAC,cAAc,IAAC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,QAAQ,IAC1F,WAAW,CAAC,gBAAgB,CACd,CACI,CACnB,CACP,CACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AACnD,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef, useState, useMemo, useImperativeHandle } from 'react';\n\nimport InternalSpaceBetween from '../space-between/internal';\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { KeyCode } from '../internal/keycode';\nimport SelectToggle from '../token-group/toggle';\nimport { generateUniqueId } from '../internal/hooks/use-unique-id/index';\nimport { fireNonCancelableEvent } from '../internal/events';\n\nimport { PropertyFilterProps, ParsedText, Ref, FilteringProperty, ComparisonOperator, Token } from './interfaces';\nimport { TokenButton } from './token';\nimport {\n getQueryActions,\n parseText,\n getAutosuggestOptions,\n getAllowedOperators,\n getExtendedOperator,\n} from './controller';\nimport { useLoadItems } from './use-load-items';\nimport styles from './styles.css.js';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport PropertyFilterAutosuggest, { PropertyFilterAutosuggestProps } from './property-filter-autosuggest';\nimport { PropertyEditor } from './property-editor';\nimport { AutosuggestInputRef } from '../internal/components/autosuggest-input';\n\nexport { PropertyFilterProps };\n\nconst PropertyFilter = React.forwardRef(\n (\n {\n disabled,\n i18nStrings,\n countText,\n query,\n hideOperations,\n onChange,\n filteringProperties,\n filteringOptions = [],\n customGroupsText = [],\n disableFreeTextFiltering = false,\n onLoadItems,\n virtualScroll,\n customControl,\n filteringEmpty,\n filteringLoadingText,\n filteringFinishedText,\n filteringErrorText,\n filteringRecoveryText,\n filteringStatusType,\n asyncProperties,\n tokenLimit,\n expandToViewport,\n ...rest\n }: PropertyFilterProps,\n ref: React.Ref<Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('PropertyFilter');\n const inputRef = useRef<AutosuggestInputRef>(null);\n const baseProps = getBaseProps(rest);\n useImperativeHandle(ref, () => ({ focus: () => inputRef.current?.focus() }), []);\n const { tokens, operation } = query;\n const showResults = tokens?.length && !disabled;\n const { addToken, removeToken, setToken, setOperation, removeAllTokens } = getQueryActions(\n query,\n onChange,\n inputRef\n );\n const [filteringText, setFilteringText] = useState<string>('');\n const parsedText = parseText(filteringText, filteringProperties, disableFreeTextFiltering);\n const autosuggestOptions = getAutosuggestOptions(\n parsedText,\n filteringOptions,\n filteringProperties,\n customGroupsText,\n i18nStrings\n );\n\n const createToken = (currentText: string) => {\n const parsedText = parseText(currentText, filteringProperties, disableFreeTextFiltering);\n let newToken: Token;\n switch (parsedText.step) {\n case 'property': {\n newToken = {\n propertyKey: parsedText.property.key,\n operator: parsedText.operator,\n value: parsedText.value,\n };\n break;\n }\n case 'free-text': {\n newToken = {\n operator: parsedText.operator || ':',\n value: parsedText.value,\n };\n break;\n }\n case 'operator': {\n newToken = {\n operator: ':',\n value: currentText,\n };\n break;\n }\n }\n if (disableFreeTextFiltering && !('propertyKey' in newToken)) {\n return;\n }\n addToken(newToken);\n setFilteringText('');\n };\n const ignoreKeyDown = useRef<boolean>(false);\n const handleKeyDown: PropertyFilterAutosuggestProps['onKeyDown'] = event => {\n if (filteringText && !ignoreKeyDown.current && event.detail.keyCode === KeyCode.enter) {\n createToken(filteringText);\n }\n };\n const getLoadMoreDetail = (parsedText: ParsedText, filteringText: string) => {\n const loadMoreDetail: {\n filteringProperty: FilteringProperty | undefined;\n filteringText: string;\n filteringOperator: ComparisonOperator | undefined;\n } = {\n filteringProperty: undefined,\n filteringText,\n filteringOperator: undefined,\n };\n if (parsedText.step === 'property') {\n loadMoreDetail.filteringProperty = parsedText.property;\n loadMoreDetail.filteringText = parsedText.value;\n loadMoreDetail.filteringOperator = parsedText.operator;\n }\n return loadMoreDetail;\n };\n const loadMoreDetail = getLoadMoreDetail(parsedText, filteringText);\n const inputLoadItemsHandlers = useLoadItems(\n onLoadItems,\n loadMoreDetail.filteringText,\n loadMoreDetail.filteringProperty,\n loadMoreDetail.filteringText,\n loadMoreDetail.filteringOperator\n );\n const asyncProps = {\n empty: filteringEmpty,\n loadingText: filteringLoadingText,\n finishedText: filteringFinishedText,\n errorText: filteringErrorText,\n recoveryText: filteringRecoveryText,\n statusType: filteringStatusType,\n };\n const asyncAutosuggestProps =\n !!filteringText.length || asyncProperties\n ? {\n ...inputLoadItemsHandlers,\n ...asyncProps,\n }\n : {};\n const handleSelected: PropertyFilterAutosuggestProps['onOptionClick'] = event => {\n // The ignoreKeyDown flag makes sure `createToken` routine runs only once. Autosuggest's `onKeyDown` fires,\n // when an item is selected from the list using \"enter\" key.\n ignoreKeyDown.current = true;\n setTimeout(() => {\n ignoreKeyDown.current = false;\n }, 0);\n const { detail: option } = event;\n const value = option.value || '';\n if ('tokenValue' in option) {\n createToken((option as { tokenValue: string }).tokenValue);\n return;\n }\n // create a token from the 'use' option\n if (!('keepOpenOnSelect' in option)) {\n createToken(value);\n return;\n }\n\n // stop dropdown from closing\n event.preventDefault();\n\n const parsedText = parseText(value, filteringProperties, disableFreeTextFiltering);\n const loadMoreDetail = getLoadMoreDetail(parsedText, value);\n\n // Insert operator automatically if only one operator is defined for the given property.\n if (parsedText.step === 'operator') {\n const operators = getAllowedOperators(parsedText.property);\n if (value.trim() === parsedText.property.propertyLabel && operators.length === 1) {\n loadMoreDetail.filteringProperty = parsedText.property;\n loadMoreDetail.filteringOperator = operators[0];\n loadMoreDetail.filteringText = '';\n setFilteringText(parsedText.property.propertyLabel + ' ' + operators[0] + ' ');\n }\n }\n\n fireNonCancelableEvent(onLoadItems, { ...loadMoreDetail, firstPage: true, samePage: false });\n };\n const [tokensExpanded, setTokensExpanded] = useState(false);\n const toggleExpandedTokens = () => setTokensExpanded(!tokensExpanded);\n const hasHiddenOptions = tokenLimit !== undefined && tokens.length > tokenLimit;\n const slicedTokens = hasHiddenOptions && !tokensExpanded ? tokens.slice(0, tokenLimit) : tokens;\n const controlId = useMemo(() => generateUniqueId(), []);\n\n const operatorForm =\n parsedText.step === 'property' &&\n getExtendedOperator(filteringProperties, parsedText.property.key, parsedText.operator)?.form;\n\n return (\n <span {...baseProps} className={clsx(baseProps.className, styles.root)} ref={__internalRootRef}>\n <div className={styles['search-field']}>\n {customControl && <div className={styles['custom-control']}>{customControl}</div>}\n <PropertyFilterAutosuggest\n ref={inputRef}\n virtualScroll={virtualScroll}\n enteredTextLabel={i18nStrings.enteredTextLabel}\n ariaLabel={i18nStrings.filteringAriaLabel}\n placeholder={i18nStrings.filteringPlaceholder}\n value={filteringText}\n disabled={disabled}\n onKeyDown={handleKeyDown}\n {...autosuggestOptions}\n onChange={event => setFilteringText(event.detail.value)}\n empty={filteringEmpty}\n {...asyncAutosuggestProps}\n expandToViewport={expandToViewport}\n onOptionClick={handleSelected}\n customForm={\n operatorForm && (\n <PropertyEditor\n property={parsedText.property}\n operator={parsedText.operator}\n filter={parsedText.value}\n operatorForm={operatorForm}\n i18nStrings={i18nStrings}\n onCancel={() => {\n setFilteringText('');\n inputRef.current?.close();\n inputRef.current?.focus({ preventDropdown: true });\n }}\n onSubmit={token => {\n addToken(token);\n setFilteringText('');\n inputRef.current?.focus({ preventDropdown: true });\n inputRef.current?.close();\n }}\n />\n )\n }\n hideEnteredTextOption={disableFreeTextFiltering && parsedText.step !== 'property'}\n />\n <span\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className={clsx(styles.results, showResults && styles['results-visible'])}\n >\n {showResults ? countText : ''}\n </span>\n </div>\n {tokens && tokens.length > 0 && (\n <div className={styles.tokens}>\n <InternalSpaceBetween size=\"xs\" direction=\"horizontal\" id={controlId}>\n {slicedTokens.map((token, index) => (\n <TokenButton\n token={token}\n first={index === 0}\n operation={operation}\n key={index}\n removeToken={() => removeToken(index)}\n setToken={(newToken: Token) => setToken(index, newToken)}\n setOperation={setOperation}\n filteringOptions={filteringOptions}\n filteringProperties={filteringProperties}\n asyncProps={asyncProps}\n onLoadItems={onLoadItems}\n i18nStrings={i18nStrings}\n asyncProperties={asyncProperties}\n hideOperations={hideOperations}\n customGroupsText={customGroupsText}\n disableFreeTextFiltering={disableFreeTextFiltering}\n disabled={disabled}\n expandToViewport={expandToViewport}\n />\n ))}\n {hasHiddenOptions && (\n <div className={styles['toggle-collapsed']}>\n <SelectToggle\n controlId={controlId}\n allHidden={tokenLimit === 0}\n expanded={tokensExpanded}\n numberOfHiddenOptions={tokens.length - slicedTokens.length}\n i18nStrings={{\n limitShowFewer: i18nStrings.tokenLimitShowFewer,\n limitShowMore: i18nStrings.tokenLimitShowMore,\n }}\n onClick={toggleExpandedTokens}\n />\n </div>\n )}\n <div className={styles.separator} />\n <InternalButton onClick={removeAllTokens} className={styles['remove-all']} disabled={disabled}>\n {i18nStrings.clearFiltersText}\n </InternalButton>\n </InternalSpaceBetween>\n </div>\n )}\n </span>\n );\n }\n);\n\napplyDisplayName(PropertyFilter, 'PropertyFilter');\nexport default PropertyFilter;\n"]}
@@ -1,9 +1,10 @@
1
+ import React from 'react';
1
2
  import { BaseComponentProps } from '../internal/base-component';
2
3
  import { NonCancelableEventHandler } from '../internal/events';
3
4
  import { DropdownStatusProps } from '../internal/components/dropdown-status';
4
5
  import { AutosuggestProps } from '../autosuggest/interfaces';
5
6
  import { ExpandToViewport } from '../internal/components/dropdown/interfaces';
6
- import { PropertyFilterOperation, PropertyFilterOperator, PropertyFilterOperatorExtended, PropertyFilterOption, PropertyFilterProperty, PropertyFilterToken } from '@cloudscape-design/collection-hooks';
7
+ import { PropertyFilterOperation, PropertyFilterOperator, PropertyFilterOperatorExtended, PropertyFilterOperatorForm, PropertyFilterOperatorFormat, PropertyFilterOperatorFormProps, PropertyFilterOption, PropertyFilterProperty, PropertyFilterToken } from '@cloudscape-design/collection-hooks';
7
8
  export interface PropertyFilterProps extends BaseComponentProps, ExpandToViewport {
8
9
  /**
9
10
  * If set to `true`, the filtering input will be disabled.
@@ -144,6 +145,9 @@ export declare namespace PropertyFilterProps {
144
145
  type JoinOperation = PropertyFilterOperation;
145
146
  type ComparisonOperator = PropertyFilterOperator;
146
147
  type ExtendedOperator<TokenValue> = PropertyFilterOperatorExtended<TokenValue>;
148
+ type ExtendedOperatorFormProps<TokenValue> = PropertyFilterOperatorFormProps<TokenValue>;
149
+ type ExtendedOperatorForm<TokenValue> = PropertyFilterOperatorForm<TokenValue>;
150
+ type ExtendedOperatorFormat<TokenValue> = PropertyFilterOperatorFormat<TokenValue>;
147
151
  type FilteringOption = PropertyFilterOption;
148
152
  type FilteringProperty = PropertyFilterProperty;
149
153
  interface Query {
@@ -210,7 +214,10 @@ export declare namespace PropertyFilterProps {
210
214
  export declare type Token = PropertyFilterProps.Token;
211
215
  export declare type JoinOperation = PropertyFilterProps.JoinOperation;
212
216
  export declare type ComparisonOperator = PropertyFilterProps.ComparisonOperator;
213
- export declare type ExtendedOperator<TokenValue> = PropertyFilterProps.ExtendedOperator<TokenValue>;
217
+ export declare type ExtendedOperator<TokenValue> = PropertyFilterOperatorExtended<TokenValue>;
218
+ export declare type ExtendedOperatorFormProps<TokenValue> = PropertyFilterOperatorFormProps<TokenValue>;
219
+ export declare type ExtendedOperatorForm<TokenValue> = PropertyFilterOperatorForm<TokenValue>;
220
+ export declare type ExtendedOperatorFormat<TokenValue> = PropertyFilterOperatorFormat<TokenValue>;
214
221
  export declare type FilteringOption = PropertyFilterProps.FilteringOption;
215
222
  export declare type FilteringProperty = PropertyFilterProps.FilteringProperty;
216
223
  export declare type Query = PropertyFilterProps.Query;
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/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EAAE,kBAAkB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC9F;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,iBAAiB,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,GACzE;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -1,2 +1,4 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
1
3
  export {};
2
4
  //# sourceMappingURL=interfaces.js.map
@@ -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';\nimport {\n PropertyFilterOperation,\n PropertyFilterOperator,\n PropertyFilterOperatorExtended,\n PropertyFilterOption,\n PropertyFilterProperty,\n PropertyFilterToken,\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 ExtendedOperator<TokenValue> = PropertyFilterOperatorExtended<TokenValue>;\n export type FilteringOption = PropertyFilterOption;\n export type FilteringProperty = PropertyFilterProperty;\n\n export interface Query {\n tokens: ReadonlyArray<PropertyFilterProps.Token>;\n operation: PropertyFilterProps.JoinOperation;\n }\n\n export interface LoadItemsDetail {\n filteringProperty?: FilteringProperty;\n filteringOperator?: ComparisonOperator;\n filteringText: string;\n firstPage: boolean;\n samePage: boolean;\n }\n\n export interface I18nStrings {\n /**\n * 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\n// Re-exported namespace interfaces to use module-style imports internally\n\nexport type Token = PropertyFilterProps.Token;\nexport type JoinOperation = PropertyFilterProps.JoinOperation;\nexport type ComparisonOperator = PropertyFilterProps.ComparisonOperator;\nexport type ExtendedOperator<TokenValue> = PropertyFilterProps.ExtendedOperator<TokenValue>;\nexport type FilteringOption = PropertyFilterProps.FilteringOption;\nexport type FilteringProperty = PropertyFilterProps.FilteringProperty;\nexport type Query = PropertyFilterProps.Query;\nexport type LoadItemsDetail = PropertyFilterProps.LoadItemsDetail;\nexport type I18nStrings = PropertyFilterProps.I18nStrings;\nexport type GroupText = PropertyFilterProps.GroupText;\nexport type FilteringChangeDetail = PropertyFilterProps.FilteringChangeDetail;\nexport type Ref = PropertyFilterProps.Ref;\n\n// Utility types\n\nexport type ParsedText =\n | { step: 'property'; property: FilteringProperty; operator: ComparisonOperator; value: string }\n | { step: 'operator'; property: FilteringProperty; 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';\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 PropertyFilterOperation,\n PropertyFilterOperator,\n PropertyFilterOperatorExtended,\n PropertyFilterOperatorForm,\n PropertyFilterOperatorFormat,\n PropertyFilterOperatorFormProps,\n PropertyFilterOption,\n PropertyFilterProperty,\n PropertyFilterToken,\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 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\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\n// Re-exported namespace interfaces to use module-style imports internally\n\nexport type Token = PropertyFilterProps.Token;\nexport type JoinOperation = PropertyFilterProps.JoinOperation;\nexport type ComparisonOperator = PropertyFilterProps.ComparisonOperator;\nexport type ExtendedOperator<TokenValue> = PropertyFilterOperatorExtended<TokenValue>;\nexport type ExtendedOperatorFormProps<TokenValue> = PropertyFilterOperatorFormProps<TokenValue>;\nexport type ExtendedOperatorForm<TokenValue> = PropertyFilterOperatorForm<TokenValue>;\nexport type ExtendedOperatorFormat<TokenValue> = PropertyFilterOperatorFormat<TokenValue>;\nexport type FilteringOption = PropertyFilterProps.FilteringOption;\nexport type FilteringProperty = PropertyFilterProps.FilteringProperty;\nexport type Query = PropertyFilterProps.Query;\nexport type LoadItemsDetail = PropertyFilterProps.LoadItemsDetail;\nexport type I18nStrings = PropertyFilterProps.I18nStrings;\nexport type GroupText = PropertyFilterProps.GroupText;\nexport type FilteringChangeDetail = PropertyFilterProps.FilteringChangeDetail;\nexport type Ref = PropertyFilterProps.Ref;\n\n// Utility types\n\nexport type ParsedText =\n | { step: 'property'; property: FilteringProperty; operator: ComparisonOperator; value: string }\n | { step: 'operator'; property: FilteringProperty; operatorPrefix: string }\n | { step: 'free-text'; operator?: ComparisonOperator; value: string };\n"]}
@@ -0,0 +1,13 @@
1
+ import { FilteringProperty, I18nStrings, Token, ExtendedOperatorForm, ComparisonOperator } from './interfaces';
2
+ interface PorpertyEditorProps<TokenValue> {
3
+ property: FilteringProperty;
4
+ operator: ComparisonOperator;
5
+ filter: string;
6
+ operatorForm: ExtendedOperatorForm<TokenValue>;
7
+ onCancel: () => void;
8
+ onSubmit: (value: Token) => void;
9
+ i18nStrings: I18nStrings;
10
+ }
11
+ export declare function PropertyEditor<TokenValue = any>({ property, operator, filter, operatorForm, onCancel, onSubmit, i18nStrings, }: PorpertyEditorProps<TokenValue>): JSX.Element;
12
+ export {};
13
+ //# sourceMappingURL=property-editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-editor.d.ts","sourceRoot":"","sources":["../../../src/property-filter/property-editor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAK/G,UAAU,mBAAmB,CAAC,UAAU;IACtC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAC/C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,cAAc,CAAC,UAAU,GAAG,GAAG,EAAE,EAC/C,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,WAAW,GACZ,EAAE,mBAAmB,CAAC,UAAU,CAAC,eAqBjC"}
@@ -0,0 +1,18 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import React, { useState } from 'react';
4
+ import styles from './styles.css.js';
5
+ import InternalButton from '../button/internal';
6
+ import InternalFormField from '../form-field/internal';
7
+ export function PropertyEditor(_a) {
8
+ var property = _a.property, operator = _a.operator, filter = _a.filter, operatorForm = _a.operatorForm, onCancel = _a.onCancel, onSubmit = _a.onSubmit, i18nStrings = _a.i18nStrings;
9
+ var _b = useState(null), value = _b[0], onChange = _b[1];
10
+ var submitToken = function () { return onSubmit({ propertyKey: property.key, operator: operator, value: value }); };
11
+ return (React.createElement("div", { className: styles['property-editor'] },
12
+ React.createElement("div", { className: styles['property-editor-form'] },
13
+ React.createElement(InternalFormField, { label: property.groupValuesLabel }, operatorForm({ value: value, onChange: onChange, operator: operator, filter: filter }))),
14
+ React.createElement("div", { className: styles['property-editor-actions'] },
15
+ React.createElement(InternalButton, { variant: "link", className: styles['property-editor-cancel'], onClick: onCancel }, i18nStrings.cancelActionText),
16
+ React.createElement(InternalButton, { className: styles['property-editor-submit'], onClick: submitToken }, i18nStrings.applyActionText))));
17
+ }
18
+ //# sourceMappingURL=property-editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-editor.js","sourceRoot":"","sources":["../../../src/property-filter/property-editor.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAYvD,MAAM,UAAU,cAAc,CAAmB,EAQf;QAPhC,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,WAAW,iBAAA;IAEL,IAAA,KAAoB,QAAQ,CAAoB,IAAI,CAAC,EAApD,KAAK,QAAA,EAAE,QAAQ,QAAqC,CAAC;IAC5D,IAAM,WAAW,GAAG,cAAM,OAAA,QAAQ,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,GAAG,EAAE,QAAQ,UAAA,EAAE,KAAK,OAAA,EAAE,CAAC,EAAxD,CAAwD,CAAC;IACnF,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC;QACvC,6BAAK,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC;YAC5C,oBAAC,iBAAiB,IAAC,KAAK,EAAE,QAAQ,CAAC,gBAAgB,IAChD,YAAY,CAAC,EAAE,KAAK,OAAA,EAAE,QAAQ,UAAA,EAAE,QAAQ,UAAA,EAAE,MAAM,QAAA,EAAE,CAAC,CAClC,CAChB;QAEN,6BAAK,SAAS,EAAE,MAAM,CAAC,yBAAyB,CAAC;YAC/C,oBAAC,cAAc,IAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAE,MAAM,CAAC,wBAAwB,CAAC,EAAE,OAAO,EAAE,QAAQ,IAC1F,WAAW,CAAC,gBAAgB,CACd;YACjB,oBAAC,cAAc,IAAC,SAAS,EAAE,MAAM,CAAC,wBAAwB,CAAC,EAAE,OAAO,EAAE,WAAW,IAC9E,WAAW,CAAC,eAAe,CACb,CACb,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, { useState } from 'react';\nimport { FilteringProperty, I18nStrings, Token, ExtendedOperatorForm, ComparisonOperator } from './interfaces';\nimport styles from './styles.css.js';\nimport InternalButton from '../button/internal';\nimport InternalFormField from '../form-field/internal';\n\ninterface PorpertyEditorProps<TokenValue> {\n property: FilteringProperty;\n operator: ComparisonOperator;\n filter: string;\n operatorForm: ExtendedOperatorForm<TokenValue>;\n onCancel: () => void;\n onSubmit: (value: Token) => void;\n i18nStrings: I18nStrings;\n}\n\nexport function PropertyEditor<TokenValue = any>({\n property,\n operator,\n filter,\n operatorForm,\n onCancel,\n onSubmit,\n i18nStrings,\n}: PorpertyEditorProps<TokenValue>) {\n const [value, onChange] = useState<null | TokenValue>(null);\n const submitToken = () => onSubmit({ propertyKey: property.key, operator, value });\n return (\n <div className={styles['property-editor']}>\n <div className={styles['property-editor-form']}>\n <InternalFormField label={property.groupValuesLabel}>\n {operatorForm({ value, onChange, operator, filter })}\n </InternalFormField>\n </div>\n\n <div className={styles['property-editor-actions']}>\n <InternalButton variant=\"link\" className={styles['property-editor-cancel']} onClick={onCancel}>\n {i18nStrings.cancelActionText}\n </InternalButton>\n <InternalButton className={styles['property-editor-submit']} onClick={submitToken}>\n {i18nStrings.applyActionText}\n </InternalButton>\n </div>\n </div>\n );\n}\n"]}
@@ -4,6 +4,7 @@ import { CancelableEventHandler } from '../internal/events';
4
4
  import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
5
5
  import { AutosuggestInputRef } from '../internal/components/autosuggest-input';
6
6
  export interface PropertyFilterAutosuggestProps extends AutosuggestProps, InternalBaseComponentProps {
7
+ customForm?: React.ReactNode;
7
8
  filterText?: string;
8
9
  onOptionClick?: CancelableEventHandler<AutosuggestProps.Option>;
9
10
  hideEnteredTextOption?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"property-filter-autosuggest.d.ts","sourceRoot":"","sources":["../../../src/property-filter/property-filter-autosuggest.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAG3C,OAAO,EAAmB,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAM9E,OAAO,EAEL,sBAAsB,EAGvB,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAIlF,OAAyB,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAMjG,MAAM,WAAW,8BAA+B,SAAQ,gBAAgB,EAAE,0BAA0B;IAClG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChE,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,QAAA,MAAM,yBAAyB,4GAwJ9B,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"property-filter-autosuggest.d.ts","sourceRoot":"","sources":["../../../src/property-filter/property-filter-autosuggest.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAG3C,OAAO,EAAmB,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAM9E,OAAO,EAEL,sBAAsB,EAGvB,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAIlF,OAAyB,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAQjG,MAAM,WAAW,8BAA+B,SAAQ,gBAAgB,EAAE,0BAA0B;IAClG,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChE,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,QAAA,MAAM,yBAAyB,4GAoK9B,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
@@ -15,11 +15,14 @@ import { useAutosuggestLoadMore } from '../autosuggest/load-more-controller';
15
15
  import AutosuggestInput from '../internal/components/autosuggest-input';
16
16
  import { useMergeRefs } from '../internal/hooks/use-merge-refs';
17
17
  import clsx from 'clsx';
18
- var DROPDOWN_WIDTH = 300;
18
+ import { getFirstFocusable } from '../internal/components/focus-lock/utils';
19
+ var DROPDOWN_WIDTH_OPTIONS_LIST = 300;
20
+ var DROPDOWN_WIDTH_CUSTOM_FORM = 200;
19
21
  var PropertyFilterAutosuggest = React.forwardRef(function (props, ref) {
20
22
  var _a;
21
- var value = props.value, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, onLoadItems = props.onLoadItems, options = props.options, _b = props.filteringType, filteringType = _b === void 0 ? 'auto' : _b, _c = props.statusType, statusType = _c === void 0 ? 'finished' : _c, placeholder = props.placeholder, disabled = props.disabled, ariaLabel = props.ariaLabel, enteredTextLabel = props.enteredTextLabel, onKeyDown = props.onKeyDown, virtualScroll = props.virtualScroll, expandToViewport = props.expandToViewport, filterText = props.filterText, onOptionClick = props.onOptionClick, hideEnteredTextOption = props.hideEnteredTextOption, rest = __rest(props, ["value", "onChange", "onFocus", "onBlur", "onLoadItems", "options", "filteringType", "statusType", "placeholder", "disabled", "ariaLabel", "enteredTextLabel", "onKeyDown", "virtualScroll", "expandToViewport", "filterText", "onOptionClick", "hideEnteredTextOption"]);
23
+ var value = props.value, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, onLoadItems = props.onLoadItems, options = props.options, _b = props.filteringType, filteringType = _b === void 0 ? 'auto' : _b, _c = props.statusType, statusType = _c === void 0 ? 'finished' : _c, placeholder = props.placeholder, disabled = props.disabled, ariaLabel = props.ariaLabel, enteredTextLabel = props.enteredTextLabel, onKeyDown = props.onKeyDown, virtualScroll = props.virtualScroll, expandToViewport = props.expandToViewport, customForm = props.customForm, filterText = props.filterText, onOptionClick = props.onOptionClick, hideEnteredTextOption = props.hideEnteredTextOption, rest = __rest(props, ["value", "onChange", "onFocus", "onBlur", "onLoadItems", "options", "filteringType", "statusType", "placeholder", "disabled", "ariaLabel", "enteredTextLabel", "onKeyDown", "virtualScroll", "expandToViewport", "customForm", "filterText", "onOptionClick", "hideEnteredTextOption"]);
22
24
  var highlightText = filterText === undefined ? value : filterText;
25
+ var customFormRef = useRef(null);
23
26
  var autosuggestInputRef = useRef(null);
24
27
  var mergedRef = useMergeRefs(autosuggestInputRef, ref);
25
28
  var _d = useAutosuggestItems({
@@ -64,7 +67,11 @@ var PropertyFilterAutosuggest = React.forwardRef(function (props, ref) {
64
67
  fireCancelableEvent(onKeyDown, e.detail);
65
68
  };
66
69
  var handlePressArrowDown = function () {
70
+ var _a;
67
71
  autosuggestItemsHandlers.moveHighlightWithKeyboard(1);
72
+ if (customFormRef.current) {
73
+ (_a = getFirstFocusable(customFormRef.current)) === null || _a === void 0 ? void 0 : _a.focus();
74
+ }
68
75
  };
69
76
  var handlePressArrowUp = function () {
70
77
  autosuggestItemsHandlers.moveHighlightWithKeyboard(-1);
@@ -86,7 +93,14 @@ var PropertyFilterAutosuggest = React.forwardRef(function (props, ref) {
86
93
  var highlightedOptionId = autosuggestItemsState.highlightedOption ? generateUniqueId() : undefined;
87
94
  var isEmpty = !value && !autosuggestItemsState.items.length;
88
95
  var dropdownStatus = useDropdownStatus(__assign(__assign({}, props), { isEmpty: isEmpty, onRecoveryClick: handleRecoveryClick }));
89
- return (React.createElement(AutosuggestInput, __assign({ ref: mergedRef }, rest, { className: clsx(autosuggestStyles.root, styles.input), value: value, onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: handleKeyDown, controlId: controlId, placeholder: placeholder, disabled: disabled, ariaLabel: ariaLabel, expandToViewport: expandToViewport, ariaControls: listId, ariaActivedescendant: highlightedOptionId, dropdownExpanded: autosuggestItemsState.items.length > 1 || dropdownStatus.content !== null, dropdownContent: autosuggestItemsState.items.length > 0 ? (React.createElement(AutosuggestOptionsList, { autosuggestItemsState: autosuggestItemsState, autosuggestItemsHandlers: autosuggestItemsHandlers, highlightedOptionId: highlightedOptionId, highlightText: highlightText, listId: listId, controlId: controlId, enteredTextLabel: enteredTextLabel, handleLoadMore: autosuggestLoadMoreHandlers.fireLoadMoreOnScroll, hasDropdownStatus: dropdownStatus.content !== null, virtualScroll: virtualScroll, listBottom: !dropdownStatus.isSticky ? React.createElement(DropdownFooter, { content: dropdownStatus.content }) : null })) : null, dropdownFooter: dropdownStatus.isSticky ? (React.createElement(DropdownFooter, { content: dropdownStatus.content, hasItems: autosuggestItemsState.items.length >= 1 })) : null, dropdownWidth: DROPDOWN_WIDTH, onCloseDropdown: handleCloseDropdown, onDelayedInput: handleDelayedInput, onPressArrowDown: handlePressArrowDown, onPressArrowUp: handlePressArrowUp, onPressEnter: handlePressEnter })));
96
+ var content = null;
97
+ if (customForm) {
98
+ content = React.createElement("div", { ref: customFormRef }, customForm);
99
+ }
100
+ else if (autosuggestItemsState.items.length > 0) {
101
+ content = (React.createElement(AutosuggestOptionsList, { autosuggestItemsState: autosuggestItemsState, autosuggestItemsHandlers: autosuggestItemsHandlers, highlightedOptionId: highlightedOptionId, highlightText: highlightText, listId: listId, controlId: controlId, enteredTextLabel: enteredTextLabel, handleLoadMore: autosuggestLoadMoreHandlers.fireLoadMoreOnScroll, hasDropdownStatus: dropdownStatus.content !== null, virtualScroll: virtualScroll, listBottom: !dropdownStatus.isSticky ? React.createElement(DropdownFooter, { content: dropdownStatus.content }) : null }));
102
+ }
103
+ return (React.createElement(AutosuggestInput, __assign({ ref: mergedRef }, rest, { className: clsx(autosuggestStyles.root, styles.input), value: value, onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: handleKeyDown, controlId: controlId, placeholder: placeholder, disabled: disabled, ariaLabel: ariaLabel, expandToViewport: expandToViewport, ariaControls: listId, ariaActivedescendant: highlightedOptionId, dropdownExpanded: autosuggestItemsState.items.length > 1 || dropdownStatus.content !== null || !!customForm, dropdownContentKey: customForm ? 'custom' : 'options', dropdownContent: content, dropdownFooter: dropdownStatus.isSticky ? (React.createElement(DropdownFooter, { content: dropdownStatus.content, hasItems: autosuggestItemsState.items.length >= 1 })) : null, dropdownWidth: customForm ? DROPDOWN_WIDTH_CUSTOM_FORM : DROPDOWN_WIDTH_OPTIONS_LIST, dropdownContentFocusable: !!customForm, onCloseDropdown: handleCloseDropdown, onDelayedInput: handleDelayedInput, onPressArrowDown: handlePressArrowDown, onPressArrowUp: handlePressArrowUp, onPressEnter: handlePressEnter })));
90
104
  });
91
105
  export default PropertyFilterAutosuggest;
92
106
  //# sourceMappingURL=property-filter-autosuggest.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"property-filter-autosuggest.js","sourceRoot":"","sources":["../../../src/property-filter/property-filter-autosuggest.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,EAAE,EAAO,MAAM,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAGxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,cAAc,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EACL,sBAAsB,GAIvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAC7D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,mBA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OAAO,EAAE,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,qBAAqB,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,GAAI,CACvG,CAAC,CAAC,CAAC,IAAI,EAEV,aAAa,EAAE,cAAc,EAC7B,eAAe,EAAE,mBAAmB,EACpC,cAAc,EAAE,kBAAkB,EAClC,gBAAgB,EAAE,oBAAoB,EACtC,cAAc,EAAE,kBAAkB,EAClC,YAAY,EAAE,gBAAgB,IAC9B,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,yBAAyB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref, useRef } from 'react';\n\nimport { useAutosuggestItems } from '../autosuggest/options-controller';\nimport { AutosuggestItem, AutosuggestProps } from '../autosuggest/interfaces';\n\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport DropdownFooter from '../internal/components/dropdown-footer';\n\nimport { generateUniqueId, useUniqueId } from '../internal/hooks/use-unique-id';\nimport {\n fireNonCancelableEvent,\n CancelableEventHandler,\n NonCancelableCustomEvent,\n BaseKeyDetail,\n} from '../internal/events';\nimport { BaseChangeDetail } from '../input/interfaces';\nimport autosuggestStyles from '../autosuggest/styles.css.js';\nimport styles from './styles.css.js';\nimport { fireCancelableEvent } from '../internal/events/index';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport AutosuggestOptionsList from '../autosuggest/options-list';\nimport { useAutosuggestLoadMore } from '../autosuggest/load-more-controller';\nimport { OptionsLoadItemsDetail } from '../internal/components/dropdown/interfaces';\nimport AutosuggestInput, { AutosuggestInputRef } from '../internal/components/autosuggest-input';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport clsx from 'clsx';\n\nconst DROPDOWN_WIDTH = 300;\n\nexport interface PropertyFilterAutosuggestProps extends AutosuggestProps, InternalBaseComponentProps {\n filterText?: string;\n onOptionClick?: CancelableEventHandler<AutosuggestProps.Option>;\n hideEnteredTextOption?: boolean;\n}\n\nconst PropertyFilterAutosuggest = React.forwardRef(\n (props: PropertyFilterAutosuggestProps, ref: Ref<AutosuggestInputRef>) => {\n const {\n value,\n onChange,\n onFocus,\n onBlur,\n onLoadItems,\n options,\n filteringType = 'auto',\n statusType = 'finished',\n placeholder,\n disabled,\n ariaLabel,\n enteredTextLabel,\n onKeyDown,\n virtualScroll,\n expandToViewport,\n filterText,\n onOptionClick,\n hideEnteredTextOption,\n ...rest\n } = props;\n const highlightText = filterText === undefined ? value : filterText;\n\n const autosuggestInputRef = useRef<AutosuggestInputRef>(null);\n const mergedRef = useMergeRefs(autosuggestInputRef, ref);\n\n const [autosuggestItemsState, autosuggestItemsHandlers] = useAutosuggestItems({\n options: options || [],\n filterValue: value,\n filterText: highlightText,\n filteringType,\n hideEnteredTextLabel: hideEnteredTextOption,\n onSelectItem: (option: AutosuggestItem) => {\n const value = option.value || '';\n fireNonCancelableEvent(onChange, { value });\n const selectedCancelled = fireCancelableEvent(onOptionClick, option);\n if (!selectedCancelled) {\n autosuggestInputRef.current?.close();\n } else {\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n }\n },\n });\n\n const autosuggestLoadMoreHandlers = useAutosuggestLoadMore({\n options,\n statusType,\n onLoadItems: (detail: OptionsLoadItemsDetail) => fireNonCancelableEvent(onLoadItems, detail),\n });\n\n const handleChange = (event: NonCancelableCustomEvent<BaseChangeDetail>) => {\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n fireNonCancelableEvent(onChange, event.detail);\n };\n\n const handleDelayedInput = (event: NonCancelableCustomEvent<BaseChangeDetail>) => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputChange(event.detail.value);\n };\n\n const handleFocus = () => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputFocus();\n fireCancelableEvent(onFocus, null);\n };\n\n const handleBlur = () => {\n fireCancelableEvent(onBlur, null);\n };\n\n const handleKeyDown = (e: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyDown, e.detail);\n };\n\n const handlePressArrowDown = () => {\n autosuggestItemsHandlers.moveHighlightWithKeyboard(1);\n };\n\n const handlePressArrowUp = () => {\n autosuggestItemsHandlers.moveHighlightWithKeyboard(-1);\n };\n\n const handlePressEnter = () => {\n return autosuggestItemsHandlers.selectHighlightedOptionWithKeyboard();\n };\n\n const handleCloseDropdown = () => {\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n };\n\n const handleRecoveryClick = () => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnRecoveryClick();\n autosuggestInputRef.current?.focus();\n };\n\n const selfControlId = useUniqueId('input');\n const controlId = rest.controlId ?? selfControlId;\n const listId = useUniqueId('list');\n const highlightedOptionId = autosuggestItemsState.highlightedOption ? generateUniqueId() : undefined;\n\n const isEmpty = !value && !autosuggestItemsState.items.length;\n const dropdownStatus = useDropdownStatus({ ...props, isEmpty, onRecoveryClick: handleRecoveryClick });\n\n return (\n <AutosuggestInput\n ref={mergedRef}\n {...rest}\n className={clsx(autosuggestStyles.root, styles.input)}\n value={value}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n controlId={controlId}\n placeholder={placeholder}\n disabled={disabled}\n ariaLabel={ariaLabel}\n expandToViewport={expandToViewport}\n ariaControls={listId}\n ariaActivedescendant={highlightedOptionId}\n dropdownExpanded={autosuggestItemsState.items.length > 1 || dropdownStatus.content !== null}\n dropdownContent={\n autosuggestItemsState.items.length > 0 ? (\n <AutosuggestOptionsList\n autosuggestItemsState={autosuggestItemsState}\n autosuggestItemsHandlers={autosuggestItemsHandlers}\n highlightedOptionId={highlightedOptionId}\n highlightText={highlightText}\n listId={listId}\n controlId={controlId}\n enteredTextLabel={enteredTextLabel}\n handleLoadMore={autosuggestLoadMoreHandlers.fireLoadMoreOnScroll}\n hasDropdownStatus={dropdownStatus.content !== null}\n virtualScroll={virtualScroll}\n listBottom={!dropdownStatus.isSticky ? <DropdownFooter content={dropdownStatus.content} /> : null}\n />\n ) : null\n }\n dropdownFooter={\n dropdownStatus.isSticky ? (\n <DropdownFooter content={dropdownStatus.content} hasItems={autosuggestItemsState.items.length >= 1} />\n ) : null\n }\n dropdownWidth={DROPDOWN_WIDTH}\n onCloseDropdown={handleCloseDropdown}\n onDelayedInput={handleDelayedInput}\n onPressArrowDown={handlePressArrowDown}\n onPressArrowUp={handlePressArrowUp}\n onPressEnter={handlePressEnter}\n />\n );\n }\n);\n\nexport default PropertyFilterAutosuggest;\n"]}
1
+ {"version":3,"file":"property-filter-autosuggest.js","sourceRoot":"","sources":["../../../src/property-filter/property-filter-autosuggest.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,EAAE,EAAO,MAAM,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAGxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,cAAc,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EACL,sBAAsB,GAIvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAC7D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,OAAO,gBAAyC,MAAM,0CAA0C,CAAC;AACjG,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE5E,IAAM,2BAA2B,GAAG,GAAG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C,CAAC,UAAU,EAC3G,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EACrD,eAAe,EAAE,OAAO,EACxB,cAAc,EACZ,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CACxB,oBAAC,cAAc,IAAC,OAAO,EAAE,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,qBAAqB,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,GAAI,CACvG,CAAC,CAAC,CAAC,IAAI,EAEV,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,2BAA2B,EACpF,wBAAwB,EAAE,CAAC,CAAC,UAAU,EACtC,eAAe,EAAE,mBAAmB,EACpC,cAAc,EAAE,kBAAkB,EAClC,gBAAgB,EAAE,oBAAoB,EACtC,cAAc,EAAE,kBAAkB,EAClC,YAAY,EAAE,gBAAgB,IAC9B,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,yBAAyB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref, useRef } from 'react';\n\nimport { useAutosuggestItems } from '../autosuggest/options-controller';\nimport { AutosuggestItem, AutosuggestProps } from '../autosuggest/interfaces';\n\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport DropdownFooter from '../internal/components/dropdown-footer';\n\nimport { generateUniqueId, useUniqueId } from '../internal/hooks/use-unique-id';\nimport {\n fireNonCancelableEvent,\n CancelableEventHandler,\n NonCancelableCustomEvent,\n BaseKeyDetail,\n} from '../internal/events';\nimport { BaseChangeDetail } from '../input/interfaces';\nimport autosuggestStyles from '../autosuggest/styles.css.js';\nimport styles from './styles.css.js';\nimport { fireCancelableEvent } from '../internal/events/index';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport AutosuggestOptionsList from '../autosuggest/options-list';\nimport { useAutosuggestLoadMore } from '../autosuggest/load-more-controller';\nimport { OptionsLoadItemsDetail } from '../internal/components/dropdown/interfaces';\nimport AutosuggestInput, { AutosuggestInputRef } from '../internal/components/autosuggest-input';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport clsx from 'clsx';\nimport { getFirstFocusable } from '../internal/components/focus-lock/utils';\n\nconst DROPDOWN_WIDTH_OPTIONS_LIST = 300;\nconst DROPDOWN_WIDTH_CUSTOM_FORM = 200;\n\nexport interface PropertyFilterAutosuggestProps extends AutosuggestProps, InternalBaseComponentProps {\n customForm?: React.ReactNode;\n filterText?: string;\n onOptionClick?: CancelableEventHandler<AutosuggestProps.Option>;\n hideEnteredTextOption?: boolean;\n}\n\nconst PropertyFilterAutosuggest = React.forwardRef(\n (props: PropertyFilterAutosuggestProps, ref: Ref<AutosuggestInputRef>) => {\n const {\n value,\n onChange,\n onFocus,\n onBlur,\n onLoadItems,\n options,\n filteringType = 'auto',\n statusType = 'finished',\n placeholder,\n disabled,\n ariaLabel,\n enteredTextLabel,\n onKeyDown,\n virtualScroll,\n expandToViewport,\n customForm,\n filterText,\n onOptionClick,\n hideEnteredTextOption,\n ...rest\n } = props;\n const highlightText = filterText === undefined ? value : filterText;\n\n const customFormRef = useRef<HTMLDivElement>(null);\n const autosuggestInputRef = useRef<AutosuggestInputRef>(null);\n const mergedRef = useMergeRefs(autosuggestInputRef, ref);\n\n const [autosuggestItemsState, autosuggestItemsHandlers] = useAutosuggestItems({\n options: options || [],\n filterValue: value,\n filterText: highlightText,\n filteringType,\n hideEnteredTextLabel: hideEnteredTextOption,\n onSelectItem: (option: AutosuggestItem) => {\n const value = option.value || '';\n fireNonCancelableEvent(onChange, { value });\n const selectedCancelled = fireCancelableEvent(onOptionClick, option);\n if (!selectedCancelled) {\n autosuggestInputRef.current?.close();\n } else {\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n }\n },\n });\n\n const autosuggestLoadMoreHandlers = useAutosuggestLoadMore({\n options,\n statusType,\n onLoadItems: (detail: OptionsLoadItemsDetail) => fireNonCancelableEvent(onLoadItems, detail),\n });\n\n const handleChange = (event: NonCancelableCustomEvent<BaseChangeDetail>) => {\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n fireNonCancelableEvent(onChange, event.detail);\n };\n\n const handleDelayedInput = (event: NonCancelableCustomEvent<BaseChangeDetail>) => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputChange(event.detail.value);\n };\n\n const handleFocus = () => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputFocus();\n fireCancelableEvent(onFocus, null);\n };\n\n const handleBlur = () => {\n fireCancelableEvent(onBlur, null);\n };\n\n const handleKeyDown = (e: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyDown, e.detail);\n };\n\n const handlePressArrowDown = () => {\n autosuggestItemsHandlers.moveHighlightWithKeyboard(1);\n if (customFormRef.current) {\n getFirstFocusable(customFormRef.current)?.focus();\n }\n };\n\n const handlePressArrowUp = () => {\n autosuggestItemsHandlers.moveHighlightWithKeyboard(-1);\n };\n\n const handlePressEnter = () => {\n return autosuggestItemsHandlers.selectHighlightedOptionWithKeyboard();\n };\n\n const handleCloseDropdown = () => {\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n };\n\n const handleRecoveryClick = () => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnRecoveryClick();\n autosuggestInputRef.current?.focus();\n };\n\n const selfControlId = useUniqueId('input');\n const controlId = rest.controlId ?? selfControlId;\n const listId = useUniqueId('list');\n const highlightedOptionId = autosuggestItemsState.highlightedOption ? generateUniqueId() : undefined;\n\n const isEmpty = !value && !autosuggestItemsState.items.length;\n const dropdownStatus = useDropdownStatus({ ...props, isEmpty, onRecoveryClick: handleRecoveryClick });\n\n let content = null;\n if (customForm) {\n content = <div ref={customFormRef}>{customForm}</div>;\n } else if (autosuggestItemsState.items.length > 0) {\n content = (\n <AutosuggestOptionsList\n autosuggestItemsState={autosuggestItemsState}\n autosuggestItemsHandlers={autosuggestItemsHandlers}\n highlightedOptionId={highlightedOptionId}\n highlightText={highlightText}\n listId={listId}\n controlId={controlId}\n enteredTextLabel={enteredTextLabel}\n handleLoadMore={autosuggestLoadMoreHandlers.fireLoadMoreOnScroll}\n hasDropdownStatus={dropdownStatus.content !== null}\n virtualScroll={virtualScroll}\n listBottom={!dropdownStatus.isSticky ? <DropdownFooter content={dropdownStatus.content} /> : null}\n />\n );\n }\n\n return (\n <AutosuggestInput\n ref={mergedRef}\n {...rest}\n className={clsx(autosuggestStyles.root, styles.input)}\n value={value}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n controlId={controlId}\n placeholder={placeholder}\n disabled={disabled}\n ariaLabel={ariaLabel}\n expandToViewport={expandToViewport}\n ariaControls={listId}\n ariaActivedescendant={highlightedOptionId}\n dropdownExpanded={autosuggestItemsState.items.length > 1 || dropdownStatus.content !== null || !!customForm}\n dropdownContentKey={customForm ? 'custom' : 'options'}\n dropdownContent={content}\n dropdownFooter={\n dropdownStatus.isSticky ? (\n <DropdownFooter content={dropdownStatus.content} hasItems={autosuggestItemsState.items.length >= 1} />\n ) : null\n }\n dropdownWidth={customForm ? DROPDOWN_WIDTH_CUSTOM_FORM : DROPDOWN_WIDTH_OPTIONS_LIST}\n dropdownContentFocusable={!!customForm}\n onCloseDropdown={handleCloseDropdown}\n onDelayedInput={handleDelayedInput}\n onPressArrowDown={handlePressArrowDown}\n onPressArrowUp={handlePressArrowUp}\n onPressEnter={handlePressEnter}\n />\n );\n }\n);\n\nexport default PropertyFilterAutosuggest;\n"]}
@@ -1,29 +1,37 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_1wzqe_1xf2c_93",
5
- "search-field": "awsui_search-field_1wzqe_1xf2c_104",
6
- "input-wrapper": "awsui_input-wrapper_1wzqe_1xf2c_110",
7
- "add-token": "awsui_add-token_1wzqe_1xf2c_114",
8
- "tokens": "awsui_tokens_1wzqe_1xf2c_121",
9
- "token-operator": "awsui_token-operator_1wzqe_1xf2c_125",
10
- "token-editor": "awsui_token-editor_1wzqe_1xf2c_129",
11
- "token-editor-form": "awsui_token-editor-form_1wzqe_1xf2c_132",
12
- "token-editor-field-property": "awsui_token-editor-field-property_1wzqe_1xf2c_135",
13
- "token-editor-field-operator": "awsui_token-editor-field-operator_1wzqe_1xf2c_138",
14
- "token-editor-field-value": "awsui_token-editor-field-value_1wzqe_1xf2c_141",
15
- "token-editor-actions": "awsui_token-editor-actions_1wzqe_1xf2c_144",
16
- "token-editor-cancel": "awsui_token-editor-cancel_1wzqe_1xf2c_153",
17
- "token-editor-submit": "awsui_token-editor-submit_1wzqe_1xf2c_156",
18
- "custom-control": "awsui_custom-control_1wzqe_1xf2c_160",
19
- "input": "awsui_input_1wzqe_1xf2c_110",
20
- "results": "awsui_results_1wzqe_1xf2c_168",
21
- "results-visible": "awsui_results-visible_1wzqe_1xf2c_174",
22
- "separator": "awsui_separator_1wzqe_1xf2c_178",
23
- "toggle-collapsed": "awsui_toggle-collapsed_1wzqe_1xf2c_185",
24
- "token-trigger": "awsui_token-trigger_1wzqe_1xf2c_190",
25
- "remove-all": "awsui_remove-all_1wzqe_1xf2c_196",
26
- "token-label": "awsui_token-label_1wzqe_1xf2c_197",
27
- "join-operation": "awsui_join-operation_1wzqe_1xf2c_198"
4
+ "root": "awsui_root_1wzqe_b1qbn_93",
5
+ "search-field": "awsui_search-field_1wzqe_b1qbn_104",
6
+ "input-wrapper": "awsui_input-wrapper_1wzqe_b1qbn_110",
7
+ "add-token": "awsui_add-token_1wzqe_b1qbn_114",
8
+ "tokens": "awsui_tokens_1wzqe_b1qbn_121",
9
+ "token-operator": "awsui_token-operator_1wzqe_b1qbn_125",
10
+ "property-editor": "awsui_property-editor_1wzqe_b1qbn_129",
11
+ "token-editor": "awsui_token-editor_1wzqe_b1qbn_130",
12
+ "property-editor-form": "awsui_property-editor-form_1wzqe_b1qbn_134",
13
+ "token-editor-form": "awsui_token-editor-form_1wzqe_b1qbn_135",
14
+ "property-editor-field-property": "awsui_property-editor-field-property_1wzqe_b1qbn_138",
15
+ "token-editor-field-property": "awsui_token-editor-field-property_1wzqe_b1qbn_139",
16
+ "property-editor-field-operator": "awsui_property-editor-field-operator_1wzqe_b1qbn_142",
17
+ "token-editor-field-operator": "awsui_token-editor-field-operator_1wzqe_b1qbn_143",
18
+ "property-editor-field-value": "awsui_property-editor-field-value_1wzqe_b1qbn_146",
19
+ "token-editor-field-value": "awsui_token-editor-field-value_1wzqe_b1qbn_147",
20
+ "property-editor-cancel": "awsui_property-editor-cancel_1wzqe_b1qbn_150",
21
+ "token-editor-cancel": "awsui_token-editor-cancel_1wzqe_b1qbn_151",
22
+ "property-editor-submit": "awsui_property-editor-submit_1wzqe_b1qbn_154",
23
+ "token-editor-submit": "awsui_token-editor-submit_1wzqe_b1qbn_155",
24
+ "property-editor-actions": "awsui_property-editor-actions_1wzqe_b1qbn_158",
25
+ "token-editor-actions": "awsui_token-editor-actions_1wzqe_b1qbn_159",
26
+ "custom-control": "awsui_custom-control_1wzqe_b1qbn_177",
27
+ "input": "awsui_input_1wzqe_b1qbn_110",
28
+ "results": "awsui_results_1wzqe_b1qbn_185",
29
+ "results-visible": "awsui_results-visible_1wzqe_b1qbn_191",
30
+ "separator": "awsui_separator_1wzqe_b1qbn_195",
31
+ "toggle-collapsed": "awsui_toggle-collapsed_1wzqe_b1qbn_202",
32
+ "token-trigger": "awsui_token-trigger_1wzqe_b1qbn_207",
33
+ "remove-all": "awsui_remove-all_1wzqe_b1qbn_213",
34
+ "token-label": "awsui_token-label_1wzqe_b1qbn_214",
35
+ "join-operation": "awsui_join-operation_1wzqe_b1qbn_215"
28
36
  };
29
37