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 🙏

© 2025 – Pkg Stats / Ryan Hefner

solidpepper-search-v17

v1.8.4

Published

Ce composant a pour but d'être modulaire pour être implémenté sur Nude et sur les B2B des clients de Solidpepper. Auteur : Nicolas Delahaie

Downloads

24

Readme

Ce composant a pour but d'être modulaire pour être implémenté sur Nude et sur les B2B des clients de Solidpepper.
Auteur : Nicolas Delahaie

Mise en place

ngx-translate

Pour fonctionner correctement, ngx-translate a besoins des traductions des différentes clés. Il faut alors les recopier pour les 3 langues présentes :

Anglais

"modal_search": {
  "search_error": "An error occurred during the search",
  "suggestions": "SUGGESTIONS",
  "categories": "CATEGORIES",
  "no_category": "No category",
  "no_result": "No exact match found",
  "extend_search": "Extend search via AI",
  "semantic_disabled": "Semantic search (by AI) is currently disabled. Please try again later."
}

Espagnol

"modal_search": {
  "search_error": "Se produjo un error durante la búsqueda",
  "suggestions": "SUGERENCIAS",
  "categories": "CATEGORÍAS",
  "no_category": "Sin categoría",
  "no_result": "No se encontraron coincidencias exactas",
  "extend_search": "Ampliar búsqueda mediante IA",
  "semantic_disabled":"La búsqueda semántica (por IA) está desactivada por el momento. Por favor, inténtelo de nuevo más tarde."
}

Français

"modal_search": {
  "search_error": "Une erreur est survenue lors de la recherche",
  "suggestions": "SUGGESTIONS",
  "categories":"CATEGORIES",
  "no_category":"Aucune catégorie",
  "no_result":"Aucune correspondance exacte trouvée",
  "extend_search":"Elargir la recherche via IA",
  "semantic_disabled": "La recherche sémantique (par IA) est désactivée pour le moment. Veuillez réessayer plus tard."
}

Resultats possibles

La modale peut retourner 5 differents types de resultats, chacun accompagné de ses propre données (typées) :

  • "VALIDATED_SEARCH"
  • "CLICKED_SKU"
  • "CLICKED_CATEGORY"
  • "PROPS_ERROR"
  • undefined, si la popup est fermée autrement

Prérequis

// Imports
import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
import {
  SolidpepperSearchComponent,
  SolidpepperSearchProps,
  TResponse,
} from 'solidpepper-search-v17';

// ...
// Injection de MatDialog dans le composant souhaitant utiliser la modal
constructor(public dialog: MatDialog) {}

Parametres de la modal

Le typage typescript est important car il donne accès aux differents paramètre obligatoires et facultatifs, ainsi que leurs explications. Utiliser CTRL + espace lorsqu'on est dans l'objet pour avoir accès aux differents parametres sur VSCode.
Il existe deux differents configurations necessaires à l'ouverture de la modal ; celle de la MatDialog et celle du composant appelé par la MatDialog.

const data: SolidpepperSearchProps = {
  // Typage fournit par typescript
};

const dialogConfig: MatDialogConfig = {
  // Typage fournit par typescript
};

Exemple d'utilisation

Ouverture via un callback "openDialog()", déclenché par l'utilisateur

openDialog(): void {
  const data: SolidpepperSearchProps = {
    url : 'https://localhost:44322/api/',
    token: "Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    lang: "fr",
    unavailableImagePath: "./assets/img/picture-unavailable.png",
    platform: "nude",
  };

  const dialogConfig: MatDialogConfig = {
    maxWidth: "80vw",
    width: "100%",
    height: "fit-content",
  };

  const dialogRef = this.dialog.open(SolidpepperSearchComponent, {
    ...dialogConfig,
    data,
  });

  dialogRef.afterClosed().subscribe((result: TResponse) => {
      console.log('The dialog was closed', result);
      // Traitement après fermeture de la popup
      switch (result?.type) {
        // Utilisation des autres donnees de result, propres aux types
        case 'VALIDATED_SEARCH':
          break;
        case 'CLICKED_CATEGORY':
          break;
        case 'CLICKED_SKU':
          break;
        case 'PROPS_ERROR':
          break;
        case undefined:
          break;
      }
    });
}