Go to file
Michał Sieciechowicz 2a8d0269b8 initial commit 2025-08-01 19:34:19 +02:00
.angular/cache/20.1.3/ng-packagr initial commit 2025-08-01 19:34:19 +02:00
src initial commit 2025-08-01 19:34:19 +02:00
README.md initial commit 2025-08-01 19:34:19 +02:00
angular.json initial commit 2025-08-01 19:34:19 +02:00
ng-package.json initial commit 2025-08-01 19:34:19 +02:00
package.json initial commit 2025-08-01 19:34:19 +02:00
tsconfig.lib.json initial commit 2025-08-01 19:34:19 +02:00
tsconfig.lib.prod.json initial commit 2025-08-01 19:34:19 +02:00
tsconfig.spec.json initial commit 2025-08-01 19:34:19 +02:00

README.md

@ngshack/input

Biblioteka komponentów input i nawigacji dla aplikacji Webland z obsługą gamepadów.

Instalacja

npm install @ngshack/input

Development

Prerequisites

  • Node.js 18+
  • Angular CLI 17+

Setup

npm install

Generate Components

# Generate new component
ng generate component components/my-component --project=input

# Generate service
ng generate service services/my-service --project=input

# Generate module
ng generate module modules/my-module --project=input

Build Library

ng build input

Test

ng test input

Publish

npm run build:libs
npm publish dist/input

Usage

Navigation Module

import { NavigationModule } from '@ngshack/input';

@Component({
  imports: [NavigationModule],
  template: `
    <div inputActionBinding="confirm" (action)="onConfirm()">
      <button>Confirm</button>
    </div>
  `
})
export class MyComponent {
  onConfirm() {
    console.log('Confirmed!');
  }
}

Action Binding Directive

import { ActionBindingDirective } from '@ngshack/input';

@Component({
  imports: [ActionBindingDirective],
  template: `
    <div inputActionBinding="back" (action)="goBack()">
      Back Button
    </div>
  `
})
export class MyComponent {
  goBack() {
    // Handle back action
  }
}

Features

  • 🎮 Gamepad support
  • ⌨️ Keyboard navigation
  • 🖱️ Mouse/touch support
  • 🎯 Action binding system
  • 📱 Responsive design
  • 🎨 Gaming console theme

Publishing the Library

Once the project is built, you can publish your library by following these steps:

  1. Navigate to the dist directory:

    cd dist/input
    
  2. Run the npm publish command to publish your library to the npm registry:

    npm publish
    

Running unit tests

To execute unit tests with the Karma test runner, use the following command:

ng test

Running end-to-end tests

For end-to-end (e2e) testing, run:

ng e2e

Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.

Additional Resources

For more information on using the Angular CLI, including detailed command references, visit the Angular CLI Overview and Command Reference page.