Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion docs/guides/migration.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ for each option it deselected and reporting the shortened value to the form cont

### 18. Component review (20.3.0)

Ten components went through a full review in 20.3.0: notification-center, popover, search-expandable, select, split-button, title, toast, tooltip, tree and tree-select. Each review closed the members that were never part of the component's contract, moved inputs to signals where that was the point of it, and fixed the behavior it uncovered along the way. Only the changes that reach a consumer are listed here.
Components went through a full review in 20.3.0, in two waves. The first covered notification-center, popover, search-expandable, select, split-button, title, toast, tooltip, tree and tree-select; the second is the one each subsection below belongs to. Each review closed the members that were never part of the component's contract, moved inputs to signals where that was the point of it, and fixed the behavior it uncovered along the way. Only the changes that reach a consumer are listed here.

Every schematic named below runs automatically:

Expand Down Expand Up @@ -1113,6 +1113,26 @@ A `<kbq-split-button>` with no projected button no longer throws outside dev mod

Reported by `split-button-optional-disabled`.

#### Timepicker

`KbqTimepicker` implements `KbqFormFieldControl`, which declares `value`, `id`, `placeholder`, `required`, `disabled`, `focused`, `empty` and `errorState` as plain members — those stay plain accessors. The four inputs the timepicker owns moved.

`min` and `max` parsed in their setters and reported the parsed result, so an unparseable bound value read back as `null`. They report what was bound now; the parsed values stay internal and still drive the validators.

| Pattern | Manual migration |
| --------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| `.format` | Read as `format()` — rewritten for you |
| `.min` / `.max` | `min()` / `max()`, and expect the bound value rather than the parsed one |
| `.format = …` / `.min = …` / `.max = …` / `.kbqValidationTooltip = …` | Bind them in the template; the inputs are read-only |

**`kbqValidationTooltip` unsubscribes.** The setter subscribed to `incorrectInput` every time it ran and never unsubscribed, so re-binding the input stacked another subscription and the last one outlived the directive. It is an effect with a teardown now.

**A locale change reformats the rendered time even when the placeholder was set by the consumer.** The effect used to return early on a consumer-provided placeholder, which skipped the reformat with it — the two are separate concerns now.

**Generated ids changed shape**, from `kbq-timepicker-1` to `kbq-timepicker-a1`.

Handled by `timepicker-signals`: the `format` reads are rewritten, the rest is reported.

#### Title

`kbq-title` measures its host and opens a tooltip when the text is truncated. The review kept that surface — the `kbq-title` input and the tooltip it opens — and closed the measurement machinery behind it.
Expand Down
22 changes: 21 additions & 1 deletion docs/guides/migration.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ ng g @koobiq/components:list-tree-multiple-input --project <your project>

### 18. Ревью компонентов (20.3.0)

В 20.3.0 полное ревью прошли десять компонентов: notification-center, popover, search-expandable, select, split-button, title, toast, tooltip, tree и tree-select. Каждое ревью закрывало члены, которые никогда не были частью контракта компонента, переводило входы на сигналы там, где в этом и был его смысл, и попутно исправляло найденные ошибки поведения. Ниже перечислено только то, что доходит до потребителя.
В 20.3.0 полное ревью прошло в две волны. В первую вошли notification-center, popover, search-expandable, select, split-button, title, toast, tooltip, tree и tree-select; ко второй относится каждый из подразделов ниже. Каждое ревью закрывало члены, которые никогда не были частью контракта компонента, переводило входы на сигналы там, где в этом и был его смысл, и попутно исправляло найденные ошибки поведения. Ниже перечислено только то, что доходит до потребителя.

Все схематики, названные ниже, запускаются автоматически:

Expand Down Expand Up @@ -1117,6 +1117,26 @@ if (splitButton.disabled === false) {

Сообщает `split-button-optional-disabled`.

#### Timepicker

`KbqTimepicker` реализует `KbqFormFieldControl`, который объявляет `value`, `id`, `placeholder`, `required`, `disabled`, `focused`, `empty` и `errorState` обычными членами — они остались обычными геттерами и сеттерами. Переехали четыре входа, которые принадлежат самому `KbqTimepicker`.

`min` и `max` разбирали значение в сеттерах и возвращали результат разбора, поэтому значение, которое адаптер дат прочитать не смог, читалось обратно как `null`. Теперь они возвращают то, что было привязано; разобранные значения остались внутренними и по-прежнему питают валидаторы.

| Что было | Как мигрировать вручную |
| --------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `.format` | Читать как `format()` — переписывается за вас |
| `.min` / `.max` | `min()` / `max()`, и ожидать привязанное значение, а не разобранное |
| `.format = …` / `.min = …` / `.max = …` / `.kbqValidationTooltip = …` | Привязать в шаблоне; входы доступны только на чтение |

**`kbqValidationTooltip` теперь отписывается.** Сеттер подписывался на `incorrectInput` при каждом срабатывании и никогда не отписывался, поэтому повторная привязка входа накапливала ещё одну подписку, а последняя переживала саму директиву. Теперь это `effect` с очисткой.

**Смена локали переформатирует показанное время, даже если placeholder задал потребитель.** Раньше эффект досрочно выходил при пользовательском placeholder и вместе с ним пропускал переформатирование — теперь это две независимые вещи.

**Формат генерируемых `id` изменился** с `kbq-timepicker-1` на `kbq-timepicker-a1`.

Закрывается схематиком `timepicker-signals`: чтения `format` переписываются, остальное сообщается в отчёте.

#### Title

`kbq-title` измеряет свой хост и открывает тултип, когда текст обрезан. Ревью сохранило эту поверхность — вход `kbq-title` и открываемый тултип — и закрыло стоящий за ней механизм измерения.
Expand Down
Loading
Loading