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

eca-select-entities

v1.1.0

Published

Component to select multiple entities in Ex Libris Cloud Apps

Downloads

1

Readme

Select Entities

Reusable components for Ex Libris Cloud Apps to select one or multiple entities visible on the current Alma screen.

Installation

$ npm install eca-select-entities --save

In app.module.ts:

import { SelectEntitiesModule } from 'eca-select-entities';

...

@NgModule({
  imports: [
  ...
    SelectEntitiesModule,
  ],

Select Entities

The select entities component supports multiple selection. Features include:

  • Display description of page entities
  • Check/uncheck all
  • Selection across multiple pages in Alma

Select Entities Component

Use the select entities component in your own component as follows.

Add an array to collect selected entities in your component.ts:

selectedEntities = new Array<Entity>();

In your component.html page, add a reference to the component and the array:

  <eca-select-entities
    [(selected)]="selectedEntities"
    >
  </eca-select-entities>

Select Entity

The select entity component supports selecting a single entity. Features include:

  • Display description of page entities
  • Radio buttons to select a single entity

Select Entity Component

Use the select entities component in your own component as follows.

Add an array to collect selected entities in your component.ts:

selectedEntity: Entity = null;

In your component.html page, add a reference to the component and the array:

<eca-select-entity
  [(selected)]="selectedEntity"
  >
</eca-select-entities>

Other methods

Both components also support the following properties/methods: clear Clears all selected items:

  @ViewChild(SelectEntitiesComponent) selectEntitiesComponent: SelectEntitiesComponent;

  clear() {
    this.selectEntitiesComponent.clear();
  }

count Count of entities:

<eca-select-entities #selectEntities
  [(selected)]="selectedEntities"
  >
</eca-select-entities>
<p *ngIf="selectEntities.count == 0">Please navigate to a screen with entities.</p>

entityTypes Filter the entity types to be displayed:

<eca-select-entities #selectEntities
  [(selected)]="selectedEntities"
  [entityTypes]="['BIB_MMS']"
  >
</eca-select-entities>

entities$ Provide an observable of entities which overrides the entities displayed on the Alma screen.

In this example, we're retrieving all of the displayed and limiting to those created by the current user: component.ts:

  entities$ = this.eventsService.entities$.pipe(
    tap(() => this.loading = true),
    mergeMap(entities => 
      combineLatest([
        of(entities),
        this.eventsService.getInitData(),
        forkJoin(entities.map(e => this.restService.call(e.link)))
          .pipe(defaultIfEmpty([]))
      ])
    ),
    map(([entities, initData, full]) => {
      const relevant = full.filter(f => f.created_by.value == initData.user.primaryId).map(f=>f.id);
      return entities.filter(e => relevant.includes(e.id));
    }),
    tap(() => this.loading = false)
  )

component.html:

<eca-select-entities #selectEntities
  [(selected)]="selectedEntities"
  [entityTypes]="['SET']"
  [entities$]="entities$"
  >
</eca-select-entities>