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

@studyportals/multiselect

v4.2.0

Published

A multiselect input component for use in Vue3 based micro-frontends.

Downloads

5,020

Readme

Multiselect

Studyportals MultiSelect is a multiselect input component for use in Vue3 based micro-frontends.

Table of Contents

Setup & commands

The following commands can be used to setup and build the package. Also, we're using husky to run unit tests before a git push is done. This could be by-passed (if absolutely necessary) by running git push --no-verify.

# install dependencies
npm install

# publish the package to npm
npm publish

# build the package for local testing
npm run build

# run linter
npm run lint
npm run lint:fix # with fix

# run unit tests
npm run unit

External dependencies

Linear icons

The AuthenticationService displays multiple icons from the linear iconset. The URL's for the set can be provided by the UX team.

Vue-Config

vue-config is a DLL package that is used by the AuthenticationService for several Vue.js related packages. It can be loaded from the jsdelivr.net CDN.

Including MultiSelect in your project

MultiSelect is a DLL supported component. This means that you should install it's DLL package and then reference the DLL in the build setup of the project that is integrating it.

npm install @studyportals/multiselect-dll
dllPackages: [
	{
		name: "multiselect-dll",
		manifest: require("@studyportals/multiselect-dll/dist/multiselect.json")
	}
]

When running your project outside of a portal environment you will need to include the multiselect-dll bundle from our CDN:

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@studyportals/multiselect-dll@version/dist/multiselect.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@studyportals/multiselect-dll@version/dist/multiselect.min.css">

Then you will be able to import MultiSelect in your component files:

import { MultiSelect } from "@studyportals/multiselect";

And import MultiSelect styling in your component files:

@import '~@studyportals/multiselect/dist/style.css';

Properties

MultiSelect has a lot of properties that can be configured in order to control styling and behaviour.

options : IOption

Default value: []

An array of available options to be selected.

groups : IOptionGroup[]

Default value: []

An array of grouped options to be selected.

label : string

Default value: "Label"

A custom label for the input.

placeholder : string

Default value: "Select an option"

A placeholder text that is shown when multipleOptions is set to true and the user has already selected one or more options.

entity : string

Default value: ""

The singular name of the entity represented in the selectbox. This will be used for display purposes like the placeholder in the search input.

validationLabel : string

Default value: ""

The text that is displayed in the validation message.

helperMessage : string

Default value: ""

Some text that will be displayed as a helper message right under the MultiSelect box.

multipleOptions : boolean

Default value: false

This value determines whether or not a user should be able to select multiple options.

searchable : boolean

Default value: false

This value determines whether the options will be searchable with a search input.

disabled : boolean

Default value: false

This value determines whether the selectbox will be disabled.

valid : boolean

Default value: true

This value determines if the selectbox should be displayed in an invalid state.

Events

The MultiSelect component emits the following events:

updated: IOption | IOption[]

updated is emitted when the users selects a new option within the MultiSelect instance. The payload contains the currently selected option or all currently selected options in case multiple options may be selected.

Public methods & properties

MultiSelect exposes a couple of public methods and properties which can be accessed by adding a ref property to your Multiselect instance like so:

<MultiSelect
	ref="myMultiSelectInstance"
	:options="options"
/>

selectOption(option: IOption)

selectOption is a method that can be used to (pre)select an option in the MultiSelect instance. The internal update loop will be triggered when using this method to prefill a MultiSelect instance.

this.$refs.myMultiSelectInstance["selectOption"]({
	label: "myLabel",
	value: "myValue"
})

selectedOption: IOption | null

selectedOption is a property that has the currently selected option as a value.

this.$refs.myMultiSelectInstance["selectedOption"];

selectedOptions: IOption[]

selectedOptions is a property that has all of the currently selected options as a value.

this.$refs.myMultiSelectInstance["selectedOptions"];

Interfaces

MultiSelect uses the following interface:

interface IOption {
	label: string,
	value: any,
	icon?: string
}

interface IOptionGroup {
	label: string,
	options: IOption[]
}