0.0.3 • Published 5 years ago

ng-parallactic-ui v0.0.3

Weekly downloads
1
License
GPL-3.0-or-later
Repository
-
Last release
5 years ago

Prallactic UI

A collection of simple unstyled ui components for Angular.

Installation

Install with npm

npm i ng-parallactic-ui --save

Import the library in your app.module.ts

import { NgParallacticUiModule } from 'ng-parallactic-ui';

@NgModule({
    ...
    imports: [
        NgParallacticUiModule,
    ],
})

Components

Datepicker

Insert a datepicker in your forms

<pl-datepicker name="date" [(ngModel)]="date"></pl-datepicker>

Options

OptionDefaultDescription
dateFormat'dd.MM.yyyy'Defines the date format to display the selected date

Input

Adds a input form control

<pl-input 
    [label]="'Full Name'"
    [type]="'text'"
    [validationMessage]="'Please fill in your name.'"
    [showValidationMessage]="!form.controls.fullName.valid"
    [(ngModel)]="model">
</pl-input>

Options

OptionDefaultDescription
labelSets the form control label
typeSets the input type. 'text', 'number', 'email', 'password', 'tel', 'url'
helpTextSets the helper text below the input
validationMessageSets the validation message
showValidationMessagefalseShows the validation message if invalid

Table

Insert a datepicker in your forms

<pl-table 
    [tableData]="data" 
    [tableOptions]="tableOptions"
    [tableColumnsDefinitions]="columnDefinitions"
    (tableRowClicked)="onTableRowClick($event)">
</pl-table>

Options

NameDefaultDescription
sortBynullDefine column (field name) to sort
sortOrder'asc'Defines the sort direction (ascdesc)
selectableRowsfalseDefines if a row is selectable. If yes, a checkbox is added in front of each row.
selectOnRowClickfalseMakes the whole row clickable to select it

Column Definitions

NameDescription
titleSets the column title
fieldDefine the field name from the data object (use title.short to select nestet field)
sortableMakes the column sortable
valueFormatterUse a function to return a formatted value (arguments: value, rowData, colDef)
tableCellRendererUse a custom component to render the cell (@Input() tableCellData: PlTableCellData;)

Events

NameDescription
tableRowClickedWhen a row has been clicked
tableRowSelectionChangedWhen the selection model changed