lml-main
Version:
This is now a mono repository published into many standalone packages.
81 lines (80 loc) • 3.19 kB
TypeScript
import * as React from 'react';
import { HoverableComponent, StylableComponentProps } from 'cosmoui';
import { JobModel, JobIncidentModel, JobStatusModel, AllocationType } from '@lml/cosmo-ts-data';
import { DragType } from '../../../allocation/actions';
/**
* These are passed in by the client
*/
export interface JobCardProps extends StylableComponentProps {
jobByStatus: JobStatusModel;
}
/**
* These are added in by the wrapper class
* e.g. LiveJobCard, AllocatedJobCard etc
*/
export interface WrappedJobCardProps extends JobCardProps {
children?: any;
ItemsField: React.ComponentClass<JobCardComponentProps> | null;
TimeField: React.ComponentClass<JobCardComponentProps> | null;
TagField: React.ComponentClass<JobCardComponentProps> | null;
SmartField: React.ComponentClass<JobCardComponentProps> | null;
CourierField: React.ComponentClass<JobCardComponentProps> | null;
StatusField: React.ComponentClass<JobCardComponentProps> | null;
ConsolidationField: React.ComponentClass<JobCardComponentProps> | null;
}
/**
* These contain everything above, plus some extra stuff
* that has been injected by the connect() call
*/
export interface JobCardComponentProps extends WrappedJobCardProps {
job: JobModel | null;
incidents: JobIncidentModel[] | null;
active: boolean;
expanded: boolean;
allocated: boolean;
dropTarget: boolean;
canAllocate: boolean;
consolidation: boolean;
allocate: (allocationType: AllocationType, jobRefId?: string, courierRefId?: string) => any;
setActiveJob: (refId: string) => any;
unsetActiveJob: (refId: string) => any;
setDragTarget: (draggingType: DragType, refId: string) => any;
setDropTarget: (draggingType: DragType, refId: string) => any;
resetDragAndDrop: () => any;
resetDropTarget: (draggingType: DragType, refId: string) => any;
showJobDetails: (refId: string) => any;
closeCourierSearchFilter: () => any;
}
export declare class JobCard extends HoverableComponent<JobCardComponentProps> {
onDragStart: (e: React.DragEvent<any>) => void;
onDragEnd: (e: React.DragEvent<any>) => void;
onDragEnter: (e: React.DragEvent<any>) => void;
onDragLeave: (e: React.DragEvent<any>) => void;
onDragOver: (e: React.DragEvent<any>) => void;
onDrop: (e: React.DragEvent<any>) => void;
onClick: (e: React.MouseEvent<any>) => void;
onDoubleClick: (e: React.MouseEvent<any>) => void;
render(): JSX.Element;
renderActionBox(): JSX.Element;
renderMainRow(): JSX.Element;
renderExpandedRow(): JSX.Element;
styles(): any;
private expandedStyles;
}
export declare abstract class AbstractJobCard extends React.Component<JobCardProps, {}> {
}
export declare class LiveJobCard extends AbstractJobCard {
render(): JSX.Element;
}
export declare class AllocatedJobCard extends AbstractJobCard {
render(): JSX.Element;
}
export declare class AcceptedJobCard extends AbstractJobCard {
render(): JSX.Element;
}
export declare class InProgressJobCard extends AbstractJobCard {
render(): JSX.Element;
}
export declare class CompletedJobCard extends AbstractJobCard {
render(): JSX.Element;
}