@iyulab/components 1.57.0 → 1.58.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/assets/locales/ar.json.js +12 -2
  3. package/dist/assets/locales/de.json.js +12 -2
  4. package/dist/assets/locales/en.json.js +12 -2
  5. package/dist/assets/locales/es.json.js +14 -2
  6. package/dist/assets/locales/fr.json.js +12 -2
  7. package/dist/assets/locales/id.json.js +12 -2
  8. package/dist/assets/locales/ja.json.js +14 -2
  9. package/dist/assets/locales/ko.json.js +14 -2
  10. package/dist/assets/locales/pt-BR.json.js +12 -2
  11. package/dist/assets/locales/ru.json.js +12 -2
  12. package/dist/assets/locales/th.json.js +14 -2
  13. package/dist/assets/locales/vi.json.js +12 -2
  14. package/dist/assets/locales/zh-CN.json.js +14 -2
  15. package/dist/assets/locales/zh-TW.json.js +14 -2
  16. package/dist/components/calendar/UCalendar.d.ts +4 -0
  17. package/dist/components/calendar/UCalendar.js +5 -4
  18. package/dist/components/calendar/date-text-controller.d.ts +62 -0
  19. package/dist/components/calendar/date-text-controller.js +90 -0
  20. package/dist/components/calendar/dates.d.ts +4 -0
  21. package/dist/components/calendar/dates.js +5 -1
  22. package/dist/components/calendar/datetime.d.ts +14 -0
  23. package/dist/components/calendar/datetime.js +35 -0
  24. package/dist/components/calendar/picker.styles.js +35 -0
  25. package/dist/components/carousel/UCarousel.d.ts +7 -1
  26. package/dist/components/carousel/UCarousel.js +8 -1
  27. package/dist/components/date-picker/UDatePicker.d.ts +33 -21
  28. package/dist/components/date-picker/UDatePicker.js +128 -103
  29. package/dist/components/date-picker/UDatePicker.styles.js +0 -19
  30. package/dist/components/date-range-picker/UDateRangePicker.d.ts +71 -24
  31. package/dist/components/date-range-picker/UDateRangePicker.js +233 -103
  32. package/dist/index.js +2 -2
  33. package/dist/utilities/Locale.d.ts +2 -2
  34. package/dist/utilities/Locale.js +2 -2
  35. package/dist/utilities/format.d.ts +32 -4
  36. package/dist/utilities/format.js +131 -15
  37. package/package.json +1 -1
  38. package/skills/iyulab-components/references/components/carousel.md +3 -1
  39. package/skills/iyulab-components/references/components/date-picker.md +34 -2
  40. package/skills/iyulab-components/references/components/date-range-picker.md +52 -5
  41. package/skills/iyulab-components/references/utilities/locale.md +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,66 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.58.0] - 2026-10-03
4
+
5
+ ### Added
6
+
7
+ - **`confirm` on `u-date-picker` and `u-date-range-picker`: apply calendar picks with a button.** With
8
+ `confirm`, choosing a day, a time, a range, a preset, "Today" or "Clear value" in the calendar only
9
+ stages the choice; the footer adds Cancel and Apply. Apply commits it and fires `change` once;
10
+ Cancel, Escape or closing the calendar any other way drops it. Useful where a day and a time, or a
11
+ range adjusted several times, should reach the app as one change. Typing in the field still commits
12
+ on Enter or leaving it. New locale key `apply` in all built-in locales.
13
+ - **`isDateDisabled` on `u-date-picker` and `u-date-range-picker`: app rules for days that cannot be
14
+ chosen** — weekends, holidays, fully booked days. The function receives the ISO day; a disabled day
15
+ is drawn `aria-disabled`, cannot be picked, and turns "Today" (or a preset ending on it) off. A range
16
+ may run across a disabled day but cannot start or end on one. A typed or assigned value on a
17
+ disabled day reports `stepMismatch` with the new locale message `dateUnavailable`.
18
+
19
+ - **`u-date-range-picker mode="datetime"`: a period with start and end times.** Labelled start and end
20
+ time inputs sit under the calendar; each half of the value is a complete ISO-8601 `DateTimeOffset`
21
+ (`2026-10-01T09:00:00+09:00/2026-10-01T18:00:00+09:00`). The first range picked, and any preset,
22
+ covers its days whole (00:00–23:59); picking other days afterwards keeps the times. The text box reads
23
+ `2026-10-01 09:00 ~ 2026-10-31 18:00` and `2026-10-01 09:00 ~ 18:00`. New exports
24
+ `parseDateTimeRange` / `formatDateTimeRangeText`, new parts `calendar-time` / `time-input`, new
25
+ locale keys `startTime` / `endTime`.
26
+
27
+ - **`seconds` on `u-date-picker` and `u-date-range-picker` (`mode="datetime"`): times to the second.**
28
+ The time inputs show seconds, the text box reads and shows `HH:mm:ss`, and in the range picker a
29
+ whole day ends at `23:59:59`. Without it, times stay to the minute and typed seconds are dropped, as
30
+ before. `parseDateTime` / `parseDateTimeRange` take `seconds: true` to keep them, and
31
+ `formatDateTimeText` / `formatDateTimeRangeText` take a `seconds` argument to write them.
32
+
33
+ - **12-hour times are read.** `parseDateTime` and `parseDateTimeRange` — and so the text boxes of
34
+ `u-date-picker` / `u-date-range-picker` in `mode="datetime"`, and other readers built on them — take
35
+ `3:00 PM`, `3:00pm`, `p.m. 3:00` in every locale, and the locale's own words before or after the
36
+ time (`오후 3:00` in `ko`, `午後3:00` in `ja`, `下午 3:00` in `zh-CN` …; `12 AM` is midnight, `12 PM`
37
+ noon). The words come from the new locale keys `timeAm` / `timePm`. The value and the shown text
38
+ stay 24-hour.
39
+ - **`Locale.getValue(key, params, locale)`** resolves a message for a given locale (along its
40
+ fallback chain) instead of the active one.
41
+
42
+ ### Changed
43
+
44
+ - **`u-carousel[autoplay]` starts stopped for users who prefer reduced motion.** With
45
+ `prefers-reduced-motion: reduce`, rotation does not start on its own; the start button turns it on.
46
+ Turning the setting on while the page is open stops rotation.
47
+
48
+ ### Fixed
49
+
50
+ - **`u-date-picker mode="datetime"` takes the UTC offset of the chosen time, not of midnight.** On a
51
+ day the clocks change, a time after the change carried the offset from before it.
52
+ - **`u-date-picker` re-validates when `min` or `max` changes.** A value that a new bound put out of
53
+ range kept reporting valid until the value itself changed; `u-date-range-picker` already re-validated.
54
+
55
+ ## [1.57.1] - 2026-10-03
56
+
57
+ ### Fixed
58
+
59
+ - **`u-date-picker`: picking a day after typing shows the picked day.** Text typed into the field but
60
+ not yet committed stayed in the box after a day was picked in the calendar (or the time changed), so
61
+ the field showed the half-typed text while the value was the picked day. `u-date-range-picker` already
62
+ cleared it; both pickers now share one implementation of the text box.
63
+
3
64
  ## [1.57.0] - 2026-10-03
4
65
 
5
66
  ### Added
@@ -53,6 +53,10 @@ var closeTab = "إغلاق علامة التبويب";
53
53
  var breadcrumb = "مسار التنقل";
54
54
  var confirm = "تأكيد";
55
55
  var cancel = "إلغاء";
56
+ var apply = "تطبيق";
57
+ var dateUnavailable = "هذا التاريخ غير متاح";
58
+ var startTime = "وقت البدء";
59
+ var endTime = "وقت الانتهاء";
56
60
  var ar_default = {
57
61
  valueMissing,
58
62
  badInput,
@@ -107,7 +111,13 @@ var ar_default = {
107
111
  closeTab,
108
112
  breadcrumb,
109
113
  confirm,
110
- cancel
114
+ cancel,
115
+ apply,
116
+ dateUnavailable,
117
+ startTime,
118
+ endTime,
119
+ timeAm: "ص",
120
+ timePm: "م"
111
121
  };
112
122
  //#endregion
113
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, decrement, ar_default as default, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
123
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, ar_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, startTime, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -53,6 +53,10 @@ var closeTab = "Tab schließen";
53
53
  var breadcrumb = "Navigationspfad";
54
54
  var confirm = "Bestätigen";
55
55
  var cancel = "Abbrechen";
56
+ var apply = "Übernehmen";
57
+ var dateUnavailable = "Dieses Datum ist nicht verfügbar";
58
+ var startTime = "Startzeit";
59
+ var endTime = "Endzeit";
56
60
  var de_default = {
57
61
  valueMissing,
58
62
  badInput,
@@ -107,7 +111,13 @@ var de_default = {
107
111
  closeTab,
108
112
  breadcrumb,
109
113
  confirm,
110
- cancel
114
+ cancel,
115
+ apply,
116
+ dateUnavailable,
117
+ startTime,
118
+ endTime,
119
+ timeAm: "AM",
120
+ timePm: "PM"
111
121
  };
112
122
  //#endregion
113
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, decrement, de_default as default, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
123
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, de_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, startTime, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -53,6 +53,10 @@ var closeTab = "Close tab";
53
53
  var breadcrumb = "Breadcrumb";
54
54
  var confirm = "Confirm";
55
55
  var cancel = "Cancel";
56
+ var apply = "Apply";
57
+ var dateUnavailable = "This date is not available";
58
+ var startTime = "Start time";
59
+ var endTime = "End time";
56
60
  var en_default = {
57
61
  valueMissing,
58
62
  badInput,
@@ -107,7 +111,13 @@ var en_default = {
107
111
  closeTab,
108
112
  breadcrumb,
109
113
  confirm,
110
- cancel
114
+ cancel,
115
+ apply,
116
+ dateUnavailable,
117
+ startTime,
118
+ endTime,
119
+ timeAm: "AM",
120
+ timePm: "PM"
111
121
  };
112
122
  //#endregion
113
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, decrement, en_default as default, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
123
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, en_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, startTime, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -52,6 +52,12 @@ var closeTab = "Cerrar pestaña";
52
52
  var breadcrumb = "Ruta de navegación";
53
53
  var confirm = "Confirmar";
54
54
  var cancel = "Cancelar";
55
+ var apply = "Aplicar";
56
+ var dateUnavailable = "Esta fecha no está disponible";
57
+ var startTime = "Hora de inicio";
58
+ var endTime = "Hora de fin";
59
+ var timeAm = "a.m.";
60
+ var timePm = "p.m.";
55
61
  var es_default = {
56
62
  valueMissing,
57
63
  badInput,
@@ -106,7 +112,13 @@ var es_default = {
106
112
  closeTab,
107
113
  breadcrumb,
108
114
  confirm,
109
- cancel
115
+ cancel,
116
+ apply,
117
+ dateUnavailable,
118
+ startTime,
119
+ endTime,
120
+ timeAm,
121
+ timePm
110
122
  };
111
123
  //#endregion
112
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, decrement, es_default as default, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
124
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, es_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, startTime, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -53,6 +53,10 @@ var closeTab = "Fermer l'onglet";
53
53
  var breadcrumb = "Fil d'Ariane";
54
54
  var confirm = "Confirmer";
55
55
  var cancel = "Annuler";
56
+ var apply = "Appliquer";
57
+ var dateUnavailable = "Cette date n'est pas disponible";
58
+ var startTime = "Heure de début";
59
+ var endTime = "Heure de fin";
56
60
  var fr_default = {
57
61
  valueMissing,
58
62
  badInput,
@@ -107,7 +111,13 @@ var fr_default = {
107
111
  closeTab,
108
112
  breadcrumb,
109
113
  confirm,
110
- cancel
114
+ cancel,
115
+ apply,
116
+ dateUnavailable,
117
+ startTime,
118
+ endTime,
119
+ timeAm: "AM",
120
+ timePm: "PM"
111
121
  };
112
122
  //#endregion
113
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, decrement, fr_default as default, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
123
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, fr_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, startTime, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -53,6 +53,10 @@ var closeTab = "Tutup tab";
53
53
  var breadcrumb = "Navigasi remah roti";
54
54
  var confirm = "Konfirmasi";
55
55
  var cancel = "Batal";
56
+ var apply = "Terapkan";
57
+ var dateUnavailable = "Tanggal ini tidak tersedia";
58
+ var startTime = "Waktu mulai";
59
+ var endTime = "Waktu selesai";
56
60
  var id_default = {
57
61
  valueMissing,
58
62
  badInput,
@@ -107,7 +111,13 @@ var id_default = {
107
111
  closeTab,
108
112
  breadcrumb,
109
113
  confirm,
110
- cancel
114
+ cancel,
115
+ apply,
116
+ dateUnavailable,
117
+ startTime,
118
+ endTime,
119
+ timeAm: "AM",
120
+ timePm: "PM"
111
121
  };
112
122
  //#endregion
113
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, decrement, id_default as default, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
123
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, id_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, startTime, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -52,6 +52,12 @@ var remove = "削除";
52
52
  var closeTab = "タブを閉じる";
53
53
  var breadcrumb = "パンくずリスト";
54
54
  var cancel = "キャンセル";
55
+ var apply = "適用";
56
+ var dateUnavailable = "この日付は選択できません";
57
+ var startTime = "開始時刻";
58
+ var endTime = "終了時刻";
59
+ var timeAm = "午前";
60
+ var timePm = "午後";
55
61
  var ja_default = {
56
62
  valueMissing,
57
63
  badInput,
@@ -106,7 +112,13 @@ var ja_default = {
106
112
  closeTab,
107
113
  breadcrumb,
108
114
  confirm: "OK",
109
- cancel
115
+ cancel,
116
+ apply,
117
+ dateUnavailable,
118
+ startTime,
119
+ endTime,
120
+ timeAm,
121
+ timePm
110
122
  };
111
123
  //#endregion
112
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, copied, copy, decrement, ja_default as default, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
124
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, copied, copy, dateUnavailable, decrement, ja_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, startTime, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -53,6 +53,12 @@ var closeTab = "탭 닫기";
53
53
  var breadcrumb = "탐색 경로";
54
54
  var confirm = "확인";
55
55
  var cancel = "취소";
56
+ var apply = "적용";
57
+ var dateUnavailable = "선택할 수 없는 날짜입니다";
58
+ var startTime = "시작 시간";
59
+ var endTime = "종료 시간";
60
+ var timeAm = "오전";
61
+ var timePm = "오후";
56
62
  var ko_default = {
57
63
  valueMissing,
58
64
  badInput,
@@ -107,7 +113,13 @@ var ko_default = {
107
113
  closeTab,
108
114
  breadcrumb,
109
115
  confirm,
110
- cancel
116
+ cancel,
117
+ apply,
118
+ dateUnavailable,
119
+ startTime,
120
+ endTime,
121
+ timeAm,
122
+ timePm
111
123
  };
112
124
  //#endregion
113
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, decrement, ko_default as default, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
125
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, ko_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, startTime, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -53,6 +53,10 @@ var closeTab = "Fechar aba";
53
53
  var breadcrumb = "Trilha de navegação";
54
54
  var confirm = "Confirmar";
55
55
  var cancel = "Cancelar";
56
+ var apply = "Aplicar";
57
+ var dateUnavailable = "Esta data não está disponível";
58
+ var startTime = "Hora de início";
59
+ var endTime = "Hora de término";
56
60
  var pt_BR_default = {
57
61
  valueMissing,
58
62
  badInput,
@@ -107,7 +111,13 @@ var pt_BR_default = {
107
111
  closeTab,
108
112
  breadcrumb,
109
113
  confirm,
110
- cancel
114
+ cancel,
115
+ apply,
116
+ dateUnavailable,
117
+ startTime,
118
+ endTime,
119
+ timeAm: "AM",
120
+ timePm: "PM"
111
121
  };
112
122
  //#endregion
113
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, decrement, pt_BR_default as default, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
123
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, pt_BR_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, startTime, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -53,6 +53,10 @@ var closeTab = "Закрыть вкладку";
53
53
  var breadcrumb = "Навигационная цепочка";
54
54
  var confirm = "Подтвердить";
55
55
  var cancel = "Отмена";
56
+ var apply = "Применить";
57
+ var dateUnavailable = "Эта дата недоступна";
58
+ var startTime = "Время начала";
59
+ var endTime = "Время окончания";
56
60
  var ru_default = {
57
61
  valueMissing,
58
62
  badInput,
@@ -107,7 +111,13 @@ var ru_default = {
107
111
  closeTab,
108
112
  breadcrumb,
109
113
  confirm,
110
- cancel
114
+ cancel,
115
+ apply,
116
+ dateUnavailable,
117
+ startTime,
118
+ endTime,
119
+ timeAm: "AM",
120
+ timePm: "PM"
111
121
  };
112
122
  //#endregion
113
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, decrement, ru_default as default, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
123
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, ru_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, startTime, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -53,6 +53,12 @@ var closeTab = "ปิดแท็บ";
53
53
  var breadcrumb = "เส้นทางการนำทาง";
54
54
  var confirm = "ยืนยัน";
55
55
  var cancel = "ยกเลิก";
56
+ var apply = "นำไปใช้";
57
+ var dateUnavailable = "ไม่สามารถเลือกวันที่นี้ได้";
58
+ var startTime = "เวลาเริ่มต้น";
59
+ var endTime = "เวลาสิ้นสุด";
60
+ var timeAm = "ก่อนเที่ยง";
61
+ var timePm = "หลังเที่ยง";
56
62
  var th_default = {
57
63
  valueMissing,
58
64
  badInput,
@@ -107,7 +113,13 @@ var th_default = {
107
113
  closeTab,
108
114
  breadcrumb,
109
115
  confirm,
110
- cancel
116
+ cancel,
117
+ apply,
118
+ dateUnavailable,
119
+ startTime,
120
+ endTime,
121
+ timeAm,
122
+ timePm
111
123
  };
112
124
  //#endregion
113
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, decrement, th_default as default, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
125
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, th_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, startTime, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -53,6 +53,10 @@ var closeTab = "Đóng tab";
53
53
  var breadcrumb = "Đường dẫn điều hướng";
54
54
  var confirm = "Xác nhận";
55
55
  var cancel = "Hủy";
56
+ var apply = "Áp dụng";
57
+ var dateUnavailable = "Ngày này không khả dụng";
58
+ var startTime = "Giờ bắt đầu";
59
+ var endTime = "Giờ kết thúc";
56
60
  var vi_default = {
57
61
  valueMissing,
58
62
  badInput,
@@ -107,7 +111,13 @@ var vi_default = {
107
111
  closeTab,
108
112
  breadcrumb,
109
113
  confirm,
110
- cancel
114
+ cancel,
115
+ apply,
116
+ dateUnavailable,
117
+ startTime,
118
+ endTime,
119
+ timeAm: "SA",
120
+ timePm: "CH"
111
121
  };
112
122
  //#endregion
113
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, decrement, vi_default as default, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
123
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, vi_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, startTime, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -53,6 +53,12 @@ var closeTab = "关闭标签页";
53
53
  var breadcrumb = "面包屑导航";
54
54
  var confirm = "确定";
55
55
  var cancel = "取消";
56
+ var apply = "应用";
57
+ var dateUnavailable = "该日期不可选";
58
+ var startTime = "开始时间";
59
+ var endTime = "结束时间";
60
+ var timeAm = "上午";
61
+ var timePm = "下午";
56
62
  var zh_CN_default = {
57
63
  valueMissing,
58
64
  badInput,
@@ -107,7 +113,13 @@ var zh_CN_default = {
107
113
  closeTab,
108
114
  breadcrumb,
109
115
  confirm,
110
- cancel
116
+ cancel,
117
+ apply,
118
+ dateUnavailable,
119
+ startTime,
120
+ endTime,
121
+ timeAm,
122
+ timePm
111
123
  };
112
124
  //#endregion
113
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, decrement, zh_CN_default as default, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
125
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, zh_CN_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, startTime, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -53,6 +53,12 @@ var closeTab = "關閉分頁";
53
53
  var breadcrumb = "麵包屑導覽";
54
54
  var confirm = "確定";
55
55
  var cancel = "取消";
56
+ var apply = "套用";
57
+ var dateUnavailable = "此日期無法選取";
58
+ var startTime = "開始時間";
59
+ var endTime = "結束時間";
60
+ var timeAm = "上午";
61
+ var timePm = "下午";
56
62
  var zh_TW_default = {
57
63
  valueMissing,
58
64
  badInput,
@@ -107,7 +113,13 @@ var zh_TW_default = {
107
113
  closeTab,
108
114
  breadcrumb,
109
115
  confirm,
110
- cancel
116
+ cancel,
117
+ apply,
118
+ dateUnavailable,
119
+ startTime,
120
+ endTime,
121
+ timeAm,
122
+ timePm
111
123
  };
112
124
  //#endregion
113
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, decrement, zh_TW_default as default, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
125
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, zh_TW_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, startSlideRotation, startTime, stepMismatch, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -1,5 +1,6 @@
1
1
  import { PropertyValues } from 'lit';
2
2
  import { UElement } from '../UElement.js';
3
+ import { DateDisabledFn } from './dates.js';
3
4
  export interface CalendarDaySelectDetail {
4
5
  /** The chosen day as ISO `YYYY-MM-DD`. */
5
6
  date: string;
@@ -57,6 +58,9 @@ export declare class UCalendar extends UElement {
57
58
  min?: string;
58
59
  /** Latest selectable day (ISO), inclusive. */
59
60
  max?: string;
61
+ /** App rule for days that cannot be chosen (ISO in, `true` = unavailable) — drawn and refused like
62
+ * a day outside `min`/`max`. */
63
+ isDateDisabled?: DateDisabledFn;
60
64
  /** How many consecutive months to show side by side. */
61
65
  visibleMonths: number;
62
66
  /** First visible month (always the 1st of a month). */
@@ -4,7 +4,7 @@ import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm
4
4
  import { Locale } from "../../utilities/Locale.js";
5
5
  import "../icon-button/UIconButton.js";
6
6
  import { formatDate } from "../../utilities/format.js";
7
- import { addDays, addMonths, daysInMonth, isOutOfRange, isSameDay, monthDiff, parseISODate, startOfMonth, toISODate } from "./dates.js";
7
+ import { addDays, addMonths, daysInMonth, isDayUnavailable, isSameDay, monthDiff, parseISODate, startOfMonth, toISODate } from "./dates.js";
8
8
  import { styles } from "./UCalendar.styles.js";
9
9
  import { html } from "lit";
10
10
  import { customElement, property, state } from "lit/decorators.js";
@@ -139,7 +139,7 @@ var UCalendar = class UCalendar extends UElement {
139
139
  if (this.start && this.end) return ordered(parseISODate(this.start), parseISODate(this.end));
140
140
  }
141
141
  renderDay(date, range) {
142
- const outOfRange = isOutOfRange(date, this.min, this.max);
142
+ const unavailable = isDayUnavailable(date, this.min, this.max, this.isDateDisabled);
143
143
  const t = date.getTime();
144
144
  const inRange = !!range && t >= range[0].getTime() && t <= range[1].getTime();
145
145
  const selected = this.selection === "range" ? this.anchor ? isSameDay(date, this.anchor) : inRange : this.value ? isSameDay(date, parseISODate(this.value)) : false;
@@ -149,7 +149,7 @@ var UCalendar = class UCalendar extends UElement {
149
149
  data-iso=${toISODate(date)}
150
150
  tabindex=${isSameDay(date, this.focusedDate) ? 0 : -1}
151
151
  aria-selected=${selected}
152
- aria-disabled=${outOfRange}
152
+ aria-disabled=${unavailable}
153
153
  ?data-today=${isSameDay(date, /* @__PURE__ */ new Date())}
154
154
  ?data-in-range=${inRange}
155
155
  ?data-range-start=${!!range && isSameDay(date, range[0])}
@@ -170,7 +170,7 @@ var UCalendar = class UCalendar extends UElement {
170
170
  return this.renderRoot.querySelector(`button.day[data-iso="${toISODate(date)}"]`);
171
171
  }
172
172
  activate(date) {
173
- if (isOutOfRange(date, this.min, this.max)) return;
173
+ if (isDayUnavailable(date, this.min, this.max, this.isDateDisabled)) return;
174
174
  if (this.selection !== "range") {
175
175
  this.fire("day-select", { detail: { date: toISODate(date) } });
176
176
  return;
@@ -210,6 +210,7 @@ __decorate([property({ type: String }), __decorateMetadata("design:type", String
210
210
  __decorate([property({ type: String }), __decorateMetadata("design:type", String)], UCalendar.prototype, "end", void 0);
211
211
  __decorate([property({ type: String }), __decorateMetadata("design:type", String)], UCalendar.prototype, "min", void 0);
212
212
  __decorate([property({ type: String }), __decorateMetadata("design:type", String)], UCalendar.prototype, "max", void 0);
213
+ __decorate([property({ attribute: false }), __decorateMetadata("design:type", Object)], UCalendar.prototype, "isDateDisabled", void 0);
213
214
  __decorate([property({
214
215
  type: Number,
215
216
  attribute: "visible-months"
@@ -0,0 +1,62 @@
1
+ import { ReactiveController, ReactiveControllerHost } from 'lit';
2
+ import { UCalendar } from './UCalendar.js';
3
+ import { UPopover } from '../popover/UPopover.js';
4
+ /** What a picker with a typed-date text box gives the controller. */
5
+ export interface DateTextControllerOptions {
6
+ /** The value to commit for the typed text — `undefined` for empty text, `null` when it is not readable. */
7
+ toValue(text: string): string | undefined | null;
8
+ /** The ISO day the typed text points at, so an open calendar can follow the typing; `null` when none. */
9
+ dayOf(text: string): string | null;
10
+ /** The value as the text box shows it when nothing is being typed. */
11
+ shown(): string;
12
+ /** Called after a commit that changed the value — the picker validates and fires `change`. */
13
+ onChange(): void;
14
+ /** Called when unreadable text is committed without a value change — the picker re-validates. */
15
+ onBadText(): void;
16
+ popover(): UPopover | undefined;
17
+ calendar(): UCalendar | undefined;
18
+ container(): HTMLElement | undefined;
19
+ input(): HTMLInputElement | null;
20
+ /** Whether the picker takes input now (not disabled, not read-only). */
21
+ interactive(): boolean;
22
+ }
23
+ type Host = ReactiveControllerHost & HTMLElement & {
24
+ value?: string;
25
+ };
26
+ /**
27
+ * The typed-date text box shared by `u-date-picker` and `u-date-range-picker`: what is being typed
28
+ * (`draft`), whether the last commit was unreadable (`badText`), committing on Enter and blur,
29
+ * opening the calendar on a click (caret stays in the box) or ArrowDown (focus moves into the grid),
30
+ * and following the typing in an open calendar.
31
+ */
32
+ export declare class DateTextController implements ReactiveController {
33
+ private readonly host;
34
+ private readonly options;
35
+ /** What the person is typing, until it is committed; `null` shows the value. */
36
+ draft: string | null;
37
+ /** The committed text was not readable — the value is empty and validity reports `badInput`. */
38
+ badText: boolean;
39
+ private focusGridOnOpen;
40
+ constructor(host: Host, options: DateTextControllerOptions);
41
+ hostConnected(): void;
42
+ /** The text box's current text. */
43
+ get text(): string;
44
+ /** Forget what was typed — after a calendar pick, a clear or a reset. */
45
+ clear(): void;
46
+ /** Called when the calendar has opened: show the typed (or current) month and, if the opening
47
+ * came from the keyboard, move focus into the grid. */
48
+ calendarOpened(fallbackDay: string | Date): void;
49
+ open(focusGrid: boolean): void;
50
+ handleInput: (e: Event) => void;
51
+ /** ArrowDown / Alt+ArrowDown opens the calendar and moves into it (the combobox convention);
52
+ * Enter commits what was typed. Escape belongs to the popover layer — it closes the calendar. */
53
+ handleKeydown: (e: KeyboardEvent) => void;
54
+ /** A click on the field (not on its clear or calendar button) opens the calendar and keeps the
55
+ * caret in the text box — the person can pick a day or keep typing. */
56
+ handleContainerClick: (e: MouseEvent) => void;
57
+ handleCalendarButtonClick: (e: MouseEvent) => void;
58
+ /** Turns the typed text into the value. Empty text clears it; unreadable text also clears it and
59
+ * reports `badInput` while the text stays to be fixed (the native date input does the same). */
60
+ commit: () => void;
61
+ }
62
+ export {};