File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed
packages/pluggableWidgets/timeline-web Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { TimelineContainerProps } from "../typings/TimelineProps";
33import "./ui/Timeline.scss" ;
44import { ActionValue , WebIcon } from "mendix" ;
55import TimelineComponent , { getGroupHeaderByType } from "./components/TimelineComponent" ;
6- import { getHeaderOption } from "./utils/utils" ;
6+ import { getGroupByMethodForCustomMode , getHeaderOption } from "./utils/utils" ;
77
88export interface BasicItemType {
99 icon ?: WebIcon ;
@@ -44,7 +44,11 @@ export default function Timeline(props: TimelineContainerProps): ReactElement {
4444 action : props . onClick ?. get ( item )
4545 } ;
4646 } else {
47- groupKey = getGroupHeaderByType ( groupAttribute ?. formatter , props . groupByKey , date ) ;
47+ groupKey = getGroupHeaderByType (
48+ groupAttribute ?. formatter ,
49+ getGroupByMethodForCustomMode ( props . groupByKey ) ,
50+ date
51+ ) ;
4852 constructedItem = {
4953 icon : props . customIcon ?. get ( item ) ,
5054 groupHeader : props . customGroupHeader ?. get ( item ) ,
Original file line number Diff line number Diff line change 1- import { TimelineContainerProps } from "../../typings/TimelineProps" ;
1+ import { GroupByKeyEnum , GroupByMonthOptionsEnum , TimelineContainerProps } from "../../typings/TimelineProps" ;
22
33export type GroupHeaderConfig = Pick <
44 TimelineContainerProps ,
@@ -8,3 +8,11 @@ export type GroupHeaderConfig = Pick<
88export function getHeaderOption ( { groupByKey, groupByDayOptions, groupByMonthOptions } : GroupHeaderConfig ) {
99 return groupByKey === "day" ? groupByDayOptions : groupByKey === "month" ? groupByMonthOptions : "year" ;
1010}
11+
12+ export function getGroupByMethodForCustomMode ( groupByKey : GroupByKeyEnum ) : GroupByMonthOptionsEnum | GroupByKeyEnum {
13+ if ( groupByKey === "month" ) {
14+ return "monthYear" ;
15+ }
16+
17+ return groupByKey ;
18+ }
Original file line number Diff line number Diff line change @@ -40,7 +40,11 @@ export interface TimelineContainerProps {
4040}
4141
4242export interface TimelinePreviewProps {
43+ /**
44+ * @deprecated Deprecated since version 9.18.0. Please use class property instead.
45+ */
4346 className : string ;
47+ class : string ;
4448 style : string ;
4549 styleObject ?: CSSProperties ;
4650 readOnly : boolean ;
You can’t perform that action at this time.
0 commit comments