@salla.sa/twilight-components 2.9.5 → 2.9.6

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.
@@ -20969,8 +20969,9 @@ const SallaSearch = class {
20969
20969
  this.container.classList.remove('s-search-no-results');
20970
20970
  }
20971
20971
  handleKeyDown(ev) {
20972
- if (ev.key === 'Enter') {
20973
- window.location.href = salla.url.get('/search?q=' + encodeURI(this.search_term));
20972
+ var _a;
20973
+ if (ev.key === 'Enter' && ((_a = this.search_term) === null || _a === void 0 ? void 0 : _a.length)) {
20974
+ window.location.href = salla.url.get('search?q=' + encodeURI(this.search_term));
20974
20975
  }
20975
20976
  }
20976
20977
  getDefaultProductSlot() {
@@ -20989,9 +20990,9 @@ const SallaSearch = class {
20989
20990
  this.search_term = event.target.value;
20990
20991
  }, 500);
20991
20992
  }
20992
- handelSearch(val) {
20993
+ handleSearch(val) {
20993
20994
  this.inputValue = val;
20994
- if (val.length > 2) {
20995
+ if (val.length > 1) {
20995
20996
  this.search(val);
20996
20997
  }
20997
20998
  else {
@@ -21037,7 +21038,7 @@ const SallaSearch = class {
21037
21038
  }
21038
21039
  get host() { return index$1.getElement(this); }
21039
21040
  static get watchers() { return {
21040
- "search_term": ["handelSearch"]
21041
+ "search_term": ["handleSearch"]
21041
21042
  }; }
21042
21043
  };
21043
21044
  SallaSearch.style = sallaSearchCss;
@@ -46,8 +46,9 @@ export class SallaSearch {
46
46
  this.container.classList.remove('s-search-no-results');
47
47
  }
48
48
  handleKeyDown(ev) {
49
- if (ev.key === 'Enter') {
50
- window.location.href = salla.url.get('/search?q=' + encodeURI(this.search_term));
49
+ var _a;
50
+ if (ev.key === 'Enter' && ((_a = this.search_term) === null || _a === void 0 ? void 0 : _a.length)) {
51
+ window.location.href = salla.url.get('search?q=' + encodeURI(this.search_term));
51
52
  }
52
53
  }
53
54
  getDefaultProductSlot() {
@@ -66,9 +67,9 @@ export class SallaSearch {
66
67
  this.search_term = event.target.value;
67
68
  }, 500);
68
69
  }
69
- handelSearch(val) {
70
+ handleSearch(val) {
70
71
  this.inputValue = val;
71
- if (val.length > 2) {
72
+ if (val.length > 1) {
72
73
  this.search(val);
73
74
  }
74
75
  else {
@@ -191,7 +192,7 @@ export class SallaSearch {
191
192
  static get elementRef() { return "host"; }
192
193
  static get watchers() { return [{
193
194
  "propName": "search_term",
194
- "methodName": "handelSearch"
195
+ "methodName": "handleSearch"
195
196
  }]; }
196
197
  static get listeners() { return [{
197
198
  "name": "keydown",
@@ -50,8 +50,9 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
50
50
  this.container.classList.remove('s-search-no-results');
51
51
  }
52
52
  handleKeyDown(ev) {
53
- if (ev.key === 'Enter') {
54
- window.location.href = salla.url.get('/search?q=' + encodeURI(this.search_term));
53
+ var _a;
54
+ if (ev.key === 'Enter' && ((_a = this.search_term) === null || _a === void 0 ? void 0 : _a.length)) {
55
+ window.location.href = salla.url.get('search?q=' + encodeURI(this.search_term));
55
56
  }
56
57
  }
57
58
  getDefaultProductSlot() {
@@ -70,9 +71,9 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
70
71
  this.search_term = event.target.value;
71
72
  }, 500);
72
73
  }
73
- handelSearch(val) {
74
+ handleSearch(val) {
74
75
  this.inputValue = val;
75
- if (val.length > 2) {
76
+ if (val.length > 1) {
76
77
  this.search(val);
77
78
  }
78
79
  else {
@@ -118,7 +119,7 @@ const SallaSearch$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
118
119
  }
119
120
  get host() { return this; }
120
121
  static get watchers() { return {
121
- "search_term": ["handelSearch"]
122
+ "search_term": ["handleSearch"]
122
123
  }; }
123
124
  static get style() { return sallaSearchCss; }
124
125
  }, [0, "salla-search", {
@@ -20965,8 +20965,9 @@ const SallaSearch = class {
20965
20965
  this.container.classList.remove('s-search-no-results');
20966
20966
  }
20967
20967
  handleKeyDown(ev) {
20968
- if (ev.key === 'Enter') {
20969
- window.location.href = salla.url.get('/search?q=' + encodeURI(this.search_term));
20968
+ var _a;
20969
+ if (ev.key === 'Enter' && ((_a = this.search_term) === null || _a === void 0 ? void 0 : _a.length)) {
20970
+ window.location.href = salla.url.get('search?q=' + encodeURI(this.search_term));
20970
20971
  }
20971
20972
  }
20972
20973
  getDefaultProductSlot() {
@@ -20985,9 +20986,9 @@ const SallaSearch = class {
20985
20986
  this.search_term = event.target.value;
20986
20987
  }, 500);
20987
20988
  }
20988
- handelSearch(val) {
20989
+ handleSearch(val) {
20989
20990
  this.inputValue = val;
20990
- if (val.length > 2) {
20991
+ if (val.length > 1) {
20991
20992
  this.search(val);
20992
20993
  }
20993
20994
  else {
@@ -21033,7 +21034,7 @@ const SallaSearch = class {
21033
21034
  }
21034
21035
  get host() { return getElement(this); }
21035
21036
  static get watchers() { return {
21036
- "search_term": ["handelSearch"]
21037
+ "search_term": ["handleSearch"]
21037
21038
  }; }
21038
21039
  };
21039
21040
  SallaSearch.style = sallaSearchCss;