@shoper/phoenix_design_system 1.11.0-1 → 1.11.0-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/build/cjs/packages/phoenix/src/components/form/search/search.js +13 -10
- package/build/cjs/packages/phoenix/src/components/form/search/search.js.map +1 -1
- package/build/cjs/packages/phoenix/src/controllers/btn_controller/btn_controller.js +2 -2
- package/build/esm/packages/phoenix/src/components/form/search/search.d.ts +0 -2
- package/build/esm/packages/phoenix/src/components/form/search/search.js +14 -11
- package/build/esm/packages/phoenix/src/components/form/search/search.js.map +1 -1
- package/build/esm/packages/phoenix/src/controllers/btn_controller/btn_controller.d.ts +1 -1
- package/build/esm/packages/phoenix/src/controllers/btn_controller/btn_controller.js +2 -2
- package/build/esm/packages/phoenix/src/controllers/btn_controller/btn_controller_types.d.ts +0 -1
- package/package.json +1 -1
|
@@ -7,7 +7,6 @@ var lit = require('lit');
|
|
|
7
7
|
var decorators = require('lit/decorators');
|
|
8
8
|
var phoenix_light_lit_element = require('../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
9
9
|
var phoenix_custom_element = require('../../../core/decorators/phoenix_custom_element.js');
|
|
10
|
-
var btn_controller = require('../../../controllers/btn_controller/btn_controller.js');
|
|
11
10
|
var icon_constants = require('../../icon/icon_constants.js');
|
|
12
11
|
var observer = require('../../../core/classes/observer/observer.js');
|
|
13
12
|
var context_consumer_controller = require('../../../core/context/context_consumer_controller.js');
|
|
@@ -16,7 +15,6 @@ var context_provider_controller = require('../../../core/context/context_provide
|
|
|
16
15
|
var global_constants = require('../../../global_constants.js');
|
|
17
16
|
var when = require('../../../../../../external/lit/external/lit-html/directives/when.js');
|
|
18
17
|
var search_constants = require('./search_constants.js');
|
|
19
|
-
var ref = require('lit/directives/ref');
|
|
20
18
|
|
|
21
19
|
exports.HSearch = class HSearch extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
22
20
|
constructor() {
|
|
@@ -33,8 +31,8 @@ exports.HSearch = class HSearch extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
33
31
|
});
|
|
34
32
|
this._activeItemId = -1;
|
|
35
33
|
this._translations = {};
|
|
36
|
-
this._openSearchButtonRef = ref.createRef();
|
|
37
34
|
this._bindKeys = (ev) => {
|
|
35
|
+
var _a;
|
|
38
36
|
const searchItemsCount = this._getSearchItemsCount();
|
|
39
37
|
switch (ev.key) {
|
|
40
38
|
case 'ArrowDown':
|
|
@@ -58,6 +56,15 @@ exports.HSearch = class HSearch extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
58
56
|
this._inputField.blur();
|
|
59
57
|
this._resetSearchView();
|
|
60
58
|
break;
|
|
59
|
+
case 'Tab':
|
|
60
|
+
const isFocusedOnSearchInput = !!((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.matches('input[type="search"]'));
|
|
61
|
+
if (!isFocusedOnSearchInput) {
|
|
62
|
+
const searchBar = this.querySelector(`.${search_constants.SEARCH_CLASS_NAMES.searchBar}`);
|
|
63
|
+
searchBar === null || searchBar === void 0 ? void 0 : searchBar.classList.remove(search_constants.SEARCH_CLASS_NAMES.outline);
|
|
64
|
+
this._resetSearchView();
|
|
65
|
+
document.removeEventListener('keyup', this._bindKeys);
|
|
66
|
+
}
|
|
67
|
+
break;
|
|
61
68
|
}
|
|
62
69
|
};
|
|
63
70
|
this._getSearchItemsCount = () => {
|
|
@@ -108,10 +115,6 @@ exports.HSearch = class HSearch extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
108
115
|
this._searchInput = this.querySelector(search_constants.SEARCH_COMPONENT_NAMES.searchInput);
|
|
109
116
|
this._setupInitialSearchPhrase();
|
|
110
117
|
this._setupListeners();
|
|
111
|
-
if (this._openSearchButtonRef.value)
|
|
112
|
-
this._btnController = new btn_controller.BtnController(this, this._handleOpenSearch, {
|
|
113
|
-
target: this._openSearchButtonRef.value
|
|
114
|
-
});
|
|
115
118
|
}
|
|
116
119
|
disconnectedCallback() {
|
|
117
120
|
super.disconnectedCallback();
|
|
@@ -149,7 +152,7 @@ exports.HSearch = class HSearch extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
149
152
|
searchBar === null || searchBar === void 0 ? void 0 : searchBar.classList.add(search_constants.SEARCH_CLASS_NAMES.outline);
|
|
150
153
|
const shouldShowMessage = ev.detail.searchPhrase !== '';
|
|
151
154
|
this._updateSearchView(ev.detail.searchPhrase, shouldShowMessage, false);
|
|
152
|
-
document.addEventListener('
|
|
155
|
+
document.addEventListener('keyup', this._bindKeys);
|
|
153
156
|
});
|
|
154
157
|
this.addEventListener(search_constants.SEARCH_CUSTOM_EVENT_NAMES.keyup, (ev) => {
|
|
155
158
|
const shouldShowMessage = ev.detail.searchPhrase !== '';
|
|
@@ -249,7 +252,7 @@ exports.HSearch = class HSearch extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
249
252
|
const searchBar = this.querySelector(`.${search_constants.SEARCH_CLASS_NAMES.searchBar}`);
|
|
250
253
|
searchBar === null || searchBar === void 0 ? void 0 : searchBar.classList.remove(search_constants.SEARCH_CLASS_NAMES.outline);
|
|
251
254
|
this._hideHistorySuggestionsAndResults();
|
|
252
|
-
document.removeEventListener('
|
|
255
|
+
document.removeEventListener('keyup', this._bindKeys);
|
|
253
256
|
}
|
|
254
257
|
_submitSearchPhrase(searchPhrase) {
|
|
255
258
|
this._dispatchEventWithSearchPhrase(search_constants.SEARCH_CUSTOM_EVENT_NAMES.searchPhraseSubmitted, searchPhrase);
|
|
@@ -268,7 +271,7 @@ exports.HSearch = class HSearch extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
268
271
|
}
|
|
269
272
|
render() {
|
|
270
273
|
return lit.html `
|
|
271
|
-
<div
|
|
274
|
+
<div class="${search_constants.SEARCH_CLASS_NAMES.icon} labeled-icon" @click=${this._handleOpenSearch}>
|
|
272
275
|
<h-icon icon-name="icon-search" size=${icon_constants.ICONS_SIZES.l}></h-icon>
|
|
273
276
|
<div class="labeled-icon__signature">${this._translations.search}</div>
|
|
274
277
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qEAA6E;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -7,7 +7,7 @@ var utilities = require('@dreamcommerce/utilities');
|
|
|
7
7
|
var keystrokes_controller = require('../keystrokes_controller/keystrokes_controller.js');
|
|
8
8
|
|
|
9
9
|
class BtnController {
|
|
10
|
-
constructor(host, callback, { isNavigable = true
|
|
10
|
+
constructor(host, callback, { isNavigable = true } = {}) {
|
|
11
11
|
(this.host = host).addController(this);
|
|
12
12
|
isNavigable ? utilities.UiDomUtils.makeNavigable(this.host) : utilities.UiDomUtils.makeUnnavigable(this.host);
|
|
13
13
|
this.host.setAttribute('role', 'button');
|
|
@@ -15,7 +15,7 @@ class BtnController {
|
|
|
15
15
|
host,
|
|
16
16
|
keys: ['enter', ' '],
|
|
17
17
|
callback,
|
|
18
|
-
target:
|
|
18
|
+
target: host
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
hostConnected() { }
|
|
@@ -22,8 +22,6 @@ export declare class HSearch extends PhoenixLightLitElement {
|
|
|
22
22
|
private _historyContext;
|
|
23
23
|
private _activeItemId;
|
|
24
24
|
private _translations;
|
|
25
|
-
private _openSearchButtonRef;
|
|
26
|
-
private _btnController;
|
|
27
25
|
connectedCallback(): Promise<void>;
|
|
28
26
|
disconnectedCallback(): void;
|
|
29
27
|
private _setupContext;
|
|
@@ -3,7 +3,6 @@ import { html } from 'lit';
|
|
|
3
3
|
import { property, state } from 'lit/decorators';
|
|
4
4
|
import { PhoenixLightLitElement } from '../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
5
5
|
import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
|
|
6
|
-
import { BtnController } from '../../../controllers/btn_controller/btn_controller.js';
|
|
7
6
|
import { ICONS_SIZES } from '../../icon/icon_constants.js';
|
|
8
7
|
import { Observer } from '../../../core/classes/observer/observer.js';
|
|
9
8
|
import { ContextConsumerController } from '../../../core/context/context_consumer_controller.js';
|
|
@@ -11,8 +10,7 @@ import { BehaviorSubject } from '../../../core/classes/behavior_subject/behavior
|
|
|
11
10
|
import { ContextProviderController } from '../../../core/context/context_provider_controller.js';
|
|
12
11
|
import { BREAKPOINTS } from '../../../global_constants.js';
|
|
13
12
|
import { when as n } from '../../../../../../external/lit/external/lit-html/directives/when.js';
|
|
14
|
-
import { DEFAULT_VIEW,
|
|
15
|
-
import { createRef, ref } from 'lit/directives/ref';
|
|
13
|
+
import { DEFAULT_VIEW, SEARCH_CLASS_NAMES, SCROLL_DIRECTIONS, SEARCH_CONFIGURATION, SEARCH_COMPONENT_NAMES, SEARCH_CONTEXT_NAMES, SEARCH_CUSTOM_EVENT_NAMES } from './search_constants.js';
|
|
16
14
|
|
|
17
15
|
let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
18
16
|
constructor() {
|
|
@@ -29,8 +27,8 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
|
29
27
|
});
|
|
30
28
|
this._activeItemId = -1;
|
|
31
29
|
this._translations = {};
|
|
32
|
-
this._openSearchButtonRef = createRef();
|
|
33
30
|
this._bindKeys = (ev) => {
|
|
31
|
+
var _a;
|
|
34
32
|
const searchItemsCount = this._getSearchItemsCount();
|
|
35
33
|
switch (ev.key) {
|
|
36
34
|
case 'ArrowDown':
|
|
@@ -54,6 +52,15 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
|
54
52
|
this._inputField.blur();
|
|
55
53
|
this._resetSearchView();
|
|
56
54
|
break;
|
|
55
|
+
case 'Tab':
|
|
56
|
+
const isFocusedOnSearchInput = !!((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.matches('input[type="search"]'));
|
|
57
|
+
if (!isFocusedOnSearchInput) {
|
|
58
|
+
const searchBar = this.querySelector(`.${SEARCH_CLASS_NAMES.searchBar}`);
|
|
59
|
+
searchBar === null || searchBar === void 0 ? void 0 : searchBar.classList.remove(SEARCH_CLASS_NAMES.outline);
|
|
60
|
+
this._resetSearchView();
|
|
61
|
+
document.removeEventListener('keyup', this._bindKeys);
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
57
64
|
}
|
|
58
65
|
};
|
|
59
66
|
this._getSearchItemsCount = () => {
|
|
@@ -104,10 +111,6 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
|
104
111
|
this._searchInput = this.querySelector(SEARCH_COMPONENT_NAMES.searchInput);
|
|
105
112
|
this._setupInitialSearchPhrase();
|
|
106
113
|
this._setupListeners();
|
|
107
|
-
if (this._openSearchButtonRef.value)
|
|
108
|
-
this._btnController = new BtnController(this, this._handleOpenSearch, {
|
|
109
|
-
target: this._openSearchButtonRef.value
|
|
110
|
-
});
|
|
111
114
|
}
|
|
112
115
|
disconnectedCallback() {
|
|
113
116
|
super.disconnectedCallback();
|
|
@@ -145,7 +148,7 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
|
145
148
|
searchBar === null || searchBar === void 0 ? void 0 : searchBar.classList.add(SEARCH_CLASS_NAMES.outline);
|
|
146
149
|
const shouldShowMessage = ev.detail.searchPhrase !== '';
|
|
147
150
|
this._updateSearchView(ev.detail.searchPhrase, shouldShowMessage, false);
|
|
148
|
-
document.addEventListener('
|
|
151
|
+
document.addEventListener('keyup', this._bindKeys);
|
|
149
152
|
});
|
|
150
153
|
this.addEventListener(SEARCH_CUSTOM_EVENT_NAMES.keyup, (ev) => {
|
|
151
154
|
const shouldShowMessage = ev.detail.searchPhrase !== '';
|
|
@@ -245,7 +248,7 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
|
245
248
|
const searchBar = this.querySelector(`.${SEARCH_CLASS_NAMES.searchBar}`);
|
|
246
249
|
searchBar === null || searchBar === void 0 ? void 0 : searchBar.classList.remove(SEARCH_CLASS_NAMES.outline);
|
|
247
250
|
this._hideHistorySuggestionsAndResults();
|
|
248
|
-
document.removeEventListener('
|
|
251
|
+
document.removeEventListener('keyup', this._bindKeys);
|
|
249
252
|
}
|
|
250
253
|
_submitSearchPhrase(searchPhrase) {
|
|
251
254
|
this._dispatchEventWithSearchPhrase(SEARCH_CUSTOM_EVENT_NAMES.searchPhraseSubmitted, searchPhrase);
|
|
@@ -264,7 +267,7 @@ let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
|
264
267
|
}
|
|
265
268
|
render() {
|
|
266
269
|
return html `
|
|
267
|
-
<div
|
|
270
|
+
<div class="${SEARCH_CLASS_NAMES.icon} labeled-icon" @click=${this._handleOpenSearch}>
|
|
268
271
|
<h-icon icon-name="icon-search" size=${ICONS_SIZES.l}></h-icon>
|
|
269
272
|
<div class="labeled-icon__signature">${this._translations.search}</div>
|
|
270
273
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,qEAA6E;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -3,7 +3,7 @@ import { TBtnControllerOption } from "./btn_controller_types";
|
|
|
3
3
|
export declare class BtnController implements ReactiveController {
|
|
4
4
|
host: ReactiveControllerHost & HTMLElement;
|
|
5
5
|
private _keystrokesController;
|
|
6
|
-
constructor(host: ReactiveControllerHost & HTMLElement, callback: (ev: Event) => void, { isNavigable
|
|
6
|
+
constructor(host: ReactiveControllerHost & HTMLElement, callback: (ev: Event) => void, { isNavigable }?: TBtnControllerOption);
|
|
7
7
|
hostConnected(): void;
|
|
8
8
|
hostDisconnected(): void;
|
|
9
9
|
}
|
|
@@ -3,7 +3,7 @@ import { UiDomUtils } from '@dreamcommerce/utilities';
|
|
|
3
3
|
import { KeystrokesController } from '../keystrokes_controller/keystrokes_controller.js';
|
|
4
4
|
|
|
5
5
|
class BtnController {
|
|
6
|
-
constructor(host, callback, { isNavigable = true
|
|
6
|
+
constructor(host, callback, { isNavigable = true } = {}) {
|
|
7
7
|
(this.host = host).addController(this);
|
|
8
8
|
isNavigable ? UiDomUtils.makeNavigable(this.host) : UiDomUtils.makeUnnavigable(this.host);
|
|
9
9
|
this.host.setAttribute('role', 'button');
|
|
@@ -11,7 +11,7 @@ class BtnController {
|
|
|
11
11
|
host,
|
|
12
12
|
keys: ['enter', ' '],
|
|
13
13
|
callback,
|
|
14
|
-
target:
|
|
14
|
+
target: host
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
hostConnected() { }
|