@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 CHANGED
@@ -22,6 +22,8 @@ declare namespace Dropdown {
22
22
  disabled?: boolean;
23
23
  /** Color for the item */
24
24
  color?: string;
25
+ // Keywords
26
+ keywords?: string;
25
27
  }
26
28
 
27
29
  interface Options {
package/dist/index.js CHANGED
@@ -437,15 +437,19 @@ if (!Modal && typeof (require) === 'function') {
437
437
  });
438
438
  }
439
439
  // Adjust the width
440
- let w = self.input.offsetWidth;
441
- if (width < w) {
442
- width = w;
443
- }
444
- // Estimated with based on the text
445
- if (self.width < width) {
446
- self.width = 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
- self.el.style.width = self.width + 'px';
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 || (item.text.toLowerCase().includes(value)) || (item.group && item.group.toLowerCase().includes(value));
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" /><span>{{self.text}}</span></div>
876
+ <div><img :src="self.image" /> <div>{{self.text}}</div></div>
868
877
  </div>
869
878
  </div>
870
879
  </div>
package/package.json CHANGED
@@ -19,5 +19,5 @@
19
19
  },
20
20
  "main": "dist/index.js",
21
21
  "types": "dist/index.d.ts",
22
- "version": "3.6.0"
22
+ "version": "3.6.2"
23
23
  }