svelte-multiselect 8.0.0 → 8.0.1

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.
@@ -465,154 +465,17 @@ function on_click_outside(event) {
465
465
  {/if}
466
466
  </div>
467
467
 
468
- <style>:where(div.multiselect) {
469
- position: relative;
470
- align-items: center;
471
- display: flex;
472
- cursor: text;
473
- border: var(--sms-border, 1pt solid lightgray);
474
- border-radius: var(--sms-border-radius, 3pt);
475
- background: var(--sms-bg);
476
- max-width: var(--sms-max-width);
477
- padding: var(--sms-padding, 0 3pt);
478
- color: var(--sms-text-color);
479
- font-size: var(--sms-font-size, inherit);
480
- min-height: var(--sms-min-height, 19pt);
481
- margin: var(--sms-margin);
482
- }
483
- :where(div.multiselect).open {
484
- /* increase z-index when open to ensure the dropdown of one <MultiSelect />
485
- displays above that of another slightly below it on the page */
486
- z-index: var(--sms-open-z-index, 4);
487
- }
488
- :where(div.multiselect):focus-within {
489
- border: var(--sms-focus-border, 1pt solid var(--sms-active-color, cornflowerblue));
490
- }
491
- :where(div.multiselect).disabled {
492
- background: var(--sms-disabled-bg, lightgray);
493
- cursor: not-allowed;
494
- }
495
- :where(div.multiselect) > ul.selected {
496
- display: flex;
497
- flex: 1;
498
- padding: 0;
499
- margin: 0;
500
- flex-wrap: wrap;
501
- }
502
- :where(div.multiselect) > ul.selected > li {
503
- align-items: center;
504
- border-radius: 3pt;
505
- display: flex;
506
- margin: 2pt;
507
- line-height: normal;
508
- transition: 0.3s;
509
- white-space: nowrap;
510
- background: var(--sms-selected-bg, rgba(0, 0, 0, 0.15));
511
- padding: var(--sms-selected-li-padding, 1pt 5pt);
512
- color: var(--sms-selected-text-color, var(--sms-text-color));
513
- }
514
- :where(div.multiselect) button {
515
- border-radius: 50%;
516
- display: flex;
517
- transition: 0.2s;
518
- color: inherit;
519
- background: transparent;
520
- border: none;
521
- cursor: pointer;
522
- outline: none;
523
- padding: 0;
524
- margin: 0 0 0 3pt; /* CSS reset */
525
- }
526
- :where(div.multiselect) button.remove-all {
527
- margin: 0 3pt;
528
- }
529
- :where(div.multiselect) ul.selected > li button:hover,
530
- :where(div.multiselect) button.remove-all:hover,
531
- :where(div.multiselect) button:focus {
532
- color: var(--sms-remove-btn-hover-color, lightskyblue);
533
- background: var(--sms-remove-btn-hover-bg, rgba(0, 0, 0, 0.2));
534
- }
535
- :where(div.multiselect) input {
536
- margin: auto 0; /* CSS reset */
537
- padding: 0; /* CSS reset */
538
- }
539
- :where(div.multiselect) > ul.selected > li > input {
540
- border: none;
541
- outline: none;
542
- background: none;
543
- flex: 1; /* this + next line fix issue #12 https://git.io/JiDe3 */
544
- min-width: 2em;
545
- /* ensure input uses text color and not --sms-selected-text-color */
546
- color: var(--sms-text-color);
547
- font-size: inherit;
548
- cursor: inherit; /* needed for disabled state */
549
- border-radius: 0; /* reset ul.selected > li */
550
- }
551
- :where(div.multiselect) > ul.selected > li > input::placeholder {
552
- padding-left: 5pt;
553
- color: var(--sms-placeholder-color);
554
- opacity: var(--sms-placeholder-opacity);
555
- }
556
- :where(div.multiselect) > input.form-control {
557
- width: 2em;
558
- position: absolute;
559
- background: transparent;
560
- border: none;
561
- outline: none;
562
- z-index: -1;
563
- opacity: 0;
564
- pointer-events: none;
565
- }
566
- :where(div.multiselect) > ul.options {
567
- list-style: none;
568
- padding: 4pt 0;
569
- top: 100%;
570
- left: 0;
571
- width: 100%;
572
- position: absolute;
573
- border-radius: 1ex;
574
- overflow: auto;
575
- background: var(--sms-options-bg, white);
576
- max-height: var(--sms-options-max-height, 50vh);
577
- overscroll-behavior: var(--sms-options-overscroll, none);
578
- box-shadow: var(--sms-options-shadow, 0 0 14pt -8pt black);
579
- transition: all 0.2s;
580
- }
581
- :where(div.multiselect) > ul.options.hidden {
582
- visibility: hidden;
583
- opacity: 0;
584
- transform: translateY(50px);
585
- }
586
- :where(div.multiselect) > ul.options > li {
587
- padding: 3pt 2ex;
588
- cursor: pointer;
589
- scroll-margin: var(--sms-options-scroll-margin, 100px);
590
- }
591
- :where(div.multiselect) > ul.options span {
592
- padding: 3pt 2ex;
593
- }
594
- :where(div.multiselect) > ul.options > li.selected {
595
- background: var(--sms-li-selected-bg);
596
- color: var(--sms-li-selected-color);
597
- }
598
- :where(div.multiselect) > ul.options > li.active {
599
- background: var(--sms-li-active-bg, var(--sms-active-color, rgba(0, 0, 0, 0.15)));
600
- }
601
- :where(div.multiselect) > ul.options > li.disabled {
602
- cursor: not-allowed;
603
- background: var(--sms-li-disabled-bg, #f5f5f6);
604
- color: var(--sms-li-disabled-text, #b8b8b8);
605
- }
606
-
607
- @supports not selector(:where(div.multiselect)) {
608
- div.multiselect {
468
+ <style>
469
+ :where(div.multiselect) {
609
470
  position: relative;
610
471
  align-items: center;
611
472
  display: flex;
612
473
  cursor: text;
474
+ box-sizing: border-box;
613
475
  border: var(--sms-border, 1pt solid lightgray);
614
476
  border-radius: var(--sms-border-radius, 3pt);
615
477
  background: var(--sms-bg);
478
+ width: var(--sms-width);
616
479
  max-width: var(--sms-max-width);
617
480
  padding: var(--sms-padding, 0 3pt);
618
481
  color: var(--sms-text-color);
@@ -620,26 +483,27 @@ function on_click_outside(event) {
620
483
  min-height: var(--sms-min-height, 19pt);
621
484
  margin: var(--sms-margin);
622
485
  }
623
- div.multiselect.open {
486
+ :where(div.multiselect.open) {
624
487
  /* increase z-index when open to ensure the dropdown of one <MultiSelect />
625
488
  displays above that of another slightly below it on the page */
626
489
  z-index: var(--sms-open-z-index, 4);
627
490
  }
628
- div.multiselect:focus-within {
491
+ :where(div.multiselect:focus-within) {
629
492
  border: var(--sms-focus-border, 1pt solid var(--sms-active-color, cornflowerblue));
630
493
  }
631
- div.multiselect.disabled {
494
+ :where(div.multiselect.disabled) {
632
495
  background: var(--sms-disabled-bg, lightgray);
633
496
  cursor: not-allowed;
634
497
  }
635
- div.multiselect > ul.selected {
498
+
499
+ :where(div.multiselect > ul.selected) {
636
500
  display: flex;
637
501
  flex: 1;
638
502
  padding: 0;
639
503
  margin: 0;
640
504
  flex-wrap: wrap;
641
505
  }
642
- div.multiselect > ul.selected > li {
506
+ :where(div.multiselect > ul.selected > li) {
643
507
  align-items: center;
644
508
  border-radius: 3pt;
645
509
  display: flex;
@@ -651,7 +515,7 @@ function on_click_outside(event) {
651
515
  padding: var(--sms-selected-li-padding, 1pt 5pt);
652
516
  color: var(--sms-selected-text-color, var(--sms-text-color));
653
517
  }
654
- div.multiselect button {
518
+ :where(div.multiselect button) {
655
519
  border-radius: 50%;
656
520
  display: flex;
657
521
  transition: 0.2s;
@@ -663,20 +527,19 @@ function on_click_outside(event) {
663
527
  padding: 0;
664
528
  margin: 0 0 0 3pt; /* CSS reset */
665
529
  }
666
- div.multiselect button.remove-all {
530
+ :where(div.multiselect button.remove-all) {
667
531
  margin: 0 3pt;
668
532
  }
669
- div.multiselect ul.selected > li button:hover,
670
- div.multiselect button.remove-all:hover,
671
- div.multiselect button:focus {
533
+ :where(ul.selected > li button:hover, button.remove-all:hover, button:focus) {
672
534
  color: var(--sms-remove-btn-hover-color, lightskyblue);
673
535
  background: var(--sms-remove-btn-hover-bg, rgba(0, 0, 0, 0.2));
674
536
  }
675
- div.multiselect input {
537
+
538
+ :where(div.multiselect input) {
676
539
  margin: auto 0; /* CSS reset */
677
540
  padding: 0; /* CSS reset */
678
541
  }
679
- div.multiselect > ul.selected > li > input {
542
+ :where(div.multiselect > ul.selected > li > input) {
680
543
  border: none;
681
544
  outline: none;
682
545
  background: none;
@@ -688,12 +551,12 @@ div.multiselect button:focus {
688
551
  cursor: inherit; /* needed for disabled state */
689
552
  border-radius: 0; /* reset ul.selected > li */
690
553
  }
691
- div.multiselect > ul.selected > li > input::placeholder {
554
+ :where(div.multiselect > ul.selected > li > input::placeholder) {
692
555
  padding-left: 5pt;
693
556
  color: var(--sms-placeholder-color);
694
557
  opacity: var(--sms-placeholder-opacity);
695
558
  }
696
- div.multiselect > input.form-control {
559
+ :where(div.multiselect > input.form-control) {
697
560
  width: 2em;
698
561
  position: absolute;
699
562
  background: transparent;
@@ -703,7 +566,8 @@ div.multiselect button:focus {
703
566
  opacity: 0;
704
567
  pointer-events: none;
705
568
  }
706
- div.multiselect > ul.options {
569
+
570
+ :where(div.multiselect > ul.options) {
707
571
  list-style: none;
708
572
  padding: 4pt 0;
709
573
  top: 100%;
@@ -718,29 +582,30 @@ div.multiselect button:focus {
718
582
  box-shadow: var(--sms-options-shadow, 0 0 14pt -8pt black);
719
583
  transition: all 0.2s;
720
584
  }
721
- div.multiselect > ul.options.hidden {
585
+ :where(div.multiselect > ul.options.hidden) {
722
586
  visibility: hidden;
723
587
  opacity: 0;
724
588
  transform: translateY(50px);
725
589
  }
726
- div.multiselect > ul.options > li {
590
+ :where(div.multiselect > ul.options > li) {
727
591
  padding: 3pt 2ex;
728
592
  cursor: pointer;
729
593
  scroll-margin: var(--sms-options-scroll-margin, 100px);
730
594
  }
731
- div.multiselect > ul.options span {
595
+ /* for noOptionsMsg */
596
+ :where(div.multiselect > ul.options span) {
732
597
  padding: 3pt 2ex;
733
598
  }
734
- div.multiselect > ul.options > li.selected {
599
+ :where(div.multiselect > ul.options > li.selected) {
735
600
  background: var(--sms-li-selected-bg);
736
601
  color: var(--sms-li-selected-color);
737
602
  }
738
- div.multiselect > ul.options > li.active {
603
+ :where(div.multiselect > ul.options > li.active) {
739
604
  background: var(--sms-li-active-bg, var(--sms-active-color, rgba(0, 0, 0, 0.15)));
740
605
  }
741
- div.multiselect > ul.options > li.disabled {
606
+ :where(div.multiselect > ul.options > li.disabled) {
742
607
  cursor: not-allowed;
743
608
  background: var(--sms-li-disabled-bg, #f5f5f6);
744
609
  color: var(--sms-li-disabled-text, #b8b8b8);
745
610
  }
746
- }</style>
611
+ </style>
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "homepage": "https://svelte-multiselect.netlify.app",
6
6
  "repository": "https://github.com/janosh/svelte-multiselect",
7
7
  "license": "MIT",
8
- "version": "8.0.0",
8
+ "version": "8.0.1",
9
9
  "type": "module",
10
10
  "svelte": "index.js",
11
11
  "main": "index.js",
@@ -28,7 +28,6 @@
28
28
  "prettier-plugin-svelte": "^2.8.0",
29
29
  "rehype-autolink-headings": "^6.1.1",
30
30
  "rehype-slug": "^5.0.1",
31
- "sass": "^1.55.0",
32
31
  "svelte": "^3.52.0",
33
32
  "svelte-check": "^2.9.2",
34
33
  "svelte-github-corner": "^0.1.0",
package/readme.md CHANGED
@@ -49,7 +49,7 @@
49
49
 
50
50
  ```sh
51
51
  npm install -D svelte-multiselect
52
- pnpm install -D svelte-multiselect
52
+ pnpm add -D svelte-multiselect
53
53
  yarn add -D svelte-multiselect
54
54
  ```
55
55
 
@@ -73,11 +73,7 @@ Favorite Frontend Frameworks?
73
73
 
74
74
  ## Props
75
75
 
76
- Full list of props/bindable variables for this component. In the type hints below, `Option` is:
77
-
78
- ```ts
79
- import type { Option } from 'svelte-multiselect'
80
- ```
76
+ Full list of props/bindable variables for this component. The `Option` type you see below is defined in [`src/lib/index.ts`](https://github.com/janosh/svelte-multiselect/blob/main/src/lib/index.ts) and can be imported as `import { type Option } from 'svelte-multiselect'`.
81
77
 
82
78
  1. ```ts
83
79
  activeIndex: number | null = null
@@ -468,6 +464,7 @@ If you only want to make small adjustments, you can pass the following CSS varia
468
464
  - `background: var(--sms-bg)`
469
465
  - `color: var(--sms-text-color)`
470
466
  - `min-height: var(--sms-min-height, 19pt)`
467
+ - `width: var(--sms-width)`
471
468
  - `max-width: var(--sms-max-width)`
472
469
  - `margin: var(--sms-margin)`
473
470
  - `font-size: var(--sms-font-size, inherit)`