@iyulab/components 2.0.0 → 2.0.2
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 +35 -0
- package/README.md +3 -3
- package/dist/components/calendar/date-text-controller.d.ts +5 -0
- package/dist/components/calendar/date-text-controller.js +7 -0
- package/dist/components/date-picker/UDatePicker.js +1 -1
- package/dist/components/date-range-picker/UDateRangePicker.js +1 -1
- package/dist/components/select/USelect.js +1 -0
- package/dist/components/tab-panel/UTabPanel.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.0.2] - 2026-10-06
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **Space on a `u-select` option selects without scrolling the list.** In a `multiple` select the
|
|
8
|
+
list stays open, and each Space toggled the option *and* scrolled the list, carrying the focused
|
|
9
|
+
option away from the pointer's view. Enter and Space now only select.
|
|
10
|
+
- **Space on a `u-tab` selects the tab without scrolling the page.**
|
|
11
|
+
- **Keys pressed on a tab's close button belong to the button** (`u-tab[removable]` in
|
|
12
|
+
`u-tab-panel`). An arrow key on the close button moved to the next tab, and Enter selected the tab
|
|
13
|
+
being closed before closing it. The tab keyboard model now applies only while the tab itself has
|
|
14
|
+
focus.
|
|
15
|
+
|
|
16
|
+
### Tests
|
|
17
|
+
|
|
18
|
+
- Keyboard contracts of `u-radio` (arrows move focus and selection together and wrap, Home/End,
|
|
19
|
+
disabled options skipped, one tab stop) and `u-select` (open with Enter, arrows/Home/End on
|
|
20
|
+
options, Enter/Space select, Escape closes and returns focus, search field arrows to the
|
|
21
|
+
first/last visible option) are now pressed with real key input.
|
|
22
|
+
|
|
23
|
+
## [2.0.1] - 2026-10-05
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- **A press on a date picker's calendar keeps focus in the picker** (`u-date-picker`,
|
|
28
|
+
`u-date-range-picker`). Pressing a part of the calendar that takes no focus — the month title, the
|
|
29
|
+
weekday row, a gap — moved focus to the page with the calendar still open: the keyboard lost its
|
|
30
|
+
place, and a host that ends an edit on `blur` (a table cell editor) ended it in the middle of
|
|
31
|
+
choosing. Presses on controls (days, buttons, the time input) are unchanged.
|
|
32
|
+
|
|
33
|
+
### Documentation
|
|
34
|
+
|
|
35
|
+
- README: individual imports use the exported `dist/components/<name>/U<Name>.js` paths (the
|
|
36
|
+
`@iyulab/components/u-button` form shown before was never exported).
|
|
37
|
+
|
|
3
38
|
## [2.0.0] - 2026-10-05
|
|
4
39
|
|
|
5
40
|
### Changed (breaking)
|
package/README.md
CHANGED
|
@@ -19,9 +19,9 @@ import '@iyulab/components/styles/tokens.css';
|
|
|
19
19
|
// 전체 import
|
|
20
20
|
import '@iyulab/components';
|
|
21
21
|
|
|
22
|
-
// 개별 import
|
|
23
|
-
import '@iyulab/components/
|
|
24
|
-
import '@iyulab/components/
|
|
22
|
+
// 개별 import (등록 부수효과만 — 쓰는 컴포넌트만 번들에 들어간다)
|
|
23
|
+
import '@iyulab/components/dist/components/button/UButton.js';
|
|
24
|
+
import '@iyulab/components/dist/components/input/UInput.js';
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
> **토큰 시트는 선택이 아니다.** 컴포넌트의 모든 색·테두리·배경은 `var(--u-…)` 로 해석되며,
|
|
@@ -54,6 +54,11 @@ export declare class DateTextController implements ReactiveController {
|
|
|
54
54
|
/** A click on the field (not on its clear or calendar button) opens the calendar and keeps the
|
|
55
55
|
* caret in the text box — the person can pick a day or keep typing. */
|
|
56
56
|
handleContainerClick: (e: MouseEvent) => void;
|
|
57
|
+
/** A press on a part of the calendar that takes no focus — the month title, the weekday row, the
|
|
58
|
+
* gaps — keeps focus where it is, inside the control. Without this the browser moves focus to the
|
|
59
|
+
* page: the control loses its place for the keyboard, and a host that ends an edit on `blur`
|
|
60
|
+
* (a table cell editor) ends it in the middle of choosing. Presses on controls are untouched. */
|
|
61
|
+
holdFocus: (e: MouseEvent) => void;
|
|
57
62
|
handleCalendarButtonClick: (e: MouseEvent) => void;
|
|
58
63
|
/** Turns the typed text into the value. Empty text clears it; unreadable text also clears it and
|
|
59
64
|
* reports `badInput` while the text stays to be fixed (the native date input does the same). */
|
|
@@ -32,6 +32,13 @@ var DateTextController = class {
|
|
|
32
32
|
if (input && root && root.activeElement !== input) input.focus();
|
|
33
33
|
this.open(false);
|
|
34
34
|
};
|
|
35
|
+
this.holdFocus = (e) => {
|
|
36
|
+
for (const node of e.composedPath()) {
|
|
37
|
+
if (node === e.currentTarget) break;
|
|
38
|
+
if (node instanceof HTMLElement && (node.tabIndex >= 0 || node.matches("button, input, select, textarea"))) return;
|
|
39
|
+
}
|
|
40
|
+
e.preventDefault();
|
|
41
|
+
};
|
|
35
42
|
this.handleCalendarButtonClick = (e) => {
|
|
36
43
|
e.stopPropagation();
|
|
37
44
|
if (this.options.popover()?.open) {
|
|
@@ -236,7 +236,7 @@ var UDatePicker = class UDatePicker extends UFormControlElement {
|
|
|
236
236
|
}
|
|
237
237
|
renderCalendar() {
|
|
238
238
|
return html`
|
|
239
|
-
<div class="calendar" part="calendar">
|
|
239
|
+
<div class="calendar" part="calendar" @mousedown=${this.textEntry.holdFocus}>
|
|
240
240
|
<u-calendar
|
|
241
241
|
exportparts="calendar-header, calendar-title, calendar-weekdays, calendar-grid, calendar-week, day"
|
|
242
242
|
.value=${this.working ? toISODate(splitValue(this.working).date) : void 0}
|
|
@@ -276,7 +276,7 @@ var UDateRangePicker = class UDateRangePicker extends UFormControlElement {
|
|
|
276
276
|
return html`
|
|
277
277
|
<div class="body">
|
|
278
278
|
${presets.length ? this.renderPresets(presets) : ""}
|
|
279
|
-
<div class="calendar" part="calendar">
|
|
279
|
+
<div class="calendar" part="calendar" @mousedown=${this.textEntry.holdFocus}>
|
|
280
280
|
<u-calendar
|
|
281
281
|
exportparts="calendar-month, calendar-header, calendar-title, calendar-weekdays, calendar-grid, calendar-week, day"
|
|
282
282
|
selection="range"
|
|
@@ -44,6 +44,7 @@ var UTabPanel = class UTabPanel extends UElement {
|
|
|
44
44
|
this.change(tab.value);
|
|
45
45
|
};
|
|
46
46
|
this.handleTabKeydown = (e) => {
|
|
47
|
+
if (e.composedPath()[0] !== e.currentTarget) return;
|
|
47
48
|
const enabledTabs = this.tabs.filter((t) => !t.disabled);
|
|
48
49
|
const currentIndex = enabledTabs.indexOf(e.currentTarget);
|
|
49
50
|
if (currentIndex === -1) return;
|
|
@@ -63,6 +64,7 @@ var UTabPanel = class UTabPanel extends UElement {
|
|
|
63
64
|
break;
|
|
64
65
|
case "Enter":
|
|
65
66
|
case " ":
|
|
67
|
+
e.preventDefault();
|
|
66
68
|
this.change(enabledTabs[currentIndex].value);
|
|
67
69
|
return;
|
|
68
70
|
default: return;
|