@iyulab/components 2.0.0 → 2.0.1

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,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.0.1] - 2026-10-05
4
+
5
+ ### Fixed
6
+
7
+ - **A press on a date picker's calendar keeps focus in the picker** (`u-date-picker`,
8
+ `u-date-range-picker`). Pressing a part of the calendar that takes no focus — the month title, the
9
+ weekday row, a gap — moved focus to the page with the calendar still open: the keyboard lost its
10
+ place, and a host that ends an edit on `blur` (a table cell editor) ended it in the middle of
11
+ choosing. Presses on controls (days, buttons, the time input) are unchanged.
12
+
13
+ ### Documentation
14
+
15
+ - README: individual imports use the exported `dist/components/<name>/U<Name>.js` paths (the
16
+ `@iyulab/components/u-button` form shown before was never exported).
17
+
3
18
  ## [2.0.0] - 2026-10-05
4
19
 
5
20
  ### 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/u-button';
24
- import '@iyulab/components/u-input';
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"
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": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "components",