3.0.0 • Published 2 years ago

@eff-custom-plugins/timesheet v3.0.0

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

Timesheet

Timesheet is a week schedule component using Angular v14.0.5.

Installation

NPM

npm i @eff-custom-plugins/timesheet

Usage

Html

<timesheet tableName="Date/Time" [selectedSchedules]="{"0": ["05:00"], "1": ["03:00","05:00"], "5": ["05:00","08:00","09:00"]}" [columnNames]="['00:00', '01:00', '02:00', '03:00']" (scheduleChangeEvent)="changeSchedule($event)"></timesheet>

Attributes

AttributesDescription
@Input() tableName: stringThe name of the table (top left column). Default value: Date/Time
@Input() selectedSchedules: {key: string: string[]}Default selected items
@Input() columnNames: IColumns[]Columns names. Default value: {"value":"00:00"},{"value":"01:00"},{"value":"02:00"},{"value":"03:00"},{"value":"04:00"},{"value":"05:00"},{"value":"06:00"},{"value":"07:00"},{"value":"08:00"},{"value":"09:00"},{"value":"10:00"},{"value":"11:00"},{"value":"12:00"},{"value":"13:00"},{"value":"14:00"},{"value":"15:00"},{"value":"16:00"},{"value":"17:00"},{"value":"18:00"},{"value":"19:00"},{"value":"20:00"},{"value":"21:00"},{"value":"22:00"},{"value":"23:00"}
@Output() scheduleChangeEvent: EventEmitter<{key: string: string[]}>()The event will be fired on change of selected schedule values. Returns: Selected schedule of values as an {key: string: string[]}.1 = Monday,2 = Tuesday,3 = Wednesday,4 = Thursday,5 = Friday,6 = Saturday,0 = Sunday

Example and Sample Code

1) Import 'TimesheetModule' in your app module

import { TimesheetModule } from "@eff-custom-plugins/timesheet";
  
@NgModule({
  imports:[
    ..
    TimesheetModule
    ..
  ]
})

2) Add 'timesheet' in your component html

<timesheet tableName="Date/Time" [selectedSchedules]="{"0": ["05:00"], "1": ["03:00","05:00"], "5": ["05:00","08:00","09:00"]}" [columnNames]="['00:00', '01:00', '02:00', '03:00']" (scheduleChangeEvent)="changeSchedule($event)"></timesheet>

3) Add a method in your component class to listen for onChange event from timesheet

/*Method to listen for onChange event from timesheet*/
scheduleChangeEvent(selectedValues: {[key: string]: string[]}) {
    this._currentValues = selectedValues;
}

4) You done. Run your app. cheers!

3.0.0

2 years ago

2.3.1

3 years ago

2.3.0

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago