@iyulab/components 2.11.0 → 2.12.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 (35) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/assets/locales/ar.json.js +3 -1
  3. package/dist/assets/locales/de.json.js +3 -1
  4. package/dist/assets/locales/en.json.js +3 -1
  5. package/dist/assets/locales/es.json.js +3 -1
  6. package/dist/assets/locales/fr.json.js +3 -1
  7. package/dist/assets/locales/id.json.js +3 -1
  8. package/dist/assets/locales/ja.json.js +3 -1
  9. package/dist/assets/locales/ko.json.js +3 -1
  10. package/dist/assets/locales/pt-BR.json.js +3 -1
  11. package/dist/assets/locales/ru.json.js +3 -1
  12. package/dist/assets/locales/th.json.js +3 -1
  13. package/dist/assets/locales/vi.json.js +3 -1
  14. package/dist/assets/locales/zh-CN.json.js +3 -1
  15. package/dist/assets/locales/zh-TW.json.js +3 -1
  16. package/dist/components/card/UCard.styles.js +5 -1
  17. package/dist/components/date-picker/UDatePicker.d.ts +2 -0
  18. package/dist/components/date-picker/UDatePicker.js +7 -2
  19. package/dist/components/date-range-picker/UDateRangePicker.d.ts +2 -0
  20. package/dist/components/date-range-picker/UDateRangePicker.js +7 -2
  21. package/dist/components/input/UInput.d.ts +2 -2
  22. package/dist/components/input/UInput.js +8 -7
  23. package/dist/components/option/UOption.d.ts +6 -0
  24. package/dist/components/option/UOption.js +12 -2
  25. package/dist/components/select/USelect.d.ts +19 -0
  26. package/dist/components/select/USelect.js +39 -10
  27. package/dist/components/select/USelect.styles.js +9 -0
  28. package/dist/utilities/Locale.d.ts +1 -1
  29. package/dist/utilities/chars.d.ts +33 -4
  30. package/dist/utilities/chars.js +86 -7
  31. package/package.json +1 -1
  32. package/skills/iyulab-components/references/components/date-picker.md +1 -1
  33. package/skills/iyulab-components/references/components/date-range-picker.md +1 -1
  34. package/skills/iyulab-components/references/components/input.md +1 -1
  35. package/skills/iyulab-components/references/components/select.md +4 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.12.0] - 2026-10-07
4
+
5
+ ### Added
6
+
7
+ - **`u-select` `filter="none"`** — a searchable select that leaves filtering to you. The `search` event could already
8
+ drive a server query, but the built-in filter kept running and could not be turned off: options the server found
9
+ by several words or by another field stayed hidden (a reused `u-option` kept the `hidden` of the earlier text), so
10
+ the results looked empty. With `filter="none"` nothing is hidden. `local` stays the default.
11
+ - **No matches** — when the search text matches no option (and the select is not `loading`), the dropdown says so
12
+ in a status line (`part="no-matches"`, new locale key `noMatches` in all fourteen languages).
13
+
14
+ ### Fixed
15
+
16
+ - With local filtering, options added while a search text is in place are filtered by it too; they appeared
17
+ unfiltered. And an option added a moment ago is matched by its label — before its first render it was matched
18
+ by its `value` (`UOption.getText()` read the label from its own slot, which did not exist yet).
19
+ - **A stretched `u-card` keeps its border on the whole card.** The border is drawn by the inner `.base` (so app
20
+ resets do not remove it), which did not grow with the host: a vertical card stretched to its row's height, or
21
+ given a height, closed its border at the content and painted a second, borderless panel below.
22
+
23
+ ## [2.11.1] - 2026-10-07
24
+
25
+ ### Fixed
26
+
27
+ - **A `chars` field holds N characters as they are drawn** (`u-input`, `u-select`, `u-date-picker`,
28
+ `u-date-range-picker`). The width was `N` CSS `ch`, which is one `0` without font features or letter spacing, so
29
+ with tabular figures (`font-variant-numeric: tabular-nums`, as the house theme sets) or letter spacing the last
30
+ digit was cut — six digits in Pretendard 14px overflowed by 2px. The field now draws N zeros in the text's own
31
+ computed font off-screen and uses that width; it re-measures when the font loads or the size changes.
32
+
3
33
  ## [2.11.0] - 2026-10-07
4
34
 
5
35
  ### Added
@@ -46,6 +46,7 @@ var filesSelected = "تم اختيار {count} ملفات";
46
46
  var resizePanels = "تغيير حجم اللوحات";
47
47
  var loading = "جارٍ التحميل";
48
48
  var search = "بحث";
49
+ var noMatches = "لا توجد نتائج مطابقة";
49
50
  var alertError = "خطأ";
50
51
  var alertWarning = "تحذير";
51
52
  var alertSuccess = "نجاح";
@@ -112,6 +113,7 @@ var ar_default = {
112
113
  resizePanels,
113
114
  loading,
114
115
  search,
116
+ noMatches,
115
117
  alertError,
116
118
  alertWarning,
117
119
  alertSuccess,
@@ -134,4 +136,4 @@ var ar_default = {
134
136
  timePm: "م"
135
137
  };
136
138
  //#endregion
137
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, ar_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, ok, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
139
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, ar_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, noMatches, ok, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -46,6 +46,7 @@ var filesSelected = "{count} Dateien ausgewählt";
46
46
  var resizePanels = "Bereichsgröße ändern";
47
47
  var loading = "Wird geladen";
48
48
  var search = "Suchen";
49
+ var noMatches = "Keine Treffer";
49
50
  var alertError = "Fehler";
50
51
  var alertWarning = "Warnung";
51
52
  var alertSuccess = "Erfolg";
@@ -111,6 +112,7 @@ var de_default = {
111
112
  resizePanels,
112
113
  loading,
113
114
  search,
115
+ noMatches,
114
116
  alertError,
115
117
  alertWarning,
116
118
  alertSuccess,
@@ -133,4 +135,4 @@ var de_default = {
133
135
  timePm: "PM"
134
136
  };
135
137
  //#endregion
136
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, de_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
138
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, de_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, noMatches, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -46,6 +46,7 @@ var filesSelected = "{count} files selected";
46
46
  var resizePanels = "Resize panels";
47
47
  var loading = "Loading";
48
48
  var search = "Search";
49
+ var noMatches = "No matches";
49
50
  var alertError = "Error";
50
51
  var alertWarning = "Warning";
51
52
  var alertSuccess = "Success";
@@ -111,6 +112,7 @@ var en_default = {
111
112
  resizePanels,
112
113
  loading,
113
114
  search,
115
+ noMatches,
114
116
  alertError,
115
117
  alertWarning,
116
118
  alertSuccess,
@@ -133,4 +135,4 @@ var en_default = {
133
135
  timePm: "PM"
134
136
  };
135
137
  //#endregion
136
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, en_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
138
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, en_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, noMatches, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -45,6 +45,7 @@ var filesSelected = "{count} archivos seleccionados";
45
45
  var resizePanels = "Cambiar el tamaño de los paneles";
46
46
  var loading = "Cargando";
47
47
  var search = "Buscar";
48
+ var noMatches = "Sin coincidencias";
48
49
  var alertError = "Error";
49
50
  var alertWarning = "Advertencia";
50
51
  var alertSuccess = "Éxito";
@@ -113,6 +114,7 @@ var es_default = {
113
114
  resizePanels,
114
115
  loading,
115
116
  search,
117
+ noMatches,
116
118
  alertError,
117
119
  alertWarning,
118
120
  alertSuccess,
@@ -135,4 +137,4 @@ var es_default = {
135
137
  timePm
136
138
  };
137
139
  //#endregion
138
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, es_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, ok, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
140
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, es_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, noMatches, ok, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -46,6 +46,7 @@ var filesSelected = "{count} fichiers sélectionnés";
46
46
  var resizePanels = "Redimensionner les panneaux";
47
47
  var loading = "Chargement";
48
48
  var search = "Rechercher";
49
+ var noMatches = "Aucun résultat";
49
50
  var alertError = "Erreur";
50
51
  var alertWarning = "Avertissement";
51
52
  var alertSuccess = "Succès";
@@ -111,6 +112,7 @@ var fr_default = {
111
112
  resizePanels,
112
113
  loading,
113
114
  search,
115
+ noMatches,
114
116
  alertError,
115
117
  alertWarning,
116
118
  alertSuccess,
@@ -133,4 +135,4 @@ var fr_default = {
133
135
  timePm: "PM"
134
136
  };
135
137
  //#endregion
136
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, fr_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
138
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, fr_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, noMatches, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -46,6 +46,7 @@ var filesSelected = "{count} berkas dipilih";
46
46
  var resizePanels = "Ubah ukuran panel";
47
47
  var loading = "Memuat";
48
48
  var search = "Cari";
49
+ var noMatches = "Tidak ada yang cocok";
49
50
  var alertError = "Kesalahan";
50
51
  var alertWarning = "Peringatan";
51
52
  var alertSuccess = "Berhasil";
@@ -111,6 +112,7 @@ var id_default = {
111
112
  resizePanels,
112
113
  loading,
113
114
  search,
115
+ noMatches,
114
116
  alertError,
115
117
  alertWarning,
116
118
  alertSuccess,
@@ -133,4 +135,4 @@ var id_default = {
133
135
  timePm: "PM"
134
136
  };
135
137
  //#endregion
136
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, id_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
138
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, id_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, noMatches, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -46,6 +46,7 @@ var filesSelected = "{count}個のファイルを選択しました";
46
46
  var resizePanels = "パネルのサイズ変更";
47
47
  var loading = "読み込み中";
48
48
  var search = "検索";
49
+ var noMatches = "一致する項目はありません";
49
50
  var alertError = "エラー";
50
51
  var alertWarning = "警告";
51
52
  var alertSuccess = "完了";
@@ -112,6 +113,7 @@ var ja_default = {
112
113
  resizePanels,
113
114
  loading,
114
115
  search,
116
+ noMatches,
115
117
  alertError,
116
118
  alertWarning,
117
119
  alertSuccess,
@@ -134,4 +136,4 @@ var ja_default = {
134
136
  timePm
135
137
  };
136
138
  //#endregion
137
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, copied, copy, dateUnavailable, decrement, ja_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
139
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, copied, copy, dateUnavailable, decrement, ja_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, noMatches, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -46,6 +46,7 @@ var filesSelected = "{count}개 파일 선택됨";
46
46
  var resizePanels = "패널 크기 조절";
47
47
  var loading = "로딩 중";
48
48
  var search = "검색";
49
+ var noMatches = "일치하는 항목 없음";
49
50
  var alertError = "오류";
50
51
  var alertWarning = "경고";
51
52
  var alertSuccess = "완료";
@@ -114,6 +115,7 @@ var ko_default = {
114
115
  resizePanels,
115
116
  loading,
116
117
  search,
118
+ noMatches,
117
119
  alertError,
118
120
  alertWarning,
119
121
  alertSuccess,
@@ -136,4 +138,4 @@ var ko_default = {
136
138
  timePm
137
139
  };
138
140
  //#endregion
139
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, ko_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, ok, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
141
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, ko_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, noMatches, ok, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -46,6 +46,7 @@ var filesSelected = "{count} arquivos selecionados";
46
46
  var resizePanels = "Redimensionar painéis";
47
47
  var loading = "Carregando";
48
48
  var search = "Pesquisar";
49
+ var noMatches = "Nenhum resultado";
49
50
  var alertError = "Erro";
50
51
  var alertWarning = "Aviso";
51
52
  var alertSuccess = "Sucesso";
@@ -111,6 +112,7 @@ var pt_BR_default = {
111
112
  resizePanels,
112
113
  loading,
113
114
  search,
115
+ noMatches,
114
116
  alertError,
115
117
  alertWarning,
116
118
  alertSuccess,
@@ -133,4 +135,4 @@ var pt_BR_default = {
133
135
  timePm: "PM"
134
136
  };
135
137
  //#endregion
136
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, 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, loading, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
138
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, 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, loading, nextMonth, nextSlide, noFileChosen, noMatches, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -46,6 +46,7 @@ var filesSelected = "Выбрано файлов: {count}";
46
46
  var resizePanels = "Изменить размер панелей";
47
47
  var loading = "Загрузка";
48
48
  var search = "Поиск";
49
+ var noMatches = "Нет совпадений";
49
50
  var alertError = "Ошибка";
50
51
  var alertWarning = "Предупреждение";
51
52
  var alertSuccess = "Успешно";
@@ -112,6 +113,7 @@ var ru_default = {
112
113
  resizePanels,
113
114
  loading,
114
115
  search,
116
+ noMatches,
115
117
  alertError,
116
118
  alertWarning,
117
119
  alertSuccess,
@@ -134,4 +136,4 @@ var ru_default = {
134
136
  timePm: "PM"
135
137
  };
136
138
  //#endregion
137
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, ru_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, ok, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
139
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, ru_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, noMatches, ok, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -46,6 +46,7 @@ var filesSelected = "เลือกแล้ว {count} ไฟล์";
46
46
  var resizePanels = "ปรับขนาดแผง";
47
47
  var loading = "กำลังโหลด";
48
48
  var search = "ค้นหา";
49
+ var noMatches = "ไม่พบรายการที่ตรงกัน";
49
50
  var alertError = "ข้อผิดพลาด";
50
51
  var alertWarning = "คำเตือน";
51
52
  var alertSuccess = "สำเร็จ";
@@ -114,6 +115,7 @@ var th_default = {
114
115
  resizePanels,
115
116
  loading,
116
117
  search,
118
+ noMatches,
117
119
  alertError,
118
120
  alertWarning,
119
121
  alertSuccess,
@@ -136,4 +138,4 @@ var th_default = {
136
138
  timePm
137
139
  };
138
140
  //#endregion
139
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, th_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, ok, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
141
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, th_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, noMatches, ok, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -46,6 +46,7 @@ var filesSelected = "Đã chọn {count} tệp";
46
46
  var resizePanels = "Thay đổi kích thước bảng";
47
47
  var loading = "Đang tải";
48
48
  var search = "Tìm kiếm";
49
+ var noMatches = "Không có kết quả phù hợp";
49
50
  var alertError = "Lỗi";
50
51
  var alertWarning = "Cảnh báo";
51
52
  var alertSuccess = "Thành công";
@@ -111,6 +112,7 @@ var vi_default = {
111
112
  resizePanels,
112
113
  loading,
113
114
  search,
115
+ noMatches,
114
116
  alertError,
115
117
  alertWarning,
116
118
  alertSuccess,
@@ -133,4 +135,4 @@ var vi_default = {
133
135
  timePm: "CH"
134
136
  };
135
137
  //#endregion
136
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, vi_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
138
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, chooseDate, chooseDateRange, chooseFile, clear, close, closeTab, confirm, copied, copy, dateUnavailable, decrement, vi_default as default, endTime, filesSelected, goToSlide, hidePassword, increment, last30Days, last7Days, lastMonth, lastWeek, loading, nextMonth, nextSlide, noFileChosen, noMatches, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -46,6 +46,7 @@ var filesSelected = "已选择{count}个文件";
46
46
  var resizePanels = "调整面板大小";
47
47
  var loading = "加载中";
48
48
  var search = "搜索";
49
+ var noMatches = "没有匹配项";
49
50
  var alertError = "错误";
50
51
  var alertWarning = "警告";
51
52
  var alertSuccess = "成功";
@@ -114,6 +115,7 @@ var zh_CN_default = {
114
115
  resizePanels,
115
116
  loading,
116
117
  search,
118
+ noMatches,
117
119
  alertError,
118
120
  alertWarning,
119
121
  alertSuccess,
@@ -136,4 +138,4 @@ var zh_CN_default = {
136
138
  timePm
137
139
  };
138
140
  //#endregion
139
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, 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, loading, nextMonth, nextSlide, noFileChosen, ok, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
141
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, 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, loading, nextMonth, nextSlide, noFileChosen, noMatches, ok, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -46,6 +46,7 @@ var filesSelected = "已選擇{count}個檔案";
46
46
  var resizePanels = "調整面板大小";
47
47
  var loading = "載入中";
48
48
  var search = "搜尋";
49
+ var noMatches = "沒有符合的項目";
49
50
  var alertError = "錯誤";
50
51
  var alertWarning = "警告";
51
52
  var alertSuccess = "成功";
@@ -114,6 +115,7 @@ var zh_TW_default = {
114
115
  resizePanels,
115
116
  loading,
116
117
  search,
118
+ noMatches,
117
119
  alertError,
118
120
  alertWarning,
119
121
  alertSuccess,
@@ -136,4 +138,4 @@ var zh_TW_default = {
136
138
  timePm
137
139
  };
138
140
  //#endregion
139
- export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, 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, loading, nextMonth, nextSlide, noFileChosen, ok, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
141
+ export { alertError, alertInfo, alertMessage, alertNotice, alertSuccess, alertWarning, apply, badInput, breadcrumb, cancel, carousel, 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, loading, nextMonth, nextSlide, noFileChosen, noMatches, ok, patternMismatch, previousMonth, previousSlide, quickRanges, rangeOverflow, rangeStartChosen, rangeUnderflow, remove, resizePanels, search, showPassword, slide, slideOf, startSlideRotation, startTime, stepComplete, stepMismatch, stepOnHold, stopSlideRotation, thisMonth, thisWeek, thisYear, time, timeAm, timePm, today, tooLong, tooShort, typeMismatch, valueMissing, yesterday };
@@ -12,9 +12,13 @@ var styles = css`
12
12
  --card-border-color: var(--u-border-color, #E0E0E0);
13
13
  }
14
14
 
15
- /* 테두리는 내부 요소가 진다 — :host 에 두면 소비 앱 CSS 리셋에 지워진다. */
15
+ /* 테두리는 내부 요소가 진다 — :host 에 두면 소비 앱 CSS 리셋에 지워진다.
16
+ 그래서 면(호스트)과 테두리(.base)가 한 상자여야 한다: 카드가 늘어나면(같은 행 높이 맞춤 · 높이 지정 · grid 행)
17
+ .base 도 호스트의 주축으로 늘어난다. 종전에는 세로 카드에서 내용 높이에 머물러 그 아래에 면만 한 번 더 그려졌다. */
16
18
  .base {
17
19
  box-sizing: border-box;
20
+ flex: 1 1 auto;
21
+ min-height: 0;
18
22
  width: 100%;
19
23
  display: flex;
20
24
  flex-direction: inherit;
@@ -70,6 +70,8 @@ export declare class UDatePicker extends UFormControlElement<string> {
70
70
  * 폭을 준 칸에서는 하한으로만 쓴다.
71
71
  */
72
72
  chars?: number;
73
+ /** `chars` 의 폭 — 그려지는 N자를 잰다(`ch` 는 글꼴 기능·자간을 빼고 잰다). */
74
+ private readonly charsWidth;
73
75
  /** `date` (default) selects a calendar day only. `datetime` also captures a time-of-day and
74
76
  * the value becomes a complete ISO-8601 `DateTimeOffset` string. */
75
77
  mode: DatePickerMode;
@@ -9,7 +9,7 @@ import { isDayUnavailable, parseISODate, toISODate } from "../calendar/dates.js"
9
9
  import { UCalendar } from "../calendar/UCalendar.js";
10
10
  import "../field/UField.js";
11
11
  import { UPopover } from "../popover/UPopover.js";
12
- import { charsWidth } from "../../utilities/chars.js";
12
+ import { CharsWidthController } from "../../utilities/chars.js";
13
13
  import { DateTextController } from "../calendar/date-text-controller.js";
14
14
  import { normalizeTime, splitDateTime, toDateTimeOffset } from "../calendar/datetime.js";
15
15
  import { styles } from "../calendar/picker.styles.js";
@@ -39,6 +39,11 @@ var UDatePicker = class UDatePicker extends UFormControlElement {
39
39
  constructor(..._args) {
40
40
  super(..._args);
41
41
  this.size = "md";
42
+ this.charsWidth = new CharsWidthController(this, {
43
+ chars: () => this.chars,
44
+ text: () => this.renderRoot.querySelector(".text-input"),
45
+ box: () => this.renderRoot.querySelector(".container")
46
+ });
42
47
  this.mode = "date";
43
48
  this.seconds = false;
44
49
  this.clearable = false;
@@ -172,7 +177,7 @@ var UDatePicker = class UDatePicker extends UFormControlElement {
172
177
  return (this.clearable && this.value ? 1 : 0) + 1;
173
178
  }
174
179
  render() {
175
- const chars = charsWidth(this.chars);
180
+ const chars = this.charsWidth.width;
176
181
  const datetime = this.mode === "datetime";
177
182
  return html`
178
183
  <u-field part="field"
@@ -84,6 +84,8 @@ export declare class UDateRangePicker extends UFormControlElement<string> {
84
84
  * 폭을 준 칸에서는 하한으로만 쓴다.
85
85
  */
86
86
  chars?: number;
87
+ /** `chars` 의 폭 — 그려지는 N자를 잰다(`ch` 는 글꼴 기능·자간을 빼고 잰다). */
88
+ private readonly charsWidth;
87
89
  /** Earliest selectable day (ISO `YYYY-MM-DD`), inclusive. */
88
90
  min?: string;
89
91
  /** Latest selectable day (ISO `YYYY-MM-DD`), inclusive. */
@@ -10,7 +10,7 @@ import { parseISODate } from "../calendar/dates.js";
10
10
  import { UCalendar } from "../calendar/UCalendar.js";
11
11
  import "../field/UField.js";
12
12
  import { UPopover } from "../popover/UPopover.js";
13
- import { charsWidth } from "../../utilities/chars.js";
13
+ import { CharsWidthController } from "../../utilities/chars.js";
14
14
  import { DateTextController } from "../calendar/date-text-controller.js";
15
15
  import { normalizeTime, splitDateTime, toDateTimeOffset } from "../calendar/datetime.js";
16
16
  import { styles } from "../calendar/picker.styles.js";
@@ -44,6 +44,11 @@ var UDateRangePicker = class UDateRangePicker extends UFormControlElement {
44
44
  constructor(..._args) {
45
45
  super(..._args);
46
46
  this.size = "md";
47
+ this.charsWidth = new CharsWidthController(this, {
48
+ chars: () => this.chars,
49
+ text: () => this.renderRoot.querySelector(".text-input"),
50
+ box: () => this.renderRoot.querySelector(".container")
51
+ });
47
52
  this.clearable = false;
48
53
  this.format = "iso";
49
54
  this.presets = [];
@@ -207,7 +212,7 @@ var UDateRangePicker = class UDateRangePicker extends UFormControlElement {
207
212
  return (this.clearable && this.value ? 1 : 0) + 1;
208
213
  }
209
214
  render() {
210
- const chars = charsWidth(this.chars);
215
+ const chars = this.charsWidth.width;
211
216
  const pattern = this.mode === "datetime" ? `${dateTextPattern(this.format)} ${this.seconds ? "HH:mm:ss" : "HH:mm"}` : dateTextPattern(this.format);
212
217
  return html`
213
218
  <u-field part="field"
@@ -96,6 +96,8 @@ export declare class UInput extends UFormControlElement<string> {
96
96
  * `size` 는 이 컴포넌트에서 크기 단(sm·md·lg)이라 이름이 다르다. 폭을 준 칸(`width`·`block`)에서는 하한으로만 쓴다.
97
97
  */
98
98
  chars?: number;
99
+ /** `chars` 의 폭 — 그려지는 N자를 잰다(`ch` 는 글꼴 기능·자간을 빼고 잰다). */
100
+ private readonly charsWidth;
99
101
  placeholder?: string;
100
102
  /** 유효성 검사 패턴 (정규식) */
101
103
  pattern?: string;
@@ -121,8 +123,6 @@ export declare class UInput extends UFormControlElement<string> {
121
123
  * `string`이라 `valueAsString` 같은 변환 없이 그대로 넘긴다. */
122
124
  protected willUpdate(changedProperties: PropertyValues): void;
123
125
  protected updated(changedProperties: PropertyValues): void;
124
- /** `chars` 를 CSS 길이로 — 양의 수일 때만(그 밖은 지정 없음과 같다). */
125
- private get charsWidth();
126
126
  /** The shown number uses the locale's decimal separator — re-show it in the new locale (unless the user is typing in it). */
127
127
  protected localeChanged(): void;
128
128
  /** Canonical `value` → the text shown: the locale's decimal separator, no grouping inserted. */
@@ -8,7 +8,7 @@ import "../icon/UIcon.js";
8
8
  import { parseNumber } from "../../utilities/format.js";
9
9
  import "../field/UField.js";
10
10
  import "../popover/UPopover.js";
11
- import { charsWidth } from "../../utilities/chars.js";
11
+ import { CharsWidthController } from "../../utilities/chars.js";
12
12
  import { UOption } from "../option/UOption.js";
13
13
  import { styles } from "./UInput.styles.js";
14
14
  import { html } from "lit";
@@ -27,6 +27,11 @@ var UInput = class UInput extends UFormControlElement {
27
27
  this.autocorrect = false;
28
28
  this.autocapitalize = "off";
29
29
  this.size = "md";
30
+ this.charsWidth = new CharsWidthController(this, {
31
+ chars: () => this.chars,
32
+ text: () => this.renderRoot.querySelector("input"),
33
+ box: () => this.renderRoot.querySelector(".container")
34
+ });
30
35
  this.showPassword = false;
31
36
  this.numberText = "";
32
37
  this.syncingFromText = false;
@@ -195,12 +200,12 @@ var UInput = class UInput extends UFormControlElement {
195
200
  .validationMessage=${this.validationMessage}
196
201
  >
197
202
  <div class="container" part="container"
198
- style=${`--_icons: ${(showStepper ? 2 : 0) + (showClear ? 1 : 0) + (showToggle ? 1 : 0)}${this.charsWidth ? `; --input-min-text: ${this.charsWidth}` : ""}`}>
203
+ style=${`--_icons: ${(showStepper ? 2 : 0) + (showClear ? 1 : 0) + (showToggle ? 1 : 0)}${this.charsWidth.width ? `; --input-min-text: ${this.charsWidth.width}` : ""}`}>
199
204
 
200
205
  <slot name="prefix"></slot>
201
206
 
202
207
  <input part="input"
203
- style=${ifDefined(this.charsWidth ? `inline-size: ${this.charsWidth}` : void 0)}
208
+ style=${ifDefined(this.charsWidth.width ? `inline-size: ${this.charsWidth.width}` : void 0)}
204
209
  type=${isNumber || this.type === "password" && this.showPassword ? "text" : this.type}
205
210
  aria-label=${ifDefined(this.resolvedAriaLabel)}
206
211
  aria-description=${ifDefined(this.resolvedAriaDescription)}
@@ -307,10 +312,6 @@ var UInput = class UInput extends UFormControlElement {
307
312
  super.updated(changedProperties);
308
313
  if (changedProperties.has("value")) this.internals?.setFormValue(this.value ?? "");
309
314
  }
310
- /** `chars` 를 CSS 길이로 — 양의 수일 때만(그 밖은 지정 없음과 같다). */
311
- get charsWidth() {
312
- return charsWidth(this.chars);
313
- }
314
315
  /** The shown number uses the locale's decimal separator — re-show it in the new locale (unless the user is typing in it). */
315
316
  localeChanged() {
316
317
  if (this.type === "number" && this.shadowRoot?.activeElement !== this.inputEl) this.numberText = this.displayNumber(this.value ?? "");
@@ -43,6 +43,12 @@ export declare class UOption extends UElement {
43
43
  protected updated(changed: PropertyValues): void;
44
44
  render(): import('lit-html').TemplateResult<1>;
45
45
  private renderMarker;
46
+ /**
47
+ * 라벨(기본 slot)에 들어가는 노드. 아직 그려지지 않은 옵션(방금 붙어 첫 렌더 전)은 슬롯이 없으므로 라이트 DOM 에서
48
+ * 기본 slot 에 들어갈 자식(`slot` 속성 없는 것)을 읽는다 — 종전에는 그때 `value` 로 대신해, 막 추가된 옵션이 검색어에
49
+ * 라벨이 아니라 값으로 걸러졌다.
50
+ */
51
+ private labelNodes;
46
52
  /** 라벨(기본 slot)의 텍스트 노드만 추출한다 — 엘리먼트 자식(예: 설명용 `<p>`)은 제외. */
47
53
  getText(): string;
48
54
  /** 라벨(기본 slot) 노드를 clone해서 반환한다 — 원본은 옵션 목록에 계속 slot돼 있어야 하므로. */
@@ -56,13 +56,23 @@ var UOption = class UOption extends UElement {
56
56
  `;
57
57
  return nothing;
58
58
  }
59
+ /**
60
+ * 라벨(기본 slot)에 들어가는 노드. 아직 그려지지 않은 옵션(방금 붙어 첫 렌더 전)은 슬롯이 없으므로 라이트 DOM 에서
61
+ * 기본 slot 에 들어갈 자식(`slot` 속성 없는 것)을 읽는다 — 종전에는 그때 `value` 로 대신해, 막 추가된 옵션이 검색어에
62
+ * 라벨이 아니라 값으로 걸러졌다.
63
+ */
64
+ labelNodes() {
65
+ const slot = this.renderRoot?.querySelector("slot:not([name])");
66
+ if (slot) return slot.assignedNodes({ flatten: true });
67
+ return [...this.childNodes].filter((n) => !(n instanceof Element && n.hasAttribute("slot")));
68
+ }
59
69
  /** 라벨(기본 slot)의 텍스트 노드만 추출한다 — 엘리먼트 자식(예: 설명용 `<p>`)은 제외. */
60
70
  getText() {
61
- return this.renderRoot.querySelector("slot:not([name])")?.assignedNodes({ flatten: true }).filter((n) => n.nodeType === Node.TEXT_NODE).map((n) => n.textContent ?? "").join("").replace(/\s+/g, " ").trim() || this.value;
71
+ return this.labelNodes().filter((n) => n.nodeType === Node.TEXT_NODE).map((n) => n.textContent ?? "").join("").replace(/\s+/g, " ").trim() || this.value;
62
72
  }
63
73
  /** 라벨(기본 slot) 노드를 clone해서 반환한다 — 원본은 옵션 목록에 계속 slot돼 있어야 하므로. */
64
74
  getContent() {
65
- const nodes = this.renderRoot.querySelector("slot:not([name])")?.assignedNodes({ flatten: true }).map((n) => n.cloneNode(true)) ?? [];
75
+ const nodes = this.labelNodes().map((n) => n.cloneNode(true));
66
76
  return nodes.length > 0 ? nodes : [document.createTextNode(this.value)];
67
77
  }
68
78
  };
@@ -20,6 +20,7 @@ import { UPopover } from '../popover/UPopover.js';
20
20
  * @csspart container - 트리거 영역을 감싸는 요소
21
21
  * @csspart popover - 옵션 목록이 표시되는 팝오버 요소
22
22
  * @csspart search-input - 검색 입력 영역
23
+ * @csspart no-matches - 검색어에 맞는 옵션이 없을 때의 «일치하는 항목 없음» 상태 줄
23
24
  *
24
25
  * @cssprop --u-select-display - 호스트의 display (기본값: inline-block). 폼/그리드 셀에서
25
26
  * 컨테이너 폭을 채우려면 `block`으로 지정한다.
@@ -55,10 +56,18 @@ export declare class USelect extends UFormControlElement<string | string[]> {
55
56
  * `u-input` 의 `chars` 와 같은 축이다. 폭을 준 칸(`--u-select-width`·`block`)에서는 하한으로만 쓴다.
56
57
  */
57
58
  chars?: number;
59
+ /** `chars` 의 폭 — 그려지는 N자를 잰다(`ch` 는 글꼴 기능·자간을 빼고 잰다). */
60
+ private readonly charsWidth;
58
61
  /** 다중 선택 여부 */
59
62
  multiple: boolean;
60
63
  /** 검색 가능 여부 */
61
64
  searchable: boolean;
65
+ /**
66
+ * 검색어로 옵션을 거르는 주체. `local`(기본) — 옵션 글자·값에 검색어가 들어 있는 것만 보인다. `none` — 거르지 않는다:
67
+ * 옵션 집합의 주인이 소비자일 때(`search` 이벤트로 서버를 검색해 옵션을 바꾸는 원격 검색) 쓴다. 서버가 낱말 AND · 다른 칸으로
68
+ * 찾은 옵션을 라이브러리가 다시 걸러 숨기던 충돌이 사라진다.
69
+ */
70
+ filter: 'local' | 'none';
62
71
  /** 지우기 버튼 표시 여부 */
63
72
  clearable: boolean;
64
73
  /** 로딩 상태 표시 여부 */
@@ -74,6 +83,10 @@ export declare class USelect extends UFormControlElement<string | string[]> {
74
83
  containerEl?: HTMLElement;
75
84
  popoverEl?: UPopover;
76
85
  private options;
86
+ /** 검색칸의 지금 검색어(소문자 · 앞뒤 공백 없음). */
87
+ private query;
88
+ /** 검색어가 있는데 보이는 옵션이 없다 — 팝업에 «일치하는 항목 없음» 을 알린다. */
89
+ private noMatches;
77
90
  /** aria-expanded 배선용 팝오버 열림 상태 */
78
91
  private open;
79
92
  /** combobox → 팝업 연결용 고유 id (aria-controls). 검색 가능이면 팝업은 dialog 이고 그 안에 listbox 가 있다. */
@@ -85,6 +98,7 @@ export declare class USelect extends UFormControlElement<string | string[]> {
85
98
  private get valueAsArray();
86
99
  private get hasValue();
87
100
  disconnectedCallback(): void;
101
+ protected willUpdate(changedProperties: PropertyValues): void;
88
102
  protected updated(changedProperties: PropertyValues): void;
89
103
  render(): import('lit-html').TemplateResult<1>;
90
104
  private renderContent;
@@ -115,6 +129,11 @@ export declare class USelect extends UFormControlElement<string | string[]> {
115
129
  private handleOptionClick;
116
130
  private handleOptionKeydown;
117
131
  private handleSearchInput;
132
+ /**
133
+ * 지금 검색어를 지금 옵션에 적용한다 — 입력 때뿐 아니라 옵션이 바뀔 때도(재사용된 `u-option` 이 앞 검색의 `hidden` 을
134
+ * 들고 남지 않게). `filter="none"` 이면 아무것도 숨기지 않는다.
135
+ */
136
+ private applyFilter;
118
137
  private handleSearchKeydown;
119
138
  private handleClearClick;
120
139
  /** suffix `u-icon`은 순수 표시 요소(버튼 아님)라 네이티브 키보드 활성화가 없다 —
@@ -7,7 +7,7 @@ import "../icon/UIcon.js";
7
7
  import "../chip/UChip.js";
8
8
  import "../field/UField.js";
9
9
  import "../popover/UPopover.js";
10
- import { charsWidth } from "../../utilities/chars.js";
10
+ import { CharsWidthController } from "../../utilities/chars.js";
11
11
  import { UOption } from "../option/UOption.js";
12
12
  import { styles } from "./USelect.styles.js";
13
13
  import { html } from "lit";
@@ -19,11 +19,19 @@ var USelect = class USelect extends UFormControlElement {
19
19
  super(..._args);
20
20
  this.appearance = "outlined";
21
21
  this.size = "md";
22
+ this.charsWidth = new CharsWidthController(this, {
23
+ chars: () => this.chars,
24
+ text: () => this.renderRoot.querySelector(".text-content, .chips-content"),
25
+ box: () => this.renderRoot.querySelector(".container")
26
+ });
22
27
  this.multiple = false;
23
28
  this.searchable = false;
29
+ this.filter = "local";
24
30
  this.clearable = false;
25
31
  this.loading = false;
26
32
  this.options = [];
33
+ this.query = "";
34
+ this.noMatches = false;
27
35
  this.open = false;
28
36
  this.idBase = `u-select-${Math.random().toString(36).slice(2, 8)}`;
29
37
  this.listboxId = `${this.idBase}-listbox`;
@@ -33,6 +41,7 @@ var USelect = class USelect extends UFormControlElement {
33
41
  const slot = e.target;
34
42
  this.options = slot.assignedElements({ flatten: true }).filter((el) => el instanceof UOption);
35
43
  this.setup(this.options);
44
+ this.applyFilter();
36
45
  };
37
46
  this.handlePopoverHide = () => {
38
47
  this.open = false;
@@ -89,15 +98,11 @@ var USelect = class USelect extends UFormControlElement {
89
98
  }
90
99
  };
91
100
  this.handleSearchInput = (e) => {
92
- const query = e.target.value.toLowerCase().trim();
93
- for (const option of this.options) if (!query) option.hidden = false;
94
- else {
95
- const label = option.getText().toLowerCase();
96
- const value = option.value.toLowerCase();
97
- option.hidden = !label.includes(query) && !value.includes(query);
98
- }
101
+ const input = e.target;
102
+ this.query = input.value.toLowerCase().trim();
103
+ this.applyFilter();
99
104
  this.fire("search", {
100
- detail: { query },
105
+ detail: { query: this.query },
101
106
  cancelable: false
102
107
  });
103
108
  };
@@ -160,13 +165,17 @@ var USelect = class USelect extends UFormControlElement {
160
165
  this.cleanup(this.options);
161
166
  super.disconnectedCallback();
162
167
  }
168
+ willUpdate(changedProperties) {
169
+ super.willUpdate(changedProperties);
170
+ if (changedProperties.has("filter") || changedProperties.has("loading")) this.applyFilter();
171
+ }
163
172
  updated(changedProperties) {
164
173
  super.updated(changedProperties);
165
174
  if (["value", "options"].some((k) => changedProperties.has(k))) this.onChangeValue();
166
175
  if (changedProperties.has("open")) this.internals?.states[this.open ? "add" : "delete"]("open");
167
176
  }
168
177
  render() {
169
- const chars = charsWidth(this.chars);
178
+ const chars = this.charsWidth.width;
170
179
  return html`
171
180
  <u-field part="field"
172
181
  ?required=${this.required}
@@ -242,6 +251,7 @@ var USelect = class USelect extends UFormControlElement {
242
251
  @keydown=${this.handleSearchKeydown}
243
252
  />
244
253
  </div>
254
+ <div class="no-matches" part="no-matches" role="status">${this.noMatches ? Locale.getValue("noMatches") : ""}</div>
245
255
  <div class="listbox" role="listbox" id=${this.listboxId}
246
256
  aria-multiselectable=${ifDefined(this.multiple ? "true" : void 0)}>
247
257
  <slot @slotchange=${this.handleSlotChange}></slot>
@@ -336,6 +346,20 @@ var USelect = class USelect extends UFormControlElement {
336
346
  composed: true
337
347
  }));
338
348
  }
349
+ /**
350
+ * 지금 검색어를 지금 옵션에 적용한다 — 입력 때뿐 아니라 옵션이 바뀔 때도(재사용된 `u-option` 이 앞 검색의 `hidden` 을
351
+ * 들고 남지 않게). `filter="none"` 이면 아무것도 숨기지 않는다.
352
+ */
353
+ applyFilter() {
354
+ const query = this.filter === "none" ? "" : this.query;
355
+ for (const option of this.options) if (!query) option.hidden = false;
356
+ else {
357
+ const label = option.getText().toLowerCase();
358
+ const value = option.value.toLowerCase();
359
+ option.hidden = !label.includes(query) && !value.includes(query);
360
+ }
361
+ this.noMatches = !!this.query && !this.loading && !this.options.some((o) => !o.hidden);
362
+ }
339
363
  };
340
364
  __decorate([property({
341
365
  type: String,
@@ -357,6 +381,10 @@ __decorate([property({
357
381
  type: Boolean,
358
382
  reflect: true
359
383
  }), __decorateMetadata("design:type", Boolean)], USelect.prototype, "searchable", void 0);
384
+ __decorate([property({
385
+ type: String,
386
+ reflect: true
387
+ }), __decorateMetadata("design:type", String)], USelect.prototype, "filter", void 0);
360
388
  __decorate([property({
361
389
  type: Boolean,
362
390
  reflect: true
@@ -386,6 +414,7 @@ __decorate([property({ converter: { fromAttribute: (value) => {
386
414
  __decorate([query(".container", true), __decorateMetadata("design:type", typeof HTMLElement === "undefined" ? Object : HTMLElement)], USelect.prototype, "containerEl", void 0);
387
415
  __decorate([query("u-popover", true), __decorateMetadata("design:type", Object)], USelect.prototype, "popoverEl", void 0);
388
416
  __decorate([state(), __decorateMetadata("design:type", Array)], USelect.prototype, "options", void 0);
417
+ __decorate([state(), __decorateMetadata("design:type", Object)], USelect.prototype, "noMatches", void 0);
389
418
  __decorate([state(), __decorateMetadata("design:type", Boolean)], USelect.prototype, "open", void 0);
390
419
  USelect = __decorate([customElement("u-select")], USelect);
391
420
  //#endregion
@@ -228,6 +228,15 @@ var styles = css`
228
228
  overflow-y: auto;
229
229
  }
230
230
 
231
+ /* 결과 0건 — 비어 있을 때는 자리를 차지하지 않는다(상태 영역은 늘 있어야 바뀐 문구가 읽힌다). */
232
+ .no-matches:empty {
233
+ display: none;
234
+ }
235
+ .no-matches {
236
+ padding: var(--u-field-padding-block, 0.3em) var(--u-field-padding-inline, 0.6em);
237
+ color: var(--u-txt-color-weak, #616161);
238
+ }
239
+
231
240
  .search-input {
232
241
  display: flex;
233
242
  align-items: center;
@@ -12,7 +12,7 @@ export type SupportedLocale = 'en' | 'ko' | 'ja' | 'zh-CN' | 'zh-TW' | 'es' | 'f
12
12
  /** 내장 로케일은 자동완성되지만, 임의의 BCP47 태그도 그대로 받는다. */
13
13
  export type LocaleTag = SupportedLocale | (string & {});
14
14
  /** 라이브러리가 제공하는 chrome 문자열 키. 지금은 검증 메시지뿐이지만 이후 다른 UI 문구도 추가될 수 있다. */
15
- export type LocaleMessageKey = 'valueMissing' | 'badInput' | 'typeMismatch' | 'patternMismatch' | 'rangeUnderflow' | 'rangeOverflow' | 'stepMismatch' | 'tooShort' | 'tooLong' | 'increment' | 'decrement' | 'clear' | 'today' | 'time' | 'showPassword' | 'hidePassword' | 'previousSlide' | 'nextSlide' | 'goToSlide' | 'carousel' | 'slide' | 'slideOf' | 'stopSlideRotation' | 'startSlideRotation' | 'chooseDate' | 'chooseDateRange' | 'yesterday' | 'last7Days' | 'last30Days' | 'thisWeek' | 'lastWeek' | 'thisMonth' | 'lastMonth' | 'thisYear' | 'quickRanges' | 'rangeStartChosen' | 'previousMonth' | 'nextMonth' | 'close' | 'copy' | 'copied' | 'chooseFile' | 'noFileChosen' | 'filesSelected' | 'resizePanels' | 'loading' | 'breadcrumb' | 'search' | 'alertError' | 'alertWarning' | 'alertSuccess' | 'alertInfo' | 'alertNotice' | 'alertMessage' | 'remove' | 'closeTab' | 'confirm' | 'cancel' | 'ok' | 'stepComplete' | 'stepOnHold' | 'apply' | 'dateUnavailable' | 'startTime' | 'endTime' | 'timeAm' | 'timePm';
15
+ export type LocaleMessageKey = 'valueMissing' | 'badInput' | 'typeMismatch' | 'patternMismatch' | 'rangeUnderflow' | 'rangeOverflow' | 'stepMismatch' | 'tooShort' | 'tooLong' | 'increment' | 'decrement' | 'clear' | 'today' | 'time' | 'showPassword' | 'hidePassword' | 'previousSlide' | 'nextSlide' | 'goToSlide' | 'carousel' | 'slide' | 'slideOf' | 'stopSlideRotation' | 'startSlideRotation' | 'chooseDate' | 'chooseDateRange' | 'yesterday' | 'last7Days' | 'last30Days' | 'thisWeek' | 'lastWeek' | 'thisMonth' | 'lastMonth' | 'thisYear' | 'quickRanges' | 'rangeStartChosen' | 'previousMonth' | 'nextMonth' | 'close' | 'copy' | 'copied' | 'chooseFile' | 'noFileChosen' | 'filesSelected' | 'resizePanels' | 'loading' | 'breadcrumb' | 'search' | 'noMatches' | 'alertError' | 'alertWarning' | 'alertSuccess' | 'alertInfo' | 'alertNotice' | 'alertMessage' | 'remove' | 'closeTab' | 'confirm' | 'cancel' | 'ok' | 'stepComplete' | 'stepOnHold' | 'apply' | 'dateUnavailable' | 'startTime' | 'endTime' | 'timeAm' | 'timePm';
16
16
  type LocaleTable = Record<LocaleMessageKey, string>;
17
17
  /**
18
18
  * 한 패키지(또는 앱 영역)의 문자열 묶음.
@@ -1,7 +1,36 @@
1
+ import { ReactiveController, ReactiveControllerHost } from 'lit';
2
+ /** `chars` 가 유효한 글자 수인가 — 양의 유한수일 때만(그 밖은 지정 없음과 같다). 소수는 올린다. */
3
+ export declare function charsCount(n: number | undefined | null): number | undefined;
4
+ /** 이 컨트롤러가 측정하는 컨트롤이 내주는 것. */
5
+ export interface CharsWidthOptions {
6
+ /** 칸이 담을 글자 수(`chars` 속성). */
7
+ chars(): number | undefined;
8
+ /** 글자를 그리는 요소 — 그 계산된 글꼴로 잰다. 없으면 `box` 의 글꼴로. */
9
+ text(): HTMLElement | null | undefined;
10
+ /** 측정용 요소를 붙일 자리(글자 영역을 담는 컨테이너). */
11
+ box(): HTMLElement | null | undefined;
12
+ }
1
13
  /**
2
- * `chars`(칸이 담을 글자 수)를 CSS 길이로 — 양의 유한수일 때만(그 밖은 지정 없음과 같다). 소수는 올린다.
14
+ * `chars` 의 폭 — «N자 칸» 을 **그려지는 N자** 로 잰다.
3
15
  *
4
- * 글자를 받는 폼 컨트롤(`u-input`·`u-select`·`u-date-picker`·`u-date-range-picker`)이 같은 규칙을 쓴다 —
5
- * 각자 글자 영역 하한(`--*-min-text`)과 표시 글자 요소의 폭에 이 값을 준다. 한 곳에서 정해 형제가 갈리지 않게 한다.
16
+ * CSS `ch` 는 글꼴 기능을 뺀 `0` 하나의 폭이다. 숫자를 고정폭(`font-variant-numeric: tabular-nums`)으로 그리거나
17
+ * 자간(`letter-spacing`)을 주면 N자가 `Nch` 를 넘어, «N자리 숫자 칸» 이 마지막 숫자를 잘랐다(Pretendard 14px 에서 자당
18
+ * 0.33px — 6자리면 2px). 그래서 글자 요소의 계산된 글꼴을 옮긴 보이지 않는 요소에 `0` N개를 실제로 그리고 그 폭을 쓴다.
19
+ * 크기는 `ResizeObserver` 로 따른다 — 웹 글꼴이 늦게 실리거나 크기 단(`size`)이 바뀌어 폭이 달라지면 다시 읽는다.
20
+ * 재기 전(첫 그림)에는 `Nch` 로 그린다.
6
21
  */
7
- export declare function charsWidth(n: number | undefined | null): string | undefined;
22
+ export declare class CharsWidthController implements ReactiveController {
23
+ private readonly host;
24
+ private readonly options;
25
+ private sizer?;
26
+ private observer?;
27
+ private measured?;
28
+ constructor(host: ReactiveControllerHost & HTMLElement, options: CharsWidthOptions);
29
+ /** 글자 영역의 CSS 길이 — 잰 폭(px), 재기 전에는 `Nch`, `chars` 가 없으면 `undefined`. */
30
+ get width(): string | undefined;
31
+ hostUpdated(): void;
32
+ hostDisconnected(): void;
33
+ private measure;
34
+ private read;
35
+ private release;
36
+ }
@@ -1,12 +1,91 @@
1
1
  //#region src/utilities/chars.ts
2
+ /** `chars` 가 유효한 글자 수인가 — 양의 유한수일 때만(그 밖은 지정 없음과 같다). 소수는 올린다. */
3
+ function charsCount(n) {
4
+ return n != null && Number.isFinite(n) && n > 0 ? Math.ceil(n) : void 0;
5
+ }
6
+ /** 측정용 요소에 옮기는 글꼴 속성 — 그려지는 글자 폭을 바꾸는 것 전부. */
7
+ var FONT_PROPS = [
8
+ "font-family",
9
+ "font-size",
10
+ "font-weight",
11
+ "font-style",
12
+ "font-stretch",
13
+ "font-variant-numeric",
14
+ "font-feature-settings",
15
+ "font-variation-settings",
16
+ "font-kerning",
17
+ "letter-spacing"
18
+ ];
2
19
  /**
3
- * `chars`(칸이 담을 글자 수)를 CSS 길이로 — 양의 유한수일 때만(그 밖은 지정 없음과 같다). 소수는 올린다.
20
+ * `chars` 의 폭 — «N자 칸» 을 **그려지는 N자** 로 잰다.
4
21
  *
5
- * 글자를 받는 폼 컨트롤(`u-input`·`u-select`·`u-date-picker`·`u-date-range-picker`)이 같은 규칙을 쓴다 —
6
- * 각자 글자 영역 하한(`--*-min-text`)과 표시 글자 요소의 폭에 이 값을 준다. 한 곳에서 정해 형제가 갈리지 않게 한다.
22
+ * CSS `ch` 는 글꼴 기능을 뺀 `0` 하나의 폭이다. 숫자를 고정폭(`font-variant-numeric: tabular-nums`)으로 그리거나
23
+ * 자간(`letter-spacing`)을 주면 N자가 `Nch` 를 넘어, «N자리 숫자 칸» 이 마지막 숫자를 잘랐다(Pretendard 14px 에서 자당
24
+ * 0.33px — 6자리면 2px). 그래서 글자 요소의 계산된 글꼴을 옮긴 보이지 않는 요소에 `0` N개를 실제로 그리고 그 폭을 쓴다.
25
+ * 크기는 `ResizeObserver` 로 따른다 — 웹 글꼴이 늦게 실리거나 크기 단(`size`)이 바뀌어 폭이 달라지면 다시 읽는다.
26
+ * 재기 전(첫 그림)에는 `Nch` 로 그린다.
7
27
  */
8
- function charsWidth(n) {
9
- return n != null && Number.isFinite(n) && n > 0 ? `${Math.ceil(n)}ch` : void 0;
10
- }
28
+ var CharsWidthController = class {
29
+ constructor(host, options) {
30
+ this.host = host;
31
+ this.options = options;
32
+ host.addController(this);
33
+ }
34
+ /** 글자 영역의 CSS 길이 — 잰 폭(px), 재기 전에는 `Nch`, `chars` 가 없으면 `undefined`. */
35
+ get width() {
36
+ const n = charsCount(this.options.chars());
37
+ if (!n) return void 0;
38
+ return this.measured != null ? `${this.measured}px` : `${n}ch`;
39
+ }
40
+ hostUpdated() {
41
+ this.measure();
42
+ }
43
+ hostDisconnected() {
44
+ this.release();
45
+ }
46
+ measure() {
47
+ const n = charsCount(this.options.chars());
48
+ const box = this.options.box();
49
+ if (!n || !box) {
50
+ if (this.sizer) {
51
+ this.release();
52
+ this.host.requestUpdate();
53
+ }
54
+ return;
55
+ }
56
+ if (!this.sizer || this.sizer.parentNode?.parentNode !== box) {
57
+ this.release();
58
+ const frame = document.createElement("span");
59
+ frame.setAttribute("aria-hidden", "true");
60
+ frame.style.cssText = "position:absolute;inset-block-start:0;inset-inline-start:0;inline-size:0;block-size:0;overflow:hidden;visibility:hidden;pointer-events:none";
61
+ const sizer = document.createElement("span");
62
+ sizer.style.cssText = "display:inline-block;white-space:pre";
63
+ frame.appendChild(sizer);
64
+ box.appendChild(frame);
65
+ this.sizer = sizer;
66
+ this.observer = new ResizeObserver((entries) => this.read(entries[entries.length - 1].contentRect.width));
67
+ this.observer.observe(sizer);
68
+ }
69
+ const sizer = this.sizer;
70
+ const source = getComputedStyle(this.options.text() ?? box);
71
+ for (const prop of FONT_PROPS) sizer.style.setProperty(prop, source.getPropertyValue(prop));
72
+ const digits = "0".repeat(n);
73
+ if (sizer.textContent !== digits) sizer.textContent = digits;
74
+ }
75
+ read(width) {
76
+ if (!(width > 0)) return;
77
+ const rounded = Math.ceil(width);
78
+ if (rounded === this.measured) return;
79
+ this.measured = rounded;
80
+ this.host.requestUpdate();
81
+ }
82
+ release() {
83
+ this.observer?.disconnect();
84
+ this.observer = void 0;
85
+ this.sizer?.parentElement?.remove();
86
+ this.sizer = void 0;
87
+ this.measured = void 0;
88
+ }
89
+ };
11
90
  //#endregion
12
- export { charsWidth };
91
+ export { CharsWidthController, charsCount };
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.11.0",
4
+ "version": "2.12.0",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "components",
@@ -82,7 +82,7 @@ starts from the value. Typing in the text box still commits on Enter or leaving
82
82
  | `min` | `string` | — | — | Minimum selectable date (ISO `YYYY-MM-DD`, date-only in both modes) |
83
83
  | `max` | `string` | — | — | Maximum selectable date (ISO `YYYY-MM-DD`, date-only in both modes) |
84
84
  | `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: 12px · `--u-density` (14px) · 16px. A field and a button of the same size share a height |
85
- | `chars` | `number` | — | ✓ | Characters the field holds. An unsized field draws at N characters + its clear and calendar buttons + padding; a sized one uses it as the text floor, so a narrower box overflows. Give the length of the `format` pattern for a box that fits it exactly. Same axis as `u-input`'s `chars` |
85
+ | `chars` | `number` | — | ✓ | Characters the field holds. An unsized field draws at N characters + its clear and calendar buttons + padding; a sized one uses it as the text floor, so a narrower box overflows. Give the length of the `format` pattern for a box that fits it exactly. Same axis as `u-input`'s `chars`. N characters are measured as drawn — tabular figures and letter spacing count, which CSS `ch` leaves out |
86
86
  | `clearable` | `boolean` | `false` | ✓ | Show clear button |
87
87
  | `isDateDisabled` | `(date: string) => boolean` | — | — | App rule for days that cannot be chosen (ISO in, `true` = disabled). Property only; see «Disabled days» |
88
88
  | `placeholder` | `string` | — | — | Placeholder text (defaults to the pattern to type, e.g. `YYYY-MM-DD` or `YYYY-MM-DD HH:mm`) |
@@ -138,7 +138,7 @@ picker.addEventListener('change', () => {
138
138
  | `min` | `string` | — | — | Earliest selectable day (ISO `YYYY-MM-DD`), inclusive |
139
139
  | `max` | `string` | — | — | Latest selectable day (ISO `YYYY-MM-DD`), inclusive |
140
140
  | `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: 12px · `--u-density` (14px) · 16px. A field and a button of the same size share a height |
141
- | `chars` | `number` | — | ✓ | Characters the field holds — both dates and the separator (`a – b`). An unsized field draws at N characters + its clear and calendar buttons + padding; a sized one uses it as the text floor, so a narrower box overflows. Same axis as `u-input`'s `chars` |
141
+ | `chars` | `number` | — | ✓ | Characters the field holds — both dates and the separator (`a – b`). An unsized field draws at N characters + its clear and calendar buttons + padding; a sized one uses it as the text floor, so a narrower box overflows. Same axis as `u-input`'s `chars`. N characters are measured as drawn — tabular figures and letter spacing count, which CSS `ch` leaves out |
142
142
  | `clearable` | `boolean` | `false` | ✓ | Show clear button |
143
143
  | `isDateDisabled` | `(date: string) => boolean` | — | — | App rule for days that cannot start or end a range (ISO in, `true` = disabled). Property only; see «Disabled days» |
144
144
  | `placeholder` | `string` | — | — | Placeholder text (defaults to the pattern to type) |
@@ -57,7 +57,7 @@ the library does not infer one from field meaning.
57
57
  | `appearance` | `'outlined'\|'soft'\|'underlined'\|'plain'` | `'outlined'` | ✓ | How much chrome: `outlined` · `soft` tinted face · `underlined` bottom line only · `plain` no chrome |
58
58
  | `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: 12px · `--u-density` (14px) · 16px. A field and a button of the same size share a height |
59
59
  | `type` | `'text'\|'password'\|'email'\|'tel'\|'url'\|'search'\|'number'\|'date'\|'time'`… | `'text'` | — | Input type |
60
- | `chars` | `number` | — | ✓ | Characters the field holds. An unsized field draws at N characters + its suffix icons + padding; a sized one (`width`, `block`) uses it as the text floor, so a narrower box overflows. Not `size` — that is the sm/md/lg scale |
60
+ | `chars` | `number` | — | ✓ | Characters the field holds. An unsized field draws at N characters + its suffix icons + padding; a sized one (`width`, `block`) uses it as the text floor, so a narrower box overflows. Not `size` — that is the sm/md/lg scale. N characters are measured as drawn — tabular figures and letter spacing count, which CSS `ch` leaves out |
61
61
  | `placeholder` | `string` | — | — | Placeholder text |
62
62
  | `clearable` | `boolean` | `false` | ✓ | Show clear button |
63
63
  | `minlength` | `number` | — | — | Minimum character count |
@@ -39,9 +39,10 @@ Dropdown select with single or multiple selection, search, and clear support. Fo
39
39
  | `value` | `string \| string[]` | — | — | Selected value(s) |
40
40
  | `appearance` | `'outlined'\|'soft'\|'underlined'\|'plain'` | `'outlined'` | ✓ | How much chrome: `outlined` · `soft` tinted face · `underlined` bottom line only · `plain` no chrome |
41
41
  | `size` | `'sm'\|'md'\|'lg'` | `'md'` | ✓ | Field size, like a button's: 12px · `--u-density` (14px) · 16px. A field and a button of the same size share a height |
42
- | `chars` | `number` | — | ✓ | Characters the field holds. An unsized field draws at N characters + its clear button and arrow + padding, so it no longer widens and narrows with the chosen option (a longer one ends in an ellipsis); a sized one (`--u-select-width`, `block`) uses it as the text floor, so a narrower box overflows. Same axis as `u-input`'s `chars` |
42
+ | `chars` | `number` | — | ✓ | Characters the field holds. An unsized field draws at N characters + its clear button and arrow + padding, so it no longer widens and narrows with the chosen option (a longer one ends in an ellipsis); a sized one (`--u-select-width`, `block`) uses it as the text floor, so a narrower box overflows. Same axis as `u-input`'s `chars`. N characters are measured as drawn — tabular figures and letter spacing count, which CSS `ch` leaves out |
43
43
  | `multiple` | `boolean` | `false` | ✓ | Allow multiple selections |
44
44
  | `searchable` | `boolean` | `false` | ✓ | Filter options by text |
45
+ | `filter` | `'local'\|'none'` | `'local'` | ✓ | Who filters by the search text. `local` shows options whose text or value contains it; `none` hides nothing — for remote search, where the `search` event drives a server query and you replace the options with its results. When the text matches nothing (and not `loading`), the popup says *No matches* |
45
46
  | `clearable` | `boolean` | `false` | ✓ | Show clear button |
46
47
  | `loading` | `boolean` | `false` | ✓ | Loading state |
47
48
  | `placeholder` | `string` | — | — | Placeholder text |
@@ -61,7 +62,7 @@ Dropdown select with single or multiple selection, search, and clear support. Fo
61
62
  | Event | Description |
62
63
  |-------|-------------|
63
64
  | `change` | Fires when selection changes |
64
- | `search` | Fires on every search input change when `searchable` (`detail: { query: string }`). Fires alongside the built-in local filtering — subscribe to it to drive remote/server-side search instead of (or in addition to) the local filter |
65
+ | `search` | Fires on every search input change when `searchable` (`detail: { query: string }`). With `filter="none"` the select hides nothing, so the options you set from the server are shown as they are — otherwise the built-in local filter runs too |
65
66
 
66
67
  ## Methods
67
68
 
@@ -89,6 +90,7 @@ the first/last visible option; on an option, arrows, `Home`/`End`, `Enter`/`Spac
89
90
  | `container` | Trigger area |
90
91
  | `popover` | Dropdown list container |
91
92
  | `search-input` | Search input inside dropdown |
93
+ | `no-matches` | *No matches* status line in the dropdown (empty and hidden otherwise) |
92
94
 
93
95
  ## CSS Custom Properties
94
96