@koobiq/components 18.22.0 → 18.23.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 (167) hide show
  1. package/alert/_alert-theme.scss +4 -0
  2. package/alert/alert-tokens.scss +1 -1
  3. package/alert/alert.component.d.ts +8 -2
  4. package/checkbox/checkbox.d.ts +6 -6
  5. package/core/animation/animation.d.ts +5 -2
  6. package/core/common-behaviors/checkbox.d.ts +5 -0
  7. package/core/common-behaviors/index.d.ts +1 -0
  8. package/core/pop-up/pop-up-trigger.d.ts +9 -1
  9. package/core/utils/utils.d.ts +2 -0
  10. package/esm2022/actions-panel/actions-panel-container.mjs +1 -1
  11. package/esm2022/actions-panel/actions-panel.mjs +1 -1
  12. package/esm2022/alert/alert.component.mjs +11 -5
  13. package/esm2022/autocomplete/autocomplete-trigger.directive.mjs +1 -1
  14. package/esm2022/breadcrumbs/breadcrumbs.mjs +1 -1
  15. package/esm2022/button-toggle/button-toggle.component.mjs +1 -1
  16. package/esm2022/checkbox/checkbox.mjs +5 -5
  17. package/esm2022/code-block/code-block-highlight.mjs +1 -1
  18. package/esm2022/code-block/code-block.mjs +1 -1
  19. package/esm2022/core/animation/animation.mjs +4 -1
  20. package/esm2022/core/common-behaviors/checkbox.mjs +2 -0
  21. package/esm2022/core/common-behaviors/color.mjs +1 -1
  22. package/esm2022/core/common-behaviors/index.mjs +2 -1
  23. package/esm2022/core/formatters/number/formatter.mjs +1 -1
  24. package/esm2022/core/forms/validators.mjs +1 -1
  25. package/esm2022/core/line/line.mjs +1 -1
  26. package/esm2022/core/overlay/overlay-position-map.mjs +1 -1
  27. package/esm2022/core/pop-up/pop-up-trigger.mjs +26 -11
  28. package/esm2022/core/pop-up/pop-up.mjs +1 -4
  29. package/esm2022/core/select/common.mjs +1 -1
  30. package/esm2022/core/services/measure-scrollbar.service.mjs +1 -1
  31. package/esm2022/core/utils/utils.mjs +5 -1
  32. package/esm2022/core/version.mjs +2 -2
  33. package/esm2022/datepicker/calendar-header.component.mjs +1 -1
  34. package/esm2022/datepicker/datepicker-input.directive.mjs +1 -1
  35. package/esm2022/datepicker/datepicker.component.mjs +1 -1
  36. package/esm2022/datepicker/month-view.component.mjs +1 -1
  37. package/esm2022/dropdown/dropdown-item.component.mjs +1 -1
  38. package/esm2022/dropdown/dropdown-trigger.directive.mjs +1 -1
  39. package/esm2022/dropdown/dropdown.component.mjs +1 -1
  40. package/esm2022/ellipsis-center/ellipsis-center.directive.mjs +1 -1
  41. package/esm2022/file-upload/file-drop.mjs +1 -1
  42. package/esm2022/file-upload/file-upload.mjs +1 -1
  43. package/esm2022/file-upload/single-file-upload.component.mjs +1 -1
  44. package/esm2022/filter-bar/filter-bar-button.mjs +2 -1
  45. package/esm2022/filter-bar/filter-bar.mjs +14 -1
  46. package/esm2022/filter-bar/filter-bar.module.mjs +5 -3
  47. package/esm2022/filter-bar/filter-bar.types.mjs +27 -2
  48. package/esm2022/filter-bar/filter-reset.mjs +15 -5
  49. package/esm2022/filter-bar/filter-search.mjs +18 -5
  50. package/esm2022/filter-bar/filters.mjs +22 -6
  51. package/esm2022/filter-bar/pipe-add.mjs +10 -1
  52. package/esm2022/filter-bar/pipe.directive.mjs +7 -25
  53. package/esm2022/filter-bar/pipes/base-pipe.mjs +23 -3
  54. package/esm2022/filter-bar/pipes/pipe-button.mjs +12 -6
  55. package/esm2022/filter-bar/pipes/pipe-date.mjs +26 -8
  56. package/esm2022/filter-bar/pipes/pipe-datetime.mjs +27 -8
  57. package/esm2022/filter-bar/pipes/pipe-multi-select.mjs +6 -1
  58. package/esm2022/filter-bar/pipes/pipe-select.mjs +6 -1
  59. package/esm2022/filter-bar/pipes/pipe-state.mjs +2 -1
  60. package/esm2022/filter-bar/pipes/pipe-text.mjs +7 -3
  61. package/esm2022/filter-bar/pipes/pipe-title.mjs +2 -1
  62. package/esm2022/form-field/form-field.mjs +1 -1
  63. package/esm2022/form-field/validate.directive.mjs +1 -1
  64. package/esm2022/input/input-number.mjs +1 -1
  65. package/esm2022/list/list-selection.component.mjs +1 -1
  66. package/esm2022/markdown/markdown.component.mjs +2 -2
  67. package/esm2022/modal/modal.component.mjs +1 -1
  68. package/esm2022/modal/modal.service.mjs +1 -1
  69. package/esm2022/navbar/navbar.component.mjs +9 -12
  70. package/esm2022/navbar/vertical-navbar.component.mjs +9 -13
  71. package/esm2022/overflow-items/overflow-items.mjs +1 -1
  72. package/esm2022/popover/popover-confirm.component.mjs +1 -1
  73. package/esm2022/radio/radio.component.mjs +3 -3
  74. package/esm2022/scrollbar/scrollbar.component.mjs +1 -1
  75. package/esm2022/scrollbar/scrollbar.directive.mjs +1 -1
  76. package/esm2022/select/select.component.mjs +1 -1
  77. package/esm2022/sidepanel/sidepanel.service.mjs +1 -1
  78. package/esm2022/splitter/splitter.component.mjs +1 -1
  79. package/esm2022/tabs/paginated-tab-header.mjs +1 -1
  80. package/esm2022/tabs/tab-body.component.mjs +1 -1
  81. package/esm2022/tabs/tab-group.component.mjs +1 -1
  82. package/esm2022/tags/tag-input.mjs +1 -1
  83. package/esm2022/tags/tag-list.component.mjs +1 -1
  84. package/esm2022/tags/tag.component.mjs +1 -1
  85. package/esm2022/textarea/textarea.component.mjs +1 -1
  86. package/esm2022/timepicker/timepicker.directive.mjs +1 -1
  87. package/esm2022/toggle/toggle.component.mjs +95 -16
  88. package/esm2022/tree/control/base-tree-control.mjs +1 -1
  89. package/esm2022/tree/control/flat-tree-control.filters.mjs +1 -1
  90. package/esm2022/tree/control/nested-tree-control.mjs +1 -1
  91. package/esm2022/tree/data-source/flat-data-source.mjs +1 -1
  92. package/esm2022/tree/padding.directive.mjs +1 -1
  93. package/esm2022/tree/tree-base.mjs +1 -1
  94. package/esm2022/tree/tree-selection.component.mjs +1 -1
  95. package/esm2022/tree-select/tree-select.component.mjs +1 -1
  96. package/fesm2022/koobiq-components-actions-panel.mjs.map +1 -1
  97. package/fesm2022/koobiq-components-alert.mjs +10 -4
  98. package/fesm2022/koobiq-components-alert.mjs.map +1 -1
  99. package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
  100. package/fesm2022/koobiq-components-breadcrumbs.mjs.map +1 -1
  101. package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
  102. package/fesm2022/koobiq-components-checkbox.mjs +4 -4
  103. package/fesm2022/koobiq-components-checkbox.mjs.map +1 -1
  104. package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
  105. package/fesm2022/koobiq-components-core.mjs +33 -15
  106. package/fesm2022/koobiq-components-core.mjs.map +1 -1
  107. package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
  108. package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
  109. package/fesm2022/koobiq-components-ellipsis-center.mjs.map +1 -1
  110. package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
  111. package/fesm2022/koobiq-components-filter-bar.mjs +1470 -1322
  112. package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -1
  113. package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
  114. package/fesm2022/koobiq-components-input.mjs.map +1 -1
  115. package/fesm2022/koobiq-components-list.mjs.map +1 -1
  116. package/fesm2022/koobiq-components-markdown.mjs +2 -2
  117. package/fesm2022/koobiq-components-markdown.mjs.map +1 -1
  118. package/fesm2022/koobiq-components-modal.mjs.map +1 -1
  119. package/fesm2022/koobiq-components-navbar.mjs +15 -22
  120. package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
  121. package/fesm2022/koobiq-components-overflow-items.mjs.map +1 -1
  122. package/fesm2022/koobiq-components-popover.mjs.map +1 -1
  123. package/fesm2022/koobiq-components-radio.mjs +2 -2
  124. package/fesm2022/koobiq-components-radio.mjs.map +1 -1
  125. package/fesm2022/koobiq-components-scrollbar.mjs.map +1 -1
  126. package/fesm2022/koobiq-components-select.mjs.map +1 -1
  127. package/fesm2022/koobiq-components-sidepanel.mjs.map +1 -1
  128. package/fesm2022/koobiq-components-splitter.mjs.map +1 -1
  129. package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
  130. package/fesm2022/koobiq-components-tags.mjs.map +1 -1
  131. package/fesm2022/koobiq-components-textarea.mjs.map +1 -1
  132. package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
  133. package/fesm2022/koobiq-components-toggle.mjs +94 -15
  134. package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
  135. package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
  136. package/fesm2022/koobiq-components-tree.mjs.map +1 -1
  137. package/filter-bar/filter-bar-button.d.ts +1 -0
  138. package/filter-bar/filter-bar.d.ts +14 -0
  139. package/filter-bar/filter-bar.types.d.ts +13 -3
  140. package/filter-bar/filter-reset.d.ts +6 -2
  141. package/filter-bar/filter-search.d.ts +17 -10
  142. package/filter-bar/filters.d.ts +26 -11
  143. package/filter-bar/pipe-add.d.ts +10 -0
  144. package/filter-bar/pipe.directive.d.ts +5 -5
  145. package/filter-bar/pipes/base-pipe.d.ts +28 -2
  146. package/filter-bar/pipes/pipe-button.d.ts +6 -1
  147. package/filter-bar/pipes/pipe-date.d.ts +30 -10
  148. package/filter-bar/pipes/pipe-date.scss +29 -27
  149. package/filter-bar/pipes/pipe-datetime.d.ts +31 -10
  150. package/filter-bar/pipes/pipe-multi-select.d.ts +7 -0
  151. package/filter-bar/pipes/pipe-select.d.ts +7 -0
  152. package/filter-bar/pipes/pipe-state.d.ts +1 -0
  153. package/filter-bar/pipes/pipe-text.d.ts +5 -0
  154. package/link/_link-theme.scss +14 -0
  155. package/markdown/markdown.scss +0 -4
  156. package/navbar/navbar.component.d.ts +2 -2
  157. package/navbar/vertical-navbar.component.d.ts +3 -3
  158. package/package.json +5 -5
  159. package/prebuilt-themes/dark-theme.css +1 -1
  160. package/prebuilt-themes/light-theme.css +1 -1
  161. package/prebuilt-themes/theme.css +1 -1
  162. package/radio/radio.scss +0 -1
  163. package/schematics/ng-add/index.js +3 -3
  164. package/toggle/_toggle-theme.scss +12 -3
  165. package/toggle/toggle-tokens.scss +2 -2
  166. package/toggle/toggle.component.d.ts +22 -4
  167. package/toggle/toggle.scss +37 -0
@@ -1,1550 +1,1697 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, EventEmitter, Component, ChangeDetectionStrategy, Output, Directive, ChangeDetectorRef, ViewEncapsulation, ViewChild, Input, ContentChild, TemplateRef, ElementRef, afterNextRender, DestroyRef, ContentChildren, viewChild, Injector, ViewContainerRef, NgModule } from '@angular/core';
2
+ import { InjectionToken, inject, ChangeDetectorRef, TemplateRef, Directive, ElementRef, afterNextRender, DestroyRef, Input, Component, ChangeDetectionStrategy, ViewEncapsulation, ContentChildren, ContentChild, viewChild, ViewChild, EventEmitter, Output, Injector, ViewContainerRef, NgModule } from '@angular/core';
3
3
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
4
  import * as i3$2 from '@koobiq/components/core';
5
- import { ruRULocaleData, KbqComponentColors, PopUpPlacements, PopUpSizes, KbqFormsModule, KBQ_LOCALE_SERVICE, KbqOptionModule, KbqSelectMatcher, KBQ_TITLE_TEXT_REF, DateAdapter, DateFormatter, KBQ_VALIDATION, KbqFormattersModule } from '@koobiq/components/core';
5
+ import { isMac, KbqComponentColors, KBQ_TITLE_TEXT_REF, DateAdapter, DateFormatter, PopUpPlacements, KBQ_VALIDATION, KbqFormattersModule, ruRULocaleData, PopUpSizes, KbqFormsModule, KBQ_LOCALE_SERVICE, KbqOptionModule, KbqSelectMatcher } from '@koobiq/components/core';
6
6
  import * as i4 from '@koobiq/components/divider';
7
7
  import { KbqDividerModule } from '@koobiq/components/divider';
8
- import { merge, of, BehaviorSubject, Subject, Subscription, throttleTime, Observable } from 'rxjs';
9
- import * as i1 from '@koobiq/components/button';
10
- import { KbqButtonModule, KbqButton, KbqButtonStyles } from '@koobiq/components/button';
11
- import { NgClass, AsyncPipe, NgTemplateOutlet } from '@angular/common';
8
+ import { Subject, merge, Subscription, throttleTime, Observable, of, BehaviorSubject } from 'rxjs';
12
9
  import * as i1$1 from '@angular/forms';
13
- import { UntypedFormControl, FormControl, Validators, ReactiveFormsModule, FormsModule, FormGroup } from '@angular/forms';
14
- import * as i10 from '@koobiq/components/alert';
15
- import { KbqAlertModule } from '@koobiq/components/alert';
16
- import * as i3 from '@koobiq/components/dropdown';
17
- import { KbqDropdownTrigger, KbqDropdownModule } from '@koobiq/components/dropdown';
10
+ import { FormGroup, FormControl, ReactiveFormsModule, FormsModule, UntypedFormControl, Validators } from '@angular/forms';
11
+ import { ENTER } from '@koobiq/cdk/keycodes';
12
+ import * as i1 from '@koobiq/components/button';
13
+ import { KbqButton, KbqButtonStyles, KbqButtonModule } from '@koobiq/components/button';
14
+ import * as i8 from '@koobiq/components/datepicker';
15
+ import { KbqDatepickerModule } from '@koobiq/components/datepicker';
18
16
  import * as i6 from '@koobiq/components/form-field';
19
17
  import { KbqFormFieldModule } from '@koobiq/components/form-field';
20
18
  import * as i2 from '@koobiq/components/icon';
21
19
  import { KbqIcon, KbqIconModule } from '@koobiq/components/icon';
22
- import * as i3$1 from '@koobiq/components/input';
20
+ import * as i3 from '@koobiq/components/input';
23
21
  import { KbqInputModule, KbqInput } from '@koobiq/components/input';
24
- import * as i5$1 from '@koobiq/components/popover';
25
- import { KbqPopoverTrigger, KbqPopoverModule } from '@koobiq/components/popover';
26
- import * as i5 from '@koobiq/components/title';
27
- import { KbqTitleModule } from '@koobiq/components/title';
28
- import * as i2$1 from '@koobiq/components/tooltip';
29
- import { KbqTooltipTrigger, KbqToolTipModule } from '@koobiq/components/tooltip';
30
- import { map, filter, delay, debounceTime } from 'rxjs/operators';
31
- import * as i4$1 from '@koobiq/components/select';
32
- import { KbqSelect, KbqSelectModule } from '@koobiq/components/select';
33
- import { ENTER } from '@koobiq/cdk/keycodes';
34
- import * as i8 from '@koobiq/components/datepicker';
35
- import { KbqDatepickerModule } from '@koobiq/components/datepicker';
36
22
  import * as i7 from '@koobiq/components/list';
37
23
  import { KbqListSelection, KbqListModule } from '@koobiq/components/list';
24
+ import * as i5 from '@koobiq/components/popover';
25
+ import { KbqPopoverModule, KbqPopoverTrigger } from '@koobiq/components/popover';
38
26
  import * as i9 from '@koobiq/components/timepicker';
39
27
  import { KbqTimepickerModule } from '@koobiq/components/timepicker';
40
- import * as i5$2 from '@koobiq/components/badge';
28
+ import * as i5$3 from '@koobiq/components/title';
29
+ import { KbqTitleModule } from '@koobiq/components/title';
30
+ import { filter, delay, debounceTime, map } from 'rxjs/operators';
31
+ import * as i2$1 from '@koobiq/components/tooltip';
32
+ import { KbqTooltipTrigger, KbqToolTipModule } from '@koobiq/components/tooltip';
33
+ import { NgClass, NgTemplateOutlet, AsyncPipe } from '@angular/common';
34
+ import * as i5$1 from '@koobiq/components/badge';
41
35
  import { KbqBadgeModule } from '@koobiq/components/badge';
42
- import * as i5$3 from '@koobiq/components/textarea';
36
+ import * as i3$1 from '@koobiq/components/select';
37
+ import { KbqSelect, KbqSelectModule } from '@koobiq/components/select';
38
+ import * as i5$2 from '@koobiq/components/textarea';
43
39
  import { KbqTextareaModule } from '@koobiq/components/textarea';
40
+ import * as i10 from '@koobiq/components/alert';
41
+ import { KbqAlertModule } from '@koobiq/components/alert';
42
+ import * as i3$3 from '@koobiq/components/dropdown';
43
+ import { KbqDropdownTrigger, KbqDropdownModule } from '@koobiq/components/dropdown';
44
44
 
45
- const KBQ_FILTER_BAR_CONFIGURATION = new InjectionToken('KbqFilterBarConfiguration');
46
- const KBQ_FILTER_BAR_DEFAULT_CONFIGURATION = ruRULocaleData.filterBar;
47
- var KbqPipeTypes;
48
- (function (KbqPipeTypes) {
49
- KbqPipeTypes["Text"] = "text";
50
- KbqPipeTypes["Select"] = "select";
51
- KbqPipeTypes["MultiSelect"] = "multiselect";
52
- KbqPipeTypes["Date"] = "date";
53
- KbqPipeTypes["Datetime"] = "datetime";
54
- })(KbqPipeTypes || (KbqPipeTypes = {}));
55
-
56
- class KbqFilterReset {
45
+ /** Injection Token for providing configuration of filter-bar */
46
+ const KBQ_PIPE_DATA = new InjectionToken('KBQ_PIPE_DATA');
47
+ class KbqBasePipe {
48
+ /** Whether the current pipe is empty. Used for apply style modifier */
49
+ get isEmpty() {
50
+ return this.data.value === null || this.data.value === undefined;
51
+ }
52
+ /** Whether the current pipe is removable or cleanable. Used for apply style modifier */
53
+ get showRemoveButton() {
54
+ return !this.data.required && (this.data.removable || (this.data.cleanable && !this.isEmpty));
55
+ }
56
+ /** localized data
57
+ * @docs-private */
58
+ get localeData() {
59
+ return this.filterBar?.configuration;
60
+ }
57
61
  constructor() {
58
- this.filterBar = inject(KbqFilterBar);
59
- /** Event that is generated whenever the user reset a filter. */
60
- this.onResetFilter = new EventEmitter();
62
+ /** changes of state */
63
+ this.stateChanges = new Subject();
64
+ /** pipe data. Provided from subclass */
65
+ this.data = inject(KBQ_PIPE_DATA);
66
+ /** KbqFilterBar instance
67
+ * @docs-private */
68
+ this.filterBar = inject(KbqFilterBar, { optional: true });
69
+ /** @docs-private */
70
+ this.changeDetectorRef = inject(ChangeDetectorRef);
71
+ /** Whether the current platform is a Mac. */
72
+ this.isMac = isMac();
73
+ /** updates values for selection and value template */
74
+ this.updateTemplates = (templates) => {
75
+ const template = templates?.find((template) => template.type === this.data?.type);
76
+ if (template?.values) {
77
+ this.values = template.values;
78
+ this.valueTemplate = template.valueTemplate;
79
+ }
80
+ };
81
+ this.$implicit = this;
82
+ this.stateChanges.subscribe(() => {
83
+ this.changeDetectorRef.markForCheck();
84
+ });
85
+ this.filterBar?.internalTemplatesChanges.pipe(takeUntilDestroyed()).subscribe(this.updateTemplates);
61
86
  }
62
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterReset, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
63
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: KbqFilterReset, isStandalone: true, selector: "kbq-filter-reset", outputs: { onResetFilter: "onResetFilter" }, host: { classAttribute: "kbq-filter-reset" }, ngImport: i0, template: `
64
- <button [color]="'theme'" [kbqStyle]="'transparent'" (click)="onResetFilter.emit(filterBar.filter!)" kbq-button>
65
- <ng-content>{{ filterBar.configuration.reset.buttonName }}</ng-content>
66
- </button>
67
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
87
+ ngAfterViewInit() {
88
+ if (this.data.openOnAdd) {
89
+ delete this.data.openOnAdd;
90
+ this.open();
91
+ }
92
+ this.filterBar?.openPipe.pipe(filter(Boolean)).subscribe((name) => {
93
+ if (this.data.name === name) {
94
+ this.open();
95
+ }
96
+ });
97
+ }
98
+ /** templateRef checker utility */
99
+ isTemplateRef(value) {
100
+ return value instanceof TemplateRef;
101
+ }
102
+ /** removes pipe from filter-bar and triggers changes */
103
+ onRemove() {
104
+ this.filterBar?.removePipe(this.data);
105
+ this.stateChanges.next();
106
+ }
107
+ /** clears the pipe and triggers changes */
108
+ onClear() {
109
+ this.data.value = null;
110
+ this.stateChanges.next();
111
+ }
112
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqBasePipe, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
113
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: KbqBasePipe, isStandalone: true, host: { properties: { "class": "\"kbq-pipe__\" + data.type", "class.kbq-pipe_empty": "isEmpty", "class.kbq-pipe_cleanable": "data.cleanable", "class.kbq-pipe_removable": "data.removable", "class.kbq-pipe_disabled": "data.disabled" }, classAttribute: "kbq-pipe" }, ngImport: i0 }); }
68
114
  }
69
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterReset, decorators: [{
70
- type: Component,
115
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqBasePipe, decorators: [{
116
+ type: Directive,
71
117
  args: [{
72
118
  standalone: true,
73
- selector: 'kbq-filter-reset',
74
- template: `
75
- <button [color]="'theme'" [kbqStyle]="'transparent'" (click)="onResetFilter.emit(filterBar.filter!)" kbq-button>
76
- <ng-content>{{ filterBar.configuration.reset.buttonName }}</ng-content>
77
- </button>
78
- `,
79
119
  host: {
80
- class: 'kbq-filter-reset'
81
- },
82
- changeDetection: ChangeDetectionStrategy.OnPush,
83
- imports: [KbqButtonModule]
120
+ class: 'kbq-pipe',
121
+ '[class]': '"kbq-pipe__" + data.type',
122
+ '[class.kbq-pipe_empty]': 'isEmpty',
123
+ '[class.kbq-pipe_cleanable]': 'data.cleanable',
124
+ '[class.kbq-pipe_removable]': 'data.removable',
125
+ '[class.kbq-pipe_disabled]': 'data.disabled'
126
+ }
84
127
  }]
85
- }], propDecorators: { onResetFilter: [{
86
- type: Output
87
- }] } });
128
+ }], ctorParameters: () => [] });
129
+ class KbqPipeMinWidth {
130
+ /** current length of text */
131
+ get textLength() {
132
+ return this.elementRef.nativeElement.innerText.length || 0;
133
+ }
134
+ constructor() {
135
+ /** KbqFilterBar instance */
136
+ this.filterBar = inject(KbqFilterBar, { optional: true });
137
+ /** @docs-private */
138
+ this.elementRef = inject(ElementRef);
139
+ /** @docs-private */
140
+ this.changeDetectorRef = inject(ChangeDetectorRef);
141
+ /** maximal symbols for apply fit-content to min-width */
142
+ this.maxSymbolsForFitContent = 20;
143
+ this.update = () => {
144
+ this.minWidth = this.textLength < this.maxSymbolsForFitContent ? 'fit-content' : 'unset';
145
+ this.changeDetectorRef.markForCheck();
146
+ };
147
+ this.filterBar?.changes.pipe(delay(0)).subscribe(this.update);
148
+ afterNextRender({ read: this.update });
149
+ }
150
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeMinWidth, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
151
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: KbqPipeMinWidth, isStandalone: true, selector: "[kbqPipeMinWidth]", host: { properties: { "style.min-width": "minWidth" } }, ngImport: i0 }); }
152
+ }
153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeMinWidth, decorators: [{
154
+ type: Directive,
155
+ args: [{
156
+ standalone: true,
157
+ selector: '[kbqPipeMinWidth]',
158
+ host: {
159
+ '[style.min-width]': 'minWidth'
160
+ }
161
+ }]
162
+ }], ctorParameters: () => [] });
88
163
 
89
- class KbqFilterBarButton {
164
+ class KbqPipeState {
90
165
  constructor() {
166
+ this.destroyRef = inject(DestroyRef);
91
167
  this.button = inject(KbqButton);
92
- this.filterBar = inject(KbqFilterBar);
93
- this.filterBar.changes.pipe(takeUntilDestroyed()).subscribe(() => {
168
+ this.pipe = inject(KbqBasePipe);
169
+ this._state = null;
170
+ this.updateState = () => {
94
171
  this.button.kbqStyle = KbqButtonStyles.Outline;
95
172
  this.button.color = KbqComponentColors.ContrastFade;
96
- if (this.filterBar.filter?.changed || this.filterBar.filter?.saved) {
97
- this.button.kbqStyle = 'changed-filter';
98
- this.button.color = KbqComponentColors.Empty;
173
+ if (!this.pipe.isEmpty) {
174
+ this.button.kbqStyle = KbqButtonStyles.Filled;
175
+ this.button.color = KbqComponentColors.ContrastFade;
99
176
  }
100
- });
177
+ };
101
178
  }
102
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBarButton, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
103
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: KbqFilterBarButton, isStandalone: true, selector: "[kbqFilterBarButton]", ngImport: i0 }); }
179
+ /** calculates and updates styles of button from pipe state */
180
+ set state(pipe) {
181
+ this._state = pipe;
182
+ this.updateState();
183
+ }
184
+ get state() {
185
+ return this._state;
186
+ }
187
+ ngOnInit() {
188
+ this.pipe.stateChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(this.updateState);
189
+ }
190
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeState, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
191
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: KbqPipeState, isStandalone: true, selector: "[kbqPipeState]", inputs: { state: ["kbqPipeState", "state"] }, ngImport: i0 }); }
104
192
  }
105
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBarButton, decorators: [{
193
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeState, decorators: [{
106
194
  type: Directive,
107
195
  args: [{
108
196
  standalone: true,
109
- selector: '[kbqFilterBarButton]'
197
+ selector: '[kbqPipeState]'
110
198
  }]
111
- }], ctorParameters: () => [] });
199
+ }], propDecorators: { state: [{
200
+ type: Input,
201
+ args: [{ alias: 'kbqPipeState' }]
202
+ }] } });
112
203
 
113
- class KbqFilters {
114
- get popoverHeader() {
115
- return this.saveNewFilter ? 'Новый фильтр' : 'Изменить фильтр';
116
- }
117
- /** Component state. true if opened dropdown or popup */
118
- get opened() {
119
- return this.popover?.isOpen || this.dropdown?.opened;
120
- }
121
- /** Selected filter */
122
- get filter() {
123
- return this.filterBar.filter;
124
- }
125
- /** Component state. True if 'filters' input contains no elements. */
126
- get isEmpty() {
127
- return this.filters.length === 0;
204
+ class KbqPipeButton {
205
+ /** localized data
206
+ * @docs-private */
207
+ get localeData() {
208
+ return this.filterBar?.configuration.pipe;
128
209
  }
129
210
  constructor() {
130
- this.placements = PopUpPlacements;
211
+ /** KbqPipe instance */
212
+ this.pipe = inject(KbqBasePipe);
213
+ /** KbqFilterBar instance */
131
214
  this.filterBar = inject(KbqFilterBar);
215
+ /** @docs-private */
132
216
  this.changeDetectorRef = inject(ChangeDetectorRef);
133
- this.styles = KbqButtonStyles;
134
- this.colors = KbqComponentColors;
135
- this.searchControl = new UntypedFormControl();
136
- this.popoverSize = PopUpSizes.Medium;
137
- this.showFilterSavingError = false;
138
- /** Event that is generated whenever the user selects a filter. */
139
- this.onSelectFilter = new EventEmitter();
140
- /** Event that is generated whenever the user save a filter. */
141
- this.onSave = new EventEmitter();
142
- /** Event that is generated whenever the user change a filter. */
143
- this.onChangeFilter = new EventEmitter();
144
- /** Event that is generated whenever the user saves a filter as new. */
145
- this.onSaveAsNew = new EventEmitter();
146
- /** Event that is generated whenever the user remove a filter. */
147
- this.onRemoveFilter = new EventEmitter();
148
- /** Event that is generated whenever the user reset a filter changes. */
149
- this.onResetFilterChanges = new EventEmitter();
150
- this.closePopover = () => {
151
- this.popover.hide();
152
- this.restoreFocus();
153
- setTimeout(() => this.changeDetectorRef.detectChanges());
154
- };
155
- this.filterBar.changes.subscribe(() => this.changeDetectorRef.markForCheck());
156
- }
157
- ngOnInit() {
158
- this.filteredOptions = merge(of(this.filters), this.searchControl.valueChanges.pipe(map((value) => this.getFilteredOptions(value))));
159
- }
160
- selectFilter(filter) {
161
- this.filterBar.internalFilterChanges.next(structuredClone(filter));
162
- this.filterBar.saveFilterState();
163
- this.onSelectFilter.next(filter);
164
- }
165
- saveChanges() {
166
- if (!this.filterBar.filter)
167
- return;
168
- this.filterBar.filter.saved = true;
169
- this.filterBar.filter.changed = false;
170
- this.filterBar.saveFilterState();
171
- this.filterBar.internalFilterChanges.next(this.filterBar.filter);
172
- this.onSave.emit({ filter: this.filterBar.filter, filterBar: this.filterBar });
217
+ merge(this.pipe.stateChanges, this.filterBar.changes)
218
+ .pipe(takeUntilDestroyed())
219
+ .subscribe(() => this.changeDetectorRef.markForCheck());
173
220
  }
174
- saveAsNew() {
175
- if (this.filterName.invalid)
176
- return;
177
- const name = this.filterName.value || '';
178
- if (this.saveNewFilter) {
179
- // @todo default filter
180
- const filter = structuredClone(this.filter) || { pipes: [] };
181
- filter.name = name;
182
- filter.saved = true;
183
- filter.changed = false;
184
- this.onSaveAsNew.emit({ filter, filterBar: this.filterBar });
185
- }
186
- else {
187
- this.filterBar.filter.name = name;
188
- this.filterBar.filter.saved = true;
189
- this.filterBar.filter.changed = false;
190
- this.onSave.emit({ filter: this.filterBar.filter, filterBar: this.filterBar });
191
- }
221
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeButton, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
222
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: KbqPipeButton, isStandalone: true, selector: "kbq-pipe-button", host: { classAttribute: "kbq-pipe-button" }, ngImport: i0, template: `
223
+ <button
224
+ class="kbq-pipe__remove-button"
225
+ [disabled]="pipe.data.disabled"
226
+ [kbqPipeState]="pipe.data"
227
+ (click)="pipe.data.cleanable ? pipe.onClear() : pipe.onRemove()"
228
+ kbq-button
229
+ kbqTooltip="{{ pipe.data.cleanable ? localeData.clearButtonTooltip : localeData.removeButtonTooltip }}"
230
+ >
231
+ <i kbq-icon="kbq-xmark-s_16"></i>
232
+ </button>
233
+ `, isInline: true, styles: [".kbq-pipe-button{display:flex;position:relative}\n"], dependencies: [{ kind: "component", type: KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "directive", type: KbqPipeState, selector: "[kbqPipeState]", inputs: ["kbqPipeState"] }, { kind: "directive", type: KbqTooltipTrigger, selector: "[kbqTooltip]", inputs: ["kbqVisible", "kbqPlacement", "kbqRelativeToPointer", "kbqPlacementPriority", "kbqTooltip", "kbqTooltipDisabled", "kbqEnterDelay", "kbqLeaveDelay", "kbqTrigger", "kbqTooltipClass", "kbqTooltipContext", "kbqTooltipColor", "kbqTooltipArrow", "kbqTooltipOffset"], outputs: ["kbqPlacementChange", "kbqVisibleChange"], exportAs: ["kbqTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
234
+ }
235
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeButton, decorators: [{
236
+ type: Component,
237
+ args: [{ standalone: true, selector: 'kbq-pipe-button', template: `
238
+ <button
239
+ class="kbq-pipe__remove-button"
240
+ [disabled]="pipe.data.disabled"
241
+ [kbqPipeState]="pipe.data"
242
+ (click)="pipe.data.cleanable ? pipe.onClear() : pipe.onRemove()"
243
+ kbq-button
244
+ kbqTooltip="{{ pipe.data.cleanable ? localeData.clearButtonTooltip : localeData.removeButtonTooltip }}"
245
+ >
246
+ <i kbq-icon="kbq-xmark-s_16"></i>
247
+ </button>
248
+ `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
249
+ class: 'kbq-pipe-button'
250
+ }, imports: [
251
+ KbqIcon,
252
+ KbqButtonModule,
253
+ KbqPipeState,
254
+ KbqTooltipTrigger
255
+ ], styles: [".kbq-pipe-button{display:flex;position:relative}\n"] }]
256
+ }], ctorParameters: () => [] });
257
+
258
+ // todo DS-3672
259
+ class KbqPipeTitleDirective extends KbqTooltipTrigger {
260
+ constructor() {
261
+ super(...arguments);
262
+ this.componentInstance = inject(KBQ_TITLE_TEXT_REF, { optional: true, host: true });
263
+ this.resizeStream = new Subject();
264
+ this.debounceInterval = 100;
265
+ this.resizeSubscription = Subscription.EMPTY;
266
+ this.mutationSubscription = Subscription.EMPTY;
267
+ this.focusMonitorSubscription = Subscription.EMPTY;
192
268
  }
193
- showError(error) {
194
- if (error?.nameAlreadyExists) {
195
- this.filterName.setErrors({ filterNameAlreadyExist: true });
196
- }
197
- this.showFilterSavingError = true;
198
- this.filterSavingErrorText = error?.text ?? this.filterBar.configuration.filters.errorHint;
269
+ get isOverflown() {
270
+ return this.childContainer.some(({ nativeElement }) => {
271
+ return (this.parent?.offsetWidth < nativeElement.scrollWidth ||
272
+ this.parent?.offsetHeight < nativeElement.scrollHeight);
273
+ });
199
274
  }
200
- restoreFocus() {
201
- this.button.focus();
275
+ get parent() {
276
+ return this.parentContainer?.nativeElement || this.parentContainer;
202
277
  }
203
- preparePopover() {
204
- this.filterName = new FormControl(this.filter?.name || '', Validators.required);
205
- this.filterName.valueChanges.subscribe(() => (this.showFilterSavingError = false));
206
- this.popover.show();
207
- merge(...this.popover.defaultClosingActions()).subscribe(this.closePopover);
208
- this.popover.visibleChange.pipe(filter((state) => !state)).subscribe(this.closePopover);
209
- setTimeout(() => this.newFilterName.nativeElement.focus());
278
+ get child() {
279
+ return this.childContainer.first.nativeElement || this.childContainer;
210
280
  }
211
- openSaveAsNewFilterPopover() {
212
- this.saveNewFilter = true;
213
- this.preparePopover();
281
+ ngAfterViewInit() {
282
+ this.parentContainer = this.parentContainer || this.componentInstance?.parentTextElement || this.elementRef;
283
+ this.childContainer = this.childContainer || this.componentInstance?.textElement || this.elementRef;
284
+ this.content = this.viewValue;
285
+ this.resizeSubscription = this.resizeStream
286
+ .pipe(debounceTime(this.debounceInterval))
287
+ .subscribe(() => (this.disabled = !this.isOverflown));
288
+ this.mutationSubscription = this.createMutationObserver()
289
+ .pipe(throttleTime(this.debounceInterval))
290
+ .subscribe(() => {
291
+ this.disabled = !this.isOverflown;
292
+ this.content = this.viewValue;
293
+ });
294
+ this.focusMonitorSubscription = this.focusMonitor
295
+ .monitor(this.elementRef)
296
+ .subscribe((origin) => (origin === 'keyboard' ? this.handleElementEnter() : this.hideTooltip()));
214
297
  }
215
- openChangeFilterNamePopover() {
216
- this.saveNewFilter = false;
217
- this.preparePopover();
298
+ ngOnDestroy() {
299
+ super.ngOnDestroy();
300
+ this.resizeSubscription.unsubscribe();
301
+ this.mutationSubscription.unsubscribe();
302
+ this.focusMonitorSubscription.unsubscribe();
303
+ this.focusMonitor.stopMonitoring(this.elementRef);
218
304
  }
219
- stopEventPropagation(event) {
220
- event.stopPropagation();
305
+ handleElementEnter() {
306
+ this.disabled = !this.isOverflown;
221
307
  }
222
- searchKeydownHandler(event) {
223
- if (event.key === 'Escape') {
224
- this.closePopover();
308
+ hideTooltip() {
309
+ this.disabled = true;
310
+ }
311
+ createMutationObserver() {
312
+ return new Observable((observer) => {
313
+ const mutationObserver = new MutationObserver((mutations) => observer.next(mutations));
314
+ mutationObserver.observe(this.parent, {
315
+ characterData: true,
316
+ attributes: false,
317
+ childList: true,
318
+ subtree: true
319
+ });
320
+ return () => mutationObserver.disconnect();
321
+ });
322
+ }
323
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeTitleDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
324
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: KbqPipeTitleDirective, isStandalone: true, selector: "[kbqPipeTitle]", inputs: { viewValue: ["kbqPipeTitle", "viewValue"] }, host: { listeners: { "mouseenter": "handleElementEnter()", "mouseleave": "hideTooltip()", "window:resize": "resizeStream.next($event)" } }, queries: [{ propertyName: "parentContainer", first: true, predicate: ["kbqTitleContainer"], descendants: true }, { propertyName: "childContainer", predicate: ["kbqTitleText"], descendants: true }], exportAs: ["kbqPipeTitle"], usesInheritance: true, ngImport: i0 }); }
325
+ }
326
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeTitleDirective, decorators: [{
327
+ type: Directive,
328
+ args: [{
329
+ standalone: true,
330
+ selector: '[kbqPipeTitle]',
331
+ exportAs: 'kbqPipeTitle',
332
+ host: {
333
+ '(mouseenter)': 'handleElementEnter()',
334
+ '(mouseleave)': 'hideTooltip()',
335
+ '(window:resize)': 'resizeStream.next($event)'
336
+ }
337
+ }]
338
+ }], propDecorators: { viewValue: [{
339
+ type: Input,
340
+ args: [{ alias: 'kbqPipeTitle' }]
341
+ }], childContainer: [{
342
+ type: ContentChildren,
343
+ args: ['kbqTitleText', { descendants: true }]
344
+ }], parentContainer: [{
345
+ type: ContentChild,
346
+ args: ['kbqTitleContainer']
347
+ }] } });
348
+
349
+ class KbqPipeDateComponent extends KbqBasePipe {
350
+ constructor() {
351
+ super(...arguments);
352
+ this.adapter = inject(DateAdapter);
353
+ this.formatter = inject(DateFormatter);
354
+ /** @docs-private */
355
+ this.placements = PopUpPlacements;
356
+ /** @docs-private */
357
+ this.styles = KbqButtonStyles;
358
+ /** @docs-private */
359
+ this.colors = KbqComponentColors;
360
+ /** Whether the current state is list of periods. When false will displayed control for set custom period */
361
+ this.isListMode = true;
362
+ /** @docs-private */
363
+ this.showStartCalendar = false;
364
+ /** @docs-private */
365
+ this.showEndCalendar = false;
366
+ /** @docs-private */
367
+ this.listSelection = viewChild.required('listSelection', { read: KbqListSelection });
368
+ /** @docs-private */
369
+ this.returnButton = viewChild.required('returnButton', { read: KbqButton });
370
+ }
371
+ /** formatted value for period */
372
+ get formattedValue() {
373
+ if (this.start && this.end) {
374
+ return this.formatter.rangeShortDate(this.start, this.end);
225
375
  }
226
- else {
227
- this.stopEventPropagation(event);
376
+ return this.data.value?.name ?? '';
377
+ }
378
+ /** Whether the current pipe is disabled. */
379
+ get disabled() {
380
+ return (!this.adapter.isDateInstance(this.formGroup.controls.start.value) ||
381
+ !this.adapter.isDateInstance(this.formGroup.controls.end.value) ||
382
+ this.formGroup.controls.start.invalid);
383
+ }
384
+ /** parsed start */
385
+ get start() {
386
+ return this.adapter.parse(this.data.value?.start, '');
387
+ }
388
+ /** default object for start */
389
+ get defaultStart() {
390
+ if (this.data.value?.start) {
391
+ return this.adapter.today().plus(this.data.value?.start);
228
392
  }
393
+ return this.adapter.today();
229
394
  }
230
- onDropdownOpen() {
231
- setTimeout(() => this.search.nativeElement.focus());
395
+ /** parsed end */
396
+ get end() {
397
+ return this.adapter.parse(this.data.value?.end, '');
232
398
  }
233
- resetFilterChanges() {
234
- this.filterBar.resetFilterChangedState();
235
- this.onResetFilterChanges.emit(this.filter);
399
+ /** default object for end */
400
+ get defaultEnd() {
401
+ if (this.data.value?.start) {
402
+ return this.adapter.today();
403
+ }
404
+ return this.adapter.today().plus({ days: 1 });
236
405
  }
237
- /** Hide the popup and restore focus.
238
- * Use this method in the onSave, onSaveAsNew, or onChangeFilter events after the data has been successfully saved. */
239
- filterSavedSuccessfully() {
406
+ /** Whether the current pipe is empty. */
407
+ get isEmpty() {
408
+ if (this.data.value === null)
409
+ return true;
410
+ if (this.data.value?.name)
411
+ return false;
412
+ return !this.adapter.isDateInstance(this.start) || !this.adapter.isDateInstance(this.end);
413
+ }
414
+ /** keydown handler
415
+ * @docs-private */
416
+ onKeydown($event) {
417
+ if (($event.ctrlKey || $event.metaKey) && $event.keyCode === ENTER) {
418
+ this.onApplyPeriod();
419
+ }
420
+ }
421
+ onApplyPeriod() {
422
+ this.data.value = {
423
+ start: this.formGroup.controls.start.value.toISO(),
424
+ end: this.formGroup.controls.end.value.toISO()
425
+ };
426
+ this.stateChanges.next();
427
+ this.filterBar?.onChangePipe.next(this.data);
240
428
  this.popover.hide();
241
- this.restoreFocus();
242
429
  }
243
- /** Shows an error. Use this method in the onSave, onSaveAsNew, or onChangeFilter events if saving data failed. */
244
- filterSavedUnsuccessfully(error) {
245
- this.showError(error);
430
+ onSelect(item) {
431
+ this.data.value = item;
432
+ this.stateChanges.next();
433
+ this.filterBar?.onChangePipe.next(this.data);
434
+ this.popover.hide();
246
435
  }
247
- getFilteredOptions(value) {
248
- const searchFilter = value && value.new ? value.value : value;
249
- return searchFilter
250
- ? this.filters.filter((filter) => filter.name.toLowerCase().includes(searchFilter.toLowerCase()))
251
- : this.filters;
436
+ showPeriod() {
437
+ this.isListMode = false;
438
+ this.showStartCalendar = false;
439
+ this.showEndCalendar = false;
440
+ this.initFormGroup();
441
+ setTimeout(() => {
442
+ this.popover.updatePosition(true);
443
+ this.returnButton().focus();
444
+ });
252
445
  }
253
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilters, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
254
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: KbqFilters, isStandalone: true, selector: "kbq-filters", inputs: { filters: "filters" }, outputs: { onSelectFilter: "onSelectFilter", onSave: "onSave", onChangeFilter: "onChangeFilter", onSaveAsNew: "onSaveAsNew", onRemoveFilter: "onRemoveFilter", onResetFilterChanges: "onResetFilterChanges" }, host: { classAttribute: "kbq-filters" }, viewQueries: [{ propertyName: "button", first: true, predicate: KbqButton, descendants: true }, { propertyName: "popover", first: true, predicate: KbqPopoverTrigger, descendants: true }, { propertyName: "dropdown", first: true, predicate: KbqDropdownTrigger, descendants: true }, { propertyName: "search", first: true, predicate: ["search"], descendants: true }, { propertyName: "newFilterName", first: true, predicate: ["newFilterName"], descendants: true }], exportAs: ["kbqFilters"], ngImport: i0, template: "<button\n kbq-button\n kbq-title\n kbqFilterBarButton\n kbqPopover\n [kbqDropdownTriggerFor]=\"savedFilters\"\n [kbqPopoverArrow]=\"false\"\n [kbqPopoverClass]=\"'kbq-filters__save-as-new-filter-popover'\"\n [kbqPopoverContent]=\"saveAsNewPopoverContent\"\n [kbqPopoverFooter]=\"saveAsNewPopoverFooter\"\n [kbqPopoverHeader]=\"saveAsNewPopoverHeader\"\n [kbqPopoverPlacement]=\"placements.BottomLeft\"\n [kbqPopoverPlacementPriority]=\"[placements.BottomLeft, placements.TopLeft]\"\n [kbqPopoverSize]=\"popoverSize\"\n [kbqTrigger]=\"'manual'\"\n [ngClass]=\"{ 'kbq-active': opened }\"\n (dropdownClosed)=\"searchControl.setValue('')\"\n (dropdownOpened)=\"onDropdownOpen()\"\n>\n <span #kbqTitleText class=\"kbq-filters__filter-name\">\n @if (filter?.name) {\n {{ filter!.name }}\n } @else {\n <ng-content>\n <i kbq-icon=\"kbq-list_16\"></i>\n {{ filterBar.configuration.filters.defaultName }}\n </ng-content>\n }\n </span>\n</button>\n\n@if (filterBar.isChanged && !filterBar.isSaved) {\n <button\n kbq-button\n kbqFilterBarButton\n kbqTooltip=\"{{ filterBar.configuration.filters.saveNewFilterTooltip }}\"\n class=\"kbq-button_action\"\n [color]=\"colors.Empty\"\n (click)=\"openSaveAsNewFilterPopover()\"\n >\n <i kbq-icon=\"kbq-floppy-disk_16\"></i>\n </button>\n}\n\n@if (filterBar.isSaved) {\n <button\n kbq-button\n kbqFilterBarButton\n class=\"kbq-button_action\"\n [color]=\"colors.Empty\"\n [kbqDropdownTriggerFor]=\"filterActions\"\n [ngClass]=\"{ 'kbq-button_changed-saved-filter': filterBar.isSavedAndChanged }\"\n >\n <i kbq-icon=\"kbq-ellipsis-vertical_16\"></i>\n </button>\n\n <i kbq-icon=\"kbq-chevron-right-s_16\" class=\"kbq-filter-bar__arrow\" [color]=\"'theme'\"></i>\n} @else {\n <kbq-divider class=\"kbq-filter-bar__separator\" [vertical]=\"true\" />\n}\n\n<kbq-dropdown #savedFilters=\"kbqDropdown\" [class]=\"'kbq-filters__dropdown'\">\n <div [style.display]=\"isEmpty ? 'none' : 'initial'\">\n <kbq-form-field kbqFormFieldWithoutBorders>\n <i kbq-icon=\"kbq-magnifying-glass_16\" kbqPrefix></i>\n\n <input\n #search\n autocomplete=\"off\"\n kbqInput\n placeholder=\"{{ filterBar.configuration.filters.searchPlaceholder }}\"\n [formControl]=\"searchControl\"\n (click)=\"stopEventPropagation($event)\"\n (keydown)=\"searchKeydownHandler($event)\"\n />\n <kbq-cleaner />\n </kbq-form-field>\n\n <kbq-divider />\n\n @for (filter of filteredOptions | async; track filter) {\n <button\n kbq-dropdown-item\n kbq-title\n [class.kbq-selected]=\"filterBar.filter?.name === filter.name\"\n (click)=\"selectFilter(filter)\"\n >\n {{ filter.name }}\n </button>\n } @empty {\n <button kbq-dropdown-item [disabled]=\"true\">\n {{ filterBar.configuration.filters.searchEmptyResult }}\n </button>\n }\n\n <kbq-divider />\n </div>\n\n <button kbq-dropdown-item (click)=\"openSaveAsNewFilterPopover()\">\n <i kbq-icon=\"kbq-plus_16\"></i>\n {{ filterBar.configuration.filters.saveAsNewFilter }}\n </button>\n</kbq-dropdown>\n\n<kbq-dropdown #filterActions=\"kbqDropdown\" [class]=\"'kbq-filters__dropdown'\">\n @if (filterBar.isSavedAndChanged && !filterBar.isReadOnly) {\n <button\n kbq-dropdown-item\n [ngClass]=\"{ 'kbq-button_changed-saved-filter': filterBar.isSavedAndChanged }\"\n (click)=\"saveChanges()\"\n >\n <i kbq-icon=\"kbq-floppy-disk_16\"></i>\n {{ filterBar.configuration.filters.saveChanges }}\n @if (filterBar.isSavedAndChanged) {\n <i class=\"kbq kbq-icon kbq-icon-button kbq-circle-xs_16 kbq-warning layout-margin-left-xs\"></i>\n }\n </button>\n }\n <button kbq-dropdown-item (click)=\"openSaveAsNewFilterPopover()\">\n <i kbq-icon=\"kbq-plus_16\"></i>\n {{ filterBar.configuration.filters.saveAsNew }}\n </button>\n\n @if (!filterBar.isReadOnly) {\n <button kbq-dropdown-item (click)=\"openChangeFilterNamePopover()\">\n <i kbq-icon=\"kbq-pencil_16\"></i>\n {{ filterBar.configuration.filters.change }}\n </button>\n }\n\n @if (filterBar.isSavedAndChanged || !filterBar.isReadOnly) {\n <kbq-divider />\n }\n\n @if (filterBar.isSavedAndChanged) {\n <button kbq-dropdown-item (click)=\"resetFilterChanges()\">\n <i kbq-icon=\"kbq-xmark-circle_16\"></i>\n {{ filterBar.configuration.filters.resetChanges }}\n </button>\n }\n @if (!filterBar.isReadOnly) {\n <button kbq-dropdown-item (click)=\"this.onRemoveFilter.next(this.filter!)\">\n <i kbq-icon=\"kbq-trash_16\"></i>\n {{ filterBar.configuration.filters.remove }}\n </button>\n }\n</kbq-dropdown>\n\n<ng-template #saveAsNewPopoverHeader>{{ popoverHeader }}</ng-template>\n\n<ng-template #saveAsNewPopoverContent>\n @if (showFilterSavingError) {\n <kbq-alert class=\"layout-margin-bottom-m\" [alertColor]=\"'error'\" [alertStyle]=\"'colored'\" [compact]=\"true\">\n {{ filterSavingErrorText }}\n </kbq-alert>\n }\n <div class=\"kbq-form-vertical\">\n <div class=\"kbq-form__row\">\n <label class=\"kbq-form__label\">{{ filterBar.configuration.filters.name }}</label>\n\n <kbq-form-field class=\"kbq-form__control\">\n <input #newFilterName kbqInput type=\"text\" [formControl]=\"filterName\" />\n\n @if (filterName.hasError('filterNameAlreadyExist')) {\n <kbq-hint [color]=\"'error'\">{{ filterBar.configuration.filters.error }}</kbq-hint>\n }\n </kbq-form-field>\n </div>\n </div>\n</ng-template>\n\n<ng-template #saveAsNewPopoverFooter>\n <button kbq-button class=\"layout-margin-right-l\" [color]=\"'contrast'\" [kbqStyle]=\"'filled'\" (click)=\"saveAsNew()\">\n {{ filterBar.configuration.filters.saveButton }}\n </button>\n <button kbq-button [color]=\"'contrast-fade'\" [kbqStyle]=\"'filled'\" (click)=\"closePopover()\">\n {{ filterBar.configuration.filters.cancelButton }}\n </button>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-filters{display:flex}.kbq-filters>.kbq-button{max-width:320px}.kbq-filters>.kbq-button .kbq-button-wrapper{width:100%}.kbq-filters>.kbq-button .kbq-icon{margin-right:var(--kbq-size-xxs)}.kbq-filters .kbq-filters__filter-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-filters .kbq-filter-bar__separator{align-self:center;height:var(--kbq-size-m)!important;margin-left:calc(var(--kbq-size-s) + var(--kbq-size-xs))!important;margin-right:var(--kbq-size-xs)!important}.kbq-filters .kbq-filter-bar__arrow{align-self:center;margin-left:var(--kbq-size-s)}.kbq-filters .kbq-button.kbq-button_changed-filter{border-bottom-right-radius:unset;border-top-right-radius:unset}.kbq-filters .kbq-button-icon{margin-left:-1px;border-bottom-left-radius:unset;border-top-left-radius:unset}.kbq-filters .kbq-button_changed-saved-filter:before{content:\"\";position:absolute;right:-4px;top:-4px;width:var(--kbq-size-s);height:var(--kbq-size-s);border:2px solid var(--kbq-background-bg);border-radius:var(--kbq-size-xs);background:var(--kbq-icon-warning)}.kbq-filters .kbq-button:not(:hover,.kbq-active)+.kbq-button_action:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:var(--kbq-size-m);background:var(--kbq-line-contrast-less)}.kbq-filters__save-as-new-filter-popover .kbq-popover__container{width:400px}.kbq-filters__save-as-new-filter-popover .kbq-popover__content{padding:var(--kbq-size-s) var(--kbq-size-xxl)}.kbq-filters__dropdown .kbq-dropdown-item{padding-right:var(--kbq-size-s)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "directive", type: i1.KbqButtonDropdownTrigger, selector: "[kbq-button][kbqDropdownTriggerFor]" }, { kind: "ngmodule", type: KbqDropdownModule }, { kind: "component", type: i3.KbqDropdown, selector: "kbq-dropdown", inputs: ["navigationWithWrap", "xPosition", "yPosition", "overlapTriggerY", "overlapTriggerX", "hasBackdrop", "class", "backdropClass"], outputs: ["closed"], exportAs: ["kbqDropdown"] }, { kind: "component", type: i3.KbqDropdownItem, selector: "kbq-dropdown-item, [kbq-dropdown-item]", inputs: ["disabled"], exportAs: ["kbqDropdownItem"] }, { kind: "directive", type: i3.KbqDropdownTrigger, selector: "[kbqDropdownTriggerFor]", inputs: ["kbqDropdownTriggerData", "openByArrowDown", "kbqDropdownTriggerRestoreFocus", "kbqDropdownTriggerFor"], outputs: ["dropdownOpened", "dropdownClosed"], exportAs: ["kbqDropdownTrigger"] }, { kind: "ngmodule", type: KbqDividerModule }, { kind: "component", type: i4.KbqDivider, selector: "kbq-divider", inputs: ["vertical", "inset", "paddings"] }, { kind: "component", type: KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "ngmodule", type: KbqTitleModule }, { kind: "directive", type: i5.KbqTitleDirective, selector: "[kbq-title]", exportAs: ["kbqTitle"] }, { kind: "ngmodule", type: KbqFormFieldModule }, { kind: "component", type: i6.KbqFormField, selector: "kbq-form-field", exportAs: ["kbqFormField"] }, { kind: "directive", type: i6.KbqFormFieldWithoutBorders, selector: "kbq-form-field[kbqFormFieldWithoutBorders]", exportAs: ["kbqFormFieldWithoutBorders"] }, { kind: "component", type: i6.KbqHint, selector: "kbq-hint", inputs: ["id", "fillTextOff", "compact"], exportAs: ["kbqHint"] }, { kind: "directive", type: i6.KbqPrefix, selector: "[kbqPrefix]" }, { kind: "component", type: i6.KbqCleaner, selector: "kbq-cleaner", exportAs: ["kbqCleaner"] }, { kind: "directive", type: i6.KbqValidateDirective, selector: " input[kbqInput], input[kbqNumberInput], input[kbqInputPassword], input[kbqTimepicker], input[kbqDatepicker], textarea[kbqTextarea], kbq-select, kbq-tree-select, kbq-tag-list ", exportAs: ["KbqValidate"] }, { kind: "directive", type: i6.KbqTrim, selector: "[kbqInput], [kbqTextarea]", exportAs: ["KbqTrim"] }, { kind: "ngmodule", type: KbqInputModule }, { kind: "directive", type: i3$1.KbqInput, selector: "input[kbqInput],input[kbqNumberInput]", inputs: ["errorStateMatcher", "placeholder", "disabled", "id", "required", "type", "value"], exportAs: ["kbqInput"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: KbqFilterBarButton, selector: "[kbqFilterBarButton]" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: KbqTooltipTrigger, selector: "[kbqTooltip]", inputs: ["kbqVisible", "kbqPlacement", "kbqRelativeToPointer", "kbqPlacementPriority", "kbqTooltip", "kbqTooltipDisabled", "kbqEnterDelay", "kbqLeaveDelay", "kbqTrigger", "kbqTooltipClass", "kbqTooltipContext", "kbqTooltipColor", "kbqTooltipArrow", "kbqTooltipOffset"], outputs: ["kbqPlacementChange", "kbqVisibleChange"], exportAs: ["kbqTooltip"] }, { kind: "ngmodule", type: KbqPopoverModule }, { kind: "directive", type: i5$1.KbqPopoverTrigger, selector: "[kbqPopover]", inputs: ["kbqPopoverVisible", "kbqPopoverPlacement", "kbqPopoverPlacementPriority", "hasBackdrop", "kbqPopoverHeader", "kbqPopoverContent", "kbqPopoverFooter", "kbqPopoverDisabled", "kbqTrigger", "kbqPopoverSize", "kbqPopoverClass", "hasCloseButton", "closeOnScroll", "backdropClass", "kbqPopoverArrow", "kbqPopoverOffset"], outputs: ["kbqPopoverPlacementChange", "kbqPopoverVisibleChange"], exportAs: ["kbqPopover"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: KbqFormsModule }, { kind: "directive", type: i3$2.KbqForm, selector: ".kbq-form-vertical, .kbq-form-horizontal", exportAs: ["kbqForm"] }, { kind: "directive", type: i3$2.KbqFormElement, selector: ".kbq-form__row, .kbq-form__fieldset, .kbq-form__legend", exportAs: ["kbqFormElement"] }, { kind: "ngmodule", type: KbqAlertModule }, { kind: "component", type: i10.KbqAlert, selector: "kbq-alert", inputs: ["compact", "alertStyle", "alertColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
255
- }
256
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilters, decorators: [{
257
- type: Component,
258
- args: [{ standalone: true, exportAs: 'kbqFilters', selector: 'kbq-filters', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
259
- class: 'kbq-filters'
260
- }, imports: [
261
- ReactiveFormsModule,
262
- KbqButtonModule,
263
- KbqDropdownModule,
264
- KbqDividerModule,
265
- KbqIcon,
266
- KbqTitleModule,
267
- KbqFormFieldModule,
268
- KbqInputModule,
269
- NgClass,
270
- KbqFilterBarButton,
271
- AsyncPipe,
272
- KbqTooltipTrigger,
273
- KbqPopoverModule,
274
- FormsModule,
275
- KbqFormsModule,
276
- KbqAlertModule
277
- ], template: "<button\n kbq-button\n kbq-title\n kbqFilterBarButton\n kbqPopover\n [kbqDropdownTriggerFor]=\"savedFilters\"\n [kbqPopoverArrow]=\"false\"\n [kbqPopoverClass]=\"'kbq-filters__save-as-new-filter-popover'\"\n [kbqPopoverContent]=\"saveAsNewPopoverContent\"\n [kbqPopoverFooter]=\"saveAsNewPopoverFooter\"\n [kbqPopoverHeader]=\"saveAsNewPopoverHeader\"\n [kbqPopoverPlacement]=\"placements.BottomLeft\"\n [kbqPopoverPlacementPriority]=\"[placements.BottomLeft, placements.TopLeft]\"\n [kbqPopoverSize]=\"popoverSize\"\n [kbqTrigger]=\"'manual'\"\n [ngClass]=\"{ 'kbq-active': opened }\"\n (dropdownClosed)=\"searchControl.setValue('')\"\n (dropdownOpened)=\"onDropdownOpen()\"\n>\n <span #kbqTitleText class=\"kbq-filters__filter-name\">\n @if (filter?.name) {\n {{ filter!.name }}\n } @else {\n <ng-content>\n <i kbq-icon=\"kbq-list_16\"></i>\n {{ filterBar.configuration.filters.defaultName }}\n </ng-content>\n }\n </span>\n</button>\n\n@if (filterBar.isChanged && !filterBar.isSaved) {\n <button\n kbq-button\n kbqFilterBarButton\n kbqTooltip=\"{{ filterBar.configuration.filters.saveNewFilterTooltip }}\"\n class=\"kbq-button_action\"\n [color]=\"colors.Empty\"\n (click)=\"openSaveAsNewFilterPopover()\"\n >\n <i kbq-icon=\"kbq-floppy-disk_16\"></i>\n </button>\n}\n\n@if (filterBar.isSaved) {\n <button\n kbq-button\n kbqFilterBarButton\n class=\"kbq-button_action\"\n [color]=\"colors.Empty\"\n [kbqDropdownTriggerFor]=\"filterActions\"\n [ngClass]=\"{ 'kbq-button_changed-saved-filter': filterBar.isSavedAndChanged }\"\n >\n <i kbq-icon=\"kbq-ellipsis-vertical_16\"></i>\n </button>\n\n <i kbq-icon=\"kbq-chevron-right-s_16\" class=\"kbq-filter-bar__arrow\" [color]=\"'theme'\"></i>\n} @else {\n <kbq-divider class=\"kbq-filter-bar__separator\" [vertical]=\"true\" />\n}\n\n<kbq-dropdown #savedFilters=\"kbqDropdown\" [class]=\"'kbq-filters__dropdown'\">\n <div [style.display]=\"isEmpty ? 'none' : 'initial'\">\n <kbq-form-field kbqFormFieldWithoutBorders>\n <i kbq-icon=\"kbq-magnifying-glass_16\" kbqPrefix></i>\n\n <input\n #search\n autocomplete=\"off\"\n kbqInput\n placeholder=\"{{ filterBar.configuration.filters.searchPlaceholder }}\"\n [formControl]=\"searchControl\"\n (click)=\"stopEventPropagation($event)\"\n (keydown)=\"searchKeydownHandler($event)\"\n />\n <kbq-cleaner />\n </kbq-form-field>\n\n <kbq-divider />\n\n @for (filter of filteredOptions | async; track filter) {\n <button\n kbq-dropdown-item\n kbq-title\n [class.kbq-selected]=\"filterBar.filter?.name === filter.name\"\n (click)=\"selectFilter(filter)\"\n >\n {{ filter.name }}\n </button>\n } @empty {\n <button kbq-dropdown-item [disabled]=\"true\">\n {{ filterBar.configuration.filters.searchEmptyResult }}\n </button>\n }\n\n <kbq-divider />\n </div>\n\n <button kbq-dropdown-item (click)=\"openSaveAsNewFilterPopover()\">\n <i kbq-icon=\"kbq-plus_16\"></i>\n {{ filterBar.configuration.filters.saveAsNewFilter }}\n </button>\n</kbq-dropdown>\n\n<kbq-dropdown #filterActions=\"kbqDropdown\" [class]=\"'kbq-filters__dropdown'\">\n @if (filterBar.isSavedAndChanged && !filterBar.isReadOnly) {\n <button\n kbq-dropdown-item\n [ngClass]=\"{ 'kbq-button_changed-saved-filter': filterBar.isSavedAndChanged }\"\n (click)=\"saveChanges()\"\n >\n <i kbq-icon=\"kbq-floppy-disk_16\"></i>\n {{ filterBar.configuration.filters.saveChanges }}\n @if (filterBar.isSavedAndChanged) {\n <i class=\"kbq kbq-icon kbq-icon-button kbq-circle-xs_16 kbq-warning layout-margin-left-xs\"></i>\n }\n </button>\n }\n <button kbq-dropdown-item (click)=\"openSaveAsNewFilterPopover()\">\n <i kbq-icon=\"kbq-plus_16\"></i>\n {{ filterBar.configuration.filters.saveAsNew }}\n </button>\n\n @if (!filterBar.isReadOnly) {\n <button kbq-dropdown-item (click)=\"openChangeFilterNamePopover()\">\n <i kbq-icon=\"kbq-pencil_16\"></i>\n {{ filterBar.configuration.filters.change }}\n </button>\n }\n\n @if (filterBar.isSavedAndChanged || !filterBar.isReadOnly) {\n <kbq-divider />\n }\n\n @if (filterBar.isSavedAndChanged) {\n <button kbq-dropdown-item (click)=\"resetFilterChanges()\">\n <i kbq-icon=\"kbq-xmark-circle_16\"></i>\n {{ filterBar.configuration.filters.resetChanges }}\n </button>\n }\n @if (!filterBar.isReadOnly) {\n <button kbq-dropdown-item (click)=\"this.onRemoveFilter.next(this.filter!)\">\n <i kbq-icon=\"kbq-trash_16\"></i>\n {{ filterBar.configuration.filters.remove }}\n </button>\n }\n</kbq-dropdown>\n\n<ng-template #saveAsNewPopoverHeader>{{ popoverHeader }}</ng-template>\n\n<ng-template #saveAsNewPopoverContent>\n @if (showFilterSavingError) {\n <kbq-alert class=\"layout-margin-bottom-m\" [alertColor]=\"'error'\" [alertStyle]=\"'colored'\" [compact]=\"true\">\n {{ filterSavingErrorText }}\n </kbq-alert>\n }\n <div class=\"kbq-form-vertical\">\n <div class=\"kbq-form__row\">\n <label class=\"kbq-form__label\">{{ filterBar.configuration.filters.name }}</label>\n\n <kbq-form-field class=\"kbq-form__control\">\n <input #newFilterName kbqInput type=\"text\" [formControl]=\"filterName\" />\n\n @if (filterName.hasError('filterNameAlreadyExist')) {\n <kbq-hint [color]=\"'error'\">{{ filterBar.configuration.filters.error }}</kbq-hint>\n }\n </kbq-form-field>\n </div>\n </div>\n</ng-template>\n\n<ng-template #saveAsNewPopoverFooter>\n <button kbq-button class=\"layout-margin-right-l\" [color]=\"'contrast'\" [kbqStyle]=\"'filled'\" (click)=\"saveAsNew()\">\n {{ filterBar.configuration.filters.saveButton }}\n </button>\n <button kbq-button [color]=\"'contrast-fade'\" [kbqStyle]=\"'filled'\" (click)=\"closePopover()\">\n {{ filterBar.configuration.filters.cancelButton }}\n </button>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-filters{display:flex}.kbq-filters>.kbq-button{max-width:320px}.kbq-filters>.kbq-button .kbq-button-wrapper{width:100%}.kbq-filters>.kbq-button .kbq-icon{margin-right:var(--kbq-size-xxs)}.kbq-filters .kbq-filters__filter-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-filters .kbq-filter-bar__separator{align-self:center;height:var(--kbq-size-m)!important;margin-left:calc(var(--kbq-size-s) + var(--kbq-size-xs))!important;margin-right:var(--kbq-size-xs)!important}.kbq-filters .kbq-filter-bar__arrow{align-self:center;margin-left:var(--kbq-size-s)}.kbq-filters .kbq-button.kbq-button_changed-filter{border-bottom-right-radius:unset;border-top-right-radius:unset}.kbq-filters .kbq-button-icon{margin-left:-1px;border-bottom-left-radius:unset;border-top-left-radius:unset}.kbq-filters .kbq-button_changed-saved-filter:before{content:\"\";position:absolute;right:-4px;top:-4px;width:var(--kbq-size-s);height:var(--kbq-size-s);border:2px solid var(--kbq-background-bg);border-radius:var(--kbq-size-xs);background:var(--kbq-icon-warning)}.kbq-filters .kbq-button:not(:hover,.kbq-active)+.kbq-button_action:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:var(--kbq-size-m);background:var(--kbq-line-contrast-less)}.kbq-filters__save-as-new-filter-popover .kbq-popover__container{width:400px}.kbq-filters__save-as-new-filter-popover .kbq-popover__content{padding:var(--kbq-size-s) var(--kbq-size-xxl)}.kbq-filters__dropdown .kbq-dropdown-item{padding-right:var(--kbq-size-s)}\n"] }]
278
- }], ctorParameters: () => [], propDecorators: { button: [{
279
- type: ViewChild,
280
- args: [KbqButton]
281
- }], popover: [{
282
- type: ViewChild,
283
- args: [KbqPopoverTrigger]
284
- }], dropdown: [{
285
- type: ViewChild,
286
- args: [KbqDropdownTrigger]
287
- }], search: [{
288
- type: ViewChild,
289
- args: ['search']
290
- }], newFilterName: [{
291
- type: ViewChild,
292
- args: ['newFilterName']
293
- }], filters: [{
294
- type: Input
295
- }], onSelectFilter: [{
296
- type: Output
297
- }], onSave: [{
298
- type: Output
299
- }], onChangeFilter: [{
300
- type: Output
301
- }], onSaveAsNew: [{
302
- type: Output
303
- }], onRemoveFilter: [{
304
- type: Output
305
- }], onResetFilterChanges: [{
306
- type: Output
307
- }] } });
308
-
309
- class KbqFilterBar {
310
- /** Filter that is currently selected */
311
- get filter() {
312
- return this._filter;
313
- }
314
- set filter(value) {
315
- if (this._filter === value)
316
- return;
317
- this._filter = value;
318
- this.changes.next();
319
- }
320
- /** An array of templates that are used when adding a pipe. Also contains lists of options to select (values). */
321
- set pipeTemplates(value) {
322
- this._templates = value;
323
- this.internalTemplatesChanges.next(this._templates);
324
- }
325
- get pipeTemplates() {
326
- return this._templates;
327
- }
328
- get isSavedAndChanged() {
329
- return this.isSaved && this.isChanged;
330
- }
331
- get isSaved() {
332
- return !!this.filter?.saved;
333
- }
334
- get isChanged() {
335
- return !!this.filter?.changed;
336
- }
337
- get isReadOnly() {
338
- return !!this.filter?.readonly;
339
- }
340
- get isDisabled() {
341
- return !!this.filter?.disabled;
342
- }
343
- constructor() {
344
- this.changeDetectorRef = inject(ChangeDetectorRef);
345
- this.localeService = inject(KBQ_LOCALE_SERVICE, { optional: true });
346
- this.externalConfiguration = inject(KBQ_FILTER_BAR_CONFIGURATION, { optional: true });
347
- this._templates = [];
348
- /**
349
- * Event that emits whenever the raw value of the filter changes. This is here primarily
350
- * to facilitate the two-way binding for the `filter` input.
351
- * @docs-private
352
- */
353
- this.filterChange = new EventEmitter();
354
- /** Event that emits whenever the value of the pipe changes. */
355
- this.onChangePipe = new EventEmitter();
356
- /** Event that emits whenever the pipe deleted. */
357
- this.onRemovePipe = new EventEmitter();
358
- this.savedFilter = null;
359
- this.changes = new BehaviorSubject(undefined);
360
- this.internalFilterChanges = new BehaviorSubject(null);
361
- this.internalTemplatesChanges = new BehaviorSubject(null);
362
- this.openPipe = new BehaviorSubject(null);
363
- this.updateLocaleParams = () => {
364
- this.configuration = this.externalConfiguration || this.localeService?.getParams('filterBar');
365
- this.changeDetectorRef.markForCheck();
366
- };
367
- this.internalFilterChanges.pipe(takeUntilDestroyed()).subscribe((filter) => {
368
- this._filter = filter;
369
- this.filterChange.emit(this.filter);
370
- });
371
- this.localeService?.changes.pipe(takeUntilDestroyed()).subscribe(this.updateLocaleParams);
372
- if (!this.localeService) {
373
- this.initDefaultParams();
374
- }
375
- merge(this.onChangePipe, this.onRemovePipe)
376
- .pipe(takeUntilDestroyed())
377
- .subscribe(() => {
378
- if (this.filter) {
379
- this.filter.changed = true;
380
- }
381
- this.filterChange.emit(this.filter);
382
- });
383
- merge(this.filterChange, this.onChangePipe, this.onRemovePipe, this.internalFilterChanges)
384
- .pipe(takeUntilDestroyed())
385
- .subscribe(() => {
386
- this.changes.next();
387
- this.changeDetectorRef.markForCheck();
388
- });
389
- }
390
- /** Remove pipe from current filter and emit event */
391
- removePipe(pipe) {
392
- this.filter?.pipes.splice(this.filter?.pipes.indexOf(pipe), 1);
393
- this.onRemovePipe.next(pipe);
394
- }
395
- /** Save current state of filter */
396
- saveFilterState(filter) {
397
- this.savedFilter = structuredClone(filter ?? this.filter);
398
- }
399
- /** Restore previously saved filter state */
400
- restoreFilterState(filter) {
401
- this.filter = structuredClone(filter ?? this.savedFilter);
402
- }
403
- /** Set the filter state "changed" to false */
404
- resetFilterChangedState() {
405
- this.filter.changed = false;
446
+ showList() {
447
+ this.isListMode = true;
448
+ setTimeout(() => this.listSelection().focus());
449
+ this.popover.updatePosition(true);
406
450
  }
407
- initDefaultParams() {
408
- this.configuration = KBQ_FILTER_BAR_DEFAULT_CONFIGURATION;
451
+ /** opens popover */
452
+ open() {
453
+ this.popover.show();
409
454
  }
410
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
411
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: KbqFilterBar, isStandalone: true, selector: "kbq-filter-bar, [kbq-filter-bar]", inputs: { filter: "filter", pipeTemplates: "pipeTemplates" }, outputs: { filterChange: "filterChange", onChangePipe: "onChangePipe", onRemovePipe: "onRemovePipe" }, host: { classAttribute: "kbq-filter-bar" }, queries: [{ propertyName: "filters", first: true, predicate: KbqFilters, descendants: true }, { propertyName: "filterReset", first: true, predicate: KbqFilterReset, descendants: true }], ngImport: i0, template: `
412
- <div class="kbq-filter-bar__left">
413
- <ng-content select="kbq-filters" />
414
-
415
- <ng-content />
416
-
417
- <ng-content select="kbq-pipe-add" />
418
-
419
- <ng-content select="kbq-filter-reset" />
420
- </div>
421
-
422
- <div class="kbq-filter-bar__right">
423
- <ng-content select="kbq-filter-search, [kbq-filter-search]" />
424
-
425
- <ng-content select="kbq-filter-refresher, [kbq-filter-refresher]" />
426
- </div>
427
- `, isInline: true, styles: [".kbq-filter-bar{display:flex;flex-direction:row;justify-content:space-between;width:100%}.kbq-filter-bar .kbq-filter-bar__left{display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--kbq-size-s)}.kbq-filter-bar .kbq-filter-bar__left .kbq-button>.kbq-icon{margin-right:var(--kbq-size-xxs)}.kbq-filter-bar .kbq-filter-bar__left>.kbq-icon{align-self:center}.kbq-filter-bar .kbq-filter-bar__right{display:flex;flex-direction:row;margin-left:var(--kbq-size-3xl)}.kbq-pipe__popover .kbq-popover__container{min-width:320px;max-width:320px}.kbq-pipe__popover .kbq-popover__content{padding:var(--kbq-size-m) var(--kbq-size-m) 1px!important}.kbq-pipe__popover .kbq-popover__footer{padding:var(--kbq-size-xxs)}.kbq-pipe__popover .kbq-popover__footer .kbq-button:not(.kbq-disabled){display:flex;flex-direction:row;width:100%;justify-content:flex-start}.kbq-pipe__popover .kbq-popover__footer .kbq-button:not(.kbq-disabled) .kbq-button_hot-key{color:var(--kbq-foreground-contrast-secondary)}.kbq-button-overlay{display:none}.kbq-button,.kbq-button-icon{-webkit-font-smoothing:antialiased}.kbq-button.kbq-button_changed-filter,.kbq-button-icon.kbq-button_changed-filter{color:var(--kbq-foreground-theme);background:var(--kbq-states-background-theme-less-active)}.kbq-button.kbq-button_changed-filter .kbq-icon,.kbq-button-icon.kbq-button_changed-filter .kbq-icon,.kbq-button.kbq-button_changed-filter .kbq-icon.kbq-icon_left,.kbq-button-icon.kbq-button_changed-filter .kbq-icon.kbq-icon_left,.kbq-button.kbq-button_changed-filter .kbq-icon.kbq-icon_right,.kbq-button-icon.kbq-button_changed-filter .kbq-icon.kbq-icon_right{color:var(--kbq-icon-theme)}.kbq-button.kbq-button_changed-filter:hover:not(.kbq-disabled),.kbq-button.kbq-button_changed-filter.kbq-hover:not(.kbq-disabled),.kbq-button-icon.kbq-button_changed-filter:hover:not(.kbq-disabled),.kbq-button-icon.kbq-button_changed-filter.kbq-hover:not(.kbq-disabled){background:var(--kbq-states-background-theme-less-hover)}.kbq-button.kbq-button_changed-filter:active:not(.kbq-disabled),.kbq-button.kbq-button_changed-filter.kbq-active:not(.kbq-disabled),.kbq-button-icon.kbq-button_changed-filter:active:not(.kbq-disabled),.kbq-button-icon.kbq-button_changed-filter.kbq-active:not(.kbq-disabled){background:var(--kbq-states-background-theme-fade-active)}.kbq-button.kbq-button_changed-filter.cdk-keyboard-focused,.kbq-button-icon.kbq-button_changed-filter.cdk-keyboard-focused{outline:1px solid var(--kbq-states-line-focus-theme);border-color:var(--kbq-states-line-focus-theme)}.kbq-button.kbq-button_changed-filter.kbq-disabled,.kbq-button-icon.kbq-button_changed-filter.kbq-disabled{color:var(--kbq-states-foreground-disable);background:var(--kbq-states-background-disable)}.kbq-button.kbq-button_changed-filter.kbq-disabled .kbq-icon,.kbq-button-icon.kbq-button_changed-filter.kbq-disabled .kbq-icon,.kbq-button.kbq-button_changed-filter.kbq-disabled .kbq-icon.kbq-icon_left,.kbq-button-icon.kbq-button_changed-filter.kbq-disabled .kbq-icon.kbq-icon_left,.kbq-button.kbq-button_changed-filter.kbq-disabled .kbq-icon.kbq-icon_right,.kbq-button-icon.kbq-button_changed-filter.kbq-disabled .kbq-icon.kbq-icon_right{color:var(--kbq-states-icon-disabled)}.kbq-hint.kbq-date-period__hint .kbq-hint__text{font-size:var(--kbq-typography-text-compact-font-size);font-weight:var(--kbq-typography-text-compact-font-weight);line-height:var(--kbq-typography-text-compact-line-height);font-family:var(--kbq-typography-text-compact-font-family);text-transform:var(--kbq-typography-text-compact-text-transform);font-feature-settings:var(--kbq-typography-text-compact-font-feature-settings);letter-spacing:var(--kbq-typography-text-compact-letter-spacing)}\n"], dependencies: [{ kind: "ngmodule", type: KbqDividerModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
428
- }
429
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBar, decorators: [{
430
- type: Component,
431
- args: [{ standalone: true, selector: 'kbq-filter-bar, [kbq-filter-bar]', template: `
432
- <div class="kbq-filter-bar__left">
433
- <ng-content select="kbq-filters" />
434
-
435
- <ng-content />
436
-
437
- <ng-content select="kbq-pipe-add" />
438
-
439
- <ng-content select="kbq-filter-reset" />
440
- </div>
441
-
442
- <div class="kbq-filter-bar__right">
443
- <ng-content select="kbq-filter-search, [kbq-filter-search]" />
444
-
445
- <ng-content select="kbq-filter-refresher, [kbq-filter-refresher]" />
446
- </div>
447
- `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [KbqDividerModule], host: {
448
- class: 'kbq-filter-bar'
449
- }, styles: [".kbq-filter-bar{display:flex;flex-direction:row;justify-content:space-between;width:100%}.kbq-filter-bar .kbq-filter-bar__left{display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--kbq-size-s)}.kbq-filter-bar .kbq-filter-bar__left .kbq-button>.kbq-icon{margin-right:var(--kbq-size-xxs)}.kbq-filter-bar .kbq-filter-bar__left>.kbq-icon{align-self:center}.kbq-filter-bar .kbq-filter-bar__right{display:flex;flex-direction:row;margin-left:var(--kbq-size-3xl)}.kbq-pipe__popover .kbq-popover__container{min-width:320px;max-width:320px}.kbq-pipe__popover .kbq-popover__content{padding:var(--kbq-size-m) var(--kbq-size-m) 1px!important}.kbq-pipe__popover .kbq-popover__footer{padding:var(--kbq-size-xxs)}.kbq-pipe__popover .kbq-popover__footer .kbq-button:not(.kbq-disabled){display:flex;flex-direction:row;width:100%;justify-content:flex-start}.kbq-pipe__popover .kbq-popover__footer .kbq-button:not(.kbq-disabled) .kbq-button_hot-key{color:var(--kbq-foreground-contrast-secondary)}.kbq-button-overlay{display:none}.kbq-button,.kbq-button-icon{-webkit-font-smoothing:antialiased}.kbq-button.kbq-button_changed-filter,.kbq-button-icon.kbq-button_changed-filter{color:var(--kbq-foreground-theme);background:var(--kbq-states-background-theme-less-active)}.kbq-button.kbq-button_changed-filter .kbq-icon,.kbq-button-icon.kbq-button_changed-filter .kbq-icon,.kbq-button.kbq-button_changed-filter .kbq-icon.kbq-icon_left,.kbq-button-icon.kbq-button_changed-filter .kbq-icon.kbq-icon_left,.kbq-button.kbq-button_changed-filter .kbq-icon.kbq-icon_right,.kbq-button-icon.kbq-button_changed-filter .kbq-icon.kbq-icon_right{color:var(--kbq-icon-theme)}.kbq-button.kbq-button_changed-filter:hover:not(.kbq-disabled),.kbq-button.kbq-button_changed-filter.kbq-hover:not(.kbq-disabled),.kbq-button-icon.kbq-button_changed-filter:hover:not(.kbq-disabled),.kbq-button-icon.kbq-button_changed-filter.kbq-hover:not(.kbq-disabled){background:var(--kbq-states-background-theme-less-hover)}.kbq-button.kbq-button_changed-filter:active:not(.kbq-disabled),.kbq-button.kbq-button_changed-filter.kbq-active:not(.kbq-disabled),.kbq-button-icon.kbq-button_changed-filter:active:not(.kbq-disabled),.kbq-button-icon.kbq-button_changed-filter.kbq-active:not(.kbq-disabled){background:var(--kbq-states-background-theme-fade-active)}.kbq-button.kbq-button_changed-filter.cdk-keyboard-focused,.kbq-button-icon.kbq-button_changed-filter.cdk-keyboard-focused{outline:1px solid var(--kbq-states-line-focus-theme);border-color:var(--kbq-states-line-focus-theme)}.kbq-button.kbq-button_changed-filter.kbq-disabled,.kbq-button-icon.kbq-button_changed-filter.kbq-disabled{color:var(--kbq-states-foreground-disable);background:var(--kbq-states-background-disable)}.kbq-button.kbq-button_changed-filter.kbq-disabled .kbq-icon,.kbq-button-icon.kbq-button_changed-filter.kbq-disabled .kbq-icon,.kbq-button.kbq-button_changed-filter.kbq-disabled .kbq-icon.kbq-icon_left,.kbq-button-icon.kbq-button_changed-filter.kbq-disabled .kbq-icon.kbq-icon_left,.kbq-button.kbq-button_changed-filter.kbq-disabled .kbq-icon.kbq-icon_right,.kbq-button-icon.kbq-button_changed-filter.kbq-disabled .kbq-icon.kbq-icon_right{color:var(--kbq-states-icon-disabled)}.kbq-hint.kbq-date-period__hint .kbq-hint__text{font-size:var(--kbq-typography-text-compact-font-size);font-weight:var(--kbq-typography-text-compact-font-weight);line-height:var(--kbq-typography-text-compact-line-height);font-family:var(--kbq-typography-text-compact-font-family);text-transform:var(--kbq-typography-text-compact-text-transform);font-feature-settings:var(--kbq-typography-text-compact-font-feature-settings);letter-spacing:var(--kbq-typography-text-compact-letter-spacing)}\n"] }]
450
- }], ctorParameters: () => [], propDecorators: { filters: [{
451
- type: ContentChild,
452
- args: [KbqFilters]
453
- }], filterReset: [{
454
- type: ContentChild,
455
- args: [KbqFilterReset]
456
- }], filter: [{
457
- type: Input
458
- }], pipeTemplates: [{
459
- type: Input
460
- }], filterChange: [{
461
- type: Output
462
- }], onChangePipe: [{
463
- type: Output
464
- }], onRemovePipe: [{
465
- type: Output
466
- }] } });
467
-
468
- class KbqFilterBarRefresher {
469
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBarRefresher, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
470
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: KbqFilterBarRefresher, isStandalone: true, selector: "kbq-filter-refresher, [kbq-filter-refresher]", host: { classAttribute: "kbq-filter-refresher" }, ngImport: i0, template: `
471
- <button [color]="'contrast'" [kbqStyle]="'transparent'" kbq-button>
472
- <i kbq-icon="kbq-arrow-rotate-right_16"></i>
473
- </button>
474
- <button [color]="'contrast'" [kbqStyle]="'transparent'" kbq-button>
475
- <i kbq-icon="kbq-chevron-down_16"></i>
476
- </button>
477
- `, isInline: true, styles: [".kbq-filter-refresher{display:flex;align-items:center;min-width:64px}\n"], dependencies: [{ kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "ngmodule", type: KbqIconModule }, { kind: "component", type: i2.KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
478
- }
479
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBarRefresher, decorators: [{
480
- type: Component,
481
- args: [{ standalone: true, selector: 'kbq-filter-refresher, [kbq-filter-refresher]', template: `
482
- <button [color]="'contrast'" [kbqStyle]="'transparent'" kbq-button>
483
- <i kbq-icon="kbq-arrow-rotate-right_16"></i>
484
- </button>
485
- <button [color]="'contrast'" [kbqStyle]="'transparent'" kbq-button>
486
- <i kbq-icon="kbq-chevron-down_16"></i>
487
- </button>
488
- `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
489
- KbqButtonModule,
490
- KbqIconModule
491
- ], host: {
492
- class: 'kbq-filter-refresher'
493
- }, styles: [".kbq-filter-refresher{display:flex;align-items:center;min-width:64px}\n"] }]
494
- }] });
495
-
496
- class KbqFilterBarSearch {
497
- constructor() {
498
- this.filterBar = inject(KbqFilterBar);
499
- this.changeDetectorRef = inject(ChangeDetectorRef);
500
- this.searchControl = new UntypedFormControl();
501
- this.isSearchActive = false;
502
- this.onSearch = new EventEmitter();
503
- this.onReset = () => {
504
- this.changeDetectorRef.markForCheck();
505
- };
506
- this.searchControl.valueChanges.subscribe(this.onSearch);
507
- this.filterBar.filterReset?.onResetFilter.pipe(takeUntilDestroyed()).subscribe(this.onReset);
455
+ onSelectStartDate(value) {
456
+ this.formGroup.controls.start.setValue(value);
508
457
  }
509
- openSearch() {
510
- this.isSearchActive = true;
511
- setTimeout(() => this.input.focus());
458
+ onSelectEndDate(value) {
459
+ this.formGroup.controls.end.setValue(value);
512
460
  }
513
- onBlur() {
514
- if (this.searchControl.value)
515
- return;
516
- this.onEscape();
461
+ onFocusStartInput() {
462
+ this.showStartCalendar = true;
463
+ this.showEndCalendar = false;
464
+ this.popover.updatePosition(true);
517
465
  }
518
- onEscape() {
519
- this.isSearchActive = false;
520
- this.button.focusViaKeyboard();
521
- this.tooltip.hide();
466
+ onFocusEndInput() {
467
+ this.showEndCalendar = true;
468
+ this.showStartCalendar = false;
522
469
  }
523
- onClear() {
524
- this.isSearchActive = false;
525
- setTimeout(() => {
526
- this.button.focus();
527
- this.tooltip.hide();
528
- });
470
+ hideCalendars() {
471
+ this.showStartCalendar = false;
472
+ this.showEndCalendar = false;
529
473
  }
530
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBarSearch, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
531
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: KbqFilterBarSearch, isStandalone: true, selector: "kbq-filter-search, [kbq-filter-search]", outputs: { onSearch: "onSearch" }, host: { classAttribute: "kbq-filter-search" }, viewQueries: [{ propertyName: "input", first: true, predicate: KbqInput, descendants: true }, { propertyName: "button", first: true, predicate: KbqButton, descendants: true }, { propertyName: "tooltip", first: true, predicate: KbqTooltipTrigger, descendants: true }], ngImport: i0, template: `
532
- <button
533
- [class.kbq-filter_hidden]="isSearchActive"
534
- [color]="'contrast'"
535
- [kbqStyle]="'transparent'"
536
- (click)="openSearch()"
537
- kbq-button
538
- kbqTooltip="{{ filterBar.configuration.search.tooltip }}"
539
- >
540
- <i kbq-icon="kbq-magnifying-glass_16"></i>
541
- </button>
542
-
543
- <kbq-form-field [class.kbq-filter_hidden]="!isSearchActive">
544
- <i kbq-icon="kbq-magnifying-glass_16" kbqPrefix></i>
545
-
546
- <input
547
- [formControl]="searchControl"
548
- (blur)="onBlur()"
549
- (keydown.escape)="onEscape()"
550
- autocomplete="off"
551
- kbqInput
552
- placeholder="{{ filterBar.configuration.search.placeholder }}"
553
- />
554
-
555
- <kbq-cleaner (click)="onClear()" />
556
- </kbq-form-field>
557
- `, isInline: true, styles: [".kbq-filter-search{display:flex;align-items:start;max-width:260px}.kbq-filter-search .kbq-input{width:260px}.kbq-filter-search .kbq-filter_hidden{display:none}\n"], dependencies: [{ kind: "ngmodule", type: KbqDividerModule }, { kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "ngmodule", type: KbqToolTipModule }, { kind: "directive", type: i2$1.KbqTooltipTrigger, selector: "[kbqTooltip]", inputs: ["kbqVisible", "kbqPlacement", "kbqRelativeToPointer", "kbqPlacementPriority", "kbqTooltip", "kbqTooltipDisabled", "kbqEnterDelay", "kbqLeaveDelay", "kbqTrigger", "kbqTooltipClass", "kbqTooltipContext", "kbqTooltipColor", "kbqTooltipArrow", "kbqTooltipOffset"], outputs: ["kbqPlacementChange", "kbqVisibleChange"], exportAs: ["kbqTooltip"] }, { kind: "ngmodule", type: KbqIconModule }, { kind: "component", type: i2.KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "ngmodule", type: KbqFormFieldModule }, { kind: "component", type: i6.KbqFormField, selector: "kbq-form-field", exportAs: ["kbqFormField"] }, { kind: "directive", type: i6.KbqPrefix, selector: "[kbqPrefix]" }, { kind: "component", type: i6.KbqCleaner, selector: "kbq-cleaner", exportAs: ["kbqCleaner"] }, { kind: "directive", type: i6.KbqValidateDirective, selector: " input[kbqInput], input[kbqNumberInput], input[kbqInputPassword], input[kbqTimepicker], input[kbqDatepicker], textarea[kbqTextarea], kbq-select, kbq-tree-select, kbq-tag-list ", exportAs: ["KbqValidate"] }, { kind: "directive", type: i6.KbqTrim, selector: "[kbqInput], [kbqTextarea]", exportAs: ["KbqTrim"] }, { kind: "ngmodule", type: KbqInputModule }, { kind: "directive", type: i3$1.KbqInput, selector: "input[kbqInput],input[kbqNumberInput]", inputs: ["errorStateMatcher", "placeholder", "disabled", "id", "required", "type", "value"], exportAs: ["kbqInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
558
- }
559
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBarSearch, decorators: [{
560
- type: Component,
561
- args: [{ standalone: true, selector: 'kbq-filter-search, [kbq-filter-search]', template: `
562
- <button
563
- [class.kbq-filter_hidden]="isSearchActive"
564
- [color]="'contrast'"
565
- [kbqStyle]="'transparent'"
566
- (click)="openSearch()"
567
- kbq-button
568
- kbqTooltip="{{ filterBar.configuration.search.tooltip }}"
569
- >
570
- <i kbq-icon="kbq-magnifying-glass_16"></i>
571
- </button>
572
-
573
- <kbq-form-field [class.kbq-filter_hidden]="!isSearchActive">
574
- <i kbq-icon="kbq-magnifying-glass_16" kbqPrefix></i>
575
-
576
- <input
577
- [formControl]="searchControl"
578
- (blur)="onBlur()"
579
- (keydown.escape)="onEscape()"
580
- autocomplete="off"
581
- kbqInput
582
- placeholder="{{ filterBar.configuration.search.placeholder }}"
583
- />
584
-
585
- <kbq-cleaner (click)="onClear()" />
586
- </kbq-form-field>
587
- `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
588
- KbqDividerModule,
589
- KbqButtonModule,
590
- KbqToolTipModule,
591
- KbqIconModule,
592
- KbqFormFieldModule,
593
- KbqInputModule,
594
- ReactiveFormsModule
595
- ], host: {
596
- class: 'kbq-filter-search'
597
- }, styles: [".kbq-filter-search{display:flex;align-items:start;max-width:260px}.kbq-filter-search .kbq-input{width:260px}.kbq-filter-search .kbq-filter_hidden{display:none}\n"] }]
598
- }], ctorParameters: () => [], propDecorators: { input: [{
599
- type: ViewChild,
600
- args: [KbqInput]
601
- }], button: [{
602
- type: ViewChild,
603
- args: [KbqButton]
604
- }], tooltip: [{
605
- type: ViewChild,
606
- args: [KbqTooltipTrigger]
607
- }], onSearch: [{
608
- type: Output
609
- }] } });
610
-
611
- class KbqPipeAdd {
612
- constructor() {
613
- this.filterBar = inject(KbqFilterBar);
614
- this.onAddPipe = new EventEmitter();
615
- this.filterTemplate = {
616
- name: '',
617
- pipes: [],
618
- readonly: false,
619
- disabled: false,
620
- changed: false,
621
- saved: false
622
- };
623
- this.addedPipes = [];
624
- this.filterBar.changes.pipe(takeUntilDestroyed()).subscribe(() => {
625
- if (this.filterBar?.filter) {
626
- this.addedPipes = this.filterBar.filter.pipes.map((pipe) => pipe.id || pipe.name);
627
- }
474
+ initFormGroup() {
475
+ this.formGroup = new FormGroup({
476
+ start: new FormControl(this.start || this.defaultStart),
477
+ end: new FormControl(this.end || this.defaultEnd)
628
478
  });
629
479
  }
630
- addPipeFromTemplate(option) {
631
- if (option.selected) {
632
- this.filterBar.openPipe.next(option.value.id || option.value.name);
633
- }
634
- else {
635
- option.select();
636
- if (!this.filterBar.filter) {
637
- this.filterBar.filter = structuredClone(this.filterTemplate);
638
- }
639
- this.filterBar.filter.changed = true;
640
- this.filterBar.filter.pipes.push(Object.assign({}, option.value, { values: undefined, valueTemplate: undefined, openOnAdd: true }));
641
- this.onAddPipe.next(option.value);
642
- this.filterBar.filterChange.emit(this.filterBar.filter);
643
- }
644
- this.select.close();
645
- }
646
- compareWith(o1, o2) {
647
- return (o1.id || o1.name) === o2;
648
- }
649
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeAdd, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
650
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: KbqPipeAdd, isStandalone: true, selector: "kbq-pipe-add", inputs: { filterTemplate: "filterTemplate" }, outputs: { onAddPipe: "onAddPipe" }, host: { classAttribute: "kbq-pipe-add" }, viewQueries: [{ propertyName: "select", first: true, predicate: KbqSelect, descendants: true }], ngImport: i0, template: `
651
- <kbq-select #select [tabIndex]="-1" [multiple]="true" [value]="addedPipes" [compareWith]="compareWith">
652
- <button
653
- [color]="'contrast-fade'"
654
- [kbqStyle]="'outline'"
655
- [ngClass]="{ 'kbq-active': select.panelOpen }"
656
- kbq-button
657
- kbqTooltip="{{ filterBar.configuration.add.tooltip }}"
658
- kbq-select-matcher
659
- >
660
- <i kbq-icon="kbq-plus_16"></i>
661
- </button>
662
-
663
- @for (template of filterBar.pipeTemplates; track template) {
664
- <kbq-option
665
- #option
666
- [userSelect]="true"
667
- [value]="template"
668
- [showCheckbox]="false"
669
- (click)="addPipeFromTemplate(option)"
670
- >
671
- {{ template.name }}
672
- </kbq-option>
480
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeDateComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
481
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: KbqPipeDateComponent, isStandalone: true, selector: "kbq-pipe-date", providers: [
482
+ {
483
+ provide: KBQ_VALIDATION,
484
+ useValue: { useValidation: false }
485
+ },
486
+ {
487
+ provide: KbqBasePipe,
488
+ useExisting: this
673
489
  }
674
- </kbq-select>
675
- `, isInline: true, styles: [".kbq-pipe-add .kbq-select .kbq-select__trigger{height:unset}\n"], dependencies: [{ kind: "ngmodule", type: KbqDropdownModule }, { kind: "ngmodule", type: KbqToolTipModule }, { kind: "directive", type: i2$1.KbqTooltipTrigger, selector: "[kbqTooltip]", inputs: ["kbqVisible", "kbqPlacement", "kbqRelativeToPointer", "kbqPlacementPriority", "kbqTooltip", "kbqTooltipDisabled", "kbqEnterDelay", "kbqLeaveDelay", "kbqTrigger", "kbqTooltipClass", "kbqTooltipContext", "kbqTooltipColor", "kbqTooltipArrow", "kbqTooltipOffset"], outputs: ["kbqPlacementChange", "kbqVisibleChange"], exportAs: ["kbqTooltip"] }, { kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "component", type: KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "ngmodule", type: KbqOptionModule }, { kind: "component", type: i3$2.KbqOption, selector: "kbq-option", inputs: ["value", "userSelect", "showCheckbox", "disabled"], outputs: ["onSelectionChange"], exportAs: ["kbqOption"] }, { kind: "directive", type: KbqSelectMatcher, selector: "kbq-select-matcher, [kbq-select-matcher]" }, { kind: "ngmodule", type: KbqSelectModule }, { kind: "component", type: i4$1.KbqSelect, selector: "kbq-select", inputs: ["hiddenItemsText", "panelClass", "backdropClass", "errorStateMatcher", "sortComparator", "hasBackdrop", "placeholder", "required", "multiple", "compareWith", "panelWidth", "panelMinWidth", "value", "id", "tabIndex", "disabled", "hiddenItemsTextFormatter"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["kbqSelect"] }, { kind: "directive", type: i4$1.KbqOptionTooltip, selector: "kbq-option" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
490
+ ], viewQueries: [{ propertyName: "listSelection", first: true, predicate: ["listSelection"], descendants: true, read: KbqListSelection, isSignal: true }, { propertyName: "returnButton", first: true, predicate: ["returnButton"], descendants: true, read: KbqButton, isSignal: true }, { propertyName: "popover", first: true, predicate: ["popover"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<button\n #popover=\"kbqPopover\"\n kbq-button\n kbqPopover\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [kbqPopoverArrow]=\"false\"\n [kbqPopoverClass]=\"'kbq-pipe-date__popover'\"\n [kbqPopoverContent]=\"content\"\n [kbqPopoverOffset]=\"4\"\n [kbqPopoverPlacement]=\"placements.BottomLeft\"\n [kbqPopoverPlacementPriority]=\"[placements.BottomLeft, placements.TopLeft]\"\n (kbqPopoverVisibleChange)=\"isListMode = true\"\n>\n <span #kbqTitleText class=\"kbq-pipe__name\">{{ data.name }}</span>\n <span #kbqTitleText class=\"kbq-pipe__value\" [class.kbq-pipe__value_empty]=\"!formattedValue\">\n {{ formattedValue }}\n </span>\n</button>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #content>\n @if (isListMode) {\n <div class=\"kbq-date-list\">\n <kbq-list-selection #listSelection [autoSelect]=\"false\" [ngModel]=\"data.value?.name\">\n <kbq-list-option (click)=\"showPeriod()\" (keydown.enter)=\"showPeriod()\">\n {{ localeData.datePipe?.customPeriod }}\n <i class=\"kbq kbq-icon kbq-chevron-right_16 kbq-contrast-fade\"></i>\n </kbq-list-option>\n\n @for (item of values; track item) {\n <kbq-list-option [value]=\"item.name\" (click)=\"onSelect(item)\" (keydown.enter)=\"onSelect(item)\">\n {{ item.name }}\n </kbq-list-option>\n }\n </kbq-list-selection>\n </div>\n } @else {\n <div class=\"kbq-date-period kbq-datepicker__content\" (keydown)=\"onKeydown($event)\">\n <div class=\"kbq-date-period__header\">\n <button\n #returnButton\n kbq-button\n [color]=\"colors.Theme\"\n [kbqStyle]=\"styles.Transparent\"\n (click)=\"showList()\"\n >\n <i kbq-icon=\"kbq-chevron-left_16\"></i>\n {{ localeData.datePipe.backToPeriodSelection }}\n </button>\n </div>\n\n <kbq-divider />\n\n <form class=\"kbq-date-period__content kbq-form-horizontal\" [formGroup]=\"formGroup\">\n <div class=\"kbq-date-period__content-header\">{{ localeData.datePipe.customPeriod }}</div>\n <label class=\"kbq-form__label\">{{ localeData.datePipe.customPeriodFrom }}</label>\n\n <kbq-form-field class=\"kbq-date-period__date kbq-form__control\" [class.kbq-focused]=\"showStartCalendar\">\n <input\n formControlName=\"start\"\n [kbqCalendar]=\"startDateCalendar\"\n [max]=\"formGroup.controls.end.value\"\n (focusin)=\"onFocusStartInput()\"\n (keydown.tab)=\"hideCalendars()\"\n />\n <i kbq-icon=\"kbq-calendar-o_16\" kbqSuffix></i>\n </kbq-form-field>\n\n <kbq-calendar\n #startDateCalendar\n [class.kbq-calendar_hidden]=\"!showStartCalendar\"\n (selectedChange)=\"onSelectStartDate($event)\"\n />\n\n <label class=\"kbq-form__label\">{{ localeData.datePipe.customPeriodTo }}</label>\n\n <kbq-form-field class=\"kbq-date-period__date kbq-form__control\" [class.kbq-focused]=\"showEndCalendar\">\n <input\n formControlName=\"end\"\n [kbqCalendar]=\"endDateCalendar\"\n (focusin)=\"onFocusEndInput()\"\n (keydown.tab)=\"hideCalendars()\"\n />\n <i kbq-icon=\"kbq-calendar-o_16\" kbqSuffix></i>\n </kbq-form-field>\n\n @if (formGroup.controls.start.invalid) {\n <kbq-hint class=\"kbq-date-period__hint\" [color]=\"'error'\">\n {{ localeData.datePipe.customPeriodErrorHint }}\n </kbq-hint>\n }\n\n <kbq-calendar\n #endDateCalendar\n [class.kbq-calendar_hidden]=\"!showEndCalendar\"\n (selectedChange)=\"onSelectEndDate($event)\"\n />\n </form>\n\n <div class=\"kbq-date-period__footer\">\n <button\n kbq-button\n [color]=\"'theme'\"\n [disabled]=\"disabled\"\n [kbqStyle]=\"'transparent'\"\n (click)=\"onApplyPeriod()\"\n >\n <span>{{ localeData.pipe.applyButton }}</span>\n &nbsp;\n <span class=\"kbq-button_hot-key\">{{ isMac ? '\u2318' : 'Ctrl+' }}Enter</span>\n </button>\n </div>\n </div>\n }\n</ng-template>\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ formattedValue }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n", ".kbq-datepicker__content{--kbq-datepicker-size-container-padding-vertical: var(--kbq-size-m);--kbq-datepicker-size-container-border-radius: var(--kbq-size-s);--kbq-datepicker-size-header-padding-horizontal: var(--kbq-size-xxs);--kbq-datepicker-size-header-margin-bottom: var(--kbq-size-3xs);--kbq-datepicker-size-grid-padding-horizontal: var(--kbq-size-m);--kbq-datepicker-size-grid-content-gap-vertical: var(--kbq-size-3xs);--kbq-datepicker-size-grid-divider-height: 1px;--kbq-datepicker-size-grid-cell-padding-horizontal: var(--kbq-size-s);--kbq-datepicker-size-grid-cell-padding-vertical: var(--kbq-size-s);--kbq-datepicker-size-grid-cell-border-radius: var(--kbq-size-s);--kbq-datepicker-container-background: var(--kbq-background-card);--kbq-datepicker-container-shadow: var(--kbq-shadow-popup);--kbq-datepicker-header-text: var(--kbq-foreground-contrast-tertiary);--kbq-datepicker-header-divider: var(--kbq-line-contrast-less);--kbq-datepicker-grid-cell-default-background: transparent;--kbq-datepicker-grid-cell-default-text: var(--kbq-foreground-contrast);--kbq-datepicker-grid-cell-today-background: transparent;--kbq-datepicker-grid-cell-today-text: var(--kbq-foreground-theme);--kbq-datepicker-grid-cell-states-hover-background: var(--kbq-states-background-transparent-hover);--kbq-datepicker-grid-cell-states-active-background: var(--kbq-states-background-transparent-active);--kbq-datepicker-grid-cell-states-selected-background: var(--kbq-background-contrast);--kbq-datepicker-grid-cell-states-selected-text: var(--kbq-foreground-white);--kbq-datepicker-grid-cell-states-selected-hover-background: var(--kbq-states-background-contrast-active);--kbq-datepicker-grid-cell-states-disabled-background: transparent;--kbq-datepicker-grid-cell-states-disabled-text: var(--kbq-states-foreground-disabled)}.kbq-pipe-date__popover .kbq-popover__container{max-height:unset}.kbq-pipe-date__popover .kbq-popover__content{padding:0}.kbq-pipe-date__popover .kbq-date-list{margin:var(--kbq-size-xxs) 0}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option{margin-left:var(--kbq-size-xxs);margin-right:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option .kbq-list-text{display:flex;flex-direction:row}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option .kbq-icon{margin-left:var(--kbq-size-s);align-self:center;color:var(--kbq-icon-fade-contrast-color)}.kbq-pipe-date__popover .kbq-date-period{width:320px}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__header{padding-top:var(--kbq-size-xs);padding-left:var(--kbq-size-xxs);padding-right:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__header .kbq-button{width:100%;justify-content:flex-start}.kbq-pipe-date__popover .kbq-date-period .kbq-divider{margin:var(--kbq-size-xxs) var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content{display:grid;grid-auto-columns:minmax(min-content,1fr);grid-template-columns:min-content;padding:0;gap:var(--kbq-size-s)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-date-period__content-header{grid-column:2 span;padding-top:var(--kbq-size-s);padding-left:var(--kbq-size-l);padding-right:var(--kbq-size-l);color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__label{padding-left:var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__control{padding-right:var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-date-period__date,.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-date-period__time{flex:1}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row_with-time{display:flex}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row_with-time .kbq-date-period__date .kbq-form-field__container{border-top-right-radius:unset;border-bottom-right-radius:unset}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row_with-time .kbq-date-period__time{margin-left:-1px}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row_with-time .kbq-date-period__time .kbq-form-field__container{border-top-left-radius:unset;border-bottom-left-radius:unset}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-calendar{position:relative;grid-column:2 span;padding:var(--kbq-size-s) var(--kbq-size-s) var(--kbq-size-m);background-color:var(--kbq-background-bg-tertiary)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-calendar.kbq-calendar_hidden{display:none}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-hint{grid-column:2 span;padding-left:var(--kbq-size-m);padding-right:var(--kbq-size-m)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer{padding:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer .kbq-button{width:100%;justify-content:flex-start}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer .kbq-button:not(.kbq-disabled) .kbq-button_hot-key{color:var(--kbq-foreground-contrast-secondary)}.kbq-datepicker__content{background:var(--kbq-datepicker-container-background);box-shadow:var(--kbq-datepicker-container-shadow)}.kbq-calendar__table-header{color:var(--kbq-datepicker-header-text)}.kbq-calendar__table-header-divider:after{background:var(--kbq-datepicker-header-divider)}.kbq-calendar__body-cell-content{background:var(--kbq-datepicker-grid-cell-default-background);color:var(--kbq-datepicker-grid-cell-default-text)}.kbq-calendar__body-cell-content.kbq-calendar__body-today{background:var(--kbq-datepicker-grid-cell-today-background);color:var(--kbq-datepicker-grid-cell-today-text)}.kbq-calendar__body-cell-content:hover:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-hover-background)}.kbq-calendar__body-cell-content:active:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-active-background)}.kbq-calendar__body-cell-content.kbq-selected:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-selected-background);color:var(--kbq-datepicker-grid-cell-states-selected-text)}.kbq-calendar__body-cell-content.kbq-selected:not(.kbq-disabled):hover{background:var(--kbq-datepicker-grid-cell-states-selected-hover-background)}.kbq-calendar__body-cell-content.kbq-disabled{color:var(--kbq-states-foreground-disabled);background:var(--kbq-datepicker-grid-cell-states-disabled-background)}.kbq-calendar,.kbq-calendar__table-header th{font-size:var(--kbq-typography-text-normal-font-size);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: KbqFormFieldModule }, { kind: "component", type: i6.KbqFormField, selector: "kbq-form-field", exportAs: ["kbqFormField"] }, { kind: "component", type: i6.KbqHint, selector: "kbq-hint", inputs: ["id", "fillTextOff", "compact"], exportAs: ["kbqHint"] }, { kind: "directive", type: i6.KbqSuffix, selector: "[kbqSuffix]" }, { kind: "component", type: KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "ngmodule", type: KbqInputModule }, { kind: "directive", type: i3.MaxValidator, selector: "[max][formControlName],[max][formControl],[max][ngModel]", inputs: ["max"] }, { kind: "ngmodule", type: KbqDividerModule }, { kind: "component", type: i4.KbqDivider, selector: "kbq-divider", inputs: ["vertical", "inset", "paddings"] }, { kind: "ngmodule", type: KbqPopoverModule }, { kind: "directive", type: i5.KbqPopoverTrigger, selector: "[kbqPopover]", inputs: ["kbqPopoverVisible", "kbqPopoverPlacement", "kbqPopoverPlacementPriority", "hasBackdrop", "kbqPopoverHeader", "kbqPopoverContent", "kbqPopoverFooter", "kbqPopoverDisabled", "kbqTrigger", "kbqPopoverSize", "kbqPopoverClass", "hasCloseButton", "closeOnScroll", "backdropClass", "kbqPopoverArrow", "kbqPopoverOffset"], outputs: ["kbqPopoverPlacementChange", "kbqPopoverVisibleChange"], exportAs: ["kbqPopover"] }, { kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "ngmodule", type: KbqListModule }, { kind: "component", type: i7.KbqListSelection, selector: "kbq-list-selection", inputs: ["autoSelect", "noUnselectLast", "horizontal", "tabIndex", "disabled", "compareWith"], outputs: ["onSelectAll", "onCopy", "selectionChange"], exportAs: ["kbqListSelection"] }, { kind: "component", type: i7.KbqListOption, selector: "kbq-list-option", inputs: ["checkboxPosition", "value", "disabled", "showCheckbox", "selected"], exportAs: ["kbqListOption"] }, { kind: "ngmodule", type: KbqDatepickerModule }, { kind: "component", type: i8.KbqCalendar, selector: "kbq-calendar", inputs: ["startAt", "selected", "minDate", "maxDate", "dateFilter", "dateClass"], outputs: ["selectedChange", "yearSelected", "monthSelected", "userSelection"], exportAs: ["kbqCalendar"] }, { kind: "directive", type: i8.KbqDatepickerInput, selector: "input[kbqDatepicker], input[kbqCalendar]", inputs: ["placeholder", "required", "kbqDatepicker", "kbqCalendar", "kbqDatepickerFilter", "value", "min", "max", "disabled", "id", "kbqValidationTooltip"], outputs: ["incorrectInput", "dateChange", "dateInput"], exportAs: ["kbqDatepickerInput"] }, { kind: "ngmodule", type: KbqTimepickerModule }, { kind: "directive", type: KbqPipeState, selector: "[kbqPipeState]", inputs: ["kbqPipeState"] }, { kind: "ngmodule", type: KbqFormattersModule }, { kind: "component", type: KbqPipeButton, selector: "kbq-pipe-button" }, { kind: "ngmodule", type: KbqTitleModule }, { kind: "directive", type: KbqPipeTitleDirective, selector: "[kbqPipeTitle]", inputs: ["kbqPipeTitle"], exportAs: ["kbqPipeTitle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
676
491
  }
677
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeAdd, decorators: [{
492
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeDateComponent, decorators: [{
678
493
  type: Component,
679
- args: [{ standalone: true, selector: 'kbq-pipe-add', template: `
680
- <kbq-select #select [tabIndex]="-1" [multiple]="true" [value]="addedPipes" [compareWith]="compareWith">
681
- <button
682
- [color]="'contrast-fade'"
683
- [kbqStyle]="'outline'"
684
- [ngClass]="{ 'kbq-active': select.panelOpen }"
685
- kbq-button
686
- kbqTooltip="{{ filterBar.configuration.add.tooltip }}"
687
- kbq-select-matcher
688
- >
689
- <i kbq-icon="kbq-plus_16"></i>
690
- </button>
691
-
692
- @for (template of filterBar.pipeTemplates; track template) {
693
- <kbq-option
694
- #option
695
- [userSelect]="true"
696
- [value]="template"
697
- [showCheckbox]="false"
698
- (click)="addPipeFromTemplate(option)"
699
- >
700
- {{ template.name }}
701
- </kbq-option>
702
- }
703
- </kbq-select>
704
- `, host: {
705
- class: 'kbq-pipe-add'
706
- }, imports: [
707
- KbqDropdownModule,
708
- KbqToolTipModule,
709
- KbqButtonModule,
710
- KbqIcon,
711
- KbqOptionModule,
712
- KbqSelectMatcher,
713
- KbqSelectModule,
714
- NgClass
715
- ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, styles: [".kbq-pipe-add .kbq-select .kbq-select__trigger{height:unset}\n"] }]
716
- }], ctorParameters: () => [], propDecorators: { select: [{
494
+ args: [{ standalone: true, selector: 'kbq-pipe-date', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
495
+ {
496
+ provide: KBQ_VALIDATION,
497
+ useValue: { useValidation: false }
498
+ },
499
+ {
500
+ provide: KbqBasePipe,
501
+ useExisting: this
502
+ }
503
+ ], imports: [
504
+ ReactiveFormsModule,
505
+ KbqFormFieldModule,
506
+ KbqIcon,
507
+ KbqInputModule,
508
+ KbqDividerModule,
509
+ KbqPopoverModule,
510
+ KbqButtonModule,
511
+ KbqListModule,
512
+ KbqDatepickerModule,
513
+ KbqTimepickerModule,
514
+ KbqPipeState,
515
+ KbqFormattersModule,
516
+ KbqPipeButton,
517
+ KbqTitleModule,
518
+ KbqPipeTitleDirective,
519
+ FormsModule
520
+ ], template: "<button\n #popover=\"kbqPopover\"\n kbq-button\n kbqPopover\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [kbqPopoverArrow]=\"false\"\n [kbqPopoverClass]=\"'kbq-pipe-date__popover'\"\n [kbqPopoverContent]=\"content\"\n [kbqPopoverOffset]=\"4\"\n [kbqPopoverPlacement]=\"placements.BottomLeft\"\n [kbqPopoverPlacementPriority]=\"[placements.BottomLeft, placements.TopLeft]\"\n (kbqPopoverVisibleChange)=\"isListMode = true\"\n>\n <span #kbqTitleText class=\"kbq-pipe__name\">{{ data.name }}</span>\n <span #kbqTitleText class=\"kbq-pipe__value\" [class.kbq-pipe__value_empty]=\"!formattedValue\">\n {{ formattedValue }}\n </span>\n</button>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #content>\n @if (isListMode) {\n <div class=\"kbq-date-list\">\n <kbq-list-selection #listSelection [autoSelect]=\"false\" [ngModel]=\"data.value?.name\">\n <kbq-list-option (click)=\"showPeriod()\" (keydown.enter)=\"showPeriod()\">\n {{ localeData.datePipe?.customPeriod }}\n <i class=\"kbq kbq-icon kbq-chevron-right_16 kbq-contrast-fade\"></i>\n </kbq-list-option>\n\n @for (item of values; track item) {\n <kbq-list-option [value]=\"item.name\" (click)=\"onSelect(item)\" (keydown.enter)=\"onSelect(item)\">\n {{ item.name }}\n </kbq-list-option>\n }\n </kbq-list-selection>\n </div>\n } @else {\n <div class=\"kbq-date-period kbq-datepicker__content\" (keydown)=\"onKeydown($event)\">\n <div class=\"kbq-date-period__header\">\n <button\n #returnButton\n kbq-button\n [color]=\"colors.Theme\"\n [kbqStyle]=\"styles.Transparent\"\n (click)=\"showList()\"\n >\n <i kbq-icon=\"kbq-chevron-left_16\"></i>\n {{ localeData.datePipe.backToPeriodSelection }}\n </button>\n </div>\n\n <kbq-divider />\n\n <form class=\"kbq-date-period__content kbq-form-horizontal\" [formGroup]=\"formGroup\">\n <div class=\"kbq-date-period__content-header\">{{ localeData.datePipe.customPeriod }}</div>\n <label class=\"kbq-form__label\">{{ localeData.datePipe.customPeriodFrom }}</label>\n\n <kbq-form-field class=\"kbq-date-period__date kbq-form__control\" [class.kbq-focused]=\"showStartCalendar\">\n <input\n formControlName=\"start\"\n [kbqCalendar]=\"startDateCalendar\"\n [max]=\"formGroup.controls.end.value\"\n (focusin)=\"onFocusStartInput()\"\n (keydown.tab)=\"hideCalendars()\"\n />\n <i kbq-icon=\"kbq-calendar-o_16\" kbqSuffix></i>\n </kbq-form-field>\n\n <kbq-calendar\n #startDateCalendar\n [class.kbq-calendar_hidden]=\"!showStartCalendar\"\n (selectedChange)=\"onSelectStartDate($event)\"\n />\n\n <label class=\"kbq-form__label\">{{ localeData.datePipe.customPeriodTo }}</label>\n\n <kbq-form-field class=\"kbq-date-period__date kbq-form__control\" [class.kbq-focused]=\"showEndCalendar\">\n <input\n formControlName=\"end\"\n [kbqCalendar]=\"endDateCalendar\"\n (focusin)=\"onFocusEndInput()\"\n (keydown.tab)=\"hideCalendars()\"\n />\n <i kbq-icon=\"kbq-calendar-o_16\" kbqSuffix></i>\n </kbq-form-field>\n\n @if (formGroup.controls.start.invalid) {\n <kbq-hint class=\"kbq-date-period__hint\" [color]=\"'error'\">\n {{ localeData.datePipe.customPeriodErrorHint }}\n </kbq-hint>\n }\n\n <kbq-calendar\n #endDateCalendar\n [class.kbq-calendar_hidden]=\"!showEndCalendar\"\n (selectedChange)=\"onSelectEndDate($event)\"\n />\n </form>\n\n <div class=\"kbq-date-period__footer\">\n <button\n kbq-button\n [color]=\"'theme'\"\n [disabled]=\"disabled\"\n [kbqStyle]=\"'transparent'\"\n (click)=\"onApplyPeriod()\"\n >\n <span>{{ localeData.pipe.applyButton }}</span>\n &nbsp;\n <span class=\"kbq-button_hot-key\">{{ isMac ? '\u2318' : 'Ctrl+' }}Enter</span>\n </button>\n </div>\n </div>\n }\n</ng-template>\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ formattedValue }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n", ".kbq-datepicker__content{--kbq-datepicker-size-container-padding-vertical: var(--kbq-size-m);--kbq-datepicker-size-container-border-radius: var(--kbq-size-s);--kbq-datepicker-size-header-padding-horizontal: var(--kbq-size-xxs);--kbq-datepicker-size-header-margin-bottom: var(--kbq-size-3xs);--kbq-datepicker-size-grid-padding-horizontal: var(--kbq-size-m);--kbq-datepicker-size-grid-content-gap-vertical: var(--kbq-size-3xs);--kbq-datepicker-size-grid-divider-height: 1px;--kbq-datepicker-size-grid-cell-padding-horizontal: var(--kbq-size-s);--kbq-datepicker-size-grid-cell-padding-vertical: var(--kbq-size-s);--kbq-datepicker-size-grid-cell-border-radius: var(--kbq-size-s);--kbq-datepicker-container-background: var(--kbq-background-card);--kbq-datepicker-container-shadow: var(--kbq-shadow-popup);--kbq-datepicker-header-text: var(--kbq-foreground-contrast-tertiary);--kbq-datepicker-header-divider: var(--kbq-line-contrast-less);--kbq-datepicker-grid-cell-default-background: transparent;--kbq-datepicker-grid-cell-default-text: var(--kbq-foreground-contrast);--kbq-datepicker-grid-cell-today-background: transparent;--kbq-datepicker-grid-cell-today-text: var(--kbq-foreground-theme);--kbq-datepicker-grid-cell-states-hover-background: var(--kbq-states-background-transparent-hover);--kbq-datepicker-grid-cell-states-active-background: var(--kbq-states-background-transparent-active);--kbq-datepicker-grid-cell-states-selected-background: var(--kbq-background-contrast);--kbq-datepicker-grid-cell-states-selected-text: var(--kbq-foreground-white);--kbq-datepicker-grid-cell-states-selected-hover-background: var(--kbq-states-background-contrast-active);--kbq-datepicker-grid-cell-states-disabled-background: transparent;--kbq-datepicker-grid-cell-states-disabled-text: var(--kbq-states-foreground-disabled)}.kbq-pipe-date__popover .kbq-popover__container{max-height:unset}.kbq-pipe-date__popover .kbq-popover__content{padding:0}.kbq-pipe-date__popover .kbq-date-list{margin:var(--kbq-size-xxs) 0}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option{margin-left:var(--kbq-size-xxs);margin-right:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option .kbq-list-text{display:flex;flex-direction:row}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option .kbq-icon{margin-left:var(--kbq-size-s);align-self:center;color:var(--kbq-icon-fade-contrast-color)}.kbq-pipe-date__popover .kbq-date-period{width:320px}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__header{padding-top:var(--kbq-size-xs);padding-left:var(--kbq-size-xxs);padding-right:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__header .kbq-button{width:100%;justify-content:flex-start}.kbq-pipe-date__popover .kbq-date-period .kbq-divider{margin:var(--kbq-size-xxs) var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content{display:grid;grid-auto-columns:minmax(min-content,1fr);grid-template-columns:min-content;padding:0;gap:var(--kbq-size-s)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-date-period__content-header{grid-column:2 span;padding-top:var(--kbq-size-s);padding-left:var(--kbq-size-l);padding-right:var(--kbq-size-l);color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__label{padding-left:var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__control{padding-right:var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-date-period__date,.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-date-period__time{flex:1}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row_with-time{display:flex}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row_with-time .kbq-date-period__date .kbq-form-field__container{border-top-right-radius:unset;border-bottom-right-radius:unset}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row_with-time .kbq-date-period__time{margin-left:-1px}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row_with-time .kbq-date-period__time .kbq-form-field__container{border-top-left-radius:unset;border-bottom-left-radius:unset}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-calendar{position:relative;grid-column:2 span;padding:var(--kbq-size-s) var(--kbq-size-s) var(--kbq-size-m);background-color:var(--kbq-background-bg-tertiary)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-calendar.kbq-calendar_hidden{display:none}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-hint{grid-column:2 span;padding-left:var(--kbq-size-m);padding-right:var(--kbq-size-m)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer{padding:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer .kbq-button{width:100%;justify-content:flex-start}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer .kbq-button:not(.kbq-disabled) .kbq-button_hot-key{color:var(--kbq-foreground-contrast-secondary)}.kbq-datepicker__content{background:var(--kbq-datepicker-container-background);box-shadow:var(--kbq-datepicker-container-shadow)}.kbq-calendar__table-header{color:var(--kbq-datepicker-header-text)}.kbq-calendar__table-header-divider:after{background:var(--kbq-datepicker-header-divider)}.kbq-calendar__body-cell-content{background:var(--kbq-datepicker-grid-cell-default-background);color:var(--kbq-datepicker-grid-cell-default-text)}.kbq-calendar__body-cell-content.kbq-calendar__body-today{background:var(--kbq-datepicker-grid-cell-today-background);color:var(--kbq-datepicker-grid-cell-today-text)}.kbq-calendar__body-cell-content:hover:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-hover-background)}.kbq-calendar__body-cell-content:active:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-active-background)}.kbq-calendar__body-cell-content.kbq-selected:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-selected-background);color:var(--kbq-datepicker-grid-cell-states-selected-text)}.kbq-calendar__body-cell-content.kbq-selected:not(.kbq-disabled):hover{background:var(--kbq-datepicker-grid-cell-states-selected-hover-background)}.kbq-calendar__body-cell-content.kbq-disabled{color:var(--kbq-states-foreground-disabled);background:var(--kbq-datepicker-grid-cell-states-disabled-background)}.kbq-calendar,.kbq-calendar__table-header th{font-size:var(--kbq-typography-text-normal-font-size);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}\n"] }]
521
+ }], propDecorators: { popover: [{
717
522
  type: ViewChild,
718
- args: [KbqSelect]
719
- }], onAddPipe: [{
720
- type: Output
721
- }], filterTemplate: [{
722
- type: Input
523
+ args: ['popover']
723
524
  }] } });
724
525
 
725
- const KBQ_PIPE_DATA = new InjectionToken('KBQ_PIPE_DATA');
726
- class KbqBasePipe {
727
- get isEmpty() {
728
- return this.data.value === null || this.data.value === undefined;
526
+ class KbqPipeDatetimeComponent extends KbqBasePipe {
527
+ constructor() {
528
+ super(...arguments);
529
+ this.adapter = inject(DateAdapter);
530
+ this.formatter = inject(DateFormatter);
531
+ /** @docs-private */
532
+ this.placements = PopUpPlacements;
533
+ /** @docs-private */
534
+ this.styles = KbqButtonStyles;
535
+ /** @docs-private */
536
+ this.colors = KbqComponentColors;
537
+ /** Whether the current state is list of periods. When false will displayed control for set custom period */
538
+ this.isListMode = true;
539
+ /** @docs-private */
540
+ this.showStartCalendar = false;
541
+ /** @docs-private */
542
+ this.showEndCalendar = false;
543
+ /** @docs-private */
544
+ this.listSelection = viewChild.required('listSelection', { read: KbqListSelection });
545
+ /** @docs-private */
546
+ this.returnButton = viewChild.required('returnButton', { read: KbqButton });
729
547
  }
730
- get showRemoveButton() {
731
- return !this.data.required && (this.data.removable || (this.data.cleanable && !this.isEmpty));
548
+ /** formatted value for period */
549
+ get formattedValue() {
550
+ if (this.start && this.end) {
551
+ return this.formatter.rangeShortDateTime(this.start, this.end);
552
+ }
553
+ return this.data.value?.name ?? '';
732
554
  }
733
- get localeData() {
734
- return this.filterBar?.configuration;
555
+ /** Whether the current pipe is disabled. */
556
+ get disabled() {
557
+ return (!this.adapter.isDateInstance(this.formGroup.controls.start.value) ||
558
+ !this.adapter.isDateInstance(this.formGroup.controls.end.value) ||
559
+ this.formGroup.controls.start.invalid);
735
560
  }
736
- constructor() {
737
- this.stateChanges = new Subject();
738
- this.data = inject(KBQ_PIPE_DATA);
739
- this.filterBar = inject(KbqFilterBar, { optional: true });
740
- this.changeDetectorRef = inject(ChangeDetectorRef);
741
- // todo DS-3511
742
- this.isMac = /^mac/i.test(navigator.userAgent);
743
- this.updateTemplates = (templates) => {
744
- const template = templates?.find((template) => template.type === this.data?.type);
745
- if (template?.values) {
746
- this.values = template.values;
747
- this.valueTemplate = template.valueTemplate;
748
- }
749
- };
750
- this.$implicit = this;
751
- this.stateChanges.subscribe(() => {
752
- this.changeDetectorRef.markForCheck();
753
- });
754
- this.filterBar?.internalTemplatesChanges.pipe(takeUntilDestroyed()).subscribe(this.updateTemplates);
561
+ /** parsed start */
562
+ get start() {
563
+ return this.adapter.parse(this.data.value?.start, '');
755
564
  }
756
- ngAfterViewInit() {
757
- if (this.data.openOnAdd) {
758
- delete this.data.openOnAdd;
759
- this.open();
565
+ /** default object for start */
566
+ get defaultStart() {
567
+ if (this.data.value?.start) {
568
+ return this.adapter.today().plus(this.data.value?.start);
760
569
  }
761
- this.filterBar?.openPipe.pipe(filter(Boolean)).subscribe((name) => {
762
- if (this.data.name === name) {
763
- this.open();
764
- }
765
- });
570
+ return this.adapter.today().startOf('day');
766
571
  }
767
- isTemplateRef(value) {
768
- return value instanceof TemplateRef;
572
+ /** parsed end */
573
+ get end() {
574
+ return this.adapter.parse(this.data.value?.end, '');
769
575
  }
770
- onRemove() {
771
- this.filterBar?.removePipe(this.data);
576
+ /** default object for end */
577
+ get defaultEnd() {
578
+ if (this.data.value?.start) {
579
+ return this.adapter.today();
580
+ }
581
+ return this.adapter.today().endOf('day');
582
+ }
583
+ /** Whether the current pipe is empty. */
584
+ get isEmpty() {
585
+ if (this.data.value === null)
586
+ return true;
587
+ if (this.data.value?.name)
588
+ return false;
589
+ return !this.adapter.isDateInstance(this.start) || !this.adapter.isDateInstance(this.end);
590
+ }
591
+ /** keydown handler
592
+ * @docs-private */
593
+ onKeydown($event) {
594
+ if (($event.ctrlKey || $event.metaKey) && $event.keyCode === ENTER) {
595
+ this.onApplyPeriod();
596
+ }
597
+ }
598
+ /** @docs-private */
599
+ onApplyPeriod() {
600
+ this.data.value = {
601
+ start: this.formGroup.controls.start.value.toISO(),
602
+ end: this.formGroup.controls.end.value.toISO()
603
+ };
772
604
  this.stateChanges.next();
605
+ this.filterBar?.onChangePipe.next(this.data);
606
+ this.popover.hide();
773
607
  }
774
- onClear() {
775
- this.data.value = null;
608
+ onSelect(item) {
609
+ this.data.value = item;
776
610
  this.stateChanges.next();
611
+ this.filterBar?.onChangePipe.next(this.data);
612
+ this.popover.hide();
777
613
  }
778
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqBasePipe, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
779
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: KbqBasePipe, isStandalone: true, host: { properties: { "class": "\"kbq-pipe__\" + data.type", "class.kbq-pipe_empty": "isEmpty", "class.kbq-pipe_cleanable": "data.cleanable", "class.kbq-pipe_removable": "data.removable", "class.kbq-pipe_disabled": "data.disabled" }, classAttribute: "kbq-pipe" }, ngImport: i0 }); }
780
- }
781
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqBasePipe, decorators: [{
782
- type: Directive,
783
- args: [{
784
- standalone: true,
785
- host: {
786
- class: 'kbq-pipe',
787
- '[class]': '"kbq-pipe__" + data.type',
788
- '[class.kbq-pipe_empty]': 'isEmpty',
789
- '[class.kbq-pipe_cleanable]': 'data.cleanable',
790
- '[class.kbq-pipe_removable]': 'data.removable',
791
- '[class.kbq-pipe_disabled]': 'data.disabled'
792
- }
793
- }]
794
- }], ctorParameters: () => [] });
795
- class KbqPipeMinWidth {
796
- get textLength() {
797
- return this.elementRef.nativeElement.innerText.length || 0;
614
+ showPeriod() {
615
+ this.isListMode = false;
616
+ this.showStartCalendar = false;
617
+ this.showEndCalendar = false;
618
+ this.initFormGroup();
619
+ setTimeout(() => {
620
+ this.popover.updatePosition(true);
621
+ this.returnButton().focus();
622
+ });
798
623
  }
799
- constructor() {
800
- this.filterBar = inject(KbqFilterBar, { optional: true });
801
- this.elementRef = inject(ElementRef);
802
- this.changeDetectorRef = inject(ChangeDetectorRef);
803
- this.maxSymbolsForFitContent = 20;
804
- this.update = () => {
805
- this.minWidth = this.textLength < this.maxSymbolsForFitContent ? 'fit-content' : 'unset';
806
- this.changeDetectorRef.markForCheck();
807
- };
808
- this.filterBar?.changes.pipe(delay(0)).subscribe(this.update);
809
- afterNextRender({ read: this.update });
624
+ showList() {
625
+ this.isListMode = true;
626
+ setTimeout(() => this.listSelection().focus());
627
+ this.popover.updatePosition(true);
810
628
  }
811
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeMinWidth, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
812
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: KbqPipeMinWidth, isStandalone: true, selector: "[kbqPipeMinWidth]", host: { properties: { "style.min-width": "minWidth" } }, ngImport: i0 }); }
813
- }
814
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeMinWidth, decorators: [{
815
- type: Directive,
816
- args: [{
817
- standalone: true,
818
- selector: '[kbqPipeMinWidth]',
819
- host: {
820
- '[style.min-width]': 'minWidth'
821
- }
822
- }]
823
- }], ctorParameters: () => [] });
824
-
825
- class KbqPipeState {
826
- constructor() {
827
- this.destroyRef = inject(DestroyRef);
828
- this.button = inject(KbqButton);
829
- this.pipe = inject(KbqBasePipe);
830
- this._state = null;
831
- this.updateState = () => {
832
- this.button.kbqStyle = KbqButtonStyles.Outline;
833
- this.button.color = KbqComponentColors.ContrastFade;
834
- if (!this.pipe.isEmpty) {
835
- this.button.kbqStyle = KbqButtonStyles.Filled;
836
- this.button.color = KbqComponentColors.ContrastFade;
837
- }
838
- };
629
+ /** opens popover */
630
+ open() {
631
+ this.popover.show();
839
632
  }
840
- set state(pipe) {
841
- this._state = pipe;
842
- this.updateState();
633
+ onSelectStartDate(value) {
634
+ this.formGroup.controls.start.setValue(value);
843
635
  }
844
- get state() {
845
- return this._state;
636
+ onSelectEndDate(value) {
637
+ this.formGroup.controls.end.setValue(value);
846
638
  }
847
- ngOnInit() {
848
- this.pipe.stateChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(this.updateState);
639
+ onFocusStartInput() {
640
+ this.showStartCalendar = true;
641
+ this.showEndCalendar = false;
642
+ this.popover.updatePosition(true);
849
643
  }
850
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeState, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
851
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: KbqPipeState, isStandalone: true, selector: "[kbqPipeState]", inputs: { state: ["kbqPipeState", "state"] }, ngImport: i0 }); }
852
- }
853
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeState, decorators: [{
854
- type: Directive,
855
- args: [{
856
- standalone: true,
857
- selector: '[kbqPipeState]'
858
- }]
859
- }], propDecorators: { state: [{
860
- type: Input,
861
- args: [{ alias: 'kbqPipeState' }]
862
- }] } });
863
-
864
- class KbqPipeButton {
865
- get localeData() {
866
- return this.filterBar?.configuration.pipe;
644
+ onFocusEndInput() {
645
+ this.showEndCalendar = true;
646
+ this.showStartCalendar = false;
867
647
  }
868
- constructor() {
869
- this.pipe = inject(KbqBasePipe);
870
- this.filterBar = inject(KbqFilterBar, { optional: true });
871
- this.changeDetectorRef = inject(ChangeDetectorRef);
872
- this.filterBar?.changes.pipe(takeUntilDestroyed()).subscribe(() => this.changeDetectorRef.markForCheck());
648
+ hideCalendars() {
649
+ this.showStartCalendar = false;
650
+ this.showEndCalendar = false;
873
651
  }
874
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeButton, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
875
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: KbqPipeButton, isStandalone: true, selector: "kbq-pipe-button", host: { classAttribute: "kbq-pipe-button" }, ngImport: i0, template: `
876
- <button
877
- class="kbq-pipe__remove-button"
878
- [disabled]="pipe.data.disabled"
879
- [kbqPipeState]="pipe.data"
880
- (click)="pipe.data.cleanable ? pipe.onClear() : pipe.onRemove()"
881
- kbq-button
882
- kbqTooltip="{{ pipe.data.cleanable ? localeData.clearButtonTooltip : localeData.removeButtonTooltip }}"
883
- >
884
- <i kbq-icon="kbq-xmark-s_16"></i>
885
- </button>
886
- `, isInline: true, styles: [".kbq-pipe-button{display:flex;position:relative}\n"], dependencies: [{ kind: "component", type: KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "ngmodule", type: KbqDividerModule }, { kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "directive", type: KbqPipeState, selector: "[kbqPipeState]", inputs: ["kbqPipeState"] }, { kind: "directive", type: KbqTooltipTrigger, selector: "[kbqTooltip]", inputs: ["kbqVisible", "kbqPlacement", "kbqRelativeToPointer", "kbqPlacementPriority", "kbqTooltip", "kbqTooltipDisabled", "kbqEnterDelay", "kbqLeaveDelay", "kbqTrigger", "kbqTooltipClass", "kbqTooltipContext", "kbqTooltipColor", "kbqTooltipArrow", "kbqTooltipOffset"], outputs: ["kbqPlacementChange", "kbqVisibleChange"], exportAs: ["kbqTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
652
+ initFormGroup() {
653
+ this.formGroup = new FormGroup({
654
+ start: new FormControl(this.start || this.defaultStart),
655
+ end: new FormControl(this.end || this.defaultEnd)
656
+ });
657
+ }
658
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeDatetimeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
659
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: KbqPipeDatetimeComponent, isStandalone: true, selector: "kbq-pipe-datetime", providers: [
660
+ {
661
+ provide: KBQ_VALIDATION,
662
+ useValue: { useValidation: false }
663
+ },
664
+ {
665
+ provide: KbqBasePipe,
666
+ useExisting: this
667
+ }
668
+ ], viewQueries: [{ propertyName: "listSelection", first: true, predicate: ["listSelection"], descendants: true, read: KbqListSelection, isSignal: true }, { propertyName: "returnButton", first: true, predicate: ["returnButton"], descendants: true, read: KbqButton, isSignal: true }, { propertyName: "popover", first: true, predicate: ["popover"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<button\n #popover=\"kbqPopover\"\n kbq-button\n kbqPopover\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [kbqPopoverArrow]=\"false\"\n [kbqPopoverClass]=\"'kbq-pipe-date__popover'\"\n [kbqPopoverContent]=\"content\"\n [kbqPopoverOffset]=\"4\"\n [kbqPopoverPlacement]=\"placements.BottomLeft\"\n [kbqPopoverPlacementPriority]=\"[placements.BottomLeft, placements.TopLeft]\"\n (kbqPopoverVisibleChange)=\"isListMode = true\"\n>\n <span #kbqTitleText class=\"kbq-pipe__name\">{{ data.name }}</span>\n <span #kbqTitleText class=\"kbq-pipe__value\" [class.kbq-pipe__value_empty]=\"!formattedValue\">\n {{ formattedValue }}\n </span>\n</button>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #content>\n @if (isListMode) {\n <div class=\"kbq-date-list\">\n <kbq-list-selection #listSelection [autoSelect]=\"false\" [ngModel]=\"data.value?.name\">\n <kbq-list-option (click)=\"showPeriod()\" (keydown.enter)=\"showPeriod()\">\n {{ localeData.datePipe?.customPeriod }}\n <i class=\"kbq kbq-icon kbq-chevron-right_16 kbq-contrast-fade\"></i>\n </kbq-list-option>\n\n @for (item of values; track item) {\n <kbq-list-option [value]=\"item.name\" (click)=\"onSelect(item)\" (keydown.enter)=\"onSelect(item)\">\n {{ item.name }}\n </kbq-list-option>\n }\n </kbq-list-selection>\n </div>\n } @else {\n <div class=\"kbq-date-period kbq-datepicker__content\" (keydown)=\"onKeydown($event)\">\n <div class=\"kbq-date-period__header\">\n <button\n #returnButton\n kbq-button\n [color]=\"colors.Theme\"\n [kbqStyle]=\"styles.Transparent\"\n (click)=\"showList()\"\n >\n <i kbq-icon=\"kbq-chevron-left_16\"></i>\n {{ localeData.datePipe.backToPeriodSelection }}\n </button>\n </div>\n\n <kbq-divider />\n\n <form class=\"kbq-date-period__content kbq-form-horizontal\" [formGroup]=\"formGroup\">\n <div class=\"kbq-date-period__content-header\">{{ localeData.datePipe.customPeriod }}</div>\n <label class=\"kbq-form__label\">{{ localeData.datePipe.customPeriodFrom }}</label>\n\n <div class=\"kbq-form__row_with-time kbq-form__control\">\n <kbq-form-field class=\"kbq-date-period__date\" [class.kbq-focused]=\"showStartCalendar\">\n <input\n formControlName=\"start\"\n [kbqCalendar]=\"startDateCalendar\"\n [max]=\"formGroup.controls.end.value\"\n (focusin)=\"onFocusStartInput()\"\n (keydown.tab)=\"hideCalendars()\"\n />\n <i kbq-icon=\"kbq-calendar-o_16\" kbqSuffix></i>\n </kbq-form-field>\n\n <kbq-form-field class=\"kbq-date-period__time\">\n <i kbq-icon=\"kbq-clock_16\" kbqPrefix></i>\n <input formControlName=\"start\" kbqTimepicker (focusin)=\"hideCalendars()\" />\n </kbq-form-field>\n </div>\n\n <kbq-calendar\n #startDateCalendar\n [class.kbq-calendar_hidden]=\"!showStartCalendar\"\n (selectedChange)=\"onSelectStartDate($event)\"\n />\n\n <label class=\"kbq-form__label\">{{ localeData.datePipe.customPeriodTo }}</label>\n\n <div class=\"kbq-form__row_with-time kbq-form__control\">\n <kbq-form-field class=\"kbq-date-period__date\" [class.kbq-focused]=\"showEndCalendar\">\n <input\n formControlName=\"end\"\n [kbqCalendar]=\"endDateCalendar\"\n (focusin)=\"onFocusEndInput()\"\n (keydown.tab)=\"hideCalendars()\"\n />\n <i kbq-icon=\"kbq-calendar-o_16\" kbqSuffix></i>\n </kbq-form-field>\n\n <kbq-form-field class=\"kbq-date-period__time\">\n <i kbq-icon=\"kbq-clock_16\" kbqPrefix></i>\n <input formControlName=\"end\" kbqTimepicker (focusin)=\"hideCalendars()\" />\n </kbq-form-field>\n </div>\n\n @if (formGroup.controls.start.invalid) {\n <kbq-hint class=\"kbq-date-period__hint\" [color]=\"'error'\">\n {{ localeData.datePipe.customPeriodErrorHint }}\n </kbq-hint>\n }\n\n <kbq-calendar\n #endDateCalendar\n [class.kbq-calendar_hidden]=\"!showEndCalendar\"\n (selectedChange)=\"onSelectEndDate($event)\"\n />\n </form>\n\n <div class=\"kbq-date-period__footer\">\n <button\n kbq-button\n [color]=\"'theme'\"\n [disabled]=\"disabled\"\n [kbqStyle]=\"'transparent'\"\n (click)=\"onApplyPeriod()\"\n >\n <span>{{ localeData.pipe.applyButton }}</span>\n &nbsp;\n <span class=\"kbq-button_hot-key\">{{ isMac ? '\u2318' : 'Ctrl+' }}Enter</span>\n </button>\n </div>\n </div>\n }\n</ng-template>\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ formattedValue }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n", ".kbq-datepicker__content{--kbq-datepicker-size-container-padding-vertical: var(--kbq-size-m);--kbq-datepicker-size-container-border-radius: var(--kbq-size-s);--kbq-datepicker-size-header-padding-horizontal: var(--kbq-size-xxs);--kbq-datepicker-size-header-margin-bottom: var(--kbq-size-3xs);--kbq-datepicker-size-grid-padding-horizontal: var(--kbq-size-m);--kbq-datepicker-size-grid-content-gap-vertical: var(--kbq-size-3xs);--kbq-datepicker-size-grid-divider-height: 1px;--kbq-datepicker-size-grid-cell-padding-horizontal: var(--kbq-size-s);--kbq-datepicker-size-grid-cell-padding-vertical: var(--kbq-size-s);--kbq-datepicker-size-grid-cell-border-radius: var(--kbq-size-s);--kbq-datepicker-container-background: var(--kbq-background-card);--kbq-datepicker-container-shadow: var(--kbq-shadow-popup);--kbq-datepicker-header-text: var(--kbq-foreground-contrast-tertiary);--kbq-datepicker-header-divider: var(--kbq-line-contrast-less);--kbq-datepicker-grid-cell-default-background: transparent;--kbq-datepicker-grid-cell-default-text: var(--kbq-foreground-contrast);--kbq-datepicker-grid-cell-today-background: transparent;--kbq-datepicker-grid-cell-today-text: var(--kbq-foreground-theme);--kbq-datepicker-grid-cell-states-hover-background: var(--kbq-states-background-transparent-hover);--kbq-datepicker-grid-cell-states-active-background: var(--kbq-states-background-transparent-active);--kbq-datepicker-grid-cell-states-selected-background: var(--kbq-background-contrast);--kbq-datepicker-grid-cell-states-selected-text: var(--kbq-foreground-white);--kbq-datepicker-grid-cell-states-selected-hover-background: var(--kbq-states-background-contrast-active);--kbq-datepicker-grid-cell-states-disabled-background: transparent;--kbq-datepicker-grid-cell-states-disabled-text: var(--kbq-states-foreground-disabled)}.kbq-pipe-date__popover .kbq-popover__container{max-height:unset}.kbq-pipe-date__popover .kbq-popover__content{padding:0}.kbq-pipe-date__popover .kbq-date-list{margin:var(--kbq-size-xxs) 0}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option{margin-left:var(--kbq-size-xxs);margin-right:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option .kbq-list-text{display:flex;flex-direction:row}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option .kbq-icon{margin-left:var(--kbq-size-s);align-self:center;color:var(--kbq-icon-fade-contrast-color)}.kbq-pipe-date__popover .kbq-date-period{width:320px}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__header{padding-top:var(--kbq-size-xs);padding-left:var(--kbq-size-xxs);padding-right:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__header .kbq-button{width:100%;justify-content:flex-start}.kbq-pipe-date__popover .kbq-date-period .kbq-divider{margin:var(--kbq-size-xxs) var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content{display:grid;grid-auto-columns:minmax(min-content,1fr);grid-template-columns:min-content;padding:0;gap:var(--kbq-size-s)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-date-period__content-header{grid-column:2 span;padding-top:var(--kbq-size-s);padding-left:var(--kbq-size-l);padding-right:var(--kbq-size-l);color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__label{padding-left:var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__control{padding-right:var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-date-period__date,.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-date-period__time{flex:1}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row_with-time{display:flex}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row_with-time .kbq-date-period__date .kbq-form-field__container{border-top-right-radius:unset;border-bottom-right-radius:unset}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row_with-time .kbq-date-period__time{margin-left:-1px}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row_with-time .kbq-date-period__time .kbq-form-field__container{border-top-left-radius:unset;border-bottom-left-radius:unset}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-calendar{position:relative;grid-column:2 span;padding:var(--kbq-size-s) var(--kbq-size-s) var(--kbq-size-m);background-color:var(--kbq-background-bg-tertiary)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-calendar.kbq-calendar_hidden{display:none}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-hint{grid-column:2 span;padding-left:var(--kbq-size-m);padding-right:var(--kbq-size-m)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer{padding:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer .kbq-button{width:100%;justify-content:flex-start}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer .kbq-button:not(.kbq-disabled) .kbq-button_hot-key{color:var(--kbq-foreground-contrast-secondary)}.kbq-datepicker__content{background:var(--kbq-datepicker-container-background);box-shadow:var(--kbq-datepicker-container-shadow)}.kbq-calendar__table-header{color:var(--kbq-datepicker-header-text)}.kbq-calendar__table-header-divider:after{background:var(--kbq-datepicker-header-divider)}.kbq-calendar__body-cell-content{background:var(--kbq-datepicker-grid-cell-default-background);color:var(--kbq-datepicker-grid-cell-default-text)}.kbq-calendar__body-cell-content.kbq-calendar__body-today{background:var(--kbq-datepicker-grid-cell-today-background);color:var(--kbq-datepicker-grid-cell-today-text)}.kbq-calendar__body-cell-content:hover:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-hover-background)}.kbq-calendar__body-cell-content:active:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-active-background)}.kbq-calendar__body-cell-content.kbq-selected:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-selected-background);color:var(--kbq-datepicker-grid-cell-states-selected-text)}.kbq-calendar__body-cell-content.kbq-selected:not(.kbq-disabled):hover{background:var(--kbq-datepicker-grid-cell-states-selected-hover-background)}.kbq-calendar__body-cell-content.kbq-disabled{color:var(--kbq-states-foreground-disabled);background:var(--kbq-datepicker-grid-cell-states-disabled-background)}.kbq-calendar,.kbq-calendar__table-header th{font-size:var(--kbq-typography-text-normal-font-size);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: KbqFormFieldModule }, { kind: "component", type: i6.KbqFormField, selector: "kbq-form-field", exportAs: ["kbqFormField"] }, { kind: "component", type: i6.KbqHint, selector: "kbq-hint", inputs: ["id", "fillTextOff", "compact"], exportAs: ["kbqHint"] }, { kind: "directive", type: i6.KbqPrefix, selector: "[kbqPrefix]" }, { kind: "directive", type: i6.KbqSuffix, selector: "[kbqSuffix]" }, { kind: "directive", type: i6.KbqValidateDirective, selector: " input[kbqInput], input[kbqNumberInput], input[kbqInputPassword], input[kbqTimepicker], input[kbqDatepicker], textarea[kbqTextarea], kbq-select, kbq-tree-select, kbq-tag-list ", exportAs: ["KbqValidate"] }, { kind: "component", type: KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "ngmodule", type: KbqInputModule }, { kind: "directive", type: i3.MaxValidator, selector: "[max][formControlName],[max][formControl],[max][ngModel]", inputs: ["max"] }, { kind: "ngmodule", type: KbqDividerModule }, { kind: "component", type: i4.KbqDivider, selector: "kbq-divider", inputs: ["vertical", "inset", "paddings"] }, { kind: "ngmodule", type: KbqPopoverModule }, { kind: "directive", type: i5.KbqPopoverTrigger, selector: "[kbqPopover]", inputs: ["kbqPopoverVisible", "kbqPopoverPlacement", "kbqPopoverPlacementPriority", "hasBackdrop", "kbqPopoverHeader", "kbqPopoverContent", "kbqPopoverFooter", "kbqPopoverDisabled", "kbqTrigger", "kbqPopoverSize", "kbqPopoverClass", "hasCloseButton", "closeOnScroll", "backdropClass", "kbqPopoverArrow", "kbqPopoverOffset"], outputs: ["kbqPopoverPlacementChange", "kbqPopoverVisibleChange"], exportAs: ["kbqPopover"] }, { kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "ngmodule", type: KbqListModule }, { kind: "component", type: i7.KbqListSelection, selector: "kbq-list-selection", inputs: ["autoSelect", "noUnselectLast", "horizontal", "tabIndex", "disabled", "compareWith"], outputs: ["onSelectAll", "onCopy", "selectionChange"], exportAs: ["kbqListSelection"] }, { kind: "component", type: i7.KbqListOption, selector: "kbq-list-option", inputs: ["checkboxPosition", "value", "disabled", "showCheckbox", "selected"], exportAs: ["kbqListOption"] }, { kind: "ngmodule", type: KbqDatepickerModule }, { kind: "component", type: i8.KbqCalendar, selector: "kbq-calendar", inputs: ["startAt", "selected", "minDate", "maxDate", "dateFilter", "dateClass"], outputs: ["selectedChange", "yearSelected", "monthSelected", "userSelection"], exportAs: ["kbqCalendar"] }, { kind: "directive", type: i8.KbqDatepickerInput, selector: "input[kbqDatepicker], input[kbqCalendar]", inputs: ["placeholder", "required", "kbqDatepicker", "kbqCalendar", "kbqDatepickerFilter", "value", "min", "max", "disabled", "id", "kbqValidationTooltip"], outputs: ["incorrectInput", "dateChange", "dateInput"], exportAs: ["kbqDatepickerInput"] }, { kind: "ngmodule", type: KbqTimepickerModule }, { kind: "directive", type: i9.KbqTimepicker, selector: "input[kbqTimepicker]", inputs: ["placeholder", "disabled", "id", "required", "format", "min", "max", "value", "kbqValidationTooltip"], outputs: ["incorrectInput"], exportAs: ["kbqTimepicker"] }, { kind: "directive", type: KbqPipeState, selector: "[kbqPipeState]", inputs: ["kbqPipeState"] }, { kind: "ngmodule", type: KbqFormattersModule }, { kind: "component", type: KbqPipeButton, selector: "kbq-pipe-button" }, { kind: "ngmodule", type: KbqTitleModule }, { kind: "directive", type: KbqPipeTitleDirective, selector: "[kbqPipeTitle]", inputs: ["kbqPipeTitle"], exportAs: ["kbqPipeTitle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
887
669
  }
888
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeButton, decorators: [{
670
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeDatetimeComponent, decorators: [{
889
671
  type: Component,
890
- args: [{ standalone: true, selector: 'kbq-pipe-button', template: `
891
- <button
892
- class="kbq-pipe__remove-button"
893
- [disabled]="pipe.data.disabled"
894
- [kbqPipeState]="pipe.data"
895
- (click)="pipe.data.cleanable ? pipe.onClear() : pipe.onRemove()"
896
- kbq-button
897
- kbqTooltip="{{ pipe.data.cleanable ? localeData.clearButtonTooltip : localeData.removeButtonTooltip }}"
898
- >
899
- <i kbq-icon="kbq-xmark-s_16"></i>
900
- </button>
901
- `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
902
- class: 'kbq-pipe-button'
903
- }, imports: [
672
+ args: [{ standalone: true, selector: 'kbq-pipe-datetime', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
673
+ {
674
+ provide: KBQ_VALIDATION,
675
+ useValue: { useValidation: false }
676
+ },
677
+ {
678
+ provide: KbqBasePipe,
679
+ useExisting: this
680
+ }
681
+ ], imports: [
682
+ ReactiveFormsModule,
683
+ KbqFormFieldModule,
904
684
  KbqIcon,
685
+ KbqInputModule,
905
686
  KbqDividerModule,
687
+ KbqPopoverModule,
906
688
  KbqButtonModule,
689
+ KbqListModule,
690
+ KbqDatepickerModule,
691
+ KbqTimepickerModule,
907
692
  KbqPipeState,
908
- KbqTooltipTrigger
909
- ], styles: [".kbq-pipe-button{display:flex;position:relative}\n"] }]
910
- }], ctorParameters: () => [] });
693
+ KbqFormattersModule,
694
+ KbqPipeButton,
695
+ KbqTitleModule,
696
+ KbqPipeTitleDirective,
697
+ FormsModule
698
+ ], template: "<button\n #popover=\"kbqPopover\"\n kbq-button\n kbqPopover\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [kbqPopoverArrow]=\"false\"\n [kbqPopoverClass]=\"'kbq-pipe-date__popover'\"\n [kbqPopoverContent]=\"content\"\n [kbqPopoverOffset]=\"4\"\n [kbqPopoverPlacement]=\"placements.BottomLeft\"\n [kbqPopoverPlacementPriority]=\"[placements.BottomLeft, placements.TopLeft]\"\n (kbqPopoverVisibleChange)=\"isListMode = true\"\n>\n <span #kbqTitleText class=\"kbq-pipe__name\">{{ data.name }}</span>\n <span #kbqTitleText class=\"kbq-pipe__value\" [class.kbq-pipe__value_empty]=\"!formattedValue\">\n {{ formattedValue }}\n </span>\n</button>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #content>\n @if (isListMode) {\n <div class=\"kbq-date-list\">\n <kbq-list-selection #listSelection [autoSelect]=\"false\" [ngModel]=\"data.value?.name\">\n <kbq-list-option (click)=\"showPeriod()\" (keydown.enter)=\"showPeriod()\">\n {{ localeData.datePipe?.customPeriod }}\n <i class=\"kbq kbq-icon kbq-chevron-right_16 kbq-contrast-fade\"></i>\n </kbq-list-option>\n\n @for (item of values; track item) {\n <kbq-list-option [value]=\"item.name\" (click)=\"onSelect(item)\" (keydown.enter)=\"onSelect(item)\">\n {{ item.name }}\n </kbq-list-option>\n }\n </kbq-list-selection>\n </div>\n } @else {\n <div class=\"kbq-date-period kbq-datepicker__content\" (keydown)=\"onKeydown($event)\">\n <div class=\"kbq-date-period__header\">\n <button\n #returnButton\n kbq-button\n [color]=\"colors.Theme\"\n [kbqStyle]=\"styles.Transparent\"\n (click)=\"showList()\"\n >\n <i kbq-icon=\"kbq-chevron-left_16\"></i>\n {{ localeData.datePipe.backToPeriodSelection }}\n </button>\n </div>\n\n <kbq-divider />\n\n <form class=\"kbq-date-period__content kbq-form-horizontal\" [formGroup]=\"formGroup\">\n <div class=\"kbq-date-period__content-header\">{{ localeData.datePipe.customPeriod }}</div>\n <label class=\"kbq-form__label\">{{ localeData.datePipe.customPeriodFrom }}</label>\n\n <div class=\"kbq-form__row_with-time kbq-form__control\">\n <kbq-form-field class=\"kbq-date-period__date\" [class.kbq-focused]=\"showStartCalendar\">\n <input\n formControlName=\"start\"\n [kbqCalendar]=\"startDateCalendar\"\n [max]=\"formGroup.controls.end.value\"\n (focusin)=\"onFocusStartInput()\"\n (keydown.tab)=\"hideCalendars()\"\n />\n <i kbq-icon=\"kbq-calendar-o_16\" kbqSuffix></i>\n </kbq-form-field>\n\n <kbq-form-field class=\"kbq-date-period__time\">\n <i kbq-icon=\"kbq-clock_16\" kbqPrefix></i>\n <input formControlName=\"start\" kbqTimepicker (focusin)=\"hideCalendars()\" />\n </kbq-form-field>\n </div>\n\n <kbq-calendar\n #startDateCalendar\n [class.kbq-calendar_hidden]=\"!showStartCalendar\"\n (selectedChange)=\"onSelectStartDate($event)\"\n />\n\n <label class=\"kbq-form__label\">{{ localeData.datePipe.customPeriodTo }}</label>\n\n <div class=\"kbq-form__row_with-time kbq-form__control\">\n <kbq-form-field class=\"kbq-date-period__date\" [class.kbq-focused]=\"showEndCalendar\">\n <input\n formControlName=\"end\"\n [kbqCalendar]=\"endDateCalendar\"\n (focusin)=\"onFocusEndInput()\"\n (keydown.tab)=\"hideCalendars()\"\n />\n <i kbq-icon=\"kbq-calendar-o_16\" kbqSuffix></i>\n </kbq-form-field>\n\n <kbq-form-field class=\"kbq-date-period__time\">\n <i kbq-icon=\"kbq-clock_16\" kbqPrefix></i>\n <input formControlName=\"end\" kbqTimepicker (focusin)=\"hideCalendars()\" />\n </kbq-form-field>\n </div>\n\n @if (formGroup.controls.start.invalid) {\n <kbq-hint class=\"kbq-date-period__hint\" [color]=\"'error'\">\n {{ localeData.datePipe.customPeriodErrorHint }}\n </kbq-hint>\n }\n\n <kbq-calendar\n #endDateCalendar\n [class.kbq-calendar_hidden]=\"!showEndCalendar\"\n (selectedChange)=\"onSelectEndDate($event)\"\n />\n </form>\n\n <div class=\"kbq-date-period__footer\">\n <button\n kbq-button\n [color]=\"'theme'\"\n [disabled]=\"disabled\"\n [kbqStyle]=\"'transparent'\"\n (click)=\"onApplyPeriod()\"\n >\n <span>{{ localeData.pipe.applyButton }}</span>\n &nbsp;\n <span class=\"kbq-button_hot-key\">{{ isMac ? '\u2318' : 'Ctrl+' }}Enter</span>\n </button>\n </div>\n </div>\n }\n</ng-template>\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ formattedValue }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n", ".kbq-datepicker__content{--kbq-datepicker-size-container-padding-vertical: var(--kbq-size-m);--kbq-datepicker-size-container-border-radius: var(--kbq-size-s);--kbq-datepicker-size-header-padding-horizontal: var(--kbq-size-xxs);--kbq-datepicker-size-header-margin-bottom: var(--kbq-size-3xs);--kbq-datepicker-size-grid-padding-horizontal: var(--kbq-size-m);--kbq-datepicker-size-grid-content-gap-vertical: var(--kbq-size-3xs);--kbq-datepicker-size-grid-divider-height: 1px;--kbq-datepicker-size-grid-cell-padding-horizontal: var(--kbq-size-s);--kbq-datepicker-size-grid-cell-padding-vertical: var(--kbq-size-s);--kbq-datepicker-size-grid-cell-border-radius: var(--kbq-size-s);--kbq-datepicker-container-background: var(--kbq-background-card);--kbq-datepicker-container-shadow: var(--kbq-shadow-popup);--kbq-datepicker-header-text: var(--kbq-foreground-contrast-tertiary);--kbq-datepicker-header-divider: var(--kbq-line-contrast-less);--kbq-datepicker-grid-cell-default-background: transparent;--kbq-datepicker-grid-cell-default-text: var(--kbq-foreground-contrast);--kbq-datepicker-grid-cell-today-background: transparent;--kbq-datepicker-grid-cell-today-text: var(--kbq-foreground-theme);--kbq-datepicker-grid-cell-states-hover-background: var(--kbq-states-background-transparent-hover);--kbq-datepicker-grid-cell-states-active-background: var(--kbq-states-background-transparent-active);--kbq-datepicker-grid-cell-states-selected-background: var(--kbq-background-contrast);--kbq-datepicker-grid-cell-states-selected-text: var(--kbq-foreground-white);--kbq-datepicker-grid-cell-states-selected-hover-background: var(--kbq-states-background-contrast-active);--kbq-datepicker-grid-cell-states-disabled-background: transparent;--kbq-datepicker-grid-cell-states-disabled-text: var(--kbq-states-foreground-disabled)}.kbq-pipe-date__popover .kbq-popover__container{max-height:unset}.kbq-pipe-date__popover .kbq-popover__content{padding:0}.kbq-pipe-date__popover .kbq-date-list{margin:var(--kbq-size-xxs) 0}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option{margin-left:var(--kbq-size-xxs);margin-right:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option .kbq-list-text{display:flex;flex-direction:row}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option .kbq-icon{margin-left:var(--kbq-size-s);align-self:center;color:var(--kbq-icon-fade-contrast-color)}.kbq-pipe-date__popover .kbq-date-period{width:320px}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__header{padding-top:var(--kbq-size-xs);padding-left:var(--kbq-size-xxs);padding-right:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__header .kbq-button{width:100%;justify-content:flex-start}.kbq-pipe-date__popover .kbq-date-period .kbq-divider{margin:var(--kbq-size-xxs) var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content{display:grid;grid-auto-columns:minmax(min-content,1fr);grid-template-columns:min-content;padding:0;gap:var(--kbq-size-s)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-date-period__content-header{grid-column:2 span;padding-top:var(--kbq-size-s);padding-left:var(--kbq-size-l);padding-right:var(--kbq-size-l);color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__label{padding-left:var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__control{padding-right:var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-date-period__date,.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-date-period__time{flex:1}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row_with-time{display:flex}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row_with-time .kbq-date-period__date .kbq-form-field__container{border-top-right-radius:unset;border-bottom-right-radius:unset}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row_with-time .kbq-date-period__time{margin-left:-1px}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row_with-time .kbq-date-period__time .kbq-form-field__container{border-top-left-radius:unset;border-bottom-left-radius:unset}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-calendar{position:relative;grid-column:2 span;padding:var(--kbq-size-s) var(--kbq-size-s) var(--kbq-size-m);background-color:var(--kbq-background-bg-tertiary)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-calendar.kbq-calendar_hidden{display:none}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-hint{grid-column:2 span;padding-left:var(--kbq-size-m);padding-right:var(--kbq-size-m)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer{padding:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer .kbq-button{width:100%;justify-content:flex-start}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer .kbq-button:not(.kbq-disabled) .kbq-button_hot-key{color:var(--kbq-foreground-contrast-secondary)}.kbq-datepicker__content{background:var(--kbq-datepicker-container-background);box-shadow:var(--kbq-datepicker-container-shadow)}.kbq-calendar__table-header{color:var(--kbq-datepicker-header-text)}.kbq-calendar__table-header-divider:after{background:var(--kbq-datepicker-header-divider)}.kbq-calendar__body-cell-content{background:var(--kbq-datepicker-grid-cell-default-background);color:var(--kbq-datepicker-grid-cell-default-text)}.kbq-calendar__body-cell-content.kbq-calendar__body-today{background:var(--kbq-datepicker-grid-cell-today-background);color:var(--kbq-datepicker-grid-cell-today-text)}.kbq-calendar__body-cell-content:hover:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-hover-background)}.kbq-calendar__body-cell-content:active:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-active-background)}.kbq-calendar__body-cell-content.kbq-selected:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-selected-background);color:var(--kbq-datepicker-grid-cell-states-selected-text)}.kbq-calendar__body-cell-content.kbq-selected:not(.kbq-disabled):hover{background:var(--kbq-datepicker-grid-cell-states-selected-hover-background)}.kbq-calendar__body-cell-content.kbq-disabled{color:var(--kbq-states-foreground-disabled);background:var(--kbq-datepicker-grid-cell-states-disabled-background)}.kbq-calendar,.kbq-calendar__table-header th{font-size:var(--kbq-typography-text-normal-font-size);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}\n"] }]
699
+ }], propDecorators: { popover: [{
700
+ type: ViewChild,
701
+ args: ['popover']
702
+ }] } });
911
703
 
912
- class KbqPipeTitleDirective extends KbqTooltipTrigger {
704
+ class KbqPipeMultiSelectComponent extends KbqBasePipe {
913
705
  constructor() {
914
706
  super(...arguments);
915
- this.componentInstance = inject(KBQ_TITLE_TEXT_REF, { optional: true, host: true });
916
- this.resizeStream = new Subject();
917
- this.debounceInterval = 100;
918
- this.resizeSubscription = Subscription.EMPTY;
919
- this.mutationSubscription = Subscription.EMPTY;
920
- this.focusMonitorSubscription = Subscription.EMPTY;
921
- }
922
- get isOverflown() {
923
- return this.childContainer.some(({ nativeElement }) => {
924
- return (this.parent?.offsetWidth < nativeElement.scrollWidth ||
925
- this.parent?.offsetHeight < nativeElement.scrollHeight);
926
- });
707
+ /** control for search options */
708
+ this.searchControl = new UntypedFormControl();
709
+ /** Comparator of selected options */
710
+ this.compareByValue = (o1, o2) => o1?.id === o2?.id;
927
711
  }
928
- get parent() {
929
- return this.parentContainer?.nativeElement || this.parentContainer;
712
+ /** selected value */
713
+ get selected() {
714
+ return this.data.value;
930
715
  }
931
- get child() {
932
- return this.childContainer.first.nativeElement || this.childContainer;
716
+ /** Whether the current pipe is empty. */
717
+ get isEmpty() {
718
+ return !this.data.value?.length;
933
719
  }
934
- ngAfterViewInit() {
935
- this.parentContainer = this.parentContainer || this.componentInstance?.parentTextElement || this.elementRef;
936
- this.childContainer = this.childContainer || this.componentInstance?.textElement || this.elementRef;
937
- this.content = this.viewValue;
938
- this.resizeSubscription = this.resizeStream
939
- .pipe(debounceTime(this.debounceInterval))
940
- .subscribe(() => (this.disabled = !this.isOverflown));
941
- this.mutationSubscription = this.createMutationObserver()
942
- .pipe(throttleTime(this.debounceInterval))
943
- .subscribe(() => {
944
- this.disabled = !this.isOverflown;
945
- this.content = this.viewValue;
946
- });
947
- this.focusMonitorSubscription = this.focusMonitor
948
- .monitor(this.elementRef)
949
- .subscribe((origin) => (origin === 'keyboard' ? this.handleElementEnter() : this.hideTooltip()));
720
+ ngOnInit() {
721
+ this.filteredOptions = merge(of(this.values), this.searchControl.valueChanges.pipe(map((value) => this.getFilteredOptions(value))));
950
722
  }
951
- ngOnDestroy() {
952
- super.ngOnDestroy();
953
- this.resizeSubscription.unsubscribe();
954
- this.mutationSubscription.unsubscribe();
955
- this.focusMonitorSubscription.unsubscribe();
956
- this.focusMonitor.stopMonitoring(this.elementRef);
723
+ onSelect(item) {
724
+ this.data.value = item;
725
+ this.filterBar?.onChangePipe.emit(this.data);
726
+ this.stateChanges.next();
957
727
  }
958
- handleElementEnter() {
959
- this.disabled = !this.isOverflown;
728
+ onClear() {
729
+ this.data.value = [];
730
+ this.filterBar?.onChangePipe.emit(this.data);
731
+ this.stateChanges.next();
960
732
  }
961
- hideTooltip() {
962
- this.disabled = true;
733
+ /** opens select */
734
+ open() {
735
+ this.select.open();
963
736
  }
964
- createMutationObserver() {
965
- return new Observable((observer) => {
966
- const mutationObserver = new MutationObserver((mutations) => observer.next(mutations));
967
- mutationObserver.observe(this.parent, {
968
- characterData: true,
969
- attributes: false,
970
- childList: true,
971
- subtree: true
972
- });
973
- return () => mutationObserver.disconnect();
974
- });
737
+ getFilteredOptions(value) {
738
+ return value
739
+ ? this.values.filter((item) => item.name.toLowerCase().includes(value.toLowerCase()))
740
+ : this.values;
975
741
  }
976
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeTitleDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
977
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: KbqPipeTitleDirective, isStandalone: true, selector: "[kbqPipeTitle]", inputs: { viewValue: ["kbqPipeTitle", "viewValue"] }, host: { listeners: { "mouseenter": "handleElementEnter()", "mouseleave": "hideTooltip()", "window:resize": "resizeStream.next($event)" } }, queries: [{ propertyName: "parentContainer", first: true, predicate: ["kbqTitleContainer"], descendants: true }, { propertyName: "childContainer", predicate: ["kbqTitleText"], descendants: true }], exportAs: ["kbqPipeTitle"], usesInheritance: true, ngImport: i0 }); }
742
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeMultiSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
743
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: KbqPipeMultiSelectComponent, isStandalone: true, selector: "kbq-pipe-multi-select", providers: [
744
+ {
745
+ provide: KbqBasePipe,
746
+ useExisting: this
747
+ }
748
+ ], viewQueries: [{ propertyName: "select", first: true, predicate: KbqSelect, descendants: true }], usesInheritance: true, ngImport: i0, template: "<kbq-select\n #select=\"kbqSelect\"\n multiple\n [compareWith]=\"compareByValue\"\n [disabled]=\"data.disabled\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [ngClass]=\"{ 'kbq-active': select.panelOpen }\"\n [panelClass]=\"'kbq-pipe-multiselect__panel'\"\n [tabIndex]=\"-1\"\n [value]=\"selected\"\n (selectionChange)=\"onSelect($event.value)\"\n>\n <button\n kbq-button\n kbq-select-matcher\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [ngClass]=\"{ 'kbq-active': select.panelOpen }\"\n >\n <span #kbqTitleText class=\"kbq-pipe__name\">{{ data.name }}</span>\n @if (select.triggerValues.length === 1) {\n <span #kbqTitleText class=\"kbq-pipe__value\" [class.kbq-pipe__value_empty]=\"!select.triggerValue\">\n {{ select.triggerValue }}\n </span>\n } @else if (select.triggerValues.length > 1) {\n <kbq-badge [badgeColor]=\"'contrast'\" [compact]=\"true\">\n {{ select.triggerValues.length }}\n </kbq-badge>\n }\n </button>\n @if (data.search) {\n <kbq-form-field kbqFormFieldWithoutBorders kbqSelectSearch>\n <i kbq-icon=\"kbq-magnifying-glass_16\" kbqPrefix></i>\n <input kbqInput placeholder=\"Search\" type=\"text\" [formControl]=\"searchControl\" />\n <kbq-cleaner />\n </kbq-form-field>\n }\n\n <div kbq-select-search-empty-result>{{ localeData.pipe.emptySearchResult }}</div>\n\n @for (item of filteredOptions | async; track item) {\n <kbq-option [value]=\"item\">\n @if (isTemplateRef(valueTemplate)) {\n <ng-container\n [ngTemplateOutlet]=\"$any(valueTemplate)\"\n [ngTemplateOutletContext]=\"{ $implicit, option: item }\"\n />\n } @else {\n {{ item.name }}\n }\n </kbq-option>\n }\n</kbq-select>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ select.triggerValue }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n", ".kbq-pipe__multiselect .kbq-pipe__value{margin-left:var(--kbq-size-xxs)}.kbq-pipe__multiselect .kbq-badge{align-self:center;margin-left:var(--kbq-size-xs)}.kbq-pipe-multiselect__panel .kbq-select__content{max-height:404px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "ngmodule", type: KbqDividerModule }, { kind: "ngmodule", type: KbqSelectModule }, { kind: "component", type: i3$1.KbqSelect, selector: "kbq-select", inputs: ["hiddenItemsText", "panelClass", "backdropClass", "errorStateMatcher", "sortComparator", "hasBackdrop", "placeholder", "required", "multiple", "compareWith", "panelWidth", "panelMinWidth", "value", "id", "tabIndex", "disabled", "hiddenItemsTextFormatter"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["kbqSelect"] }, { kind: "directive", type: i3$1.KbqOptionTooltip, selector: "kbq-option" }, { kind: "component", type: i3$2.KbqOption, selector: "kbq-option", inputs: ["value", "userSelect", "showCheckbox", "disabled"], outputs: ["onSelectionChange"], exportAs: ["kbqOption"] }, { kind: "directive", type: i3$2.KbqSelectSearch, selector: "[kbqSelectSearch]", exportAs: ["kbqSelectSearch"] }, { kind: "directive", type: i3$2.KbqSelectMatcher, selector: "kbq-select-matcher, [kbq-select-matcher]" }, { kind: "directive", type: i3$2.KbqSelectSearchEmptyResult, selector: "[kbq-select-search-empty-result]", exportAs: ["kbqSelectSearchEmptyResult"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: KbqPipeState, selector: "[kbqPipeState]", inputs: ["kbqPipeState"] }, { kind: "ngmodule", type: KbqBadgeModule }, { kind: "component", type: i5$1.KbqBadge, selector: "kbq-badge", inputs: ["compact", "outline", "badgeColor"] }, { kind: "directive", type: i5$1.KbqBadgeCssStyler, selector: "kbq-badge" }, { kind: "component", type: KbqPipeButton, selector: "kbq-pipe-button" }, { kind: "ngmodule", type: KbqTitleModule }, { kind: "directive", type: KbqPipeTitleDirective, selector: "[kbqPipeTitle]", inputs: ["kbqPipeTitle"], exportAs: ["kbqPipeTitle"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: KbqFormFieldModule }, { kind: "component", type: i6.KbqFormField, selector: "kbq-form-field", exportAs: ["kbqFormField"] }, { kind: "directive", type: i6.KbqFormFieldWithoutBorders, selector: "kbq-form-field[kbqFormFieldWithoutBorders]", exportAs: ["kbqFormFieldWithoutBorders"] }, { kind: "directive", type: i6.KbqPrefix, selector: "[kbqPrefix]" }, { kind: "component", type: i6.KbqCleaner, selector: "kbq-cleaner", exportAs: ["kbqCleaner"] }, { kind: "directive", type: i6.KbqValidateDirective, selector: " input[kbqInput], input[kbqNumberInput], input[kbqInputPassword], input[kbqTimepicker], input[kbqDatepicker], textarea[kbqTextarea], kbq-select, kbq-tree-select, kbq-tag-list ", exportAs: ["KbqValidate"] }, { kind: "directive", type: i6.KbqTrim, selector: "[kbqInput], [kbqTextarea]", exportAs: ["KbqTrim"] }, { kind: "component", type: KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "ngmodule", type: KbqInputModule }, { kind: "directive", type: i3.KbqInput, selector: "input[kbqInput],input[kbqNumberInput]", inputs: ["errorStateMatcher", "placeholder", "disabled", "id", "required", "type", "value"], exportAs: ["kbqInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
978
749
  }
979
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeTitleDirective, decorators: [{
980
- type: Directive,
981
- args: [{
982
- standalone: true,
983
- selector: '[kbqPipeTitle]',
984
- exportAs: 'kbqPipeTitle',
985
- host: {
986
- '(mouseenter)': 'handleElementEnter()',
987
- '(mouseleave)': 'hideTooltip()',
988
- '(window:resize)': 'resizeStream.next($event)'
989
- }
990
- }]
991
- }], propDecorators: { viewValue: [{
992
- type: Input,
993
- args: [{ alias: 'kbqPipeTitle' }]
994
- }], childContainer: [{
995
- type: ContentChildren,
996
- args: ['kbqTitleText', { descendants: true }]
997
- }], parentContainer: [{
998
- type: ContentChild,
999
- args: ['kbqTitleContainer']
750
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeMultiSelectComponent, decorators: [{
751
+ type: Component,
752
+ args: [{ standalone: true, selector: 'kbq-pipe-multi-select', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
753
+ {
754
+ provide: KbqBasePipe,
755
+ useExisting: this
756
+ }
757
+ ], imports: [
758
+ FormsModule,
759
+ KbqButtonModule,
760
+ KbqDividerModule,
761
+ KbqSelectModule,
762
+ NgClass,
763
+ KbqPipeState,
764
+ KbqBadgeModule,
765
+ KbqPipeButton,
766
+ KbqTitleModule,
767
+ KbqPipeTitleDirective,
768
+ NgTemplateOutlet,
769
+ KbqFormFieldModule,
770
+ KbqIcon,
771
+ KbqInputModule,
772
+ ReactiveFormsModule,
773
+ AsyncPipe
774
+ ], template: "<kbq-select\n #select=\"kbqSelect\"\n multiple\n [compareWith]=\"compareByValue\"\n [disabled]=\"data.disabled\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [ngClass]=\"{ 'kbq-active': select.panelOpen }\"\n [panelClass]=\"'kbq-pipe-multiselect__panel'\"\n [tabIndex]=\"-1\"\n [value]=\"selected\"\n (selectionChange)=\"onSelect($event.value)\"\n>\n <button\n kbq-button\n kbq-select-matcher\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [ngClass]=\"{ 'kbq-active': select.panelOpen }\"\n >\n <span #kbqTitleText class=\"kbq-pipe__name\">{{ data.name }}</span>\n @if (select.triggerValues.length === 1) {\n <span #kbqTitleText class=\"kbq-pipe__value\" [class.kbq-pipe__value_empty]=\"!select.triggerValue\">\n {{ select.triggerValue }}\n </span>\n } @else if (select.triggerValues.length > 1) {\n <kbq-badge [badgeColor]=\"'contrast'\" [compact]=\"true\">\n {{ select.triggerValues.length }}\n </kbq-badge>\n }\n </button>\n @if (data.search) {\n <kbq-form-field kbqFormFieldWithoutBorders kbqSelectSearch>\n <i kbq-icon=\"kbq-magnifying-glass_16\" kbqPrefix></i>\n <input kbqInput placeholder=\"Search\" type=\"text\" [formControl]=\"searchControl\" />\n <kbq-cleaner />\n </kbq-form-field>\n }\n\n <div kbq-select-search-empty-result>{{ localeData.pipe.emptySearchResult }}</div>\n\n @for (item of filteredOptions | async; track item) {\n <kbq-option [value]=\"item\">\n @if (isTemplateRef(valueTemplate)) {\n <ng-container\n [ngTemplateOutlet]=\"$any(valueTemplate)\"\n [ngTemplateOutletContext]=\"{ $implicit, option: item }\"\n />\n } @else {\n {{ item.name }}\n }\n </kbq-option>\n }\n</kbq-select>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ select.triggerValue }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n", ".kbq-pipe__multiselect .kbq-pipe__value{margin-left:var(--kbq-size-xxs)}.kbq-pipe__multiselect .kbq-badge{align-self:center;margin-left:var(--kbq-size-xs)}.kbq-pipe-multiselect__panel .kbq-select__content{max-height:404px}\n"] }]
775
+ }], propDecorators: { select: [{
776
+ type: ViewChild,
777
+ args: [KbqSelect]
1000
778
  }] } });
1001
779
 
1002
- class KbqPipeDateComponent extends KbqBasePipe {
780
+ class KbqPipeSelectComponent extends KbqBasePipe {
1003
781
  constructor() {
1004
782
  super(...arguments);
1005
- this.adapter = inject(DateAdapter);
1006
- this.formatter = inject(DateFormatter);
1007
- this.placements = PopUpPlacements;
1008
- this.styles = KbqButtonStyles;
1009
- this.colors = KbqComponentColors;
1010
- this.list = true;
1011
- this.showStartCalendar = false;
1012
- this.showEndCalendar = false;
1013
- this.listSelection = viewChild.required('listSelection', { read: KbqListSelection });
1014
- this.returnButton = viewChild.required('returnButton', { read: KbqButton });
783
+ /** control for search options */
784
+ this.searchControl = new UntypedFormControl();
785
+ /** Comparator of selected options */
786
+ this.compareByValue = (o1, o2) => o1 && o2 && o1.id === o2.id;
1015
787
  }
1016
- get formattedValue() {
1017
- if (this.start && this.end) {
1018
- return this.formatter.rangeShortDate(this.start, this.end);
1019
- }
1020
- return this.data.value?.name ?? '';
788
+ /** selected value */
789
+ get selected() {
790
+ return this.data.value;
791
+ }
792
+ /** Whether the current pipe is empty. */
793
+ get isEmpty() {
794
+ return !this.data.value;
795
+ }
796
+ ngOnInit() {
797
+ this.filteredOptions = merge(of(this.values), this.searchControl.valueChanges.pipe(map((value) => this.getFilteredOptions(value))));
798
+ }
799
+ onSelect(item) {
800
+ this.data.value = item;
801
+ this.filterBar?.onChangePipe.emit(this.data);
802
+ this.stateChanges.next();
803
+ }
804
+ /** opens select */
805
+ open() {
806
+ this.select.open();
807
+ }
808
+ getFilteredOptions(value) {
809
+ return value
810
+ ? this.values.filter((item) => item.name.toLowerCase().includes(value.toLowerCase()))
811
+ : this.values;
812
+ }
813
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
814
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: KbqPipeSelectComponent, isStandalone: true, selector: "kbq-pipe-select", providers: [
815
+ {
816
+ provide: KbqBasePipe,
817
+ useExisting: this
818
+ }
819
+ ], viewQueries: [{ propertyName: "select", first: true, predicate: KbqSelect, descendants: true }], usesInheritance: true, ngImport: i0, template: "<kbq-select\n #select\n [compareWith]=\"compareByValue\"\n [disabled]=\"data.disabled\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [ngClass]=\"{ 'kbq-active': select.panelOpen }\"\n [panelClass]=\"'kbq-pipe-select__panel'\"\n [tabIndex]=\"-1\"\n [value]=\"selected\"\n (selectionChange)=\"onSelect($event.value)\"\n>\n <button\n kbq-button\n kbq-select-matcher\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [ngClass]=\"{ 'kbq-active': select.panelOpen }\"\n >\n <span #kbqTitleText kbqPipeMinWidth class=\"kbq-pipe__name\">{{ data.name }}</span>\n <span\n #kbqTitleText\n kbqPipeMinWidth\n class=\"kbq-pipe__value\"\n [class.kbq-pipe__value_empty]=\"!select.triggerValue\"\n >\n {{ select.triggerValue }}\n </span>\n </button>\n\n @if (data.search) {\n <kbq-form-field kbqFormFieldWithoutBorders kbqSelectSearch>\n <i kbq-icon=\"kbq-magnifying-glass_16\" kbqPrefix></i>\n <input kbqInput placeholder=\"Search\" type=\"text\" [formControl]=\"searchControl\" />\n <kbq-cleaner />\n </kbq-form-field>\n }\n\n <div kbq-select-search-empty-result>{{ localeData.pipe.emptySearchResult }}</div>\n\n @for (item of filteredOptions | async; track item) {\n <kbq-option [value]=\"item\">\n @if (isTemplateRef(valueTemplate)) {\n <ng-container\n [ngTemplateOutlet]=\"$any(valueTemplate)\"\n [ngTemplateOutletContext]=\"{ $implicit, option: item }\"\n />\n } @else {\n {{ item.name }}\n }\n </kbq-option>\n }\n</kbq-select>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ select.triggerValue }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n", ".kbq-pipe-select__panel .kbq-select__content{max-height:404px}\n"], dependencies: [{ kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "ngmodule", type: KbqDividerModule }, { kind: "ngmodule", type: KbqSelectModule }, { kind: "component", type: i3$1.KbqSelect, selector: "kbq-select", inputs: ["hiddenItemsText", "panelClass", "backdropClass", "errorStateMatcher", "sortComparator", "hasBackdrop", "placeholder", "required", "multiple", "compareWith", "panelWidth", "panelMinWidth", "value", "id", "tabIndex", "disabled", "hiddenItemsTextFormatter"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["kbqSelect"] }, { kind: "directive", type: i3$1.KbqOptionTooltip, selector: "kbq-option" }, { kind: "component", type: i3$2.KbqOption, selector: "kbq-option", inputs: ["value", "userSelect", "showCheckbox", "disabled"], outputs: ["onSelectionChange"], exportAs: ["kbqOption"] }, { kind: "directive", type: i3$2.KbqSelectSearch, selector: "[kbqSelectSearch]", exportAs: ["kbqSelectSearch"] }, { kind: "directive", type: i3$2.KbqSelectMatcher, selector: "kbq-select-matcher, [kbq-select-matcher]" }, { kind: "directive", type: i3$2.KbqSelectSearchEmptyResult, selector: "[kbq-select-search-empty-result]", exportAs: ["kbqSelectSearchEmptyResult"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: KbqPipeState, selector: "[kbqPipeState]", inputs: ["kbqPipeState"] }, { kind: "component", type: KbqPipeButton, selector: "kbq-pipe-button" }, { kind: "ngmodule", type: KbqTitleModule }, { kind: "directive", type: KbqPipeTitleDirective, selector: "[kbqPipeTitle]", inputs: ["kbqPipeTitle"], exportAs: ["kbqPipeTitle"] }, { kind: "directive", type: KbqPipeMinWidth, selector: "[kbqPipeMinWidth]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: KbqFormFieldModule }, { kind: "component", type: i6.KbqFormField, selector: "kbq-form-field", exportAs: ["kbqFormField"] }, { kind: "directive", type: i6.KbqFormFieldWithoutBorders, selector: "kbq-form-field[kbqFormFieldWithoutBorders]", exportAs: ["kbqFormFieldWithoutBorders"] }, { kind: "directive", type: i6.KbqPrefix, selector: "[kbqPrefix]" }, { kind: "component", type: i6.KbqCleaner, selector: "kbq-cleaner", exportAs: ["kbqCleaner"] }, { kind: "directive", type: i6.KbqValidateDirective, selector: " input[kbqInput], input[kbqNumberInput], input[kbqInputPassword], input[kbqTimepicker], input[kbqDatepicker], textarea[kbqTextarea], kbq-select, kbq-tree-select, kbq-tag-list ", exportAs: ["KbqValidate"] }, { kind: "directive", type: i6.KbqTrim, selector: "[kbqInput], [kbqTextarea]", exportAs: ["KbqTrim"] }, { kind: "component", type: KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "ngmodule", type: KbqInputModule }, { kind: "directive", type: i3.KbqInput, selector: "input[kbqInput],input[kbqNumberInput]", inputs: ["errorStateMatcher", "placeholder", "disabled", "id", "required", "type", "value"], exportAs: ["kbqInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
820
+ }
821
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeSelectComponent, decorators: [{
822
+ type: Component,
823
+ args: [{ standalone: true, selector: 'kbq-pipe-select', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
824
+ {
825
+ provide: KbqBasePipe,
826
+ useExisting: this
827
+ }
828
+ ], imports: [
829
+ KbqButtonModule,
830
+ KbqDividerModule,
831
+ KbqSelectModule,
832
+ NgClass,
833
+ KbqPipeState,
834
+ KbqPipeButton,
835
+ KbqTitleModule,
836
+ KbqPipeTitleDirective,
837
+ KbqPipeMinWidth,
838
+ NgTemplateOutlet,
839
+ KbqFormFieldModule,
840
+ KbqIcon,
841
+ KbqInputModule,
842
+ ReactiveFormsModule,
843
+ AsyncPipe
844
+ ], template: "<kbq-select\n #select\n [compareWith]=\"compareByValue\"\n [disabled]=\"data.disabled\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [ngClass]=\"{ 'kbq-active': select.panelOpen }\"\n [panelClass]=\"'kbq-pipe-select__panel'\"\n [tabIndex]=\"-1\"\n [value]=\"selected\"\n (selectionChange)=\"onSelect($event.value)\"\n>\n <button\n kbq-button\n kbq-select-matcher\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [ngClass]=\"{ 'kbq-active': select.panelOpen }\"\n >\n <span #kbqTitleText kbqPipeMinWidth class=\"kbq-pipe__name\">{{ data.name }}</span>\n <span\n #kbqTitleText\n kbqPipeMinWidth\n class=\"kbq-pipe__value\"\n [class.kbq-pipe__value_empty]=\"!select.triggerValue\"\n >\n {{ select.triggerValue }}\n </span>\n </button>\n\n @if (data.search) {\n <kbq-form-field kbqFormFieldWithoutBorders kbqSelectSearch>\n <i kbq-icon=\"kbq-magnifying-glass_16\" kbqPrefix></i>\n <input kbqInput placeholder=\"Search\" type=\"text\" [formControl]=\"searchControl\" />\n <kbq-cleaner />\n </kbq-form-field>\n }\n\n <div kbq-select-search-empty-result>{{ localeData.pipe.emptySearchResult }}</div>\n\n @for (item of filteredOptions | async; track item) {\n <kbq-option [value]=\"item\">\n @if (isTemplateRef(valueTemplate)) {\n <ng-container\n [ngTemplateOutlet]=\"$any(valueTemplate)\"\n [ngTemplateOutletContext]=\"{ $implicit, option: item }\"\n />\n } @else {\n {{ item.name }}\n }\n </kbq-option>\n }\n</kbq-select>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ select.triggerValue }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n", ".kbq-pipe-select__panel .kbq-select__content{max-height:404px}\n"] }]
845
+ }], propDecorators: { select: [{
846
+ type: ViewChild,
847
+ args: [KbqSelect]
848
+ }] } });
849
+
850
+ class KbqPipeTextComponent extends KbqBasePipe {
851
+ constructor() {
852
+ super(...arguments);
853
+ this.placements = PopUpPlacements;
854
+ /** textarea control */
855
+ this.control = new FormControl('');
1021
856
  }
857
+ /** Whether the current pipe is disabled. */
1022
858
  get disabled() {
1023
- return (!this.adapter.isDateInstance(this.formGroup.controls.start.value) ||
1024
- !this.adapter.isDateInstance(this.formGroup.controls.end.value) ||
1025
- this.formGroup.controls.start.invalid);
1026
- }
1027
- get start() {
1028
- return this.adapter.parse(this.data.value?.start, '');
1029
- }
1030
- get defaultStart() {
1031
- if (this.data.value?.start) {
1032
- return this.adapter.today().plus(this.data.value?.start);
1033
- }
1034
- return this.adapter.today();
1035
- }
1036
- get end() {
1037
- return this.adapter.parse(this.data.value?.end, '');
1038
- }
1039
- get defaultEnd() {
1040
- if (this.data.value?.start) {
1041
- return this.adapter.today();
1042
- }
1043
- return this.adapter.today().plus({ days: 1 });
859
+ return !this.control.value;
1044
860
  }
1045
- get isEmpty() {
1046
- if (this.data.value === null)
1047
- return true;
1048
- if (this.data.value?.name)
1049
- return false;
1050
- return !this.adapter.isDateInstance(this.start) || !this.adapter.isDateInstance(this.end);
861
+ ngOnInit() {
862
+ this.control.setValue(this.data.value);
1051
863
  }
1052
- onKeydown($event) {
1053
- if (($event.ctrlKey || $event.metaKey) && $event.keyCode === ENTER) {
1054
- this.onApplyPeriod();
1055
- }
864
+ ngAfterViewInit() {
865
+ super.ngAfterViewInit();
866
+ this.popover.visibleChange.subscribe(() => this.stateChanges.next());
1056
867
  }
1057
- onApplyPeriod() {
1058
- this.data.value = {
1059
- start: this.formGroup.controls.start.value.toISO(),
1060
- end: this.formGroup.controls.end.value.toISO()
1061
- };
868
+ onApply() {
869
+ this.data.value = this.control.value;
1062
870
  this.stateChanges.next();
1063
- this.filterBar?.onChangePipe.next(this.data);
871
+ this.control.markAsPristine();
1064
872
  this.popover.hide();
1065
- }
1066
- onSelect(item) {
1067
- this.data.value = item;
1068
- this.stateChanges.next();
1069
873
  this.filterBar?.onChangePipe.next(this.data);
1070
- this.popover.hide();
1071
- }
1072
- openPeriod() {
1073
- this.list = false;
1074
- this.showStartCalendar = false;
1075
- this.showEndCalendar = false;
1076
- this.initFormGroup();
1077
- setTimeout(() => {
1078
- this.popover.updatePosition(true);
1079
- this.returnButton().focus();
1080
- });
1081
874
  }
1082
- openList() {
1083
- this.list = true;
1084
- setTimeout(() => this.listSelection().focus());
1085
- this.popover.updatePosition(true);
875
+ /** @docs-private */
876
+ onKeydown($event) {
877
+ if (!this.disabled && ($event.ctrlKey || $event.metaKey) && $event.keyCode === ENTER) {
878
+ this.onApply();
879
+ }
1086
880
  }
881
+ /** opens popover */
1087
882
  open() {
1088
883
  this.popover.show();
1089
884
  }
1090
- onSelectStartDate(value) {
1091
- this.formGroup.controls.start.setValue(value);
1092
- }
1093
- onSelectEndDate(value) {
1094
- this.formGroup.controls.end.setValue(value);
1095
- }
1096
- onFocusStartInput() {
1097
- this.showStartCalendar = true;
1098
- this.showEndCalendar = false;
1099
- this.popover.updatePosition(true);
1100
- }
1101
- onFocusEndInput() {
1102
- this.showEndCalendar = true;
1103
- this.showStartCalendar = false;
1104
- }
1105
- hideCalendars() {
1106
- this.showStartCalendar = false;
1107
- this.showEndCalendar = false;
1108
- }
1109
- initFormGroup() {
1110
- this.formGroup = new FormGroup({
1111
- start: new FormControl(this.start || this.defaultStart),
1112
- end: new FormControl(this.end || this.defaultEnd)
1113
- });
1114
- }
1115
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeDateComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1116
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: KbqPipeDateComponent, isStandalone: true, selector: "kbq-pipe-date", providers: [
1117
- {
1118
- provide: KBQ_VALIDATION,
1119
- useValue: { useValidation: false }
1120
- },
885
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeTextComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
886
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: KbqPipeTextComponent, isStandalone: true, selector: "kbq-pipe-text", providers: [
1121
887
  {
1122
888
  provide: KbqBasePipe,
1123
889
  useExisting: this
1124
890
  }
1125
- ], viewQueries: [{ propertyName: "listSelection", first: true, predicate: ["listSelection"], descendants: true, read: KbqListSelection, isSignal: true }, { propertyName: "returnButton", first: true, predicate: ["returnButton"], descendants: true, read: KbqButton, isSignal: true }, { propertyName: "popover", first: true, predicate: ["popover"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<button\n #popover=\"kbqPopover\"\n kbq-button\n kbqPopover\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [kbqPopoverArrow]=\"false\"\n [kbqPopoverClass]=\"'kbq-pipe-date__popover'\"\n [kbqPopoverContent]=\"content\"\n [kbqPopoverPlacement]=\"placements.BottomLeft\"\n [kbqPopoverPlacementPriority]=\"[placements.BottomLeft, placements.TopLeft]\"\n (kbqPopoverVisibleChange)=\"list = true\"\n>\n <span #kbqTitleText class=\"kbq-pipe__name\">{{ data.name }}</span>\n <span #kbqTitleText class=\"kbq-pipe__value\" [class.kbq-pipe__value_empty]=\"!formattedValue\">\n {{ formattedValue }}\n </span>\n</button>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #content>\n @if (list) {\n <div class=\"kbq-date-list\">\n <kbq-list-selection #listSelection [autoSelect]=\"false\" [ngModel]=\"data.value?.name\">\n <kbq-list-option (click)=\"openPeriod()\" (keydown.enter)=\"openPeriod()\">\n {{ localeData.datePipe.customPeriod }}\n <i class=\"kbq kbq-icon kbq-chevron-right_16 kbq-contrast-fade\"></i>\n </kbq-list-option>\n\n @for (item of values; track item) {\n <kbq-list-option [value]=\"item.name\" (click)=\"onSelect(item)\" (keydown.enter)=\"onSelect(item)\">\n {{ item.name }}\n </kbq-list-option>\n }\n </kbq-list-selection>\n </div>\n } @else {\n <div class=\"kbq-date-period kbq-datepicker__content\" (keydown)=\"onKeydown($event)\">\n <div class=\"kbq-date-period__header\">\n <button\n #returnButton\n kbq-button\n [color]=\"colors.Theme\"\n [kbqStyle]=\"styles.Transparent\"\n (click)=\"openList()\"\n >\n <i kbq-icon=\"kbq-chevron-left_16\"></i>\n {{ localeData.datePipe.backToPeriodSelection }}\n </button>\n </div>\n\n <kbq-divider />\n\n <form class=\"kbq-date-period__content kbq-form-horizontal\" [formGroup]=\"formGroup\">\n <div class=\"kbq-date-period__content-header\">{{ localeData.datePipe.customPeriod }}</div>\n <div class=\"kbq-form__row\">\n <label class=\"kbq-form__label flex-10\">{{ localeData.datePipe.customPeriodFrom }}</label>\n\n <kbq-form-field\n class=\"kbq-date-period__date kbq-form__control\"\n [class.kbq-focused]=\"showStartCalendar\"\n >\n <input\n formControlName=\"start\"\n [kbqCalendar]=\"startDateCalendar\"\n [max]=\"formGroup.controls.end.value\"\n (focusin)=\"onFocusStartInput()\"\n (keydown.tab)=\"hideCalendars()\"\n />\n <i kbq-icon=\"kbq-calendar-o_16\" kbqSuffix></i>\n </kbq-form-field>\n </div>\n\n <kbq-calendar\n #startDateCalendar\n [class.kbq-calendar_hidden]=\"!showStartCalendar\"\n (selectedChange)=\"onSelectStartDate($event)\"\n />\n\n <div class=\"kbq-form__row\">\n <label class=\"kbq-form__label flex-10\">{{ localeData.datePipe.customPeriodTo }}</label>\n\n <kbq-form-field\n class=\"kbq-date-period__date kbq-form__control\"\n [class.kbq-focused]=\"showEndCalendar\"\n >\n <input\n formControlName=\"end\"\n [kbqCalendar]=\"endDateCalendar\"\n (focusin)=\"onFocusEndInput()\"\n (keydown.tab)=\"hideCalendars()\"\n />\n <i kbq-icon=\"kbq-calendar-o_16\" kbqSuffix></i>\n </kbq-form-field>\n </div>\n\n @if (formGroup.controls.start.invalid) {\n <kbq-hint class=\"kbq-date-period__hint\" [color]=\"'error'\">\n {{ localeData.datePipe.customPeriodErrorHint }}\n </kbq-hint>\n }\n\n <kbq-calendar\n #endDateCalendar\n [class.kbq-calendar_hidden]=\"!showEndCalendar\"\n (selectedChange)=\"onSelectEndDate($event)\"\n />\n </form>\n\n <div class=\"kbq-date-period__footer\">\n <button\n kbq-button\n [color]=\"'theme'\"\n [disabled]=\"disabled\"\n [kbqStyle]=\"'transparent'\"\n (click)=\"onApplyPeriod()\"\n >\n <span>{{ localeData.pipe.applyButton }}</span>\n &nbsp;\n <span class=\"kbq-button_hot-key\">{{ isMac ? '\u2318' : 'Ctrl+' }}Enter</span>\n </button>\n </div>\n </div>\n }\n</ng-template>\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ formattedValue }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n", ".kbq-datepicker__content{--kbq-datepicker-size-container-padding-vertical: var(--kbq-size-m);--kbq-datepicker-size-container-border-radius: var(--kbq-size-s);--kbq-datepicker-size-header-padding-horizontal: var(--kbq-size-xxs);--kbq-datepicker-size-header-margin-bottom: var(--kbq-size-3xs);--kbq-datepicker-size-grid-padding-horizontal: var(--kbq-size-m);--kbq-datepicker-size-grid-content-gap-vertical: var(--kbq-size-3xs);--kbq-datepicker-size-grid-divider-height: 1px;--kbq-datepicker-size-grid-cell-padding-horizontal: var(--kbq-size-s);--kbq-datepicker-size-grid-cell-padding-vertical: var(--kbq-size-s);--kbq-datepicker-size-grid-cell-border-radius: var(--kbq-size-s);--kbq-datepicker-container-background: var(--kbq-background-card);--kbq-datepicker-container-shadow: var(--kbq-shadow-popup);--kbq-datepicker-header-text: var(--kbq-foreground-contrast-tertiary);--kbq-datepicker-header-divider: var(--kbq-line-contrast-less);--kbq-datepicker-grid-cell-default-background: transparent;--kbq-datepicker-grid-cell-default-text: var(--kbq-foreground-contrast);--kbq-datepicker-grid-cell-today-background: transparent;--kbq-datepicker-grid-cell-today-text: var(--kbq-foreground-theme);--kbq-datepicker-grid-cell-states-hover-background: var(--kbq-states-background-transparent-hover);--kbq-datepicker-grid-cell-states-active-background: var(--kbq-states-background-transparent-active);--kbq-datepicker-grid-cell-states-selected-background: var(--kbq-background-contrast);--kbq-datepicker-grid-cell-states-selected-text: var(--kbq-foreground-white);--kbq-datepicker-grid-cell-states-selected-hover-background: var(--kbq-states-background-contrast-active);--kbq-datepicker-grid-cell-states-disabled-background: transparent;--kbq-datepicker-grid-cell-states-disabled-text: var(--kbq-states-foreground-disabled)}.kbq-pipe-date__popover.kbq-popover.kbq-popover_medium{margin-top:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-popover__container{max-height:unset}.kbq-pipe-date__popover .kbq-popover__content{padding:0}.kbq-pipe-date__popover .kbq-date-list{margin:var(--kbq-size-xxs) 0}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option{margin-left:var(--kbq-size-xxs);margin-right:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option .kbq-list-text{display:flex;flex-direction:row}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option .kbq-icon{margin-left:var(--kbq-size-s);align-self:center;color:var(--kbq-icon-fade-contrast-color)}.kbq-pipe-date__popover .kbq-date-period{width:320px}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__header{padding-top:var(--kbq-size-xs);padding-left:var(--kbq-size-xxs);padding-right:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__header .kbq-button{width:100%;justify-content:flex-start}.kbq-pipe-date__popover .kbq-date-period .kbq-divider{margin:var(--kbq-size-xxs) var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content{display:flex;flex-direction:column;padding:0;gap:var(--kbq-size-s)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-date-period__content-header{padding-top:var(--kbq-size-s);padding-left:var(--kbq-size-l);padding-right:var(--kbq-size-l);color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row{padding-left:var(--kbq-size-l);padding-right:var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row .kbq-date-period__date,.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row .kbq-date-period__time{flex:1}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row.kbq-form__row_with-time .kbq-date-period__date{max-width:45%}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row.kbq-form__row_with-time .kbq-date-period__date .kbq-form-field__container{border-top-right-radius:unset;border-bottom-right-radius:unset}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row.kbq-form__row_with-time .kbq-date-period__time{margin-left:-1px;max-width:45%}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row.kbq-form__row_with-time .kbq-date-period__time .kbq-form-field__container{border-top-left-radius:unset;border-bottom-left-radius:unset}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-calendar{position:relative;padding:var(--kbq-size-s) var(--kbq-size-s) var(--kbq-size-m);background-color:var(--kbq-background-bg-tertiary)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-calendar.kbq-calendar_hidden{display:none}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-hint{padding-left:var(--kbq-size-m);padding-right:var(--kbq-size-m)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer{padding:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer .kbq-button{width:100%;justify-content:flex-start}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer .kbq-button:not(.kbq-disabled) .kbq-button_hot-key{color:var(--kbq-foreground-contrast-secondary)}.kbq-datepicker__content{background:var(--kbq-datepicker-container-background);box-shadow:var(--kbq-datepicker-container-shadow)}.kbq-calendar__table-header{color:var(--kbq-datepicker-header-text)}.kbq-calendar__table-header-divider:after{background:var(--kbq-datepicker-header-divider)}.kbq-calendar__body-cell-content{background:var(--kbq-datepicker-grid-cell-default-background);color:var(--kbq-datepicker-grid-cell-default-text)}.kbq-calendar__body-cell-content.kbq-calendar__body-today{background:var(--kbq-datepicker-grid-cell-today-background);color:var(--kbq-datepicker-grid-cell-today-text)}.kbq-calendar__body-cell-content:hover:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-hover-background)}.kbq-calendar__body-cell-content:active:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-active-background)}.kbq-calendar__body-cell-content.kbq-selected:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-selected-background);color:var(--kbq-datepicker-grid-cell-states-selected-text)}.kbq-calendar__body-cell-content.kbq-selected:not(.kbq-disabled):hover{background:var(--kbq-datepicker-grid-cell-states-selected-hover-background)}.kbq-calendar__body-cell-content.kbq-disabled{color:var(--kbq-states-foreground-disabled);background:var(--kbq-datepicker-grid-cell-states-disabled-background)}.kbq-calendar,.kbq-calendar__table-header th{font-size:var(--kbq-typography-text-normal-font-size);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: KbqFormFieldModule }, { kind: "component", type: i6.KbqFormField, selector: "kbq-form-field", exportAs: ["kbqFormField"] }, { kind: "component", type: i6.KbqHint, selector: "kbq-hint", inputs: ["id", "fillTextOff", "compact"], exportAs: ["kbqHint"] }, { kind: "directive", type: i6.KbqSuffix, selector: "[kbqSuffix]" }, { kind: "component", type: KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "ngmodule", type: KbqInputModule }, { kind: "directive", type: i3$1.MaxValidator, selector: "[max][formControlName],[max][formControl],[max][ngModel]", inputs: ["max"] }, { kind: "ngmodule", type: KbqDividerModule }, { kind: "component", type: i4.KbqDivider, selector: "kbq-divider", inputs: ["vertical", "inset", "paddings"] }, { kind: "ngmodule", type: KbqPopoverModule }, { kind: "directive", type: i5$1.KbqPopoverTrigger, selector: "[kbqPopover]", inputs: ["kbqPopoverVisible", "kbqPopoverPlacement", "kbqPopoverPlacementPriority", "hasBackdrop", "kbqPopoverHeader", "kbqPopoverContent", "kbqPopoverFooter", "kbqPopoverDisabled", "kbqTrigger", "kbqPopoverSize", "kbqPopoverClass", "hasCloseButton", "closeOnScroll", "backdropClass", "kbqPopoverArrow", "kbqPopoverOffset"], outputs: ["kbqPopoverPlacementChange", "kbqPopoverVisibleChange"], exportAs: ["kbqPopover"] }, { kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "ngmodule", type: KbqListModule }, { kind: "component", type: i7.KbqListSelection, selector: "kbq-list-selection", inputs: ["autoSelect", "noUnselectLast", "horizontal", "tabIndex", "disabled", "compareWith"], outputs: ["onSelectAll", "onCopy", "selectionChange"], exportAs: ["kbqListSelection"] }, { kind: "component", type: i7.KbqListOption, selector: "kbq-list-option", inputs: ["checkboxPosition", "value", "disabled", "showCheckbox", "selected"], exportAs: ["kbqListOption"] }, { kind: "ngmodule", type: KbqDatepickerModule }, { kind: "component", type: i8.KbqCalendar, selector: "kbq-calendar", inputs: ["startAt", "selected", "minDate", "maxDate", "dateFilter", "dateClass"], outputs: ["selectedChange", "yearSelected", "monthSelected", "userSelection"], exportAs: ["kbqCalendar"] }, { kind: "directive", type: i8.KbqDatepickerInput, selector: "input[kbqDatepicker], input[kbqCalendar]", inputs: ["placeholder", "required", "kbqDatepicker", "kbqCalendar", "kbqDatepickerFilter", "value", "min", "max", "disabled", "id", "kbqValidationTooltip"], outputs: ["incorrectInput", "dateChange", "dateInput"], exportAs: ["kbqDatepickerInput"] }, { kind: "ngmodule", type: KbqTimepickerModule }, { kind: "directive", type: KbqPipeState, selector: "[kbqPipeState]", inputs: ["kbqPipeState"] }, { kind: "ngmodule", type: KbqFormattersModule }, { kind: "component", type: KbqPipeButton, selector: "kbq-pipe-button" }, { kind: "ngmodule", type: KbqTitleModule }, { kind: "directive", type: KbqPipeTitleDirective, selector: "[kbqPipeTitle]", inputs: ["kbqPipeTitle"], exportAs: ["kbqPipeTitle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
891
+ ], viewQueries: [{ propertyName: "popover", first: true, predicate: KbqPopoverTrigger, descendants: true }], usesInheritance: true, ngImport: i0, template: "<button\n kbq-button\n kbqPopover\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [kbqPopoverArrow]=\"false\"\n [kbqPopoverClass]=\"'kbq-pipe__popover'\"\n [kbqPopoverContent]=\"content\"\n [kbqPopoverFooter]=\"footer\"\n [kbqPopoverOffset]=\"4\"\n [kbqPopoverPlacement]=\"placements.BottomLeft\"\n [ngClass]=\"{ 'kbq-active': popover?.isOpen }\"\n>\n <span #kbqTitleText kbqPipeMinWidth class=\"kbq-pipe__name\">{{ data.name }}</span>\n <span #kbqTitleText kbqPipeMinWidth class=\"kbq-pipe__value\" [class.kbq-pipe__value_empty]=\"!data.value\">\n {{ data.value }}\n </span>\n</button>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #content>\n <kbq-form-field (keydown)=\"onKeydown($event)\">\n <textarea kbqTextarea rows=\"1\" [formControl]=\"control\" [freeRowsHeight]=\"0\" [maxRows]=\"5\"></textarea>\n </kbq-form-field>\n</ng-template>\n\n<ng-template #footer>\n <button kbq-button [color]=\"'theme'\" [disabled]=\"disabled\" [kbqStyle]=\"'transparent'\" (click)=\"onApply()\">\n <span>{{ localeData.pipe.applyButton }}</span>\n &nbsp;\n <span class=\"kbq-button_hot-key\">{{ isMac ? '\u2318' : 'Ctrl+' }}Enter</span>\n </button>\n</ng-template>\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ data.value }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n"], dependencies: [{ kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "ngmodule", type: KbqFormFieldModule }, { kind: "component", type: i6.KbqFormField, selector: "kbq-form-field", exportAs: ["kbqFormField"] }, { kind: "directive", type: i6.KbqValidateDirective, selector: " input[kbqInput], input[kbqNumberInput], input[kbqInputPassword], input[kbqTimepicker], input[kbqDatepicker], textarea[kbqTextarea], kbq-select, kbq-tree-select, kbq-tag-list ", exportAs: ["KbqValidate"] }, { kind: "directive", type: i6.KbqTrim, selector: "[kbqInput], [kbqTextarea]", exportAs: ["KbqTrim"] }, { kind: "ngmodule", type: KbqPopoverModule }, { kind: "directive", type: i5.KbqPopoverTrigger, selector: "[kbqPopover]", inputs: ["kbqPopoverVisible", "kbqPopoverPlacement", "kbqPopoverPlacementPriority", "hasBackdrop", "kbqPopoverHeader", "kbqPopoverContent", "kbqPopoverFooter", "kbqPopoverDisabled", "kbqTrigger", "kbqPopoverSize", "kbqPopoverClass", "hasCloseButton", "closeOnScroll", "backdropClass", "kbqPopoverArrow", "kbqPopoverOffset"], outputs: ["kbqPopoverPlacementChange", "kbqPopoverVisibleChange"], exportAs: ["kbqPopover"] }, { kind: "ngmodule", type: KbqInputModule }, { kind: "ngmodule", type: KbqDividerModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: KbqTextareaModule }, { kind: "directive", type: i5$2.KbqTextarea, selector: "textarea[kbqTextarea]", inputs: ["canGrow", "maxRows", "errorStateMatcher", "disabled", "id", "placeholder", "freeRowsHeight", "required", "value"], exportAs: ["kbqTextarea"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: KbqPipeButton, selector: "kbq-pipe-button" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: KbqTitleModule }, { kind: "directive", type: KbqPipeState, selector: "[kbqPipeState]", inputs: ["kbqPipeState"] }, { kind: "directive", type: KbqPipeTitleDirective, selector: "[kbqPipeTitle]", inputs: ["kbqPipeTitle"], exportAs: ["kbqPipeTitle"] }, { kind: "directive", type: KbqPipeMinWidth, selector: "[kbqPipeMinWidth]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1126
892
  }
1127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeDateComponent, decorators: [{
893
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeTextComponent, decorators: [{
1128
894
  type: Component,
1129
- args: [{ standalone: true, selector: 'kbq-pipe-date', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
1130
- {
1131
- provide: KBQ_VALIDATION,
1132
- useValue: { useValidation: false }
1133
- },
895
+ args: [{ standalone: true, selector: 'kbq-pipe-text', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
1134
896
  {
1135
897
  provide: KbqBasePipe,
1136
898
  useExisting: this
1137
899
  }
1138
900
  ], imports: [
1139
- ReactiveFormsModule,
901
+ KbqButtonModule,
1140
902
  KbqFormFieldModule,
1141
- KbqIcon,
903
+ KbqPopoverModule,
1142
904
  KbqInputModule,
1143
905
  KbqDividerModule,
1144
- KbqPopoverModule,
1145
- KbqButtonModule,
1146
- KbqListModule,
1147
- KbqDatepickerModule,
1148
- KbqTimepickerModule,
1149
- KbqPipeState,
1150
- KbqFormattersModule,
906
+ FormsModule,
907
+ KbqTextareaModule,
908
+ NgClass,
1151
909
  KbqPipeButton,
910
+ ReactiveFormsModule,
1152
911
  KbqTitleModule,
912
+ KbqPipeState,
1153
913
  KbqPipeTitleDirective,
1154
- FormsModule
1155
- ], template: "<button\n #popover=\"kbqPopover\"\n kbq-button\n kbqPopover\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [kbqPopoverArrow]=\"false\"\n [kbqPopoverClass]=\"'kbq-pipe-date__popover'\"\n [kbqPopoverContent]=\"content\"\n [kbqPopoverPlacement]=\"placements.BottomLeft\"\n [kbqPopoverPlacementPriority]=\"[placements.BottomLeft, placements.TopLeft]\"\n (kbqPopoverVisibleChange)=\"list = true\"\n>\n <span #kbqTitleText class=\"kbq-pipe__name\">{{ data.name }}</span>\n <span #kbqTitleText class=\"kbq-pipe__value\" [class.kbq-pipe__value_empty]=\"!formattedValue\">\n {{ formattedValue }}\n </span>\n</button>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #content>\n @if (list) {\n <div class=\"kbq-date-list\">\n <kbq-list-selection #listSelection [autoSelect]=\"false\" [ngModel]=\"data.value?.name\">\n <kbq-list-option (click)=\"openPeriod()\" (keydown.enter)=\"openPeriod()\">\n {{ localeData.datePipe.customPeriod }}\n <i class=\"kbq kbq-icon kbq-chevron-right_16 kbq-contrast-fade\"></i>\n </kbq-list-option>\n\n @for (item of values; track item) {\n <kbq-list-option [value]=\"item.name\" (click)=\"onSelect(item)\" (keydown.enter)=\"onSelect(item)\">\n {{ item.name }}\n </kbq-list-option>\n }\n </kbq-list-selection>\n </div>\n } @else {\n <div class=\"kbq-date-period kbq-datepicker__content\" (keydown)=\"onKeydown($event)\">\n <div class=\"kbq-date-period__header\">\n <button\n #returnButton\n kbq-button\n [color]=\"colors.Theme\"\n [kbqStyle]=\"styles.Transparent\"\n (click)=\"openList()\"\n >\n <i kbq-icon=\"kbq-chevron-left_16\"></i>\n {{ localeData.datePipe.backToPeriodSelection }}\n </button>\n </div>\n\n <kbq-divider />\n\n <form class=\"kbq-date-period__content kbq-form-horizontal\" [formGroup]=\"formGroup\">\n <div class=\"kbq-date-period__content-header\">{{ localeData.datePipe.customPeriod }}</div>\n <div class=\"kbq-form__row\">\n <label class=\"kbq-form__label flex-10\">{{ localeData.datePipe.customPeriodFrom }}</label>\n\n <kbq-form-field\n class=\"kbq-date-period__date kbq-form__control\"\n [class.kbq-focused]=\"showStartCalendar\"\n >\n <input\n formControlName=\"start\"\n [kbqCalendar]=\"startDateCalendar\"\n [max]=\"formGroup.controls.end.value\"\n (focusin)=\"onFocusStartInput()\"\n (keydown.tab)=\"hideCalendars()\"\n />\n <i kbq-icon=\"kbq-calendar-o_16\" kbqSuffix></i>\n </kbq-form-field>\n </div>\n\n <kbq-calendar\n #startDateCalendar\n [class.kbq-calendar_hidden]=\"!showStartCalendar\"\n (selectedChange)=\"onSelectStartDate($event)\"\n />\n\n <div class=\"kbq-form__row\">\n <label class=\"kbq-form__label flex-10\">{{ localeData.datePipe.customPeriodTo }}</label>\n\n <kbq-form-field\n class=\"kbq-date-period__date kbq-form__control\"\n [class.kbq-focused]=\"showEndCalendar\"\n >\n <input\n formControlName=\"end\"\n [kbqCalendar]=\"endDateCalendar\"\n (focusin)=\"onFocusEndInput()\"\n (keydown.tab)=\"hideCalendars()\"\n />\n <i kbq-icon=\"kbq-calendar-o_16\" kbqSuffix></i>\n </kbq-form-field>\n </div>\n\n @if (formGroup.controls.start.invalid) {\n <kbq-hint class=\"kbq-date-period__hint\" [color]=\"'error'\">\n {{ localeData.datePipe.customPeriodErrorHint }}\n </kbq-hint>\n }\n\n <kbq-calendar\n #endDateCalendar\n [class.kbq-calendar_hidden]=\"!showEndCalendar\"\n (selectedChange)=\"onSelectEndDate($event)\"\n />\n </form>\n\n <div class=\"kbq-date-period__footer\">\n <button\n kbq-button\n [color]=\"'theme'\"\n [disabled]=\"disabled\"\n [kbqStyle]=\"'transparent'\"\n (click)=\"onApplyPeriod()\"\n >\n <span>{{ localeData.pipe.applyButton }}</span>\n &nbsp;\n <span class=\"kbq-button_hot-key\">{{ isMac ? '\u2318' : 'Ctrl+' }}Enter</span>\n </button>\n </div>\n </div>\n }\n</ng-template>\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ formattedValue }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n", ".kbq-datepicker__content{--kbq-datepicker-size-container-padding-vertical: var(--kbq-size-m);--kbq-datepicker-size-container-border-radius: var(--kbq-size-s);--kbq-datepicker-size-header-padding-horizontal: var(--kbq-size-xxs);--kbq-datepicker-size-header-margin-bottom: var(--kbq-size-3xs);--kbq-datepicker-size-grid-padding-horizontal: var(--kbq-size-m);--kbq-datepicker-size-grid-content-gap-vertical: var(--kbq-size-3xs);--kbq-datepicker-size-grid-divider-height: 1px;--kbq-datepicker-size-grid-cell-padding-horizontal: var(--kbq-size-s);--kbq-datepicker-size-grid-cell-padding-vertical: var(--kbq-size-s);--kbq-datepicker-size-grid-cell-border-radius: var(--kbq-size-s);--kbq-datepicker-container-background: var(--kbq-background-card);--kbq-datepicker-container-shadow: var(--kbq-shadow-popup);--kbq-datepicker-header-text: var(--kbq-foreground-contrast-tertiary);--kbq-datepicker-header-divider: var(--kbq-line-contrast-less);--kbq-datepicker-grid-cell-default-background: transparent;--kbq-datepicker-grid-cell-default-text: var(--kbq-foreground-contrast);--kbq-datepicker-grid-cell-today-background: transparent;--kbq-datepicker-grid-cell-today-text: var(--kbq-foreground-theme);--kbq-datepicker-grid-cell-states-hover-background: var(--kbq-states-background-transparent-hover);--kbq-datepicker-grid-cell-states-active-background: var(--kbq-states-background-transparent-active);--kbq-datepicker-grid-cell-states-selected-background: var(--kbq-background-contrast);--kbq-datepicker-grid-cell-states-selected-text: var(--kbq-foreground-white);--kbq-datepicker-grid-cell-states-selected-hover-background: var(--kbq-states-background-contrast-active);--kbq-datepicker-grid-cell-states-disabled-background: transparent;--kbq-datepicker-grid-cell-states-disabled-text: var(--kbq-states-foreground-disabled)}.kbq-pipe-date__popover.kbq-popover.kbq-popover_medium{margin-top:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-popover__container{max-height:unset}.kbq-pipe-date__popover .kbq-popover__content{padding:0}.kbq-pipe-date__popover .kbq-date-list{margin:var(--kbq-size-xxs) 0}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option{margin-left:var(--kbq-size-xxs);margin-right:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option .kbq-list-text{display:flex;flex-direction:row}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option .kbq-icon{margin-left:var(--kbq-size-s);align-self:center;color:var(--kbq-icon-fade-contrast-color)}.kbq-pipe-date__popover .kbq-date-period{width:320px}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__header{padding-top:var(--kbq-size-xs);padding-left:var(--kbq-size-xxs);padding-right:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__header .kbq-button{width:100%;justify-content:flex-start}.kbq-pipe-date__popover .kbq-date-period .kbq-divider{margin:var(--kbq-size-xxs) var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content{display:flex;flex-direction:column;padding:0;gap:var(--kbq-size-s)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-date-period__content-header{padding-top:var(--kbq-size-s);padding-left:var(--kbq-size-l);padding-right:var(--kbq-size-l);color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row{padding-left:var(--kbq-size-l);padding-right:var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row .kbq-date-period__date,.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row .kbq-date-period__time{flex:1}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row.kbq-form__row_with-time .kbq-date-period__date{max-width:45%}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row.kbq-form__row_with-time .kbq-date-period__date .kbq-form-field__container{border-top-right-radius:unset;border-bottom-right-radius:unset}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row.kbq-form__row_with-time .kbq-date-period__time{margin-left:-1px;max-width:45%}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row.kbq-form__row_with-time .kbq-date-period__time .kbq-form-field__container{border-top-left-radius:unset;border-bottom-left-radius:unset}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-calendar{position:relative;padding:var(--kbq-size-s) var(--kbq-size-s) var(--kbq-size-m);background-color:var(--kbq-background-bg-tertiary)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-calendar.kbq-calendar_hidden{display:none}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-hint{padding-left:var(--kbq-size-m);padding-right:var(--kbq-size-m)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer{padding:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer .kbq-button{width:100%;justify-content:flex-start}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer .kbq-button:not(.kbq-disabled) .kbq-button_hot-key{color:var(--kbq-foreground-contrast-secondary)}.kbq-datepicker__content{background:var(--kbq-datepicker-container-background);box-shadow:var(--kbq-datepicker-container-shadow)}.kbq-calendar__table-header{color:var(--kbq-datepicker-header-text)}.kbq-calendar__table-header-divider:after{background:var(--kbq-datepicker-header-divider)}.kbq-calendar__body-cell-content{background:var(--kbq-datepicker-grid-cell-default-background);color:var(--kbq-datepicker-grid-cell-default-text)}.kbq-calendar__body-cell-content.kbq-calendar__body-today{background:var(--kbq-datepicker-grid-cell-today-background);color:var(--kbq-datepicker-grid-cell-today-text)}.kbq-calendar__body-cell-content:hover:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-hover-background)}.kbq-calendar__body-cell-content:active:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-active-background)}.kbq-calendar__body-cell-content.kbq-selected:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-selected-background);color:var(--kbq-datepicker-grid-cell-states-selected-text)}.kbq-calendar__body-cell-content.kbq-selected:not(.kbq-disabled):hover{background:var(--kbq-datepicker-grid-cell-states-selected-hover-background)}.kbq-calendar__body-cell-content.kbq-disabled{color:var(--kbq-states-foreground-disabled);background:var(--kbq-datepicker-grid-cell-states-disabled-background)}.kbq-calendar,.kbq-calendar__table-header th{font-size:var(--kbq-typography-text-normal-font-size);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}\n"] }]
914
+ KbqPipeMinWidth
915
+ ], template: "<button\n kbq-button\n kbqPopover\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [kbqPopoverArrow]=\"false\"\n [kbqPopoverClass]=\"'kbq-pipe__popover'\"\n [kbqPopoverContent]=\"content\"\n [kbqPopoverFooter]=\"footer\"\n [kbqPopoverOffset]=\"4\"\n [kbqPopoverPlacement]=\"placements.BottomLeft\"\n [ngClass]=\"{ 'kbq-active': popover?.isOpen }\"\n>\n <span #kbqTitleText kbqPipeMinWidth class=\"kbq-pipe__name\">{{ data.name }}</span>\n <span #kbqTitleText kbqPipeMinWidth class=\"kbq-pipe__value\" [class.kbq-pipe__value_empty]=\"!data.value\">\n {{ data.value }}\n </span>\n</button>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #content>\n <kbq-form-field (keydown)=\"onKeydown($event)\">\n <textarea kbqTextarea rows=\"1\" [formControl]=\"control\" [freeRowsHeight]=\"0\" [maxRows]=\"5\"></textarea>\n </kbq-form-field>\n</ng-template>\n\n<ng-template #footer>\n <button kbq-button [color]=\"'theme'\" [disabled]=\"disabled\" [kbqStyle]=\"'transparent'\" (click)=\"onApply()\">\n <span>{{ localeData.pipe.applyButton }}</span>\n &nbsp;\n <span class=\"kbq-button_hot-key\">{{ isMac ? '\u2318' : 'Ctrl+' }}Enter</span>\n </button>\n</ng-template>\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ data.value }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n"] }]
1156
916
  }], propDecorators: { popover: [{
1157
917
  type: ViewChild,
1158
- args: ['popover']
918
+ args: [KbqPopoverTrigger]
1159
919
  }] } });
1160
920
 
1161
- class KbqPipeDatetimeComponent extends KbqBasePipe {
921
+ /**default configuration of filter-bar */
922
+ const KBQ_FILTER_BAR_DEFAULT_CONFIGURATION = ruRULocaleData.filterBar;
923
+ /** Injection Token for providing configuration of filter-bar */
924
+ const KBQ_FILTER_BAR_CONFIGURATION = new InjectionToken('KbqFilterBarConfiguration');
925
+ /** Injection Token for providing pipes in filter-bar */
926
+ const KBQ_FILTER_BAR_PIPES = new InjectionToken('kbq-filter-bar-pipes');
927
+ /** Utility provider for `KBQ_FILTER_BAR_PIPES`. */
928
+ const kbqFilterBarPipesProvider = () => {
929
+ return {
930
+ provide: KBQ_FILTER_BAR_PIPES,
931
+ useValue: new Map(defaultFilterBarPipes)
932
+ };
933
+ };
934
+ /** list of pipe types available out of the box */
935
+ var KbqPipeTypes;
936
+ (function (KbqPipeTypes) {
937
+ KbqPipeTypes["Text"] = "text";
938
+ KbqPipeTypes["Select"] = "select";
939
+ KbqPipeTypes["MultiSelect"] = "multiselect";
940
+ KbqPipeTypes["Date"] = "date";
941
+ KbqPipeTypes["Datetime"] = "datetime";
942
+ })(KbqPipeTypes || (KbqPipeTypes = {}));
943
+ /** list of pipes available out of the box. */
944
+ const defaultFilterBarPipes = [
945
+ [KbqPipeTypes.Text, KbqPipeTextComponent],
946
+ [KbqPipeTypes.Select, KbqPipeSelectComponent],
947
+ [KbqPipeTypes.MultiSelect, KbqPipeMultiSelectComponent],
948
+ [KbqPipeTypes.Date, KbqPipeDateComponent],
949
+ [KbqPipeTypes.Datetime, KbqPipeDatetimeComponent]
950
+ ];
951
+
952
+ class KbqFilterReset {
1162
953
  constructor() {
1163
- super(...arguments);
1164
- this.adapter = inject(DateAdapter);
1165
- this.formatter = inject(DateFormatter);
954
+ /** KbqFilterBar instance */
955
+ this.filterBar = inject(KbqFilterBar);
956
+ /** Event that is generated whenever the user reset a filter. */
957
+ this.onResetFilter = new EventEmitter();
958
+ }
959
+ /** localized data
960
+ * @docs-private */
961
+ get localeData() {
962
+ return this.filterBar.configuration.reset.buttonName;
963
+ }
964
+ resetFilter() {
965
+ this.onResetFilter.emit(this.filterBar.filter);
966
+ this.filterBar.changes.next();
967
+ }
968
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterReset, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
969
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: KbqFilterReset, isStandalone: true, selector: "kbq-filter-reset", outputs: { onResetFilter: "onResetFilter" }, host: { classAttribute: "kbq-filter-reset" }, ngImport: i0, template: `
970
+ <button [color]="'theme'" [kbqStyle]="'transparent'" (click)="resetFilter()" kbq-button>
971
+ <ng-content>{{ localeData }}</ng-content>
972
+ </button>
973
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
974
+ }
975
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterReset, decorators: [{
976
+ type: Component,
977
+ args: [{
978
+ standalone: true,
979
+ selector: 'kbq-filter-reset',
980
+ template: `
981
+ <button [color]="'theme'" [kbqStyle]="'transparent'" (click)="resetFilter()" kbq-button>
982
+ <ng-content>{{ localeData }}</ng-content>
983
+ </button>
984
+ `,
985
+ host: {
986
+ class: 'kbq-filter-reset'
987
+ },
988
+ changeDetection: ChangeDetectionStrategy.OnPush,
989
+ imports: [KbqButtonModule]
990
+ }]
991
+ }], propDecorators: { onResetFilter: [{
992
+ type: Output
993
+ }] } });
994
+
995
+ class KbqFilterBarButton {
996
+ constructor() {
997
+ this.button = inject(KbqButton);
998
+ /** KbqFilterBar instance */
999
+ this.filterBar = inject(KbqFilterBar);
1000
+ this.filterBar.changes.pipe(takeUntilDestroyed()).subscribe(() => {
1001
+ this.button.kbqStyle = KbqButtonStyles.Outline;
1002
+ this.button.color = KbqComponentColors.ContrastFade;
1003
+ if (this.filterBar.filter?.changed || this.filterBar.filter?.saved) {
1004
+ this.button.kbqStyle = 'changed-filter';
1005
+ this.button.color = KbqComponentColors.Empty;
1006
+ }
1007
+ });
1008
+ }
1009
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBarButton, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1010
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: KbqFilterBarButton, isStandalone: true, selector: "[kbqFilterBarButton]", ngImport: i0 }); }
1011
+ }
1012
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBarButton, decorators: [{
1013
+ type: Directive,
1014
+ args: [{
1015
+ standalone: true,
1016
+ selector: '[kbqFilterBarButton]'
1017
+ }]
1018
+ }], ctorParameters: () => [] });
1019
+
1020
+ class KbqFilters {
1021
+ /** header of popover. Depends on the mode */
1022
+ get popoverHeader() {
1023
+ return this.saveNewFilter ? this.localeData.saveAsNew : this.localeData.saveChanges;
1024
+ }
1025
+ /** Component state. true if opened dropdown or popup */
1026
+ get opened() {
1027
+ return this.popover?.isOpen || this.dropdown?.opened;
1028
+ }
1029
+ /** Selected filter */
1030
+ get filter() {
1031
+ return this.filterBar.filter;
1032
+ }
1033
+ /** Component state. True if 'filters' input contains no elements. */
1034
+ get isEmpty() {
1035
+ return this.filters.length === 0;
1036
+ }
1037
+ /** localized data
1038
+ * @docs-private */
1039
+ get localeData() {
1040
+ return this.filterBar.configuration.filters;
1041
+ }
1042
+ constructor() {
1043
+ /** @docs-private */
1166
1044
  this.placements = PopUpPlacements;
1045
+ /** @docs-private */
1167
1046
  this.styles = KbqButtonStyles;
1047
+ /** @docs-private */
1168
1048
  this.colors = KbqComponentColors;
1169
- this.list = true;
1170
- this.showStartCalendar = false;
1171
- this.showEndCalendar = false;
1172
- this.listSelection = viewChild.required('listSelection', { read: KbqListSelection });
1173
- this.returnButton = viewChild.required('returnButton', { read: KbqButton });
1174
- }
1175
- get formattedValue() {
1176
- if (this.start && this.end) {
1177
- return this.formatter.rangeShortDateTime(this.start, this.end);
1178
- }
1179
- return this.data.value?.name ?? '';
1180
- }
1181
- get disabled() {
1182
- return (!this.adapter.isDateInstance(this.formGroup.controls.start.value) ||
1183
- !this.adapter.isDateInstance(this.formGroup.controls.end.value) ||
1184
- this.formGroup.controls.start.invalid);
1049
+ /** KbqFilterBar instance */
1050
+ this.filterBar = inject(KbqFilterBar);
1051
+ /** @docs-private */
1052
+ this.changeDetectorRef = inject(ChangeDetectorRef);
1053
+ /** control for search filter */
1054
+ this.searchControl = new UntypedFormControl();
1055
+ /** @docs-private */
1056
+ this.popoverSize = PopUpSizes.Medium;
1057
+ this.showFilterSavingError = false;
1058
+ /** Event that is generated whenever the user selects a filter. */
1059
+ this.onSelectFilter = new EventEmitter();
1060
+ /** Event that is generated whenever the user save a filter. */
1061
+ this.onSave = new EventEmitter();
1062
+ /** Event that is generated whenever the user change a filter. */
1063
+ this.onChangeFilter = new EventEmitter();
1064
+ /** Event that is generated whenever the user saves a filter as new. */
1065
+ this.onSaveAsNew = new EventEmitter();
1066
+ /** Event that is generated whenever the user remove a filter. */
1067
+ this.onRemoveFilter = new EventEmitter();
1068
+ /** Event that is generated whenever the user reset a filter changes. */
1069
+ this.onResetFilterChanges = new EventEmitter();
1070
+ this.closePopover = () => {
1071
+ this.popover.hide();
1072
+ this.restoreFocus();
1073
+ setTimeout(() => this.changeDetectorRef.detectChanges());
1074
+ };
1075
+ this.filterBar.changes.subscribe(() => this.changeDetectorRef.markForCheck());
1185
1076
  }
1186
- get start() {
1187
- return this.adapter.parse(this.data.value?.start, '');
1077
+ ngOnInit() {
1078
+ this.filteredOptions = merge(of(this.filters), this.searchControl.valueChanges.pipe(map((value) => this.getFilteredOptions(value))));
1188
1079
  }
1189
- get defaultStart() {
1190
- if (this.data.value?.start) {
1191
- return this.adapter.today().plus(this.data.value?.start);
1192
- }
1193
- return this.adapter.today().startOf('day');
1080
+ selectFilter(filter) {
1081
+ this.filterBar.internalFilterChanges.next(structuredClone(filter));
1082
+ this.filterBar.saveFilterState();
1083
+ this.onSelectFilter.next(filter);
1194
1084
  }
1195
- get end() {
1196
- return this.adapter.parse(this.data.value?.end, '');
1085
+ saveChanges() {
1086
+ if (!this.filterBar.filter)
1087
+ return;
1088
+ this.filterBar.filter.saved = true;
1089
+ this.filterBar.filter.changed = false;
1090
+ this.filterBar.saveFilterState();
1091
+ this.filterBar.internalFilterChanges.next(this.filterBar.filter);
1092
+ this.onSave.emit({ filter: this.filterBar.filter, filterBar: this.filterBar });
1197
1093
  }
1198
- get defaultEnd() {
1199
- if (this.data.value?.start) {
1200
- return this.adapter.today();
1094
+ saveAsNew() {
1095
+ if (this.filterName.invalid)
1096
+ return;
1097
+ const name = this.filterName.value || '';
1098
+ if (this.saveNewFilter) {
1099
+ // @todo default filter
1100
+ const filter = structuredClone(this.filter) || { pipes: [] };
1101
+ filter.name = name;
1102
+ filter.saved = true;
1103
+ filter.changed = false;
1104
+ this.onSaveAsNew.emit({ filter, filterBar: this.filterBar });
1105
+ }
1106
+ else {
1107
+ this.filterBar.filter.name = name;
1108
+ this.filterBar.filter.saved = true;
1109
+ this.filterBar.filter.changed = false;
1110
+ this.onSave.emit({ filter: this.filterBar.filter, filterBar: this.filterBar });
1201
1111
  }
1202
- return this.adapter.today().endOf('day');
1203
- }
1204
- get isEmpty() {
1205
- if (this.data.value === null)
1206
- return true;
1207
- if (this.data.value?.name)
1208
- return false;
1209
- return !this.adapter.isDateInstance(this.start) || !this.adapter.isDateInstance(this.end);
1210
1112
  }
1211
- onKeydown($event) {
1212
- if (($event.ctrlKey || $event.metaKey) && $event.keyCode === ENTER) {
1213
- this.onApplyPeriod();
1113
+ showError(error) {
1114
+ if (error?.nameAlreadyExists) {
1115
+ this.filterName.setErrors({ filterNameAlreadyExist: true });
1214
1116
  }
1117
+ this.showFilterSavingError = true;
1118
+ this.filterSavingErrorText = error?.text ?? this.filterBar.configuration.filters.errorHint;
1215
1119
  }
1216
- onApplyPeriod() {
1217
- this.data.value = {
1218
- start: this.formGroup.controls.start.value.toISO(),
1219
- end: this.formGroup.controls.end.value.toISO()
1220
- };
1221
- this.stateChanges.next();
1222
- this.filterBar?.onChangePipe.next(this.data);
1223
- this.popover.hide();
1120
+ restoreFocus() {
1121
+ this.button.focus();
1224
1122
  }
1225
- onSelect(item) {
1226
- this.data.value = item;
1227
- this.stateChanges.next();
1228
- this.filterBar?.onChangePipe.next(this.data);
1229
- this.popover.hide();
1123
+ preparePopover() {
1124
+ this.filterName = new FormControl(this.filter?.name || '', Validators.required);
1125
+ this.filterName.valueChanges.subscribe(() => (this.showFilterSavingError = false));
1126
+ this.popover.show();
1127
+ merge(...this.popover.defaultClosingActions()).subscribe(this.closePopover);
1128
+ this.popover.visibleChange.pipe(filter((state) => !state)).subscribe(this.closePopover);
1129
+ setTimeout(() => this.newFilterName.nativeElement.focus());
1230
1130
  }
1231
- openPeriod() {
1232
- this.list = false;
1233
- this.showStartCalendar = false;
1234
- this.showEndCalendar = false;
1235
- this.initFormGroup();
1236
- setTimeout(() => {
1237
- this.popover.updatePosition(true);
1238
- this.returnButton().focus();
1239
- });
1131
+ openSaveAsNewFilterPopover() {
1132
+ this.saveNewFilter = true;
1133
+ this.preparePopover();
1240
1134
  }
1241
- openList() {
1242
- this.list = true;
1243
- setTimeout(() => this.listSelection().focus());
1244
- this.popover.updatePosition(true);
1135
+ openChangeFilterNamePopover() {
1136
+ this.saveNewFilter = false;
1137
+ this.preparePopover();
1245
1138
  }
1246
- open() {
1247
- this.popover.show();
1139
+ /** @docs-private */
1140
+ stopEventPropagation(event) {
1141
+ event.stopPropagation();
1248
1142
  }
1249
- onSelectStartDate(value) {
1250
- this.formGroup.controls.start.setValue(value);
1143
+ /** @docs-private */
1144
+ searchKeydownHandler(event) {
1145
+ if (event.key === 'Escape') {
1146
+ this.closePopover();
1147
+ }
1148
+ else {
1149
+ this.stopEventPropagation(event);
1150
+ }
1251
1151
  }
1252
- onSelectEndDate(value) {
1253
- this.formGroup.controls.end.setValue(value);
1152
+ /** @docs-private */
1153
+ onDropdownOpen() {
1154
+ setTimeout(() => this.search.nativeElement.focus());
1254
1155
  }
1255
- onFocusStartInput() {
1256
- this.showStartCalendar = true;
1257
- this.showEndCalendar = false;
1258
- this.popover.updatePosition(true);
1156
+ resetFilterChanges() {
1157
+ this.filterBar.resetFilterChangedState();
1158
+ this.onResetFilterChanges.emit(this.filter);
1259
1159
  }
1260
- onFocusEndInput() {
1261
- this.showEndCalendar = true;
1262
- this.showStartCalendar = false;
1160
+ /** Hide the popup and restore focus.
1161
+ * Use this method in the onSave, onSaveAsNew, or onChangeFilter events after the data has been successfully saved. */
1162
+ filterSavedSuccessfully() {
1163
+ this.popover.hide();
1164
+ this.restoreFocus();
1263
1165
  }
1264
- hideCalendars() {
1265
- this.showStartCalendar = false;
1266
- this.showEndCalendar = false;
1166
+ /** Shows an error. Use this method in the onSave, onSaveAsNew, or onChangeFilter events if saving data failed. */
1167
+ filterSavedUnsuccessfully(error) {
1168
+ this.showError(error);
1267
1169
  }
1268
- initFormGroup() {
1269
- this.formGroup = new FormGroup({
1270
- start: new FormControl(this.start || this.defaultStart),
1271
- end: new FormControl(this.end || this.defaultEnd)
1272
- });
1170
+ getFilteredOptions(value) {
1171
+ const searchFilter = value && value.new ? value.value : value;
1172
+ return searchFilter
1173
+ ? this.filters.filter((filter) => filter.name.toLowerCase().includes(searchFilter.toLowerCase()))
1174
+ : this.filters;
1273
1175
  }
1274
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeDatetimeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1275
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: KbqPipeDatetimeComponent, isStandalone: true, selector: "kbq-pipe-datetime", providers: [
1276
- {
1277
- provide: KBQ_VALIDATION,
1278
- useValue: { useValidation: false }
1279
- },
1280
- {
1281
- provide: KbqBasePipe,
1282
- useExisting: this
1283
- }
1284
- ], viewQueries: [{ propertyName: "listSelection", first: true, predicate: ["listSelection"], descendants: true, read: KbqListSelection, isSignal: true }, { propertyName: "returnButton", first: true, predicate: ["returnButton"], descendants: true, read: KbqButton, isSignal: true }, { propertyName: "popover", first: true, predicate: ["popover"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<button\n #popover=\"kbqPopover\"\n kbq-button\n kbqPopover\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [kbqPopoverArrow]=\"false\"\n [kbqPopoverClass]=\"'kbq-pipe-date__popover'\"\n [kbqPopoverContent]=\"content\"\n [kbqPopoverPlacement]=\"placements.BottomLeft\"\n [kbqPopoverPlacementPriority]=\"[placements.BottomLeft, placements.TopLeft]\"\n (kbqPopoverVisibleChange)=\"list = true\"\n>\n <span #kbqTitleText class=\"kbq-pipe__name\">{{ data.name }}</span>\n <span #kbqTitleText class=\"kbq-pipe__value\" [class.kbq-pipe__value_empty]=\"!formattedValue\">\n {{ formattedValue }}\n </span>\n</button>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #content>\n @if (list) {\n <div class=\"kbq-date-list\">\n <kbq-list-selection #listSelection [ngModel]=\"data.value?.name\">\n <kbq-list-option (click)=\"openPeriod()\" (keydown.enter)=\"openPeriod()\">\n {{ localeData.datePipe?.customPeriod }}\n <i class=\"kbq kbq-icon kbq-chevron-right_16 kbq-contrast-fade\"></i>\n </kbq-list-option>\n\n @for (item of values; track item) {\n <kbq-list-option [value]=\"item.name\" (click)=\"onSelect(item)\" (keydown.enter)=\"onSelect(item)\">\n {{ item.name }}\n </kbq-list-option>\n }\n </kbq-list-selection>\n </div>\n } @else {\n <div class=\"kbq-date-period kbq-datepicker__content\" (keydown)=\"onKeydown($event)\">\n <div class=\"kbq-date-period__header\">\n <button\n #returnButton\n kbq-button\n [color]=\"colors.Theme\"\n [kbqStyle]=\"styles.Transparent\"\n (click)=\"openList()\"\n >\n <i kbq-icon=\"kbq-chevron-left_16\"></i>\n {{ localeData.datePipe.backToPeriodSelection }}\n </button>\n </div>\n\n <kbq-divider />\n\n <form class=\"kbq-date-period__content kbq-form-horizontal\" [formGroup]=\"formGroup\">\n <div class=\"kbq-date-period__content-header\">{{ localeData.datePipe.customPeriod }}</div>\n <div class=\"kbq-form__row kbq-form__row_with-time\">\n <label class=\"kbq-form__label flex-10\">{{ localeData.datePipe.customPeriodFrom }}</label>\n\n <kbq-form-field\n class=\"kbq-date-period__date kbq-form__control\"\n [class.kbq-focused]=\"showStartCalendar\"\n >\n <input\n formControlName=\"start\"\n [kbqCalendar]=\"startDateCalendar\"\n [max]=\"formGroup.controls.end.value\"\n (focusin)=\"onFocusStartInput()\"\n (keydown.tab)=\"hideCalendars()\"\n />\n <i kbq-icon=\"kbq-calendar-o_16\" kbqSuffix></i>\n </kbq-form-field>\n\n <kbq-form-field class=\"kbq-date-period__time kbq-form__control\">\n <i kbq-icon=\"kbq-clock_16\" kbqPrefix></i>\n <input formControlName=\"start\" kbqTimepicker (focusin)=\"hideCalendars()\" />\n </kbq-form-field>\n </div>\n\n <kbq-calendar\n #startDateCalendar\n [class.kbq-calendar_hidden]=\"!showStartCalendar\"\n (selectedChange)=\"onSelectStartDate($event)\"\n />\n\n <div class=\"kbq-form__row kbq-form__row_with-time\">\n <label class=\"kbq-form__label flex-10\">{{ localeData.datePipe.customPeriodTo }}</label>\n\n <kbq-form-field\n class=\"kbq-date-period__date kbq-form__control\"\n [class.kbq-focused]=\"showEndCalendar\"\n >\n <input\n formControlName=\"end\"\n [kbqCalendar]=\"endDateCalendar\"\n (focusin)=\"onFocusEndInput()\"\n (keydown.tab)=\"hideCalendars()\"\n />\n <i kbq-icon=\"kbq-calendar-o_16\" kbqSuffix></i>\n </kbq-form-field>\n\n <kbq-form-field class=\"kbq-date-period__time kbq-form__control\">\n <i kbq-icon=\"kbq-clock_16\" kbqPrefix></i>\n <input formControlName=\"end\" kbqTimepicker (focusin)=\"hideCalendars()\" />\n </kbq-form-field>\n </div>\n\n @if (formGroup.controls.start.invalid) {\n <kbq-hint class=\"kbq-date-period__hint\" [color]=\"'error'\">\n {{ localeData.datePipe.customPeriodErrorHint }}\n </kbq-hint>\n }\n\n <kbq-calendar\n #endDateCalendar\n [class.kbq-calendar_hidden]=\"!showEndCalendar\"\n (selectedChange)=\"onSelectEndDate($event)\"\n />\n </form>\n\n <div class=\"kbq-date-period__footer\">\n <button\n kbq-button\n [color]=\"'theme'\"\n [disabled]=\"disabled\"\n [kbqStyle]=\"'transparent'\"\n (click)=\"onApplyPeriod()\"\n >\n <span>{{ localeData.pipe.applyButton }}</span>\n &nbsp;\n <span class=\"kbq-button_hot-key\">{{ isMac ? '\u2318' : 'Ctrl+' }}Enter</span>\n </button>\n </div>\n </div>\n }\n</ng-template>\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ formattedValue }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n", ".kbq-datepicker__content{--kbq-datepicker-size-container-padding-vertical: var(--kbq-size-m);--kbq-datepicker-size-container-border-radius: var(--kbq-size-s);--kbq-datepicker-size-header-padding-horizontal: var(--kbq-size-xxs);--kbq-datepicker-size-header-margin-bottom: var(--kbq-size-3xs);--kbq-datepicker-size-grid-padding-horizontal: var(--kbq-size-m);--kbq-datepicker-size-grid-content-gap-vertical: var(--kbq-size-3xs);--kbq-datepicker-size-grid-divider-height: 1px;--kbq-datepicker-size-grid-cell-padding-horizontal: var(--kbq-size-s);--kbq-datepicker-size-grid-cell-padding-vertical: var(--kbq-size-s);--kbq-datepicker-size-grid-cell-border-radius: var(--kbq-size-s);--kbq-datepicker-container-background: var(--kbq-background-card);--kbq-datepicker-container-shadow: var(--kbq-shadow-popup);--kbq-datepicker-header-text: var(--kbq-foreground-contrast-tertiary);--kbq-datepicker-header-divider: var(--kbq-line-contrast-less);--kbq-datepicker-grid-cell-default-background: transparent;--kbq-datepicker-grid-cell-default-text: var(--kbq-foreground-contrast);--kbq-datepicker-grid-cell-today-background: transparent;--kbq-datepicker-grid-cell-today-text: var(--kbq-foreground-theme);--kbq-datepicker-grid-cell-states-hover-background: var(--kbq-states-background-transparent-hover);--kbq-datepicker-grid-cell-states-active-background: var(--kbq-states-background-transparent-active);--kbq-datepicker-grid-cell-states-selected-background: var(--kbq-background-contrast);--kbq-datepicker-grid-cell-states-selected-text: var(--kbq-foreground-white);--kbq-datepicker-grid-cell-states-selected-hover-background: var(--kbq-states-background-contrast-active);--kbq-datepicker-grid-cell-states-disabled-background: transparent;--kbq-datepicker-grid-cell-states-disabled-text: var(--kbq-states-foreground-disabled)}.kbq-pipe-date__popover.kbq-popover.kbq-popover_medium{margin-top:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-popover__container{max-height:unset}.kbq-pipe-date__popover .kbq-popover__content{padding:0}.kbq-pipe-date__popover .kbq-date-list{margin:var(--kbq-size-xxs) 0}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option{margin-left:var(--kbq-size-xxs);margin-right:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option .kbq-list-text{display:flex;flex-direction:row}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option .kbq-icon{margin-left:var(--kbq-size-s);align-self:center;color:var(--kbq-icon-fade-contrast-color)}.kbq-pipe-date__popover .kbq-date-period{width:320px}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__header{padding-top:var(--kbq-size-xs);padding-left:var(--kbq-size-xxs);padding-right:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__header .kbq-button{width:100%;justify-content:flex-start}.kbq-pipe-date__popover .kbq-date-period .kbq-divider{margin:var(--kbq-size-xxs) var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content{display:flex;flex-direction:column;padding:0;gap:var(--kbq-size-s)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-date-period__content-header{padding-top:var(--kbq-size-s);padding-left:var(--kbq-size-l);padding-right:var(--kbq-size-l);color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row{padding-left:var(--kbq-size-l);padding-right:var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row .kbq-date-period__date,.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row .kbq-date-period__time{flex:1}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row.kbq-form__row_with-time .kbq-date-period__date{max-width:45%}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row.kbq-form__row_with-time .kbq-date-period__date .kbq-form-field__container{border-top-right-radius:unset;border-bottom-right-radius:unset}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row.kbq-form__row_with-time .kbq-date-period__time{margin-left:-1px;max-width:45%}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row.kbq-form__row_with-time .kbq-date-period__time .kbq-form-field__container{border-top-left-radius:unset;border-bottom-left-radius:unset}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-calendar{position:relative;padding:var(--kbq-size-s) var(--kbq-size-s) var(--kbq-size-m);background-color:var(--kbq-background-bg-tertiary)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-calendar.kbq-calendar_hidden{display:none}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-hint{padding-left:var(--kbq-size-m);padding-right:var(--kbq-size-m)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer{padding:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer .kbq-button{width:100%;justify-content:flex-start}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer .kbq-button:not(.kbq-disabled) .kbq-button_hot-key{color:var(--kbq-foreground-contrast-secondary)}.kbq-datepicker__content{background:var(--kbq-datepicker-container-background);box-shadow:var(--kbq-datepicker-container-shadow)}.kbq-calendar__table-header{color:var(--kbq-datepicker-header-text)}.kbq-calendar__table-header-divider:after{background:var(--kbq-datepicker-header-divider)}.kbq-calendar__body-cell-content{background:var(--kbq-datepicker-grid-cell-default-background);color:var(--kbq-datepicker-grid-cell-default-text)}.kbq-calendar__body-cell-content.kbq-calendar__body-today{background:var(--kbq-datepicker-grid-cell-today-background);color:var(--kbq-datepicker-grid-cell-today-text)}.kbq-calendar__body-cell-content:hover:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-hover-background)}.kbq-calendar__body-cell-content:active:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-active-background)}.kbq-calendar__body-cell-content.kbq-selected:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-selected-background);color:var(--kbq-datepicker-grid-cell-states-selected-text)}.kbq-calendar__body-cell-content.kbq-selected:not(.kbq-disabled):hover{background:var(--kbq-datepicker-grid-cell-states-selected-hover-background)}.kbq-calendar__body-cell-content.kbq-disabled{color:var(--kbq-states-foreground-disabled);background:var(--kbq-datepicker-grid-cell-states-disabled-background)}.kbq-calendar,.kbq-calendar__table-header th{font-size:var(--kbq-typography-text-normal-font-size);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: KbqFormFieldModule }, { kind: "component", type: i6.KbqFormField, selector: "kbq-form-field", exportAs: ["kbqFormField"] }, { kind: "component", type: i6.KbqHint, selector: "kbq-hint", inputs: ["id", "fillTextOff", "compact"], exportAs: ["kbqHint"] }, { kind: "directive", type: i6.KbqPrefix, selector: "[kbqPrefix]" }, { kind: "directive", type: i6.KbqSuffix, selector: "[kbqSuffix]" }, { kind: "directive", type: i6.KbqValidateDirective, selector: " input[kbqInput], input[kbqNumberInput], input[kbqInputPassword], input[kbqTimepicker], input[kbqDatepicker], textarea[kbqTextarea], kbq-select, kbq-tree-select, kbq-tag-list ", exportAs: ["KbqValidate"] }, { kind: "component", type: KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "ngmodule", type: KbqInputModule }, { kind: "directive", type: i3$1.MaxValidator, selector: "[max][formControlName],[max][formControl],[max][ngModel]", inputs: ["max"] }, { kind: "ngmodule", type: KbqDividerModule }, { kind: "component", type: i4.KbqDivider, selector: "kbq-divider", inputs: ["vertical", "inset", "paddings"] }, { kind: "ngmodule", type: KbqPopoverModule }, { kind: "directive", type: i5$1.KbqPopoverTrigger, selector: "[kbqPopover]", inputs: ["kbqPopoverVisible", "kbqPopoverPlacement", "kbqPopoverPlacementPriority", "hasBackdrop", "kbqPopoverHeader", "kbqPopoverContent", "kbqPopoverFooter", "kbqPopoverDisabled", "kbqTrigger", "kbqPopoverSize", "kbqPopoverClass", "hasCloseButton", "closeOnScroll", "backdropClass", "kbqPopoverArrow", "kbqPopoverOffset"], outputs: ["kbqPopoverPlacementChange", "kbqPopoverVisibleChange"], exportAs: ["kbqPopover"] }, { kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "ngmodule", type: KbqListModule }, { kind: "component", type: i7.KbqListSelection, selector: "kbq-list-selection", inputs: ["autoSelect", "noUnselectLast", "horizontal", "tabIndex", "disabled", "compareWith"], outputs: ["onSelectAll", "onCopy", "selectionChange"], exportAs: ["kbqListSelection"] }, { kind: "component", type: i7.KbqListOption, selector: "kbq-list-option", inputs: ["checkboxPosition", "value", "disabled", "showCheckbox", "selected"], exportAs: ["kbqListOption"] }, { kind: "ngmodule", type: KbqDatepickerModule }, { kind: "component", type: i8.KbqCalendar, selector: "kbq-calendar", inputs: ["startAt", "selected", "minDate", "maxDate", "dateFilter", "dateClass"], outputs: ["selectedChange", "yearSelected", "monthSelected", "userSelection"], exportAs: ["kbqCalendar"] }, { kind: "directive", type: i8.KbqDatepickerInput, selector: "input[kbqDatepicker], input[kbqCalendar]", inputs: ["placeholder", "required", "kbqDatepicker", "kbqCalendar", "kbqDatepickerFilter", "value", "min", "max", "disabled", "id", "kbqValidationTooltip"], outputs: ["incorrectInput", "dateChange", "dateInput"], exportAs: ["kbqDatepickerInput"] }, { kind: "ngmodule", type: KbqTimepickerModule }, { kind: "directive", type: i9.KbqTimepicker, selector: "input[kbqTimepicker]", inputs: ["placeholder", "disabled", "id", "required", "format", "min", "max", "value", "kbqValidationTooltip"], outputs: ["incorrectInput"], exportAs: ["kbqTimepicker"] }, { kind: "directive", type: KbqPipeState, selector: "[kbqPipeState]", inputs: ["kbqPipeState"] }, { kind: "ngmodule", type: KbqFormattersModule }, { kind: "component", type: KbqPipeButton, selector: "kbq-pipe-button" }, { kind: "ngmodule", type: KbqTitleModule }, { kind: "directive", type: KbqPipeTitleDirective, selector: "[kbqPipeTitle]", inputs: ["kbqPipeTitle"], exportAs: ["kbqPipeTitle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1176
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilters, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1177
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: KbqFilters, isStandalone: true, selector: "kbq-filters", inputs: { filters: "filters" }, outputs: { onSelectFilter: "onSelectFilter", onSave: "onSave", onChangeFilter: "onChangeFilter", onSaveAsNew: "onSaveAsNew", onRemoveFilter: "onRemoveFilter", onResetFilterChanges: "onResetFilterChanges" }, host: { classAttribute: "kbq-filters" }, viewQueries: [{ propertyName: "button", first: true, predicate: KbqButton, descendants: true }, { propertyName: "popover", first: true, predicate: KbqPopoverTrigger, descendants: true }, { propertyName: "dropdown", first: true, predicate: KbqDropdownTrigger, descendants: true }, { propertyName: "search", first: true, predicate: ["search"], descendants: true }, { propertyName: "newFilterName", first: true, predicate: ["newFilterName"], descendants: true }], exportAs: ["kbqFilters"], ngImport: i0, template: "<button\n kbq-button\n kbq-title\n kbqFilterBarButton\n kbqPopover\n [kbqDropdownTriggerFor]=\"savedFilters\"\n [kbqPopoverArrow]=\"false\"\n [kbqPopoverClass]=\"'kbq-filters__save-as-new-filter-popover'\"\n [kbqPopoverContent]=\"saveAsNewPopoverContent\"\n [kbqPopoverFooter]=\"saveAsNewPopoverFooter\"\n [kbqPopoverHeader]=\"saveAsNewPopoverHeader\"\n [kbqPopoverPlacement]=\"placements.BottomLeft\"\n [kbqPopoverPlacementPriority]=\"[placements.BottomLeft, placements.TopLeft]\"\n [kbqPopoverSize]=\"popoverSize\"\n [kbqTrigger]=\"'manual'\"\n [ngClass]=\"{ 'kbq-active': opened }\"\n (dropdownClosed)=\"searchControl.setValue('')\"\n (dropdownOpened)=\"onDropdownOpen()\"\n>\n <span #kbqTitleText class=\"kbq-filters__filter-name\">\n @if (filter?.name) {\n {{ filter!.name }}\n } @else {\n <ng-content>\n <i kbq-icon=\"kbq-list_16\"></i>\n {{ localeData.defaultName }}\n </ng-content>\n }\n </span>\n</button>\n\n@if (filterBar.isChanged && !filterBar.isSaved) {\n <button\n kbq-button\n kbqFilterBarButton\n kbqTooltip=\"{{ localeData.saveNewFilterTooltip }}\"\n class=\"kbq-button_action\"\n [color]=\"colors.Empty\"\n (click)=\"openSaveAsNewFilterPopover()\"\n >\n <i kbq-icon=\"kbq-floppy-disk_16\"></i>\n </button>\n}\n\n@if (filterBar.isSaved) {\n <button\n kbq-button\n kbqFilterBarButton\n class=\"kbq-button_action\"\n [color]=\"colors.Empty\"\n [kbqDropdownTriggerFor]=\"filterActions\"\n [ngClass]=\"{ 'kbq-button_changed-saved-filter': filterBar.isSavedAndChanged }\"\n >\n <i kbq-icon=\"kbq-ellipsis-vertical_16\"></i>\n </button>\n\n <i kbq-icon=\"kbq-chevron-right-s_16\" class=\"kbq-filter-bar__arrow\" [color]=\"'theme'\"></i>\n} @else {\n <kbq-divider class=\"kbq-filter-bar__separator\" [vertical]=\"true\" />\n}\n\n<kbq-dropdown #savedFilters=\"kbqDropdown\" [class]=\"'kbq-filters__dropdown'\">\n <div [style.display]=\"isEmpty ? 'none' : 'initial'\">\n <kbq-form-field kbqFormFieldWithoutBorders>\n <i kbq-icon=\"kbq-magnifying-glass_16\" kbqPrefix></i>\n\n <input\n #search\n autocomplete=\"off\"\n kbqInput\n placeholder=\"{{ localeData.searchPlaceholder }}\"\n [formControl]=\"searchControl\"\n (click)=\"stopEventPropagation($event)\"\n (keydown)=\"searchKeydownHandler($event)\"\n />\n <kbq-cleaner />\n </kbq-form-field>\n\n <kbq-divider />\n\n @for (filter of filteredOptions | async; track filter) {\n <button\n kbq-dropdown-item\n kbq-title\n [class.kbq-selected]=\"filterBar.filter?.name === filter.name\"\n (click)=\"selectFilter(filter)\"\n >\n {{ filter.name }}\n </button>\n } @empty {\n <button kbq-dropdown-item [disabled]=\"true\">\n {{ localeData.searchEmptyResult }}\n </button>\n }\n\n <kbq-divider />\n </div>\n\n <button kbq-dropdown-item (click)=\"openSaveAsNewFilterPopover()\">\n <i kbq-icon=\"kbq-plus_16\"></i>\n {{ localeData.saveAsNewFilter }}\n </button>\n</kbq-dropdown>\n\n<kbq-dropdown #filterActions=\"kbqDropdown\" [class]=\"'kbq-filters__dropdown'\">\n @if (filterBar.isSavedAndChanged && !filterBar.isReadOnly) {\n <button\n kbq-dropdown-item\n [ngClass]=\"{ 'kbq-button_changed-saved-filter': filterBar.isSavedAndChanged }\"\n (click)=\"saveChanges()\"\n >\n <i kbq-icon=\"kbq-floppy-disk_16\"></i>\n {{ localeData.saveChanges }}\n @if (filterBar.isSavedAndChanged) {\n <i class=\"kbq kbq-icon kbq-icon-button kbq-circle-xs_16 kbq-warning layout-margin-left-xs\"></i>\n }\n </button>\n }\n <button kbq-dropdown-item (click)=\"openSaveAsNewFilterPopover()\">\n <i kbq-icon=\"kbq-plus_16\"></i>\n {{ localeData.saveAsNew }}\n </button>\n\n @if (!filterBar.isReadOnly) {\n <button kbq-dropdown-item (click)=\"openChangeFilterNamePopover()\">\n <i kbq-icon=\"kbq-pencil_16\"></i>\n {{ localeData.change }}\n </button>\n }\n\n @if (filterBar.isSavedAndChanged || !filterBar.isReadOnly) {\n <kbq-divider />\n }\n\n @if (filterBar.isSavedAndChanged) {\n <button kbq-dropdown-item (click)=\"resetFilterChanges()\">\n <i kbq-icon=\"kbq-xmark-circle_16\"></i>\n {{ localeData.resetChanges }}\n </button>\n }\n @if (!filterBar.isReadOnly) {\n <button kbq-dropdown-item (click)=\"this.onRemoveFilter.next(this.filter!)\">\n <i kbq-icon=\"kbq-trash_16\"></i>\n {{ localeData.remove }}\n </button>\n }\n</kbq-dropdown>\n\n<ng-template #saveAsNewPopoverHeader>{{ popoverHeader }}</ng-template>\n\n<ng-template #saveAsNewPopoverContent>\n @if (showFilterSavingError) {\n <kbq-alert class=\"layout-margin-bottom-m\" [alertColor]=\"'error'\" [alertStyle]=\"'colored'\" [compact]=\"true\">\n {{ filterSavingErrorText }}\n </kbq-alert>\n }\n <div class=\"kbq-form-vertical\">\n <div class=\"kbq-form__row\">\n <label class=\"kbq-form__label\">{{ localeData.name }}</label>\n\n <kbq-form-field class=\"kbq-form__control\">\n <input #newFilterName kbqInput type=\"text\" [formControl]=\"filterName\" />\n\n @if (filterName.hasError('filterNameAlreadyExist')) {\n <kbq-hint [color]=\"'error'\">{{ localeData.error }}</kbq-hint>\n }\n </kbq-form-field>\n </div>\n </div>\n</ng-template>\n\n<ng-template #saveAsNewPopoverFooter>\n <button kbq-button class=\"layout-margin-right-l\" [color]=\"'contrast'\" [kbqStyle]=\"'filled'\" (click)=\"saveAsNew()\">\n {{ localeData.saveButton }}\n </button>\n <button kbq-button [color]=\"'contrast-fade'\" [kbqStyle]=\"'filled'\" (click)=\"closePopover()\">\n {{ localeData.cancelButton }}\n </button>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-filters{display:flex}.kbq-filters>.kbq-button{max-width:320px}.kbq-filters>.kbq-button .kbq-button-wrapper{width:100%}.kbq-filters>.kbq-button .kbq-icon{margin-right:var(--kbq-size-xxs)}.kbq-filters .kbq-filters__filter-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-filters .kbq-filter-bar__separator{align-self:center;height:var(--kbq-size-m)!important;margin-left:calc(var(--kbq-size-s) + var(--kbq-size-xs))!important;margin-right:var(--kbq-size-xs)!important}.kbq-filters .kbq-filter-bar__arrow{align-self:center;margin-left:var(--kbq-size-s)}.kbq-filters .kbq-button.kbq-button_changed-filter{border-bottom-right-radius:unset;border-top-right-radius:unset}.kbq-filters .kbq-button-icon{margin-left:-1px;border-bottom-left-radius:unset;border-top-left-radius:unset}.kbq-filters .kbq-button_changed-saved-filter:before{content:\"\";position:absolute;right:-4px;top:-4px;width:var(--kbq-size-s);height:var(--kbq-size-s);border:2px solid var(--kbq-background-bg);border-radius:var(--kbq-size-xs);background:var(--kbq-icon-warning)}.kbq-filters .kbq-button:not(:hover,.kbq-active)+.kbq-button_action:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:var(--kbq-size-m);background:var(--kbq-line-contrast-less)}.kbq-filters__save-as-new-filter-popover .kbq-popover__container{width:400px}.kbq-filters__save-as-new-filter-popover .kbq-popover__content{padding:var(--kbq-size-s) var(--kbq-size-xxl)}.kbq-filters__dropdown .kbq-dropdown-item{padding-right:var(--kbq-size-s)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "directive", type: i1.KbqButtonDropdownTrigger, selector: "[kbq-button][kbqDropdownTriggerFor]" }, { kind: "ngmodule", type: KbqDropdownModule }, { kind: "component", type: i3$3.KbqDropdown, selector: "kbq-dropdown", inputs: ["navigationWithWrap", "xPosition", "yPosition", "overlapTriggerY", "overlapTriggerX", "hasBackdrop", "class", "backdropClass"], outputs: ["closed"], exportAs: ["kbqDropdown"] }, { kind: "component", type: i3$3.KbqDropdownItem, selector: "kbq-dropdown-item, [kbq-dropdown-item]", inputs: ["disabled"], exportAs: ["kbqDropdownItem"] }, { kind: "directive", type: i3$3.KbqDropdownTrigger, selector: "[kbqDropdownTriggerFor]", inputs: ["kbqDropdownTriggerData", "openByArrowDown", "kbqDropdownTriggerRestoreFocus", "kbqDropdownTriggerFor"], outputs: ["dropdownOpened", "dropdownClosed"], exportAs: ["kbqDropdownTrigger"] }, { kind: "ngmodule", type: KbqDividerModule }, { kind: "component", type: i4.KbqDivider, selector: "kbq-divider", inputs: ["vertical", "inset", "paddings"] }, { kind: "component", type: KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "ngmodule", type: KbqTitleModule }, { kind: "directive", type: i5$3.KbqTitleDirective, selector: "[kbq-title]", exportAs: ["kbqTitle"] }, { kind: "ngmodule", type: KbqFormFieldModule }, { kind: "component", type: i6.KbqFormField, selector: "kbq-form-field", exportAs: ["kbqFormField"] }, { kind: "directive", type: i6.KbqFormFieldWithoutBorders, selector: "kbq-form-field[kbqFormFieldWithoutBorders]", exportAs: ["kbqFormFieldWithoutBorders"] }, { kind: "component", type: i6.KbqHint, selector: "kbq-hint", inputs: ["id", "fillTextOff", "compact"], exportAs: ["kbqHint"] }, { kind: "directive", type: i6.KbqPrefix, selector: "[kbqPrefix]" }, { kind: "component", type: i6.KbqCleaner, selector: "kbq-cleaner", exportAs: ["kbqCleaner"] }, { kind: "directive", type: i6.KbqValidateDirective, selector: " input[kbqInput], input[kbqNumberInput], input[kbqInputPassword], input[kbqTimepicker], input[kbqDatepicker], textarea[kbqTextarea], kbq-select, kbq-tree-select, kbq-tag-list ", exportAs: ["KbqValidate"] }, { kind: "directive", type: i6.KbqTrim, selector: "[kbqInput], [kbqTextarea]", exportAs: ["KbqTrim"] }, { kind: "ngmodule", type: KbqInputModule }, { kind: "directive", type: i3.KbqInput, selector: "input[kbqInput],input[kbqNumberInput]", inputs: ["errorStateMatcher", "placeholder", "disabled", "id", "required", "type", "value"], exportAs: ["kbqInput"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: KbqFilterBarButton, selector: "[kbqFilterBarButton]" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: KbqTooltipTrigger, selector: "[kbqTooltip]", inputs: ["kbqVisible", "kbqPlacement", "kbqRelativeToPointer", "kbqPlacementPriority", "kbqTooltip", "kbqTooltipDisabled", "kbqEnterDelay", "kbqLeaveDelay", "kbqTrigger", "kbqTooltipClass", "kbqTooltipContext", "kbqTooltipColor", "kbqTooltipArrow", "kbqTooltipOffset"], outputs: ["kbqPlacementChange", "kbqVisibleChange"], exportAs: ["kbqTooltip"] }, { kind: "ngmodule", type: KbqPopoverModule }, { kind: "directive", type: i5.KbqPopoverTrigger, selector: "[kbqPopover]", inputs: ["kbqPopoverVisible", "kbqPopoverPlacement", "kbqPopoverPlacementPriority", "hasBackdrop", "kbqPopoverHeader", "kbqPopoverContent", "kbqPopoverFooter", "kbqPopoverDisabled", "kbqTrigger", "kbqPopoverSize", "kbqPopoverClass", "hasCloseButton", "closeOnScroll", "backdropClass", "kbqPopoverArrow", "kbqPopoverOffset"], outputs: ["kbqPopoverPlacementChange", "kbqPopoverVisibleChange"], exportAs: ["kbqPopover"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: KbqFormsModule }, { kind: "directive", type: i3$2.KbqForm, selector: ".kbq-form-vertical, .kbq-form-horizontal", exportAs: ["kbqForm"] }, { kind: "directive", type: i3$2.KbqFormElement, selector: ".kbq-form__row, .kbq-form__fieldset, .kbq-form__legend", exportAs: ["kbqFormElement"] }, { kind: "ngmodule", type: KbqAlertModule }, { kind: "component", type: i10.KbqAlert, selector: "kbq-alert", inputs: ["compact", "alertStyle", "alertColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1285
1178
  }
1286
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeDatetimeComponent, decorators: [{
1179
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilters, decorators: [{
1287
1180
  type: Component,
1288
- args: [{ standalone: true, selector: 'kbq-pipe-datetime', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
1289
- {
1290
- provide: KBQ_VALIDATION,
1291
- useValue: { useValidation: false }
1292
- },
1293
- {
1294
- provide: KbqBasePipe,
1295
- useExisting: this
1296
- }
1297
- ], imports: [
1181
+ args: [{ standalone: true, exportAs: 'kbqFilters', selector: 'kbq-filters', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
1182
+ class: 'kbq-filters'
1183
+ }, imports: [
1298
1184
  ReactiveFormsModule,
1299
- KbqFormFieldModule,
1185
+ KbqButtonModule,
1186
+ KbqDropdownModule,
1187
+ KbqDividerModule,
1300
1188
  KbqIcon,
1189
+ KbqTitleModule,
1190
+ KbqFormFieldModule,
1301
1191
  KbqInputModule,
1302
- KbqDividerModule,
1192
+ NgClass,
1193
+ KbqFilterBarButton,
1194
+ AsyncPipe,
1195
+ KbqTooltipTrigger,
1303
1196
  KbqPopoverModule,
1304
- KbqButtonModule,
1305
- KbqListModule,
1306
- KbqDatepickerModule,
1307
- KbqTimepickerModule,
1308
- KbqPipeState,
1309
- KbqFormattersModule,
1310
- KbqPipeButton,
1311
- KbqTitleModule,
1312
- KbqPipeTitleDirective,
1313
- FormsModule
1314
- ], template: "<button\n #popover=\"kbqPopover\"\n kbq-button\n kbqPopover\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [kbqPopoverArrow]=\"false\"\n [kbqPopoverClass]=\"'kbq-pipe-date__popover'\"\n [kbqPopoverContent]=\"content\"\n [kbqPopoverPlacement]=\"placements.BottomLeft\"\n [kbqPopoverPlacementPriority]=\"[placements.BottomLeft, placements.TopLeft]\"\n (kbqPopoverVisibleChange)=\"list = true\"\n>\n <span #kbqTitleText class=\"kbq-pipe__name\">{{ data.name }}</span>\n <span #kbqTitleText class=\"kbq-pipe__value\" [class.kbq-pipe__value_empty]=\"!formattedValue\">\n {{ formattedValue }}\n </span>\n</button>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #content>\n @if (list) {\n <div class=\"kbq-date-list\">\n <kbq-list-selection #listSelection [ngModel]=\"data.value?.name\">\n <kbq-list-option (click)=\"openPeriod()\" (keydown.enter)=\"openPeriod()\">\n {{ localeData.datePipe?.customPeriod }}\n <i class=\"kbq kbq-icon kbq-chevron-right_16 kbq-contrast-fade\"></i>\n </kbq-list-option>\n\n @for (item of values; track item) {\n <kbq-list-option [value]=\"item.name\" (click)=\"onSelect(item)\" (keydown.enter)=\"onSelect(item)\">\n {{ item.name }}\n </kbq-list-option>\n }\n </kbq-list-selection>\n </div>\n } @else {\n <div class=\"kbq-date-period kbq-datepicker__content\" (keydown)=\"onKeydown($event)\">\n <div class=\"kbq-date-period__header\">\n <button\n #returnButton\n kbq-button\n [color]=\"colors.Theme\"\n [kbqStyle]=\"styles.Transparent\"\n (click)=\"openList()\"\n >\n <i kbq-icon=\"kbq-chevron-left_16\"></i>\n {{ localeData.datePipe.backToPeriodSelection }}\n </button>\n </div>\n\n <kbq-divider />\n\n <form class=\"kbq-date-period__content kbq-form-horizontal\" [formGroup]=\"formGroup\">\n <div class=\"kbq-date-period__content-header\">{{ localeData.datePipe.customPeriod }}</div>\n <div class=\"kbq-form__row kbq-form__row_with-time\">\n <label class=\"kbq-form__label flex-10\">{{ localeData.datePipe.customPeriodFrom }}</label>\n\n <kbq-form-field\n class=\"kbq-date-period__date kbq-form__control\"\n [class.kbq-focused]=\"showStartCalendar\"\n >\n <input\n formControlName=\"start\"\n [kbqCalendar]=\"startDateCalendar\"\n [max]=\"formGroup.controls.end.value\"\n (focusin)=\"onFocusStartInput()\"\n (keydown.tab)=\"hideCalendars()\"\n />\n <i kbq-icon=\"kbq-calendar-o_16\" kbqSuffix></i>\n </kbq-form-field>\n\n <kbq-form-field class=\"kbq-date-period__time kbq-form__control\">\n <i kbq-icon=\"kbq-clock_16\" kbqPrefix></i>\n <input formControlName=\"start\" kbqTimepicker (focusin)=\"hideCalendars()\" />\n </kbq-form-field>\n </div>\n\n <kbq-calendar\n #startDateCalendar\n [class.kbq-calendar_hidden]=\"!showStartCalendar\"\n (selectedChange)=\"onSelectStartDate($event)\"\n />\n\n <div class=\"kbq-form__row kbq-form__row_with-time\">\n <label class=\"kbq-form__label flex-10\">{{ localeData.datePipe.customPeriodTo }}</label>\n\n <kbq-form-field\n class=\"kbq-date-period__date kbq-form__control\"\n [class.kbq-focused]=\"showEndCalendar\"\n >\n <input\n formControlName=\"end\"\n [kbqCalendar]=\"endDateCalendar\"\n (focusin)=\"onFocusEndInput()\"\n (keydown.tab)=\"hideCalendars()\"\n />\n <i kbq-icon=\"kbq-calendar-o_16\" kbqSuffix></i>\n </kbq-form-field>\n\n <kbq-form-field class=\"kbq-date-period__time kbq-form__control\">\n <i kbq-icon=\"kbq-clock_16\" kbqPrefix></i>\n <input formControlName=\"end\" kbqTimepicker (focusin)=\"hideCalendars()\" />\n </kbq-form-field>\n </div>\n\n @if (formGroup.controls.start.invalid) {\n <kbq-hint class=\"kbq-date-period__hint\" [color]=\"'error'\">\n {{ localeData.datePipe.customPeriodErrorHint }}\n </kbq-hint>\n }\n\n <kbq-calendar\n #endDateCalendar\n [class.kbq-calendar_hidden]=\"!showEndCalendar\"\n (selectedChange)=\"onSelectEndDate($event)\"\n />\n </form>\n\n <div class=\"kbq-date-period__footer\">\n <button\n kbq-button\n [color]=\"'theme'\"\n [disabled]=\"disabled\"\n [kbqStyle]=\"'transparent'\"\n (click)=\"onApplyPeriod()\"\n >\n <span>{{ localeData.pipe.applyButton }}</span>\n &nbsp;\n <span class=\"kbq-button_hot-key\">{{ isMac ? '\u2318' : 'Ctrl+' }}Enter</span>\n </button>\n </div>\n </div>\n }\n</ng-template>\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ formattedValue }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n", ".kbq-datepicker__content{--kbq-datepicker-size-container-padding-vertical: var(--kbq-size-m);--kbq-datepicker-size-container-border-radius: var(--kbq-size-s);--kbq-datepicker-size-header-padding-horizontal: var(--kbq-size-xxs);--kbq-datepicker-size-header-margin-bottom: var(--kbq-size-3xs);--kbq-datepicker-size-grid-padding-horizontal: var(--kbq-size-m);--kbq-datepicker-size-grid-content-gap-vertical: var(--kbq-size-3xs);--kbq-datepicker-size-grid-divider-height: 1px;--kbq-datepicker-size-grid-cell-padding-horizontal: var(--kbq-size-s);--kbq-datepicker-size-grid-cell-padding-vertical: var(--kbq-size-s);--kbq-datepicker-size-grid-cell-border-radius: var(--kbq-size-s);--kbq-datepicker-container-background: var(--kbq-background-card);--kbq-datepicker-container-shadow: var(--kbq-shadow-popup);--kbq-datepicker-header-text: var(--kbq-foreground-contrast-tertiary);--kbq-datepicker-header-divider: var(--kbq-line-contrast-less);--kbq-datepicker-grid-cell-default-background: transparent;--kbq-datepicker-grid-cell-default-text: var(--kbq-foreground-contrast);--kbq-datepicker-grid-cell-today-background: transparent;--kbq-datepicker-grid-cell-today-text: var(--kbq-foreground-theme);--kbq-datepicker-grid-cell-states-hover-background: var(--kbq-states-background-transparent-hover);--kbq-datepicker-grid-cell-states-active-background: var(--kbq-states-background-transparent-active);--kbq-datepicker-grid-cell-states-selected-background: var(--kbq-background-contrast);--kbq-datepicker-grid-cell-states-selected-text: var(--kbq-foreground-white);--kbq-datepicker-grid-cell-states-selected-hover-background: var(--kbq-states-background-contrast-active);--kbq-datepicker-grid-cell-states-disabled-background: transparent;--kbq-datepicker-grid-cell-states-disabled-text: var(--kbq-states-foreground-disabled)}.kbq-pipe-date__popover.kbq-popover.kbq-popover_medium{margin-top:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-popover__container{max-height:unset}.kbq-pipe-date__popover .kbq-popover__content{padding:0}.kbq-pipe-date__popover .kbq-date-list{margin:var(--kbq-size-xxs) 0}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option{margin-left:var(--kbq-size-xxs);margin-right:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option .kbq-list-text{display:flex;flex-direction:row}.kbq-pipe-date__popover .kbq-date-list .kbq-list-option .kbq-icon{margin-left:var(--kbq-size-s);align-self:center;color:var(--kbq-icon-fade-contrast-color)}.kbq-pipe-date__popover .kbq-date-period{width:320px}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__header{padding-top:var(--kbq-size-xs);padding-left:var(--kbq-size-xxs);padding-right:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__header .kbq-button{width:100%;justify-content:flex-start}.kbq-pipe-date__popover .kbq-date-period .kbq-divider{margin:var(--kbq-size-xxs) var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content{display:flex;flex-direction:column;padding:0;gap:var(--kbq-size-s)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-date-period__content-header{padding-top:var(--kbq-size-s);padding-left:var(--kbq-size-l);padding-right:var(--kbq-size-l);color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row{padding-left:var(--kbq-size-l);padding-right:var(--kbq-size-l)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row .kbq-date-period__date,.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row .kbq-date-period__time{flex:1}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row.kbq-form__row_with-time .kbq-date-period__date{max-width:45%}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row.kbq-form__row_with-time .kbq-date-period__date .kbq-form-field__container{border-top-right-radius:unset;border-bottom-right-radius:unset}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row.kbq-form__row_with-time .kbq-date-period__time{margin-left:-1px;max-width:45%}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-form__row.kbq-form__row_with-time .kbq-date-period__time .kbq-form-field__container{border-top-left-radius:unset;border-bottom-left-radius:unset}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-calendar{position:relative;padding:var(--kbq-size-s) var(--kbq-size-s) var(--kbq-size-m);background-color:var(--kbq-background-bg-tertiary)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-calendar.kbq-calendar_hidden{display:none}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__content .kbq-hint{padding-left:var(--kbq-size-m);padding-right:var(--kbq-size-m)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer{padding:var(--kbq-size-xxs)}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer .kbq-button{width:100%;justify-content:flex-start}.kbq-pipe-date__popover .kbq-date-period .kbq-date-period__footer .kbq-button:not(.kbq-disabled) .kbq-button_hot-key{color:var(--kbq-foreground-contrast-secondary)}.kbq-datepicker__content{background:var(--kbq-datepicker-container-background);box-shadow:var(--kbq-datepicker-container-shadow)}.kbq-calendar__table-header{color:var(--kbq-datepicker-header-text)}.kbq-calendar__table-header-divider:after{background:var(--kbq-datepicker-header-divider)}.kbq-calendar__body-cell-content{background:var(--kbq-datepicker-grid-cell-default-background);color:var(--kbq-datepicker-grid-cell-default-text)}.kbq-calendar__body-cell-content.kbq-calendar__body-today{background:var(--kbq-datepicker-grid-cell-today-background);color:var(--kbq-datepicker-grid-cell-today-text)}.kbq-calendar__body-cell-content:hover:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-hover-background)}.kbq-calendar__body-cell-content:active:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-active-background)}.kbq-calendar__body-cell-content.kbq-selected:not(.kbq-disabled){background:var(--kbq-datepicker-grid-cell-states-selected-background);color:var(--kbq-datepicker-grid-cell-states-selected-text)}.kbq-calendar__body-cell-content.kbq-selected:not(.kbq-disabled):hover{background:var(--kbq-datepicker-grid-cell-states-selected-hover-background)}.kbq-calendar__body-cell-content.kbq-disabled{color:var(--kbq-states-foreground-disabled);background:var(--kbq-datepicker-grid-cell-states-disabled-background)}.kbq-calendar,.kbq-calendar__table-header th{font-size:var(--kbq-typography-text-normal-font-size);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}\n"] }]
1315
- }], propDecorators: { popover: [{
1197
+ FormsModule,
1198
+ KbqFormsModule,
1199
+ KbqAlertModule
1200
+ ], template: "<button\n kbq-button\n kbq-title\n kbqFilterBarButton\n kbqPopover\n [kbqDropdownTriggerFor]=\"savedFilters\"\n [kbqPopoverArrow]=\"false\"\n [kbqPopoverClass]=\"'kbq-filters__save-as-new-filter-popover'\"\n [kbqPopoverContent]=\"saveAsNewPopoverContent\"\n [kbqPopoverFooter]=\"saveAsNewPopoverFooter\"\n [kbqPopoverHeader]=\"saveAsNewPopoverHeader\"\n [kbqPopoverPlacement]=\"placements.BottomLeft\"\n [kbqPopoverPlacementPriority]=\"[placements.BottomLeft, placements.TopLeft]\"\n [kbqPopoverSize]=\"popoverSize\"\n [kbqTrigger]=\"'manual'\"\n [ngClass]=\"{ 'kbq-active': opened }\"\n (dropdownClosed)=\"searchControl.setValue('')\"\n (dropdownOpened)=\"onDropdownOpen()\"\n>\n <span #kbqTitleText class=\"kbq-filters__filter-name\">\n @if (filter?.name) {\n {{ filter!.name }}\n } @else {\n <ng-content>\n <i kbq-icon=\"kbq-list_16\"></i>\n {{ localeData.defaultName }}\n </ng-content>\n }\n </span>\n</button>\n\n@if (filterBar.isChanged && !filterBar.isSaved) {\n <button\n kbq-button\n kbqFilterBarButton\n kbqTooltip=\"{{ localeData.saveNewFilterTooltip }}\"\n class=\"kbq-button_action\"\n [color]=\"colors.Empty\"\n (click)=\"openSaveAsNewFilterPopover()\"\n >\n <i kbq-icon=\"kbq-floppy-disk_16\"></i>\n </button>\n}\n\n@if (filterBar.isSaved) {\n <button\n kbq-button\n kbqFilterBarButton\n class=\"kbq-button_action\"\n [color]=\"colors.Empty\"\n [kbqDropdownTriggerFor]=\"filterActions\"\n [ngClass]=\"{ 'kbq-button_changed-saved-filter': filterBar.isSavedAndChanged }\"\n >\n <i kbq-icon=\"kbq-ellipsis-vertical_16\"></i>\n </button>\n\n <i kbq-icon=\"kbq-chevron-right-s_16\" class=\"kbq-filter-bar__arrow\" [color]=\"'theme'\"></i>\n} @else {\n <kbq-divider class=\"kbq-filter-bar__separator\" [vertical]=\"true\" />\n}\n\n<kbq-dropdown #savedFilters=\"kbqDropdown\" [class]=\"'kbq-filters__dropdown'\">\n <div [style.display]=\"isEmpty ? 'none' : 'initial'\">\n <kbq-form-field kbqFormFieldWithoutBorders>\n <i kbq-icon=\"kbq-magnifying-glass_16\" kbqPrefix></i>\n\n <input\n #search\n autocomplete=\"off\"\n kbqInput\n placeholder=\"{{ localeData.searchPlaceholder }}\"\n [formControl]=\"searchControl\"\n (click)=\"stopEventPropagation($event)\"\n (keydown)=\"searchKeydownHandler($event)\"\n />\n <kbq-cleaner />\n </kbq-form-field>\n\n <kbq-divider />\n\n @for (filter of filteredOptions | async; track filter) {\n <button\n kbq-dropdown-item\n kbq-title\n [class.kbq-selected]=\"filterBar.filter?.name === filter.name\"\n (click)=\"selectFilter(filter)\"\n >\n {{ filter.name }}\n </button>\n } @empty {\n <button kbq-dropdown-item [disabled]=\"true\">\n {{ localeData.searchEmptyResult }}\n </button>\n }\n\n <kbq-divider />\n </div>\n\n <button kbq-dropdown-item (click)=\"openSaveAsNewFilterPopover()\">\n <i kbq-icon=\"kbq-plus_16\"></i>\n {{ localeData.saveAsNewFilter }}\n </button>\n</kbq-dropdown>\n\n<kbq-dropdown #filterActions=\"kbqDropdown\" [class]=\"'kbq-filters__dropdown'\">\n @if (filterBar.isSavedAndChanged && !filterBar.isReadOnly) {\n <button\n kbq-dropdown-item\n [ngClass]=\"{ 'kbq-button_changed-saved-filter': filterBar.isSavedAndChanged }\"\n (click)=\"saveChanges()\"\n >\n <i kbq-icon=\"kbq-floppy-disk_16\"></i>\n {{ localeData.saveChanges }}\n @if (filterBar.isSavedAndChanged) {\n <i class=\"kbq kbq-icon kbq-icon-button kbq-circle-xs_16 kbq-warning layout-margin-left-xs\"></i>\n }\n </button>\n }\n <button kbq-dropdown-item (click)=\"openSaveAsNewFilterPopover()\">\n <i kbq-icon=\"kbq-plus_16\"></i>\n {{ localeData.saveAsNew }}\n </button>\n\n @if (!filterBar.isReadOnly) {\n <button kbq-dropdown-item (click)=\"openChangeFilterNamePopover()\">\n <i kbq-icon=\"kbq-pencil_16\"></i>\n {{ localeData.change }}\n </button>\n }\n\n @if (filterBar.isSavedAndChanged || !filterBar.isReadOnly) {\n <kbq-divider />\n }\n\n @if (filterBar.isSavedAndChanged) {\n <button kbq-dropdown-item (click)=\"resetFilterChanges()\">\n <i kbq-icon=\"kbq-xmark-circle_16\"></i>\n {{ localeData.resetChanges }}\n </button>\n }\n @if (!filterBar.isReadOnly) {\n <button kbq-dropdown-item (click)=\"this.onRemoveFilter.next(this.filter!)\">\n <i kbq-icon=\"kbq-trash_16\"></i>\n {{ localeData.remove }}\n </button>\n }\n</kbq-dropdown>\n\n<ng-template #saveAsNewPopoverHeader>{{ popoverHeader }}</ng-template>\n\n<ng-template #saveAsNewPopoverContent>\n @if (showFilterSavingError) {\n <kbq-alert class=\"layout-margin-bottom-m\" [alertColor]=\"'error'\" [alertStyle]=\"'colored'\" [compact]=\"true\">\n {{ filterSavingErrorText }}\n </kbq-alert>\n }\n <div class=\"kbq-form-vertical\">\n <div class=\"kbq-form__row\">\n <label class=\"kbq-form__label\">{{ localeData.name }}</label>\n\n <kbq-form-field class=\"kbq-form__control\">\n <input #newFilterName kbqInput type=\"text\" [formControl]=\"filterName\" />\n\n @if (filterName.hasError('filterNameAlreadyExist')) {\n <kbq-hint [color]=\"'error'\">{{ localeData.error }}</kbq-hint>\n }\n </kbq-form-field>\n </div>\n </div>\n</ng-template>\n\n<ng-template #saveAsNewPopoverFooter>\n <button kbq-button class=\"layout-margin-right-l\" [color]=\"'contrast'\" [kbqStyle]=\"'filled'\" (click)=\"saveAsNew()\">\n {{ localeData.saveButton }}\n </button>\n <button kbq-button [color]=\"'contrast-fade'\" [kbqStyle]=\"'filled'\" (click)=\"closePopover()\">\n {{ localeData.cancelButton }}\n </button>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-filters{display:flex}.kbq-filters>.kbq-button{max-width:320px}.kbq-filters>.kbq-button .kbq-button-wrapper{width:100%}.kbq-filters>.kbq-button .kbq-icon{margin-right:var(--kbq-size-xxs)}.kbq-filters .kbq-filters__filter-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-filters .kbq-filter-bar__separator{align-self:center;height:var(--kbq-size-m)!important;margin-left:calc(var(--kbq-size-s) + var(--kbq-size-xs))!important;margin-right:var(--kbq-size-xs)!important}.kbq-filters .kbq-filter-bar__arrow{align-self:center;margin-left:var(--kbq-size-s)}.kbq-filters .kbq-button.kbq-button_changed-filter{border-bottom-right-radius:unset;border-top-right-radius:unset}.kbq-filters .kbq-button-icon{margin-left:-1px;border-bottom-left-radius:unset;border-top-left-radius:unset}.kbq-filters .kbq-button_changed-saved-filter:before{content:\"\";position:absolute;right:-4px;top:-4px;width:var(--kbq-size-s);height:var(--kbq-size-s);border:2px solid var(--kbq-background-bg);border-radius:var(--kbq-size-xs);background:var(--kbq-icon-warning)}.kbq-filters .kbq-button:not(:hover,.kbq-active)+.kbq-button_action:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:var(--kbq-size-m);background:var(--kbq-line-contrast-less)}.kbq-filters__save-as-new-filter-popover .kbq-popover__container{width:400px}.kbq-filters__save-as-new-filter-popover .kbq-popover__content{padding:var(--kbq-size-s) var(--kbq-size-xxl)}.kbq-filters__dropdown .kbq-dropdown-item{padding-right:var(--kbq-size-s)}\n"] }]
1201
+ }], ctorParameters: () => [], propDecorators: { button: [{
1316
1202
  type: ViewChild,
1317
- args: ['popover']
1203
+ args: [KbqButton]
1204
+ }], popover: [{
1205
+ type: ViewChild,
1206
+ args: [KbqPopoverTrigger]
1207
+ }], dropdown: [{
1208
+ type: ViewChild,
1209
+ args: [KbqDropdownTrigger]
1210
+ }], search: [{
1211
+ type: ViewChild,
1212
+ args: ['search']
1213
+ }], newFilterName: [{
1214
+ type: ViewChild,
1215
+ args: ['newFilterName']
1216
+ }], filters: [{
1217
+ type: Input
1218
+ }], onSelectFilter: [{
1219
+ type: Output
1220
+ }], onSave: [{
1221
+ type: Output
1222
+ }], onChangeFilter: [{
1223
+ type: Output
1224
+ }], onSaveAsNew: [{
1225
+ type: Output
1226
+ }], onRemoveFilter: [{
1227
+ type: Output
1228
+ }], onResetFilterChanges: [{
1229
+ type: Output
1318
1230
  }] } });
1319
1231
 
1320
- class KbqPipeMultiSelectComponent extends KbqBasePipe {
1321
- constructor() {
1322
- super(...arguments);
1323
- this.searchControl = new UntypedFormControl();
1324
- this.compareByValue = (o1, o2) => o1?.id === o2?.id;
1232
+ class KbqFilterBar {
1233
+ /** Filter that is currently selected */
1234
+ get filter() {
1235
+ return this._filter;
1236
+ }
1237
+ set filter(value) {
1238
+ if (this._filter === value)
1239
+ return;
1240
+ this._filter = value;
1241
+ this.changes.next();
1242
+ }
1243
+ /** An array of templates that are used when adding a pipe. Also contains lists of options to select (values). */
1244
+ set pipeTemplates(value) {
1245
+ this._templates = value;
1246
+ this.internalTemplatesChanges.next(this._templates);
1247
+ }
1248
+ get pipeTemplates() {
1249
+ return this._templates;
1250
+ }
1251
+ /** Whether the current filter is saved and changed */
1252
+ get isSavedAndChanged() {
1253
+ return this.isSaved && this.isChanged;
1254
+ }
1255
+ /** Whether the current filter is saved */
1256
+ get isSaved() {
1257
+ return !!this.filter?.saved;
1325
1258
  }
1326
- get selected() {
1327
- return this.data.value;
1259
+ /** Whether the current filter is changed */
1260
+ get isChanged() {
1261
+ return !!this.filter?.changed;
1328
1262
  }
1329
- get isEmpty() {
1330
- return !this.data.value?.length;
1263
+ /** Whether the current filter is readonly */
1264
+ get isReadOnly() {
1265
+ return !!this.filter?.readonly;
1331
1266
  }
1332
- ngOnInit() {
1333
- this.filteredOptions = merge(of(this.values), this.searchControl.valueChanges.pipe(map((value) => this.getFilteredOptions(value))));
1267
+ /** Whether the current filter is disabled */
1268
+ get isDisabled() {
1269
+ return !!this.filter?.disabled;
1334
1270
  }
1335
- onSelect(item) {
1336
- this.data.value = item;
1337
- this.filterBar?.onChangePipe.emit(this.data);
1338
- this.stateChanges.next();
1271
+ constructor() {
1272
+ /** @docs-private */
1273
+ this.changeDetectorRef = inject(ChangeDetectorRef);
1274
+ /** @docs-private */
1275
+ this.localeService = inject(KBQ_LOCALE_SERVICE, { optional: true });
1276
+ this.externalConfiguration = inject(KBQ_FILTER_BAR_CONFIGURATION, { optional: true });
1277
+ this._templates = [];
1278
+ /**
1279
+ * Event that emits whenever the raw value of the filter changes. This is here primarily
1280
+ * to facilitate the two-way binding for the `filter` input.
1281
+ * @docs-private
1282
+ */
1283
+ this.filterChange = new EventEmitter();
1284
+ /** Event that emits whenever the value of the pipe changes. */
1285
+ this.onChangePipe = new EventEmitter();
1286
+ /** Event that emits whenever the pipe deleted. */
1287
+ this.onRemovePipe = new EventEmitter();
1288
+ this.savedFilter = null;
1289
+ /** all changes */
1290
+ this.changes = new BehaviorSubject(undefined);
1291
+ /** internal filter changes */
1292
+ this.internalFilterChanges = new BehaviorSubject(null);
1293
+ /** internal changes in templates */
1294
+ this.internalTemplatesChanges = new BehaviorSubject(null);
1295
+ /** this subject need for opens pipe after adding
1296
+ * @docs-private */
1297
+ this.openPipe = new BehaviorSubject(null);
1298
+ this.updateLocaleParams = () => {
1299
+ this.configuration = this.externalConfiguration || this.localeService?.getParams('filterBar');
1300
+ this.changeDetectorRef.markForCheck();
1301
+ };
1302
+ this.internalFilterChanges.pipe(takeUntilDestroyed()).subscribe((filter) => {
1303
+ this._filter = filter;
1304
+ this.filterChange.emit(this.filter);
1305
+ });
1306
+ this.localeService?.changes.pipe(takeUntilDestroyed()).subscribe(this.updateLocaleParams);
1307
+ if (!this.localeService) {
1308
+ this.initDefaultParams();
1309
+ }
1310
+ merge(this.onChangePipe, this.onRemovePipe)
1311
+ .pipe(takeUntilDestroyed())
1312
+ .subscribe(() => {
1313
+ if (this.filter) {
1314
+ this.filter.changed = true;
1315
+ }
1316
+ this.filterChange.emit(this.filter);
1317
+ });
1318
+ merge(this.filterChange, this.onChangePipe, this.onRemovePipe, this.internalFilterChanges)
1319
+ .pipe(takeUntilDestroyed())
1320
+ .subscribe(() => {
1321
+ this.changes.next();
1322
+ this.changeDetectorRef.markForCheck();
1323
+ });
1339
1324
  }
1340
- onClear() {
1341
- this.data.value = [];
1342
- this.filterBar?.onChangePipe.emit(this.data);
1343
- this.stateChanges.next();
1325
+ /** Remove pipe from current filter and emit event */
1326
+ removePipe(pipe) {
1327
+ this.filter?.pipes.splice(this.filter?.pipes.indexOf(pipe), 1);
1328
+ this.onRemovePipe.next(pipe);
1329
+ this.changes.next();
1344
1330
  }
1345
- open() {
1346
- this.select.open();
1331
+ /** Save current state of filter */
1332
+ saveFilterState(filter) {
1333
+ this.savedFilter = structuredClone(filter ?? this.filter);
1347
1334
  }
1348
- getFilteredOptions(value) {
1349
- return value
1350
- ? this.values.filter((item) => item.name.toLowerCase().includes(value.toLowerCase()))
1351
- : this.values;
1335
+ /** Restore previously saved filter state */
1336
+ restoreFilterState(filter) {
1337
+ this.filter = structuredClone(filter ?? this.savedFilter);
1352
1338
  }
1353
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeMultiSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1354
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: KbqPipeMultiSelectComponent, isStandalone: true, selector: "kbq-pipe-multi-select", providers: [
1355
- {
1356
- provide: KbqBasePipe,
1357
- useExisting: this
1358
- }
1359
- ], viewQueries: [{ propertyName: "select", first: true, predicate: KbqSelect, descendants: true }], usesInheritance: true, ngImport: i0, template: "<kbq-select\n #select=\"kbqSelect\"\n multiple\n [compareWith]=\"compareByValue\"\n [disabled]=\"data.disabled\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [ngClass]=\"{ 'kbq-active': select.panelOpen }\"\n [panelClass]=\"'kbq-pipe-multiselect__panel'\"\n [tabIndex]=\"-1\"\n [value]=\"selected\"\n (selectionChange)=\"onSelect($event.value)\"\n>\n <button\n kbq-button\n kbq-select-matcher\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [ngClass]=\"{ 'kbq-active': select.panelOpen }\"\n >\n <span #kbqTitleText class=\"kbq-pipe__name\">{{ data.name }}</span>\n @if (select.triggerValues.length === 1) {\n <span #kbqTitleText class=\"kbq-pipe__value\" [class.kbq-pipe__value_empty]=\"!select.triggerValue\">\n {{ select.triggerValue }}\n </span>\n } @else if (select.triggerValues.length > 1) {\n <kbq-badge [badgeColor]=\"'contrast'\" [compact]=\"true\">\n {{ select.triggerValues.length }}\n </kbq-badge>\n }\n </button>\n @if (data.search) {\n <kbq-form-field kbqFormFieldWithoutBorders kbqSelectSearch>\n <i kbq-icon=\"kbq-magnifying-glass_16\" kbqPrefix></i>\n <input kbqInput placeholder=\"Search\" type=\"text\" [formControl]=\"searchControl\" />\n <kbq-cleaner />\n </kbq-form-field>\n }\n\n <div kbq-select-search-empty-result>{{ localeData.pipe.emptySearchResult }}</div>\n\n @for (item of filteredOptions | async; track item) {\n <kbq-option [value]=\"item\">\n @if (isTemplateRef(valueTemplate)) {\n <ng-container\n [ngTemplateOutlet]=\"$any(valueTemplate)\"\n [ngTemplateOutletContext]=\"{ $implicit, option: item }\"\n />\n } @else {\n {{ item.name }}\n }\n </kbq-option>\n }\n</kbq-select>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ select.triggerValue }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n", ".kbq-pipe__multiselect .kbq-pipe__value{margin-left:var(--kbq-size-xxs)}.kbq-pipe__multiselect .kbq-badge{align-self:center;margin-left:var(--kbq-size-xs)}.kbq-pipe-multiselect__panel .kbq-select__content{max-height:404px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "ngmodule", type: KbqDividerModule }, { kind: "ngmodule", type: KbqSelectModule }, { kind: "component", type: i4$1.KbqSelect, selector: "kbq-select", inputs: ["hiddenItemsText", "panelClass", "backdropClass", "errorStateMatcher", "sortComparator", "hasBackdrop", "placeholder", "required", "multiple", "compareWith", "panelWidth", "panelMinWidth", "value", "id", "tabIndex", "disabled", "hiddenItemsTextFormatter"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["kbqSelect"] }, { kind: "directive", type: i4$1.KbqOptionTooltip, selector: "kbq-option" }, { kind: "component", type: i3$2.KbqOption, selector: "kbq-option", inputs: ["value", "userSelect", "showCheckbox", "disabled"], outputs: ["onSelectionChange"], exportAs: ["kbqOption"] }, { kind: "directive", type: i3$2.KbqSelectSearch, selector: "[kbqSelectSearch]", exportAs: ["kbqSelectSearch"] }, { kind: "directive", type: i3$2.KbqSelectMatcher, selector: "kbq-select-matcher, [kbq-select-matcher]" }, { kind: "directive", type: i3$2.KbqSelectSearchEmptyResult, selector: "[kbq-select-search-empty-result]", exportAs: ["kbqSelectSearchEmptyResult"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: KbqPipeState, selector: "[kbqPipeState]", inputs: ["kbqPipeState"] }, { kind: "ngmodule", type: KbqBadgeModule }, { kind: "component", type: i5$2.KbqBadge, selector: "kbq-badge", inputs: ["compact", "outline", "badgeColor"] }, { kind: "directive", type: i5$2.KbqBadgeCssStyler, selector: "kbq-badge" }, { kind: "component", type: KbqPipeButton, selector: "kbq-pipe-button" }, { kind: "ngmodule", type: KbqTitleModule }, { kind: "directive", type: KbqPipeTitleDirective, selector: "[kbqPipeTitle]", inputs: ["kbqPipeTitle"], exportAs: ["kbqPipeTitle"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: KbqFormFieldModule }, { kind: "component", type: i6.KbqFormField, selector: "kbq-form-field", exportAs: ["kbqFormField"] }, { kind: "directive", type: i6.KbqFormFieldWithoutBorders, selector: "kbq-form-field[kbqFormFieldWithoutBorders]", exportAs: ["kbqFormFieldWithoutBorders"] }, { kind: "directive", type: i6.KbqPrefix, selector: "[kbqPrefix]" }, { kind: "component", type: i6.KbqCleaner, selector: "kbq-cleaner", exportAs: ["kbqCleaner"] }, { kind: "directive", type: i6.KbqValidateDirective, selector: " input[kbqInput], input[kbqNumberInput], input[kbqInputPassword], input[kbqTimepicker], input[kbqDatepicker], textarea[kbqTextarea], kbq-select, kbq-tree-select, kbq-tag-list ", exportAs: ["KbqValidate"] }, { kind: "directive", type: i6.KbqTrim, selector: "[kbqInput], [kbqTextarea]", exportAs: ["KbqTrim"] }, { kind: "component", type: KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "ngmodule", type: KbqInputModule }, { kind: "directive", type: i3$1.KbqInput, selector: "input[kbqInput],input[kbqNumberInput]", inputs: ["errorStateMatcher", "placeholder", "disabled", "id", "required", "type", "value"], exportAs: ["kbqInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1339
+ /** Set the filter state "changed" to false */
1340
+ resetFilterChangedState() {
1341
+ this.filter.changed = false;
1342
+ }
1343
+ initDefaultParams() {
1344
+ this.configuration = KBQ_FILTER_BAR_DEFAULT_CONFIGURATION;
1345
+ }
1346
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1347
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: KbqFilterBar, isStandalone: true, selector: "kbq-filter-bar, [kbq-filter-bar]", inputs: { filter: "filter", pipeTemplates: "pipeTemplates" }, outputs: { filterChange: "filterChange", onChangePipe: "onChangePipe", onRemovePipe: "onRemovePipe" }, host: { classAttribute: "kbq-filter-bar" }, queries: [{ propertyName: "filters", first: true, predicate: KbqFilters, descendants: true }, { propertyName: "filterReset", first: true, predicate: KbqFilterReset, descendants: true }], ngImport: i0, template: `
1348
+ <div class="kbq-filter-bar__left">
1349
+ <ng-content select="kbq-filters" />
1350
+
1351
+ <ng-content />
1352
+
1353
+ <ng-content select="kbq-pipe-add" />
1354
+
1355
+ <ng-content select="kbq-filter-reset" />
1356
+ </div>
1357
+
1358
+ <div class="kbq-filter-bar__right">
1359
+ <ng-content select="kbq-filter-search, [kbq-filter-search]" />
1360
+
1361
+ <ng-content select="kbq-filter-refresher, [kbq-filter-refresher]" />
1362
+ </div>
1363
+ `, isInline: true, styles: [".kbq-filter-bar{display:flex;flex-direction:row;justify-content:space-between;width:100%}.kbq-filter-bar .kbq-filter-bar__left{display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--kbq-size-s)}.kbq-filter-bar .kbq-filter-bar__left .kbq-button>.kbq-icon{margin-right:var(--kbq-size-xxs)}.kbq-filter-bar .kbq-filter-bar__left>.kbq-icon{align-self:center}.kbq-filter-bar .kbq-filter-bar__right{display:flex;flex-direction:row;margin-left:var(--kbq-size-3xl)}.kbq-pipe__popover .kbq-popover__container{min-width:320px;max-width:320px}.kbq-pipe__popover .kbq-popover__content{padding:var(--kbq-size-m) var(--kbq-size-m) 1px!important}.kbq-pipe__popover .kbq-popover__footer{padding:var(--kbq-size-xxs)}.kbq-pipe__popover .kbq-popover__footer .kbq-button:not(.kbq-disabled){display:flex;flex-direction:row;width:100%;justify-content:flex-start}.kbq-pipe__popover .kbq-popover__footer .kbq-button:not(.kbq-disabled) .kbq-button_hot-key{color:var(--kbq-foreground-contrast-secondary)}.kbq-button-overlay{display:none}.kbq-button,.kbq-button-icon{-webkit-font-smoothing:antialiased}.kbq-button.kbq-button_changed-filter,.kbq-button-icon.kbq-button_changed-filter{color:var(--kbq-foreground-theme);background:var(--kbq-states-background-theme-less-active)}.kbq-button.kbq-button_changed-filter .kbq-icon,.kbq-button-icon.kbq-button_changed-filter .kbq-icon,.kbq-button.kbq-button_changed-filter .kbq-icon.kbq-icon_left,.kbq-button-icon.kbq-button_changed-filter .kbq-icon.kbq-icon_left,.kbq-button.kbq-button_changed-filter .kbq-icon.kbq-icon_right,.kbq-button-icon.kbq-button_changed-filter .kbq-icon.kbq-icon_right{color:var(--kbq-icon-theme)}.kbq-button.kbq-button_changed-filter:hover:not(.kbq-disabled),.kbq-button.kbq-button_changed-filter.kbq-hover:not(.kbq-disabled),.kbq-button-icon.kbq-button_changed-filter:hover:not(.kbq-disabled),.kbq-button-icon.kbq-button_changed-filter.kbq-hover:not(.kbq-disabled){background:var(--kbq-states-background-theme-less-hover)}.kbq-button.kbq-button_changed-filter:active:not(.kbq-disabled),.kbq-button.kbq-button_changed-filter.kbq-active:not(.kbq-disabled),.kbq-button-icon.kbq-button_changed-filter:active:not(.kbq-disabled),.kbq-button-icon.kbq-button_changed-filter.kbq-active:not(.kbq-disabled){background:var(--kbq-states-background-theme-fade-active)}.kbq-button.kbq-button_changed-filter.cdk-keyboard-focused,.kbq-button-icon.kbq-button_changed-filter.cdk-keyboard-focused{outline:1px solid var(--kbq-states-line-focus-theme);border-color:var(--kbq-states-line-focus-theme)}.kbq-button.kbq-button_changed-filter.kbq-disabled,.kbq-button-icon.kbq-button_changed-filter.kbq-disabled{color:var(--kbq-states-foreground-disable);background:var(--kbq-states-background-disable)}.kbq-button.kbq-button_changed-filter.kbq-disabled .kbq-icon,.kbq-button-icon.kbq-button_changed-filter.kbq-disabled .kbq-icon,.kbq-button.kbq-button_changed-filter.kbq-disabled .kbq-icon.kbq-icon_left,.kbq-button-icon.kbq-button_changed-filter.kbq-disabled .kbq-icon.kbq-icon_left,.kbq-button.kbq-button_changed-filter.kbq-disabled .kbq-icon.kbq-icon_right,.kbq-button-icon.kbq-button_changed-filter.kbq-disabled .kbq-icon.kbq-icon_right{color:var(--kbq-states-icon-disabled)}.kbq-hint.kbq-date-period__hint .kbq-hint__text{font-size:var(--kbq-typography-text-compact-font-size);font-weight:var(--kbq-typography-text-compact-font-weight);line-height:var(--kbq-typography-text-compact-line-height);font-family:var(--kbq-typography-text-compact-font-family);text-transform:var(--kbq-typography-text-compact-text-transform);font-feature-settings:var(--kbq-typography-text-compact-font-feature-settings);letter-spacing:var(--kbq-typography-text-compact-letter-spacing)}\n"], dependencies: [{ kind: "ngmodule", type: KbqDividerModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1360
1364
  }
1361
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeMultiSelectComponent, decorators: [{
1365
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBar, decorators: [{
1362
1366
  type: Component,
1363
- args: [{ standalone: true, selector: 'kbq-pipe-multi-select', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
1364
- {
1365
- provide: KbqBasePipe,
1366
- useExisting: this
1367
- }
1368
- ], imports: [
1369
- FormsModule,
1370
- KbqButtonModule,
1371
- KbqDividerModule,
1372
- KbqSelectModule,
1373
- NgClass,
1374
- KbqPipeState,
1375
- KbqBadgeModule,
1376
- KbqPipeButton,
1377
- KbqTitleModule,
1378
- KbqPipeTitleDirective,
1379
- NgTemplateOutlet,
1380
- KbqFormFieldModule,
1381
- KbqIcon,
1382
- KbqInputModule,
1383
- ReactiveFormsModule,
1384
- AsyncPipe
1385
- ], template: "<kbq-select\n #select=\"kbqSelect\"\n multiple\n [compareWith]=\"compareByValue\"\n [disabled]=\"data.disabled\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [ngClass]=\"{ 'kbq-active': select.panelOpen }\"\n [panelClass]=\"'kbq-pipe-multiselect__panel'\"\n [tabIndex]=\"-1\"\n [value]=\"selected\"\n (selectionChange)=\"onSelect($event.value)\"\n>\n <button\n kbq-button\n kbq-select-matcher\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [ngClass]=\"{ 'kbq-active': select.panelOpen }\"\n >\n <span #kbqTitleText class=\"kbq-pipe__name\">{{ data.name }}</span>\n @if (select.triggerValues.length === 1) {\n <span #kbqTitleText class=\"kbq-pipe__value\" [class.kbq-pipe__value_empty]=\"!select.triggerValue\">\n {{ select.triggerValue }}\n </span>\n } @else if (select.triggerValues.length > 1) {\n <kbq-badge [badgeColor]=\"'contrast'\" [compact]=\"true\">\n {{ select.triggerValues.length }}\n </kbq-badge>\n }\n </button>\n @if (data.search) {\n <kbq-form-field kbqFormFieldWithoutBorders kbqSelectSearch>\n <i kbq-icon=\"kbq-magnifying-glass_16\" kbqPrefix></i>\n <input kbqInput placeholder=\"Search\" type=\"text\" [formControl]=\"searchControl\" />\n <kbq-cleaner />\n </kbq-form-field>\n }\n\n <div kbq-select-search-empty-result>{{ localeData.pipe.emptySearchResult }}</div>\n\n @for (item of filteredOptions | async; track item) {\n <kbq-option [value]=\"item\">\n @if (isTemplateRef(valueTemplate)) {\n <ng-container\n [ngTemplateOutlet]=\"$any(valueTemplate)\"\n [ngTemplateOutletContext]=\"{ $implicit, option: item }\"\n />\n } @else {\n {{ item.name }}\n }\n </kbq-option>\n }\n</kbq-select>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ select.triggerValue }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n", ".kbq-pipe__multiselect .kbq-pipe__value{margin-left:var(--kbq-size-xxs)}.kbq-pipe__multiselect .kbq-badge{align-self:center;margin-left:var(--kbq-size-xs)}.kbq-pipe-multiselect__panel .kbq-select__content{max-height:404px}\n"] }]
1386
- }], propDecorators: { select: [{
1387
- type: ViewChild,
1388
- args: [KbqSelect]
1367
+ args: [{ standalone: true, selector: 'kbq-filter-bar, [kbq-filter-bar]', template: `
1368
+ <div class="kbq-filter-bar__left">
1369
+ <ng-content select="kbq-filters" />
1370
+
1371
+ <ng-content />
1372
+
1373
+ <ng-content select="kbq-pipe-add" />
1374
+
1375
+ <ng-content select="kbq-filter-reset" />
1376
+ </div>
1377
+
1378
+ <div class="kbq-filter-bar__right">
1379
+ <ng-content select="kbq-filter-search, [kbq-filter-search]" />
1380
+
1381
+ <ng-content select="kbq-filter-refresher, [kbq-filter-refresher]" />
1382
+ </div>
1383
+ `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [KbqDividerModule], host: {
1384
+ class: 'kbq-filter-bar'
1385
+ }, styles: [".kbq-filter-bar{display:flex;flex-direction:row;justify-content:space-between;width:100%}.kbq-filter-bar .kbq-filter-bar__left{display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--kbq-size-s)}.kbq-filter-bar .kbq-filter-bar__left .kbq-button>.kbq-icon{margin-right:var(--kbq-size-xxs)}.kbq-filter-bar .kbq-filter-bar__left>.kbq-icon{align-self:center}.kbq-filter-bar .kbq-filter-bar__right{display:flex;flex-direction:row;margin-left:var(--kbq-size-3xl)}.kbq-pipe__popover .kbq-popover__container{min-width:320px;max-width:320px}.kbq-pipe__popover .kbq-popover__content{padding:var(--kbq-size-m) var(--kbq-size-m) 1px!important}.kbq-pipe__popover .kbq-popover__footer{padding:var(--kbq-size-xxs)}.kbq-pipe__popover .kbq-popover__footer .kbq-button:not(.kbq-disabled){display:flex;flex-direction:row;width:100%;justify-content:flex-start}.kbq-pipe__popover .kbq-popover__footer .kbq-button:not(.kbq-disabled) .kbq-button_hot-key{color:var(--kbq-foreground-contrast-secondary)}.kbq-button-overlay{display:none}.kbq-button,.kbq-button-icon{-webkit-font-smoothing:antialiased}.kbq-button.kbq-button_changed-filter,.kbq-button-icon.kbq-button_changed-filter{color:var(--kbq-foreground-theme);background:var(--kbq-states-background-theme-less-active)}.kbq-button.kbq-button_changed-filter .kbq-icon,.kbq-button-icon.kbq-button_changed-filter .kbq-icon,.kbq-button.kbq-button_changed-filter .kbq-icon.kbq-icon_left,.kbq-button-icon.kbq-button_changed-filter .kbq-icon.kbq-icon_left,.kbq-button.kbq-button_changed-filter .kbq-icon.kbq-icon_right,.kbq-button-icon.kbq-button_changed-filter .kbq-icon.kbq-icon_right{color:var(--kbq-icon-theme)}.kbq-button.kbq-button_changed-filter:hover:not(.kbq-disabled),.kbq-button.kbq-button_changed-filter.kbq-hover:not(.kbq-disabled),.kbq-button-icon.kbq-button_changed-filter:hover:not(.kbq-disabled),.kbq-button-icon.kbq-button_changed-filter.kbq-hover:not(.kbq-disabled){background:var(--kbq-states-background-theme-less-hover)}.kbq-button.kbq-button_changed-filter:active:not(.kbq-disabled),.kbq-button.kbq-button_changed-filter.kbq-active:not(.kbq-disabled),.kbq-button-icon.kbq-button_changed-filter:active:not(.kbq-disabled),.kbq-button-icon.kbq-button_changed-filter.kbq-active:not(.kbq-disabled){background:var(--kbq-states-background-theme-fade-active)}.kbq-button.kbq-button_changed-filter.cdk-keyboard-focused,.kbq-button-icon.kbq-button_changed-filter.cdk-keyboard-focused{outline:1px solid var(--kbq-states-line-focus-theme);border-color:var(--kbq-states-line-focus-theme)}.kbq-button.kbq-button_changed-filter.kbq-disabled,.kbq-button-icon.kbq-button_changed-filter.kbq-disabled{color:var(--kbq-states-foreground-disable);background:var(--kbq-states-background-disable)}.kbq-button.kbq-button_changed-filter.kbq-disabled .kbq-icon,.kbq-button-icon.kbq-button_changed-filter.kbq-disabled .kbq-icon,.kbq-button.kbq-button_changed-filter.kbq-disabled .kbq-icon.kbq-icon_left,.kbq-button-icon.kbq-button_changed-filter.kbq-disabled .kbq-icon.kbq-icon_left,.kbq-button.kbq-button_changed-filter.kbq-disabled .kbq-icon.kbq-icon_right,.kbq-button-icon.kbq-button_changed-filter.kbq-disabled .kbq-icon.kbq-icon_right{color:var(--kbq-states-icon-disabled)}.kbq-hint.kbq-date-period__hint .kbq-hint__text{font-size:var(--kbq-typography-text-compact-font-size);font-weight:var(--kbq-typography-text-compact-font-weight);line-height:var(--kbq-typography-text-compact-line-height);font-family:var(--kbq-typography-text-compact-font-family);text-transform:var(--kbq-typography-text-compact-text-transform);font-feature-settings:var(--kbq-typography-text-compact-font-feature-settings);letter-spacing:var(--kbq-typography-text-compact-letter-spacing)}\n"] }]
1386
+ }], ctorParameters: () => [], propDecorators: { filters: [{
1387
+ type: ContentChild,
1388
+ args: [KbqFilters]
1389
+ }], filterReset: [{
1390
+ type: ContentChild,
1391
+ args: [KbqFilterReset]
1392
+ }], filter: [{
1393
+ type: Input
1394
+ }], pipeTemplates: [{
1395
+ type: Input
1396
+ }], filterChange: [{
1397
+ type: Output
1398
+ }], onChangePipe: [{
1399
+ type: Output
1400
+ }], onRemovePipe: [{
1401
+ type: Output
1389
1402
  }] } });
1390
1403
 
1391
- class KbqPipeSelectComponent extends KbqBasePipe {
1404
+ class KbqFilterBarRefresher {
1405
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBarRefresher, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1406
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: KbqFilterBarRefresher, isStandalone: true, selector: "kbq-filter-refresher, [kbq-filter-refresher]", host: { classAttribute: "kbq-filter-refresher" }, ngImport: i0, template: `
1407
+ <button [color]="'contrast'" [kbqStyle]="'transparent'" kbq-button>
1408
+ <i kbq-icon="kbq-arrow-rotate-right_16"></i>
1409
+ </button>
1410
+ <button [color]="'contrast'" [kbqStyle]="'transparent'" kbq-button>
1411
+ <i kbq-icon="kbq-chevron-down_16"></i>
1412
+ </button>
1413
+ `, isInline: true, styles: [".kbq-filter-refresher{display:flex;align-items:center;min-width:64px}\n"], dependencies: [{ kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "ngmodule", type: KbqIconModule }, { kind: "component", type: i2.KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1414
+ }
1415
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBarRefresher, decorators: [{
1416
+ type: Component,
1417
+ args: [{ standalone: true, selector: 'kbq-filter-refresher, [kbq-filter-refresher]', template: `
1418
+ <button [color]="'contrast'" [kbqStyle]="'transparent'" kbq-button>
1419
+ <i kbq-icon="kbq-arrow-rotate-right_16"></i>
1420
+ </button>
1421
+ <button [color]="'contrast'" [kbqStyle]="'transparent'" kbq-button>
1422
+ <i kbq-icon="kbq-chevron-down_16"></i>
1423
+ </button>
1424
+ `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
1425
+ KbqButtonModule,
1426
+ KbqIconModule
1427
+ ], host: {
1428
+ class: 'kbq-filter-refresher'
1429
+ }, styles: [".kbq-filter-refresher{display:flex;align-items:center;min-width:64px}\n"] }]
1430
+ }] });
1431
+
1432
+ class KbqFilterBarSearch {
1433
+ /** localized data
1434
+ * @docs-private */
1435
+ get localeData() {
1436
+ return this.filterBar.configuration.search;
1437
+ }
1392
1438
  constructor() {
1393
- super(...arguments);
1439
+ /** KbqFilterBar instance */
1440
+ this.filterBar = inject(KbqFilterBar);
1441
+ this.changeDetectorRef = inject(ChangeDetectorRef);
1442
+ /** control for search */
1394
1443
  this.searchControl = new UntypedFormControl();
1395
- this.compareByValue = (o1, o2) => o1 && o2 && o1.id === o2.id;
1396
- }
1397
- get selected() {
1398
- return this.data.value;
1399
- }
1400
- get isEmpty() {
1401
- return !this.data.value;
1444
+ /** Whether the search active */
1445
+ this.isSearchActive = false;
1446
+ /** event that is generated whenever a user performs a search. */
1447
+ this.onSearch = new EventEmitter();
1448
+ /** @docs-private */
1449
+ this.onReset = () => {
1450
+ this.changeDetectorRef.markForCheck();
1451
+ };
1452
+ this.searchControl.valueChanges.subscribe(this.onSearch);
1453
+ this.filterBar.filterReset?.onResetFilter.pipe(takeUntilDestroyed()).subscribe(this.onReset);
1402
1454
  }
1403
- ngOnInit() {
1404
- this.filteredOptions = merge(of(this.values), this.searchControl.valueChanges.pipe(map((value) => this.getFilteredOptions(value))));
1455
+ openSearch() {
1456
+ this.isSearchActive = true;
1457
+ setTimeout(() => this.input.focus());
1405
1458
  }
1406
- onSelect(item) {
1407
- this.data.value = item;
1408
- this.filterBar?.onChangePipe.emit(this.data);
1409
- this.stateChanges.next();
1459
+ /** @docs-private */
1460
+ onBlur() {
1461
+ if (this.searchControl.value)
1462
+ return;
1463
+ this.onEscape();
1410
1464
  }
1411
- open() {
1412
- this.select.open();
1465
+ /** @docs-private */
1466
+ onEscape() {
1467
+ this.isSearchActive = false;
1468
+ this.button.focusViaKeyboard();
1469
+ this.tooltip.hide();
1413
1470
  }
1414
- getFilteredOptions(value) {
1415
- return value
1416
- ? this.values.filter((item) => item.name.toLowerCase().includes(value.toLowerCase()))
1417
- : this.values;
1471
+ /** @docs-private */
1472
+ onClear() {
1473
+ this.isSearchActive = false;
1474
+ setTimeout(() => {
1475
+ this.button.focus();
1476
+ this.tooltip.hide();
1477
+ });
1418
1478
  }
1419
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1420
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: KbqPipeSelectComponent, isStandalone: true, selector: "kbq-pipe-select", providers: [
1421
- {
1422
- provide: KbqBasePipe,
1423
- useExisting: this
1424
- }
1425
- ], viewQueries: [{ propertyName: "select", first: true, predicate: KbqSelect, descendants: true }], usesInheritance: true, ngImport: i0, template: "<kbq-select\n #select\n [compareWith]=\"compareByValue\"\n [disabled]=\"data.disabled\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [ngClass]=\"{ 'kbq-active': select.panelOpen }\"\n [panelClass]=\"'kbq-pipe-select__panel'\"\n [tabIndex]=\"-1\"\n [value]=\"selected\"\n (selectionChange)=\"onSelect($event.value)\"\n>\n <button\n kbq-button\n kbq-select-matcher\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [ngClass]=\"{ 'kbq-active': select.panelOpen }\"\n >\n <span #kbqTitleText kbqPipeMinWidth class=\"kbq-pipe__name\">{{ data.name }}</span>\n <span\n #kbqTitleText\n kbqPipeMinWidth\n class=\"kbq-pipe__value\"\n [class.kbq-pipe__value_empty]=\"!select.triggerValue\"\n >\n {{ select.triggerValue }}\n </span>\n </button>\n\n @if (data.search) {\n <kbq-form-field kbqFormFieldWithoutBorders kbqSelectSearch>\n <i kbq-icon=\"kbq-magnifying-glass_16\" kbqPrefix></i>\n <input kbqInput placeholder=\"Search\" type=\"text\" [formControl]=\"searchControl\" />\n <kbq-cleaner />\n </kbq-form-field>\n }\n\n <div kbq-select-search-empty-result>{{ localeData.pipe.emptySearchResult }}</div>\n\n @for (item of filteredOptions | async; track item) {\n <kbq-option [value]=\"item\">\n @if (isTemplateRef(valueTemplate)) {\n <ng-container\n [ngTemplateOutlet]=\"$any(valueTemplate)\"\n [ngTemplateOutletContext]=\"{ $implicit, option: item }\"\n />\n } @else {\n {{ item.name }}\n }\n </kbq-option>\n }\n</kbq-select>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ select.triggerValue }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n", ".kbq-pipe-select__panel .kbq-select__content{max-height:404px}\n"], dependencies: [{ kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "ngmodule", type: KbqDividerModule }, { kind: "ngmodule", type: KbqSelectModule }, { kind: "component", type: i4$1.KbqSelect, selector: "kbq-select", inputs: ["hiddenItemsText", "panelClass", "backdropClass", "errorStateMatcher", "sortComparator", "hasBackdrop", "placeholder", "required", "multiple", "compareWith", "panelWidth", "panelMinWidth", "value", "id", "tabIndex", "disabled", "hiddenItemsTextFormatter"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["kbqSelect"] }, { kind: "directive", type: i4$1.KbqOptionTooltip, selector: "kbq-option" }, { kind: "component", type: i3$2.KbqOption, selector: "kbq-option", inputs: ["value", "userSelect", "showCheckbox", "disabled"], outputs: ["onSelectionChange"], exportAs: ["kbqOption"] }, { kind: "directive", type: i3$2.KbqSelectSearch, selector: "[kbqSelectSearch]", exportAs: ["kbqSelectSearch"] }, { kind: "directive", type: i3$2.KbqSelectMatcher, selector: "kbq-select-matcher, [kbq-select-matcher]" }, { kind: "directive", type: i3$2.KbqSelectSearchEmptyResult, selector: "[kbq-select-search-empty-result]", exportAs: ["kbqSelectSearchEmptyResult"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: KbqPipeState, selector: "[kbqPipeState]", inputs: ["kbqPipeState"] }, { kind: "component", type: KbqPipeButton, selector: "kbq-pipe-button" }, { kind: "ngmodule", type: KbqTitleModule }, { kind: "directive", type: KbqPipeTitleDirective, selector: "[kbqPipeTitle]", inputs: ["kbqPipeTitle"], exportAs: ["kbqPipeTitle"] }, { kind: "directive", type: KbqPipeMinWidth, selector: "[kbqPipeMinWidth]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: KbqFormFieldModule }, { kind: "component", type: i6.KbqFormField, selector: "kbq-form-field", exportAs: ["kbqFormField"] }, { kind: "directive", type: i6.KbqFormFieldWithoutBorders, selector: "kbq-form-field[kbqFormFieldWithoutBorders]", exportAs: ["kbqFormFieldWithoutBorders"] }, { kind: "directive", type: i6.KbqPrefix, selector: "[kbqPrefix]" }, { kind: "component", type: i6.KbqCleaner, selector: "kbq-cleaner", exportAs: ["kbqCleaner"] }, { kind: "directive", type: i6.KbqValidateDirective, selector: " input[kbqInput], input[kbqNumberInput], input[kbqInputPassword], input[kbqTimepicker], input[kbqDatepicker], textarea[kbqTextarea], kbq-select, kbq-tree-select, kbq-tag-list ", exportAs: ["KbqValidate"] }, { kind: "directive", type: i6.KbqTrim, selector: "[kbqInput], [kbqTextarea]", exportAs: ["KbqTrim"] }, { kind: "component", type: KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "ngmodule", type: KbqInputModule }, { kind: "directive", type: i3$1.KbqInput, selector: "input[kbqInput],input[kbqNumberInput]", inputs: ["errorStateMatcher", "placeholder", "disabled", "id", "required", "type", "value"], exportAs: ["kbqInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1479
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBarSearch, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1480
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: KbqFilterBarSearch, isStandalone: true, selector: "kbq-filter-search, [kbq-filter-search]", outputs: { onSearch: "onSearch" }, host: { classAttribute: "kbq-filter-search" }, viewQueries: [{ propertyName: "input", first: true, predicate: KbqInput, descendants: true }, { propertyName: "button", first: true, predicate: KbqButton, descendants: true }, { propertyName: "tooltip", first: true, predicate: KbqTooltipTrigger, descendants: true }], ngImport: i0, template: `
1481
+ <button
1482
+ [class.kbq-filter_hidden]="isSearchActive"
1483
+ [color]="'contrast'"
1484
+ [kbqStyle]="'transparent'"
1485
+ (click)="openSearch()"
1486
+ kbq-button
1487
+ kbqTooltip="{{ localeData.tooltip }}"
1488
+ >
1489
+ <i kbq-icon="kbq-magnifying-glass_16"></i>
1490
+ </button>
1491
+
1492
+ <kbq-form-field [class.kbq-filter_hidden]="!isSearchActive">
1493
+ <i kbq-icon="kbq-magnifying-glass_16" kbqPrefix></i>
1494
+
1495
+ <input
1496
+ [formControl]="searchControl"
1497
+ (blur)="onBlur()"
1498
+ (keydown.escape)="onEscape()"
1499
+ autocomplete="off"
1500
+ kbqInput
1501
+ placeholder="{{ localeData.placeholder }}"
1502
+ />
1503
+
1504
+ <kbq-cleaner (click)="onClear()" />
1505
+ </kbq-form-field>
1506
+ `, isInline: true, styles: [".kbq-filter-search{display:flex;align-items:start;max-width:260px}.kbq-filter-search .kbq-input{width:260px}.kbq-filter-search .kbq-filter_hidden{display:none}\n"], dependencies: [{ kind: "ngmodule", type: KbqDividerModule }, { kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "ngmodule", type: KbqToolTipModule }, { kind: "directive", type: i2$1.KbqTooltipTrigger, selector: "[kbqTooltip]", inputs: ["kbqVisible", "kbqPlacement", "kbqRelativeToPointer", "kbqPlacementPriority", "kbqTooltip", "kbqTooltipDisabled", "kbqEnterDelay", "kbqLeaveDelay", "kbqTrigger", "kbqTooltipClass", "kbqTooltipContext", "kbqTooltipColor", "kbqTooltipArrow", "kbqTooltipOffset"], outputs: ["kbqPlacementChange", "kbqVisibleChange"], exportAs: ["kbqTooltip"] }, { kind: "ngmodule", type: KbqIconModule }, { kind: "component", type: i2.KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "ngmodule", type: KbqFormFieldModule }, { kind: "component", type: i6.KbqFormField, selector: "kbq-form-field", exportAs: ["kbqFormField"] }, { kind: "directive", type: i6.KbqPrefix, selector: "[kbqPrefix]" }, { kind: "component", type: i6.KbqCleaner, selector: "kbq-cleaner", exportAs: ["kbqCleaner"] }, { kind: "directive", type: i6.KbqValidateDirective, selector: " input[kbqInput], input[kbqNumberInput], input[kbqInputPassword], input[kbqTimepicker], input[kbqDatepicker], textarea[kbqTextarea], kbq-select, kbq-tree-select, kbq-tag-list ", exportAs: ["KbqValidate"] }, { kind: "directive", type: i6.KbqTrim, selector: "[kbqInput], [kbqTextarea]", exportAs: ["KbqTrim"] }, { kind: "ngmodule", type: KbqInputModule }, { kind: "directive", type: i3.KbqInput, selector: "input[kbqInput],input[kbqNumberInput]", inputs: ["errorStateMatcher", "placeholder", "disabled", "id", "required", "type", "value"], exportAs: ["kbqInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1426
1507
  }
1427
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeSelectComponent, decorators: [{
1508
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBarSearch, decorators: [{
1428
1509
  type: Component,
1429
- args: [{ standalone: true, selector: 'kbq-pipe-select', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
1430
- {
1431
- provide: KbqBasePipe,
1432
- useExisting: this
1433
- }
1434
- ], imports: [
1435
- KbqButtonModule,
1510
+ args: [{ standalone: true, selector: 'kbq-filter-search, [kbq-filter-search]', template: `
1511
+ <button
1512
+ [class.kbq-filter_hidden]="isSearchActive"
1513
+ [color]="'contrast'"
1514
+ [kbqStyle]="'transparent'"
1515
+ (click)="openSearch()"
1516
+ kbq-button
1517
+ kbqTooltip="{{ localeData.tooltip }}"
1518
+ >
1519
+ <i kbq-icon="kbq-magnifying-glass_16"></i>
1520
+ </button>
1521
+
1522
+ <kbq-form-field [class.kbq-filter_hidden]="!isSearchActive">
1523
+ <i kbq-icon="kbq-magnifying-glass_16" kbqPrefix></i>
1524
+
1525
+ <input
1526
+ [formControl]="searchControl"
1527
+ (blur)="onBlur()"
1528
+ (keydown.escape)="onEscape()"
1529
+ autocomplete="off"
1530
+ kbqInput
1531
+ placeholder="{{ localeData.placeholder }}"
1532
+ />
1533
+
1534
+ <kbq-cleaner (click)="onClear()" />
1535
+ </kbq-form-field>
1536
+ `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
1436
1537
  KbqDividerModule,
1437
- KbqSelectModule,
1438
- NgClass,
1439
- KbqPipeState,
1440
- KbqPipeButton,
1441
- KbqTitleModule,
1442
- KbqPipeTitleDirective,
1443
- KbqPipeMinWidth,
1444
- NgTemplateOutlet,
1538
+ KbqButtonModule,
1539
+ KbqToolTipModule,
1540
+ KbqIconModule,
1445
1541
  KbqFormFieldModule,
1446
- KbqIcon,
1447
1542
  KbqInputModule,
1448
- ReactiveFormsModule,
1449
- AsyncPipe
1450
- ], template: "<kbq-select\n #select\n [compareWith]=\"compareByValue\"\n [disabled]=\"data.disabled\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [ngClass]=\"{ 'kbq-active': select.panelOpen }\"\n [panelClass]=\"'kbq-pipe-select__panel'\"\n [tabIndex]=\"-1\"\n [value]=\"selected\"\n (selectionChange)=\"onSelect($event.value)\"\n>\n <button\n kbq-button\n kbq-select-matcher\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [ngClass]=\"{ 'kbq-active': select.panelOpen }\"\n >\n <span #kbqTitleText kbqPipeMinWidth class=\"kbq-pipe__name\">{{ data.name }}</span>\n <span\n #kbqTitleText\n kbqPipeMinWidth\n class=\"kbq-pipe__value\"\n [class.kbq-pipe__value_empty]=\"!select.triggerValue\"\n >\n {{ select.triggerValue }}\n </span>\n </button>\n\n @if (data.search) {\n <kbq-form-field kbqFormFieldWithoutBorders kbqSelectSearch>\n <i kbq-icon=\"kbq-magnifying-glass_16\" kbqPrefix></i>\n <input kbqInput placeholder=\"Search\" type=\"text\" [formControl]=\"searchControl\" />\n <kbq-cleaner />\n </kbq-form-field>\n }\n\n <div kbq-select-search-empty-result>{{ localeData.pipe.emptySearchResult }}</div>\n\n @for (item of filteredOptions | async; track item) {\n <kbq-option [value]=\"item\">\n @if (isTemplateRef(valueTemplate)) {\n <ng-container\n [ngTemplateOutlet]=\"$any(valueTemplate)\"\n [ngTemplateOutletContext]=\"{ $implicit, option: item }\"\n />\n } @else {\n {{ item.name }}\n }\n </kbq-option>\n }\n</kbq-select>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ select.triggerValue }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n", ".kbq-pipe-select__panel .kbq-select__content{max-height:404px}\n"] }]
1451
- }], propDecorators: { select: [{
1543
+ ReactiveFormsModule
1544
+ ], host: {
1545
+ class: 'kbq-filter-search'
1546
+ }, styles: [".kbq-filter-search{display:flex;align-items:start;max-width:260px}.kbq-filter-search .kbq-input{width:260px}.kbq-filter-search .kbq-filter_hidden{display:none}\n"] }]
1547
+ }], ctorParameters: () => [], propDecorators: { input: [{
1452
1548
  type: ViewChild,
1453
- args: [KbqSelect]
1549
+ args: [KbqInput]
1550
+ }], button: [{
1551
+ type: ViewChild,
1552
+ args: [KbqButton]
1553
+ }], tooltip: [{
1554
+ type: ViewChild,
1555
+ args: [KbqTooltipTrigger]
1556
+ }], onSearch: [{
1557
+ type: Output
1454
1558
  }] } });
1455
1559
 
1456
- class KbqPipeTextComponent extends KbqBasePipe {
1560
+ class KbqPipeAdd {
1457
1561
  constructor() {
1458
- super(...arguments);
1459
- this.placements = PopUpPlacements;
1460
- this.control = new FormControl('');
1461
- }
1462
- get disabled() {
1463
- return !this.control.value;
1464
- }
1465
- ngOnInit() {
1466
- this.control.setValue(this.data.value);
1467
- }
1468
- ngAfterViewInit() {
1469
- super.ngAfterViewInit();
1470
- this.popover.visibleChange.subscribe(() => this.stateChanges.next());
1471
- }
1472
- onApply() {
1473
- this.data.value = this.control.value;
1474
- this.stateChanges.next();
1475
- this.control.markAsPristine();
1476
- this.popover.hide();
1477
- this.filterBar?.onChangePipe.next(this.data);
1562
+ /** KbqFilterBar instance */
1563
+ this.filterBar = inject(KbqFilterBar);
1564
+ /** Event that is generated after add pipe. */
1565
+ this.onAddPipe = new EventEmitter();
1566
+ /** template of filter */
1567
+ this.filterTemplate = {
1568
+ name: '',
1569
+ pipes: [],
1570
+ readonly: false,
1571
+ disabled: false,
1572
+ changed: false,
1573
+ saved: false
1574
+ };
1575
+ /** already added pipes. Used to open an already added pipe. */
1576
+ this.addedPipes = [];
1577
+ this.filterBar.changes.pipe(takeUntilDestroyed()).subscribe(() => {
1578
+ if (this.filterBar?.filter) {
1579
+ this.addedPipes = this.filterBar.filter.pipes.map((pipe) => pipe.id || pipe.name);
1580
+ }
1581
+ });
1478
1582
  }
1479
- onKeydown($event) {
1480
- if (!this.disabled && ($event.ctrlKey || $event.metaKey) && $event.keyCode === ENTER) {
1481
- this.onApply();
1583
+ addPipeFromTemplate(option) {
1584
+ if (option.selected) {
1585
+ this.filterBar.openPipe.next(option.value.id || option.value.name);
1586
+ }
1587
+ else {
1588
+ option.select();
1589
+ if (!this.filterBar.filter) {
1590
+ this.filterBar.filter = structuredClone(this.filterTemplate);
1591
+ }
1592
+ this.filterBar.filter.changed = true;
1593
+ this.filterBar.filter.pipes.push(Object.assign({}, option.value, { values: undefined, valueTemplate: undefined, openOnAdd: true }));
1594
+ this.onAddPipe.next(option.value);
1595
+ this.filterBar.filterChange.emit(this.filterBar.filter);
1482
1596
  }
1597
+ this.select.close();
1483
1598
  }
1484
- open() {
1485
- this.popover.show();
1599
+ /**
1600
+ * Function to compare the option values with the selected values. The first argument
1601
+ * is a value from an option. The second is a value from the selection. A boolean
1602
+ * should be returned.
1603
+ */
1604
+ compareWith(o1, o2) {
1605
+ return (o1.id || o1.name) === o2;
1486
1606
  }
1487
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeTextComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1488
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: KbqPipeTextComponent, isStandalone: true, selector: "kbq-pipe-text", providers: [
1489
- {
1490
- provide: KbqBasePipe,
1491
- useExisting: this
1607
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeAdd, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1608
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: KbqPipeAdd, isStandalone: true, selector: "kbq-pipe-add", inputs: { filterTemplate: "filterTemplate" }, outputs: { onAddPipe: "onAddPipe" }, host: { classAttribute: "kbq-pipe-add" }, viewQueries: [{ propertyName: "select", first: true, predicate: KbqSelect, descendants: true }], ngImport: i0, template: `
1609
+ <kbq-select #select [tabIndex]="-1" [multiple]="true" [value]="addedPipes" [compareWith]="compareWith">
1610
+ <button
1611
+ [color]="'contrast-fade'"
1612
+ [kbqStyle]="'outline'"
1613
+ [ngClass]="{ 'kbq-active': select.panelOpen }"
1614
+ kbq-button
1615
+ kbqTooltip="{{ filterBar.configuration.add.tooltip }}"
1616
+ kbq-select-matcher
1617
+ >
1618
+ <i kbq-icon="kbq-plus_16"></i>
1619
+ </button>
1620
+
1621
+ @for (template of filterBar.pipeTemplates; track template) {
1622
+ <kbq-option
1623
+ #option
1624
+ [userSelect]="true"
1625
+ [value]="template"
1626
+ [showCheckbox]="false"
1627
+ (click)="addPipeFromTemplate(option)"
1628
+ >
1629
+ {{ template.name }}
1630
+ </kbq-option>
1492
1631
  }
1493
- ], viewQueries: [{ propertyName: "popover", first: true, predicate: KbqPopoverTrigger, descendants: true }], usesInheritance: true, ngImport: i0, template: "<button\n kbq-button\n kbqPopover\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [kbqPopoverArrow]=\"false\"\n [kbqPopoverClass]=\"'kbq-pipe__popover'\"\n [kbqPopoverContent]=\"content\"\n [kbqPopoverFooter]=\"footer\"\n [kbqPopoverPlacement]=\"placements.BottomLeft\"\n [ngClass]=\"{ 'kbq-active': popover?.isOpen }\"\n>\n <span #kbqTitleText kbqPipeMinWidth class=\"kbq-pipe__name\">{{ data.name }}</span>\n <span #kbqTitleText kbqPipeMinWidth class=\"kbq-pipe__value\" [class.kbq-pipe__value_empty]=\"!data.value\">\n {{ data.value }}\n </span>\n</button>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #content>\n <kbq-form-field (keydown)=\"onKeydown($event)\">\n <textarea kbqTextarea rows=\"1\" [formControl]=\"control\" [freeRowsHeight]=\"0\" [maxRows]=\"5\"></textarea>\n </kbq-form-field>\n</ng-template>\n\n<ng-template #footer>\n <button kbq-button [color]=\"'theme'\" [disabled]=\"disabled\" [kbqStyle]=\"'transparent'\" (click)=\"onApply()\">\n <span>{{ localeData.pipe.applyButton }}</span>\n &nbsp;\n <span class=\"kbq-button_hot-key\">{{ isMac ? '\u2318' : 'Ctrl+' }}Enter</span>\n </button>\n</ng-template>\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ data.value }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n"], dependencies: [{ kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "ngmodule", type: KbqFormFieldModule }, { kind: "component", type: i6.KbqFormField, selector: "kbq-form-field", exportAs: ["kbqFormField"] }, { kind: "directive", type: i6.KbqValidateDirective, selector: " input[kbqInput], input[kbqNumberInput], input[kbqInputPassword], input[kbqTimepicker], input[kbqDatepicker], textarea[kbqTextarea], kbq-select, kbq-tree-select, kbq-tag-list ", exportAs: ["KbqValidate"] }, { kind: "directive", type: i6.KbqTrim, selector: "[kbqInput], [kbqTextarea]", exportAs: ["KbqTrim"] }, { kind: "ngmodule", type: KbqPopoverModule }, { kind: "directive", type: i5$1.KbqPopoverTrigger, selector: "[kbqPopover]", inputs: ["kbqPopoverVisible", "kbqPopoverPlacement", "kbqPopoverPlacementPriority", "hasBackdrop", "kbqPopoverHeader", "kbqPopoverContent", "kbqPopoverFooter", "kbqPopoverDisabled", "kbqTrigger", "kbqPopoverSize", "kbqPopoverClass", "hasCloseButton", "closeOnScroll", "backdropClass", "kbqPopoverArrow", "kbqPopoverOffset"], outputs: ["kbqPopoverPlacementChange", "kbqPopoverVisibleChange"], exportAs: ["kbqPopover"] }, { kind: "ngmodule", type: KbqInputModule }, { kind: "ngmodule", type: KbqDividerModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: KbqTextareaModule }, { kind: "directive", type: i5$3.KbqTextarea, selector: "textarea[kbqTextarea]", inputs: ["canGrow", "maxRows", "errorStateMatcher", "disabled", "id", "placeholder", "freeRowsHeight", "required", "value"], exportAs: ["kbqTextarea"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: KbqPipeButton, selector: "kbq-pipe-button" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: KbqTitleModule }, { kind: "directive", type: KbqPipeState, selector: "[kbqPipeState]", inputs: ["kbqPipeState"] }, { kind: "directive", type: KbqPipeTitleDirective, selector: "[kbqPipeTitle]", inputs: ["kbqPipeTitle"], exportAs: ["kbqPipeTitle"] }, { kind: "directive", type: KbqPipeMinWidth, selector: "[kbqPipeMinWidth]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1632
+ </kbq-select>
1633
+ `, isInline: true, styles: [".kbq-pipe-add .kbq-select .kbq-select__trigger{height:unset}\n"], dependencies: [{ kind: "ngmodule", type: KbqDropdownModule }, { kind: "ngmodule", type: KbqToolTipModule }, { kind: "directive", type: i2$1.KbqTooltipTrigger, selector: "[kbqTooltip]", inputs: ["kbqVisible", "kbqPlacement", "kbqRelativeToPointer", "kbqPlacementPriority", "kbqTooltip", "kbqTooltipDisabled", "kbqEnterDelay", "kbqLeaveDelay", "kbqTrigger", "kbqTooltipClass", "kbqTooltipContext", "kbqTooltipColor", "kbqTooltipArrow", "kbqTooltipOffset"], outputs: ["kbqPlacementChange", "kbqVisibleChange"], exportAs: ["kbqTooltip"] }, { kind: "ngmodule", type: KbqButtonModule }, { kind: "component", type: i1.KbqButton, selector: "[kbq-button]", inputs: ["kbqStyle", "disabled", "tabIndex"] }, { kind: "directive", type: i1.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "component", type: KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }, { kind: "ngmodule", type: KbqOptionModule }, { kind: "component", type: i3$2.KbqOption, selector: "kbq-option", inputs: ["value", "userSelect", "showCheckbox", "disabled"], outputs: ["onSelectionChange"], exportAs: ["kbqOption"] }, { kind: "directive", type: KbqSelectMatcher, selector: "kbq-select-matcher, [kbq-select-matcher]" }, { kind: "ngmodule", type: KbqSelectModule }, { kind: "component", type: i3$1.KbqSelect, selector: "kbq-select", inputs: ["hiddenItemsText", "panelClass", "backdropClass", "errorStateMatcher", "sortComparator", "hasBackdrop", "placeholder", "required", "multiple", "compareWith", "panelWidth", "panelMinWidth", "value", "id", "tabIndex", "disabled", "hiddenItemsTextFormatter"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["kbqSelect"] }, { kind: "directive", type: i3$1.KbqOptionTooltip, selector: "kbq-option" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
1494
1634
  }
1495
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeTextComponent, decorators: [{
1635
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqPipeAdd, decorators: [{
1496
1636
  type: Component,
1497
- args: [{ standalone: true, selector: 'kbq-pipe-text', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
1498
- {
1499
- provide: KbqBasePipe,
1500
- useExisting: this
1501
- }
1502
- ], imports: [
1637
+ args: [{ standalone: true, selector: 'kbq-pipe-add', template: `
1638
+ <kbq-select #select [tabIndex]="-1" [multiple]="true" [value]="addedPipes" [compareWith]="compareWith">
1639
+ <button
1640
+ [color]="'contrast-fade'"
1641
+ [kbqStyle]="'outline'"
1642
+ [ngClass]="{ 'kbq-active': select.panelOpen }"
1643
+ kbq-button
1644
+ kbqTooltip="{{ filterBar.configuration.add.tooltip }}"
1645
+ kbq-select-matcher
1646
+ >
1647
+ <i kbq-icon="kbq-plus_16"></i>
1648
+ </button>
1649
+
1650
+ @for (template of filterBar.pipeTemplates; track template) {
1651
+ <kbq-option
1652
+ #option
1653
+ [userSelect]="true"
1654
+ [value]="template"
1655
+ [showCheckbox]="false"
1656
+ (click)="addPipeFromTemplate(option)"
1657
+ >
1658
+ {{ template.name }}
1659
+ </kbq-option>
1660
+ }
1661
+ </kbq-select>
1662
+ `, host: {
1663
+ class: 'kbq-pipe-add'
1664
+ }, imports: [
1665
+ KbqDropdownModule,
1666
+ KbqToolTipModule,
1503
1667
  KbqButtonModule,
1504
- KbqFormFieldModule,
1505
- KbqPopoverModule,
1506
- KbqInputModule,
1507
- KbqDividerModule,
1508
- FormsModule,
1509
- KbqTextareaModule,
1510
- NgClass,
1511
- KbqPipeButton,
1512
- ReactiveFormsModule,
1513
- KbqTitleModule,
1514
- KbqPipeState,
1515
- KbqPipeTitleDirective,
1516
- KbqPipeMinWidth
1517
- ], template: "<button\n kbq-button\n kbqPopover\n [disabled]=\"data.disabled\"\n [kbqPipeState]=\"data\"\n [kbqPipeTitle]=\"pipeTooltip\"\n [kbqPopoverArrow]=\"false\"\n [kbqPopoverClass]=\"'kbq-pipe__popover'\"\n [kbqPopoverContent]=\"content\"\n [kbqPopoverFooter]=\"footer\"\n [kbqPopoverPlacement]=\"placements.BottomLeft\"\n [ngClass]=\"{ 'kbq-active': popover?.isOpen }\"\n>\n <span #kbqTitleText kbqPipeMinWidth class=\"kbq-pipe__name\">{{ data.name }}</span>\n <span #kbqTitleText kbqPipeMinWidth class=\"kbq-pipe__value\" [class.kbq-pipe__value_empty]=\"!data.value\">\n {{ data.value }}\n </span>\n</button>\n\n@if (showRemoveButton) {\n <kbq-pipe-button />\n}\n\n<ng-template #content>\n <kbq-form-field (keydown)=\"onKeydown($event)\">\n <textarea kbqTextarea rows=\"1\" [formControl]=\"control\" [freeRowsHeight]=\"0\" [maxRows]=\"5\"></textarea>\n </kbq-form-field>\n</ng-template>\n\n<ng-template #footer>\n <button kbq-button [color]=\"'theme'\" [disabled]=\"disabled\" [kbqStyle]=\"'transparent'\" (click)=\"onApply()\">\n <span>{{ localeData.pipe.applyButton }}</span>\n &nbsp;\n <span class=\"kbq-button_hot-key\">{{ isMac ? '\u2318' : 'Ctrl+' }}Enter</span>\n </button>\n</ng-template>\n\n<ng-template #pipeTooltip>\n <div class=\"kbq-pipe-tooltip__name kbq-text-compact\">{{ data.name }}</div>\n <div class=\"kbq-pipe-tooltip__value kbq-text-compact\">{{ data.value }}</div>\n</ng-template>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:64px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,#0000000a 12px,#ffffff1a 12px 22px,#0000000a 22px 34px,#ffffff1a 34px) repeat;background-size:32px 32px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-size-border-width))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-size-border-radius)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-size-border-width))}.kbq-truncate-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kbq-no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.kbq-pipe{display:flex;flex-direction:row;max-height:32px}.kbq-pipe .kbq-select .kbq-select__trigger{height:unset}.kbq-pipe .kbq-button-wrapper{max-width:320px}.kbq-pipe .kbq-pipe__name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;color:var(--kbq-foreground-contrast-secondary)}.kbq-pipe .kbq-pipe__value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}.kbq-pipe .kbq-pipe__value:not(.kbq-pipe__value_empty){margin-left:4px}.kbq-pipe .kbq-pipe__separator{z-index:1;margin-left:-1px;margin-right:0;height:12px;align-self:center;color:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-select:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after,.kbq-pipe .kbq-button:not(:hover,.kbq-active)+.kbq-pipe-button:not(:hover,.kbq-active):after{content:\"\";position:absolute;left:0;top:10px;width:1px;height:12px;background:var(--kbq-line-contrast-less)}.kbq-pipe .kbq-button.cdk-keyboard-focused{z-index:1}.kbq-pipe.kbq-pipe_disabled .kbq-pipe__name,.kbq-pipe.kbq-pipe_disabled .kbq-pipe__value{color:var(--kbq-states-foreground-disabled)}.kbq-pipe.kbq-pipe_removable .kbq-button,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button{border-bottom-right-radius:unset;border-top-right-radius:unset;border-right:none}.kbq-pipe.kbq-pipe_removable .kbq-button.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button.cdk-keyboard-focused:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe.kbq-pipe_removable .kbq-button-icon,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon{border-bottom-left-radius:unset;border-top-left-radius:unset;border-left:none}.kbq-pipe.kbq-pipe_removable .kbq-button-icon.cdk-keyboard-focused:after,.kbq-pipe.kbq-pipe_cleanable:not(.kbq-pipe_empty) .kbq-button-icon.cdk-keyboard-focused:after{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background:var(--kbq-states-line-focus-theme)}.kbq-pipe-tooltip__name{color:var(--kbq-foreground-white-secondary)}.kbq-pipe-tooltip__value{color:var(--kbq-foreground-white)}\n"] }]
1518
- }], propDecorators: { popover: [{
1668
+ KbqIcon,
1669
+ KbqOptionModule,
1670
+ KbqSelectMatcher,
1671
+ KbqSelectModule,
1672
+ NgClass
1673
+ ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, styles: [".kbq-pipe-add .kbq-select .kbq-select__trigger{height:unset}\n"] }]
1674
+ }], ctorParameters: () => [], propDecorators: { select: [{
1519
1675
  type: ViewChild,
1520
- args: [KbqPopoverTrigger]
1676
+ args: [KbqSelect]
1677
+ }], onAddPipe: [{
1678
+ type: Output
1679
+ }], filterTemplate: [{
1680
+ type: Input
1521
1681
  }] } });
1522
1682
 
1523
1683
  class KbqPipeDirective {
1524
1684
  constructor() {
1525
1685
  this.injector = inject(Injector);
1686
+ this.pipes = inject(KBQ_FILTER_BAR_PIPES);
1526
1687
  this.viewContainerRef = inject(ViewContainerRef);
1527
1688
  }
1528
1689
  ngAfterContentInit() {
1529
- const options = {
1530
- injector: this.getInjector(this.pipe)
1531
- };
1532
- // todo this for extend and configure
1533
- if (this.pipe.type === KbqPipeTypes.Text) {
1534
- this.viewContainerRef.createComponent(KbqPipeTextComponent, options);
1535
- }
1536
- else if (this.pipe.type === KbqPipeTypes.Select) {
1537
- this.viewContainerRef.createComponent(KbqPipeSelectComponent, options);
1538
- }
1539
- else if (this.pipe.type === KbqPipeTypes.MultiSelect) {
1540
- this.viewContainerRef.createComponent(KbqPipeMultiSelectComponent, options);
1541
- }
1542
- else if (this.pipe.type === KbqPipeTypes.Date) {
1543
- this.viewContainerRef.createComponent(KbqPipeDateComponent, options);
1544
- }
1545
- else if (this.pipe.type === KbqPipeTypes.Datetime) {
1546
- this.viewContainerRef.createComponent(KbqPipeDatetimeComponent, options);
1690
+ const component = this.pipes.get(this.pipe.type);
1691
+ if (!component) {
1692
+ throw new Error(`Can't find component for this type: ${this.pipe.type}`);
1547
1693
  }
1694
+ this.viewContainerRef.createComponent(component, { injector: this.getInjector(this.pipe) });
1548
1695
  }
1549
1696
  getInjector(pipe) {
1550
1697
  return Injector.create({
@@ -1602,7 +1749,7 @@ class KbqFilterBarModule {
1602
1749
  KbqFilterBarSearch,
1603
1750
  KbqPipeTitleDirective,
1604
1751
  KbqPipeState] }); }
1605
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBarModule, imports: [KbqFilterBar,
1752
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqFilterBarModule, providers: [kbqFilterBarPipesProvider()], imports: [KbqFilterBar,
1606
1753
  KbqFilters,
1607
1754
  KbqFilterBarRefresher,
1608
1755
  KbqFilterReset,
@@ -1614,7 +1761,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImpor
1614
1761
  type: NgModule,
1615
1762
  args: [{
1616
1763
  exports: COMPONENTS,
1617
- imports: COMPONENTS
1764
+ imports: COMPONENTS,
1765
+ providers: [kbqFilterBarPipesProvider()]
1618
1766
  }]
1619
1767
  }] });
1620
1768
 
@@ -1622,5 +1770,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImpor
1622
1770
  * Generated bundle index. Do not edit.
1623
1771
  */
1624
1772
 
1625
- export { KBQ_FILTER_BAR_CONFIGURATION, KBQ_FILTER_BAR_DEFAULT_CONFIGURATION, KBQ_PIPE_DATA, KbqBasePipe, KbqFilterBar, KbqFilterBarButton, KbqFilterBarModule, KbqFilterBarRefresher, KbqFilterBarSearch, KbqFilterReset, KbqFilters, KbqPipeAdd, KbqPipeButton, KbqPipeDateComponent, KbqPipeDatetimeComponent, KbqPipeDirective, KbqPipeMinWidth, KbqPipeMultiSelectComponent, KbqPipeSelectComponent, KbqPipeState, KbqPipeTextComponent, KbqPipeTitleDirective, KbqPipeTypes };
1773
+ export { KBQ_FILTER_BAR_CONFIGURATION, KBQ_FILTER_BAR_DEFAULT_CONFIGURATION, KBQ_FILTER_BAR_PIPES, KBQ_PIPE_DATA, KbqBasePipe, KbqFilterBar, KbqFilterBarButton, KbqFilterBarModule, KbqFilterBarRefresher, KbqFilterBarSearch, KbqFilterReset, KbqFilters, KbqPipeAdd, KbqPipeButton, KbqPipeDateComponent, KbqPipeDatetimeComponent, KbqPipeDirective, KbqPipeMinWidth, KbqPipeMultiSelectComponent, KbqPipeSelectComponent, KbqPipeState, KbqPipeTextComponent, KbqPipeTitleDirective, KbqPipeTypes, defaultFilterBarPipes, kbqFilterBarPipesProvider };
1626
1774
  //# sourceMappingURL=koobiq-components-filter-bar.mjs.map