GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - some-angular-utils/modal

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.vscode
.vscode
 
 
projects/some-angular-utils/modal
projects/some-angular-utils/modal
 
 
public
public
 
 
src
src
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.postcssrc.json
.postcssrc.json
 
 
CLAUDE.md
CLAUDE.md
 
 
README.md
README.md
 
 
angular.json
angular.json
 
 
bun.lock
bun.lock
 
 
package.json
package.json
 
 
tsconfig.app.json
tsconfig.app.json
 
 
tsconfig.json
tsconfig.json
 
 
tsconfig.spec.json
tsconfig.spec.json
 
 

Repository files navigation

@some-angular-utils/modal

github stars

NPM Version NPM Downloads

npm bundle size npm bundle size


NPM


DEMO

This repo ships with an interactive showcase app — every feature has a live, editable example (edit the code, open the dialog). Run it locally:

npm install
npm run dev

Then open http://localhost:4200.

IMPORT

import { SAUModalService } from '@some-angular-utils/modal';

The library doesn't ship a dialog component — open() takes any component of your own (standalone, injecting ModalRef if it needs to close/dismiss itself):

import { Component, Input, inject } from '@angular/core';
import { ModalRef } from '@some-angular-utils/modal';

@Component({ selector: 'app-confirm-dialog', template: `...` })
export class ConfirmDialogComponent {
  @Input() name = '';
  @Input() entity = 'item';

  private modalRef = inject<ModalRef<ConfirmDialogComponent>>(ModalRef);

  confirm(): void { this.modalRef.close(true); }
  cancel(): void { this.modalRef.dismiss(false); }
}

TYPESCRIPT

private sauModalService = inject(SAUModalService);

deleteCompany(company: Company) {
  const modalRef = this.sauModalService.open(ConfirmDialogComponent, {});
  modalRef.componentInstance.name = company.name;
  modalRef.componentInstance.entity = 'Company';

  modalRef.result.then(
    () => this.removeFromList(company.id), // confirmed
    () => {},                              // cancelled
  );
}

OPTIONS

this.sauModalService.open(ConfirmDialogComponent, {
  size: 'lg',        // 'sm' | 'md' | 'lg', defaults to 'md'
  backdrop: 'static', // true | false | 'static' — 'static' keeps it open on outside click
  keyboard: false,    // whether Escape dismisses it, defaults to true
});

COLORS

sau-modal {
    --sau-color-primary: rgb(147, 51, 234);
    --sau-color-background: rgb(255, 255, 255);
    --sau-color-text: rgb(31, 41, 55);
}

These custom properties cascade from <sau-modal> down into whatever component you open, so your own component's styles can reference them too (e.g. var(--sau-color-background, #fff)).

About

some-angular-utils.github.io/modal/

Topics

angularangular-componentmodal

Resources

Readme
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.