4.0.0 • Published 3 years ago

@disane/ngx-taskboard v4.0.0

Weekly downloads
11
License
MIT
Repository
github
Last release
3 years ago

ngx-taskboard

badge codecov badge npm bundle size (scoped) Build Status Commitizen friendly

ngx-taskboard is an implemention of my on taskboard, because all other taskboards are not that what I need. Feel free to contribute or leave some important feedback! Head over to the issues when you have questions or found a bug or leave a PR if you have som additions. Styling is made with Bootstrap, so it's 100% compatible.

Description

Taskboard

Dependencies

  • Angular 7
  • Bootstrap 4

Installation

npm install @disane/ngx-taskboard

Basic usage

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { NgxTaskboardModule } from '@disane/ngx-taskboard';

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

app.component.html

<ngx-taskboard class="w-100 h-100" [items]="items" [hGroupKeys]="hGroupKeys" [vGroupKeys]="vGroupKeys"
  [vGroupKey]="vGroupKey" [hGroupKey]="hGroupKey" [sortBy]="sortBy" [invertGroupDirection]="false">
</ngx-taskboard>

app.component.ts

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  public items = [
    { id: 1, name: 'Evaluate', color: '#fb3064', status: 'open', user: 'Marco', priority: 1 },
    { id: 2, name: 'Call customer', color: '#71dd8f', status: 'working', user: 'Jamie', priority: 1 },
    { id: 3, name: 'Fix bugs', color: '#29aa82', status: 'open', user: 'Malian', priority: 1 },
    { id: 3, name: 'Create SCSS', color: '#e14a2f', status: 'open', user: 'Marco', priority: 1 },
    { id: 4, name: 'Boil water', color: '#209ab7', status: 'working', user: 'Marco', priority: 2 },
    { id: 4, name: 'Walking the doggo', color: '#b3f7dd', status: 'done', user: 'Thorsten', priority: 3 },
    { id: 4, name: 'Prepare for xmas', color: '#ea6562', status: '', user: '' },
    { id: 4, name: 'Birthday preps', color: '#b4ade5', status: 'test', user: '', priority: 5 }
  ];

  public vGroupKeys = ['open', 'working', 'test', 'done'];
  public hGroupKeys = ['Marco', 'Jamie', 'Malian', 'Natalie', 'Thorsten'];

  public vGroupKey = 'status';
  public hGroupKey = 'user';
  public sortBy = 'priority';

}

Configuration

Properties

NameDefault valueDescriptionType
actionsTemplatenullTemplate for actions, add and collapse buttons (see examples)TemplateRef<any>
backlogName'Backlog'Name of the backlog row
backlogWidth${this.columnWidth}pxWidth of the backlog row, when activated. You can use all valid css units. Default is columnWidth
boardName''Board name to show between row and column header
cellAddNewItemstrueShow add buttons in the cells for columns and rows
cellClass'card-header'Default css class for cell header
columnWidth200Column width (in px) which is applied to the columns when the content is scollable
dragoverPlaceholderTemplatenullTemplate for the placeholder element which will be generated when an item is draged over a cellTemplateRef<any>
filter''Predefined filter for the searchbar. If set, the items are filtered by the term on init.
filterOnProperties[]Specify the properties which will be searched for the given termin filter. If not properties are given, all will be searchedstring[]
filterRowPlaceholder'Search for items'Placeholder for the input with the filter row
hAddNewItemstrueShow add buttons on the column headings
hCollapsedfalseColumns are collapsed or not on init
hGroupKey''Key to group data for columns
hGroupKeys[]Grouping keys for columns (if not passed, the keys will be determined out of the items)Caution: If you don't pass any headings manually, only the columns are shown, which have data.If you want to show emtpy rows, please set them(string | GroupHeading)[]
hHeaderClass'card-header card-header-bg'Default css class for column header
hHeaderTemplatenullTemplate for column headers. Current groupName will be passed (see examples)TemplateRef<any>
initialCollapseState[]The collapse state which is applied when set initiallyCollapseState[]
invertGroupDirectionfalseInvert rows and columns
items[]
itemTemplatenullTemplate for items to render. "item" object ist passed (see examples)TemplateRef<any>
noElementsTemplatenullTemplate for collapsed rows to render. "count" object ist passed (see examples)TemplateRef<any>
showBacklogtrueShows the blacklog on onit
showFilterRowtrueShows the filter row to search items by filter in filterOnProperties array
showUngroupedInBacklogtrueAll items which can't be grouped into rows and columns are stored into the backlog
smallTextfalseDecrease overall font size
sortBy''Sort items by property
stickyHorizontalHeaderKeystrueIf set to true, the horizontal group keys are fixed positioned to the top and remain at the top while scrolling. Only applied when scrollable is true
stickyVerticalHeaderKeysfalseIf set to true, the vertical group keys are fixed positioned to the top and remain at the top while scrolling. Only applied when scrollable is true
vAddNewItemstrueShow add buttons on the row headings
vCollapsabletrueAllow to collapse the rows
vCollapsedfalseRows are collapsed or not on init
vGroupKey''Key to group data for rows
vGroupKeys[]Grouping keys for rows (if not passed, the keys will be determined out of the items)Caution: If you don't pass any headings manually, only the rows are shown, which have data.If you want to show emtpy rows, please set them(string | GroupHeading)[]
vHeaderClass'card-header'Default css class for row header
vHeaderTemplatenullTemplate for row headers. Current groupName will be passed (see examples)TemplateRef<any>

Events

NameDefault valueDescriptionType
dragStartednew EventEmitter<object>()Fired when the user drags an item. Current item is passedEventEmitter
droppednew EventEmitter<DropEvent>()Fired when an item is dropped. Current item is passedEventEmitter
elementCreateClicknew EventEmitter<ClickEvent>()Fired when an add action is click. Current ClickEvent is passedEventEmitter
headingCollapsednew EventEmitter<CollapseEvent>()Fired when a heading is collapsed. CollapseEvent is emittedEventEmitter
isScrollingnew EventEmitter()EventEmitter
scrolledToEndnew EventEmitter()EventEmitter
scrollEndednew EventEmitter()EventEmitter

Interfaces

NameTypeDescription
CardIteminterfaceItem to render
ClickEventinterfaceDatatype which is emitted when an item should be added
CollapseEventinterfaceObject for the headings in which you can set color etc.
CollapseStateinterfaceAll the collapse stated of every group item (horizontal / vertical)
DropEventinterfaceEvent which is fired when an item is dropped
GroupHeadinginterfaceObject for the headings in which you can set color etc.
GroupKeysinterfaceGroup keys to determine the correct groups internally
ScrollableinterfaceObject to determine the scrollability
ScrollEventinterface

Examples

Basic examples

https://stackblitz.com/edit/disane-ngx-taskboard?embed=1&file=src/app/app.component.html&hideExplorer=1&hideNavigation=1&view=preview

Contributing

Installation the project

git clone https://github.com/Disane87/ngx-taskboard.git .

Installing deps:

npm install

If you use Visual Studio Code, just use the included ngx-taskboard.code-workspace, install recommended extensions and hit F5 to debug.

And now, have some fun! 😊

4.0.0

3 years ago

2.0.0

4 years ago

3.0.0

4 years ago

1.4.0

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.15

5 years ago

1.2.14

5 years ago

1.2.13

5 years ago

1.2.12

5 years ago

1.2.11

5 years ago

1.2.10

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.0

5 years ago

1.1.16

5 years ago

1.1.11

5 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.0

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago