0.1.3 • Published 5 years ago

mlkms-common-ui v0.1.3

Weekly downloads
19
License
SEE LICENSE IN LI...
Repository
github
Last release
5 years ago

mlkms-common-ui

An Angular module for common ui.

Installation

npm install --save mlkms-common-ui

Usage

Add MlkmsCommonUiModule to your app module:

import { MlkmsCommonUiModule } from 'mlkms-common-ui';

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

Options

<mlkms-header>

Inputs

Property nameTypeDefaultDescription
toggleBtnPositionstringleftIndicate where the toogle button to trigger sidebar meny should be placed. Available values are left, right.
toggleButtonTemplateTemplateRefCustom UI for toggle button.
logoTemplateTemplateRefCustom UI for logo.
headerMenuTemplateTemplateRefCustom UI for header menu.
userProfileTemplateTemplateRefCustom UI for user profile.

In your app component, simply use add a <mlkms-header> element and add more templates if you want.

@Component({
  selector: 'app',
  template: `
    <mlkms-header
      [toggleBtnPosition]="'left'"
      [toggleButtonTemplate]="customToggleSidebar"
      [userProfileTemplate]="isLoggedIn ? userProfileTemplate : loginButton"
    >
    </mlkms-header>

    <ng-template #customToggleSidebar>
      <div class="hambuger-logo-wrapper" (click)="onHambugerButtonClick()">
        <img
          src="assets/img/hambuger.png"
          alt="Sidebar menu toggler"
          class="hambuger-logo"
          width="64"
          height="64">
      </div>
    </ng-template>
  `
})
class AppComponent {}

<mlkms-footer>

Inputs

Property nameTypeDefaultDescription
fixedbooleanfalseTo fix footer to the bottom of browser.

<mlkms-sidebar-menu>

Inputs

Property nameTypeDefaultDescription
openedbooleanfalseTo show or hide sidebar menu.
positionstringleftTo display and hide sidebar menu on the left or on the right of the screen. Available values are left, right.

<mlkms-login>

Outputs

Property nameTypeDefaultDescription
loginHandlerFunctionTo pass user info to external components when user logged in successfully.
0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago