2.1.5 • Published 5 years ago

axiom-scheduler v2.1.5

Weekly downloads
9
License
MIT
Repository
github
Last release
5 years ago

Axiom Scheduler (beta)

Axiom scheduler is an angular scheduler component use Momentjs.

Online Demo

Usage Demo

Demo source is available here : Source

Install component package from npm :

npm install axiom-scheduler moment angular2-draggable

Axiom Scheduler also need to install @angular/animations. (By default angular will install animation module when you create a new angular project using angular CLI)

For drag and resizing feature Axiom scheduler using angular2-draggable, Thanks to xieziyu :blush:.

Import component module :
import { AxiomSchedulerModule } from 'axiom-scheduler';

...

@NgModule({
  imports: [
    AxiomSchedulerModule
  ], 
  declarations: [
    AppComponent
  ],
  bootstrap: [AppComponent]
})

...

Usage

Add ax-scheduler tag to use scheduler.

<ax-scheduler [axEventTemplate]="eventTemplate" [axSchedulerView]="'week'"
      [axEventToolbar]="true" [axAnimation]="'default" [axTheme]="'light'" [axEvents]="events"
      [axDragStep]="5" [axShowLocale]="true">
</ax-scheduler>

Events

Axiom scheduler using an AxiomSchedulerEvent array to view events. AxiomSchedulerEvent is a class that contains these members :

NameTypeDefaultDescription
_idSymbolthis member is readonlyprovide a unique id for each event and could be use in delete and edit operations
fromDatenullstart date of event
toDatenullend date of event
dataDatenullprovide an object to store event additional data
colorstringnullcolor of event
lockedbooleanfalsewhen it is true event will be locked
titlestringnulldefault title of event

Custom event template

For customizing events to show you can use [axEventTemplate] parameter and design your events template.

<ng-template #t let-item="item">
   <div class="event-template">
      {{ item.data.title }} at <b> {{ item.from | date:'HH:mm' }} {{ item.to | date:'HH:mm' }} </b>
   </div>
</ng-template>

<ax-scheduler [axEventTemplate]="t" [axSchedulerView]="'week'"
      [axEventToolbar]="true" [axAnimation]="'default" [axTheme]="'light'" [axEvents]="events"
      [axDragStep]="5" [axShowLocale]="true">
</ax-scheduler>

As shown above, #t template passed to [axEventTemplate], item variable provide entire event to use in your template.

Events drag and resize

You can drag and resize events to new hours easily. For lock an event and disable drag and resize features just in event object set lock property to True.

Alt Text

Localization

For change scheduler locale just pass your locale to [axLocale], Always you can check available locales in Momentjs i18n document.

<ax-scheduler [axLocale]="'bm'">
</ax-scheduler>

Alt Text

Themes

For change scheduler theme just pass 'light' or 'dark' to [axTheme].

<ax-scheduler [axTheme]="'dark'">
</ax-scheduler>

Alt Text

Animations

For change scheduler theme just pass available animations shown in Input params table to [axAnimation].

<ax-scheduler [axAnimation]="'animation4'">
</ax-scheduler>

Alt Text

@Input() Params

NameTypeDefaultUsage
axEvents--AxiomSchedulerEvent List of scheduler events
axStartDateDateTodayCurrent date of scheduler
axEventTemplateTempateRef--Custom template for events
axDragStepNumber5Events drag and resize step
axLocaleString'en'Set scheduler locale, for more information of available locales, check Momentjs i18n document
axEventToolbarbooleanfalseShow/Hide events toolbar
axSchedulerViewAxiomSchedulerView'day'Set default scheduler view, Available views : 'day', 'week', 'month', 'year'
axViewsAxiomSchedulerView All viewsSet scheduler available views to show
axThemeAxiomSchedulerTheme'light'Set default scheduler theme, Available themes : 'light', 'dark'
axAnimationAxiomSchedulerAnimation'default'Set default scheduler animation effects, Available animations : 'animation1', 'animation2', 'animation3', 'animation4', 'default', 'none'
axShowLocalebooleantrueShow/Hide locale dropdown
axShowLocalebooleantrueShow/Hide locale dropdown

@Output() Params

NameEvent ParamatersDescription
axEventChangeAxiomSchedulerEventFire when an event changed by dragging, resizing, or ...
axEventClickAxiomSchedulerEventFire when an event clicked
axEventDeleteClickAxiomSchedulerEventFire when remove button clicked from event's toolbar
axEventEditClickAxiomSchedulerEventFire when edit button clicked from event's toolbar
axDateChangeDateFire when date of scheduler changed by navigator
axViewChangeAxiomSchedulerViewFire when view of scheduler changed

License

MIT

2.1.5

5 years ago

2.1.4

5 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago