lucos_search_component 0.0.11 → 0.0.13

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.
Files changed (3) hide show
  1. package/dist/index.js +12 -8
  2. package/index.js +12 -8
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5608,6 +5608,12 @@ class LucosSearchComponent extends HTMLSpanElement {
5608
5608
  const component = this;
5609
5609
  const shadow = component.attachShadow({mode: 'open'});
5610
5610
 
5611
+ {
5612
+ const tomStyle = document.createElement('style');
5613
+ tomStyle.textContent = tomSelectStylesheet;
5614
+ shadow.appendChild(tomStyle);
5615
+ }
5616
+
5611
5617
  const mainStyle = document.createElement('style');
5612
5618
  mainStyle.textContent = `
5613
5619
  .lozenge {
@@ -5684,20 +5690,15 @@ class LucosSearchComponent extends HTMLSpanElement {
5684
5690
  margin: 0 3px;
5685
5691
  padding: 2px 6px;
5686
5692
  }
5693
+ .ts-dropdown {
5694
+ margin: 0;
5695
+ }
5687
5696
  `;
5688
5697
  shadow.appendChild(mainStyle);
5689
5698
 
5690
- // If webpack is configured with `css-loader` but not `style-loader`, include the tom-select stylesheet here
5691
- // (If `style-loader` is being used, the tom-select stylesheet will be handled by that)
5692
- {
5693
- const tomStyle = document.createElement('style');
5694
- tomStyle.textContent = tomSelectStylesheet;
5695
- shadow.appendChild(tomStyle);
5696
- }
5697
5699
 
5698
5700
  const selector = component.querySelector("select");
5699
5701
  if (!selector) throw new Error("Can't find select element in lucos-search");
5700
- shadow.append(selector);
5701
5702
  selector.setAttribute("multiple", "multiple");
5702
5703
  new TomSelect(selector, {
5703
5704
  valueField: 'id',
@@ -5752,6 +5753,9 @@ class LucosSearchComponent extends HTMLSpanElement {
5752
5753
  },
5753
5754
  },
5754
5755
  });
5756
+ if (selector.nextElementSibling) {
5757
+ shadow.append(selector.nextElementSibling);
5758
+ }
5755
5759
  }
5756
5760
  async searchRequest(searchParams) {
5757
5761
  const key = this.getAttribute("data-api-key");
package/index.js CHANGED
@@ -10,6 +10,12 @@ class LucosSearchComponent extends HTMLSpanElement {
10
10
  const component = this;
11
11
  const shadow = component.attachShadow({mode: 'open'});
12
12
 
13
+ if (tomSelectStylesheet) {
14
+ const tomStyle = document.createElement('style');
15
+ tomStyle.textContent = tomSelectStylesheet;
16
+ shadow.appendChild(tomStyle);
17
+ }
18
+
13
19
  const mainStyle = document.createElement('style');
14
20
  mainStyle.textContent = `
15
21
  .lozenge {
@@ -86,20 +92,15 @@ class LucosSearchComponent extends HTMLSpanElement {
86
92
  margin: 0 3px;
87
93
  padding: 2px 6px;
88
94
  }
95
+ .ts-dropdown {
96
+ margin: 0;
97
+ }
89
98
  `;
90
99
  shadow.appendChild(mainStyle);
91
100
 
92
- // If webpack is configured with `css-loader` but not `style-loader`, include the tom-select stylesheet here
93
- // (If `style-loader` is being used, the tom-select stylesheet will be handled by that)
94
- if (tomSelectStylesheet) {
95
- const tomStyle = document.createElement('style');
96
- tomStyle.textContent = tomSelectStylesheet;
97
- shadow.appendChild(tomStyle);
98
- }
99
101
 
100
102
  const selector = component.querySelector("select");
101
103
  if (!selector) throw new Error("Can't find select element in lucos-search");
102
- shadow.append(selector);
103
104
  selector.setAttribute("multiple", "multiple");
104
105
  new TomSelect(selector, {
105
106
  valueField: 'id',
@@ -154,6 +155,9 @@ class LucosSearchComponent extends HTMLSpanElement {
154
155
  },
155
156
  },
156
157
  });
158
+ if (selector.nextElementSibling) {
159
+ shadow.append(selector.nextElementSibling);
160
+ }
157
161
  }
158
162
  async searchRequest(searchParams) {
159
163
  const key = this.getAttribute("data-api-key");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucos_search_component",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "Web Component for searching lucOS data",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",