@koobiq/components 18.18.0 → 18.20.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 (234) hide show
  1. package/actions-panel/actions-panel-config.d.ts +79 -0
  2. package/actions-panel/actions-panel-container.d.ts +90 -0
  3. package/actions-panel/actions-panel-container.scss +33 -0
  4. package/actions-panel/actions-panel-ref.d.ts +31 -0
  5. package/actions-panel/actions-panel-tokens.scss +13 -0
  6. package/actions-panel/actions-panel.d.ts +144 -0
  7. package/actions-panel/index.d.ts +5 -0
  8. package/actions-panel/module.d.ts +7 -0
  9. package/core/animation/animation.d.ts +26 -0
  10. package/core/form-field/form-field-ref.d.ts +4 -0
  11. package/core/locales/en-US.d.ts +45 -0
  12. package/core/locales/es-LA.d.ts +45 -0
  13. package/core/locales/fa-IR.d.ts +45 -0
  14. package/core/locales/locale-service.d.ts +315 -0
  15. package/core/locales/pt-BR.d.ts +45 -0
  16. package/core/locales/ru-RU.d.ts +45 -0
  17. package/core/locales/tk-TM.d.ts +45 -0
  18. package/core/locales/types.d.ts +6 -0
  19. package/core/locales/zh-CN.d.ts +45 -0
  20. package/core/option/option-tokens.scss +5 -1
  21. package/core/option/option.d.ts +3 -1
  22. package/core/option/option.scss +6 -4
  23. package/core/styles/common/_list.scss +2 -9
  24. package/core/styles/common/_select.scss +6 -0
  25. package/core/styles/common/_tokens.scss +1 -1
  26. package/datepicker/calendar.component.d.ts +9 -0
  27. package/datepicker/datepicker-input.directive.d.ts +5 -1
  28. package/dl/dl.component.d.ts +4 -4
  29. package/dropdown/_dropdown-theme.scss +9 -10
  30. package/dropdown/dropdown-tokens.scss +1 -0
  31. package/dropdown/dropdown.component.d.ts +1 -1
  32. package/dropdown/dropdown.scss +5 -0
  33. package/dropdown/dropdown.types.d.ts +3 -1
  34. package/esm2022/accordion/accordion-trigger.component.mjs +1 -1
  35. package/esm2022/actions-panel/actions-panel-config.mjs +55 -0
  36. package/esm2022/actions-panel/actions-panel-container.mjs +217 -0
  37. package/esm2022/actions-panel/actions-panel-ref.mjs +62 -0
  38. package/esm2022/actions-panel/actions-panel.mjs +220 -0
  39. package/esm2022/actions-panel/index.mjs +6 -0
  40. package/esm2022/actions-panel/koobiq-components-actions-panel.mjs +5 -0
  41. package/esm2022/actions-panel/module.mjs +21 -0
  42. package/esm2022/breadcrumbs/breadcrumbs.mjs +2 -2
  43. package/esm2022/button-toggle/button-toggle.component.mjs +2 -2
  44. package/esm2022/code-block/code-block.mjs +1 -1
  45. package/esm2022/core/animation/animation.mjs +29 -1
  46. package/esm2022/core/common-behaviors/common-module.mjs +2 -2
  47. package/esm2022/core/form-field/form-field-ref.mjs +1 -1
  48. package/esm2022/core/locales/en-US.mjs +46 -1
  49. package/esm2022/core/locales/es-LA.mjs +46 -1
  50. package/esm2022/core/locales/fa-IR.mjs +46 -1
  51. package/esm2022/core/locales/pt-BR.mjs +46 -1
  52. package/esm2022/core/locales/ru-RU.mjs +46 -1
  53. package/esm2022/core/locales/tk-TM.mjs +46 -1
  54. package/esm2022/core/locales/types.mjs +1 -1
  55. package/esm2022/core/locales/zh-CN.mjs +46 -1
  56. package/esm2022/core/option/option.mjs +12 -5
  57. package/esm2022/core/version.mjs +2 -2
  58. package/esm2022/datepicker/calendar-header.component.mjs +1 -1
  59. package/esm2022/datepicker/calendar.component.mjs +20 -2
  60. package/esm2022/datepicker/datepicker-input.directive.mjs +22 -11
  61. package/esm2022/datepicker/datepicker-toggle.component.mjs +1 -1
  62. package/esm2022/dl/dl.component.mjs +12 -9
  63. package/esm2022/dropdown/dropdown-item.component.mjs +2 -2
  64. package/esm2022/dropdown/dropdown-trigger.directive.mjs +6 -1
  65. package/esm2022/dropdown/dropdown.component.mjs +4 -4
  66. package/esm2022/dropdown/dropdown.types.mjs +1 -1
  67. package/esm2022/file-upload/multiple-file-upload.component.mjs +1 -1
  68. package/esm2022/file-upload/single-file-upload.component.mjs +1 -1
  69. package/esm2022/filter-bar/filter-bar-button.mjs +30 -0
  70. package/esm2022/filter-bar/filter-bar.mjs +168 -0
  71. package/esm2022/filter-bar/filter-bar.module.mjs +65 -0
  72. package/esm2022/filter-bar/filter-bar.types.mjs +13 -0
  73. package/esm2022/filter-bar/filter-refresher.mjs +34 -0
  74. package/esm2022/filter-bar/filter-reset.mjs +38 -0
  75. package/esm2022/filter-bar/filter-search.mjs +132 -0
  76. package/esm2022/filter-bar/filters.mjs +225 -0
  77. package/esm2022/filter-bar/index.mjs +2 -0
  78. package/esm2022/filter-bar/koobiq-components-filter-bar.mjs +5 -0
  79. package/esm2022/filter-bar/pipe-add.mjs +129 -0
  80. package/esm2022/filter-bar/pipe.directive.mjs +55 -0
  81. package/esm2022/filter-bar/pipes/base-pipe.mjs +106 -0
  82. package/esm2022/filter-bar/pipes/pipe-button.mjs +59 -0
  83. package/esm2022/filter-bar/pipes/pipe-date.mjs +171 -0
  84. package/esm2022/filter-bar/pipes/pipe-datetime.mjs +172 -0
  85. package/esm2022/filter-bar/pipes/pipe-multi-select.mjs +96 -0
  86. package/esm2022/filter-bar/pipes/pipe-select.mjs +88 -0
  87. package/esm2022/filter-bar/pipes/pipe-state.mjs +45 -0
  88. package/esm2022/filter-bar/pipes/pipe-text.mjs +89 -0
  89. package/esm2022/filter-bar/pipes/pipe-title.mjs +96 -0
  90. package/esm2022/filter-bar/public-api.mjs +20 -0
  91. package/esm2022/form-field/cleaner.mjs +1 -1
  92. package/esm2022/form-field/form-field.mjs +13 -6
  93. package/esm2022/form-field/password-hint.mjs +1 -1
  94. package/esm2022/form-field/password-toggle.mjs +1 -1
  95. package/esm2022/form-field/stepper.mjs +1 -1
  96. package/esm2022/icon/icon-button.component.mjs +9 -9
  97. package/esm2022/icon/icon-item.component.mjs +10 -10
  98. package/esm2022/icon/icon.component.mjs +9 -12
  99. package/esm2022/list/list-selection.component.mjs +18 -15
  100. package/esm2022/list/list.component.mjs +2 -2
  101. package/esm2022/modal/modal.component.mjs +1 -1
  102. package/esm2022/modal/modal.directive.mjs +1 -1
  103. package/esm2022/navbar/navbar-item.component.mjs +2 -2
  104. package/esm2022/navbar/navbar.component.mjs +2 -2
  105. package/esm2022/navbar/vertical-navbar.component.mjs +18 -16
  106. package/esm2022/overflow-items/overflow-items.mjs +129 -139
  107. package/esm2022/popover/popover-confirm.component.mjs +3 -3
  108. package/esm2022/popover/popover.component.mjs +30 -10
  109. package/esm2022/radio/radio.component.mjs +2 -2
  110. package/esm2022/select/select.component.mjs +3 -3
  111. package/esm2022/sidepanel/sidepanel-container.component.mjs +3 -3
  112. package/esm2022/sidepanel/sidepanel-directives.mjs +2 -2
  113. package/esm2022/tabs/tab-header.component.mjs +1 -1
  114. package/esm2022/tabs/tab-nav-bar.mjs +2 -2
  115. package/esm2022/tags/tag.component.mjs +2 -2
  116. package/esm2022/textarea/textarea.component.mjs +9 -5
  117. package/esm2022/timezone/timezone-option.component.mjs +2 -2
  118. package/esm2022/timezone/timezone-select.component.mjs +2 -2
  119. package/esm2022/title/title.directive.mjs +12 -5
  120. package/esm2022/toast/toast.component.mjs +2 -2
  121. package/esm2022/tree/toggle.mjs +1 -1
  122. package/esm2022/tree/tree-option.component.mjs +5 -4
  123. package/esm2022/tree/tree-selection.component.mjs +10 -3
  124. package/esm2022/tree-select/tree-select.component.mjs +6 -4
  125. package/fesm2022/koobiq-components-accordion.mjs +1 -1
  126. package/fesm2022/koobiq-components-accordion.mjs.map +1 -1
  127. package/fesm2022/koobiq-components-actions-panel.mjs +567 -0
  128. package/fesm2022/koobiq-components-actions-panel.mjs.map +1 -0
  129. package/fesm2022/koobiq-components-breadcrumbs.mjs +1 -1
  130. package/fesm2022/koobiq-components-breadcrumbs.mjs.map +1 -1
  131. package/fesm2022/koobiq-components-button-toggle.mjs +2 -2
  132. package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
  133. package/fesm2022/koobiq-components-code-block.mjs +1 -1
  134. package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
  135. package/fesm2022/koobiq-components-core.mjs +357 -7
  136. package/fesm2022/koobiq-components-core.mjs.map +1 -1
  137. package/fesm2022/koobiq-components-datepicker.mjs +40 -12
  138. package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
  139. package/fesm2022/koobiq-components-dl.mjs +11 -8
  140. package/fesm2022/koobiq-components-dl.mjs.map +1 -1
  141. package/fesm2022/koobiq-components-dropdown.mjs +10 -5
  142. package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
  143. package/fesm2022/koobiq-components-file-upload.mjs +2 -2
  144. package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
  145. package/fesm2022/koobiq-components-filter-bar.mjs +1596 -0
  146. package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -0
  147. package/fesm2022/koobiq-components-form-field.mjs +16 -9
  148. package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
  149. package/fesm2022/koobiq-components-icon.mjs +23 -26
  150. package/fesm2022/koobiq-components-icon.mjs.map +1 -1
  151. package/fesm2022/koobiq-components-list.mjs +19 -16
  152. package/fesm2022/koobiq-components-list.mjs.map +1 -1
  153. package/fesm2022/koobiq-components-modal.mjs +2 -2
  154. package/fesm2022/koobiq-components-modal.mjs.map +1 -1
  155. package/fesm2022/koobiq-components-navbar.mjs +21 -19
  156. package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
  157. package/fesm2022/koobiq-components-overflow-items.mjs +129 -139
  158. package/fesm2022/koobiq-components-overflow-items.mjs.map +1 -1
  159. package/fesm2022/koobiq-components-popover.mjs +31 -11
  160. package/fesm2022/koobiq-components-popover.mjs.map +1 -1
  161. package/fesm2022/koobiq-components-radio.mjs +2 -2
  162. package/fesm2022/koobiq-components-radio.mjs.map +1 -1
  163. package/fesm2022/koobiq-components-select.mjs +2 -2
  164. package/fesm2022/koobiq-components-select.mjs.map +1 -1
  165. package/fesm2022/koobiq-components-sidepanel.mjs +3 -3
  166. package/fesm2022/koobiq-components-sidepanel.mjs.map +1 -1
  167. package/fesm2022/koobiq-components-tabs.mjs +2 -2
  168. package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
  169. package/fesm2022/koobiq-components-tags.mjs +2 -2
  170. package/fesm2022/koobiq-components-tags.mjs.map +1 -1
  171. package/fesm2022/koobiq-components-textarea.mjs +8 -4
  172. package/fesm2022/koobiq-components-textarea.mjs.map +1 -1
  173. package/fesm2022/koobiq-components-timezone.mjs +4 -4
  174. package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
  175. package/fesm2022/koobiq-components-title.mjs +11 -4
  176. package/fesm2022/koobiq-components-title.mjs.map +1 -1
  177. package/fesm2022/koobiq-components-toast.mjs +1 -1
  178. package/fesm2022/koobiq-components-toast.mjs.map +1 -1
  179. package/fesm2022/koobiq-components-tree-select.mjs +5 -3
  180. package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
  181. package/fesm2022/koobiq-components-tree.mjs +14 -6
  182. package/fesm2022/koobiq-components-tree.mjs.map +1 -1
  183. package/filter-bar/_filter-bar-theme.scss +61 -0
  184. package/filter-bar/filter-bar-button.d.ts +8 -0
  185. package/filter-bar/filter-bar.d.ts +55 -0
  186. package/filter-bar/filter-bar.module.d.ts +17 -0
  187. package/filter-bar/filter-bar.scss +60 -0
  188. package/filter-bar/filter-bar.types.d.ts +97 -0
  189. package/filter-bar/filter-refresher.d.ts +5 -0
  190. package/filter-bar/filter-refresher.scss +6 -0
  191. package/filter-bar/filter-reset.d.ts +11 -0
  192. package/filter-bar/filter-search.d.ts +25 -0
  193. package/filter-bar/filter-search.scss +14 -0
  194. package/filter-bar/filters.d.ts +72 -0
  195. package/filter-bar/filters.scss +92 -0
  196. package/filter-bar/index.d.ts +1 -0
  197. package/filter-bar/pipe-add.d.ts +18 -0
  198. package/filter-bar/pipe-add.scss +5 -0
  199. package/filter-bar/pipe.directive.d.ts +13 -0
  200. package/filter-bar/pipes/base-pipe.d.ts +40 -0
  201. package/filter-bar/pipes/base-pipe.scss +117 -0
  202. package/filter-bar/pipes/pipe-button.d.ts +13 -0
  203. package/filter-bar/pipes/pipe-button.scss +5 -0
  204. package/filter-bar/pipes/pipe-date.d.ts +41 -0
  205. package/filter-bar/pipes/pipe-date.scss +132 -0
  206. package/filter-bar/pipes/pipe-datetime.d.ts +41 -0
  207. package/filter-bar/pipes/pipe-multi-select.d.ts +22 -0
  208. package/filter-bar/pipes/pipe-multiselect.scss +15 -0
  209. package/filter-bar/pipes/pipe-select.d.ts +21 -0
  210. package/filter-bar/pipes/pipe-select.scss +3 -0
  211. package/filter-bar/pipes/pipe-state.d.ts +14 -0
  212. package/filter-bar/pipes/pipe-text.d.ts +19 -0
  213. package/filter-bar/pipes/pipe-title.d.ts +25 -0
  214. package/filter-bar/public-api.d.ts +19 -0
  215. package/form-field/form-field.d.ts +6 -1
  216. package/form-field/form-field.scss +1 -0
  217. package/icon/icon-button.component.d.ts +5 -3
  218. package/icon/icon-item.component.d.ts +5 -3
  219. package/icon/icon.component.d.ts +5 -4
  220. package/list/list.scss +2 -3
  221. package/navbar/vertical-navbar.component.d.ts +4 -1
  222. package/overflow-items/overflow-items.d.ts +59 -71
  223. package/package.json +19 -7
  224. package/popover/popover.component.d.ts +6 -1
  225. package/radio/radio-tokens.scss +7 -3
  226. package/radio/radio.scss +19 -15
  227. package/schematics/ng-add/index.js +6 -6
  228. package/select/_select-theme.scss +9 -1
  229. package/tags/tag.scss +3 -0
  230. package/textarea/textarea.component.d.ts +2 -1
  231. package/timezone/timezone-option-tokens.scss +3 -2
  232. package/title/title.directive.d.ts +2 -0
  233. package/tree/tree-option.scss +2 -1
  234. package/tree-select/_tree-select-theme.scss +9 -1
@@ -1,72 +1,106 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, TemplateRef, Directive, input, viewChildren, ElementRef, contentChildren, contentChild, viewChild, computed, signal, booleanAttribute, numberAttribute, ChangeDetectorRef, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
2
+ import { inject, Renderer2, ElementRef, signal, Directive, input, contentChildren, contentChild, booleanAttribute, numberAttribute, output, NgModule } from '@angular/core';
3
3
  import { SharedResizeObserver } from '@angular/cdk/observers/private';
4
- import { NgTemplateOutlet } from '@angular/common';
5
- import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
+ import { DOCUMENT } from '@angular/common';
5
+ import { toSignal, outputToObservable, toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
6
  import { merge, skip, debounceTime } from 'rxjs';
7
7
 
8
8
  /**
9
- * Directive for providing `KbqOverflowItemsResultContext` to the `KbqOverflowItems` component.
9
+ * Manages the visibility of the element.
10
10
  *
11
- * @see `KbqOverflowItemsResultContext`
11
+ * @docs-private
12
12
  */
13
- class KbqOverflowItemsResult {
13
+ class ElementVisibilityManager {
14
14
  constructor() {
15
+ this.renderer = inject(Renderer2);
15
16
  /**
16
- * TemplateRef for the overflow result.
17
+ * Reference to the element.
17
18
  *
18
19
  * @docs-private
19
20
  */
20
- this.templateRef = inject(TemplateRef);
21
+ this.elementRef = inject(ElementRef);
22
+ /**
23
+ * Whether the element is hidden.
24
+ *
25
+ * @docs-private
26
+ */
27
+ this.hidden = signal(false);
21
28
  }
22
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqOverflowItemsResult, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
23
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: KbqOverflowItemsResult, isStandalone: true, selector: "ng-template[kbqOverflowItemsResult]", ngImport: i0 }); }
29
+ /**
30
+ * Hides the element.
31
+ *
32
+ * @docs-private
33
+ */
34
+ hide() {
35
+ this.renderer.setStyle(this.elementRef.nativeElement, 'visibility', 'hidden');
36
+ this.renderer.setStyle(this.elementRef.nativeElement, 'position', 'absolute');
37
+ this.hidden.set(true);
38
+ }
39
+ /**
40
+ * Shows the element.
41
+ *
42
+ * @docs-private
43
+ */
44
+ show() {
45
+ this.renderer.removeStyle(this.elementRef.nativeElement, 'visibility');
46
+ this.renderer.removeStyle(this.elementRef.nativeElement, 'position');
47
+ this.hidden.set(false);
48
+ }
49
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: ElementVisibilityManager, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
50
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: ElementVisibilityManager, host: { properties: { "attr.aria-hidden": "hidden()" } }, ngImport: i0 }); }
51
+ }
52
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: ElementVisibilityManager, decorators: [{
53
+ type: Directive,
54
+ args: [{
55
+ host: {
56
+ '[attr.aria-hidden]': 'hidden()'
57
+ }
58
+ }]
59
+ }] });
60
+ /**
61
+ * Directive for displaying the result of hidden items by the `KbqOverflowItems` directive.
62
+ */
63
+ class KbqOverflowItemsResult extends ElementVisibilityManager {
64
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqOverflowItemsResult, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
65
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.6", type: KbqOverflowItemsResult, isStandalone: true, selector: "[kbqOverflowItemsResult]", host: { classAttribute: "kbq-overflow-items-result" }, exportAs: ["kbqOverflowItemsResult"], usesInheritance: true, ngImport: i0 }); }
24
66
  }
25
67
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqOverflowItemsResult, decorators: [{
26
68
  type: Directive,
27
69
  args: [{
28
70
  standalone: true,
29
- selector: 'ng-template[kbqOverflowItemsResult]'
71
+ selector: '[kbqOverflowItemsResult]',
72
+ exportAs: 'kbqOverflowItemsResult',
73
+ host: { class: 'kbq-overflow-items-result' }
30
74
  }]
31
75
  }] });
32
76
  /**
33
- * Structure directive for providing items to the `KbqOverflowItems`.
77
+ * Directive for the item that can be hidden by the `KbqOverflowItems` directive.
34
78
  */
35
- class KbqOverflowItem {
79
+ class KbqOverflowItem extends ElementVisibilityManager {
36
80
  constructor() {
81
+ super(...arguments);
37
82
  /**
38
- * Identifier for the item.
83
+ * Unique identifier for the item.
39
84
  */
40
85
  this.id = input.required({ alias: 'kbqOverflowItem' });
41
- /**
42
- * Whether the item is hidden.
43
- *
44
- * @docs-private
45
- */
46
- this.hidden = false;
47
- /**
48
- * TemplateRef for the item.
49
- *
50
- * @docs-private
51
- */
52
- this.templateRef = inject(TemplateRef);
53
86
  }
54
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqOverflowItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
55
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.6", type: KbqOverflowItem, isStandalone: true, selector: "[kbqOverflowItem]", inputs: { id: { classPropertyName: "id", publicName: "kbqOverflowItem", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
87
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqOverflowItem, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
88
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.6", type: KbqOverflowItem, isStandalone: true, selector: "[kbqOverflowItem]", inputs: { id: { classPropertyName: "id", publicName: "kbqOverflowItem", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "kbq-overflow-item" }, exportAs: ["kbqOverflowItem"], usesInheritance: true, ngImport: i0 }); }
56
89
  }
57
90
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqOverflowItem, decorators: [{
58
91
  type: Directive,
59
92
  args: [{
60
93
  standalone: true,
61
- selector: '[kbqOverflowItem]'
94
+ selector: '[kbqOverflowItem]',
95
+ exportAs: 'kbqOverflowItem',
96
+ host: { class: 'kbq-overflow-item' }
62
97
  }]
63
98
  }] });
64
99
  /**
65
- * Component for automatically hiding elements with dynamic adaptation to the container width.
100
+ * Directive for managing the visibility of items that overflow the container.
66
101
  */
67
102
  class KbqOverflowItems {
68
103
  constructor() {
69
- this.itemElementRefs = viewChildren('itemRef', { read: ElementRef });
70
104
  /**
71
105
  * `KbqOverflowItem` directive references.
72
106
  *
@@ -79,29 +113,8 @@ class KbqOverflowItems {
79
113
  * @docs-private
80
114
  */
81
115
  this.result = contentChild(KbqOverflowItemsResult);
82
- this.resultElementRef = viewChild('resultRef', { read: ElementRef });
83
- /**
84
- * Template context for the `KbqOverflowItemsResult` directive.
85
- *
86
- * @docs-private
87
- */
88
- this.resultTemplateContext = computed(() => {
89
- const hiddenItemIDs = this.hiddenItemIDs();
90
- return {
91
- $implicit: hiddenItemIDs,
92
- hiddenItemIDs: hiddenItemIDs
93
- };
94
- });
95
- this.hiddenItemIDs = signal(new Set([]));
96
- /**
97
- * Whether the overflow result is hidden.
98
- *
99
- * @docs-private
100
- */
101
- this.resultHidden = computed(() => this.hiddenItemIDs().size === 0);
102
116
  /**
103
117
  * Whether the overflow order should be reversed.
104
- * Also changes the position of the `resultTemplateRef`.
105
118
  *
106
119
  * @default false
107
120
  */
@@ -112,126 +125,103 @@ class KbqOverflowItems {
112
125
  * @default 100
113
126
  */
114
127
  this.debounceTime = input(100, { transform: numberAttribute });
128
+ /**
129
+ * Emits when the set of hidden items changes.
130
+ */
131
+ this.changes = output();
132
+ /**
133
+ * Set of hidden item IDs.
134
+ */
135
+ this.hiddenItemIDs = toSignal(outputToObservable(this.changes), {
136
+ initialValue: new Set([])
137
+ });
115
138
  this.elementRef = inject(ElementRef);
116
139
  this.resizeObserver = inject(SharedResizeObserver);
117
- this.changeDetectorRef = inject(ChangeDetectorRef);
140
+ this.renderer = inject(Renderer2);
141
+ this.document = inject(DOCUMENT);
118
142
  /**
119
143
  * Determines if the given item is hidden.
120
144
  */
121
- this.isHiddenItem = ({ hidden }) => hidden;
145
+ this.isHiddenItem = ({ hidden }) => hidden();
146
+ this.setStyles();
122
147
  merge(toObservable(this.items), toObservable(this.reverseOverflowOrder).pipe(skip(1)), this.resizeObserver.observe(this.elementRef.nativeElement))
123
148
  .pipe(debounceTime(this.debounceTime()), takeUntilDestroyed())
124
149
  .subscribe(() => {
125
- const items = this.items();
126
- this.updateItemsVisibility(items, this.itemElementRefs(), this.reverseOverflowOrder(), this.resultElementRef(), this.elementRef.nativeElement);
127
- this.hiddenItemIDs.set(new Set(items.filter(this.isHiddenItem).map(({ id }) => id())));
128
- this.changeDetectorRef.markForCheck();
150
+ const hiddenItems = this.calculateItemsVisibility(this.items(), this.reverseOverflowOrder(), this.result(), this.elementRef.nativeElement);
151
+ const hiddenItemIDs = new Set(hiddenItems.map(({ id }) => id()));
152
+ this.changes.emit(hiddenItemIDs);
129
153
  });
130
154
  }
131
155
  /**
132
- * Updates items visibility, based on the container width and the `reverseOverflowOrder` flag.
156
+ * Calculates the visibility of items, based on the container width and `reverseOverflowOrder` property.
133
157
  */
134
- updateItemsVisibility(items, itemElementRefs, reverseOverflowOrder, resultElementRef, { offsetWidth: totalWidth }) {
158
+ calculateItemsVisibility(items, reverseOverflowOrder, result, { offsetWidth: totalWidth }) {
159
+ result?.hide();
135
160
  items.forEach((item) => {
136
- item.hidden = false;
161
+ item.show();
137
162
  });
138
- let itemsWidth = items.reduce((width, _, index) => width + itemElementRefs[index].nativeElement.offsetWidth, 0);
163
+ let itemsWidth = items.reduce((width, { elementRef }) => width + this.getElementWidthWithMargins(elementRef), 0);
139
164
  const startIndex = reverseOverflowOrder ? 0 : items.length - 1;
140
165
  const endIndex = reverseOverflowOrder ? items.length : -1;
141
166
  const step = reverseOverflowOrder ? 1 : -1;
142
- const resultWidth = resultElementRef?.nativeElement.offsetWidth || 0;
167
+ const resultWidth = result ? this.getElementWidthWithMargins(result.elementRef) : 0;
143
168
  for (let index = startIndex; index !== endIndex; index += step) {
144
169
  const current = items[index];
145
- const currentWidth = itemElementRefs[index].nativeElement.offsetWidth;
170
+ const currentWidth = this.getElementWidthWithMargins(current.elementRef);
146
171
  const _resultWidth = items.some(this.isHiddenItem) ? resultWidth : 0;
147
172
  if (itemsWidth + _resultWidth > totalWidth) {
148
- current.hidden = true;
173
+ current.hide();
149
174
  itemsWidth -= currentWidth;
150
175
  }
151
176
  else {
152
177
  const isEdgeElement = reverseOverflowOrder ? index === 0 : index === items.length - 1;
153
178
  const _resultWidth = isEdgeElement ? 0 : resultWidth;
154
179
  if (itemsWidth + currentWidth + _resultWidth <= totalWidth) {
155
- current.hidden = false;
180
+ current.show();
156
181
  itemsWidth += currentWidth;
157
182
  }
158
183
  }
159
184
  }
160
- }
161
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqOverflowItems, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
162
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: KbqOverflowItems, isStandalone: true, selector: "kbq-overflow-items", inputs: { reverseOverflowOrder: { classPropertyName: "reverseOverflowOrder", publicName: "reverseOverflowOrder", isSignal: true, isRequired: false, transformFunction: null }, debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "kbq-overflow-items" }, queries: [{ propertyName: "items", predicate: KbqOverflowItem, isSignal: true }, { propertyName: "result", first: true, predicate: KbqOverflowItemsResult, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "itemElementRefs", predicate: ["itemRef"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "resultElementRef", first: true, predicate: ["resultRef"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: `
163
- @if (reverseOverflowOrder()) {
164
- <ng-container [ngTemplateOutlet]="template" />
185
+ const hiddenItems = items.filter(this.isHiddenItem);
186
+ if (hiddenItems.length > 0) {
187
+ result?.show();
165
188
  }
166
-
167
- @for (item of items(); track item) {
168
- <div
169
- class="kbq-overflow-items__item"
170
- #itemRef
171
- [attr.aria-hidden]="item.hidden"
172
- [class.kbq-overflow-items__item_hidden]="item.hidden"
173
- >
174
- <ng-container [ngTemplateOutlet]="item.templateRef" />
175
- </div>
176
- }
177
-
178
- @if (!reverseOverflowOrder()) {
179
- <ng-container [ngTemplateOutlet]="template" />
180
- }
181
-
182
- <ng-template #template>
183
- <div
184
- class="kbq-overflow-items__result"
185
- #resultRef
186
- [attr.aria-hidden]="resultHidden()"
187
- [class.kbq-overflow-items__result_hidden]="resultHidden()"
188
- >
189
- <ng-container
190
- [ngTemplateOutlet]="result()?.templateRef || null"
191
- [ngTemplateOutletContext]="resultTemplateContext()"
192
- />
193
- </div>
194
- </ng-template>
195
- `, isInline: true, styles: [":host{position:relative;display:flex;flex-grow:1;overflow:hidden;flex-wrap:nowrap;white-space:nowrap}.kbq-overflow-items__item,.kbq-overflow-items__result{display:flex;align-items:center}.kbq-overflow-items__item.kbq-overflow-items__item_hidden,.kbq-overflow-items__item.kbq-overflow-items__result_hidden,.kbq-overflow-items__result.kbq-overflow-items__item_hidden,.kbq-overflow-items__result.kbq-overflow-items__result_hidden{visibility:hidden;position:absolute}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
189
+ return hiddenItems;
190
+ }
191
+ /**
192
+ * Returns the width of the element including margins.
193
+ */
194
+ getElementWidthWithMargins({ nativeElement }) {
195
+ const { marginLeft, marginRight } = this.getWindow().getComputedStyle(nativeElement);
196
+ return Math.ceil(parseFloat(marginLeft) + nativeElement.offsetWidth + parseFloat(marginRight));
197
+ }
198
+ /**
199
+ * This method sets the necessary styles for the directive.
200
+ */
201
+ setStyles() {
202
+ this.renderer.setStyle(this.elementRef.nativeElement, 'position', 'relative');
203
+ this.renderer.setStyle(this.elementRef.nativeElement, 'display', 'flex');
204
+ this.renderer.setStyle(this.elementRef.nativeElement, 'flex-wrap', 'nowrap');
205
+ this.renderer.setStyle(this.elementRef.nativeElement, 'flex-grow', '1');
206
+ this.renderer.setStyle(this.elementRef.nativeElement, 'overflow', 'hidden');
207
+ }
208
+ /**
209
+ * Returns the window object.
210
+ */
211
+ getWindow() {
212
+ return this.document.defaultView || window;
213
+ }
214
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqOverflowItems, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
215
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "18.2.6", type: KbqOverflowItems, isStandalone: true, selector: "[kbqOverflowItems]", inputs: { reverseOverflowOrder: { classPropertyName: "reverseOverflowOrder", publicName: "reverseOverflowOrder", isSignal: true, isRequired: false, transformFunction: null }, debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changes: "changes" }, host: { classAttribute: "kbq-overflow-items" }, queries: [{ propertyName: "items", predicate: KbqOverflowItem, isSignal: true }, { propertyName: "result", first: true, predicate: KbqOverflowItemsResult, descendants: true, isSignal: true }], exportAs: ["kbqOverflowItems"], ngImport: i0 }); }
196
216
  }
197
217
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: KbqOverflowItems, decorators: [{
198
- type: Component,
199
- args: [{ standalone: true, selector: 'kbq-overflow-items', imports: [NgTemplateOutlet], template: `
200
- @if (reverseOverflowOrder()) {
201
- <ng-container [ngTemplateOutlet]="template" />
202
- }
203
-
204
- @for (item of items(); track item) {
205
- <div
206
- class="kbq-overflow-items__item"
207
- #itemRef
208
- [attr.aria-hidden]="item.hidden"
209
- [class.kbq-overflow-items__item_hidden]="item.hidden"
210
- >
211
- <ng-container [ngTemplateOutlet]="item.templateRef" />
212
- </div>
213
- }
214
-
215
- @if (!reverseOverflowOrder()) {
216
- <ng-container [ngTemplateOutlet]="template" />
217
- }
218
-
219
- <ng-template #template>
220
- <div
221
- class="kbq-overflow-items__result"
222
- #resultRef
223
- [attr.aria-hidden]="resultHidden()"
224
- [class.kbq-overflow-items__result_hidden]="resultHidden()"
225
- >
226
- <ng-container
227
- [ngTemplateOutlet]="result()?.templateRef || null"
228
- [ngTemplateOutletContext]="resultTemplateContext()"
229
- />
230
- </div>
231
- </ng-template>
232
- `, host: {
233
- class: 'kbq-overflow-items'
234
- }, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{position:relative;display:flex;flex-grow:1;overflow:hidden;flex-wrap:nowrap;white-space:nowrap}.kbq-overflow-items__item,.kbq-overflow-items__result{display:flex;align-items:center}.kbq-overflow-items__item.kbq-overflow-items__item_hidden,.kbq-overflow-items__item.kbq-overflow-items__result_hidden,.kbq-overflow-items__result.kbq-overflow-items__item_hidden,.kbq-overflow-items__result.kbq-overflow-items__result_hidden{visibility:hidden;position:absolute}\n"] }]
218
+ type: Directive,
219
+ args: [{
220
+ standalone: true,
221
+ selector: '[kbqOverflowItems]',
222
+ exportAs: 'kbqOverflowItems',
223
+ host: { class: 'kbq-overflow-items' }
224
+ }]
235
225
  }], ctorParameters: () => [] });
236
226
 
237
227
  const COMPONENTS = [
@@ -260,5 +250,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImpor
260
250
  * Generated bundle index. Do not edit.
261
251
  */
262
252
 
263
- export { KbqOverflowItem, KbqOverflowItems, KbqOverflowItemsModule, KbqOverflowItemsResult };
253
+ export { ElementVisibilityManager, KbqOverflowItem, KbqOverflowItems, KbqOverflowItemsModule, KbqOverflowItemsResult };
264
254
  //# sourceMappingURL=koobiq-components-overflow-items.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"koobiq-components-overflow-items.mjs","sources":["../../../packages/components/overflow-items/overflow-items.ts","../../../packages/components/overflow-items/module.ts","../../../packages/components/overflow-items/koobiq-components-overflow-items.ts"],"sourcesContent":["import { SharedResizeObserver } from '@angular/cdk/observers/private';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n computed,\n contentChild,\n contentChildren,\n Directive,\n ElementRef,\n inject,\n input,\n numberAttribute,\n signal,\n TemplateRef,\n viewChild,\n viewChildren\n} from '@angular/core';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\nimport { debounceTime, merge, skip } from 'rxjs';\n\n/**\n * Template context for the `KbqOverflowItemsResult` directive.\n *\n * @see `KbqOverflowItemsResult`\n */\nexport type KbqOverflowItemsResultContext = {\n /**\n * Set of hidden item ID's.\n *\n * Example:\n *\n * ```html\n * <ng-template kbqOverflowItemsResult let-hiddenItemIDs>\n * {{ hiddenItemIDs.size }}\n * </ng-template>\n * ````\n */\n $implicit: ReadonlySet<unknown>;\n /**\n * Set of hidden item ID's.\n *\n * Example:\n *\n * ```html\n * <ng-template kbqOverflowItemsResult let-hiddenItemIDs=\"hiddenItemIDs\">\n * @if (hiddenItemIDs.has(SOME_ID)) {...}\n * </ng-template>\n * ````\n */\n hiddenItemIDs: ReadonlySet<unknown>;\n};\n\n/**\n * Directive for providing `KbqOverflowItemsResultContext` to the `KbqOverflowItems` component.\n *\n * @see `KbqOverflowItemsResultContext`\n */\n@Directive({\n standalone: true,\n selector: 'ng-template[kbqOverflowItemsResult]'\n})\nexport class KbqOverflowItemsResult {\n /**\n * TemplateRef for the overflow result.\n *\n * @docs-private\n */\n readonly templateRef = inject<TemplateRef<KbqOverflowItemsResultContext>>(TemplateRef);\n}\n\n/**\n * Structure directive for providing items to the `KbqOverflowItems`.\n */\n@Directive({\n standalone: true,\n selector: '[kbqOverflowItem]'\n})\nexport class KbqOverflowItem {\n /**\n * Identifier for the item.\n */\n readonly id = input.required({ alias: 'kbqOverflowItem' });\n\n /**\n * Whether the item is hidden.\n *\n * @docs-private\n */\n hidden: boolean = false;\n\n /**\n * TemplateRef for the item.\n *\n * @docs-private\n */\n readonly templateRef = inject(TemplateRef);\n}\n\n/**\n * Component for automatically hiding elements with dynamic adaptation to the container width.\n */\n@Component({\n standalone: true,\n selector: 'kbq-overflow-items',\n imports: [NgTemplateOutlet],\n template: `\n @if (reverseOverflowOrder()) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n }\n\n @for (item of items(); track item) {\n <div\n class=\"kbq-overflow-items__item\"\n #itemRef\n [attr.aria-hidden]=\"item.hidden\"\n [class.kbq-overflow-items__item_hidden]=\"item.hidden\"\n >\n <ng-container [ngTemplateOutlet]=\"item.templateRef\" />\n </div>\n }\n\n @if (!reverseOverflowOrder()) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n }\n\n <ng-template #template>\n <div\n class=\"kbq-overflow-items__result\"\n #resultRef\n [attr.aria-hidden]=\"resultHidden()\"\n [class.kbq-overflow-items__result_hidden]=\"resultHidden()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"result()?.templateRef || null\"\n [ngTemplateOutletContext]=\"resultTemplateContext()\"\n />\n </div>\n </ng-template>\n `,\n styleUrl: './overflow-items.scss',\n host: {\n class: 'kbq-overflow-items'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class KbqOverflowItems {\n private readonly itemElementRefs = viewChildren<string, ElementRef<HTMLElement>>('itemRef', { read: ElementRef });\n\n /**\n * `KbqOverflowItem` directive references.\n *\n * @docs-private\n */\n protected readonly items = contentChildren(KbqOverflowItem);\n\n /**\n * `KbqOverflowItemsResult` directive reference.\n *\n * @docs-private\n */\n protected readonly result = contentChild(KbqOverflowItemsResult);\n\n private readonly resultElementRef = viewChild<string, ElementRef<HTMLElement>>('resultRef', { read: ElementRef });\n\n /**\n * Template context for the `KbqOverflowItemsResult` directive.\n *\n * @docs-private\n */\n protected readonly resultTemplateContext = computed<KbqOverflowItemsResultContext>(() => {\n const hiddenItemIDs = this.hiddenItemIDs();\n return {\n $implicit: hiddenItemIDs,\n hiddenItemIDs: hiddenItemIDs\n };\n });\n\n private readonly hiddenItemIDs = signal<ReadonlySet<unknown>>(new Set([]));\n\n /**\n * Whether the overflow result is hidden.\n *\n * @docs-private\n */\n protected readonly resultHidden = computed(() => this.hiddenItemIDs().size === 0);\n\n /**\n * Whether the overflow order should be reversed.\n * Also changes the position of the `resultTemplateRef`.\n *\n * @default false\n */\n readonly reverseOverflowOrder = input(false, { transform: booleanAttribute });\n\n /**\n * Debounce time for recalculating items visibility.\n *\n * @default 100\n */\n readonly debounceTime = input(100, { transform: numberAttribute });\n\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly resizeObserver = inject(SharedResizeObserver);\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n\n constructor() {\n merge(\n toObservable(this.items),\n toObservable(this.reverseOverflowOrder).pipe(skip(1)),\n this.resizeObserver.observe(this.elementRef.nativeElement)\n )\n .pipe(debounceTime(this.debounceTime()), takeUntilDestroyed())\n .subscribe(() => {\n const items = this.items();\n this.updateItemsVisibility(\n items,\n this.itemElementRefs(),\n this.reverseOverflowOrder(),\n this.resultElementRef(),\n this.elementRef.nativeElement\n );\n this.hiddenItemIDs.set(new Set(items.filter(this.isHiddenItem).map(({ id }) => id())));\n this.changeDetectorRef.markForCheck();\n });\n }\n\n /**\n * Updates items visibility, based on the container width and the `reverseOverflowOrder` flag.\n */\n private updateItemsVisibility(\n items: readonly KbqOverflowItem[],\n itemElementRefs: readonly ElementRef<HTMLElement>[],\n reverseOverflowOrder: boolean,\n resultElementRef: ElementRef<HTMLElement> | undefined,\n { offsetWidth: totalWidth }: HTMLElement\n ): void {\n items.forEach((item) => {\n item.hidden = false;\n });\n let itemsWidth = items.reduce((width, _, index) => width + itemElementRefs[index].nativeElement.offsetWidth, 0);\n const startIndex = reverseOverflowOrder ? 0 : items.length - 1;\n const endIndex = reverseOverflowOrder ? items.length : -1;\n const step = reverseOverflowOrder ? 1 : -1;\n const resultWidth = resultElementRef?.nativeElement.offsetWidth || 0;\n for (let index = startIndex; index !== endIndex; index += step) {\n const current = items[index];\n const currentWidth = itemElementRefs[index].nativeElement.offsetWidth;\n const _resultWidth = items.some(this.isHiddenItem) ? resultWidth : 0;\n if (itemsWidth + _resultWidth > totalWidth) {\n current.hidden = true;\n itemsWidth -= currentWidth;\n } else {\n const isEdgeElement = reverseOverflowOrder ? index === 0 : index === items.length - 1;\n const _resultWidth = isEdgeElement ? 0 : resultWidth;\n if (itemsWidth + currentWidth + _resultWidth <= totalWidth) {\n current.hidden = false;\n itemsWidth += currentWidth;\n }\n }\n }\n }\n\n /**\n * Determines if the given item is hidden.\n */\n private isHiddenItem = ({ hidden }: KbqOverflowItem) => hidden;\n}\n","import { NgModule } from '@angular/core';\nimport { KbqOverflowItem, KbqOverflowItems, KbqOverflowItemsResult } from './overflow-items';\n\nconst COMPONENTS = [\n KbqOverflowItems,\n KbqOverflowItem,\n KbqOverflowItemsResult\n];\n\n@NgModule({\n imports: COMPONENTS,\n exports: COMPONENTS\n})\nexport class KbqOverflowItemsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAuDA;;;;AAIG;MAKU,sBAAsB,CAAA;AAJnC,IAAA,WAAA,GAAA;AAKI;;;;AAIG;AACM,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAA6C,WAAW,CAAC,CAAC;AAC1F,KAAA;iIAPY,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;qHAAtB,sBAAsB,EAA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A;kBAJlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,UAAU;AACnB,oBAAA,OAAO,EAAE,UAAU;AACtB,iBAAA,CAAA;;;ACZD;;AAEG;;;;"}
1
+ {"version":3,"file":"koobiq-components-overflow-items.mjs","sources":["../../../packages/components/overflow-items/overflow-items.ts","../../../packages/components/overflow-items/module.ts","../../../packages/components/overflow-items/koobiq-components-overflow-items.ts"],"sourcesContent":["import { SharedResizeObserver } from '@angular/cdk/observers/private';\nimport { DOCUMENT } from '@angular/common';\nimport {\n booleanAttribute,\n contentChild,\n contentChildren,\n Directive,\n ElementRef,\n inject,\n input,\n numberAttribute,\n output,\n Renderer2,\n signal\n} from '@angular/core';\nimport { outputToObservable, takeUntilDestroyed, toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { debounceTime, merge, skip } from 'rxjs';\n\n/**\n * Manages the visibility of the element.\n *\n * @docs-private\n */\n@Directive({\n host: {\n '[attr.aria-hidden]': 'hidden()'\n }\n})\nexport class ElementVisibilityManager {\n private readonly renderer = inject(Renderer2);\n\n /**\n * Reference to the element.\n *\n * @docs-private\n */\n readonly elementRef = inject(ElementRef);\n\n /**\n * Whether the element is hidden.\n *\n * @docs-private\n */\n readonly hidden = signal(false);\n\n /**\n * Hides the element.\n *\n * @docs-private\n */\n hide(): void {\n this.renderer.setStyle(this.elementRef.nativeElement, 'visibility', 'hidden');\n this.renderer.setStyle(this.elementRef.nativeElement, 'position', 'absolute');\n this.hidden.set(true);\n }\n\n /**\n * Shows the element.\n *\n * @docs-private\n */\n show(): void {\n this.renderer.removeStyle(this.elementRef.nativeElement, 'visibility');\n this.renderer.removeStyle(this.elementRef.nativeElement, 'position');\n this.hidden.set(false);\n }\n}\n\n/**\n * Directive for displaying the result of hidden items by the `KbqOverflowItems` directive.\n */\n@Directive({\n standalone: true,\n selector: '[kbqOverflowItemsResult]',\n exportAs: 'kbqOverflowItemsResult',\n host: { class: 'kbq-overflow-items-result' }\n})\nexport class KbqOverflowItemsResult extends ElementVisibilityManager {}\n\n/**\n * Directive for the item that can be hidden by the `KbqOverflowItems` directive.\n */\n@Directive({\n standalone: true,\n selector: '[kbqOverflowItem]',\n exportAs: 'kbqOverflowItem',\n host: { class: 'kbq-overflow-item' }\n})\nexport class KbqOverflowItem extends ElementVisibilityManager {\n /**\n * Unique identifier for the item.\n */\n readonly id = input.required({ alias: 'kbqOverflowItem' });\n}\n\n/**\n * Directive for managing the visibility of items that overflow the container.\n */\n@Directive({\n standalone: true,\n selector: '[kbqOverflowItems]',\n exportAs: 'kbqOverflowItems',\n host: { class: 'kbq-overflow-items' }\n})\nexport class KbqOverflowItems {\n /**\n * `KbqOverflowItem` directive references.\n *\n * @docs-private\n */\n private readonly items = contentChildren(KbqOverflowItem);\n\n /**\n * `KbqOverflowItemsResult` directive reference.\n *\n * @docs-private\n */\n private readonly result = contentChild(KbqOverflowItemsResult);\n\n /**\n * Whether the overflow order should be reversed.\n *\n * @default false\n */\n readonly reverseOverflowOrder = input(false, { transform: booleanAttribute });\n\n /**\n * Debounce time for recalculating items visibility.\n *\n * @default 100\n */\n readonly debounceTime = input(100, { transform: numberAttribute });\n\n /**\n * Emits when the set of hidden items changes.\n */\n readonly changes = output<ReadonlySet<unknown>>();\n\n /**\n * Set of hidden item IDs.\n */\n readonly hiddenItemIDs = toSignal(outputToObservable(this.changes), {\n initialValue: new Set<unknown>([]) as ReadonlySet<unknown>\n });\n\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly resizeObserver = inject(SharedResizeObserver);\n private readonly renderer = inject(Renderer2);\n private readonly document = inject(DOCUMENT);\n\n constructor() {\n this.setStyles();\n\n merge(\n toObservable(this.items),\n toObservable(this.reverseOverflowOrder).pipe(skip(1)),\n this.resizeObserver.observe(this.elementRef.nativeElement)\n )\n .pipe(debounceTime(this.debounceTime()), takeUntilDestroyed())\n .subscribe(() => {\n const hiddenItems = this.calculateItemsVisibility(\n this.items(),\n this.reverseOverflowOrder(),\n this.result(),\n this.elementRef.nativeElement\n );\n const hiddenItemIDs = new Set(hiddenItems.map(({ id }) => id()));\n this.changes.emit(hiddenItemIDs);\n });\n }\n\n /**\n * Calculates the visibility of items, based on the container width and `reverseOverflowOrder` property.\n */\n private calculateItemsVisibility(\n items: readonly KbqOverflowItem[],\n reverseOverflowOrder: boolean,\n result: KbqOverflowItemsResult | undefined,\n { offsetWidth: totalWidth }: HTMLElement\n ): KbqOverflowItem[] {\n result?.hide();\n items.forEach((item) => {\n item.show();\n });\n let itemsWidth = items.reduce(\n (width, { elementRef }) => width + this.getElementWidthWithMargins(elementRef),\n 0\n );\n const startIndex = reverseOverflowOrder ? 0 : items.length - 1;\n const endIndex = reverseOverflowOrder ? items.length : -1;\n const step = reverseOverflowOrder ? 1 : -1;\n const resultWidth = result ? this.getElementWidthWithMargins(result.elementRef) : 0;\n for (let index = startIndex; index !== endIndex; index += step) {\n const current = items[index];\n const currentWidth = this.getElementWidthWithMargins(current.elementRef);\n const _resultWidth = items.some(this.isHiddenItem) ? resultWidth : 0;\n if (itemsWidth + _resultWidth > totalWidth) {\n current.hide();\n itemsWidth -= currentWidth;\n } else {\n const isEdgeElement = reverseOverflowOrder ? index === 0 : index === items.length - 1;\n const _resultWidth = isEdgeElement ? 0 : resultWidth;\n if (itemsWidth + currentWidth + _resultWidth <= totalWidth) {\n current.show();\n itemsWidth += currentWidth;\n }\n }\n }\n const hiddenItems = items.filter(this.isHiddenItem);\n if (hiddenItems.length > 0) {\n result?.show();\n }\n return hiddenItems;\n }\n\n /**\n * Returns the width of the element including margins.\n */\n private getElementWidthWithMargins({ nativeElement }: ElementRef<HTMLElement>): number {\n const { marginLeft, marginRight } = this.getWindow().getComputedStyle(nativeElement);\n return Math.ceil(parseFloat(marginLeft) + nativeElement.offsetWidth + parseFloat(marginRight));\n }\n\n /**\n * This method sets the necessary styles for the directive.\n */\n private setStyles(): void {\n this.renderer.setStyle(this.elementRef.nativeElement, 'position', 'relative');\n this.renderer.setStyle(this.elementRef.nativeElement, 'display', 'flex');\n this.renderer.setStyle(this.elementRef.nativeElement, 'flex-wrap', 'nowrap');\n this.renderer.setStyle(this.elementRef.nativeElement, 'flex-grow', '1');\n this.renderer.setStyle(this.elementRef.nativeElement, 'overflow', 'hidden');\n }\n\n /**\n * Determines if the given item is hidden.\n */\n private isHiddenItem = ({ hidden }: KbqOverflowItem) => hidden();\n\n /**\n * Returns the window object.\n */\n private getWindow(): Window {\n return this.document.defaultView || window;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { KbqOverflowItem, KbqOverflowItems, KbqOverflowItemsResult } from './overflow-items';\n\nconst COMPONENTS = [\n KbqOverflowItems,\n KbqOverflowItem,\n KbqOverflowItemsResult\n];\n\n@NgModule({\n imports: COMPONENTS,\n exports: COMPONENTS\n})\nexport class KbqOverflowItemsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAkBA;;;;AAIG;MAMU,wBAAwB,CAAA;AALrC,IAAA,WAAA,GAAA;AAMqB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAE9C;;;;AAIG;AACM,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAEzC;;;;AAIG;AACM,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAuBnC,KAAA;AArBG;;;;AAIG;IACH,IAAI,GAAA;AACA,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;AAC9E,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AAC9E,QAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,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