@lemonadejs/dropdown 3.6.0 → 3.6.2
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/dist/index.d.ts +2 -0
- package/dist/index.js +19 -10
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -437,15 +437,19 @@ if (!Modal && typeof (require) === 'function') {
|
|
|
437
437
|
});
|
|
438
438
|
}
|
|
439
439
|
// Adjust the width
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
width
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
self.width
|
|
440
|
+
if (typeof(self.width) === 'undefined') {
|
|
441
|
+
let w = self.input.offsetWidth;
|
|
442
|
+
if (width < w) {
|
|
443
|
+
width = w;
|
|
444
|
+
}
|
|
445
|
+
// Estimated with based on the text
|
|
446
|
+
if (self.width < width) {
|
|
447
|
+
self.width = width;
|
|
448
|
+
}
|
|
449
|
+
self.el.style.width = self.width + 'px';
|
|
447
450
|
}
|
|
448
|
-
|
|
451
|
+
// Min width for the container
|
|
452
|
+
self.container.parentNode.style.minWidth = self.width + 'px';
|
|
449
453
|
// Height
|
|
450
454
|
self.height = 400;
|
|
451
455
|
// Animation for mobile
|
|
@@ -645,7 +649,10 @@ if (!Modal && typeof (require) === 'function') {
|
|
|
645
649
|
temp = data;
|
|
646
650
|
} else {
|
|
647
651
|
temp = data.filter(item => {
|
|
648
|
-
return item.selected === true ||
|
|
652
|
+
return item.selected === true ||
|
|
653
|
+
(item.text.toLowerCase().includes(value)) ||
|
|
654
|
+
(item.group && item.group.toLowerCase().includes(value)) ||
|
|
655
|
+
(item.keywords.toLowerCase().includes(value));
|
|
649
656
|
});
|
|
650
657
|
}
|
|
651
658
|
// Cursor
|
|
@@ -756,6 +763,8 @@ if (!Modal && typeof (require) === 'function') {
|
|
|
756
763
|
|
|
757
764
|
// Default width
|
|
758
765
|
self.el.style.width = self.width + 'px';
|
|
766
|
+
// Container
|
|
767
|
+
self.container.parentNode.style.minWidth = self.width + 'px';
|
|
759
768
|
|
|
760
769
|
// Focus out of the component
|
|
761
770
|
self.el.addEventListener('focusout', function (e) {
|
|
@@ -864,7 +873,7 @@ if (!Modal && typeof (require) === 'function') {
|
|
|
864
873
|
<div>
|
|
865
874
|
<div :loop="self.result" :ref="self.container" :rows="self.rows">
|
|
866
875
|
<div class="lm-dropdown-item" onclick="self.parent.select" data-cursor="{{self.cursor}}" data-selected="{{self.selected}}" data-group="{{self.header}}">
|
|
867
|
-
<div><img :src="self.image"
|
|
876
|
+
<div><img :src="self.image" /> <div>{{self.text}}</div></div>
|
|
868
877
|
</div>
|
|
869
878
|
</div>
|
|
870
879
|
</div>
|
package/package.json
CHANGED