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

@tp-ui/tp-window

v0.2.0

Published

# Features

Downloads

12

Readme

ThingsPro Window

Features

Usages

1. Create a tp-window state config or write a config in template directly.

Example: create a config

const tpStateConfig: TpWindowStateConfig = new TpWindowStateConfig('stateId', 'stateName', 'STATE', 'settings');

Example: write config in template files.

<tp-window-state stateId="demoState" name="{{Demo State}}" type="CONTENT" icon="settings">  
</tp-window-state>

2. Setup tp-window

Notice: tp-window id and tp-window-state config is required.

<tp-window [name]="name" maxStateNumber="3" id="tpDemoId" [optionPortal]="portal" (stateChange)="onStateChange($event)">
  <tp-window-state [config]="tpStateConfig">
    <!-- Your DOM template -->
  <tp-window-state>
</tp-window>

3. Inject TpWindowService to manipulate your states.

constructor(public tpWindow: TpWindowService) {}
// Navigate a window to a state
this.tpWindow.navigateTo('windowId.stateId'); // windowId + '.' + stateId

// Show or hide progress bar
this.tpWindow.progressStart('tpDemoId');
this.tpWindow.progressComplete('tpDemoId');

// Show or hide state icon
this.tpWindow.setIcons([{stateUrl: 'tpDemoId.stateId',isShow: false}, {stateUrl: 'tpDemoId.stateId',isShow: false}]);

API Document

tp-window (TpWindowComponent)

| Property | Type | Description | | -------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | *windowId | @Input string | The identification for window | | name | @Input string | The name will be showed on the title of component. | | maxStateNumber | @Input number | Limit the total number of icons on the tool bar. The rest of icons will be sorted to menu list as the number of icons exceeds it. This setting could be used to RWD. | | loading | @Input Observable<any> | It Will show a loading bar before observable completed. | | optionPortal | @Input Portal<any> | Add customized actions or information by using CdkPortal | | stateChange | @Output EventEmitter<WindowStateComponent> | emit clicked state component. |

tp-window-state (TpWindowStateComponent)

| Property | Type | Description | | -------- | ---------------------------- | ------------- | | *config | @input TpWindowStateConfig | State config. |

TpWindowStateConfig

| Property | Type | Description | | -------- | ------------------- | ---------------------------------------------------------------------------------------- | | stateId | string | The identification for state. | | name | string | The name will be showed on the menu item or tooltip. | | type | TpWindowStateType | 'ACTION' 'STATE' 'CONTENT' | | icon | string | The name of Angular Material Icon ,please see Icons |

TpWindowService

| Methods | Description | | --------------------------------------------------------------- | ---------------------------- | | navigateTo(stateUrl: string) | Navigate a state of a window | | progress(windowId: string, progress: Observable<any>) | Show progress bar | | progressStart(windowId: string) | Show progress bar | | progressComplete(windowId: string) | Hide progress bar | | setIcons(options: Array<{stateUrl: string, isShow: boolean}>) | Hide a icon of a state |