From 996ec5ebca32252e29df13e4cd71a51dc406e484 Mon Sep 17 00:00:00 2001 From: Melloware Date: Fri, 23 Dec 2022 10:50:02 -0500 Subject: [PATCH] Fix #3815: Timeline docs (#3816) --- components/doc/datatable/apidoc.js | 2 +- components/doc/dataview/apidoc.js | 2 +- components/doc/orderlist/apidoc.js | 2 +- components/doc/picklist/apidoc.js | 2 +- components/doc/timeline/apidoc.js | 23 ++++++++++++++++++++--- components/lib/timeline/Timeline.js | 16 +++++++--------- components/lib/timeline/timeline.d.ts | 10 +++++----- 7 files changed, 36 insertions(+), 21 deletions(-) diff --git a/components/doc/datatable/apidoc.js b/components/doc/datatable/apidoc.js index f25a726a95..5b8d30488d 100644 --- a/components/doc/datatable/apidoc.js +++ b/components/doc/datatable/apidoc.js @@ -718,7 +718,7 @@ export function ApiDoc(props) { dataKey string null - A property to uniquely identify a record in data. + Name of the field that uniquely identifies a record in the data. Should be a unique business key to prevent re-rendering. metaKeySelection diff --git a/components/doc/dataview/apidoc.js b/components/doc/dataview/apidoc.js index b2fa2aa856..6b7e4c676b 100644 --- a/components/doc/dataview/apidoc.js +++ b/components/doc/dataview/apidoc.js @@ -37,7 +37,7 @@ export function ApiDoc(props) { dataKey string null - A property to uniquely identify an item. + Name of the field that uniquely identifies a record in the data. Should be a unique business key to prevent re-rendering. style diff --git a/components/doc/orderlist/apidoc.js b/components/doc/orderlist/apidoc.js index 6fcaa28800..96db8995e2 100644 --- a/components/doc/orderlist/apidoc.js +++ b/components/doc/orderlist/apidoc.js @@ -36,7 +36,7 @@ export function ApiDoc(props) { dataKey string null - Name of the field that uniquely identifies the a record in the data. + Name of the field that uniquely identifies a record in the data. Should be a unique business key to prevent re-rendering. header diff --git a/components/doc/picklist/apidoc.js b/components/doc/picklist/apidoc.js index 48f3bc5efe..106d9cf0a9 100644 --- a/components/doc/picklist/apidoc.js +++ b/components/doc/picklist/apidoc.js @@ -204,7 +204,7 @@ export function ApiDoc(props) { dataKey string null - Name of the field that uniquely identifies the a record in the data. + Name of the field that uniquely identifies a record in the data. Should be a unique business key to prevent re-rendering. diff --git a/components/doc/timeline/apidoc.js b/components/doc/timeline/apidoc.js index 0cd480b644..572c41abbf 100644 --- a/components/doc/timeline/apidoc.js +++ b/components/doc/timeline/apidoc.js @@ -1,8 +1,7 @@ -import { CodeHighlight } from '../common/codehighlight'; +import Link from 'next/link'; import { DevelopmentSection } from '../common/developmentsection'; import { DocSectionText } from '../common/docsectiontext'; import { DocSubSection } from '../common/docsubsection'; -import Link from 'next/link'; export function ApiDoc(props) { return ( @@ -45,11 +44,29 @@ export function ApiDoc(props) { vertical Orientation of the timeline, valid values are "vertical" and "horizontal". + + content + any + null + Template of the content. + + + marker + any + null + Template content allows placing a custom event marker instead of the default one. + + + opposite + any + null + Template content to be placed at the other side of the bar. + dataKey string null - Name of the field that uniquely identifies the a record in the data. + Name of the field that uniquely identifies a record in the data. Should be a unique business key to prevent re-rendering. style diff --git a/components/lib/timeline/Timeline.js b/components/lib/timeline/Timeline.js index 3dc4d29b4f..2f2b57d7e1 100644 --- a/components/lib/timeline/Timeline.js +++ b/components/lib/timeline/Timeline.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { classNames, ObjectUtils } from '../utils/Utils'; +import { ObjectUtils, classNames } from '../utils/Utils'; export const Timeline = React.memo( React.forwardRef((props, ref) => { @@ -50,7 +50,7 @@ export const Timeline = React.memo( const events = createEvents(); return ( -
+
{events}
); @@ -60,14 +60,12 @@ export const Timeline = React.memo( Timeline.displayName = 'Timeline'; Timeline.defaultProps = { __TYPE: 'Timeline', - id: null, - value: null, align: 'left', - layout: 'vertical', - dataKey: null, className: null, - style: null, - opposite: null, + content: null, + dataKey: null, + layout: 'vertical', marker: null, - content: null + opposite: null, + value: null }; diff --git a/components/lib/timeline/timeline.d.ts b/components/lib/timeline/timeline.d.ts index 28abbde667..c6acef1625 100644 --- a/components/lib/timeline/timeline.d.ts +++ b/components/lib/timeline/timeline.d.ts @@ -7,14 +7,14 @@ type TimelineLayoutType = 'vertical' | 'horizontal'; type TimelineTemplateType = React.ReactNode | ((item: any, index: number) => React.ReactNode); export interface TimelineProps extends Omit, HTMLDivElement>, 'ref'> { - value?: any[]; align?: TimelineAlignType; - layout?: TimelineLayoutType; + children?: React.ReactNode; + content?: TimelineTemplateType; dataKey?: string; - opposite?: TimelineTemplateType; + layout?: TimelineLayoutType; marker?: TimelineTemplateType; - content?: TimelineTemplateType; - children?: React.ReactNode; + opposite?: TimelineTemplateType; + value?: any[]; } export declare class Timeline extends React.Component {