11import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js" ;
2- import type { DefaultSlot , Slot } from "@ui5/webcomponents-base/dist/UI5Element.js" ;
2+ import type { DefaultSlot } from "@ui5/webcomponents-base/dist/UI5Element.js" ;
33import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js" ;
44import property from "@ui5/webcomponents-base/dist/decorators/property.js" ;
55import slot from "@ui5/webcomponents-base/dist/decorators/slot-strict.js" ;
@@ -21,10 +21,7 @@ import type ToggleButton from "@ui5/webcomponents/dist/ToggleButton.js";
2121import "./TimelineItem.js" ;
2222import ItemNavigation from "@ui5/webcomponents-base/dist/delegate/ItemNavigation.js" ;
2323import NavigationMode from "@ui5/webcomponents-base/dist/types/NavigationMode.js" ;
24- import {
25- TIMELINE_ARIA_LABEL ,
26- TIMELINE_LOAD_MORE_BUTTON_TEXT ,
27- } from "./generated/i18n/i18n-defaults.js" ;
24+ import { TIMELINE_ARIA_LABEL , TIMELINE_LOAD_MORE_BUTTON_TEXT } from "./generated/i18n/i18n-defaults.js" ;
2825import TimelineTemplate from "./TimelineTemplate.js" ;
2926import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js" ;
3027import debounce from "@ui5/webcomponents-base/dist/util/debounce.js" ;
@@ -38,8 +35,6 @@ import TimelineLayout from "./types/TimelineLayout.js";
3835import TimelineGrowingMode from "./types/TimelineGrowingMode.js" ;
3936import { getFirstFocusableElement } from "@ui5/webcomponents-base/dist/util/FocusableElements.js" ;
4037import getActiveElement from "@ui5/webcomponents-base/dist/util/getActiveElement.js" ;
41- import type TimelineHeaderBar from "./TimelineHeaderBar.js" ;
42- import type { TimelineHeaderBarSearchEventDetail , TimelineHeaderBarFilterEventDetail , TimelineHeaderBarSortEventDetail } from "./TimelineHeaderBar.js" ;
4338
4439/**
4540 * Interface for components that may be slotted inside `ui5-timeline` as items
@@ -59,17 +54,8 @@ interface ITimelineItem extends UI5Element, ITabbable {
5954 isNextItemGroup ?: boolean ;
6055 firstItemInTimeline ?: boolean ;
6156 effectiveRole ?: string ;
62- titleText ?: string ;
63- name ?: string ;
64- subtitleText ?: string ;
6557}
6658
67- type TimelineSearchEventDetail = TimelineHeaderBarSearchEventDetail ;
68-
69- type TimelineFilterEventDetail = TimelineHeaderBarFilterEventDetail ;
70-
71- type TimelineSortEventDetail = TimelineHeaderBarSortEventDetail ;
72-
7359const SHORT_LINE_WIDTH = "ShortLineWidth" ;
7460const LARGE_LINE_WIDTH = "LargeLineWidth" ;
7561const GROWING_WITH_SCROLL_DEBOUNCE_RATE = 250 ; // ms
@@ -84,15 +70,6 @@ const GROWING_WITH_SCROLL_DEBOUNCE_RATE = 250; // ms
8470 * These entries can be generated by the system (for example, value XY changed from A to B), or added manually.
8571 * There are two distinct variants of the timeline: basic and social. The basic timeline is read-only,
8672 * while the social timeline offers a high level of interaction and collaboration, and is integrated within SAP Jam.
87- *
88- * ### Header Bar
89- *
90- * The Timeline supports a `header-bar` slot for search, filter, and sort functionality.
91- * Use the `ui5-timeline-header-bar` component in this slot.
92- * The Timeline fires `search`, `filter`, and `sort` events that the application should handle
93- * by adding, removing, or reordering items in the DOM. The Timeline itself does not perform
94- * filtering or sorting — it renders whatever items are provided in the default slot.
95- *
9673 * @constructor
9774 * @extends UI5Element
9875 * @public
@@ -117,55 +94,9 @@ const GROWING_WITH_SCROLL_DEBOUNCE_RATE = 250; // ms
11794 bubbles : true ,
11895} )
11996
120- /**
121- * Fired when the user performs a search in the header bar.
122- *
123- * **Note:** The Timeline does not perform filtering. The application should handle
124- * this event and add/remove items from the DOM to reflect the search results.
125- *
126- * @param {string } value The search value entered by the user.
127- * @public
128- * @since 2.22.0
129- */
130- @event ( "search" , {
131- bubbles : true ,
132- } )
133-
134- /**
135- * Fired when the user changes filter selection in the header bar.
136- *
137- * **Note:** The Timeline does not perform filtering. The application should handle
138- * this event and add/remove items from the DOM to reflect the filter selection.
139- *
140- * @param {string } filterBy The filter category.
141- * @param {string[] } selectedOptions The selected filter option texts.
142- * @public
143- * @since 2.22.0
144- */
145- @event ( "filter" , {
146- bubbles : true ,
147- } )
148-
149- /**
150- * Fired when the user changes sort order in the header bar.
151- *
152- * **Note:** The Timeline does not perform sorting. The application should handle
153- * this event and reorder the items in the DOM accordingly.
154- *
155- * @param {string } sortOrder The sort order ("Ascending" or "Descending").
156- * @public
157- * @since 2.22.0
158- */
159- @event ( "sort" , {
160- bubbles : true ,
161- } )
162-
16397class Timeline extends UI5Element {
16498 eventDetails ! : {
16599 "load-more" : void ,
166- "search" : TimelineSearchEventDetail ,
167- "filter" : TimelineFilterEventDetail ,
168- "sort" : TimelineSortEventDetail ,
169100 }
170101 /**
171102 * Defines the items orientation.
@@ -236,19 +167,6 @@ class Timeline extends UI5Element {
236167 @slot ( { type : HTMLElement , individualSlots : true , "default" : true } )
237168 items ! : DefaultSlot < ITimelineItem > ;
238169
239- /**
240- * Defines the header bar of the timeline.
241- * Use `ui5-timeline-header-bar` for filtering, sorting, and search functionality.
242- *
243- * **Note:** The Timeline fires `search`, `filter`, and `sort` events when the user interacts
244- * with the header bar. The application should handle these events to filter/sort the items.
245- *
246- * @public
247- * @since 2.22.0
248- */
249- @slot ( )
250- headerBar ! : Slot < TimelineHeaderBar > ;
251-
252170 @query ( ".ui5-timeline-end-marker" )
253171 timelineEndMarker ! : HTMLElement ;
254172
@@ -297,14 +215,6 @@ class Timeline extends UI5Element {
297215 return this . growing === TimelineGrowingMode . Button ;
298216 }
299217
300- get _hasHeaderBar ( ) : boolean {
301- return this . headerBar . length > 0 ;
302- }
303-
304- onExitDOM ( ) {
305- this . unobserveTimelineEnd ( ) ;
306- }
307-
308218 onAfterRendering ( ) {
309219 if ( this . growsOnScroll ) {
310220 this . observeTimelineEnd ( ) ;
@@ -315,6 +225,10 @@ class Timeline extends UI5Element {
315225 this . growingIntersectionObserver = this . getIntersectionObserver ( ) ;
316226 }
317227
228+ onExitDOM ( ) {
229+ this . unobserveTimelineEnd ( ) ;
230+ }
231+
318232 async observeTimelineEnd ( ) {
319233 if ( ! this . timeLineEndObserved ) {
320234 await renderFinished ( ) ;
@@ -559,7 +473,4 @@ Timeline.define();
559473export default Timeline ;
560474export type {
561475 ITimelineItem ,
562- TimelineSearchEventDetail ,
563- TimelineFilterEventDetail ,
564- TimelineSortEventDetail ,
565476} ;
0 commit comments