@cloudscape-design/components-themeable 3.0.941 → 3.0.943
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/components/selectable-item/styles.scss +4 -0
- package/lib/internal/scss/select/parts/styles.scss +5 -15
- package/lib/internal/template/app-layout/drawer/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/drawer/index.js +1 -1
- package/lib/internal/template/app-layout/drawer/index.js.map +1 -1
- package/lib/internal/template/app-layout/mobile-toolbar/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/mobile-toolbar/index.js +1 -1
- package/lib/internal/template/app-layout/mobile-toolbar/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/drawers.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/drawers.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh/drawers.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js.map +1 -1
- package/lib/internal/template/internal/components/option/interfaces.d.ts +1 -1
- 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/utils/prepare-options.d.ts +1 -0
- package/lib/internal/template/internal/components/option/utils/prepare-options.d.ts.map +1 -1
- package/lib/internal/template/internal/components/option/utils/prepare-options.js +1 -0
- package/lib/internal/template/internal/components/option/utils/prepare-options.js.map +1 -1
- package/lib/internal/template/internal/components/options-list/index.d.ts +1 -0
- package/lib/internal/template/internal/components/options-list/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/options-list/index.js +2 -2
- package/lib/internal/template/internal/components/options-list/index.js.map +1 -1
- package/lib/internal/template/internal/components/selectable-item/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/selectable-item/index.js +2 -1
- package/lib/internal/template/internal/components/selectable-item/index.js.map +1 -1
- package/lib/internal/template/internal/components/selectable-item/interfaces.d.ts +1 -0
- 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/selectable-item/styles.css.js +20 -19
- package/lib/internal/template/internal/components/selectable-item/styles.scoped.css +41 -37
- package/lib/internal/template/internal/components/selectable-item/styles.selectors.js +20 -19
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/environment.json +1 -1
- package/lib/internal/template/multiselect/interfaces.d.ts +11 -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.map +1 -1
- package/lib/internal/template/multiselect/internal.js +5 -3
- package/lib/internal/template/multiselect/internal.js.map +1 -1
- package/lib/internal/template/multiselect/use-multiselect.d.ts +7 -4
- package/lib/internal/template/multiselect/use-multiselect.d.ts.map +1 -1
- package/lib/internal/template/multiselect/use-multiselect.js +33 -9
- package/lib/internal/template/multiselect/use-multiselect.js.map +1 -1
- package/lib/internal/template/select/internal.js +1 -1
- package/lib/internal/template/select/internal.js.map +1 -1
- package/lib/internal/template/select/parts/common.d.ts +2 -0
- package/lib/internal/template/select/parts/common.d.ts.map +1 -0
- package/lib/internal/template/select/parts/common.js +4 -0
- package/lib/internal/template/select/parts/common.js.map +1 -0
- package/lib/internal/template/select/parts/multiselect-item.d.ts.map +1 -1
- package/lib/internal/template/select/parts/multiselect-item.js +3 -2
- package/lib/internal/template/select/parts/multiselect-item.js.map +1 -1
- package/lib/internal/template/select/parts/plain-list.d.ts.map +1 -1
- package/lib/internal/template/select/parts/plain-list.js +22 -14
- package/lib/internal/template/select/parts/plain-list.js.map +1 -1
- package/lib/internal/template/select/parts/styles.css.js +20 -21
- package/lib/internal/template/select/parts/styles.scoped.css +26 -30
- package/lib/internal/template/select/parts/styles.selectors.js +20 -21
- package/lib/internal/template/select/parts/trigger.d.ts.map +1 -1
- package/lib/internal/template/select/parts/trigger.js +1 -1
- package/lib/internal/template/select/parts/trigger.js.map +1 -1
- package/lib/internal/template/select/parts/virtual-list.d.ts.map +1 -1
- package/lib/internal/template/select/parts/virtual-list.js +26 -9
- package/lib/internal/template/select/parts/virtual-list.js.map +1 -1
- package/lib/internal/template/select/utils/render-options.d.ts +4 -3
- package/lib/internal/template/select/utils/render-options.d.ts.map +1 -1
- package/lib/internal/template/select/utils/render-options.js +5 -5
- package/lib/internal/template/select/utils/render-options.js.map +1 -1
- package/lib/internal/template/select/utils/scroll-to-index.d.ts +5 -0
- package/lib/internal/template/select/utils/scroll-to-index.d.ts.map +1 -0
- package/lib/internal/template/select/utils/scroll-to-index.js +14 -0
- package/lib/internal/template/select/utils/scroll-to-index.js.map +1 -0
- package/lib/internal/template/select/utils/use-select.d.ts +4 -1
- package/lib/internal/template/select/utils/use-select.d.ts.map +1 -1
- package/lib/internal/template/select/utils/use-select.js +18 -9
- package/lib/internal/template/select/utils/use-select.js.map +1 -1
- package/lib/internal/template/test-utils/dom/internal/dropdown-host.d.ts +20 -2
- package/lib/internal/template/test-utils/dom/internal/dropdown-host.js +33 -2
- package/lib/internal/template/test-utils/dom/internal/dropdown-host.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/internal/dropdown-host.d.ts +1 -0
- package/lib/internal/template/test-utils/selectors/internal/dropdown-host.js +6 -0
- package/lib/internal/template/test-utils/selectors/internal/dropdown-host.js.map +1 -1
- package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plain-list.js","sourceRoot":"","sources":["../../../../src/select/parts/plain-list.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OA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sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useImperativeHandle, useRef, useState } from 'react';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\n\nimport { DropdownOption } from '../../internal/components/option/interfaces';\nimport OptionsList from '../../internal/components/options-list';\nimport { HighlightType } from '../../internal/components/options-list/utils/use-highlight-option';\nimport { useMergeRefs } from '../../internal/hooks/use-merge-refs';\nimport { renderOptions } from '../utils/render-options';\nimport scrollToIndex from '../utils/scroll-to-index';\nimport { GetOptionProps, MenuProps } from '../utils/use-select';\nimport { fallbackItemHeight } from './common';\n\nimport styles from './styles.css.js';\n\nexport interface SelectListProps {\n menuProps: MenuProps;\n getOptionProps: GetOptionProps;\n filteredOptions: ReadonlyArray<DropdownOption>;\n filteringValue: string;\n highlightType: HighlightType;\n checkboxes?: boolean;\n hasDropdownStatus?: boolean;\n listBottom?: React.ReactNode;\n useInteractiveGroups?: boolean;\n screenReaderContent?: string;\n firstOptionSticky?: boolean;\n}\n\nexport namespace SelectListProps {\n export type SelectListRef = (index: number) => void;\n}\n\nconst PlainList = (\n {\n menuProps,\n getOptionProps,\n filteredOptions,\n filteringValue,\n highlightType,\n checkboxes,\n hasDropdownStatus,\n listBottom,\n useInteractiveGroups,\n screenReaderContent,\n firstOptionSticky,\n }: SelectListProps,\n ref: React.Ref<SelectListProps.SelectListRef>\n) => {\n const stickyOptionRef = useRef<HTMLDivElement>(null);\n const [stickyOptionBlockSize, setStickyOptionBlockSize] = useState(firstOptionSticky ? fallbackItemHeight : 0);\n\n const [width, menuMeasureRef] = useContainerQuery(rect => {\n if (stickyOptionRef.current) {\n // Cannot use container query on the sticky option individually because it is not rendered until the dropdown is open.\n // Not expecting the sticky option to change size without the dropdown also changing size.\n\n // The effects of using the sticky option block size to set the menu scroll padding are covered by integration tests.\n // istanbul ignore next\n setStickyOptionBlockSize(stickyOptionRef.current.clientHeight);\n }\n return { inner: rect.contentBoxWidth, outer: rect.borderBoxWidth };\n });\n\n const menuRef = menuProps.ref;\n\n const mergedRef = useMergeRefs(menuMeasureRef, menuRef);\n\n useImperativeHandle(\n ref,\n () => (index: number) => {\n const isSticky = firstOptionSticky && index === 0;\n if (highlightType.moveFocus && menuRef.current && !isSticky) {\n scrollToIndex({ index, menuEl: menuRef.current });\n }\n },\n [firstOptionSticky, highlightType.moveFocus, menuRef]\n );\n\n const withScrollbar = !!width && width.inner < width.outer;\n\n return (\n <OptionsList {...menuProps} ref={mergedRef} stickyItemBlockSize={stickyOptionBlockSize}>\n {renderOptions({\n options: filteredOptions,\n getOptionProps,\n filteringValue,\n highlightType,\n checkboxes,\n hasDropdownStatus,\n useInteractiveGroups,\n screenReaderContent,\n firstOptionSticky,\n stickyOptionRef,\n withScrollbar,\n })}\n {listBottom ? (\n <li role=\"option\" className={styles['list-bottom']}>\n {listBottom}\n </li>\n ) : null}\n </OptionsList>\n );\n};\n\nexport default forwardRef(PlainList);\n"]}
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"placeholder": "
|
|
5
|
-
"item": "
|
|
6
|
-
"checkbox": "
|
|
7
|
-
"filter": "
|
|
8
|
-
"trigger": "
|
|
9
|
-
"layout-strut": "awsui_layout-
|
|
10
|
-
"list-bottom": "awsui_list-
|
|
11
|
-
"selected-icon": "awsui_selected-
|
|
12
|
-
"show-label-tag": "awsui_show-label-
|
|
13
|
-
"inline-token-trigger": "awsui_inline-token-
|
|
14
|
-
"inline-token-list": "awsui_inline-token-
|
|
15
|
-
"inline-token": "awsui_inline-
|
|
16
|
-
"visual-refresh": "awsui_visual-
|
|
17
|
-
"inline-token-hidden-placeholder": "awsui_inline-token-hidden-
|
|
18
|
-
"inline-token-counter": "awsui_inline-token-
|
|
19
|
-
"inline-token-trigger--disabled": "awsui_inline-token-trigger--
|
|
20
|
-
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-
|
|
21
|
-
"inline-label-wrapper": "awsui_inline-label-
|
|
22
|
-
"inline-label": "awsui_inline-
|
|
23
|
-
"
|
|
24
|
-
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_dwuol_66tnt_286"
|
|
4
|
+
"placeholder": "awsui_placeholder_dwuol_1yl5a_145",
|
|
5
|
+
"item": "awsui_item_dwuol_1yl5a_150",
|
|
6
|
+
"checkbox": "awsui_checkbox_dwuol_1yl5a_154",
|
|
7
|
+
"filter": "awsui_filter_dwuol_1yl5a_163",
|
|
8
|
+
"trigger": "awsui_trigger_dwuol_1yl5a_168",
|
|
9
|
+
"layout-strut": "awsui_layout-strut_dwuol_1yl5a_174",
|
|
10
|
+
"list-bottom": "awsui_list-bottom_dwuol_1yl5a_180",
|
|
11
|
+
"selected-icon": "awsui_selected-icon_dwuol_1yl5a_184",
|
|
12
|
+
"show-label-tag": "awsui_show-label-tag_dwuol_1yl5a_188",
|
|
13
|
+
"inline-token-trigger": "awsui_inline-token-trigger_dwuol_1yl5a_192",
|
|
14
|
+
"inline-token-list": "awsui_inline-token-list_dwuol_1yl5a_199",
|
|
15
|
+
"inline-token": "awsui_inline-token_dwuol_1yl5a_192",
|
|
16
|
+
"visual-refresh": "awsui_visual-refresh_dwuol_1yl5a_229",
|
|
17
|
+
"inline-token-hidden-placeholder": "awsui_inline-token-hidden-placeholder_dwuol_1yl5a_236",
|
|
18
|
+
"inline-token-counter": "awsui_inline-token-counter_dwuol_1yl5a_242",
|
|
19
|
+
"inline-token-trigger--disabled": "awsui_inline-token-trigger--disabled_dwuol_1yl5a_246",
|
|
20
|
+
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-wrapper_dwuol_1yl5a_252",
|
|
21
|
+
"inline-label-wrapper": "awsui_inline-label-wrapper_dwuol_1yl5a_256",
|
|
22
|
+
"inline-label": "awsui_inline-label_dwuol_1yl5a_252",
|
|
23
|
+
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_dwuol_1yl5a_282"
|
|
25
24
|
};
|
|
26
25
|
|
|
@@ -142,16 +142,16 @@
|
|
|
142
142
|
*/
|
|
143
143
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
144
144
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
145
|
-
.
|
|
145
|
+
.awsui_placeholder_dwuol_1yl5a_145:not(#\9) {
|
|
146
146
|
color: var(--color-text-input-placeholder-od847j, #687078);
|
|
147
147
|
font-style: italic;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
.
|
|
150
|
+
.awsui_item_dwuol_1yl5a_150:not(#\9) {
|
|
151
151
|
display: flex;
|
|
152
152
|
align-items: center;
|
|
153
153
|
}
|
|
154
|
-
.
|
|
154
|
+
.awsui_item_dwuol_1yl5a_150 > .awsui_checkbox_dwuol_1yl5a_154:not(#\9) {
|
|
155
155
|
position: relative;
|
|
156
156
|
min-block-size: var(--size-control-rwazx4, 14px);
|
|
157
157
|
min-inline-size: var(--size-control-rwazx4, 14px);
|
|
@@ -160,43 +160,43 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
160
160
|
margin-inline-end: var(--space-field-horizontal-cxdor9, 8px);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
.
|
|
163
|
+
.awsui_filter_dwuol_1yl5a_163:not(#\9) {
|
|
164
164
|
z-index: 4;
|
|
165
165
|
flex-shrink: 0;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
.
|
|
168
|
+
.awsui_trigger_dwuol_1yl5a_168:not(#\9) {
|
|
169
169
|
white-space: nowrap;
|
|
170
170
|
overflow: hidden;
|
|
171
171
|
text-overflow: ellipsis;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
.awsui_layout-
|
|
174
|
+
.awsui_layout-strut_dwuol_1yl5a_174:not(#\9) {
|
|
175
175
|
inline-size: 100%;
|
|
176
176
|
position: relative;
|
|
177
177
|
transform: translate3d(0, 0, 0);
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
.awsui_list-
|
|
180
|
+
.awsui_list-bottom_dwuol_1yl5a_180:not(#\9) {
|
|
181
181
|
/* used in unit-tests */
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
.awsui_selected-
|
|
184
|
+
.awsui_selected-icon_dwuol_1yl5a_184:not(#\9) {
|
|
185
185
|
color: var(--color-border-item-focused-q68bgg, #0073bb);
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
.awsui_show-label-
|
|
188
|
+
.awsui_show-label-tag_dwuol_1yl5a_188 > .awsui_selected-icon_dwuol_1yl5a_184:not(#\9) {
|
|
189
189
|
padding-inline-start: var(--space-scaled-s-8j7izy, 12px);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
.awsui_inline-token-
|
|
192
|
+
.awsui_inline-token-trigger_dwuol_1yl5a_192:not(#\9) {
|
|
193
193
|
display: flex;
|
|
194
194
|
flex-wrap: nowrap;
|
|
195
195
|
column-gap: var(--space-xxs-y2432o, 4px);
|
|
196
196
|
inline-size: 100%;
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
.awsui_inline-token-
|
|
199
|
+
.awsui_inline-token-list_dwuol_1yl5a_199:not(#\9) {
|
|
200
200
|
display: flex;
|
|
201
201
|
flex-wrap: nowrap;
|
|
202
202
|
align-items: center;
|
|
@@ -206,10 +206,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
206
206
|
mask-image: linear-gradient(270deg, transparent, white 20px, white);
|
|
207
207
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
208
208
|
}
|
|
209
|
-
.awsui_inline-token-
|
|
209
|
+
.awsui_inline-token-list_dwuol_1yl5a_199:not(#\9):dir(rtl) {
|
|
210
210
|
mask-image: linear-gradient(-270deg, transparent, white 20px, white);
|
|
211
211
|
}
|
|
212
|
-
.awsui_inline-token-
|
|
212
|
+
.awsui_inline-token-list_dwuol_1yl5a_199 > .awsui_inline-token_dwuol_1yl5a_192:not(#\9) {
|
|
213
213
|
display: flex;
|
|
214
214
|
align-items: center;
|
|
215
215
|
min-inline-size: max-content;
|
|
@@ -226,40 +226,43 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
226
226
|
color: var(--color-text-body-default-agk00h, #16191f);
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
.awsui_visual-
|
|
229
|
+
.awsui_visual-refresh_dwuol_1yl5a_229 > .awsui_inline-token-list_dwuol_1yl5a_199 > .awsui_inline-token_dwuol_1yl5a_192:not(#\9) {
|
|
230
230
|
border-start-start-radius: var(--border-radius-badge-nlbq5e, 16px);
|
|
231
231
|
border-start-end-radius: var(--border-radius-badge-nlbq5e, 16px);
|
|
232
232
|
border-end-start-radius: var(--border-radius-badge-nlbq5e, 16px);
|
|
233
233
|
border-end-end-radius: var(--border-radius-badge-nlbq5e, 16px);
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
.awsui_inline-token-hidden-
|
|
236
|
+
.awsui_inline-token-hidden-placeholder_dwuol_1yl5a_236:not(#\9) {
|
|
237
237
|
position: absolute !important;
|
|
238
238
|
inset-block-start: -9999px !important;
|
|
239
239
|
inset-inline-start: -9999px !important;
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
.awsui_inline-token-
|
|
242
|
+
.awsui_inline-token-counter_dwuol_1yl5a_242:not(#\9) {
|
|
243
243
|
white-space: nowrap;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
.awsui_inline-token-trigger--
|
|
246
|
+
.awsui_inline-token-trigger--disabled_dwuol_1yl5a_246 > .awsui_inline-token-list_dwuol_1yl5a_199 > .awsui_inline-token_dwuol_1yl5a_192:not(#\9) {
|
|
247
247
|
border-color: var(--color-border-control-disabled-7jgofv, #d5dbdb);
|
|
248
248
|
background-color: var(--color-background-container-content-myy7cn, #ffffff);
|
|
249
249
|
color: var(--color-text-disabled-hv8bna, #aab7b8);
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
.awsui_inline-label-trigger-
|
|
252
|
+
.awsui_inline-label-trigger-wrapper_dwuol_1yl5a_252:not(#\9) {
|
|
253
253
|
margin-block-start: -7px;
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
.awsui_inline-label-
|
|
256
|
+
.awsui_inline-label-wrapper_dwuol_1yl5a_256:not(#\9) {
|
|
257
257
|
margin-block-start: calc(var(--space-scaled-xs-t3am3w, 8px) * -1);
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
-
.awsui_inline-
|
|
261
|
-
background
|
|
262
|
-
|
|
260
|
+
.awsui_inline-label_dwuol_1yl5a_252:not(#\9) {
|
|
261
|
+
background: var(--color-background-container-header-9jxtzb, #fafafa);
|
|
262
|
+
border-start-start-radius: 2px;
|
|
263
|
+
border-start-end-radius: 2px;
|
|
264
|
+
border-end-start-radius: 2px;
|
|
265
|
+
border-end-end-radius: 2px;
|
|
263
266
|
box-sizing: border-box;
|
|
264
267
|
display: inline-block;
|
|
265
268
|
color: var(--color-text-form-label-o56hrc, #16191f);
|
|
@@ -275,14 +278,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
275
278
|
max-inline-size: calc(100% - 2 * var(--space-field-horizontal-cxdor9, 8px));
|
|
276
279
|
z-index: 1;
|
|
277
280
|
}
|
|
278
|
-
.awsui_inline-label_dwuol_66tnt_252.awsui_inline-label-disabled_dwuol_66tnt_278:not(#\9) {
|
|
279
|
-
background: var(--color-background-container-header-9jxtzb, #fafafa);
|
|
280
|
-
border-start-start-radius: 2px;
|
|
281
|
-
border-start-end-radius: 2px;
|
|
282
|
-
border-end-start-radius: 2px;
|
|
283
|
-
border-end-end-radius: 2px;
|
|
284
|
-
}
|
|
285
281
|
|
|
286
|
-
.awsui_disabled-reason-
|
|
282
|
+
.awsui_disabled-reason-tooltip_dwuol_1yl5a_282:not(#\9) {
|
|
287
283
|
/* used in test-utils or tests */
|
|
288
284
|
}
|
|
@@ -2,26 +2,25 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"placeholder": "
|
|
6
|
-
"item": "
|
|
7
|
-
"checkbox": "
|
|
8
|
-
"filter": "
|
|
9
|
-
"trigger": "
|
|
10
|
-
"layout-strut": "awsui_layout-
|
|
11
|
-
"list-bottom": "awsui_list-
|
|
12
|
-
"selected-icon": "awsui_selected-
|
|
13
|
-
"show-label-tag": "awsui_show-label-
|
|
14
|
-
"inline-token-trigger": "awsui_inline-token-
|
|
15
|
-
"inline-token-list": "awsui_inline-token-
|
|
16
|
-
"inline-token": "awsui_inline-
|
|
17
|
-
"visual-refresh": "awsui_visual-
|
|
18
|
-
"inline-token-hidden-placeholder": "awsui_inline-token-hidden-
|
|
19
|
-
"inline-token-counter": "awsui_inline-token-
|
|
20
|
-
"inline-token-trigger--disabled": "awsui_inline-token-trigger--
|
|
21
|
-
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-
|
|
22
|
-
"inline-label-wrapper": "awsui_inline-label-
|
|
23
|
-
"inline-label": "awsui_inline-
|
|
24
|
-
"
|
|
25
|
-
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_dwuol_66tnt_286"
|
|
5
|
+
"placeholder": "awsui_placeholder_dwuol_1yl5a_145",
|
|
6
|
+
"item": "awsui_item_dwuol_1yl5a_150",
|
|
7
|
+
"checkbox": "awsui_checkbox_dwuol_1yl5a_154",
|
|
8
|
+
"filter": "awsui_filter_dwuol_1yl5a_163",
|
|
9
|
+
"trigger": "awsui_trigger_dwuol_1yl5a_168",
|
|
10
|
+
"layout-strut": "awsui_layout-strut_dwuol_1yl5a_174",
|
|
11
|
+
"list-bottom": "awsui_list-bottom_dwuol_1yl5a_180",
|
|
12
|
+
"selected-icon": "awsui_selected-icon_dwuol_1yl5a_184",
|
|
13
|
+
"show-label-tag": "awsui_show-label-tag_dwuol_1yl5a_188",
|
|
14
|
+
"inline-token-trigger": "awsui_inline-token-trigger_dwuol_1yl5a_192",
|
|
15
|
+
"inline-token-list": "awsui_inline-token-list_dwuol_1yl5a_199",
|
|
16
|
+
"inline-token": "awsui_inline-token_dwuol_1yl5a_192",
|
|
17
|
+
"visual-refresh": "awsui_visual-refresh_dwuol_1yl5a_229",
|
|
18
|
+
"inline-token-hidden-placeholder": "awsui_inline-token-hidden-placeholder_dwuol_1yl5a_236",
|
|
19
|
+
"inline-token-counter": "awsui_inline-token-counter_dwuol_1yl5a_242",
|
|
20
|
+
"inline-token-trigger--disabled": "awsui_inline-token-trigger--disabled_dwuol_1yl5a_246",
|
|
21
|
+
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-wrapper_dwuol_1yl5a_252",
|
|
22
|
+
"inline-label-wrapper": "awsui_inline-label-wrapper_dwuol_1yl5a_256",
|
|
23
|
+
"inline-label": "awsui_inline-label_dwuol_1yl5a_252",
|
|
24
|
+
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_dwuol_1yl5a_282"
|
|
26
25
|
};
|
|
27
26
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/trigger.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAK5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAIzD,MAAM,WAAW,YAAa,SAAQ,+BAA+B;IACnE,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,EAAE,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AAM,GAAG,QAAQ,CAAC;IACrC,eAAe,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACnD;AAED,QAAA,MAAM,OAAO,wFA8GZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -44,7 +44,7 @@ const Trigger = React.forwardRef(({ ariaLabelledby, ariaDescribedby, controlId,
|
|
|
44
44
|
const mergedRef = useMergeRefs(triggerProps.ref, ref);
|
|
45
45
|
const triggerButton = (React.createElement(ButtonTrigger, Object.assign({}, triggerProps, { id: id, ref: mergedRef, pressed: !!isOpen, disabled: disabled, readOnly: readOnly, invalid: invalid, warning: warning && !invalid, inFilteringToken: inFilteringToken, inlineTokens: triggerVariant === 'tokens', ariaDescribedby: ariaDescribedby, ariaLabelledby: ariaLabelledbyIds }), triggerContent));
|
|
46
46
|
return (React.createElement(React.Fragment, null, inlineLabelText ? (React.createElement("div", { className: styles['inline-label-wrapper'] },
|
|
47
|
-
React.createElement("label", { htmlFor: controlId, className:
|
|
47
|
+
React.createElement("label", { htmlFor: controlId, className: styles['inline-label'] }, inlineLabelText),
|
|
48
48
|
React.createElement("div", { className: styles['inline-label-trigger-wrapper'] }, triggerButton))) : (React.createElement(React.Fragment, null, triggerButton))));
|
|
49
49
|
});
|
|
50
50
|
export default Trigger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../../../src/select/parts/trigger.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,aAAa,MAAM,0CAA0C,CAAC;AACrE,OAAO,MAAM,MAAM,kCAAkC,CAAC;AAGtD,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCA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E,OAAO,EAChB,OAAO,EAAE,OAAO,IAAI,CAAC,OAAO,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,cAAc,KAAK,QAAQ,EACzC,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,iBAAiB,KAEhC,cAAc,CACD,CACjB,CAAC;IACF,OAAO,CACL,0CACG,eAAe,CAAC,CAAC,CAAC,CACjB,6BAAK,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC;QAC5C,+
|
|
1
|
+
{"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../../../src/select/parts/trigger.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,aAAa,MAAM,0CAA0C,CAAC;AACrE,OAAO,MAAM,MAAM,kCAAkC,CAAC;AAGtD,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAK3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAerC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAC9B,CACE,EACE,cAAc,EACd,eAAe,EACf,SAAS,EACT,OAAO,EACP,eAAe,EACf,OAAO,EACP,YAAY,EACZ,cAAc,EACd,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,MAAM,EACN,WAAW,EACX,QAAQ,EACR,QAAQ,GACK,EACf,GAAiC,EACjC,EAAE;IACF,MAAM,eAAe,GAAG,gBAAgB,EAAE,CAAC;IAC3C,MAAM,WAAW,GAAG,WAAW,EAAE,CAAC;IAClC,MAAM,EAAE,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,WAAW,CAAC;IACpC,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,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport ButtonTrigger from '../../internal/components/button-trigger';\nimport Option from '../../internal/components/option';\nimport { OptionDefinition } from '../../internal/components/option/interfaces';\nimport { FormFieldValidationControlProps } from '../../internal/context/form-field-context';\nimport { useMergeRefs } from '../../internal/hooks/use-merge-refs';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { useVisualRefresh } from '../../internal/hooks/use-visual-mode';\nimport { joinStrings } from '../../internal/utils/strings';\nimport { MultiselectProps } from '../../multiselect/interfaces';\nimport { SelectProps } from '../interfaces';\nimport { SelectTriggerProps } from '../utils/use-select';\n\nimport styles from './styles.css.js';\n\nexport interface TriggerProps extends FormFieldValidationControlProps {\n placeholder: string | undefined;\n disabled: boolean | undefined;\n readOnly?: boolean;\n triggerProps: SelectTriggerProps;\n selectedOption: OptionDefinition | null;\n inlineLabelText?: string;\n isOpen?: boolean;\n triggerVariant?: SelectProps.TriggerVariant | MultiselectProps.TriggerVariant;\n inFilteringToken?: 'root' | 'nested';\n selectedOptions?: ReadonlyArray<OptionDefinition>;\n}\n\nconst Trigger = React.forwardRef(\n (\n {\n ariaLabelledby,\n ariaDescribedby,\n controlId,\n invalid,\n inlineLabelText,\n warning,\n triggerProps,\n selectedOption,\n selectedOptions,\n triggerVariant,\n inFilteringToken,\n isOpen,\n placeholder,\n disabled,\n readOnly,\n }: TriggerProps,\n ref: React.Ref<HTMLButtonElement>\n ) => {\n const isVisualRefresh = useVisualRefresh();\n const generatedId = useUniqueId();\n const id = controlId ?? generatedId;\n const triggerContentId = useUniqueId('trigger-content-');\n\n let ariaLabelledbyIds = joinStrings(ariaLabelledby, triggerContentId);\n\n let triggerContent = null;\n if (triggerVariant === 'tokens') {\n if (selectedOptions?.length) {\n triggerContent = (\n <span\n className={clsx(\n styles['inline-token-trigger'],\n disabled && styles['inline-token-trigger--disabled'],\n isVisualRefresh && styles['visual-refresh']\n )}\n >\n <span className={styles['inline-token-list']}>\n {selectedOptions.map(({ label }, i) => (\n <span key={i} className={styles['inline-token']}>\n {label}\n </span>\n ))}\n </span>\n <span className={styles['inline-token-counter']} id={triggerContentId}>\n <span className={styles['inline-token-hidden-placeholder']}>{placeholder}</span>\n <span>({selectedOptions.length})</span>\n </span>\n </span>\n );\n ariaLabelledbyIds = ariaLabelledby;\n } else {\n triggerContent = (\n <span aria-disabled=\"true\" className={clsx(styles.placeholder, styles.trigger)} id={triggerContentId}>\n {placeholder}\n </span>\n );\n }\n } else if (!selectedOption) {\n triggerContent = (\n <span aria-disabled=\"true\" className={clsx(styles.placeholder, styles.trigger)} id={triggerContentId}>\n {placeholder}\n </span>\n );\n } else if (triggerVariant === 'option') {\n triggerContent = <Option id={triggerContentId} option={{ ...selectedOption, disabled }} triggerVariant={true} />;\n } else {\n triggerContent = (\n <span id={triggerContentId} className={styles.trigger}>\n {selectedOption.label || selectedOption.value}\n </span>\n );\n }\n\n const mergedRef = useMergeRefs(triggerProps.ref, ref);\n const triggerButton = (\n <ButtonTrigger\n {...triggerProps}\n id={id}\n ref={mergedRef}\n pressed={!!isOpen}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n warning={warning && !invalid}\n inFilteringToken={inFilteringToken}\n inlineTokens={triggerVariant === 'tokens'}\n ariaDescribedby={ariaDescribedby}\n ariaLabelledby={ariaLabelledbyIds}\n >\n {triggerContent}\n </ButtonTrigger>\n );\n return (\n <>\n {inlineLabelText ? (\n <div className={styles['inline-label-wrapper']}>\n <label htmlFor={controlId} className={styles['inline-label']}>\n {inlineLabelText}\n </label>\n <div className={styles['inline-label-trigger-wrapper']}>{triggerButton}</div>\n </div>\n ) : (\n <>{triggerButton}</>\n )}\n </>\n );\n }\n);\n\nexport default Trigger;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-list.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/virtual-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+D,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"virtual-list.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/virtual-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAUpF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;;AA0H/C,wBAAuC"}
|
|
@@ -6,6 +6,8 @@ import OptionsList from '../../internal/components/options-list';
|
|
|
6
6
|
import { useMergeRefs } from '../../internal/hooks/use-merge-refs';
|
|
7
7
|
import { useVirtual } from '../../internal/hooks/use-virtual';
|
|
8
8
|
import { renderOptions } from '../utils/render-options';
|
|
9
|
+
import customScrollToIndex from '../utils/scroll-to-index';
|
|
10
|
+
import { fallbackItemHeight } from './common';
|
|
9
11
|
import styles from './styles.css.js';
|
|
10
12
|
const VirtualList = (props, ref) => {
|
|
11
13
|
return props.menuProps.open ? React.createElement(VirtualListOpen, Object.assign({}, props, { ref: ref })) : React.createElement(VirtualListClosed, Object.assign({}, props, { ref: ref }));
|
|
@@ -15,6 +17,7 @@ const VirtualListOpen = forwardRef(({ menuProps, getOptionProps, filteredOptions
|
|
|
15
17
|
const [width, menuMeasureRef] = useContainerQuery(rect => ({ inner: rect.contentBoxWidth, outer: rect.borderBoxWidth }), []);
|
|
16
18
|
const menuRefObject = useRef(null);
|
|
17
19
|
const menuRef = useMergeRefs(menuMeasureRef, menuRefObject, menuProps.ref);
|
|
20
|
+
const previousHighlightedIndex = useRef();
|
|
18
21
|
const { virtualItems, totalSize, scrollToIndex } = useVirtual({
|
|
19
22
|
items: filteredOptions,
|
|
20
23
|
parentRef: menuRefObject,
|
|
@@ -23,17 +26,32 @@ const VirtualListOpen = forwardRef(({ menuProps, getOptionProps, filteredOptions
|
|
|
23
26
|
// 1: because the component got resized (width property got updated)
|
|
24
27
|
// 2: because the option changed its content (filteringValue property controls the highlight and the visibility of hidden tags)
|
|
25
28
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
|
-
estimateSize: useCallback(() =>
|
|
29
|
+
estimateSize: useCallback(() => fallbackItemHeight, [width === null || width === void 0 ? void 0 : width.inner, filteringValue]),
|
|
27
30
|
firstItemSticky: firstOptionSticky,
|
|
28
31
|
});
|
|
29
32
|
useImperativeHandle(ref, () => (index) => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
if (highlightType.moveFocus) {
|
|
34
|
+
const movingUp = previousHighlightedIndex.current !== undefined && index < previousHighlightedIndex.current;
|
|
35
|
+
if (firstOptionSticky && movingUp && index !== 0 && menuRefObject.current) {
|
|
36
|
+
// React-Virtual v2 does not offer a proper way to handle sticky elements when scrolling,
|
|
37
|
+
// so until we upgrade to v3, use our own scroll implementation
|
|
38
|
+
// to prevent newly highlighted element from being covered by the sticky element
|
|
39
|
+
// when moving the highlight upwards in the list.
|
|
40
|
+
// Scrolling behavior is covered by integration tests.
|
|
41
|
+
// istanbul ignore next
|
|
42
|
+
customScrollToIndex({
|
|
43
|
+
index,
|
|
44
|
+
menuEl: menuRefObject === null || menuRefObject === void 0 ? void 0 : menuRefObject.current,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
scrollToIndex(index);
|
|
49
|
+
}
|
|
33
50
|
}
|
|
34
|
-
|
|
51
|
+
previousHighlightedIndex.current = index;
|
|
52
|
+
}, [firstOptionSticky, highlightType.moveFocus, scrollToIndex]);
|
|
35
53
|
const stickySize = firstOptionSticky ? virtualItems[0].size : 0;
|
|
36
|
-
const
|
|
54
|
+
const withScrollbar = !!width && width.inner < width.outer;
|
|
37
55
|
const finalOptions = renderOptions({
|
|
38
56
|
options: virtualItems.map(({ index }) => filteredOptions[index]),
|
|
39
57
|
getOptionProps,
|
|
@@ -44,11 +62,10 @@ const VirtualListOpen = forwardRef(({ menuProps, getOptionProps, filteredOptions
|
|
|
44
62
|
virtualItems,
|
|
45
63
|
useInteractiveGroups,
|
|
46
64
|
screenReaderContent,
|
|
47
|
-
ariaSetsize: filteredOptions.length,
|
|
48
|
-
withScrollbar: hasScrollbar,
|
|
49
65
|
firstOptionSticky,
|
|
66
|
+
withScrollbar,
|
|
50
67
|
});
|
|
51
|
-
return (React.createElement(OptionsList, Object.assign({}, menuProps, { ref: menuRef }),
|
|
68
|
+
return (React.createElement(OptionsList, Object.assign({}, menuProps, { stickyItemBlockSize: stickySize, ref: menuRef }),
|
|
52
69
|
finalOptions,
|
|
53
70
|
React.createElement("div", { "aria-hidden": "true", key: "total-size", className: styles['layout-strut'], style: { height: totalSize - stickySize } }),
|
|
54
71
|
listBottom ? (React.createElement("li", { role: "option", className: styles['list-bottom'] }, listBottom)) : null));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-list.js","sourceRoot":"","sources":["../../../../src/select/parts/virtual-list.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,WAAW,MAAM,wCAAwC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"virtual-list.js","sourceRoot":"","sources":["../../../../src/select/parts/virtual-list.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpF,OAAO,EAAE,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C,CAAC,CAAC,IAAI,CACI,CACf,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC,WAAW,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useCallback, useImperativeHandle, useRef } from 'react';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\n\nimport OptionsList from '../../internal/components/options-list';\nimport { useMergeRefs } from '../../internal/hooks/use-merge-refs';\nimport { useVirtual } from '../../internal/hooks/use-virtual';\nimport { renderOptions } from '../utils/render-options';\nimport customScrollToIndex from '../utils/scroll-to-index';\nimport { fallbackItemHeight } from './common';\nimport { SelectListProps } from './plain-list';\n\nimport styles from './styles.css.js';\n\nconst VirtualList = (props: SelectListProps, ref: React.Ref<SelectListProps.SelectListRef>) => {\n return props.menuProps.open ? <VirtualListOpen {...props} ref={ref} /> : <VirtualListClosed {...props} ref={ref} />;\n};\n\nconst VirtualListOpen = forwardRef(\n (\n {\n menuProps,\n getOptionProps,\n filteredOptions,\n filteringValue,\n highlightType,\n checkboxes,\n hasDropdownStatus,\n listBottom,\n useInteractiveGroups,\n screenReaderContent,\n firstOptionSticky,\n }: SelectListProps,\n ref: React.Ref<SelectListProps.SelectListRef>\n ) => {\n // update component, when it gets wider or narrower to reposition items\n const [width, menuMeasureRef] = useContainerQuery(\n rect => ({ inner: rect.contentBoxWidth, outer: rect.borderBoxWidth }),\n []\n );\n const menuRefObject = useRef(null);\n const menuRef = useMergeRefs(menuMeasureRef, menuRefObject, menuProps.ref);\n const previousHighlightedIndex = useRef<number>();\n const { virtualItems, totalSize, scrollToIndex } = useVirtual({\n items: filteredOptions,\n parentRef: menuRefObject,\n // estimateSize is a dependency of measurements memo. We update it to force full recalculation\n // when the height of any option could have changed:\n // 1: because the component got resized (width property got updated)\n // 2: because the option changed its content (filteringValue property controls the highlight and the visibility of hidden tags)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n estimateSize: useCallback(() => fallbackItemHeight, [width?.inner, filteringValue]),\n firstItemSticky: firstOptionSticky,\n });\n\n useImperativeHandle(\n ref,\n () => (index: number) => {\n if (highlightType.moveFocus) {\n const movingUp = previousHighlightedIndex.current !== undefined && index < previousHighlightedIndex.current;\n if (firstOptionSticky && movingUp && index !== 0 && menuRefObject.current) {\n // React-Virtual v2 does not offer a proper way to handle sticky elements when scrolling,\n // so until we upgrade to v3, use our own scroll implementation\n // to prevent newly highlighted element from being covered by the sticky element\n // when moving the highlight upwards in the list.\n\n // Scrolling behavior is covered by integration tests.\n // istanbul ignore next\n customScrollToIndex({\n index,\n menuEl: menuRefObject?.current,\n });\n } else {\n scrollToIndex(index);\n }\n }\n previousHighlightedIndex.current = index;\n },\n [firstOptionSticky, highlightType.moveFocus, scrollToIndex]\n );\n\n const stickySize = firstOptionSticky ? virtualItems[0].size : 0;\n const withScrollbar = !!width && width.inner < width.outer;\n\n const finalOptions = renderOptions({\n options: virtualItems.map(({ index }) => filteredOptions[index]),\n getOptionProps,\n filteringValue,\n highlightType,\n checkboxes,\n hasDropdownStatus,\n virtualItems,\n useInteractiveGroups,\n screenReaderContent,\n firstOptionSticky,\n withScrollbar,\n });\n\n return (\n <OptionsList {...menuProps} stickyItemBlockSize={stickySize} ref={menuRef}>\n {finalOptions}\n <div\n aria-hidden=\"true\"\n key=\"total-size\"\n className={styles['layout-strut']}\n style={{ height: totalSize - stickySize }}\n />\n {listBottom ? (\n <li role=\"option\" className={styles['list-bottom']}>\n {listBottom}\n </li>\n ) : null}\n </OptionsList>\n );\n }\n);\n\nconst VirtualListClosed = forwardRef(\n ({ menuProps, listBottom }: SelectListProps, ref: React.Ref<SelectListProps.SelectListRef>) => {\n useImperativeHandle(ref, () => () => {}, []);\n return (\n <OptionsList {...menuProps} ref={menuProps.ref}>\n {listBottom ? (\n <li role=\"option\" className={styles['list-bottom']}>\n {listBottom}\n </li>\n ) : null}\n </OptionsList>\n );\n }\n);\n\nexport default forwardRef(VirtualList);\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { DropdownOption } from '../../internal/components/option/interfaces';
|
|
3
3
|
import { HighlightType } from '../../internal/components/options-list/utils/use-highlight-option';
|
|
4
4
|
import { VirtualItem } from '../../internal/vendor/react-virtual';
|
|
@@ -13,9 +13,10 @@ interface RenderOptionProps {
|
|
|
13
13
|
useInteractiveGroups?: boolean;
|
|
14
14
|
screenReaderContent?: string;
|
|
15
15
|
ariaSetsize?: number;
|
|
16
|
-
withScrollbar
|
|
16
|
+
withScrollbar: boolean;
|
|
17
17
|
firstOptionSticky?: boolean;
|
|
18
|
+
stickyOptionRef?: React.Ref<HTMLDivElement>;
|
|
18
19
|
}
|
|
19
|
-
export declare const renderOptions: ({ options, getOptionProps, filteringValue, highlightType, checkboxes, hasDropdownStatus, virtualItems, useInteractiveGroups, screenReaderContent, ariaSetsize, withScrollbar, firstOptionSticky, }: RenderOptionProps) => JSX.Element[];
|
|
20
|
+
export declare const renderOptions: ({ options, getOptionProps, filteringValue, highlightType, checkboxes, hasDropdownStatus, virtualItems, useInteractiveGroups, screenReaderContent, ariaSetsize, withScrollbar, firstOptionSticky, stickyOptionRef, }: RenderOptionProps) => JSX.Element[];
|
|
20
21
|
export {};
|
|
21
22
|
//# sourceMappingURL=render-options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-options.d.ts","sourceRoot":"","sources":["../../../../src/select/utils/render-options.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"render-options.d.ts","sourceRoot":"","sources":["../../../../src/select/utils/render-options.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,mEAAmE,CAAC;AAClG,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAKlE,UAAU,iBAAiB;IACzB,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IACvC,cAAc,EAAE,GAAG,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CAC7C;AAED,eAAO,MAAM,aAAa,wNAcvB,iBAAiB,kBAiCnB,CAAC"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import Item from '../parts/item';
|
|
5
|
-
import
|
|
5
|
+
import MultiselectItem from '../parts/multiselect-item';
|
|
6
6
|
import { getItemProps } from './get-item-props';
|
|
7
|
-
export const renderOptions = ({ options, getOptionProps, filteringValue, highlightType, checkboxes = false, hasDropdownStatus, virtualItems, useInteractiveGroups, screenReaderContent, ariaSetsize, withScrollbar, firstOptionSticky, }) => {
|
|
7
|
+
export const renderOptions = ({ options, getOptionProps, filteringValue, highlightType, checkboxes = false, hasDropdownStatus, virtualItems, useInteractiveGroups, screenReaderContent, ariaSetsize, withScrollbar, firstOptionSticky, stickyOptionRef, }) => {
|
|
8
8
|
return options.map((option, index) => {
|
|
9
9
|
const virtualItem = virtualItems && virtualItems[index];
|
|
10
10
|
const globalIndex = virtualItem ? virtualItem.index : index;
|
|
@@ -12,14 +12,14 @@ export const renderOptions = ({ options, getOptionProps, filteringValue, highlig
|
|
|
12
12
|
option,
|
|
13
13
|
index: globalIndex,
|
|
14
14
|
getOptionProps,
|
|
15
|
-
filteringValue,
|
|
15
|
+
filteringValue: option.type === 'select-all' ? '' : filteringValue,
|
|
16
16
|
checkboxes,
|
|
17
17
|
});
|
|
18
18
|
const isLastItem = index === options.length - 1;
|
|
19
19
|
const padBottom = !hasDropdownStatus && isLastItem;
|
|
20
|
-
const ListItem = useInteractiveGroups ?
|
|
20
|
+
const ListItem = useInteractiveGroups ? MultiselectItem : Item;
|
|
21
21
|
const isSticky = firstOptionSticky && globalIndex === 0;
|
|
22
|
-
return (React.createElement(ListItem, Object.assign({ key: globalIndex }, props, { virtualPosition:
|
|
22
|
+
return (React.createElement(ListItem, Object.assign({ key: globalIndex }, props, { virtualPosition: virtualItem && virtualItem.start, ref: isSticky && stickyOptionRef ? stickyOptionRef : virtualItem && virtualItem.measureRef, padBottom: padBottom, screenReaderContent: screenReaderContent, ariaPosinset: globalIndex + 1, ariaSetsize: ariaSetsize, highlightType: highlightType.type, withScrollbar: withScrollbar, sticky: isSticky })));
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
//# sourceMappingURL=render-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-options.js","sourceRoot":"","sources":["../../../../src/select/utils/render-options.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"render-options.js","sourceRoot":"","sources":["../../../../src/select/utils/render-options.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,IAAI,MAAM,eAAe,CAAC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AC,CAAC,WAAW,IAAI,WAAW,CAAC,UAAU,EAC1F,SAAS,EAAE,SAAS,EACpB,mBAAmB,EAAE,mBAAmB,EACxC,YAAY,EAAE,WAAW,GAAG,CAAC,EAC7B,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,CAAC,IAAI,EACjC,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,QAAQ,IAChB,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,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 { DropdownOption } from '../../internal/components/option/interfaces';\nimport { HighlightType } from '../../internal/components/options-list/utils/use-highlight-option';\nimport { VirtualItem } from '../../internal/vendor/react-virtual';\nimport Item from '../parts/item';\nimport MultiselectItem from '../parts/multiselect-item';\nimport { getItemProps } from './get-item-props';\n\ninterface RenderOptionProps {\n options: ReadonlyArray<DropdownOption>;\n getOptionProps: any;\n filteringValue: string;\n highlightType: HighlightType;\n checkboxes?: boolean;\n hasDropdownStatus?: boolean;\n virtualItems?: VirtualItem[];\n useInteractiveGroups?: boolean;\n screenReaderContent?: string;\n ariaSetsize?: number;\n withScrollbar: boolean;\n firstOptionSticky?: boolean;\n stickyOptionRef?: React.Ref<HTMLDivElement>;\n}\n\nexport const renderOptions = ({\n options,\n getOptionProps,\n filteringValue,\n highlightType,\n checkboxes = false,\n hasDropdownStatus,\n virtualItems,\n useInteractiveGroups,\n screenReaderContent,\n ariaSetsize,\n withScrollbar,\n firstOptionSticky,\n stickyOptionRef,\n}: RenderOptionProps) => {\n return options.map((option, index) => {\n const virtualItem = virtualItems && virtualItems[index];\n const globalIndex = virtualItem ? virtualItem.index : index;\n const props = getItemProps({\n option,\n index: globalIndex,\n getOptionProps,\n filteringValue: option.type === 'select-all' ? '' : filteringValue,\n checkboxes,\n });\n\n const isLastItem = index === options.length - 1;\n const padBottom = !hasDropdownStatus && isLastItem;\n const ListItem = useInteractiveGroups ? MultiselectItem : Item;\n const isSticky = firstOptionSticky && globalIndex === 0;\n\n return (\n <ListItem\n key={globalIndex}\n {...props}\n virtualPosition={virtualItem && virtualItem.start}\n ref={isSticky && stickyOptionRef ? stickyOptionRef : virtualItem && virtualItem.measureRef}\n padBottom={padBottom}\n screenReaderContent={screenReaderContent}\n ariaPosinset={globalIndex + 1}\n ariaSetsize={ariaSetsize}\n highlightType={highlightType.type}\n withScrollbar={withScrollbar}\n sticky={isSticky}\n />\n );\n });\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-to-index.d.ts","sourceRoot":"","sources":["../../../../src/select/utils/scroll-to-index.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,QAUjF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { scrollElementIntoView } from '../../internal/utils/scrollable-containers';
|
|
4
|
+
export default function ({ index, menuEl }) {
|
|
5
|
+
const item = menuEl.querySelector(`[data-mouse-target="${index}"]`);
|
|
6
|
+
if (item) {
|
|
7
|
+
// In edge case dropdown can be very small, scrolling can cause side effect AWSUI-60318
|
|
8
|
+
if (menuEl.clientHeight !== undefined && menuEl.clientHeight > 15) {
|
|
9
|
+
/* istanbul ignore next: clientHeight always returns 0 in JSDOM, the line is covered by integ tests */
|
|
10
|
+
scrollElementIntoView(item);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=scroll-to-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-to-index.js","sourceRoot":"","sources":["../../../../src/select/utils/scroll-to-index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAEnF,MAAM,CAAC,OAAO,WAAW,EAAE,KAAK,EAAE,MAAM,EAA0C;IAChF,MAAM,IAAI,GAAG,MAAM,CAAC,aAAa,CAAc,uBAAuB,KAAK,IAAI,CAAC,CAAC;IAEjF,IAAI,IAAI,EAAE;QACR,uFAAuF;QACvF,IAAI,MAAM,CAAC,YAAY,KAAK,SAAS,IAAI,MAAM,CAAC,YAAY,GAAG,EAAE,EAAE;YACjE,sGAAsG;YACtG,qBAAqB,CAAC,IAAI,CAAC,CAAC;SAC7B;KACF;AACH,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { scrollElementIntoView } from '../../internal/utils/scrollable-containers';\n\nexport default function ({ index, menuEl }: { index: number; menuEl: HTMLElement }) {\n const item = menuEl.querySelector<HTMLElement>(`[data-mouse-target=\"${index}\"]`);\n\n if (item) {\n // In edge case dropdown can be very small, scrolling can cause side effect AWSUI-60318\n if (menuEl.clientHeight !== undefined && menuEl.clientHeight > 15) {\n /* istanbul ignore next: clientHeight always returns 0 in JSDOM, the line is covered by integ tests */\n scrollElementIntoView(item);\n }\n }\n}\n"]}
|
|
@@ -25,11 +25,14 @@ interface UseSelectProps {
|
|
|
25
25
|
setFilteringValue?: (filteringText: string) => void;
|
|
26
26
|
useInteractiveGroups?: boolean;
|
|
27
27
|
statusType: DropdownStatusProps.StatusType;
|
|
28
|
+
isAllSelected?: boolean;
|
|
29
|
+
isSomeSelected?: boolean;
|
|
30
|
+
toggleAll?: () => void;
|
|
28
31
|
}
|
|
29
32
|
export interface SelectTriggerProps extends ButtonTriggerProps {
|
|
30
33
|
ref: RefObject<HTMLButtonElement>;
|
|
31
34
|
}
|
|
32
|
-
export declare function useSelect({ selectedOptions, updateSelectedOption, options, filteringType, onBlur, onFocus, externalRef, keepOpen, embedded, fireLoadItems, setFilteringValue, useInteractiveGroups, statusType, }: UseSelectProps): {
|
|
35
|
+
export declare function useSelect({ selectedOptions, updateSelectedOption, options, filteringType, onBlur, onFocus, externalRef, keepOpen, embedded, fireLoadItems, setFilteringValue, useInteractiveGroups, statusType, isAllSelected, isSomeSelected, toggleAll, }: UseSelectProps): {
|
|
33
36
|
isOpen: boolean;
|
|
34
37
|
highlightedOption: DropdownOption | undefined;
|
|
35
38
|
highlightedIndex: number;
|