1.1.1 • Published 2 years ago

ngx-material-timeline v1.1.1

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

About

Angular library for timeline feature. This library includes various customisations for timeline feature in angular.

Timeline consist of timecards and each timecard can be customized.

This library works only with Angular Material.

Demo

Working Demo

Hands On Demo

Installation

npm install ngx-material-timeline

Usage

Import the NgxMaterialTimelineModule in your app.module.ts file of your angular application.

import { NgxMaterialTimelineModule } from 'ngx-material-timeline';


@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    ...
    NgxMaterialTimelineModule,
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Now you can use the selector in html file as required.

<!DOCTYPE html>
<html>
    <head>
        <mate charest="utf-8" />
        <title>Hello world!</title>
    </head>
    <body>
        <ngx-material-timeline
          [timeline]='timelineArray'
          [addTimecard]='true'
          [addTimecardPosition]='"bottom"'
          [enableFilter]='true'
          (actionEvent)='captureEvent($event)'
          [cardTitleFontSize]='"16px"'
          [cardTimestampFontSize]='"14px"'
          [cardDescriptionFontSize]='"14px"'>
        </ngx-material-timeline>
    </body>
</html>

In style.scss import the material theme.

@import "~@angular/material/prebuilt-themes/indigo-pink.css";

Setting up Global options for ngx-material-timeline selector.

Inputs[]

OptionTypeDefaultDescription
timelinearray[]Array of timecards to be displayed in timeline.
addTimecardbooleanfalseDisplay the add timeline button at the bottom of the timeline.
addTimecardPositionstringbottomDisplay the add timeline button at the bottom of the timeline.
expandAllbooleanfalseExpand descriptions of all the timecards.
enableFilterbooleantrueEnable the filter option to filter timecards in timeline.
defaultThemestring#004c88Default theme color for timeline. Accepts hex value or any color format.
cardTitleFontSizestring14pxChange the font-size of card title.
cardTimestampFontSizestring14pxChange the font-size of card timestamp.
cardDescriptionFontSizestring14pxChange the font-size of card description.

Output()

OptionDescription
actionEventEvent Emmiter for various event from timecards and timeline.

Following will help you understand the event types.

EventEventTypeDescription
actionEventfloatingIconClickEvent emmiter for click on floating icon in timecard.
actionEventtimecardIconClickEvent emmiter for click on timecard icon in timeline.
actionEventtimecardClosedEvent emmiter for close of particular timecard descripion.
actionEventtimecardOpenedEvent emmiter for open of particular timecard descripion.
actionEventaddtimecardClickEvent emmiter for add timecard button.

Timecard Model

{
    index = 0,  // timecard index
    title = '', // timecard title
    description = '', // timecard description
    timestamp = '', // timecard timestamp
    align = '', // time alignment
    timecardIcon = '', // timecard icon
    timecardIconColor = '', // timecard icon color
    timecardFloatingIcon = '', // timecard floating icon
    timecardFloatingIconColor = '', // timecard floating icon color
    timecardColor = '', // timecard color
    timecardTitleColor = '', // timecard title color
    timecardTextColor = '', // timecard description and timestamp color
}
OptionTypeDefaultDescription
indexnumberauto-incrementTimecard index (Auto-increment if not provided.)
titlestring''Timecard title.
descriptionstring''Timecard description.
timestampstring''Timecard timestamp.
alignstring''Align timecards. Accepts: left, right
timecardIconstring''Icon for timecard. Accepts Google Mat Icons.
timecardIconColorstringdefaultThemeColorColor for timecard icon. Accepts hex value or any color format.
timecardFloatingIconstring''Floating icon for timecard. Accepts Google Mat Icons.
timecardFloatingIconColorstringdefaultThemeColorColor for floating icon. Accepts hex value or any color format.
timecardColorstringdefaultThemeColorColor for timecard. Accepts hex value or any color format.
timecardTitleColorstringwhiteColor for timecard title. Accepts hex value or any color format.
timecardTextColorstringblackColor for timecard description and timestamp. Accepts hex value or any color format.

License

MIT

Help and Support

GitHub

1.1.1

2 years ago

1.1.0

2 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago