@iyulab/components 1.34.0 → 1.35.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.35.0] - 2026-08-28
4
+
5
+ ### Added
6
+
7
+ - **`USelect` fires a `search` event on every search-input change when
8
+ `searchable`.** The search text was already computed internally to drive
9
+ the built-in local option filtering, but never surfaced — a consumer
10
+ binding `USelect` to a large server-paginated dataset had no way to hook
11
+ into it and had to rebuild the search UI from scratch to do remote
12
+ search. `search` (`detail: { query: string }`, non-cancelable) fires
13
+ alongside the existing local filtering, so a consumer can subscribe and
14
+ drive remote search without losing the built-in search input. Mapped
15
+ through to the React wrapper as `onSearch`.
16
+
3
17
  ## [1.34.0] - 2026-08-28
4
18
 
5
19
  ### Added
@@ -24,6 +24,9 @@ export type SelectVariant = 'outlined' | 'filled' | 'underlined' | 'borderless';
24
24
  *
25
25
  * @event change - 사용자 상호작용(옵션 클릭·칩 제거·지우기)으로 선택 값이 변경될 때 발생.
26
26
  * 네이티브 select와 동일하게 프로그램적 value 세팅·옵션 등록으로는 발화하지 않는다.
27
+ * @event search - `searchable`일 때 검색 입력이 바뀔 때마다 발생(`detail: { query: string }`).
28
+ * 로컬 필터링(이미 렌더된 `u-option`의 `hidden` 토글)과 별개로 발행되므로, 서버/원격 검색이
29
+ * 필요한 소비자는 이 이벤트를 구독해 자체적으로 옵션을 갱신할 수 있다.
27
30
  */
28
31
  export declare class USelect extends UFormControlElement<string | string[]> {
29
32
  static styles: import('lit').CSSResultGroup[];
@@ -86,6 +86,10 @@ var USelect = class USelect extends UFormControlElement {
86
86
  const value = option.value.toLowerCase();
87
87
  option.hidden = !label.includes(query) && !value.includes(query);
88
88
  }
89
+ this.fire("search", {
90
+ detail: { query },
91
+ cancelable: false
92
+ });
89
93
  };
90
94
  this.handleSearchKeydown = (e) => {
91
95
  const options = this.options.filter((o) => !o.hidden && !o.disabled);
@@ -3,10 +3,11 @@ import { USelect as USelectElement } from '../components/select/USelect';
3
3
 
4
4
  export declare const USelect: React.ForwardRefExoticComponent<
5
5
  Omit<Partial<USelectElement>, keyof React.HTMLAttributes<USelectElement>>
6
- & Omit<React.HTMLAttributes<USelectElement>, 'onChange'>
6
+ & Omit<React.HTMLAttributes<USelectElement>, 'onChange' | 'onSearch'>
7
7
  & React.RefAttributes<USelectElement>
8
8
  & {
9
9
  onChange?: (event: CustomEvent) => void;
10
+ onSearch?: (event: CustomEvent<{ query: string }>) => void;
10
11
  }
11
12
  >;
12
13
 
@@ -8,5 +8,6 @@ export const USelect = createComponent({
8
8
  elementClass: USelectElement,
9
9
  events: {
10
10
  onChange: 'change',
11
+ onSearch: 'search',
11
12
  },
12
13
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iyulab/components",
3
3
  "description": "web-components library based on lit-element made by iyulab",
4
- "version": "1.34.0",
4
+ "version": "1.35.0",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "components",
@@ -59,6 +59,7 @@ Dropdown select with single or multiple selection, search, and clear support. Fo
59
59
  | Event | Description |
60
60
  |-------|-------------|
61
61
  | `change` | Fires when selection changes |
62
+ | `search` | Fires on every search input change when `searchable` (`detail: { query: string }`). Fires alongside the built-in local filtering — subscribe to it to drive remote/server-side search instead of (or in addition to) the local filter |
62
63
 
63
64
  ## Methods
64
65