@zanichelli/zanichelli-appswitcher
TypeScript icon, indicating that this package has built-in type declarations

1.1.7 • Public • Published

Zanichelli AppSwitcher Component

Use this component to allow a user to easily navigate between Zanichelli's web applications.

Installation

Download the package by running yarn add @zanichelli/zanichelli-appswitcher

or import it in your html using Unpkg:

<script type="module" src="https://unpkg.com/@zanichelli/zanichelli-appswitcher"></script>

Albe Web Components dependency

This component requires the Albe Web Components Library. To get Albe you can:

  • install it via NPM by running yarn add @zanichelli/albe-web-components
  • include it in your app inside a script tag:
<script type="module" src="https://unpkg.com/@zanichelli/albe-web-components/dist/web-components-library/web-components-library.esm.js"></script>

Remember to also include the stylesheet:

<link type="text/css" rel="stylesheet" href="https://unpkg.com/@zanichelli/albe-web-components/www/build/web-components-library.css" />

Using custom elements

import { defineCustomElements as defineAlbeComponents, applyPolyfills } from '@zanichelli/albe-web-components/loader';
import { defineCustomElements as defineZanichelliAppswitcher } from '@zanichelli/zanichelli-appswitcher/dist/wc/loader';

applyPolyfills().then(() => {
  defineAlbeComponents();
  defineZanichelliAppswitcher();
});

return <zanichelli-appswitcher></zanichelli-appswitcher>;

Using React Bindings

import { ZanichelliAppswitcher } from '@zanichelli/zanichelli-appswitcher/dist/react';

return <ZanichelliAppswitcher/>;

Development

  • Download the repo using git clone git@bitbucket.org:zanichelli/zanichelli-appswitcher.git
  • In the project's root folder, run yarn inst
  • cd into your web-component-library folder, then run yarn build and yarn start

If you need to work with a local copy of the Albe Web Components Library:

  • Download the Albe repo using git clone git@github.com:ZanichelliEditore/design-system.git
  • In the root folder of this new project, run yarn build and then yarn link
  • In your zanichelli-appswitcher project, uncomment the import in web-component-library/src/components/zanichelli-appswitcher/zanichelli-appswitcher.tsx

To use the cookie lastVisitedHosts locally

  • add in your own file /etc/hosts 127.0.0.1 app-switcher.zanichelli.it

Testing

You can launch the available tests using yarn test.


Props & Slots

This component accepts the following props:

  • current-host: custom host name to be registered if the default is misleading.
  • env-type: defines the usage environment to retrieve the config.json, available values local, staging, production, admin, localadmin
  • user-object: the user's data as retrieved from a valid Zanichelli IDP token
  • config-object: appswitcher configuration in JSON format (needed for the configurator app)
  • offcanvas-open: whether the offcanvas should start in an already opened state (needed for the configurator app)
  • offcanvas-type: what variant of z-offcanvas should be used (needed for the configurator app)

Readme

Keywords

none

Package Sidebar

Install

npm i @zanichelli/zanichelli-appswitcher

Weekly Downloads

214

Version

1.1.7

License

MIT

Unpacked Size

650 kB

Total Files

183

Last publish

Collaborators

  • cmalvispx
  • veronica.van
  • developers_zanichelli
  • oleksandroleksyuk
  • alessandramartera
  • alessandro_zuddas
  • veronicavannini
  • francescochiapella
  • alegiua
  • f.santi
  • ooga9k
  • davideda
  • leonardogiaconemondora
  • nicolo.carpignoli
  • alessandrodolci
  • amalferpoma
  • edocava
  • a-sartori-wt
  • mikelina
  • nitroin
  • saldomik
  • alicegambella
  • vpasquino
  • dariosacco
  • paolofrancesco-marino
  • gretalucchina