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

up-window-angular

v0.8.1

Published

An Angular library designed to create dynamic, customizable windows and window-based components for web applications. With a simple and intuitive API, UpWindow enables developers to easily integrate responsive windows, popups, floating windows, and drawer

Downloads

126

Readme

up-window-angular

An Angular library designed to create dynamic, customizable windows and window-based components for web applications. With a simple and intuitive API, UpWindow enables developers to easily integrate responsive windows, popups, floating windows, and drawers into their projects. It provides full control over window size, position, animations, and behavior, offering a flexible solution for creating engaging user interfaces.

Install

npm install up-window-angular

Usage Example

import { Component } from '@angular/core';
import { signal, WritableSignal } from 'signals';
import UpWindowAngularModule from 'up-window-angular';

@Component({
  selector: 'app-window-example',
  templateUrl: './window-example.component.html',
})
export class WindowExampleComponent {
  isWindowOpenExample: WritableSignal<boolean> = signal(false);

  openWindowExample() {
    this.isWindowOpenExample.set(true);
  }
}

HTML Template

<button class="button-window-example" type="button" (click)="openWindowExample()">
  Open Window Example
</button>

<up-window-angular
  [isOpen]="isWindowOpenExample"
  title="Window Title"
  subtitle="This is the subtitle of the window."
>
  Window Example content!
</up-window-angular>

Component Setup

  • In the WindowExampleComponent, a WritableSignal<boolean> named isWindowOpenExample is defined, initialized to false.
  • The openWindowExample method sets isWindowOpenExample to true, which opens the window.

Inputs

  • @Input() title!: string;

    • Example: Set the title of the window.
    <up-window-angular title="My Custom Title" />
  • @Input() subtitle!: string;

    • Example: Set the subtitle of the window.
    <up-window-angular subtitle="This is a custom subtitle" />
  • @Input() class: string | undefined;

    • Example: Add custom CSS classes.
    <up-window-angular class="custom-window-class" />
  • @Input() isOpen: WritableSignal<boolean> = signal(false);

    • Example: Control the visibility of the window.
    this.isWindowOpenExample.set(true); // Opens the window
  • @Input() animation: string = 'fade';

    • Example: Set a different animation type.
    <up-window-angular animation="slide" />
  • @Input() restrictMode: boolean = false;

    • Example: Enable restricted mode.
    <up-window-angular restrictMode="true" />
  • @Input() fullScreen: boolean = false;

    • Example: Enable fullscreen mode for the window.
    <up-window-angular [fullScreen]="true" />
  • @Input() drawer: 'left' | 'right' | 'top' | 'bottom' = 'left';

    • Example: Set the position of the drawer when in drawer mode.
    <up-window-angular drawer="right" />
  • @Input() confirmText: string = 'Confirm';

    • Example: Customize the confirm button text.
    <up-window-angular confirmText="Agree" />
  • @Input() cancelText: string = 'Cancel';

    • Example: Customize the cancel button text.
    <up-window-angular cancelText="Dismiss" />
  • @Input() confirmType: string = 'primary';

    • Example: Set the style of the confirm button.
    <up-window-angular confirmType="success" />
  • @Input() cancelType: string = 'default';

    • Example: Set the style of the cancel button.
    <up-window-angular cancelType="danger" />
  • @Input() buttonAlignment: 'start' | 'end' | 'center' = 'end';

    • Example: Align the buttons to the center.
    <up-window-angular buttonAlignment="center" />
  • @Input() onConfirmClick: () => void = () => this.onConfirm();

    • Example: Custom confirm action.
    onConfirm() {
      console.log('Confirmed!');
    }
  • @Input() onCancelClick: () => void = () => this.onCancel();

    • Example: Custom cancel action.
    onCancel() {
      console.log('Cancelled!');
    }
  • @Input() hiddenActions: boolean = false;

    • Example: Control the visibility of action buttons (confirm and cancel). When set to true, the action buttons will not be displayed.
    <up-window-angular [hiddenActions]="true" />
  • @Input() blur: boolean = false;

    • Example: Enable blur effect for the window.
    <up-window-angular [blur]="true" />
  • @Input() grayscale: boolean = false;

    • Example: Enable grayscale effect for the window.
    <up-window-angular [grayscale]="true" />

Outputs

  • @Output() confirm = new EventEmitter<void>();

    • Example: Emit an event when confirm is clicked.
    this.confirm.subscribe(() => {
      console.log('Confirmed action triggered');
    });
  • @Output() cancel = new EventEmitter<void>();

    • Example: Emit an event when cancel is clicked.
    this.cancel.subscribe(() => {
      console.log('Cancel action triggered');
    });

ng-content for Custom Footer

You can project custom content into the footer of the up-window-angular component using ng-template. This allows for more flexible designs in your window. Here’s how to use it:

Example of Custom Footer

<up-window-angular
  [isOpen]="isWindowOpenExample"
  title="Window Title"
  subtitle="This is the subtitle of the window."
>
  Window Example content!

  <ng-template footer>
    <button class="custom-btn" (click)="isWindowOpenExample.set(false)">
      Close
    </button>
    <span>Custom footer content!</span>
  </ng-template>
</up-window-angular>