@skyux/filter-bar 12.40.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.
Files changed (29) hide show
  1. package/README.md +7 -0
  2. package/fesm2022/skyux-filter-bar-testing.mjs +126 -0
  3. package/fesm2022/skyux-filter-bar-testing.mjs.map +1 -0
  4. package/fesm2022/skyux-filter-bar.mjs +498 -0
  5. package/fesm2022/skyux-filter-bar.mjs.map +1 -0
  6. package/index.d.ts +11 -0
  7. package/lib/modules/filter-bar/filter-bar.component.d.ts +24 -0
  8. package/lib/modules/filter-bar/filter-bar.module.d.ts +8 -0
  9. package/lib/modules/filter-bar/filter-bar.service.d.ts +28 -0
  10. package/lib/modules/filter-bar/filter-item-modal.component.d.ts +45 -0
  11. package/lib/modules/filter-bar/filter-item.token.d.ts +7 -0
  12. package/lib/modules/filter-bar/models/filter-bar-filter-item.d.ts +14 -0
  13. package/lib/modules/filter-bar/models/filter-bar-filter-value.d.ts +13 -0
  14. package/lib/modules/filter-bar/models/filter-bar-item.d.ts +19 -0
  15. package/lib/modules/filter-bar/models/filter-item-modal-context.d.ts +24 -0
  16. package/lib/modules/filter-bar/models/filter-item-modal-instance.d.ts +20 -0
  17. package/lib/modules/filter-bar/models/filter-item-modal-opened-args.d.ts +14 -0
  18. package/lib/modules/filter-bar/models/filter-item-modal-saved-args.d.ts +10 -0
  19. package/lib/modules/filter-bar/models/filter-item-modal-size.d.ts +1 -0
  20. package/lib/modules/filter-bar/models/filter-item-modal.d.ts +10 -0
  21. package/lib/modules/filter-bar/models/filter-item.d.ts +26 -0
  22. package/lib/modules/shared/sky-filter-bar-resources.module.d.ts +10 -0
  23. package/package.json +48 -0
  24. package/testing/index.d.ts +5 -0
  25. package/testing/modules/filter-bar/filter-bar-harness-filters.d.ts +6 -0
  26. package/testing/modules/filter-bar/filter-bar-harness.d.ts +48 -0
  27. package/testing/modules/filter-bar/filter-item-harness-filters.d.ts +14 -0
  28. package/testing/modules/filter-bar/filter-item-harness.d.ts +30 -0
  29. package/testing/public-api.d.ts +4 -0
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # filter-bar
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Running unit tests
6
+
7
+ Run `nx test filter-bar` to execute the unit tests.
@@ -0,0 +1,126 @@
1
+ import { SkyComponentHarness } from '@skyux/core/testing';
2
+ import { SkySelectionModalHarness } from '@skyux/lookup/testing';
3
+ import { HarnessPredicate } from '@angular/cdk/testing';
4
+
5
+ /**
6
+ * Harness to interact with a filter item component in tests.
7
+ */
8
+ class SkyFilterItemHarness extends SkyComponentHarness {
9
+ /**
10
+ * @internal
11
+ */
12
+ static { this.hostSelector = '.sky-filter-item'; }
13
+ #getButton = this.locatorFor('button.sky-filter-bar-btn');
14
+ #getFilterName = this.locatorFor('span.sky-filter-item-name');
15
+ #getFilterValue = this.locatorForOptional('span.sky-filter-item-value');
16
+ /**
17
+ * Gets a `HarnessPredicate` that can be used to search for a
18
+ * `SkyFilterBarItemHarness` that meets certain criteria.
19
+ */
20
+ static with(filters) {
21
+ return SkyFilterItemHarness.getDataSkyIdPredicate(filters)
22
+ .addOption('filterId', filters.filterId, async (harness, filterId) => {
23
+ const harnessId = await (await harness.#getButton()).getAttribute('data-filter-id');
24
+ return await HarnessPredicate.stringMatches(harnessId, filterId);
25
+ })
26
+ .addOption('labelText', filters.labelText, async (harness, labelText) => {
27
+ const harnessName = await harness.getLabelText();
28
+ return await HarnessPredicate.stringMatches(harnessName, labelText);
29
+ });
30
+ }
31
+ /**
32
+ * Clicks the filter item to open its modal.
33
+ */
34
+ async click() {
35
+ return await (await this.#getButton()).click();
36
+ }
37
+ /**
38
+ * Gets the filter item value.
39
+ */
40
+ async getFilterValue() {
41
+ return await (await this.#getFilterValue())?.text();
42
+ }
43
+ /**
44
+ * Gets the filter item label.
45
+ */
46
+ async getLabelText() {
47
+ return await (await this.#getFilterName()).text();
48
+ }
49
+ }
50
+
51
+ /**
52
+ * Harness for interacting with a filter bar component in tests.
53
+ */
54
+ class SkyFilterBarHarness extends SkyComponentHarness {
55
+ /**
56
+ * @internal
57
+ */
58
+ static { this.hostSelector = 'sky-filter-bar'; }
59
+ #documentRootLocator = this.documentRootLocatorFactory();
60
+ #getClearFiltersButton = this.locatorForOptional('.sky-filter-bar-clear-filters');
61
+ #getFilterPickerButton = this.locatorForOptional('.sky-filter-bar-filter-picker');
62
+ /**
63
+ * Gets a `HarnessPredicate` that can be used to search for a
64
+ * `SkyFilterBarHarness` that meets certain criteria.
65
+ */
66
+ static with(filters) {
67
+ return SkyFilterBarHarness.getDataSkyIdPredicate(filters);
68
+ }
69
+ /**
70
+ * Clicks the clear filters button.
71
+ */
72
+ async clickClearFilters() {
73
+ const button = await this.#getClearFiltersButton();
74
+ if (!button) {
75
+ throw new Error('Unable to find clear filters button because no filters are set');
76
+ }
77
+ await button.click();
78
+ }
79
+ /**
80
+ * Gets a specific filter item based on the filter criteria.
81
+ * @param filter The filter criteria.
82
+ */
83
+ async getItem(filter) {
84
+ return await this.locatorFor(SkyFilterItemHarness.with(filter))();
85
+ }
86
+ /**
87
+ * Gets an array of filter items based on the filter criteria.
88
+ * If no filter is provided, returns all filter items.
89
+ * @param filters The optional filter criteria.
90
+ */
91
+ async getItems(filters) {
92
+ return await this.locatorForAll(SkyFilterItemHarness.with(filters || {}))();
93
+ }
94
+ /**
95
+ * Checks if the filter bar has active filters.
96
+ */
97
+ async hasActiveFilters() {
98
+ const clearButton = await this.#getClearFiltersButton();
99
+ return !!clearButton;
100
+ }
101
+ /**
102
+ * Checks if the filter picker button is visible.
103
+ */
104
+ async hasFilterPicker() {
105
+ const pickerButton = await this.#getFilterPickerButton();
106
+ return !!pickerButton;
107
+ }
108
+ /**
109
+ * Clicks the filter picker button and returns a harness for the selection modal that it opened.
110
+ */
111
+ async openFilterPicker() {
112
+ const button = await this.#getFilterPickerButton();
113
+ if (!button) {
114
+ throw new Error('Filter picker button not found');
115
+ }
116
+ await button.click();
117
+ return await this.#documentRootLocator.locatorFor(SkySelectionModalHarness)();
118
+ }
119
+ }
120
+
121
+ /**
122
+ * Generated bundle index. Do not edit.
123
+ */
124
+
125
+ export { SkyFilterBarHarness, SkyFilterItemHarness };
126
+ //# sourceMappingURL=skyux-filter-bar-testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skyux-filter-bar-testing.mjs","sources":["../../../../../libs/components/filter-bar/testing/src/modules/filter-bar/filter-item-harness.ts","../../../../../libs/components/filter-bar/testing/src/modules/filter-bar/filter-bar-harness.ts","../../../../../libs/components/filter-bar/testing/src/skyux-filter-bar-testing.ts"],"sourcesContent":["import { HarnessPredicate } from '@angular/cdk/testing';\nimport { SkyComponentHarness } from '@skyux/core/testing';\n\nimport { SkyFilterItemHarnessFilters } from './filter-item-harness-filters';\n\n/**\n * Harness to interact with a filter item component in tests.\n */\nexport class SkyFilterItemHarness extends SkyComponentHarness {\n /**\n * @internal\n */\n public static hostSelector = '.sky-filter-item';\n\n #getButton = this.locatorFor('button.sky-filter-bar-btn');\n #getFilterName = this.locatorFor('span.sky-filter-item-name');\n #getFilterValue = this.locatorForOptional('span.sky-filter-item-value');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a\n * `SkyFilterBarItemHarness` that meets certain criteria.\n */\n public static with(\n filters: SkyFilterItemHarnessFilters,\n ): HarnessPredicate<SkyFilterItemHarness> {\n return SkyFilterItemHarness.getDataSkyIdPredicate(filters)\n .addOption('filterId', filters.filterId, async (harness, filterId) => {\n const harnessId = await (\n await harness.#getButton()\n ).getAttribute('data-filter-id');\n return await HarnessPredicate.stringMatches(harnessId, filterId);\n })\n .addOption('labelText', filters.labelText, async (harness, labelText) => {\n const harnessName = await harness.getLabelText();\n return await HarnessPredicate.stringMatches(harnessName, labelText);\n });\n }\n\n /**\n * Clicks the filter item to open its modal.\n */\n public async click(): Promise<void> {\n return await (await this.#getButton()).click();\n }\n\n /**\n * Gets the filter item value.\n */\n public async getFilterValue(): Promise<string | undefined> {\n return await (await this.#getFilterValue())?.text();\n }\n\n /**\n * Gets the filter item label.\n */\n public async getLabelText(): Promise<string> {\n return await (await this.#getFilterName()).text();\n }\n}\n","import { HarnessPredicate } from '@angular/cdk/testing';\nimport { SkyComponentHarness } from '@skyux/core/testing';\nimport { SkySelectionModalHarness } from '@skyux/lookup/testing';\n\nimport { SkyFilterBarHarnessFilters } from './filter-bar-harness-filters';\nimport { SkyFilterItemHarness } from './filter-item-harness';\nimport { SkyFilterItemHarnessFilters } from './filter-item-harness-filters';\n\n/**\n * Harness for interacting with a filter bar component in tests.\n */\nexport class SkyFilterBarHarness extends SkyComponentHarness {\n /**\n * @internal\n */\n public static hostSelector = 'sky-filter-bar';\n\n #documentRootLocator = this.documentRootLocatorFactory();\n\n #getClearFiltersButton = this.locatorForOptional(\n '.sky-filter-bar-clear-filters',\n );\n #getFilterPickerButton = this.locatorForOptional(\n '.sky-filter-bar-filter-picker',\n );\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a\n * `SkyFilterBarHarness` that meets certain criteria.\n */\n public static with(\n filters: SkyFilterBarHarnessFilters,\n ): HarnessPredicate<SkyFilterBarHarness> {\n return SkyFilterBarHarness.getDataSkyIdPredicate(filters);\n }\n\n /**\n * Clicks the clear filters button.\n */\n public async clickClearFilters(): Promise<void> {\n const button = await this.#getClearFiltersButton();\n if (!button) {\n throw new Error(\n 'Unable to find clear filters button because no filters are set',\n );\n }\n await button.click();\n }\n\n /**\n * Gets a specific filter item based on the filter criteria.\n * @param filter The filter criteria.\n */\n public async getItem(\n filter: SkyFilterItemHarnessFilters,\n ): Promise<SkyFilterItemHarness> {\n return await this.locatorFor(SkyFilterItemHarness.with(filter))();\n }\n\n /**\n * Gets an array of filter items based on the filter criteria.\n * If no filter is provided, returns all filter items.\n * @param filters The optional filter criteria.\n */\n public async getItems(\n filters?: SkyFilterItemHarnessFilters,\n ): Promise<SkyFilterItemHarness[]> {\n return await this.locatorForAll(SkyFilterItemHarness.with(filters || {}))();\n }\n\n /**\n * Checks if the filter bar has active filters.\n */\n public async hasActiveFilters(): Promise<boolean> {\n const clearButton = await this.#getClearFiltersButton();\n return !!clearButton;\n }\n\n /**\n * Checks if the filter picker button is visible.\n */\n public async hasFilterPicker(): Promise<boolean> {\n const pickerButton = await this.#getFilterPickerButton();\n return !!pickerButton;\n }\n\n /**\n * Clicks the filter picker button and returns a harness for the selection modal that it opened.\n */\n public async openFilterPicker(): Promise<SkySelectionModalHarness> {\n const button = await this.#getFilterPickerButton();\n if (!button) {\n throw new Error('Filter picker button not found');\n }\n await button.click();\n\n return await this.#documentRootLocator.locatorFor(\n SkySelectionModalHarness,\n )();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAKA;;AAEG;AACG,MAAO,oBAAqB,SAAQ,mBAAmB,CAAA;AAC3D;;AAEG;aACW,IAAA,CAAA,YAAY,GAAG,kBAAkB,CAAC;AAEhD,IAAA,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC;AACzD,IAAA,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC;AAC7D,IAAA,eAAe,GAAG,IAAI,CAAC,kBAAkB,CAAC,4BAA4B,CAAC;AAEvE;;;AAGG;IACI,OAAO,IAAI,CAChB,OAAoC,EAAA;AAEpC,QAAA,OAAO,oBAAoB,CAAC,qBAAqB,CAAC,OAAO;AACtD,aAAA,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,OAAO,EAAE,QAAQ,KAAI;AACnE,YAAA,MAAM,SAAS,GAAG,MAAM,CACtB,MAAM,OAAO,CAAC,UAAU,EAAE,EAC1B,YAAY,CAAC,gBAAgB,CAAC;YAChC,OAAO,MAAM,gBAAgB,CAAC,aAAa,CAAC,SAAS,EAAE,QAAQ,CAAC;AAClE,SAAC;AACA,aAAA,SAAS,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,EAAE,OAA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AAA,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE;;AAGnE;;;;AAIG;IACI,MAAM,QAAQ,CACnB,OAAqC,EAAA;AAErC,QAAA,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,EAAE;;AAG7E;;AAEG;AACI,IAAA,MAAM,gBAAgB,GAAA;AAC3B,QAAA,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,sBAAsB,EAAE;QACvD,OAAO,CAAC,CAAC,WAAW;;AAGtB;;AAEG;AACI,IAAA,MAAM,eAAe,GAAA;AAC1B,QAAA,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,sBAAsB,EAAE;QACxD,OAAO,CAAC,CAAC,YAAY;;AAGvB;;AAEG;AACI,IAAA,MAAM,gBAAgB,GAAA;AAC3B,QAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,sBAAsB,EAAE;QAClD,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC;;AAEnD,QAAA,MAAM,MAAM,CAAC,KAAK,EAAE;QAEpB,OAAO,MAAM,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAC/C,wBAAwB,CACzB,EAAE;;;;AClGP;;AAEG;;;;"}
@@ -0,0 +1,498 @@
1
+ import * as i0 from '@angular/core';
2
+ import { NgModule, Injectable, InjectionToken, model, contentChildren, computed, inject, effect, untracked, Component, input, EventEmitter, viewChild, TemplateRef, EnvironmentInjector, Injector, runInInjectionContext, DestroyRef, Output } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
+ import { CommonModule, NgTemplateOutlet } from '@angular/common';
5
+ import { toSignal, toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
+ import * as i2 from '@skyux/i18n';
7
+ import { SkyLibResourcesService, SkyI18nModule } from '@skyux/i18n';
8
+ import * as i3 from '@skyux/icon';
9
+ import { SkyIconModule } from '@skyux/icon';
10
+ import * as i4 from '@skyux/layout';
11
+ import { SkyToolbarModule } from '@skyux/layout';
12
+ import { SkySelectionModalService } from '@skyux/lookup';
13
+ import { SkyConfirmService, SkyConfirmType, SkyModalService } from '@skyux/modals';
14
+ import { Subject, ReplaySubject, filter, map, of } from 'rxjs';
15
+ import { switchMap, take } from 'rxjs/operators';
16
+
17
+ /* istanbul ignore file */
18
+ /**
19
+ * NOTICE: DO NOT MODIFY THIS FILE!
20
+ * The contents of this file were automatically generated by
21
+ * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-filter-bar' schematic.
22
+ * To update this file, simply rerun the command.
23
+ */
24
+ const RESOURCES = {
25
+ 'EN-US': {
26
+ skyux_filter_bar_clear_filters_confirm_apply_label: {
27
+ message: 'Clear values',
28
+ },
29
+ skyux_filter_bar_clear_filters_confirm_body: {
30
+ message: 'This will not remove any filters, but any values you have set will be removed.',
31
+ },
32
+ skyux_filter_bar_clear_filters_confirm_cancel_label: { message: 'Cancel' },
33
+ skyux_filter_bar_clear_filters_confirm_title: {
34
+ message: 'Are you sure you want to reset all filters to their original values?',
35
+ },
36
+ skyux_filter_bar_clear_filters_label: { message: 'Clear all values' },
37
+ skyux_filter_bar_filter_label: { message: 'Filters' },
38
+ skyux_filter_bar_filter_picker_descriptor: { message: 'filters' },
39
+ skyux_filter_item_n_selected: { message: '{0} selected' },
40
+ },
41
+ };
42
+ SkyLibResourcesService.addResources(RESOURCES);
43
+ /**
44
+ * Import into any component library module that needs to use resource strings.
45
+ */
46
+ class SkyFilterBarResourcesModule {
47
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SkyFilterBarResourcesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
48
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: SkyFilterBarResourcesModule, exports: [SkyI18nModule] }); }
49
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SkyFilterBarResourcesModule, imports: [SkyI18nModule] }); }
50
+ }
51
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SkyFilterBarResourcesModule, decorators: [{
52
+ type: NgModule,
53
+ args: [{
54
+ exports: [SkyI18nModule],
55
+ }]
56
+ }] });
57
+
58
+ /**
59
+ * Service for filter items to emit value changes to the filter bar.
60
+ * @internal
61
+ */
62
+ class SkyFilterBarService {
63
+ constructor() {
64
+ this.#filterItemUpdates = new Subject();
65
+ this.#filterValueUpdates = new ReplaySubject();
66
+ /**
67
+ * Observable stream of filter item updates.
68
+ */
69
+ this.filterItemUpdated = this.#filterItemUpdates.asObservable();
70
+ }
71
+ #filterItemUpdates;
72
+ #filterValueUpdates;
73
+ /**
74
+ * Filtered observable stream of filter value updates.
75
+ * @param filterId the
76
+ * @returns
77
+ */
78
+ getFilterValueUpdates(filterId) {
79
+ return this.#filterValueUpdates.pipe(filter((update) => update.filterId === filterId), map((item) => item.filterValue));
80
+ }
81
+ /**
82
+ * Emit a filter value update.
83
+ */
84
+ updateFilter(filter) {
85
+ this.#filterItemUpdates.next(filter);
86
+ }
87
+ updateFilters(filters) {
88
+ for (const filter of filters) {
89
+ this.#filterValueUpdates.next(filter);
90
+ }
91
+ }
92
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SkyFilterBarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
93
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SkyFilterBarService }); }
94
+ }
95
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SkyFilterBarService, decorators: [{
96
+ type: Injectable
97
+ }] });
98
+
99
+ /**
100
+ * A token for filter bar items.
101
+ * @internal
102
+ */
103
+ const SKY_FILTER_ITEM = new InjectionToken('SKY_FILTER_ITEM');
104
+
105
+ /**
106
+ * The top-level filter bar component.
107
+ */
108
+ class SkyFilterBarComponent {
109
+ #confirmSvc;
110
+ #filterBarSvc;
111
+ #filterUpdated;
112
+ #modalSvc;
113
+ #resourceSvc;
114
+ #strings;
115
+ constructor() {
116
+ /**
117
+ * An array of filter items containing the IDs and values of the filters that have been set.
118
+ */
119
+ this.appliedFilters = model();
120
+ /**
121
+ * An array of filter IDs that the user has selected using the built-in selection modal. Setting this input to undefined results in all filters being displayed.
122
+ */
123
+ this.selectedFilterIds = model();
124
+ this.filterItems = contentChildren(SKY_FILTER_ITEM);
125
+ this.visibleFilters = computed(() => {
126
+ const items = this.filterItems();
127
+ const selectedFilters = this.selectedFilterIds();
128
+ const visibleFilters = [];
129
+ if (items) {
130
+ if (selectedFilters) {
131
+ for (const id of selectedFilters) {
132
+ visibleFilters.push(items.find((item) => item.filterId() === id));
133
+ }
134
+ }
135
+ else {
136
+ for (const item of items) {
137
+ visibleFilters.push(item);
138
+ }
139
+ }
140
+ }
141
+ return visibleFilters.filter((item) => !!item);
142
+ });
143
+ this.#confirmSvc = inject(SkyConfirmService);
144
+ this.#filterBarSvc = inject(SkyFilterBarService);
145
+ this.#filterUpdated = toSignal(this.#filterBarSvc.filterItemUpdated);
146
+ this.#modalSvc = inject(SkySelectionModalService);
147
+ this.#resourceSvc = inject(SkyLibResourcesService);
148
+ this.#strings = toSignal(this.#resourceSvc.getStrings({
149
+ descriptor: 'skyux_filter_bar_filter_picker_descriptor',
150
+ title: 'skyux_filter_bar_clear_filters_confirm_title',
151
+ body: 'skyux_filter_bar_clear_filters_confirm_body',
152
+ save: 'skyux_filter_bar_clear_filters_confirm_apply_label',
153
+ cancel: 'skyux_filter_bar_clear_filters_confirm_cancel_label',
154
+ }));
155
+ /* istanbul ignore next */
156
+ this.#filterAsyncSearchFn = (args) => {
157
+ const items = this.filterItems().map((item) => ({
158
+ filterId: item.filterId(),
159
+ labelText: item.labelText(),
160
+ }));
161
+ const results = args.searchText
162
+ ? items.filter((item) => item.labelText
163
+ .toLocaleUpperCase()
164
+ .includes(args.searchText.toLocaleUpperCase()))
165
+ : items;
166
+ return of({
167
+ items: results,
168
+ totalCount: items.length,
169
+ });
170
+ };
171
+ // Subscribe to filter value updates from child filter items
172
+ effect(() => {
173
+ const updatedFilter = this.#filterUpdated();
174
+ if (updatedFilter) {
175
+ this.#updateFilter(updatedFilter);
176
+ }
177
+ });
178
+ // Push filter value updates to child filter items
179
+ effect(() => {
180
+ const filters = this.appliedFilters();
181
+ this.#updateFilters(filters);
182
+ });
183
+ }
184
+ openFilters() {
185
+ const strings = this.#strings();
186
+ const existingFilters = this.#getExistingFilterItems();
187
+ /* istanbul ignore if: safety check */
188
+ if (!strings) {
189
+ return;
190
+ }
191
+ const filterArgs = {
192
+ selectionDescriptor: strings.descriptor,
193
+ descriptorProperty: 'labelText',
194
+ idProperty: 'filterId',
195
+ selectMode: 'multiple',
196
+ value: existingFilters,
197
+ searchAsync: this.#filterAsyncSearchFn,
198
+ };
199
+ const modalInstance = this.#modalSvc.open(filterArgs);
200
+ modalInstance.closed.subscribe((closeArgs) => {
201
+ if (closeArgs.reason === 'save') {
202
+ this.#handleFilterSelection(closeArgs.selectedItems, existingFilters);
203
+ }
204
+ });
205
+ }
206
+ clearFilters() {
207
+ const strings = this.#strings();
208
+ /* istanbul ignore if: safety check */
209
+ if (!strings) {
210
+ return;
211
+ }
212
+ const config = {
213
+ message: strings.title,
214
+ body: strings.body,
215
+ type: SkyConfirmType.Custom,
216
+ buttons: [
217
+ {
218
+ action: 'save',
219
+ text: strings.save,
220
+ styleType: 'primary',
221
+ },
222
+ {
223
+ action: 'cancel',
224
+ text: strings.cancel,
225
+ styleType: 'link',
226
+ },
227
+ ],
228
+ };
229
+ const instance = this.#confirmSvc.open(config);
230
+ instance.closed.subscribe((result) => {
231
+ if (result.action === 'save') {
232
+ this.appliedFilters.set(undefined);
233
+ }
234
+ });
235
+ }
236
+ #getExistingFilterItems() {
237
+ /* istanbul ignore next: safety check */
238
+ const selectedIds = this.selectedFilterIds() ?? [];
239
+ return this.filterItems()
240
+ .filter((item) => selectedIds.includes(item.filterId()))
241
+ .map((item) => ({
242
+ filterId: item.filterId(),
243
+ labelText: item.labelText(),
244
+ filterValue: item.filterValue(),
245
+ }));
246
+ }
247
+ #handleFilterSelection(selectedFilters, existingFilters) {
248
+ const { newFilterItems, removedFilterItems } = this.#processFilterChanges(selectedFilters, existingFilters);
249
+ const selectedIds = newFilterItems.map((item) => item.filterId);
250
+ this.selectedFilterIds.set(selectedIds);
251
+ if (removedFilterItems.length) {
252
+ this.#updateFilters(removedFilterItems);
253
+ const newFilters = newFilterItems.filter((filter) => !!filter.filterValue);
254
+ this.appliedFilters.set(newFilters.length ? newFilters : undefined);
255
+ }
256
+ }
257
+ #processFilterChanges(selectedFilters, existingFilters) {
258
+ const newFilterItems = [];
259
+ const removedFilterItems = [];
260
+ // Process existing filters
261
+ for (const existingFilter of existingFilters) {
262
+ if (this.#isFilterSelected(existingFilter.filterId, selectedFilters)) {
263
+ newFilterItems.push({
264
+ filterId: existingFilter.filterId,
265
+ filterValue: existingFilter.filterValue,
266
+ });
267
+ }
268
+ else {
269
+ removedFilterItems.push({ filterId: existingFilter.filterId });
270
+ }
271
+ }
272
+ // Add newly selected filters
273
+ if (selectedFilters) {
274
+ for (const selectedFilter of selectedFilters) {
275
+ if (!this.#isFilterInList(selectedFilter.filterId, newFilterItems)) {
276
+ newFilterItems.push({ filterId: selectedFilter.filterId });
277
+ }
278
+ }
279
+ }
280
+ return { newFilterItems, removedFilterItems };
281
+ }
282
+ #isFilterSelected(filterId, selectedFilters) {
283
+ return !!selectedFilters?.find((selectedFilter) => selectedFilter.filterId === filterId);
284
+ }
285
+ #isFilterInList(filterId, filterList) {
286
+ return !!filterList.find((filter) => filter.filterId === filterId);
287
+ }
288
+ /* istanbul ignore next */
289
+ #filterAsyncSearchFn;
290
+ #updateFilter(updatedFilter) {
291
+ const filters = untracked(() => this.appliedFilters()) ?? [];
292
+ const newFilterValues = [];
293
+ let replaceFilter = false;
294
+ for (const filterValue of filters) {
295
+ if (filterValue.filterId === updatedFilter.filterId) {
296
+ if (updatedFilter.filterValue) {
297
+ newFilterValues.push(updatedFilter);
298
+ }
299
+ replaceFilter = true;
300
+ }
301
+ else {
302
+ newFilterValues.push(filterValue);
303
+ }
304
+ }
305
+ if (!replaceFilter && updatedFilter.filterValue) {
306
+ newFilterValues.push(updatedFilter);
307
+ }
308
+ this.appliedFilters.set(newFilterValues.length ? newFilterValues : undefined);
309
+ }
310
+ #updateFilters(updatedFilters) {
311
+ if (updatedFilters) {
312
+ this.#filterBarSvc.updateFilters(updatedFilters);
313
+ }
314
+ else {
315
+ this.#filterBarSvc.updateFilters(untracked(() => this.filterItems()).map((filterItem) => ({
316
+ filterId: filterItem.filterId(),
317
+ })));
318
+ }
319
+ }
320
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SkyFilterBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
321
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: SkyFilterBarComponent, isStandalone: true, selector: "sky-filter-bar", inputs: { appliedFilters: { classPropertyName: "appliedFilters", publicName: "appliedFilters", isSignal: true, isRequired: false, transformFunction: null }, selectedFilterIds: { classPropertyName: "selectedFilterIds", publicName: "selectedFilterIds", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { appliedFilters: "appliedFiltersChange", selectedFilterIds: "selectedFilterIdsChange" }, providers: [SkyFilterBarService], queries: [{ propertyName: "filterItems", predicate: SKY_FILTER_ITEM, isSignal: true }], ngImport: i0, template: "<sky-toolbar class=\"sky-filter-bar-toolbar\">\n <sky-toolbar-item>\n <span class=\"sky-font-data-label\">{{\n 'skyux_filter_bar_filter_label' | skyLibResources\n }}</span>\n </sky-toolbar-item>\n @if (!!selectedFilterIds()) {\n <sky-toolbar-item>\n <button\n type=\"button\"\n class=\"sky-filter-bar-filter-picker sky-btn sky-filter-bar-btn sky-btn-default sky-btn-icon\"\n (click)=\"openFilters()\"\n >\n <sky-icon iconName=\"filter\" />\n </button>\n </sky-toolbar-item>\n }\n @for (filter of visibleFilters(); track filter.filterId()) {\n <sky-toolbar-item>\n <ng-container *ngTemplateOutlet=\"filter.templateRef() ?? null\" />\n </sky-toolbar-item>\n }\n @if (!!appliedFilters()) {\n <sky-toolbar-item>\n <button\n type=\"button\"\n class=\"sky-filter-bar-clear-filters sky-btn sky-filter-bar-btn sky-btn-link\"\n (click)=\"clearFilters()\"\n >\n {{ 'skyux_filter_bar_clear_filters_label' | skyLibResources }}\n </button>\n </sky-toolbar-item>\n }\n</sky-toolbar>\n", styles: [":host{display:block}:host-context(.sky-theme-modern) .sky-filter-bar-toolbar{--sky-override-toolbar-container-padding: var( --sky-comp-filter_bar-space-inset-top ) var(--sky-comp-filter_bar-space-inset-right) var(--sky-comp-filter_bar-space-inset-bottom) var(--sky-comp-filter_bar-space-inset-left)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: SkyFilterBarResourcesModule }, { kind: "pipe", type: i2.SkyLibResourcesPipe, name: "skyLibResources" }, { kind: "ngmodule", type: SkyIconModule }, { kind: "component", type: i3.λ1, selector: "sky-icon", inputs: ["icon", "iconName", "iconType", "size", "fixedWidth", "variant", "iconSize"] }, { kind: "ngmodule", type: SkyToolbarModule }, { kind: "component", type: i4.λ37, selector: "sky-toolbar", inputs: ["listDescriptor"] }, { kind: "component", type: i4.λ39, selector: "sky-toolbar-item" }] }); }
322
+ }
323
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SkyFilterBarComponent, decorators: [{
324
+ type: Component,
325
+ args: [{ selector: 'sky-filter-bar', imports: [
326
+ CommonModule,
327
+ NgTemplateOutlet,
328
+ SkyFilterBarResourcesModule,
329
+ SkyIconModule,
330
+ SkyToolbarModule,
331
+ ], providers: [SkyFilterBarService], template: "<sky-toolbar class=\"sky-filter-bar-toolbar\">\n <sky-toolbar-item>\n <span class=\"sky-font-data-label\">{{\n 'skyux_filter_bar_filter_label' | skyLibResources\n }}</span>\n </sky-toolbar-item>\n @if (!!selectedFilterIds()) {\n <sky-toolbar-item>\n <button\n type=\"button\"\n class=\"sky-filter-bar-filter-picker sky-btn sky-filter-bar-btn sky-btn-default sky-btn-icon\"\n (click)=\"openFilters()\"\n >\n <sky-icon iconName=\"filter\" />\n </button>\n </sky-toolbar-item>\n }\n @for (filter of visibleFilters(); track filter.filterId()) {\n <sky-toolbar-item>\n <ng-container *ngTemplateOutlet=\"filter.templateRef() ?? null\" />\n </sky-toolbar-item>\n }\n @if (!!appliedFilters()) {\n <sky-toolbar-item>\n <button\n type=\"button\"\n class=\"sky-filter-bar-clear-filters sky-btn sky-filter-bar-btn sky-btn-link\"\n (click)=\"clearFilters()\"\n >\n {{ 'skyux_filter_bar_clear_filters_label' | skyLibResources }}\n </button>\n </sky-toolbar-item>\n }\n</sky-toolbar>\n", styles: [":host{display:block}:host-context(.sky-theme-modern) .sky-filter-bar-toolbar{--sky-override-toolbar-container-padding: var( --sky-comp-filter_bar-space-inset-top ) var(--sky-comp-filter_bar-space-inset-right) var(--sky-comp-filter_bar-space-inset-bottom) var(--sky-comp-filter_bar-space-inset-left)}\n"] }]
332
+ }], ctorParameters: () => [] });
333
+
334
+ /**
335
+ * The context object that is provided to a filter modal.
336
+ */
337
+ class SkyFilterItemModalContext {
338
+ constructor(args) {
339
+ this.filterLabelText = args.filterLabelText;
340
+ this.filterValue = args.filterValue;
341
+ this.additionalContext = args.additionalContext;
342
+ }
343
+ }
344
+
345
+ /**
346
+ * A specialized `SkyModalInstance` wrapper.
347
+ */
348
+ class SkyFilterItemModalInstance {
349
+ }
350
+
351
+ /**
352
+ * A filter bar item that opens a modal for complex filter configuration.
353
+ * Use this component when your filter requires a rich UI with multiple inputs,
354
+ * date pickers, or other complex controls that don't fit in an inline filter.
355
+ */
356
+ class SkyFilterItemModalComponent {
357
+ constructor() {
358
+ /**
359
+ * A unique identifier for the filter item.
360
+ * @required
361
+ */
362
+ this.filterId = input.required();
363
+ /**
364
+ * The label to display for the filter item.
365
+ * @required
366
+ */
367
+ this.labelText = input.required();
368
+ /**
369
+ * The modal component to display when the user selects the filter.
370
+ * The component needs to inject a `SkyFilterItemModalInstance` object on instantiation to receive the modal instance and context from the modal service.
371
+ * The return value of the modal save action needs to be a `SkyFilterBarFilterValue`.
372
+ * @required
373
+ */
374
+ this.modalComponent = input.required();
375
+ /**
376
+ * The size of the modal to display. The valid options are `"small"`, `"medium"`, `"large"`, and `"fullScreen"`.
377
+ */
378
+ this.modalSize = input.required();
379
+ /**
380
+ * Fires when the user clicks the filter item. To pass additional context data to a filter modal, consumers
381
+ * must subscribe to this event and return the context using the observable property on the event args.
382
+ */
383
+ this.modalOpened = new EventEmitter();
384
+ this.templateRef = viewChild((TemplateRef));
385
+ this.#environmentInjector = inject(EnvironmentInjector);
386
+ this.#modalSvc = inject(SkyModalService);
387
+ this.#filterBarSvc = inject(SkyFilterBarService);
388
+ this.filterValue = toSignal(toObservable(this.filterId).pipe(switchMap((filterId) => this.#filterBarSvc.getFilterValueUpdates(filterId))));
389
+ }
390
+ #environmentInjector;
391
+ #modalSvc;
392
+ #filterBarSvc;
393
+ openFilter() {
394
+ const modalComponent = this.modalComponent();
395
+ const modalSize = this.modalSize();
396
+ const labelText = this.labelText();
397
+ const filterValue = this.filterValue();
398
+ this.#openFilterCallback().subscribe((additionalContext) => {
399
+ const context = new SkyFilterItemModalContext({
400
+ filterLabelText: labelText,
401
+ filterValue,
402
+ additionalContext,
403
+ });
404
+ const injector = Injector.create({
405
+ parent: this.#environmentInjector,
406
+ providers: [{ provide: SkyFilterItemModalContext, useValue: context }],
407
+ });
408
+ runInInjectionContext(injector, () => {
409
+ const destroyRef = injector.get(DestroyRef);
410
+ const saved = new Subject();
411
+ const canceled = new Subject();
412
+ const context = inject(SkyFilterItemModalContext);
413
+ const filterModalInstance = {
414
+ context,
415
+ cancel() {
416
+ canceled.next();
417
+ canceled.complete();
418
+ },
419
+ save(result) {
420
+ saved.next(result);
421
+ saved.complete();
422
+ },
423
+ };
424
+ canceled
425
+ .pipe(takeUntilDestroyed(destroyRef))
426
+ .subscribe(() => instance.cancel());
427
+ saved
428
+ .pipe(takeUntilDestroyed(destroyRef))
429
+ .subscribe((result) => instance.save(result.filterValue));
430
+ const modalConfig = {
431
+ providers: [
432
+ {
433
+ provide: SkyFilterItemModalInstance,
434
+ useValue: filterModalInstance,
435
+ },
436
+ ],
437
+ };
438
+ if (modalSize === 'fullScreen') {
439
+ modalConfig.fullPage = true;
440
+ }
441
+ else {
442
+ modalConfig.size = modalSize;
443
+ }
444
+ const instance = this.#modalSvc.open(modalComponent, modalConfig);
445
+ instance.closed.subscribe((args) => {
446
+ if (args.reason === 'save') {
447
+ this.#filterBarSvc.updateFilter({
448
+ filterId: this.filterId(),
449
+ filterValue: args.data,
450
+ });
451
+ }
452
+ });
453
+ });
454
+ });
455
+ }
456
+ #openFilterCallback() {
457
+ if (this.modalOpened.observed) {
458
+ const args = {
459
+ filterId: this.filterId(),
460
+ };
461
+ this.modalOpened.emit(args);
462
+ return args.data?.pipe(take(1)) || of(undefined);
463
+ }
464
+ return of(undefined);
465
+ }
466
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SkyFilterItemModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
467
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: SkyFilterItemModalComponent, isStandalone: true, selector: "sky-filter-item-modal", inputs: { filterId: { classPropertyName: "filterId", publicName: "filterId", isSignal: true, isRequired: true, transformFunction: null }, labelText: { classPropertyName: "labelText", publicName: "labelText", isSignal: true, isRequired: true, transformFunction: null }, modalComponent: { classPropertyName: "modalComponent", publicName: "modalComponent", isSignal: true, isRequired: true, transformFunction: null }, modalSize: { classPropertyName: "modalSize", publicName: "modalSize", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { modalOpened: "modalOpened" }, providers: [
468
+ { provide: SKY_FILTER_ITEM, useExisting: SkyFilterItemModalComponent },
469
+ ], viewQueries: [{ propertyName: "templateRef", first: true, predicate: (TemplateRef), descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #templateRef>\n @let value = filterValue();\n <div class=\"sky-filter-item sky-filter-item-modal\">\n <button\n aria-haspopup=\"dialog\"\n class=\"sky-btn sky-filter-bar-btn sky-btn-default\"\n type=\"button\"\n [attr.aria-pressed]=\"!!value\"\n [attr.data-filter-id]=\"filterId()\"\n [class.sky-filter-bar-btn-selected]=\"!!value\"\n (click)=\"openFilter()\"\n >\n <span class=\"sky-filter-item-title\"\n ><span class=\"sky-filter-item-name\">{{ labelText() }}</span>\n @if (value) {\n <span>:</span>\n }\n </span>\n @if (value) {\n <span class=\"sky-filter-item-value\">{{\n value.displayValue ?? value.value\n }}</span>\n }\n <span class=\"sky-filter-item-caret\">\n <sky-icon iconName=\"chevron-down\" />\n </span>\n </button>\n </div>\n</ng-template>\n", styles: [".sky-filter-item:not(.sky-theme-modern *){--sky-override-filter-bar-button-gap-spacing: 10px;--sky-override-filter-bar-button-selected-background-color: #c1e8fb}::ng-deep .sky-theme-modern:not(.sky-theme-brand-base) .sky-filter-item{--sky-override-filter-bar-button-border-selected: inset 0 0 0 var(--sky-border-width-action-base) var(--sky-color-border-selected)}.sky-filter-bar-btn{display:flex;max-width:300px}.sky-filter-item-title,.sky-filter-item-value{margin-right:var(--sky-override-filter-bar-button-gap-spacing, var(--sky-space-gap-action_group-m))}.sky-filter-item-value{flex-shrink:1;overflow:hidden;text-overflow:ellipsis}.sky-filter-item-caret{flex-grow:1}.sky-filter-bar-btn.sky-filter-bar-btn-selected:not(:hover,:focus-visible,:active,:disabled){box-shadow:var(--sky-override-filter-bar-button-border-selected, inset 0 0 0 var(--sky-border-width-action-base) var(--sky-color-border-selected_soft))}.sky-filter-bar-btn.sky-filter-bar-btn-selected,.sky-filter-bar-btn.sky-filter-bar-btn-selected:hover,.sky-filter-bar-btn.sky-filter-bar-btn-selected:focus-visible,.sky-filter-bar-btn.sky-filter-bar-btn-selected:active,.sky-filter-bar-btn.sky-filter-bar-btn-selected:not(:disabled){background-color:var(--sky-override-filter-bar-button-selected-background-color, var(--sky-color-background-selected-soft))}.sky-filter-bar-btn.sky-filter-bar-btn-selected .sky-filter-item-title{color:var(--sky-color-text-deemphasized)}.sky-filter-bar-btn.sky-filter-bar-btn-selected .sky-filter-item-value,.sky-filter-bar-btn.sky-filter-bar-btn-selected .sky-filter-item-caret{color:var(--sky-color-text-action);font-weight:var(--sky-font-style-emphasized)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: SkyIconModule }, { kind: "component", type: i3.λ1, selector: "sky-icon", inputs: ["icon", "iconName", "iconType", "size", "fixedWidth", "variant", "iconSize"] }] }); }
470
+ }
471
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SkyFilterItemModalComponent, decorators: [{
472
+ type: Component,
473
+ args: [{ selector: 'sky-filter-item-modal', imports: [CommonModule, SkyIconModule], providers: [
474
+ { provide: SKY_FILTER_ITEM, useExisting: SkyFilterItemModalComponent },
475
+ ], template: "<ng-template #templateRef>\n @let value = filterValue();\n <div class=\"sky-filter-item sky-filter-item-modal\">\n <button\n aria-haspopup=\"dialog\"\n class=\"sky-btn sky-filter-bar-btn sky-btn-default\"\n type=\"button\"\n [attr.aria-pressed]=\"!!value\"\n [attr.data-filter-id]=\"filterId()\"\n [class.sky-filter-bar-btn-selected]=\"!!value\"\n (click)=\"openFilter()\"\n >\n <span class=\"sky-filter-item-title\"\n ><span class=\"sky-filter-item-name\">{{ labelText() }}</span>\n @if (value) {\n <span>:</span>\n }\n </span>\n @if (value) {\n <span class=\"sky-filter-item-value\">{{\n value.displayValue ?? value.value\n }}</span>\n }\n <span class=\"sky-filter-item-caret\">\n <sky-icon iconName=\"chevron-down\" />\n </span>\n </button>\n </div>\n</ng-template>\n", styles: [".sky-filter-item:not(.sky-theme-modern *){--sky-override-filter-bar-button-gap-spacing: 10px;--sky-override-filter-bar-button-selected-background-color: #c1e8fb}::ng-deep .sky-theme-modern:not(.sky-theme-brand-base) .sky-filter-item{--sky-override-filter-bar-button-border-selected: inset 0 0 0 var(--sky-border-width-action-base) var(--sky-color-border-selected)}.sky-filter-bar-btn{display:flex;max-width:300px}.sky-filter-item-title,.sky-filter-item-value{margin-right:var(--sky-override-filter-bar-button-gap-spacing, var(--sky-space-gap-action_group-m))}.sky-filter-item-value{flex-shrink:1;overflow:hidden;text-overflow:ellipsis}.sky-filter-item-caret{flex-grow:1}.sky-filter-bar-btn.sky-filter-bar-btn-selected:not(:hover,:focus-visible,:active,:disabled){box-shadow:var(--sky-override-filter-bar-button-border-selected, inset 0 0 0 var(--sky-border-width-action-base) var(--sky-color-border-selected_soft))}.sky-filter-bar-btn.sky-filter-bar-btn-selected,.sky-filter-bar-btn.sky-filter-bar-btn-selected:hover,.sky-filter-bar-btn.sky-filter-bar-btn-selected:focus-visible,.sky-filter-bar-btn.sky-filter-bar-btn-selected:active,.sky-filter-bar-btn.sky-filter-bar-btn-selected:not(:disabled){background-color:var(--sky-override-filter-bar-button-selected-background-color, var(--sky-color-background-selected-soft))}.sky-filter-bar-btn.sky-filter-bar-btn-selected .sky-filter-item-title{color:var(--sky-color-text-deemphasized)}.sky-filter-bar-btn.sky-filter-bar-btn-selected .sky-filter-item-value,.sky-filter-bar-btn.sky-filter-bar-btn-selected .sky-filter-item-caret{color:var(--sky-color-text-action);font-weight:var(--sky-font-style-emphasized)}\n"] }]
476
+ }], propDecorators: { modalOpened: [{
477
+ type: Output
478
+ }] } });
479
+
480
+ class SkyFilterBarModule {
481
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SkyFilterBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
482
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: SkyFilterBarModule, imports: [SkyFilterBarComponent, SkyFilterItemModalComponent], exports: [SkyFilterBarComponent, SkyFilterItemModalComponent] }); }
483
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SkyFilterBarModule, imports: [SkyFilterBarComponent, SkyFilterItemModalComponent] }); }
484
+ }
485
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SkyFilterBarModule, decorators: [{
486
+ type: NgModule,
487
+ args: [{
488
+ imports: [SkyFilterBarComponent, SkyFilterItemModalComponent],
489
+ exports: [SkyFilterBarComponent, SkyFilterItemModalComponent],
490
+ }]
491
+ }] });
492
+
493
+ /**
494
+ * Generated bundle index. Do not edit.
495
+ */
496
+
497
+ export { SkyFilterBarModule, SkyFilterItemModalContext, SkyFilterItemModalInstance, SkyFilterBarComponent as λ1, SkyFilterItemModalComponent as λ2 };
498
+ //# sourceMappingURL=skyux-filter-bar.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skyux-filter-bar.mjs","sources":["../../../../../libs/components/filter-bar/src/lib/modules/shared/sky-filter-bar-resources.module.ts","../../../../../libs/components/filter-bar/src/lib/modules/filter-bar/filter-bar.service.ts","../../../../../libs/components/filter-bar/src/lib/modules/filter-bar/filter-item.token.ts","../../../../../libs/components/filter-bar/src/lib/modules/filter-bar/filter-bar.component.ts","../../../../../libs/components/filter-bar/src/lib/modules/filter-bar/filter-bar.component.html","../../../../../libs/components/filter-bar/src/lib/modules/filter-bar/models/filter-item-modal-context.ts","../../../../../libs/components/filter-bar/src/lib/modules/filter-bar/models/filter-item-modal-instance.ts","../../../../../libs/components/filter-bar/src/lib/modules/filter-bar/filter-item-modal.component.ts","../../../../../libs/components/filter-bar/src/lib/modules/filter-bar/filter-item-modal.component.html","../../../../../libs/components/filter-bar/src/lib/modules/filter-bar/filter-bar.module.ts","../../../../../libs/components/filter-bar/src/skyux-filter-bar.ts"],"sourcesContent":["/* istanbul ignore file */\n/**\n * NOTICE: DO NOT MODIFY THIS FILE!\n * The contents of this file were automatically generated by\n * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-filter-bar' schematic.\n * To update this file, simply rerun the command.\n */\nimport { NgModule } from '@angular/core';\nimport {\n SkyI18nModule,\n SkyLibResources,\n SkyLibResourcesService,\n} from '@skyux/i18n';\n\nconst RESOURCES: Record<string, SkyLibResources> = {\n 'EN-US': {\n skyux_filter_bar_clear_filters_confirm_apply_label: {\n message: 'Clear values',\n },\n skyux_filter_bar_clear_filters_confirm_body: {\n message:\n 'This will not remove any filters, but any values you have set will be removed.',\n },\n skyux_filter_bar_clear_filters_confirm_cancel_label: { message: 'Cancel' },\n skyux_filter_bar_clear_filters_confirm_title: {\n message:\n 'Are you sure you want to reset all filters to their original values?',\n },\n skyux_filter_bar_clear_filters_label: { message: 'Clear all values' },\n skyux_filter_bar_filter_label: { message: 'Filters' },\n skyux_filter_bar_filter_picker_descriptor: { message: 'filters' },\n skyux_filter_item_n_selected: { message: '{0} selected' },\n },\n};\n\nSkyLibResourcesService.addResources(RESOURCES);\n\n/**\n * Import into any component library module that needs to use resource strings.\n */\n@NgModule({\n exports: [SkyI18nModule],\n})\nexport class SkyFilterBarResourcesModule {}\n","import { Injectable } from '@angular/core';\n\nimport { Observable, ReplaySubject, Subject, filter, map } from 'rxjs';\n\nimport { SkyFilterBarFilterItem } from './models/filter-bar-filter-item';\nimport { SkyFilterBarFilterValue } from './models/filter-bar-filter-value';\n\n/**\n * Service for filter items to emit value changes to the filter bar.\n * @internal\n */\n@Injectable()\nexport class SkyFilterBarService {\n readonly #filterItemUpdates = new Subject<SkyFilterBarFilterItem>();\n readonly #filterValueUpdates = new ReplaySubject<SkyFilterBarFilterItem>();\n\n /**\n * Observable stream of filter item updates.\n */\n public readonly filterItemUpdated: Observable<SkyFilterBarFilterItem> =\n this.#filterItemUpdates.asObservable();\n\n /**\n * Filtered observable stream of filter value updates.\n * @param filterId the\n * @returns\n */\n public getFilterValueUpdates(\n filterId: string,\n ): Observable<SkyFilterBarFilterValue | undefined> {\n return this.#filterValueUpdates.pipe(\n filter((update) => update.filterId === filterId),\n map((item) => item.filterValue),\n );\n }\n /**\n * Emit a filter value update.\n */\n public updateFilter(filter: SkyFilterBarFilterItem): void {\n this.#filterItemUpdates.next(filter);\n }\n\n public updateFilters(filters: SkyFilterBarFilterItem[]): void {\n for (const filter of filters) {\n this.#filterValueUpdates.next(filter);\n }\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { SkyFilterItem } from './models/filter-item';\n\n/**\n * A token for filter bar items.\n * @internal\n */\nexport const SKY_FILTER_ITEM = new InjectionToken<SkyFilterItem>(\n 'SKY_FILTER_ITEM',\n);\n","import { CommonModule, NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n computed,\n contentChildren,\n effect,\n inject,\n model,\n untracked,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { SkyLibResourcesService } from '@skyux/i18n';\nimport { SkyIconModule } from '@skyux/icon';\nimport { SkyToolbarModule } from '@skyux/layout';\nimport {\n SkySelectionModalOpenArgs,\n SkySelectionModalSearchArgs,\n SkySelectionModalSearchResult,\n SkySelectionModalService,\n} from '@skyux/lookup';\nimport {\n SkyConfirmConfig,\n SkyConfirmService,\n SkyConfirmType,\n} from '@skyux/modals';\n\nimport { Observable, of } from 'rxjs';\n\nimport { SkyFilterBarResourcesModule } from '../shared/sky-filter-bar-resources.module';\n\nimport { SkyFilterBarService } from './filter-bar.service';\nimport { SKY_FILTER_ITEM } from './filter-item.token';\nimport { SkyFilterBarFilterItem } from './models/filter-bar-filter-item';\nimport { SkyFilterBarItem } from './models/filter-bar-item';\nimport { SkyFilterItem } from './models/filter-item';\n\n/**\n * The top-level filter bar component.\n */\n@Component({\n selector: 'sky-filter-bar',\n imports: [\n CommonModule,\n NgTemplateOutlet,\n SkyFilterBarResourcesModule,\n SkyIconModule,\n SkyToolbarModule,\n ],\n providers: [SkyFilterBarService],\n templateUrl: './filter-bar.component.html',\n styleUrl: './filter-bar.component.scss',\n})\nexport class SkyFilterBarComponent {\n /**\n * An array of filter items containing the IDs and values of the filters that have been set.\n */\n public readonly appliedFilters = model<\n SkyFilterBarFilterItem[] | undefined\n >();\n\n /**\n * An array of filter IDs that the user has selected using the built-in selection modal. Setting this input to undefined results in all filters being displayed.\n */\n public readonly selectedFilterIds = model<string[] | undefined>();\n\n protected readonly filterItems = contentChildren(SKY_FILTER_ITEM);\n\n protected readonly visibleFilters = computed((): SkyFilterItem[] => {\n const items = this.filterItems();\n const selectedFilters = this.selectedFilterIds();\n\n const visibleFilters: (SkyFilterItem | undefined)[] = [];\n\n if (items) {\n if (selectedFilters) {\n for (const id of selectedFilters) {\n visibleFilters.push(items.find((item) => item.filterId() === id));\n }\n } else {\n for (const item of items) {\n visibleFilters.push(item);\n }\n }\n }\n\n return visibleFilters.filter((item) => !!item);\n });\n\n readonly #confirmSvc = inject(SkyConfirmService);\n readonly #filterBarSvc = inject(SkyFilterBarService);\n readonly #filterUpdated = toSignal(this.#filterBarSvc.filterItemUpdated);\n readonly #modalSvc = inject(SkySelectionModalService);\n readonly #resourceSvc = inject(SkyLibResourcesService);\n readonly #strings = toSignal(\n this.#resourceSvc.getStrings({\n descriptor: 'skyux_filter_bar_filter_picker_descriptor',\n title: 'skyux_filter_bar_clear_filters_confirm_title',\n body: 'skyux_filter_bar_clear_filters_confirm_body',\n save: 'skyux_filter_bar_clear_filters_confirm_apply_label',\n cancel: 'skyux_filter_bar_clear_filters_confirm_cancel_label',\n }),\n );\n\n constructor() {\n // Subscribe to filter value updates from child filter items\n effect(() => {\n const updatedFilter = this.#filterUpdated();\n if (updatedFilter) {\n this.#updateFilter(updatedFilter);\n }\n });\n\n // Push filter value updates to child filter items\n effect(() => {\n const filters = this.appliedFilters();\n this.#updateFilters(filters);\n });\n }\n\n protected openFilters(): void {\n const strings = this.#strings();\n const existingFilters = this.#getExistingFilterItems();\n\n /* istanbul ignore if: safety check */\n if (!strings) {\n return;\n }\n\n const filterArgs: SkySelectionModalOpenArgs = {\n selectionDescriptor: strings.descriptor,\n descriptorProperty: 'labelText',\n idProperty: 'filterId',\n selectMode: 'multiple',\n value: existingFilters,\n searchAsync: this.#filterAsyncSearchFn,\n };\n\n const modalInstance = this.#modalSvc.open(filterArgs);\n\n modalInstance.closed.subscribe((closeArgs) => {\n if (closeArgs.reason === 'save') {\n this.#handleFilterSelection(\n closeArgs.selectedItems as SkyFilterBarItem[] | undefined,\n existingFilters,\n );\n }\n });\n }\n\n protected clearFilters(): void {\n const strings = this.#strings();\n\n /* istanbul ignore if: safety check */\n if (!strings) {\n return;\n }\n\n const config: SkyConfirmConfig = {\n message: strings.title,\n body: strings.body,\n type: SkyConfirmType.Custom,\n buttons: [\n {\n action: 'save',\n text: strings.save,\n styleType: 'primary',\n },\n {\n action: 'cancel',\n text: strings.cancel,\n styleType: 'link',\n },\n ],\n };\n\n const instance = this.#confirmSvc.open(config);\n\n instance.closed.subscribe((result) => {\n if (result.action === 'save') {\n this.appliedFilters.set(undefined);\n }\n });\n }\n\n #getExistingFilterItems(): SkyFilterBarItem[] {\n /* istanbul ignore next: safety check */\n const selectedIds = this.selectedFilterIds() ?? [];\n return this.filterItems()\n .filter((item) => selectedIds.includes(item.filterId()))\n .map((item) => ({\n filterId: item.filterId(),\n labelText: item.labelText(),\n filterValue: item.filterValue(),\n }));\n }\n\n #handleFilterSelection(\n selectedFilters: SkyFilterBarItem[] | undefined,\n existingFilters: SkyFilterBarItem[],\n ): void {\n const { newFilterItems, removedFilterItems } = this.#processFilterChanges(\n selectedFilters,\n existingFilters,\n );\n\n const selectedIds = newFilterItems.map((item) => item.filterId);\n this.selectedFilterIds.set(selectedIds);\n\n if (removedFilterItems.length) {\n this.#updateFilters(removedFilterItems);\n const newFilters = newFilterItems.filter(\n (filter) => !!filter.filterValue,\n );\n this.appliedFilters.set(newFilters.length ? newFilters : undefined);\n }\n }\n\n #processFilterChanges(\n selectedFilters: SkyFilterBarItem[] | undefined,\n existingFilters: SkyFilterBarItem[],\n ): {\n newFilterItems: SkyFilterBarFilterItem[];\n removedFilterItems: SkyFilterBarFilterItem[];\n } {\n const newFilterItems: SkyFilterBarFilterItem[] = [];\n const removedFilterItems: SkyFilterBarFilterItem[] = [];\n\n // Process existing filters\n for (const existingFilter of existingFilters) {\n if (this.#isFilterSelected(existingFilter.filterId, selectedFilters)) {\n newFilterItems.push({\n filterId: existingFilter.filterId,\n filterValue: existingFilter.filterValue,\n });\n } else {\n removedFilterItems.push({ filterId: existingFilter.filterId });\n }\n }\n\n // Add newly selected filters\n if (selectedFilters) {\n for (const selectedFilter of selectedFilters) {\n if (!this.#isFilterInList(selectedFilter.filterId, newFilterItems)) {\n newFilterItems.push({ filterId: selectedFilter.filterId });\n }\n }\n }\n\n return { newFilterItems, removedFilterItems };\n }\n\n #isFilterSelected(\n filterId: string,\n selectedFilters: SkyFilterBarItem[] | undefined,\n ): boolean {\n return !!selectedFilters?.find(\n (selectedFilter) => selectedFilter.filterId === filterId,\n );\n }\n\n #isFilterInList(\n filterId: string,\n filterList: SkyFilterBarFilterItem[],\n ): boolean {\n return !!filterList.find((filter) => filter.filterId === filterId);\n }\n\n /* istanbul ignore next */\n #filterAsyncSearchFn = (\n args: SkySelectionModalSearchArgs,\n ): Observable<SkySelectionModalSearchResult> => {\n const items = this.filterItems().map((item) => ({\n filterId: item.filterId(),\n labelText: item.labelText(),\n }));\n\n const results = args.searchText\n ? items.filter((item) =>\n item.labelText\n .toLocaleUpperCase()\n .includes(args.searchText.toLocaleUpperCase()),\n )\n : items;\n\n return of({\n items: results,\n totalCount: items.length,\n });\n };\n\n #updateFilter(updatedFilter: SkyFilterBarFilterItem): void {\n const filters = untracked(() => this.appliedFilters()) ?? [];\n const newFilterValues: SkyFilterBarFilterItem[] = [];\n\n let replaceFilter = false;\n for (const filterValue of filters) {\n if (filterValue.filterId === updatedFilter.filterId) {\n if (updatedFilter.filterValue) {\n newFilterValues.push(updatedFilter);\n }\n replaceFilter = true;\n } else {\n newFilterValues.push(filterValue);\n }\n }\n\n if (!replaceFilter && updatedFilter.filterValue) {\n newFilterValues.push(updatedFilter);\n }\n\n this.appliedFilters.set(\n newFilterValues.length ? newFilterValues : undefined,\n );\n }\n\n #updateFilters(updatedFilters: SkyFilterBarFilterItem[] | undefined): void {\n if (updatedFilters) {\n this.#filterBarSvc.updateFilters(updatedFilters);\n } else {\n this.#filterBarSvc.updateFilters(\n untracked(() => this.filterItems()).map((filterItem) => ({\n filterId: filterItem.filterId(),\n })),\n );\n }\n }\n}\n","<sky-toolbar class=\"sky-filter-bar-toolbar\">\n <sky-toolbar-item>\n <span class=\"sky-font-data-label\">{{\n 'skyux_filter_bar_filter_label' | skyLibResources\n }}</span>\n </sky-toolbar-item>\n @if (!!selectedFilterIds()) {\n <sky-toolbar-item>\n <button\n type=\"button\"\n class=\"sky-filter-bar-filter-picker sky-btn sky-filter-bar-btn sky-btn-default sky-btn-icon\"\n (click)=\"openFilters()\"\n >\n <sky-icon iconName=\"filter\" />\n </button>\n </sky-toolbar-item>\n }\n @for (filter of visibleFilters(); track filter.filterId()) {\n <sky-toolbar-item>\n <ng-container *ngTemplateOutlet=\"filter.templateRef() ?? null\" />\n </sky-toolbar-item>\n }\n @if (!!appliedFilters()) {\n <sky-toolbar-item>\n <button\n type=\"button\"\n class=\"sky-filter-bar-clear-filters sky-btn sky-filter-bar-btn sky-btn-link\"\n (click)=\"clearFilters()\"\n >\n {{ 'skyux_filter_bar_clear_filters_label' | skyLibResources }}\n </button>\n </sky-toolbar-item>\n }\n</sky-toolbar>\n","import { SkyFilterBarFilterValue } from './filter-bar-filter-value';\n\n/**\n * The context object that is provided to a filter modal.\n */\nexport class SkyFilterItemModalContext<TData = Record<string, unknown>> {\n /**\n * The name of the filter. We recommend using this value for the modal's heading.\n */\n public readonly filterLabelText: string;\n /**\n * The value of the filter.\n */\n public readonly filterValue?: SkyFilterBarFilterValue;\n /**\n * An untyped property that can track any config information relevant to the filter modal\n * that existing options do not include.\n */\n public readonly additionalContext?: TData;\n\n constructor(args: {\n filterLabelText: string;\n filterValue?: SkyFilterBarFilterValue;\n additionalContext?: TData;\n }) {\n this.filterLabelText = args.filterLabelText;\n this.filterValue = args.filterValue;\n this.additionalContext = args.additionalContext;\n }\n}\n","import { SkyFilterItemModalContext } from './filter-item-modal-context';\nimport { SkyFilterItemModalSavedArgs } from './filter-item-modal-saved-args';\n\n/**\n * A specialized `SkyModalInstance` wrapper.\n */\nexport abstract class SkyFilterItemModalInstance<\n TData = Record<string, unknown>,\n> {\n /**\n * The context provided to the filter modal component.\n */\n public abstract readonly context: SkyFilterItemModalContext<TData>;\n\n /**\n * Closes the modal instance with `reason=\"cancel\"`.\n */\n public abstract cancel(): void;\n\n /**\n * Closes the modal instance with `reason=\"save\"`.\n * @param args\n */\n public abstract save(args: SkyFilterItemModalSavedArgs): void;\n}\n","import { CommonModule } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n EnvironmentInjector,\n EventEmitter,\n Injector,\n Output,\n TemplateRef,\n Type,\n inject,\n input,\n runInInjectionContext,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { SkyIconModule } from '@skyux/icon';\nimport { SkyModalConfigurationInterface, SkyModalService } from '@skyux/modals';\n\nimport { Observable, Subject, of } from 'rxjs';\nimport { switchMap, take } from 'rxjs/operators';\n\nimport { SkyFilterBarService } from './filter-bar.service';\nimport { SKY_FILTER_ITEM } from './filter-item.token';\nimport { SkyFilterItem } from './models/filter-item';\nimport { SkyFilterItemModal } from './models/filter-item-modal';\nimport { SkyFilterItemModalContext } from './models/filter-item-modal-context';\nimport { SkyFilterItemModalInstance } from './models/filter-item-modal-instance';\nimport { SkyFilterItemModalOpenedArgs } from './models/filter-item-modal-opened-args';\nimport { SkyFilterItemModalSavedArgs } from './models/filter-item-modal-saved-args';\nimport { SkyFilterItemModalSizeType } from './models/filter-item-modal-size';\n\n/**\n * A filter bar item that opens a modal for complex filter configuration.\n * Use this component when your filter requires a rich UI with multiple inputs,\n * date pickers, or other complex controls that don't fit in an inline filter.\n */\n@Component({\n selector: 'sky-filter-item-modal',\n imports: [CommonModule, SkyIconModule],\n templateUrl: './filter-item-modal.component.html',\n styleUrls: ['./filter-item-modal.component.scss'],\n providers: [\n { provide: SKY_FILTER_ITEM, useExisting: SkyFilterItemModalComponent },\n ],\n})\nexport class SkyFilterItemModalComponent<\n TData = Record<string, unknown> | undefined,\n> implements SkyFilterItem\n{\n /**\n * A unique identifier for the filter item.\n * @required\n */\n public readonly filterId = input.required<string>();\n\n /**\n * The label to display for the filter item.\n * @required\n */\n public readonly labelText = input.required<string>();\n\n /**\n * The modal component to display when the user selects the filter.\n * The component needs to inject a `SkyFilterItemModalInstance` object on instantiation to receive the modal instance and context from the modal service.\n * The return value of the modal save action needs to be a `SkyFilterBarFilterValue`.\n * @required\n */\n public readonly modalComponent =\n input.required<Type<SkyFilterItemModal<TData>>>();\n\n /**\n * The size of the modal to display. The valid options are `\"small\"`, `\"medium\"`, `\"large\"`, and `\"fullScreen\"`.\n */\n public readonly modalSize = input.required<SkyFilterItemModalSizeType>();\n\n /**\n * Fires when the user clicks the filter item. To pass additional context data to a filter modal, consumers\n * must subscribe to this event and return the context using the observable property on the event args.\n */\n @Output()\n public modalOpened = new EventEmitter<SkyFilterItemModalOpenedArgs<TData>>();\n\n public readonly templateRef = viewChild(TemplateRef<unknown>);\n\n readonly #environmentInjector = inject(EnvironmentInjector);\n readonly #modalSvc = inject(SkyModalService);\n readonly #filterBarSvc = inject(SkyFilterBarService);\n\n public readonly filterValue = toSignal(\n toObservable(this.filterId).pipe(\n switchMap((filterId) =>\n this.#filterBarSvc.getFilterValueUpdates(filterId),\n ),\n ),\n );\n\n protected openFilter(): void {\n const modalComponent = this.modalComponent();\n const modalSize = this.modalSize();\n const labelText = this.labelText();\n const filterValue = this.filterValue();\n\n this.#openFilterCallback().subscribe((additionalContext) => {\n const context = new SkyFilterItemModalContext<TData>({\n filterLabelText: labelText,\n filterValue,\n additionalContext,\n });\n\n const injector = Injector.create({\n parent: this.#environmentInjector,\n providers: [{ provide: SkyFilterItemModalContext, useValue: context }],\n });\n\n runInInjectionContext(injector, () => {\n const destroyRef = injector.get(DestroyRef);\n\n const saved = new Subject<SkyFilterItemModalSavedArgs>();\n const canceled = new Subject<void>();\n\n const context = inject<SkyFilterItemModalContext<TData>>(\n SkyFilterItemModalContext,\n );\n\n const filterModalInstance: SkyFilterItemModalInstance<TData> = {\n context,\n cancel() {\n canceled.next();\n canceled.complete();\n },\n save(result) {\n saved.next(result);\n saved.complete();\n },\n };\n\n canceled\n .pipe(takeUntilDestroyed(destroyRef))\n .subscribe(() => instance.cancel());\n saved\n .pipe(takeUntilDestroyed(destroyRef))\n .subscribe((result) => instance.save(result.filterValue));\n\n const modalConfig: SkyModalConfigurationInterface = {\n providers: [\n {\n provide: SkyFilterItemModalInstance,\n useValue: filterModalInstance,\n },\n ],\n };\n if (modalSize === 'fullScreen') {\n modalConfig.fullPage = true;\n } else {\n modalConfig.size = modalSize;\n }\n\n const instance = this.#modalSvc.open(modalComponent, modalConfig);\n\n instance.closed.subscribe((args) => {\n if (args.reason === 'save') {\n this.#filterBarSvc.updateFilter({\n filterId: this.filterId(),\n filterValue: args.data,\n });\n }\n });\n });\n });\n }\n\n #openFilterCallback(): Observable<TData | undefined> {\n if (this.modalOpened.observed) {\n const args: SkyFilterItemModalOpenedArgs<TData> = {\n filterId: this.filterId(),\n };\n this.modalOpened.emit(args);\n return args.data?.pipe(take(1)) || of(undefined);\n }\n\n return of(undefined);\n }\n}\n","<ng-template #templateRef>\n @let value = filterValue();\n <div class=\"sky-filter-item sky-filter-item-modal\">\n <button\n aria-haspopup=\"dialog\"\n class=\"sky-btn sky-filter-bar-btn sky-btn-default\"\n type=\"button\"\n [attr.aria-pressed]=\"!!value\"\n [attr.data-filter-id]=\"filterId()\"\n [class.sky-filter-bar-btn-selected]=\"!!value\"\n (click)=\"openFilter()\"\n >\n <span class=\"sky-filter-item-title\"\n ><span class=\"sky-filter-item-name\">{{ labelText() }}</span>\n @if (value) {\n <span>:</span>\n }\n </span>\n @if (value) {\n <span class=\"sky-filter-item-value\">{{\n value.displayValue ?? value.value\n }}</span>\n }\n <span class=\"sky-filter-item-caret\">\n <sky-icon iconName=\"chevron-down\" />\n </span>\n </button>\n </div>\n</ng-template>\n","import { NgModule } from '@angular/core';\n\nimport { SkyFilterBarComponent } from './filter-bar.component';\nimport { SkyFilterItemModalComponent } from './filter-item-modal.component';\n\n@NgModule({\n imports: [SkyFilterBarComponent, SkyFilterItemModalComponent],\n exports: [SkyFilterBarComponent, SkyFilterItemModalComponent],\n})\nexport class SkyFilterBarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;;;;;AAKG;AAQH,MAAM,SAAS,GAAoC;AACjD,IAAA,OAAO,EAAE;AACP,QAAA,kDAAkD,EAAE;AAClD,YAAA,OAAO,EAAE,cAAc;AACxB,SAAA;AACD,QAAA,2CAA2C,EAAE;AAC3C,YAAA,OAAO,EACL,gFAAgF;AACnF,SAAA;AACD,QAAA,mDAAmD,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;AAC1E,QAAA,4CAA4C,EAAE;AAC5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GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAHnB,qBAAqB,EAAE,2BAA2B,CAAA,EAAA,OAAA,EAAA,CAClD,qBAAqB,EAAE,2BAA2B,CAAA,EAAA,CAAA,CAAA;gHAEjD,kBAAkB,EAAA,OAAA,EAAA,CAHnB,qBAAqB,EAAE,2BAA2B,CAAA,EAAA,CAAA,CAAA;;4FAGjD,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,qBAAqB,EAAE,2BAA2B,CAAC;AAC7D,oBAAA,OAAO,EAAE,CAAC,qBAAqB,EAAE,2BAA2B,CAAC;AAC9D,iBAAA;;;ACRD;;AAEG;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ export { SkyFilterBarModule } from './lib/modules/filter-bar/filter-bar.module';
2
+ export { SkyFilterBarFilterItem } from './lib/modules/filter-bar/models/filter-bar-filter-item';
3
+ export { SkyFilterBarFilterValue } from './lib/modules/filter-bar/models/filter-bar-filter-value';
4
+ export { SkyFilterItemModal } from './lib/modules/filter-bar/models/filter-item-modal';
5
+ export { SkyFilterItemModalContext } from './lib/modules/filter-bar/models/filter-item-modal-context';
6
+ export { SkyFilterItemModalInstance } from './lib/modules/filter-bar/models/filter-item-modal-instance';
7
+ export { SkyFilterItemModalOpenedArgs } from './lib/modules/filter-bar/models/filter-item-modal-opened-args';
8
+ export { SkyFilterItemModalSavedArgs } from './lib/modules/filter-bar/models/filter-item-modal-saved-args';
9
+ export { SkyFilterItemModalSizeType } from './lib/modules/filter-bar/models/filter-item-modal-size';
10
+ export { SkyFilterBarComponent as λ1 } from './lib/modules/filter-bar/filter-bar.component';
11
+ export { SkyFilterItemModalComponent as λ2 } from './lib/modules/filter-bar/filter-item-modal.component';
@@ -0,0 +1,24 @@
1
+ import { SkyFilterBarFilterItem } from './models/filter-bar-filter-item';
2
+ import { SkyFilterItem } from './models/filter-item';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * The top-level filter bar component.
6
+ */
7
+ export declare class SkyFilterBarComponent {
8
+ #private;
9
+ /**
10
+ * An array of filter items containing the IDs and values of the filters that have been set.
11
+ */
12
+ readonly appliedFilters: import("@angular/core").ModelSignal<SkyFilterBarFilterItem[] | undefined>;
13
+ /**
14
+ * An array of filter IDs that the user has selected using the built-in selection modal. Setting this input to undefined results in all filters being displayed.
15
+ */
16
+ readonly selectedFilterIds: import("@angular/core").ModelSignal<string[] | undefined>;
17
+ protected readonly filterItems: import("@angular/core").Signal<readonly SkyFilterItem[]>;
18
+ protected readonly visibleFilters: import("@angular/core").Signal<SkyFilterItem[]>;
19
+ constructor();
20
+ protected openFilters(): void;
21
+ protected clearFilters(): void;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkyFilterBarComponent, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<SkyFilterBarComponent, "sky-filter-bar", never, { "appliedFilters": { "alias": "appliedFilters"; "required": false; "isSignal": true; }; "selectedFilterIds": { "alias": "selectedFilterIds"; "required": false; "isSignal": true; }; }, { "appliedFilters": "appliedFiltersChange"; "selectedFilterIds": "selectedFilterIdsChange"; }, ["filterItems"], never, true, never>;
24
+ }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./filter-bar.component";
3
+ import * as i2 from "./filter-item-modal.component";
4
+ export declare class SkyFilterBarModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkyFilterBarModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SkyFilterBarModule, never, [typeof i1.SkyFilterBarComponent, typeof i2.SkyFilterItemModalComponent], [typeof i1.SkyFilterBarComponent, typeof i2.SkyFilterItemModalComponent]>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<SkyFilterBarModule>;
8
+ }
@@ -0,0 +1,28 @@
1
+ import { Observable } from 'rxjs';
2
+ import { SkyFilterBarFilterItem } from './models/filter-bar-filter-item';
3
+ import { SkyFilterBarFilterValue } from './models/filter-bar-filter-value';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Service for filter items to emit value changes to the filter bar.
7
+ * @internal
8
+ */
9
+ export declare class SkyFilterBarService {
10
+ #private;
11
+ /**
12
+ * Observable stream of filter item updates.
13
+ */
14
+ readonly filterItemUpdated: Observable<SkyFilterBarFilterItem>;
15
+ /**
16
+ * Filtered observable stream of filter value updates.
17
+ * @param filterId the
18
+ * @returns
19
+ */
20
+ getFilterValueUpdates(filterId: string): Observable<SkyFilterBarFilterValue | undefined>;
21
+ /**
22
+ * Emit a filter value update.
23
+ */
24
+ updateFilter(filter: SkyFilterBarFilterItem): void;
25
+ updateFilters(filters: SkyFilterBarFilterItem[]): void;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkyFilterBarService, never>;
27
+ static ɵprov: i0.ɵɵInjectableDeclaration<SkyFilterBarService>;
28
+ }
@@ -0,0 +1,45 @@
1
+ import { EventEmitter, TemplateRef, Type } from '@angular/core';
2
+ import { SkyFilterItem } from './models/filter-item';
3
+ import { SkyFilterItemModal } from './models/filter-item-modal';
4
+ import { SkyFilterItemModalOpenedArgs } from './models/filter-item-modal-opened-args';
5
+ import { SkyFilterItemModalSizeType } from './models/filter-item-modal-size';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * A filter bar item that opens a modal for complex filter configuration.
9
+ * Use this component when your filter requires a rich UI with multiple inputs,
10
+ * date pickers, or other complex controls that don't fit in an inline filter.
11
+ */
12
+ export declare class SkyFilterItemModalComponent<TData = Record<string, unknown> | undefined> implements SkyFilterItem {
13
+ #private;
14
+ /**
15
+ * A unique identifier for the filter item.
16
+ * @required
17
+ */
18
+ readonly filterId: import("@angular/core").InputSignal<string>;
19
+ /**
20
+ * The label to display for the filter item.
21
+ * @required
22
+ */
23
+ readonly labelText: import("@angular/core").InputSignal<string>;
24
+ /**
25
+ * The modal component to display when the user selects the filter.
26
+ * The component needs to inject a `SkyFilterItemModalInstance` object on instantiation to receive the modal instance and context from the modal service.
27
+ * The return value of the modal save action needs to be a `SkyFilterBarFilterValue`.
28
+ * @required
29
+ */
30
+ readonly modalComponent: import("@angular/core").InputSignal<Type<SkyFilterItemModal<TData>>>;
31
+ /**
32
+ * The size of the modal to display. The valid options are `"small"`, `"medium"`, `"large"`, and `"fullScreen"`.
33
+ */
34
+ readonly modalSize: import("@angular/core").InputSignal<SkyFilterItemModalSizeType>;
35
+ /**
36
+ * Fires when the user clicks the filter item. To pass additional context data to a filter modal, consumers
37
+ * must subscribe to this event and return the context using the observable property on the event args.
38
+ */
39
+ modalOpened: EventEmitter<SkyFilterItemModalOpenedArgs<TData>>;
40
+ readonly templateRef: import("@angular/core").Signal<TemplateRef<any> | undefined>;
41
+ readonly filterValue: import("@angular/core").Signal<import("@skyux/filter-bar").SkyFilterBarFilterValue | undefined>;
42
+ protected openFilter(): void;
43
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkyFilterItemModalComponent<any>, never>;
44
+ static ɵcmp: i0.ɵɵComponentDeclaration<SkyFilterItemModalComponent<any>, "sky-filter-item-modal", never, { "filterId": { "alias": "filterId"; "required": true; "isSignal": true; }; "labelText": { "alias": "labelText"; "required": true; "isSignal": true; }; "modalComponent": { "alias": "modalComponent"; "required": true; "isSignal": true; }; "modalSize": { "alias": "modalSize"; "required": true; "isSignal": true; }; }, { "modalOpened": "modalOpened"; }, never, never, true, never>;
45
+ }
@@ -0,0 +1,7 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { SkyFilterItem } from './models/filter-item';
3
+ /**
4
+ * A token for filter bar items.
5
+ * @internal
6
+ */
7
+ export declare const SKY_FILTER_ITEM: InjectionToken<SkyFilterItem>;
@@ -0,0 +1,14 @@
1
+ import { SkyFilterBarFilterValue } from './filter-bar-filter-value';
2
+ /**
3
+ * Represents a specific filter item and its selected value, if any.
4
+ */
5
+ export interface SkyFilterBarFilterItem {
6
+ /**
7
+ * A unique identifier for the filter item.
8
+ */
9
+ filterId: string;
10
+ /**
11
+ * The value of the filter item.
12
+ */
13
+ filterValue?: SkyFilterBarFilterValue;
14
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Represents a value for a filter item.
3
+ */
4
+ export interface SkyFilterBarFilterValue {
5
+ /**
6
+ * The real value for the filter.
7
+ */
8
+ value: unknown;
9
+ /**
10
+ * A human-readable string for use with values that can't be displayed to the user.
11
+ */
12
+ displayValue?: string;
13
+ }
@@ -0,0 +1,19 @@
1
+ import { SkyFilterBarFilterValue } from './filter-bar-filter-value';
2
+ /**
3
+ * An internal representation of a filter item displayed on the filter bar.
4
+ * @internal
5
+ */
6
+ export interface SkyFilterBarItem {
7
+ /**
8
+ * A unique identifier for the filter.
9
+ */
10
+ filterId: string;
11
+ /**
12
+ * The human-readable display string for the filter.
13
+ */
14
+ labelText: string;
15
+ /**
16
+ * The value of the filter, if it is set.
17
+ */
18
+ filterValue?: SkyFilterBarFilterValue;
19
+ }
@@ -0,0 +1,24 @@
1
+ import { SkyFilterBarFilterValue } from './filter-bar-filter-value';
2
+ /**
3
+ * The context object that is provided to a filter modal.
4
+ */
5
+ export declare class SkyFilterItemModalContext<TData = Record<string, unknown>> {
6
+ /**
7
+ * The name of the filter. We recommend using this value for the modal's heading.
8
+ */
9
+ readonly filterLabelText: string;
10
+ /**
11
+ * The value of the filter.
12
+ */
13
+ readonly filterValue?: SkyFilterBarFilterValue;
14
+ /**
15
+ * An untyped property that can track any config information relevant to the filter modal
16
+ * that existing options do not include.
17
+ */
18
+ readonly additionalContext?: TData;
19
+ constructor(args: {
20
+ filterLabelText: string;
21
+ filterValue?: SkyFilterBarFilterValue;
22
+ additionalContext?: TData;
23
+ });
24
+ }
@@ -0,0 +1,20 @@
1
+ import { SkyFilterItemModalContext } from './filter-item-modal-context';
2
+ import { SkyFilterItemModalSavedArgs } from './filter-item-modal-saved-args';
3
+ /**
4
+ * A specialized `SkyModalInstance` wrapper.
5
+ */
6
+ export declare abstract class SkyFilterItemModalInstance<TData = Record<string, unknown>> {
7
+ /**
8
+ * The context provided to the filter modal component.
9
+ */
10
+ abstract readonly context: SkyFilterItemModalContext<TData>;
11
+ /**
12
+ * Closes the modal instance with `reason="cancel"`.
13
+ */
14
+ abstract cancel(): void;
15
+ /**
16
+ * Closes the modal instance with `reason="save"`.
17
+ * @param args
18
+ */
19
+ abstract save(args: SkyFilterItemModalSavedArgs): void;
20
+ }
@@ -0,0 +1,14 @@
1
+ import { Observable } from 'rxjs';
2
+ /**
3
+ * Arguments passed to a filter modal when it opens.
4
+ */
5
+ export interface SkyFilterItemModalOpenedArgs<TData = Record<string, unknown> | undefined> {
6
+ /**
7
+ * The unique identifier for the filter.
8
+ */
9
+ filterId: string;
10
+ /**
11
+ * An observable representing data that is passed to the filter modal as additional context.
12
+ */
13
+ data?: Observable<TData>;
14
+ }
@@ -0,0 +1,10 @@
1
+ import { SkyFilterBarFilterValue } from './filter-bar-filter-value';
2
+ /**
3
+ * Arguments passed back from a filter modal when the user has saved.
4
+ */
5
+ export interface SkyFilterItemModalSavedArgs {
6
+ /**
7
+ * The filter value.
8
+ */
9
+ filterValue: SkyFilterBarFilterValue | undefined;
10
+ }
@@ -0,0 +1 @@
1
+ export type SkyFilterItemModalSizeType = 'small' | 'medium' | 'large' | 'fullScreen';
@@ -0,0 +1,10 @@
1
+ import { SkyFilterItemModalInstance } from './filter-item-modal-instance';
2
+ /**
3
+ * A type marker for passing context object data types into the filter modal component.
4
+ */
5
+ export interface SkyFilterItemModal<TData = Record<string, unknown> | undefined> {
6
+ /**
7
+ * The filter modal instance to be injected into the component.
8
+ */
9
+ readonly modalInstance: SkyFilterItemModalInstance<TData>;
10
+ }
@@ -0,0 +1,26 @@
1
+ import { Signal, TemplateRef } from '@angular/core';
2
+ import { SkyFilterBarFilterValue } from './filter-bar-filter-value';
3
+ /**
4
+ * Defines the common properties various filter item types must implement to work with the filter bar component.
5
+ * @internal
6
+ */
7
+ export interface SkyFilterItem {
8
+ /**
9
+ * A unique identifier for the filter item.
10
+ */
11
+ filterId: Signal<string>;
12
+ /**
13
+ * The label for the filter item.
14
+ */
15
+ labelText: Signal<string>;
16
+ /**
17
+ * The template of the filter that is rendered by the filter bar.
18
+ * @internal
19
+ */
20
+ templateRef: Signal<TemplateRef<unknown> | undefined>;
21
+ /**
22
+ * The value of the filter item.
23
+ * @internal
24
+ */
25
+ filterValue: Signal<SkyFilterBarFilterValue | undefined>;
26
+ }
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@skyux/i18n";
3
+ /**
4
+ * Import into any component library module that needs to use resource strings.
5
+ */
6
+ export declare class SkyFilterBarResourcesModule {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkyFilterBarResourcesModule, never>;
8
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SkyFilterBarResourcesModule, never, never, [typeof i1.SkyI18nModule]>;
9
+ static ɵinj: i0.ɵɵInjectorDeclaration<SkyFilterBarResourcesModule>;
10
+ }
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@skyux/filter-bar",
3
+ "version": "12.40.0",
4
+ "author": "Blackbaud, Inc.",
5
+ "keywords": [
6
+ "blackbaud",
7
+ "skyux"
8
+ ],
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/blackbaud/skyux.git"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/blackbaud/skyux/issues"
16
+ },
17
+ "homepage": "https://github.com/blackbaud/skyux#reamde",
18
+ "peerDependencies": {
19
+ "@angular/cdk": "^19.2.19",
20
+ "@angular/common": "^19.2.14",
21
+ "@angular/core": "^19.2.14",
22
+ "@skyux/core": "12.40.0",
23
+ "@skyux/i18n": "12.40.0",
24
+ "@skyux/icon": "12.40.0",
25
+ "@skyux/layout": "12.40.0",
26
+ "@skyux/lookup": "12.40.0",
27
+ "@skyux/modals": "12.40.0"
28
+ },
29
+ "dependencies": {
30
+ "tslib": "^2.8.1"
31
+ },
32
+ "sideEffects": false,
33
+ "module": "fesm2022/skyux-filter-bar.mjs",
34
+ "typings": "index.d.ts",
35
+ "exports": {
36
+ "./package.json": {
37
+ "default": "./package.json"
38
+ },
39
+ ".": {
40
+ "types": "./index.d.ts",
41
+ "default": "./fesm2022/skyux-filter-bar.mjs"
42
+ },
43
+ "./testing": {
44
+ "types": "./testing/index.d.ts",
45
+ "default": "./fesm2022/skyux-filter-bar-testing.mjs"
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@skyux/filter-bar/testing" />
5
+ export * from './public-api';
@@ -0,0 +1,6 @@
1
+ import { SkyHarnessFilters } from '@skyux/core/testing';
2
+ /**
3
+ * A set of criteria that can be used to filter a list of `SkyFilterBarHarness` instances.
4
+ */
5
+ export interface SkyFilterBarHarnessFilters extends SkyHarnessFilters {
6
+ }
@@ -0,0 +1,48 @@
1
+ import { HarnessPredicate } from '@angular/cdk/testing';
2
+ import { SkyComponentHarness } from '@skyux/core/testing';
3
+ import { SkySelectionModalHarness } from '@skyux/lookup/testing';
4
+ import { SkyFilterBarHarnessFilters } from './filter-bar-harness-filters';
5
+ import { SkyFilterItemHarness } from './filter-item-harness';
6
+ import { SkyFilterItemHarnessFilters } from './filter-item-harness-filters';
7
+ /**
8
+ * Harness for interacting with a filter bar component in tests.
9
+ */
10
+ export declare class SkyFilterBarHarness extends SkyComponentHarness {
11
+ #private;
12
+ /**
13
+ * @internal
14
+ */
15
+ static hostSelector: string;
16
+ /**
17
+ * Gets a `HarnessPredicate` that can be used to search for a
18
+ * `SkyFilterBarHarness` that meets certain criteria.
19
+ */
20
+ static with(filters: SkyFilterBarHarnessFilters): HarnessPredicate<SkyFilterBarHarness>;
21
+ /**
22
+ * Clicks the clear filters button.
23
+ */
24
+ clickClearFilters(): Promise<void>;
25
+ /**
26
+ * Gets a specific filter item based on the filter criteria.
27
+ * @param filter The filter criteria.
28
+ */
29
+ getItem(filter: SkyFilterItemHarnessFilters): Promise<SkyFilterItemHarness>;
30
+ /**
31
+ * Gets an array of filter items based on the filter criteria.
32
+ * If no filter is provided, returns all filter items.
33
+ * @param filters The optional filter criteria.
34
+ */
35
+ getItems(filters?: SkyFilterItemHarnessFilters): Promise<SkyFilterItemHarness[]>;
36
+ /**
37
+ * Checks if the filter bar has active filters.
38
+ */
39
+ hasActiveFilters(): Promise<boolean>;
40
+ /**
41
+ * Checks if the filter picker button is visible.
42
+ */
43
+ hasFilterPicker(): Promise<boolean>;
44
+ /**
45
+ * Clicks the filter picker button and returns a harness for the selection modal that it opened.
46
+ */
47
+ openFilterPicker(): Promise<SkySelectionModalHarness>;
48
+ }
@@ -0,0 +1,14 @@
1
+ import { BaseHarnessFilters } from '@angular/cdk/testing';
2
+ /**
3
+ * A set of criteria that can be used to filter a list of `SkyFilterItemHarness` instances.
4
+ */
5
+ export interface SkyFilterItemHarnessFilters extends BaseHarnessFilters {
6
+ /**
7
+ * Finds a filter item whose filter id matches the given value.
8
+ */
9
+ filterId?: string;
10
+ /**
11
+ * Finds a filter item whose label text matches the given value.
12
+ */
13
+ labelText?: string;
14
+ }
@@ -0,0 +1,30 @@
1
+ import { HarnessPredicate } from '@angular/cdk/testing';
2
+ import { SkyComponentHarness } from '@skyux/core/testing';
3
+ import { SkyFilterItemHarnessFilters } from './filter-item-harness-filters';
4
+ /**
5
+ * Harness to interact with a filter item component in tests.
6
+ */
7
+ export declare class SkyFilterItemHarness extends SkyComponentHarness {
8
+ #private;
9
+ /**
10
+ * @internal
11
+ */
12
+ static hostSelector: string;
13
+ /**
14
+ * Gets a `HarnessPredicate` that can be used to search for a
15
+ * `SkyFilterBarItemHarness` that meets certain criteria.
16
+ */
17
+ static with(filters: SkyFilterItemHarnessFilters): HarnessPredicate<SkyFilterItemHarness>;
18
+ /**
19
+ * Clicks the filter item to open its modal.
20
+ */
21
+ click(): Promise<void>;
22
+ /**
23
+ * Gets the filter item value.
24
+ */
25
+ getFilterValue(): Promise<string | undefined>;
26
+ /**
27
+ * Gets the filter item label.
28
+ */
29
+ getLabelText(): Promise<string>;
30
+ }
@@ -0,0 +1,4 @@
1
+ export { SkyFilterBarHarness } from './modules/filter-bar/filter-bar-harness';
2
+ export { SkyFilterBarHarnessFilters } from './modules/filter-bar/filter-bar-harness-filters';
3
+ export { SkyFilterItemHarness } from './modules/filter-bar/filter-item-harness';
4
+ export { SkyFilterItemHarnessFilters } from './modules/filter-bar/filter-item-harness-filters';