svelte-multiselect 8.2.4 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,67 @@
1
+ <script>import { tick } from 'svelte/internal';
2
+ import { fade } from 'svelte/transition';
3
+ import Select from '.';
4
+ export let actions;
5
+ export let trigger = `k`;
6
+ export let fade_duration = 200; // in ms
7
+ let open = false;
8
+ let dialog;
9
+ let input;
10
+ async function toggle(event) {
11
+ if (event.key === trigger && event.metaKey && !open) {
12
+ // open on cmd+trigger
13
+ open = true;
14
+ await tick(); // wait for dialog to open and input to be mounted
15
+ input?.focus();
16
+ }
17
+ else if (event.key === `Escape` && open) {
18
+ // close on escape
19
+ open = false;
20
+ }
21
+ }
22
+ function close_if_outside(event) {
23
+ if (open && !dialog?.contains(event.target)) {
24
+ open = false;
25
+ }
26
+ }
27
+ function move(event) {
28
+ event.detail.option.action();
29
+ open = false;
30
+ }
31
+ </script>
32
+
33
+ <svelte:window on:keydown={toggle} on:click={close_if_outside} />
34
+
35
+ {#if open}
36
+ <dialog class:open bind:this={dialog} transition:fade={{ duration: fade_duration }}>
37
+ <Select
38
+ options={actions}
39
+ bind:input
40
+ placeholder="Go to..."
41
+ on:add={move}
42
+ on:keydown={toggle}
43
+ />
44
+ </dialog>
45
+ {/if}
46
+
47
+ <style>
48
+ :where(dialog) {
49
+ position: fixed;
50
+ top: 30%;
51
+ border: none;
52
+ padding: 0;
53
+ background-color: transparent;
54
+ display: flex;
55
+ color: white;
56
+ z-index: 10;
57
+ font-size: 2.4ex;
58
+ }
59
+ dialog :global(div.multiselect) {
60
+ --sms-bg: var(--sms-options-bg);
61
+ --sms-width: min(20em, 90vw);
62
+ --sms-max-width: none;
63
+ --sms-placeholder-color: lightgray;
64
+ --sms-options-margin: 1px 0;
65
+ --sms-options-border-radius: 0 0 1ex 1ex;
66
+ }
67
+ </style>
@@ -0,0 +1,21 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ actions: {
5
+ label: string;
6
+ action: () => void;
7
+ }[];
8
+ trigger?: string | undefined;
9
+ fade_duration?: number | undefined;
10
+ };
11
+ events: {
12
+ [evt: string]: CustomEvent<any>;
13
+ };
14
+ slots: {};
15
+ };
16
+ export type CmdPaletteProps = typeof __propDef.props;
17
+ export type CmdPaletteEvents = typeof __propDef.events;
18
+ export type CmdPaletteSlots = typeof __propDef.slots;
19
+ export default class CmdPalette extends SvelteComponentTyped<CmdPaletteProps, CmdPaletteEvents, CmdPaletteSlots> {
20
+ }
21
+ export {};
@@ -1,12 +1,12 @@
1
1
  <script>import { createEventDispatcher, tick } from 'svelte';
2
2
  import { flip } from 'svelte/animate';
3
- import CircleSpinner from './CircleSpinner.svelte';
3
+ import { CircleSpinner, Wiggle } from '.';
4
4
  import { CrossIcon, DisabledIcon, ExpandIcon } from './icons';
5
- import Wiggle from './Wiggle.svelte';
6
5
  export let activeIndex = null;
7
6
  export let activeOption = null;
8
- export let addOptionMsg = `Create this option...`;
7
+ export let createOptionMsg = `Create this option...`;
9
8
  export let allowUserOptions = false;
9
+ export let allowEmpty = false; // added for https://github.com/janosh/svelte-multiselect/issues/192
10
10
  export let autocomplete = `off`;
11
11
  export let autoScroll = true;
12
12
  export let breakpoint = 800; // any screen with more horizontal pixels is considered desktop, below is mobile
@@ -62,25 +62,30 @@ export let ulOptionsClass = ``;
62
62
  export let ulSelectedClass = ``;
63
63
  export let value = null;
64
64
  // get the label key from an option object or the option itself if it's a string or number
65
- const get_label = (op) => (op instanceof Object ? op.label : op);
65
+ const get_label = (op) => {
66
+ if (op instanceof Object) {
67
+ if (op.label === undefined) {
68
+ console.error(`MultiSelect option ${JSON.stringify(op)} is an object but has no label key`);
69
+ }
70
+ return op.label;
71
+ }
72
+ return op;
73
+ };
66
74
  // if maxSelect=1, value is the single item in selected (or null if selected is empty)
67
75
  // this solves both https://github.com/janosh/svelte-multiselect/issues/86 and
68
76
  // https://github.com/janosh/svelte-multiselect/issues/136
69
77
  $: value = maxSelect === 1 ? selected[0] ?? null : selected;
70
78
  let wiggle = false; // controls wiggle animation when user tries to exceed maxSelect
71
79
  if (!(options?.length > 0)) {
72
- if (allowUserOptions || loading || disabled) {
80
+ if (allowUserOptions || loading || disabled || allowEmpty) {
73
81
  options = []; // initializing as array avoids errors when component mounts
74
82
  }
75
83
  else {
76
- // only error for empty options if user is not allowed to create custom
77
- // options and loading is false
84
+ // error on empty options if user is not allowed to create custom options and loading is false
85
+ // and component is not disabled and allowEmpty is false
78
86
  console.error(`MultiSelect received no options`);
79
87
  }
80
88
  }
81
- if (parseLabelsAsHtml && allowUserOptions) {
82
- console.warn(`Don't combine parseLabelsAsHtml and allowUserOptions. It's susceptible to XSS attacks!`);
83
- }
84
89
  if (maxSelect !== null && maxSelect < 1) {
85
90
  console.error(`MultiSelect's maxSelect must be null or positive integer, got ${maxSelect}`);
86
91
  }
@@ -90,11 +95,14 @@ if (!Array.isArray(selected)) {
90
95
  if (maxSelect && typeof required === `number` && required > maxSelect) {
91
96
  console.error(`MultiSelect maxSelect=${maxSelect} < required=${required}, makes it impossible for users to submit a valid form`);
92
97
  }
98
+ if (parseLabelsAsHtml && allowUserOptions) {
99
+ console.warn(`Don't combine parseLabelsAsHtml and allowUserOptions. It's susceptible to XSS attacks!`);
100
+ }
93
101
  if (sortSelected && selectedOptionsDraggable) {
94
102
  console.warn(`MultiSelect's sortSelected and selectedOptionsDraggable should not be combined as any user re-orderings of selected options will be undone by sortSelected on component re-renders.`);
95
103
  }
96
104
  const dispatch = createEventDispatcher();
97
- let add_option_msg_is_active = false; // controls active state of <li>{addOptionMsg}</li>
105
+ let add_option_msg_is_active = false; // controls active state of <li>{createOptionMsg}</li>
98
106
  let window_width;
99
107
  // options matching the current search text
100
108
  $: matchingOptions = options.filter((op) => filterFunc(op, searchText) && !selected.map(get_label).includes(get_label(op)) // remove already selected options from dropdown list
@@ -104,7 +112,7 @@ if (activeIndex !== null && !matchingOptions[activeIndex]) {
104
112
  throw `Run time error, activeIndex=${activeIndex} is out of bounds, matchingOptions.length=${matchingOptions.length}`;
105
113
  }
106
114
  // update activeOption when activeIndex changes
107
- $: activeOption = activeIndex !== null ? matchingOptions[activeIndex] : null;
115
+ $: activeOption = matchingOptions[activeIndex ?? -1] ?? null;
108
116
  // add an option to selected list
109
117
  function add(label, event) {
110
118
  if (maxSelect && maxSelect > 1 && selected.length >= maxSelect)
@@ -180,16 +188,17 @@ function add(label, event) {
180
188
  function remove(label) {
181
189
  if (selected.length === 0)
182
190
  return;
183
- selected.splice(selected.map(get_label).lastIndexOf(label), 1);
184
- selected = selected; // Svelte rerender after in-place splice
185
- const option = options.find((option) => get_label(option) === label) ??
191
+ let option = selected.find((op) => get_label(op) === label);
192
+ if (option === undefined && allowUserOptions) {
186
193
  // if option with label could not be found but allowUserOptions is truthy,
187
194
  // assume it was created by user and create corresponding option object
188
195
  // on the fly for use as event payload
189
- (allowUserOptions && { label, value: label });
190
- if (!option) {
191
- return console.error(`MultiSelect: option with label ${label} not found`);
196
+ option = (typeof options[0] == `object` ? { label } : label);
197
+ }
198
+ if (option === undefined) {
199
+ return console.error(`Multiselect can't remove selected option ${label}, not found in selected list`);
192
200
  }
201
+ selected = selected.filter((op) => get_label(op) !== label); // remove option from selected list
193
202
  dispatch(`remove`, { option });
194
203
  dispatch(`change`, { option, type: `remove` });
195
204
  invalid = false; // reset error status whenever items are removed
@@ -208,7 +217,7 @@ function open_dropdown(event) {
208
217
  function close_dropdown(event) {
209
218
  open = false;
210
219
  input?.blur();
211
- activeOption = null;
220
+ activeIndex = null;
212
221
  dispatch(`close`, { event });
213
222
  }
214
223
  // handle all keyboard events this component receives
@@ -272,6 +281,10 @@ async function handle_keydown(event) {
272
281
  else if (event.key === `Backspace` && selected.length > 0 && !searchText) {
273
282
  remove(selected.map(get_label).at(-1));
274
283
  }
284
+ // make first matching option active on any keypress (if none of the above special cases match)
285
+ else if (matchingOptions.length > 0) {
286
+ activeIndex = 0;
287
+ }
275
288
  }
276
289
  function remove_all() {
277
290
  dispatch(`removeAll`, { options: selected });
@@ -298,7 +311,7 @@ const drop = (target_idx) => (event) => {
298
311
  return;
299
312
  event.dataTransfer.dropEffect = `move`;
300
313
  const start_idx = parseInt(event.dataTransfer.getData(`text/plain`));
301
- const new_selected = selected;
314
+ const new_selected = [...selected];
302
315
  if (start_idx < target_idx) {
303
316
  new_selected.splice(target_idx + 1, 0, new_selected[start_idx]);
304
317
  new_selected.splice(start_idx, 1);
@@ -372,7 +385,7 @@ const dragstart = (idx) => (event) => {
372
385
  class={liSelectedClass}
373
386
  aria-selected="true"
374
387
  animate:flip={{ duration: 100 }}
375
- draggable={selectedOptionsDraggable}
388
+ draggable={selectedOptionsDraggable && !disabled && selected.length > 1}
376
389
  on:dragstart={dragstart(idx)}
377
390
  on:drop|preventDefault={drop(idx)}
378
391
  on:dragenter={() => (drag_idx = idx)}
@@ -393,6 +406,7 @@ const dragstart = (idx) => (event) => {
393
406
  on:keydown={if_enter_or_space(() => remove(get_label(option)))}
394
407
  type="button"
395
408
  title="{removeBtnTitle} {get_label(option)}"
409
+ class="remove"
396
410
  >
397
411
  <slot name="remove-icon">
398
412
  <CrossIcon width="15px" />
@@ -405,7 +419,6 @@ const dragstart = (idx) => (event) => {
405
419
  <input
406
420
  class={inputClass}
407
421
  bind:this={input}
408
- {autocomplete}
409
422
  bind:value={searchText}
410
423
  on:mouseup|self|stopPropagation={open_dropdown}
411
424
  on:keydown|stopPropagation={handle_keydown}
@@ -413,6 +426,7 @@ const dragstart = (idx) => (event) => {
413
426
  on:focus={open_dropdown}
414
427
  {id}
415
428
  {disabled}
429
+ {autocomplete}
416
430
  {inputmode}
417
431
  {pattern}
418
432
  placeholder={selected.length == 0 ? placeholder : null}
@@ -454,7 +468,7 @@ const dragstart = (idx) => (event) => {
454
468
  {#if maxSelect !== 1 && selected.length > 1}
455
469
  <button
456
470
  type="button"
457
- class="remove-all"
471
+ class="remove remove-all"
458
472
  title={removeAllTitle}
459
473
  on:mouseup|stopPropagation={remove_all}
460
474
  on:keydown={if_enter_or_space(remove_all)}
@@ -467,7 +481,7 @@ const dragstart = (idx) => (event) => {
467
481
  {/if}
468
482
 
469
483
  <!-- only render options dropdown if options or searchText is not empty needed to avoid briefly flashing empty dropdown -->
470
- {#if searchText || options?.length > 0}
484
+ {#if (searchText && noMatchingOptionsMsg) || options?.length > 0}
471
485
  <ul class:hidden={!open} class="options {ulOptionsClass}">
472
486
  {#each matchingOptions as option, idx}
473
487
  {@const {
@@ -513,7 +527,7 @@ const dragstart = (idx) => (event) => {
513
527
  <li
514
528
  on:mousedown|stopPropagation
515
529
  on:mouseup|stopPropagation={(event) => add(searchText, event)}
516
- title={addOptionMsg}
530
+ title={createOptionMsg}
517
531
  class:active={add_option_msg_is_active}
518
532
  on:mouseover={() => (add_option_msg_is_active = true)}
519
533
  on:focus={() => (add_option_msg_is_active = true)}
@@ -523,7 +537,7 @@ const dragstart = (idx) => (event) => {
523
537
  >
524
538
  {!duplicates && selected.some((option) => duplicateFunc(option, searchText))
525
539
  ? duplicateOptionMsg
526
- : addOptionMsg}
540
+ : createOptionMsg}
527
541
  </li>
528
542
  {:else}
529
543
  <span>{noMatchingOptionsMsg}</span>
@@ -583,7 +597,7 @@ const dragstart = (idx) => (event) => {
583
597
  padding: var(--sms-selected-li-padding, 1pt 5pt);
584
598
  color: var(--sms-selected-text-color, var(--sms-text-color));
585
599
  }
586
- :where(div.multiselect > ul.selected > li[draggable]) {
600
+ :where(div.multiselect > ul.selected > li[draggable='true']) {
587
601
  cursor: grab;
588
602
  }
589
603
  :where(div.multiselect > ul.selected > li.active) {
@@ -625,7 +639,8 @@ const dragstart = (idx) => (event) => {
625
639
  cursor: inherit; /* needed for disabled state */
626
640
  border-radius: 0; /* reset ul.selected > li */
627
641
  }
628
- :where(div.multiselect > ul.selected > li > input::placeholder) {
642
+ /* don't wrap ::placeholder rules in :where() as it seems to be overpowered by browser defaults i.t.o. specificity */
643
+ div.multiselect > ul.selected > li > input::placeholder {
629
644
  padding-left: 5pt;
630
645
  color: var(--sms-placeholder-color);
631
646
  opacity: var(--sms-placeholder-opacity);
@@ -643,18 +658,22 @@ const dragstart = (idx) => (event) => {
643
658
 
644
659
  :where(div.multiselect > ul.options) {
645
660
  list-style: none;
646
- padding: 4pt 0;
647
661
  top: 100%;
648
662
  left: 0;
649
663
  width: 100%;
650
664
  position: absolute;
651
- border-radius: 1ex;
652
665
  overflow: auto;
666
+ transition: all 0.2s;
667
+ box-sizing: border-box;
653
668
  background: var(--sms-options-bg, white);
654
669
  max-height: var(--sms-options-max-height, 50vh);
655
670
  overscroll-behavior: var(--sms-options-overscroll, none);
656
671
  box-shadow: var(--sms-options-shadow, 0 0 14pt -8pt black);
657
- transition: all 0.2s;
672
+ border: var(--sms-options-border);
673
+ border-width: var(--sms-options-border-width);
674
+ border-radius: var(--sms-options-border-radius, 1ex);
675
+ padding: var(--sms-options-padding);
676
+ margin: var(--sms-options-margin, inherit);
658
677
  }
659
678
  :where(div.multiselect > ul.options.hidden) {
660
679
  visibility: hidden;
@@ -4,8 +4,9 @@ declare class __sveltets_Render<Option extends GenericOption> {
4
4
  props(): {
5
5
  activeIndex?: number | null | undefined;
6
6
  activeOption?: Option | null | undefined;
7
- addOptionMsg?: string | undefined;
7
+ createOptionMsg?: string | undefined;
8
8
  allowUserOptions?: boolean | "append" | undefined;
9
+ allowEmpty?: boolean | undefined;
9
10
  autocomplete?: string | undefined;
10
11
  autoScroll?: boolean | undefined;
11
12
  breakpoint?: number | undefined;
@@ -1,4 +1,7 @@
1
- export { default } from './MultiSelect.svelte';
1
+ export { default as CircleSpinner } from './CircleSpinner.svelte';
2
+ export { default as CmdPalette } from './CmdPalette.svelte';
3
+ export { default, default as MultiSelect } from './MultiSelect.svelte';
4
+ export { default as Wiggle } from './Wiggle.svelte';
2
5
  export type Option = string | number | ObjectOption;
3
6
  export type ObjectOption = {
4
7
  label: string | number;
@@ -10,19 +13,19 @@ export type ObjectOption = {
10
13
  selectedTitle?: string;
11
14
  [key: string]: unknown;
12
15
  };
13
- export type DispatchEvents = {
16
+ export type DispatchEvents<T = Option> = {
14
17
  add: {
15
- option: Option;
18
+ option: T;
16
19
  };
17
20
  remove: {
18
- option: Option;
21
+ option: T;
19
22
  };
20
23
  removeAll: {
21
- options: Option[];
24
+ options: T[];
22
25
  };
23
26
  change: {
24
- option?: Option;
25
- options?: Option[];
27
+ option?: T;
28
+ options?: T[];
26
29
  type: 'add' | 'remove' | 'removeAll';
27
30
  };
28
31
  open: {
@@ -1,4 +1,7 @@
1
- export { default } from './MultiSelect.svelte';
1
+ export { default as CircleSpinner } from './CircleSpinner.svelte';
2
+ export { default as CmdPalette } from './CmdPalette.svelte';
3
+ export { default, default as MultiSelect } from './MultiSelect.svelte';
4
+ export { default as Wiggle } from './Wiggle.svelte';
2
5
  // Firefox lacks support for scrollIntoViewIfNeeded, see
3
6
  // https://github.com/janosh/svelte-multiselect/issues/87
4
7
  // this polyfill was copied from
package/package.json CHANGED
@@ -5,42 +5,55 @@
5
5
  "homepage": "https://janosh.github.io/svelte-multiselect",
6
6
  "repository": "https://github.com/janosh/svelte-multiselect",
7
7
  "license": "MIT",
8
- "version": "8.2.4",
8
+ "version": "8.4.0",
9
9
  "type": "module",
10
- "svelte": "index.js",
10
+ "svelte": "./dist/index.js",
11
11
  "bugs": "https://github.com/janosh/svelte-multiselect/issues",
12
+ "scripts": {
13
+ "dev": "vite dev",
14
+ "build": "vite build",
15
+ "preview": "vite preview",
16
+ "package": "svelte-package",
17
+ "serve": "vite build && vite preview",
18
+ "check": "svelte-check --ignore dist",
19
+ "test": "vitest --run --coverage tests/unit/*.ts && playwright test tests/*.test.ts",
20
+ "test:unit": "vitest tests/unit/*.ts",
21
+ "test:e2e": "playwright test tests/*.test.ts",
22
+ "changelog": "npx auto-changelog --package --output changelog.md --unreleased-only --hide-credit --commit-limit false",
23
+ "update-coverage": "vitest tests/unit --run --coverage && npx istanbul-badges-readme"
24
+ },
25
+ "dependencies": {
26
+ "svelte": "^3.55.1"
27
+ },
12
28
  "devDependencies": {
13
- "@iconify/svelte": "^3.0.1",
14
- "@playwright/test": "^1.29.2",
15
- "@sveltejs/adapter-static": "1.0.1",
16
- "@sveltejs/kit": "1.0.7",
17
- "@sveltejs/package": "1.0.2",
18
- "@sveltejs/vite-plugin-svelte": "^2.0.2",
19
- "@typescript-eslint/eslint-plugin": "^5.48.0",
20
- "@typescript-eslint/parser": "^5.48.0",
21
- "@vitest/coverage-c8": "^0.26.3",
22
- "eslint": "^8.31.0",
29
+ "@iconify/svelte": "^3.1.0",
30
+ "@playwright/test": "^1.31.1",
31
+ "@sveltejs/adapter-static": "^2.0.1",
32
+ "@sveltejs/kit": "^1.9.2",
33
+ "@sveltejs/package": "2.0.2",
34
+ "@sveltejs/vite-plugin-svelte": "^2.0.3",
35
+ "@typescript-eslint/eslint-plugin": "^5.54.0",
36
+ "@typescript-eslint/parser": "^5.54.0",
37
+ "@vitest/coverage-c8": "^0.29.2",
38
+ "eslint": "^8.35.0",
23
39
  "eslint-plugin-svelte3": "^4.0.0",
24
40
  "hastscript": "^7.2.0",
25
41
  "highlight.js": "^11.7.0",
26
- "jsdom": "^21.0.0",
42
+ "jsdom": "^21.1.0",
27
43
  "mdsvex": "^0.10.6",
28
44
  "mdsvexamples": "^0.3.3",
29
- "prettier": "^2.8.2",
45
+ "prettier": "^2.8.4",
30
46
  "prettier-plugin-svelte": "^2.9.0",
31
47
  "rehype-autolink-headings": "^6.1.1",
32
48
  "rehype-slug": "^5.1.0",
33
- "svelte": "^3.55.0",
34
- "svelte-check": "^3.0.1",
35
- "svelte-github-corner": "^0.2.0",
36
- "svelte-preprocess": "^5.0.0",
37
- "svelte-toc": "^0.5.1",
38
- "svelte-zoo": "^0.1.4",
39
- "svelte2tsx": "^0.6.0",
40
- "tslib": "^2.4.1",
41
- "typescript": "^4.9.4",
42
- "vite": "^4.0.4",
43
- "vitest": "^0.26.3"
49
+ "svelte-check": "^3.0.4",
50
+ "svelte-preprocess": "^5.0.1",
51
+ "svelte-toc": "^0.5.2",
52
+ "svelte-zoo": "^0.3.4",
53
+ "svelte2tsx": "^0.6.2",
54
+ "typescript": "^4.9.5",
55
+ "vite": "^4.1.4",
56
+ "vitest": "^0.29.2"
44
57
  },
45
58
  "keywords": [
46
59
  "svelte",
@@ -53,8 +66,18 @@
53
66
  "access": "public"
54
67
  },
55
68
  "exports": {
56
- "./package.json": "./package.json",
57
- "./MultiSelect.svelte": "./MultiSelect.svelte",
58
- ".": "./index.js"
59
- }
60
- }
69
+ "./MultiSelect.svelte": {
70
+ "types": "./dist/MultiSelect.svelte.d.ts",
71
+ "svelte": "./dist/MultiSelect.svelte",
72
+ "default": "./dist/MultiSelect.svelte"
73
+ },
74
+ ".": {
75
+ "types": "./dist/index.d.ts",
76
+ "svelte": "./dist/index.js",
77
+ "default": "./dist/index.js"
78
+ }
79
+ },
80
+ "files": [
81
+ "dist"
82
+ ]
83
+ }
package/readme.md CHANGED
@@ -42,11 +42,10 @@
42
42
 
43
43
  ## 📜 &thinsp; Breaking changes
44
44
 
45
- - **6.1.0**&nbsp; The `dispatch` events `focus` and `blur` were renamed to `open` and `close`, respectively. These actions refer to the dropdown list, i.e. `<MultiSelect on:open={(event) => console.log(event)}>` will trigger when the dropdown list opens. The focus and blur events are now regular DOM (not Svelte `dispatch`) events emitted by the `<input>` node. [PR 120](https://github.com/janosh/svelte-multiselect/pull/120).
46
- - **v7.0.0**&nbsp; `selected` (as well `selectedLabels` and `selectedValues`) used to be arrays always. Now, if `maxSelect=1`, they will no longer be a length-1 array but simply a single a option (label/value respectively) or `null` if no option is selected. [PR 123](https://github.com/janosh/svelte-multiselect/pull/123).
47
45
  - **8.0.0**&nbsp;
48
46
  - Props `selectedLabels` and `selectedValues` were removed. If you were using them, they were equivalent to assigning `bind:selected` to a local variable and then running `selectedLabels = selected.map(option => option.label)` and `selectedValues = selected.map(option => option.value)` if your options were objects with `label` and `value` keys. If they were simple strings/numbers, there was no point in using `selected{Labels,Values}` anyway. [PR 138](https://github.com/janosh/svelte-multiselect/pull/138)
49
47
  - Prop `noOptionsMsg` was renamed to `noMatchingOptionsMsg`. [PR 133](https://github.com/janosh/svelte-multiselect/pull/133).
48
+ - **v8.3.0**&nbsp; `addOptionMsg` was renamed to `createOptionMsg` (no major since version since it's rarely used) [sha](https://github.com/janosh/svelte-multiselect/commits).
50
49
 
51
50
  ## 🔨 &thinsp; Installation
52
51
 
@@ -91,11 +90,17 @@ Full list of props/bindable variables for this component. The `Option` type you
91
90
  Currently active option, i.e. the one the user currently hovers or navigated to with arrow keys.
92
91
 
93
92
  1. ```ts
94
- addOptionMsg: string = `Create this option...`
93
+ createOptionMsg: string = `Create this option...`
95
94
  ```
96
95
 
97
96
  Message shown to users after entering text when no options match their query and `allowUserOptions` is truthy.
98
97
 
98
+ 1. ```ts
99
+ allowEmpty: boolean = false
100
+ ```
101
+
102
+ Whether to `console.error` if dropdown list of options is empty. `allowEmpty={false}` will suppress errors. `allowEmpty={true}` will report a console error if component is not `disabled`, not in `loading` state and doesn't `allowUserOptions`.
103
+
99
104
  1. ```ts
100
105
  allowUserOptions: boolean | 'append' = false
101
106
  ```
@@ -527,6 +532,11 @@ If you only want to make small adjustments, you can pass the following CSS varia
527
532
  - `max-height: var(--sms-options-max-height, 50vh)`: Maximum height of options dropdown.
528
533
  - `overscroll-behavior: var(--sms-options-overscroll, none)`: Whether scroll events bubble to parent elements when reaching the top/bottom of the options dropdown. See [MDN](https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior).
529
534
  - `box-shadow: var(--sms-options-shadow, 0 0 14pt -8pt black)`: Box shadow of dropdown list.
535
+ - `border: var(--sms-options-border)`
536
+ - `border-width: var(--sms-options-border-width)`
537
+ - `border-radius: var(--sms-options-border-radius, 1ex)`
538
+ - `padding: var(--sms-options-padding)`
539
+ - `margin: var(--sms-options-margin, inherit)`
530
540
  - `div.multiselect > ul.options > li`
531
541
  - `scroll-margin: var(--sms-options-scroll-margin, 100px)`: Top/bottom margin to keep between dropdown list items and top/bottom screen edge when auto-scrolling list to keep items in view.
532
542
  - `div.multiselect > ul.options > li.selected`
package/changelog.md DELETED
@@ -1,512 +0,0 @@
1
- ### Changelog
2
-
3
- All notable changes to this project will be documented in this file. Dates are displayed in UTC.
4
-
5
- #### [v8.2.4](https://github.com/janosh/svelte-multiselect/compare/v8.2.3...v8.2.4)
6
-
7
- > 8 January 2023
8
-
9
- - Coverage badges [`#190`](https://github.com/janosh/svelte-multiselect/pull/190)
10
- - feat: add type inference for the `options` prop [`#189`](https://github.com/janosh/svelte-multiselect/pull/189)
11
- - feat: add type inference for the `options` prop (#189) [`#78`](https://github.com/janosh/svelte-multiselect/issues/78)
12
- - merge ExampleCode.svelte with CollapsibleCode.svelte [`56ff99b`](https://github.com/janosh/svelte-multiselect/commit/56ff99bcc378c5582b303aa1c03302cdbceb3076)
13
- - pnpm add -D svelte-zoo to outsource some site components and icons [`6ee64f3`](https://github.com/janosh/svelte-multiselect/commit/6ee64f376dfe166b993c94a36d376d1dce5f44f5)
14
- - restore reactive searchText block in loading example [`846da66`](https://github.com/janosh/svelte-multiselect/commit/846da66af058ac1f448c8aaa513d12fb4c2ac4cc)
15
- - fix bunch of TS errors, add playwright test for dragging selected options to reorder [`a483217`](https://github.com/janosh/svelte-multiselect/commit/a4832176f6fceb5346af2d4cd8ecc01a5626ab43)
16
- - add update-coverage package.json script [`1094f08`](https://github.com/janosh/svelte-multiselect/commit/1094f08cec9d6fd2f54b058af05022ab35ec4ac9)
17
- - add vite alias $root to clean up package.json, readme|contributing|changelog.md imports [`c19cbe4`](https://github.com/janosh/svelte-multiselect/commit/c19cbe4e38413bbcd04d4e35eddcd4cd88c67662)
18
- - mv src/components src/site [`3683ed7`](https://github.com/janosh/svelte-multiselect/commit/3683ed70f19498070ffe9e95c0261c688fb2f7c7)
19
-
20
- <!-- auto-changelog-above -->
21
-
22
- #### [v8.2.3](https://github.com/janosh/svelte-multiselect/compare/v8.2.2...v8.2.3)
23
-
24
- > 28 December 2022
25
-
26
- - add 'Open in StackBlitz' links to example code fences [`ac07557`](https://github.com/janosh/svelte-multiselect/commit/ac075576c261892807faa0071b5f3e0b5b4fcd2c)
27
- - v8.2.2 contains unintended breaking changes and was deprecated on NPM (see [#188](https://github.com/janosh/svelte-multiselect/issues/188)). Use this fixed release instead. [`ef4d669`](https://github.com/janosh/svelte-multiselect/commit/ef4d669)
28
-
29
- #### [v8.2.2](https://github.com/janosh/svelte-multiselect/compare/v8.2.1...v8.2.2)
30
-
31
- > 18 December 2022
32
-
33
- - Issue console warning if `sortSelected && selectedOptionsDraggable` [`#187`](https://github.com/janosh/svelte-multiselect/pull/187)
34
- - Add new slot named 'expand-icon' [`#186`](https://github.com/janosh/svelte-multiselect/pull/186)
35
-
36
- #### [v8.2.1](https://github.com/janosh/svelte-multiselect/compare/v8.2.0...v8.2.1)
37
-
38
- > 10 December 2022
39
-
40
- - Fix `allowUserOptions` preventing dropdown list navigation with up/down arrow keys [`#184`](https://github.com/janosh/svelte-multiselect/pull/184)
41
- - Mdsvexamples [`#182`](https://github.com/janosh/svelte-multiselect/pull/182)
42
- - Add changelog & contributing pages to site [`#181`](https://github.com/janosh/svelte-multiselect/pull/181)
43
- - tweak contributing.md and css-classes example [`6f78033`](https://github.com/janosh/svelte-multiselect/commit/6f78033826beb34cd00bf3282c93ac5328905735)
44
- - fix build error [`b896d36`](https://github.com/janosh/svelte-multiselect/commit/b896d3643a0988b0d0bed832ba46bcad0e2c4494)
45
- - fix readme badge for gh-pages.yml status [`906b560`](https://github.com/janosh/svelte-multiselect/commit/906b56024a826ed45263197b1267015d88f0a660)
46
-
47
- #### [v8.2.0](https://github.com/janosh/svelte-multiselect/compare/v8.1.0...v8.2.0)
48
-
49
- > 30 November 2022
50
-
51
- - Draggable selected options [`#178`](https://github.com/janosh/svelte-multiselect/pull/178)
52
- - Fix page navigation in GH pages, broken because served from non-apex domain [`#172`](https://github.com/janosh/svelte-multiselect/pull/172)
53
- - Publish docs to GitHub pages [`#170`](https://github.com/janosh/svelte-multiselect/pull/170)
54
- - Contributing docs plus issue and PR templates with StackBlitz repro starter [`#169`](https://github.com/janosh/svelte-multiselect/pull/169)
55
- - add missing about field to bug-report issue template (closes #171) [`#171`](https://github.com/janosh/svelte-multiselect/issues/171)
56
- - add changelog.md [`236d238`](https://github.com/janosh/svelte-multiselect/commit/236d238c5fa1ce5f07cf08c09861da4d8446acb2)
57
- - fix prop form_input: set default value null to make it optional [`b150fe0`](https://github.com/janosh/svelte-multiselect/commit/b150fe0032ebde82a319b23bd5e6b573e0c31721)
58
- - set `aliveStatusCodes: [200, 429]` in `.github/workflows/link-check-config.json` [`b34c7bf`](https://github.com/janosh/svelte-multiselect/commit/b34c7bf99d4afa96dcd3c9c322ab4e94b1ef3a39)
59
- - add changelog script to `package.json` [`c943617`](https://github.com/janosh/svelte-multiselect/commit/c9436171033e06e8098f4443ed40d48ddee35167)
60
-
61
- #### [v8.1.0](https://github.com/janosh/svelte-multiselect/compare/v8.0.4...v8.1.0)
62
-
63
- > 18 November 2022
64
-
65
- - Add minSelect prop [`#166`](https://github.com/janosh/svelte-multiselect/pull/166)
66
- - Add `pnpm test` to readme [`#168`](https://github.com/janosh/svelte-multiselect/pull/168)
67
- - Add class for maxSelectMsg [`#167`](https://github.com/janosh/svelte-multiselect/pull/167)
68
- - Allow `required=1 | 2 | ...` to set minimum number of selected options for form submission [`#161`](https://github.com/janosh/svelte-multiselect/pull/161)
69
- - Add minSelect prop (#166) [`#163`](https://github.com/janosh/svelte-multiselect/issues/163) [`#163`](https://github.com/janosh/svelte-multiselect/issues/163) [`#163`](https://github.com/janosh/svelte-multiselect/issues/163)
70
- - mv /max-select example to /min-max-select [`9838db8`](https://github.com/janosh/svelte-multiselect/commit/9838db87d044a0d3d261c82ac1d654b9e32310d1)
71
-
72
- #### [v8.0.4](https://github.com/janosh/svelte-multiselect/compare/v8.0.3...v8.0.4)
73
-
74
- > 15 November 2022
75
-
76
- - Form validation docs [`#159`](https://github.com/janosh/svelte-multiselect/pull/159)
77
- - Don't `console.error` about missing `options` if `disabled=true` [`#158`](https://github.com/janosh/svelte-multiselect/pull/158)
78
-
79
- #### [v8.0.3](https://github.com/janosh/svelte-multiselect/compare/v8.0.2...v8.0.3)
80
-
81
- > 15 November 2022
82
-
83
- - Test uncovered lines [`#157`](https://github.com/janosh/svelte-multiselect/pull/157)
84
- - Don't `console.error` about missing `options` if `loading=true` [`#156`](https://github.com/janosh/svelte-multiselect/pull/156)
85
- - Measure `vitest` coverage with `c8` [`#155`](https://github.com/janosh/svelte-multiselect/pull/155)
86
- - increase --sms-min-height 19->`22pt [`5d0e081`](<https://github.com/janosh/svelte-multiselect/commit/5d0e0815d0b488ae23b439a3f085dd083138c326>)
87
-
88
- #### [v8.0.2](https://github.com/janosh/svelte-multiselect/compare/v8.0.1...v8.0.2)
89
-
90
- > 7 November 2022
91
-
92
- - Pass JSON.stringified selected options to form submission handlers [`#152`](https://github.com/janosh/svelte-multiselect/pull/152)
93
- - Link check CI and readme housekeeping [`#149`](https://github.com/janosh/svelte-multiselect/pull/149)
94
- - REPL links for landing page examples [`#148`](https://github.com/janosh/svelte-multiselect/pull/148)
95
- - Add Collapsible code blocks to usage examples [`#143`](https://github.com/janosh/svelte-multiselect/pull/143)
96
- - REPL links for landing page examples (#148) [`#144`](https://github.com/janosh/svelte-multiselect/issues/144) [`#145`](https://github.com/janosh/svelte-multiselect/issues/145) [`#146`](https://github.com/janosh/svelte-multiselect/issues/146) [`#147`](https://github.com/janosh/svelte-multiselect/issues/147)
97
-
98
- #### [v8.0.1](https://github.com/janosh/svelte-multiselect/compare/v8.0.0...v8.0.1)
99
-
100
- > 30 October 2022
101
-
102
- - Revert SCSS preprocessing [`#141`](https://github.com/janosh/svelte-multiselect/pull/141)
103
- - Add unit tests for 2-/1-way binding of `activeIndex` and `activeOption` [`#139`](https://github.com/janosh/svelte-multiselect/pull/139)
104
-
105
- ### [v8.0.0](https://github.com/janosh/svelte-multiselect/compare/v7.1.0...v8.0.0)
106
-
107
- > 22 October 2022
108
-
109
- - Add new prop `value` [`#138`](https://github.com/janosh/svelte-multiselect/pull/138)
110
- - New prop resetFilterOnAdd [`#137`](https://github.com/janosh/svelte-multiselect/pull/137)
111
- - `yarn` to `pnpm` [`#134`](https://github.com/janosh/svelte-multiselect/pull/134)
112
- - Rename prop `noOptionsMsg -> noMatchingOptionsMsg` [`#133`](https://github.com/janosh/svelte-multiselect/pull/133)
113
- - remove props selectedLabels and selectedValues [`ef6598e`](https://github.com/janosh/svelte-multiselect/commit/ef6598e8b0dc1f2f8cb687074463cb73b2f9ebff)
114
-
115
- #### [v7.1.0](https://github.com/janosh/svelte-multiselect/compare/v7.0.2...v7.1.0)
116
-
117
- > 13 October 2022
118
-
119
- - Allow preventing duplicate options when allowUserOptions is thruthy [`#132`](https://github.com/janosh/svelte-multiselect/pull/132)
120
-
121
- #### [v7.0.2](https://github.com/janosh/svelte-multiselect/compare/v7.0.1...v7.0.2)
122
-
123
- > 8 October 2022
124
-
125
- - Fix TypeError: Cannot read properties of null (reading 'get_label') - take 2 [`#131`](https://github.com/janosh/svelte-multiselect/pull/131)
126
- - Fix selecting options with falsy labels (like 0) [`#130`](https://github.com/janosh/svelte-multiselect/pull/130)
127
-
128
- #### [v7.0.1](https://github.com/janosh/svelte-multiselect/compare/v7.0.0...v7.0.1)
129
-
130
- > 6 October 2022
131
-
132
- - Fix single select with arrow and enter keys [`#128`](https://github.com/janosh/svelte-multiselect/pull/128)
133
- - Add SCSS preprocessing [`#126`](https://github.com/janosh/svelte-multiselect/pull/126)
134
- - pre-commit autoupdate [`#124`](https://github.com/janosh/svelte-multiselect/pull/124)
135
- - more unit tests [`1adbc99`](https://github.com/janosh/svelte-multiselect/commit/1adbc994b746b39c4ad081dc2573bf37f27c96c0)
136
- - test required but empty MultiSelect fails form validity check (i.e. causes unsubmittable form) and filled one passes it [`fd8b377`](https://github.com/janosh/svelte-multiselect/commit/fd8b37782cd508aacfc8125c6647cefe56144b80)
137
-
138
- ### [v7.0.0](https://github.com/janosh/svelte-multiselect/compare/v6.1.0...v7.0.0)
139
-
140
- > 3 October 2022
141
-
142
- - Make selected a single value (not a length-1 array) if maxSelect=1 [`#123`](https://github.com/janosh/svelte-multiselect/pull/123)
143
- - Fix TypeError: Cannot read properties of null (reading 'get_label') at MultiSelect.svelte:75 [`#122`](https://github.com/janosh/svelte-multiselect/pull/122)
144
- - add stopPropagation to keydown handler (closes #114) [`#114`](https://github.com/janosh/svelte-multiselect/issues/114)
145
-
146
- #### [v6.1.0](https://github.com/janosh/svelte-multiselect/compare/v6.0.3...v6.1.0)
147
-
148
- > 30 September 2022
149
-
150
- - Forward input DOM events [`#120`](https://github.com/janosh/svelte-multiselect/pull/120)
151
- - Props to manipulating inputmode and pattern attributes [`#116`](https://github.com/janosh/svelte-multiselect/pull/116)
152
- - docs: remove `userInputAs` prop reference [`#115`](https://github.com/janosh/svelte-multiselect/pull/115)
153
- - Fix top option not selectable with enter key [`#113`](https://github.com/janosh/svelte-multiselect/pull/113)
154
-
155
- #### [v6.0.3](https://github.com/janosh/svelte-multiselect/compare/v6.0.2...v6.0.3)
156
-
157
- > 20 September 2022
158
-
159
- - Fix using arrow keys to control active option in dropdown list [`#111`](https://github.com/janosh/svelte-multiselect/pull/111)
160
- - eslintrc set @typescript-eslint/no-inferrable-types: off [`c688773`](https://github.com/janosh/svelte-multiselect/commit/c6887737871709cdadc2ef0835795d6c1696e34c)
161
-
162
- #### [v6.0.2](https://github.com/janosh/svelte-multiselect/compare/v6.0.1...v6.0.2)
163
-
164
- > 17 September 2022
165
-
166
- - Test readme docs on CSS variables [`#109`](https://github.com/janosh/svelte-multiselect/pull/109)
167
- - Fix selected array not being initialized to options with preselected=true [`#108`](https://github.com/janosh/svelte-multiselect/pull/108)
168
-
169
- #### [v6.0.1](https://github.com/janosh/svelte-multiselect/compare/v6.0.0...v6.0.1)
170
-
171
- > 13 September 2022
172
-
173
- - Better props docs and test [`#105`](https://github.com/janosh/svelte-multiselect/pull/105)
174
- - fix breaking change sveltekit:prefetch renamed to data-sveltekit-prefetch [`65ddbb9`](https://github.com/janosh/svelte-multiselect/commit/65ddbb93c720e3d92d7bc3fec232f58e87c0ea6d)
175
- - fix .svx demo routes [`fde53f1`](https://github.com/janosh/svelte-multiselect/commit/fde53f1225fda928412303256d48b77d122d19f1)
176
- - revert from adapter-netlify to adapter-static [`224144d`](https://github.com/janosh/svelte-multiselect/commit/224144dce012d1eef515abafa542c6a6b7e063e8)
177
-
178
- ### [v6.0.0](https://github.com/janosh/svelte-multiselect/compare/v5.0.6...v6.0.0)
179
-
180
- > 3 September 2022
181
-
182
- - Better on mobile and better about which option is active [`#103`](https://github.com/janosh/svelte-multiselect/pull/103)
183
- - SvelteKit routes auto migration [`#101`](https://github.com/janosh/svelte-multiselect/pull/101)
184
-
185
- #### [v5.0.6](https://github.com/janosh/svelte-multiselect/compare/v5.0.5...v5.0.6)
186
-
187
- > 2 August 2022
188
-
189
- - Fix 'Cannot find module `scroll-into-view-if-needed`' [`#99`](https://github.com/janosh/svelte-multiselect/pull/99)
190
-
191
- #### [v5.0.5](https://github.com/janosh/svelte-multiselect/compare/v5.0.4...v5.0.5)
192
-
193
- > 2 August 2022
194
-
195
- - Add `scroll-into-view-if-needed` ponyfill [`#97`](https://github.com/janosh/svelte-multiselect/pull/97)
196
-
197
- #### [v5.0.4](https://github.com/janosh/svelte-multiselect/compare/v5.0.3...v5.0.4)
198
-
199
- > 17 July 2022
200
-
201
- - Convert E2E tests from`vitest` to `@playwright/test` [`#95`](https://github.com/janosh/svelte-multiselect/pull/95)
202
- - Allow empty Multiselect [`#94`](https://github.com/janosh/svelte-multiselect/pull/94)
203
- - Add new slot `'remove-icon'` [`#93`](https://github.com/janosh/svelte-multiselect/pull/93)
204
- - pre-commit autoupdate [`#92`](https://github.com/janosh/svelte-multiselect/pull/92)
205
-
206
- #### [v5.0.3](https://github.com/janosh/svelte-multiselect/compare/v5.0.2...v5.0.3)
207
-
208
- > 1 July 2022
209
-
210
- - Reset `activeOption` to `null` if not in `matchingOptions` [`#90`](https://github.com/janosh/svelte-multiselect/pull/90)
211
-
212
- #### [v5.0.2](https://github.com/janosh/svelte-multiselect/compare/v5.0.1...v5.0.2)
213
-
214
- > 27 June 2022
215
-
216
- - Replace `li.scrollIntoViewIfNeeded()` with `li.scrollIntoView()` [`#88`](https://github.com/janosh/svelte-multiselect/pull/88)
217
- - Add new prop `parseLabelsAsHtml` [`#84`](https://github.com/janosh/svelte-multiselect/pull/84)
218
- - try fix flaky test 'multiselect >`can select and remove many options' [`2b0c453`](<https://github.com/janosh/svelte-multiselect/commit/2b0c453c794c0b3b82e81c5b994c10bc305a98d6>)
219
- - bump netlify node to v18, update readme + deps [`586c724`](https://github.com/janosh/svelte-multiselect/commit/586c724d471aece2b5a3726bb5eb145e36073fe3)
220
- - remove plausible.js analytics [`cd4c9f6`](https://github.com/janosh/svelte-multiselect/commit/cd4c9f6e18e13959dfb4fcebe9acba7a875b83a2)
221
-
222
- #### [v5.0.1](https://github.com/janosh/svelte-multiselect/compare/v5.0.0...v5.0.1)
223
-
224
- > 23 April 2022
225
-
226
- - Strongly typed custom events [`#79`](https://github.com/janosh/svelte-multiselect/pull/79)
227
-
228
- ### [v5.0.0](https://github.com/janosh/svelte-multiselect/compare/v4.0.6...v5.0.0)
229
-
230
- > 21 April 2022
231
-
232
- - v5 release [`#76`](https://github.com/janosh/svelte-multiselect/pull/76)
233
- - Work with string options as is, don't convert to objects internally [`#75`](https://github.com/janosh/svelte-multiselect/pull/75)
234
- - v5 release (#76) [`#57`](https://github.com/janosh/svelte-multiselect/issues/57)
235
-
236
- #### [v4.0.6](https://github.com/janosh/svelte-multiselect/compare/v4.0.5...v4.0.6)
237
-
238
- > 7 April 2022
239
-
240
- - Fix backspace deleting multiple selected options if identical labels [`#72`](https://github.com/janosh/svelte-multiselect/pull/72)
241
- - Several fixes for `allowUserOptions` [`#69`](https://github.com/janosh/svelte-multiselect/pull/69)
242
- - pre-commit autoupdate [`#70`](https://github.com/janosh/svelte-multiselect/pull/70)
243
-
244
- #### [v4.0.5](https://github.com/janosh/svelte-multiselect/compare/v4.0.4...v4.0.5)
245
-
246
- > 2 April 2022
247
-
248
- - Fix MultiSelect `localStorage` binding [`#66`](https://github.com/janosh/svelte-multiselect/pull/66)
249
-
250
- #### [v4.0.4](https://github.com/janosh/svelte-multiselect/compare/v4.0.3...v4.0.4)
251
-
252
- > 30 March 2022
253
-
254
- - Move examples to new `src/routes/demos` dir [`#63`](https://github.com/janosh/svelte-multiselect/pull/63)
255
- - make ToC position fixed (closes #64) [`#64`](https://github.com/janosh/svelte-multiselect/issues/64)
256
- - check for undefined (not falsy) value in rawOp processing (fixes #65) [`#65`](https://github.com/janosh/svelte-multiselect/issues/65)
257
- - LanguageSlot change SVG icons src repo to vscode-icons for more coverage [`92390e9`](https://github.com/janosh/svelte-multiselect/commit/92390e937a063b2b0c88e0ac6f9a9d8f3cb1eadd)
258
- - more preselected slots in Examples.svelte [`cd0a01a`](https://github.com/janosh/svelte-multiselect/commit/cd0a01a7a6b319299642b3c24c5caea8dc9dc24d)
259
-
260
- #### [v4.0.3](https://github.com/janosh/svelte-multiselect/compare/v4.0.2...v4.0.3)
261
-
262
- > 23 March 2022
263
-
264
- - Add `aria-label` to hidden `.form-control` input [`#62`](https://github.com/janosh/svelte-multiselect/pull/62)
265
- - Add `aria-label` to hidden `.form-control` input (#62) [`#58`](https://github.com/janosh/svelte-multiselect/issues/58) [`#35`](https://github.com/janosh/svelte-multiselect/issues/35)
266
- - fix dropdown closing when clicking between list items (closes #61) [`#61`](https://github.com/janosh/svelte-multiselect/issues/61)
267
- - `svelte.config.js` add `kit.prerender.default: true`, `mv src/{global,app}.d.ts` [`4a84913`](https://github.com/janosh/svelte-multiselect/commit/4a8491380e08bad137ca7bdda9ee4ddd38abe3d6)
268
-
269
- #### [v4.0.2](https://github.com/janosh/svelte-multiselect/compare/v4.0.1...v4.0.2)
270
-
271
- > 13 March 2022
272
-
273
- - Improve a11y [`#60`](https://github.com/janosh/svelte-multiselect/pull/60)
274
- - Convert tests to Playwright [`#59`](https://github.com/janosh/svelte-multiselect/pull/59)
275
- - Convert tests to Playwright (#59) [`#58`](https://github.com/janosh/svelte-multiselect/issues/58)
276
- - add and document prop invalid (closes #47) [`#47`](https://github.com/janosh/svelte-multiselect/issues/47)
277
- - set width (not height) on svg icons and as px (not em) so they don't shrink with fluid typography on mobile screens [`ba77f93`](https://github.com/janosh/svelte-multiselect/commit/ba77f93b23b375bb650411b580406f1f7d55f365)
278
-
279
- #### [v4.0.1](https://github.com/janosh/svelte-multiselect/compare/v4.0.0...v4.0.1)
280
-
281
- > 5 March 2022
282
-
283
- - Rename readonly to disabled [`#55`](https://github.com/janosh/svelte-multiselect/pull/55)
284
- - CSS and UX tweaks [`#52`](https://github.com/janosh/svelte-multiselect/pull/52)
285
- - Readme document test runner config to avoid transpiling errors in downstream testing [`#54`](https://github.com/janosh/svelte-multiselect/pull/54)
286
- - More tests [`#51`](https://github.com/janosh/svelte-multiselect/pull/51)
287
- - Add `vitest` [`#50`](https://github.com/janosh/svelte-multiselect/pull/50)
288
- - Rename readonly to disabled (#55) [`#45`](https://github.com/janosh/svelte-multiselect/issues/45)
289
- - close options dropdown list on input blur (fixes #53) [`#53`](https://github.com/janosh/svelte-multiselect/issues/53)
290
- - CSS and UX tweaks (#52) [`#44`](https://github.com/janosh/svelte-multiselect/issues/44) [`#44`](https://github.com/janosh/svelte-multiselect/issues/44) [`#44`](https://github.com/janosh/svelte-multiselect/issues/44)
291
- - Readme document test runner config to avoid transpiling errors in downstream testing (#54) [`#48`](https://github.com/janosh/svelte-multiselect/issues/48)
292
-
293
- ### [v4.0.0](https://github.com/janosh/svelte-multiselect/compare/v3.3.0...v4.0.0)
294
-
295
- > 21 February 2022
296
-
297
- - Implement `allowUserOptions`, `autoScroll` and `loading` (closes #39) [`#41`](https://github.com/janosh/svelte-multiselect/pull/41)
298
- - define DispatchEvents type used to annotate createEventDispatcher() [`#32`](https://github.com/janosh/svelte-multiselect/pull/32)
299
- - add prop required to prevent form submission if no options selected (closes #42) [`#42`](https://github.com/janosh/svelte-multiselect/issues/42)
300
- - Implement `allowUserOptions`, `autoScroll` and `loading` (closes #39) (#41) [`#39`](https://github.com/janosh/svelte-multiselect/issues/39) [`#39`](https://github.com/janosh/svelte-multiselect/issues/39)
301
-
302
- #### [v3.3.0](https://github.com/janosh/svelte-multiselect/compare/v3.2.3...v3.3.0)
303
-
304
- > 20 February 2022
305
-
306
- - by default, only show maxSelectMsg if maxSelect != null and >`1 (closes #37) [`#37`](<https://github.com/janosh/svelte-multiselect/issues/37>)
307
- - add CSS var --sms-options-shadow defaults to subtle black shadow around dropdown list (0 0 14pt -8pt black) (closes #36) [`#36`](https://github.com/janosh/svelte-multiselect/issues/36)
308
- - add prop liActiveOptionClass = '' (closes #35) [`#35`](https://github.com/janosh/svelte-multiselect/issues/35)
309
- - turn searchText = and showOptions = false into bindable props (closes #33) [`#33`](https://github.com/janosh/svelte-multiselect/issues/33)
310
- - document missing noOptionsMsg prop (closes #34) [`#34`](https://github.com/janosh/svelte-multiselect/issues/34)
311
- - ensure custom class names (outerDivClass, ulOptionsClass) come last (closes #38) [`#38`](https://github.com/janosh/svelte-multiselect/issues/38)
312
- - fix ToC scroll to heading (closes #31) [`#31`](https://github.com/janosh/svelte-multiselect/issues/31)
313
- - only show remove all btn when maxSelect !== 1 (for #37) [`64cfd8a`](https://github.com/janosh/svelte-multiselect/commit/64cfd8a1108e19aae12e65c3ad17177f09a066d8)
314
-
315
- #### [v3.2.3](https://github.com/janosh/svelte-multiselect/compare/v3.2.2...v3.2.3)
316
-
317
- > 19 February 2022
318
-
319
- - Fixes for focus on click and wiggle on hitting maxSelect [`#30`](https://github.com/janosh/svelte-multiselect/pull/30)
320
-
321
- #### [v3.2.2](https://github.com/janosh/svelte-multiselect/compare/v3.2.1...v3.2.2)
322
-
323
- > 16 February 2022
324
-
325
- - Expose filter method [`#29`](https://github.com/janosh/svelte-multiselect/pull/29)
326
- - readme improve docs on css variables and granular control through :global() selectors (closes #27) [`#27`](https://github.com/janosh/svelte-multiselect/issues/27)
327
-
328
- #### [v3.2.1](https://github.com/janosh/svelte-multiselect/compare/v3.2.0...v3.2.1)
329
-
330
- > 7 February 2022
331
-
332
- - mv input outside ul.selected for better HTML semantics (closes #26) [`#26`](https://github.com/janosh/svelte-multiselect/issues/26)
333
-
334
- #### [v3.2.0](https://github.com/janosh/svelte-multiselect/compare/v3.1.1...v3.2.0)
335
-
336
- > 3 February 2022
337
-
338
- - apply id prop to `<input>` instead of outer div (closes #25) [`#25`](https://github.com/janosh/svelte-multiselect/issues/25)
339
- - add eslint commit hook + update deps [`6ad44b8`](https://github.com/janosh/svelte-multiselect/commit/6ad44b85057aef71eae19293de80f9d42f91f87b)
340
- - v.3.2.0 [`71ff2d1`](https://github.com/janosh/svelte-multiselect/commit/71ff2d192caccacbe41f83949c14d7d4ca87d590)
341
- - add readme badge to document minimum svelte version (for #24) [`7d9fe5a`](https://github.com/janosh/svelte-multiselect/commit/7d9fe5a977b56dab95069b64321f0718e0d61f08)
342
-
343
- #### [v3.1.1](https://github.com/janosh/svelte-multiselect/compare/v3.1.0...v3.1.1)
344
-
345
- > 25 January 2022
346
-
347
- - wiggle the maxSelect msg on hitting selection limit (closes #19) [`#19`](https://github.com/janosh/svelte-multiselect/issues/19)
348
- - readme better docs for CSS variables, rename slots `{options,selected}Renderer -> render{options,selected}` [`c8ab724`](https://github.com/janosh/svelte-multiselect/commit/c8ab7241506cfe6b5930d098150a251e85c52afd)
349
-
350
- #### [v3.1.0](https://github.com/janosh/svelte-multiselect/compare/v3.0.1...v3.1.0)
351
-
352
- > 22 January 2022
353
-
354
- - add selectedRenderer + optionRenderer named slots (closes #21) [`#21`](https://github.com/janosh/svelte-multiselect/issues/21)
355
- - docs site use unmodified readme with slot to insert examples, yarn add svelte-github-corner [`1072691`](https://github.com/janosh/svelte-multiselect/commit/10726916ea2a72560cd8ee6f2806526bf932e771)
356
- - readme add note on type exports for TS users, add error page that redirects to index [`dde76c8`](https://github.com/janosh/svelte-multiselect/commit/dde76c8b92408b7fddca0b555a63c2b1bfd0dbe8)
357
-
358
- #### [v3.0.1](https://github.com/janosh/svelte-multiselect/compare/v3.0.0...v3.0.1)
359
-
360
- > 7 January 2022
361
-
362
- - favorite web framework show Confetti.svelte on:add Svelte [`8d109ee`](https://github.com/janosh/svelte-multiselect/commit/8d109ee5c7755e447fcb72419f3b7ecc19cac0b2)
363
- - bump svelte@3.45.0 to silence warning: MultiSelect has unused export property 'defaultDisabledTitle' (sveltejs/svelte#6964) [`f80a7a6`](https://github.com/janosh/svelte-multiselect/commit/f80a7a622310005407585298f2611597c0941990)
364
- - update readme + svelte-toc@0.2.0 [`40013ba`](https://github.com/janosh/svelte-multiselect/commit/40013badd61dd0fcade7ab295dabd26693e3cc51)
365
- - pre-commit autoupdate [`0d05864`](https://github.com/janosh/svelte-multiselect/commit/0d05864d19987460dd30d667eb22deb91a520668)
366
- - iOS Safari prevent zoom into page on focus MultiSelect input [`44f17be`](https://github.com/janosh/svelte-multiselect/commit/44f17be53378e38f4a8748b815737d25cdebc85f)
367
-
368
- ### [v3.0.0](https://github.com/janosh/svelte-multiselect/compare/v2.0.0...v3.0.0)
369
-
370
- > 29 December 2021
371
-
372
- - ensure active option is scrolled into view if needed (closes #15), breaking change: renames tokens to options [`#15`](https://github.com/janosh/svelte-multiselect/issues/15)
373
-
374
- ### [v2.0.0](https://github.com/janosh/svelte-multiselect/compare/v1.2.2...v2.0.0)
375
-
376
- > 24 December 2021
377
-
378
- - Convert options from simple strings to objects [`#16`](https://github.com/janosh/svelte-multiselect/pull/16)
379
- - Add local to transition:fly [`#14`](https://github.com/janosh/svelte-multiselect/pull/14)
380
- - add onClickOutside action, used to replace input.on:blur() for hiding options (closes #18) [`#18`](https://github.com/janosh/svelte-multiselect/issues/18)
381
- - update deps [`fb90f93`](https://github.com/janosh/svelte-multiselect/commit/fb90f936fa0d49f81e6c9c60986dd04749ea6a67)
382
- - more keyboard friendliness by showing remove button focus and triggering on space bar or enter key [`b87d22b`](https://github.com/janosh/svelte-multiselect/commit/b87d22bc5706acd18e1e79c40b3845f2ee3615b2)
383
- - add plausible [`0557c0f`](https://github.com/janosh/svelte-multiselect/commit/0557c0f2bbef80820540302af29c79b7ac89023b)
384
-
385
- #### [v1.2.2](https://github.com/janosh/svelte-multiselect/compare/v1.2.1...v1.2.2)
386
-
387
- > 27 October 2021
388
-
389
- - set `<input>` width back to 1pt as it's only needed to tab into, focus and blur `<MultiSelect>` (closes #12) [`#12`](https://github.com/janosh/svelte-multiselect/issues/12)
390
- - update readme [`45c7993`](https://github.com/janosh/svelte-multiselect/commit/45c7993398c986499d4c0729177620cbec719cb7)
391
-
392
- #### [v1.2.1](https://github.com/janosh/svelte-multiselect/compare/v1.2.0...v1.2.1)
393
-
394
- > 21 October 2021
395
-
396
- - make internal CSS easily overridable (sveltejs/svelte#6859) [`d15a445`](https://github.com/janosh/svelte-multiselect/commit/d15a44504707c178c67e22318b2cc6095b1b192f)
397
-
398
- #### [v1.2.0](https://github.com/janosh/svelte-multiselect/compare/v1.1.13...v1.2.0)
399
-
400
- > 12 October 2021
401
-
402
- - add src/lib/index.ts for package path export '.' (closes #11) [`#11`](https://github.com/janosh/svelte-multiselect/issues/11)
403
-
404
- #### [v1.1.13](https://github.com/janosh/svelte-multiselect/compare/v1.1.12...v1.1.13)
405
-
406
- > 12 October 2021
407
-
408
- - add src/lib/index.ts for package path export '.' (closes #11) [`#11`](https://github.com/janosh/svelte-multiselect/issues/11)
409
-
410
- #### [v1.1.12](https://github.com/janosh/svelte-multiselect/compare/v1.1.11...v1.1.12)
411
-
412
- > 11 October 2021
413
-
414
- - Add new prop disabledOptions [`#9`](https://github.com/janosh/svelte-multiselect/pull/9)
415
- - add pre-commit hooks [`dfb6399`](https://github.com/janosh/svelte-multiselect/commit/dfb6399a77b705f8e5979eb887d345a5f52ff929)
416
- - pre-commit autoupdate [`b69425d`](https://github.com/janosh/svelte-multiselect/commit/b69425d18473122f1af889d2f48c60d02e43b99f)
417
-
418
- #### [v1.1.11](https://github.com/janosh/svelte-multiselect/compare/v1.1.10...v1.1.11)
419
-
420
- > 3 September 2021
421
-
422
- - fix removeAll button not dispatching remove and change events (closes #7) [`#7`](https://github.com/janosh/svelte-multiselect/issues/7)
423
- - remove @tsconfig/svelte, update deps [`9b2c231`](https://github.com/janosh/svelte-multiselect/commit/9b2c23181f4a96bd9d002f535dd669153e772b72)
424
- - add type=(add|remove) detail to 'change' event dispatch [`8290458`](https://github.com/janosh/svelte-multiselect/commit/8290458b898292a28d65710d6941f193fb9964aa)
425
-
426
- #### [v1.1.10](https://github.com/janosh/svelte-multiselect/compare/v1.1.9...v1.1.10)
427
-
428
- > 12 August 2021
429
-
430
- - add `on:change` event and document events in readme (closes #5) [`#5`](https://github.com/janosh/svelte-multiselect/issues/5)
431
-
432
- #### [v1.1.9](https://github.com/janosh/svelte-multiselect/compare/v1.1.8...v1.1.9)
433
-
434
- > 12 July 2021
435
-
436
- - convert to typescript [`bd391c5`](https://github.com/janosh/svelte-multiselect/commit/bd391c5aba615ab41e2f561f81e057928a7064a8)
437
- - update to @sveltejs/kit@1.0.0-next.124+ to use svelte field in `package.json` [`2367e38`](https://github.com/janosh/svelte-multiselect/commit/2367e38d699e503e6dc98808904278f96eb54ee7)
438
-
439
- #### [v1.1.8](https://github.com/janosh/svelte-multiselect/compare/v1.1.7...v1.1.8)
440
-
441
- > 7 July 2021
442
-
443
- - turn hard-coded remove button titles into props [`c35162b`](https://github.com/janosh/svelte-multiselect/commit/c35162b0d0c1ed183bc23dbf15b0ff46638cbb3b)
444
- - guard against selected being nullish, keep ul.options in the DOM even if showoptions is false to allow selecting in dev tools for styling [`b9bd576`](https://github.com/janosh/svelte-multiselect/commit/b9bd576f6f76ec86ebeff1d899d8947bef64f66f)
445
-
446
- #### [v1.1.7](https://github.com/janosh/svelte-multiselect/compare/v1.1.6...v1.1.7)
447
-
448
- > 5 July 2021
449
-
450
- - add css classes as props for use with tailwind (closes #3) [`#3`](https://github.com/janosh/svelte-multiselect/issues/3)
451
-
452
- #### [v1.1.6](https://github.com/janosh/svelte-multiselect/compare/v1.1.5...v1.1.6)
453
-
454
- > 23 June 2021
455
-
456
- - fix: don't remove tags if search string is non-empty, open options on clicking selected tags (#2) [`5ffed50`](https://github.com/janosh/svelte-multiselect/commit/5ffed50617f47dba6ffbafd6ce266fa6e064c7de)
457
- - update svelte-toc to fix deploy [`d5279dd`](https://github.com/janosh/svelte-multiselect/commit/d5279dd11279509493030aeb26295873929b2253)
458
-
459
- #### [v1.1.5](https://github.com/janosh/svelte-multiselect/compare/v1.1.4...v1.1.5)
460
-
461
- > 22 June 2021
462
-
463
- - convert to `svelte-kit package` [`9db3cfb`](https://github.com/janosh/svelte-multiselect/commit/9db3cfb5b6e2db844961be5bc59fc12e5d5b6b76)
464
-
465
- #### [v1.1.4](https://github.com/janosh/svelte-multiselect/compare/v1.1.3...v1.1.4)
466
-
467
- > 21 June 2021
468
-
469
- - fix setting initial value for selected, fix setting class `'selected'` in single mode [`16d11de`](https://github.com/janosh/svelte-multiselect/commit/16d11de77567f9d30e37e815dfcb9a7d580d6500)
470
-
471
- #### [v1.1.3](https://github.com/janosh/svelte-multiselect/compare/v1.1.2...v1.1.3)
472
-
473
- > 20 June 2021
474
-
475
- - replace prop single with maxSelect to specify any number of selectable options, add class single to div.multiselect if maxSelect===1 (#2) [`36e916f`](https://github.com/janosh/svelte-multiselect/commit/36e916f4a42d395c394ddff47364a17fd22a7ec1)
476
- - add linked headings [`2eedf9a`](https://github.com/janosh/svelte-multiselect/commit/2eedf9aa24512ff96f8ccff564d3a1fa7615388a)
477
-
478
- #### [v1.1.2](https://github.com/janosh/svelte-multiselect/compare/v1.1.1...v1.1.2)
479
-
480
- > 28 May 2021
481
-
482
- - add css var props [`f591814`](https://github.com/janosh/svelte-multiselect/commit/f5918141805cfc6acda28c836a57c3df81fa758f)
483
-
484
- #### [v1.1.1](https://github.com/janosh/svelte-multiselect/compare/v1.1.0...v1.1.1)
485
-
486
- > 25 May 2021
487
-
488
- - add GitHubCorner.svelte for link to repo [`e80a402`](https://github.com/janosh/svelte-multiselect/commit/e80a402556783108bc5dc626f9816b647e2c937f)
489
- - remove selected tokens with backspace [`c5d7495`](https://github.com/janosh/svelte-multiselect/commit/c5d7495a43b945dd56ad06fbe639de0db542d5f4)
490
- - add readme badges [`992eaa4`](https://github.com/janosh/svelte-multiselect/commit/992eaa43ec19841b3035a5dcf9996eaf58316fa8)
491
- - demo site fix stripping start of readme for docs [`107273d`](https://github.com/janosh/svelte-multiselect/commit/107273de356f176cb0fc94f28ae4f2e773b62d42)
492
- - add `svelte-toc` table of contents to demo site [`36aa1c5`](https://github.com/janosh/svelte-multiselect/commit/36aa1c523c5bc3acb14e9613b61c04ffd54c6100)
493
-
494
- #### [v1.1.0](https://github.com/janosh/svelte-multiselect/compare/v1.0.1...v1.1.0)
495
-
496
- > 9 May 2021
497
-
498
- - import readme on demo site (more DRY) [`c0e4924`](https://github.com/janosh/svelte-multiselect/commit/c0e49246e76a81600bb35931fd7d30f6f6aeb550)
499
- - remove unused `example.svx` [`2138caa`](https://github.com/janosh/svelte-multiselect/commit/2138caa171f20a2f80c2e75d0dffd066caf17a83)
500
- - rename package dir, improve readme [`0150378`](https://github.com/janosh/svelte-multiselect/commit/015037848f666a76b24b93603764084b41611740)
501
-
502
- #### [v1.0.1](https://github.com/janosh/svelte-multiselect/compare/v1.0.0...v1.0.1)
503
-
504
- > 8 May 2021
505
-
506
- - remove hidden input for storing currently selected options as JSON [`802a219`](https://github.com/janosh/svelte-multiselect/commit/802a2195a28986c219298d7d9e7ca47f2aaf7db6)
507
-
508
- ### v1.0.0
509
-
510
- > 7 May 2021
511
-
512
- - initial commit [`14dd38a`](https://github.com/janosh/svelte-multiselect/commit/14dd38adb06a8899e39efabdb114faab943cedf0)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes