@cloudscape-design/components-themeable 3.0.1317 → 3.0.1319
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/template/action-card/interfaces.d.ts +3 -3
- package/lib/internal/template/action-card/interfaces.d.ts.map +1 -1
- package/lib/internal/template/action-card/interfaces.js.map +1 -1
- package/lib/internal/template/alert/interfaces.d.ts +3 -3
- package/lib/internal/template/alert/interfaces.d.ts.map +1 -1
- package/lib/internal/template/alert/interfaces.js.map +1 -1
- package/lib/internal/template/anchor-navigation/interfaces.d.ts +2 -2
- package/lib/internal/template/anchor-navigation/interfaces.d.ts.map +1 -1
- package/lib/internal/template/anchor-navigation/interfaces.js.map +1 -1
- package/lib/internal/template/annotation-context/interfaces.d.ts +1 -1
- package/lib/internal/template/annotation-context/interfaces.d.ts.map +1 -1
- package/lib/internal/template/annotation-context/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/classic.d.ts +1 -1
- package/lib/internal/template/app-layout/drawer/overflow-menu.d.ts +1 -1
- package/lib/internal/template/app-layout/drawer/overflow-menu.d.ts.map +1 -1
- package/lib/internal/template/app-layout/drawer/overflow-menu.js.map +1 -1
- package/lib/internal/template/app-layout/index.js.map +1 -1
- package/lib/internal/template/app-layout/interfaces.d.ts +3 -3
- package/lib/internal/template/app-layout/interfaces.d.ts.map +1 -1
- package/lib/internal/template/app-layout/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/internal.d.ts +1 -1
- package/lib/internal/template/app-layout/runtime-drawer/index.d.ts +1 -1
- package/lib/internal/template/app-layout/runtime-drawer/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/runtime-drawer/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/index.d.ts +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-ai-drawer.d.ts +4 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-bottom-drawers.d.ts +4 -4
- package/lib/internal/template/app-layout-toolbar/index.js.map +1 -1
- package/lib/internal/template/area-chart/elements/use-highlight-details.d.ts +1 -1
- package/lib/internal/template/area-chart/elements/use-highlight-details.d.ts.map +1 -1
- package/lib/internal/template/area-chart/elements/use-highlight-details.js.map +1 -1
- package/lib/internal/template/area-chart/interfaces.d.ts +1 -1
- package/lib/internal/template/area-chart/interfaces.d.ts.map +1 -1
- package/lib/internal/template/area-chart/interfaces.js.map +1 -1
- package/lib/internal/template/area-chart/model/compute-chart-props.d.ts +2 -2
- package/lib/internal/template/area-chart/model/compute-chart-props.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/compute-chart-props.js +2 -0
- package/lib/internal/template/area-chart/model/compute-chart-props.js.map +1 -1
- package/lib/internal/template/area-chart/model/index.d.ts +1 -1
- package/lib/internal/template/area-chart/model/index.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/index.js.map +1 -1
- package/lib/internal/template/area-chart/model/use-chart-model.d.ts +1 -1
- package/lib/internal/template/area-chart/model/use-chart-model.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/use-chart-model.js.map +1 -1
- package/lib/internal/template/area-chart/model/use-filter-props.d.ts +1 -1
- package/lib/internal/template/area-chart/model/use-filter-props.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/use-filter-props.js.map +1 -1
- package/lib/internal/template/area-chart/model/use-highlight-props.d.ts +1 -1
- package/lib/internal/template/area-chart/model/use-highlight-props.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/use-highlight-props.js.map +1 -1
- package/lib/internal/template/area-chart/model/utils.d.ts +1 -1
- package/lib/internal/template/area-chart/model/utils.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/utils.js.map +1 -1
- package/lib/internal/template/attribute-editor/interfaces.d.ts +3 -3
- package/lib/internal/template/attribute-editor/interfaces.d.ts.map +1 -1
- package/lib/internal/template/attribute-editor/interfaces.js.map +1 -1
- package/lib/internal/template/attribute-editor/row.d.ts +2 -2
- package/lib/internal/template/attribute-editor/row.d.ts.map +1 -1
- package/lib/internal/template/attribute-editor/row.js.map +1 -1
- package/lib/internal/template/autosuggest/autosuggest-option.d.ts +1 -1
- package/lib/internal/template/autosuggest/autosuggest-option.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/autosuggest-option.js.map +1 -1
- package/lib/internal/template/autosuggest/interfaces.d.ts +5 -5
- package/lib/internal/template/autosuggest/interfaces.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/interfaces.js.map +1 -1
- package/lib/internal/template/autosuggest/internal.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/internal.js +1 -1
- package/lib/internal/template/autosuggest/internal.js.map +1 -1
- package/lib/internal/template/autosuggest/load-more-controller.d.ts +1 -1
- package/lib/internal/template/autosuggest/load-more-controller.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/load-more-controller.js.map +1 -1
- package/lib/internal/template/badge/interfaces.d.ts +2 -2
- package/lib/internal/template/badge/interfaces.d.ts.map +1 -1
- package/lib/internal/template/badge/interfaces.js.map +1 -1
- package/lib/internal/template/bar-chart/interfaces.d.ts +1 -1
- package/lib/internal/template/bar-chart/interfaces.d.ts.map +1 -1
- package/lib/internal/template/bar-chart/interfaces.js.map +1 -1
- package/lib/internal/template/box/interfaces.d.ts +2 -2
- package/lib/internal/template/box/interfaces.d.ts.map +1 -1
- package/lib/internal/template/box/interfaces.js.map +1 -1
- package/lib/internal/template/breadcrumb-group/all-items-dropdown.d.ts +1 -1
- package/lib/internal/template/breadcrumb-group/all-items-dropdown.d.ts.map +1 -1
- package/lib/internal/template/breadcrumb-group/all-items-dropdown.js.map +1 -1
- package/lib/internal/template/breadcrumb-group/interfaces.d.ts +2 -2
- package/lib/internal/template/breadcrumb-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/breadcrumb-group/interfaces.js.map +1 -1
- package/lib/internal/template/button/interfaces.d.ts +3 -3
- package/lib/internal/template/button/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button/interfaces.js.map +1 -1
- package/lib/internal/template/button-dropdown/interfaces.d.ts +3 -3
- package/lib/internal/template/button-dropdown/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/interfaces.js.map +1 -1
- package/lib/internal/template/button-dropdown/utils/use-button-dropdown.d.ts +1 -1
- package/lib/internal/template/button-dropdown/utils/use-button-dropdown.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/utils/use-button-dropdown.js.map +1 -1
- package/lib/internal/template/button-group/file-input-item.d.ts +1 -1
- package/lib/internal/template/button-group/file-input-item.d.ts.map +1 -1
- package/lib/internal/template/button-group/file-input-item.js.map +1 -1
- package/lib/internal/template/button-group/icon-button-item.d.ts +1 -1
- package/lib/internal/template/button-group/icon-button-item.d.ts.map +1 -1
- package/lib/internal/template/button-group/icon-button-item.js +1 -1
- package/lib/internal/template/button-group/icon-button-item.js.map +1 -1
- package/lib/internal/template/button-group/icon-toggle-button-item.d.ts +1 -1
- package/lib/internal/template/button-group/icon-toggle-button-item.d.ts.map +1 -1
- package/lib/internal/template/button-group/icon-toggle-button-item.js.map +1 -1
- package/lib/internal/template/button-group/interfaces.d.ts +10 -2
- package/lib/internal/template/button-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button-group/interfaces.js.map +1 -1
- package/lib/internal/template/button-group/item-element.d.ts +1 -1
- package/lib/internal/template/button-group/item-element.d.ts.map +1 -1
- package/lib/internal/template/button-group/item-element.js.map +1 -1
- package/lib/internal/template/button-group/menu-dropdown-item.d.ts +1 -1
- package/lib/internal/template/button-group/menu-dropdown-item.d.ts.map +1 -1
- package/lib/internal/template/button-group/menu-dropdown-item.js.map +1 -1
- package/lib/internal/template/calendar/interfaces.d.ts +3 -3
- package/lib/internal/template/calendar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/calendar/interfaces.js.map +1 -1
- package/lib/internal/template/cards/interfaces.d.ts +2 -2
- package/lib/internal/template/cards/interfaces.d.ts.map +1 -1
- package/lib/internal/template/cards/interfaces.js.map +1 -1
- package/lib/internal/template/checkbox/base-checkbox.d.ts +3 -3
- package/lib/internal/template/checkbox/base-checkbox.d.ts.map +1 -1
- package/lib/internal/template/checkbox/base-checkbox.js.map +1 -1
- package/lib/internal/template/checkbox/interfaces.d.ts +2 -2
- package/lib/internal/template/checkbox/interfaces.d.ts.map +1 -1
- package/lib/internal/template/checkbox/interfaces.js.map +1 -1
- package/lib/internal/template/code-editor/error-screen.d.ts +1 -1
- package/lib/internal/template/code-editor/error-screen.d.ts.map +1 -1
- package/lib/internal/template/code-editor/error-screen.js.map +1 -1
- package/lib/internal/template/code-editor/interfaces.d.ts +3 -3
- package/lib/internal/template/code-editor/interfaces.d.ts.map +1 -1
- package/lib/internal/template/code-editor/interfaces.js.map +1 -1
- package/lib/internal/template/code-editor/listeners.d.ts +1 -1
- package/lib/internal/template/code-editor/listeners.d.ts.map +1 -1
- package/lib/internal/template/code-editor/listeners.js.map +1 -1
- package/lib/internal/template/code-editor/preferences-modal.js.map +1 -1
- package/lib/internal/template/collection-preferences/interfaces.d.ts +4 -4
- package/lib/internal/template/collection-preferences/interfaces.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/interfaces.js.map +1 -1
- package/lib/internal/template/column-layout/interfaces.d.ts +1 -1
- package/lib/internal/template/column-layout/interfaces.d.ts.map +1 -1
- package/lib/internal/template/column-layout/interfaces.js.map +1 -1
- package/lib/internal/template/container/interfaces.d.ts +1 -1
- package/lib/internal/template/container/interfaces.d.ts.map +1 -1
- package/lib/internal/template/container/interfaces.js.map +1 -1
- package/lib/internal/template/content-layout/interfaces.d.ts +1 -1
- package/lib/internal/template/content-layout/interfaces.d.ts.map +1 -1
- package/lib/internal/template/content-layout/interfaces.js.map +1 -1
- package/lib/internal/template/contexts/form-field.d.ts +2 -1
- package/lib/internal/template/contexts/form-field.d.ts.map +1 -1
- package/lib/internal/template/contexts/form-field.js +1 -1
- package/lib/internal/template/contexts/form-field.js.map +1 -1
- package/lib/internal/template/copy-to-clipboard/interfaces.d.ts +2 -2
- package/lib/internal/template/copy-to-clipboard/interfaces.d.ts.map +1 -1
- package/lib/internal/template/copy-to-clipboard/interfaces.js.map +1 -1
- package/lib/internal/template/date-input/interfaces.d.ts +3 -3
- package/lib/internal/template/date-input/interfaces.d.ts.map +1 -1
- package/lib/internal/template/date-input/interfaces.js.map +1 -1
- package/lib/internal/template/date-input/internal.d.ts.map +1 -1
- package/lib/internal/template/date-input/internal.js.map +1 -1
- package/lib/internal/template/date-picker/interfaces.d.ts +4 -4
- package/lib/internal/template/date-picker/interfaces.d.ts.map +1 -1
- package/lib/internal/template/date-picker/interfaces.js.map +1 -1
- package/lib/internal/template/date-range-picker/calendar/interfaces.d.ts +1 -1
- package/lib/internal/template/date-range-picker/calendar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/calendar/interfaces.js.map +1 -1
- package/lib/internal/template/date-range-picker/interfaces.d.ts +4 -4
- package/lib/internal/template/date-range-picker/interfaces.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/interfaces.js.map +1 -1
- package/lib/internal/template/divider/interfaces.d.ts +2 -2
- package/lib/internal/template/divider/interfaces.d.ts.map +1 -1
- package/lib/internal/template/divider/interfaces.js.map +1 -1
- package/lib/internal/template/drawer/interfaces.d.ts +2 -2
- package/lib/internal/template/drawer/interfaces.d.ts.map +1 -1
- package/lib/internal/template/drawer/interfaces.js.map +1 -1
- package/lib/internal/template/dropdown/interfaces.d.ts +1 -1
- package/lib/internal/template/dropdown/interfaces.d.ts.map +1 -1
- package/lib/internal/template/dropdown/interfaces.js.map +1 -1
- package/lib/internal/template/dropdown/internal.d.ts +1 -1
- package/lib/internal/template/dropdown/internal.d.ts.map +1 -1
- package/lib/internal/template/dropdown/internal.js.map +1 -1
- package/lib/internal/template/error-boundary/interfaces.d.ts +1 -1
- package/lib/internal/template/error-boundary/interfaces.d.ts.map +1 -1
- package/lib/internal/template/error-boundary/interfaces.js.map +1 -1
- package/lib/internal/template/expandable-section/interfaces.d.ts +2 -2
- package/lib/internal/template/expandable-section/interfaces.d.ts.map +1 -1
- package/lib/internal/template/expandable-section/interfaces.js.map +1 -1
- package/lib/internal/template/file-dropzone/interfaces.d.ts +2 -2
- package/lib/internal/template/file-dropzone/interfaces.d.ts.map +1 -1
- package/lib/internal/template/file-dropzone/interfaces.js.map +1 -1
- package/lib/internal/template/file-input/interfaces.d.ts +3 -3
- package/lib/internal/template/file-input/interfaces.d.ts.map +1 -1
- package/lib/internal/template/file-input/interfaces.js.map +1 -1
- package/lib/internal/template/file-token-group/file-token.d.ts +1 -1
- package/lib/internal/template/file-token-group/file-token.d.ts.map +1 -1
- package/lib/internal/template/file-token-group/file-token.js.map +1 -1
- package/lib/internal/template/file-token-group/interfaces.d.ts +2 -2
- package/lib/internal/template/file-token-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/file-token-group/interfaces.js.map +1 -1
- package/lib/internal/template/file-upload/interfaces.d.ts +3 -3
- package/lib/internal/template/file-upload/interfaces.d.ts.map +1 -1
- package/lib/internal/template/file-upload/interfaces.js.map +1 -1
- package/lib/internal/template/flashbar/common.d.ts +1 -1
- package/lib/internal/template/flashbar/interfaces.d.ts +2 -2
- package/lib/internal/template/flashbar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/flashbar/interfaces.js.map +1 -1
- package/lib/internal/template/form/interfaces.d.ts +2 -2
- package/lib/internal/template/form/interfaces.d.ts.map +1 -1
- package/lib/internal/template/form/interfaces.js.map +1 -1
- package/lib/internal/template/form-field/interfaces.d.ts +2 -2
- package/lib/internal/template/form-field/interfaces.d.ts.map +1 -1
- package/lib/internal/template/form-field/interfaces.js.map +1 -1
- package/lib/internal/template/grid/interfaces.d.ts +2 -2
- package/lib/internal/template/grid/interfaces.d.ts.map +1 -1
- package/lib/internal/template/grid/interfaces.js.map +1 -1
- package/lib/internal/template/grid/internal.d.ts +1 -1
- package/lib/internal/template/grid/internal.d.ts.map +1 -1
- package/lib/internal/template/grid/internal.js.map +1 -1
- package/lib/internal/template/header/interfaces.d.ts +1 -1
- package/lib/internal/template/header/interfaces.d.ts.map +1 -1
- package/lib/internal/template/header/interfaces.js.map +1 -1
- package/lib/internal/template/help-panel/interfaces.d.ts +1 -1
- package/lib/internal/template/help-panel/interfaces.d.ts.map +1 -1
- package/lib/internal/template/help-panel/interfaces.js.map +1 -1
- package/lib/internal/template/hotspot/interfaces.d.ts +1 -1
- package/lib/internal/template/hotspot/interfaces.d.ts.map +1 -1
- package/lib/internal/template/hotspot/interfaces.js.map +1 -1
- package/lib/internal/template/icon/generated/icons.d.ts +2 -0
- package/lib/internal/template/icon/generated/icons.d.ts.map +1 -1
- package/lib/internal/template/icon/generated/icons.js +7 -0
- package/lib/internal/template/icon/generated/icons.js.map +1 -1
- package/lib/internal/template/icon/interfaces.d.ts +2 -2
- package/lib/internal/template/icon/interfaces.d.ts.map +1 -1
- package/lib/internal/template/icon/interfaces.js.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.d.ts +2 -2
- package/lib/internal/template/icon-provider/interfaces.d.ts.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.js.map +1 -1
- package/lib/internal/template/input/interfaces.d.ts +4 -4
- package/lib/internal/template/input/interfaces.d.ts.map +1 -1
- package/lib/internal/template/input/interfaces.js.map +1 -1
- package/lib/internal/template/input/internal.d.ts +3 -3
- package/lib/internal/template/input/internal.d.ts.map +1 -1
- package/lib/internal/template/input/internal.js.map +1 -1
- package/lib/internal/template/interfaces.d.ts +1 -1
- package/lib/internal/template/interfaces.d.ts.map +1 -1
- package/lib/internal/template/interfaces.js.map +1 -1
- package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts +2 -1
- package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/components/analytics-funnel.js.map +1 -1
- package/lib/internal/template/internal/analytics/context/analytics-context.d.ts +2 -1
- package/lib/internal/template/internal/analytics/context/analytics-context.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/context/analytics-context.js.map +1 -1
- package/lib/internal/template/internal/analytics/interfaces.d.ts +2 -15
- package/lib/internal/template/internal/analytics/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/interfaces.js.map +1 -1
- package/lib/internal/template/internal/base-component/index.d.ts +3 -15
- package/lib/internal/template/internal/base-component/index.d.ts.map +1 -1
- package/lib/internal/template/internal/base-component/index.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/breakpoints.d.ts +2 -1
- package/lib/internal/template/internal/breakpoints.d.ts.map +1 -1
- package/lib/internal/template/internal/breakpoints.js.map +1 -1
- package/lib/internal/template/internal/components/autosuggest-input/index.d.ts +3 -3
- package/lib/internal/template/internal/components/autosuggest-input/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/autosuggest-input/index.js.map +1 -1
- package/lib/internal/template/internal/components/button-trigger/index.d.ts +2 -2
- package/lib/internal/template/internal/components/button-trigger/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/button-trigger/index.js.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/block-end-labels.d.ts +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/block-end-labels.d.ts.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/block-end-labels.js.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/interfaces.d.ts +1 -209
- package/lib/internal/template/internal/components/cartesian-chart/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/interfaces.js +2 -0
- package/lib/internal/template/internal/components/cartesian-chart/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/label-utils.d.ts +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/label-utils.d.ts.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/label-utils.js.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/scales.d.ts +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/scales.d.ts.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/scales.js +0 -2
- package/lib/internal/template/internal/components/cartesian-chart/scales.js.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/ticks.d.ts +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/ticks.d.ts.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/ticks.js.map +1 -1
- package/lib/internal/template/internal/components/chart-filter/index.d.ts +1 -1
- package/lib/internal/template/internal/components/chart-filter/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/chart-filter/index.js.map +1 -1
- package/lib/internal/template/internal/components/chart-series-details/index.d.ts +1 -1
- package/lib/internal/template/internal/components/chart-series-details/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/chart-series-details/index.js.map +1 -1
- package/lib/internal/template/internal/components/chart-series-marker/index.d.ts +1 -1
- package/lib/internal/template/internal/components/chart-series-marker/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/chart-series-marker/index.js.map +1 -1
- package/lib/internal/template/internal/components/chart-status-container/index.d.ts +2 -2
- package/lib/internal/template/internal/components/chart-status-container/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/chart-status-container/index.js.map +1 -1
- package/lib/internal/template/internal/components/chart-wrapper/index.d.ts +1 -1
- package/lib/internal/template/internal/components/chart-wrapper/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/chart-wrapper/index.js.map +1 -1
- package/lib/internal/template/internal/components/checkbox-icon/index.d.ts +1 -1
- package/lib/internal/template/internal/components/checkbox-icon/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/checkbox-icon/index.js.map +1 -1
- package/lib/internal/template/internal/components/dropdown-status/index.d.ts +3 -3
- package/lib/internal/template/internal/components/dropdown-status/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/dropdown-status/index.js.map +1 -1
- package/lib/internal/template/internal/components/masked-input/interfaces.d.ts +2 -2
- package/lib/internal/template/internal/components/masked-input/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/masked-input/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/masked-input/use-mask.d.ts +1 -1
- package/lib/internal/template/internal/components/masked-input/use-mask.d.ts.map +1 -1
- package/lib/internal/template/internal/components/masked-input/use-mask.js.map +1 -1
- package/lib/internal/template/internal/components/option/interfaces.d.ts +3 -26
- package/lib/internal/template/internal/components/option/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/option/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/option/option-announcer.d.ts +1 -1
- package/lib/internal/template/internal/components/option/option-announcer.d.ts.map +1 -1
- package/lib/internal/template/internal/components/option/option-announcer.js.map +1 -1
- package/lib/internal/template/internal/components/option/utils/filter-options.d.ts +2 -1
- package/lib/internal/template/internal/components/option/utils/filter-options.d.ts.map +1 -1
- package/lib/internal/template/internal/components/option/utils/filter-options.js.map +1 -1
- package/lib/internal/template/internal/components/option/utils/flatten-options.d.ts +2 -1
- package/lib/internal/template/internal/components/option/utils/flatten-options.d.ts.map +1 -1
- package/lib/internal/template/internal/components/option/utils/flatten-options.js.map +1 -1
- package/lib/internal/template/internal/components/options-list/index.d.ts +3 -3
- package/lib/internal/template/internal/components/options-list/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/options-list/index.js +1 -1
- package/lib/internal/template/internal/components/options-list/index.js.map +1 -1
- package/lib/internal/template/internal/components/options-list/utils/use-keyboard.d.ts +1 -1
- package/lib/internal/template/internal/components/options-list/utils/use-keyboard.d.ts.map +1 -1
- package/lib/internal/template/internal/components/options-list/utils/use-keyboard.js.map +1 -1
- package/lib/internal/template/internal/components/radio-button/index.d.ts +1 -1
- package/lib/internal/template/internal/components/radio-button/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/radio-button/index.js.map +1 -1
- package/lib/internal/template/internal/components/radio-button/interfaces.d.ts +1 -128
- package/lib/internal/template/internal/components/radio-button/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/radio-button/interfaces.js +2 -0
- package/lib/internal/template/internal/components/radio-button/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/selectable-item/interfaces.d.ts +1 -1
- package/lib/internal/template/internal/components/selectable-item/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/selectable-item/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/interfaces.d.ts +3 -9
- package/lib/internal/template/internal/components/sortable-area/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/sortable-area/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/token-list/token-limit-toggle.d.ts +1 -1
- package/lib/internal/template/internal/components/token-list/token-limit-toggle.d.ts.map +1 -1
- package/lib/internal/template/internal/components/token-list/token-limit-toggle.js.map +1 -1
- package/lib/internal/template/internal/context/form-field-context.d.ts +2 -54
- package/lib/internal/template/internal/context/form-field-context.d.ts.map +1 -1
- package/lib/internal/template/internal/context/form-field-context.js.map +1 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/interfaces.d.ts +1 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/interfaces.js.map +1 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/internal.d.ts +1 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/internal.d.ts.map +1 -1
- package/lib/internal/template/internal/do-not-use/feature-prompt/internal.js.map +1 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/events/index.d.ts +2 -24
- package/lib/internal/template/internal/events/index.d.ts.map +1 -1
- package/lib/internal/template/internal/events/index.js.map +1 -1
- package/lib/internal/template/internal/generated/theming/index.cjs +6 -0
- package/lib/internal/template/internal/generated/theming/index.cjs.d.ts +27 -0
- package/lib/internal/template/internal/generated/theming/index.d.ts +27 -0
- package/lib/internal/template/internal/generated/theming/index.js +6 -0
- package/lib/internal/template/internal/hooks/check-controlled/index.d.ts +1 -1
- package/lib/internal/template/internal/hooks/check-controlled/index.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/check-controlled/index.js.map +1 -1
- package/lib/internal/template/internal/hooks/container-queries/use-container-breakpoints.d.ts +1 -1
- package/lib/internal/template/internal/hooks/container-queries/use-container-breakpoints.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/container-queries/use-container-breakpoints.js.map +1 -1
- package/lib/internal/template/internal/hooks/use-base-component/index.d.ts +1 -1
- package/lib/internal/template/internal/hooks/use-base-component/index.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/use-base-component/index.js.map +1 -1
- package/lib/internal/template/internal/hooks/use-focus-tracker.d.ts +1 -1
- package/lib/internal/template/internal/hooks/use-focus-tracker.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/use-focus-tracker.js.map +1 -1
- package/lib/internal/template/internal/plugins/controllers/drawers.d.ts +1 -1
- package/lib/internal/template/internal/plugins/controllers/drawers.d.ts.map +1 -1
- package/lib/internal/template/internal/plugins/controllers/drawers.js.map +1 -1
- package/lib/internal/template/internal/plugins/widget/interfaces.d.ts +1 -1
- package/lib/internal/template/internal/plugins/widget/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/plugins/widget/interfaces.js.map +1 -1
- package/lib/internal/template/internal/utils/date-time/interfaces.d.ts +1 -16
- package/lib/internal/template/internal/utils/date-time/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/utils/date-time/interfaces.js.map +1 -1
- package/lib/internal/template/internal/utils/with-native-attributes.d.ts +2 -1
- package/lib/internal/template/internal/utils/with-native-attributes.d.ts.map +1 -1
- package/lib/internal/template/internal/utils/with-native-attributes.js.map +1 -1
- package/lib/internal/template/item-card/interfaces.d.ts +2 -2
- package/lib/internal/template/item-card/interfaces.d.ts.map +1 -1
- package/lib/internal/template/item-card/interfaces.js.map +1 -1
- package/lib/internal/template/key-value-pairs/interfaces.d.ts +1 -1
- package/lib/internal/template/key-value-pairs/interfaces.d.ts.map +1 -1
- package/lib/internal/template/key-value-pairs/interfaces.js.map +1 -1
- package/lib/internal/template/link/interfaces.d.ts +3 -3
- package/lib/internal/template/link/interfaces.d.ts.map +1 -1
- package/lib/internal/template/link/interfaces.js.map +1 -1
- package/lib/internal/template/list/interfaces.d.ts +3 -3
- package/lib/internal/template/list/interfaces.d.ts.map +1 -1
- package/lib/internal/template/list/interfaces.js.map +1 -1
- package/lib/internal/template/live-region/interfaces.d.ts +1 -1
- package/lib/internal/template/live-region/interfaces.d.ts.map +1 -1
- package/lib/internal/template/live-region/interfaces.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-container.d.ts +1 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-container.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-container.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/format-highlighted.d.ts +1 -1
- package/lib/internal/template/mixed-line-bar-chart/format-highlighted.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/format-highlighted.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/interfaces.d.ts +1 -1
- package/lib/internal/template/mixed-line-bar-chart/interfaces.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/interfaces.js.map +1 -1
- package/lib/internal/template/modal/interfaces.d.ts +3 -3
- package/lib/internal/template/modal/interfaces.d.ts.map +1 -1
- package/lib/internal/template/modal/interfaces.js.map +1 -1
- package/lib/internal/template/multiselect/embedded.d.ts +2 -2
- package/lib/internal/template/multiselect/interfaces.d.ts +2 -2
- package/lib/internal/template/multiselect/interfaces.d.ts.map +1 -1
- package/lib/internal/template/multiselect/interfaces.js.map +1 -1
- package/lib/internal/template/multiselect/internal.d.ts +1 -1
- package/lib/internal/template/multiselect/use-multiselect.d.ts +8 -8
- package/lib/internal/template/multiselect/use-multiselect.d.ts.map +1 -1
- package/lib/internal/template/multiselect/use-multiselect.js.map +1 -1
- package/lib/internal/template/navigable-group/interfaces.d.ts +1 -1
- package/lib/internal/template/navigable-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/navigable-group/interfaces.js.map +1 -1
- package/lib/internal/template/pagination/interfaces.d.ts +1 -1
- package/lib/internal/template/pagination/interfaces.d.ts.map +1 -1
- package/lib/internal/template/pagination/interfaces.js.map +1 -1
- package/lib/internal/template/pagination/internal.d.ts.map +1 -1
- package/lib/internal/template/pagination/internal.js.map +1 -1
- package/lib/internal/template/panel-layout/interfaces.d.ts +2 -2
- package/lib/internal/template/panel-layout/interfaces.d.ts.map +1 -1
- package/lib/internal/template/panel-layout/interfaces.js.map +1 -1
- package/lib/internal/template/pie-chart/interfaces.d.ts +2 -2
- package/lib/internal/template/pie-chart/interfaces.d.ts.map +1 -1
- package/lib/internal/template/pie-chart/interfaces.js.map +1 -1
- package/lib/internal/template/popover/interfaces.d.ts +1 -1
- package/lib/internal/template/popover/interfaces.d.ts.map +1 -1
- package/lib/internal/template/popover/interfaces.js.map +1 -1
- package/lib/internal/template/popover/internal.d.ts +1 -1
- package/lib/internal/template/popover/internal.d.ts.map +1 -1
- package/lib/internal/template/popover/internal.js.map +1 -1
- package/lib/internal/template/progress-bar/interfaces.d.ts +2 -2
- package/lib/internal/template/progress-bar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/progress-bar/interfaces.js.map +1 -1
- package/lib/internal/template/prompt-input/core/menu-state.d.ts +2 -2
- package/lib/internal/template/prompt-input/core/menu-state.d.ts.map +1 -1
- package/lib/internal/template/prompt-input/core/menu-state.js.map +1 -1
- package/lib/internal/template/prompt-input/interfaces.d.ts +6 -6
- package/lib/internal/template/prompt-input/interfaces.d.ts.map +1 -1
- package/lib/internal/template/prompt-input/interfaces.js.map +1 -1
- package/lib/internal/template/property-filter/controller.d.ts +2 -2
- package/lib/internal/template/property-filter/controller.d.ts.map +1 -1
- package/lib/internal/template/property-filter/controller.js.map +1 -1
- package/lib/internal/template/property-filter/filter-options.js.map +1 -1
- package/lib/internal/template/property-filter/interfaces.d.ts +4 -4
- package/lib/internal/template/property-filter/interfaces.d.ts.map +1 -1
- package/lib/internal/template/property-filter/interfaces.js.map +1 -1
- package/lib/internal/template/property-filter/property-editor.d.ts +2 -2
- package/lib/internal/template/property-filter/property-editor.d.ts.map +1 -1
- package/lib/internal/template/property-filter/property-editor.js.map +1 -1
- package/lib/internal/template/property-filter/property-filter-autosuggest.d.ts +1 -1
- package/lib/internal/template/property-filter/property-filter-autosuggest.d.ts.map +1 -1
- package/lib/internal/template/property-filter/property-filter-autosuggest.js +1 -1
- package/lib/internal/template/property-filter/property-filter-autosuggest.js.map +1 -1
- package/lib/internal/template/property-filter/token-editor-inputs.d.ts +2 -2
- package/lib/internal/template/property-filter/token-editor-inputs.d.ts.map +1 -1
- package/lib/internal/template/property-filter/token-editor-inputs.js.map +1 -1
- package/lib/internal/template/property-filter/token-editor.d.ts +2 -2
- package/lib/internal/template/property-filter/token-editor.d.ts.map +1 -1
- package/lib/internal/template/property-filter/token-editor.js.map +1 -1
- package/lib/internal/template/property-filter/token.d.ts +2 -2
- package/lib/internal/template/property-filter/token.d.ts.map +1 -1
- package/lib/internal/template/property-filter/token.js.map +1 -1
- package/lib/internal/template/property-filter/use-load-items.d.ts +1 -1
- package/lib/internal/template/property-filter/use-load-items.d.ts.map +1 -1
- package/lib/internal/template/property-filter/use-load-items.js.map +1 -1
- package/lib/internal/template/radio-button/interfaces.d.ts +128 -2
- package/lib/internal/template/radio-button/interfaces.d.ts.map +1 -1
- package/lib/internal/template/radio-button/interfaces.js.map +1 -1
- package/lib/internal/template/radio-group/interfaces.d.ts +4 -4
- package/lib/internal/template/radio-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/radio-group/interfaces.js.map +1 -1
- package/lib/internal/template/s3-resource-selector/interfaces.d.ts +2 -2
- package/lib/internal/template/s3-resource-selector/interfaces.d.ts.map +1 -1
- package/lib/internal/template/s3-resource-selector/interfaces.js.map +1 -1
- package/lib/internal/template/s3-resource-selector/s3-in-context/index.d.ts +1 -1
- package/lib/internal/template/s3-resource-selector/s3-in-context/index.d.ts.map +1 -1
- package/lib/internal/template/s3-resource-selector/s3-in-context/index.js.map +1 -1
- package/lib/internal/template/s3-resource-selector/s3-in-context/use-versions-fetch.d.ts +1 -1
- package/lib/internal/template/segmented-control/interfaces.d.ts +2 -2
- package/lib/internal/template/segmented-control/interfaces.d.ts.map +1 -1
- package/lib/internal/template/segmented-control/interfaces.js.map +1 -1
- package/lib/internal/template/select/interfaces.d.ts +5 -5
- package/lib/internal/template/select/interfaces.d.ts.map +1 -1
- package/lib/internal/template/select/interfaces.js.map +1 -1
- package/lib/internal/template/select/internal.d.ts.map +1 -1
- package/lib/internal/template/select/internal.js.map +1 -1
- package/lib/internal/template/select/parts/item.d.ts.map +1 -1
- package/lib/internal/template/select/parts/item.js.map +1 -1
- package/lib/internal/template/select/parts/multiselect-item.d.ts.map +1 -1
- package/lib/internal/template/select/parts/multiselect-item.js.map +1 -1
- package/lib/internal/template/select/parts/trigger.d.ts +2 -2
- package/lib/internal/template/select/parts/trigger.d.ts.map +1 -1
- package/lib/internal/template/select/parts/trigger.js.map +1 -1
- package/lib/internal/template/select/utils/connect-options.d.ts +2 -1
- package/lib/internal/template/select/utils/connect-options.d.ts.map +1 -1
- package/lib/internal/template/select/utils/connect-options.js.map +1 -1
- package/lib/internal/template/select/utils/use-announcement.d.ts +1 -1
- package/lib/internal/template/select/utils/use-announcement.d.ts.map +1 -1
- package/lib/internal/template/select/utils/use-announcement.js.map +1 -1
- package/lib/internal/template/select/utils/use-load-items.d.ts +2 -2
- package/lib/internal/template/select/utils/use-load-items.d.ts.map +1 -1
- package/lib/internal/template/select/utils/use-load-items.js.map +1 -1
- package/lib/internal/template/select/utils/use-native-search.d.ts +2 -1
- package/lib/internal/template/select/utils/use-native-search.d.ts.map +1 -1
- package/lib/internal/template/select/utils/use-native-search.js.map +1 -1
- package/lib/internal/template/select/utils/use-select.d.ts +4 -3
- package/lib/internal/template/select/utils/use-select.d.ts.map +1 -1
- package/lib/internal/template/select/utils/use-select.js.map +1 -1
- package/lib/internal/template/side-navigation/interfaces.d.ts +2 -2
- package/lib/internal/template/side-navigation/interfaces.d.ts.map +1 -1
- package/lib/internal/template/side-navigation/interfaces.js.map +1 -1
- package/lib/internal/template/side-navigation/parts.d.ts.map +1 -1
- package/lib/internal/template/side-navigation/parts.js.map +1 -1
- package/lib/internal/template/skeleton/interfaces.d.ts +1 -1
- package/lib/internal/template/skeleton/interfaces.d.ts.map +1 -1
- package/lib/internal/template/skeleton/interfaces.js.map +1 -1
- package/lib/internal/template/slider/interfaces.d.ts +3 -3
- package/lib/internal/template/slider/interfaces.d.ts.map +1 -1
- package/lib/internal/template/slider/interfaces.js.map +1 -1
- package/lib/internal/template/space-between/interfaces.d.ts +2 -2
- package/lib/internal/template/space-between/interfaces.d.ts.map +1 -1
- package/lib/internal/template/space-between/interfaces.js.map +1 -1
- package/lib/internal/template/spinner/interfaces.d.ts +2 -2
- package/lib/internal/template/spinner/interfaces.d.ts.map +1 -1
- package/lib/internal/template/spinner/interfaces.js.map +1 -1
- package/lib/internal/template/split-panel/interfaces.d.ts +1 -1
- package/lib/internal/template/split-panel/interfaces.d.ts.map +1 -1
- package/lib/internal/template/split-panel/interfaces.js.map +1 -1
- package/lib/internal/template/status-indicator/interfaces.d.ts +2 -2
- package/lib/internal/template/status-indicator/interfaces.d.ts.map +1 -1
- package/lib/internal/template/status-indicator/interfaces.js.map +1 -1
- package/lib/internal/template/steps/interfaces.d.ts +1 -1
- package/lib/internal/template/steps/interfaces.d.ts.map +1 -1
- package/lib/internal/template/steps/interfaces.js.map +1 -1
- package/lib/internal/template/table/interfaces.d.ts +2 -2
- package/lib/internal/template/table/interfaces.d.ts.map +1 -1
- package/lib/internal/template/table/interfaces.js.map +1 -1
- package/lib/internal/template/table/thead.d.ts +1 -1
- package/lib/internal/template/table/thead.d.ts.map +1 -1
- package/lib/internal/template/table/thead.js.map +1 -1
- package/lib/internal/template/table/use-cell-editing.d.ts +1 -1
- package/lib/internal/template/table/use-cell-editing.d.ts.map +1 -1
- package/lib/internal/template/table/use-cell-editing.js.map +1 -1
- package/lib/internal/template/tabs/interfaces.d.ts +2 -2
- package/lib/internal/template/tabs/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tabs/interfaces.js.map +1 -1
- package/lib/internal/template/tag-editor/index.d.ts.map +1 -1
- package/lib/internal/template/tag-editor/index.js.map +1 -1
- package/lib/internal/template/tag-editor/interfaces.d.ts +2 -2
- package/lib/internal/template/tag-editor/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tag-editor/interfaces.js.map +1 -1
- package/lib/internal/template/tag-editor/internal.js.map +1 -1
- package/lib/internal/template/text-content/interfaces.d.ts +1 -1
- package/lib/internal/template/text-content/interfaces.d.ts.map +1 -1
- package/lib/internal/template/text-content/interfaces.js.map +1 -1
- package/lib/internal/template/text-filter/interfaces.d.ts +3 -3
- package/lib/internal/template/text-filter/interfaces.d.ts.map +1 -1
- package/lib/internal/template/text-filter/interfaces.js.map +1 -1
- package/lib/internal/template/textarea/interfaces.d.ts +4 -4
- package/lib/internal/template/textarea/interfaces.d.ts.map +1 -1
- package/lib/internal/template/textarea/interfaces.js.map +1 -1
- package/lib/internal/template/tiles/interfaces.d.ts +4 -4
- package/lib/internal/template/tiles/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tiles/interfaces.js.map +1 -1
- package/lib/internal/template/time-input/interfaces.d.ts +2 -2
- package/lib/internal/template/time-input/interfaces.d.ts.map +1 -1
- package/lib/internal/template/time-input/interfaces.js.map +1 -1
- package/lib/internal/template/toggle/interfaces.d.ts +2 -2
- package/lib/internal/template/toggle/interfaces.d.ts.map +1 -1
- package/lib/internal/template/toggle/interfaces.js.map +1 -1
- package/lib/internal/template/toggle-button/interfaces.d.ts +2 -2
- package/lib/internal/template/toggle-button/interfaces.d.ts.map +1 -1
- package/lib/internal/template/toggle-button/interfaces.js.map +1 -1
- package/lib/internal/template/token/dismiss-button.d.ts +1 -1
- package/lib/internal/template/token/dismiss-button.d.ts.map +1 -1
- package/lib/internal/template/token/dismiss-button.js.map +1 -1
- package/lib/internal/template/token/interfaces.d.ts +2 -2
- package/lib/internal/template/token/interfaces.d.ts.map +1 -1
- package/lib/internal/template/token/interfaces.js.map +1 -1
- package/lib/internal/template/token-group/interfaces.d.ts +2 -2
- package/lib/internal/template/token-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/token-group/interfaces.js.map +1 -1
- package/lib/internal/template/tooltip/interfaces.d.ts +1 -1
- package/lib/internal/template/tooltip/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tooltip/interfaces.js.map +1 -1
- package/lib/internal/template/top-navigation/interfaces.d.ts +2 -2
- package/lib/internal/template/top-navigation/interfaces.d.ts.map +1 -1
- package/lib/internal/template/top-navigation/interfaces.js.map +1 -1
- package/lib/internal/template/tree-view/interfaces.d.ts +2 -2
- package/lib/internal/template/tree-view/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tree-view/interfaces.js.map +1 -1
- package/lib/internal/template/truncated-text/interfaces.d.ts +1 -1
- package/lib/internal/template/truncated-text/interfaces.d.ts.map +1 -1
- package/lib/internal/template/truncated-text/interfaces.js.map +1 -1
- package/lib/internal/template/tutorial-panel/index.js.map +1 -1
- package/lib/internal/template/tutorial-panel/interfaces.d.ts +2 -2
- package/lib/internal/template/tutorial-panel/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tutorial-panel/interfaces.js.map +1 -1
- package/lib/internal/template/types/analytics.d.ts +16 -0
- package/lib/internal/template/types/analytics.d.ts.map +1 -0
- package/lib/internal/template/types/analytics.js +4 -0
- package/lib/internal/template/types/analytics.js.map +1 -0
- package/lib/internal/template/types/base-component.d.ts +15 -0
- package/lib/internal/template/types/base-component.d.ts.map +1 -0
- package/lib/internal/template/types/base-component.js +4 -0
- package/lib/internal/template/types/base-component.js.map +1 -0
- package/lib/internal/template/types/breakpoint.d.ts +2 -0
- package/lib/internal/template/types/breakpoint.d.ts.map +1 -0
- package/lib/internal/template/types/breakpoint.js +2 -0
- package/lib/internal/template/types/breakpoint.js.map +1 -0
- package/lib/internal/template/types/cartesian-chart.d.ts +210 -0
- package/lib/internal/template/types/cartesian-chart.d.ts.map +1 -0
- package/lib/internal/template/types/cartesian-chart.js +2 -0
- package/lib/internal/template/types/cartesian-chart.js.map +1 -0
- package/lib/internal/template/types/date-time.d.ts +17 -0
- package/lib/internal/template/types/date-time.d.ts.map +1 -0
- package/lib/internal/template/types/date-time.js +4 -0
- package/lib/internal/template/types/date-time.js.map +1 -0
- package/lib/internal/template/{internal/components/dropdown-status/interfaces.d.ts → types/dropdown-status.d.ts} +1 -1
- package/lib/internal/template/types/dropdown-status.d.ts.map +1 -0
- package/lib/internal/template/types/dropdown-status.js +2 -0
- package/lib/internal/template/types/dropdown-status.js.map +1 -0
- package/lib/internal/template/types/events.d.ts +25 -0
- package/lib/internal/template/types/events.d.ts.map +1 -0
- package/lib/internal/template/types/events.js +4 -0
- package/lib/internal/template/types/events.js.map +1 -0
- package/lib/internal/template/types/form-field.d.ts +55 -0
- package/lib/internal/template/types/form-field.d.ts.map +1 -0
- package/lib/internal/template/types/form-field.js +4 -0
- package/lib/internal/template/types/form-field.js.map +1 -0
- package/lib/internal/template/types/native-attributes.d.ts +3 -0
- package/lib/internal/template/types/native-attributes.d.ts.map +1 -0
- package/lib/internal/template/types/native-attributes.js +2 -0
- package/lib/internal/template/types/native-attributes.js.map +1 -0
- package/lib/internal/template/types/option.d.ts +27 -0
- package/lib/internal/template/types/option.d.ts.map +1 -0
- package/lib/internal/template/types/option.js +2 -0
- package/lib/internal/template/types/option.js.map +1 -0
- package/lib/internal/template/types/sortable-area.d.ts +9 -0
- package/lib/internal/template/types/sortable-area.d.ts.map +1 -0
- package/lib/internal/template/types/sortable-area.js +4 -0
- package/lib/internal/template/types/sortable-area.js.map +1 -0
- package/lib/internal/template/wizard/interfaces.d.ts +3 -3
- package/lib/internal/template/wizard/interfaces.d.ts.map +1 -1
- package/lib/internal/template/wizard/interfaces.js.map +1 -1
- package/package.json +1 -1
- package/lib/internal/template/internal/components/dropdown-status/interfaces.d.ts.map +0 -1
- package/lib/internal/template/internal/components/dropdown-status/interfaces.js +0 -2
- package/lib/internal/template/internal/components/dropdown-status/interfaces.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/area-chart/model/utils.ts"],"names":[],"mappings":"AAOA,8BAA8B;AAC9B,kEAAkE;AAClE,sGAAsG;AACtG,MAAM,OAAO,GAAG,eAAe,CAAC;AAEhC,8EAA8E;AAC9E,MAAM,UAAU,cAAc,CAA2B,MAA2C;IAClG,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IAEnC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,EAA2B,CAAC;IACrC,CAAC;IAED,+BAA+B;IAC/B,+CAA+C;IAC/C,IAAI,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC,OAAO,CAA0B,CAAC;IAChD,CAAC;IAED,sDAAsD;IACtD,OAAO,OAAO,CAAC,MAAM,CACnB,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EACzD,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CACA,CAAC;AAC7B,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,cAAc,CAAI,MAA2C,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,EAAE,CAAC;YACpB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACf,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ChartDataTypes, XDomain, YDomain, YScaleType } from '../../internal/components/cartesian-chart/interfaces';\nimport { ChartScale, NumericChartScale } from '../../internal/components/cartesian-chart/scales';\nimport { AreaChartProps } from '../interfaces';\nimport { ChartModel } from './index';\n\n// A sufficiently small value.\n// The Number.EPSILON is not available in the target ECMA version.\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON\nconst EPSILON = 0.0000000000001;\n\n// When x-domain is not set explicitly - guess it based on the available data.\nexport function computeDomainX<T extends ChartDataTypes>(series: readonly AreaChartProps.Series<T>[]): XDomain<T> {\n const xValues = getXValues(series);\n\n if (xValues.length === 0) {\n return [] as unknown as XDomain<T>;\n }\n\n // Assuming categorical domain.\n // In that case, all values are to be included.\n if (typeof xValues[0] === 'string') {\n return uniq(xValues) as unknown as XDomain<T>;\n }\n\n // For non-categorical domain find min and max bounds.\n return xValues.reduce(\n ([min, max], x) => [x < min ? x : min, max < x ? x : max],\n [xValues[0], xValues[0]]\n ) as unknown as XDomain<T>;\n}\n\n// When y-domain is not set explicitly - guess it based on the available data and series.\nexport function computeDomainY<T>(series: readonly AreaChartProps.Series<T>[], scaleType: YScaleType): YDomain {\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n\n // Find the min and max for threshold series.\n series.forEach(s => {\n if (s.type === 'threshold') {\n min = Math.min(min, s.y);\n max = Math.max(max, s.y);\n }\n });\n\n // Find the min and max for area series considering their stacking.\n getXValues(series).forEach((_, xIndex) => {\n // Maintains the prev stack level.\n let stackY = scaleType === 'linear' ? 0 : EPSILON;\n\n for (const s of series) {\n if (s.type === 'area') {\n stackY = stackY + (s.data[xIndex]?.y || 0);\n min = Math.min(min, stackY);\n max = Math.max(max, stackY);\n }\n }\n });\n\n // If min/max is not overridden than either series or series data is empty.\n if (min === Number.POSITIVE_INFINITY) {\n return [];\n }\n\n // Log scales can't start from 0, so, if possible, start from 1.\n if (scaleType === 'log' && min === 0 && max > 1) {\n return [1, max];\n }\n\n return [min, max];\n}\n\n// For given data, series and scales, compute all points and group them as\n// x:y, x:series and series:x to allow constant time access to the required point or subset.\nexport function computePlotPoints<T>(\n series: readonly AreaChartProps.Series<T>[],\n xScale: ChartScale,\n yScale: NumericChartScale\n): {\n xy: ChartModel.PlotPoint<T>[][];\n xs: ChartModel.PlotPoint<T>[][];\n sx: ChartModel.PlotPoint<T>[][];\n} {\n const xValues = getXValues(series);\n\n // Lookup for xy[xIndex][yIndex]\n const xy: ChartModel.PlotPoint<T>[][] = [];\n // Lookup for xs[xIndex][seriesIndex]\n const xs: ChartModel.PlotPoint<T>[][] = [];\n // Lookup for sx[seriesIndex][xIndex]\n const sx: ChartModel.PlotPoint<T>[][] = [];\n\n // Filter out the data which is beyond the plot for whatever reason.\n getVisibleData(xValues, xScale).forEach(({ x, scaledX }, xIndex) => {\n // Maintains the prev stack level. Starting from epsilon to not break log scales.\n let stackY = yScale.scaleType === 'linear' ? 0 : EPSILON;\n\n // A column of series points related to the same x.\n const points: ChartModel.PlotPoint<T>[] = [];\n\n // Collect the points, leaving y-index as 0 for now.\n series.forEach((s, sIndex) => {\n if (s.type === 'threshold') {\n const scaledY = yScale.d3Scale(s.y) || 0;\n points.push({\n x: x,\n y0: s.y,\n y1: s.y,\n scaled: { x: scaledX, y0: scaledY, y1: scaledY },\n index: { x: xIndex, s: sIndex, y: 0 },\n value: 0,\n });\n } else {\n const value = s.data[xIndex]?.y || 0;\n const y0 = stackY;\n const y1 = stackY + value;\n points.push({\n x: x,\n y0: y0,\n y1: y1,\n scaled: { x: scaledX, y0: yScale.d3Scale(y0) || 0, y1: yScale.d3Scale(y1) || 0 },\n index: { x: xIndex, s: sIndex, y: 0 },\n value: value,\n });\n\n stackY = y1;\n }\n });\n\n // Sort points by y and insert the missing y-index.\n points\n .sort((p1, p2) => p1.y1 - p2.y1)\n .forEach((point, index) => {\n point.index.y = index;\n\n // Insert the points to the respective two-dimensional lookup arrays.\n insertIntoMatrix(xy, point.index.x, point.index.y, point);\n insertIntoMatrix(xs, point.index.x, point.index.s, point);\n insertIntoMatrix(sx, point.index.s, point.index.x, point);\n });\n });\n\n return { xy, xs, sx };\n}\n\n// Finds the closest point in the sorted array.\nexport function findClosest<T>(sortedArray: readonly T[], target: number, getter: (item: T) => number): null | T {\n // The method guarantees to return a point hence empty arrays are not allowed.\n if (sortedArray.length === 0) {\n return null;\n }\n const isAscending = getter(sortedArray[0]) < getter(sortedArray[sortedArray.length - 1]);\n const compare = (x: T) => (isAscending ? getter(x) < target : getter(x) > target);\n const delta = (x: T) => Math.abs(getter(x) - target);\n\n // Use binary search to find the closest value in a sorted array.\n let lo = 0;\n let hi = sortedArray.length - 1;\n while (hi - lo > 1) {\n const mid = Math.floor((lo + hi) / 2);\n if (compare(sortedArray[mid])) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return delta(sortedArray[lo]) < delta(sortedArray[hi]) ? sortedArray[lo] : sortedArray[hi];\n}\n\n// Compares all x-values between series to ensure they are consistent.\nexport function isSeriesValid<T>(series: readonly AreaChartProps.Series<T>[]) {\n const sampleXValues = getXValues(series);\n\n for (const s of series) {\n if (s.type === 'area') {\n for (let i = 0; i < Math.max(s.data.length, sampleXValues.length); i++) {\n if (s.data[i]?.x !== sampleXValues[i]) {\n return false;\n }\n }\n }\n }\n\n return true;\n}\n\n// Takes first area series x-values as all data x-values are to match across series.\nfunction getXValues<T>(series: readonly AreaChartProps.Series<T>[]) {\n for (const s of series) {\n if (s.type === 'area') {\n return s.data.map(({ x }) => x);\n }\n }\n\n return [];\n}\n\n// Returns data that is visible in the given scale.\nfunction getVisibleData<T>(data: readonly T[], xScale: ChartScale) {\n const scaledOffsetX = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0;\n\n const visibleData = [];\n for (const x of data) {\n const scaledX = xScale.d3Scale(x as any);\n\n if (scaledX !== undefined) {\n visibleData.push({ x, scaledX: scaledX + scaledOffsetX });\n }\n }\n return visibleData;\n}\n\n// Inserts given value into a two-dimensional array.\nfunction insertIntoMatrix<T>(matrix: T[][], row: number, col: number, value: T) {\n if (!matrix[row]) {\n matrix[row] = [];\n }\n matrix[row][col] = value;\n}\n\n// Creates new array with only unique elements of the given array.\nfunction uniq<T>(arr: readonly T[]): readonly T[] {\n const set = new Set();\n const uniqArray: T[] = [];\n\n for (const value of arr) {\n if (!set.has(value)) {\n set.add(value);\n uniqArray.push(value);\n }\n }\n\n return uniqArray;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/area-chart/model/utils.ts"],"names":[],"mappings":"AAOA,8BAA8B;AAC9B,kEAAkE;AAClE,sGAAsG;AACtG,MAAM,OAAO,GAAG,eAAe,CAAC;AAEhC,8EAA8E;AAC9E,MAAM,UAAU,cAAc,CAA2B,MAA2C;IAClG,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IAEnC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,EAA2B,CAAC;IACrC,CAAC;IAED,+BAA+B;IAC/B,+CAA+C;IAC/C,IAAI,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC,OAAO,CAA0B,CAAC;IAChD,CAAC;IAED,sDAAsD;IACtD,OAAO,OAAO,CAAC,MAAM,CACnB,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC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AC3B,CAAC;AAED,kEAAkE;AAClE,SAAS,IAAI,CAAI,GAAiB;IAChC,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;IACtB,MAAM,SAAS,GAAQ,EAAE,CAAC;IAE1B,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YACpB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACf,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ChartScale, NumericChartScale } from '../../internal/components/cartesian-chart/scales';\nimport { ChartDataTypes, XDomain, YDomain, YScaleType } from '../../types/cartesian-chart';\nimport { AreaChartProps } from '../interfaces';\nimport { ChartModel } from './index';\n\n// A sufficiently small value.\n// The Number.EPSILON is not available in the target ECMA version.\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON\nconst EPSILON = 0.0000000000001;\n\n// When x-domain is not set explicitly - guess it based on the available data.\nexport function computeDomainX<T extends ChartDataTypes>(series: readonly AreaChartProps.Series<T>[]): XDomain<T> {\n const xValues = getXValues(series);\n\n if (xValues.length === 0) {\n return [] as unknown as XDomain<T>;\n }\n\n // Assuming categorical domain.\n // In that case, all values are to be included.\n if (typeof xValues[0] === 'string') {\n return uniq(xValues) as unknown as XDomain<T>;\n }\n\n // For non-categorical domain find min and max bounds.\n return xValues.reduce(\n ([min, max], x) => [x < min ? x : min, max < x ? x : max],\n [xValues[0], xValues[0]]\n ) as unknown as XDomain<T>;\n}\n\n// When y-domain is not set explicitly - guess it based on the available data and series.\nexport function computeDomainY<T>(series: readonly AreaChartProps.Series<T>[], scaleType: YScaleType): YDomain {\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n\n // Find the min and max for threshold series.\n series.forEach(s => {\n if (s.type === 'threshold') {\n min = Math.min(min, s.y);\n max = Math.max(max, s.y);\n }\n });\n\n // Find the min and max for area series considering their stacking.\n getXValues(series).forEach((_, xIndex) => {\n // Maintains the prev stack level.\n let stackY = scaleType === 'linear' ? 0 : EPSILON;\n\n for (const s of series) {\n if (s.type === 'area') {\n stackY = stackY + (s.data[xIndex]?.y || 0);\n min = Math.min(min, stackY);\n max = Math.max(max, stackY);\n }\n }\n });\n\n // If min/max is not overridden than either series or series data is empty.\n if (min === Number.POSITIVE_INFINITY) {\n return [];\n }\n\n // Log scales can't start from 0, so, if possible, start from 1.\n if (scaleType === 'log' && min === 0 && max > 1) {\n return [1, max];\n }\n\n return [min, max];\n}\n\n// For given data, series and scales, compute all points and group them as\n// x:y, x:series and series:x to allow constant time access to the required point or subset.\nexport function computePlotPoints<T>(\n series: readonly AreaChartProps.Series<T>[],\n xScale: ChartScale,\n yScale: NumericChartScale\n): {\n xy: ChartModel.PlotPoint<T>[][];\n xs: ChartModel.PlotPoint<T>[][];\n sx: ChartModel.PlotPoint<T>[][];\n} {\n const xValues = getXValues(series);\n\n // Lookup for xy[xIndex][yIndex]\n const xy: ChartModel.PlotPoint<T>[][] = [];\n // Lookup for xs[xIndex][seriesIndex]\n const xs: ChartModel.PlotPoint<T>[][] = [];\n // Lookup for sx[seriesIndex][xIndex]\n const sx: ChartModel.PlotPoint<T>[][] = [];\n\n // Filter out the data which is beyond the plot for whatever reason.\n getVisibleData(xValues, xScale).forEach(({ x, scaledX }, xIndex) => {\n // Maintains the prev stack level. Starting from epsilon to not break log scales.\n let stackY = yScale.scaleType === 'linear' ? 0 : EPSILON;\n\n // A column of series points related to the same x.\n const points: ChartModel.PlotPoint<T>[] = [];\n\n // Collect the points, leaving y-index as 0 for now.\n series.forEach((s, sIndex) => {\n if (s.type === 'threshold') {\n const scaledY = yScale.d3Scale(s.y) || 0;\n points.push({\n x: x,\n y0: s.y,\n y1: s.y,\n scaled: { x: scaledX, y0: scaledY, y1: scaledY },\n index: { x: xIndex, s: sIndex, y: 0 },\n value: 0,\n });\n } else {\n const value = s.data[xIndex]?.y || 0;\n const y0 = stackY;\n const y1 = stackY + value;\n points.push({\n x: x,\n y0: y0,\n y1: y1,\n scaled: { x: scaledX, y0: yScale.d3Scale(y0) || 0, y1: yScale.d3Scale(y1) || 0 },\n index: { x: xIndex, s: sIndex, y: 0 },\n value: value,\n });\n\n stackY = y1;\n }\n });\n\n // Sort points by y and insert the missing y-index.\n points\n .sort((p1, p2) => p1.y1 - p2.y1)\n .forEach((point, index) => {\n point.index.y = index;\n\n // Insert the points to the respective two-dimensional lookup arrays.\n insertIntoMatrix(xy, point.index.x, point.index.y, point);\n insertIntoMatrix(xs, point.index.x, point.index.s, point);\n insertIntoMatrix(sx, point.index.s, point.index.x, point);\n });\n });\n\n return { xy, xs, sx };\n}\n\n// Finds the closest point in the sorted array.\nexport function findClosest<T>(sortedArray: readonly T[], target: number, getter: (item: T) => number): null | T {\n // The method guarantees to return a point hence empty arrays are not allowed.\n if (sortedArray.length === 0) {\n return null;\n }\n const isAscending = getter(sortedArray[0]) < getter(sortedArray[sortedArray.length - 1]);\n const compare = (x: T) => (isAscending ? getter(x) < target : getter(x) > target);\n const delta = (x: T) => Math.abs(getter(x) - target);\n\n // Use binary search to find the closest value in a sorted array.\n let lo = 0;\n let hi = sortedArray.length - 1;\n while (hi - lo > 1) {\n const mid = Math.floor((lo + hi) / 2);\n if (compare(sortedArray[mid])) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return delta(sortedArray[lo]) < delta(sortedArray[hi]) ? sortedArray[lo] : sortedArray[hi];\n}\n\n// Compares all x-values between series to ensure they are consistent.\nexport function isSeriesValid<T>(series: readonly AreaChartProps.Series<T>[]) {\n const sampleXValues = getXValues(series);\n\n for (const s of series) {\n if (s.type === 'area') {\n for (let i = 0; i < Math.max(s.data.length, sampleXValues.length); i++) {\n if (s.data[i]?.x !== sampleXValues[i]) {\n return false;\n }\n }\n }\n }\n\n return true;\n}\n\n// Takes first area series x-values as all data x-values are to match across series.\nfunction getXValues<T>(series: readonly AreaChartProps.Series<T>[]) {\n for (const s of series) {\n if (s.type === 'area') {\n return s.data.map(({ x }) => x);\n }\n }\n\n return [];\n}\n\n// Returns data that is visible in the given scale.\nfunction getVisibleData<T>(data: readonly T[], xScale: ChartScale) {\n const scaledOffsetX = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0;\n\n const visibleData = [];\n for (const x of data) {\n const scaledX = xScale.d3Scale(x as any);\n\n if (scaledX !== undefined) {\n visibleData.push({ x, scaledX: scaledX + scaledOffsetX });\n }\n }\n return visibleData;\n}\n\n// Inserts given value into a two-dimensional array.\nfunction insertIntoMatrix<T>(matrix: T[][], row: number, col: number, value: T) {\n if (!matrix[row]) {\n matrix[row] = [];\n }\n matrix[row][col] = value;\n}\n\n// Creates new array with only unique elements of the given array.\nfunction uniq<T>(arr: readonly T[]): readonly T[] {\n const set = new Set();\n const uniqArray: T[] = [];\n\n for (const value of arr) {\n if (!set.has(value)) {\n set.add(value);\n uniqArray.push(value);\n }\n }\n\n return uniqArray;\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ButtonDropdownProps } from '../button-dropdown/interfaces';
|
|
3
|
-
import { BaseComponentProps } from '../
|
|
4
|
-
import { Breakpoint as InternalBreakpoint } from '../
|
|
5
|
-
import { NonCancelableEventHandler } from '../
|
|
3
|
+
import { BaseComponentProps } from '../types/base-component';
|
|
4
|
+
import { Breakpoint as InternalBreakpoint } from '../types/breakpoint';
|
|
5
|
+
import { NonCancelableEventHandler } from '../types/events';
|
|
6
6
|
export interface AttributeEditorForwardRefType {
|
|
7
7
|
<T>(props: AttributeEditorProps<T> & {
|
|
8
8
|
ref?: React.Ref<AttributeEditorProps.Ref>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/attribute-editor/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/attribute-editor/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAY5D,MAAM,WAAW,6BAA6B;IAC5C,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG;QAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAA;KAAE,GAAG,GAAG,CAAC,OAAO,CAAC;CAClG;AAED,yBAAiB,oBAAoB,CAAC;IACpC,UAAiB,uBAAuB,CAAC,CAAC;QACxC,CAAC,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC;KACpB;IAED,KAAY,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;IACjF,UAAiB,eAAe,CAAC,CAAC;QAChC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QAC9B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,OAAO,CAAC,EAAE,eA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gBAAgB,CAAC,EAAE,yBAAyB,CAAC;IAE7C;;;OAGG;IACH,mBAAmB,CAAC,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;IAE9F;;;OAGG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CACnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/attribute-editor/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces';\nimport { BaseComponentProps } from '../
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/attribute-editor/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces';\nimport { BaseComponentProps } from '../types/base-component';\nimport { Breakpoint as InternalBreakpoint } from '../types/breakpoint';\nimport { NonCancelableEventHandler } from '../types/events';\n\n/*\n * HACK: Cast the component to a named parametrized interface.\n *\n * This lets us use React.forwardRef and still let the component have type\n * parameters, and the naming convention lets the documenter know that this is\n * a forwardRef-wrapped component.\n *\n * We don't need to expose this type to customers because it's just a simple\n * function type.\n */\nexport interface AttributeEditorForwardRefType {\n <T>(props: AttributeEditorProps<T> & { ref?: React.Ref<AttributeEditorProps.Ref> }): JSX.Element;\n}\n\nexport namespace AttributeEditorProps {\n export interface IsItemRemovableFunction<T> {\n (item: T): boolean;\n }\n\n export type FieldRenderable<T> = (item: T, itemIndex: number) => React.ReactNode;\n export interface FieldDefinition<T> {\n label?: React.ReactNode;\n description?: React.ReactNode;\n info?: React.ReactNode;\n control?: FieldRenderable<T> | React.ReactNode;\n errorText?: FieldRenderable<T> | React.ReactNode;\n warningText?: FieldRenderable<T> | React.ReactNode;\n constraintText?: FieldRenderable<T> | React.ReactNode;\n }\n\n export type AddButtonVariant = 'normal' | 'inline-link';\n\n export interface RemoveButtonClickDetail {\n itemIndex: number;\n }\n\n export interface Ref {\n /**\n * Focuses the 'remove' button for the given row index.\n */\n focusRemoveButton(itemIndex: number): void;\n /**\n * Focuses the 'add' button. Use this, for example, after a user removes the last row.\n */\n focusAddButton(): void;\n }\n\n export interface RowActionsProps<T> {\n item: T;\n itemIndex: number;\n ref: React.Ref<ButtonDropdownProps.Ref>;\n breakpoint: Breakpoint | null;\n ownRow: boolean;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export interface I18nStrings<T = any> {\n /**\n * Provides a text alternative for the error icon in the error message.\n */\n errorIconAriaLabel?: string;\n\n /**\n * Provides a text alternative for the warning icon in the warning message.\n */\n warningIconAriaLabel?: string;\n\n /**\n * Announcement made to screen readers when an item is removed.\n */\n itemRemovedAriaLive?: string;\n\n /**\n * @deprecated Use `removeButtonAriaLabel` on the component instead.\n */\n removeButtonAriaLabel?: (item: T) => string;\n }\n\n export type Breakpoint = InternalBreakpoint;\n\n export interface GridLayout {\n breakpoint?: Breakpoint;\n rows: ReadonlyArray<ReadonlyArray<number>>;\n removeButton?: {\n ownRow?: boolean;\n width?: number | 'auto';\n };\n }\n}\n\nexport interface AttributeEditorProps<T> extends BaseComponentProps {\n /**\n * Displayed when there are no items to display.\n */\n empty?: React.ReactNode;\n\n /**\n * Displayed below the add button. Use it for additional information related to the attribute editor.\n */\n additionalInfo?: React.ReactNode;\n\n /**\n * Specifies the text that's displayed in the add button.\n */\n addButtonText: string;\n\n /**\n * Specifies the text that's displayed in the remove button.\n * @i18n\n */\n removeButtonText?: string;\n\n /**\n * Adds an `aria-label` to the remove button.\n */\n removeButtonAriaLabel?: (item: T) => string;\n\n /**\n * Specifies the items that serve as the data source for all rows.\n * The display of a row is handled by the `definition` property.\n */\n items?: ReadonlyArray<T>;\n\n /**\n * Function that determines whether an item is removable. When this function returns `false`, the remove\n * button is not rendered and the user can't remove the item.\n * By default, all items are removable.\n */\n isItemRemovable?: AttributeEditorProps.IsItemRemovableFunction<T>;\n\n /**\n * Determines whether the add button is disabled.\n */\n disableAddButton?: boolean;\n\n /**\n * Determines whether the add button is hidden\n */\n hideAddButton?: boolean;\n\n /**\n * Specifies additional actions displayed next to the add-button (or instead of the add-button if hidden).\n */\n additionalActions?: React.ReactNode;\n\n /**\n * Specifies the variant to use for the add button. By default a normal button is used.\n * Use `inline-link` when using an attribute editor nested inside complex attribute editing\n * with expandable sections.\n */\n addButtonVariant?: AttributeEditorProps.AddButtonVariant;\n\n /**\n * Defines the editor configuration. Each object in the array represents one form field in the row.\n * If more than 6 attributes are specified, a `gridLayout` must be provided.\n *\n * * `label` (ReactNode) - Text label for the form field.\n * * `description` (ReactNode) - Additional description for the form field.\n * * `info` (ReactNode) - Info link for the form field.\n * * `errorText` ((item, itemIndex) => ReactNode) - Error message text to display as a control validation message.\n * It renders the form field as invalid if the returned value is not `null` or `undefined`.\n * * `warningText` ((item, itemIndex) => ReactNode) - Warning message text to display as a control validation message.\n * It renders the form field in a warning state if the returned value is not `null` or `undefined`.\n * * `constraintText` ((item, itemIndex) => ReactNode) - Text to display as a constraint message below the field.\n * * `control` ((item, itemIndex) => ReactNode) - A control to use as the input for the field.\n */\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n\n /**\n * Optionally specifies the layout of the attributes. By default, all attributes will be\n * equally spaced and wrapped into multiple rows on smaller viewports.\n *\n * A `gridLayout` is an array of breakpoint definitions. Each definition consists of:\n * - `rows` (`number[][]`): the rows in which to display the attributes. Each row consists of a list of numbers indicating\n * the relative width of each attribute. For example, `[[1, 1, 1, 1]]` is a single row of four evenly-spaced attributes,\n * or `[[1, 2], [1, 1, 1]]` splits five attributes onto two rows.\n * - `breakpoint` (`string`): optionally specifies that the given entry should only be used when at least that much width is available.\n * - `removeButton`: optionally configures the remove (or row action) button placement. If this is not provided, the button will be\n * placed at the end of a single row, or below if multiple rows are present. The `removeButton` property supports contains two properties:\n * - `ownRow` (`boolean`): forces the remove button onto its own row.\n * - `width` (`number | 'auto'`): a number indicating the relative width (equivalent to a `rows` entry), or 'auto' to fit to the button width.\n */\n gridLayout?: ReadonlyArray<AttributeEditorProps.GridLayout>;\n\n /**\n * Specifies a custom action trigger for each row, in place of the remove button.\n * Only button and button dropdown components are supported.\n * If you provide this, `removeButtonText`, `removeButtonAriaLabel`,\n * and `onRemoveButtonClick` will be ignored.\n * The trigger must be given the provided `ref` in order for `focusRemoveButton`\n * to work.\n * The function receives the following properties:\n * - `item`: The item being rendered in the current row.\n * - `itemIndex` (`number`): The index of the item.\n * - `ref` (`ReactRef`): A React ref that should be passed to the rendered button.\n * - `breakpoint` (`Breakpoint`): The current breakpoint, for responsive behavior.\n * - `ownRow` (`boolean`): Whether the button is rendered on its own row.\n */\n customRowActions?: (props: AttributeEditorProps.RowActionsProps<T>) => React.ReactNode;\n\n /**\n * Called when add button is clicked.\n */\n onAddButtonClick?: NonCancelableEventHandler;\n\n /**\n * Called when remove button is clicked.\n * The event `detail` contains the index of the corresponding item.\n */\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: AttributeEditorProps.I18nStrings<T>;\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ButtonProps } from '../button/interfaces';
|
|
3
|
-
import { Breakpoint } from '../
|
|
4
|
-
import { NonCancelableEventHandler } from '../
|
|
3
|
+
import { Breakpoint } from '../types/breakpoint';
|
|
4
|
+
import { NonCancelableEventHandler } from '../types/events';
|
|
5
5
|
import { AttributeEditorProps } from './interfaces';
|
|
6
6
|
interface RowProps<T> {
|
|
7
7
|
breakpoint: Breakpoint | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row.d.ts","sourceRoot":"","sources":["../../../src/attribute-editor/row.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"row.d.ts","sourceRoot":"","sources":["../../../src/attribute-editor/row.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAKnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAKpD,UAAU,QAAQ,CAAC,CAAC;IAClB,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,oBAAoB,CAAC,UAAU,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC;IACR,UAAU,EAAE,aAAa,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,WAAW,EAAE,oBAAoB,CAAC,WAAW,GAAG,SAAS,CAAC;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC;IACrD,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IACvF,mBAAmB,CAAC,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;IAC9F,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;CAC7C;AAiBD,eAAO,MAAM,GAAG,EAgGX,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row.js","sourceRoot":"","sources":["../../../src/attribute-editor/row.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAG5E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"row.js","sourceRoot":"","sources":["../../../src/attribute-editor/row.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAG5E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAI5D,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEnG,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAiBrC,SAAS,MAAM,CACb,IAAO,EACP,SAAiB,EACjB,IAA2E;IAE3E,IAAI,cAAc,CAAC,IAAI,CAAC,EAAE,CA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SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,yBAAyB,CAAC,EAAE;gBACjD,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC,EAAE,sBAAsB,IAAI,KAAK,KAAK,CAAC;gBAC9E,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,EAAE,CAAC,sBAAsB;aAC3D,CAAC,EACF,KAAK,EAAE,EAAE,GAAG,0BAA0B,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE,IAE9D,SAAS;YACR,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,CAC7B,aAAa,CACd,CAAC,CAAC,CAAC,CACF,oBAAC,cAAc,IACb,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,EAClC,UAAU,EAAC,MAAM,EACjB,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,MAAA,CAAC,qBAAqB,aAArB,qBAAqB,cAArB,qBAAqB,GAAI,WAAW,CAAC,qBAAqB,CAAC,0CAAG,IAAI,CAAC,EAC/E,OAAO,EAAE,iBAAiB,IAEzB,IAAI,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAC5B,CAClB,CAAC,CACA;QACL,CAAC,sBAAsB,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,OAAO,GAAI,CAC1D,CACP,CAAC;AACJ,CAAC,CACwC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport InternalFormField from '../form-field/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { Breakpoint } from '../types/breakpoint';\nimport { NonCancelableEventHandler } from '../types/events';\nimport { AttributeEditorProps } from './interfaces';\nimport { getItemGridColumns, getRemoveButtonGridColumns, isRemoveButtonOnSameLine } from './utils';\n\nimport styles from './styles.css.js';\n\ninterface RowProps<T> {\n breakpoint: Breakpoint | null;\n layout: AttributeEditorProps.GridLayout;\n item: T;\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n i18nStrings: AttributeEditorProps.I18nStrings | undefined;\n index: number;\n removable: boolean;\n removeButtonText?: string;\n removeButtonRefs: Array<ButtonProps.Ref | undefined>;\n customRowActions?: (props: AttributeEditorProps.RowActionsProps<T>) => React.ReactNode;\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n removeButtonAriaLabel?: (item: T) => string;\n}\n\nfunction render<T>(\n item: T,\n itemIndex: number,\n slot: AttributeEditorProps.FieldRenderable<T> | React.ReactNode | undefined\n) {\n if (isSlotFunction(slot)) {\n return slot(item, itemIndex);\n }\n return slot;\n\n function isSlotFunction(slot: unknown): slot is AttributeEditorProps.FieldRenderable<T> {\n return typeof slot === 'function';\n }\n}\n\nexport const Row = React.memo(\n <T,>({\n breakpoint,\n item,\n definition,\n layout,\n i18nStrings = {},\n index,\n removable,\n removeButtonText,\n removeButtonRefs,\n customRowActions,\n onRemoveButtonClick,\n removeButtonAriaLabel,\n }: RowProps<T>) => {\n const i18n = useInternalI18n('attribute-editor');\n\n const handleRemoveClick = useCallback(() => {\n fireNonCancelableEvent(onRemoveButtonClick, { itemIndex: index });\n }, [onRemoveButtonClick, index]);\n\n const firstControlId = useUniqueId('first-control-id-');\n\n const buttonRef = (ref: ButtonProps.Ref | null) => {\n removeButtonRefs[index] = ref ?? undefined;\n };\n\n let gridColumnStart = 1;\n let gridColumnEnd = 1;\n const removeButtonOnSameLine = isRemoveButtonOnSameLine(layout);\n\n const customActions = customRowActions?.({\n item,\n itemIndex: index,\n ref: buttonRef,\n breakpoint,\n ownRow: !removeButtonOnSameLine,\n });\n\n return (\n <div\n className={clsx(styles.row, layout.rows.length === 1 && styles['single-row'])}\n role=\"group\"\n aria-labelledby={`${firstControlId}-label ${firstControlId}`}\n >\n {definition.map(({ info, label, description, constraintText, errorText, warningText, control }, defIndex) => {\n ({ gridColumnStart, gridColumnEnd } = getItemGridColumns(layout, defIndex));\n return (\n <InternalFormField\n key={defIndex}\n className={styles.field}\n __style={{ gridColumnStart, gridColumnEnd }}\n label={label}\n description={description}\n info={info}\n constraintText={render(item, index, constraintText)}\n errorText={render(item, index, errorText)}\n warningText={render(item, index, warningText)}\n stretch={true}\n i18nStrings={{\n errorIconAriaLabel: i18nStrings.errorIconAriaLabel,\n warningIconAriaLabel: i18nStrings.warningIconAriaLabel,\n }}\n __hideLabel={index !== 0 && removeButtonOnSameLine}\n controlId={defIndex === 0 ? firstControlId : undefined}\n >\n {render(item, index, control)}\n </InternalFormField>\n );\n })}\n <div\n className={clsx(styles['remove-button-container'], {\n [styles['remove-button-field-padding']]: removeButtonOnSameLine && index === 0,\n [styles['remove-button-own-row']]: !removeButtonOnSameLine,\n })}\n style={{ ...getRemoveButtonGridColumns(layout, gridColumnEnd) }}\n >\n {removable &&\n (customActions !== undefined ? (\n customActions\n ) : (\n <InternalButton\n className={styles['remove-button']}\n formAction=\"none\"\n ref={buttonRef}\n ariaLabel={(removeButtonAriaLabel ?? i18nStrings.removeButtonAriaLabel)?.(item)}\n onClick={handleRemoveClick}\n >\n {i18n('removeButtonText', removeButtonText)}\n </InternalButton>\n ))}\n </div>\n {!removeButtonOnSameLine && <div className={styles.divider} />}\n </div>\n );\n }\n) as <T>(props: RowProps<T>) => JSX.Element;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BaseComponentProps } from '../internal/base-component';
|
|
3
2
|
import { HighlightType } from '../internal/components/options-list/utils/use-highlight-option';
|
|
3
|
+
import { BaseComponentProps } from '../types/base-component';
|
|
4
4
|
import { AutosuggestItem, AutosuggestProps } from './interfaces';
|
|
5
5
|
interface AutosuggestOptionProps extends BaseComponentProps {
|
|
6
6
|
index: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autosuggest-option.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/autosuggest-option.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"autosuggest-option.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/autosuggest-option.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,aAAa,EAAE,MAAM,gEAAgE,CAAC;AAE/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIjE,UAAU,sBAAuB,SAAQ,kBAAkB;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IACxD,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,eAAe,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC;IAC7C,WAAW,CAAC,EAAE,gCAAgC,CAAC;CAChD;AAED,MAAM,WAAW,gCAAgC;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;CACnB;;AAuKD,wBAA+D"}
|
|
@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,CAAC,EAAE,CAAC;YACnC,cAAc,CAAC,YAAY,CAAC,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAChE,CAAC;QAED,aAAa,GAAG,CACd,gCAAS,cAAc;YACrB,oBAAC,eAAe,IACd,aAAa,EAAE,YAAY,EAC3B,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,WAAW,EAC9B,aAAa,EAAE,aAAa,GAC5B,CACE,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,oBAAC,cAAc,OACT,SAAS,EACb,qBAAqB,EAAE,CAAC,CAAC,YAAY,EACrC,SAAS,EAAE,MAAM,CAAC,MAAM,EACxB,YAAY,EAAE,OAAO,EACrB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,aAAa,EAAE,UAAU,EACzB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,eAAe,qBACf,YAAY,yBACR,YAAY,sBACf,UAAU,EAC5B,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,mBAAmB,EAAE,mBAAmB,EACxC,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,CAAC,IAAI,EACjC,KAAK,EAAE,MAAM,CAAC,KAAK,IAElB,aAAa,CACC,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps, getBaseProps } from '../internal/base-component';\nimport OptionComponent from '../internal/components/option';\nimport { OptionDefinition, OptionGroup } from '../internal/components/option/interfaces';\nimport { getTestOptionIndexes } from '../internal/components/options-list/utils/test-indexes';\nimport { HighlightType } from '../internal/components/options-list/utils/use-highlight-option';\nimport SelectableItem from '../internal/components/selectable-item';\nimport { AutosuggestItem, AutosuggestProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ninterface AutosuggestOptionProps extends BaseComponentProps {\n index: number;\n virtualIndex?: number;\n nativeAttributes?: React.HTMLAttributes<HTMLDivElement>;\n highlightText: string;\n option: AutosuggestItem;\n highlighted: boolean;\n highlightType: HighlightType;\n current: boolean;\n virtualPosition?: number;\n padBottom?: boolean;\n screenReaderContent?: string;\n ariaSetsize?: number;\n ariaPosinset?: number;\n renderOption?: AutosuggestProps.ItemRenderer;\n parentProps?: AutosuggestRenderItemParentProps;\n}\n\nexport interface AutosuggestRenderItemParentProps {\n index: number;\n virtualIndex?: number;\n option: AutosuggestItem;\n disabled: boolean;\n}\n\nconst toAutosuggestOptionGroupItem = (\n props: AutosuggestRenderItemParentProps\n): AutosuggestProps.OptionGroupRenderItem => {\n return {\n type: 'group',\n index: props.virtualIndex ?? props.index,\n option: props.option.option as OptionGroup,\n disabled: props.disabled,\n };\n};\n\nconst toAutosuggestOptionItem = (props: {\n index: number;\n virtualIndex?: number;\n option: AutosuggestItem;\n disabled: boolean;\n selected: boolean;\n highlighted: boolean;\n parentProps?: AutosuggestRenderItemParentProps;\n}): AutosuggestProps.OptionRenderItem => {\n return {\n type: 'item',\n index: props.virtualIndex ?? props.index,\n option: props.option.option as OptionDefinition,\n selected: props.selected,\n highlighted: props.highlighted,\n disabled: props.disabled,\n parent: props.parentProps\n ? toAutosuggestOptionGroupItem({\n index: props.parentProps.index,\n virtualIndex: props.parentProps.virtualIndex,\n option: props.parentProps.option,\n disabled: props.disabled,\n })\n : null,\n };\n};\n\nconst toAutosuggestUseEnteredItem = (props: {\n option: AutosuggestItem;\n highlighted: boolean;\n}): AutosuggestProps.EnteredTextRenderItem => {\n return {\n type: 'entered-text',\n option: props.option.option as OptionDefinition,\n highlighted: props.highlighted,\n };\n};\n\nconst AutosuggestOption = (\n {\n index,\n virtualIndex,\n nativeAttributes = {},\n highlightText,\n option,\n highlighted,\n highlightType,\n current,\n virtualPosition,\n padBottom,\n screenReaderContent,\n ariaSetsize,\n ariaPosinset,\n renderOption,\n parentProps,\n ...rest\n }: AutosuggestOptionProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const baseProps = getBaseProps(rest);\n const useEntered = option?.type === 'use-entered';\n const isParent = option?.type === 'parent';\n const isChild = option?.type === 'child';\n const { throughIndex, inGroupIndex, groupIndex } = getTestOptionIndexes(option) || {};\n\n const getAutosuggestItemProps = (option: AutosuggestItem) => {\n if (option.type === 'parent') {\n return toAutosuggestOptionGroupItem({\n option: option,\n index: index,\n virtualIndex: virtualIndex,\n disabled: !!option.disabled,\n });\n } else if (option.type === 'use-entered') {\n return toAutosuggestUseEnteredItem({\n option: option,\n highlighted: highlighted,\n });\n } else {\n return toAutosuggestOptionItem({\n option: option,\n index: index,\n virtualIndex: virtualIndex,\n disabled: !!option.disabled,\n highlighted: highlighted,\n selected: current,\n parentProps: parentProps,\n });\n }\n };\n\n const renderOptionWrapper = (option: AutosuggestItem) => {\n if (!renderOption) {\n return null;\n }\n\n return renderOption({ item: getAutosuggestItemProps(option), filterText: highlightText });\n };\n const renderResult = renderOptionWrapper(option);\n\n let optionContent;\n if (useEntered) {\n optionContent = renderResult ?? option.label;\n // we don't want fancy generated content for screenreader for the \"Use...\" option,\n // just the visible text is fine\n screenReaderContent = undefined;\n } else if (isParent) {\n optionContent = renderResult ?? option.label;\n } else {\n const a11yProperties: AutosuggestOptionProps['nativeAttributes'] = {};\n if (nativeAttributes['aria-label']) {\n a11yProperties['aria-label'] = nativeAttributes['aria-label'];\n }\n\n optionContent = (\n <div {...a11yProperties}>\n <OptionComponent\n customContent={renderResult}\n option={option}\n highlightedOption={highlighted}\n highlightText={highlightText}\n />\n </div>\n );\n }\n\n return (\n <SelectableItem\n {...baseProps}\n disableContentStyling={!!renderResult}\n className={styles.option}\n ariaSelected={current}\n highlighted={highlighted}\n disabled={option.disabled}\n hasBackground={useEntered}\n isParent={isParent}\n isChild={isChild}\n virtualPosition={virtualPosition}\n data-test-index={throughIndex}\n data-in-group-index={inGroupIndex}\n data-group-index={groupIndex}\n ref={ref}\n padBottom={padBottom}\n screenReaderContent={screenReaderContent}\n ariaSetsize={ariaSetsize}\n ariaPosinset={ariaPosinset}\n highlightType={highlightType.type}\n value={option.value}\n >\n {optionContent}\n </SelectableItem>\n );\n};\n\nexport default React.memo(React.forwardRef(AutosuggestOption));\n"]}
|
|
1
|
+
{"version":3,"file":"autosuggest-option.js","sourceRoot":"","sources":["../../../src/autosuggest/autosuggest-option.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAE9F,OAAO,cAAc,MAAM,wCAAwC,CAAC;AAKpE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AA2BrC,MAAM,4BAA4B,GAAG,CACnC,KAAuC,EACC,EAAE;;IAC1C,OAAO;QACL,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,MAAA,KAAK,CAAC,YAAY,mCAAI,KAAK,CAAC,KAAK;QACxC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAqB;QAC1C,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG,CAAC,KAQhC,EAAqC,EAAE;;IACtC,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,MAAA,KAAK,CAAC,YAAY,mCAAI,KAAK,CAAC,KAAK;QACxC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAA0B;QAC/C,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,QAAQ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Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { getBaseProps } from '../internal/base-component';\nimport OptionComponent from '../internal/components/option';\nimport { getTestOptionIndexes } from '../internal/components/options-list/utils/test-indexes';\nimport { HighlightType } from '../internal/components/options-list/utils/use-highlight-option';\nimport SelectableItem from '../internal/components/selectable-item';\nimport { BaseComponentProps } from '../types/base-component';\nimport { OptionDefinition, OptionGroup } from '../types/option';\nimport { AutosuggestItem, AutosuggestProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ninterface AutosuggestOptionProps extends BaseComponentProps {\n index: number;\n virtualIndex?: number;\n nativeAttributes?: React.HTMLAttributes<HTMLDivElement>;\n highlightText: string;\n option: AutosuggestItem;\n highlighted: boolean;\n highlightType: HighlightType;\n current: boolean;\n virtualPosition?: number;\n padBottom?: boolean;\n screenReaderContent?: string;\n ariaSetsize?: number;\n ariaPosinset?: number;\n renderOption?: AutosuggestProps.ItemRenderer;\n parentProps?: AutosuggestRenderItemParentProps;\n}\n\nexport interface AutosuggestRenderItemParentProps {\n index: number;\n virtualIndex?: number;\n option: AutosuggestItem;\n disabled: boolean;\n}\n\nconst toAutosuggestOptionGroupItem = (\n props: AutosuggestRenderItemParentProps\n): AutosuggestProps.OptionGroupRenderItem => {\n return {\n type: 'group',\n index: props.virtualIndex ?? props.index,\n option: props.option.option as OptionGroup,\n disabled: props.disabled,\n };\n};\n\nconst toAutosuggestOptionItem = (props: {\n index: number;\n virtualIndex?: number;\n option: AutosuggestItem;\n disabled: boolean;\n selected: boolean;\n highlighted: boolean;\n parentProps?: AutosuggestRenderItemParentProps;\n}): AutosuggestProps.OptionRenderItem => {\n return {\n type: 'item',\n index: props.virtualIndex ?? props.index,\n option: props.option.option as OptionDefinition,\n selected: props.selected,\n highlighted: props.highlighted,\n disabled: props.disabled,\n parent: props.parentProps\n ? toAutosuggestOptionGroupItem({\n index: props.parentProps.index,\n virtualIndex: props.parentProps.virtualIndex,\n option: props.parentProps.option,\n disabled: props.disabled,\n })\n : null,\n };\n};\n\nconst toAutosuggestUseEnteredItem = (props: {\n option: AutosuggestItem;\n highlighted: boolean;\n}): AutosuggestProps.EnteredTextRenderItem => {\n return {\n type: 'entered-text',\n option: props.option.option as OptionDefinition,\n highlighted: props.highlighted,\n };\n};\n\nconst AutosuggestOption = (\n {\n index,\n virtualIndex,\n nativeAttributes = {},\n highlightText,\n option,\n highlighted,\n highlightType,\n current,\n virtualPosition,\n padBottom,\n screenReaderContent,\n ariaSetsize,\n ariaPosinset,\n renderOption,\n parentProps,\n ...rest\n }: AutosuggestOptionProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const baseProps = getBaseProps(rest);\n const useEntered = option?.type === 'use-entered';\n const isParent = option?.type === 'parent';\n const isChild = option?.type === 'child';\n const { throughIndex, inGroupIndex, groupIndex } = getTestOptionIndexes(option) || {};\n\n const getAutosuggestItemProps = (option: AutosuggestItem) => {\n if (option.type === 'parent') {\n return toAutosuggestOptionGroupItem({\n option: option,\n index: index,\n virtualIndex: virtualIndex,\n disabled: !!option.disabled,\n });\n } else if (option.type === 'use-entered') {\n return toAutosuggestUseEnteredItem({\n option: option,\n highlighted: highlighted,\n });\n } else {\n return toAutosuggestOptionItem({\n option: option,\n index: index,\n virtualIndex: virtualIndex,\n disabled: !!option.disabled,\n highlighted: highlighted,\n selected: current,\n parentProps: parentProps,\n });\n }\n };\n\n const renderOptionWrapper = (option: AutosuggestItem) => {\n if (!renderOption) {\n return null;\n }\n\n return renderOption({ item: getAutosuggestItemProps(option), filterText: highlightText });\n };\n const renderResult = renderOptionWrapper(option);\n\n let optionContent;\n if (useEntered) {\n optionContent = renderResult ?? option.label;\n // we don't want fancy generated content for screenreader for the \"Use...\" option,\n // just the visible text is fine\n screenReaderContent = undefined;\n } else if (isParent) {\n optionContent = renderResult ?? option.label;\n } else {\n const a11yProperties: AutosuggestOptionProps['nativeAttributes'] = {};\n if (nativeAttributes['aria-label']) {\n a11yProperties['aria-label'] = nativeAttributes['aria-label'];\n }\n\n optionContent = (\n <div {...a11yProperties}>\n <OptionComponent\n customContent={renderResult}\n option={option}\n highlightedOption={highlighted}\n highlightText={highlightText}\n />\n </div>\n );\n }\n\n return (\n <SelectableItem\n {...baseProps}\n disableContentStyling={!!renderResult}\n className={styles.option}\n ariaSelected={current}\n highlighted={highlighted}\n disabled={option.disabled}\n hasBackground={useEntered}\n isParent={isParent}\n isChild={isChild}\n virtualPosition={virtualPosition}\n data-test-index={throughIndex}\n data-in-group-index={inGroupIndex}\n data-group-index={groupIndex}\n ref={ref}\n padBottom={padBottom}\n screenReaderContent={screenReaderContent}\n ariaSetsize={ariaSetsize}\n ariaPosinset={ariaPosinset}\n highlightType={highlightType.type}\n value={option.value}\n >\n {optionContent}\n </SelectableItem>\n );\n};\n\nexport default React.memo(React.forwardRef(AutosuggestOption));\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { BaseDropdownHostProps, OptionsFilteringType, OptionsLoadItemsDetail } from '../dropdown/interfaces';
|
|
3
3
|
import { BaseInputProps, InputAutoCorrect, InputClearLabel, InputKeyEvents, InputProps } from '../input/interfaces';
|
|
4
|
-
import { BaseComponentProps } from '../
|
|
5
|
-
import { DropdownStatusProps } from '../
|
|
6
|
-
import {
|
|
7
|
-
import { FormFieldValidationControlProps } from '../
|
|
8
|
-
import {
|
|
4
|
+
import { BaseComponentProps } from '../types/base-component';
|
|
5
|
+
import { DropdownStatusProps } from '../types/dropdown-status';
|
|
6
|
+
import { NonCancelableEventHandler } from '../types/events';
|
|
7
|
+
import { FormFieldValidationControlProps } from '../types/form-field';
|
|
8
|
+
import { OptionDefinition, OptionGroup } from '../types/option';
|
|
9
9
|
export interface AutosuggestProps extends BaseComponentProps, BaseInputProps, InputAutoCorrect, BaseDropdownHostProps, InputKeyEvents, InputClearLabel, FormFieldValidationControlProps, DropdownStatusProps {
|
|
10
10
|
onLoadItems?: NonCancelableEventHandler<AutosuggestProps.LoadItemsDetail>;
|
|
11
11
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAC7G,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACpH,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAC7G,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACpH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEhE,MAAM,WAAW,gBACf,SAAQ,kBAAkB,EACxB,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,+BAA+B,EAC/B,mBAAmB;IACrB,WAAW,CAAC,EAAE,yBAAyB,C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AQ,CAAC,EAAE,MAAM,CAAC;YAClB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB,CAAC;KACH;CACF;AAGD,MAAM,MAAM,eAAe,GAAG,CAAC,gBAAgB,CAAC,MAAM,GAAG,gBAAgB,CAAC,WAAW,CAAC,GAAG;IACvF,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAC;IAC1C,MAAM,EAAE,gBAAgB,GAAG,WAAW,CAAC;IACvC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/autosuggest/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { ReactNode } from 'react';\n\nimport { BaseDropdownHostProps, OptionsFilteringType, OptionsLoadItemsDetail } from '../dropdown/interfaces';\nimport { BaseInputProps, InputAutoCorrect, InputClearLabel, InputKeyEvents, InputProps } from '../input/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status';\nimport { OptionDefinition, OptionGroup } from '../internal/components/option/interfaces';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface AutosuggestProps\n extends BaseComponentProps,\n BaseInputProps,\n InputAutoCorrect,\n BaseDropdownHostProps,\n InputKeyEvents,\n InputClearLabel,\n FormFieldValidationControlProps,\n DropdownStatusProps {\n onLoadItems?: NonCancelableEventHandler<AutosuggestProps.LoadItemsDetail>;\n /**\n * Specifies an array of options that are displayed to the user as a dropdown list.\n * The options can be grouped using `OptionGroup` objects.\n *\n * #### Option\n * - `value` (string) - The returned value of the option when selected.\n * - `label` (string) - (Optional) Option text displayed to the user.\n * - `lang` (string) - (Optional) The language of the option, provided as a BCP 47 language tag.\n * - `description` (string) - (Optional) Further information about the option that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the option is disabled.\n * - `labelTag` (string) - (Optional) A label tag that provides additional guidance, shown next to the label.\n * - `tags` [string[]] - (Optional) A list of tags giving further guidance about the option.\n * - `filteringTags` [string[]] - (Optional) A list of additional tags used for automatic filtering.\n * - `iconName` (string) - (Optional) Specifies the name of an [icon](/components/icon/) to display in the option.\n * - `iconAriaLabel` (string) - (Optional) Specifies alternate text for the icon. We recommend that you provide this for accessibility.\n * - `iconAlt` (string) - (Optional) **Deprecated**, replaced by \\`iconAriaLabel\\`. Specifies alternate text for a custom icon, for use with `iconUrl`.\n * - `iconUrl` (string) - (Optional) URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * #### OptionGroup\n * - `label` (string) - Option group text displayed to the user.\n * - `disabled` (boolean) - (Optional) Determines whether the option group is disabled.\n * - `options` (Option[]) - (Optional) The options under this group.\n *\n * Note: Only one level of option nesting is supported.\n *\n * If you want to use the built-in filtering capabilities of this component, provide\n * a list of all valid options here and they will be automatically filtered based on the user's filtering input.\n *\n * Alternatively, you can listen to the `onChange` or `onLoadItems` event and set new options\n * on your own.\n **/\n options?: AutosuggestProps.Options;\n\n /**\n * Specifies a render function to render custom options in the dropdown menu.\n *\n * The item inside the props has a different shape depending on its type:\n *\n *\n * ### item\n *\n * - `type` ('item') - The item type.\n * - `index` (number) - The item's absolute position in the dropdown.\n * - `option` (Option) - The original option configuration.\n * - `disabled` (boolean) - Whether the item is disabled.\n * - `highlighted` (boolean) - Whether the item is currently highlighted.\n * - `selected` (boolean) - Whether the item is selected.\n * - `parent` (OptionGroupRenderItem | null) - The parent group item, if any.\n *\n * ### group\n *\n * - `type` ('group') - The item type.\n * - `index` (number) - The item's absolute position in the dropdown.\n * - `option` (OptionGroup) - The original option configuration.\n * - `disabled` (boolean) - Whether the item is disabled.\n *\n * ### entered-text\n *\n * - `type` ('entered-text') - The item type.\n * - `option` (Option) - The entered-text option configuration.\n *\n * When providing a custom `renderOption` implementation, it fully replaces the default visual rendering and content for that item.\n * The component still manages focus, keyboard interactions, and selection state, but it no longer applies its default item layout or typography.\n *\n * When returning `null`, the default rendering will be applied for that item.\n */\n renderOption?: AutosuggestProps.ItemRenderer;\n\n /**\n * Determines how filtering is applied to the list of `options`:\n *\n * * `auto` - The component will automatically filter options based on user input.\n * * `manual` - You will set up `onChange` or `onLoadItems` event listeners and filter options on your side or request\n * them from server.\n *\n * By default the component will filter the provided `options` based on the value of the filtering input field.\n * Only options that have a `value`, `label`, `description` or `labelTag` that contains the input value as a substring\n * are displayed in the list of options.\n *\n * If you set this property to `manual`, this default filtering mechanism is disabled and all provided `options` are\n * displayed in the dropdown list. In that case make sure that you use the `onChange` or `onLoadItems` events in order\n * to set the `options` property to the options that are relevant for the user, given the filtering input value.\n *\n * Note: Manual filtering doesn't disable match highlighting.\n **/\n filteringType?: OptionsFilteringType;\n\n /**\n * Specifies a function that generates the custom value indicator (for example, `Use \"${value}\"`).\n * @i18n\n */\n enteredTextLabel?: AutosuggestProps.EnteredTextLabel;\n\n /**\n * Defines whether entered text option is shown as the first option in the dropdown when value is non-empty.\n */\n hideEnteredTextOption?: boolean;\n\n /**\n * Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.\n *\n * Note that the `matchesCount` includes the `enteredTextLabel` (\"Use ${value}\") item, so in most cases you\n * should subtract 1 from `matchesCount`. If using manual filtering, you should provide your own value for `totalCount`.\n */\n filteringResultsText?: (matchesCount: number, totalCount: number) => string;\n\n /**\n * Specifies the text that's displayed when there aren't any suggestions to display.\n * This is displayed when `statusType` is set to `finished` or it's not set at all.\n */\n empty?: React.ReactNode;\n\n /**\n * Called whenever a user selects an option in the dropdown. Don't use this event as the only way to handle user input.\n * Instead, use `onSelect` in combination with the `onChange` handler only as an optional convenience for the user.\n */\n onSelect?: NonCancelableEventHandler<AutosuggestProps.SelectDetail>;\n\n /**\n * Specifies the localized string that describes an option as being selected.\n * This is required to provide a good screen reader experience. For more information, see the\n * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).\n * @i18n\n */\n selectedAriaLabel?: string;\n /**\n * Overrides the element that is announced to screen readers\n * when the highlighted option changes. By default, this announces\n * the option's name and properties, and its selected state if\n * the `selectedAriaLabel` property is defined.\n * The highlighted option is provided, and its group (if groups\n * are used and it differs from the group of the previously highlighted option).\n *\n * For more information, see the\n * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).\n */\n renderHighlightedAriaLive?: AutosuggestProps.ContainingOptionAndGroupString;\n\n /**\n * An object containing CSS properties to customize the autosuggest's visual appearance.\n * Refer to the [style](/components/autosuggest/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: AutosuggestProps.Style;\n}\n\nexport namespace AutosuggestProps {\n export type ChangeDetail = InputProps.ChangeDetail;\n export type KeyDetail = InputProps.KeyDetail;\n export type FilteringType = OptionsFilteringType;\n export type Option = OptionDefinition;\n export type Options = ReadonlyArray<Option | OptionGroup>;\n export type EnteredTextLabel = (value: string) => string;\n export interface OptionGroup extends Option {\n label?: string;\n options: ReadonlyArray<Option>;\n }\n /* eslint-disable-next-line @typescript-eslint/no-empty-object-type --\n * Required to create a distinct named type for the documenter.\n **/\n export interface LoadItemsDetail extends OptionsLoadItemsDetail {}\n export type StatusType = DropdownStatusProps.StatusType;\n export interface SelectDetail {\n value: string;\n selectedOption?: Option;\n }\n\n export interface ContainingOptionAndGroupString {\n (option: Option, group?: OptionGroup): string;\n }\n\n export interface OptionRenderItem {\n type: 'item';\n index: number;\n option: Option;\n disabled: boolean;\n highlighted: boolean;\n selected: boolean;\n parent: OptionGroupRenderItem | null;\n }\n export interface OptionGroupRenderItem {\n type: 'group';\n index: number;\n option: OptionGroup;\n disabled: boolean;\n }\n export interface EnteredTextRenderItem {\n type: 'entered-text';\n option: Option;\n highlighted: boolean;\n }\n export type RenderItem = OptionRenderItem | OptionGroupRenderItem | EnteredTextRenderItem;\n export type ItemRenderer = (props: { item: RenderItem; filterText?: string }) => ReactNode | null;\n\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n\n /**\n * Selects all text in the input control.\n */\n select(): void;\n }\n\n export interface Style {\n root?: {\n backgroundColor?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n borderColor?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n boxShadow?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n color?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n fontSize?: string;\n fontWeight?: string;\n paddingBlock?: string;\n paddingInline?: string;\n };\n placeholder?: {\n color?: string;\n fontSize?: string;\n fontStyle?: string;\n fontWeight?: string;\n };\n }\n}\n\n// TODO: use DropdownOption type same as in select and multiselect\nexport type AutosuggestItem = (AutosuggestProps.Option | AutosuggestProps.OptionGroup) & {\n type?: 'parent' | 'child' | 'use-entered';\n option: OptionDefinition | OptionGroup;\n parent?: OptionGroup;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/autosuggest/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { ReactNode } from 'react';\n\nimport { BaseDropdownHostProps, OptionsFilteringType, OptionsLoadItemsDetail } from '../dropdown/interfaces';\nimport { BaseInputProps, InputAutoCorrect, InputClearLabel, InputKeyEvents, InputProps } from '../input/interfaces';\nimport { BaseComponentProps } from '../types/base-component';\nimport { DropdownStatusProps } from '../types/dropdown-status';\nimport { NonCancelableEventHandler } from '../types/events';\nimport { FormFieldValidationControlProps } from '../types/form-field';\nimport { OptionDefinition, OptionGroup } from '../types/option';\n\nexport interface AutosuggestProps\n extends BaseComponentProps,\n BaseInputProps,\n InputAutoCorrect,\n BaseDropdownHostProps,\n InputKeyEvents,\n InputClearLabel,\n FormFieldValidationControlProps,\n DropdownStatusProps {\n onLoadItems?: NonCancelableEventHandler<AutosuggestProps.LoadItemsDetail>;\n /**\n * Specifies an array of options that are displayed to the user as a dropdown list.\n * The options can be grouped using `OptionGroup` objects.\n *\n * #### Option\n * - `value` (string) - The returned value of the option when selected.\n * - `label` (string) - (Optional) Option text displayed to the user.\n * - `lang` (string) - (Optional) The language of the option, provided as a BCP 47 language tag.\n * - `description` (string) - (Optional) Further information about the option that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the option is disabled.\n * - `labelTag` (string) - (Optional) A label tag that provides additional guidance, shown next to the label.\n * - `tags` [string[]] - (Optional) A list of tags giving further guidance about the option.\n * - `filteringTags` [string[]] - (Optional) A list of additional tags used for automatic filtering.\n * - `iconName` (string) - (Optional) Specifies the name of an [icon](/components/icon/) to display in the option.\n * - `iconAriaLabel` (string) - (Optional) Specifies alternate text for the icon. We recommend that you provide this for accessibility.\n * - `iconAlt` (string) - (Optional) **Deprecated**, replaced by \\`iconAriaLabel\\`. Specifies alternate text for a custom icon, for use with `iconUrl`.\n * - `iconUrl` (string) - (Optional) URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * #### OptionGroup\n * - `label` (string) - Option group text displayed to the user.\n * - `disabled` (boolean) - (Optional) Determines whether the option group is disabled.\n * - `options` (Option[]) - (Optional) The options under this group.\n *\n * Note: Only one level of option nesting is supported.\n *\n * If you want to use the built-in filtering capabilities of this component, provide\n * a list of all valid options here and they will be automatically filtered based on the user's filtering input.\n *\n * Alternatively, you can listen to the `onChange` or `onLoadItems` event and set new options\n * on your own.\n **/\n options?: AutosuggestProps.Options;\n\n /**\n * Specifies a render function to render custom options in the dropdown menu.\n *\n * The item inside the props has a different shape depending on its type:\n *\n *\n * ### item\n *\n * - `type` ('item') - The item type.\n * - `index` (number) - The item's absolute position in the dropdown.\n * - `option` (Option) - The original option configuration.\n * - `disabled` (boolean) - Whether the item is disabled.\n * - `highlighted` (boolean) - Whether the item is currently highlighted.\n * - `selected` (boolean) - Whether the item is selected.\n * - `parent` (OptionGroupRenderItem | null) - The parent group item, if any.\n *\n * ### group\n *\n * - `type` ('group') - The item type.\n * - `index` (number) - The item's absolute position in the dropdown.\n * - `option` (OptionGroup) - The original option configuration.\n * - `disabled` (boolean) - Whether the item is disabled.\n *\n * ### entered-text\n *\n * - `type` ('entered-text') - The item type.\n * - `option` (Option) - The entered-text option configuration.\n *\n * When providing a custom `renderOption` implementation, it fully replaces the default visual rendering and content for that item.\n * The component still manages focus, keyboard interactions, and selection state, but it no longer applies its default item layout or typography.\n *\n * When returning `null`, the default rendering will be applied for that item.\n */\n renderOption?: AutosuggestProps.ItemRenderer;\n\n /**\n * Determines how filtering is applied to the list of `options`:\n *\n * * `auto` - The component will automatically filter options based on user input.\n * * `manual` - You will set up `onChange` or `onLoadItems` event listeners and filter options on your side or request\n * them from server.\n *\n * By default the component will filter the provided `options` based on the value of the filtering input field.\n * Only options that have a `value`, `label`, `description` or `labelTag` that contains the input value as a substring\n * are displayed in the list of options.\n *\n * If you set this property to `manual`, this default filtering mechanism is disabled and all provided `options` are\n * displayed in the dropdown list. In that case make sure that you use the `onChange` or `onLoadItems` events in order\n * to set the `options` property to the options that are relevant for the user, given the filtering input value.\n *\n * Note: Manual filtering doesn't disable match highlighting.\n **/\n filteringType?: OptionsFilteringType;\n\n /**\n * Specifies a function that generates the custom value indicator (for example, `Use \"${value}\"`).\n * @i18n\n */\n enteredTextLabel?: AutosuggestProps.EnteredTextLabel;\n\n /**\n * Defines whether entered text option is shown as the first option in the dropdown when value is non-empty.\n */\n hideEnteredTextOption?: boolean;\n\n /**\n * Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.\n *\n * Note that the `matchesCount` includes the `enteredTextLabel` (\"Use ${value}\") item, so in most cases you\n * should subtract 1 from `matchesCount`. If using manual filtering, you should provide your own value for `totalCount`.\n */\n filteringResultsText?: (matchesCount: number, totalCount: number) => string;\n\n /**\n * Specifies the text that's displayed when there aren't any suggestions to display.\n * This is displayed when `statusType` is set to `finished` or it's not set at all.\n */\n empty?: React.ReactNode;\n\n /**\n * Called whenever a user selects an option in the dropdown. Don't use this event as the only way to handle user input.\n * Instead, use `onSelect` in combination with the `onChange` handler only as an optional convenience for the user.\n */\n onSelect?: NonCancelableEventHandler<AutosuggestProps.SelectDetail>;\n\n /**\n * Specifies the localized string that describes an option as being selected.\n * This is required to provide a good screen reader experience. For more information, see the\n * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).\n * @i18n\n */\n selectedAriaLabel?: string;\n /**\n * Overrides the element that is announced to screen readers\n * when the highlighted option changes. By default, this announces\n * the option's name and properties, and its selected state if\n * the `selectedAriaLabel` property is defined.\n * The highlighted option is provided, and its group (if groups\n * are used and it differs from the group of the previously highlighted option).\n *\n * For more information, see the\n * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).\n */\n renderHighlightedAriaLive?: AutosuggestProps.ContainingOptionAndGroupString;\n\n /**\n * An object containing CSS properties to customize the autosuggest's visual appearance.\n * Refer to the [style](/components/autosuggest/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: AutosuggestProps.Style;\n}\n\nexport namespace AutosuggestProps {\n export type ChangeDetail = InputProps.ChangeDetail;\n export type KeyDetail = InputProps.KeyDetail;\n export type FilteringType = OptionsFilteringType;\n export type Option = OptionDefinition;\n export type Options = ReadonlyArray<Option | OptionGroup>;\n export type EnteredTextLabel = (value: string) => string;\n export interface OptionGroup extends Option {\n label?: string;\n options: ReadonlyArray<Option>;\n }\n /* eslint-disable-next-line @typescript-eslint/no-empty-object-type --\n * Required to create a distinct named type for the documenter.\n **/\n export interface LoadItemsDetail extends OptionsLoadItemsDetail {}\n export type StatusType = DropdownStatusProps.StatusType;\n export interface SelectDetail {\n value: string;\n selectedOption?: Option;\n }\n\n export interface ContainingOptionAndGroupString {\n (option: Option, group?: OptionGroup): string;\n }\n\n export interface OptionRenderItem {\n type: 'item';\n index: number;\n option: Option;\n disabled: boolean;\n highlighted: boolean;\n selected: boolean;\n parent: OptionGroupRenderItem | null;\n }\n export interface OptionGroupRenderItem {\n type: 'group';\n index: number;\n option: OptionGroup;\n disabled: boolean;\n }\n export interface EnteredTextRenderItem {\n type: 'entered-text';\n option: Option;\n highlighted: boolean;\n }\n export type RenderItem = OptionRenderItem | OptionGroupRenderItem | EnteredTextRenderItem;\n export type ItemRenderer = (props: { item: RenderItem; filterText?: string }) => ReactNode | null;\n\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n\n /**\n * Selects all text in the input control.\n */\n select(): void;\n }\n\n export interface Style {\n root?: {\n backgroundColor?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n borderColor?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n boxShadow?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n color?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n fontSize?: string;\n fontWeight?: string;\n paddingBlock?: string;\n paddingInline?: string;\n };\n placeholder?: {\n color?: string;\n fontSize?: string;\n fontStyle?: string;\n fontWeight?: string;\n };\n }\n}\n\n// TODO: use DropdownOption type same as in select and multiselect\nexport type AutosuggestItem = (AutosuggestProps.Option | AutosuggestProps.OptionGroup) & {\n type?: 'parent' | 'child' | 'use-entered';\n option: OptionDefinition | OptionGroup;\n parent?: OptionGroup;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAchE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAmB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAOjE,UAAU,wBAAyB,SAAQ,gBAAgB,EAAE,0BAA0B;CAAG;AAE1F,QAAA,MAAM,mBAAmB,uGAgPvB,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { useInternalI18n } from '../i18n/context';
|
|
|
8
8
|
import AutosuggestInput from '../internal/components/autosuggest-input';
|
|
9
9
|
import DropdownFooter from '../internal/components/dropdown-footer';
|
|
10
10
|
import { useDropdownStatus } from '../internal/components/dropdown-status';
|
|
11
|
-
import { fireCancelableEvent, fireNonCancelableEvent
|
|
11
|
+
import { fireCancelableEvent, fireNonCancelableEvent } from '../internal/events';
|
|
12
12
|
import checkControlled from '../internal/hooks/check-controlled';
|
|
13
13
|
import { checkOptionValueField } from '../select/utils/check-option-value-field';
|
|
14
14
|
import { useAutosuggestLoadMore } from './load-more-controller';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/autosuggest/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAO,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,gBAAyC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Ac,IAAC,OAAO,EAAE,cAAc,CAAC,OAAO,EAAE,EAAE,EAAE,eAAe,GAAI,CAAC,CAAC,CAAC,IAAI,EAE5G,eAAe,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,GACrE,CACH,EAEH,cAAc,EACZ,cAAc,CAAC,QAAQ,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAClD,oBAAC,cAAc,IACb,EAAE,EAAE,eAAe,EACnB,OAAO,EAAE,cAAc,CAAC,OAAO,EAC/B,QAAQ,EAAE,qBAAqB,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,GACjD,CACH,CAAC,CAAC,CAAC,IAAI;QAEV,qEAAqE;QACrE,kBAAkB,EAAE,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,EAC/C,SAAS,EAAE,cAAc,CAAC,iBAAiB,EAC3C,eAAe,EAAE,mBAAmB,EACpC,cAAc,EAAE,kBAAkB,EAClC,gBAAgB,EAAE,oBAAoB,EACtC,cAAc,EAAE,kBAAkB,EAClC,YAAY,EAAE,gBAAgB,GAC9B,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref, useImperativeHandle, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useFormFieldContext } from '../contexts/form-field';\nimport { OptionsLoadItemsDetail } from '../dropdown/interfaces';\nimport { useInternalI18n } from '../i18n/context';\nimport { BaseChangeDetail } from '../input/interfaces';\nimport AutosuggestInput, { AutosuggestInputRef } from '../internal/components/autosuggest-input';\nimport DropdownFooter from '../internal/components/dropdown-footer';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport {\n BaseKeyDetail,\n fireCancelableEvent,\n fireNonCancelableEvent,\n NonCancelableCustomEvent,\n} from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { checkOptionValueField } from '../select/utils/check-option-value-field';\nimport { AutosuggestItem, AutosuggestProps } from './interfaces';\nimport { useAutosuggestLoadMore } from './load-more-controller';\nimport { useAutosuggestItems } from './options-controller';\nimport AutosuggestOptionsList from './options-list';\n\nimport styles from './styles.css.js';\n\ninterface InternalAutosuggestProps extends AutosuggestProps, InternalBaseComponentProps {}\n\nconst InternalAutosuggest = React.forwardRef((props: InternalAutosuggestProps, ref: Ref<AutosuggestProps.Ref>) => {\n const {\n value,\n onChange,\n onBlur,\n onFocus,\n onKeyUp,\n onLoadItems,\n options,\n filteringType = 'auto',\n statusType = 'finished',\n placeholder,\n clearAriaLabel,\n name,\n disabled,\n disableBrowserAutocorrect = false,\n autoFocus,\n readOnly,\n ariaLabel,\n ariaRequired,\n enteredTextLabel,\n hideEnteredTextOption,\n filteringResultsText,\n onKeyDown,\n virtualScroll,\n expandToViewport,\n onSelect,\n renderHighlightedAriaLive,\n style,\n renderOption,\n __internalRootRef,\n ...restProps\n } = props;\n\n checkControlled('Autosuggest', 'value', value, 'onChange', onChange);\n checkOptionValueField('Autosuggest', 'options', options);\n\n const autosuggestInputRef = useRef<AutosuggestInputRef>(null);\n useImperativeHandle(\n ref,\n () => ({\n focus: () => autosuggestInputRef.current?.focus(),\n select: () => autosuggestInputRef.current?.select(),\n }),\n []\n );\n\n const i18n = useInternalI18n('autosuggest');\n const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);\n const recoveryText = i18n('recoveryText', restProps.recoveryText);\n\n if (restProps.recoveryText && !onLoadItems) {\n warnOnce('Autosuggest', '`onLoadItems` must be provided for `recoveryText` to be displayed.');\n }\n\n const [autosuggestItemsState, autosuggestItemsHandlers] = useAutosuggestItems({\n options: options || [],\n filterValue: value,\n filterText: value,\n filteringType,\n enteredTextLabel,\n hideEnteredTextLabel: hideEnteredTextOption,\n onSelectItem: (option: AutosuggestItem) => {\n const value = option.value || '';\n fireNonCancelableEvent(onChange, { value });\n fireNonCancelableEvent(onSelect, {\n value,\n selectedOption: option.type !== 'use-entered' ? option.option : undefined,\n });\n autosuggestInputRef.current?.close();\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.setShowAll(false);\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 handleBlur = () => {\n fireNonCancelableEvent(onBlur, null);\n };\n\n const handleFocus = () => {\n autosuggestItemsHandlers.setShowAll(true);\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputFocus();\n fireNonCancelableEvent(onFocus, null);\n };\n\n const handleKeyUp = (event: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyUp, event.detail, event);\n };\n\n const handleKeyDown = (event: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyDown, event.detail, event);\n };\n\n const handlePressArrowDown = () => {\n if (autosuggestItemsState.items.length - 1 === autosuggestItemsState.highlightedIndex) {\n autosuggestItemsHandlers.goHomeWithKeyboard();\n return;\n }\n\n autosuggestItemsHandlers.moveHighlightWithKeyboard(1);\n };\n\n const handlePressArrowUp = () => {\n if (\n (autosuggestItemsState.highlightedOption?.type === 'child' && autosuggestItemsState.highlightedIndex === 1) ||\n autosuggestItemsState.highlightedIndex === 0\n ) {\n autosuggestItemsHandlers.goEndWithKeyboard();\n return;\n }\n\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 formFieldContext = useFormFieldContext(restProps);\n const selfControlId = useUniqueId('input');\n const footerControlId = useUniqueId('footer');\n const controlId = formFieldContext.controlId ?? selfControlId;\n const listId = useUniqueId('list');\n const highlightedOptionIdSource = useUniqueId();\n const highlightedOptionId = autosuggestItemsState.highlightedOption ? highlightedOptionIdSource : undefined;\n\n const isEmpty = !value && !autosuggestItemsState.items.length;\n const isFiltered = !!value && value.length !== 0 && !(filteringType === 'auto' && autosuggestItemsState.showAll);\n const filteredText = isFiltered\n ? filteringResultsText?.(autosuggestItemsState.items.length, options?.length ?? 0)\n : undefined;\n const dropdownStatus = useDropdownStatus({\n ...props,\n isEmpty,\n recoveryText,\n errorIconAriaLabel,\n onRecoveryClick: handleRecoveryClick,\n filteringResultsText: filteredText,\n hasRecoveryCallback: !!onLoadItems,\n });\n\n const shouldRenderDropdownContent =\n autosuggestItemsState.items.length !== 0 || !!dropdownStatus.content || (!hideEnteredTextOption && !!value);\n\n const hasItems = useRef(autosuggestItemsState.items.length > 0);\n hasItems.current = hasItems.current || autosuggestItemsState.items.length > 0;\n\n return (\n <AutosuggestInput\n {...restProps}\n className={clsx(styles.root, restProps.className)}\n ref={autosuggestInputRef}\n __internalRootRef={__internalRootRef}\n value={value}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n onKeyUp={handleKeyUp}\n onKeyDown={handleKeyDown}\n name={name}\n controlId={controlId}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n autoFocus={autoFocus}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n clearAriaLabel={clearAriaLabel}\n disableBrowserAutocorrect={disableBrowserAutocorrect}\n expandToViewport={expandToViewport}\n ariaControls={listId}\n ariaActivedescendant={highlightedOptionId}\n dropdownExpanded={shouldRenderDropdownContent}\n style={style}\n dropdownContent={\n shouldRenderDropdownContent && (\n <AutosuggestOptionsList\n renderOption={renderOption}\n statusType={statusType}\n autosuggestItemsState={autosuggestItemsState}\n autosuggestItemsHandlers={autosuggestItemsHandlers}\n highlightedOptionId={highlightedOptionId}\n highlightText={value}\n listId={listId}\n controlId={controlId}\n handleLoadMore={autosuggestLoadMoreHandlers.fireLoadMoreOnScroll}\n hasDropdownStatus={dropdownStatus.content !== null}\n virtualScroll={virtualScroll}\n selectedAriaLabel={selectedAriaLabel}\n renderHighlightedAriaLive={renderHighlightedAriaLive}\n listBottom={\n !dropdownStatus.isSticky ? <DropdownFooter content={dropdownStatus.content} id={footerControlId} /> : null\n }\n ariaDescribedby={dropdownStatus.content ? footerControlId : undefined}\n />\n )\n }\n dropdownFooter={\n dropdownStatus.isSticky && dropdownStatus.content ? (\n <DropdownFooter\n id={footerControlId}\n content={dropdownStatus.content}\n hasItems={autosuggestItemsState.items.length >= 1}\n />\n ) : null\n }\n // Forces dropdown position recalculation when new options are loaded\n dropdownContentKey={hasItems.current.toString()}\n loopFocus={dropdownStatus.hasRecoveryButton}\n onCloseDropdown={handleCloseDropdown}\n onDelayedInput={handleDelayedInput}\n onPressArrowDown={handlePressArrowDown}\n onPressArrowUp={handlePressArrowUp}\n onPressEnter={handlePressEnter}\n />\n );\n});\n\nexport default InternalAutosuggest;\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/autosuggest/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAO,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE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AAO,KAAK,IAAI,EAClD,aAAa,EAAE,aAAa,EAC5B,iBAAiB,EAAE,iBAAiB,EACpC,yBAAyB,EAAE,yBAAyB,EACpD,UAAU,EACR,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,oBAAC,cAAc,IAAC,OAAO,EAAE,cAAc,CAAC,OAAO,EAAE,EAAE,EAAE,eAAe,GAAI,CAAC,CAAC,CAAC,IAAI,EAE5G,eAAe,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,GACrE,CACH,EAEH,cAAc,EACZ,cAAc,CAAC,QAAQ,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAClD,oBAAC,cAAc,IACb,EAAE,EAAE,eAAe,EACnB,OAAO,EAAE,cAAc,CAAC,OAAO,EAC/B,QAAQ,EAAE,qBAAqB,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,GACjD,CACH,CAAC,CAAC,CAAC,IAAI;QAEV,qEAAqE;QACrE,kBAAkB,EAAE,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,EAC/C,SAAS,EAAE,cAAc,CAAC,iBAAiB,EAC3C,eAAe,EAAE,mBAAmB,EACpC,cAAc,EAAE,kBAAkB,EAClC,gBAAgB,EAAE,oBAAoB,EACtC,cAAc,EAAE,kBAAkB,EAClC,YAAY,EAAE,gBAAgB,GAC9B,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref, useImperativeHandle, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useFormFieldContext } from '../contexts/form-field';\nimport { OptionsLoadItemsDetail } from '../dropdown/interfaces';\nimport { useInternalI18n } from '../i18n/context';\nimport { BaseChangeDetail } from '../input/interfaces';\nimport AutosuggestInput, { AutosuggestInputRef } from '../internal/components/autosuggest-input';\nimport DropdownFooter from '../internal/components/dropdown-footer';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport { fireCancelableEvent, fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { checkOptionValueField } from '../select/utils/check-option-value-field';\nimport { BaseKeyDetail, NonCancelableCustomEvent } from '../types/events';\nimport { AutosuggestItem, AutosuggestProps } from './interfaces';\nimport { useAutosuggestLoadMore } from './load-more-controller';\nimport { useAutosuggestItems } from './options-controller';\nimport AutosuggestOptionsList from './options-list';\n\nimport styles from './styles.css.js';\n\ninterface InternalAutosuggestProps extends AutosuggestProps, InternalBaseComponentProps {}\n\nconst InternalAutosuggest = React.forwardRef((props: InternalAutosuggestProps, ref: Ref<AutosuggestProps.Ref>) => {\n const {\n value,\n onChange,\n onBlur,\n onFocus,\n onKeyUp,\n onLoadItems,\n options,\n filteringType = 'auto',\n statusType = 'finished',\n placeholder,\n clearAriaLabel,\n name,\n disabled,\n disableBrowserAutocorrect = false,\n autoFocus,\n readOnly,\n ariaLabel,\n ariaRequired,\n enteredTextLabel,\n hideEnteredTextOption,\n filteringResultsText,\n onKeyDown,\n virtualScroll,\n expandToViewport,\n onSelect,\n renderHighlightedAriaLive,\n style,\n renderOption,\n __internalRootRef,\n ...restProps\n } = props;\n\n checkControlled('Autosuggest', 'value', value, 'onChange', onChange);\n checkOptionValueField('Autosuggest', 'options', options);\n\n const autosuggestInputRef = useRef<AutosuggestInputRef>(null);\n useImperativeHandle(\n ref,\n () => ({\n focus: () => autosuggestInputRef.current?.focus(),\n select: () => autosuggestInputRef.current?.select(),\n }),\n []\n );\n\n const i18n = useInternalI18n('autosuggest');\n const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);\n const recoveryText = i18n('recoveryText', restProps.recoveryText);\n\n if (restProps.recoveryText && !onLoadItems) {\n warnOnce('Autosuggest', '`onLoadItems` must be provided for `recoveryText` to be displayed.');\n }\n\n const [autosuggestItemsState, autosuggestItemsHandlers] = useAutosuggestItems({\n options: options || [],\n filterValue: value,\n filterText: value,\n filteringType,\n enteredTextLabel,\n hideEnteredTextLabel: hideEnteredTextOption,\n onSelectItem: (option: AutosuggestItem) => {\n const value = option.value || '';\n fireNonCancelableEvent(onChange, { value });\n fireNonCancelableEvent(onSelect, {\n value,\n selectedOption: option.type !== 'use-entered' ? option.option : undefined,\n });\n autosuggestInputRef.current?.close();\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.setShowAll(false);\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 handleBlur = () => {\n fireNonCancelableEvent(onBlur, null);\n };\n\n const handleFocus = () => {\n autosuggestItemsHandlers.setShowAll(true);\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputFocus();\n fireNonCancelableEvent(onFocus, null);\n };\n\n const handleKeyUp = (event: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyUp, event.detail, event);\n };\n\n const handleKeyDown = (event: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyDown, event.detail, event);\n };\n\n const handlePressArrowDown = () => {\n if (autosuggestItemsState.items.length - 1 === autosuggestItemsState.highlightedIndex) {\n autosuggestItemsHandlers.goHomeWithKeyboard();\n return;\n }\n\n autosuggestItemsHandlers.moveHighlightWithKeyboard(1);\n };\n\n const handlePressArrowUp = () => {\n if (\n (autosuggestItemsState.highlightedOption?.type === 'child' && autosuggestItemsState.highlightedIndex === 1) ||\n autosuggestItemsState.highlightedIndex === 0\n ) {\n autosuggestItemsHandlers.goEndWithKeyboard();\n return;\n }\n\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 formFieldContext = useFormFieldContext(restProps);\n const selfControlId = useUniqueId('input');\n const footerControlId = useUniqueId('footer');\n const controlId = formFieldContext.controlId ?? selfControlId;\n const listId = useUniqueId('list');\n const highlightedOptionIdSource = useUniqueId();\n const highlightedOptionId = autosuggestItemsState.highlightedOption ? highlightedOptionIdSource : undefined;\n\n const isEmpty = !value && !autosuggestItemsState.items.length;\n const isFiltered = !!value && value.length !== 0 && !(filteringType === 'auto' && autosuggestItemsState.showAll);\n const filteredText = isFiltered\n ? filteringResultsText?.(autosuggestItemsState.items.length, options?.length ?? 0)\n : undefined;\n const dropdownStatus = useDropdownStatus({\n ...props,\n isEmpty,\n recoveryText,\n errorIconAriaLabel,\n onRecoveryClick: handleRecoveryClick,\n filteringResultsText: filteredText,\n hasRecoveryCallback: !!onLoadItems,\n });\n\n const shouldRenderDropdownContent =\n autosuggestItemsState.items.length !== 0 || !!dropdownStatus.content || (!hideEnteredTextOption && !!value);\n\n const hasItems = useRef(autosuggestItemsState.items.length > 0);\n hasItems.current = hasItems.current || autosuggestItemsState.items.length > 0;\n\n return (\n <AutosuggestInput\n {...restProps}\n className={clsx(styles.root, restProps.className)}\n ref={autosuggestInputRef}\n __internalRootRef={__internalRootRef}\n value={value}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n onKeyUp={handleKeyUp}\n onKeyDown={handleKeyDown}\n name={name}\n controlId={controlId}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n autoFocus={autoFocus}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n clearAriaLabel={clearAriaLabel}\n disableBrowserAutocorrect={disableBrowserAutocorrect}\n expandToViewport={expandToViewport}\n ariaControls={listId}\n ariaActivedescendant={highlightedOptionId}\n dropdownExpanded={shouldRenderDropdownContent}\n style={style}\n dropdownContent={\n shouldRenderDropdownContent && (\n <AutosuggestOptionsList\n renderOption={renderOption}\n statusType={statusType}\n autosuggestItemsState={autosuggestItemsState}\n autosuggestItemsHandlers={autosuggestItemsHandlers}\n highlightedOptionId={highlightedOptionId}\n highlightText={value}\n listId={listId}\n controlId={controlId}\n handleLoadMore={autosuggestLoadMoreHandlers.fireLoadMoreOnScroll}\n hasDropdownStatus={dropdownStatus.content !== null}\n virtualScroll={virtualScroll}\n selectedAriaLabel={selectedAriaLabel}\n renderHighlightedAriaLive={renderHighlightedAriaLive}\n listBottom={\n !dropdownStatus.isSticky ? <DropdownFooter content={dropdownStatus.content} id={footerControlId} /> : null\n }\n ariaDescribedby={dropdownStatus.content ? footerControlId : undefined}\n />\n )\n }\n dropdownFooter={\n dropdownStatus.isSticky && dropdownStatus.content ? (\n <DropdownFooter\n id={footerControlId}\n content={dropdownStatus.content}\n hasItems={autosuggestItemsState.items.length >= 1}\n />\n ) : null\n }\n // Forces dropdown position recalculation when new options are loaded\n dropdownContentKey={hasItems.current.toString()}\n loopFocus={dropdownStatus.hasRecoveryButton}\n onCloseDropdown={handleCloseDropdown}\n onDelayedInput={handleDelayedInput}\n onPressArrowDown={handlePressArrowDown}\n onPressArrowUp={handlePressArrowUp}\n onPressEnter={handlePressEnter}\n />\n );\n});\n\nexport default InternalAutosuggest;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OptionsLoadItemsDetail } from '../dropdown/interfaces';
|
|
2
|
-
import { DropdownStatusProps } from '../
|
|
2
|
+
import { DropdownStatusProps } from '../types/dropdown-status';
|
|
3
3
|
import { AutosuggestProps } from './interfaces';
|
|
4
4
|
interface UseAutosuggestLoadMoreProps {
|
|
5
5
|
options?: AutosuggestProps.Options;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-more-controller.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/load-more-controller.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"load-more-controller.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/load-more-controller.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,UAAU,2BAA2B;IACnC,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC;IACnC,UAAU,EAAE,mBAAmB,CAAC,UAAU,CAAC;IAC3C,WAAW,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;CACvD;AAED,UAAU,2BAA2B;IACnC,oBAAoB,IAAI,IAAI,CAAC;IAC7B,2BAA2B,IAAI,IAAI,CAAC;IACpC,wBAAwB,IAAI,IAAI,CAAC;IACjC,yBAAyB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CACxD;AAED,eAAO,MAAM,sBAAsB,GAAI,uCAIpC,2BAA2B,KAAG,2BAmChC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-more-controller.js","sourceRoot":"","sources":["../../../src/autosuggest/load-more-controller.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO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AC1D,YAAY,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC;IAEpE,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,CAAC;AACpH,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useRef } from 'react';\n\nimport { OptionsLoadItemsDetail } from '../dropdown/interfaces';\nimport { DropdownStatusProps } from '../
|
|
1
|
+
{"version":3,"file":"load-more-controller.js","sourceRoot":"","sources":["../../../src/autosuggest/load-more-controller.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAmB/B,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,OAAO,GAAG,EAAE,EACZ,UAAU,EACV,WAAW,GACiB,EAA+B,EAAE;IAC7D,MAAM,iBAAiB,GAAG,MAAM,CAAgB,IAAI,CAAC,CAAC;IAEtD,MAAM,YAAY,GAAG,CAAC,EACpB,SAAS,EACT,QAAQ,EACR,aAAa,GAKd,EAAE,EAAE;;QACH,IAAI,aAAa,KAAK,SAAS,IAAI,iBAAiB,CAAC,OAAO,KAAK,aAAa,EAAE,CAAC;YAC/E,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;gBAChC,iBAAiB,CAAC,OAAO,GAAG,aAAa,CAAC;YAC5C,CAAC;YACD,WAAW,CAAC,EAAE,aAAa,EAAE,MAAA,iBAAiB,CAAC,OAAO,mCAAI,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;QACvF,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,oBAAoB,GAAG,GAAG,EAAE;QAChC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YACnD,YAAY,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;QACtD,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,2BAA2B,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAE7F,MAAM,wBAAwB,GAAG,GAAG,EAAE,WACpC,OAAA,YAAY,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,MAAA,iBAAiB,CAAC,OAAO,mCAAI,EAAE,EAAE,CAAC,CAAA,EAAA,CAAC;IAErG,MAAM,yBAAyB,GAAG,CAAC,aAAqB,EAAE,EAAE,CAC1D,YAAY,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC;IAEpE,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,CAAC;AACpH,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useRef } from 'react';\n\nimport { OptionsLoadItemsDetail } from '../dropdown/interfaces';\nimport { DropdownStatusProps } from '../types/dropdown-status';\nimport { AutosuggestProps } from './interfaces';\n\ninterface UseAutosuggestLoadMoreProps {\n options?: AutosuggestProps.Options;\n statusType: DropdownStatusProps.StatusType;\n onLoadItems: (detail: OptionsLoadItemsDetail) => void;\n}\n\ninterface AutosuggestLoadMoreHandlers {\n fireLoadMoreOnScroll(): void;\n fireLoadMoreOnRecoveryClick(): void;\n fireLoadMoreOnInputFocus(): void;\n fireLoadMoreOnInputChange(filteringText: string): void;\n}\n\nexport const useAutosuggestLoadMore = ({\n options = [],\n statusType,\n onLoadItems,\n}: UseAutosuggestLoadMoreProps): AutosuggestLoadMoreHandlers => {\n const lastFilteringText = useRef<string | null>(null);\n\n const fireLoadMore = ({\n firstPage,\n samePage,\n filteringText,\n }: {\n firstPage: boolean;\n samePage: boolean;\n filteringText?: string;\n }) => {\n if (filteringText === undefined || lastFilteringText.current !== filteringText) {\n if (filteringText !== undefined) {\n lastFilteringText.current = filteringText;\n }\n onLoadItems({ filteringText: lastFilteringText.current ?? '', firstPage, samePage });\n }\n };\n\n const fireLoadMoreOnScroll = () => {\n if (options.length > 0 && statusType === 'pending') {\n fireLoadMore({ firstPage: false, samePage: false });\n }\n };\n\n const fireLoadMoreOnRecoveryClick = () => fireLoadMore({ firstPage: false, samePage: true });\n\n const fireLoadMoreOnInputFocus = () =>\n fireLoadMore({ firstPage: true, samePage: false, filteringText: lastFilteringText.current ?? '' });\n\n const fireLoadMoreOnInputChange = (filteringText: string) =>\n fireLoadMore({ firstPage: true, samePage: false, filteringText });\n\n return { fireLoadMoreOnScroll, fireLoadMoreOnRecoveryClick, fireLoadMoreOnInputFocus, fireLoadMoreOnInputChange };\n};\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BaseComponentProps } from '../
|
|
2
|
+
import { BaseComponentProps } from '../types/base-component';
|
|
3
3
|
/**
|
|
4
4
|
* @awsuiSystem core
|
|
5
5
|
*/
|
|
6
|
-
import { NativeAttributes } from '../
|
|
6
|
+
import { NativeAttributes } from '../types/native-attributes';
|
|
7
7
|
export interface BadgeProps extends BaseComponentProps {
|
|
8
8
|
/**
|
|
9
9
|
* Specifies the badge color.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/badge/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/badge/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,WAAW,UAAW,SAAQ,kBAAkB;IACpD;;OAEG;IACH,KAAK,CAAC,EACF,MAAM,GACN,MAAM,GACN,OAAO,GACP,KAAK,GACL,mBAAmB,GACnB,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,kBAAkB,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;;;OAIG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC;IAEzB;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC;CACxE;AAED,yBAAiB,UAAU,CAAC;IAC1B,UAAiB,KAAK;QACpB,IAAI,CAAC,EAAE;YACL,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,YAAY,CAAC,EAAE,MAAM,CAAC;YACtB,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,YAAY,CAAC,EAAE,MAAM,CAAC;YACtB,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB,CAAC;KACH;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/badge/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/badge/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../types/base-component';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../types/native-attributes';\n\nexport interface BadgeProps extends BaseComponentProps {\n /**\n * Specifies the badge color.\n */\n color?:\n | 'blue'\n | 'grey'\n | 'green'\n | 'red'\n | 'severity-critical'\n | 'severity-high'\n | 'severity-medium'\n | 'severity-low'\n | 'severity-neutral';\n\n /**\n * Text displayed inside the badge.\n */\n children?: React.ReactNode;\n\n /**\n * An object containing CSS properties to customize the badge's visual appearance.\n * Refer to the [style](/components/badge/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: BadgeProps.Style;\n\n /**\n * Attributes to add to the native element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeAttributes?: NativeAttributes<React.HTMLAttributes<HTMLElement>>;\n}\n\nexport namespace BadgeProps {\n export interface Style {\n root?: {\n background?: string;\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n color?: string;\n paddingBlock?: string;\n paddingInline?: string;\n };\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ScaleType } from '../internal/components/cartesian-chart/interfaces';
|
|
2
1
|
import { ChartDataTypes, CommonMixedChartProps, MixedLineBarChartProps } from '../mixed-line-bar-chart/interfaces';
|
|
2
|
+
import { ScaleType } from '../types/cartesian-chart';
|
|
3
3
|
type BarSeries<T> = MixedLineBarChartProps.BarDataSeries<T> | MixedLineBarChartProps.ThresholdSeries<T>;
|
|
4
4
|
export interface BarChartProps<T extends ChartDataTypes> extends CommonMixedChartProps<T> {
|
|
5
5
|
/**
|