@iyulab/components 2.7.0 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/dist/assets/locales/ar.json.js +3 -1
- package/dist/assets/locales/de.json.js +1 -0
- package/dist/assets/locales/en.json.js +1 -0
- package/dist/assets/locales/es.json.js +3 -1
- package/dist/assets/locales/fr.json.js +1 -0
- package/dist/assets/locales/id.json.js +1 -0
- package/dist/assets/locales/ja.json.js +1 -0
- package/dist/assets/locales/ko.json.js +3 -1
- package/dist/assets/locales/pt-BR.json.js +1 -0
- package/dist/assets/locales/ru.json.js +3 -1
- package/dist/assets/locales/th.json.js +3 -1
- package/dist/assets/locales/vi.json.js +1 -0
- package/dist/assets/locales/zh-CN.json.js +3 -1
- package/dist/assets/locales/zh-TW.json.js +3 -1
- package/dist/components/UElement.d.ts +10 -0
- package/dist/components/UElement.js +18 -0
- package/dist/components/UFormControlElement.d.ts +5 -0
- package/dist/components/UFormControlElement.js +8 -0
- package/dist/components/alert/UAlert.js +16 -2
- package/dist/components/breadcrumb/UBreadcrumb.js +1 -1
- package/dist/components/calendar/UCalendar.js +1 -1
- package/dist/components/carousel/UCarousel.d.ts +2 -0
- package/dist/components/carousel/UCarousel.js +7 -1
- package/dist/components/checkbox/UCheckbox.js +1 -1
- package/dist/components/chip/UChip.js +1 -1
- package/dist/components/copy-button/UCopyButton.js +1 -1
- package/dist/components/date-picker/UDatePicker.js +1 -1
- package/dist/components/date-range-picker/UDateRangePicker.js +1 -1
- package/dist/components/dialog/UDialog.js +1 -1
- package/dist/components/drawer/UDrawer.js +1 -1
- package/dist/components/file-input/UFileInput.js +1 -1
- package/dist/components/input/UInput.d.ts +10 -0
- package/dist/components/input/UInput.js +17 -2
- package/dist/components/radio/URadio.js +1 -1
- package/dist/components/rating/URating.js +1 -1
- package/dist/components/select/USelect.js +1 -1
- package/dist/components/slider/USlider.js +1 -1
- package/dist/components/spinner/USpinner.d.ts +4 -0
- package/dist/components/spinner/USpinner.js +8 -1
- package/dist/components/split-panel/USplitPanel.d.ts +2 -0
- package/dist/components/split-panel/USplitPanel.js +6 -1
- package/dist/components/steps/USteps.js +1 -1
- package/dist/components/switch/USwitch.js +1 -1
- package/dist/components/tab/UTab.js +1 -1
- package/dist/components/textarea/UTextarea.js +1 -1
- package/dist/index.js +1 -1
- package/dist/utilities/Dialog.d.ts +5 -1
- package/dist/utilities/Dialog.js +6 -2
- package/dist/utilities/Locale.d.ts +12 -1
- package/dist/utilities/Locale.js +32 -0
- package/package.json +1 -1
- package/skills/iyulab-components/references/components/alert.md +1 -1
- package/skills/iyulab-components/references/components/input.md +1 -0
- package/skills/iyulab-components/references/utilities/dialog.md +5 -1
- package/skills/iyulab-components/references/utilities/locale.md +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.9.0] - 2026-10-07
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **`u-input` `chars`** — the number of characters the field holds. An unsized field (the default `inline-block`) draws
|
|
8
|
+
at N characters plus its suffix icons and padding, so "a 12-digit number box" no longer needs a `calc()` that copies
|
|
9
|
+
the field's icon boxes and padding (and drifts when the host target floor changes). In a sized field it is the text
|
|
10
|
+
floor. Native `<input size>` / CSS `field-sizing` axis — `size` is already this component's sm/md/lg scale.
|
|
11
|
+
- `AlertDialogOptions.confirmLabel` and the locale key `ok` (en `OK`, ko `확인`, es `Aceptar` …).
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **`Dialog.alert` has an OK button**, focused when it opens — like a native `alert()`. It opened with no button at
|
|
16
|
+
all, so it closed only by Esc or a backdrop click (neither visible), and the `alertdialog` had nowhere for focus to
|
|
17
|
+
go (WAI-ARIA APG Alert Dialog).
|
|
18
|
+
|
|
19
|
+
## [2.8.0] - 2026-10-07
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- **Switching the locale at runtime updates what is already on screen.** `Locale.set()` and `Locale.register()` now
|
|
24
|
+
notify, and every connected component re-renders — including text it keeps outside its template: form validation
|
|
25
|
+
messages, `u-spinner`'s default name, `u-split-panel`'s handle name, `u-carousel`'s descriptions and slide names, the
|
|
26
|
+
decimal separator shown by `u-input type="number"`. An element detached during the change catches up when attached
|
|
27
|
+
again. Before, the old language stayed until something else re-rendered the component.
|
|
28
|
+
- `Locale.subscribe(listener)` (returns the unsubscribe function) and `Locale.revision` for your own code —
|
|
29
|
+
`useSyncExternalStore(Locale.subscribe, () => Locale.revision)` in React.
|
|
30
|
+
- `UElement.localeChanged()` — a protected hook for subclasses that keep localized text outside `render()`.
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- **An unknown `u-alert` `status` warning names the likely word** — `status="danger"` now warns "Did you mean
|
|
35
|
+
status="error"?" (also `warn`, `critical`, `positive` …). `status` is an outcome (`error`) while a button's or
|
|
36
|
+
badge's `color` is a palette role (`danger`); a value carried over from `color` rendered as a neutral notice with only
|
|
37
|
+
the list of valid values to go on.
|
|
38
|
+
|
|
3
39
|
## [2.7.0] - 2026-10-07
|
|
4
40
|
|
|
5
41
|
### Added
|
|
@@ -57,6 +57,7 @@ var closeTab = "إغلاق علامة التبويب";
|
|
|
57
57
|
var breadcrumb = "مسار التنقل";
|
|
58
58
|
var confirm = "تأكيد";
|
|
59
59
|
var cancel = "إلغاء";
|
|
60
|
+
var ok = "حسنًا";
|
|
60
61
|
var stepComplete = "مكتمل";
|
|
61
62
|
var stepOnHold = "معلّق";
|
|
62
63
|
var apply = "تطبيق";
|
|
@@ -122,6 +123,7 @@ var ar_default = {
|
|
|
122
123
|
breadcrumb,
|
|
123
124
|
confirm,
|
|
124
125
|
cancel,
|
|
126
|
+
ok,
|
|
125
127
|
stepComplete,
|
|
126
128
|
stepOnHold,
|
|
127
129
|
apply,
|
|
@@ -132,4 +134,4 @@ var ar_default = {
|
|
|
132
134
|
timePm: "م"
|
|
133
135
|
};
|
|
134
136
|
//#endregion
|
|
135
|
-
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, 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 };
|
|
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 };
|
|
@@ -56,6 +56,7 @@ var closeTab = "Cerrar pestaña";
|
|
|
56
56
|
var breadcrumb = "Ruta de navegación";
|
|
57
57
|
var confirm = "Confirmar";
|
|
58
58
|
var cancel = "Cancelar";
|
|
59
|
+
var ok = "Aceptar";
|
|
59
60
|
var stepComplete = "Completado";
|
|
60
61
|
var stepOnHold = "En espera";
|
|
61
62
|
var apply = "Aplicar";
|
|
@@ -123,6 +124,7 @@ var es_default = {
|
|
|
123
124
|
breadcrumb,
|
|
124
125
|
confirm,
|
|
125
126
|
cancel,
|
|
127
|
+
ok,
|
|
126
128
|
stepComplete,
|
|
127
129
|
stepOnHold,
|
|
128
130
|
apply,
|
|
@@ -133,4 +135,4 @@ var es_default = {
|
|
|
133
135
|
timePm
|
|
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, es_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, 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, 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 };
|
|
@@ -57,6 +57,7 @@ var closeTab = "탭 닫기";
|
|
|
57
57
|
var breadcrumb = "탐색 경로";
|
|
58
58
|
var confirm = "확인";
|
|
59
59
|
var cancel = "취소";
|
|
60
|
+
var ok = "확인";
|
|
60
61
|
var stepComplete = "완료";
|
|
61
62
|
var stepOnHold = "보류";
|
|
62
63
|
var apply = "적용";
|
|
@@ -124,6 +125,7 @@ var ko_default = {
|
|
|
124
125
|
breadcrumb,
|
|
125
126
|
confirm,
|
|
126
127
|
cancel,
|
|
128
|
+
ok,
|
|
127
129
|
stepComplete,
|
|
128
130
|
stepOnHold,
|
|
129
131
|
apply,
|
|
@@ -134,4 +136,4 @@ var ko_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, ko_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, 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 };
|
|
@@ -57,6 +57,7 @@ var closeTab = "Закрыть вкладку";
|
|
|
57
57
|
var breadcrumb = "Навигационная цепочка";
|
|
58
58
|
var confirm = "Подтвердить";
|
|
59
59
|
var cancel = "Отмена";
|
|
60
|
+
var ok = "ОК";
|
|
60
61
|
var stepComplete = "Завершено";
|
|
61
62
|
var stepOnHold = "Приостановлено";
|
|
62
63
|
var apply = "Применить";
|
|
@@ -122,6 +123,7 @@ var ru_default = {
|
|
|
122
123
|
breadcrumb,
|
|
123
124
|
confirm,
|
|
124
125
|
cancel,
|
|
126
|
+
ok,
|
|
125
127
|
stepComplete,
|
|
126
128
|
stepOnHold,
|
|
127
129
|
apply,
|
|
@@ -132,4 +134,4 @@ var ru_default = {
|
|
|
132
134
|
timePm: "PM"
|
|
133
135
|
};
|
|
134
136
|
//#endregion
|
|
135
|
-
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, 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 };
|
|
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 };
|
|
@@ -57,6 +57,7 @@ var closeTab = "ปิดแท็บ";
|
|
|
57
57
|
var breadcrumb = "เส้นทางการนำทาง";
|
|
58
58
|
var confirm = "ยืนยัน";
|
|
59
59
|
var cancel = "ยกเลิก";
|
|
60
|
+
var ok = "ตกลง";
|
|
60
61
|
var stepComplete = "เสร็จสิ้น";
|
|
61
62
|
var stepOnHold = "พักไว้";
|
|
62
63
|
var apply = "นำไปใช้";
|
|
@@ -124,6 +125,7 @@ var th_default = {
|
|
|
124
125
|
breadcrumb,
|
|
125
126
|
confirm,
|
|
126
127
|
cancel,
|
|
128
|
+
ok,
|
|
127
129
|
stepComplete,
|
|
128
130
|
stepOnHold,
|
|
129
131
|
apply,
|
|
@@ -134,4 +136,4 @@ var th_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, th_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, 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 };
|
|
@@ -57,6 +57,7 @@ var closeTab = "关闭标签页";
|
|
|
57
57
|
var breadcrumb = "面包屑导航";
|
|
58
58
|
var confirm = "确定";
|
|
59
59
|
var cancel = "取消";
|
|
60
|
+
var ok = "确定";
|
|
60
61
|
var stepComplete = "已完成";
|
|
61
62
|
var stepOnHold = "已暂停";
|
|
62
63
|
var apply = "应用";
|
|
@@ -124,6 +125,7 @@ var zh_CN_default = {
|
|
|
124
125
|
breadcrumb,
|
|
125
126
|
confirm,
|
|
126
127
|
cancel,
|
|
128
|
+
ok,
|
|
127
129
|
stepComplete,
|
|
128
130
|
stepOnHold,
|
|
129
131
|
apply,
|
|
@@ -134,4 +136,4 @@ var zh_CN_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, zh_CN_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, 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 };
|
|
@@ -57,6 +57,7 @@ var closeTab = "關閉分頁";
|
|
|
57
57
|
var breadcrumb = "麵包屑導覽";
|
|
58
58
|
var confirm = "確定";
|
|
59
59
|
var cancel = "取消";
|
|
60
|
+
var ok = "確定";
|
|
60
61
|
var stepComplete = "已完成";
|
|
61
62
|
var stepOnHold = "已暫停";
|
|
62
63
|
var apply = "套用";
|
|
@@ -124,6 +125,7 @@ var zh_TW_default = {
|
|
|
124
125
|
breadcrumb,
|
|
125
126
|
confirm,
|
|
126
127
|
cancel,
|
|
128
|
+
ok,
|
|
127
129
|
stepComplete,
|
|
128
130
|
stepOnHold,
|
|
129
131
|
apply,
|
|
@@ -134,4 +136,4 @@ var zh_TW_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, zh_TW_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, 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 };
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { LitElement, CSSResultGroup, RenderOptions } from 'lit';
|
|
2
2
|
export declare class UElement extends LitElement {
|
|
3
3
|
static styles: CSSResultGroup;
|
|
4
|
+
/** 연결된 동안의 로케일 구독 해제 함수 · 떨어질 때 본 로케일 판(다시 붙을 때 그 사이 바뀌었는가를 묻는다). */
|
|
5
|
+
private unsubscribeLocale?;
|
|
6
|
+
private detachedLocaleRevision?;
|
|
4
7
|
connectedCallback(): void;
|
|
8
|
+
disconnectedCallback(): void;
|
|
9
|
+
/**
|
|
10
|
+
* 로케일이 바뀌었다(`Locale.set` · `Locale.register`) — 기본은 다시 그린다. 렌더 밖에서 로케일 문장을 담아 둔
|
|
11
|
+
* 컴포넌트(속성·`ElementInternals`·필드에 적어 둔 이름)는 이것을 재정의해 그 값을 다시 적고 `super` 를 부른다.
|
|
12
|
+
* 종전에는 런타임에 언어를 바꿔도 이미 그려진 문장이 다음 재렌더까지 옛 언어로 남았다.
|
|
13
|
+
*/
|
|
14
|
+
protected localeChanged(): void;
|
|
5
15
|
/**
|
|
6
16
|
* 커스텀 이벤트를 생성하여 발행합니다.
|
|
7
17
|
* 기본적으로 bubbles, composed, cancelable이 활성화됩니다.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { styles } from "./UElement.styles.js";
|
|
2
|
+
import { Locale } from "../utilities/Locale.js";
|
|
2
3
|
import { LitElement, render } from "lit";
|
|
3
4
|
//#region src/components/UElement.ts
|
|
4
5
|
/**
|
|
@@ -32,6 +33,23 @@ var UElement = class extends LitElement {
|
|
|
32
33
|
connectedCallback() {
|
|
33
34
|
super.connectedCallback();
|
|
34
35
|
if (process.env.NODE_ENV !== "production") warnIfTokensMissing();
|
|
36
|
+
this.unsubscribeLocale = Locale.subscribe(() => this.localeChanged());
|
|
37
|
+
if (this.detachedLocaleRevision !== void 0 && this.detachedLocaleRevision !== Locale.revision) this.localeChanged();
|
|
38
|
+
this.detachedLocaleRevision = void 0;
|
|
39
|
+
}
|
|
40
|
+
disconnectedCallback() {
|
|
41
|
+
this.unsubscribeLocale?.();
|
|
42
|
+
this.unsubscribeLocale = void 0;
|
|
43
|
+
this.detachedLocaleRevision = Locale.revision;
|
|
44
|
+
super.disconnectedCallback();
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 로케일이 바뀌었다(`Locale.set` · `Locale.register`) — 기본은 다시 그린다. 렌더 밖에서 로케일 문장을 담아 둔
|
|
48
|
+
* 컴포넌트(속성·`ElementInternals`·필드에 적어 둔 이름)는 이것을 재정의해 그 값을 다시 적고 `super` 를 부른다.
|
|
49
|
+
* 종전에는 런타임에 언어를 바꿔도 이미 그려진 문장이 다음 재렌더까지 옛 언어로 남았다.
|
|
50
|
+
*/
|
|
51
|
+
localeChanged() {
|
|
52
|
+
this.requestUpdate();
|
|
35
53
|
}
|
|
36
54
|
/**
|
|
37
55
|
* 커스텀 이벤트를 생성하여 발행합니다.
|
|
@@ -75,6 +75,11 @@ export declare abstract class UFormControlElement<T> extends UElement {
|
|
|
75
75
|
/** form-associated 표준 콜백 — 조상 fieldset 의 비활성 상태가 바뀔 때 UA 가 부른다. */
|
|
76
76
|
formDisabledCallback(disabled: boolean): void;
|
|
77
77
|
connectedCallback(): void;
|
|
78
|
+
/**
|
|
79
|
+
* 검증 메시지는 `setValidity()` 가 `internals` 에 적어 둔 문장이다 — 다시 그리기만 하면 옛 언어가 그대로 나온다.
|
|
80
|
+
* 첫 렌더 뒤라면(검증이 참조하는 안쪽 컨트롤이 있을 때) 다시 계산하고 그린다.
|
|
81
|
+
*/
|
|
82
|
+
protected localeChanged(): void;
|
|
78
83
|
/**
|
|
79
84
|
* 호스트에 세팅된 `aria-label`/`aria-description` 은 접근성 트리에 노출되는 노드가 아니다 —
|
|
80
85
|
* 그것은 shadow DOM 안쪽의 네이티브 컨트롤이고, 섀도우 경계를 넘지 않으므로 자동으로
|
|
@@ -88,6 +88,14 @@ var UFormControlElement = class extends UElement {
|
|
|
88
88
|
if (!this.internals && "attachInternals" in this) this.internals = this.attachInternals();
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
|
+
* 검증 메시지는 `setValidity()` 가 `internals` 에 적어 둔 문장이다 — 다시 그리기만 하면 옛 언어가 그대로 나온다.
|
|
92
|
+
* 첫 렌더 뒤라면(검증이 참조하는 안쪽 컨트롤이 있을 때) 다시 계산하고 그린다.
|
|
93
|
+
*/
|
|
94
|
+
localeChanged() {
|
|
95
|
+
if (this.hasUpdated) this.setValidity();
|
|
96
|
+
super.localeChanged();
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
91
99
|
* 호스트에 세팅된 `aria-label`/`aria-description` 은 접근성 트리에 노출되는 노드가 아니다 —
|
|
92
100
|
* 그것은 shadow DOM 안쪽의 네이티브 컨트롤이고, 섀도우 경계를 넘지 않으므로 자동으로
|
|
93
101
|
* 반영되지 않는다(속성은 붙어 있는데 접근 가능한 이름이 빈 채로 남는다).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import { UElement } from "../UElement.js";
|
|
2
3
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
3
4
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import "../button/UButton.js";
|
|
6
6
|
import { devWarnOnce } from "../../utilities/devWarning.js";
|
|
7
7
|
import "../icon/UIcon.js";
|
|
@@ -17,6 +17,19 @@ var ALERT_STATUSES = [
|
|
|
17
17
|
"info",
|
|
18
18
|
"notice"
|
|
19
19
|
];
|
|
20
|
+
/**
|
|
21
|
+
* 다른 축의 낱말로 쓴 `status` → 이 축의 낱말. `status` 는 **결과 상태**(alert · progress · Toast 가 `error`)이고,
|
|
22
|
+
* 버튼·배지·태그의 `color` 는 **팔레트 역할**(`danger`)이다 — 두 축이 다른 낱말을 쓰는 것은 의도지만, 소비자가
|
|
23
|
+
* `color` 의 낱말을 그대로 옮겨 `status="danger"` 로 화면 셋을 내보낸 실측이 있어 경고가 맞는 낱말을 함께 말한다.
|
|
24
|
+
*/
|
|
25
|
+
var STATUS_SYNONYMS = {
|
|
26
|
+
danger: "error",
|
|
27
|
+
critical: "error",
|
|
28
|
+
negative: "error",
|
|
29
|
+
warn: "warning",
|
|
30
|
+
positive: "success",
|
|
31
|
+
information: "info"
|
|
32
|
+
};
|
|
20
33
|
var UAlert = class UAlert extends UElement {
|
|
21
34
|
constructor(..._args) {
|
|
22
35
|
super(..._args);
|
|
@@ -125,7 +138,8 @@ var UAlert = class UAlert extends UElement {
|
|
|
125
138
|
warnUnknownStatus() {
|
|
126
139
|
const status = this.status;
|
|
127
140
|
if (!status || ALERT_STATUSES.includes(status)) return;
|
|
128
|
-
|
|
141
|
+
const suggestion = STATUS_SYNONYMS[status.toLowerCase()];
|
|
142
|
+
devWarnOnce(`u-alert:status:${status}`, `<u-alert status="${status}"> is not a known status, so it renders as a neutral notice. ` + (suggestion ? `Did you mean status="${suggestion}"? ` : "") + `Use one of: ${ALERT_STATUSES.join(", ")}.`);
|
|
129
143
|
}
|
|
130
144
|
/** Alert 상태에 따른 아이콘 이름을 반환합니다. */
|
|
131
145
|
mapIcon(status) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import { UElement } from "../UElement.js";
|
|
2
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
3
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
4
4
|
import "../icon/UIcon.js";
|
|
5
5
|
import { styles } from "./UBreadcrumb.styles.js";
|
|
6
6
|
import { html } from "lit";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import { UElement } from "../UElement.js";
|
|
2
3
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
3
4
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import "../icon-button/UIconButton.js";
|
|
6
6
|
import { formatDate } from "../../utilities/format.js";
|
|
7
7
|
import { addDays, addMonths, daysInMonth, isDayUnavailable, isSameDay, monthDiff, parseISODate, startOfMonth, toISODate } from "./dates.js";
|
|
@@ -80,6 +80,8 @@ export declare class UCarousel extends UElement {
|
|
|
80
80
|
private startAutoplay;
|
|
81
81
|
private stopAutoplay;
|
|
82
82
|
private handleSlotChange;
|
|
83
|
+
/** 렌더 밖에서 적어 둔 로케일 문장(호스트 역할 설명 · 슬라이드 이름)을 새 로케일로 다시 적는다. */
|
|
84
|
+
protected localeChanged(): void;
|
|
83
85
|
/** 슬라이드를 «n / 전체» 이름의 그룹으로 — 처음 볼 때 비어 있던 속성만 우리 것으로 삼고, 그것만 갱신한다. */
|
|
84
86
|
private labelSlide;
|
|
85
87
|
/** 슬롯을 떠난 슬라이드에서 우리가 단 속성을 걷는다. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import { UElement } from "../UElement.js";
|
|
2
3
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
3
4
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import "../button/UButton.js";
|
|
6
6
|
import "../icon/UIcon.js";
|
|
7
7
|
import { styles } from "./UCarousel.styles.js";
|
|
@@ -243,6 +243,12 @@ var UCarousel = class UCarousel extends UElement {
|
|
|
243
243
|
this.slideCount = next.length;
|
|
244
244
|
if (this.index >= this.slideCount) this.index = Math.max(0, this.slideCount - 1);
|
|
245
245
|
}
|
|
246
|
+
/** 렌더 밖에서 적어 둔 로케일 문장(호스트 역할 설명 · 슬라이드 이름)을 새 로케일로 다시 적는다. */
|
|
247
|
+
localeChanged() {
|
|
248
|
+
if (this.internals) this.internals.ariaRoleDescription = Locale.getValue("carousel");
|
|
249
|
+
this.slides.forEach((slide, i) => this.labelSlide(slide, i, this.slides.length));
|
|
250
|
+
super.localeChanged();
|
|
251
|
+
}
|
|
246
252
|
/** 슬라이드를 «n / 전체» 이름의 그룹으로 — 처음 볼 때 비어 있던 속성만 우리 것으로 삼고, 그것만 갱신한다. */
|
|
247
253
|
labelSlide(slide, i, total) {
|
|
248
254
|
let owned = this.ownedSlideAttrs.get(slide);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
2
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
3
4
|
import { UFormControlElement } from "../UFormControlElement.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import "../icon/UIcon.js";
|
|
6
6
|
import { styles } from "./UCheckbox.styles.js";
|
|
7
7
|
import { html } from "lit";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import { UElement } from "../UElement.js";
|
|
2
3
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
3
4
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import "../button/UButton.js";
|
|
6
6
|
import "../icon/UIcon.js";
|
|
7
7
|
import "../tooltip/UTooltip.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import { UElement } from "../UElement.js";
|
|
2
3
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
3
4
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import "../button/UButton.js";
|
|
6
6
|
import "../icon/UIcon.js";
|
|
7
7
|
import "../icon-button/UIconButton.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
2
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
3
4
|
import { UFormControlElement } from "../UFormControlElement.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import "../button/UButton.js";
|
|
6
6
|
import "../icon/UIcon.js";
|
|
7
7
|
import { dateTextPattern, formatDateText, formatDateTimeText, parseDate, parseDateTime } from "../../utilities/format.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
2
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
3
4
|
import { UFormControlElement } from "../UFormControlElement.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import "../button/UButton.js";
|
|
6
6
|
import { devWarnOnce } from "../../utilities/devWarning.js";
|
|
7
7
|
import "../icon/UIcon.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
2
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
3
4
|
import { UOverlayElement } from "../UOverlayElement.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import "../button/UButton.js";
|
|
6
6
|
import "../icon/UIcon.js";
|
|
7
7
|
import { styles } from "./UDialog.styles.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
2
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
3
4
|
import { UOverlayElement } from "../UOverlayElement.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import "../button/UButton.js";
|
|
6
6
|
import "../icon/UIcon.js";
|
|
7
7
|
import { styles } from "./UDrawer.styles.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
2
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
3
4
|
import { UFormControlElement } from "../UFormControlElement.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import "../icon/UIcon.js";
|
|
6
6
|
import "../field/UField.js";
|
|
7
7
|
import { styles } from "./UFileInput.styles.js";
|
|
@@ -90,6 +90,12 @@ export declare class UInput extends UFormControlElement<string> {
|
|
|
90
90
|
*/
|
|
91
91
|
size: FieldSize;
|
|
92
92
|
/** placeholder 텍스트 */
|
|
93
|
+
/**
|
|
94
|
+
* 칸이 담을 글자 수 — 지정하면 폭을 정하지 않은 칸(기본 `inline-block`)이 «N자 + 접미 아이콘 + 패딩» 폭으로 그려지고,
|
|
95
|
+
* 그보다 좁게 주면 넘친다(글자 영역 하한이 N자가 된다). 네이티브 `<input size>`·CSS `field-sizing` 과 같은 축이다 —
|
|
96
|
+
* `size` 는 이 컴포넌트에서 크기 단(sm·md·lg)이라 이름이 다르다. 폭을 준 칸(`width`·`block`)에서는 하한으로만 쓴다.
|
|
97
|
+
*/
|
|
98
|
+
chars?: number;
|
|
93
99
|
placeholder?: string;
|
|
94
100
|
/** 유효성 검사 패턴 (정규식) */
|
|
95
101
|
pattern?: string;
|
|
@@ -115,6 +121,10 @@ export declare class UInput extends UFormControlElement<string> {
|
|
|
115
121
|
* `string`이라 `valueAsString` 같은 변환 없이 그대로 넘긴다. */
|
|
116
122
|
protected willUpdate(changedProperties: PropertyValues): void;
|
|
117
123
|
protected updated(changedProperties: PropertyValues): void;
|
|
124
|
+
/** `chars` 를 CSS 길이로 — 양의 정수일 때만(그 밖은 지정 없음과 같다). */
|
|
125
|
+
private get charsWidth();
|
|
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
|
+
protected localeChanged(): void;
|
|
118
128
|
/** Canonical `value` → the text shown: the locale's decimal separator, no grouping inserted. */
|
|
119
129
|
private displayNumber;
|
|
120
130
|
/** Writes what the user typed into `value` (canonical, or `""` when it is not a number). */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
2
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
3
4
|
import { UFormControlElement } from "../UFormControlElement.js";
|
|
4
5
|
import { isImeComposing } from "../../utilities/keyboard.js";
|
|
5
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
6
6
|
import "../spinner/USpinner.js";
|
|
7
7
|
import "../icon/UIcon.js";
|
|
8
8
|
import { parseNumber } from "../../utilities/format.js";
|
|
@@ -194,11 +194,12 @@ var UInput = class UInput extends UFormControlElement {
|
|
|
194
194
|
.validationMessage=${this.validationMessage}
|
|
195
195
|
>
|
|
196
196
|
<div class="container" part="container"
|
|
197
|
-
style=${`--_icons: ${(showStepper ? 2 : 0) + (showClear ? 1 : 0) + (showToggle ? 1 : 0)}`}>
|
|
197
|
+
style=${`--_icons: ${(showStepper ? 2 : 0) + (showClear ? 1 : 0) + (showToggle ? 1 : 0)}${this.charsWidth ? `; --input-min-text: ${this.charsWidth}` : ""}`}>
|
|
198
198
|
|
|
199
199
|
<slot name="prefix"></slot>
|
|
200
200
|
|
|
201
201
|
<input part="input"
|
|
202
|
+
style=${ifDefined(this.charsWidth ? `inline-size: ${this.charsWidth}` : void 0)}
|
|
202
203
|
type=${isNumber || this.type === "password" && this.showPassword ? "text" : this.type}
|
|
203
204
|
aria-label=${ifDefined(this.resolvedAriaLabel)}
|
|
204
205
|
aria-description=${ifDefined(this.resolvedAriaDescription)}
|
|
@@ -305,6 +306,16 @@ var UInput = class UInput extends UFormControlElement {
|
|
|
305
306
|
super.updated(changedProperties);
|
|
306
307
|
if (changedProperties.has("value")) this.internals?.setFormValue(this.value ?? "");
|
|
307
308
|
}
|
|
309
|
+
/** `chars` 를 CSS 길이로 — 양의 정수일 때만(그 밖은 지정 없음과 같다). */
|
|
310
|
+
get charsWidth() {
|
|
311
|
+
const n = this.chars;
|
|
312
|
+
return n != null && Number.isFinite(n) && n > 0 ? `${Math.ceil(n)}ch` : void 0;
|
|
313
|
+
}
|
|
314
|
+
/** The shown number uses the locale's decimal separator — re-show it in the new locale (unless the user is typing in it). */
|
|
315
|
+
localeChanged() {
|
|
316
|
+
if (this.type === "number" && this.shadowRoot?.activeElement !== this.inputEl) this.numberText = this.displayNumber(this.value ?? "");
|
|
317
|
+
super.localeChanged();
|
|
318
|
+
}
|
|
308
319
|
/** Canonical `value` → the text shown: the locale's decimal separator, no grouping inserted. */
|
|
309
320
|
displayNumber(value) {
|
|
310
321
|
if ((value ? parseNumber(value, "en") : null) === null) return value;
|
|
@@ -510,6 +521,10 @@ __decorate([property({
|
|
|
510
521
|
type: String,
|
|
511
522
|
reflect: true
|
|
512
523
|
}), __decorateMetadata("design:type", Object)], UInput.prototype, "size", void 0);
|
|
524
|
+
__decorate([property({
|
|
525
|
+
type: Number,
|
|
526
|
+
reflect: true
|
|
527
|
+
}), __decorateMetadata("design:type", Number)], UInput.prototype, "chars", void 0);
|
|
513
528
|
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UInput.prototype, "placeholder", void 0);
|
|
514
529
|
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UInput.prototype, "pattern", void 0);
|
|
515
530
|
__decorate([query(".container", true), __decorateMetadata("design:type", typeof HTMLDivElement === "undefined" ? Object : HTMLDivElement)], UInput.prototype, "containerEl", void 0);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
2
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
3
4
|
import { UFormControlElement } from "../UFormControlElement.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import "../field/UField.js";
|
|
6
6
|
import { UOption } from "../option/UOption.js";
|
|
7
7
|
import { styles } from "./URadio.styles.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
2
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
3
4
|
import { UFormControlElement } from "../UFormControlElement.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import "../icon/UIcon.js";
|
|
6
6
|
import "../field/UField.js";
|
|
7
7
|
import { styles } from "./URating.styles.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
2
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
3
4
|
import { UFormControlElement } from "../UFormControlElement.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import "../spinner/USpinner.js";
|
|
6
6
|
import "../icon/UIcon.js";
|
|
7
7
|
import "../field/UField.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
2
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
3
4
|
import { UFormControlElement } from "../UFormControlElement.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import "../tooltip/UTooltip.js";
|
|
6
6
|
import "../field/UField.js";
|
|
7
7
|
import { styles } from "./USlider.styles.js";
|
|
@@ -25,7 +25,11 @@ export declare class USpinner extends UElement {
|
|
|
25
25
|
*/
|
|
26
26
|
private readonly internals;
|
|
27
27
|
connectedCallback(): void;
|
|
28
|
+
/** 이름으로 쓰는 보이는 글자(없으면 로케일의 «로딩 중»). */
|
|
29
|
+
private slotText;
|
|
28
30
|
private nameFrom;
|
|
31
|
+
/** 글자가 없을 때의 기본 이름은 로케일 문장이다 — 새 로케일로 다시 적는다. */
|
|
32
|
+
protected localeChanged(): void;
|
|
29
33
|
render(): import('lit-html').TemplateResult<1>;
|
|
30
34
|
private handleSlotChange;
|
|
31
35
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import { UElement } from "../UElement.js";
|
|
2
3
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
3
4
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
4
5
|
import { styles } from "./USpinner.styles.js";
|
|
5
6
|
import { attachProgressbar } from "../../utilities/progressAria.js";
|
|
6
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
7
7
|
import { html } from "lit";
|
|
8
8
|
import { customElement, property, state } from "lit/decorators.js";
|
|
9
9
|
//#region src/components/spinner/USpinner.ts
|
|
@@ -12,6 +12,7 @@ var USpinner = class USpinner extends UElement {
|
|
|
12
12
|
super(..._args);
|
|
13
13
|
this.hasLabel = false;
|
|
14
14
|
this.internals = attachProgressbar(this);
|
|
15
|
+
this.slotText = "";
|
|
15
16
|
}
|
|
16
17
|
static {
|
|
17
18
|
this.styles = [super.styles, styles];
|
|
@@ -21,8 +22,14 @@ var USpinner = class USpinner extends UElement {
|
|
|
21
22
|
this.nameFrom("");
|
|
22
23
|
}
|
|
23
24
|
nameFrom(text) {
|
|
25
|
+
this.slotText = text;
|
|
24
26
|
if (this.internals) this.internals.ariaLabel = text || Locale.getValue("loading");
|
|
25
27
|
}
|
|
28
|
+
/** 글자가 없을 때의 기본 이름은 로케일 문장이다 — 새 로케일로 다시 적는다. */
|
|
29
|
+
localeChanged() {
|
|
30
|
+
this.nameFrom(this.slotText);
|
|
31
|
+
super.localeChanged();
|
|
32
|
+
}
|
|
26
33
|
render() {
|
|
27
34
|
return html`
|
|
28
35
|
<svg class="spinner" part="svg">
|
|
@@ -68,6 +68,8 @@ export declare class USplitPanel extends UElement {
|
|
|
68
68
|
* 값은 **앞 패널(primary pane)의 몫**이다. 패널이 셋 이상이면 한 핸들은 이웃한 두 패널 사이만
|
|
69
69
|
* 옮기므로 최대값은 100 이 아니라 그 두 패널의 몫의 합이다.
|
|
70
70
|
*/
|
|
71
|
+
/** 핸들 이름(«패널 크기 조절»)은 템플릿 밖에 적어 둔 로케일 문장이다 — 새 로케일로 다시 적는다. */
|
|
72
|
+
protected localeChanged(): void;
|
|
71
73
|
private syncSplitterAria;
|
|
72
74
|
/** 방향키 한 번이 옮기는 앞 패널의 몫(나머지 공간 기준 %). */
|
|
73
75
|
private static readonly KEY_STEP;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import { UElement } from "../UElement.js";
|
|
2
3
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
3
4
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
4
5
|
import { arrayAttrConverter } from "../../utilities/converters.js";
|
|
5
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
6
6
|
import { devWarnOnce } from "../../utilities/devWarning.js";
|
|
7
7
|
import { styles } from "./USplitPanel.styles.js";
|
|
8
8
|
import { html } from "lit";
|
|
@@ -287,6 +287,11 @@ var USplitPanel = class USplitPanel extends UElement {
|
|
|
287
287
|
* 값은 **앞 패널(primary pane)의 몫**이다. 패널이 셋 이상이면 한 핸들은 이웃한 두 패널 사이만
|
|
288
288
|
* 옮기므로 최대값은 100 이 아니라 그 두 패널의 몫의 합이다.
|
|
289
289
|
*/
|
|
290
|
+
/** 핸들 이름(«패널 크기 조절»)은 템플릿 밖에 적어 둔 로케일 문장이다 — 새 로케일로 다시 적는다. */
|
|
291
|
+
localeChanged() {
|
|
292
|
+
this.syncSplitterAria();
|
|
293
|
+
super.localeChanged();
|
|
294
|
+
}
|
|
290
295
|
syncSplitterAria() {
|
|
291
296
|
const root = this.renderRoot;
|
|
292
297
|
if (!root) return;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import { UElement } from "../UElement.js";
|
|
2
3
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
3
4
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import { styles } from "./USteps.styles.js";
|
|
6
6
|
import { html, nothing } from "lit";
|
|
7
7
|
import { customElement, property } from "lit/decorators.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
2
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
3
4
|
import { UFormControlElement } from "../UFormControlElement.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import { styles } from "./USwitch.styles.js";
|
|
6
6
|
import { html } from "lit";
|
|
7
7
|
import { customElement, property, query } from "lit/decorators.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import { UElement } from "../UElement.js";
|
|
2
3
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
3
4
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import "../button/UButton.js";
|
|
6
6
|
import "../icon/UIcon.js";
|
|
7
7
|
import { styles } from "./UTab.styles.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Locale } from "../../utilities/Locale.js";
|
|
1
2
|
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorateMetadata.js";
|
|
2
3
|
import __decorate from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/decorate.js";
|
|
3
4
|
import { UFormControlElement } from "../UFormControlElement.js";
|
|
4
|
-
import { Locale } from "../../utilities/Locale.js";
|
|
5
5
|
import "../field/UField.js";
|
|
6
6
|
import { styles } from "./UTextarea.styles.js";
|
|
7
7
|
import { html } from "lit";
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Locale } from "./utilities/Locale.js";
|
|
1
2
|
import { UElement } from "./components/UElement.js";
|
|
2
3
|
import { getParentElement, isCoarsePointer, isFocusCandidate, querySelectorAllWithin, querySelectorDeep, querySelectorWithin } from "./utilities/elements.js";
|
|
3
4
|
import { UFloatingElement } from "./components/UFloatingElement.js";
|
|
@@ -6,7 +7,6 @@ import { isImeComposing } from "./utilities/keyboard.js";
|
|
|
6
7
|
import { OverlayManager } from "./utilities/OverlayManager.js";
|
|
7
8
|
import { arrayAttrConverter, booleanAttrConverter, dateAttrConverter, jsonAttrConverter, urlAttrConverter } from "./utilities/converters.js";
|
|
8
9
|
import { UOverlayElement } from "./components/UOverlayElement.js";
|
|
9
|
-
import { Locale } from "./utilities/Locale.js";
|
|
10
10
|
import { USpinner } from "./components/spinner/USpinner.js";
|
|
11
11
|
import { UButton } from "./components/button/UButton.js";
|
|
12
12
|
import { IconCache, IconRegistry, getDefaultBaseUrl, setDefaultBaseUrl } from "./utilities/icons.js";
|
|
@@ -21,6 +21,10 @@ export interface DialogOptions {
|
|
|
21
21
|
backdropClose?: boolean;
|
|
22
22
|
}
|
|
23
23
|
/** Confirm Dialog 옵션 */
|
|
24
|
+
export interface AlertDialogOptions extends DialogOptions {
|
|
25
|
+
/** 닫는 버튼의 글자 (기본값: 로케일의 «확인»/`OK`) */
|
|
26
|
+
confirmLabel?: string;
|
|
27
|
+
}
|
|
24
28
|
export interface ConfirmDialogOptions extends DialogOptions {
|
|
25
29
|
/** 확인 버튼 텍스트 (기본: 현재 로케일의 `confirm` — 영어는 'Confirm') */
|
|
26
30
|
confirmLabel?: string;
|
|
@@ -71,7 +75,7 @@ export declare class Dialog {
|
|
|
71
75
|
* @param message 본문 — **문자열은 글자로** 그린다(사용자 입력을 넣어도 마크업이 되지 않는다). 서식이 필요하면
|
|
72
76
|
* `TemplateResult`(`html\`…\``)를 넘긴다. HTML 문자열은 그것을 명시한 `show({ content })` 로만.
|
|
73
77
|
*/
|
|
74
|
-
static alert(message: string | TemplateResult, options?:
|
|
78
|
+
static alert(message: string | TemplateResult, options?: AlertDialogOptions): Promise<void>;
|
|
75
79
|
/**
|
|
76
80
|
* 확인 다이얼로그를 표시합니다. (확인/취소 버튼)
|
|
77
81
|
* @param message 본문 — **문자열은 글자로** 그린다(`alert` 와 같다). 서식은 `TemplateResult` 로.
|
package/dist/utilities/Dialog.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isImeComposing } from "./keyboard.js";
|
|
2
1
|
import { Locale } from "./Locale.js";
|
|
2
|
+
import { isImeComposing } from "./keyboard.js";
|
|
3
3
|
import "../components/button/UButton.js";
|
|
4
4
|
import { UDialog } from "../components/dialog/UDialog.js";
|
|
5
5
|
import "../components/input/UInput.js";
|
|
@@ -44,7 +44,11 @@ var Dialog = class {
|
|
|
44
44
|
const messageId = nextMessageId();
|
|
45
45
|
await this.present({
|
|
46
46
|
...options,
|
|
47
|
-
content: asText(message, messageId)
|
|
47
|
+
content: asText(message, messageId),
|
|
48
|
+
actions: [{
|
|
49
|
+
label: options?.confirmLabel || Locale.getValue("ok"),
|
|
50
|
+
value: "ok"
|
|
51
|
+
}]
|
|
48
52
|
}, (dialog) => describe(dialog, messageId, "alertdialog"));
|
|
49
53
|
}
|
|
50
54
|
/**
|
|
@@ -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' | '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' | '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
|
* 한 패키지(또는 앱 영역)의 문자열 묶음.
|
|
@@ -53,6 +53,17 @@ export declare class Locale {
|
|
|
53
53
|
private constructor();
|
|
54
54
|
/** 전역 활성 로케일을 지정합니다. */
|
|
55
55
|
static set(locale: LocaleTag): void;
|
|
56
|
+
/**
|
|
57
|
+
* 로케일이 바뀔 때(활성 로케일 전환 · 표 등록) 부를 함수를 등록하고, **구독을 푸는 함수**를 돌려줍니다.
|
|
58
|
+
* `UElement` 계열은 연결된 동안 스스로 구독해 다시 그리므로, 이것은 그 밖의 코드 — 직접 만든 요소, 앱 상태 —
|
|
59
|
+
* 를 위한 것입니다. React 에서는 `useSyncExternalStore(Locale.subscribe, () => Locale.revision)`.
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* 로케일이 바뀔 때마다(구독자에게 알릴 때마다) 하나씩 느는 수 — «내가 마지막으로 본 뒤 바뀌었는가» 를 묻는 값.
|
|
63
|
+
* `get()` 은 표 등록으로 문장이 바뀌어도 그대로이므로, 스냅샷·캐시 키로는 이것을 쓴다.
|
|
64
|
+
*/
|
|
65
|
+
static get revision(): number;
|
|
66
|
+
static subscribe(listener: () => void): () => void;
|
|
56
67
|
/** 전역 활성 로케일을 반환합니다 (초기값은 `<html lang>` → 브라우저 언어 자동 감지, 실패 시 'en'). */
|
|
57
68
|
static get(): LocaleTag;
|
|
58
69
|
/**
|
package/dist/utilities/Locale.js
CHANGED
|
@@ -50,6 +50,16 @@ function detectLocale() {
|
|
|
50
50
|
}
|
|
51
51
|
var active = detectLocale();
|
|
52
52
|
/**
|
|
53
|
+
* 로케일이 바뀌었음을 들을 곳 — 활성 로케일 전환(`set`)과 표 등록(`register`, 네임스페이스 포함).
|
|
54
|
+
* 이것이 없으면 이미 그려진 문장은 다음 재렌더까지 옛 언어로 남았다(런타임 언어 전환의 절반이 비었다).
|
|
55
|
+
*/
|
|
56
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
57
|
+
var revision = 0;
|
|
58
|
+
function notify() {
|
|
59
|
+
revision++;
|
|
60
|
+
for (const listener of [...listeners]) listener();
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
53
63
|
* 내장 표가 **지역형으로만** 있는 언어의 기본 지역형 — 키는 태그의 접두(소문자).
|
|
54
64
|
*
|
|
55
65
|
* ⚠`lang="zh"`·`"pt"` 처럼 지역 없는 태그는 흔하고 정당하다(BCP 47). 사슬이 접두를 줄여 가기만
|
|
@@ -103,7 +113,27 @@ var Locale = class {
|
|
|
103
113
|
constructor() {}
|
|
104
114
|
/** 전역 활성 로케일을 지정합니다. */
|
|
105
115
|
static set(locale) {
|
|
116
|
+
if (locale === active) return;
|
|
106
117
|
active = locale;
|
|
118
|
+
notify();
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* 로케일이 바뀔 때(활성 로케일 전환 · 표 등록) 부를 함수를 등록하고, **구독을 푸는 함수**를 돌려줍니다.
|
|
122
|
+
* `UElement` 계열은 연결된 동안 스스로 구독해 다시 그리므로, 이것은 그 밖의 코드 — 직접 만든 요소, 앱 상태 —
|
|
123
|
+
* 를 위한 것입니다. React 에서는 `useSyncExternalStore(Locale.subscribe, () => Locale.revision)`.
|
|
124
|
+
*/
|
|
125
|
+
/**
|
|
126
|
+
* 로케일이 바뀔 때마다(구독자에게 알릴 때마다) 하나씩 느는 수 — «내가 마지막으로 본 뒤 바뀌었는가» 를 묻는 값.
|
|
127
|
+
* `get()` 은 표 등록으로 문장이 바뀌어도 그대로이므로, 스냅샷·캐시 키로는 이것을 쓴다.
|
|
128
|
+
*/
|
|
129
|
+
static get revision() {
|
|
130
|
+
return revision;
|
|
131
|
+
}
|
|
132
|
+
static subscribe(listener) {
|
|
133
|
+
listeners.add(listener);
|
|
134
|
+
return () => {
|
|
135
|
+
listeners.delete(listener);
|
|
136
|
+
};
|
|
107
137
|
}
|
|
108
138
|
/** 전역 활성 로케일을 반환합니다 (초기값은 `<html lang>` → 브라우저 언어 자동 감지, 실패 시 'en'). */
|
|
109
139
|
static get() {
|
|
@@ -120,6 +150,7 @@ var Locale = class {
|
|
|
120
150
|
...current,
|
|
121
151
|
...table
|
|
122
152
|
});
|
|
153
|
+
notify();
|
|
123
154
|
}
|
|
124
155
|
/**
|
|
125
156
|
* 현재 활성 로케일 기준으로 메시지를 조회합니다.
|
|
@@ -155,6 +186,7 @@ var Locale = class {
|
|
|
155
186
|
...table
|
|
156
187
|
});
|
|
157
188
|
namespaces.set(name, byLocale);
|
|
189
|
+
notify();
|
|
158
190
|
},
|
|
159
191
|
text: (key, params) => textIn(void 0, key, params),
|
|
160
192
|
textIn
|
package/package.json
CHANGED
|
@@ -35,7 +35,7 @@ Closable message banner with status icons, auto-dismiss timer, and open/hide tra
|
|
|
35
35
|
| `open` | `boolean` | `false` | ✓ | Show/hide the alert |
|
|
36
36
|
| `closable` | `boolean` | `false` | ✓ | Show close button |
|
|
37
37
|
| `appearance` | `'soft'\|'outlined'` | `'soft'` | ✓ | `soft` status-colour tint, no outline · `outlined` status-colour border on a transparent face |
|
|
38
|
-
| `status` | `'error'\|'warning'\|'success'\|'info'\|'notice'` | — | ✓ | Status type; controls icon and color |
|
|
38
|
+
| `status` | `'error'\|'warning'\|'success'\|'info'\|'notice'` | — | ✓ | Status type; controls icon, color and role (`error`/`warning` are `role="alert"`). An outcome word, not a palette word — buttons and badges say `color="danger"`, an alert says `status="error"`; an unknown value renders as a neutral notice and warns in development, naming the likely word |
|
|
39
39
|
| `title` | `string` | `''` | — | Title label. Left empty, the status name in the current locale is shown (`Locale.set('ko')` → 「오류」), not the raw status value |
|
|
40
40
|
| `duration` | `number` | `0` | — | Auto-dismiss delay in ms; `0` disables |
|
|
41
41
|
|
|
@@ -57,6 +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
61
|
| `placeholder` | `string` | — | — | Placeholder text |
|
|
61
62
|
| `clearable` | `boolean` | `false` | ✓ | Show clear button |
|
|
62
63
|
| `minlength` | `number` | — | — | Minimum character count |
|
|
@@ -40,7 +40,7 @@ const result = await Dialog.show({
|
|
|
40
40
|
|
|
41
41
|
| Method | Returns | Description |
|
|
42
42
|
|--------|---------|-------------|
|
|
43
|
-
| `Dialog.alert(message, options?)` | `Promise<void>` | Informational alert |
|
|
43
|
+
| `Dialog.alert(message, options?)` | `Promise<void>` | Informational alert with one OK button (focused on open) |
|
|
44
44
|
| `Dialog.confirm(message, options?)` | `Promise<boolean>` | Confirm / Cancel dialog |
|
|
45
45
|
| `Dialog.prompt(message, options?)` | `Promise<string \| null>` | Text input dialog |
|
|
46
46
|
| `Dialog.show(options)` | `Promise<string \| null>` | Custom dialog; resolves with clicked action `value` |
|
|
@@ -70,6 +70,10 @@ interface DialogOptions {
|
|
|
70
70
|
backdropClose?: boolean; // close on backdrop click — default: true
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
interface AlertDialogOptions extends DialogOptions {
|
|
74
|
+
confirmLabel?: string; // the OK button — default: the active locale's `ok` (en: 'OK', ko: '확인')
|
|
75
|
+
}
|
|
76
|
+
|
|
73
77
|
interface ConfirmDialogOptions extends DialogOptions {
|
|
74
78
|
confirmLabel?: string; // default: the active locale's `confirm` (en: 'Confirm')
|
|
75
79
|
cancelLabel?: string; // default: the active locale's `cancel` (en: 'Cancel')
|
|
@@ -40,6 +40,21 @@ same chain.
|
|
|
40
40
|
| `Locale.register(locale, table)` | Register/override locale messages (partial merge supported) |
|
|
41
41
|
| `Locale.getValue(key, params?, locale?)` | Resolve a localized message for the current locale (or `locale`, along its fallback chain) |
|
|
42
42
|
| `Locale.namespace(name)` | A string table for a package or app area, keyed by its own union — returns a handle (below) |
|
|
43
|
+
| `Locale.subscribe(listener)` | Call `listener` whenever the locale changes (`set` to another locale, any `register`) — returns the unsubscribe function |
|
|
44
|
+
| `Locale.revision` | A number that grows on every change — a snapshot or cache key (`get()` stays the same when only a table changes) |
|
|
45
|
+
|
|
46
|
+
### Switching at runtime
|
|
47
|
+
|
|
48
|
+
`Locale.set()` and `Locale.register()` take effect on screen at once: every connected component
|
|
49
|
+
re-renders, including text it keeps outside its template — validation messages, accessible names,
|
|
50
|
+
the decimal separator of a number field. An element detached during the change catches up when it
|
|
51
|
+
is attached again. Your own code subscribes the same way:
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
const off = Locale.subscribe(() => renderMyView());
|
|
55
|
+
// React
|
|
56
|
+
const revision = useSyncExternalStore(Locale.subscribe, () => Locale.revision);
|
|
57
|
+
```
|
|
43
58
|
|
|
44
59
|
### Namespaces
|
|
45
60
|
|