@memberjunction/ng-timeline 6.2.0-edge.0 → 6.2.0-edge.1
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/dist/lib/component/timeline.component.d.ts +312 -16
- package/dist/lib/component/timeline.component.d.ts.map +1 -1
- package/dist/lib/component/timeline.component.js +661 -195
- package/dist/lib/component/timeline.component.js.map +1 -1
- package/dist/lib/timeline-group.d.ts +22 -0
- package/dist/lib/timeline-group.d.ts.map +1 -1
- package/dist/lib/timeline-group.js +62 -18
- package/dist/lib/timeline-group.js.map +1 -1
- package/package.json +5 -5
|
@@ -634,10 +634,10 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
634
634
|
* Array of timeline groups to display.
|
|
635
635
|
* Each group defines a data source and display configuration.
|
|
636
636
|
*/
|
|
637
|
-
get
|
|
637
|
+
get Groups() {
|
|
638
638
|
return this._groups;
|
|
639
639
|
}
|
|
640
|
-
set
|
|
640
|
+
set Groups(value) {
|
|
641
641
|
const prevGroups = this._groups;
|
|
642
642
|
this._groups = value || [];
|
|
643
643
|
const hasGroups = this._groups.length > 0;
|
|
@@ -649,17 +649,25 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
649
649
|
// so ngAfterViewInit's real refresh would be skipped and the timeline would show "No events"
|
|
650
650
|
// until something forced a re-refresh (e.g. changing the date field). Only refresh from the setter
|
|
651
651
|
// once the view is ready.
|
|
652
|
-
if (this.
|
|
652
|
+
if (this.AllowLoad && hasGroups && this._viewReady) {
|
|
653
653
|
if (!this._hasLoaded) {
|
|
654
654
|
// First load
|
|
655
|
-
this.
|
|
655
|
+
this.Refresh();
|
|
656
656
|
}
|
|
657
657
|
else if (groupsChanged) {
|
|
658
658
|
// Groups changed after initial load - force refresh
|
|
659
|
-
this.
|
|
659
|
+
this.Refresh(true);
|
|
660
660
|
}
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
|
+
/** @deprecated Use {@link Groups}. */
|
|
664
|
+
get groups() {
|
|
665
|
+
return this.Groups;
|
|
666
|
+
}
|
|
667
|
+
/** @deprecated Use {@link Groups}. */
|
|
668
|
+
set groups(value) {
|
|
669
|
+
this.Groups = value;
|
|
670
|
+
}
|
|
663
671
|
_groups = [];
|
|
664
672
|
/** True once ngAfterViewInit has run — the view is ready to render refreshed events. */
|
|
665
673
|
_viewReady = false;
|
|
@@ -685,17 +693,25 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
685
693
|
* Set to false to defer loading until ready.
|
|
686
694
|
* @default true
|
|
687
695
|
*/
|
|
688
|
-
get
|
|
696
|
+
get AllowLoad() {
|
|
689
697
|
return this._allowLoad;
|
|
690
698
|
}
|
|
691
|
-
set
|
|
699
|
+
set AllowLoad(value) {
|
|
692
700
|
const wasDisabled = !this._allowLoad;
|
|
693
701
|
this._allowLoad = value;
|
|
694
702
|
// When allowLoad becomes true and we have groups, trigger refresh
|
|
695
703
|
if (value && wasDisabled && this._groups.length > 0) {
|
|
696
|
-
this.
|
|
704
|
+
this.Refresh(this._hasLoaded);
|
|
697
705
|
}
|
|
698
706
|
}
|
|
707
|
+
/** @deprecated Use {@link AllowLoad}. */
|
|
708
|
+
get allowLoad() {
|
|
709
|
+
return this.AllowLoad;
|
|
710
|
+
}
|
|
711
|
+
/** @deprecated Use {@link AllowLoad}. */
|
|
712
|
+
set allowLoad(value) {
|
|
713
|
+
this.AllowLoad = value;
|
|
714
|
+
}
|
|
699
715
|
_allowLoad = true;
|
|
700
716
|
// ============================================================================
|
|
701
717
|
// INPUTS - LAYOUT (using setters for reactive updates)
|
|
@@ -706,15 +722,23 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
706
722
|
* - `horizontal`: Events displayed left-to-right
|
|
707
723
|
* @default 'vertical'
|
|
708
724
|
*/
|
|
709
|
-
get
|
|
725
|
+
get Orientation() {
|
|
710
726
|
return this._orientation;
|
|
711
727
|
}
|
|
712
|
-
set
|
|
728
|
+
set Orientation(value) {
|
|
713
729
|
if (this._orientation !== value) {
|
|
714
730
|
this._orientation = value;
|
|
715
731
|
this.cdr.markForCheck();
|
|
716
732
|
}
|
|
717
733
|
}
|
|
734
|
+
/** @deprecated Use {@link Orientation}. */
|
|
735
|
+
get orientation() {
|
|
736
|
+
return this.Orientation;
|
|
737
|
+
}
|
|
738
|
+
/** @deprecated Use {@link Orientation}. */
|
|
739
|
+
set orientation(value) {
|
|
740
|
+
this.Orientation = value;
|
|
741
|
+
}
|
|
718
742
|
_orientation = 'vertical';
|
|
719
743
|
/**
|
|
720
744
|
* Layout mode for vertical timeline.
|
|
@@ -722,15 +746,23 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
722
746
|
* - `alternating`: Cards alternate sides
|
|
723
747
|
* @default 'single'
|
|
724
748
|
*/
|
|
725
|
-
get
|
|
749
|
+
get Layout() {
|
|
726
750
|
return this._layout;
|
|
727
751
|
}
|
|
728
|
-
set
|
|
752
|
+
set Layout(value) {
|
|
729
753
|
if (this._layout !== value) {
|
|
730
754
|
this._layout = value;
|
|
731
755
|
this.cdr.markForCheck();
|
|
732
756
|
}
|
|
733
757
|
}
|
|
758
|
+
/** @deprecated Use {@link Layout}. */
|
|
759
|
+
get layout() {
|
|
760
|
+
return this.Layout;
|
|
761
|
+
}
|
|
762
|
+
/** @deprecated Use {@link Layout}. */
|
|
763
|
+
set layout(value) {
|
|
764
|
+
this.Layout = value;
|
|
765
|
+
}
|
|
734
766
|
_layout = 'single';
|
|
735
767
|
/**
|
|
736
768
|
* Sort order for events.
|
|
@@ -738,37 +770,53 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
738
770
|
* - `asc`: Oldest first
|
|
739
771
|
* @default 'desc'
|
|
740
772
|
*/
|
|
741
|
-
get
|
|
773
|
+
get SortOrder() {
|
|
742
774
|
return this._sortOrder;
|
|
743
775
|
}
|
|
744
|
-
set
|
|
776
|
+
set SortOrder(value) {
|
|
745
777
|
if (this._sortOrder !== value) {
|
|
746
778
|
this._sortOrder = value;
|
|
747
779
|
// Re-process events when sort order changes - force refresh since data already loaded
|
|
748
780
|
if (this._initialized) {
|
|
749
|
-
this.
|
|
781
|
+
this.Refresh(true);
|
|
750
782
|
}
|
|
751
783
|
this.cdr.markForCheck();
|
|
752
784
|
}
|
|
753
785
|
}
|
|
786
|
+
/** @deprecated Use {@link SortOrder}. */
|
|
787
|
+
get sortOrder() {
|
|
788
|
+
return this.SortOrder;
|
|
789
|
+
}
|
|
790
|
+
/** @deprecated Use {@link SortOrder}. */
|
|
791
|
+
set sortOrder(value) {
|
|
792
|
+
this.SortOrder = value;
|
|
793
|
+
}
|
|
754
794
|
_sortOrder = 'desc';
|
|
755
795
|
/**
|
|
756
796
|
* How to group events into time segments.
|
|
757
797
|
* @default 'month'
|
|
758
798
|
*/
|
|
759
|
-
get
|
|
799
|
+
get SegmentGrouping() {
|
|
760
800
|
return this._segmentGrouping;
|
|
761
801
|
}
|
|
762
|
-
set
|
|
802
|
+
set SegmentGrouping(value) {
|
|
763
803
|
if (this._segmentGrouping !== value) {
|
|
764
804
|
this._segmentGrouping = value;
|
|
765
805
|
// Re-segment events when grouping changes - force refresh since data already loaded
|
|
766
806
|
if (this._initialized) {
|
|
767
|
-
this.
|
|
807
|
+
this.Refresh(true);
|
|
768
808
|
}
|
|
769
809
|
this.cdr.markForCheck();
|
|
770
810
|
}
|
|
771
811
|
}
|
|
812
|
+
/** @deprecated Use {@link SegmentGrouping}. */
|
|
813
|
+
get segmentGrouping() {
|
|
814
|
+
return this.SegmentGrouping;
|
|
815
|
+
}
|
|
816
|
+
/** @deprecated Use {@link SegmentGrouping}. */
|
|
817
|
+
set segmentGrouping(value) {
|
|
818
|
+
this.SegmentGrouping = value;
|
|
819
|
+
}
|
|
772
820
|
_segmentGrouping = 'month';
|
|
773
821
|
// ============================================================================
|
|
774
822
|
// INPUTS - CARD DEFAULTS
|
|
@@ -777,14 +825,30 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
777
825
|
* Default card configuration applied to all groups.
|
|
778
826
|
* Individual groups can override these settings.
|
|
779
827
|
*/
|
|
780
|
-
|
|
828
|
+
DefaultCardConfig = { ...DEFAULT_CARD_CONFIG };
|
|
829
|
+
/** @deprecated Use {@link DefaultCardConfig}. */
|
|
830
|
+
set defaultCardConfig(value) {
|
|
831
|
+
this.DefaultCardConfig = value;
|
|
832
|
+
}
|
|
833
|
+
/** @deprecated Use {@link DefaultCardConfig}. */
|
|
834
|
+
get defaultCardConfig() {
|
|
835
|
+
return this.DefaultCardConfig;
|
|
836
|
+
}
|
|
781
837
|
// ============================================================================
|
|
782
838
|
// INPUTS - VIRTUAL SCROLLING
|
|
783
839
|
// ============================================================================
|
|
784
840
|
/**
|
|
785
841
|
* Virtual scrolling configuration.
|
|
786
842
|
*/
|
|
787
|
-
|
|
843
|
+
VirtualScroll = { ...DEFAULT_VIRTUAL_SCROLL_CONFIG };
|
|
844
|
+
/** @deprecated Use {@link VirtualScroll}. */
|
|
845
|
+
set virtualScroll(value) {
|
|
846
|
+
this.VirtualScroll = value;
|
|
847
|
+
}
|
|
848
|
+
/** @deprecated Use {@link VirtualScroll}. */
|
|
849
|
+
get virtualScroll() {
|
|
850
|
+
return this.VirtualScroll;
|
|
851
|
+
}
|
|
788
852
|
// ============================================================================
|
|
789
853
|
// INPUTS - SEGMENTS
|
|
790
854
|
// ============================================================================
|
|
@@ -792,12 +856,12 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
792
856
|
* Whether time segments can be collapsed.
|
|
793
857
|
* @default true
|
|
794
858
|
*/
|
|
795
|
-
segmentsCollapsible = true;
|
|
859
|
+
segmentsCollapsible = true; // case-violation-ok-legacy-back-compat: untyped member on a generic class — the alias cannot name its type
|
|
796
860
|
/**
|
|
797
861
|
* Whether segments start expanded.
|
|
798
862
|
* @default true
|
|
799
863
|
*/
|
|
800
|
-
segmentsDefaultExpanded = true;
|
|
864
|
+
segmentsDefaultExpanded = true; // case-violation-ok-legacy-back-compat: untyped member on a generic class — the alias cannot name its type
|
|
801
865
|
// ============================================================================
|
|
802
866
|
// INPUTS - EMPTY & LOADING STATES
|
|
803
867
|
// ============================================================================
|
|
@@ -805,17 +869,17 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
805
869
|
* Message shown when no events exist.
|
|
806
870
|
* @default 'No events to display'
|
|
807
871
|
*/
|
|
808
|
-
emptyMessage = 'No events to display';
|
|
872
|
+
emptyMessage = 'No events to display'; // case-violation-ok-legacy-back-compat: untyped member on a generic class — the alias cannot name its type
|
|
809
873
|
/**
|
|
810
874
|
* Icon shown with empty message.
|
|
811
875
|
* @default 'fa-regular fa-calendar-xmark'
|
|
812
876
|
*/
|
|
813
|
-
emptyIcon = 'fa-regular fa-calendar-xmark';
|
|
877
|
+
emptyIcon = 'fa-regular fa-calendar-xmark'; // case-violation-ok-legacy-back-compat: untyped member on a generic class — the alias cannot name its type
|
|
814
878
|
/**
|
|
815
879
|
* Message shown while loading.
|
|
816
880
|
* @default 'Loading timeline...'
|
|
817
881
|
*/
|
|
818
|
-
loadingMessage = 'Loading timeline...';
|
|
882
|
+
loadingMessage = 'Loading timeline...'; // case-violation-ok-legacy-back-compat: untyped member on a generic class — the alias cannot name its type
|
|
819
883
|
// ============================================================================
|
|
820
884
|
// INPUTS - ACCESSIBILITY
|
|
821
885
|
// ============================================================================
|
|
@@ -823,101 +887,341 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
823
887
|
* ARIA label for the timeline container.
|
|
824
888
|
* @default 'Timeline'
|
|
825
889
|
*/
|
|
826
|
-
ariaLabel = 'Timeline';
|
|
890
|
+
ariaLabel = 'Timeline'; // case-violation-ok-legacy-back-compat: untyped member on a generic class — the alias cannot name its type
|
|
827
891
|
/**
|
|
828
892
|
* Enable keyboard navigation.
|
|
829
893
|
* @default true
|
|
830
894
|
*/
|
|
831
|
-
enableKeyboardNavigation = true;
|
|
895
|
+
enableKeyboardNavigation = true; // case-violation-ok-legacy-back-compat: untyped member on a generic class — the alias cannot name its type
|
|
832
896
|
/**
|
|
833
897
|
* ID of the currently selected event.
|
|
834
898
|
* When set, the corresponding event will be highlighted with the focused style.
|
|
835
899
|
*/
|
|
836
|
-
get
|
|
900
|
+
get SelectedEventId() {
|
|
837
901
|
return this._selectedEventId;
|
|
838
902
|
}
|
|
839
|
-
set
|
|
903
|
+
set SelectedEventId(value) {
|
|
840
904
|
const changed = this._selectedEventId !== value;
|
|
841
905
|
this._selectedEventId = value;
|
|
842
906
|
if (changed) {
|
|
843
907
|
this.cdr.markForCheck();
|
|
844
908
|
}
|
|
845
909
|
}
|
|
910
|
+
/** @deprecated Use {@link SelectedEventId}. */
|
|
911
|
+
get selectedEventId() {
|
|
912
|
+
return this.SelectedEventId;
|
|
913
|
+
}
|
|
914
|
+
/** @deprecated Use {@link SelectedEventId}. */
|
|
915
|
+
set selectedEventId(value) {
|
|
916
|
+
this.SelectedEventId = value;
|
|
917
|
+
}
|
|
846
918
|
_selectedEventId = null;
|
|
847
919
|
// ============================================================================
|
|
848
920
|
// OUTPUTS - BEFORE EVENTS (with cancel support)
|
|
849
921
|
// ============================================================================
|
|
850
922
|
/** Emitted before an event card is clicked. Set `cancel = true` to prevent. */
|
|
851
|
-
|
|
923
|
+
BeforeEventClick = new EventEmitter();
|
|
924
|
+
/**
|
|
925
|
+
* @deprecated Use {@link BeforeEventClick}.
|
|
926
|
+
*
|
|
927
|
+
* The same emitter under the old binding name, so a template still binding
|
|
928
|
+
* (beforeEventClick) keeps working. Must stay AFTER BeforeEventClick: class fields
|
|
929
|
+
* initialise in order, and the other way round this captures undefined.
|
|
930
|
+
*/
|
|
931
|
+
beforeEventClick = this.BeforeEventClick;
|
|
852
932
|
/** Emitted before an event card expands. Set `cancel = true` to prevent. */
|
|
853
|
-
|
|
933
|
+
BeforeEventExpand = new EventEmitter();
|
|
934
|
+
/**
|
|
935
|
+
* @deprecated Use {@link BeforeEventExpand}.
|
|
936
|
+
*
|
|
937
|
+
* The same emitter under the old binding name, so a template still binding
|
|
938
|
+
* (beforeEventExpand) keeps working. Must stay AFTER BeforeEventExpand: class fields
|
|
939
|
+
* initialise in order, and the other way round this captures undefined.
|
|
940
|
+
*/
|
|
941
|
+
beforeEventExpand = this.BeforeEventExpand;
|
|
854
942
|
/** Emitted before an event card collapses. Set `cancel = true` to prevent. */
|
|
855
|
-
|
|
943
|
+
BeforeEventCollapse = new EventEmitter();
|
|
944
|
+
/**
|
|
945
|
+
* @deprecated Use {@link BeforeEventCollapse}.
|
|
946
|
+
*
|
|
947
|
+
* The same emitter under the old binding name, so a template still binding
|
|
948
|
+
* (beforeEventCollapse) keeps working. Must stay AFTER BeforeEventCollapse: class fields
|
|
949
|
+
* initialise in order, and the other way round this captures undefined.
|
|
950
|
+
*/
|
|
951
|
+
beforeEventCollapse = this.BeforeEventCollapse;
|
|
856
952
|
/** Emitted before hover state changes. Set `cancel = true` to prevent. */
|
|
857
|
-
|
|
953
|
+
BeforeEventHover = new EventEmitter();
|
|
954
|
+
/**
|
|
955
|
+
* @deprecated Use {@link BeforeEventHover}.
|
|
956
|
+
*
|
|
957
|
+
* The same emitter under the old binding name, so a template still binding
|
|
958
|
+
* (beforeEventHover) keeps working. Must stay AFTER BeforeEventHover: class fields
|
|
959
|
+
* initialise in order, and the other way round this captures undefined.
|
|
960
|
+
*/
|
|
961
|
+
beforeEventHover = this.BeforeEventHover;
|
|
858
962
|
/** Emitted before an action button is clicked. Set `cancel = true` to prevent. */
|
|
859
|
-
|
|
963
|
+
BeforeActionClick = new EventEmitter();
|
|
964
|
+
/**
|
|
965
|
+
* @deprecated Use {@link BeforeActionClick}.
|
|
966
|
+
*
|
|
967
|
+
* The same emitter under the old binding name, so a template still binding
|
|
968
|
+
* (beforeActionClick) keeps working. Must stay AFTER BeforeActionClick: class fields
|
|
969
|
+
* initialise in order, and the other way round this captures undefined.
|
|
970
|
+
*/
|
|
971
|
+
beforeActionClick = this.BeforeActionClick;
|
|
860
972
|
/** Emitted before a time segment expands. Set `cancel = true` to prevent. */
|
|
861
|
-
|
|
973
|
+
BeforeSegmentExpand = new EventEmitter();
|
|
974
|
+
/**
|
|
975
|
+
* @deprecated Use {@link BeforeSegmentExpand}.
|
|
976
|
+
*
|
|
977
|
+
* The same emitter under the old binding name, so a template still binding
|
|
978
|
+
* (beforeSegmentExpand) keeps working. Must stay AFTER BeforeSegmentExpand: class fields
|
|
979
|
+
* initialise in order, and the other way round this captures undefined.
|
|
980
|
+
*/
|
|
981
|
+
beforeSegmentExpand = this.BeforeSegmentExpand;
|
|
862
982
|
/** Emitted before a time segment collapses. Set `cancel = true` to prevent. */
|
|
863
|
-
|
|
983
|
+
BeforeSegmentCollapse = new EventEmitter();
|
|
984
|
+
/**
|
|
985
|
+
* @deprecated Use {@link BeforeSegmentCollapse}.
|
|
986
|
+
*
|
|
987
|
+
* The same emitter under the old binding name, so a template still binding
|
|
988
|
+
* (beforeSegmentCollapse) keeps working. Must stay AFTER BeforeSegmentCollapse: class fields
|
|
989
|
+
* initialise in order, and the other way round this captures undefined.
|
|
990
|
+
*/
|
|
991
|
+
beforeSegmentCollapse = this.BeforeSegmentCollapse;
|
|
864
992
|
/** Emitted before data loading begins. Set `cancel = true` to prevent. */
|
|
865
|
-
|
|
993
|
+
BeforeLoad = new EventEmitter();
|
|
994
|
+
/**
|
|
995
|
+
* @deprecated Use {@link BeforeLoad}.
|
|
996
|
+
*
|
|
997
|
+
* The same emitter under the old binding name, so a template still binding
|
|
998
|
+
* (beforeLoad) keeps working. Must stay AFTER BeforeLoad: class fields
|
|
999
|
+
* initialise in order, and the other way round this captures undefined.
|
|
1000
|
+
*/
|
|
1001
|
+
beforeLoad = this.BeforeLoad;
|
|
866
1002
|
// ============================================================================
|
|
867
1003
|
// OUTPUTS - AFTER EVENTS
|
|
868
1004
|
// ============================================================================
|
|
869
1005
|
/** Emitted after an event card is clicked. */
|
|
870
|
-
|
|
1006
|
+
AfterEventClick = new EventEmitter();
|
|
1007
|
+
/**
|
|
1008
|
+
* @deprecated Use {@link AfterEventClick}.
|
|
1009
|
+
*
|
|
1010
|
+
* The same emitter under the old binding name, so a template still binding
|
|
1011
|
+
* (afterEventClick) keeps working. Must stay AFTER AfterEventClick: class fields
|
|
1012
|
+
* initialise in order, and the other way round this captures undefined.
|
|
1013
|
+
*/
|
|
1014
|
+
afterEventClick = this.AfterEventClick;
|
|
871
1015
|
/** Emitted after an event card expands. */
|
|
872
|
-
|
|
1016
|
+
AfterEventExpand = new EventEmitter();
|
|
1017
|
+
/**
|
|
1018
|
+
* @deprecated Use {@link AfterEventExpand}.
|
|
1019
|
+
*
|
|
1020
|
+
* The same emitter under the old binding name, so a template still binding
|
|
1021
|
+
* (afterEventExpand) keeps working. Must stay AFTER AfterEventExpand: class fields
|
|
1022
|
+
* initialise in order, and the other way round this captures undefined.
|
|
1023
|
+
*/
|
|
1024
|
+
afterEventExpand = this.AfterEventExpand;
|
|
873
1025
|
/** Emitted after an event card collapses. */
|
|
874
|
-
|
|
1026
|
+
AfterEventCollapse = new EventEmitter();
|
|
1027
|
+
/**
|
|
1028
|
+
* @deprecated Use {@link AfterEventCollapse}.
|
|
1029
|
+
*
|
|
1030
|
+
* The same emitter under the old binding name, so a template still binding
|
|
1031
|
+
* (afterEventCollapse) keeps working. Must stay AFTER AfterEventCollapse: class fields
|
|
1032
|
+
* initialise in order, and the other way round this captures undefined.
|
|
1033
|
+
*/
|
|
1034
|
+
afterEventCollapse = this.AfterEventCollapse;
|
|
875
1035
|
/** Emitted after hover state changes. */
|
|
876
|
-
|
|
1036
|
+
AfterEventHover = new EventEmitter();
|
|
1037
|
+
/**
|
|
1038
|
+
* @deprecated Use {@link AfterEventHover}.
|
|
1039
|
+
*
|
|
1040
|
+
* The same emitter under the old binding name, so a template still binding
|
|
1041
|
+
* (afterEventHover) keeps working. Must stay AFTER AfterEventHover: class fields
|
|
1042
|
+
* initialise in order, and the other way round this captures undefined.
|
|
1043
|
+
*/
|
|
1044
|
+
afterEventHover = this.AfterEventHover;
|
|
877
1045
|
/** Emitted after an action button is clicked. */
|
|
878
|
-
|
|
1046
|
+
AfterActionClick = new EventEmitter();
|
|
1047
|
+
/**
|
|
1048
|
+
* @deprecated Use {@link AfterActionClick}.
|
|
1049
|
+
*
|
|
1050
|
+
* The same emitter under the old binding name, so a template still binding
|
|
1051
|
+
* (afterActionClick) keeps working. Must stay AFTER AfterActionClick: class fields
|
|
1052
|
+
* initialise in order, and the other way round this captures undefined.
|
|
1053
|
+
*/
|
|
1054
|
+
afterActionClick = this.AfterActionClick;
|
|
879
1055
|
/** Emitted after a time segment expands. */
|
|
880
|
-
|
|
1056
|
+
AfterSegmentExpand = new EventEmitter();
|
|
1057
|
+
/**
|
|
1058
|
+
* @deprecated Use {@link AfterSegmentExpand}.
|
|
1059
|
+
*
|
|
1060
|
+
* The same emitter under the old binding name, so a template still binding
|
|
1061
|
+
* (afterSegmentExpand) keeps working. Must stay AFTER AfterSegmentExpand: class fields
|
|
1062
|
+
* initialise in order, and the other way round this captures undefined.
|
|
1063
|
+
*/
|
|
1064
|
+
afterSegmentExpand = this.AfterSegmentExpand;
|
|
881
1065
|
/** Emitted after a time segment collapses. */
|
|
882
|
-
|
|
1066
|
+
AfterSegmentCollapse = new EventEmitter();
|
|
1067
|
+
/**
|
|
1068
|
+
* @deprecated Use {@link AfterSegmentCollapse}.
|
|
1069
|
+
*
|
|
1070
|
+
* The same emitter under the old binding name, so a template still binding
|
|
1071
|
+
* (afterSegmentCollapse) keeps working. Must stay AFTER AfterSegmentCollapse: class fields
|
|
1072
|
+
* initialise in order, and the other way round this captures undefined.
|
|
1073
|
+
*/
|
|
1074
|
+
afterSegmentCollapse = this.AfterSegmentCollapse;
|
|
883
1075
|
/** Emitted after data loading completes. */
|
|
884
|
-
|
|
1076
|
+
AfterLoad = new EventEmitter();
|
|
1077
|
+
/**
|
|
1078
|
+
* @deprecated Use {@link AfterLoad}.
|
|
1079
|
+
*
|
|
1080
|
+
* The same emitter under the old binding name, so a template still binding
|
|
1081
|
+
* (afterLoad) keeps working. Must stay AFTER AfterLoad: class fields
|
|
1082
|
+
* initialise in order, and the other way round this captures undefined.
|
|
1083
|
+
*/
|
|
1084
|
+
afterLoad = this.AfterLoad;
|
|
885
1085
|
// ============================================================================
|
|
886
1086
|
// CONTENT CHILDREN - OPTIONAL TEMPLATES
|
|
887
1087
|
// ============================================================================
|
|
888
1088
|
/** Custom template for entire card. Context: { event, group } */
|
|
889
|
-
|
|
1089
|
+
CardTemplate;
|
|
1090
|
+
/** @deprecated Use {@link CardTemplate}. */
|
|
1091
|
+
get cardTemplate() {
|
|
1092
|
+
return this.CardTemplate;
|
|
1093
|
+
}
|
|
1094
|
+
/** @deprecated Use {@link CardTemplate}. */
|
|
1095
|
+
set cardTemplate(value) {
|
|
1096
|
+
this.CardTemplate = value;
|
|
1097
|
+
}
|
|
890
1098
|
/** Custom template for card header. Context: { event } */
|
|
891
|
-
|
|
1099
|
+
HeaderTemplate;
|
|
1100
|
+
/** @deprecated Use {@link HeaderTemplate}. */
|
|
1101
|
+
get headerTemplate() {
|
|
1102
|
+
return this.HeaderTemplate;
|
|
1103
|
+
}
|
|
1104
|
+
/** @deprecated Use {@link HeaderTemplate}. */
|
|
1105
|
+
set headerTemplate(value) {
|
|
1106
|
+
this.HeaderTemplate = value;
|
|
1107
|
+
}
|
|
892
1108
|
/** Custom template for card body. Context: { event } */
|
|
893
|
-
|
|
1109
|
+
BodyTemplate;
|
|
1110
|
+
/** @deprecated Use {@link BodyTemplate}. */
|
|
1111
|
+
get bodyTemplate() {
|
|
1112
|
+
return this.BodyTemplate;
|
|
1113
|
+
}
|
|
1114
|
+
/** @deprecated Use {@link BodyTemplate}. */
|
|
1115
|
+
set bodyTemplate(value) {
|
|
1116
|
+
this.BodyTemplate = value;
|
|
1117
|
+
}
|
|
894
1118
|
/** Custom template for card actions. Context: { event, actions } */
|
|
895
|
-
|
|
1119
|
+
ActionsTemplate;
|
|
1120
|
+
/** @deprecated Use {@link ActionsTemplate}. */
|
|
1121
|
+
get actionsTemplate() {
|
|
1122
|
+
return this.ActionsTemplate;
|
|
1123
|
+
}
|
|
1124
|
+
/** @deprecated Use {@link ActionsTemplate}. */
|
|
1125
|
+
set actionsTemplate(value) {
|
|
1126
|
+
this.ActionsTemplate = value;
|
|
1127
|
+
}
|
|
896
1128
|
/** Custom template for segment header. Context: { segment } */
|
|
897
|
-
|
|
1129
|
+
SegmentHeaderTemplate;
|
|
1130
|
+
/** @deprecated Use {@link SegmentHeaderTemplate}. */
|
|
1131
|
+
get segmentHeaderTemplate() {
|
|
1132
|
+
return this.SegmentHeaderTemplate;
|
|
1133
|
+
}
|
|
1134
|
+
/** @deprecated Use {@link SegmentHeaderTemplate}. */
|
|
1135
|
+
set segmentHeaderTemplate(value) {
|
|
1136
|
+
this.SegmentHeaderTemplate = value;
|
|
1137
|
+
}
|
|
898
1138
|
/** Custom template for empty state. */
|
|
899
|
-
|
|
1139
|
+
EmptyTemplate;
|
|
1140
|
+
/** @deprecated Use {@link EmptyTemplate}. */
|
|
1141
|
+
get emptyTemplate() {
|
|
1142
|
+
return this.EmptyTemplate;
|
|
1143
|
+
}
|
|
1144
|
+
/** @deprecated Use {@link EmptyTemplate}. */
|
|
1145
|
+
set emptyTemplate(value) {
|
|
1146
|
+
this.EmptyTemplate = value;
|
|
1147
|
+
}
|
|
900
1148
|
/** Custom template for loading state. */
|
|
901
|
-
|
|
1149
|
+
LoadingTemplate;
|
|
1150
|
+
/** @deprecated Use {@link LoadingTemplate}. */
|
|
1151
|
+
get loadingTemplate() {
|
|
1152
|
+
return this.LoadingTemplate;
|
|
1153
|
+
}
|
|
1154
|
+
/** @deprecated Use {@link LoadingTemplate}. */
|
|
1155
|
+
set loadingTemplate(value) {
|
|
1156
|
+
this.LoadingTemplate = value;
|
|
1157
|
+
}
|
|
902
1158
|
// ============================================================================
|
|
903
1159
|
// VIEW CHILDREN
|
|
904
1160
|
// ============================================================================
|
|
905
|
-
|
|
1161
|
+
ScrollContainer;
|
|
1162
|
+
/** @deprecated Use {@link ScrollContainer}. */
|
|
1163
|
+
get scrollContainer() {
|
|
1164
|
+
return this.ScrollContainer;
|
|
1165
|
+
}
|
|
1166
|
+
/** @deprecated Use {@link ScrollContainer}. */
|
|
1167
|
+
set scrollContainer(value) {
|
|
1168
|
+
this.ScrollContainer = value;
|
|
1169
|
+
}
|
|
906
1170
|
// ============================================================================
|
|
907
1171
|
// PUBLIC PROPERTIES
|
|
908
1172
|
// ============================================================================
|
|
909
1173
|
/** Current time segments with events. */
|
|
910
|
-
|
|
1174
|
+
Segments = [];
|
|
1175
|
+
/** @deprecated Use {@link Segments}. */
|
|
1176
|
+
get segments() {
|
|
1177
|
+
return this.Segments;
|
|
1178
|
+
}
|
|
1179
|
+
/** @deprecated Use {@link Segments}. */
|
|
1180
|
+
set segments(value) {
|
|
1181
|
+
this.Segments = value;
|
|
1182
|
+
}
|
|
911
1183
|
/** All flattened events (for non-segmented display). */
|
|
912
|
-
|
|
1184
|
+
AllEvents = [];
|
|
1185
|
+
/** @deprecated Use {@link AllEvents}. */
|
|
1186
|
+
get allEvents() {
|
|
1187
|
+
return this.AllEvents;
|
|
1188
|
+
}
|
|
1189
|
+
/** @deprecated Use {@link AllEvents}. */
|
|
1190
|
+
set allEvents(value) {
|
|
1191
|
+
this.AllEvents = value;
|
|
1192
|
+
}
|
|
913
1193
|
/** Virtual scroll state. */
|
|
914
|
-
|
|
1194
|
+
ScrollState = { ...DEFAULT_VIRTUAL_SCROLL_STATE };
|
|
1195
|
+
/** @deprecated Use {@link ScrollState}. */
|
|
1196
|
+
get scrollState() {
|
|
1197
|
+
return this.ScrollState;
|
|
1198
|
+
}
|
|
1199
|
+
/** @deprecated Use {@link ScrollState}. */
|
|
1200
|
+
set scrollState(value) {
|
|
1201
|
+
this.ScrollState = value;
|
|
1202
|
+
}
|
|
915
1203
|
/** Whether initial load is complete. */
|
|
916
|
-
|
|
1204
|
+
IsInitialized = false;
|
|
1205
|
+
/** @deprecated Use {@link IsInitialized}. */
|
|
1206
|
+
get isInitialized() {
|
|
1207
|
+
return this.IsInitialized;
|
|
1208
|
+
}
|
|
1209
|
+
/** @deprecated Use {@link IsInitialized}. */
|
|
1210
|
+
set isInitialized(value) {
|
|
1211
|
+
this.IsInitialized = value;
|
|
1212
|
+
}
|
|
917
1213
|
/** Whether currently loading data. */
|
|
918
1214
|
isLoading = false;
|
|
919
1215
|
/** Index of currently focused event (for keyboard navigation). */
|
|
920
|
-
|
|
1216
|
+
FocusedEventIndex = -1;
|
|
1217
|
+
/** @deprecated Use {@link FocusedEventIndex}. */
|
|
1218
|
+
get focusedEventIndex() {
|
|
1219
|
+
return this.FocusedEventIndex;
|
|
1220
|
+
}
|
|
1221
|
+
/** @deprecated Use {@link FocusedEventIndex}. */
|
|
1222
|
+
set focusedEventIndex(value) {
|
|
1223
|
+
this.FocusedEventIndex = value;
|
|
1224
|
+
}
|
|
921
1225
|
// ============================================================================
|
|
922
1226
|
// PRIVATE PROPERTIES
|
|
923
1227
|
// ============================================================================
|
|
@@ -949,8 +1253,8 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
949
1253
|
// The view is now ready — first loads triggered by the `groups`/`allowLoad` setters were deferred
|
|
950
1254
|
// to here so refreshed events actually render (see the `groups` setter).
|
|
951
1255
|
this._viewReady = true;
|
|
952
|
-
if (this.
|
|
953
|
-
this.
|
|
1256
|
+
if (this.AllowLoad && !this._hasLoaded && this._groups.length > 0) {
|
|
1257
|
+
this.Refresh();
|
|
954
1258
|
}
|
|
955
1259
|
// Set up intersection observer for virtual scroll trigger
|
|
956
1260
|
this.setupIntersectionObserver();
|
|
@@ -969,7 +1273,7 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
969
1273
|
* Refreshes all data from the configured groups.
|
|
970
1274
|
* Clears existing data and reloads from sources.
|
|
971
1275
|
*/
|
|
972
|
-
async
|
|
1276
|
+
async Refresh(force = false) {
|
|
973
1277
|
// Prevent concurrent refresh calls - if already refreshing, exit immediately
|
|
974
1278
|
if (this.isLoading || (this._hasLoaded && !force)) {
|
|
975
1279
|
return;
|
|
@@ -981,7 +1285,7 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
981
1285
|
groups: this._groups,
|
|
982
1286
|
isIncremental: false
|
|
983
1287
|
};
|
|
984
|
-
this.
|
|
1288
|
+
this.BeforeLoad.emit(beforeArgs);
|
|
985
1289
|
if (beforeArgs.cancel) {
|
|
986
1290
|
return;
|
|
987
1291
|
}
|
|
@@ -989,24 +1293,24 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
989
1293
|
this.cdr.markForCheck();
|
|
990
1294
|
try {
|
|
991
1295
|
// Clear existing data
|
|
992
|
-
this.
|
|
993
|
-
this.
|
|
994
|
-
this.
|
|
1296
|
+
this.AllEvents = [];
|
|
1297
|
+
this.Segments = [];
|
|
1298
|
+
this.ScrollState = { ...DEFAULT_VIRTUAL_SCROLL_STATE };
|
|
995
1299
|
// Load data from all groups
|
|
996
1300
|
await this.loadAllGroups();
|
|
997
1301
|
// Group into segments
|
|
998
1302
|
this.buildSegments();
|
|
999
1303
|
this._hasLoaded = true;
|
|
1000
|
-
this.
|
|
1304
|
+
this.IsInitialized = true;
|
|
1001
1305
|
// Emit after event
|
|
1002
1306
|
const afterArgs = {
|
|
1003
1307
|
success: true,
|
|
1004
|
-
eventsLoaded: this.
|
|
1005
|
-
totalEvents: this.
|
|
1308
|
+
eventsLoaded: this.AllEvents.length,
|
|
1309
|
+
totalEvents: this.AllEvents.length,
|
|
1006
1310
|
loadTimeMs: Date.now() - startTime,
|
|
1007
|
-
hasMore: this.
|
|
1311
|
+
hasMore: this.ScrollState.hasMore
|
|
1008
1312
|
};
|
|
1009
|
-
this.
|
|
1313
|
+
this.AfterLoad.emit(afterArgs);
|
|
1010
1314
|
}
|
|
1011
1315
|
catch (error) {
|
|
1012
1316
|
console.error('Timeline: Error loading data', error);
|
|
@@ -1018,18 +1322,22 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1018
1322
|
loadTimeMs: Date.now() - startTime,
|
|
1019
1323
|
hasMore: false
|
|
1020
1324
|
};
|
|
1021
|
-
this.
|
|
1325
|
+
this.AfterLoad.emit(afterArgs);
|
|
1022
1326
|
}
|
|
1023
1327
|
finally {
|
|
1024
1328
|
this.isLoading = false;
|
|
1025
1329
|
this.cdr.markForCheck();
|
|
1026
1330
|
}
|
|
1027
1331
|
}
|
|
1332
|
+
/** @deprecated Use {@link Refresh}. */
|
|
1333
|
+
async refresh(force = false) {
|
|
1334
|
+
return this.Refresh(force);
|
|
1335
|
+
}
|
|
1028
1336
|
/**
|
|
1029
1337
|
* Loads more events (for virtual scrolling).
|
|
1030
1338
|
*/
|
|
1031
|
-
async
|
|
1032
|
-
if (!this.
|
|
1339
|
+
async LoadMore() {
|
|
1340
|
+
if (!this.VirtualScroll.enabled || this.ScrollState.isLoading || !this.ScrollState.hasMore) {
|
|
1033
1341
|
return;
|
|
1034
1342
|
}
|
|
1035
1343
|
const startTime = Date.now();
|
|
@@ -1038,119 +1346,151 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1038
1346
|
cancel: false,
|
|
1039
1347
|
groups: this._groups,
|
|
1040
1348
|
isIncremental: true,
|
|
1041
|
-
offset: this.
|
|
1042
|
-
batchSize: this.
|
|
1349
|
+
offset: this.ScrollState.loadedCount,
|
|
1350
|
+
batchSize: this.VirtualScroll.batchSize
|
|
1043
1351
|
};
|
|
1044
|
-
this.
|
|
1352
|
+
this.BeforeLoad.emit(beforeArgs);
|
|
1045
1353
|
if (beforeArgs.cancel) {
|
|
1046
1354
|
return;
|
|
1047
1355
|
}
|
|
1048
|
-
this.
|
|
1356
|
+
this.ScrollState.isLoading = true;
|
|
1049
1357
|
this.cdr.markForCheck();
|
|
1050
1358
|
try {
|
|
1051
|
-
const previousCount = this.
|
|
1359
|
+
const previousCount = this.AllEvents.length;
|
|
1052
1360
|
// Load next batch from all groups
|
|
1053
1361
|
await this.loadNextBatch();
|
|
1054
1362
|
// Rebuild segments with new data
|
|
1055
1363
|
this.buildSegments();
|
|
1056
|
-
const newCount = this.
|
|
1364
|
+
const newCount = this.AllEvents.length - previousCount;
|
|
1057
1365
|
// Emit after event
|
|
1058
1366
|
const afterArgs = {
|
|
1059
1367
|
success: true,
|
|
1060
1368
|
eventsLoaded: newCount,
|
|
1061
|
-
totalEvents: this.
|
|
1369
|
+
totalEvents: this.AllEvents.length,
|
|
1062
1370
|
loadTimeMs: Date.now() - startTime,
|
|
1063
|
-
hasMore: this.
|
|
1371
|
+
hasMore: this.ScrollState.hasMore
|
|
1064
1372
|
};
|
|
1065
|
-
this.
|
|
1373
|
+
this.AfterLoad.emit(afterArgs);
|
|
1066
1374
|
}
|
|
1067
1375
|
catch (error) {
|
|
1068
1376
|
console.error('Timeline: Error loading more data', error);
|
|
1069
1377
|
}
|
|
1070
1378
|
finally {
|
|
1071
|
-
this.
|
|
1379
|
+
this.ScrollState.isLoading = false;
|
|
1072
1380
|
this.cdr.markForCheck();
|
|
1073
1381
|
}
|
|
1074
1382
|
}
|
|
1383
|
+
/** @deprecated Use {@link LoadMore}. */
|
|
1384
|
+
async loadMore() {
|
|
1385
|
+
return this.LoadMore();
|
|
1386
|
+
}
|
|
1075
1387
|
/**
|
|
1076
1388
|
* Expands all event cards.
|
|
1077
1389
|
*/
|
|
1078
|
-
|
|
1079
|
-
for (const event of this.
|
|
1390
|
+
ExpandAllEvents() {
|
|
1391
|
+
for (const event of this.AllEvents) {
|
|
1080
1392
|
if (!event.isExpanded) {
|
|
1081
1393
|
this.setEventExpanded(event, true);
|
|
1082
1394
|
}
|
|
1083
1395
|
}
|
|
1084
1396
|
this.cdr.markForCheck();
|
|
1085
1397
|
}
|
|
1398
|
+
/** @deprecated Use {@link ExpandAllEvents}. */
|
|
1399
|
+
expandAllEvents() {
|
|
1400
|
+
return this.ExpandAllEvents();
|
|
1401
|
+
}
|
|
1086
1402
|
/**
|
|
1087
1403
|
* Collapses all event cards.
|
|
1088
1404
|
*/
|
|
1089
|
-
|
|
1090
|
-
for (const event of this.
|
|
1405
|
+
CollapseAllEvents() {
|
|
1406
|
+
for (const event of this.AllEvents) {
|
|
1091
1407
|
if (event.isExpanded) {
|
|
1092
1408
|
this.setEventExpanded(event, false);
|
|
1093
1409
|
}
|
|
1094
1410
|
}
|
|
1095
1411
|
this.cdr.markForCheck();
|
|
1096
1412
|
}
|
|
1413
|
+
/** @deprecated Use {@link CollapseAllEvents}. */
|
|
1414
|
+
collapseAllEvents() {
|
|
1415
|
+
return this.CollapseAllEvents();
|
|
1416
|
+
}
|
|
1097
1417
|
/**
|
|
1098
1418
|
* Expands all time segments.
|
|
1099
1419
|
*/
|
|
1100
|
-
|
|
1101
|
-
for (const segment of this.
|
|
1420
|
+
ExpandAllSegments() {
|
|
1421
|
+
for (const segment of this.Segments) {
|
|
1102
1422
|
if (!segment.isExpanded) {
|
|
1103
1423
|
this.setSegmentExpanded(segment, true);
|
|
1104
1424
|
}
|
|
1105
1425
|
}
|
|
1106
1426
|
this.cdr.markForCheck();
|
|
1107
1427
|
}
|
|
1428
|
+
/** @deprecated Use {@link ExpandAllSegments}. */
|
|
1429
|
+
expandAllSegments() {
|
|
1430
|
+
return this.ExpandAllSegments();
|
|
1431
|
+
}
|
|
1108
1432
|
/**
|
|
1109
1433
|
* Collapses all time segments.
|
|
1110
1434
|
*/
|
|
1111
|
-
|
|
1112
|
-
for (const segment of this.
|
|
1435
|
+
CollapseAllSegments() {
|
|
1436
|
+
for (const segment of this.Segments) {
|
|
1113
1437
|
if (segment.isExpanded) {
|
|
1114
1438
|
this.setSegmentExpanded(segment, false);
|
|
1115
1439
|
}
|
|
1116
1440
|
}
|
|
1117
1441
|
this.cdr.markForCheck();
|
|
1118
1442
|
}
|
|
1443
|
+
/** @deprecated Use {@link CollapseAllSegments}. */
|
|
1444
|
+
collapseAllSegments() {
|
|
1445
|
+
return this.CollapseAllSegments();
|
|
1446
|
+
}
|
|
1119
1447
|
/**
|
|
1120
1448
|
* Expands a specific event by ID.
|
|
1121
1449
|
*/
|
|
1122
|
-
|
|
1123
|
-
const event = this.
|
|
1450
|
+
ExpandEvent(eventId) {
|
|
1451
|
+
const event = this.GetEvent(eventId);
|
|
1124
1452
|
if (event && !event.isExpanded) {
|
|
1125
1453
|
this.setEventExpanded(event, true);
|
|
1126
1454
|
this.cdr.markForCheck();
|
|
1127
1455
|
}
|
|
1128
1456
|
}
|
|
1457
|
+
/** @deprecated Use {@link ExpandEvent}. */
|
|
1458
|
+
expandEvent(eventId) {
|
|
1459
|
+
return this.ExpandEvent(eventId);
|
|
1460
|
+
}
|
|
1129
1461
|
/**
|
|
1130
1462
|
* Collapses a specific event by ID.
|
|
1131
1463
|
*/
|
|
1132
|
-
|
|
1133
|
-
const event = this.
|
|
1464
|
+
CollapseEvent(eventId) {
|
|
1465
|
+
const event = this.GetEvent(eventId);
|
|
1134
1466
|
if (event && event.isExpanded) {
|
|
1135
1467
|
this.setEventExpanded(event, false);
|
|
1136
1468
|
this.cdr.markForCheck();
|
|
1137
1469
|
}
|
|
1138
1470
|
}
|
|
1471
|
+
/** @deprecated Use {@link CollapseEvent}. */
|
|
1472
|
+
collapseEvent(eventId) {
|
|
1473
|
+
return this.CollapseEvent(eventId);
|
|
1474
|
+
}
|
|
1139
1475
|
/**
|
|
1140
1476
|
* Scrolls to a specific event.
|
|
1141
1477
|
*/
|
|
1142
|
-
|
|
1478
|
+
ScrollToEvent(eventId, behavior = 'smooth') {
|
|
1143
1479
|
const element = this.elementRef.nativeElement.querySelector(`[data-event-id="${eventId}"]`);
|
|
1144
1480
|
if (element) {
|
|
1145
1481
|
element.scrollIntoView({ behavior, block: 'center' });
|
|
1146
1482
|
}
|
|
1147
1483
|
}
|
|
1484
|
+
/** @deprecated Use {@link ScrollToEvent}. */
|
|
1485
|
+
scrollToEvent(eventId, behavior = 'smooth') {
|
|
1486
|
+
return this.ScrollToEvent(eventId, behavior);
|
|
1487
|
+
}
|
|
1148
1488
|
/**
|
|
1149
1489
|
* Scrolls to a specific date.
|
|
1150
1490
|
*/
|
|
1151
|
-
|
|
1491
|
+
ScrollToDate(date, behavior = 'smooth') {
|
|
1152
1492
|
// Find the segment containing this date
|
|
1153
|
-
const segment = this.
|
|
1493
|
+
const segment = this.Segments.find(s => date >= s.startDate && date < s.endDate);
|
|
1154
1494
|
if (segment) {
|
|
1155
1495
|
const element = this.elementRef.nativeElement.querySelector(`[data-segment-label="${segment.label}"]`);
|
|
1156
1496
|
if (element) {
|
|
@@ -1158,17 +1498,29 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1158
1498
|
}
|
|
1159
1499
|
}
|
|
1160
1500
|
}
|
|
1501
|
+
/** @deprecated Use {@link ScrollToDate}. */
|
|
1502
|
+
scrollToDate(date, behavior = 'smooth') {
|
|
1503
|
+
return this.ScrollToDate(date, behavior);
|
|
1504
|
+
}
|
|
1161
1505
|
/**
|
|
1162
1506
|
* Gets an event by ID.
|
|
1163
1507
|
*/
|
|
1508
|
+
GetEvent(eventId) {
|
|
1509
|
+
return this.AllEvents.find(e => e.id === eventId);
|
|
1510
|
+
}
|
|
1511
|
+
/** @deprecated Use {@link GetEvent}. */
|
|
1164
1512
|
getEvent(eventId) {
|
|
1165
|
-
return this.
|
|
1513
|
+
return this.GetEvent(eventId);
|
|
1166
1514
|
}
|
|
1167
1515
|
/**
|
|
1168
1516
|
* Gets all events (flattened).
|
|
1169
1517
|
*/
|
|
1518
|
+
GetAllEvents() {
|
|
1519
|
+
return [...this.AllEvents];
|
|
1520
|
+
}
|
|
1521
|
+
/** @deprecated Use {@link GetAllEvents}. */
|
|
1170
1522
|
getAllEvents() {
|
|
1171
|
-
return
|
|
1523
|
+
return this.GetAllEvents();
|
|
1172
1524
|
}
|
|
1173
1525
|
// ============================================================================
|
|
1174
1526
|
// EVENT HANDLERS (Template bindings)
|
|
@@ -1176,7 +1528,7 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1176
1528
|
/**
|
|
1177
1529
|
* Handles click on an event card.
|
|
1178
1530
|
*/
|
|
1179
|
-
|
|
1531
|
+
OnEventClick(event, index, domEvent) {
|
|
1180
1532
|
const group = this._groups[event.groupIndex];
|
|
1181
1533
|
// Emit before event
|
|
1182
1534
|
const beforeArgs = {
|
|
@@ -1186,12 +1538,12 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1186
1538
|
index,
|
|
1187
1539
|
domEvent
|
|
1188
1540
|
};
|
|
1189
|
-
this.
|
|
1541
|
+
this.BeforeEventClick.emit(beforeArgs);
|
|
1190
1542
|
if (beforeArgs.cancel) {
|
|
1191
1543
|
return;
|
|
1192
1544
|
}
|
|
1193
1545
|
// Default behavior: toggle expand/collapse if collapsible
|
|
1194
|
-
const cardConfig = this.
|
|
1546
|
+
const cardConfig = this.GetEffectiveCardConfig(event);
|
|
1195
1547
|
if (cardConfig.collapsible) {
|
|
1196
1548
|
this.toggleEventExpanded(event, index, domEvent);
|
|
1197
1549
|
}
|
|
@@ -1203,19 +1555,27 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1203
1555
|
index,
|
|
1204
1556
|
domEvent
|
|
1205
1557
|
};
|
|
1206
|
-
this.
|
|
1558
|
+
this.AfterEventClick.emit(afterArgs);
|
|
1559
|
+
}
|
|
1560
|
+
/** @deprecated Use {@link OnEventClick}. */
|
|
1561
|
+
onEventClick(event, index, domEvent) {
|
|
1562
|
+
return this.OnEventClick(event, index, domEvent);
|
|
1207
1563
|
}
|
|
1208
1564
|
/**
|
|
1209
1565
|
* Handles expand/collapse toggle on an event.
|
|
1210
1566
|
*/
|
|
1211
|
-
|
|
1567
|
+
OnToggleExpand(event, index, domEvent) {
|
|
1212
1568
|
domEvent.stopPropagation();
|
|
1213
1569
|
this.toggleEventExpanded(event, index, domEvent);
|
|
1214
1570
|
}
|
|
1571
|
+
/** @deprecated Use {@link OnToggleExpand}. */
|
|
1572
|
+
onToggleExpand(event, index, domEvent) {
|
|
1573
|
+
return this.OnToggleExpand(event, index, domEvent);
|
|
1574
|
+
}
|
|
1215
1575
|
/**
|
|
1216
1576
|
* Handles mouse enter on an event card.
|
|
1217
1577
|
*/
|
|
1218
|
-
|
|
1578
|
+
OnEventMouseEnter(event, index, domEvent) {
|
|
1219
1579
|
const group = this._groups[event.groupIndex];
|
|
1220
1580
|
const beforeArgs = {
|
|
1221
1581
|
cancel: false,
|
|
@@ -1225,7 +1585,7 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1225
1585
|
domEvent,
|
|
1226
1586
|
hoverState: 'enter'
|
|
1227
1587
|
};
|
|
1228
|
-
this.
|
|
1588
|
+
this.BeforeEventHover.emit(beforeArgs);
|
|
1229
1589
|
if (!beforeArgs.cancel) {
|
|
1230
1590
|
const afterArgs = {
|
|
1231
1591
|
success: true,
|
|
@@ -1235,13 +1595,17 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1235
1595
|
domEvent,
|
|
1236
1596
|
hoverState: 'enter'
|
|
1237
1597
|
};
|
|
1238
|
-
this.
|
|
1598
|
+
this.AfterEventHover.emit(afterArgs);
|
|
1239
1599
|
}
|
|
1240
1600
|
}
|
|
1601
|
+
/** @deprecated Use {@link OnEventMouseEnter}. */
|
|
1602
|
+
onEventMouseEnter(event, index, domEvent) {
|
|
1603
|
+
return this.OnEventMouseEnter(event, index, domEvent);
|
|
1604
|
+
}
|
|
1241
1605
|
/**
|
|
1242
1606
|
* Handles mouse leave on an event card.
|
|
1243
1607
|
*/
|
|
1244
|
-
|
|
1608
|
+
OnEventMouseLeave(event, index, domEvent) {
|
|
1245
1609
|
const group = this._groups[event.groupIndex];
|
|
1246
1610
|
const beforeArgs = {
|
|
1247
1611
|
cancel: false,
|
|
@@ -1251,7 +1615,7 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1251
1615
|
domEvent,
|
|
1252
1616
|
hoverState: 'leave'
|
|
1253
1617
|
};
|
|
1254
|
-
this.
|
|
1618
|
+
this.BeforeEventHover.emit(beforeArgs);
|
|
1255
1619
|
if (!beforeArgs.cancel) {
|
|
1256
1620
|
const afterArgs = {
|
|
1257
1621
|
success: true,
|
|
@@ -1261,13 +1625,17 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1261
1625
|
domEvent,
|
|
1262
1626
|
hoverState: 'leave'
|
|
1263
1627
|
};
|
|
1264
|
-
this.
|
|
1628
|
+
this.AfterEventHover.emit(afterArgs);
|
|
1265
1629
|
}
|
|
1266
1630
|
}
|
|
1631
|
+
/** @deprecated Use {@link OnEventMouseLeave}. */
|
|
1632
|
+
onEventMouseLeave(event, index, domEvent) {
|
|
1633
|
+
return this.OnEventMouseLeave(event, index, domEvent);
|
|
1634
|
+
}
|
|
1267
1635
|
/**
|
|
1268
1636
|
* Handles action button click.
|
|
1269
1637
|
*/
|
|
1270
|
-
|
|
1638
|
+
OnActionClick(event, action, index, domEvent) {
|
|
1271
1639
|
domEvent.stopPropagation();
|
|
1272
1640
|
if (action.disabled) {
|
|
1273
1641
|
return;
|
|
@@ -1281,7 +1649,7 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1281
1649
|
domEvent,
|
|
1282
1650
|
action
|
|
1283
1651
|
};
|
|
1284
|
-
this.
|
|
1652
|
+
this.BeforeActionClick.emit(beforeArgs);
|
|
1285
1653
|
if (!beforeArgs.cancel) {
|
|
1286
1654
|
const afterArgs = {
|
|
1287
1655
|
success: true,
|
|
@@ -1291,13 +1659,17 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1291
1659
|
domEvent,
|
|
1292
1660
|
action
|
|
1293
1661
|
};
|
|
1294
|
-
this.
|
|
1662
|
+
this.AfterActionClick.emit(afterArgs);
|
|
1295
1663
|
}
|
|
1296
1664
|
}
|
|
1665
|
+
/** @deprecated Use {@link OnActionClick}. */
|
|
1666
|
+
onActionClick(event, action, index, domEvent) {
|
|
1667
|
+
return this.OnActionClick(event, action, index, domEvent);
|
|
1668
|
+
}
|
|
1297
1669
|
/**
|
|
1298
1670
|
* Handles segment header click.
|
|
1299
1671
|
*/
|
|
1300
|
-
|
|
1672
|
+
OnSegmentClick(segment) {
|
|
1301
1673
|
if (!this.segmentsCollapsible) {
|
|
1302
1674
|
return;
|
|
1303
1675
|
}
|
|
@@ -1308,16 +1680,24 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1308
1680
|
this.expandSegment(segment);
|
|
1309
1681
|
}
|
|
1310
1682
|
}
|
|
1683
|
+
/** @deprecated Use {@link OnSegmentClick}. */
|
|
1684
|
+
onSegmentClick(segment) {
|
|
1685
|
+
return this.OnSegmentClick(segment);
|
|
1686
|
+
}
|
|
1311
1687
|
/**
|
|
1312
1688
|
* Handles scroll events for virtual scrolling.
|
|
1313
1689
|
*/
|
|
1314
|
-
|
|
1690
|
+
OnScroll(event) {
|
|
1315
1691
|
this._scroll$.next(event);
|
|
1316
1692
|
}
|
|
1693
|
+
/** @deprecated Use {@link OnScroll}. */
|
|
1694
|
+
onScroll(event) {
|
|
1695
|
+
return this.OnScroll(event);
|
|
1696
|
+
}
|
|
1317
1697
|
/**
|
|
1318
1698
|
* Handles keyboard navigation.
|
|
1319
1699
|
*/
|
|
1320
|
-
|
|
1700
|
+
OnKeyDown(event) {
|
|
1321
1701
|
if (!this.enableKeyboardNavigation) {
|
|
1322
1702
|
return;
|
|
1323
1703
|
}
|
|
@@ -1351,24 +1731,32 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1351
1731
|
break;
|
|
1352
1732
|
}
|
|
1353
1733
|
}
|
|
1734
|
+
/** @deprecated Use {@link OnKeyDown}. */
|
|
1735
|
+
onKeyDown(event) {
|
|
1736
|
+
return this.OnKeyDown(event);
|
|
1737
|
+
}
|
|
1354
1738
|
// ============================================================================
|
|
1355
1739
|
// TEMPLATE HELPERS
|
|
1356
1740
|
// ============================================================================
|
|
1357
1741
|
/**
|
|
1358
1742
|
* Gets the effective card config for an event.
|
|
1359
1743
|
*/
|
|
1360
|
-
|
|
1744
|
+
GetEffectiveCardConfig(event) {
|
|
1361
1745
|
const group = this._groups[event.groupIndex];
|
|
1362
1746
|
return {
|
|
1363
|
-
...this.
|
|
1747
|
+
...this.DefaultCardConfig,
|
|
1364
1748
|
...group?.CardConfig,
|
|
1365
1749
|
...this.mapEventConfigToCardConfig(event.config)
|
|
1366
1750
|
};
|
|
1367
1751
|
}
|
|
1752
|
+
/** @deprecated Use {@link GetEffectiveCardConfig}. */
|
|
1753
|
+
getEffectiveCardConfig(event) {
|
|
1754
|
+
return this.GetEffectiveCardConfig(event);
|
|
1755
|
+
}
|
|
1368
1756
|
/**
|
|
1369
1757
|
* Gets the color for a group/event.
|
|
1370
1758
|
*/
|
|
1371
|
-
|
|
1759
|
+
GetColor(event) {
|
|
1372
1760
|
if (event.config?.color) {
|
|
1373
1761
|
return event.config.color;
|
|
1374
1762
|
}
|
|
@@ -1378,6 +1766,10 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1378
1766
|
}
|
|
1379
1767
|
return AUTO_COLORS[event.groupIndex % AUTO_COLORS.length];
|
|
1380
1768
|
}
|
|
1769
|
+
/** @deprecated Use {@link GetColor}. */
|
|
1770
|
+
getColor(event) {
|
|
1771
|
+
return this.GetColor(event);
|
|
1772
|
+
}
|
|
1381
1773
|
/**
|
|
1382
1774
|
* Gets the icon for a group/event.
|
|
1383
1775
|
*/
|
|
@@ -1394,24 +1786,28 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1394
1786
|
/**
|
|
1395
1787
|
* Gets the actions for an event.
|
|
1396
1788
|
*/
|
|
1397
|
-
|
|
1789
|
+
GetActions(event) {
|
|
1398
1790
|
if (event.config?.actions) {
|
|
1399
1791
|
return event.config.actions;
|
|
1400
1792
|
}
|
|
1401
|
-
const cardConfig = this.
|
|
1793
|
+
const cardConfig = this.GetEffectiveCardConfig(event);
|
|
1402
1794
|
return cardConfig.actions || [];
|
|
1403
1795
|
}
|
|
1796
|
+
/** @deprecated Use {@link GetActions}. */
|
|
1797
|
+
getActions(event) {
|
|
1798
|
+
return this.GetActions(event);
|
|
1799
|
+
}
|
|
1404
1800
|
/**
|
|
1405
1801
|
* Formats a date for display.
|
|
1406
1802
|
*/
|
|
1407
1803
|
formatDate(date, format) {
|
|
1408
|
-
const fmt = format || this.
|
|
1804
|
+
const fmt = format || this.DefaultCardConfig.dateFormat || 'MMM d, yyyy';
|
|
1409
1805
|
return this.formatDateInternal(date, fmt);
|
|
1410
1806
|
}
|
|
1411
1807
|
/**
|
|
1412
1808
|
* Gets the value of a display field from an event.
|
|
1413
1809
|
*/
|
|
1414
|
-
|
|
1810
|
+
GetFieldValue(event, field) {
|
|
1415
1811
|
const value = getFieldValue(event.entity, field.fieldName);
|
|
1416
1812
|
if (field.formatter) {
|
|
1417
1813
|
return field.formatter(value);
|
|
@@ -1424,23 +1820,39 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1424
1820
|
}
|
|
1425
1821
|
return String(value);
|
|
1426
1822
|
}
|
|
1823
|
+
/** @deprecated Use {@link GetFieldValue}. */
|
|
1824
|
+
getFieldValue(event, field) {
|
|
1825
|
+
return this.GetFieldValue(event, field);
|
|
1826
|
+
}
|
|
1427
1827
|
/**
|
|
1428
1828
|
* Track by function for ngFor.
|
|
1429
1829
|
*/
|
|
1430
|
-
|
|
1830
|
+
TrackByEventId(_index, event) {
|
|
1431
1831
|
return event.id;
|
|
1432
1832
|
}
|
|
1833
|
+
/** @deprecated Use {@link TrackByEventId}. */
|
|
1834
|
+
trackByEventId(_index, event) {
|
|
1835
|
+
return this.TrackByEventId(_index, event);
|
|
1836
|
+
}
|
|
1433
1837
|
/**
|
|
1434
1838
|
* Track by function for segments.
|
|
1435
1839
|
*/
|
|
1436
|
-
|
|
1840
|
+
TrackBySegmentLabel(_index, segment) {
|
|
1437
1841
|
return segment.label;
|
|
1438
1842
|
}
|
|
1843
|
+
/** @deprecated Use {@link TrackBySegmentLabel}. */
|
|
1844
|
+
trackBySegmentLabel(_index, segment) {
|
|
1845
|
+
return this.TrackBySegmentLabel(_index, segment);
|
|
1846
|
+
}
|
|
1439
1847
|
/**
|
|
1440
1848
|
* Gets the global index of an event in the allEvents array.
|
|
1441
1849
|
*/
|
|
1850
|
+
GetGlobalIndex(event) {
|
|
1851
|
+
return this.AllEvents.indexOf(event);
|
|
1852
|
+
}
|
|
1853
|
+
/** @deprecated Use {@link GetGlobalIndex}. */
|
|
1442
1854
|
getGlobalIndex(event) {
|
|
1443
|
-
return this.
|
|
1855
|
+
return this.GetGlobalIndex(event);
|
|
1444
1856
|
}
|
|
1445
1857
|
/**
|
|
1446
1858
|
* Checks if an event is currently selected/focused.
|
|
@@ -1448,13 +1860,17 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1448
1860
|
* - Its ID matches the selectedEventId input
|
|
1449
1861
|
* - Its global index matches the focusedEventIndex (keyboard navigation)
|
|
1450
1862
|
*/
|
|
1451
|
-
|
|
1863
|
+
IsEventSelected(event, globalIndex) {
|
|
1452
1864
|
// Check selectedEventId from parent first (takes priority)
|
|
1453
|
-
if (this.
|
|
1865
|
+
if (this.SelectedEventId && event.id === this.SelectedEventId) {
|
|
1454
1866
|
return true;
|
|
1455
1867
|
}
|
|
1456
1868
|
// Fall back to keyboard navigation focus
|
|
1457
|
-
return this.
|
|
1869
|
+
return this.FocusedEventIndex === globalIndex;
|
|
1870
|
+
}
|
|
1871
|
+
/** @deprecated Use {@link IsEventSelected}. */
|
|
1872
|
+
isEventSelected(event, globalIndex) {
|
|
1873
|
+
return this.IsEventSelected(event, globalIndex);
|
|
1458
1874
|
}
|
|
1459
1875
|
// ============================================================================
|
|
1460
1876
|
// PRIVATE METHODS - DATA LOADING
|
|
@@ -1470,8 +1886,8 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1470
1886
|
// Sort all events by date
|
|
1471
1887
|
this.sortEvents();
|
|
1472
1888
|
// Update scroll state
|
|
1473
|
-
this.
|
|
1474
|
-
this.
|
|
1889
|
+
this.ScrollState.loadedCount = this.AllEvents.length;
|
|
1890
|
+
this.ScrollState.hasMore = false; // TODO: Implement proper pagination detection
|
|
1475
1891
|
}
|
|
1476
1892
|
/**
|
|
1477
1893
|
* Loads data from a single group.
|
|
@@ -1487,7 +1903,7 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1487
1903
|
// Convert records to timeline events
|
|
1488
1904
|
for (const record of records) {
|
|
1489
1905
|
const event = this.createTimelineEvent(record, group, groupIndex);
|
|
1490
|
-
this.
|
|
1906
|
+
this.AllEvents.push(event);
|
|
1491
1907
|
}
|
|
1492
1908
|
}
|
|
1493
1909
|
/**
|
|
@@ -1542,9 +1958,9 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1542
1958
|
* Sorts events by date according to sortOrder.
|
|
1543
1959
|
*/
|
|
1544
1960
|
sortEvents() {
|
|
1545
|
-
this.
|
|
1961
|
+
this.AllEvents.sort((a, b) => {
|
|
1546
1962
|
const diff = a.date.getTime() - b.date.getTime();
|
|
1547
|
-
return this.
|
|
1963
|
+
return this.SortOrder === 'asc' ? diff : -diff;
|
|
1548
1964
|
});
|
|
1549
1965
|
}
|
|
1550
1966
|
// ============================================================================
|
|
@@ -1554,12 +1970,12 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1554
1970
|
* Builds time segments from events.
|
|
1555
1971
|
*/
|
|
1556
1972
|
buildSegments() {
|
|
1557
|
-
if (this.
|
|
1558
|
-
this.
|
|
1973
|
+
if (this.SegmentGrouping === 'none') {
|
|
1974
|
+
this.Segments = [];
|
|
1559
1975
|
return;
|
|
1560
1976
|
}
|
|
1561
1977
|
const segmentMap = new Map();
|
|
1562
|
-
for (const event of this.
|
|
1978
|
+
for (const event of this.AllEvents) {
|
|
1563
1979
|
const { label, startDate, endDate } = this.getSegmentInfo(event.date);
|
|
1564
1980
|
if (!segmentMap.has(label)) {
|
|
1565
1981
|
segmentMap.set(label, {
|
|
@@ -1576,10 +1992,10 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1576
1992
|
segment.eventCount++;
|
|
1577
1993
|
}
|
|
1578
1994
|
// Convert to array and sort
|
|
1579
|
-
this.
|
|
1580
|
-
this.
|
|
1995
|
+
this.Segments = Array.from(segmentMap.values());
|
|
1996
|
+
this.Segments.sort((a, b) => {
|
|
1581
1997
|
const diff = a.startDate.getTime() - b.startDate.getTime();
|
|
1582
|
-
return this.
|
|
1998
|
+
return this.SortOrder === 'asc' ? diff : -diff;
|
|
1583
1999
|
});
|
|
1584
2000
|
}
|
|
1585
2001
|
/**
|
|
@@ -1589,7 +2005,7 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1589
2005
|
const year = date.getFullYear();
|
|
1590
2006
|
const month = date.getMonth();
|
|
1591
2007
|
const day = date.getDate();
|
|
1592
|
-
switch (this.
|
|
2008
|
+
switch (this.SegmentGrouping) {
|
|
1593
2009
|
case 'day':
|
|
1594
2010
|
return {
|
|
1595
2011
|
label: this.formatDateInternal(date, 'MMMM d, yyyy'),
|
|
@@ -1665,7 +2081,7 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1665
2081
|
index,
|
|
1666
2082
|
domEvent
|
|
1667
2083
|
};
|
|
1668
|
-
this.
|
|
2084
|
+
this.BeforeEventExpand.emit(beforeArgs);
|
|
1669
2085
|
if (beforeArgs.cancel) {
|
|
1670
2086
|
return;
|
|
1671
2087
|
}
|
|
@@ -1678,7 +2094,7 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1678
2094
|
index,
|
|
1679
2095
|
domEvent
|
|
1680
2096
|
};
|
|
1681
|
-
this.
|
|
2097
|
+
this.AfterEventExpand.emit(afterArgs);
|
|
1682
2098
|
}
|
|
1683
2099
|
/**
|
|
1684
2100
|
* Collapses an event with events.
|
|
@@ -1692,7 +2108,7 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1692
2108
|
index,
|
|
1693
2109
|
domEvent
|
|
1694
2110
|
};
|
|
1695
|
-
this.
|
|
2111
|
+
this.BeforeEventCollapse.emit(beforeArgs);
|
|
1696
2112
|
if (beforeArgs.cancel) {
|
|
1697
2113
|
return;
|
|
1698
2114
|
}
|
|
@@ -1705,7 +2121,7 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1705
2121
|
index,
|
|
1706
2122
|
domEvent
|
|
1707
2123
|
};
|
|
1708
|
-
this.
|
|
2124
|
+
this.AfterEventCollapse.emit(afterArgs);
|
|
1709
2125
|
}
|
|
1710
2126
|
/**
|
|
1711
2127
|
* Expands a segment.
|
|
@@ -1719,7 +2135,7 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1719
2135
|
endDate: segment.endDate,
|
|
1720
2136
|
eventCount: segment.eventCount
|
|
1721
2137
|
};
|
|
1722
|
-
this.
|
|
2138
|
+
this.BeforeSegmentExpand.emit(beforeArgs);
|
|
1723
2139
|
if (beforeArgs.cancel) {
|
|
1724
2140
|
return;
|
|
1725
2141
|
}
|
|
@@ -1733,7 +2149,7 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1733
2149
|
endDate: segment.endDate,
|
|
1734
2150
|
eventCount: segment.eventCount
|
|
1735
2151
|
};
|
|
1736
|
-
this.
|
|
2152
|
+
this.AfterSegmentExpand.emit(afterArgs);
|
|
1737
2153
|
}
|
|
1738
2154
|
/**
|
|
1739
2155
|
* Collapses a segment.
|
|
@@ -1747,7 +2163,7 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1747
2163
|
endDate: segment.endDate,
|
|
1748
2164
|
eventCount: segment.eventCount
|
|
1749
2165
|
};
|
|
1750
|
-
this.
|
|
2166
|
+
this.BeforeSegmentCollapse.emit(beforeArgs);
|
|
1751
2167
|
if (beforeArgs.cancel) {
|
|
1752
2168
|
return;
|
|
1753
2169
|
}
|
|
@@ -1761,7 +2177,7 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1761
2177
|
endDate: segment.endDate,
|
|
1762
2178
|
eventCount: segment.eventCount
|
|
1763
2179
|
};
|
|
1764
|
-
this.
|
|
2180
|
+
this.AfterSegmentCollapse.emit(afterArgs);
|
|
1765
2181
|
}
|
|
1766
2182
|
/**
|
|
1767
2183
|
* Sets segment expanded state without events.
|
|
@@ -1773,47 +2189,47 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1773
2189
|
// PRIVATE METHODS - KEYBOARD NAVIGATION
|
|
1774
2190
|
// ============================================================================
|
|
1775
2191
|
focusNextEvent() {
|
|
1776
|
-
if (this.
|
|
2192
|
+
if (this.AllEvents.length === 0)
|
|
1777
2193
|
return;
|
|
1778
|
-
this.
|
|
2194
|
+
this.FocusedEventIndex = Math.min(this.FocusedEventIndex + 1, this.AllEvents.length - 1);
|
|
1779
2195
|
this.scrollToFocusedEvent();
|
|
1780
2196
|
}
|
|
1781
2197
|
focusPreviousEvent() {
|
|
1782
|
-
if (this.
|
|
2198
|
+
if (this.AllEvents.length === 0)
|
|
1783
2199
|
return;
|
|
1784
|
-
this.
|
|
2200
|
+
this.FocusedEventIndex = Math.max(this.FocusedEventIndex - 1, 0);
|
|
1785
2201
|
this.scrollToFocusedEvent();
|
|
1786
2202
|
}
|
|
1787
2203
|
focusFirstEvent() {
|
|
1788
|
-
if (this.
|
|
2204
|
+
if (this.AllEvents.length === 0)
|
|
1789
2205
|
return;
|
|
1790
|
-
this.
|
|
2206
|
+
this.FocusedEventIndex = 0;
|
|
1791
2207
|
this.scrollToFocusedEvent();
|
|
1792
2208
|
}
|
|
1793
2209
|
focusLastEvent() {
|
|
1794
|
-
if (this.
|
|
2210
|
+
if (this.AllEvents.length === 0)
|
|
1795
2211
|
return;
|
|
1796
|
-
this.
|
|
2212
|
+
this.FocusedEventIndex = this.AllEvents.length - 1;
|
|
1797
2213
|
this.scrollToFocusedEvent();
|
|
1798
2214
|
}
|
|
1799
2215
|
activateFocusedEvent() {
|
|
1800
|
-
if (this.
|
|
1801
|
-
const event = this.
|
|
1802
|
-
this.toggleEventExpanded(event, this.
|
|
2216
|
+
if (this.FocusedEventIndex >= 0 && this.FocusedEventIndex < this.AllEvents.length) {
|
|
2217
|
+
const event = this.AllEvents[this.FocusedEventIndex];
|
|
2218
|
+
this.toggleEventExpanded(event, this.FocusedEventIndex);
|
|
1803
2219
|
}
|
|
1804
2220
|
}
|
|
1805
2221
|
collapseFocusedEvent() {
|
|
1806
|
-
if (this.
|
|
1807
|
-
const event = this.
|
|
2222
|
+
if (this.FocusedEventIndex >= 0 && this.FocusedEventIndex < this.AllEvents.length) {
|
|
2223
|
+
const event = this.AllEvents[this.FocusedEventIndex];
|
|
1808
2224
|
if (event.isExpanded) {
|
|
1809
|
-
this.collapseEventInternal(event, this.
|
|
2225
|
+
this.collapseEventInternal(event, this.FocusedEventIndex);
|
|
1810
2226
|
}
|
|
1811
2227
|
}
|
|
1812
2228
|
}
|
|
1813
2229
|
scrollToFocusedEvent() {
|
|
1814
|
-
if (this.
|
|
1815
|
-
const event = this.
|
|
1816
|
-
this.
|
|
2230
|
+
if (this.FocusedEventIndex >= 0 && this.FocusedEventIndex < this.AllEvents.length) {
|
|
2231
|
+
const event = this.AllEvents[this.FocusedEventIndex];
|
|
2232
|
+
this.ScrollToEvent(event.id, 'smooth');
|
|
1817
2233
|
}
|
|
1818
2234
|
this.cdr.markForCheck();
|
|
1819
2235
|
}
|
|
@@ -1821,7 +2237,7 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1821
2237
|
// PRIVATE METHODS - VIRTUAL SCROLLING
|
|
1822
2238
|
// ============================================================================
|
|
1823
2239
|
setupIntersectionObserver() {
|
|
1824
|
-
if (!this.
|
|
2240
|
+
if (!this.VirtualScroll.enabled)
|
|
1825
2241
|
return;
|
|
1826
2242
|
// Use requestAnimationFrame to ensure DOM is ready
|
|
1827
2243
|
requestAnimationFrame(() => {
|
|
@@ -1830,26 +2246,26 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1830
2246
|
return;
|
|
1831
2247
|
this._intersectionObserver = new IntersectionObserver((entries) => {
|
|
1832
2248
|
const entry = entries[0];
|
|
1833
|
-
if (entry?.isIntersecting && !this.
|
|
1834
|
-
this.ngZone.run(() => this.
|
|
2249
|
+
if (entry?.isIntersecting && !this.ScrollState.isLoading && this.ScrollState.hasMore) {
|
|
2250
|
+
this.ngZone.run(() => this.LoadMore());
|
|
1835
2251
|
}
|
|
1836
2252
|
}, {
|
|
1837
|
-
root: this.
|
|
2253
|
+
root: this.ScrollContainer?.nativeElement,
|
|
1838
2254
|
threshold: 0,
|
|
1839
|
-
rootMargin: `${this.
|
|
2255
|
+
rootMargin: `${this.VirtualScroll.loadThreshold}px`
|
|
1840
2256
|
});
|
|
1841
2257
|
this._intersectionObserver.observe(sentinel);
|
|
1842
2258
|
});
|
|
1843
2259
|
}
|
|
1844
2260
|
onScrollCheck() {
|
|
1845
|
-
if (!this.
|
|
2261
|
+
if (!this.ScrollContainer?.nativeElement || !this.VirtualScroll.enabled) {
|
|
1846
2262
|
return;
|
|
1847
2263
|
}
|
|
1848
|
-
const el = this.
|
|
1849
|
-
this.
|
|
2264
|
+
const el = this.ScrollContainer.nativeElement;
|
|
2265
|
+
this.ScrollState.scrollOffset = el.scrollTop;
|
|
1850
2266
|
const distanceFromBottom = el.scrollHeight - el.scrollTop - el.clientHeight;
|
|
1851
|
-
if (distanceFromBottom < this.
|
|
1852
|
-
this.
|
|
2267
|
+
if (distanceFromBottom < this.VirtualScroll.loadThreshold && this.ScrollState.hasMore) {
|
|
2268
|
+
this.LoadMore();
|
|
1853
2269
|
}
|
|
1854
2270
|
}
|
|
1855
2271
|
// ============================================================================
|
|
@@ -1913,19 +2329,19 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1913
2329
|
i0.ɵɵcontentQuery(dirIndex, _c0, 5)(dirIndex, _c1, 5)(dirIndex, _c2, 5)(dirIndex, _c3, 5)(dirIndex, _c4, 5)(dirIndex, _c5, 5)(dirIndex, _c6, 5);
|
|
1914
2330
|
} if (rf & 2) {
|
|
1915
2331
|
let _t;
|
|
1916
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.
|
|
1917
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.
|
|
1918
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.
|
|
1919
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.
|
|
1920
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.
|
|
1921
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.
|
|
1922
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.
|
|
2332
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.CardTemplate = _t.first);
|
|
2333
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.HeaderTemplate = _t.first);
|
|
2334
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.BodyTemplate = _t.first);
|
|
2335
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.ActionsTemplate = _t.first);
|
|
2336
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.SegmentHeaderTemplate = _t.first);
|
|
2337
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.EmptyTemplate = _t.first);
|
|
2338
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.LoadingTemplate = _t.first);
|
|
1923
2339
|
} }, viewQuery: function TimelineComponent_Query(rf, ctx) { if (rf & 1) {
|
|
1924
2340
|
i0.ɵɵviewQuery(_c7, 5);
|
|
1925
2341
|
} if (rf & 2) {
|
|
1926
2342
|
let _t;
|
|
1927
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.
|
|
1928
|
-
} }, inputs: { groups: "groups", allowLoad: "allowLoad", orientation: "orientation", layout: "layout", sortOrder: "sortOrder", segmentGrouping: "segmentGrouping", defaultCardConfig: "defaultCardConfig", virtualScroll: "virtualScroll", segmentsCollapsible: "segmentsCollapsible", segmentsDefaultExpanded: "segmentsDefaultExpanded", emptyMessage: "emptyMessage", emptyIcon: "emptyIcon", loadingMessage: "loadingMessage", ariaLabel: "ariaLabel", enableKeyboardNavigation: "enableKeyboardNavigation", selectedEventId: "selectedEventId" }, outputs: { beforeEventClick: "beforeEventClick", beforeEventExpand: "beforeEventExpand", beforeEventCollapse: "beforeEventCollapse", beforeEventHover: "beforeEventHover", beforeActionClick: "beforeActionClick", beforeSegmentExpand: "beforeSegmentExpand", beforeSegmentCollapse: "beforeSegmentCollapse", beforeLoad: "beforeLoad", afterEventClick: "afterEventClick", afterEventExpand: "afterEventExpand", afterEventCollapse: "afterEventCollapse", afterEventHover: "afterEventHover", afterActionClick: "afterActionClick", afterSegmentExpand: "afterSegmentExpand", afterSegmentCollapse: "afterSegmentCollapse", afterLoad: "afterLoad" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 9, vars: 14, consts: [["scrollContainer", ""], ["eventCard", ""], ["role", "list", "tabindex", "0", 1, "mj-timeline", 3, "keydown", "scroll"], [1, "mj-timeline-scroll-sentinel"], [1, "mj-timeline__loading-more"], [1, "mj-timeline__loading"], [4, "ngTemplateOutlet"], [1, "mj-timeline__loading-spinner"], [1, "mj-timeline__loading-text"], [3, "Icon", "Title"], [1, "mj-timeline__axis"], [1, "mj-timeline__segment", 3, "mj-timeline__segment--collapsed"], [1, "mj-timeline__segment"], ["role", "button", 1, "mj-timeline__segment-header", 3, "click"], [1, "mj-timeline__segment-content", 3, "id"], [4, "ngTemplateOutlet", "ngTemplateOutletContext"], [1, "mj-timeline__segment-toggle"], [1, "mj-timeline__segment-label"], [1, "mj-timeline__segment-count"], [1, "mj-timeline__segment-line"], [1, "mj-timeline__loading-spinner", "mj-timeline__loading-spinner--small"], ["role", "listitem", 1, "mj-timeline__event"], [1, "mj-timeline__marker"], [1, "mj-timeline__marker-icon"], [1, "mj-timeline__connector"], [1, "mj-timeline__date-label"], [1, "mj-timeline__card", 3, "click", "mouseenter", "mouseleave", "ngClass"], [1, "mj-timeline__card-header"], [1, "mj-timeline__card-image", "mj-timeline__card-image--left", 3, "mj-timeline__card-image--small", "mj-timeline__card-image--medium", "mj-timeline__card-image--large"], [1, "mj-timeline__card-header-content"], [1, "mj-timeline__card-image", "mj-timeline__card-image--top"], [1, "mj-timeline__card-body"], [1, "mj-timeline__card-actions", 3, "mj-timeline__card-actions--hover-only"], [1, "mj-timeline__card-image", "mj-timeline__card-image--left"], [3, "src", "alt"], [1, "mj-timeline__card-icon", 3, "color"], [1, "mj-timeline__card-titles"], [1, "mj-timeline__card-title"], [1, "mj-timeline__card-subtitle"], [1, "mj-timeline__card-date"], ["type", "button", 1, "mj-timeline__card-toggle"], [1, "mj-timeline__card-icon"], ["type", "button", 1, "mj-timeline__card-toggle", 3, "click"], [1, "mj-timeline__card-fields", "mj-timeline__card-fields--summary"], [1, "mj-timeline__card-description", 3, "mj-timeline__card-description--clamped", "-webkit-line-clamp"], [1, "mj-timeline__card-fields", "mj-timeline__card-fields--expanded"], [1, "mj-timeline__card-field", 3, "ngClass"], [1, "mj-timeline__card-field-icon", 3, "ngClass"], [1, "mj-timeline__card-field-label"], [1, "mj-timeline__card-field-value"], [1, "mj-timeline__card-description"], [3, "innerHTML"], [1, "mj-timeline__card-actions"], ["type", "button", 1, "mj-timeline__action", 3, "mj-timeline__action--primary", "mj-timeline__action--secondary", "mj-timeline__action--danger", "mj-timeline__action--link", "ngClass", "disabled", "title"], ["type", "button", 1, "mj-timeline__action", 3, "click", "ngClass", "disabled", "title"], [3, "ngClass"]], template: function TimelineComponent_Template(rf, ctx) { if (rf & 1) {
|
|
2343
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.ScrollContainer = _t.first);
|
|
2344
|
+
} }, inputs: { Groups: "Groups", groups: "groups", AllowLoad: "AllowLoad", allowLoad: "allowLoad", Orientation: "Orientation", orientation: "orientation", Layout: "Layout", layout: "layout", SortOrder: "SortOrder", sortOrder: "sortOrder", SegmentGrouping: "SegmentGrouping", segmentGrouping: "segmentGrouping", DefaultCardConfig: "DefaultCardConfig", defaultCardConfig: "defaultCardConfig", VirtualScroll: "VirtualScroll", virtualScroll: "virtualScroll", segmentsCollapsible: "segmentsCollapsible", segmentsDefaultExpanded: "segmentsDefaultExpanded", emptyMessage: "emptyMessage", emptyIcon: "emptyIcon", loadingMessage: "loadingMessage", ariaLabel: "ariaLabel", enableKeyboardNavigation: "enableKeyboardNavigation", SelectedEventId: "SelectedEventId", selectedEventId: "selectedEventId" }, outputs: { BeforeEventClick: "BeforeEventClick", beforeEventClick: "beforeEventClick", BeforeEventExpand: "BeforeEventExpand", beforeEventExpand: "beforeEventExpand", BeforeEventCollapse: "BeforeEventCollapse", beforeEventCollapse: "beforeEventCollapse", BeforeEventHover: "BeforeEventHover", beforeEventHover: "beforeEventHover", BeforeActionClick: "BeforeActionClick", beforeActionClick: "beforeActionClick", BeforeSegmentExpand: "BeforeSegmentExpand", beforeSegmentExpand: "beforeSegmentExpand", BeforeSegmentCollapse: "BeforeSegmentCollapse", beforeSegmentCollapse: "beforeSegmentCollapse", BeforeLoad: "BeforeLoad", beforeLoad: "beforeLoad", AfterEventClick: "AfterEventClick", afterEventClick: "afterEventClick", AfterEventExpand: "AfterEventExpand", afterEventExpand: "afterEventExpand", AfterEventCollapse: "AfterEventCollapse", afterEventCollapse: "afterEventCollapse", AfterEventHover: "AfterEventHover", afterEventHover: "afterEventHover", AfterActionClick: "AfterActionClick", afterActionClick: "afterActionClick", AfterSegmentExpand: "AfterSegmentExpand", afterSegmentExpand: "afterSegmentExpand", AfterSegmentCollapse: "AfterSegmentCollapse", afterSegmentCollapse: "afterSegmentCollapse", AfterLoad: "AfterLoad", afterLoad: "afterLoad" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 9, vars: 14, consts: [["scrollContainer", ""], ["eventCard", ""], ["role", "list", "tabindex", "0", 1, "mj-timeline", 3, "keydown", "scroll"], [1, "mj-timeline-scroll-sentinel"], [1, "mj-timeline__loading-more"], [1, "mj-timeline__loading"], [4, "ngTemplateOutlet"], [1, "mj-timeline__loading-spinner"], [1, "mj-timeline__loading-text"], [3, "Icon", "Title"], [1, "mj-timeline__axis"], [1, "mj-timeline__segment", 3, "mj-timeline__segment--collapsed"], [1, "mj-timeline__segment"], ["role", "button", 1, "mj-timeline__segment-header", 3, "click"], [1, "mj-timeline__segment-content", 3, "id"], [4, "ngTemplateOutlet", "ngTemplateOutletContext"], [1, "mj-timeline__segment-toggle"], [1, "mj-timeline__segment-label"], [1, "mj-timeline__segment-count"], [1, "mj-timeline__segment-line"], [1, "mj-timeline__loading-spinner", "mj-timeline__loading-spinner--small"], ["role", "listitem", 1, "mj-timeline__event"], [1, "mj-timeline__marker"], [1, "mj-timeline__marker-icon"], [1, "mj-timeline__connector"], [1, "mj-timeline__date-label"], [1, "mj-timeline__card", 3, "click", "mouseenter", "mouseleave", "ngClass"], [1, "mj-timeline__card-header"], [1, "mj-timeline__card-image", "mj-timeline__card-image--left", 3, "mj-timeline__card-image--small", "mj-timeline__card-image--medium", "mj-timeline__card-image--large"], [1, "mj-timeline__card-header-content"], [1, "mj-timeline__card-image", "mj-timeline__card-image--top"], [1, "mj-timeline__card-body"], [1, "mj-timeline__card-actions", 3, "mj-timeline__card-actions--hover-only"], [1, "mj-timeline__card-image", "mj-timeline__card-image--left"], [3, "src", "alt"], [1, "mj-timeline__card-icon", 3, "color"], [1, "mj-timeline__card-titles"], [1, "mj-timeline__card-title"], [1, "mj-timeline__card-subtitle"], [1, "mj-timeline__card-date"], ["type", "button", 1, "mj-timeline__card-toggle"], [1, "mj-timeline__card-icon"], ["type", "button", 1, "mj-timeline__card-toggle", 3, "click"], [1, "mj-timeline__card-fields", "mj-timeline__card-fields--summary"], [1, "mj-timeline__card-description", 3, "mj-timeline__card-description--clamped", "-webkit-line-clamp"], [1, "mj-timeline__card-fields", "mj-timeline__card-fields--expanded"], [1, "mj-timeline__card-field", 3, "ngClass"], [1, "mj-timeline__card-field-icon", 3, "ngClass"], [1, "mj-timeline__card-field-label"], [1, "mj-timeline__card-field-value"], [1, "mj-timeline__card-description"], [3, "innerHTML"], [1, "mj-timeline__card-actions"], ["type", "button", 1, "mj-timeline__action", 3, "mj-timeline__action--primary", "mj-timeline__action--secondary", "mj-timeline__action--danger", "mj-timeline__action--link", "ngClass", "disabled", "title"], ["type", "button", 1, "mj-timeline__action", 3, "click", "ngClass", "disabled", "title"], [3, "ngClass"]], template: function TimelineComponent_Template(rf, ctx) { if (rf & 1) {
|
|
1929
2345
|
i0.ɵɵelementStart(0, "div", 2, 0);
|
|
1930
2346
|
i0.ɵɵlistener("keydown", function TimelineComponent_Template_div_keydown_0_listener($event) { return ctx.onKeyDown($event); })("scroll", function TimelineComponent_Template_div_scroll_0_listener($event) { return ctx.onScroll($event); });
|
|
1931
2347
|
i0.ɵɵconditionalCreate(2, TimelineComponent_Conditional_2_Template, 2, 1);
|
|
@@ -1953,20 +2369,36 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1953
2369
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TimelineComponent, [{
|
|
1954
2370
|
type: Component,
|
|
1955
2371
|
args: [{ standalone: false, selector: 'mj-timeline', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<!--\nMJ Timeline Component Template\n\nStructure:\n- Loading state\n- Empty state\n- Timeline container (vertical/horizontal)\n- Time segments (collapsible)\n- Segment header\n- Event cards within segment\n- Or flat list of events (when segmentGrouping='none')\n- Virtual scroll sentinel\n-->\n\n<div\n class=\"mj-timeline\"\n [class.mj-timeline--vertical]=\"orientation === 'vertical'\"\n [class.mj-timeline--horizontal]=\"orientation === 'horizontal'\"\n [class.mj-timeline--single]=\"layout === 'single'\"\n [class.mj-timeline--alternating]=\"layout === 'alternating'\"\n [attr.aria-label]=\"ariaLabel\"\n role=\"list\"\n tabindex=\"0\"\n (keydown)=\"onKeyDown($event)\"\n #scrollContainer\n (scroll)=\"onScroll($event)\">\n\n <!-- Loading State -->\n @if (isLoading && !isInitialized) {\n @if (loadingTemplate) {\n <ng-container *ngTemplateOutlet=\"loadingTemplate\"></ng-container>\n } @else {\n <div class=\"mj-timeline__loading\">\n <div class=\"mj-timeline__loading-spinner\"></div>\n <span class=\"mj-timeline__loading-text\">{{ loadingMessage }}</span>\n </div>\n }\n }\n\n <!-- Empty State -->\n @if (isInitialized && allEvents.length === 0 && !isLoading) {\n @if (emptyTemplate) {\n <ng-container *ngTemplateOutlet=\"emptyTemplate\"></ng-container>\n } @else {\n <mj-empty-state\n [Icon]=\"emptyIcon\"\n [Title]=\"emptyMessage\" />\n }\n }\n\n <!-- Timeline Content -->\n @if (isInitialized && allEvents.length > 0) {\n <!-- Segmented View -->\n @if (segmentGrouping !== 'none') {\n @for (segment of segments; track trackBySegmentLabel(segmentIndex, segment); let segmentIndex = $index) {\n <div\n class=\"mj-timeline__segment\"\n [class.mj-timeline__segment--collapsed]=\"!segment.isExpanded\"\n [attr.data-segment-label]=\"segment.label\">\n <!-- Segment Header -->\n <div\n class=\"mj-timeline__segment-header\"\n [class.mj-timeline__segment-header--clickable]=\"segmentsCollapsible\"\n (click)=\"onSegmentClick(segment)\"\n role=\"button\"\n [attr.aria-expanded]=\"segment.isExpanded\"\n [attr.aria-controls]=\"'segment-content-' + segmentIndex\">\n @if (segmentHeaderTemplate) {\n <ng-container *ngTemplateOutlet=\"segmentHeaderTemplate; context: { segment: segment }\"></ng-container>\n } @else {\n @if (segmentsCollapsible) {\n <span class=\"mj-timeline__segment-toggle\">\n <i [class]=\"segment.isExpanded ? 'fa-solid fa-chevron-down' : 'fa-solid fa-chevron-right'\"></i>\n </span>\n }\n <span class=\"mj-timeline__segment-label\">{{ segment.label }}</span>\n <span class=\"mj-timeline__segment-count\">({{ segment.eventCount }} {{ segment.eventCount === 1 ? 'event' : 'events' }})</span>\n <span class=\"mj-timeline__segment-line\"></span>\n }\n </div>\n <!-- Segment Content -->\n <div\n class=\"mj-timeline__segment-content\"\n [id]=\"'segment-content-' + segmentIndex\"\n [class.mj-timeline__segment-content--hidden]=\"!segment.isExpanded\">\n <div class=\"mj-timeline__axis\">\n <!-- Events in Segment -->\n @for (event of segment.events; track trackByEventId(eventIndex, event); let eventIndex = $index; let isOdd = $odd) {\n <ng-container *ngTemplateOutlet=\"eventCard; context: {\n event: event,\n index: eventIndex,\n isOdd: isOdd,\n globalIndex: getGlobalIndex(event)\n }\"></ng-container>\n }\n </div>\n </div>\n </div>\n }\n }\n <!-- Flat View (no segments) -->\n @if (segmentGrouping === 'none') {\n <div class=\"mj-timeline__axis\">\n @for (event of allEvents; track trackByEventId(eventIndex, event); let eventIndex = $index; let isOdd = $odd) {\n <ng-container *ngTemplateOutlet=\"eventCard; context: {\n event: event,\n index: eventIndex,\n isOdd: isOdd,\n globalIndex: eventIndex\n }\"></ng-container>\n }\n </div>\n }\n }\n\n <!-- Virtual Scroll Sentinel -->\n @if (virtualScroll.enabled && scrollState.hasMore) {\n <div\n class=\"mj-timeline-scroll-sentinel\"\n >\n </div>\n }\n\n <!-- Loading More Indicator -->\n @if (scrollState.isLoading && virtualScroll.showLoadingIndicator) {\n <div\n class=\"mj-timeline__loading-more\"\n >\n <div class=\"mj-timeline__loading-spinner mj-timeline__loading-spinner--small\"></div>\n <span>{{ virtualScroll.loadingMessage }}</span>\n </div>\n }\n\n</div>\n\n<!-- Event Card Template -->\n<ng-template #eventCard let-event=\"event\" let-index=\"index\" let-isOdd=\"isOdd\" let-globalIndex=\"globalIndex\">\n <div\n class=\"mj-timeline__event\"\n [class.mj-timeline__event--odd]=\"isOdd && layout === 'alternating'\"\n [class.mj-timeline__event--even]=\"!isOdd && layout === 'alternating'\"\n [class.mj-timeline__event--expanded]=\"event.isExpanded\"\n [class.mj-timeline__event--focused]=\"isEventSelected(event, globalIndex)\"\n [attr.data-event-id]=\"event.id\"\n role=\"listitem\"\n [attr.aria-expanded]=\"event.isExpanded\">\n\n <!-- Timeline Marker -->\n <div class=\"mj-timeline__marker\" [style.background-color]=\"getColor(event)\">\n <i [class]=\"getIcon(event)\" class=\"mj-timeline__marker-icon\"></i>\n </div>\n\n <!-- Connector Line -->\n <div class=\"mj-timeline__connector\" [style.background-color]=\"getColor(event)\"></div>\n\n <!-- Date Label (for alternating layout) -->\n @if (layout === 'alternating') {\n <div class=\"mj-timeline__date-label\">\n {{ formatDate(event.date) }}\n </div>\n }\n\n <!-- Event Card -->\n <div\n class=\"mj-timeline__card\"\n [ngClass]=\"getEffectiveCardConfig(event).cssClass\"\n [style.max-width]=\"getEffectiveCardConfig(event).maxWidth\"\n [style.min-width]=\"getEffectiveCardConfig(event).minWidth\"\n [style.border-left-color]=\"getColor(event)\"\n (click)=\"onEventClick(event, globalIndex, $event)\"\n (mouseenter)=\"onEventMouseEnter(event, globalIndex, $event)\"\n (mouseleave)=\"onEventMouseLeave(event, globalIndex, $event)\">\n\n <!-- Custom Card Template -->\n @if (cardTemplate) {\n <ng-container *ngTemplateOutlet=\"cardTemplate; context: {\n event: event,\n group: groups[event.groupIndex]\n }\"></ng-container>\n } @else {\n <!-- Card Header -->\n <div class=\"mj-timeline__card-header\">\n <!-- Image (left position) -->\n @if (event.imageUrl && getEffectiveCardConfig(event).imagePosition === 'left') {\n <div\n class=\"mj-timeline__card-image mj-timeline__card-image--left\"\n [class.mj-timeline__card-image--small]=\"getEffectiveCardConfig(event).imageSize === 'small'\"\n [class.mj-timeline__card-image--medium]=\"getEffectiveCardConfig(event).imageSize === 'medium'\"\n [class.mj-timeline__card-image--large]=\"getEffectiveCardConfig(event).imageSize === 'large'\">\n <img [src]=\"event.imageUrl\" [alt]=\"event.title\" />\n </div>\n }\n <div class=\"mj-timeline__card-header-content\">\n <!-- Custom Header Template -->\n @if (headerTemplate) {\n <ng-container *ngTemplateOutlet=\"headerTemplate; context: { event: event }\"></ng-container>\n } @else {\n <!-- Icon -->\n @if (getEffectiveCardConfig(event).showIcon) {\n <span\n class=\"mj-timeline__card-icon\"\n [style.color]=\"getColor(event)\">\n <i [class]=\"getIcon(event)\"></i>\n </span>\n }\n <!-- Title & Subtitle -->\n <div class=\"mj-timeline__card-titles\">\n <h4 class=\"mj-timeline__card-title\">{{ event.title }}</h4>\n @if (event.subtitle && getEffectiveCardConfig(event).showSubtitle) {\n <span\n class=\"mj-timeline__card-subtitle\"\n >\n {{ event.subtitle }}\n </span>\n }\n @if (getEffectiveCardConfig(event).showDate && layout !== 'alternating') {\n <span\n class=\"mj-timeline__card-date\"\n >\n {{ formatDate(event.date, getEffectiveCardConfig(event).dateFormat) }}\n </span>\n }\n </div>\n <!-- Expand/Collapse Toggle -->\n @if (getEffectiveCardConfig(event).collapsible) {\n <button\n class=\"mj-timeline__card-toggle\"\n (click)=\"onToggleExpand(event, globalIndex, $event)\"\n [attr.aria-label]=\"event.isExpanded ? 'Collapse' : 'Expand'\"\n type=\"button\">\n <i [class]=\"event.isExpanded ? 'fa-solid fa-chevron-up' : 'fa-solid fa-chevron-down'\"></i>\n </button>\n }\n }\n </div>\n </div>\n <!-- Image (top position) -->\n @if (event.imageUrl && getEffectiveCardConfig(event).imagePosition === 'top') {\n <div\n class=\"mj-timeline__card-image mj-timeline__card-image--top\"\n >\n <img [src]=\"event.imageUrl\" [alt]=\"event.title\" />\n </div>\n }\n <!-- Card Body -->\n <div\n class=\"mj-timeline__card-body\"\n [class.mj-timeline__card-body--collapsed]=\"!event.isExpanded && getEffectiveCardConfig(event).collapsible\">\n <!-- Custom Body Template -->\n @if (bodyTemplate) {\n <ng-container *ngTemplateOutlet=\"bodyTemplate; context: { event: event }\"></ng-container>\n } @else {\n <!-- Summary Fields (always visible) -->\n @if (getEffectiveCardConfig(event).summaryFields?.length) {\n <div\n class=\"mj-timeline__card-fields mj-timeline__card-fields--summary\"\n >\n @for (field of getEffectiveCardConfig(event).summaryFields; track field) {\n <div class=\"mj-timeline__card-field\" [ngClass]=\"field.cssClass\">\n @if (field.icon) {\n <i [ngClass]=\"field.icon\" class=\"mj-timeline__card-field-icon\"></i>\n }\n @if (!field.hideLabel && field.label) {\n <span class=\"mj-timeline__card-field-label\">{{ field.label }}:</span>\n }\n <span class=\"mj-timeline__card-field-value\">{{ getFieldValue(event, field) }}</span>\n </div>\n }\n </div>\n }\n <!-- Description (expanded view) -->\n @if (event.description && event.isExpanded) {\n <div\n class=\"mj-timeline__card-description\"\n [class.mj-timeline__card-description--clamped]=\"(getEffectiveCardConfig(event).descriptionMaxLines ?? 0) > 0\"\n [style.-webkit-line-clamp]=\"getEffectiveCardConfig(event).descriptionMaxLines || null\">\n @if (getEffectiveCardConfig(event).allowHtmlDescription) {\n <div [innerHTML]=\"event.description\"></div>\n } @else {\n {{ event.description }}\n }\n </div>\n }\n <!-- Expanded Fields -->\n @if (event.isExpanded && getEffectiveCardConfig(event).expandedFields?.length) {\n <div\n class=\"mj-timeline__card-fields mj-timeline__card-fields--expanded\"\n >\n @for (field of getEffectiveCardConfig(event).expandedFields; track field) {\n <div class=\"mj-timeline__card-field\" [ngClass]=\"field.cssClass\">\n @if (field.icon) {\n <i [ngClass]=\"field.icon\" class=\"mj-timeline__card-field-icon\"></i>\n }\n @if (!field.hideLabel) {\n <span class=\"mj-timeline__card-field-label\">{{ field.label || field.fieldName }}:</span>\n }\n <span class=\"mj-timeline__card-field-value\">{{ getFieldValue(event, field) }}</span>\n </div>\n }\n </div>\n }\n }\n </div>\n <!-- Card Actions -->\n @if (getActions(event).length > 0) {\n <div\n class=\"mj-timeline__card-actions\"\n [class.mj-timeline__card-actions--hover-only]=\"getEffectiveCardConfig(event).actionsOnHover\"\n >\n <!-- Custom Actions Template -->\n @if (actionsTemplate) {\n <ng-container *ngTemplateOutlet=\"actionsTemplate; context: {\n event: event,\n actions: getActions(event)\n }\"></ng-container>\n } @else {\n @for (action of getActions(event); track action) {\n <button\n class=\"mj-timeline__action\"\n [class.mj-timeline__action--primary]=\"action.variant === 'primary'\"\n [class.mj-timeline__action--secondary]=\"action.variant === 'secondary' || !action.variant\"\n [class.mj-timeline__action--danger]=\"action.variant === 'danger'\"\n [class.mj-timeline__action--link]=\"action.variant === 'link'\"\n [ngClass]=\"action.cssClass\"\n [disabled]=\"action.disabled\"\n [title]=\"action.tooltip || ''\"\n (click)=\"onActionClick(event, action, globalIndex, $event)\"\n type=\"button\">\n @if (action.icon) {\n <i [ngClass]=\"action.icon\"></i>\n }\n <span>{{ action.label }}</span>\n </button>\n }\n }\n </div>\n }\n }\n\n <!-- Default Card Template -->\n </div>\n </div>\n</ng-template>\n", styles: ["/**\n * MJ Timeline Component Styles\n * Kendo-inspired design with vertical alternating and horizontal layouts\n */\n\n/* ============================================================================\n CSS VARIABLES (Theming)\n ============================================================================ */\n\nmj-timeline {\n /* Colors */\n --mj-timeline-bg: transparent;\n --mj-timeline-line-color: var(--mj-border-default);\n --mj-timeline-marker-bg: var(--mj-bg-surface);\n --mj-timeline-marker-border: var(--mj-brand-primary);\n --mj-timeline-marker-fill: var(--mj-brand-primary);\n --mj-timeline-card-bg: var(--mj-bg-surface);\n --mj-timeline-card-border: var(--mj-border-default);\n --mj-timeline-card-shadow: var(--mj-shadow-sm);\n --mj-timeline-card-shadow-hover: var(--mj-shadow-md);\n --mj-timeline-card-radius: var(--mj-radius-md);\n --mj-timeline-text-primary: var(--mj-text-primary);\n --mj-timeline-text-secondary: var(--mj-text-muted);\n --mj-timeline-text-muted: var(--mj-text-disabled);\n --mj-timeline-accent: var(--mj-brand-primary);\n --mj-timeline-accent-light: color-mix(in srgb, var(--mj-brand-primary) 8%, transparent);\n --mj-timeline-segment-bg: var(--mj-brand-primary);\n --mj-timeline-segment-text: var(--mj-text-inverse);\n --mj-timeline-focus-ring: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 30%, transparent);\n\n /* Sizing */\n --mj-timeline-line-width: 2px;\n --mj-timeline-marker-size: 14px;\n --mj-timeline-card-padding: 16px;\n --mj-timeline-card-max-width: 400px;\n --mj-timeline-card-min-width: 200px;\n --mj-timeline-gap: 24px;\n --mj-timeline-segment-gap: 16px;\n --mj-timeline-axis-offset: 50%;\n\n /* Animation */\n --mj-timeline-transition: 0.15s ease;\n\n display: block;\n width: 100%;\n height: 100%;\n}\n\n/* Dark mode handled automatically by --mj-* semantic tokens */\n\n/* ============================================================================\n MAIN CONTAINER\n ============================================================================ */\n\n.mj-timeline {\n position: relative;\n width: 100%;\n height: 100%;\n padding: 0;\n background: var(--mj-timeline-bg);\n outline: none;\n overflow-y: auto;\n overflow-x: hidden;\n}\n\n/* Subtle scrollbar */\n.mj-timeline::-webkit-scrollbar {\n width: 6px;\n}\n\n.mj-timeline::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.mj-timeline::-webkit-scrollbar-thumb {\n background: rgba(0, 0, 0, 0.15);\n border-radius: 3px;\n}\n\n.mj-timeline::-webkit-scrollbar-thumb:hover {\n background: rgba(0, 0, 0, 0.25);\n}\n\n.mj-timeline:focus-visible {\n box-shadow: inset var(--mj-timeline-focus-ring);\n}\n\n/* ============================================================================\n LOADING & EMPTY STATES\n ============================================================================ */\n\n.mj-timeline__loading {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 48px 24px;\n gap: 12px;\n}\n\n.mj-timeline__loading-spinner {\n width: 24px;\n height: 24px;\n border: 2px solid var(--mj-timeline-line-color);\n border-top-color: var(--mj-timeline-accent);\n border-radius: var(--mj-radius-full);\n animation: mj-timeline-spin 0.6s linear infinite;\n}\n\n.mj-timeline__loading-spinner--small {\n width: 14px;\n height: 14px;\n}\n\n.mj-timeline__loading-text {\n color: var(--mj-timeline-text-muted);\n font-size: var(--mj-text-sm);\n}\n\n.mj-timeline__loading-more {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 16px;\n gap: 8px;\n color: var(--mj-timeline-text-muted);\n font-size: var(--mj-text-xs);\n}\n\n@keyframes mj-timeline-spin {\n to { transform: rotate(360deg); }\n}\n\n/* ============================================================================\n TIME SEGMENTS - Year/Month badges on the axis\n ============================================================================ */\n\n.mj-timeline__segment {\n margin-bottom: var(--mj-timeline-segment-gap);\n position: relative;\n}\n\n.mj-timeline__segment:last-child {\n margin-bottom: 0;\n}\n\n.mj-timeline__segment-header {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n padding: 6px 16px;\n margin-bottom: var(--mj-timeline-gap);\n background: var(--mj-timeline-segment-bg);\n border-radius: var(--mj-radius-sm);\n font-weight: 600;\n font-size: var(--mj-text-sm);\n color: var(--mj-timeline-segment-text);\n user-select: none;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n position: relative;\n z-index: 10;\n}\n\n.mj-timeline__segment-header--clickable {\n cursor: pointer;\n transition: all var(--mj-timeline-transition);\n}\n\n.mj-timeline__segment-header--clickable:hover {\n filter: brightness(1.1);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);\n}\n\n.mj-timeline__segment-toggle {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n color: inherit;\n font-size: var(--mj-text-xs);\n opacity: 0.9;\n transition: transform var(--mj-timeline-transition);\n}\n\n.mj-timeline__segment--collapsed .mj-timeline__segment-toggle {\n transform: rotate(-90deg);\n}\n\n.mj-timeline__segment-label {\n font-size: inherit;\n font-weight: inherit;\n color: inherit;\n}\n\n.mj-timeline__segment-count {\n display: none;\n}\n\n.mj-timeline__segment-line {\n display: none;\n}\n\n.mj-timeline__segment-content {\n overflow: visible;\n transition: max-height 0.25s ease, opacity 0.2s ease;\n padding-top: 8px;\n}\n\n.mj-timeline__segment-content--hidden {\n max-height: 0;\n opacity: 0;\n pointer-events: none;\n}\n\n/* ============================================================================\n TIMELINE AXIS - Vertical line in center\n ============================================================================ */\n\n.mj-timeline__axis {\n position: relative;\n padding-left: 0;\n}\n\n/* Vertical center line */\n.mj-timeline__axis::before {\n content: '';\n position: absolute;\n left: 50%;\n top: 0;\n bottom: 0;\n width: var(--mj-timeline-line-width);\n background: var(--mj-timeline-line-color);\n transform: translateX(-50%);\n}\n\n/* ============================================================================\n TIMELINE EVENT - Alternating left/right by default\n ============================================================================ */\n\n.mj-timeline__event {\n position: relative;\n display: flex;\n align-items: flex-start;\n margin-bottom: var(--mj-timeline-gap);\n width: 100%;\n}\n\n/* Even events (0, 2, 4...) - card on LEFT, date on RIGHT */\n.mj-timeline__event {\n padding-right: calc(50% + 32px);\n justify-content: flex-end;\n}\n\n/* Odd events (1, 3, 5...) - card on RIGHT, date on LEFT */\n.mj-timeline__event--odd {\n padding-right: 0;\n padding-left: calc(50% + 32px);\n justify-content: flex-start;\n flex-direction: row;\n}\n\n.mj-timeline__event:last-child {\n margin-bottom: 0;\n}\n\n/* ============================================================================\n MARKER - Circular dot on the axis\n ============================================================================ */\n\n.mj-timeline__marker {\n position: absolute;\n left: 50%;\n top: 12px;\n transform: translateX(-50%);\n width: var(--mj-timeline-marker-size);\n height: var(--mj-timeline-marker-size);\n background: var(--mj-timeline-marker-fill);\n border: 2px solid var(--mj-timeline-marker-bg);\n border-radius: var(--mj-radius-full);\n box-shadow: 0 0 0 2px var(--mj-timeline-marker-fill);\n z-index: 5;\n transition: transform var(--mj-timeline-transition);\n}\n\n.mj-timeline__marker-icon {\n display: none;\n}\n\n.mj-timeline__event:hover .mj-timeline__marker {\n transform: translateX(-50%) scale(1.2);\n}\n\n.mj-timeline__connector {\n display: none;\n}\n\n/* ============================================================================\n DATE LABEL - Positioned opposite the card\n ============================================================================ */\n\n.mj-timeline__date-label {\n position: absolute;\n top: 10px;\n font-size: var(--mj-text-sm);\n font-weight: 500;\n color: var(--mj-timeline-text-secondary);\n white-space: nowrap;\n}\n\n/* Even events - date on RIGHT side of axis */\n.mj-timeline__event:not(.mj-timeline__event--odd) .mj-timeline__date-label {\n left: calc(50% + 24px);\n text-align: left;\n}\n\n/* Odd events - date on LEFT side of axis */\n.mj-timeline__event--odd .mj-timeline__date-label {\n right: calc(50% + 24px);\n text-align: right;\n}\n\n/* ============================================================================\n EVENT CARD - Clean design matching Kendo\n ============================================================================ */\n\n.mj-timeline__card {\n background: var(--mj-timeline-card-bg);\n border: 1px solid var(--mj-timeline-card-border);\n border-radius: var(--mj-timeline-card-radius);\n box-shadow: var(--mj-timeline-card-shadow);\n overflow: hidden;\n transition: all var(--mj-timeline-transition);\n cursor: pointer;\n max-width: var(--mj-timeline-card-max-width);\n min-width: var(--mj-timeline-card-min-width);\n width: 100%;\n}\n\n/* Card arrow/pointer toward the axis */\n.mj-timeline__card::before {\n content: '';\n position: absolute;\n top: 14px;\n width: 10px;\n height: 10px;\n background: var(--mj-timeline-card-bg);\n border: 1px solid var(--mj-timeline-card-border);\n transform: rotate(45deg);\n}\n\n/* Even events - arrow points RIGHT toward axis */\n.mj-timeline__event:not(.mj-timeline__event--odd) .mj-timeline__card::before {\n right: -6px;\n border-left: none;\n border-bottom: none;\n}\n\n/* Odd events - arrow points LEFT toward axis */\n.mj-timeline__event--odd .mj-timeline__card::before {\n left: -6px;\n border-right: none;\n border-top: none;\n}\n\n/* Hover state */\n.mj-timeline__card:hover {\n box-shadow: var(--mj-timeline-card-shadow-hover);\n border-color: var(--mj-timeline-accent);\n}\n\n/* Selected/Focused state - prominent highlight with animation */\n.mj-timeline__event--focused .mj-timeline__card {\n background: var(--mj-timeline-accent-light);\n border-color: var(--mj-timeline-accent);\n box-shadow:\n 0 0 0 3px var(--mj-timeline-accent),\n 0 8px 24px color-mix(in srgb, var(--mj-brand-primary) 25%, transparent);\n transform: scale(1.02);\n}\n\n/* Selected marker - larger and more prominent */\n.mj-timeline__event--focused .mj-timeline__marker {\n transform: translateX(-50%) scale(1.4);\n box-shadow:\n 0 0 0 3px var(--mj-timeline-marker-fill),\n 0 0 12px color-mix(in srgb, var(--mj-brand-primary) 50%, transparent);\n}\n\n/* Pulse animation for selected marker */\n.mj-timeline__event--focused .mj-timeline__marker::after {\n content: '';\n position: absolute;\n top: -4px;\n left: -4px;\n right: -4px;\n bottom: -4px;\n border-radius: var(--mj-radius-full);\n border: 2px solid var(--mj-timeline-accent);\n animation: mj-timeline-pulse 1.5s ease-out infinite;\n}\n\n@keyframes mj-timeline-pulse {\n 0% {\n transform: scale(1);\n opacity: 0.8;\n }\n 100% {\n transform: scale(1.8);\n opacity: 0;\n }\n}\n\n/* Selected date label - bolder */\n.mj-timeline__event--focused .mj-timeline__date-label {\n color: var(--mj-timeline-accent);\n font-weight: 600;\n}\n\n/* Card arrow gets accent color when selected */\n.mj-timeline__event--focused .mj-timeline__card::before {\n border-color: var(--mj-timeline-accent);\n background: var(--mj-timeline-accent-light);\n}\n\n/* ============================================================================\n CARD HEADER\n ============================================================================ */\n\n.mj-timeline__card-header {\n display: flex;\n align-items: flex-start;\n padding: var(--mj-timeline-card-padding);\n gap: 10px;\n}\n\n.mj-timeline__card-header-content {\n flex: 1;\n display: flex;\n align-items: flex-start;\n gap: 10px;\n min-width: 0;\n}\n\n.mj-timeline__card-icon {\n display: none;\n}\n\n.mj-timeline__card-titles {\n flex: 1;\n min-width: 0;\n}\n\n.mj-timeline__card-title {\n margin: 0;\n font-size: var(--mj-text-base);\n font-weight: 600;\n color: var(--mj-timeline-text-primary);\n line-height: 1.35;\n}\n\n.mj-timeline__card-subtitle {\n display: block;\n font-size: var(--mj-text-sm);\n color: var(--mj-timeline-text-secondary);\n margin-top: 4px;\n}\n\n.mj-timeline__card-date {\n display: block;\n font-size: var(--mj-text-xs);\n color: var(--mj-timeline-text-muted);\n margin-top: 6px;\n}\n\n.mj-timeline__card-date::before {\n display: none;\n}\n\n.mj-timeline__card-toggle {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: none;\n background: transparent;\n color: var(--mj-timeline-text-muted);\n border-radius: 4px;\n cursor: pointer;\n transition: all var(--mj-timeline-transition);\n font-size: var(--mj-text-sm);\n}\n\n.mj-timeline__card-toggle:hover {\n background: var(--mj-timeline-accent-light);\n color: var(--mj-timeline-accent);\n}\n\n/* ============================================================================\n CARD IMAGE\n ============================================================================ */\n\n.mj-timeline__card-image {\n overflow: hidden;\n border-radius: var(--mj-radius-sm);\n flex-shrink: 0;\n}\n\n.mj-timeline__card-image img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center;\n}\n\n.mj-timeline__card-image--left.mj-timeline__card-image--small {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n}\n\n.mj-timeline__card-image--left.mj-timeline__card-image--medium {\n width: 72px;\n height: 72px;\n}\n\n.mj-timeline__card-image--left.mj-timeline__card-image--large {\n width: 96px;\n height: 96px;\n}\n\n.mj-timeline__card-image--top {\n width: calc(100% - 32px);\n max-height: 180px;\n margin: 0 16px 12px;\n}\n\n/* ============================================================================\n CARD BODY\n ============================================================================ */\n\n.mj-timeline__card-body {\n padding: 0 var(--mj-timeline-card-padding) var(--mj-timeline-card-padding);\n}\n\n.mj-timeline__card-body--collapsed {\n display: none;\n}\n\n.mj-timeline__card-description {\n font-size: var(--mj-text-sm);\n line-height: 1.6;\n color: var(--mj-timeline-text-secondary);\n margin-bottom: 12px;\n}\n\n.mj-timeline__card-description--clamped {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n overflow: hidden;\n}\n\n.mj-timeline__card-description:last-child {\n margin-bottom: 0;\n}\n\n/* ============================================================================\n CARD FIELDS\n ============================================================================ */\n\n.mj-timeline__card-fields {\n display: flex;\n flex-wrap: wrap;\n gap: 4px 12px;\n}\n\n.mj-timeline__card-fields--summary {\n padding-top: 12px;\n border-top: 1px solid var(--mj-timeline-line-color);\n margin-top: 12px;\n}\n\n.mj-timeline__card-fields--expanded {\n margin-top: 12px;\n padding-top: 12px;\n border-top: 1px solid var(--mj-timeline-line-color);\n}\n\n.mj-timeline__card-field {\n display: flex;\n align-items: center;\n gap: 5px;\n font-size: var(--mj-text-xs);\n}\n\n.mj-timeline__card-field-icon {\n color: var(--mj-timeline-text-muted);\n font-size: var(--mj-text-xs);\n}\n\n.mj-timeline__card-field-label {\n color: var(--mj-timeline-text-muted);\n}\n\n.mj-timeline__card-field-value {\n color: var(--mj-timeline-text-secondary);\n font-weight: 500;\n}\n\n/* ============================================================================\n CARD ACTIONS\n ============================================================================ */\n\n.mj-timeline__card-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n padding: 0 var(--mj-timeline-card-padding) var(--mj-timeline-card-padding);\n justify-content: flex-end;\n}\n\n.mj-timeline__card-actions--hover-only {\n opacity: 0;\n transition: opacity var(--mj-timeline-transition);\n}\n\n.mj-timeline__card:hover .mj-timeline__card-actions--hover-only,\n.mj-timeline__card:focus-within .mj-timeline__card-actions--hover-only {\n opacity: 1;\n}\n\n.mj-timeline__action {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 6px 12px;\n font-size: var(--mj-text-xs);\n font-weight: 500;\n border: 1px solid;\n border-radius: var(--mj-radius-sm);\n cursor: pointer;\n transition: all var(--mj-timeline-transition);\n}\n\n.mj-timeline__action:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n.mj-timeline__action i {\n font-size: var(--mj-text-xs);\n}\n\n.mj-timeline__action--primary {\n background: var(--mj-timeline-accent);\n border-color: var(--mj-timeline-accent);\n color: var(--mj-text-inverse);\n}\n\n.mj-timeline__action--primary:hover:not(:disabled) {\n filter: brightness(1.1);\n}\n\n.mj-timeline__action--secondary {\n background: transparent;\n border-color: var(--mj-timeline-card-border);\n color: var(--mj-timeline-text-primary);\n}\n\n.mj-timeline__action--secondary:hover:not(:disabled) {\n background: var(--mj-timeline-accent-light);\n border-color: var(--mj-timeline-accent);\n color: var(--mj-timeline-accent);\n}\n\n.mj-timeline__action--danger {\n background: var(--mj-status-error);\n border-color: var(--mj-status-error);\n color: var(--mj-text-inverse);\n}\n\n.mj-timeline__action--link {\n background: transparent;\n border-color: transparent;\n color: var(--mj-timeline-accent);\n}\n\n.mj-timeline__action--link:hover:not(:disabled) {\n text-decoration: underline;\n}\n\n/* ============================================================================\n VIRTUAL SCROLL\n ============================================================================ */\n\n.mj-timeline-scroll-sentinel {\n height: 1px;\n width: 100%;\n visibility: hidden;\n}\n\n/* ============================================================================\n SINGLE LAYOUT - Cards only on right side\n ============================================================================ */\n\n.mj-timeline--single .mj-timeline__axis::before {\n left: 24px;\n transform: none;\n}\n\n.mj-timeline--single .mj-timeline__segment-header {\n margin-left: 12px;\n}\n\n.mj-timeline--single .mj-timeline__event {\n padding-right: 0;\n padding-left: 56px;\n justify-content: flex-start;\n}\n\n.mj-timeline--single .mj-timeline__event--odd {\n padding-left: 56px;\n flex-direction: row;\n}\n\n.mj-timeline--single .mj-timeline__marker {\n left: 24px;\n transform: translateX(-50%);\n}\n\n.mj-timeline--single .mj-timeline__date-label {\n display: none;\n}\n\n.mj-timeline--single .mj-timeline__card::before {\n left: -6px;\n right: auto;\n border-right: none;\n border-top: none;\n border-left: 1px solid var(--mj-timeline-card-border);\n border-bottom: 1px solid var(--mj-timeline-card-border);\n}\n\n.mj-timeline--single .mj-timeline__card {\n max-width: none;\n}\n\n/* ============================================================================\n ALTERNATING LAYOUT - Explicit class (same as default vertical)\n ============================================================================ */\n\n.mj-timeline--alternating .mj-timeline__segment-header {\n left: 50%;\n transform: translateX(-50%);\n}\n\n/* ============================================================================\n HORIZONTAL LAYOUT\n ============================================================================ */\n\n.mj-timeline--horizontal {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n align-items: flex-start;\n overflow-x: auto;\n overflow-y: hidden;\n padding: 80px 40px 24px;\n min-width: 100%;\n}\n\n.mj-timeline--horizontal .mj-timeline__segment {\n flex: 0 0 auto;\n display: flex;\n flex-direction: column;\n margin-bottom: 0;\n margin-right: 40px;\n position: relative;\n}\n\n.mj-timeline--horizontal .mj-timeline__segment:last-child {\n margin-right: 0;\n}\n\n.mj-timeline--horizontal .mj-timeline__segment-header {\n position: absolute;\n top: -56px;\n left: 0;\n margin-bottom: 0;\n white-space: nowrap;\n}\n\n.mj-timeline--horizontal .mj-timeline__segment-content {\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n}\n\n.mj-timeline--horizontal .mj-timeline__axis {\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n padding-left: 0;\n min-width: max-content;\n gap: 0;\n}\n\n/* Horizontal axis line */\n.mj-timeline--horizontal .mj-timeline__axis::before {\n left: 0;\n right: 0;\n top: 0;\n bottom: auto;\n width: 100%;\n height: var(--mj-timeline-line-width);\n transform: none;\n}\n\n.mj-timeline--horizontal .mj-timeline__event {\n flex-direction: column;\n align-items: center;\n margin-bottom: 0;\n margin-right: 48px;\n padding: 0;\n padding-top: 32px;\n min-width: 180px;\n max-width: 280px;\n width: auto;\n}\n\n.mj-timeline--horizontal .mj-timeline__event--odd {\n padding-left: 0;\n flex-direction: column;\n}\n\n.mj-timeline--horizontal .mj-timeline__event:last-child {\n margin-right: 0;\n}\n\n.mj-timeline--horizontal .mj-timeline__marker {\n position: absolute;\n left: 50%;\n /* Position so marker is centered on the axis line (top: 0 of axis) */\n /* Event has padding-top: 32px, marker is 14px, so top: -(32 + 7) = -39px for center */\n top: calc(-32px - var(--mj-timeline-marker-size) / 2);\n transform: translateX(-50%);\n margin: 0;\n}\n\n.mj-timeline--horizontal .mj-timeline__event:hover .mj-timeline__marker {\n transform: translateX(-50%) scale(1.2);\n}\n\n.mj-timeline--horizontal .mj-timeline__date-label {\n position: absolute;\n top: -40px;\n left: 50%;\n right: auto;\n transform: translateX(-50%);\n text-align: center;\n font-size: var(--mj-text-xs);\n}\n\n.mj-timeline--horizontal .mj-timeline__card {\n max-width: none;\n width: 100%;\n min-width: 0;\n}\n\n.mj-timeline--horizontal .mj-timeline__card::before {\n display: none;\n}\n\n/* Horizontal focused marker override */\n.mj-timeline--horizontal .mj-timeline__event--focused .mj-timeline__marker {\n transform: translateX(-50%) scale(1.4);\n}\n\n/* Horizontal collapsed segment - rotate 90\u00B0 CCW and compress */\n.mj-timeline--horizontal .mj-timeline__segment--collapsed {\n flex: 0 0 auto;\n width: 32px;\n min-width: 32px;\n margin-right: 4px;\n}\n\n.mj-timeline--horizontal .mj-timeline__segment--collapsed .mj-timeline__segment-header {\n writing-mode: vertical-rl;\n text-orientation: mixed;\n transform: rotate(180deg);\n white-space: nowrap;\n padding: 8px 4px;\n margin: 0;\n top: 0;\n position: relative;\n}\n\n.mj-timeline--horizontal .mj-timeline__segment--collapsed .mj-timeline__segment-content {\n display: none;\n}\n\n/* ============================================================================\n RESPONSIVE\n ============================================================================ */\n\n@media (max-width: 900px) {\n /* Force single layout on smaller screens */\n .mj-timeline--alternating .mj-timeline__axis::before {\n left: 24px;\n transform: none;\n }\n\n .mj-timeline--alternating .mj-timeline__segment-header {\n left: auto;\n transform: none;\n margin-left: 12px;\n }\n\n .mj-timeline--alternating .mj-timeline__event {\n padding-right: 0;\n padding-left: 56px;\n justify-content: flex-start;\n }\n\n .mj-timeline--alternating .mj-timeline__event--odd {\n padding-left: 56px;\n padding-right: 0;\n flex-direction: row;\n }\n\n .mj-timeline--alternating .mj-timeline__marker {\n left: 24px;\n transform: translateX(-50%);\n }\n\n .mj-timeline--alternating .mj-timeline__event:hover .mj-timeline__marker {\n transform: translateX(-50%) scale(1.2);\n }\n\n .mj-timeline--alternating .mj-timeline__date-label {\n display: none;\n }\n\n .mj-timeline--alternating .mj-timeline__card::before {\n left: -6px;\n right: auto;\n border-right: none;\n border-top: none;\n border-left: 1px solid var(--mj-timeline-card-border);\n border-bottom: 1px solid var(--mj-timeline-card-border);\n }\n\n .mj-timeline--alternating .mj-timeline__card {\n max-width: none;\n }\n}\n\n@media (max-width: 600px) {\n mj-timeline {\n --mj-timeline-card-padding: 12px;\n --mj-timeline-gap: 16px;\n --mj-timeline-marker-size: 12px;\n }\n\n .mj-timeline {\n padding: 16px 12px;\n }\n\n .mj-timeline__card-title {\n font-size: var(--mj-text-sm);\n }\n\n .mj-timeline--horizontal .mj-timeline__event {\n min-width: 160px;\n max-width: 220px;\n margin-right: 32px;\n }\n}\n\n/* Touch devices */\n@media (hover: none) and (pointer: coarse) {\n .mj-timeline__card-actions--hover-only {\n opacity: 1;\n }\n\n .mj-timeline__action {\n min-height: 40px;\n }\n}\n\n/* Reduced motion */\n@media (prefers-reduced-motion: reduce) {\n .mj-timeline__card,\n .mj-timeline__marker,\n .mj-timeline__segment-toggle {\n transition: none;\n }\n}\n"] }]
|
|
1956
|
-
}], () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }], {
|
|
2372
|
+
}], () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }], { Groups: [{
|
|
2373
|
+
type: Input
|
|
2374
|
+
}], groups: [{
|
|
2375
|
+
type: Input
|
|
2376
|
+
}], AllowLoad: [{
|
|
1957
2377
|
type: Input
|
|
1958
2378
|
}], allowLoad: [{
|
|
1959
2379
|
type: Input
|
|
2380
|
+
}], Orientation: [{
|
|
2381
|
+
type: Input
|
|
1960
2382
|
}], orientation: [{
|
|
1961
2383
|
type: Input
|
|
2384
|
+
}], Layout: [{
|
|
2385
|
+
type: Input
|
|
1962
2386
|
}], layout: [{
|
|
1963
2387
|
type: Input
|
|
2388
|
+
}], SortOrder: [{
|
|
2389
|
+
type: Input
|
|
1964
2390
|
}], sortOrder: [{
|
|
1965
2391
|
type: Input
|
|
2392
|
+
}], SegmentGrouping: [{
|
|
2393
|
+
type: Input
|
|
1966
2394
|
}], segmentGrouping: [{
|
|
1967
2395
|
type: Input
|
|
2396
|
+
}], DefaultCardConfig: [{
|
|
2397
|
+
type: Input
|
|
1968
2398
|
}], defaultCardConfig: [{
|
|
1969
2399
|
type: Input
|
|
2400
|
+
}], VirtualScroll: [{
|
|
2401
|
+
type: Input
|
|
1970
2402
|
}], virtualScroll: [{
|
|
1971
2403
|
type: Input
|
|
1972
2404
|
}], segmentsCollapsible: [{
|
|
@@ -1983,62 +2415,96 @@ export class TimelineComponent extends BaseAngularComponent {
|
|
|
1983
2415
|
type: Input
|
|
1984
2416
|
}], enableKeyboardNavigation: [{
|
|
1985
2417
|
type: Input
|
|
2418
|
+
}], SelectedEventId: [{
|
|
2419
|
+
type: Input
|
|
1986
2420
|
}], selectedEventId: [{
|
|
1987
2421
|
type: Input
|
|
2422
|
+
}], BeforeEventClick: [{
|
|
2423
|
+
type: Output
|
|
1988
2424
|
}], beforeEventClick: [{
|
|
1989
2425
|
type: Output
|
|
2426
|
+
}], BeforeEventExpand: [{
|
|
2427
|
+
type: Output
|
|
1990
2428
|
}], beforeEventExpand: [{
|
|
1991
2429
|
type: Output
|
|
2430
|
+
}], BeforeEventCollapse: [{
|
|
2431
|
+
type: Output
|
|
1992
2432
|
}], beforeEventCollapse: [{
|
|
1993
2433
|
type: Output
|
|
2434
|
+
}], BeforeEventHover: [{
|
|
2435
|
+
type: Output
|
|
1994
2436
|
}], beforeEventHover: [{
|
|
1995
2437
|
type: Output
|
|
2438
|
+
}], BeforeActionClick: [{
|
|
2439
|
+
type: Output
|
|
1996
2440
|
}], beforeActionClick: [{
|
|
1997
2441
|
type: Output
|
|
2442
|
+
}], BeforeSegmentExpand: [{
|
|
2443
|
+
type: Output
|
|
1998
2444
|
}], beforeSegmentExpand: [{
|
|
1999
2445
|
type: Output
|
|
2446
|
+
}], BeforeSegmentCollapse: [{
|
|
2447
|
+
type: Output
|
|
2000
2448
|
}], beforeSegmentCollapse: [{
|
|
2001
2449
|
type: Output
|
|
2450
|
+
}], BeforeLoad: [{
|
|
2451
|
+
type: Output
|
|
2002
2452
|
}], beforeLoad: [{
|
|
2003
2453
|
type: Output
|
|
2454
|
+
}], AfterEventClick: [{
|
|
2455
|
+
type: Output
|
|
2004
2456
|
}], afterEventClick: [{
|
|
2005
2457
|
type: Output
|
|
2458
|
+
}], AfterEventExpand: [{
|
|
2459
|
+
type: Output
|
|
2006
2460
|
}], afterEventExpand: [{
|
|
2007
2461
|
type: Output
|
|
2462
|
+
}], AfterEventCollapse: [{
|
|
2463
|
+
type: Output
|
|
2008
2464
|
}], afterEventCollapse: [{
|
|
2009
2465
|
type: Output
|
|
2466
|
+
}], AfterEventHover: [{
|
|
2467
|
+
type: Output
|
|
2010
2468
|
}], afterEventHover: [{
|
|
2011
2469
|
type: Output
|
|
2470
|
+
}], AfterActionClick: [{
|
|
2471
|
+
type: Output
|
|
2012
2472
|
}], afterActionClick: [{
|
|
2013
2473
|
type: Output
|
|
2474
|
+
}], AfterSegmentExpand: [{
|
|
2475
|
+
type: Output
|
|
2014
2476
|
}], afterSegmentExpand: [{
|
|
2015
2477
|
type: Output
|
|
2478
|
+
}], AfterSegmentCollapse: [{
|
|
2479
|
+
type: Output
|
|
2016
2480
|
}], afterSegmentCollapse: [{
|
|
2017
2481
|
type: Output
|
|
2482
|
+
}], AfterLoad: [{
|
|
2483
|
+
type: Output
|
|
2018
2484
|
}], afterLoad: [{
|
|
2019
2485
|
type: Output
|
|
2020
|
-
}],
|
|
2486
|
+
}], CardTemplate: [{
|
|
2021
2487
|
type: ContentChild,
|
|
2022
2488
|
args: ['cardTemplate']
|
|
2023
|
-
}],
|
|
2489
|
+
}], HeaderTemplate: [{
|
|
2024
2490
|
type: ContentChild,
|
|
2025
2491
|
args: ['headerTemplate']
|
|
2026
|
-
}],
|
|
2492
|
+
}], BodyTemplate: [{
|
|
2027
2493
|
type: ContentChild,
|
|
2028
2494
|
args: ['bodyTemplate']
|
|
2029
|
-
}],
|
|
2495
|
+
}], ActionsTemplate: [{
|
|
2030
2496
|
type: ContentChild,
|
|
2031
2497
|
args: ['actionsTemplate']
|
|
2032
|
-
}],
|
|
2498
|
+
}], SegmentHeaderTemplate: [{
|
|
2033
2499
|
type: ContentChild,
|
|
2034
2500
|
args: ['segmentHeaderTemplate']
|
|
2035
|
-
}],
|
|
2501
|
+
}], EmptyTemplate: [{
|
|
2036
2502
|
type: ContentChild,
|
|
2037
2503
|
args: ['emptyTemplate']
|
|
2038
|
-
}],
|
|
2504
|
+
}], LoadingTemplate: [{
|
|
2039
2505
|
type: ContentChild,
|
|
2040
2506
|
args: ['loadingTemplate']
|
|
2041
|
-
}],
|
|
2507
|
+
}], ScrollContainer: [{
|
|
2042
2508
|
type: ViewChild,
|
|
2043
2509
|
args: ['scrollContainer']
|
|
2044
2510
|
}] }); })();
|