# @dbp-toolkit/organization-select

> You can install this component via npm:

Latest version **0.2.4** (published 2022-04-05) · LGPL-2.1-or-later license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @dbp-toolkit/organization-select
pnpm add @dbp-toolkit/organization-select
yarn add @dbp-toolkit/organization-select
bun add @dbp-toolkit/organization-select
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2022-04-05 |
| First published | 2021-03-18 |
| Weekly downloads | 0 |
| License | LGPL-2.1-or-later |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 2.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | lazka, pbek, dbp-deploy |

## Links

- npm: https://www.npmjs.com/package/@dbp-toolkit/organization-select
- Repository: https://gitlab.tugraz.at/dbp/web-components/toolkit
- Homepage: https://gitlab.tugraz.at/dbp/web-components/toolkit/-/tree/master/packages/organization-select
- npm.io page: https://npm.io/package/@dbp-toolkit/organization-select

## Dependencies (6)

- [lit](https://npm.io/package/lit.md) ^2.0.0
- [jquery](https://npm.io/package/jquery.md) ^3.4.1
- [select2](https://npm.io/package/select2.md) ^4.0.10
- [@dbp-toolkit/auth](https://npm.io/package/@dbp-toolkit/auth.md) ^0.3.0
- [@dbp-toolkit/common](https://npm.io/package/@dbp-toolkit/common.md) ^0.3.0
- [@open-wc/scoped-elements](https://npm.io/package/@open-wc/scoped-elements.md) ^2.0.0

## Recent versions

- 0.2.4 (latest) — 2022-04-05
- 0.2.3 — 2021-06-16
- 0.2.2 — 2021-03-23
- 0.2.1 — 2021-03-22
- 0.2.0 — 2021-03-18

## README

# Organization Select Web Component

You can install this component via npm:

```bash
npm i @dbp-toolkit/organization-select
```

## Usage

```html
<dbp-organization-select></dbp-organization-select>
<script type="module" src="node_modules/@dbp-toolkit/organization-select/dist/dbp-organization-select.js"></script>
```

Or directly via CDN:

```html
<dbp-organization-select></dbp-organization-select>
<script type="module" src="https://unpkg.com/@dbp-toolkit/organization-select@0.2.2/dist/dbp-organization-select.js"></script>
```

## Attributes

- `lang` (optional, default: `de`): set to `de` or `en` for German or English
    - example `<dbp-organization-select lang="de"></dbp-organization-select>`
- `entry-point-url` (optional, default is the TU Graz entry point url): entry point url to access the api
    - example `<dbp-organization-select entry-point-url="http://127.0.0.1:8000"></dbp-organization-select>`
- `value` (optional): api path of organization to preload the selector with
    - example `<dbp-organization-select value="/base/people/testuser"></dbp-organization-select>`
    - the `value` will also be set automatically when an organization is chosen in the selector
- `context` (optional): the context of the returned organizations
    - example `<dbp-organization-select context="libray-manager"></dbp-organization-select>` returns all organizations
      where the current user is library manager
    - if no `context` is set all organizations are returned that are in a relation with the current user
- `data-object` (read-only): when an organization is selected the organization object will be set as json string
    - example `<dbp-organization-select data-object="{"@id":"/organizations/1190-F2050","@type":"http://schema.org/Organization","identifier":"1190-F2050","name":"Institut für Stahlbau","url":"https://online.tugraz.at/tug_online/wborg.display?pOrgNr=1190","alternateName":"F2050"}"></dbp-organization-select>`
- `auth` object: you need to set that object property for the auth token
    - example auth property: `{token: "THE_BEARER_TOKEN"}`
    - note: most often this should be an attribute that is not set directly, but subscribed at a provider

## Local development

```bash
# get the source
git clone git@gitlab.tugraz.at:dbp/web-components/toolkit.git
cd toolkit/packages/organization-select

# install dependencies
yarn install

# constantly build dist/bundle.js and run a local web-server on port 8002 
yarn run watch

# run tests
yarn test

# build local packages in dist directory
yarn run build
```

Jump to <http://localhost:8002> and you should get a Single Sign On login page.

---
_Source: https://npm.io/package/@dbp-toolkit/organization-select · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
