Skip to content

Commit

Permalink
Fix primefaces#3815: Timeline docs (primefaces#3816)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Dec 23, 2022
1 parent 1e87979 commit 996ec5e
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 21 deletions.
2 changes: 1 addition & 1 deletion components/doc/datatable/apidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ export function ApiDoc(props) {
<td>dataKey</td>
<td>string</td>
<td>null</td>
<td>A property to uniquely identify a record in data.</td>
<td>Name of the field that uniquely identifies a record in the data. Should be a unique business key to prevent re-rendering.</td>
</tr>
<tr>
<td>metaKeySelection</td>
Expand Down
2 changes: 1 addition & 1 deletion components/doc/dataview/apidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function ApiDoc(props) {
<td>dataKey</td>
<td>string</td>
<td>null</td>
<td>A property to uniquely identify an item.</td>
<td>Name of the field that uniquely identifies a record in the data. Should be a unique business key to prevent re-rendering.</td>
</tr>
<tr>
<td>style</td>
Expand Down
2 changes: 1 addition & 1 deletion components/doc/orderlist/apidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function ApiDoc(props) {
<td>dataKey</td>
<td>string</td>
<td>null</td>
<td>Name of the field that uniquely identifies the a record in the data.</td>
<td>Name of the field that uniquely identifies a record in the data. Should be a unique business key to prevent re-rendering.</td>
</tr>
<tr>
<td>header</td>
Expand Down
2 changes: 1 addition & 1 deletion components/doc/picklist/apidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export function ApiDoc(props) {
<td>dataKey</td>
<td>string</td>
<td>null</td>
<td>Name of the field that uniquely identifies the a record in the data.</td>
<td>Name of the field that uniquely identifies a record in the data. Should be a unique business key to prevent re-rendering.</td>
</tr>
</tbody>
</table>
Expand Down
23 changes: 20 additions & 3 deletions components/doc/timeline/apidoc.js
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down Expand Up @@ -45,11 +44,29 @@ export function ApiDoc(props) {
<td>vertical</td>
<td>Orientation of the timeline, valid values are "vertical" and "horizontal".</td>
</tr>
<tr>
<td>content</td>
<td>any</td>
<td>null</td>
<td>Template of the content.</td>
</tr>
<tr>
<td>marker</td>
<td>any</td>
<td>null</td>
<td>Template content allows placing a custom event marker instead of the default one.</td>
</tr>
<tr>
<td>opposite</td>
<td>any</td>
<td>null</td>
<td>Template content to be placed at the other side of the bar.</td>
</tr>
<tr>
<td>dataKey</td>
<td>string</td>
<td>null</td>
<td>Name of the field that uniquely identifies the a record in the data.</td>
<td>Name of the field that uniquely identifies a record in the data. Should be a unique business key to prevent re-rendering.</td>
</tr>
<tr>
<td>style</td>
Expand Down
16 changes: 7 additions & 9 deletions components/lib/timeline/Timeline.js
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down Expand Up @@ -50,7 +50,7 @@ export const Timeline = React.memo(
const events = createEvents();

return (
<div id={props.id} ref={elementRef} className={className} style={props.style} {...otherProps}>
<div ref={elementRef} className={className} {...otherProps}>
{events}
</div>
);
Expand All @@ -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
};
10 changes: 5 additions & 5 deletions components/lib/timeline/timeline.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ type TimelineLayoutType = 'vertical' | 'horizontal';
type TimelineTemplateType = React.ReactNode | ((item: any, index: number) => React.ReactNode);

export interface TimelineProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, 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<TimelineProps, any> {
Expand Down

0 comments on commit 996ec5e

Please sign in to comment.