@iyulab/components 1.49.1 → 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 +48 -0
- package/README.md +1 -1
- package/dist/components/UFormControlElement.d.ts +29 -2
- package/dist/components/UFormControlElement.js +31 -0
- package/dist/components/UFormControlElement.styles.js +1 -1
- package/dist/components/breadcrumb/UBreadcrumb.d.ts +5 -2
- package/dist/components/breadcrumb/UBreadcrumb.js +18 -21
- package/dist/components/button/UButton.d.ts +6 -0
- package/dist/components/button/UButton.js +16 -5
- package/dist/components/button/UButton.styles.js +1 -1
- package/dist/components/checkbox/UCheckbox.d.ts +8 -0
- package/dist/components/checkbox/UCheckbox.js +10 -2
- package/dist/components/checkbox/UCheckbox.styles.js +2 -2
- package/dist/components/date-picker/UDatePicker.js +5 -5
- package/dist/components/date-picker/UDatePicker.styles.js +4 -4
- package/dist/components/file-input/UFileInput.js +5 -5
- package/dist/components/input/UInput.js +5 -4
- package/dist/components/input/UInput.styles.js +14 -14
- package/dist/components/radio/URadio.js +7 -6
- package/dist/components/radio/URadio.styles.js +1 -1
- package/dist/components/rating/URating.js +7 -7
- package/dist/components/rating/URating.styles.js +1 -1
- package/dist/components/select/USelect.js +6 -6
- package/dist/components/select/USelect.styles.js +15 -15
- package/dist/components/slider/USlider.js +6 -6
- package/dist/components/switch/USwitch.d.ts +8 -0
- package/dist/components/switch/USwitch.js +10 -2
- package/dist/components/switch/USwitch.styles.js +2 -2
- package/dist/components/textarea/UTextarea.js +2 -2
- package/dist/components/textarea/UTextarea.styles.js +15 -15
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/utilities/Dialog.js +2 -1
- package/dist/utilities/OverlayManager.js +2 -1
- package/dist/utilities/keyboard.d.ts +20 -0
- package/dist/utilities/keyboard.js +25 -0
- package/package.json +1 -1
- package/skills/iyulab-components/SKILL.md +1 -0
- package/skills/iyulab-components/references/usage.md +3 -1
- package/skills/iyulab-components/references/utilities/keyboard.md +27 -0
|
@@ -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.
|