4.2.0 • Published 2 months ago

@studyportals/multiselect v4.2.0

Weekly downloads
18
License
ISC
Repository
-
Last release
2 months ago

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[]
}
4.2.0-beta.4

2 months ago

4.2.0-beta.5

2 months ago

4.2.0

2 months ago

4.2.0-beta.3

3 months ago

4.2.0-1

3 months ago

4.2.0-0

3 months ago

4.2.0-beta.2

4 months ago

4.2.0-beta.1

4 months ago

4.2.0-beta.0

4 months ago

4.1.4

10 months ago

4.1.2-2

2 years ago

4.1.2-3

2 years ago

3.2.2

1 year ago

3.2.0

2 years ago

4.1.2-0

2 years ago

4.1.2-1

2 years ago

4.1.3-beta.0

2 years ago

4.1.0-beta.0

2 years ago

3.2.1-beta.4

1 year ago

3.2.1-beta.3

1 year ago

3.2.1-beta.5

1 year ago

3.2.1-beta.0

2 years ago

3.2.1-beta.2

1 year ago

3.2.1-beta.1

2 years ago

4.1.3

2 years ago

4.1.0

2 years ago

4.1.2

2 years ago

4.1.1

2 years ago

4.0.7-1

2 years ago

4.0.5

2 years ago

4.0.4

2 years ago

4.0.7

2 years ago

3.1.3-14

2 years ago

4.0.6

2 years ago

3.1.3-13

2 years ago

4.0.1

2 years ago

3.1.3-12

2 years ago

4.0.0

2 years ago

4.0.3

2 years ago

4.0.2

2 years ago

3.1.3-19

2 years ago

3.1.3-18

2 years ago

3.1.3-17

2 years ago

3.1.3-27

2 years ago

3.1.3-26

2 years ago

3.1.3-25

2 years ago

3.1.3-24

2 years ago

3.1.3-20

2 years ago

3.1.3-29

2 years ago

3.1.3-28

2 years ago

3.1.3-30

2 years ago

3.1.3-38

2 years ago

3.1.3-37

2 years ago

3.1.3-36

2 years ago

3.1.3-35

2 years ago

3.1.3-34

2 years ago

3.1.3-33

2 years ago

3.1.3-31

2 years ago

3.1.3-39

2 years ago

3.1.3-41

2 years ago

3.1.3-40

2 years ago

3.1.3-49

2 years ago

3.1.3-48

2 years ago

3.1.3-47

2 years ago

3.1.3-46

2 years ago

3.1.3-45

2 years ago

3.1.3-44

2 years ago

3.1.3-43

2 years ago

3.1.3-42

2 years ago

4.0.1-0

2 years ago

3.1.3-52

2 years ago

3.1.3-51

2 years ago

3.1.3-50

2 years ago

3.1.3-58

2 years ago

3.1.3-57

2 years ago

3.1.3-56

2 years ago

3.1.3-5

2 years ago

3.1.3-7

2 years ago

3.1.3-6

2 years ago

3.1.3-63

2 years ago

3.1.3-62

2 years ago

3.1.3-69

2 years ago

3.1.3-68

2 years ago

3.1.3-67

2 years ago

3.1.3-66

2 years ago

3.1.3-65

2 years ago

3.1.3-64

2 years ago

4.0.0-0

2 years ago

4.0.0-3

2 years ago

4.0.0-1

2 years ago

4.0.0-2

2 years ago

3.2.0-beta.0

2 years ago

3.1.3-74

2 years ago

3.2.0-beta.1

2 years ago

3.1.3-73

2 years ago

3.1.3-72

2 years ago

3.1.1-3

2 years ago

3.1.1-2

2 years ago

3.1.1-1

2 years ago

3.1.1-0

2 years ago

3.1.1-7

2 years ago

3.1.1-6

2 years ago

3.1.1-5

2 years ago

3.1.1-4

2 years ago

3.1.1-9

2 years ago

3.1.1-8

2 years ago

3.1.2

2 years ago

3.1.1-10

2 years ago

3.1.1-11

2 years ago

3.1.1-12

2 years ago

3.1.3-1

2 years ago

3.1.3-0

2 years ago

3.1.3-4

2 years ago

3.1.3-2

2 years ago

3.1.0-0

2 years ago

3.1.0-1

2 years ago

3.1.0

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.5

2 years ago

2.2.4

2 years ago

3.0.0

2 years ago

2.2.0-8

2 years ago

2.2.0-7

2 years ago

2.2.0-6

2 years ago

2.2.0-5

2 years ago

2.2.0-11

2 years ago

2.2.0-10

2 years ago

2.2.0-13

2 years ago

2.2.0-0

2 years ago

2.2.0-15

2 years ago

2.2.0-4

2 years ago

2.2.0-2

2 years ago

2.2.0-16

2 years ago

3.0.0-beta.20

2 years ago

3.0.0-beta.21

2 years ago

3.0.0-beta.22

2 years ago

3.0.0-beta.23

2 years ago

3.0.0-beta.24

2 years ago

3.0.0-beta.25

2 years ago

3.0.0-beta.26

2 years ago

3.0.0-beta.27

2 years ago

3.0.0-beta.28

2 years ago

3.0.0-beta.29

2 years ago

3.0.0-beta.19

2 years ago

3.0.0-beta.14

2 years ago

3.0.0-beta.15

2 years ago

3.0.0-beta.16

2 years ago

3.0.0-beta.17

2 years ago

3.0.0-beta.18

2 years ago

3.0.0-beta.40

2 years ago

3.0.0-beta.30

2 years ago

3.0.0-beta.31

2 years ago

3.0.0-beta.32

2 years ago

3.0.0-beta.33

2 years ago

3.0.0-beta.34

2 years ago

3.0.0-beta.35

2 years ago

3.0.0-beta.36

2 years ago

3.0.0-beta.37

2 years ago

3.0.0-beta.38

2 years ago

3.0.0-beta.39

2 years ago

3.0.0-beta.1

2 years ago

3.0.0-beta.0

2 years ago

3.0.0-beta.3

2 years ago

3.0.0-beta.2

2 years ago

3.0.0-beta.5

2 years ago

3.0.0-beta.4

2 years ago

3.0.0-beta.7

2 years ago

3.0.0-beta.6

2 years ago

3.0.0-beta.9

2 years ago

3.0.0-beta.8

2 years ago

3.0.0-beta.11

2 years ago

3.0.0-beta.12

2 years ago

3.0.0-beta.13

2 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.0.2

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.1-beta.4

3 years ago

2.0.1-beta.2

3 years ago

2.0.1-beta.3

3 years ago

2.0.1-beta.1

3 years ago

2.0.0

3 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.0.0-beta.4

4 years ago

1.0.0-beta.5

4 years ago

1.0.0-beta.3

4 years ago

1.0.0-beta.2

4 years ago

1.0.0-beta.1

4 years ago

1.0.0-beta.0

4 years ago