tlimpanont-hamis-ui-library

0.0.1 • Public • Published

Hamis UI components built with Angular2

This repo runs npm test before each git push action

To successfully install this component library on your local machine make sure you have the following configuration in your ~/.npmrc file

registry=https://nexus3.hamis.nl/repository/npm-all
npm install hamis-ui-library --save

Note on dependencies version 0.0.0-214 and higher

version 0.0.0-214 and higher will not support full dependencies anymore

You have to manage the dependencies of third party libraries yourself. Add this as dependencies to your project (as proposed by Angular project and the peerDependencies of hamis-ui-library):

{
  "dependencies": {
    "@angular/common": "4.0.0",
    "@angular/compiler": "4.0.0",
    "@angular/core": "4.0.0",
    "@angular/forms": "4.0.0",
    "@angular/http": "4.0.0",
    "@angular/platform-browser": "4.0.0",
    "@angular/platform-browser-dynamic": "4.0.0",
    "@angular/router": "4.0.0",
    "angular-in-memory-web-api": "0.3.0",
    "systemjs": "0.19.40",
    "core-js": "2.4.1",
    "rxjs": "5.0.1",
    "zone.js": "0.8.4"
  }
}

It's also very important to have version 3 or higher of npm so that the project can use peerDependencies. npm install -g npm

importing as ngModule

app.module.ts (don't forget FormsModule!)

import {NgModule}      from "@angular/core";
import {BrowserModule} from "@angular/platform-browser";
import {FormsModule} from "@angular/forms";

import {AppComponent}  from "./app.component";

import {HamisComponentsModule} from "hamis-ui-library/components";

@NgModule({
  imports: [BrowserModule, FormsModule, HamisComponentsModule.forRoot()],
  declarations: [AppComponent],
  bootstrap: [AppComponent]
})
export class AppModule {
}

Developing components

hamis-ui-library repo is also a place where you can develop and add new components. This repo can be built and served as a web server for demo purposes.

The app folder contains the application and NPM published components source codes. components.ts is a index file where we export all the components we want to publish.

Start to develop (see package.json)

npm start

Start to test while developing (see package.json). This is a unit-level testing.

npm test:watch
npm test #is used for CI test

E2E Testing description will come soon...

Components README.md

Remember to write a README.md file for each component you build.

Requirements:

  • Write enough HTML markup examples which explains how to implement the component
  • Describe the attributes and it's type and purposes.

This documentation style is heavily inspired by Angular2 Material https://github.com/angular/material2/tree/master/src/components/button

Example Component Documentation

Callout component

<callout class="glyphicon glyphicon-info-sign text-success">
    <callout-content>
        <!-- some angular2 component -->
    </callout-content>
</callout>

<!-- OR -->

<HTMLTag data-callout>
    <callout-content>
        <!-- some angular2 component -->
    </callout-content>
</HTMLTag>

Styling

add a class to the callout component tag like the example above.

Accessibility

  • As callout is added to an existing button or a tag, it enjoys all the accessibility natively built into these elements.

API Summary

Properties:

Name Type Description
title string The title of the callout
direction `"left" "right"

Readme

Keywords

none

Package Sidebar

Install

npm i tlimpanont-hamis-ui-library

Weekly Downloads

1

Version

0.0.1

License

none

Last publish

Collaborators

  • tlimpanont