platypicker 1.0.5 → 1.0.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platypicker",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "private": false,
5
5
  "main": "dist/platypicker.min.js",
6
6
  "files": [
@@ -1,14 +1,21 @@
1
1
  @media (any-pointer: fine), (any-hover: hover) {
2
2
  *:has(> select.platypicker) {
3
3
  anchor-scope: --platypicker;
4
-
4
+
5
5
  select.platypicker {
6
6
  anchor-name: --platypicker;
7
+ white-space: nowrap;
8
+ min-width: max-content;
9
+
10
+ &:not(:has(option:checked))::after {
11
+ content: "\00a0";
12
+ visibility: hidden;
13
+ }
7
14
 
8
15
  &:not([multiple]), &::picker(select) {
9
16
  appearance: base-select !important;
10
17
  }
11
-
18
+
12
19
  &::picker(select) {
13
20
  display: none;
14
21
  }
@@ -20,7 +27,7 @@
20
27
  &.platypicker[multiple] {
21
28
  background-image: var(--bs-form-select-bg-img), var(--bs-form-select-bg-icon, none);
22
29
  }
23
-
30
+
24
31
  & + .dropdown-menu[popover] {
25
32
  display: revert;
26
33
  position-anchor: --platypicker;
@@ -28,13 +35,13 @@
28
35
  left: anchor(left) !important;
29
36
  min-width: anchor-size();
30
37
  max-height: 30rem;
31
-
38
+
32
39
  transform: none !important;
33
-
40
+
34
41
  .input-group:not(:has(*:not(.d-none))) {
35
42
  display: none;
36
43
  }
37
-
44
+
38
45
  .input-group input:not(:has(~ button:not(.d-none))) {
39
46
  border-top-right-radius: var(--bs-border-radius);
40
47
  border-bottom-right-radius: var(--bs-border-radius);
@@ -44,13 +51,13 @@
44
51
  border-bottom-right-radius: var(--bs-border-radius-sm);
45
52
  }
46
53
  }
47
-
54
+
48
55
  .input-group input.d-none {
49
56
  & ~ button {
50
57
  flex-grow: 1;
51
58
  flex-basis: 50%;
52
59
  }
53
-
60
+
54
61
  & + button:not(.d-none),
55
62
  & + button.d-none + button:not(.d-none) {
56
63
  border-top-left-radius: var(--bs-border-radius);
@@ -62,37 +69,34 @@
62
69
  }
63
70
  }
64
71
  }
65
-
72
+
66
73
  .input-group button:not(.d-none) + button:not(.d-none) {
67
74
  border-left-width: 0;
68
75
  }
69
-
76
+
70
77
  li:has(.dropdown-item.d-none) ~ li:has(.dropdown-divider) {
71
78
  display: none;
72
79
  }
73
-
80
+
74
81
  li:has(.dropdown-item:not(.d-none)) ~ li:has(.dropdown-divider) {
75
82
  display: revert;
76
83
  }
77
-
84
+
78
85
  li:has(.dropdown-item.d-none), /* Hidden items */
79
86
  li:has(.dropdown-header.d-none), /* Hidden headers */
80
87
  li:has(.dropdown-divider.d-none), /* Hidden dividers */
81
88
  li:has(.dropdown-header):not(:has(~ li .dropdown-item:not(.d-none))), /* Headers without any visible items */
82
- li:has(.dropdown-divider):not(:has(~ li .dropdown-item:not(.d-none))) /* Dividers without any trailing items */ {
89
+ li:has(.dropdown-divider):not(:has(~ li .dropdown-item:not(.d-none))) /* Dividers without any trailing items */
90
+ {
83
91
  display: none;
84
92
  }
85
93
  }
86
-
87
- selectedcontent {
88
- white-space: nowrap;
89
- }
90
94
  }
91
95
  }
92
-
96
+
93
97
  .dropdown-item::highlight(platypicker-highlight),
94
98
  .dropdown-item small::highlight(platypicker-highlight) {
95
- background-color: #FEE6B1;
99
+ background-color: #fee6b1;
96
100
  color: black;
97
101
  }
98
102
  }
@@ -342,9 +342,6 @@ export default class Platypicker {
342
342
  for (const selectedOption of this.#select.selectedOptions) {
343
343
  selectedOption["popoverItem"].classList.add("active");
344
344
  }
345
-
346
- if (!this.#select.selectedOptions.length)
347
- this.#select.querySelector("selectedcontent").textContent = "0 selected";
348
345
  }
349
346
 
350
347
  #adjustHighlightRange(item, searchValue) {