@exmg/exm-search 1.1.10 → 1.1.12

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.
@@ -18,8 +18,9 @@ export declare class ExmSearchBase extends ExmgElement {
18
18
  detectOutsideClick(e: Event): void;
19
19
  render(): import("lit-html").TemplateResult<1>;
20
20
  _getValue(): string;
21
- _notifyChange(): void;
22
- _handleClear(e: Event): void;
23
- _handleKeyUp(e: KeyboardEvent): void;
21
+ private notifyChange;
22
+ private handleClear;
23
+ private handleKeyUp;
24
+ private handleBlur;
24
25
  updated(changedProperties: Map<string, any>): void;
25
26
  }
@@ -61,21 +61,18 @@ export class ExmSearchBase extends ExmgElement {
61
61
  placeholder=${this.placeHolder}
62
62
  value=${this.filterValue ? this.filterValue : ''}
63
63
  onfocus="let value = this.value; this.value = null; this.value = value"
64
- @keyup=${this._handleKeyUp}
64
+ @keyup=${this.handleKeyUp}
65
+ @blur=${this.handleBlur}
65
66
  />
66
67
  ${this.filterValue
67
- ? html `
68
- <md-icon-button class="clear" @click=${this._handleClear}><md-icon>clear</md-icon></md-icon-button>
69
- `
68
+ ? html ` <md-icon-button class="clear" @click=${this.handleClear}><md-icon>clear</md-icon></md-icon-button> `
70
69
  : nothing}
71
70
  </div>
72
71
  <div class="mode-default" @click=${() => this.focus()}>
73
72
  <md-icon class="search">search</md-icon>
74
73
  <span class="interactive-content">${this._getValue()}</span>
75
74
  ${this.filterValue
76
- ? html `
77
- <md-icon-button class="clear" @click=${this._handleClear}><md-icon>clear</md-icon></md-icon-button>
78
- `
75
+ ? html ` <md-icon-button class="clear" @click=${this.handleClear}><md-icon>clear</md-icon></md-icon-button> `
79
76
  : nothing}
80
77
  </div>
81
78
  </div>
@@ -84,10 +81,10 @@ export class ExmSearchBase extends ExmgElement {
84
81
  _getValue() {
85
82
  return this.filterValue || this.placeHolder;
86
83
  }
87
- _notifyChange() {
84
+ notifyChange() {
88
85
  this.fire('search-value-change', { value: this.filterValue }, this.bubbles);
89
86
  }
90
- _handleClear(e) {
87
+ handleClear(e) {
91
88
  var _a;
92
89
  e.stopPropagation();
93
90
  e.preventDefault();
@@ -95,19 +92,22 @@ export class ExmSearchBase extends ExmgElement {
95
92
  if (this.search) {
96
93
  this.search.value = '';
97
94
  }
98
- this._notifyChange();
95
+ this.notifyChange();
99
96
  (_a = this.search) === null || _a === void 0 ? void 0 : _a.focus();
100
97
  }
101
- _handleKeyUp(e) {
98
+ handleKeyUp(e) {
102
99
  const input = e.target;
103
100
  if (this.filterValue !== input.value) {
104
101
  this.filterValue = input.value;
105
- this._notifyChange();
102
+ this.notifyChange();
106
103
  }
107
104
  if (e.key === 'Escape') {
108
105
  this._hasFocus = false;
109
106
  }
110
107
  }
108
+ handleBlur() {
109
+ this.fire('search-blur', {}, this.bubbles);
110
+ }
111
111
  updated(changedProperties) {
112
112
  if (changedProperties.has('_hasFocus')) {
113
113
  // after _hasFocus changed to true, focus the input
@@ -5,7 +5,7 @@ export const style = css `
5
5
  --_hover-outline-color: var(--exm-search-hover-outline-color, var(--md-sys-color-on-surface, #1d1b20));
6
6
  --_outline-width: var(--exm-search-outline-width, 1px);
7
7
  --_outline-color: var(--exm-search-outline-color, var(--md-outlined-field-hover-outline-width, 1px));
8
- --_container-shape: var(--exm-search-container-shape, 4px);
8
+ --_container-shape: var(--exm-search-container-shape, 3rem);
9
9
  --_focus-input-text-color: var(--exm-search-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));
10
10
  --_focus-label-text-color: var(--exm-search-focus-label-text-color, var(--md-sys-color-primary, #6750a4));
11
11
  --_focus-icon-color: var(--exm-search-focus-icon-color, var(--md-sys-color-on-surface-variant, #49454f));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exmg/exm-search",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "36f7f6dd58a96ea7edda7af31b25e679555d79c4"
39
+ "gitHead": "1478e41cdcc8b109995cf78f8ccfadd7699c22aa"
40
40
  }