@1337exp/taoui 3.3.1 → 4.0.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 +32 -0
- package/README.md +12 -6
- package/README.ru.md +12 -6
- package/dist/index.cjs +267 -217
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +55 -9
- package/dist/index.mjs +268 -218
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.0.0
|
|
4
|
+
|
|
5
|
+
### Breaking: English is the default language
|
|
6
|
+
|
|
7
|
+
- **Built-in texts are English by default** (they were Russian): placeholders, “Clear”, aria labels, `toast` / `confirm()` defaults, calendar captions. The date helpers (`formatTaoDateLabel` and friends) default to `en-US` instead of `ru-RU`, and `TaoDate` / `TaoDateRange` follow the active locale as before.
|
|
8
|
+
- **To stay on Russian**, pass the locale once: `app.use(TaoUI, { locale: localeRu })`, or `setTaoLocale(localeRu)` without the plugin. `localeRu` and `localeEn` are both still exported, nothing else changed in the locale API.
|
|
9
|
+
- `setTaoLocale(overrides)` now merges on top of English (it merged on top of Russian). Pass `setTaoLocale(overrides, localeRu)` to keep the old base.
|
|
10
|
+
|
|
11
|
+
### Minimum width
|
|
12
|
+
|
|
13
|
+
- **`TaoButton` `minWidth`** (number = px, or any CSS length) and the **`--tao-button-min-width`** variable; default `0`, so nothing changes until you set it. Set the variable on one button, on a container or on `:root`.
|
|
14
|
+
- **`TaoSegmented` `minWidth`** and **`--tao-segmented-option-min-width`**: the minimum width of every option, including in `block` mode.
|
|
15
|
+
|
|
16
|
+
## 3.4.1
|
|
17
|
+
|
|
18
|
+
- **Fix:** `TaoScrollTop` `variant="text"` could not be shown without a caption: `label=""` now hides it, leaving just the arrow button (the accessible name stays).
|
|
19
|
+
|
|
20
|
+
## 3.4.0
|
|
21
|
+
|
|
22
|
+
### TaoScrollTop
|
|
23
|
+
|
|
24
|
+
- **`variant`:** `solid` (default, as before), `ghost` (a light circle on a raised surface with a hairline border) and `text` (a bare uppercase caption with an arrow, always visible).
|
|
25
|
+
- **`label`:** a caption that appears beside the button on mouse hover (`@media (hover: hover) and (pointer: fine)`, so never on touch) and on keyboard focus. For `text` it is always shown and defaults to the locale text.
|
|
26
|
+
- **`side`** (`left` / `right`) picks the page edge, **`offset`** is the distance from it (`right` stays as its older name). **`labelSide`** puts the caption left or right of the button; by default it is the side opposite to `side`, so it opens towards the page, and an explicit value wins.
|
|
27
|
+
- **Fix:** the button had no accessible name unless `ariaLabel` was passed; it now falls back to `label`, then to the locale text.
|
|
28
|
+
- **Fix:** `size`, `bottom` and `zIndex` react to prop changes (they were read once at setup).
|
|
29
|
+
- The root is now a positioning wrapper around the button: fall-through attributes (`class`, `data-*`, …) still land on the button, but a `style` that moves the button should go to `bottom` / `offset` props instead.
|
|
30
|
+
|
|
31
|
+
## 3.3.2
|
|
32
|
+
|
|
33
|
+
- **Fix:** the focus trap of Modal, Drawer and `confirm()` no longer lets focus escape in Safari on macOS, where Tab skips buttons and links by default. After a Tab the trap checks that focus is still inside the dialog and pulls it back if not.
|
|
34
|
+
|
|
3
35
|
## 3.3.0
|
|
4
36
|
|
|
5
37
|
### Presentation
|
package/README.md
CHANGED
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
- **TaoLink** — `<NuxtLink>` in Nuxt, `<RouterLink>` with vue-router, otherwise a plain `<a>` — no extra setup
|
|
118
118
|
- **TaoBreadcrumb** — crumbs: the last item is the current page
|
|
119
119
|
- **TaoDropdownMenu** — dropdown that flips at the viewport edge
|
|
120
|
-
- **TaoScrollTop** — floating “back to top
|
|
120
|
+
- **TaoScrollTop** — floating “back to top”: `solid` / `ghost` / `text` looks, `side`, a mouse-hover `label`. Appears on reverse scroll after `boundary`
|
|
121
121
|
|
|
122
122
|
### Feedback
|
|
123
123
|
|
|
@@ -222,12 +222,12 @@ app.mount('#app')
|
|
|
222
222
|
|
|
223
223
|
### Language
|
|
224
224
|
|
|
225
|
-
Built-in texts (placeholders, “Clear”, aria labels, dates) are
|
|
225
|
+
Built-in texts (placeholders, “Clear”, aria labels, dates) are English by default. Russian ships with the library:
|
|
226
226
|
|
|
227
227
|
```javascript
|
|
228
|
-
import TaoUI, {
|
|
228
|
+
import TaoUI, { localeRu } from '@1337exp/taoui'
|
|
229
229
|
|
|
230
|
-
app.use(TaoUI, { locale:
|
|
230
|
+
app.use(TaoUI, { locale: localeRu })
|
|
231
231
|
```
|
|
232
232
|
|
|
233
233
|
Change single texts — the rest stays from the default:
|
|
@@ -236,7 +236,7 @@ Change single texts — the rest stays from the default:
|
|
|
236
236
|
app.use(TaoUI, { locale: { select: { placeholder: 'Pick one' } } })
|
|
237
237
|
```
|
|
238
238
|
|
|
239
|
-
Another language: copy `localeEn
|
|
239
|
+
Another language: copy `localeEn` (or `localeRu`), translate, pass it the same way (type `TaoLocale`). Keys repeat prop names —
|
|
240
240
|
`locale.select.placeholder` is the default of TaoSelect `placeholder`, and a prop passed by hand always wins.
|
|
241
241
|
|
|
242
242
|
Switch the language at any moment — from your settings, a language picker, a route. Components already on the page
|
|
@@ -246,12 +246,18 @@ update at once, without a reload and without losing what users typed:
|
|
|
246
246
|
import { setTaoLocale, localeEn, localeRu } from '@1337exp/taoui'
|
|
247
247
|
|
|
248
248
|
function onLanguageChange(lang) {
|
|
249
|
-
setTaoLocale(lang === '
|
|
249
|
+
setTaoLocale(lang === 'ru' ? localeRu : localeEn)
|
|
250
250
|
}
|
|
251
251
|
```
|
|
252
252
|
|
|
253
253
|
Without the plugin (individual components) `setTaoLocale()` is the only call you need.
|
|
254
254
|
|
|
255
|
+
### Upgrading from 3.x
|
|
256
|
+
|
|
257
|
+
4.0 changes one default: the built-in texts are now English (they were Russian). To stay on Russian, pass the locale
|
|
258
|
+
once — `app.use(TaoUI, { locale: localeRu })`, or `setTaoLocale(localeRu)` without the plugin. The date helpers and
|
|
259
|
+
the date components follow the locale and default to `en-US` as well.
|
|
260
|
+
|
|
255
261
|
### Upgrading from 1.x
|
|
256
262
|
|
|
257
263
|
See [CHANGELOG.md](CHANGELOG.md): what broke, and a table of old names → new ones. Old names still work in 2.x and
|
package/README.ru.md
CHANGED
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
- **TaoLink** — `<NuxtLink>` в Nuxt, `<RouterLink>` при vue-router, иначе обычный `<a>` — без дополнительной настройки
|
|
118
118
|
- **TaoBreadcrumb** — крошки: последний пункт — текущая страница
|
|
119
119
|
- **TaoDropdownMenu** — выпадающее меню с авто-позиционированием у края экрана
|
|
120
|
-
- **TaoScrollTop** — плавающая кнопка
|
|
120
|
+
- **TaoScrollTop** — плавающая кнопка «наверх»: виды `solid` / `ghost` / `text`, `side`, подпись `label` при наведении мыши. Появляется при обратном скролле после `boundary`
|
|
121
121
|
|
|
122
122
|
### Обратная связь
|
|
123
123
|
|
|
@@ -224,12 +224,12 @@ app.mount('#app')
|
|
|
224
224
|
|
|
225
225
|
### Язык
|
|
226
226
|
|
|
227
|
-
Встроенные тексты (плейсхолдеры, «Очистить», aria-подписи, даты) по умолчанию
|
|
227
|
+
Встроенные тексты (плейсхолдеры, «Очистить», aria-подписи, даты) по умолчанию английские. Русский идёт в комплекте:
|
|
228
228
|
|
|
229
229
|
```javascript
|
|
230
|
-
import TaoUI, {
|
|
230
|
+
import TaoUI, { localeRu } from '@1337exp/taoui'
|
|
231
231
|
|
|
232
|
-
app.use(TaoUI, { locale:
|
|
232
|
+
app.use(TaoUI, { locale: localeRu })
|
|
233
233
|
```
|
|
234
234
|
|
|
235
235
|
Поменять отдельные тексты — остальное останется от локали по умолчанию:
|
|
@@ -238,7 +238,7 @@ app.use(TaoUI, { locale: localeEn })
|
|
|
238
238
|
app.use(TaoUI, { locale: { select: { placeholder: 'Выберите город' } } })
|
|
239
239
|
```
|
|
240
240
|
|
|
241
|
-
Другой язык: скопируйте `localeEn
|
|
241
|
+
Другой язык: скопируйте `localeEn` (или `localeRu`), переведите и передайте так же (тип `TaoLocale`). Ключи повторяют имена пропсов —
|
|
242
242
|
`locale.select.placeholder` — значение по умолчанию для `placeholder` у TaoSelect, а переданный руками проп всегда главнее.
|
|
243
243
|
|
|
244
244
|
Язык можно переключать в любой момент — из настроек, переключателя языка, по маршруту. Уже показанные компоненты
|
|
@@ -248,12 +248,18 @@ app.use(TaoUI, { locale: { select: { placeholder: 'Выберите город'
|
|
|
248
248
|
import { setTaoLocale, localeEn, localeRu } from '@1337exp/taoui'
|
|
249
249
|
|
|
250
250
|
function onLanguageChange(lang) {
|
|
251
|
-
setTaoLocale(lang === '
|
|
251
|
+
setTaoLocale(lang === 'ru' ? localeRu : localeEn)
|
|
252
252
|
}
|
|
253
253
|
```
|
|
254
254
|
|
|
255
255
|
Без плагина (отдельные компоненты) достаточно одного вызова `setTaoLocale()`.
|
|
256
256
|
|
|
257
|
+
### Переход с 3.x
|
|
258
|
+
|
|
259
|
+
В 4.0 поменялся один умолчательный параметр: встроенные тексты теперь английские (раньше были русские). Чтобы остаться
|
|
260
|
+
на русском, передайте локаль один раз: `app.use(TaoUI, { locale: localeRu })`, а без плагина — `setTaoLocale(localeRu)`.
|
|
261
|
+
Хелперы дат и компоненты дат следуют локали и по умолчанию тоже `en-US`.
|
|
262
|
+
|
|
257
263
|
### Переход с 1.x
|
|
258
264
|
|
|
259
265
|
Смотрите [CHANGELOG.md](CHANGELOG.md): что сломалось и таблица «старое имя → новое». В 2.x старые имена ещё работают
|