@ngbase/adk 0.1.1 → 0.1.3

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 (275) hide show
  1. package/a11y/accessibility-group.d.ts +2 -5
  2. package/accordion/accordion-item.d.ts +7 -1
  3. package/accordion/public-api.d.ts +1 -1
  4. package/autocomplete/autocomplete-input.d.ts +2 -4
  5. package/autocomplete/autocomplete.d.ts +13 -4
  6. package/avatar/avatar.d.ts +1 -1
  7. package/breadcrumb/breadcrumb.d.ts +2 -3
  8. package/breadcrumb/public-api.d.ts +1 -1
  9. package/carousel/carousel.d.ts +3 -3
  10. package/checkbox/checkbox.d.ts +11 -3
  11. package/checkbox/public-api.d.ts +1 -1
  12. package/chip/chip.d.ts +2 -2
  13. package/datepicker/calendar.d.ts +3 -3
  14. package/datepicker/datepicker-trigger.d.ts +22 -5
  15. package/datepicker/datepicker.d.ts +4 -3
  16. package/datepicker/time.d.ts +2 -2
  17. package/dialog/dialog.d.ts +1 -1
  18. package/drag/drag.d.ts +1 -2
  19. package/fesm2022/ngbase-adk-a11y.mjs +29 -26
  20. package/fesm2022/ngbase-adk-a11y.mjs.map +1 -1
  21. package/fesm2022/ngbase-adk-accordion.mjs +16 -3
  22. package/fesm2022/ngbase-adk-accordion.mjs.map +1 -1
  23. package/fesm2022/ngbase-adk-autocomplete.mjs +23 -52
  24. package/fesm2022/ngbase-adk-autocomplete.mjs.map +1 -1
  25. package/fesm2022/ngbase-adk-avatar.mjs +2 -2
  26. package/fesm2022/ngbase-adk-avatar.mjs.map +1 -1
  27. package/fesm2022/ngbase-adk-breadcrumb.mjs +2 -2
  28. package/fesm2022/ngbase-adk-breadcrumb.mjs.map +1 -1
  29. package/fesm2022/ngbase-adk-carousel.mjs +7 -7
  30. package/fesm2022/ngbase-adk-carousel.mjs.map +1 -1
  31. package/fesm2022/ngbase-adk-checkbox.mjs +8 -6
  32. package/fesm2022/ngbase-adk-checkbox.mjs.map +1 -1
  33. package/fesm2022/ngbase-adk-chip.mjs +4 -2
  34. package/fesm2022/ngbase-adk-chip.mjs.map +1 -1
  35. package/fesm2022/ngbase-adk-datepicker.mjs +187 -350
  36. package/fesm2022/ngbase-adk-datepicker.mjs.map +1 -1
  37. package/fesm2022/ngbase-adk-dialog.mjs +14 -15
  38. package/fesm2022/ngbase-adk-dialog.mjs.map +1 -1
  39. package/fesm2022/ngbase-adk-drag.mjs +1 -2
  40. package/fesm2022/ngbase-adk-drag.mjs.map +1 -1
  41. package/fesm2022/ngbase-adk-form-field.mjs +2 -156
  42. package/fesm2022/ngbase-adk-form-field.mjs.map +1 -1
  43. package/fesm2022/ngbase-adk-list.mjs +2 -2
  44. package/fesm2022/ngbase-adk-list.mjs.map +1 -1
  45. package/fesm2022/ngbase-adk-mask.mjs +5 -3
  46. package/fesm2022/ngbase-adk-mask.mjs.map +1 -1
  47. package/fesm2022/ngbase-adk-menu.mjs +34 -34
  48. package/fesm2022/ngbase-adk-menu.mjs.map +1 -1
  49. package/fesm2022/ngbase-adk-otp.mjs +164 -0
  50. package/fesm2022/ngbase-adk-otp.mjs.map +1 -0
  51. package/fesm2022/ngbase-adk-pagination.mjs +10 -67
  52. package/fesm2022/ngbase-adk-pagination.mjs.map +1 -1
  53. package/fesm2022/ngbase-adk-popover.mjs +434 -556
  54. package/fesm2022/ngbase-adk-popover.mjs.map +1 -1
  55. package/fesm2022/ngbase-adk-portal.mjs +5 -10
  56. package/fesm2022/ngbase-adk-portal.mjs.map +1 -1
  57. package/fesm2022/ngbase-adk-radio.mjs +8 -19
  58. package/fesm2022/ngbase-adk-radio.mjs.map +1 -1
  59. package/fesm2022/ngbase-adk-resizable.mjs +10 -43
  60. package/fesm2022/ngbase-adk-resizable.mjs.map +1 -1
  61. package/fesm2022/ngbase-adk-select.mjs +87 -185
  62. package/fesm2022/ngbase-adk-select.mjs.map +1 -1
  63. package/fesm2022/ngbase-adk-sheet.mjs +95 -0
  64. package/fesm2022/ngbase-adk-sheet.mjs.map +1 -0
  65. package/fesm2022/ngbase-adk-sidenav.mjs +2 -2
  66. package/fesm2022/ngbase-adk-sidenav.mjs.map +1 -1
  67. package/fesm2022/ngbase-adk-slider.mjs +12 -23
  68. package/fesm2022/ngbase-adk-slider.mjs.map +1 -1
  69. package/fesm2022/ngbase-adk-sonner.mjs +13 -63
  70. package/fesm2022/ngbase-adk-sonner.mjs.map +1 -1
  71. package/fesm2022/ngbase-adk-stepper.mjs +16 -114
  72. package/fesm2022/ngbase-adk-stepper.mjs.map +1 -1
  73. package/fesm2022/ngbase-adk-switch.mjs +2 -2
  74. package/fesm2022/ngbase-adk-switch.mjs.map +1 -1
  75. package/fesm2022/ngbase-adk-table.mjs +17 -35
  76. package/fesm2022/ngbase-adk-table.mjs.map +1 -1
  77. package/fesm2022/ngbase-adk-tabs.mjs +14 -94
  78. package/fesm2022/ngbase-adk-tabs.mjs.map +1 -1
  79. package/fesm2022/ngbase-adk-test.mjs +11 -1
  80. package/fesm2022/ngbase-adk-test.mjs.map +1 -1
  81. package/fesm2022/ngbase-adk-tooltip.mjs +49 -39
  82. package/fesm2022/ngbase-adk-tooltip.mjs.map +1 -1
  83. package/fesm2022/ngbase-adk-tour.mjs +3 -3
  84. package/fesm2022/ngbase-adk-tour.mjs.map +1 -1
  85. package/fesm2022/ngbase-adk-tree.mjs +11 -43
  86. package/fesm2022/ngbase-adk-tree.mjs.map +1 -1
  87. package/fesm2022/ngbase-adk-utils.mjs +12 -9
  88. package/fesm2022/ngbase-adk-utils.mjs.map +1 -1
  89. package/form-field/public-api.d.ts +0 -1
  90. package/mask/mask.d.ts +1 -2
  91. package/menu/menu-trigger.d.ts +3 -3
  92. package/menu/menu.d.ts +13 -7
  93. package/otp/index.d.ts +5 -0
  94. package/{form-field → otp}/otp.d.ts +1 -1
  95. package/otp/public-api.d.ts +1 -0
  96. package/package.json +27 -19
  97. package/pagination/pagination.d.ts +7 -3
  98. package/popover/base-popover.service.d.ts +1 -1
  99. package/popover/popover-arrow.ng.d.ts +34 -0
  100. package/popover/popover.d.ts +17 -7
  101. package/popover/popover.service.d.ts +5 -4
  102. package/popover/public-api.d.ts +1 -0
  103. package/popover/utils.d.ts +32 -48
  104. package/portal/dialog-ref.d.ts +0 -1
  105. package/portal/portal-base.service.d.ts +3 -3
  106. package/portal/portal-close.directive.d.ts +3 -2
  107. package/radio/radio.d.ts +5 -1
  108. package/resizable/resizable-group.d.ts +2 -2
  109. package/resizable/resizable.d.ts +2 -2
  110. package/select/option-group.d.ts +3 -3
  111. package/select/option.d.ts +1 -1
  112. package/select/select-base.d.ts +8 -6
  113. package/select/select.d.ts +6 -3
  114. package/sheet/index.d.ts +5 -0
  115. package/sheet/public-api.d.ts +2 -0
  116. package/sheet/sheet.d.ts +26 -0
  117. package/sheet/sheet.service.d.ts +13 -0
  118. package/sidenav/public-api.d.ts +1 -1
  119. package/sidenav/sidenav.d.ts +1 -1
  120. package/slider/public-api.d.ts +1 -1
  121. package/slider/slider.d.ts +6 -5
  122. package/sonner/sonner.d.ts +2 -1
  123. package/stepper/animation.d.ts +1 -1
  124. package/stepper/step.d.ts +1 -1
  125. package/stepper/stepper.d.ts +2 -2
  126. package/switch/switch.d.ts +1 -1
  127. package/table/body-row.d.ts +3 -3
  128. package/table/head-row.d.ts +3 -3
  129. package/table/table.d.ts +3 -3
  130. package/tabs/tab-group.d.ts +4 -4
  131. package/tabs/tab.d.ts +2 -2
  132. package/test/utils.d.ts +19 -3
  133. package/tooltip/public-api.d.ts +1 -1
  134. package/tooltip/tooltip.d.ts +5 -1
  135. package/tooltip/tooltip.directive.d.ts +1 -1
  136. package/tooltip/tooltip.service.d.ts +4 -2
  137. package/tour/tour.service.d.ts +3 -4
  138. package/tree/public-api.d.ts +2 -2
  139. package/tree/tree-node.d.ts +2 -2
  140. package/tree/tree.d.ts +2 -2
  141. package/utils/utils.d.ts +5 -4
  142. package/schematics/collection.json +0 -15
  143. package/schematics/components/files/accordion/accordion.ts.template +0 -55
  144. package/schematics/components/files/accordion/index.ts.template +0 -5
  145. package/schematics/components/files/alert/alert.ts.template +0 -62
  146. package/schematics/components/files/alert/index.ts.template +0 -1
  147. package/schematics/components/files/autocomplete/autocomplete.ts.template +0 -48
  148. package/schematics/components/files/autocomplete/index.ts.template +0 -5
  149. package/schematics/components/files/avatar/avatar.ts.template +0 -31
  150. package/schematics/components/files/avatar/index.ts.template +0 -1
  151. package/schematics/components/files/badge/badge.ts.template +0 -11
  152. package/schematics/components/files/badge/index.ts.template +0 -1
  153. package/schematics/components/files/breadcrumb/breadcrumb.ts.template +0 -49
  154. package/schematics/components/files/breadcrumb/index.ts.template +0 -1
  155. package/schematics/components/files/button/button.ts.template +0 -29
  156. package/schematics/components/files/button/index.ts.template +0 -5
  157. package/schematics/components/files/card/card.ts.template +0 -11
  158. package/schematics/components/files/card/index.ts.template +0 -5
  159. package/schematics/components/files/carousel/carousel.ts.template +0 -44
  160. package/schematics/components/files/carousel/index.ts.template +0 -1
  161. package/schematics/components/files/checkbox/checkbox.ts.template +0 -46
  162. package/schematics/components/files/checkbox/focus-style.directive.ts.template +0 -12
  163. package/schematics/components/files/checkbox/index.ts.template +0 -6
  164. package/schematics/components/files/chip/chip.ts.template +0 -36
  165. package/schematics/components/files/chip/index.ts.template +0 -1
  166. package/schematics/components/files/color-picker/color-picker.ts.template +0 -104
  167. package/schematics/components/files/color-picker/index.ts.template +0 -5
  168. package/schematics/components/files/command/command.ts.template +0 -82
  169. package/schematics/components/files/command/index.ts.template +0 -1
  170. package/schematics/components/files/datepicker/calendar.ts.template +0 -117
  171. package/schematics/components/files/datepicker/datepicker-trigger.ts.template +0 -27
  172. package/schematics/components/files/datepicker/datepicker.ts.template +0 -28
  173. package/schematics/components/files/datepicker/index.ts.template +0 -3
  174. package/schematics/components/files/datepicker/time.ts.template +0 -46
  175. package/schematics/components/files/dialog/dialog.ts.template +0 -89
  176. package/schematics/components/files/dialog/index.ts.template +0 -5
  177. package/schematics/components/files/drawer/drawer.ts.template +0 -104
  178. package/schematics/components/files/drawer/index.ts.template +0 -5
  179. package/schematics/components/files/form-field/index.ts.template +0 -7
  180. package/schematics/components/files/form-field/input-style.directive.ts.template +0 -11
  181. package/schematics/components/files/form-field/input.ts.template +0 -100
  182. package/schematics/components/files/form-field/otp.ts.template +0 -37
  183. package/schematics/components/files/hover-card/hover-card.ts.template +0 -13
  184. package/schematics/components/files/hover-card/index.ts.template +0 -5
  185. package/schematics/components/files/icon/icon.ts.template +0 -16
  186. package/schematics/components/files/icon/index.ts.template +0 -1
  187. package/schematics/components/files/inline-edit/index.ts.template +0 -1
  188. package/schematics/components/files/inline-edit/inline-edit.ts.template +0 -24
  189. package/schematics/components/files/keys/index.ts.template +0 -5
  190. package/schematics/components/files/keys/key.ts.template +0 -35
  191. package/schematics/components/files/list/index.ts.template +0 -5
  192. package/schematics/components/files/list/list.ts.template +0 -28
  193. package/schematics/components/files/mask/index.ts.template +0 -1
  194. package/schematics/components/files/mask/mask.ts.template +0 -8
  195. package/schematics/components/files/menu/context-menu.ts.template +0 -14
  196. package/schematics/components/files/menu/index.ts.template +0 -8
  197. package/schematics/components/files/menu/mention.ts.template +0 -14
  198. package/schematics/components/files/menu/menu.ts.template +0 -37
  199. package/schematics/components/files/menu/navigation-menu.ts.template +0 -8
  200. package/schematics/components/files/pagination/index.ts.template +0 -1
  201. package/schematics/components/files/pagination/pagination.ts.template +0 -71
  202. package/schematics/components/files/picasa/index.ts.template +0 -1
  203. package/schematics/components/files/picasa/picasa-base.component.ts.template +0 -80
  204. package/schematics/components/files/picasa/picasa.component.ts.template +0 -57
  205. package/schematics/components/files/picasa/picasa.directive.ts.template +0 -41
  206. package/schematics/components/files/picasa/picase.service.ts.template +0 -24
  207. package/schematics/components/files/popover/index.ts.template +0 -1
  208. package/schematics/components/files/popover/popover.ts.template +0 -87
  209. package/schematics/components/files/progress/index.ts.template +0 -5
  210. package/schematics/components/files/progress/progress.ts.template +0 -14
  211. package/schematics/components/files/radio/index.ts.template +0 -5
  212. package/schematics/components/files/radio/radio.ts.template +0 -40
  213. package/schematics/components/files/resizable/index.ts.template +0 -5
  214. package/schematics/components/files/resizable/resizable.ts.template +0 -56
  215. package/schematics/components/files/scroll-area/index.ts.template +0 -1
  216. package/schematics/components/files/scroll-area/scroll-area.ts.template +0 -40
  217. package/schematics/components/files/select/index.ts.template +0 -8
  218. package/schematics/components/files/select/list-selection.ts.template +0 -15
  219. package/schematics/components/files/select/option.ts.template +0 -34
  220. package/schematics/components/files/select/select-input.ts.template +0 -21
  221. package/schematics/components/files/select/select.ts.template +0 -96
  222. package/schematics/components/files/selectable/index.ts.template +0 -1
  223. package/schematics/components/files/selectable/selectable.ts.template +0 -34
  224. package/schematics/components/files/separator/index.ts.template +0 -5
  225. package/schematics/components/files/separator/separator.ts.template +0 -19
  226. package/schematics/components/files/sheet/index.ts.template +0 -5
  227. package/schematics/components/files/sheet/sheet.ts.template +0 -134
  228. package/schematics/components/files/sidenav/index.ts.template +0 -1
  229. package/schematics/components/files/sidenav/sidenav.ts.template +0 -48
  230. package/schematics/components/files/skeleton/index.ts.template +0 -1
  231. package/schematics/components/files/skeleton/skeleton.ts.template +0 -15
  232. package/schematics/components/files/slider/index.ts.template +0 -5
  233. package/schematics/components/files/slider/slider.ts.template +0 -42
  234. package/schematics/components/files/sonner/index.ts.template +0 -5
  235. package/schematics/components/files/sonner/sonner.ts.template +0 -58
  236. package/schematics/components/files/spinner/index.ts.template +0 -1
  237. package/schematics/components/files/spinner/spinner.ts.template +0 -79
  238. package/schematics/components/files/stepper/index.ts.template +0 -1
  239. package/schematics/components/files/stepper/stepper.ts.template +0 -88
  240. package/schematics/components/files/switch/index.ts.template +0 -5
  241. package/schematics/components/files/switch/switch.ts.template +0 -29
  242. package/schematics/components/files/table/body-cell.ts.template +0 -19
  243. package/schematics/components/files/table/body-row.ts.template +0 -21
  244. package/schematics/components/files/table/column.ts.template +0 -8
  245. package/schematics/components/files/table/head-cell.ts.template +0 -19
  246. package/schematics/components/files/table/head-row.ts.template +0 -27
  247. package/schematics/components/files/table/index.ts.template +0 -26
  248. package/schematics/components/files/table/table.ts.template +0 -20
  249. package/schematics/components/files/tabs/index.ts.template +0 -5
  250. package/schematics/components/files/tabs/tab.ts.template +0 -89
  251. package/schematics/components/files/theme/index.ts.template +0 -2
  252. package/schematics/components/files/theme/theme-button.component.ts.template +0 -26
  253. package/schematics/components/files/theme/theme.component.ts.template +0 -165
  254. package/schematics/components/files/theme/theme.service.ts.template +0 -44
  255. package/schematics/components/files/toggle/index.ts.template +0 -5
  256. package/schematics/components/files/toggle/toggle.ts.template +0 -13
  257. package/schematics/components/files/toggle-group/index.ts.template +0 -5
  258. package/schematics/components/files/toggle-group/toggle-group.ts.template +0 -25
  259. package/schematics/components/files/tooltip/index.ts.template +0 -5
  260. package/schematics/components/files/tooltip/tooltip.ts.template +0 -40
  261. package/schematics/components/files/tour/index.ts.template +0 -3
  262. package/schematics/components/files/tour/tour-step.ts.template +0 -8
  263. package/schematics/components/files/tour/tour.service.ts.template +0 -7
  264. package/schematics/components/files/tour/tour.ts.template +0 -8
  265. package/schematics/components/files/tree/index.ts.template +0 -1
  266. package/schematics/components/files/tree/tree.ts.template +0 -66
  267. package/schematics/components/index.d.ts +0 -3
  268. package/schematics/components/index.js +0 -17
  269. package/schematics/components/index.js.map +0 -1
  270. package/schematics/components/index.ts +0 -29
  271. package/schematics/components/schema.d.ts +0 -6
  272. package/schematics/components/schema.js +0 -3
  273. package/schematics/components/schema.js.map +0 -1
  274. package/schematics/components/schema.json +0 -137
  275. package/schematics/components/schema.ts +0 -6
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, contentChildren, forwardRef, input, effect, untracked, Component, ChangeDetectionStrategy, linkedSignal, Directive, ViewContainerRef, viewChild, TemplateRef, computed, signal } from '@angular/core';
2
+ import { inject, ElementRef, contentChildren, forwardRef, input, effect, untracked, Directive, linkedSignal, ViewContainerRef, viewChild, TemplateRef, computed, signal } from '@angular/core';
3
3
  import * as i1 from '@ngbase/adk/drag';
4
4
  import { Drag } from '@ngbase/adk/drag';
5
5
  import { DOCUMENT } from '@angular/common';
@@ -80,24 +80,20 @@ class NgbResizableGroup {
80
80
  panel.onEnd();
81
81
  });
82
82
  }
83
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbResizableGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
84
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.0", type: NgbResizableGroup, isStandalone: true, selector: "[ngbResizableGroup]", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.flex-col": "direction() === 'vertical'", "attr.id": "id" }, classAttribute: "flex w-full" }, queries: [{ propertyName: "panels", predicate: i0.forwardRef(() => NgbResizable), isSignal: true }], exportAs: ["ngbResizableGroup"], ngImport: i0, template: `<ng-content select="[ngbResizable]" />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
83
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbResizableGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
84
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.0", type: NgbResizableGroup, isStandalone: true, selector: "[ngbResizableGroup]", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "id" } }, queries: [{ propertyName: "panels", predicate: i0.forwardRef(() => NgbResizable), isSignal: true }], exportAs: ["ngbResizableGroup"], ngImport: i0 }); }
85
85
  }
86
86
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbResizableGroup, decorators: [{
87
- type: Component,
87
+ type: Directive,
88
88
  args: [{
89
89
  selector: '[ngbResizableGroup]',
90
90
  exportAs: 'ngbResizableGroup',
91
- changeDetection: ChangeDetectionStrategy.OnPush,
92
- template: `<ng-content select="[ngbResizable]" />`,
93
91
  host: {
94
- class: 'flex w-full',
95
- '[class.flex-col]': "direction() === 'vertical'",
96
92
  '[attr.id]': 'id',
97
93
  },
98
94
  }]
99
95
  }], ctorParameters: () => [] });
100
- function provideResizableGroup(resizableGroup) {
96
+ function aliasResizableGroup(resizableGroup) {
101
97
  return { provide: NgbResizableGroup, useExisting: resizableGroup };
102
98
  }
103
99
 
@@ -312,46 +308,17 @@ class NgbResizable {
312
308
  this.el.nativeElement.style.height = this.str;
313
309
  }
314
310
  }
315
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbResizable, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
316
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: NgbResizable, isStandalone: true, selector: "[ngbResizable]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "dragElement", first: true, predicate: ["dragElement"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "drag", first: true, predicate: Drag, descendants: true, isSignal: true }], exportAs: ["ngbResizable"], ngImport: i0, template: `<ng-content />
317
- <ng-template #dragElement>
318
- @if (draggable()) {
319
- <div
320
- ngbGutter
321
- class="{{
322
- 'dragElement relative flex cursor-ew-resize items-center justify-center after:absolute after:top-0 ' +
323
- (resizable.direction() === 'vertical'
324
- ? 'bottom-0 left-0 h-0 w-full cursor-ns-resize border-b after:-mt-1 after:h-2 after:w-full'
325
- : 'right-0 top-0 w-0 cursor-ew-resize border-l after:h-full after:w-2')
326
- }}"
327
- ></div>
328
- }
329
- </ng-template>`, isInline: true, dependencies: [{ kind: "directive", type: NgbGutter, selector: "[ngbGutter]", exportAs: ["ngbGutter"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
311
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbResizable, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
312
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.0", type: NgbResizable, isStandalone: true, selector: "[ngbResizable]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "dragElement", first: true, predicate: ["dragElement"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "drag", first: true, predicate: Drag, descendants: true, isSignal: true }], exportAs: ["ngbResizable"], ngImport: i0 }); }
330
313
  }
331
314
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbResizable, decorators: [{
332
- type: Component,
315
+ type: Directive,
333
316
  args: [{
334
317
  selector: '[ngbResizable]',
335
318
  exportAs: 'ngbResizable',
336
- imports: [Drag, NgbGutter],
337
- changeDetection: ChangeDetectionStrategy.OnPush,
338
- template: `<ng-content />
339
- <ng-template #dragElement>
340
- @if (draggable()) {
341
- <div
342
- ngbGutter
343
- class="{{
344
- 'dragElement relative flex cursor-ew-resize items-center justify-center after:absolute after:top-0 ' +
345
- (resizable.direction() === 'vertical'
346
- ? 'bottom-0 left-0 h-0 w-full cursor-ns-resize border-b after:-mt-1 after:h-2 after:w-full'
347
- : 'right-0 top-0 w-0 cursor-ew-resize border-l after:h-full after:w-2')
348
- }}"
349
- ></div>
350
- }
351
- </ng-template>`,
352
319
  }]
353
320
  }], ctorParameters: () => [] });
354
- function provideResizable(resizable) {
321
+ function aliasResizable(resizable) {
355
322
  return { provide: NgbResizable, useExisting: resizable };
356
323
  }
357
324
 
@@ -363,5 +330,5 @@ function provideResizable(resizable) {
363
330
  * Generated bundle index. Do not edit.
364
331
  */
365
332
 
366
- export { NgbGutter, NgbResizable, NgbResizableGroup, provideResizable, provideResizableGroup };
333
+ export { NgbGutter, NgbResizable, NgbResizableGroup, aliasResizable, aliasResizableGroup };
367
334
  //# sourceMappingURL=ngbase-adk-resizable.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ngbase-adk-resizable.mjs","sources":["../../../projects/adk/resizable/resizable-group.ts","../../../projects/adk/resizable/resizable.ts","../../../projects/adk/resizable/public-api.ts","../../../projects/adk/resizable/ngbase-adk-resizable.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n contentChildren,\n effect,\n forwardRef,\n inject,\n input,\n untracked,\n} from '@angular/core';\nimport { uniqueId } from '@ngbase/adk/utils';\nimport { NgbResizable } from './resizable';\n\n@Component({\n selector: '[ngbResizableGroup]',\n exportAs: 'ngbResizableGroup',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `<ng-content select=\"[ngbResizable]\" />`,\n host: {\n class: 'flex w-full',\n '[class.flex-col]': \"direction() === 'vertical'\",\n '[attr.id]': 'id',\n },\n})\nexport class NgbResizableGroup {\n readonly document = inject(DOCUMENT);\n readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly panels = contentChildren(forwardRef(() => NgbResizable));\n readonly direction = input<'horizontal' | 'vertical'>('horizontal');\n readonly id = uniqueId();\n\n private overlayDiv?: HTMLDivElement;\n\n constructor() {\n effect(() => {\n const panels = this.panels();\n\n untracked(() => {\n // set the index of each panel first before initializing the drag\n panels.forEach((panel, index) => {\n panel.index = index;\n });\n panels.forEach((panel, index) => {\n // hide the last panel's drag handle\n panel.draggable.set(index !== panels.length - 1);\n if (panel.size() !== 'auto') {\n panel.handleDrag();\n }\n });\n // we need to called setAuto after all panels have been initialized\n // because the number of panels could have changed\n this.setAuto();\n });\n });\n }\n\n get w() {\n return this.el.nativeElement.clientWidth;\n }\n\n get h() {\n return this.el.nativeElement.clientHeight;\n }\n\n setAuto() {\n const panels = this.panels();\n let str = 'calc(100%';\n const autos = [];\n for (const panel of panels) {\n if (panel.size() !== 'auto') {\n str += panel.str ? ` - ${panel.str}` : '';\n } else {\n autos.push(panel);\n }\n }\n str += ')';\n if (autos.length > 1) {\n str = `calc(${str} / ${autos.length})`;\n }\n for (const auto of autos) {\n auto.lSize.set(str);\n auto.handleDrag();\n }\n }\n\n start() {\n const div = this.document.createElement('div');\n div.style.position = 'absolute';\n div.style.top = '0';\n div.style.left = '0';\n div.style.width = '100%';\n div.style.height = '100%';\n div.style.zIndex = '9999';\n div.style.cursor = 'ew-resize';\n this.document.body.appendChild(div);\n this.overlayDiv = div;\n\n this.panels().forEach(panel => {\n panel.onStart();\n });\n }\n\n end() {\n this.overlayDiv?.remove();\n this.panels().forEach(panel => {\n panel.onEnd();\n });\n }\n}\n\nexport function provideResizableGroup(resizableGroup: typeof NgbResizableGroup) {\n return { provide: NgbResizableGroup, useExisting: resizableGroup };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n Directive,\n ElementRef,\n TemplateRef,\n ViewContainerRef,\n computed,\n effect,\n inject,\n input,\n linkedSignal,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { Drag, DragData } from '@ngbase/adk/drag';\nimport { NgbResizableGroup } from './resizable-group';\n\n@Directive({\n selector: '[ngbGutter]',\n exportAs: 'ngbGutter',\n hostDirectives: [Drag],\n host: {\n role: 'separator',\n '[attr.aria-valuemin]': 'resizable.min()',\n '[attr.aria-valuemax]': 'resizable.max()',\n },\n})\nexport class NgbGutter {\n readonly resizable = inject(NgbResizable);\n readonly drag = inject(Drag);\n\n constructor() {\n this.drag._lockAxis = linkedSignal(this.resizable.lockAxis);\n this.drag._dragBoundary = linkedSignal(() => `#${this.resizable.id}`);\n }\n}\n\n@Component({\n selector: '[ngbResizable]',\n exportAs: 'ngbResizable',\n imports: [Drag, NgbGutter],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `<ng-content />\n <ng-template #dragElement>\n @if (draggable()) {\n <div\n ngbGutter\n class=\"{{\n 'dragElement relative flex cursor-ew-resize items-center justify-center after:absolute after:top-0 ' +\n (resizable.direction() === 'vertical'\n ? 'bottom-0 left-0 h-0 w-full cursor-ns-resize border-b after:-mt-1 after:h-2 after:w-full'\n : 'right-0 top-0 w-0 cursor-ew-resize border-l after:h-full after:w-2')\n }}\"\n ></div>\n }\n </ng-template>`,\n})\nexport class NgbResizable {\n // Dependencies\n readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly resizable = inject(NgbResizableGroup);\n readonly containerRef = inject(ViewContainerRef);\n readonly dragElement = viewChild('dragElement', { read: TemplateRef });\n readonly drag = viewChild(Drag);\n readonly id = this.resizable.id;\n readonly lockAxis = computed(() => (this.resizable.direction() === 'horizontal' ? 'x' : 'y'));\n\n // inputs\n readonly size = input<number | string>('auto');\n readonly min = input<number | string>(0);\n readonly max = input<number | string>();\n\n // State\n readonly lSize = linkedSignal({\n source: this.size,\n computation: size => (size !== 'auto' ? size : ''),\n });\n readonly draggable = signal(false);\n private reducedSize = 0;\n private localMinSize = Infinity;\n private localMaxSize = -Infinity;\n private lastReducedSize = 0;\n index = 0;\n str = '';\n\n constructor() {\n effect(() => {\n const size = this.size();\n untracked(() => {\n if (size !== 'auto') this.handleDrag();\n\n this.resizable.setAuto();\n });\n });\n\n // This effect is responsible for creating the gutter element\n effect(() => {\n const cf = this.containerRef;\n if (this.draggable() && this.size()) {\n if (cf.length === 0) {\n untracked(() => cf.createEmbeddedView(this.dragElement()!));\n }\n } else {\n cf.clear();\n }\n });\n\n // This effect is responsible for handling the drag events\n effect(cleanup => {\n const drag = this.drag();\n\n if (!drag) return;\n\n untracked(() => {\n const sub = drag.events.subscribe((data: DragData) => {\n data.event?.preventDefault();\n\n requestAnimationFrame(() => this.onDrag(data));\n });\n cleanup(() => sub.unsubscribe());\n });\n });\n }\n\n // get w() {\n // return this.el.nativeElement.clientWidth;\n // }\n\n // get h() {\n // return this.el.nativeElement.clientHeight;\n // }\n\n cSize() {\n return this.resizable.direction() === 'horizontal'\n ? this.el.nativeElement.offsetWidth\n : this.el.nativeElement.offsetHeight;\n }\n\n onStart() {\n const cSize = this.cSize();\n const minSize = this.getSize(this.min());\n this.localMinSize = cSize + this.reducedSize - minSize;\n if (this.max()) {\n const maxSize = this.getSize(this.max());\n this.localMaxSize = cSize + this.reducedSize - maxSize;\n }\n // console.log(`onStart ${this.index}`, this.min(), this.localMinSize, this.localMaxSize);\n }\n\n onEnd() {\n this.localMinSize = Infinity;\n this.localMaxSize = -Infinity;\n this.lastReducedSize = this.reducedSize;\n }\n\n private getSize(size?: number | string): number {\n if (!size) return 0;\n\n const minValue = size;\n if (typeof minValue === 'number') {\n // If number, treat as percentage\n return (\n (this.resizable.direction() === 'horizontal' ? this.resizable.w : this.resizable.h) *\n (minValue / 100)\n );\n }\n\n // Handle pixel values\n const pixelMatch = minValue?.toString().match(/(\\d+)px/);\n if (pixelMatch) {\n return parseInt(pixelMatch[1], 10);\n }\n\n // Handle percentage values provided as string\n const percentMatch = minValue?.toString().match(/(\\d+)%/);\n if (percentMatch) {\n return (\n (this.resizable.direction() === 'horizontal' ? this.resizable.w : this.resizable.h) *\n (parseInt(percentMatch[1], 10) / 100)\n );\n }\n\n return 0;\n }\n\n onDrag(data: DragData): void {\n if (data.type === 'start') {\n this.resizable.start();\n }\n\n // We have to call end method without calling handleDrag to avoid layout thrashing\n if (data.type === 'end') {\n this.resizable.end();\n } else {\n this.handleDrag(data);\n }\n }\n\n handleDrag(event = { x: 0, y: 0 } as DragData) {\n const isHorizontal = this.resizable.direction() === 'horizontal';\n\n let delta = isHorizontal ? event.x : event.y;\n delta -= this.lastReducedSize;\n\n const panels = this.resizable.panels();\n\n let remaining = -delta;\n for (let i = this.index; i >= 0; i--) {\n const panel = panels[i];\n remaining = panel.getUpdatedSize(remaining).remaining;\n if (remaining === 0) {\n break;\n }\n }\n delta = delta + remaining;\n remaining = delta;\n for (let i = this.index + 1; i < panels.length; i++) {\n const panel = panels[i];\n remaining = panel.getUpdatedSize(remaining).remaining;\n if (remaining === 0) {\n break;\n }\n }\n delta = delta - remaining;\n\n const current = panels[this.index];\n current.updateSize(delta, 'both');\n }\n\n private getUpdatedSize(px: number): { remaining: number; value: number } {\n const v = Math.max(Math.min(px, this.localMinSize), this.localMaxSize);\n return { remaining: px - v, value: v };\n }\n\n updateSize(px: number, direct: 'both' | 'prev' | 'next') {\n const prevSize = -px;\n const { remaining, value } = this.getUpdatedSize(prevSize);\n this.reducedSize = value;\n\n this.updateFlex();\n const isSame = prevSize !== this.reducedSize;\n\n const v = direct === 'both' ? px : remaining;\n\n if ((isSame && direct === 'next') || direct === 'both') {\n // console.log(`updateSize ${this.index}`, this.reducedSize, px, value, v);\n const next = this.resizable.panels()[this.index + 1];\n next?.updateSize(-v, 'next');\n }\n if (isSame && (direct === 'prev' || direct === 'both')) {\n const prev = this.resizable.panels()[this.index - 1];\n prev?.updateSize(v, 'prev');\n }\n }\n\n private calculateSize(): string {\n const size = this.lSize();\n\n const baseSize = typeof size === 'number' ? `${size}%` : size;\n\n if (this.reducedSize === 0) {\n return baseSize;\n }\n\n return `calc(${baseSize} - ${this.reducedSize}px)`;\n }\n\n private updateFlex() {\n const size = this.calculateSize();\n this.updateElementSize(size || '0px');\n }\n\n updateElementSize(str: string) {\n this.str = str;\n if (this.resizable.direction() === 'horizontal') {\n this.el.nativeElement.style.width = this.str;\n } else {\n this.el.nativeElement.style.height = this.str;\n }\n }\n}\n\nexport function provideResizable(resizable: typeof NgbResizable) {\n return { provide: NgbResizable, useExisting: resizable };\n}\n","/*\n * Public API Surface of resizable\n */\n\nexport * from './resizable';\nexport * from './resizable-group';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"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A,EAAA,IAAA,EAAA,WAAW,EACzC,QAAA,EAAA,IAAA,EAAA,EAAA,EAAA,YAAA,EAAA,MAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,IAAI,EArBpB,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA;;;;;;;;;;;;;AAaO,kBAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EA5BN,SAAS,EAAA,QAAA,EAAA,aAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FA8BT,YAAY,EAAA,UAAA,EAAA,CAAA;kBApBxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC;oBAC1B,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE,CAAA;;;;;;;;;;;;;AAaO,kBAAA,CAAA;AAClB,iBAAA;;AAkOK,SAAU,gBAAgB,CAAC,SAA8B,EAAA;IAC7D,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE;AAC1D;;AC9RA;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"ngbase-adk-resizable.mjs","sources":["../../../projects/adk/resizable/resizable-group.ts","../../../projects/adk/resizable/resizable.ts","../../../projects/adk/resizable/public-api.ts","../../../projects/adk/resizable/ngbase-adk-resizable.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport {\n Directive,\n ElementRef,\n contentChildren,\n effect,\n forwardRef,\n inject,\n input,\n untracked,\n} from '@angular/core';\nimport { uniqueId } from '@ngbase/adk/utils';\nimport { NgbResizable } from './resizable';\n\n@Directive({\n selector: '[ngbResizableGroup]',\n exportAs: 'ngbResizableGroup',\n host: {\n '[attr.id]': 'id',\n },\n})\nexport class NgbResizableGroup {\n readonly document = inject(DOCUMENT);\n readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly panels = contentChildren(forwardRef(() => NgbResizable));\n\n readonly direction = input<'horizontal' | 'vertical'>('horizontal');\n\n readonly id = uniqueId();\n\n private overlayDiv?: HTMLDivElement;\n\n constructor() {\n effect(() => {\n const panels = this.panels();\n\n untracked(() => {\n // set the index of each panel first before initializing the drag\n panels.forEach((panel, index) => {\n panel.index = index;\n });\n panels.forEach((panel, index) => {\n // hide the last panel's drag handle\n panel.draggable.set(index !== panels.length - 1);\n if (panel.size() !== 'auto') {\n panel.handleDrag();\n }\n });\n // we need to called setAuto after all panels have been initialized\n // because the number of panels could have changed\n this.setAuto();\n });\n });\n }\n\n get w() {\n return this.el.nativeElement.clientWidth;\n }\n\n get h() {\n return this.el.nativeElement.clientHeight;\n }\n\n setAuto() {\n const panels = this.panels();\n let str = 'calc(100%';\n const autos = [];\n for (const panel of panels) {\n if (panel.size() !== 'auto') {\n str += panel.str ? ` - ${panel.str}` : '';\n } else {\n autos.push(panel);\n }\n }\n str += ')';\n if (autos.length > 1) {\n str = `calc(${str} / ${autos.length})`;\n }\n for (const auto of autos) {\n auto.lSize.set(str);\n auto.handleDrag();\n }\n }\n\n start() {\n const div = this.document.createElement('div');\n div.style.position = 'absolute';\n div.style.top = '0';\n div.style.left = '0';\n div.style.width = '100%';\n div.style.height = '100%';\n div.style.zIndex = '9999';\n div.style.cursor = 'ew-resize';\n this.document.body.appendChild(div);\n this.overlayDiv = div;\n\n this.panels().forEach(panel => {\n panel.onStart();\n });\n }\n\n end() {\n this.overlayDiv?.remove();\n this.panels().forEach(panel => {\n panel.onEnd();\n });\n }\n}\n\nexport function aliasResizableGroup(resizableGroup: typeof NgbResizableGroup) {\n return { provide: NgbResizableGroup, useExisting: resizableGroup };\n}\n","import {\n Directive,\n ElementRef,\n TemplateRef,\n ViewContainerRef,\n computed,\n effect,\n inject,\n input,\n linkedSignal,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { Drag, DragData } from '@ngbase/adk/drag';\nimport { NgbResizableGroup } from './resizable-group';\n\n@Directive({\n selector: '[ngbGutter]',\n exportAs: 'ngbGutter',\n hostDirectives: [Drag],\n host: {\n role: 'separator',\n '[attr.aria-valuemin]': 'resizable.min()',\n '[attr.aria-valuemax]': 'resizable.max()',\n },\n})\nexport class NgbGutter {\n readonly resizable = inject(NgbResizable);\n readonly drag = inject(Drag);\n\n constructor() {\n this.drag._lockAxis = linkedSignal(this.resizable.lockAxis);\n this.drag._dragBoundary = linkedSignal(() => `#${this.resizable.id}`);\n }\n}\n\n@Directive({\n selector: '[ngbResizable]',\n exportAs: 'ngbResizable',\n})\nexport class NgbResizable {\n // Dependencies\n readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly resizable = inject(NgbResizableGroup);\n readonly containerRef = inject(ViewContainerRef);\n readonly dragElement = viewChild('dragElement', { read: TemplateRef });\n readonly drag = viewChild(Drag);\n readonly id = this.resizable.id;\n readonly lockAxis = computed(() => (this.resizable.direction() === 'horizontal' ? 'x' : 'y'));\n\n // inputs\n readonly size = input<number | string>('auto');\n readonly min = input<number | string>(0);\n readonly max = input<number | string>();\n\n // State\n readonly lSize = linkedSignal({\n source: this.size,\n computation: size => (size !== 'auto' ? size : ''),\n });\n readonly draggable = signal(false);\n private reducedSize = 0;\n private localMinSize = Infinity;\n private localMaxSize = -Infinity;\n private lastReducedSize = 0;\n index = 0;\n str = '';\n\n constructor() {\n effect(() => {\n const size = this.size();\n untracked(() => {\n if (size !== 'auto') this.handleDrag();\n\n this.resizable.setAuto();\n });\n });\n\n // This effect is responsible for creating the gutter element\n effect(() => {\n const cf = this.containerRef;\n if (this.draggable() && this.size()) {\n if (cf.length === 0) {\n untracked(() => cf.createEmbeddedView(this.dragElement()!));\n }\n } else {\n cf.clear();\n }\n });\n\n // This effect is responsible for handling the drag events\n effect(cleanup => {\n const drag = this.drag();\n\n if (!drag) return;\n\n untracked(() => {\n const sub = drag.events.subscribe((data: DragData) => {\n data.event?.preventDefault();\n\n requestAnimationFrame(() => this.onDrag(data));\n });\n cleanup(() => sub.unsubscribe());\n });\n });\n }\n\n // get w() {\n // return this.el.nativeElement.clientWidth;\n // }\n\n // get h() {\n // return this.el.nativeElement.clientHeight;\n // }\n\n cSize() {\n return this.resizable.direction() === 'horizontal'\n ? this.el.nativeElement.offsetWidth\n : this.el.nativeElement.offsetHeight;\n }\n\n onStart() {\n const cSize = this.cSize();\n const minSize = this.getSize(this.min());\n this.localMinSize = cSize + this.reducedSize - minSize;\n if (this.max()) {\n const maxSize = this.getSize(this.max());\n this.localMaxSize = cSize + this.reducedSize - maxSize;\n }\n // console.log(`onStart ${this.index}`, this.min(), this.localMinSize, this.localMaxSize);\n }\n\n onEnd() {\n this.localMinSize = Infinity;\n this.localMaxSize = -Infinity;\n this.lastReducedSize = this.reducedSize;\n }\n\n private getSize(size?: number | string): number {\n if (!size) return 0;\n\n const minValue = size;\n if (typeof minValue === 'number') {\n // If number, treat as percentage\n return (\n (this.resizable.direction() === 'horizontal' ? this.resizable.w : this.resizable.h) *\n (minValue / 100)\n );\n }\n\n // Handle pixel values\n const pixelMatch = minValue?.toString().match(/(\\d+)px/);\n if (pixelMatch) {\n return parseInt(pixelMatch[1], 10);\n }\n\n // Handle percentage values provided as string\n const percentMatch = minValue?.toString().match(/(\\d+)%/);\n if (percentMatch) {\n return (\n (this.resizable.direction() === 'horizontal' ? this.resizable.w : this.resizable.h) *\n (parseInt(percentMatch[1], 10) / 100)\n );\n }\n\n return 0;\n }\n\n onDrag(data: DragData): void {\n if (data.type === 'start') {\n this.resizable.start();\n }\n\n // We have to call end method without calling handleDrag to avoid layout thrashing\n if (data.type === 'end') {\n this.resizable.end();\n } else {\n this.handleDrag(data);\n }\n }\n\n handleDrag(event = { x: 0, y: 0 } as DragData) {\n const isHorizontal = this.resizable.direction() === 'horizontal';\n\n let delta = isHorizontal ? event.x : event.y;\n delta -= this.lastReducedSize;\n\n const panels = this.resizable.panels();\n\n let remaining = -delta;\n for (let i = this.index; i >= 0; i--) {\n const panel = panels[i];\n remaining = panel.getUpdatedSize(remaining).remaining;\n if (remaining === 0) {\n break;\n }\n }\n delta = delta + remaining;\n remaining = delta;\n for (let i = this.index + 1; i < panels.length; i++) {\n const panel = panels[i];\n remaining = panel.getUpdatedSize(remaining).remaining;\n if (remaining === 0) {\n break;\n }\n }\n delta = delta - remaining;\n\n const current = panels[this.index];\n current.updateSize(delta, 'both');\n }\n\n private getUpdatedSize(px: number): { remaining: number; value: number } {\n const v = Math.max(Math.min(px, this.localMinSize), this.localMaxSize);\n return { remaining: px - v, value: v };\n }\n\n updateSize(px: number, direct: 'both' | 'prev' | 'next') {\n const prevSize = -px;\n const { remaining, value } = this.getUpdatedSize(prevSize);\n this.reducedSize = value;\n\n this.updateFlex();\n const isSame = prevSize !== this.reducedSize;\n\n const v = direct === 'both' ? px : remaining;\n\n if ((isSame && direct === 'next') || direct === 'both') {\n // console.log(`updateSize ${this.index}`, this.reducedSize, px, value, v);\n const next = this.resizable.panels()[this.index + 1];\n next?.updateSize(-v, 'next');\n }\n if (isSame && (direct === 'prev' || direct === 'both')) {\n const prev = this.resizable.panels()[this.index - 1];\n prev?.updateSize(v, 'prev');\n }\n }\n\n private calculateSize(): string {\n const size = this.lSize();\n\n const baseSize = typeof size === 'number' ? `${size}%` : size;\n\n if (this.reducedSize === 0) {\n return baseSize;\n }\n\n return `calc(${baseSize} - ${this.reducedSize}px)`;\n }\n\n private updateFlex() {\n const size = this.calculateSize();\n this.updateElementSize(size || '0px');\n }\n\n updateElementSize(str: string) {\n this.str = str;\n if (this.resizable.direction() === 'horizontal') {\n this.el.nativeElement.style.width = this.str;\n } else {\n this.el.nativeElement.style.height = this.str;\n }\n }\n}\n\nexport function aliasResizable(resizable: typeof NgbResizable) {\n return { provide: NgbResizable, useExisting: resizable };\n}\n","/*\n * Public API Surface of resizable\n */\n\nexport * from './resizable';\nexport * from './resizable-group';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAqBa,iBAAiB,CAAA;AAW5B,IAAA,WAAA,GAAA;AAVS,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC;QAChD,IAAM,CAAA,MAAA,GAAG,eAAe,CAAC,UAAU,CAAC,MAAM,YAAY,CAAC,CAAC;AAExD,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAA4B,YAAY,CAAC;QAE1D,IAAE,CAAA,EAAA,GAAG,QAAQ,EAAE;QAKtB,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;YAE5B,SAAS,CAAC,MAAK;;gBAEb,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,KAAI;AAC9B,oBAAA,KAAK,CAAC,KAAK,GAAG,KAAK;AACrB,iBAAC,CAAC;gBACF,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,KAAI;;AAE9B,oBAAA,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,KAAK,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;AAChD,oBAAA,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,MAAM,EAAE;wBAC3B,KAAK,CAAC,UAAU,EAAE;;AAEtB,iBAAC,CAAC;;;gBAGF,IAAI,CAAC,OAAO,EAAE;AAChB,aAAC,CAAC;AACJ,SAAC,CAAC;;AAGJ,IAAA,IAAI,CAAC,GAAA;AAC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,cAAc,CAAC,SAA8B,EAAA;IAC3D,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE;AAC1D;;AC5QA;;AAEG;;ACFH;;AAEG;;;;"}
@@ -1,9 +1,7 @@
1
- import { NgTemplateOutlet } from '@angular/common';
2
1
  import * as i0 from '@angular/core';
3
- import { inject, ElementRef, input, booleanAttribute, output, signal, linkedSignal, Directive, contentChildren, viewChild, TemplateRef, model, computed, effect, untracked, contentChild, Component, ChangeDetectionStrategy, forwardRef } from '@angular/core';
4
- import { FormsModule } from '@angular/forms';
2
+ import { inject, ElementRef, input, booleanAttribute, output, signal, linkedSignal, Directive, contentChildren, viewChild, TemplateRef, model, computed, effect, untracked, contentChild } from '@angular/core';
5
3
  import * as i1 from '@ngbase/adk/a11y';
6
- import { AccessibleItem, Autofocus, AccessibleGroup } from '@ngbase/adk/a11y';
4
+ import { AccessibleItem, AccessibleGroup, Autofocus } from '@ngbase/adk/a11y';
7
5
  import { uniqueId, filterFunction, provideValueAccessor } from '@ngbase/adk/utils';
8
6
  import { Directionality } from '@ngbase/adk/bidi';
9
7
  import { ngbPopoverPortal } from '@ngbase/adk/popover';
@@ -37,13 +35,16 @@ class NgbOption {
37
35
  }
38
36
  focus() {
39
37
  this.el.nativeElement.scrollIntoView({ block: 'nearest' });
40
- this.el.nativeElement.classList.add('bg-muted-background');
38
+ this.el.nativeElement.classList.add('bg-muted');
41
39
  }
42
40
  unselect() {
43
- this.el.nativeElement.classList.remove('bg-muted-background');
41
+ this.el.nativeElement.classList.remove('bg-muted');
44
42
  }
45
43
  getValue() {
46
- return this.value() || this.label();
44
+ if (this.value() === undefined) {
45
+ return this.label();
46
+ }
47
+ return this.value();
47
48
  }
48
49
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbOption, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
49
50
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: NgbOption, isStandalone: true, selector: "[ngbOption]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ayId: { classPropertyName: "ayId", publicName: "ayId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSelectionChange: "onSelectionChange" }, host: { attributes: { "role": "option", "tabindex": "-1" }, listeners: { "click": "selectOption()" } }, hostDirectives: [{ directive: i1.AccessibleItem }], ngImport: i0 }); }
@@ -87,16 +88,17 @@ class SelectBase {
87
88
  this.container = viewChild('container', { read: ElementRef });
88
89
  this.optionsGroup = viewChild('optionsGroup', { read: ElementRef });
89
90
  // inputs
90
- this.options = input([]);
91
91
  this.value = model('');
92
+ this.disabled = model(false);
92
93
  this.multiple = input(false, { transform: booleanAttribute });
94
+ this.noAutoClose = input(false, { transform: booleanAttribute });
95
+ this.options = input([]);
93
96
  this.placeholder = input(' ');
94
- this.disabled = model(false);
95
97
  this.size = input('free');
96
98
  this.opened = output();
97
99
  this.closed = output();
98
100
  // state
99
- this.sideOffset = 0;
101
+ this.defaultOptions = {};
100
102
  this.panelOpen = signal(false);
101
103
  this.values = signal([]);
102
104
  this.status = signal('closed');
@@ -153,7 +155,7 @@ class SelectBase {
153
155
  this.setValue([option.getValue()]);
154
156
  option.checked.set(!option.checked());
155
157
  option.onSelectionChange.emit(option.getValue());
156
- if (!this.multiple()) {
158
+ if (!this.multiple() && !this.noAutoClose()) {
157
159
  this.close();
158
160
  }
159
161
  });
@@ -188,6 +190,7 @@ class SelectBase {
188
190
  }
189
191
  const el = this.target?.target() || this.container()?.nativeElement || this.el.nativeElement;
190
192
  const { diaRef, events } = this.popover.open(this.optionsTemplate(), {
193
+ ...this.defaultOptions,
191
194
  target: el,
192
195
  position: this.dir.isRtl() ? 'br' : 'bl',
193
196
  backdrop: this.isSelect,
@@ -195,7 +198,6 @@ class SelectBase {
195
198
  maxHeight: '400px',
196
199
  ayId: this.ayId,
197
200
  focusTrap: false,
198
- sideOffset: this.sideOffset,
199
201
  afterFocusEl: this.container()?.nativeElement || this.el.nativeElement,
200
202
  });
201
203
  this.withInPopup = false;
@@ -266,7 +268,8 @@ class SelectBase {
266
268
  else {
267
269
  localValue = values;
268
270
  setValue = values[0];
269
- this.close();
271
+ if (!this.noAutoClose())
272
+ this.close();
270
273
  }
271
274
  // console.log('setValue', localValue, this.values());
272
275
  this.values.set(localValue);
@@ -304,69 +307,12 @@ class SelectBase {
304
307
  this.close();
305
308
  }
306
309
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SelectBase, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
307
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.0", type: SelectBase, isStandalone: true, inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange", opened: "opened", closed: "closed" }, queries: [{ propertyName: "list", predicate: NgbOption, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "optionsTemplate", first: true, predicate: ["optionsTemplate"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "optionsGroup", first: true, predicate: ["optionsGroup"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0 }); }
310
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.0", type: SelectBase, isStandalone: true, inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, noAutoClose: { classPropertyName: "noAutoClose", publicName: "noAutoClose", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange", opened: "opened", closed: "closed" }, queries: [{ propertyName: "list", predicate: NgbOption, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "optionsTemplate", first: true, predicate: ["optionsTemplate"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "optionsGroup", first: true, predicate: ["optionsGroup"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0 }); }
308
311
  }
309
312
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SelectBase, decorators: [{
310
313
  type: Directive
311
314
  }], ctorParameters: () => [{ type: undefined }] });
312
315
 
313
- class NgbSelectInput {
314
- constructor() {
315
- // Dependencies
316
- this.el = inject(ElementRef);
317
- this.select = inject(NgbSelect, { optional: true });
318
- this.inputBase = inject(InputBase);
319
- // Inputs
320
- this.placeholder = input('Search here');
321
- this.options = input([]);
322
- this.filterFn = input();
323
- // State
324
- this.filteredOptions = computed(() => {
325
- const fn = this.filterFn();
326
- const options = this.options();
327
- const search = this.inputBase.value();
328
- const values = search ? options.filter(v => fn(search, v, options)) : options;
329
- return values;
330
- });
331
- this.select?.events.subscribe(event => {
332
- if (event === 'open') {
333
- this.inputBase.value.set('');
334
- this.el.nativeElement.focus();
335
- }
336
- });
337
- }
338
- updateSearch(value) {
339
- this.inputBase.value.set(value);
340
- }
341
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
342
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: NgbSelectInput, isStandalone: true, selector: "[ngbSelectInput]", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, filterFn: { classPropertyName: "filterFn", publicName: "filterFn", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "placeholder": "placeholder()", "tabindex": "0" } }, exportAs: ["ngbSelectInput"], hostDirectives: [{ directive: i1.Autofocus }, { directive: i2.InputBase, inputs: ["value", "value"], outputs: ["valueChange", "valueChange"] }], ngImport: i0 }); }
343
- }
344
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectInput, decorators: [{
345
- type: Directive,
346
- args: [{
347
- selector: '[ngbSelectInput]',
348
- exportAs: 'ngbSelectInput',
349
- hostDirectives: [
350
- Autofocus,
351
- { directive: InputBase, inputs: ['value'], outputs: ['valueChange'] },
352
- ],
353
- host: {
354
- '[placeholder]': 'placeholder()',
355
- '[tabindex]': '0',
356
- },
357
- }]
358
- }], ctorParameters: () => [] });
359
- class NgbSelectTrigger {
360
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
361
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: NgbSelectTrigger, isStandalone: true, selector: "[ngbSelectTrigger]", ngImport: i0 }); }
362
- }
363
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectTrigger, decorators: [{
364
- type: Directive,
365
- args: [{
366
- selector: '[ngbSelectTrigger]',
367
- }]
368
- }] });
369
-
370
316
  class NgbSelectOption {
371
317
  constructor() {
372
318
  this.template = inject((TemplateRef));
@@ -422,72 +368,20 @@ class NgbSelect extends SelectBase {
422
368
  super(true);
423
369
  this.search = model('');
424
370
  this.optionTemplate = contentChild((NgbSelectOption));
425
- this.defaultFilter = (option) => option;
426
- this.optionsFilter = filterFunction(this.options, { filter: this.defaultFilter });
371
+ this.filterFn = input((option) => option);
372
+ this.queryFn = input();
373
+ this.filterOptions = input();
374
+ this.optionsFilter = filterFunction(this.options, computed(() => this.filterOptions() ??
375
+ { filter: this.filterFn(), query: this.queryFn() }));
427
376
  }
428
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelect, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
429
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: NgbSelect, isStandalone: true, selector: "[ngbSelect]", inputs: { search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { search: "searchChange" }, host: { attributes: { "role": "listbox", "type": "button" }, listeners: { "click": "open()", "keydown.arrowdown": "open()", "keydown.arrowup": "open()", "keydown.enter": "open()", "keydown.space": "open()" }, properties: { "tabindex": "disabled() ? -1 : 0" } }, providers: [_provide(NgbSelect)], queries: [{ propertyName: "optionTemplate", first: true, predicate: (NgbSelectOption), descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
430
- <button
431
- ngbSelectValue
432
- class="flex min-h-5 w-full items-center justify-between gap-1 whitespace-nowrap outline-none"
433
- [class.opacity-50]="disabled()"
434
- >
435
- <!-- Prefix template -->
436
- <ng-content select=".select-prefix" />
437
-
438
- <span class="truncate" [class.text-muted]="!cValue()">
439
- <ng-content select="[ngbSelectTrigger]">
440
- {{ cValue() || placeholder() }}
441
- </ng-content>
442
- </span>
443
- </button>
444
-
445
- <!-- Options template -->
446
- <ng-template #optionsTemplate>
447
- <div class="flex flex-col overflow-hidden">
448
- <ng-content select="[ngbSelectInput]">
449
- @if (options().length) {
450
- <input ngbSelectInput placeholder="Search options" [(value)]="optionsFilter.search" />
451
- }
452
- </ng-content>
453
- <div #optionsGroup ngbSelectOptionGroup class="overflow-auto p-1">
454
- <div class="h-full" role="listbox" aria-label="Suggestions">
455
- <ng-content>
456
- @for (option of optionsFilter.filteredList(); track option; let i = $index) {
457
- <div ngbOption [value]="option" [ayId]="ayId">
458
- @if (optionTemplate(); as ot) {
459
- <ng-template
460
- [ngTemplateOutlet]="ot.template"
461
- [ngTemplateOutletContext]="{ $implicit: option, index: i }"
462
- />
463
- } @else {
464
- {{ option }}
465
- }
466
- </div>
467
- }
468
- </ng-content>
469
- </div>
470
- </div>
471
- </div>
472
- </ng-template>
473
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: i0.forwardRef(() => FormsModule) }, { kind: "directive", type: i0.forwardRef(() => NgbSelectInput), selector: "[ngbSelectInput]", inputs: ["placeholder", "options", "filterFn"], exportAs: ["ngbSelectInput"] }, { kind: "directive", type: i0.forwardRef(() => NgbOption), selector: "[ngbOption]", inputs: ["value", "disabled", "ayId"], outputs: ["onSelectionChange"] }, { kind: "directive", type: i0.forwardRef(() => NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i0.forwardRef(() => SelectValue), selector: "[ngbSelectValue]" }, { kind: "directive", type: i0.forwardRef(() => NgbSelectOptionGroup), selector: "[ngbSelectOptionGroup]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
377
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelect, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
378
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.0", type: NgbSelect, isStandalone: true, selector: "[ngbSelect]", inputs: { search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, filterFn: { classPropertyName: "filterFn", publicName: "filterFn", isSignal: true, isRequired: false, transformFunction: null }, queryFn: { classPropertyName: "queryFn", publicName: "queryFn", isSignal: true, isRequired: false, transformFunction: null }, filterOptions: { classPropertyName: "filterOptions", publicName: "filterOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { search: "searchChange" }, host: { attributes: { "role": "listbox", "type": "button" }, listeners: { "click": "open()", "keydown.arrowdown": "open()", "keydown.arrowup": "open()", "keydown.enter": "open()", "keydown.space": "open()" }, properties: { "tabindex": "disabled() ? -1 : 0" } }, providers: [_provide(NgbSelect)], queries: [{ propertyName: "optionTemplate", first: true, predicate: (NgbSelectOption), descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 }); }
474
379
  }
475
380
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelect, decorators: [{
476
- type: Component,
381
+ type: Directive,
477
382
  args: [{
478
383
  selector: '[ngbSelect]',
479
- changeDetection: ChangeDetectionStrategy.OnPush,
480
384
  providers: [_provide(NgbSelect)],
481
- imports: [
482
- AccessibleGroup,
483
- FormsModule,
484
- AccessibleItem,
485
- forwardRef(() => NgbSelectInput),
486
- NgbOption,
487
- NgTemplateOutlet,
488
- SelectValue,
489
- NgbSelectOptionGroup,
490
- ],
491
385
  host: {
492
386
  role: 'listbox',
493
387
  type: 'button',
@@ -498,57 +392,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
498
392
  '(keydown.space)': 'open()',
499
393
  '[tabindex]': 'disabled() ? -1 : 0',
500
394
  },
501
- template: `
502
- <button
503
- ngbSelectValue
504
- class="flex min-h-5 w-full items-center justify-between gap-1 whitespace-nowrap outline-none"
505
- [class.opacity-50]="disabled()"
506
- >
507
- <!-- Prefix template -->
508
- <ng-content select=".select-prefix" />
509
-
510
- <span class="truncate" [class.text-muted]="!cValue()">
511
- <ng-content select="[ngbSelectTrigger]">
512
- {{ cValue() || placeholder() }}
513
- </ng-content>
514
- </span>
515
- </button>
516
-
517
- <!-- Options template -->
518
- <ng-template #optionsTemplate>
519
- <div class="flex flex-col overflow-hidden">
520
- <ng-content select="[ngbSelectInput]">
521
- @if (options().length) {
522
- <input ngbSelectInput placeholder="Search options" [(value)]="optionsFilter.search" />
523
- }
524
- </ng-content>
525
- <div #optionsGroup ngbSelectOptionGroup class="overflow-auto p-1">
526
- <div class="h-full" role="listbox" aria-label="Suggestions">
527
- <ng-content>
528
- @for (option of optionsFilter.filteredList(); track option; let i = $index) {
529
- <div ngbOption [value]="option" [ayId]="ayId">
530
- @if (optionTemplate(); as ot) {
531
- <ng-template
532
- [ngTemplateOutlet]="ot.template"
533
- [ngTemplateOutletContext]="{ $implicit: option, index: i }"
534
- />
535
- } @else {
536
- {{ option }}
537
- }
538
- </div>
539
- }
540
- </ng-content>
541
- </div>
542
- </div>
543
- </div>
544
- </ng-template>
545
- `,
546
395
  }]
547
396
  }], ctorParameters: () => [] });
548
397
  function _provide(select) {
549
398
  return [{ provide: SelectBase, useExisting: select }, provideValueAccessor(select)];
550
399
  }
551
- function provideSelect(select) {
400
+ function aliasSelect(select) {
552
401
  const deps = [_provide(select), { provide: NgbSelect, useExisting: select }];
553
402
  return deps;
554
403
  }
@@ -558,17 +407,70 @@ class NgbOptionGroup {
558
407
  this.label = input.required();
559
408
  this.disabled = input(false);
560
409
  }
561
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbOptionGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
562
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.0", type: NgbOptionGroup, isStandalone: true, selector: "[ngbOptionGroup]", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `<div>{{ label() }}</div>
563
- <ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
410
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbOptionGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
411
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: NgbOptionGroup, isStandalone: true, selector: "[ngbOptionGroup]", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
564
412
  }
565
413
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbOptionGroup, decorators: [{
566
- type: Component,
414
+ type: Directive,
567
415
  args: [{
568
416
  selector: '[ngbOptionGroup]',
569
- changeDetection: ChangeDetectionStrategy.OnPush,
570
- template: `<div>{{ label() }}</div>
571
- <ng-content />`,
417
+ }]
418
+ }] });
419
+
420
+ class NgbSelectInput {
421
+ constructor() {
422
+ // Dependencies
423
+ this.el = inject(ElementRef);
424
+ this.select = inject(NgbSelect, { optional: true });
425
+ this.inputBase = inject(InputBase);
426
+ // Inputs
427
+ this.placeholder = input('Search here');
428
+ this.options = input([]);
429
+ this.filterFn = input();
430
+ // State
431
+ this.filteredOptions = computed(() => {
432
+ const fn = this.filterFn();
433
+ const options = this.options();
434
+ const search = this.inputBase.value();
435
+ const values = search ? options.filter(v => fn(search, v, options)) : options;
436
+ return values;
437
+ });
438
+ this.select?.events.subscribe(event => {
439
+ if (event === 'open') {
440
+ this.inputBase.value.set('');
441
+ this.el.nativeElement.focus();
442
+ }
443
+ });
444
+ }
445
+ updateSearch(value) {
446
+ this.inputBase.value.set(value);
447
+ }
448
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
449
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.0", type: NgbSelectInput, isStandalone: true, selector: "[ngbSelectInput]", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, filterFn: { classPropertyName: "filterFn", publicName: "filterFn", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "placeholder": "placeholder()", "tabindex": "0" } }, exportAs: ["ngbSelectInput"], hostDirectives: [{ directive: i1.Autofocus }, { directive: i2.InputBase, inputs: ["value", "value"], outputs: ["valueChange", "valueChange"] }], ngImport: i0 }); }
450
+ }
451
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectInput, decorators: [{
452
+ type: Directive,
453
+ args: [{
454
+ selector: '[ngbSelectInput]',
455
+ exportAs: 'ngbSelectInput',
456
+ hostDirectives: [
457
+ Autofocus,
458
+ { directive: InputBase, inputs: ['value'], outputs: ['valueChange'] },
459
+ ],
460
+ host: {
461
+ '[placeholder]': 'placeholder()',
462
+ '[tabindex]': '0',
463
+ },
464
+ }]
465
+ }], ctorParameters: () => [] });
466
+ class NgbSelectTrigger {
467
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
468
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0", type: NgbSelectTrigger, isStandalone: true, selector: "[ngbSelectTrigger]", ngImport: i0 }); }
469
+ }
470
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: NgbSelectTrigger, decorators: [{
471
+ type: Directive,
472
+ args: [{
473
+ selector: '[ngbSelectTrigger]',
572
474
  }]
573
475
  }] });
574
476
 
@@ -595,5 +497,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
595
497
  * Generated bundle index. Do not edit.
596
498
  */
597
499
 
598
- export { ListSelection, NgbOption, NgbOptionGroup, NgbSelect, NgbSelectInput, NgbSelectOption, NgbSelectOptionGroup, NgbSelectTarget, NgbSelectTrigger, SelectBase, SelectValue, provideSelect };
500
+ export { ListSelection, NgbOption, NgbOptionGroup, NgbSelect, NgbSelectInput, NgbSelectOption, NgbSelectOptionGroup, NgbSelectTarget, NgbSelectTrigger, SelectBase, SelectValue, aliasSelect };
599
501
  //# sourceMappingURL=ngbase-adk-select.mjs.map