Skip to content
Merged
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
2 changes: 2 additions & 0 deletions packages/components/core/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ export const enUSLocaleData = {
customPeriodFrom: 'from',
customPeriodTo: 'to',
customPeriodErrorHint: 'The period cannot start later than it ends',
customPeriodMinIntervalErrorHint: 'The period cannot be shorter than {{ value }}',
customPeriodMaxIntervalErrorHint: 'The period cannot be longer than {{ value }}',
backToPeriodSelection: 'Back'
}
},
Expand Down
2 changes: 2 additions & 0 deletions packages/components/core/locales/es-LA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ export const esLALocaleData = {
customPeriodFrom: 'desde',
customPeriodTo: 'hasta',
customPeriodErrorHint: 'El inicio del período no puede estar después del fin',
customPeriodMinIntervalErrorHint: 'El período no puede ser más corto que {{ value }}',
customPeriodMaxIntervalErrorHint: 'El período no puede ser más largo que {{ value }}',
backToPeriodSelection: 'Atrás'
}
},
Expand Down
2 changes: 2 additions & 0 deletions packages/components/core/locales/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ export const ptBRLocaleData = {
customPeriodFrom: 'de',
customPeriodTo: 'até',
customPeriodErrorHint: 'O período não pode começar depois de quando acaba',
customPeriodMinIntervalErrorHint: 'O período não pode ser menor que {{ value }}',
customPeriodMaxIntervalErrorHint: 'O período não pode ser maior que {{ value }}',
backToPeriodSelection: 'Voltar'
}
},
Expand Down
2 changes: 2 additions & 0 deletions packages/components/core/locales/ru-RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ export const ruRULocaleData = {
customPeriodFrom: 'с',
customPeriodTo: 'по',
customPeriodErrorHint: 'Начало периода не может быть позже окончания',
customPeriodMinIntervalErrorHint: 'Период не может быть короче {{ value }}',
customPeriodMaxIntervalErrorHint: 'Период не может быть длиннее {{ value }}',
backToPeriodSelection: 'Назад'
}
},
Expand Down
2 changes: 2 additions & 0 deletions packages/components/core/locales/tk-TM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ export const tkTMLocaleData = {
customPeriodFrom: 'başy',
customPeriodTo: 'soňy',
customPeriodErrorHint: 'Döwür gutarýan wagtyndan soň başlap bilmeýär',
customPeriodMinIntervalErrorHint: 'Döwür azyndan {{ value }} bolmaly',
customPeriodMaxIntervalErrorHint: 'Döwür köpi bilen {{ value }} bolmaly',
backToPeriodSelection: 'Yzyna'
}
},
Expand Down
6 changes: 6 additions & 0 deletions packages/components/filter-bar/filter-bar.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ For the `select` and `multiselect` types, the pipe template accepts an optional

The `input` type is the only one without a popover: it renders a bare input that is typed into directly in the bar, using the pipe's `name` as its placeholder. The value is applied as you type — 200 ms after the last keystroke (`debounceTime`) and only from 3 characters on (`minLength`) — rather than through an Apply button. Text shorter than the threshold, including an emptied field, is applied as `null`, so the bar never keeps filtering by text that is no longer in the input. `Enter` and blur apply the value immediately and ignore the threshold: an explicit action is always applied as typed. Its only clear affordance is the built-in cleaner inside the input, so `removable` has no effect — an `input` pipe can only be removed programmatically. Values are trimmed, and a blank value is applied as `null`. Set its width with the `--kbq-filter-bar-pipe-input-width` CSS variable.

### Date and time limits

The `date` and `datetime` pipe templates accept optional limits for the custom period. `minDateTime` and `maxDateTime` bound the selectable range — the `datetime` pipe uses the full instant (date and time), the `date` pipe only the day. `minInterval` and `maxInterval` constrain the length of the selected period (`end − start`) as a duration-like object (e.g. `{ days: 3 }`, `{ hours: 1 }`); a period outside these bounds shows an error and disables Apply, with the limit formatted for the current locale. All four are ignored by other pipe types.

<!-- example(filter-bar-date-limits) -->

### Search in pipes

If the filter has many values, it is useful to enable search in the drop-down menu.
Expand Down
6 changes: 6 additions & 0 deletions packages/components/filter-bar/filter-bar.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@

Тип `input` — единственный без поповера: он отображает обычное поле ввода, в котором печатают прямо в баре, а `name` пайпа используется как плейсхолдер. Значение применяется по ходу ввода — через 200 мс после последнего нажатия клавиши (`debounceTime`) и начиная с 3 символов (`minLength`), — а не через кнопку «Применить». Текст короче порога, в том числе очищенное поле, применяется как `null`, поэтому бар никогда не продолжает фильтровать по тексту, которого уже нет в поле. `Enter` и потеря фокуса применяют значение сразу и порог игнорируют: явное действие пользователя применяется как введено. Единственный способ очистки — встроенный клинер внутри поля, поэтому `removable` ни на что не влияет: пайп типа `input` можно удалить только программно. Значения обрезаются по краям, а пустое значение применяется как `null`. Ширина задаётся CSS-переменной `--kbq-filter-bar-pipe-input-width`.

### Ограничения даты и времени

В шаблонах пайпов `date` и `datetime` доступны необязательные ограничения произвольного периода. `minDateTime` и `maxDateTime` задают границы выбираемого диапазона: пайп `datetime` использует полный момент (дату и время), пайп `date` — только день. `minInterval` и `maxInterval` ограничивают длину выбранного периода (`end − start`) и задаются объектом длительности (например, `{ days: 3 }`, `{ hours: 1 }`); период вне этих границ показывает ошибку и блокирует «Применить», а само ограничение форматируется под текущую локаль. Все четыре параметра игнорируются другими типами пайпов.

<!-- example(filter-bar-date-limits) -->

### Поиск значений

Если в фильтре много значений, то полезно включить поиск в выпадающем меню.
Expand Down
30 changes: 30 additions & 0 deletions packages/components/filter-bar/filter-bar.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,36 @@ export interface KbqPipeTemplate extends Omit<KbqPipe, 'value'> {
* is used. Ignored by other pipe types.
*/
compareWith?: (o1: KbqSelectValue | null | undefined, o2: KbqSelectValue | null | undefined) => boolean;
/**
* Earliest selectable instant for the `date` / `datetime` pipe custom period. Accepts any value the
* configured `DateAdapter` can deserialize (with the default Luxon adapter: an ISO-8601 string, a
* `Date`, or a `DateTime`). The `date` pipe uses only its day (pinned to the start of day). Ignored by
* other pipe types.
*/
minDateTime?: unknown;
/**
* Latest selectable instant for the `date` / `datetime` pipe custom period. See
* {@link KbqPipeTemplate.minDateTime}. The `date` pipe uses only its day (pinned to the end of day).
* Ignored by other pipe types.
*/
maxDateTime?: unknown;
/**
* Minimum length of the `date` / `datetime` pipe custom period (`end − start`), as a Luxon
* duration-like object, e.g. `{ days: 1 }` or `{ hours: 2 }`. When the selected period is shorter, the
* editor shows an error and disables Apply. Ignored by other pipe types.
*
* Unlike {@link KbqPipeTemplate.minDateTime}, this value is NOT deserialized through the configured
* `DateAdapter` — it is applied directly via the date value's own `.plus()`, so this option currently
* assumes the default Luxon adapter and is not portable to other `DateAdapter` implementations (e.g.
* the Moment adapter).
*/
minInterval?: unknown;
/**
* Maximum length of the `date` / `datetime` pipe custom period (`end − start`). See
* {@link KbqPipeTemplate.minInterval}. When the selected period is longer, the editor shows an error and
* disables Apply. Ignored by other pipe types.
*/
maxInterval?: unknown;
}

export interface KbqSaveFilterError {
Expand Down
Loading