@frame-kit/ui-ng 0.0.1

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 (220) hide show
  1. package/COMPONENTS.md +683 -0
  2. package/DEVELOPMENT_GUIDE.md +1102 -0
  3. package/LICENSE +21 -0
  4. package/README.md +69 -0
  5. package/THEMING.md +130 -0
  6. package/core/headline/README.md +121 -0
  7. package/core/icon/README.md +173 -0
  8. package/core/image/README.md +210 -0
  9. package/core/link/README.md +297 -0
  10. package/core/separator/README.md +145 -0
  11. package/core/text/README.md +240 -0
  12. package/directives/infinite-scroll/README.md +102 -0
  13. package/directives/spotlight/README.md +154 -0
  14. package/directives/tooltip/README.md +147 -0
  15. package/docs/endpoint-link/README.md +142 -0
  16. package/docs/method-badge/README.md +154 -0
  17. package/fesm2022/frame-kit-ui-ng-core-headline.mjs +122 -0
  18. package/fesm2022/frame-kit-ui-ng-core-headline.mjs.map +1 -0
  19. package/fesm2022/frame-kit-ui-ng-core-icon.mjs +189 -0
  20. package/fesm2022/frame-kit-ui-ng-core-icon.mjs.map +1 -0
  21. package/fesm2022/frame-kit-ui-ng-core-image.mjs +123 -0
  22. package/fesm2022/frame-kit-ui-ng-core-image.mjs.map +1 -0
  23. package/fesm2022/frame-kit-ui-ng-core-link.mjs +369 -0
  24. package/fesm2022/frame-kit-ui-ng-core-link.mjs.map +1 -0
  25. package/fesm2022/frame-kit-ui-ng-core-separator.mjs +59 -0
  26. package/fesm2022/frame-kit-ui-ng-core-separator.mjs.map +1 -0
  27. package/fesm2022/frame-kit-ui-ng-core-text.mjs +204 -0
  28. package/fesm2022/frame-kit-ui-ng-core-text.mjs.map +1 -0
  29. package/fesm2022/frame-kit-ui-ng-directives-infinite-scroll.mjs +74 -0
  30. package/fesm2022/frame-kit-ui-ng-directives-infinite-scroll.mjs.map +1 -0
  31. package/fesm2022/frame-kit-ui-ng-directives-spotlight.mjs +76 -0
  32. package/fesm2022/frame-kit-ui-ng-directives-spotlight.mjs.map +1 -0
  33. package/fesm2022/frame-kit-ui-ng-directives-tooltip.mjs +425 -0
  34. package/fesm2022/frame-kit-ui-ng-directives-tooltip.mjs.map +1 -0
  35. package/fesm2022/frame-kit-ui-ng-docs-endpoint-link.mjs +63 -0
  36. package/fesm2022/frame-kit-ui-ng-docs-endpoint-link.mjs.map +1 -0
  37. package/fesm2022/frame-kit-ui-ng-docs-method-badge.mjs +43 -0
  38. package/fesm2022/frame-kit-ui-ng-docs-method-badge.mjs.map +1 -0
  39. package/fesm2022/frame-kit-ui-ng-forms.mjs +3632 -0
  40. package/fesm2022/frame-kit-ui-ng-forms.mjs.map +1 -0
  41. package/fesm2022/frame-kit-ui-ng-layouts-app-shell.mjs +239 -0
  42. package/fesm2022/frame-kit-ui-ng-layouts-app-shell.mjs.map +1 -0
  43. package/fesm2022/frame-kit-ui-ng-layouts-content-split.mjs +132 -0
  44. package/fesm2022/frame-kit-ui-ng-layouts-content-split.mjs.map +1 -0
  45. package/fesm2022/frame-kit-ui-ng-services-overlay-orchestrator.mjs +133 -0
  46. package/fesm2022/frame-kit-ui-ng-services-overlay-orchestrator.mjs.map +1 -0
  47. package/fesm2022/frame-kit-ui-ng-services-spotlight.mjs +60 -0
  48. package/fesm2022/frame-kit-ui-ng-services-spotlight.mjs.map +1 -0
  49. package/fesm2022/frame-kit-ui-ng-services-toast.mjs +166 -0
  50. package/fesm2022/frame-kit-ui-ng-services-toast.mjs.map +1 -0
  51. package/fesm2022/frame-kit-ui-ng-ui-accordion.mjs +214 -0
  52. package/fesm2022/frame-kit-ui-ng-ui-accordion.mjs.map +1 -0
  53. package/fesm2022/frame-kit-ui-ng-ui-alert.mjs +82 -0
  54. package/fesm2022/frame-kit-ui-ng-ui-alert.mjs.map +1 -0
  55. package/fesm2022/frame-kit-ui-ng-ui-avatar-stack.mjs +76 -0
  56. package/fesm2022/frame-kit-ui-ng-ui-avatar-stack.mjs.map +1 -0
  57. package/fesm2022/frame-kit-ui-ng-ui-avatar.mjs +81 -0
  58. package/fesm2022/frame-kit-ui-ng-ui-avatar.mjs.map +1 -0
  59. package/fesm2022/frame-kit-ui-ng-ui-badge.mjs +81 -0
  60. package/fesm2022/frame-kit-ui-ng-ui-badge.mjs.map +1 -0
  61. package/fesm2022/frame-kit-ui-ng-ui-breadcrumb.mjs +68 -0
  62. package/fesm2022/frame-kit-ui-ng-ui-breadcrumb.mjs.map +1 -0
  63. package/fesm2022/frame-kit-ui-ng-ui-button.mjs +108 -0
  64. package/fesm2022/frame-kit-ui-ng-ui-button.mjs.map +1 -0
  65. package/fesm2022/frame-kit-ui-ng-ui-callout.mjs +58 -0
  66. package/fesm2022/frame-kit-ui-ng-ui-callout.mjs.map +1 -0
  67. package/fesm2022/frame-kit-ui-ng-ui-card.mjs +70 -0
  68. package/fesm2022/frame-kit-ui-ng-ui-card.mjs.map +1 -0
  69. package/fesm2022/frame-kit-ui-ng-ui-copyable-field.mjs +113 -0
  70. package/fesm2022/frame-kit-ui-ng-ui-copyable-field.mjs.map +1 -0
  71. package/fesm2022/frame-kit-ui-ng-ui-data-table.mjs +1288 -0
  72. package/fesm2022/frame-kit-ui-ng-ui-data-table.mjs.map +1 -0
  73. package/fesm2022/frame-kit-ui-ng-ui-dialog.mjs +456 -0
  74. package/fesm2022/frame-kit-ui-ng-ui-dialog.mjs.map +1 -0
  75. package/fesm2022/frame-kit-ui-ng-ui-drawer.mjs +398 -0
  76. package/fesm2022/frame-kit-ui-ng-ui-drawer.mjs.map +1 -0
  77. package/fesm2022/frame-kit-ui-ng-ui-dropdown-menu.mjs +398 -0
  78. package/fesm2022/frame-kit-ui-ng-ui-dropdown-menu.mjs.map +1 -0
  79. package/fesm2022/frame-kit-ui-ng-ui-editable-field.mjs +125 -0
  80. package/fesm2022/frame-kit-ui-ng-ui-editable-field.mjs.map +1 -0
  81. package/fesm2022/frame-kit-ui-ng-ui-icon-badge.mjs +113 -0
  82. package/fesm2022/frame-kit-ui-ng-ui-icon-badge.mjs.map +1 -0
  83. package/fesm2022/frame-kit-ui-ng-ui-icon-list.mjs +111 -0
  84. package/fesm2022/frame-kit-ui-ng-ui-icon-list.mjs.map +1 -0
  85. package/fesm2022/frame-kit-ui-ng-ui-inline-edit.mjs +103 -0
  86. package/fesm2022/frame-kit-ui-ng-ui-inline-edit.mjs.map +1 -0
  87. package/fesm2022/frame-kit-ui-ng-ui-list-editor.mjs +135 -0
  88. package/fesm2022/frame-kit-ui-ng-ui-list-editor.mjs.map +1 -0
  89. package/fesm2022/frame-kit-ui-ng-ui-loader.mjs +81 -0
  90. package/fesm2022/frame-kit-ui-ng-ui-loader.mjs.map +1 -0
  91. package/fesm2022/frame-kit-ui-ng-ui-menu-item.mjs +79 -0
  92. package/fesm2022/frame-kit-ui-ng-ui-menu-item.mjs.map +1 -0
  93. package/fesm2022/frame-kit-ui-ng-ui-nav-brand.mjs +40 -0
  94. package/fesm2022/frame-kit-ui-ng-ui-nav-brand.mjs.map +1 -0
  95. package/fesm2022/frame-kit-ui-ng-ui-nav-group.mjs +110 -0
  96. package/fesm2022/frame-kit-ui-ng-ui-nav-group.mjs.map +1 -0
  97. package/fesm2022/frame-kit-ui-ng-ui-nav-separator.mjs +91 -0
  98. package/fesm2022/frame-kit-ui-ng-ui-nav-separator.mjs.map +1 -0
  99. package/fesm2022/frame-kit-ui-ng-ui-node-tree-breadcrumb.mjs +86 -0
  100. package/fesm2022/frame-kit-ui-ng-ui-node-tree-breadcrumb.mjs.map +1 -0
  101. package/fesm2022/frame-kit-ui-ng-ui-node-tree.mjs +443 -0
  102. package/fesm2022/frame-kit-ui-ng-ui-node-tree.mjs.map +1 -0
  103. package/fesm2022/frame-kit-ui-ng-ui-note.mjs +56 -0
  104. package/fesm2022/frame-kit-ui-ng-ui-note.mjs.map +1 -0
  105. package/fesm2022/frame-kit-ui-ng-ui-numbered-list.mjs +105 -0
  106. package/fesm2022/frame-kit-ui-ng-ui-numbered-list.mjs.map +1 -0
  107. package/fesm2022/frame-kit-ui-ng-ui-pagination.mjs +110 -0
  108. package/fesm2022/frame-kit-ui-ng-ui-pagination.mjs.map +1 -0
  109. package/fesm2022/frame-kit-ui-ng-ui-progress-bar.mjs +129 -0
  110. package/fesm2022/frame-kit-ui-ng-ui-progress-bar.mjs.map +1 -0
  111. package/fesm2022/frame-kit-ui-ng-ui-sidenav-link.mjs +42 -0
  112. package/fesm2022/frame-kit-ui-ng-ui-sidenav-link.mjs.map +1 -0
  113. package/fesm2022/frame-kit-ui-ng-ui-tabs.mjs +894 -0
  114. package/fesm2022/frame-kit-ui-ng-ui-tabs.mjs.map +1 -0
  115. package/fesm2022/frame-kit-ui-ng-ui-timeline.mjs +81 -0
  116. package/fesm2022/frame-kit-ui-ng-ui-timeline.mjs.map +1 -0
  117. package/fesm2022/frame-kit-ui-ng-ui-toast.mjs +179 -0
  118. package/fesm2022/frame-kit-ui-ng-ui-toast.mjs.map +1 -0
  119. package/fesm2022/frame-kit-ui-ng-ui-user-menu.mjs +143 -0
  120. package/fesm2022/frame-kit-ui-ng-ui-user-menu.mjs.map +1 -0
  121. package/fesm2022/frame-kit-ui-ng-ui-wizard-dialog.mjs +191 -0
  122. package/fesm2022/frame-kit-ui-ng-ui-wizard-dialog.mjs.map +1 -0
  123. package/fesm2022/frame-kit-ui-ng.mjs +58 -0
  124. package/fesm2022/frame-kit-ui-ng.mjs.map +1 -0
  125. package/layouts/app-shell/README.md +357 -0
  126. package/layouts/content-split/README.md +180 -0
  127. package/package.json +253 -0
  128. package/services/overlay-orchestrator/README.md +184 -0
  129. package/services/spotlight/README.md +61 -0
  130. package/services/toast/README.md +118 -0
  131. package/types/frame-kit-ui-ng-core-headline.d.ts +38 -0
  132. package/types/frame-kit-ui-ng-core-icon.d.ts +74 -0
  133. package/types/frame-kit-ui-ng-core-image.d.ts +93 -0
  134. package/types/frame-kit-ui-ng-core-link.d.ts +251 -0
  135. package/types/frame-kit-ui-ng-core-separator.d.ts +28 -0
  136. package/types/frame-kit-ui-ng-core-text.d.ts +186 -0
  137. package/types/frame-kit-ui-ng-directives-infinite-scroll.d.ts +42 -0
  138. package/types/frame-kit-ui-ng-directives-spotlight.d.ts +51 -0
  139. package/types/frame-kit-ui-ng-directives-tooltip.d.ts +70 -0
  140. package/types/frame-kit-ui-ng-docs-endpoint-link.d.ts +43 -0
  141. package/types/frame-kit-ui-ng-docs-method-badge.d.ts +30 -0
  142. package/types/frame-kit-ui-ng-forms.d.ts +1674 -0
  143. package/types/frame-kit-ui-ng-layouts-app-shell.d.ts +75 -0
  144. package/types/frame-kit-ui-ng-layouts-content-split.d.ts +43 -0
  145. package/types/frame-kit-ui-ng-services-overlay-orchestrator.d.ts +96 -0
  146. package/types/frame-kit-ui-ng-services-spotlight.d.ts +32 -0
  147. package/types/frame-kit-ui-ng-services-toast.d.ts +100 -0
  148. package/types/frame-kit-ui-ng-ui-accordion.d.ts +86 -0
  149. package/types/frame-kit-ui-ng-ui-alert.d.ts +34 -0
  150. package/types/frame-kit-ui-ng-ui-avatar-stack.d.ts +38 -0
  151. package/types/frame-kit-ui-ng-ui-avatar.d.ts +36 -0
  152. package/types/frame-kit-ui-ng-ui-badge.d.ts +33 -0
  153. package/types/frame-kit-ui-ng-ui-breadcrumb.d.ts +45 -0
  154. package/types/frame-kit-ui-ng-ui-button.d.ts +48 -0
  155. package/types/frame-kit-ui-ng-ui-callout.d.ts +26 -0
  156. package/types/frame-kit-ui-ng-ui-card.d.ts +30 -0
  157. package/types/frame-kit-ui-ng-ui-copyable-field.d.ts +62 -0
  158. package/types/frame-kit-ui-ng-ui-data-table.d.ts +482 -0
  159. package/types/frame-kit-ui-ng-ui-dialog.d.ts +166 -0
  160. package/types/frame-kit-ui-ng-ui-drawer.d.ts +130 -0
  161. package/types/frame-kit-ui-ng-ui-dropdown-menu.d.ts +77 -0
  162. package/types/frame-kit-ui-ng-ui-editable-field.d.ts +65 -0
  163. package/types/frame-kit-ui-ng-ui-icon-badge.d.ts +45 -0
  164. package/types/frame-kit-ui-ng-ui-icon-list.d.ts +67 -0
  165. package/types/frame-kit-ui-ng-ui-inline-edit.d.ts +44 -0
  166. package/types/frame-kit-ui-ng-ui-list-editor.d.ts +56 -0
  167. package/types/frame-kit-ui-ng-ui-loader.d.ts +32 -0
  168. package/types/frame-kit-ui-ng-ui-menu-item.d.ts +27 -0
  169. package/types/frame-kit-ui-ng-ui-nav-brand.d.ts +25 -0
  170. package/types/frame-kit-ui-ng-ui-nav-group.d.ts +60 -0
  171. package/types/frame-kit-ui-ng-ui-nav-separator.d.ts +33 -0
  172. package/types/frame-kit-ui-ng-ui-node-tree-breadcrumb.d.ts +35 -0
  173. package/types/frame-kit-ui-ng-ui-node-tree.d.ts +135 -0
  174. package/types/frame-kit-ui-ng-ui-note.d.ts +22 -0
  175. package/types/frame-kit-ui-ng-ui-numbered-list.d.ts +52 -0
  176. package/types/frame-kit-ui-ng-ui-pagination.d.ts +49 -0
  177. package/types/frame-kit-ui-ng-ui-progress-bar.d.ts +50 -0
  178. package/types/frame-kit-ui-ng-ui-sidenav-link.d.ts +24 -0
  179. package/types/frame-kit-ui-ng-ui-tabs.d.ts +266 -0
  180. package/types/frame-kit-ui-ng-ui-timeline.d.ts +42 -0
  181. package/types/frame-kit-ui-ng-ui-toast.d.ts +56 -0
  182. package/types/frame-kit-ui-ng-ui-user-menu.d.ts +87 -0
  183. package/types/frame-kit-ui-ng-ui-wizard-dialog.d.ts +116 -0
  184. package/types/frame-kit-ui-ng.d.ts +53 -0
  185. package/ui/accordion/README.md +261 -0
  186. package/ui/alert/README.md +211 -0
  187. package/ui/avatar/README.md +167 -0
  188. package/ui/avatar-stack/README.md +164 -0
  189. package/ui/badge/README.md +162 -0
  190. package/ui/breadcrumb/README.md +240 -0
  191. package/ui/button/README.md +184 -0
  192. package/ui/callout/README.md +159 -0
  193. package/ui/card/README.md +174 -0
  194. package/ui/copyable-field/README.md +235 -0
  195. package/ui/data-table/README.md +408 -0
  196. package/ui/dialog/README.md +222 -0
  197. package/ui/drawer/README.md +274 -0
  198. package/ui/dropdown-menu/README.md +336 -0
  199. package/ui/editable-field/README.md +171 -0
  200. package/ui/icon-badge/README.md +131 -0
  201. package/ui/icon-list/README.md +205 -0
  202. package/ui/inline-edit/README.md +135 -0
  203. package/ui/list-editor/README.md +162 -0
  204. package/ui/loader/README.md +160 -0
  205. package/ui/menu-item/README.md +204 -0
  206. package/ui/nav-brand/README.md +111 -0
  207. package/ui/nav-group/README.md +145 -0
  208. package/ui/nav-separator/README.md +44 -0
  209. package/ui/node-tree/README.md +278 -0
  210. package/ui/node-tree-breadcrumb/README.md +164 -0
  211. package/ui/note/README.md +146 -0
  212. package/ui/numbered-list/README.md +187 -0
  213. package/ui/pagination/README.md +174 -0
  214. package/ui/progress-bar/README.md +223 -0
  215. package/ui/sidenav-link/README.md +214 -0
  216. package/ui/tabs/README.md +204 -0
  217. package/ui/timeline/README.md +285 -0
  218. package/ui/toast/README.md +243 -0
  219. package/ui/user-menu/README.md +260 -0
  220. package/ui/wizard-dialog/README.md +283 -0
@@ -0,0 +1,398 @@
1
+ import { NgTemplateOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { InjectionToken, inject, TemplateRef, Directive, ElementRef, input, output, signal, contentChild, viewChild, DestroyRef, computed, HostListener, HostBinding, ChangeDetectionStrategy, Component } from '@angular/core';
4
+
5
+ const FK_DROPDOWN_PANEL = new InjectionToken('FK_DROPDOWN_PANEL');
6
+ class DropdownPanelDirective {
7
+ templateRef = inject(TemplateRef);
8
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DropdownPanelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
9
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DropdownPanelDirective, isStandalone: true, selector: "[fkDropdownPanel]", providers: [
10
+ { provide: FK_DROPDOWN_PANEL, useExisting: DropdownPanelDirective },
11
+ ], ngImport: i0 });
12
+ }
13
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DropdownPanelDirective, decorators: [{
14
+ type: Directive,
15
+ args: [{
16
+ selector: '[fkDropdownPanel]',
17
+ standalone: true,
18
+ providers: [
19
+ { provide: FK_DROPDOWN_PANEL, useExisting: DropdownPanelDirective },
20
+ ],
21
+ }]
22
+ }] });
23
+
24
+ const FK_DROPDOWN_TRIGGER = new InjectionToken('FK_DROPDOWN_TRIGGER');
25
+ class DropdownTriggerDirective {
26
+ elRef = inject(ElementRef);
27
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DropdownTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
28
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DropdownTriggerDirective, isStandalone: true, selector: "[fkDropdownTrigger]", host: { attributes: { "aria-haspopup": "menu", "aria-expanded": "false" } }, providers: [
29
+ { provide: FK_DROPDOWN_TRIGGER, useExisting: DropdownTriggerDirective },
30
+ ], ngImport: i0 });
31
+ }
32
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DropdownTriggerDirective, decorators: [{
33
+ type: Directive,
34
+ args: [{
35
+ selector: '[fkDropdownTrigger]',
36
+ standalone: true,
37
+ providers: [
38
+ { provide: FK_DROPDOWN_TRIGGER, useExisting: DropdownTriggerDirective },
39
+ ],
40
+ host: {
41
+ 'aria-haspopup': 'menu',
42
+ 'aria-expanded': 'false',
43
+ },
44
+ }]
45
+ }] });
46
+
47
+ class DropdownMenuComponent {
48
+ // ===== INPUTS =====
49
+ /** Preferred placement of the panel relative to the trigger. */
50
+ placement = input('bottom-end', ...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
51
+ /** When true, the trigger is non-interactive and the panel cannot open. */
52
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
53
+ /** When true, the panel is appended to `document.body` instead of rendered inline. */
54
+ portal = input(false, ...(ngDevMode ? [{ debugName: "portal" }] : /* istanbul ignore next */ []));
55
+ /** Extra CSS class applied to the floating panel element. */
56
+ panelClass = input(null, ...(ngDevMode ? [{ debugName: "panelClass" }] : /* istanbul ignore next */ []));
57
+ ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
58
+ className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
59
+ id = input(null, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
60
+ // ===== OUTPUTS =====
61
+ /** Fires when the dropdown panel opens. */
62
+ menuOpen = output();
63
+ /** Fires when the dropdown panel closes. */
64
+ menuClose = output();
65
+ // ===== STATE =====
66
+ isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
67
+ // ===== REFS =====
68
+ triggerRef = contentChild(FK_DROPDOWN_TRIGGER, ...(ngDevMode ? [{ debugName: "triggerRef" }] : /* istanbul ignore next */ []));
69
+ panelRef = contentChild(FK_DROPDOWN_PANEL, ...(ngDevMode ? [{ debugName: "panelRef" }] : /* istanbul ignore next */ []));
70
+ menuPanelEl = viewChild('menuPanel', ...(ngDevMode ? [{ debugName: "menuPanelEl" }] : /* istanbul ignore next */ []));
71
+ elRef = inject(ElementRef);
72
+ destroyRef = inject(DestroyRef);
73
+ portalCleanup = null;
74
+ constructor() {
75
+ this.destroyRef.onDestroy(() => {
76
+ this.cleanupPortal();
77
+ });
78
+ }
79
+ // ===== COMPUTED =====
80
+ classes = computed(() => {
81
+ return [
82
+ 'fk-dropdown-menu',
83
+ this.isOpen() ? 'fk-dropdown-menu--open' : '',
84
+ this.disabled() ? 'fk-dropdown-menu--disabled' : '',
85
+ this.className(),
86
+ ]
87
+ .filter(Boolean)
88
+ .join(' ');
89
+ }, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
90
+ get hostClass() {
91
+ return this.classes();
92
+ }
93
+ get hostId() {
94
+ return this.id();
95
+ }
96
+ // ===== HOST CLICK — captures clicks from projected trigger =====
97
+ onHostClick(event) {
98
+ const trigger = this.triggerRef();
99
+ if (!trigger) {
100
+ return;
101
+ }
102
+ const triggerEl = trigger.elRef.nativeElement;
103
+ if (triggerEl.contains(event.target)) {
104
+ this.toggle();
105
+ }
106
+ }
107
+ // ===== HOST KEYDOWN — captures keydown from projected trigger =====
108
+ onHostKeydown(event) {
109
+ const trigger = this.triggerRef();
110
+ if (!trigger) {
111
+ return;
112
+ }
113
+ const triggerEl = trigger.elRef.nativeElement;
114
+ if (triggerEl.contains(event.target)) {
115
+ this.onTriggerKeydown(event);
116
+ }
117
+ }
118
+ // ===== OUTSIDE CLICK =====
119
+ onDocumentClick(event) {
120
+ if (!this.isOpen()) {
121
+ return;
122
+ }
123
+ const host = this.elRef.nativeElement;
124
+ const panel = this.menuPanelEl()?.nativeElement;
125
+ if (host.contains(event.target)) {
126
+ return;
127
+ }
128
+ if (panel && panel.contains(event.target)) {
129
+ return;
130
+ }
131
+ this.close();
132
+ }
133
+ // ===== KEYBOARD =====
134
+ onDocumentKeydown(event) {
135
+ if (!this.isOpen()) {
136
+ return;
137
+ }
138
+ switch (event.key) {
139
+ case 'Escape':
140
+ event.preventDefault();
141
+ this.close();
142
+ this.focusTrigger();
143
+ break;
144
+ case 'ArrowDown':
145
+ event.preventDefault();
146
+ this.focusNext();
147
+ break;
148
+ case 'ArrowUp':
149
+ event.preventDefault();
150
+ this.focusPrev();
151
+ break;
152
+ case 'Tab':
153
+ this.close();
154
+ break;
155
+ case 'Home':
156
+ event.preventDefault();
157
+ this.focusFirst();
158
+ break;
159
+ case 'End':
160
+ event.preventDefault();
161
+ this.focusLast();
162
+ break;
163
+ }
164
+ }
165
+ // ===== ACTIONS =====
166
+ /** Toggles the dropdown panel open or closed if not disabled. */
167
+ toggle() {
168
+ if (this.disabled()) {
169
+ return;
170
+ }
171
+ if (this.isOpen()) {
172
+ this.close();
173
+ }
174
+ else {
175
+ this.open();
176
+ }
177
+ }
178
+ /** Opens the dropdown panel and positions it relative to the trigger. */
179
+ open() {
180
+ if (this.disabled()) {
181
+ return;
182
+ }
183
+ this.isOpen.set(true);
184
+ this.updateTriggerAria(true);
185
+ this.menuOpen.emit();
186
+ requestAnimationFrame(() => {
187
+ if (this.portal()) {
188
+ this.attachPortal();
189
+ }
190
+ this.positionPanel();
191
+ });
192
+ }
193
+ /** Closes the dropdown panel and cleans up any portal attachment. */
194
+ close() {
195
+ this.cleanupPortal();
196
+ this.isOpen.set(false);
197
+ this.updateTriggerAria(false);
198
+ this.menuClose.emit();
199
+ }
200
+ onPanelItemSelect() {
201
+ this.close();
202
+ }
203
+ // ===== TRIGGER KEYBOARD =====
204
+ onTriggerKeydown(event) {
205
+ if (event.key === 'Enter' || event.key === ' ') {
206
+ event.preventDefault();
207
+ this.toggle();
208
+ }
209
+ if (event.key === 'ArrowDown' && !this.isOpen()) {
210
+ event.preventDefault();
211
+ this.open();
212
+ requestAnimationFrame(() => this.focusFirst());
213
+ }
214
+ }
215
+ // ===== FOCUS MANAGEMENT =====
216
+ getMenuItems() {
217
+ const panel = this.menuPanelEl()?.nativeElement;
218
+ if (!panel) {
219
+ return [];
220
+ }
221
+ return Array.from(panel.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])'));
222
+ }
223
+ focusNext() {
224
+ const items = this.getMenuItems();
225
+ const current = items.findIndex((el) => el === document.activeElement || el.contains(document.activeElement));
226
+ const next = current + 1;
227
+ if (next < items.length) {
228
+ items[next].focus();
229
+ }
230
+ }
231
+ focusPrev() {
232
+ const items = this.getMenuItems();
233
+ const current = items.findIndex((el) => el === document.activeElement || el.contains(document.activeElement));
234
+ const prev = current - 1;
235
+ if (prev >= 0) {
236
+ items[prev].focus();
237
+ }
238
+ }
239
+ focusFirst() {
240
+ const items = this.getMenuItems();
241
+ if (items.length > 0) {
242
+ items[0].focus();
243
+ }
244
+ }
245
+ focusLast() {
246
+ const items = this.getMenuItems();
247
+ if (items.length > 0) {
248
+ items[items.length - 1].focus();
249
+ }
250
+ }
251
+ focusTrigger() {
252
+ const trigger = this.triggerRef();
253
+ if (trigger) {
254
+ trigger.elRef.nativeElement.focus();
255
+ }
256
+ }
257
+ updateTriggerAria(open) {
258
+ const trigger = this.triggerRef();
259
+ if (trigger) {
260
+ trigger.elRef.nativeElement.setAttribute('aria-expanded', String(open));
261
+ }
262
+ }
263
+ // ===== PORTAL =====
264
+ attachPortal() {
265
+ const panel = this.menuPanelEl()?.nativeElement;
266
+ if (!panel) {
267
+ return;
268
+ }
269
+ document.body.appendChild(panel);
270
+ panel.style.position = 'fixed';
271
+ panel.style.zIndex = '1000';
272
+ this.portalCleanup = () => {
273
+ if (panel.parentNode === document.body) {
274
+ document.body.removeChild(panel);
275
+ }
276
+ };
277
+ }
278
+ cleanupPortal() {
279
+ if (this.portalCleanup) {
280
+ this.portalCleanup();
281
+ this.portalCleanup = null;
282
+ }
283
+ }
284
+ // ===== PANEL POSITIONING =====
285
+ positionPanel() {
286
+ const panel = this.menuPanelEl()?.nativeElement;
287
+ if (!panel) {
288
+ return;
289
+ }
290
+ const host = this.elRef.nativeElement;
291
+ const hostRect = host.getBoundingClientRect();
292
+ const panelRect = panel.getBoundingClientRect();
293
+ const viewportH = window.innerHeight;
294
+ const viewportW = window.innerWidth;
295
+ const gap = 4;
296
+ if (this.portal()) {
297
+ this.positionPortalPanel(panel, hostRect, panelRect, viewportH, viewportW, gap);
298
+ }
299
+ else {
300
+ this.positionInlinePanel(panel, hostRect, panelRect, viewportH, viewportW, gap);
301
+ }
302
+ }
303
+ positionPortalPanel(panel, hostRect, panelRect, viewportH, viewportW, gap) {
304
+ const spaceBelow = viewportH - hostRect.bottom;
305
+ const spaceAbove = hostRect.top;
306
+ if (spaceBelow >= panelRect.height + gap || spaceBelow >= spaceAbove) {
307
+ panel.style.top = hostRect.bottom + gap + 'px';
308
+ panel.style.bottom = '';
309
+ }
310
+ else {
311
+ panel.style.top = '';
312
+ panel.style.bottom = viewportH - hostRect.top + gap + 'px';
313
+ }
314
+ const preferred = this.placement();
315
+ if (preferred === 'bottom-end') {
316
+ const left = hostRect.right - panelRect.width;
317
+ panel.style.left = Math.max(0, left) + 'px';
318
+ panel.style.right = '';
319
+ }
320
+ else {
321
+ const left = hostRect.left;
322
+ if (left + panelRect.width > viewportW) {
323
+ panel.style.left = '';
324
+ panel.style.right = '0';
325
+ }
326
+ else {
327
+ panel.style.left = left + 'px';
328
+ panel.style.right = '';
329
+ }
330
+ }
331
+ }
332
+ positionInlinePanel(panel, hostRect, panelRect, viewportH, viewportW, gap) {
333
+ panel.style.top = '';
334
+ panel.style.bottom = '';
335
+ panel.style.left = '';
336
+ panel.style.right = '';
337
+ panel.style.marginTop = '';
338
+ panel.style.marginBottom = '';
339
+ const spaceBelow = viewportH - hostRect.bottom;
340
+ const spaceAbove = hostRect.top;
341
+ if (spaceBelow >= panelRect.height + gap || spaceBelow >= spaceAbove) {
342
+ panel.style.top = '100%';
343
+ panel.style.marginTop = gap + 'px';
344
+ }
345
+ else {
346
+ panel.style.bottom = '100%';
347
+ panel.style.marginBottom = gap + 'px';
348
+ }
349
+ const preferred = this.placement();
350
+ if (preferred === 'bottom-end') {
351
+ panel.style.right = '0';
352
+ const panelLeft = hostRect.right - panelRect.width;
353
+ if (panelLeft < 0) {
354
+ panel.style.right = '';
355
+ panel.style.left = -hostRect.left + 'px';
356
+ }
357
+ }
358
+ else {
359
+ panel.style.left = '0';
360
+ const panelRight = hostRect.left + panelRect.width;
361
+ if (panelRight > viewportW) {
362
+ panel.style.left = '';
363
+ panel.style.right = -(viewportW - hostRect.right) + 'px';
364
+ }
365
+ }
366
+ }
367
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DropdownMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
368
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DropdownMenuComponent, isStandalone: true, selector: "fk-dropdown-menu", inputs: { placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, portal: { classPropertyName: "portal", publicName: "portal", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuOpen: "menuOpen", menuClose: "menuClose" }, host: { listeners: { "click": "onHostClick($event)", "keydown": "onHostKeydown($event)", "document:click": "onDocumentClick($event)", "document:keydown": "onDocumentKeydown($event)" }, properties: { "class": "this.hostClass", "attr.id": "this.hostId" } }, queries: [{ propertyName: "triggerRef", first: true, predicate: FK_DROPDOWN_TRIGGER, descendants: true, isSignal: true }, { propertyName: "panelRef", first: true, predicate: FK_DROPDOWN_PANEL, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "menuPanelEl", first: true, predicate: ["menuPanel"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-content select=\"[fkDropdownTrigger]\" />\n\n@if (isOpen()) {\n <div\n #menuPanel\n class=\"fk-dropdown-menu__panel\"\n [class]=\"\n 'fk-dropdown-menu__panel' + (panelClass() ? ' ' + panelClass() : '')\n \"\n role=\"menu\"\n [attr.aria-label]=\"ariaLabel()\"\n (fkmenuitemselect)=\"onPanelItemSelect()\"\n >\n <ng-container [ngTemplateOutlet]=\"panelRef()?.templateRef ?? null\" />\n </div>\n}\n", styles: [":host{display:inline-block;position:relative}:host.fk-dropdown-menu--disabled{pointer-events:none}.fk-dropdown-menu__panel{position:absolute;z-index:var(--fk-dropdown-menu-panel-z, 100);min-width:var(--fk-dropdown-menu-panel-min-width, 12rem);padding:var(--fk-dropdown-menu-panel-padding, var(--fk-rhythm-1, .25rem));border-radius:var(--fk-dropdown-menu-panel-radius, var(--fk-radius-lg, .75rem));background-color:var(--fk-dropdown-menu-panel-bg, var(--fk-color-surface, #ffffff));border:1px solid var(--fk-dropdown-menu-panel-border, var(--fk-color-border, #d9e2ee));box-shadow:var(--fk-dropdown-menu-panel-shadow, 0 4px 16px rgba(0, 0, 0, .08));animation:fk-dropdown-menu-enter var(--fk-dropdown-menu-enter-duration, var(--fk-motion-duration-fast, .12s)) var(--fk-dropdown-menu-enter-easing, var(--fk-motion-easing-out, ease-out))}@keyframes fk-dropdown-menu-enter{0%{opacity:0;transform:scale(.95) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}@media(prefers-reduced-motion:reduce){.fk-dropdown-menu__panel{animation:none}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
369
+ }
370
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DropdownMenuComponent, decorators: [{
371
+ type: Component,
372
+ args: [{ selector: 'fk-dropdown-menu', standalone: true, imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content select=\"[fkDropdownTrigger]\" />\n\n@if (isOpen()) {\n <div\n #menuPanel\n class=\"fk-dropdown-menu__panel\"\n [class]=\"\n 'fk-dropdown-menu__panel' + (panelClass() ? ' ' + panelClass() : '')\n \"\n role=\"menu\"\n [attr.aria-label]=\"ariaLabel()\"\n (fkmenuitemselect)=\"onPanelItemSelect()\"\n >\n <ng-container [ngTemplateOutlet]=\"panelRef()?.templateRef ?? null\" />\n </div>\n}\n", styles: [":host{display:inline-block;position:relative}:host.fk-dropdown-menu--disabled{pointer-events:none}.fk-dropdown-menu__panel{position:absolute;z-index:var(--fk-dropdown-menu-panel-z, 100);min-width:var(--fk-dropdown-menu-panel-min-width, 12rem);padding:var(--fk-dropdown-menu-panel-padding, var(--fk-rhythm-1, .25rem));border-radius:var(--fk-dropdown-menu-panel-radius, var(--fk-radius-lg, .75rem));background-color:var(--fk-dropdown-menu-panel-bg, var(--fk-color-surface, #ffffff));border:1px solid var(--fk-dropdown-menu-panel-border, var(--fk-color-border, #d9e2ee));box-shadow:var(--fk-dropdown-menu-panel-shadow, 0 4px 16px rgba(0, 0, 0, .08));animation:fk-dropdown-menu-enter var(--fk-dropdown-menu-enter-duration, var(--fk-motion-duration-fast, .12s)) var(--fk-dropdown-menu-enter-easing, var(--fk-motion-easing-out, ease-out))}@keyframes fk-dropdown-menu-enter{0%{opacity:0;transform:scale(.95) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}@media(prefers-reduced-motion:reduce){.fk-dropdown-menu__panel{animation:none}}\n"] }]
373
+ }], ctorParameters: () => [], propDecorators: { placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], portal: [{ type: i0.Input, args: [{ isSignal: true, alias: "portal", required: false }] }], panelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelClass", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], menuOpen: [{ type: i0.Output, args: ["menuOpen"] }], menuClose: [{ type: i0.Output, args: ["menuClose"] }], triggerRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => FK_DROPDOWN_TRIGGER), { isSignal: true }] }], panelRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => FK_DROPDOWN_PANEL), { isSignal: true }] }], menuPanelEl: [{ type: i0.ViewChild, args: ['menuPanel', { isSignal: true }] }], hostClass: [{
374
+ type: HostBinding,
375
+ args: ['class']
376
+ }], hostId: [{
377
+ type: HostBinding,
378
+ args: ['attr.id']
379
+ }], onHostClick: [{
380
+ type: HostListener,
381
+ args: ['click', ['$event']]
382
+ }], onHostKeydown: [{
383
+ type: HostListener,
384
+ args: ['keydown', ['$event']]
385
+ }], onDocumentClick: [{
386
+ type: HostListener,
387
+ args: ['document:click', ['$event']]
388
+ }], onDocumentKeydown: [{
389
+ type: HostListener,
390
+ args: ['document:keydown', ['$event']]
391
+ }] } });
392
+
393
+ /**
394
+ * Generated bundle index. Do not edit.
395
+ */
396
+
397
+ export { DropdownMenuComponent, DropdownPanelDirective, DropdownTriggerDirective, FK_DROPDOWN_PANEL, FK_DROPDOWN_TRIGGER };
398
+ //# sourceMappingURL=frame-kit-ui-ng-ui-dropdown-menu.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frame-kit-ui-ng-ui-dropdown-menu.mjs","sources":["../../../../packages/ui-ng/ui/dropdown-menu/dropdown-panel.directive.ts","../../../../packages/ui-ng/ui/dropdown-menu/dropdown-trigger.directive.ts","../../../../packages/ui-ng/ui/dropdown-menu/dropdown-menu.component.ts","../../../../packages/ui-ng/ui/dropdown-menu/dropdown-menu.component.html","../../../../packages/ui-ng/ui/dropdown-menu/frame-kit-ui-ng-ui-dropdown-menu.ts"],"sourcesContent":["import { Directive, inject, InjectionToken, TemplateRef } from '@angular/core';\n\nexport const FK_DROPDOWN_PANEL = new InjectionToken<DropdownPanelDirective>(\n 'FK_DROPDOWN_PANEL',\n);\n\n@Directive({\n selector: '[fkDropdownPanel]',\n standalone: true,\n providers: [\n { provide: FK_DROPDOWN_PANEL, useExisting: DropdownPanelDirective },\n ],\n})\nexport class DropdownPanelDirective {\n readonly templateRef = inject(TemplateRef);\n}\n","import { Directive, ElementRef, inject, InjectionToken } from '@angular/core';\n\nexport const FK_DROPDOWN_TRIGGER = new InjectionToken<DropdownTriggerDirective>(\n 'FK_DROPDOWN_TRIGGER',\n);\n\n@Directive({\n selector: '[fkDropdownTrigger]',\n standalone: true,\n providers: [\n { provide: FK_DROPDOWN_TRIGGER, useExisting: DropdownTriggerDirective },\n ],\n host: {\n 'aria-haspopup': 'menu',\n 'aria-expanded': 'false',\n },\n})\nexport class DropdownTriggerDirective {\n readonly elRef = inject(ElementRef);\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n DestroyRef,\n ElementRef,\n HostBinding,\n HostListener,\n inject,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core';\n\nimport type { DropdownPlacement } from './dropdown-menu.types';\nimport { FK_DROPDOWN_PANEL } from './dropdown-panel.directive';\nimport { FK_DROPDOWN_TRIGGER } from './dropdown-trigger.directive';\n\n@Component({\n selector: 'fk-dropdown-menu',\n standalone: true,\n imports: [NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './dropdown-menu.component.html',\n styleUrl: './dropdown-menu.component.scss',\n})\nexport class DropdownMenuComponent {\n // ===== INPUTS =====\n /** Preferred placement of the panel relative to the trigger. */\n readonly placement = input<DropdownPlacement>('bottom-end');\n /** When true, the trigger is non-interactive and the panel cannot open. */\n readonly disabled = input<boolean>(false);\n /** When true, the panel is appended to `document.body` instead of rendered inline. */\n readonly portal = input<boolean>(false);\n /** Extra CSS class applied to the floating panel element. */\n readonly panelClass = input<string | null>(null);\n readonly ariaLabel = input<string | null>(null);\n readonly className = input<string>('');\n readonly id = input<string | null>(null);\n\n // ===== OUTPUTS =====\n /** Fires when the dropdown panel opens. */\n readonly menuOpen = output<void>();\n /** Fires when the dropdown panel closes. */\n readonly menuClose = output<void>();\n\n // ===== STATE =====\n readonly isOpen = signal(false);\n\n // ===== REFS =====\n readonly triggerRef = contentChild(FK_DROPDOWN_TRIGGER);\n readonly panelRef = contentChild(FK_DROPDOWN_PANEL);\n readonly menuPanelEl = viewChild<ElementRef<HTMLElement>>('menuPanel');\n\n private readonly elRef = inject(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n\n private portalCleanup: (() => void) | null = null;\n\n constructor() {\n this.destroyRef.onDestroy(() => {\n this.cleanupPortal();\n });\n }\n\n // ===== COMPUTED =====\n\n readonly classes = computed(() => {\n return [\n 'fk-dropdown-menu',\n this.isOpen() ? 'fk-dropdown-menu--open' : '',\n this.disabled() ? 'fk-dropdown-menu--disabled' : '',\n this.className(),\n ]\n .filter(Boolean)\n .join(' ');\n });\n\n @HostBinding('class')\n get hostClass() {\n return this.classes();\n }\n\n @HostBinding('attr.id')\n get hostId(): string | null {\n return this.id();\n }\n\n // ===== HOST CLICK — captures clicks from projected trigger =====\n\n @HostListener('click', ['$event'])\n onHostClick(event: Event): void {\n const trigger = this.triggerRef();\n\n if (!trigger) {\n return;\n }\n\n const triggerEl = trigger.elRef.nativeElement as HTMLElement;\n\n if (triggerEl.contains(event.target as Node)) {\n this.toggle();\n }\n }\n\n // ===== HOST KEYDOWN — captures keydown from projected trigger =====\n\n @HostListener('keydown', ['$event'])\n onHostKeydown(event: KeyboardEvent): void {\n const trigger = this.triggerRef();\n\n if (!trigger) {\n return;\n }\n\n const triggerEl = trigger.elRef.nativeElement as HTMLElement;\n\n if (triggerEl.contains(event.target as Node)) {\n this.onTriggerKeydown(event);\n }\n }\n\n // ===== OUTSIDE CLICK =====\n\n @HostListener('document:click', ['$event'])\n onDocumentClick(event: MouseEvent): void {\n if (!this.isOpen()) {\n return;\n }\n\n const host = this.elRef.nativeElement as HTMLElement;\n const panel = this.menuPanelEl()?.nativeElement;\n\n if (host.contains(event.target as Node)) {\n return;\n }\n\n if (panel && panel.contains(event.target as Node)) {\n return;\n }\n\n this.close();\n }\n\n // ===== KEYBOARD =====\n\n @HostListener('document:keydown', ['$event'])\n onDocumentKeydown(event: KeyboardEvent): void {\n if (!this.isOpen()) {\n return;\n }\n\n switch (event.key) {\n case 'Escape':\n event.preventDefault();\n this.close();\n this.focusTrigger();\n break;\n\n case 'ArrowDown':\n event.preventDefault();\n this.focusNext();\n break;\n\n case 'ArrowUp':\n event.preventDefault();\n this.focusPrev();\n break;\n\n case 'Tab':\n this.close();\n break;\n\n case 'Home':\n event.preventDefault();\n this.focusFirst();\n break;\n\n case 'End':\n event.preventDefault();\n this.focusLast();\n break;\n }\n }\n\n // ===== ACTIONS =====\n\n /** Toggles the dropdown panel open or closed if not disabled. */\n toggle(): void {\n if (this.disabled()) {\n return;\n }\n\n if (this.isOpen()) {\n this.close();\n } else {\n this.open();\n }\n }\n\n /** Opens the dropdown panel and positions it relative to the trigger. */\n open(): void {\n if (this.disabled()) {\n return;\n }\n\n this.isOpen.set(true);\n this.updateTriggerAria(true);\n this.menuOpen.emit();\n\n requestAnimationFrame(() => {\n if (this.portal()) {\n this.attachPortal();\n }\n\n this.positionPanel();\n });\n }\n\n /** Closes the dropdown panel and cleans up any portal attachment. */\n close(): void {\n this.cleanupPortal();\n this.isOpen.set(false);\n this.updateTriggerAria(false);\n this.menuClose.emit();\n }\n\n onPanelItemSelect(): void {\n this.close();\n }\n\n // ===== TRIGGER KEYBOARD =====\n\n private onTriggerKeydown(event: KeyboardEvent): void {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.toggle();\n }\n\n if (event.key === 'ArrowDown' && !this.isOpen()) {\n event.preventDefault();\n this.open();\n requestAnimationFrame(() => this.focusFirst());\n }\n }\n\n // ===== FOCUS MANAGEMENT =====\n\n private getMenuItems(): HTMLElement[] {\n const panel = this.menuPanelEl()?.nativeElement;\n\n if (!panel) {\n return [];\n }\n\n return Array.from(\n panel.querySelectorAll<HTMLElement>(\n '[role=\"menuitem\"]:not([aria-disabled=\"true\"])',\n ),\n );\n }\n\n private focusNext(): void {\n const items = this.getMenuItems();\n const current = items.findIndex(\n (el) =>\n el === document.activeElement || el.contains(document.activeElement),\n );\n\n const next = current + 1;\n\n if (next < items.length) {\n items[next].focus();\n }\n }\n\n private focusPrev(): void {\n const items = this.getMenuItems();\n const current = items.findIndex(\n (el) =>\n el === document.activeElement || el.contains(document.activeElement),\n );\n\n const prev = current - 1;\n\n if (prev >= 0) {\n items[prev].focus();\n }\n }\n\n private focusFirst(): void {\n const items = this.getMenuItems();\n\n if (items.length > 0) {\n items[0].focus();\n }\n }\n\n private focusLast(): void {\n const items = this.getMenuItems();\n\n if (items.length > 0) {\n items[items.length - 1].focus();\n }\n }\n\n private focusTrigger(): void {\n const trigger = this.triggerRef();\n\n if (trigger) {\n trigger.elRef.nativeElement.focus();\n }\n }\n\n private updateTriggerAria(open: boolean): void {\n const trigger = this.triggerRef();\n\n if (trigger) {\n trigger.elRef.nativeElement.setAttribute('aria-expanded', String(open));\n }\n }\n\n // ===== PORTAL =====\n\n private attachPortal(): void {\n const panel = this.menuPanelEl()?.nativeElement;\n\n if (!panel) {\n return;\n }\n\n document.body.appendChild(panel);\n panel.style.position = 'fixed';\n panel.style.zIndex = '1000';\n\n this.portalCleanup = () => {\n if (panel.parentNode === document.body) {\n document.body.removeChild(panel);\n }\n };\n }\n\n private cleanupPortal(): void {\n if (this.portalCleanup) {\n this.portalCleanup();\n this.portalCleanup = null;\n }\n }\n\n // ===== PANEL POSITIONING =====\n\n private positionPanel(): void {\n const panel = this.menuPanelEl()?.nativeElement;\n\n if (!panel) {\n return;\n }\n\n const host = this.elRef.nativeElement as HTMLElement;\n const hostRect = host.getBoundingClientRect();\n const panelRect = panel.getBoundingClientRect();\n const viewportH = window.innerHeight;\n const viewportW = window.innerWidth;\n const gap = 4;\n\n if (this.portal()) {\n this.positionPortalPanel(\n panel,\n hostRect,\n panelRect,\n viewportH,\n viewportW,\n gap,\n );\n } else {\n this.positionInlinePanel(\n panel,\n hostRect,\n panelRect,\n viewportH,\n viewportW,\n gap,\n );\n }\n }\n\n private positionPortalPanel(\n panel: HTMLElement,\n hostRect: DOMRect,\n panelRect: DOMRect,\n viewportH: number,\n viewportW: number,\n gap: number,\n ): void {\n const spaceBelow = viewportH - hostRect.bottom;\n const spaceAbove = hostRect.top;\n\n if (spaceBelow >= panelRect.height + gap || spaceBelow >= spaceAbove) {\n panel.style.top = hostRect.bottom + gap + 'px';\n panel.style.bottom = '';\n } else {\n panel.style.top = '';\n panel.style.bottom = viewportH - hostRect.top + gap + 'px';\n }\n\n const preferred = this.placement();\n\n if (preferred === 'bottom-end') {\n const left = hostRect.right - panelRect.width;\n\n panel.style.left = Math.max(0, left) + 'px';\n panel.style.right = '';\n } else {\n const left = hostRect.left;\n\n if (left + panelRect.width > viewportW) {\n panel.style.left = '';\n panel.style.right = '0';\n } else {\n panel.style.left = left + 'px';\n panel.style.right = '';\n }\n }\n }\n\n private positionInlinePanel(\n panel: HTMLElement,\n hostRect: DOMRect,\n panelRect: DOMRect,\n viewportH: number,\n viewportW: number,\n gap: number,\n ): void {\n panel.style.top = '';\n panel.style.bottom = '';\n panel.style.left = '';\n panel.style.right = '';\n panel.style.marginTop = '';\n panel.style.marginBottom = '';\n\n const spaceBelow = viewportH - hostRect.bottom;\n const spaceAbove = hostRect.top;\n\n if (spaceBelow >= panelRect.height + gap || spaceBelow >= spaceAbove) {\n panel.style.top = '100%';\n panel.style.marginTop = gap + 'px';\n } else {\n panel.style.bottom = '100%';\n panel.style.marginBottom = gap + 'px';\n }\n\n const preferred = this.placement();\n\n if (preferred === 'bottom-end') {\n panel.style.right = '0';\n\n const panelLeft = hostRect.right - panelRect.width;\n\n if (panelLeft < 0) {\n panel.style.right = '';\n panel.style.left = -hostRect.left + 'px';\n }\n } else {\n panel.style.left = '0';\n\n const panelRight = hostRect.left + panelRect.width;\n\n if (panelRight > viewportW) {\n panel.style.left = '';\n panel.style.right = -(viewportW - hostRect.right) + 'px';\n }\n }\n }\n}\n","<ng-content select=\"[fkDropdownTrigger]\" />\n\n@if (isOpen()) {\n <div\n #menuPanel\n class=\"fk-dropdown-menu__panel\"\n [class]=\"\n 'fk-dropdown-menu__panel' + (panelClass() ? ' ' + panelClass() : '')\n \"\n role=\"menu\"\n [attr.aria-label]=\"ariaLabel()\"\n (fkmenuitemselect)=\"onPanelItemSelect()\"\n >\n <ng-container [ngTemplateOutlet]=\"panelRef()?.templateRef ?? null\" />\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAEa,iBAAiB,GAAG,IAAI,cAAc,CACjD,mBAAmB;MAUR,sBAAsB,CAAA;AACxB,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;uGAD/B,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAtB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,SAAA,EAJtB;AACT,YAAA,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,sBAAsB,EAAE;AACpE,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAEU,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAPlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,wBAAwB,EAAE;AACpE,qBAAA;AACF,iBAAA;;;MCVY,mBAAmB,GAAG,IAAI,cAAc,CACnD,qBAAqB;MAcV,wBAAwB,CAAA;AAC1B,IAAA,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC;uGADxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAxB,IAAA,OAA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AA,EACV,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,ibAAA,EAAA,MAAA,EAAA,CAAA,whCAAA,CAAA,EAAA;+3BA4BZ,mBAAmB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MACrB,iBAAiB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CACQ,WAAW,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA;sBA0BpE,WAAW;uBAAC,OAAO;;sBAKnB,WAAW;uBAAC,SAAS;;sBAOrB,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;sBAiBhC,YAAY;uBAAC,SAAS,EAAE,CAAC,QAAQ,CAAC;;sBAiBlC,YAAY;uBAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC;;sBAsBzC,YAAY;uBAAC,kBAAkB,EAAE,CAAC,QAAQ,CAAC;;;AErJ9C;;AAEG;;;;"}
@@ -0,0 +1,125 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, output, signal, viewChild, computed, HostBinding, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { IconComponent } from '@frame-kit/ui-ng/core/icon';
4
+
5
+ /**
6
+ * A single-line text field that lives in two states:
7
+ *
8
+ * - **Display** — the field reads as a regular bordered input
9
+ * showing the current value. A pencil icon sits inside the
10
+ * trailing edge. Clicking anywhere on the field surface enters
11
+ * edit mode.
12
+ * - **Edit** — the field becomes a live `<input>`. The pencil slot
13
+ * swaps to a cancel (✗) icon inside the trailing edge. A
14
+ * separate Save button slides in as a sibling to the field's
15
+ * right.
16
+ *
17
+ * Distinct from `fk-inline-edit`, which renders the value as a span +
18
+ * an Edit button as siblings. `fk-editable-field` is meant for form-
19
+ * shaped surfaces (billing details, profile pages) where every row
20
+ * should *look* like a regular input even in display mode.
21
+ *
22
+ * The save / cancel / pencil icons can be overridden via the named
23
+ * content slots `[editIcon]`, `[cancelIcon]`, and `[saveIcon]`.
24
+ */
25
+ class EditableFieldComponent {
26
+ // ===== INPUTS =====
27
+ /** Current committed value displayed in read mode. */
28
+ value = input('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
29
+ /** Placeholder text shown in the input when the edit buffer is empty. */
30
+ placeholder = input('Enter a value…', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
31
+ /** Size variant controlling the font and spacing of the component. */
32
+ size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
33
+ /** Text displayed in read mode when the committed value is empty. */
34
+ emptyText = input('None', ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
35
+ // ===== BASE PROPS =====
36
+ className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
37
+ id = input(null, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
38
+ ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
39
+ ariaDescribedBy = input(null, ...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : /* istanbul ignore next */ []));
40
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
41
+ // ===== OUTPUTS =====
42
+ /** Fires when the user saves an edit, emitting the trimmed new value. */
43
+ valueChange = output();
44
+ /** Fires when the component enters edit mode. */
45
+ editStart = output();
46
+ /** Fires when the user cancels an in-progress edit without saving. */
47
+ editCancel = output();
48
+ // ===== STATE =====
49
+ editing = signal(false, ...(ngDevMode ? [{ debugName: "editing" }] : /* istanbul ignore next */ []));
50
+ editValue = signal('', ...(ngDevMode ? [{ debugName: "editValue" }] : /* istanbul ignore next */ []));
51
+ inputRef = viewChild('inputEl', ...(ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []));
52
+ // ===== COMPUTED =====
53
+ classes = computed(() => [
54
+ 'fk-editable-field',
55
+ `fk-editable-field--${this.size()}`,
56
+ this.editing() ? 'fk-editable-field--editing' : '',
57
+ this.disabled() ? 'fk-editable-field--disabled' : '',
58
+ this.className(),
59
+ ]
60
+ .filter(Boolean)
61
+ .join(' '), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
62
+ get hostClass() {
63
+ return this.classes();
64
+ }
65
+ get hostId() {
66
+ return this.id();
67
+ }
68
+ // ===== METHODS =====
69
+ /** Enters edit mode and focuses the input, copying the current value into the edit buffer. */
70
+ startEdit() {
71
+ if (this.disabled()) {
72
+ return;
73
+ }
74
+ this.editValue.set(this.value());
75
+ this.editing.set(true);
76
+ this.editStart.emit();
77
+ setTimeout(() => {
78
+ this.inputRef()?.nativeElement.focus();
79
+ });
80
+ }
81
+ /** Commits the current edit buffer, exits edit mode, and emits the trimmed value. */
82
+ save() {
83
+ const trimmed = this.editValue().trim();
84
+ this.editing.set(false);
85
+ this.valueChange.emit(trimmed);
86
+ }
87
+ /** Discards the current edit buffer and exits edit mode. */
88
+ cancel() {
89
+ this.editing.set(false);
90
+ this.editCancel.emit();
91
+ }
92
+ onKeydown(event) {
93
+ if (event.key === 'Enter') {
94
+ event.preventDefault();
95
+ this.save();
96
+ }
97
+ if (event.key === 'Escape') {
98
+ event.preventDefault();
99
+ this.cancel();
100
+ }
101
+ }
102
+ onInput(event) {
103
+ const target = event.target;
104
+ this.editValue.set(target.value);
105
+ }
106
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EditableFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
107
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: EditableFieldComponent, isStandalone: true, selector: "fk-editable-field", inputs: { value: { classPropertyName: "value", publicName: "value", 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 }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", editStart: "editStart", editCancel: "editCancel" }, host: { properties: { "class": "this.hostClass", "attr.id": "this.hostId" } }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (editing()) {\n <div class=\"fk-editable-field__container\">\n <div class=\"fk-editable-field__field fk-editable-field__field--editing\">\n <input\n #inputEl\n class=\"fk-editable-field__input\"\n type=\"text\"\n [value]=\"editValue()\"\n [placeholder]=\"placeholder()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n />\n\n <button\n class=\"fk-editable-field__inline-btn\"\n type=\"button\"\n aria-label=\"Cancel\"\n (click)=\"cancel()\"\n >\n <ng-content select=\"[cancelIcon]\">\n <fk-icon name=\"circle-xmark-outline\" size=\"sm\" />\n </ng-content>\n </button>\n </div>\n\n <button\n class=\"fk-editable-field__save\"\n type=\"button\"\n aria-label=\"Save\"\n (click)=\"save()\"\n >\n <ng-content select=\"[saveIcon]\">\n <span class=\"fk-editable-field__save-text\">Save</span>\n </ng-content>\n </button>\n </div>\n} @else {\n <button\n class=\"fk-editable-field__field fk-editable-field__field--display\"\n type=\"button\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel() ? 'Edit ' + ariaLabel() : 'Edit'\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n (click)=\"startEdit()\"\n >\n <span class=\"fk-editable-field__value\">\n @if (value()) {\n {{ value() }}\n } @else {\n <span class=\"fk-editable-field__empty\">{{ emptyText() }}</span>\n }\n </span>\n\n @if (!disabled()) {\n <span\n class=\"fk-editable-field__inline-btn fk-editable-field__inline-btn--decoration\"\n >\n <ng-content select=\"[editIcon]\">\n <fk-icon name=\"pen-outline\" size=\"sm\" />\n </ng-content>\n </span>\n }\n </button>\n}\n", styles: [":host{display:block}.fk-editable-field__container{display:flex;align-items:center;gap:var(--fk-editable-field-gap, var(--fk-rhythm-2, .5rem))}.fk-editable-field__field{flex:1;min-width:0;display:flex;align-items:center;width:100%;padding-right:var(--fk-editable-field-trailing-padding, var(--fk-rhythm-1, .25rem));font-family:inherit;text-align:start;background:var(--fk-editable-field-bg, var(--fk-color-surface, #ffffff));border:1px solid var(--fk-editable-field-border-color, var(--fk-color-border, #d9e2ee));border-radius:var(--fk-editable-field-border-radius, var(--fk-radius-md, .375rem));transition:border-color .12s ease,box-shadow .12s ease}.fk-editable-field__field--display{cursor:pointer}.fk-editable-field__field--display:hover:not(:disabled){border-color:var(--fk-editable-field-hover-border, var(--fk-color-primary, #3b82f6))}.fk-editable-field__field--display:focus-visible{outline:none;border-color:var(--fk-editable-field-focus-border, var(--fk-color-primary, #3b82f6));box-shadow:var(--fk-focus-ring, 0 0 0 3px rgba(10, 132, 255, .18))}.fk-editable-field__field--display:disabled{cursor:default;opacity:var(--fk-editable-field-disabled-opacity, .6)}.fk-editable-field__field--editing:focus-within{border-color:var(--fk-editable-field-focus-border, var(--fk-color-primary, #3b82f6));box-shadow:var(--fk-focus-ring, 0 0 0 3px rgba(10, 132, 255, .18))}.fk-editable-field__input{flex:1;min-width:0;padding:var(--fk-editable-field-input-padding, var(--fk-rhythm-1, .25rem) var(--fk-rhythm-2, .5rem));font-family:inherit;font-size:var(--fk-editable-field-font-size, var(--fk-typography-body-font-size, .875rem));color:var(--fk-editable-field-color, var(--fk-color-text, #1f2d3d));background:transparent;border:none;outline:none}.fk-editable-field__value{flex:1;min-width:0;padding:var(--fk-editable-field-input-padding, var(--fk-rhythm-1, .25rem) var(--fk-rhythm-2, .5rem));font-size:var(--fk-editable-field-font-size, var(--fk-typography-body-font-size, .875rem));color:var(--fk-editable-field-color, var(--fk-color-text, #1f2d3d));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fk-editable-field__empty{color:var(--fk-editable-field-empty-color, var(--fk-color-muted, #8a98a8))}.fk-editable-field__inline-btn{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--fk-editable-field-inline-btn-size, 1.5rem);height:var(--fk-editable-field-inline-btn-size, 1.5rem);padding:0;background:none;border:none;color:var(--fk-editable-field-trigger-color, var(--fk-color-muted, #8a98a8));cursor:pointer}.fk-editable-field__inline-btn:hover{color:var(--fk-editable-field-trigger-hover-color, var(--fk-color-primary, #3b82f6))}.fk-editable-field__inline-btn:focus-visible{outline:none;box-shadow:var(--fk-focus-ring, 0 0 0 3px rgba(10, 132, 255, .18));border-radius:var(--fk-radius-sm, .25rem)}.fk-editable-field__inline-btn--decoration{pointer-events:none;cursor:inherit}.fk-editable-field__save{display:inline-flex;align-items:center;flex-shrink:0;padding:var(--fk-rhythm-1, .25rem) var(--fk-rhythm-3, .75rem);font-family:inherit;font-size:var(--fk-editable-field-action-font-size, var(--fk-typography-small-font-size, .8125rem));font-weight:var(--fk-font-weight-medium, 500);color:var(--fk-editable-field-save-color, #ffffff);background:var(--fk-editable-field-save-bg, var(--fk-color-primary, #3b82f6));border:1px solid var(--fk-editable-field-save-bg, var(--fk-color-primary, #3b82f6));border-radius:var(--fk-editable-field-border-radius, var(--fk-radius-md, .375rem));cursor:pointer}.fk-editable-field__save:hover{opacity:.9}.fk-editable-field__save:focus-visible{outline:none;box-shadow:var(--fk-focus-ring, 0 0 0 3px rgba(10, 132, 255, .18))}.fk-editable-field__save-text{font:inherit}:host-context(.fk-editable-field--sm) .fk-editable-field__input,:host-context(.fk-editable-field--sm) .fk-editable-field__value{font-size:var(--fk-editable-field-sm-font-size, var(--fk-typography-small-font-size, .8125rem))}:host-context(.fk-editable-field--lg) .fk-editable-field__input,:host-context(.fk-editable-field--lg) .fk-editable-field__value{font-size:var(--fk-editable-field-lg-font-size, var(--fk-typography-heading-font-size, 1.25rem));font-weight:var(--fk-editable-field-lg-font-weight, var(--fk-font-weight-semibold, 600))}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "fk-icon", inputs: ["name", "size", "color", "className", "id", "ariaLabel", "ariaHidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
108
+ }
109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EditableFieldComponent, decorators: [{
110
+ type: Component,
111
+ args: [{ selector: 'fk-editable-field', standalone: true, imports: [IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (editing()) {\n <div class=\"fk-editable-field__container\">\n <div class=\"fk-editable-field__field fk-editable-field__field--editing\">\n <input\n #inputEl\n class=\"fk-editable-field__input\"\n type=\"text\"\n [value]=\"editValue()\"\n [placeholder]=\"placeholder()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n />\n\n <button\n class=\"fk-editable-field__inline-btn\"\n type=\"button\"\n aria-label=\"Cancel\"\n (click)=\"cancel()\"\n >\n <ng-content select=\"[cancelIcon]\">\n <fk-icon name=\"circle-xmark-outline\" size=\"sm\" />\n </ng-content>\n </button>\n </div>\n\n <button\n class=\"fk-editable-field__save\"\n type=\"button\"\n aria-label=\"Save\"\n (click)=\"save()\"\n >\n <ng-content select=\"[saveIcon]\">\n <span class=\"fk-editable-field__save-text\">Save</span>\n </ng-content>\n </button>\n </div>\n} @else {\n <button\n class=\"fk-editable-field__field fk-editable-field__field--display\"\n type=\"button\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel() ? 'Edit ' + ariaLabel() : 'Edit'\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n (click)=\"startEdit()\"\n >\n <span class=\"fk-editable-field__value\">\n @if (value()) {\n {{ value() }}\n } @else {\n <span class=\"fk-editable-field__empty\">{{ emptyText() }}</span>\n }\n </span>\n\n @if (!disabled()) {\n <span\n class=\"fk-editable-field__inline-btn fk-editable-field__inline-btn--decoration\"\n >\n <ng-content select=\"[editIcon]\">\n <fk-icon name=\"pen-outline\" size=\"sm\" />\n </ng-content>\n </span>\n }\n </button>\n}\n", styles: [":host{display:block}.fk-editable-field__container{display:flex;align-items:center;gap:var(--fk-editable-field-gap, var(--fk-rhythm-2, .5rem))}.fk-editable-field__field{flex:1;min-width:0;display:flex;align-items:center;width:100%;padding-right:var(--fk-editable-field-trailing-padding, var(--fk-rhythm-1, .25rem));font-family:inherit;text-align:start;background:var(--fk-editable-field-bg, var(--fk-color-surface, #ffffff));border:1px solid var(--fk-editable-field-border-color, var(--fk-color-border, #d9e2ee));border-radius:var(--fk-editable-field-border-radius, var(--fk-radius-md, .375rem));transition:border-color .12s ease,box-shadow .12s ease}.fk-editable-field__field--display{cursor:pointer}.fk-editable-field__field--display:hover:not(:disabled){border-color:var(--fk-editable-field-hover-border, var(--fk-color-primary, #3b82f6))}.fk-editable-field__field--display:focus-visible{outline:none;border-color:var(--fk-editable-field-focus-border, var(--fk-color-primary, #3b82f6));box-shadow:var(--fk-focus-ring, 0 0 0 3px rgba(10, 132, 255, .18))}.fk-editable-field__field--display:disabled{cursor:default;opacity:var(--fk-editable-field-disabled-opacity, .6)}.fk-editable-field__field--editing:focus-within{border-color:var(--fk-editable-field-focus-border, var(--fk-color-primary, #3b82f6));box-shadow:var(--fk-focus-ring, 0 0 0 3px rgba(10, 132, 255, .18))}.fk-editable-field__input{flex:1;min-width:0;padding:var(--fk-editable-field-input-padding, var(--fk-rhythm-1, .25rem) var(--fk-rhythm-2, .5rem));font-family:inherit;font-size:var(--fk-editable-field-font-size, var(--fk-typography-body-font-size, .875rem));color:var(--fk-editable-field-color, var(--fk-color-text, #1f2d3d));background:transparent;border:none;outline:none}.fk-editable-field__value{flex:1;min-width:0;padding:var(--fk-editable-field-input-padding, var(--fk-rhythm-1, .25rem) var(--fk-rhythm-2, .5rem));font-size:var(--fk-editable-field-font-size, var(--fk-typography-body-font-size, .875rem));color:var(--fk-editable-field-color, var(--fk-color-text, #1f2d3d));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fk-editable-field__empty{color:var(--fk-editable-field-empty-color, var(--fk-color-muted, #8a98a8))}.fk-editable-field__inline-btn{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--fk-editable-field-inline-btn-size, 1.5rem);height:var(--fk-editable-field-inline-btn-size, 1.5rem);padding:0;background:none;border:none;color:var(--fk-editable-field-trigger-color, var(--fk-color-muted, #8a98a8));cursor:pointer}.fk-editable-field__inline-btn:hover{color:var(--fk-editable-field-trigger-hover-color, var(--fk-color-primary, #3b82f6))}.fk-editable-field__inline-btn:focus-visible{outline:none;box-shadow:var(--fk-focus-ring, 0 0 0 3px rgba(10, 132, 255, .18));border-radius:var(--fk-radius-sm, .25rem)}.fk-editable-field__inline-btn--decoration{pointer-events:none;cursor:inherit}.fk-editable-field__save{display:inline-flex;align-items:center;flex-shrink:0;padding:var(--fk-rhythm-1, .25rem) var(--fk-rhythm-3, .75rem);font-family:inherit;font-size:var(--fk-editable-field-action-font-size, var(--fk-typography-small-font-size, .8125rem));font-weight:var(--fk-font-weight-medium, 500);color:var(--fk-editable-field-save-color, #ffffff);background:var(--fk-editable-field-save-bg, var(--fk-color-primary, #3b82f6));border:1px solid var(--fk-editable-field-save-bg, var(--fk-color-primary, #3b82f6));border-radius:var(--fk-editable-field-border-radius, var(--fk-radius-md, .375rem));cursor:pointer}.fk-editable-field__save:hover{opacity:.9}.fk-editable-field__save:focus-visible{outline:none;box-shadow:var(--fk-focus-ring, 0 0 0 3px rgba(10, 132, 255, .18))}.fk-editable-field__save-text{font:inherit}:host-context(.fk-editable-field--sm) .fk-editable-field__input,:host-context(.fk-editable-field--sm) .fk-editable-field__value{font-size:var(--fk-editable-field-sm-font-size, var(--fk-typography-small-font-size, .8125rem))}:host-context(.fk-editable-field--lg) .fk-editable-field__input,:host-context(.fk-editable-field--lg) .fk-editable-field__value{font-size:var(--fk-editable-field-lg-font-size, var(--fk-typography-heading-font-size, 1.25rem));font-weight:var(--fk-editable-field-lg-font-weight, var(--fk-font-weight-semibold, 600))}\n"] }]
112
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedBy", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], editStart: [{ type: i0.Output, args: ["editStart"] }], editCancel: [{ type: i0.Output, args: ["editCancel"] }], inputRef: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }], hostClass: [{
113
+ type: HostBinding,
114
+ args: ['class']
115
+ }], hostId: [{
116
+ type: HostBinding,
117
+ args: ['attr.id']
118
+ }] } });
119
+
120
+ /**
121
+ * Generated bundle index. Do not edit.
122
+ */
123
+
124
+ export { EditableFieldComponent };
125
+ //# sourceMappingURL=frame-kit-ui-ng-ui-editable-field.mjs.map