@salesforcedevs/dx-components 0.10.0 → 0.10.1

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": "@salesforcedevs/dx-components",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -29,5 +29,5 @@
29
29
  "@types/debounce": "^1.2.0",
30
30
  "@types/lodash.get": "^4.4.6"
31
31
  },
32
- "gitHead": "f91a2edc71e7a19cbc26ccfd6396637d3a706f56"
32
+ "gitHead": "84ec3fe64f80f136723f84c0222afe7f34c7b2a2"
33
33
  }
@@ -8,7 +8,6 @@
8
8
  open={isDropdownOpen}
9
9
  options={suggestions}
10
10
  onrequestclose={onDropdownRequestClose}
11
- onrequestopen={openPopover}
12
11
  full-width
13
12
  page-padding="0"
14
13
  >
@@ -20,6 +19,7 @@
20
19
  onchange={onInputChange}
21
20
  onclear={onInputEscape}
22
21
  onsubmit={onInputSubmit}
22
+ onfocus={openDropdown}
23
23
  placeholder="Search"
24
24
  size="override"
25
25
  type="search"
@@ -43,10 +43,8 @@
43
43
  open={isDropdownOpen}
44
44
  placement="bottom-end"
45
45
  onrequestclose={onDropdownRequestClose}
46
- onrequestopen={openPopover}
47
46
  offset="small"
48
47
  full-width
49
- temp-id="banana"
50
48
  >
51
49
  <dx-input
52
50
  aria-label="Record Search Term"
@@ -54,7 +52,7 @@
54
52
  onchange={onInputChange}
55
53
  onclear={onInputEscape}
56
54
  onsubmit={onInputSubmit}
57
- onfocus={openPopover}
55
+ onfocus={openDropdown}
58
56
  placeholder="Search"
59
57
  shortcut-key="k"
60
58
  size="small"
@@ -70,7 +70,7 @@ export default class HeaderSearch extends LightningElement {
70
70
  switch (e.detail as PopoverRequestCloseType) {
71
71
  case "interact-outside":
72
72
  case "keypress-escape":
73
- this.closePopover();
73
+ this.closeDropdown();
74
74
  break;
75
75
  default:
76
76
  break;
@@ -124,29 +124,29 @@ export default class HeaderSearch extends LightningElement {
124
124
  const input = this.template.querySelector("dx-input");
125
125
  if (this.isMobileSearchOpen && input) {
126
126
  input.focus();
127
- this.openPopover();
127
+ this.openDropdown();
128
128
  } else {
129
- this.closePopover();
129
+ this.closeDropdown();
130
130
  }
131
131
  if (!this.isMobileSearchOpen && this.searchBox) {
132
132
  this.searchBox.updateText("");
133
133
  }
134
134
  }
135
135
 
136
- private openPopover() {
136
+ private openDropdown() {
137
137
  this.isDropdownOpen = true;
138
138
  this.isMobileSearchOpen = true;
139
139
  this.reportState<boolean>(true);
140
140
  }
141
141
 
142
- private closePopover() {
142
+ private closeDropdown() {
143
143
  this.isDropdownOpen = false;
144
144
  this.isMobileSearchOpen = false;
145
145
  this.reportState<boolean>(false);
146
146
  }
147
147
 
148
148
  private onInputEscape() {
149
- this.closePopover();
149
+ this.closeDropdown();
150
150
  }
151
151
 
152
152
  private reportState<T>(state: T) {
@@ -212,23 +212,27 @@ export default class Popover extends LightningElement {
212
212
  };
213
213
 
214
214
  private onControlClick = () => {
215
- if (this.controlled) {
215
+ if (this.controlled && this.open) {
216
216
  this.dispatchRequestCloseEvent("click-control");
217
217
  return;
218
218
  }
219
219
 
220
+ if (this.controlled && !this.open) {
221
+ this.dispatchEvent(
222
+ new CustomEvent("requestopen", {
223
+ bubbles: true,
224
+ composed: true
225
+ })
226
+ );
227
+ return;
228
+ }
229
+
220
230
  if (this.open) {
221
231
  this.closePopover();
222
232
  return;
223
233
  }
224
234
 
225
235
  this.openPopover();
226
- this.dispatchEvent(
227
- new CustomEvent("requestopen", {
228
- bubbles: true,
229
- composed: true
230
- })
231
- );
232
236
  };
233
237
 
234
238
  private onSlotChange(e: LightningSlotElement) {