@jigisha_ruparel/taf-client-filter-bar-angular 0.2.0 → 0.4.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.
@@ -3,6 +3,16 @@ import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
4
  import { Directive, EventEmitter, Output, Input, ChangeDetectionStrategy, Component } from '@angular/core';
5
5
 
6
+ /** Marks host content to place at the START of the bar, before the filters (a date navigator, a
7
+ * tab strip, a counts block) — the controls a row leads with rather than trails. */
8
+ class TafFilterBarStartDirective {
9
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: TafFilterBarStartDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
10
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.5", type: TafFilterBarStartDirective, isStandalone: true, selector: "[tafFilterBarStart]", ngImport: i0 });
11
+ }
12
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: TafFilterBarStartDirective, decorators: [{
13
+ type: Directive,
14
+ args: [{ selector: '[tafFilterBarStart]', standalone: true }]
15
+ }] });
6
16
  /** Marks host content to place at the end of the bar (an export button, a view switch). */
7
17
  class TafFilterBarEndDirective {
8
18
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: TafFilterBarEndDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
@@ -132,12 +142,15 @@ class TafFilterBarComponent {
132
142
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: TafFilterBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
133
143
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.5", type: TafFilterBarComponent, isStandalone: true, selector: "taf-filter-bar", inputs: { filters: "filters", value: "value", showClear: "showClear", clearLabel: "clearLabel", searchDebounce: "searchDebounce" }, outputs: { changed: "changed", valueChange: "valueChange", cleared: "cleared" }, ngImport: i0, template: `
134
144
  <div class="taf-filter-bar" role="search">
145
+ <ng-content select="[tafFilterBarStart]"></ng-content>
135
146
  <ng-container *ngFor="let f of filters; trackBy: trackKey">
136
147
  <div
137
148
  class="taf-filter-bar__group"
138
149
  [attr.data-key]="f.key"
139
150
  [attr.data-kind]="f.kind"
140
151
  [attr.data-captioned]="f.caption ? '' : null"
152
+ [attr.data-grow]="f.grow ? '' : null"
153
+ [attr.data-align]="f.align || null"
141
154
  >
142
155
  <span class="taf-filter-bar__caption" *ngIf="f.caption">{{ f.caption }}</span>
143
156
  <ng-container [ngSwitch]="f.kind">
@@ -278,12 +291,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
278
291
  type: Component,
279
292
  args: [{ selector: 'taf-filter-bar', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
280
293
  <div class="taf-filter-bar" role="search">
294
+ <ng-content select="[tafFilterBarStart]"></ng-content>
281
295
  <ng-container *ngFor="let f of filters; trackBy: trackKey">
282
296
  <div
283
297
  class="taf-filter-bar__group"
284
298
  [attr.data-key]="f.key"
285
299
  [attr.data-kind]="f.kind"
286
300
  [attr.data-captioned]="f.caption ? '' : null"
301
+ [attr.data-grow]="f.grow ? '' : null"
302
+ [attr.data-align]="f.align || null"
287
303
  >
288
304
  <span class="taf-filter-bar__caption" *ngIf="f.caption">{{ f.caption }}</span>
289
305
  <ng-container [ngSwitch]="f.kind">
@@ -436,10 +452,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
436
452
  }], cleared: [{
437
453
  type: Output
438
454
  }] } });
455
+ /**
456
+ * Everything `<taf-filter-bar>` needs, in one import: `imports: [...TAF_FILTER_BAR]`.
457
+ * Importing the component alone leaves `[tafFilterBarStart]` / `[tafFilterBarEnd]` content
458
+ * unprojected — it simply does not render, with no error.
459
+ */
460
+ const TAF_FILTER_BAR = [
461
+ TafFilterBarComponent,
462
+ TafFilterBarStartDirective,
463
+ TafFilterBarEndDirective,
464
+ ];
439
465
 
440
466
  /**
441
467
  * Generated bundle index. Do not edit.
442
468
  */
443
469
 
444
- export { TafFilterBarComponent, TafFilterBarEndDirective };
470
+ export { TAF_FILTER_BAR, TafFilterBarComponent, TafFilterBarEndDirective, TafFilterBarStartDirective };
445
471
  //# sourceMappingURL=jigisha_ruparel-taf-client-filter-bar-angular.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"jigisha_ruparel-taf-client-filter-bar-angular.mjs","sources":["../../src/taf-filter-bar.component.ts","../../src/jigisha_ruparel-taf-client-filter-bar-angular.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n Directive,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n booleanAttribute,\n} from '@angular/core';\n\n/** What a filter looks like on screen. */\nexport type TafFilterKind = 'search' | 'select' | 'chips' | 'segmented' | 'date' | 'date-range' | 'toggle';\n\n/** One entry in a select or chip group. */\nexport interface TafFilterOption {\n value: string;\n label: string;\n /** A live count beside the label — how many rows this choice would show. */\n count?: number;\n /** A colour for the chip's leading dot; the host theme decides what it means. */\n dot?: string;\n}\n\n/** One filter in the bar. `key` is what the value is stored and emitted under. */\nexport interface TafFilterSpec {\n key: string;\n kind: TafFilterKind;\n /** Placeholder for a search box, the \"nothing selected\" entry for a select, the caption for a toggle. */\n label?: string;\n /** Options for `select` and `chips`. Raw rows work too — name the fields with optionValue/optionLabel. */\n options?: readonly TafFilterOption[] | readonly object[];\n optionValue?: string;\n optionLabel?: string;\n /** Width in px; the bar's own layout applies when unset. */\n width?: number;\n /** Search only: ms to wait after typing before emitting (0 emits on every keystroke). */\n debounce?: number;\n /** Shown instead of `label` inside the control, when both make sense (e.g. a select's own title). */\n title?: string;\n disabled?: boolean;\n /** A caption above the control, for a bar whose groups are labelled (DATE RANGE, STATUS, …). */\n caption?: string;\n /**\n * `select` only. False drops the injected \"nothing selected\" entry, for a preset picker whose\n * every option is a real value and which therefore always has one chosen.\n */\n allowEmpty?: boolean;\n}\n\n/** The bar's current state: one entry per filter key. */\nexport type TafFilterValue = Record<string, unknown>;\n\n/** Marks host content to place at the end of the bar (an export button, a view switch). */\n@Directive({ selector: '[tafFilterBarEnd]', standalone: true })\nexport class TafFilterBarEndDirective {}\n\n/**\n * `<taf-filter-bar>` — the row of controls that sits above a list: a search box, some selects, a\n * chip group, a date range, and a Clear that appears once anything is set.\n *\n * The bar owns no state. It renders `[value]`, and every interaction emits `(changed)` with the one\n * key that moved plus `(valueChange)` with the whole record, so a host can keep either one signal per\n * filter or a single object — whichever it already has.\n *\n * Values by kind: `search`/`select`/`date`/`segmented` → string; `chips` → string[]; `date-range` →\n * `{ from: string; to: string }`; `toggle` → boolean. `segmented` is the single-select sibling of\n * `chips`, for a status rail where exactly one choice is active.\n *\n * Ships NO theme — `taf-filter-bar__*` class hooks plus `data-kind` / `data-active`, and\n * `ViewEncapsulation.None` is deliberately NOT used here: the controls are plain elements the host\n * app styles through those classes.\n */\n@Component({\n selector: 'taf-filter-bar',\n standalone: true,\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"taf-filter-bar\" role=\"search\">\n <ng-container *ngFor=\"let f of filters; trackBy: trackKey\">\n <div\n class=\"taf-filter-bar__group\"\n [attr.data-key]=\"f.key\"\n [attr.data-kind]=\"f.kind\"\n [attr.data-captioned]=\"f.caption ? '' : null\"\n >\n <span class=\"taf-filter-bar__caption\" *ngIf=\"f.caption\">{{ f.caption }}</span>\n <ng-container [ngSwitch]=\"f.kind\">\n <input\n *ngSwitchCase=\"'search'\"\n class=\"taf-filter-bar__field taf-filter-bar__search\"\n type=\"search\"\n data-kind=\"search\"\n [attr.data-key]=\"f.key\"\n [attr.aria-label]=\"f.label || 'Search'\"\n [placeholder]=\"f.label || ''\"\n [disabled]=\"!!f.disabled\"\n [style.width.px]=\"f.width || null\"\n [value]=\"asText(f.key)\"\n (input)=\"onSearch(f, $any($event.target).value)\"\n />\n\n <select\n *ngSwitchCase=\"'select'\"\n class=\"taf-filter-bar__field taf-filter-bar__select\"\n data-kind=\"select\"\n [attr.data-key]=\"f.key\"\n [attr.data-active]=\"asText(f.key) ? '' : null\"\n [attr.aria-label]=\"f.title || f.label || f.key\"\n [disabled]=\"!!f.disabled\"\n [style.width.px]=\"f.width || null\"\n [value]=\"asText(f.key)\"\n (change)=\"set(f.key, $any($event.target).value)\"\n >\n <option *ngIf=\"f.allowEmpty !== false\" value=\"\" [selected]=\"!asText(f.key)\">{{ f.label || 'All' }}</option>\n <option\n *ngFor=\"let o of options(f)\"\n [value]=\"o.value\"\n [selected]=\"asText(f.key) === o.value\"\n >{{ o.label }}</option>\n </select>\n\n <div *ngSwitchCase=\"'chips'\" class=\"taf-filter-bar__chips\" data-kind=\"chips\" [attr.data-key]=\"f.key\">\n <button\n *ngFor=\"let o of options(f)\"\n type=\"button\"\n class=\"taf-filter-bar__chip\"\n [attr.data-active]=\"isPicked(f.key, o.value) ? '' : null\"\n [attr.aria-pressed]=\"isPicked(f.key, o.value)\"\n [disabled]=\"!!f.disabled\"\n (click)=\"toggleChip(f.key, o.value)\"\n >\n <span class=\"taf-filter-bar__dot\" *ngIf=\"o.dot\" [style.background]=\"o.dot\" aria-hidden=\"true\"></span>\n {{ o.label }}\n <span class=\"taf-filter-bar__count\" *ngIf=\"o.count !== undefined\">{{ o.count }}</span>\n </button>\n </div>\n\n <div\n *ngSwitchCase=\"'segmented'\"\n class=\"taf-filter-bar__chips taf-filter-bar__chips--single\"\n data-kind=\"segmented\"\n role=\"radiogroup\"\n [attr.data-key]=\"f.key\"\n >\n <button\n *ngFor=\"let o of options(f)\"\n type=\"button\"\n role=\"radio\"\n class=\"taf-filter-bar__chip\"\n [attr.data-active]=\"asText(f.key) === o.value ? '' : null\"\n [attr.data-option]=\"o.value\"\n [attr.aria-checked]=\"asText(f.key) === o.value\"\n [disabled]=\"!!f.disabled\"\n (click)=\"set(f.key, o.value)\"\n >\n <span class=\"taf-filter-bar__dot\" *ngIf=\"o.dot\" [style.background]=\"o.dot\" aria-hidden=\"true\"></span>\n {{ o.label }}\n <span class=\"taf-filter-bar__count\" *ngIf=\"o.count !== undefined\">{{ o.count }}</span>\n </button>\n </div>\n\n <input\n *ngSwitchCase=\"'date'\"\n class=\"taf-filter-bar__field taf-filter-bar__date\"\n type=\"date\"\n data-kind=\"date\"\n [attr.data-key]=\"f.key\"\n [attr.aria-label]=\"f.label || f.key\"\n [attr.title]=\"f.title || f.label || null\"\n [disabled]=\"!!f.disabled\"\n [value]=\"asText(f.key)\"\n (input)=\"set(f.key, $any($event.target).value)\"\n />\n\n <div *ngSwitchCase=\"'date-range'\" class=\"taf-filter-bar__range\" data-kind=\"date-range\" [attr.data-key]=\"f.key\">\n <input\n type=\"date\"\n class=\"taf-filter-bar__field taf-filter-bar__date\"\n [attr.aria-label]=\"(f.label || f.key) + ' from'\"\n title=\"From\"\n [disabled]=\"!!f.disabled\"\n [value]=\"range(f.key).from\"\n (input)=\"setRange(f.key, 'from', $any($event.target).value)\"\n />\n <span class=\"taf-filter-bar__range-sep\" aria-hidden=\"true\">–</span>\n <input\n type=\"date\"\n class=\"taf-filter-bar__field taf-filter-bar__date\"\n [attr.aria-label]=\"(f.label || f.key) + ' to'\"\n title=\"To\"\n [disabled]=\"!!f.disabled\"\n [value]=\"range(f.key).to\"\n (input)=\"setRange(f.key, 'to', $any($event.target).value)\"\n />\n </div>\n\n <label *ngSwitchCase=\"'toggle'\" class=\"taf-filter-bar__toggle\" data-kind=\"toggle\" [attr.data-key]=\"f.key\">\n <input\n type=\"checkbox\"\n [disabled]=\"!!f.disabled\"\n [checked]=\"!!value[f.key]\"\n (change)=\"set(f.key, $any($event.target).checked)\"\n />\n {{ f.label }}\n </label>\n </ng-container>\n </div>\n </ng-container>\n\n <span class=\"taf-filter-bar__spacer\"></span>\n <ng-content select=\"[tafFilterBarEnd]\"></ng-content>\n <button\n *ngIf=\"clearVisible\"\n type=\"button\"\n class=\"taf-filter-bar__clear\"\n (click)=\"clear()\"\n >{{ clearLabel }}</button>\n </div>\n `,\n styles: [\n `\n taf-filter-bar { display: contents; }\n `,\n ],\n})\nexport class TafFilterBarComponent implements OnDestroy {\n @Input() filters: readonly TafFilterSpec[] = [];\n @Input() value: TafFilterValue = {};\n /**\n * Whether the Clear button renders. Left unset it appears once any filter is set; set it\n * explicitly to decide yourself — a host whose Clear also resets state the bar cannot see (tiles,\n * a tree selection) needs that, or Clear would hide while those filters are still on.\n */\n @Input() showClear: boolean | null = null;\n @Input() clearLabel = 'Clear';\n /** Default debounce for `search` filters that do not set their own, in ms. */\n @Input() searchDebounce = 200;\n\n /** The one filter that moved. */\n @Output() readonly changed = new EventEmitter<{ key: string; value: unknown }>();\n /** The whole record after that change. */\n @Output() readonly valueChange = new EventEmitter<TafFilterValue>();\n /** Clear pressed — the host decides what \"empty\" means for its own state. */\n @Output() readonly cleared = new EventEmitter<void>();\n\n private timer?: ReturnType<typeof setTimeout>;\n\n ngOnDestroy(): void {\n if (this.timer) clearTimeout(this.timer);\n }\n\n /** Clear renders when the host says so, or by default once anything is set. */\n get clearVisible(): boolean {\n return this.showClear ?? this.isDirty;\n }\n\n /** True when anything is set. */\n get isDirty(): boolean {\n return this.filters.some((f) => {\n const v = this.value[f.key];\n if (Array.isArray(v)) return v.length > 0;\n if (v && typeof v === 'object') return Object.values(v as object).some(Boolean);\n return v !== undefined && v !== null && v !== '' && v !== false;\n });\n }\n\n protected trackKey = (_: number, f: TafFilterSpec) => f.key;\n\n protected options(f: TafFilterSpec): TafFilterOption[] {\n const raw = f.options ?? [];\n const vk = f.optionValue;\n const lk = f.optionLabel;\n if (!vk && !lk) return raw as TafFilterOption[];\n return (raw as readonly Record<string, unknown>[]).map((o) => ({\n value: String(o[vk ?? 'value'] ?? ''),\n label: String(o[lk ?? 'label'] ?? o[vk ?? 'value'] ?? ''),\n count: typeof o['count'] === 'number' ? (o['count'] as number) : undefined,\n dot: typeof o['dot'] === 'string' ? (o['dot'] as string) : undefined,\n }));\n }\n\n protected asText(key: string): string {\n const v = this.value[key];\n return v === undefined || v === null ? '' : String(v);\n }\n\n protected range(key: string): { from: string; to: string } {\n const v = (this.value[key] ?? {}) as { from?: string; to?: string };\n return { from: v.from ?? '', to: v.to ?? '' };\n }\n\n protected isPicked(key: string, option: string): boolean {\n const v = this.value[key];\n return Array.isArray(v) ? v.includes(option) : false;\n }\n\n protected onSearch(f: TafFilterSpec, text: string): void {\n const wait = f.debounce ?? this.searchDebounce;\n if (this.timer) clearTimeout(this.timer);\n if (!wait) {\n this.set(f.key, text);\n return;\n }\n this.timer = setTimeout(() => this.set(f.key, text), wait);\n }\n\n protected toggleChip(key: string, option: string): void {\n const current = Array.isArray(this.value[key]) ? ([...(this.value[key] as string[])]) : [];\n const at = current.indexOf(option);\n if (at >= 0) current.splice(at, 1);\n else current.push(option);\n this.set(key, current);\n }\n\n protected setRange(key: string, edge: 'from' | 'to', text: string): void {\n this.set(key, { ...this.range(key), [edge]: text });\n }\n\n protected set(key: string, next: unknown): void {\n this.value = { ...this.value, [key]: next };\n this.changed.emit({ key, value: next });\n this.valueChange.emit(this.value);\n }\n\n protected clear(): void {\n const empty: TafFilterValue = {};\n for (const f of this.filters) {\n empty[f.key] =\n f.kind === 'chips' ? [] : f.kind === 'date-range' ? { from: '', to: '' } : f.kind === 'toggle' ? false : '';\n }\n this.value = empty;\n this.cleared.emit();\n this.valueChange.emit(this.value);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAsDA;MAEa,wBAAwB,CAAA;uGAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAxB,wBAAwB,EAAA,YAAA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AA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,CAAA,cAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAuJX,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBA1JjC,SAAS;+BACE,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,CAAC,EAAA,eAAA,EACN,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8IT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,oCAAA,CAAA,EAAA;;sBAQA;;sBACA;;sBAMA;;sBACA;;sBAEA;;sBAGA;;sBAEA;;sBAEA;;;ACtPH;;AAEG;;"}
1
+ {"version":3,"file":"jigisha_ruparel-taf-client-filter-bar-angular.mjs","sources":["../../src/taf-filter-bar.component.ts","../../src/jigisha_ruparel-taf-client-filter-bar-angular.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n Directive,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n booleanAttribute,\n} from '@angular/core';\n\n/** What a filter looks like on screen. */\nexport type TafFilterKind = 'search' | 'select' | 'chips' | 'segmented' | 'date' | 'date-range' | 'toggle';\n\n/** One entry in a select or chip group. */\nexport interface TafFilterOption {\n value: string;\n label: string;\n /** A live count beside the label — how many rows this choice would show. */\n count?: number;\n /** A colour for the chip's leading dot; the host theme decides what it means. */\n dot?: string;\n}\n\n/** One filter in the bar. `key` is what the value is stored and emitted under. */\nexport interface TafFilterSpec {\n key: string;\n kind: TafFilterKind;\n /** Placeholder for a search box, the \"nothing selected\" entry for a select, the caption for a toggle. */\n label?: string;\n /** Options for `select` and `chips`. Raw rows work too — name the fields with optionValue/optionLabel. */\n options?: readonly TafFilterOption[] | readonly object[];\n optionValue?: string;\n optionLabel?: string;\n /** Width in px; the bar's own layout applies when unset. */\n width?: number;\n /** Search only: ms to wait after typing before emitting (0 emits on every keystroke). */\n debounce?: number;\n /** Shown instead of `label` inside the control, when both make sense (e.g. a select's own title). */\n title?: string;\n disabled?: boolean;\n /** A caption above the control, for a bar whose groups are labelled (DATE RANGE, STATUS, …). */\n caption?: string;\n /**\n * `select` only. False drops the injected \"nothing selected\" entry, for a preset picker whose\n * every option is a real value and which therefore always has one chosen.\n */\n allowEmpty?: boolean;\n /**\n * Let this control take the row's leftover width — a chip group that used to be the flexible\n * element of a toolbar, so what follows it stays on the same line instead of wrapping.\n */\n grow?: boolean;\n /**\n * `'end'` pushes this filter — and everything after it — to the right edge. It is the row that\n * reads as \"these controls here, that one over there\", which a single trailing slot cannot\n * express because a filter can never be placed after it.\n */\n align?: 'start' | 'end';\n}\n\n/** The bar's current state: one entry per filter key. */\nexport type TafFilterValue = Record<string, unknown>;\n\n/** Marks host content to place at the START of the bar, before the filters (a date navigator, a\n * tab strip, a counts block) — the controls a row leads with rather than trails. */\n@Directive({ selector: '[tafFilterBarStart]', standalone: true })\nexport class TafFilterBarStartDirective {}\n\n/** Marks host content to place at the end of the bar (an export button, a view switch). */\n@Directive({ selector: '[tafFilterBarEnd]', standalone: true })\nexport class TafFilterBarEndDirective {}\n\n/**\n * `<taf-filter-bar>` — the row of controls that sits above a list: a search box, some selects, a\n * chip group, a date range, and a Clear that appears once anything is set.\n *\n * The bar owns no state. It renders `[value]`, and every interaction emits `(changed)` with the one\n * key that moved plus `(valueChange)` with the whole record, so a host can keep either one signal per\n * filter or a single object — whichever it already has.\n *\n * Values by kind: `search`/`select`/`date`/`segmented` → string; `chips` → string[]; `date-range` →\n * `{ from: string; to: string }`; `toggle` → boolean. `segmented` is the single-select sibling of\n * `chips`, for a status rail where exactly one choice is active.\n *\n * Ships NO theme — `taf-filter-bar__*` class hooks plus `data-kind` / `data-active`, and\n * `ViewEncapsulation.None` is deliberately NOT used here: the controls are plain elements the host\n * app styles through those classes.\n */\n@Component({\n selector: 'taf-filter-bar',\n standalone: true,\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"taf-filter-bar\" role=\"search\">\n <ng-content select=\"[tafFilterBarStart]\"></ng-content>\n <ng-container *ngFor=\"let f of filters; trackBy: trackKey\">\n <div\n class=\"taf-filter-bar__group\"\n [attr.data-key]=\"f.key\"\n [attr.data-kind]=\"f.kind\"\n [attr.data-captioned]=\"f.caption ? '' : null\"\n [attr.data-grow]=\"f.grow ? '' : null\"\n [attr.data-align]=\"f.align || null\"\n >\n <span class=\"taf-filter-bar__caption\" *ngIf=\"f.caption\">{{ f.caption }}</span>\n <ng-container [ngSwitch]=\"f.kind\">\n <input\n *ngSwitchCase=\"'search'\"\n class=\"taf-filter-bar__field taf-filter-bar__search\"\n type=\"search\"\n data-kind=\"search\"\n [attr.data-key]=\"f.key\"\n [attr.aria-label]=\"f.label || 'Search'\"\n [placeholder]=\"f.label || ''\"\n [disabled]=\"!!f.disabled\"\n [style.width.px]=\"f.width || null\"\n [value]=\"asText(f.key)\"\n (input)=\"onSearch(f, $any($event.target).value)\"\n />\n\n <select\n *ngSwitchCase=\"'select'\"\n class=\"taf-filter-bar__field taf-filter-bar__select\"\n data-kind=\"select\"\n [attr.data-key]=\"f.key\"\n [attr.data-active]=\"asText(f.key) ? '' : null\"\n [attr.aria-label]=\"f.title || f.label || f.key\"\n [disabled]=\"!!f.disabled\"\n [style.width.px]=\"f.width || null\"\n [value]=\"asText(f.key)\"\n (change)=\"set(f.key, $any($event.target).value)\"\n >\n <option *ngIf=\"f.allowEmpty !== false\" value=\"\" [selected]=\"!asText(f.key)\">{{ f.label || 'All' }}</option>\n <option\n *ngFor=\"let o of options(f)\"\n [value]=\"o.value\"\n [selected]=\"asText(f.key) === o.value\"\n >{{ o.label }}</option>\n </select>\n\n <div *ngSwitchCase=\"'chips'\" class=\"taf-filter-bar__chips\" data-kind=\"chips\" [attr.data-key]=\"f.key\">\n <button\n *ngFor=\"let o of options(f)\"\n type=\"button\"\n class=\"taf-filter-bar__chip\"\n [attr.data-active]=\"isPicked(f.key, o.value) ? '' : null\"\n [attr.aria-pressed]=\"isPicked(f.key, o.value)\"\n [disabled]=\"!!f.disabled\"\n (click)=\"toggleChip(f.key, o.value)\"\n >\n <span class=\"taf-filter-bar__dot\" *ngIf=\"o.dot\" [style.background]=\"o.dot\" aria-hidden=\"true\"></span>\n {{ o.label }}\n <span class=\"taf-filter-bar__count\" *ngIf=\"o.count !== undefined\">{{ o.count }}</span>\n </button>\n </div>\n\n <div\n *ngSwitchCase=\"'segmented'\"\n class=\"taf-filter-bar__chips taf-filter-bar__chips--single\"\n data-kind=\"segmented\"\n role=\"radiogroup\"\n [attr.data-key]=\"f.key\"\n >\n <button\n *ngFor=\"let o of options(f)\"\n type=\"button\"\n role=\"radio\"\n class=\"taf-filter-bar__chip\"\n [attr.data-active]=\"asText(f.key) === o.value ? '' : null\"\n [attr.data-option]=\"o.value\"\n [attr.aria-checked]=\"asText(f.key) === o.value\"\n [disabled]=\"!!f.disabled\"\n (click)=\"set(f.key, o.value)\"\n >\n <span class=\"taf-filter-bar__dot\" *ngIf=\"o.dot\" [style.background]=\"o.dot\" aria-hidden=\"true\"></span>\n {{ o.label }}\n <span class=\"taf-filter-bar__count\" *ngIf=\"o.count !== undefined\">{{ o.count }}</span>\n </button>\n </div>\n\n <input\n *ngSwitchCase=\"'date'\"\n class=\"taf-filter-bar__field taf-filter-bar__date\"\n type=\"date\"\n data-kind=\"date\"\n [attr.data-key]=\"f.key\"\n [attr.aria-label]=\"f.label || f.key\"\n [attr.title]=\"f.title || f.label || null\"\n [disabled]=\"!!f.disabled\"\n [value]=\"asText(f.key)\"\n (input)=\"set(f.key, $any($event.target).value)\"\n />\n\n <div *ngSwitchCase=\"'date-range'\" class=\"taf-filter-bar__range\" data-kind=\"date-range\" [attr.data-key]=\"f.key\">\n <input\n type=\"date\"\n class=\"taf-filter-bar__field taf-filter-bar__date\"\n [attr.aria-label]=\"(f.label || f.key) + ' from'\"\n title=\"From\"\n [disabled]=\"!!f.disabled\"\n [value]=\"range(f.key).from\"\n (input)=\"setRange(f.key, 'from', $any($event.target).value)\"\n />\n <span class=\"taf-filter-bar__range-sep\" aria-hidden=\"true\">–</span>\n <input\n type=\"date\"\n class=\"taf-filter-bar__field taf-filter-bar__date\"\n [attr.aria-label]=\"(f.label || f.key) + ' to'\"\n title=\"To\"\n [disabled]=\"!!f.disabled\"\n [value]=\"range(f.key).to\"\n (input)=\"setRange(f.key, 'to', $any($event.target).value)\"\n />\n </div>\n\n <label *ngSwitchCase=\"'toggle'\" class=\"taf-filter-bar__toggle\" data-kind=\"toggle\" [attr.data-key]=\"f.key\">\n <input\n type=\"checkbox\"\n [disabled]=\"!!f.disabled\"\n [checked]=\"!!value[f.key]\"\n (change)=\"set(f.key, $any($event.target).checked)\"\n />\n {{ f.label }}\n </label>\n </ng-container>\n </div>\n </ng-container>\n\n <span class=\"taf-filter-bar__spacer\"></span>\n <ng-content select=\"[tafFilterBarEnd]\"></ng-content>\n <button\n *ngIf=\"clearVisible\"\n type=\"button\"\n class=\"taf-filter-bar__clear\"\n (click)=\"clear()\"\n >{{ clearLabel }}</button>\n </div>\n `,\n styles: [\n `\n taf-filter-bar { display: contents; }\n `,\n ],\n})\nexport class TafFilterBarComponent implements OnDestroy {\n @Input() filters: readonly TafFilterSpec[] = [];\n @Input() value: TafFilterValue = {};\n /**\n * Whether the Clear button renders. Left unset it appears once any filter is set; set it\n * explicitly to decide yourself — a host whose Clear also resets state the bar cannot see (tiles,\n * a tree selection) needs that, or Clear would hide while those filters are still on.\n */\n @Input() showClear: boolean | null = null;\n @Input() clearLabel = 'Clear';\n /** Default debounce for `search` filters that do not set their own, in ms. */\n @Input() searchDebounce = 200;\n\n /** The one filter that moved. */\n @Output() readonly changed = new EventEmitter<{ key: string; value: unknown }>();\n /** The whole record after that change. */\n @Output() readonly valueChange = new EventEmitter<TafFilterValue>();\n /** Clear pressed — the host decides what \"empty\" means for its own state. */\n @Output() readonly cleared = new EventEmitter<void>();\n\n private timer?: ReturnType<typeof setTimeout>;\n\n ngOnDestroy(): void {\n if (this.timer) clearTimeout(this.timer);\n }\n\n /** Clear renders when the host says so, or by default once anything is set. */\n get clearVisible(): boolean {\n return this.showClear ?? this.isDirty;\n }\n\n /** True when anything is set. */\n get isDirty(): boolean {\n return this.filters.some((f) => {\n const v = this.value[f.key];\n if (Array.isArray(v)) return v.length > 0;\n if (v && typeof v === 'object') return Object.values(v as object).some(Boolean);\n return v !== undefined && v !== null && v !== '' && v !== false;\n });\n }\n\n protected trackKey = (_: number, f: TafFilterSpec) => f.key;\n\n protected options(f: TafFilterSpec): TafFilterOption[] {\n const raw = f.options ?? [];\n const vk = f.optionValue;\n const lk = f.optionLabel;\n if (!vk && !lk) return raw as TafFilterOption[];\n return (raw as readonly Record<string, unknown>[]).map((o) => ({\n value: String(o[vk ?? 'value'] ?? ''),\n label: String(o[lk ?? 'label'] ?? o[vk ?? 'value'] ?? ''),\n count: typeof o['count'] === 'number' ? (o['count'] as number) : undefined,\n dot: typeof o['dot'] === 'string' ? (o['dot'] as string) : undefined,\n }));\n }\n\n protected asText(key: string): string {\n const v = this.value[key];\n return v === undefined || v === null ? '' : String(v);\n }\n\n protected range(key: string): { from: string; to: string } {\n const v = (this.value[key] ?? {}) as { from?: string; to?: string };\n return { from: v.from ?? '', to: v.to ?? '' };\n }\n\n protected isPicked(key: string, option: string): boolean {\n const v = this.value[key];\n return Array.isArray(v) ? v.includes(option) : false;\n }\n\n protected onSearch(f: TafFilterSpec, text: string): void {\n const wait = f.debounce ?? this.searchDebounce;\n if (this.timer) clearTimeout(this.timer);\n if (!wait) {\n this.set(f.key, text);\n return;\n }\n this.timer = setTimeout(() => this.set(f.key, text), wait);\n }\n\n protected toggleChip(key: string, option: string): void {\n const current = Array.isArray(this.value[key]) ? ([...(this.value[key] as string[])]) : [];\n const at = current.indexOf(option);\n if (at >= 0) current.splice(at, 1);\n else current.push(option);\n this.set(key, current);\n }\n\n protected setRange(key: string, edge: 'from' | 'to', text: string): void {\n this.set(key, { ...this.range(key), [edge]: text });\n }\n\n protected set(key: string, next: unknown): void {\n this.value = { ...this.value, [key]: next };\n this.changed.emit({ key, value: next });\n this.valueChange.emit(this.value);\n }\n\n protected clear(): void {\n const empty: TafFilterValue = {};\n for (const f of this.filters) {\n empty[f.key] =\n f.kind === 'chips' ? [] : f.kind === 'date-range' ? { from: '', to: '' } : f.kind === 'toggle' ? false : '';\n }\n this.value = empty;\n this.cleared.emit();\n this.valueChange.emit(this.value);\n }\n}\n\n/**\n * Everything `<taf-filter-bar>` needs, in one import: `imports: [...TAF_FILTER_BAR]`.\n * Importing the component alone leaves `[tafFilterBarStart]` / `[tafFilterBarEnd]` content\n * unprojected — it simply does not render, with no error.\n */\nexport const TAF_FILTER_BAR = [\n TafFilterBarComponent,\n TafFilterBarStartDirective,\n TafFilterBarEndDirective,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAiEA;AACoF;MAEvE,0BAA0B,CAAA;uGAA1B,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA,EAAE,QAAQ,EAAE,qBAAqB,EAAE,UAAU,EAAE,IAAI,EAAE;;AAGhE;MAEa,wBAAwB,C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AA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,QAAA,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,CAAA,cAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FA0JX,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBA7JjC,SAAS;+BACE,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,CAAC,EAAA,eAAA,EACN,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiJT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,oCAAA,CAAA,EAAA;;sBAQA;;sBACA;;sBAMA;;sBACA;;sBAEA;;sBAGA;;sBAEA;;sBAEA;;AA6FH;;;;AAIG;AACI,MAAM,cAAc,GAAG;IAC5B,qBAAqB;IACrB,0BAA0B;IAC1B,wBAAwB;;;AC9W1B;;AAEG;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jigisha_ruparel/taf-client-filter-bar-angular",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "<taf-filter-bar> — the themeless row of list filters: search, selects, chip groups, date ranges and Clear.",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -36,9 +36,26 @@ interface TafFilterSpec {
36
36
  * every option is a real value and which therefore always has one chosen.
37
37
  */
38
38
  allowEmpty?: boolean;
39
+ /**
40
+ * Let this control take the row's leftover width — a chip group that used to be the flexible
41
+ * element of a toolbar, so what follows it stays on the same line instead of wrapping.
42
+ */
43
+ grow?: boolean;
44
+ /**
45
+ * `'end'` pushes this filter — and everything after it — to the right edge. It is the row that
46
+ * reads as "these controls here, that one over there", which a single trailing slot cannot
47
+ * express because a filter can never be placed after it.
48
+ */
49
+ align?: 'start' | 'end';
39
50
  }
40
51
  /** The bar's current state: one entry per filter key. */
41
52
  type TafFilterValue = Record<string, unknown>;
53
+ /** Marks host content to place at the START of the bar, before the filters (a date navigator, a
54
+ * tab strip, a counts block) — the controls a row leads with rather than trails. */
55
+ declare class TafFilterBarStartDirective {
56
+ static ɵfac: i0.ɵɵFactoryDeclaration<TafFilterBarStartDirective, never>;
57
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TafFilterBarStartDirective, "[tafFilterBarStart]", never, {}, {}, never, never, true, never>;
58
+ }
42
59
  /** Marks host content to place at the end of the bar (an export button, a view switch). */
43
60
  declare class TafFilterBarEndDirective {
44
61
  static ɵfac: i0.ɵɵFactoryDeclaration<TafFilterBarEndDirective, never>;
@@ -101,8 +118,14 @@ declare class TafFilterBarComponent implements OnDestroy {
101
118
  protected set(key: string, next: unknown): void;
102
119
  protected clear(): void;
103
120
  static ɵfac: i0.ɵɵFactoryDeclaration<TafFilterBarComponent, never>;
104
- static ɵcmp: i0.ɵɵComponentDeclaration<TafFilterBarComponent, "taf-filter-bar", never, { "filters": { "alias": "filters"; "required": false; }; "value": { "alias": "value"; "required": false; }; "showClear": { "alias": "showClear"; "required": false; }; "clearLabel": { "alias": "clearLabel"; "required": false; }; "searchDebounce": { "alias": "searchDebounce"; "required": false; }; }, { "changed": "changed"; "valueChange": "valueChange"; "cleared": "cleared"; }, never, ["[tafFilterBarEnd]"], true, never>;
121
+ static ɵcmp: i0.ɵɵComponentDeclaration<TafFilterBarComponent, "taf-filter-bar", never, { "filters": { "alias": "filters"; "required": false; }; "value": { "alias": "value"; "required": false; }; "showClear": { "alias": "showClear"; "required": false; }; "clearLabel": { "alias": "clearLabel"; "required": false; }; "searchDebounce": { "alias": "searchDebounce"; "required": false; }; }, { "changed": "changed"; "valueChange": "valueChange"; "cleared": "cleared"; }, never, ["[tafFilterBarStart]", "[tafFilterBarEnd]"], true, never>;
105
122
  }
123
+ /**
124
+ * Everything `<taf-filter-bar>` needs, in one import: `imports: [...TAF_FILTER_BAR]`.
125
+ * Importing the component alone leaves `[tafFilterBarStart]` / `[tafFilterBarEnd]` content
126
+ * unprojected — it simply does not render, with no error.
127
+ */
128
+ declare const TAF_FILTER_BAR: readonly [typeof TafFilterBarComponent, typeof TafFilterBarStartDirective, typeof TafFilterBarEndDirective];
106
129
 
107
- export { TafFilterBarComponent, TafFilterBarEndDirective };
130
+ export { TAF_FILTER_BAR, TafFilterBarComponent, TafFilterBarEndDirective, TafFilterBarStartDirective };
108
131
  export type { TafFilterKind, TafFilterOption, TafFilterSpec, TafFilterValue };