@shoper/phoenix_design_system 1.18.27-1 → 1.18.27-3

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.
@@ -16,8 +16,10 @@ var search_constants = require('../../search_constants.js');
16
16
  exports.HSearchClear = class HSearchClear extends phoenix_light_lit_element.PhoenixLightLitElement {
17
17
  constructor() {
18
18
  super();
19
+ this.isSearchClearFixFlagEnabled = false;
19
20
  this._shouldShow = false;
20
21
  this._isRequestPending = false;
22
+ this._$searchInput = null;
21
23
  this._handleClearButtonOnPhraseEnter = (ev) => {
22
24
  this._updateClearButtonVisibility(ev.detail.searchPhrase);
23
25
  };
@@ -25,8 +27,12 @@ exports.HSearchClear = class HSearchClear extends phoenix_light_lit_element.Phoe
25
27
  this._shouldShow = searchPhrase !== '';
26
28
  };
27
29
  this._handleSearchClear = () => {
30
+ var _a;
28
31
  this._dispatchClearEvent();
29
- this._updateClearButtonVisibility('');
32
+ if (this.isSearchClearFixFlagEnabled) {
33
+ this._updateClearButtonVisibility('');
34
+ (_a = this._$searchInput) === null || _a === void 0 ? void 0 : _a.focus();
35
+ }
30
36
  };
31
37
  this._dispatchClearEvent = () => {
32
38
  this.emitCustomEvent(search_constants.SEARCH_CUSTOM_EVENT_NAMES.clear, {
@@ -38,12 +44,14 @@ exports.HSearchClear = class HSearchClear extends phoenix_light_lit_element.Phoe
38
44
  this._btnController = new btn_controller.BtnController(this, this._handleSearchClear);
39
45
  }
40
46
  connectedCallback() {
41
- var _a;
47
+ var _a, _b, _c;
42
48
  super.connectedCallback();
43
49
  this._searchContextSetup();
44
50
  const $search = this.closest(search_constants.SEARCH_COMPONENT_NAMES.search);
45
- const $searchInput = $search === null || $search === void 0 ? void 0 : $search.querySelector('input[type="search"]');
46
- this._updateClearButtonVisibility((_a = $searchInput === null || $searchInput === void 0 ? void 0 : $searchInput.value) !== null && _a !== void 0 ? _a : '');
51
+ this._$searchInput = (_a = $search === null || $search === void 0 ? void 0 : $search.querySelector('input[type="search"]')) !== null && _a !== void 0 ? _a : null;
52
+ if (this.isSearchClearFixFlagEnabled) {
53
+ this._updateClearButtonVisibility((_c = (_b = this._$searchInput) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : '');
54
+ }
47
55
  this.addEventListener('click', this._handleSearchClear);
48
56
  document.addEventListener(search_constants.SEARCH_CUSTOM_EVENT_NAMES.keyup, this._handleClearButtonOnPhraseEnter);
49
57
  }
@@ -91,6 +99,10 @@ tslib_es6.__decorate([
91
99
  decorators.property({ type: String, attribute: 'module-instance-id' }),
92
100
  tslib_es6.__metadata("design:type", String)
93
101
  ], exports.HSearchClear.prototype, "moduleInstanceId", void 0);
102
+ tslib_es6.__decorate([
103
+ decorators.property({ type: Boolean, attribute: 'is-search-clear-fix-flag-enabled' }),
104
+ tslib_es6.__metadata("design:type", Boolean)
105
+ ], exports.HSearchClear.prototype, "isSearchClearFixFlagEnabled", void 0);
94
106
  tslib_es6.__decorate([
95
107
  decorators.state(),
96
108
  tslib_es6.__metadata("design:type", Boolean)
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,8DAAkE;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,qDAAyD;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,8DAAkE;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,11 +3,13 @@ import { PhoenixLightLitElement } from "../../../../../core/phoenix_light_lit_el
3
3
  export declare class HSearchClear extends PhoenixLightLitElement {
4
4
  private _btnController;
5
5
  moduleInstanceId: string;
6
+ isSearchClearFixFlagEnabled: boolean;
6
7
  private _shouldShow;
7
8
  private _isRequestPending;
8
9
  private _searchContextConsumer;
9
10
  private _searchContext$;
10
11
  private _searchContextObserver;
12
+ private _$searchInput;
11
13
  constructor();
12
14
  connectedCallback(): void;
13
15
  private _handleClearButtonOnPhraseEnter;
@@ -12,8 +12,10 @@ import { SEARCH_CUSTOM_EVENT_NAMES, SEARCH_COMPONENT_NAMES, SEARCH_CLASS_NAMES,
12
12
  let HSearchClear = class HSearchClear extends PhoenixLightLitElement {
13
13
  constructor() {
14
14
  super();
15
+ this.isSearchClearFixFlagEnabled = false;
15
16
  this._shouldShow = false;
16
17
  this._isRequestPending = false;
18
+ this._$searchInput = null;
17
19
  this._handleClearButtonOnPhraseEnter = (ev) => {
18
20
  this._updateClearButtonVisibility(ev.detail.searchPhrase);
19
21
  };
@@ -21,8 +23,12 @@ let HSearchClear = class HSearchClear extends PhoenixLightLitElement {
21
23
  this._shouldShow = searchPhrase !== '';
22
24
  };
23
25
  this._handleSearchClear = () => {
26
+ var _a;
24
27
  this._dispatchClearEvent();
25
- this._updateClearButtonVisibility('');
28
+ if (this.isSearchClearFixFlagEnabled) {
29
+ this._updateClearButtonVisibility('');
30
+ (_a = this._$searchInput) === null || _a === void 0 ? void 0 : _a.focus();
31
+ }
26
32
  };
27
33
  this._dispatchClearEvent = () => {
28
34
  this.emitCustomEvent(SEARCH_CUSTOM_EVENT_NAMES.clear, {
@@ -34,12 +40,14 @@ let HSearchClear = class HSearchClear extends PhoenixLightLitElement {
34
40
  this._btnController = new BtnController(this, this._handleSearchClear);
35
41
  }
36
42
  connectedCallback() {
37
- var _a;
43
+ var _a, _b, _c;
38
44
  super.connectedCallback();
39
45
  this._searchContextSetup();
40
46
  const $search = this.closest(SEARCH_COMPONENT_NAMES.search);
41
- const $searchInput = $search === null || $search === void 0 ? void 0 : $search.querySelector('input[type="search"]');
42
- this._updateClearButtonVisibility((_a = $searchInput === null || $searchInput === void 0 ? void 0 : $searchInput.value) !== null && _a !== void 0 ? _a : '');
47
+ this._$searchInput = (_a = $search === null || $search === void 0 ? void 0 : $search.querySelector('input[type="search"]')) !== null && _a !== void 0 ? _a : null;
48
+ if (this.isSearchClearFixFlagEnabled) {
49
+ this._updateClearButtonVisibility((_c = (_b = this._$searchInput) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : '');
50
+ }
43
51
  this.addEventListener('click', this._handleSearchClear);
44
52
  document.addEventListener(SEARCH_CUSTOM_EVENT_NAMES.keyup, this._handleClearButtonOnPhraseEnter);
45
53
  }
@@ -87,6 +95,10 @@ __decorate([
87
95
  property({ type: String, attribute: 'module-instance-id' }),
88
96
  __metadata("design:type", String)
89
97
  ], HSearchClear.prototype, "moduleInstanceId", void 0);
98
+ __decorate([
99
+ property({ type: Boolean, attribute: 'is-search-clear-fix-flag-enabled' }),
100
+ __metadata("design:type", Boolean)
101
+ ], HSearchClear.prototype, "isSearchClearFixFlagEnabled", void 0);
90
102
  __decorate([
91
103
  state(),
92
104
  __metadata("design:type", Boolean)
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,8DAAkE;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,qDAAyD;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,8DAAkE;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@shoper/phoenix_design_system",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "1.18.27-1",
5
+ "version": "1.18.27-3",
6
6
  "description": "phoenix design system",
7
7
  "author": "zefirek",
8
8
  "license": "MIT",