npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ng-golden-layout

v0.0.1

Published

Angular bindings for golden-layout

Downloads

6

Readme

ng-golden-layout

Angular 2.4.x Compatible

Installation

To install this library and golden-layout peerDependency, run:

$ npm install @goldsam/ng-golden-layout golden-layout --save
$ npm install @types/jquery --save-dev

Examples

First, import the GoldenLayoutModule into your root AppModule

import {GoldenLayoutModule} from 'angular2-hotkeys';

Then, add GoldenLayoutModule.forRoot() to your AppModule's import array

@NgModule({
    imports : [CommonModule, GoldenLayoutModule.forRoot(), ...],
})
export class AppModule {}

If you have any sub/feature modules that also use hotkeys, import the GoldenLayoutModule (but NOT .forRoot())

@NgModule({
    imports : [CommonModule, GoldenLayoutModule, ...],
})
export class SharedModule {}

Then inject the service into your constructor and add a new hotkey

constructor(private _hotkeysService: HotkeysService) {
    this._hotkeysService.add(new Hotkey('meta+shift+g', (event: KeyboardEvent): boolean => {
        console.log('Typed hotkey');
        return false; // Prevent bubbling
    }));
}

It also handles passing an array of hotkey combinations for a single callback

this._hotkeysService.add(new Hotkey(['meta+shift+g', 'alt+shift+s'], (event: KeyboardEvent, combo: string): ExtendedKeyboardEvent => {
    console.log('Combo: ' + combo); // 'Combo: meta+shift+g' or 'Combo: alt+shift+s'
    let e: ExtendedKeyboardEvent = event;
    e.returnValue = false; // Prevent bubbling
    return e;
}));

Your callback must return either a boolean or an "ExtendedKeyboardEvent".

For more information on what hotkeys can be used, check out https://craig.is/killing/mice

This library is a work in progress and any issues/pull-requests are welcomed! Based off of the angular-hotkeys library

Golden Layout Root

To enable the cheat sheet, simply add <hotkeys-cheatsheet></hotkeys-cheatsheet> to your top level component template. The HotkeysService will automatically register the ? key combo to toggle the cheat sheet.

Cheat Sheet Customization

  1. You can now pass in custom options in HotkeysModule.forRoot(options: IHotkeyOptions).
export interface IHotkeyOptions {
  /**
   * Disable the cheat sheet popover dialog? Default: false
   */
  disableCheatSheet?: boolean;
  /**
   * Key combination to trigger the cheat sheet. Default: '?'
   */
  cheatSheetHotkey?: string;
  /**
   * Description for the cheat sheet hot key in the cheat sheet. Default: 'Show / hide this help menu'
   */
  cheatSheetDescription?: string;
};
  1. You can also customize the title of the cheat sheet component.
<hotkeys-cheatsheet title="Hotkeys Rock!"></hotkeys-cheatsheet>
<!-- Default: 'Keyboard Shortcuts:' -->

TODO

  1. Create unit and E2E tests

Development

To generate all * }.js, *.js.map and *.d.ts files:

$ npm run tsc

License

MIT © Sam Goldmann