@iyulab/components 1.50.0 → 1.51.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,25 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.51.0] - 2026-09-30
4
+
5
+ ### Added
6
+
7
+ - `isImeComposing(event)` — whether a key event belongs to an IME composition (Korean, Japanese,
8
+ Chinese …). It checks `isComposing` and also `keyCode` 229, because Safari delivers the key that
9
+ confirms a composition after `compositionend` with `isComposing` false. Use it in any handler that
10
+ acts on Enter while the user types text.
11
+
12
+ ### Fixed
13
+
14
+ - **`Dialog.prompt` no longer confirms on the Enter that finishes an IME composition** — typing a
15
+ Korean name and pressing Enter closed the dialog before the last syllable was committed.
16
+ - `u-input` no longer submits its form on Safari's composition-confirming Enter (it already ignored
17
+ the Enter that Chrome and Firefox send while composing).
18
+
19
+ ### Documentation
20
+
21
+ - README component list includes `u-expander`.
22
+
3
23
  ## [1.50.0] - 2026-09-29
4
24
 
5
25
  ### Added
package/README.md CHANGED
@@ -100,7 +100,7 @@ npx skills add ./node_modules/@iyulab/components
100
100
 
101
101
  **Navigation** — `u-menu`, `u-menu-item`, `u-tab-panel`, `u-breadcrumb`, `u-breadcrumb-item`, `u-tree`, `u-tree-item`
102
102
 
103
- **Layout & Display** — `u-avatar`, `u-card`, `u-carousel`, `u-divider`, `u-icon`, `u-panel`, `u-split-panel`, `u-tag`, `u-text`
103
+ **Layout & Display** — `u-avatar`, `u-card`, `u-carousel`, `u-divider`, `u-expander`, `u-icon`, `u-panel`, `u-split-panel`, `u-tag`, `u-text`
104
104
 
105
105
  ## Theming
106
106
 
@@ -1,6 +1,7 @@
1
1
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.js";
2
2
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.js";
3
3
  import { UFormControlElement } from "../UFormControlElement.js";
4
+ import { isImeComposing } from "../../utilities/keyboard.js";
4
5
  import "../spinner/USpinner.js";
5
6
  import "../icon/UIcon.js";
6
7
  import { Locale } from "../../utilities/Locale.js";
@@ -356,7 +357,7 @@ var UInput = class UInput extends UFormControlElement {
356
357
  * 아니면 `requestSubmit()` 한다(검증도 그 안에서 돈다).
357
358
  */
358
359
  handleImplicitSubmission(e) {
359
- if (e.isComposing || this.composing || e.shiftKey || e.ctrlKey || e.altKey || e.metaKey) return;
360
+ if (isImeComposing(e) || this.composing || e.shiftKey || e.ctrlKey || e.altKey || e.metaKey) return;
360
361
  setTimeout(() => {
361
362
  const form = this.form;
362
363
  if (e.defaultPrevented || !form || !this.isConnected) return;
package/dist/index.d.ts CHANGED
@@ -64,6 +64,7 @@ export * from './utilities/Dialog.js';
64
64
  export * from './utilities/elements.js';
65
65
  export * from './utilities/format.js';
66
66
  export * from './utilities/icons.js';
67
+ export * from './utilities/keyboard.js';
67
68
  export * from './utilities/Locale.js';
68
69
  export * from './utilities/OverlayManager.js';
69
70
  export * from './utilities/Theme.js';
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ import { UElement } from "./components/UElement.js";
2
2
  import { getParentElement, isCoarsePointer, isFocusCandidate, querySelectorAllWithin, querySelectorDeep, querySelectorWithin } from "./utilities/elements.js";
3
3
  import { UFloatingElement } from "./components/UFloatingElement.js";
4
4
  import { UFormControlElement } from "./components/UFormControlElement.js";
5
+ import { isImeComposing } from "./utilities/keyboard.js";
5
6
  import { OverlayManager } from "./utilities/OverlayManager.js";
6
7
  import { arrayAttrConverter, booleanAttrConverter, dateAttrConverter, jsonAttrConverter, urlAttrConverter } from "./utilities/converters.js";
7
8
  import { UOverlayElement } from "./components/UOverlayElement.js";
@@ -59,4 +60,4 @@ import { BrowserStorage } from "./utilities/BrowserStorage.js";
59
60
  import { Dialog } from "./utilities/Dialog.js";
60
61
  import { Theme } from "./utilities/Theme.js";
61
62
  import { Toast } from "./utilities/Toast.js";
62
- export { ALERT_STATUSES, BrowserStorage, Dialog, IconCache, IconRegistry, Locale, OverlayManager, Theme, Toast, UAlert, UAvatar, UBadge, UBreadcrumb, UBreadcrumbItem, UButton, UButtonGroup, UCard, UCarousel, UCheckbox, UChip, UCopyButton, UDatePicker, UDialog, UDivider, UDrawer, UElement, UExpander, UField, UFileInput, UFloatingElement, UForm, UFormControlElement, UIcon, UIconButton, UInput, UMenu, UMenuItem, UOption, UOverlayElement, UPanel, UPopover, UProgressBar, UProgressRing, URadio, URating, USelect, USkeleton, USlider, USpinner, USplitPanel, USwitch, UTab, UTabPanel, UTag, UText, UTextarea, UTooltip, UTree, UTreeItem, arrayAttrConverter, booleanAttrConverter, createDevWarner, dateAttrConverter, devWarnOnce, formatCurrency, formatDate, formatNumber, getDefaultBaseUrl, getParentElement, isCoarsePointer, isFocusCandidate, jsonAttrConverter, querySelectorAllWithin, querySelectorDeep, querySelectorWithin, resetDevWarnings, setDefaultBaseUrl, urlAttrConverter };
63
+ export { ALERT_STATUSES, BrowserStorage, Dialog, IconCache, IconRegistry, Locale, OverlayManager, Theme, Toast, UAlert, UAvatar, UBadge, UBreadcrumb, UBreadcrumbItem, UButton, UButtonGroup, UCard, UCarousel, UCheckbox, UChip, UCopyButton, UDatePicker, UDialog, UDivider, UDrawer, UElement, UExpander, UField, UFileInput, UFloatingElement, UForm, UFormControlElement, UIcon, UIconButton, UInput, UMenu, UMenuItem, UOption, UOverlayElement, UPanel, UPopover, UProgressBar, UProgressRing, URadio, URating, USelect, USkeleton, USlider, USpinner, USplitPanel, USwitch, UTab, UTabPanel, UTag, UText, UTextarea, UTooltip, UTree, UTreeItem, arrayAttrConverter, booleanAttrConverter, createDevWarner, dateAttrConverter, devWarnOnce, formatCurrency, formatDate, formatNumber, getDefaultBaseUrl, getParentElement, isCoarsePointer, isFocusCandidate, isImeComposing, jsonAttrConverter, querySelectorAllWithin, querySelectorDeep, querySelectorWithin, resetDevWarnings, setDefaultBaseUrl, urlAttrConverter };
@@ -1,3 +1,4 @@
1
+ import { isImeComposing } from "./keyboard.js";
1
2
  import "../components/button/UButton.js";
2
3
  import { Locale } from "./Locale.js";
3
4
  import { UDialog } from "../components/dialog/UDialog.js";
@@ -60,7 +61,7 @@ var Dialog = class {
60
61
  inputValue = e.target.value || "";
61
62
  }}
62
63
  @keydown=${(e) => {
63
- if (e.key === "Enter") {
64
+ if (e.key === "Enter" && !isImeComposing(e)) {
64
65
  const input = e.target;
65
66
  inputValue = input.value || "";
66
67
  const buttons = input.closest("u-dialog").querySelectorAll("u-button");
@@ -1,3 +1,4 @@
1
+ import { isImeComposing } from "./keyboard.js";
1
2
  //#region src/utilities/OverlayManager.ts
2
3
  /**
3
4
  * OverlayManager는 **겹치는 표면 전체의 층(layer)을 소유**합니다.
@@ -86,7 +87,7 @@ var OverlayManager = class OverlayManager {
86
87
  }
87
88
  static {
88
89
  this.handleLayerKeydown = (e) => {
89
- if (e.key !== "Escape" || e.isComposing || e.defaultPrevented) return;
90
+ if (e.key !== "Escape" || isImeComposing(e) || e.defaultPrevented) return;
90
91
  const top = OverlayManager.layers[OverlayManager.layers.length - 1];
91
92
  if (!top) return;
92
93
  if (top.onEscape(e) === false) return;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Whether a key event belongs to an IME composition — typing Korean, Japanese, Chinese and other
3
+ * languages that build a character from several keystrokes.
4
+ *
5
+ * The Enter (or Escape) that confirms a composition is not a command: a handler that submits,
6
+ * commits a cell or closes a layer on Enter should ignore it, or the last syllable is sent twice
7
+ * or the action fires in the middle of a word.
8
+ *
9
+ * `isComposing` alone is not enough — Safari delivers the confirming key after `compositionend`,
10
+ * with `isComposing` false and `keyCode` 229 ("IME is processing").
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * onKeydown(e: KeyboardEvent) {
15
+ * if (e.key !== 'Enter' || isImeComposing(e)) return;
16
+ * this.submit();
17
+ * }
18
+ * ```
19
+ */
20
+ export declare function isImeComposing(e: KeyboardEvent): boolean;
@@ -0,0 +1,25 @@
1
+ //#region src/utilities/keyboard.ts
2
+ /**
3
+ * Whether a key event belongs to an IME composition — typing Korean, Japanese, Chinese and other
4
+ * languages that build a character from several keystrokes.
5
+ *
6
+ * The Enter (or Escape) that confirms a composition is not a command: a handler that submits,
7
+ * commits a cell or closes a layer on Enter should ignore it, or the last syllable is sent twice
8
+ * or the action fires in the middle of a word.
9
+ *
10
+ * `isComposing` alone is not enough — Safari delivers the confirming key after `compositionend`,
11
+ * with `isComposing` false and `keyCode` 229 ("IME is processing").
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * onKeydown(e: KeyboardEvent) {
16
+ * if (e.key !== 'Enter' || isImeComposing(e)) return;
17
+ * this.submit();
18
+ * }
19
+ * ```
20
+ */
21
+ function isImeComposing(e) {
22
+ return e.isComposing || e.keyCode === 229;
23
+ }
24
+ //#endregion
25
+ export { isImeComposing };
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.50.0",
4
+ "version": "1.51.0",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "components",
@@ -134,6 +134,7 @@ carries the control's role, not on the host element. Native nodes use native `di
134
134
  - [`Locale`](./references/utilities/locale.md) — Validation-message locale registry and lookup utility
135
135
  - [`elements`](./references/utilities/elements.md) — Shadow-DOM-aware DOM query helpers
136
136
  - [`format`](./references/utilities/format.md) — Locale-aware number, currency and date formatting
137
+ - [`keyboard`](./references/utilities/keyboard.md) — `isImeComposing` for Enter handlers that must not fire mid-composition (Korean/Japanese/Chinese input)
137
138
  - [`OverlayManager`](./references/utilities/overlay-manager.md) — Internal overlay stack and z-index manager
138
139
 
139
140
  ---
@@ -0,0 +1,27 @@
1
+ # keyboard
2
+
3
+ ```ts
4
+ import { isImeComposing } from '@iyulab/components';
5
+ // or: import { isImeComposing } from '@iyulab/components/dist/utilities/keyboard.js';
6
+ ```
7
+
8
+ ## `isImeComposing(event: KeyboardEvent): boolean`
9
+
10
+ Whether a key event belongs to an IME composition — typing Korean, Japanese, Chinese and other
11
+ languages that build a character from several keystrokes.
12
+
13
+ The Enter (or Escape) that confirms a composition is not a command. A handler that submits, commits a
14
+ cell, or closes a layer on Enter should ignore it; otherwise the action fires in the middle of a word,
15
+ or the last syllable is committed after the action and sent twice.
16
+
17
+ `event.isComposing` alone is not enough: Safari delivers the confirming key after `compositionend`,
18
+ with `isComposing` false and `keyCode` 229. This helper checks both.
19
+
20
+ ```ts
21
+ onKeydown(e: KeyboardEvent) {
22
+ if (e.key !== 'Enter' || isImeComposing(e)) return;
23
+ this.submit();
24
+ }
25
+ ```
26
+
27
+ `u-input` (implicit form submission), `Dialog.prompt`, and the overlay Escape handling already use it.