stable

Clone or download

Read-only

refactor: Dropdown custom element

How to test: - The first non-disabled item of the dropdown is no longer highlighted automatically. Highlighting is replaced by focus/hover (either through the keyboard with <tab> or with the pointer). - It is now possible to navigate through items of the dropdown using <tab> / <shift+tab>. - It is no longer possible to navigate the dropdown with up/down keys. This will be brought back in a dedicated contribution. - You can still select a focused item by pressing <enter>. There is a known issue where upon first opening, the dropdown can be offset about 40px above the lazybox. This will be adressed specifically, we should first update to latest floating-ui/dom version. No other functional change expected. Notes: - We no longer need to maintain a map of Elements to lazybox items. We no longer need an internal RenderedItem type. - We no longer require an `id` property on lazybox items. - lit/html is dropped completely in favor of hybrids. This causes changes to implementations in the field: hybrids does not allow passing space-separated strings to `class` attribute. - search_field_callback was renamed to search_input_callback, so that it matches the naming of search_input_placeholder. - setSelection was renamed to replaceSelection, to better communicate what happens. part of request #31583 Lazybox big clean-up Change-Id: I733fefe23c627a4f9215081bfc49c28e16a64f54

Modified Files

Name
M lib/frontend/lazybox/package.json +2 −2 Go to diff View file
M lib/frontend/lazybox/pnpm-lock.yaml +8 −27 Go to diff View file
M lib/frontend/lazybox/src/SearchInput.test.ts +5 −9 Go to diff View file
M lib/frontend/lazybox/src/SearchInput.ts +2 −3 Go to diff View file
M lib/frontend/lazybox/src/SelectionBadgeCallbackDefaulter.test.ts +13 −17 Go to diff View file
M lib/frontend/lazybox/src/SelectionBadgeCallbackDefaulter.ts +14 −18 Go to diff View file
D lib/frontend/lazybox/src/dropdown/DropdownContentRefresher.ts +0 −45 Go to diff View file
A lib/frontend/lazybox/src/dropdown/DropdownElement.test.ts +155 −0 Go to diff View file
A lib/frontend/lazybox/src/dropdown/DropdownElement.ts +117 −0 Go to diff View file
D lib/frontend/lazybox/src/dropdown/DropdownEventsHandler.test.ts +0 −81 Go to diff View file
D lib/frontend/lazybox/src/dropdown/DropdownEventsHandler.ts +0 −46 Go to diff View file
D lib/frontend/lazybox/src/dropdown/DropdownManager.test.ts +0 −192 Go to diff View file
D lib/frontend/lazybox/src/dropdown/DropdownManager.ts +0 −128 Go to diff View file
A lib/frontend/lazybox/src/dropdown/GroupTemplate.test.ts +176 −0 Go to diff View file
A lib/frontend/lazybox/src/dropdown/GroupTemplate.ts +122 −0 Go to diff View file
A lib/frontend/lazybox/src/dropdown/__snapshots__/GroupTemplate.test.ts.snap +29 −0 Go to diff View file
M lib/frontend/lazybox/src/events/EventManager.test.ts +59 −209 Go to diff View file
M lib/frontend/lazybox/src/events/EventManager.ts +10 −73 Go to diff View file
D lib/frontend/lazybox/src/helpers/group-id-helper.test.ts +0 −35 Go to diff View file
D lib/frontend/lazybox/src/helpers/list-item-finder.test.ts +0 −88 Go to diff View file
D lib/frontend/lazybox/src/helpers/list-item-finder.ts +0 −63 Go to diff View file
M lib/frontend/lazybox/src/index.ts +6 −3 Go to diff View file
M lib/frontend/lazybox/src/items/GroupCollection.ts +0 −1 Go to diff View file
D lib/frontend/lazybox/src/items/ItemsMapManager.test.ts +0 −71 Go to diff View file
D lib/frontend/lazybox/src/items/ItemsMapManager.ts +0 −48 Go to diff View file
D lib/frontend/lazybox/src/items/ListItemMapBuilder.test.ts +0 −161 Go to diff View file
D lib/frontend/lazybox/src/items/ListItemMapBuilder.ts +0 −81 Go to diff View file
M lib/frontend/lazybox/src/lazybox.ts +38 −78 Go to diff View file
D lib/frontend/lazybox/src/navigation/KeyboardNavigationManager.test.ts +0 −124 Go to diff View file
D lib/frontend/lazybox/src/navigation/KeyboardNavigationManager.ts +0 −112 Go to diff View file
D lib/frontend/lazybox/src/navigation/ListItemHighlighter.test.ts +0 −77 Go to diff View file
D lib/frontend/lazybox/src/navigation/ListItemHighlighter.ts +0 −59 Go to diff View file
M lib/frontend/lazybox/src/renderers/BaseComponentRenderer.test.ts +3 −5 Go to diff View file
M lib/frontend/lazybox/src/renderers/BaseComponentRenderer.ts +24 −46 Go to diff View file
D lib/frontend/lazybox/src/renderers/DropdownContentRenderer.test.ts +0 −153 Go to diff View file
D lib/frontend/lazybox/src/renderers/DropdownContentRenderer.ts +0 −131 Go to diff View file
D lib/frontend/lazybox/src/renderers/__snapshots__/DropdownContentRenderer.test.ts.snap +0 −38 Go to diff View file
M lib/frontend/lazybox/src/selection/ClearSelectionTemplate.test.ts +6 −23 Go to diff View file
M lib/frontend/lazybox/src/selection/ClearSelectionTemplate.ts +1 −17 Go to diff View file
D lib/frontend/lazybox/src/selection/KeyboardSelector.test.ts +0 −99 Go to diff View file
D lib/frontend/lazybox/src/selection/KeyboardSelector.ts +0 −47 Go to diff View file
M lib/frontend/lazybox/src/selection/SelectionElement.test.ts +78 −114 Go to diff View file
M lib/frontend/lazybox/src/selection/SelectionElement.ts +35 −73 Go to diff View file
D lib/frontend/lazybox/src/selection/SelectionManager.test.ts +0 −120 Go to diff View file
D lib/frontend/lazybox/src/selection/SelectionManager.ts +0 −63 Go to diff View file
M lib/frontend/lazybox/src/type.ts +29 −40 Go to diff View file
M lib/frontend/lazybox/tests/builders/GroupCollectionBuilder.ts +7 −16 Go to diff View file
M lib/frontend/lazybox/tests/builders/OptionsBuilder.ts +43 −10 Go to diff View file
R lib/frontend/lazybox/src/helpers/group-id-helper.ts Go to diff View file
D lib/frontend/lazybox/tests/stubs/ManageDropdownStub.ts +0 −62 Go to diff View file
D lib/frontend/lazybox/tests/stubs/ManageSelectionStub.ts +0 −56 Go to diff View file
D lib/frontend/lazybox/tests/stubs/RenderedItemStub.ts +0 −40 Go to diff View file
R lib/frontend/lazybox/src/dropdown/new-item-template.ts Go to diff View file
M lib/frontend/lazybox/tests/stubs/TemplatingCallbackStub.ts +2 −1 Go to diff View file
M lib/frontend/lazybox/themes/style.scss +24 −34 Go to diff View file
M lib/frontend/lazybox/tsconfig.json +2 −1 Go to diff View file
M lib/frontend/lazybox/vite.config.ts +4 −3 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Reviewers/PullRequestManageReviewersModal.test.ts +5 −2 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/src/components/Reviewers/PullRequestManageReviewersModal.vue +2 −3 Go to diff View file
M plugins/pullrequest/scripts/pullrequest-overview/tests/stubs/LazyboxStub.ts +1 −1 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/LinkField.ts +1 −1 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/dropdown/LinkSelectorItemProxy.test.ts +0 −2 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/dropdown/LinkSelectorItemProxy.ts +0 −1 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/dropdown/LinkableArtifactTemplate.ts +25 −25 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/link-field.scss +6 −2 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/tests/stubs/LazyboxStub.ts +1 −1 Go to diff View file
M src/scripts/tlp-doc/src/editors.js +7 −29 Go to diff View file
M src/www/tlp-doc/resources/forms/lazybox/doc.html +10 −11 Go to diff View file
M src/www/tlp-doc/resources/forms/lazybox/example.html +11 −10 Go to diff View file