@4sh/ui-kit 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +7 -0
  3. package/README.md +229 -0
  4. package/fesm2022/4sh-ui-kit-forms.mjs +501 -0
  5. package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -0
  6. package/fesm2022/4sh-ui-kit-motion.mjs +155 -0
  7. package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -0
  8. package/fesm2022/4sh-ui-kit-overlay.mjs +61 -0
  9. package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -0
  10. package/fesm2022/4sh-ui-kit-theming.mjs +120 -0
  11. package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -0
  12. package/fesm2022/4sh-ui-kit-types.mjs +12 -0
  13. package/fesm2022/4sh-ui-kit-types.mjs.map +1 -0
  14. package/fesm2022/4sh-ui-kit-ui-accordion.mjs +244 -0
  15. package/fesm2022/4sh-ui-kit-ui-accordion.mjs.map +1 -0
  16. package/fesm2022/4sh-ui-kit-ui-alert.mjs +160 -0
  17. package/fesm2022/4sh-ui-kit-ui-alert.mjs.map +1 -0
  18. package/fesm2022/4sh-ui-kit-ui-autocomplete.mjs +926 -0
  19. package/fesm2022/4sh-ui-kit-ui-autocomplete.mjs.map +1 -0
  20. package/fesm2022/4sh-ui-kit-ui-avatar-group.mjs +34 -0
  21. package/fesm2022/4sh-ui-kit-ui-avatar-group.mjs.map +1 -0
  22. package/fesm2022/4sh-ui-kit-ui-avatar.mjs +122 -0
  23. package/fesm2022/4sh-ui-kit-ui-avatar.mjs.map +1 -0
  24. package/fesm2022/4sh-ui-kit-ui-badge.mjs +95 -0
  25. package/fesm2022/4sh-ui-kit-ui-badge.mjs.map +1 -0
  26. package/fesm2022/4sh-ui-kit-ui-breadcrumb.mjs +190 -0
  27. package/fesm2022/4sh-ui-kit-ui-breadcrumb.mjs.map +1 -0
  28. package/fesm2022/4sh-ui-kit-ui-button-split.mjs +151 -0
  29. package/fesm2022/4sh-ui-kit-ui-button-split.mjs.map +1 -0
  30. package/fesm2022/4sh-ui-kit-ui-button.mjs +222 -0
  31. package/fesm2022/4sh-ui-kit-ui-button.mjs.map +1 -0
  32. package/fesm2022/4sh-ui-kit-ui-card.mjs +164 -0
  33. package/fesm2022/4sh-ui-kit-ui-card.mjs.map +1 -0
  34. package/fesm2022/4sh-ui-kit-ui-checkbox.mjs +118 -0
  35. package/fesm2022/4sh-ui-kit-ui-checkbox.mjs.map +1 -0
  36. package/fesm2022/4sh-ui-kit-ui-chip.mjs +205 -0
  37. package/fesm2022/4sh-ui-kit-ui-chip.mjs.map +1 -0
  38. package/fesm2022/4sh-ui-kit-ui-context-menu.mjs +219 -0
  39. package/fesm2022/4sh-ui-kit-ui-context-menu.mjs.map +1 -0
  40. package/fesm2022/4sh-ui-kit-ui-datepicker.mjs +1508 -0
  41. package/fesm2022/4sh-ui-kit-ui-datepicker.mjs.map +1 -0
  42. package/fesm2022/4sh-ui-kit-ui-drawer.mjs +300 -0
  43. package/fesm2022/4sh-ui-kit-ui-drawer.mjs.map +1 -0
  44. package/fesm2022/4sh-ui-kit-ui-empty-state.mjs +148 -0
  45. package/fesm2022/4sh-ui-kit-ui-empty-state.mjs.map +1 -0
  46. package/fesm2022/4sh-ui-kit-ui-field.mjs +102 -0
  47. package/fesm2022/4sh-ui-kit-ui-field.mjs.map +1 -0
  48. package/fesm2022/4sh-ui-kit-ui-file-upload.mjs +568 -0
  49. package/fesm2022/4sh-ui-kit-ui-file-upload.mjs.map +1 -0
  50. package/fesm2022/4sh-ui-kit-ui-helper.mjs +85 -0
  51. package/fesm2022/4sh-ui-kit-ui-helper.mjs.map +1 -0
  52. package/fesm2022/4sh-ui-kit-ui-icon.mjs +98 -0
  53. package/fesm2022/4sh-ui-kit-ui-icon.mjs.map +1 -0
  54. package/fesm2022/4sh-ui-kit-ui-image.mjs +201 -0
  55. package/fesm2022/4sh-ui-kit-ui-image.mjs.map +1 -0
  56. package/fesm2022/4sh-ui-kit-ui-input-group.mjs +119 -0
  57. package/fesm2022/4sh-ui-kit-ui-input-group.mjs.map +1 -0
  58. package/fesm2022/4sh-ui-kit-ui-input-mask.mjs +125 -0
  59. package/fesm2022/4sh-ui-kit-ui-input-mask.mjs.map +1 -0
  60. package/fesm2022/4sh-ui-kit-ui-input-number.mjs +234 -0
  61. package/fesm2022/4sh-ui-kit-ui-input-number.mjs.map +1 -0
  62. package/fesm2022/4sh-ui-kit-ui-input-otp.mjs +288 -0
  63. package/fesm2022/4sh-ui-kit-ui-input-otp.mjs.map +1 -0
  64. package/fesm2022/4sh-ui-kit-ui-input-tags.mjs +679 -0
  65. package/fesm2022/4sh-ui-kit-ui-input-tags.mjs.map +1 -0
  66. package/fesm2022/4sh-ui-kit-ui-input.mjs +121 -0
  67. package/fesm2022/4sh-ui-kit-ui-input.mjs.map +1 -0
  68. package/fesm2022/4sh-ui-kit-ui-label.mjs +61 -0
  69. package/fesm2022/4sh-ui-kit-ui-label.mjs.map +1 -0
  70. package/fesm2022/4sh-ui-kit-ui-link.mjs +147 -0
  71. package/fesm2022/4sh-ui-kit-ui-link.mjs.map +1 -0
  72. package/fesm2022/4sh-ui-kit-ui-menu.mjs +484 -0
  73. package/fesm2022/4sh-ui-kit-ui-menu.mjs.map +1 -0
  74. package/fesm2022/4sh-ui-kit-ui-modal.mjs +555 -0
  75. package/fesm2022/4sh-ui-kit-ui-modal.mjs.map +1 -0
  76. package/fesm2022/4sh-ui-kit-ui-nudger.mjs +168 -0
  77. package/fesm2022/4sh-ui-kit-ui-nudger.mjs.map +1 -0
  78. package/fesm2022/4sh-ui-kit-ui-paginator.mjs +245 -0
  79. package/fesm2022/4sh-ui-kit-ui-paginator.mjs.map +1 -0
  80. package/fesm2022/4sh-ui-kit-ui-popover.mjs +296 -0
  81. package/fesm2022/4sh-ui-kit-ui-popover.mjs.map +1 -0
  82. package/fesm2022/4sh-ui-kit-ui-progress-bar.mjs +124 -0
  83. package/fesm2022/4sh-ui-kit-ui-progress-bar.mjs.map +1 -0
  84. package/fesm2022/4sh-ui-kit-ui-radio.mjs +92 -0
  85. package/fesm2022/4sh-ui-kit-ui-radio.mjs.map +1 -0
  86. package/fesm2022/4sh-ui-kit-ui-rating.mjs +185 -0
  87. package/fesm2022/4sh-ui-kit-ui-rating.mjs.map +1 -0
  88. package/fesm2022/4sh-ui-kit-ui-read-only.mjs +146 -0
  89. package/fesm2022/4sh-ui-kit-ui-read-only.mjs.map +1 -0
  90. package/fesm2022/4sh-ui-kit-ui-segment-control.mjs +386 -0
  91. package/fesm2022/4sh-ui-kit-ui-segment-control.mjs.map +1 -0
  92. package/fesm2022/4sh-ui-kit-ui-select.mjs +868 -0
  93. package/fesm2022/4sh-ui-kit-ui-select.mjs.map +1 -0
  94. package/fesm2022/4sh-ui-kit-ui-separator.mjs +77 -0
  95. package/fesm2022/4sh-ui-kit-ui-separator.mjs.map +1 -0
  96. package/fesm2022/4sh-ui-kit-ui-sidebar.mjs +577 -0
  97. package/fesm2022/4sh-ui-kit-ui-sidebar.mjs.map +1 -0
  98. package/fesm2022/4sh-ui-kit-ui-skeleton.mjs +81 -0
  99. package/fesm2022/4sh-ui-kit-ui-skeleton.mjs.map +1 -0
  100. package/fesm2022/4sh-ui-kit-ui-slider.mjs +340 -0
  101. package/fesm2022/4sh-ui-kit-ui-slider.mjs.map +1 -0
  102. package/fesm2022/4sh-ui-kit-ui-spinner.mjs +132 -0
  103. package/fesm2022/4sh-ui-kit-ui-spinner.mjs.map +1 -0
  104. package/fesm2022/4sh-ui-kit-ui-stepper.mjs +389 -0
  105. package/fesm2022/4sh-ui-kit-ui-stepper.mjs.map +1 -0
  106. package/fesm2022/4sh-ui-kit-ui-table.mjs +1406 -0
  107. package/fesm2022/4sh-ui-kit-ui-table.mjs.map +1 -0
  108. package/fesm2022/4sh-ui-kit-ui-tabs.mjs +503 -0
  109. package/fesm2022/4sh-ui-kit-ui-tabs.mjs.map +1 -0
  110. package/fesm2022/4sh-ui-kit-ui-tag.mjs +84 -0
  111. package/fesm2022/4sh-ui-kit-ui-tag.mjs.map +1 -0
  112. package/fesm2022/4sh-ui-kit-ui-textarea.mjs +119 -0
  113. package/fesm2022/4sh-ui-kit-ui-textarea.mjs.map +1 -0
  114. package/fesm2022/4sh-ui-kit-ui-toast.mjs +424 -0
  115. package/fesm2022/4sh-ui-kit-ui-toast.mjs.map +1 -0
  116. package/fesm2022/4sh-ui-kit-ui-toggle.mjs +120 -0
  117. package/fesm2022/4sh-ui-kit-ui-toggle.mjs.map +1 -0
  118. package/fesm2022/4sh-ui-kit-ui-tooltip.mjs +445 -0
  119. package/fesm2022/4sh-ui-kit-ui-tooltip.mjs.map +1 -0
  120. package/fesm2022/4sh-ui-kit.mjs +16 -0
  121. package/fesm2022/4sh-ui-kit.mjs.map +1 -0
  122. package/package.json +287 -0
  123. package/styles/base/_base.scss +19 -0
  124. package/styles/base/_motion.scss +144 -0
  125. package/styles/base/_typography.scss +99 -0
  126. package/styles/generated/_tokens-breakpoint.scss +8 -0
  127. package/styles/generated/_tokens-metrics.scss +37 -0
  128. package/styles/generated/_tokens-primitives.scss +284 -0
  129. package/styles/generated/_tokens-responsive.scss +99 -0
  130. package/styles/generated/_tokens-semantics.scss +1274 -0
  131. package/styles/generated/_tokens-styles.scss +35 -0
  132. package/styles/generated/_tokens-transitions.scss +11 -0
  133. package/styles/generated/_tokens-typography.scss +14 -0
  134. package/styles/generated/_tokens.scss +10 -0
  135. package/styles/index.scss +25 -0
  136. package/styles/settings/_ui-config.scss +67 -0
  137. package/styles/utils/_functions.scss +67 -0
  138. package/styles/utils/_helpers.scss +129 -0
  139. package/styles/utils/_mixins.scss +186 -0
  140. package/styles/utils/_motion.scss +47 -0
  141. package/styles/utils/_overlay.scss +26 -0
  142. package/styles/utils.scss +15 -0
  143. package/styles.css +1 -0
  144. package/types/4sh-ui-kit-forms.d.ts +259 -0
  145. package/types/4sh-ui-kit-motion.d.ts +111 -0
  146. package/types/4sh-ui-kit-overlay.d.ts +31 -0
  147. package/types/4sh-ui-kit-theming.d.ts +54 -0
  148. package/types/4sh-ui-kit-types.d.ts +13 -0
  149. package/types/4sh-ui-kit-ui-accordion.d.ts +140 -0
  150. package/types/4sh-ui-kit-ui-alert.d.ts +89 -0
  151. package/types/4sh-ui-kit-ui-autocomplete.d.ts +411 -0
  152. package/types/4sh-ui-kit-ui-avatar-group.d.ts +17 -0
  153. package/types/4sh-ui-kit-ui-avatar.d.ts +55 -0
  154. package/types/4sh-ui-kit-ui-badge.d.ts +38 -0
  155. package/types/4sh-ui-kit-ui-breadcrumb.d.ts +131 -0
  156. package/types/4sh-ui-kit-ui-button-split.d.ts +102 -0
  157. package/types/4sh-ui-kit-ui-button.d.ts +91 -0
  158. package/types/4sh-ui-kit-ui-card.d.ts +102 -0
  159. package/types/4sh-ui-kit-ui-checkbox.d.ts +54 -0
  160. package/types/4sh-ui-kit-ui-chip.d.ts +114 -0
  161. package/types/4sh-ui-kit-ui-context-menu.d.ts +105 -0
  162. package/types/4sh-ui-kit-ui-datepicker.d.ts +539 -0
  163. package/types/4sh-ui-kit-ui-drawer.d.ts +147 -0
  164. package/types/4sh-ui-kit-ui-empty-state.d.ts +93 -0
  165. package/types/4sh-ui-kit-ui-field.d.ts +53 -0
  166. package/types/4sh-ui-kit-ui-file-upload.d.ts +268 -0
  167. package/types/4sh-ui-kit-ui-helper.d.ts +46 -0
  168. package/types/4sh-ui-kit-ui-icon.d.ts +69 -0
  169. package/types/4sh-ui-kit-ui-image.d.ts +88 -0
  170. package/types/4sh-ui-kit-ui-input-group.d.ts +54 -0
  171. package/types/4sh-ui-kit-ui-input-mask.d.ts +63 -0
  172. package/types/4sh-ui-kit-ui-input-number.d.ts +96 -0
  173. package/types/4sh-ui-kit-ui-input-otp.d.ts +130 -0
  174. package/types/4sh-ui-kit-ui-input-tags.d.ts +350 -0
  175. package/types/4sh-ui-kit-ui-input.d.ts +78 -0
  176. package/types/4sh-ui-kit-ui-label.d.ts +36 -0
  177. package/types/4sh-ui-kit-ui-link.d.ts +72 -0
  178. package/types/4sh-ui-kit-ui-menu.d.ts +235 -0
  179. package/types/4sh-ui-kit-ui-modal.d.ts +241 -0
  180. package/types/4sh-ui-kit-ui-nudger.d.ts +79 -0
  181. package/types/4sh-ui-kit-ui-paginator.d.ts +150 -0
  182. package/types/4sh-ui-kit-ui-popover.d.ts +125 -0
  183. package/types/4sh-ui-kit-ui-progress-bar.d.ts +82 -0
  184. package/types/4sh-ui-kit-ui-radio.d.ts +44 -0
  185. package/types/4sh-ui-kit-ui-rating.d.ts +90 -0
  186. package/types/4sh-ui-kit-ui-read-only.d.ts +70 -0
  187. package/types/4sh-ui-kit-ui-segment-control.d.ts +184 -0
  188. package/types/4sh-ui-kit-ui-select.d.ts +392 -0
  189. package/types/4sh-ui-kit-ui-separator.d.ts +43 -0
  190. package/types/4sh-ui-kit-ui-sidebar.d.ts +358 -0
  191. package/types/4sh-ui-kit-ui-skeleton.d.ts +52 -0
  192. package/types/4sh-ui-kit-ui-slider.d.ts +127 -0
  193. package/types/4sh-ui-kit-ui-spinner.d.ts +67 -0
  194. package/types/4sh-ui-kit-ui-stepper.d.ts +220 -0
  195. package/types/4sh-ui-kit-ui-table.d.ts +570 -0
  196. package/types/4sh-ui-kit-ui-tabs.d.ts +225 -0
  197. package/types/4sh-ui-kit-ui-tag.d.ts +46 -0
  198. package/types/4sh-ui-kit-ui-textarea.d.ts +61 -0
  199. package/types/4sh-ui-kit-ui-toast.d.ts +247 -0
  200. package/types/4sh-ui-kit-ui-toggle.d.ts +67 -0
  201. package/types/4sh-ui-kit-ui-tooltip.d.ts +167 -0
  202. package/types/4sh-ui-kit.d.ts +4 -0
@@ -0,0 +1,205 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, booleanAttribute, model, output, signal, computed, effect, isDevMode, Component } from '@angular/core';
3
+ import { NgTemplateOutlet } from '@angular/common';
4
+ import { UiIcon } from '@4sh/ui-kit/ui-icon';
5
+
6
+ /**
7
+ * ui-chip — compact, interactive entity token.
8
+ *
9
+ * A close relative of `ui-tag`, but interactive: it can carry a leading icon or
10
+ * image (avatar-like), an optional remove action, and arbitrary projected content.
11
+ * Typical uses: selected values in a multi-select, filter/entity chips, keyword lists.
12
+ *
13
+ * Categorised by `level` × `subLevel` (informative color families) and fully
14
+ * token-driven. Interactive states (hover/focus on the remove action) are handled in
15
+ * CSS via the same `informative.*` tokens — never through Angular props.
16
+ *
17
+ * Accessible: `label` is exposed as the default `aria-label` (overridable via
18
+ * `ariaLabel` / `ariaLabelledBy`); the remove action is a native `<button>`, focusable
19
+ * with Tab and removable with Enter/Space (native) plus Backspace/Delete.
20
+ */
21
+ class UiChip {
22
+ constructor() {
23
+ /** Text content of the chip. */
24
+ this.label = input(/* @ts-ignore */
25
+ ...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
26
+ /** Color family. */
27
+ this.level = input('default', /* @ts-ignore */
28
+ ...(ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []));
29
+ /** Intensity: high (solid) or low (subtle). Chips default to the discreet `low`. */
30
+ this.subLevel = input('low', /* @ts-ignore */
31
+ ...(ngDevMode ? [{ debugName: "subLevel" }] : /* istanbul ignore next */ []));
32
+ /** Size. */
33
+ this.size = input('default', /* @ts-ignore */
34
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
35
+ /** FontAwesome name of the leading icon (ignored when `image` is set). */
36
+ this.icon = input(/* @ts-ignore */
37
+ ...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
38
+ /** Leading image source (avatar-like). Takes priority over `icon`. */
39
+ this.image = input(/* @ts-ignore */
40
+ ...(ngDevMode ? [undefined, { debugName: "image" }] : /* istanbul ignore next */ []));
41
+ /** Alternative text for the image (leave empty for a decorative image next to a label). */
42
+ this.alt = input(/* @ts-ignore */
43
+ ...(ngDevMode ? [undefined, { debugName: "alt" }] : /* istanbul ignore next */ []));
44
+ /** Pill shape when true (default); rounded-rectangle when false. */
45
+ this.rounded = input(true, { ...(ngDevMode ? { debugName: "rounded" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
46
+ /** Displays a remove action at the end of the chip. */
47
+ this.removable = input(false, { ...(ngDevMode ? { debugName: "removable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
48
+ /** FontAwesome name of the remove icon. */
49
+ this.removeIcon = input('xmark', /* @ts-ignore */
50
+ ...(ngDevMode ? [{ debugName: "removeIcon" }] : /* istanbul ignore next */ []));
51
+ /** Disables the chip (the remove action / selection becomes non-interactive). */
52
+ this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
53
+ /**
54
+ * Turns the whole chip into a selectable toggle (choice/filter chip). The root
55
+ * becomes a native `<button aria-pressed>`; clicking toggles `selected`.
56
+ * Mutually exclusive with `removable` (nesting interactive elements is invalid).
57
+ */
58
+ this.selectable = input(false, { ...(ngDevMode ? { debugName: "selectable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
59
+ /** Two-way selection state (only meaningful when `selectable`). */
60
+ this.selected = model(false, /* @ts-ignore */
61
+ ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
62
+ /** FontAwesome name shown in the leading slot while selected (selectable mode). */
63
+ this.selectedIcon = input('check', /* @ts-ignore */
64
+ ...(ngDevMode ? [{ debugName: "selectedIcon" }] : /* istanbul ignore next */ []));
65
+ /** Explicit accessible name (overrides the `label` default). */
66
+ this.ariaLabel = input(/* @ts-ignore */
67
+ ...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
68
+ /** Id of the element labelling the chip (overrides `ariaLabel`/`label`). */
69
+ this.ariaLabelledBy = input(/* @ts-ignore */
70
+ ...(ngDevMode ? [undefined, { debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []));
71
+ /** Accessible name of the remove action. */
72
+ this.removeAriaLabel = input('Supprimer', /* @ts-ignore */
73
+ ...(ngDevMode ? [{ debugName: "removeAriaLabel" }] : /* istanbul ignore next */ []));
74
+ /**
75
+ * `tabindex` of the remove action. Leave unset for the natural tab order;
76
+ * set `-1` when the chip lives inside a roving-focus container (e.g.
77
+ * `ui-input-tags`) so the button is not a separate tab stop.
78
+ */
79
+ this.removeTabindex = input(/* @ts-ignore */
80
+ ...(ngDevMode ? [undefined, { debugName: "removeTabindex" }] : /* istanbul ignore next */ []));
81
+ /** Emitted when the chip is removed (click or keyboard on the remove action). */
82
+ this.remove = output();
83
+ /** Emitted when a selectable chip is toggled (click or keyboard on the chip). */
84
+ this.chipClick = output();
85
+ /** Emitted when the image fails to load (the chip then falls back to icon/label). */
86
+ this.imageError = output();
87
+ /** @ignore Set once the current image source failed to load. */
88
+ this.imageFailed = signal(false, /* @ts-ignore */
89
+ ...(ngDevMode ? [{ debugName: "imageFailed" }] : /* istanbul ignore next */ []));
90
+ /** @ignore There is a textual label. */
91
+ this.hasLabel = computed(() => !!this.label()?.length, /* @ts-ignore */
92
+ ...(ngDevMode ? [{ debugName: "hasLabel" }] : /* istanbul ignore next */ []));
93
+ /** @ignore The leading image is shown (source set and not failed). */
94
+ this.showImage = computed(() => !!this.image() && !this.imageFailed(), /* @ts-ignore */
95
+ ...(ngDevMode ? [{ debugName: "showImage" }] : /* istanbul ignore next */ []));
96
+ /** @ignore Selectable + selected: the leading slot shows the selected icon. */
97
+ this.showSelectedIcon = computed(() => this.selectable() && this.selected() && !!this.selectedIcon(), /* @ts-ignore */
98
+ ...(ngDevMode ? [{ debugName: "showSelectedIcon" }] : /* istanbul ignore next */ []));
99
+ /** @ignore The leading image is shown (not overridden by the selected icon). */
100
+ this.showLeadingImage = computed(() => !this.showSelectedIcon() && this.showImage(), /* @ts-ignore */
101
+ ...(ngDevMode ? [{ debugName: "showLeadingImage" }] : /* istanbul ignore next */ []));
102
+ /** @ignore The leading font icon is shown (no image / selected icon taking its place). */
103
+ this.showIcon = computed(() => !this.showImage() && !!this.icon(), /* @ts-ignore */
104
+ ...(ngDevMode ? [{ debugName: "showIcon" }] : /* istanbul ignore next */ []));
105
+ /** @ignore The leading font icon is shown (not overridden by the selected icon). */
106
+ this.showLeadingIcon = computed(() => !this.showSelectedIcon() && this.showIcon(), /* @ts-ignore */
107
+ ...(ngDevMode ? [{ debugName: "showLeadingIcon" }] : /* istanbul ignore next */ []));
108
+ /** @ignore The remove action is rendered (never inside a selectable button). */
109
+ this.showRemove = computed(() => this.removable() && !this.selectable(), /* @ts-ignore */
110
+ ...(ngDevMode ? [{ debugName: "showRemove" }] : /* istanbul ignore next */ []));
111
+ /** @ignore A visual (icon/image) with no textual label. */
112
+ this.isVisualOnly = computed(() => (this.showImage() || this.showIcon()) && !this.hasLabel(), /* @ts-ignore */
113
+ ...(ngDevMode ? [{ debugName: "isVisualOnly" }] : /* istanbul ignore next */ []));
114
+ /** @ignore Resolved accessible name from the explicit label / ariaLabel. */
115
+ this.accessibleName = computed(() => this.ariaLabel() ?? this.label() ?? null, /* @ts-ignore */
116
+ ...(ngDevMode ? [{ debugName: "accessibleName" }] : /* istanbul ignore next */ []));
117
+ /** @ignore Root `aria-label`: explicit name, suppressed when `ariaLabelledBy` wins. */
118
+ this.rootAriaLabel = computed(() => this.ariaLabelledBy() ? null : this.accessibleName(), /* @ts-ignore */
119
+ ...(ngDevMode ? [{ debugName: "rootAriaLabel" }] : /* istanbul ignore next */ []));
120
+ /** @ignore Leading icon size derived from the chip size. */
121
+ this.iconSize = computed(() => (this.size() === 'small' ? 'sm' : 'md'), /* @ts-ignore */
122
+ ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
123
+ /** @ignore Remove icon is compact regardless of chip size. */
124
+ this.removeIconSize = 'sm';
125
+ /** @ignore */
126
+ this.classes = computed(() => {
127
+ const c = ['ui-chip', `_${this.level()}`, `_${this.subLevel()}`];
128
+ if (this.size() !== 'default')
129
+ c.push(`_${this.size()}`);
130
+ if (!this.rounded())
131
+ c.push('_square');
132
+ if (this.showRemove())
133
+ c.push('_removable');
134
+ if (this.disabled())
135
+ c.push('_disabled');
136
+ if (this.selectable())
137
+ c.push('_selectable');
138
+ if (this.selectable() && this.selected())
139
+ c.push('_selected');
140
+ return c.join(' ');
141
+ }, /* @ts-ignore */
142
+ ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
143
+ // Reset the load-error flag whenever the source changes.
144
+ effect(() => {
145
+ this.image();
146
+ this.imageFailed.set(false);
147
+ });
148
+ // A11y safeguard: a chip with only a visual (icon/image) needs an accessible name.
149
+ if (isDevMode()) {
150
+ effect(() => {
151
+ if (this.isVisualOnly() && !this.accessibleName()) {
152
+ console.warn('[ui-chip] Chip has no text: provide `label`, `ariaLabel` or `ariaLabelledBy`.');
153
+ }
154
+ });
155
+ // `selectable` and `removable` can't coexist (nested interactive elements).
156
+ effect(() => {
157
+ if (this.selectable() && this.removable()) {
158
+ console.warn('[ui-chip] `selectable` and `removable` are mutually exclusive: the remove action is ignored.');
159
+ }
160
+ });
161
+ }
162
+ }
163
+ /** @ignore */
164
+ onImageError(event) {
165
+ this.imageFailed.set(true);
166
+ this.imageError.emit(event);
167
+ }
168
+ /** @ignore */
169
+ onRemove(event) {
170
+ if (this.disabled())
171
+ return;
172
+ this.remove.emit(event);
173
+ }
174
+ /** @ignore Backspace/Delete on the remove button also removes (Enter/Space are native). */
175
+ onRemoveKeydown(event) {
176
+ if (event.key === 'Backspace' || event.key === 'Delete') {
177
+ event.preventDefault();
178
+ this.onRemove(event);
179
+ }
180
+ }
181
+ /** @ignore Toggle the selection (selectable mode). Enter/Space fire this via native click. */
182
+ onToggle(event) {
183
+ if (this.disabled())
184
+ return;
185
+ this.selected.set(!this.selected());
186
+ this.chipClick.emit(event);
187
+ }
188
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiChip, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
189
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: UiChip, isStandalone: true, selector: "ui-chip", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, subLevel: { classPropertyName: "subLevel", publicName: "subLevel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, image: { classPropertyName: "image", publicName: "image", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, removeIcon: { classPropertyName: "removeIcon", publicName: "removeIcon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, selectedIcon: { classPropertyName: "selectedIcon", publicName: "selectedIcon", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, removeAriaLabel: { classPropertyName: "removeAriaLabel", publicName: "removeAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, removeTabindex: { classPropertyName: "removeTabindex", publicName: "removeTabindex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selectedChange", remove: "remove", chipClick: "chipClick", imageError: "imageError" }, ngImport: i0, template: "@if (selectable()) {\n <button\n type=\"button\"\n [class]=\"classes()\"\n [disabled]=\"disabled()\"\n [attr.aria-pressed]=\"selected()\"\n [attr.aria-label]=\"rootAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n (click)=\"onToggle($event)\"\n >\n <ng-container [ngTemplateOutlet]=\"inner\" />\n </button>\n} @else {\n <span\n [class]=\"classes()\"\n [attr.aria-label]=\"rootAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n >\n <ng-container [ngTemplateOutlet]=\"inner\" />\n </span>\n}\n\n<ng-template #inner>\n @if (showSelectedIcon()) {\n <ui-icon class=\"ui-chip-icon\" [name]=\"selectedIcon()!\" [size]=\"iconSize()\" />\n } @else if (showLeadingImage()) {\n <img\n class=\"ui-chip-image\"\n [src]=\"image()\"\n [attr.alt]=\"alt() ?? ''\"\n (error)=\"onImageError($event)\"\n />\n } @else if (showLeadingIcon()) {\n <ui-icon class=\"ui-chip-icon\" [name]=\"icon()!\" [size]=\"iconSize()\" />\n }\n\n @if (hasLabel()) {\n <span class=\"ui-chip-label\">{{ label() }}</span>\n }\n\n <!-- Custom / templated content -->\n <ng-content />\n\n @if (showRemove()) {\n <button\n type=\"button\"\n class=\"ui-chip-remove\"\n [disabled]=\"disabled()\"\n [attr.tabindex]=\"removeTabindex()\"\n [attr.aria-label]=\"removeAriaLabel()\"\n (click)=\"onRemove($event)\"\n (keydown)=\"onRemoveKeydown($event)\"\n >\n <ui-icon [name]=\"removeIcon()\" [size]=\"removeIconSize\" />\n </button>\n }\n</ng-template>\n", styles: [".ui-chip{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;max-width:100%;border:var(--stroke-sm) solid transparent;border-radius:var(--radius-full);font-family:var(--fontfamily-base);font-weight:var(--weight-regular);line-height:1;white-space:nowrap;height:2rem;min-width:2rem;gap:var(--units-xs);padding:0 var(--units-sm);font-size:var(--size-typography-text-default)}.ui-chip .ui-chip-image{width:1.5rem;height:1.5rem}.ui-chip-icon{line-height:0;flex:none}.ui-chip-image{flex:none;margin-inline-start:calc(-1 * var(--units-2xs));border-radius:var(--radius-full);object-fit:cover}.ui-chip-label{display:inline-flex;align-items:center;height:100%;overflow:hidden;text-overflow:ellipsis}.ui-chip-remove{flex:none;display:inline-flex;align-items:center;justify-content:center;margin:0;padding:var(--units-2xs);border:0;border-radius:var(--radius-full);background:transparent;color:inherit;line-height:0;cursor:pointer;transition:background-color var(--transition-default) var(--transition-easeinout),color var(--transition-default) var(--transition-easeinout),box-shadow var(--transition-default) var(--transition-easeinout)}.ui-chip-remove:disabled{cursor:not-allowed}.ui-chip._removable{padding-inline-end:var(--units-2xs)!important}.ui-chip._selectable{appearance:none;cursor:pointer;text-align:center;transition:background-color var(--transition-default) var(--transition-easeinout),color var(--transition-default) var(--transition-easeinout),border-color var(--transition-default) var(--transition-easeinout),box-shadow var(--transition-default) var(--transition-easeinout)}.ui-chip._selectable:disabled{cursor:not-allowed}.ui-chip._square{border-radius:var(--radius-sm)}.ui-chip._square .ui-chip-image{border-radius:var(--radius-xs)}.ui-chip._disabled{cursor:not-allowed}.ui-chip._small{height:1.5rem;min-width:1.5rem;gap:var(--units-2xs);padding:0 var(--units-sm);font-size:var(--size-typography-text-md)}.ui-chip._small .ui-chip-image{width:1.125rem;height:1.125rem}.ui-chip._default._high{background-color:var(--informative-defaulthigh-surface-default);color:var(--informative-defaulthigh-content-default);border-color:var(--informative-defaulthigh-stroke-default)}.ui-chip._default._high .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-defaulthigh-surface-hover);color:var(--informative-defaulthigh-content-hover)}.ui-chip._default._high .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-defaulthigh-content-default)}.ui-chip._default._high._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-defaulthigh-surface-hover);color:var(--informative-defaulthigh-content-hover)}.ui-chip._default._low{background-color:var(--informative-defaultlow-surface-default);color:var(--informative-defaultlow-content-default);border-color:var(--informative-defaultlow-stroke-default)}.ui-chip._default._low .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-defaultlow-surface-hover);color:var(--informative-defaultlow-content-hover)}.ui-chip._default._low .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-defaultlow-content-default)}.ui-chip._default._low._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-defaultlow-surface-hover);color:var(--informative-defaultlow-content-hover)}.ui-chip._default._selected{background-color:var(--informative-defaulthigh-surface-default);color:var(--informative-defaulthigh-content-default);border-color:var(--informative-defaulthigh-stroke-default)}.ui-chip._default._selected._selectable:hover:not(:disabled){background-color:var(--informative-defaulthigh-surface-hover);color:var(--informative-defaulthigh-content-hover)}.ui-chip._default._selectable:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-defaulthigh-surface-default)}.ui-chip._highlight._high{background-color:var(--informative-highlighthigh-surface-default);color:var(--informative-highlighthigh-content-default);border-color:var(--informative-highlighthigh-stroke-default)}.ui-chip._highlight._high .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-highlighthigh-surface-hover);color:var(--informative-highlighthigh-content-hover)}.ui-chip._highlight._high .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-highlighthigh-content-default)}.ui-chip._highlight._high._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-highlighthigh-surface-hover);color:var(--informative-highlighthigh-content-hover)}.ui-chip._highlight._low{background-color:var(--informative-highlightlow-surface-default);color:var(--informative-highlightlow-content-default);border-color:var(--informative-highlightlow-stroke-default)}.ui-chip._highlight._low .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-highlightlow-surface-hover);color:var(--informative-highlightlow-content-hover)}.ui-chip._highlight._low .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-highlightlow-content-default)}.ui-chip._highlight._low._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-highlightlow-surface-hover);color:var(--informative-highlightlow-content-hover)}.ui-chip._highlight._selected{background-color:var(--informative-highlighthigh-surface-default);color:var(--informative-highlighthigh-content-default);border-color:var(--informative-highlighthigh-stroke-default)}.ui-chip._highlight._selected._selectable:hover:not(:disabled){background-color:var(--informative-highlighthigh-surface-hover);color:var(--informative-highlighthigh-content-hover)}.ui-chip._highlight._selectable:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-highlighthigh-surface-default)}.ui-chip._success._high{background-color:var(--informative-successhigh-surface-default);color:var(--informative-successhigh-content-default);border-color:var(--informative-successhigh-stroke-default)}.ui-chip._success._high .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-successhigh-surface-hover);color:var(--informative-successhigh-content-hover)}.ui-chip._success._high .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-successhigh-content-default)}.ui-chip._success._high._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-successhigh-surface-hover);color:var(--informative-successhigh-content-hover)}.ui-chip._success._low{background-color:var(--informative-successlow-surface-default);color:var(--informative-successlow-content-default);border-color:var(--informative-successlow-stroke-default)}.ui-chip._success._low .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-successlow-surface-hover);color:var(--informative-successlow-content-hover)}.ui-chip._success._low .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-successlow-content-default)}.ui-chip._success._low._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-successlow-surface-hover);color:var(--informative-successlow-content-hover)}.ui-chip._success._selected{background-color:var(--informative-successhigh-surface-default);color:var(--informative-successhigh-content-default);border-color:var(--informative-successhigh-stroke-default)}.ui-chip._success._selected._selectable:hover:not(:disabled){background-color:var(--informative-successhigh-surface-hover);color:var(--informative-successhigh-content-hover)}.ui-chip._success._selectable:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-successhigh-surface-default)}.ui-chip._warning._high{background-color:var(--informative-warninghigh-surface-default);color:var(--informative-warninghigh-content-default);border-color:var(--informative-warninghigh-stroke-default)}.ui-chip._warning._high .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-warninghigh-surface-hover);color:var(--informative-warninghigh-content-hover)}.ui-chip._warning._high .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-warninghigh-content-default)}.ui-chip._warning._high._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-warninghigh-surface-hover);color:var(--informative-warninghigh-content-hover)}.ui-chip._warning._low{background-color:var(--informative-warninglow-surface-default);color:var(--informative-warninglow-content-default);border-color:var(--informative-warninglow-stroke-default)}.ui-chip._warning._low .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-warninglow-surface-hover);color:var(--informative-warninglow-content-hover)}.ui-chip._warning._low .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-warninglow-content-default)}.ui-chip._warning._low._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-warninglow-surface-hover);color:var(--informative-warninglow-content-hover)}.ui-chip._warning._selected{background-color:var(--informative-warninghigh-surface-default);color:var(--informative-warninghigh-content-default);border-color:var(--informative-warninghigh-stroke-default)}.ui-chip._warning._selected._selectable:hover:not(:disabled){background-color:var(--informative-warninghigh-surface-hover);color:var(--informative-warninghigh-content-hover)}.ui-chip._warning._selectable:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-warninghigh-surface-default)}.ui-chip._error._high{background-color:var(--informative-errorhigh-surface-default);color:var(--informative-errorhigh-content-default);border-color:var(--informative-errorhigh-stroke-default)}.ui-chip._error._high .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-errorhigh-surface-hover);color:var(--informative-errorhigh-content-hover)}.ui-chip._error._high .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-errorhigh-content-default)}.ui-chip._error._high._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-errorhigh-surface-hover);color:var(--informative-errorhigh-content-hover)}.ui-chip._error._low{background-color:var(--informative-errorlow-surface-default);color:var(--informative-errorlow-content-default);border-color:var(--informative-errorlow-stroke-default)}.ui-chip._error._low .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-errorlow-surface-hover);color:var(--informative-errorlow-content-hover)}.ui-chip._error._low .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-errorlow-content-default)}.ui-chip._error._low._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-errorlow-surface-hover);color:var(--informative-errorlow-content-hover)}.ui-chip._error._selected{background-color:var(--informative-errorhigh-surface-default);color:var(--informative-errorhigh-content-default);border-color:var(--informative-errorhigh-stroke-default)}.ui-chip._error._selected._selectable:hover:not(:disabled){background-color:var(--informative-errorhigh-surface-hover);color:var(--informative-errorhigh-content-hover)}.ui-chip._error._selectable:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-errorhigh-surface-default)}\n"], dependencies: [{ kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
190
+ }
191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiChip, decorators: [{
192
+ type: Component,
193
+ args: [{ selector: 'ui-chip', imports: [UiIcon, NgTemplateOutlet], template: "@if (selectable()) {\n <button\n type=\"button\"\n [class]=\"classes()\"\n [disabled]=\"disabled()\"\n [attr.aria-pressed]=\"selected()\"\n [attr.aria-label]=\"rootAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n (click)=\"onToggle($event)\"\n >\n <ng-container [ngTemplateOutlet]=\"inner\" />\n </button>\n} @else {\n <span\n [class]=\"classes()\"\n [attr.aria-label]=\"rootAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n >\n <ng-container [ngTemplateOutlet]=\"inner\" />\n </span>\n}\n\n<ng-template #inner>\n @if (showSelectedIcon()) {\n <ui-icon class=\"ui-chip-icon\" [name]=\"selectedIcon()!\" [size]=\"iconSize()\" />\n } @else if (showLeadingImage()) {\n <img\n class=\"ui-chip-image\"\n [src]=\"image()\"\n [attr.alt]=\"alt() ?? ''\"\n (error)=\"onImageError($event)\"\n />\n } @else if (showLeadingIcon()) {\n <ui-icon class=\"ui-chip-icon\" [name]=\"icon()!\" [size]=\"iconSize()\" />\n }\n\n @if (hasLabel()) {\n <span class=\"ui-chip-label\">{{ label() }}</span>\n }\n\n <!-- Custom / templated content -->\n <ng-content />\n\n @if (showRemove()) {\n <button\n type=\"button\"\n class=\"ui-chip-remove\"\n [disabled]=\"disabled()\"\n [attr.tabindex]=\"removeTabindex()\"\n [attr.aria-label]=\"removeAriaLabel()\"\n (click)=\"onRemove($event)\"\n (keydown)=\"onRemoveKeydown($event)\"\n >\n <ui-icon [name]=\"removeIcon()\" [size]=\"removeIconSize\" />\n </button>\n }\n</ng-template>\n", styles: [".ui-chip{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;max-width:100%;border:var(--stroke-sm) solid transparent;border-radius:var(--radius-full);font-family:var(--fontfamily-base);font-weight:var(--weight-regular);line-height:1;white-space:nowrap;height:2rem;min-width:2rem;gap:var(--units-xs);padding:0 var(--units-sm);font-size:var(--size-typography-text-default)}.ui-chip .ui-chip-image{width:1.5rem;height:1.5rem}.ui-chip-icon{line-height:0;flex:none}.ui-chip-image{flex:none;margin-inline-start:calc(-1 * var(--units-2xs));border-radius:var(--radius-full);object-fit:cover}.ui-chip-label{display:inline-flex;align-items:center;height:100%;overflow:hidden;text-overflow:ellipsis}.ui-chip-remove{flex:none;display:inline-flex;align-items:center;justify-content:center;margin:0;padding:var(--units-2xs);border:0;border-radius:var(--radius-full);background:transparent;color:inherit;line-height:0;cursor:pointer;transition:background-color var(--transition-default) var(--transition-easeinout),color var(--transition-default) var(--transition-easeinout),box-shadow var(--transition-default) var(--transition-easeinout)}.ui-chip-remove:disabled{cursor:not-allowed}.ui-chip._removable{padding-inline-end:var(--units-2xs)!important}.ui-chip._selectable{appearance:none;cursor:pointer;text-align:center;transition:background-color var(--transition-default) var(--transition-easeinout),color var(--transition-default) var(--transition-easeinout),border-color var(--transition-default) var(--transition-easeinout),box-shadow var(--transition-default) var(--transition-easeinout)}.ui-chip._selectable:disabled{cursor:not-allowed}.ui-chip._square{border-radius:var(--radius-sm)}.ui-chip._square .ui-chip-image{border-radius:var(--radius-xs)}.ui-chip._disabled{cursor:not-allowed}.ui-chip._small{height:1.5rem;min-width:1.5rem;gap:var(--units-2xs);padding:0 var(--units-sm);font-size:var(--size-typography-text-md)}.ui-chip._small .ui-chip-image{width:1.125rem;height:1.125rem}.ui-chip._default._high{background-color:var(--informative-defaulthigh-surface-default);color:var(--informative-defaulthigh-content-default);border-color:var(--informative-defaulthigh-stroke-default)}.ui-chip._default._high .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-defaulthigh-surface-hover);color:var(--informative-defaulthigh-content-hover)}.ui-chip._default._high .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-defaulthigh-content-default)}.ui-chip._default._high._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-defaulthigh-surface-hover);color:var(--informative-defaulthigh-content-hover)}.ui-chip._default._low{background-color:var(--informative-defaultlow-surface-default);color:var(--informative-defaultlow-content-default);border-color:var(--informative-defaultlow-stroke-default)}.ui-chip._default._low .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-defaultlow-surface-hover);color:var(--informative-defaultlow-content-hover)}.ui-chip._default._low .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-defaultlow-content-default)}.ui-chip._default._low._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-defaultlow-surface-hover);color:var(--informative-defaultlow-content-hover)}.ui-chip._default._selected{background-color:var(--informative-defaulthigh-surface-default);color:var(--informative-defaulthigh-content-default);border-color:var(--informative-defaulthigh-stroke-default)}.ui-chip._default._selected._selectable:hover:not(:disabled){background-color:var(--informative-defaulthigh-surface-hover);color:var(--informative-defaulthigh-content-hover)}.ui-chip._default._selectable:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-defaulthigh-surface-default)}.ui-chip._highlight._high{background-color:var(--informative-highlighthigh-surface-default);color:var(--informative-highlighthigh-content-default);border-color:var(--informative-highlighthigh-stroke-default)}.ui-chip._highlight._high .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-highlighthigh-surface-hover);color:var(--informative-highlighthigh-content-hover)}.ui-chip._highlight._high .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-highlighthigh-content-default)}.ui-chip._highlight._high._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-highlighthigh-surface-hover);color:var(--informative-highlighthigh-content-hover)}.ui-chip._highlight._low{background-color:var(--informative-highlightlow-surface-default);color:var(--informative-highlightlow-content-default);border-color:var(--informative-highlightlow-stroke-default)}.ui-chip._highlight._low .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-highlightlow-surface-hover);color:var(--informative-highlightlow-content-hover)}.ui-chip._highlight._low .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-highlightlow-content-default)}.ui-chip._highlight._low._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-highlightlow-surface-hover);color:var(--informative-highlightlow-content-hover)}.ui-chip._highlight._selected{background-color:var(--informative-highlighthigh-surface-default);color:var(--informative-highlighthigh-content-default);border-color:var(--informative-highlighthigh-stroke-default)}.ui-chip._highlight._selected._selectable:hover:not(:disabled){background-color:var(--informative-highlighthigh-surface-hover);color:var(--informative-highlighthigh-content-hover)}.ui-chip._highlight._selectable:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-highlighthigh-surface-default)}.ui-chip._success._high{background-color:var(--informative-successhigh-surface-default);color:var(--informative-successhigh-content-default);border-color:var(--informative-successhigh-stroke-default)}.ui-chip._success._high .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-successhigh-surface-hover);color:var(--informative-successhigh-content-hover)}.ui-chip._success._high .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-successhigh-content-default)}.ui-chip._success._high._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-successhigh-surface-hover);color:var(--informative-successhigh-content-hover)}.ui-chip._success._low{background-color:var(--informative-successlow-surface-default);color:var(--informative-successlow-content-default);border-color:var(--informative-successlow-stroke-default)}.ui-chip._success._low .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-successlow-surface-hover);color:var(--informative-successlow-content-hover)}.ui-chip._success._low .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-successlow-content-default)}.ui-chip._success._low._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-successlow-surface-hover);color:var(--informative-successlow-content-hover)}.ui-chip._success._selected{background-color:var(--informative-successhigh-surface-default);color:var(--informative-successhigh-content-default);border-color:var(--informative-successhigh-stroke-default)}.ui-chip._success._selected._selectable:hover:not(:disabled){background-color:var(--informative-successhigh-surface-hover);color:var(--informative-successhigh-content-hover)}.ui-chip._success._selectable:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-successhigh-surface-default)}.ui-chip._warning._high{background-color:var(--informative-warninghigh-surface-default);color:var(--informative-warninghigh-content-default);border-color:var(--informative-warninghigh-stroke-default)}.ui-chip._warning._high .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-warninghigh-surface-hover);color:var(--informative-warninghigh-content-hover)}.ui-chip._warning._high .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-warninghigh-content-default)}.ui-chip._warning._high._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-warninghigh-surface-hover);color:var(--informative-warninghigh-content-hover)}.ui-chip._warning._low{background-color:var(--informative-warninglow-surface-default);color:var(--informative-warninglow-content-default);border-color:var(--informative-warninglow-stroke-default)}.ui-chip._warning._low .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-warninglow-surface-hover);color:var(--informative-warninglow-content-hover)}.ui-chip._warning._low .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-warninglow-content-default)}.ui-chip._warning._low._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-warninglow-surface-hover);color:var(--informative-warninglow-content-hover)}.ui-chip._warning._selected{background-color:var(--informative-warninghigh-surface-default);color:var(--informative-warninghigh-content-default);border-color:var(--informative-warninghigh-stroke-default)}.ui-chip._warning._selected._selectable:hover:not(:disabled){background-color:var(--informative-warninghigh-surface-hover);color:var(--informative-warninghigh-content-hover)}.ui-chip._warning._selectable:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-warninghigh-surface-default)}.ui-chip._error._high{background-color:var(--informative-errorhigh-surface-default);color:var(--informative-errorhigh-content-default);border-color:var(--informative-errorhigh-stroke-default)}.ui-chip._error._high .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-errorhigh-surface-hover);color:var(--informative-errorhigh-content-hover)}.ui-chip._error._high .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-errorhigh-content-default)}.ui-chip._error._high._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-errorhigh-surface-hover);color:var(--informative-errorhigh-content-hover)}.ui-chip._error._low{background-color:var(--informative-errorlow-surface-default);color:var(--informative-errorlow-content-default);border-color:var(--informative-errorlow-stroke-default)}.ui-chip._error._low .ui-chip-remove:hover:not(:disabled){background-color:var(--informative-errorlow-surface-hover);color:var(--informative-errorlow-content-hover)}.ui-chip._error._low .ui-chip-remove:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-errorlow-content-default)}.ui-chip._error._low._selectable:not(._selected):hover:not(:disabled){background-color:var(--informative-errorlow-surface-hover);color:var(--informative-errorlow-content-hover)}.ui-chip._error._selected{background-color:var(--informative-errorhigh-surface-default);color:var(--informative-errorhigh-content-default);border-color:var(--informative-errorhigh-stroke-default)}.ui-chip._error._selected._selectable:hover:not(:disabled){background-color:var(--informative-errorhigh-surface-hover);color:var(--informative-errorhigh-content-hover)}.ui-chip._error._selectable:focus-visible{outline:none;box-shadow:0 0 0 var(--units-2xs) var(--informative-errorhigh-surface-default)}\n"] }]
194
+ }], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], subLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "subLevel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], image: [{ type: i0.Input, args: [{ isSignal: true, alias: "image", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], removeIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeIcon", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }, { type: i0.Output, args: ["selectedChange"] }], selectedIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedIcon", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledBy", required: false }] }], removeAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeAriaLabel", required: false }] }], removeTabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeTabindex", required: false }] }], remove: [{ type: i0.Output, args: ["remove"] }], chipClick: [{ type: i0.Output, args: ["chipClick"] }], imageError: [{ type: i0.Output, args: ["imageError"] }] } });
195
+
196
+ /*
197
+ * Public API Surface of ui-kit/ui-chip
198
+ */
199
+
200
+ /**
201
+ * Generated bundle index. Do not edit.
202
+ */
203
+
204
+ export { UiChip };
205
+ //# sourceMappingURL=4sh-ui-kit-ui-chip.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"4sh-ui-kit-ui-chip.mjs","sources":["../../../projects/ui-kit/ui-chip/src/lib/ui-chip.ts","../../../projects/ui-kit/ui-chip/src/lib/ui-chip.html","../../../projects/ui-kit/ui-chip/src/public-api.ts","../../../projects/ui-kit/ui-chip/src/4sh-ui-kit-ui-chip.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n effect,\n input,\n isDevMode,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { UiIcon, UiIconSize } from '@4sh/ui-kit/ui-icon';\nimport { UiFeedbackLevel, UiSubLevel } from '@4sh/ui-kit/types';\n\nexport type ChipSize = 'default' | 'small';\n\n/**\n * ui-chip — compact, interactive entity token.\n *\n * A close relative of `ui-tag`, but interactive: it can carry a leading icon or\n * image (avatar-like), an optional remove action, and arbitrary projected content.\n * Typical uses: selected values in a multi-select, filter/entity chips, keyword lists.\n *\n * Categorised by `level` × `subLevel` (informative color families) and fully\n * token-driven. Interactive states (hover/focus on the remove action) are handled in\n * CSS via the same `informative.*` tokens — never through Angular props.\n *\n * Accessible: `label` is exposed as the default `aria-label` (overridable via\n * `ariaLabel` / `ariaLabelledBy`); the remove action is a native `<button>`, focusable\n * with Tab and removable with Enter/Space (native) plus Backspace/Delete.\n */\n@Component({\n selector: 'ui-chip',\n imports: [UiIcon, NgTemplateOutlet],\n templateUrl: './ui-chip.html',\n styleUrl: './ui-chip.scss',\n})\nexport class UiChip {\n /** Text content of the chip. */\n label = input<string>();\n /** Color family. */\n level = input<UiFeedbackLevel>('default');\n /** Intensity: high (solid) or low (subtle). Chips default to the discreet `low`. */\n subLevel = input<UiSubLevel>('low');\n /** Size. */\n size = input<ChipSize>('default');\n /** FontAwesome name of the leading icon (ignored when `image` is set). */\n icon = input<string>();\n /** Leading image source (avatar-like). Takes priority over `icon`. */\n image = input<string>();\n /** Alternative text for the image (leave empty for a decorative image next to a label). */\n alt = input<string>();\n /** Pill shape when true (default); rounded-rectangle when false. */\n rounded = input(true, { transform: booleanAttribute });\n /** Displays a remove action at the end of the chip. */\n removable = input(false, { transform: booleanAttribute });\n /** FontAwesome name of the remove icon. */\n removeIcon = input<string>('xmark');\n /** Disables the chip (the remove action / selection becomes non-interactive). */\n disabled = input(false, { transform: booleanAttribute });\n /**\n * Turns the whole chip into a selectable toggle (choice/filter chip). The root\n * becomes a native `<button aria-pressed>`; clicking toggles `selected`.\n * Mutually exclusive with `removable` (nesting interactive elements is invalid).\n */\n selectable = input(false, { transform: booleanAttribute });\n /** Two-way selection state (only meaningful when `selectable`). */\n selected = model(false);\n /** FontAwesome name shown in the leading slot while selected (selectable mode). */\n selectedIcon = input<string>('check');\n /** Explicit accessible name (overrides the `label` default). */\n ariaLabel = input<string>();\n /** Id of the element labelling the chip (overrides `ariaLabel`/`label`). */\n ariaLabelledBy = input<string>();\n /** Accessible name of the remove action. */\n removeAriaLabel = input<string>('Supprimer');\n /**\n * `tabindex` of the remove action. Leave unset for the natural tab order;\n * set `-1` when the chip lives inside a roving-focus container (e.g.\n * `ui-input-tags`) so the button is not a separate tab stop.\n */\n removeTabindex = input<number>();\n\n /** Emitted when the chip is removed (click or keyboard on the remove action). */\n remove = output<Event>();\n /** Emitted when a selectable chip is toggled (click or keyboard on the chip). */\n chipClick = output<Event>();\n /** Emitted when the image fails to load (the chip then falls back to icon/label). */\n imageError = output<Event>();\n\n /** @ignore Set once the current image source failed to load. */\n private readonly imageFailed = signal(false);\n\n constructor() {\n // Reset the load-error flag whenever the source changes.\n effect(() => {\n this.image();\n this.imageFailed.set(false);\n });\n\n // A11y safeguard: a chip with only a visual (icon/image) needs an accessible name.\n if (isDevMode()) {\n effect(() => {\n if (this.isVisualOnly() && !this.accessibleName()) {\n console.warn(\n '[ui-chip] Chip has no text: provide `label`, `ariaLabel` or `ariaLabelledBy`.',\n );\n }\n });\n\n // `selectable` and `removable` can't coexist (nested interactive elements).\n effect(() => {\n if (this.selectable() && this.removable()) {\n console.warn(\n '[ui-chip] `selectable` and `removable` are mutually exclusive: the remove action is ignored.',\n );\n }\n });\n }\n }\n\n /** @ignore There is a textual label. */\n protected readonly hasLabel = computed(() => !!this.label()?.length);\n\n /** @ignore The leading image is shown (source set and not failed). */\n protected readonly showImage = computed(() => !!this.image() && !this.imageFailed());\n\n /** @ignore Selectable + selected: the leading slot shows the selected icon. */\n protected readonly showSelectedIcon = computed(\n () => this.selectable() && this.selected() && !!this.selectedIcon(),\n );\n\n /** @ignore The leading image is shown (not overridden by the selected icon). */\n protected readonly showLeadingImage = computed(() => !this.showSelectedIcon() && this.showImage());\n\n /** @ignore The leading font icon is shown (no image / selected icon taking its place). */\n protected readonly showIcon = computed(() => !this.showImage() && !!this.icon());\n\n /** @ignore The leading font icon is shown (not overridden by the selected icon). */\n protected readonly showLeadingIcon = computed(() => !this.showSelectedIcon() && this.showIcon());\n\n /** @ignore The remove action is rendered (never inside a selectable button). */\n protected readonly showRemove = computed(() => this.removable() && !this.selectable());\n\n /** @ignore A visual (icon/image) with no textual label. */\n protected readonly isVisualOnly = computed(\n () => (this.showImage() || this.showIcon()) && !this.hasLabel(),\n );\n\n /** @ignore Resolved accessible name from the explicit label / ariaLabel. */\n protected readonly accessibleName = computed<string | null>(\n () => this.ariaLabel() ?? this.label() ?? null,\n );\n\n /** @ignore Root `aria-label`: explicit name, suppressed when `ariaLabelledBy` wins. */\n protected readonly rootAriaLabel = computed<string | null>(() =>\n this.ariaLabelledBy() ? null : this.accessibleName(),\n );\n\n /** @ignore Leading icon size derived from the chip size. */\n protected readonly iconSize = computed<UiIconSize>(() => (this.size() === 'small' ? 'sm' : 'md'));\n\n /** @ignore Remove icon is compact regardless of chip size. */\n protected readonly removeIconSize: UiIconSize = 'sm';\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-chip', `_${this.level()}`, `_${this.subLevel()}`];\n if (this.size() !== 'default') c.push(`_${this.size()}`);\n if (!this.rounded()) c.push('_square');\n if (this.showRemove()) c.push('_removable');\n if (this.disabled()) c.push('_disabled');\n if (this.selectable()) c.push('_selectable');\n if (this.selectable() && this.selected()) c.push('_selected');\n return c.join(' ');\n });\n\n /** @ignore */\n protected onImageError(event: Event): void {\n this.imageFailed.set(true);\n this.imageError.emit(event);\n }\n\n /** @ignore */\n protected onRemove(event: Event): void {\n if (this.disabled()) return;\n this.remove.emit(event);\n }\n\n /** @ignore Backspace/Delete on the remove button also removes (Enter/Space are native). */\n protected onRemoveKeydown(event: KeyboardEvent): void {\n if (event.key === 'Backspace' || event.key === 'Delete') {\n event.preventDefault();\n this.onRemove(event);\n }\n }\n\n /** @ignore Toggle the selection (selectable mode). Enter/Space fire this via native click. */\n protected onToggle(event: Event): void {\n if (this.disabled()) return;\n this.selected.set(!this.selected());\n this.chipClick.emit(event);\n }\n}\n","@if (selectable()) {\n <button\n type=\"button\"\n [class]=\"classes()\"\n [disabled]=\"disabled()\"\n [attr.aria-pressed]=\"selected()\"\n [attr.aria-label]=\"rootAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n (click)=\"onToggle($event)\"\n >\n <ng-container [ngTemplateOutlet]=\"inner\" />\n </button>\n} @else {\n <span\n [class]=\"classes()\"\n [attr.aria-label]=\"rootAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n >\n <ng-container [ngTemplateOutlet]=\"inner\" />\n </span>\n}\n\n<ng-template #inner>\n @if (showSelectedIcon()) {\n <ui-icon class=\"ui-chip-icon\" [name]=\"selectedIcon()!\" [size]=\"iconSize()\" />\n } @else if (showLeadingImage()) {\n <img\n class=\"ui-chip-image\"\n [src]=\"image()\"\n [attr.alt]=\"alt() ?? ''\"\n (error)=\"onImageError($event)\"\n />\n } @else if (showLeadingIcon()) {\n <ui-icon class=\"ui-chip-icon\" [name]=\"icon()!\" [size]=\"iconSize()\" />\n }\n\n @if (hasLabel()) {\n <span class=\"ui-chip-label\">{{ label() }}</span>\n }\n\n <!-- Custom / templated content -->\n <ng-content />\n\n @if (showRemove()) {\n <button\n type=\"button\"\n class=\"ui-chip-remove\"\n [disabled]=\"disabled()\"\n [attr.tabindex]=\"removeTabindex()\"\n [attr.aria-label]=\"removeAriaLabel()\"\n (click)=\"onRemove($event)\"\n (keydown)=\"onRemoveKeydown($event)\"\n >\n <ui-icon [name]=\"removeIcon()\" [size]=\"removeIconSize\" />\n </button>\n }\n</ng-template>\n","/*\n * Public API Surface of ui-kit/ui-chip\n */\n\nexport * from './lib/ui-chip';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAiBA;;;;;;;;;;;;;;AAcG;MAOU,MAAM,CAAA;AAwDjB,IAAA,WAAA,GAAA;;AAtDA,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK;6FAAU;;QAEvB,IAAA,CAAA,KAAK,GAAG,KAAK,CAAkB,SAAS;kFAAC;;QAEzC,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAa,KAAK;qFAAC;;QAEnC,IAAA,CAAA,IAAI,GAAG,KAAK,CAAW,SAAS;iFAAC;;AAEjC,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK;4FAAU;;AAEtB,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK;6FAAU;;AAEvB,QAAA,IAAA,CAAA,GAAG,GAAG,KAAK;2FAAU;;QAErB,IAAA,CAAA,OAAO,GAAG,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AAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,EAAA,iBAAA,EAAA,gBAAA,EAAA,UAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,QAAA,EAAA,SAAA,EAAA,WAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECtCnB,2iDAyDA,EAAA,MAAA,EAAA,CAAA,21WAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDvBY,MAAM,2HAAE,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAIvB,MAAM,EAAA,UAAA,EAAA,CAAA;kBANlB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,SAAS,EAAA,OAAA,EACV,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAAA,QAAA,EAAA,2iDAAA,EAAA,MAAA,EAAA,CAAA,21WAAA,CAAA,EAAA;;;AElCrC;;AAEG;;ACFH;;AAEG;;;;"}
@@ -0,0 +1,219 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, booleanAttribute, output, contentChild, viewChild, inject, signal, computed, ElementRef, effect, Component } from '@angular/core';
3
+ import { DOCUMENT } from '@angular/common';
4
+ import * as i1 from '@angular/cdk/overlay';
5
+ import { OverlayModule } from '@angular/cdk/overlay';
6
+ import { UiMenu } from '@4sh/ui-kit/ui-menu';
7
+ import { UiMotion } from '@4sh/ui-kit/motion';
8
+ import { closeOnNavigation } from '@4sh/ui-kit/overlay';
9
+
10
+ /**
11
+ * ui-context-menu — contextual menu opened with a right-click (or any
12
+ * `triggerEvent`), positioned at the pointer.
13
+ *
14
+ * Attach it to an element with `target` (template reference variable), or to
15
+ * the whole document with `global`. The panel is a {@link UiMenu} rendered in
16
+ * a CDK overlay anchored on the click coordinates: same declarative
17
+ * {@link UiMenuItem} model (nested submenus, `command`, `routerLink` / `url`),
18
+ * same keyboard navigation, same `navigation.*` tokens — compact density
19
+ * (`size="small"`) by default.
20
+ *
21
+ * Manual wiring is also possible through the public `show(event)` / `hide()` /
22
+ * `toggle(event)` methods.
23
+ *
24
+ * Customisation: `#item` and `#submenuheader` templates (forwarded to the
25
+ * embedded menu), `styleClass`, `level`, `size`.
26
+ */
27
+ class UiContextMenu {
28
+ constructor() {
29
+ /** Menu entries (see {@link UiMenuItem}). */
30
+ this.items = input([], /* @ts-ignore */
31
+ ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
32
+ /** Element the context menu is attached to (template reference variable). */
33
+ this.target = input(null, /* @ts-ignore */
34
+ ...(ngDevMode ? [{ debugName: "target" }] : /* istanbul ignore next */ []));
35
+ /** Attach to the whole document instead of a specific `target`. */
36
+ this.global = input(false, { ...(ngDevMode ? { debugName: "global" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
37
+ /** DOM event opening the menu on the target (right-click by default). */
38
+ this.triggerEvent = input('contextmenu', /* @ts-ignore */
39
+ ...(ngDevMode ? [{ debugName: "triggerEvent" }] : /* istanbul ignore next */ []));
40
+ /** Accessible name of the menu list. */
41
+ this.ariaLabel = input(/* @ts-ignore */
42
+ ...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
43
+ /** Extra class(es) applied to the panel (scoped custom styling). */
44
+ this.styleClass = input(/* @ts-ignore */
45
+ ...(ngDevMode ? [undefined, { debugName: "styleClass" }] : /* istanbul ignore next */ []));
46
+ /** Color family: `high` (default) or `low` navigation tokens. */
47
+ this.level = input('high', /* @ts-ignore */
48
+ ...(ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []));
49
+ /** Density — compact by default (contextual action menus). */
50
+ this.size = input('small', /* @ts-ignore */
51
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
52
+ /** Group rendering — cascading side panels by default (classic context menus). */
53
+ this.submenus = input('flyout', /* @ts-ignore */
54
+ ...(ngDevMode ? [{ debugName: "submenus" }] : /* istanbul ignore next */ []));
55
+ /** Animate the menu entrance (reduced-motion always wins). */
56
+ this.motion = input(true, { ...(ngDevMode ? { debugName: "motion" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
57
+ /** Emitted when the menu opens. */
58
+ this.opened = output();
59
+ /** Emitted when the menu closes. */
60
+ this.closed = output();
61
+ /** Emitted when a leaf item is clicked / keyboard-activated. */
62
+ this.itemClick = output();
63
+ /** Custom menuitem content: `<ng-template #item let-item>` (forwarded to the menu). */
64
+ this.itemTemplateContent = contentChild('item', /* @ts-ignore */
65
+ ...(ngDevMode ? [{ debugName: "itemTemplateContent" }] : /* istanbul ignore next */ []));
66
+ /** Custom group-header content: `<ng-template #submenuheader let-item>` (forwarded). */
67
+ this.submenuHeaderTemplateContent = contentChild('submenuheader', /* @ts-ignore */
68
+ ...(ngDevMode ? [{ debugName: "submenuHeaderTemplateContent" }] : /* istanbul ignore next */ []));
69
+ /** @ignore Embedded menu (roving focus entry point). */
70
+ this.menu = viewChild('menu', /* @ts-ignore */
71
+ ...(ngDevMode ? [{ debugName: "menu" }] : /* istanbul ignore next */ []));
72
+ /** @ignore */
73
+ this.doc = inject(DOCUMENT);
74
+ /** @ignore Menu visibility. */
75
+ this.open = signal(false, /* @ts-ignore */
76
+ ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
77
+ /** @ignore Viewport coordinates the overlay is anchored on (derived from `anchorPage`). */
78
+ this.overlayPoint = signal({ x: 0, y: 0 }, /* @ts-ignore */
79
+ ...(ngDevMode ? [{ debugName: "overlayPoint" }] : /* istanbul ignore next */ []));
80
+ /** @ignore DOCUMENT coordinates of the anchor: the menu belongs to the content,
81
+ * not to the screen — it must follow the page when it scrolls. */
82
+ this.anchorPage = { x: 0, y: 0 };
83
+ /** @ignore Below-right of the pointer, flipping on the viewport edges. */
84
+ this.overlayPositions = [
85
+ { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'top' },
86
+ { originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top' },
87
+ { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },
88
+ { originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'bottom' },
89
+ ];
90
+ /** @ignore `_floating` gives the embedded panel its own viewport cap +
91
+ * internal scroll (a wrapper overflow would clip the panel's shadow). */
92
+ this.menuClasses = computed(() => ['_floating', this.styleClass()].filter(Boolean).join(' '), /* @ts-ignore */
93
+ ...(ngDevMode ? [{ debugName: "menuClasses" }] : /* istanbul ignore next */ []));
94
+ /** @ignore */
95
+ this.resolvedTarget = computed(() => {
96
+ const target = this.target();
97
+ return target instanceof ElementRef ? target.nativeElement : (target ?? null);
98
+ }, /* @ts-ignore */
99
+ ...(ngDevMode ? [{ debugName: "resolvedTarget" }] : /* istanbul ignore next */ []));
100
+ // The anchor is a point of the page that just left: never carry the menu
101
+ // over to the next one (a `global` context menu outlives every view).
102
+ closeOnNavigation(() => this.hide());
103
+ // Bind the trigger listener on the target (or the document when `global`);
104
+ // re-bound whenever target/global/triggerEvent change. Browser only.
105
+ effect((onCleanup) => {
106
+ const trigger = this.triggerEvent();
107
+ const host = this.global() ? this.doc : this.resolvedTarget();
108
+ if (!host || typeof window === 'undefined')
109
+ return;
110
+ const handler = (event) => this.onTrigger(event);
111
+ host.addEventListener(trigger, handler);
112
+ onCleanup(() => host.removeEventListener(trigger, handler));
113
+ });
114
+ // While open, follow the page scroll: the anchor is a DOCUMENT point
115
+ // (page coordinates captured at open), re-projected into the viewport on
116
+ // every scroll — the menu stays where it was opened, like a DOM node.
117
+ effect((onCleanup) => {
118
+ if (!this.open() || typeof window === 'undefined')
119
+ return;
120
+ const handler = () => this.overlayPoint.set({
121
+ x: this.anchorPage.x - window.scrollX,
122
+ y: this.anchorPage.y - window.scrollY,
123
+ });
124
+ this.doc.addEventListener('scroll', handler, { capture: true, passive: true });
125
+ onCleanup(() => this.doc.removeEventListener('scroll', handler, true));
126
+ });
127
+ // While open, close on the PRESS of any pointer outside the overlays —
128
+ // not on release: CDK's outside-click dispatcher attributes the opening
129
+ // right-click's own `auxclick` (fired on release) to its pre-open
130
+ // `pointerdown` and would close the menu as soon as the button is let go.
131
+ effect((onCleanup) => {
132
+ if (!this.open() || typeof window === 'undefined')
133
+ return;
134
+ const handler = (event) => this.onDocumentPointerdown(event);
135
+ this.doc.addEventListener('pointerdown', handler, true);
136
+ onCleanup(() => this.doc.removeEventListener('pointerdown', handler, true));
137
+ });
138
+ }
139
+ // --- Public API ---------------------------------------------------------
140
+ /** Opens the menu at the event's pointer coordinates. */
141
+ show(event) {
142
+ const scrollX = typeof window === 'undefined' ? 0 : window.scrollX;
143
+ const scrollY = typeof window === 'undefined' ? 0 : window.scrollY;
144
+ this.anchorPage = { x: event.clientX + scrollX, y: event.clientY + scrollY };
145
+ this.overlayPoint.set({ x: event.clientX, y: event.clientY });
146
+ if (!this.open()) {
147
+ this.open.set(true);
148
+ this.opened.emit();
149
+ }
150
+ this.queueFocusFirst();
151
+ }
152
+ /** Closes the menu. */
153
+ hide() {
154
+ if (!this.open())
155
+ return;
156
+ this.open.set(false);
157
+ this.closed.emit();
158
+ }
159
+ /** Toggles the menu at the event's pointer coordinates. */
160
+ toggle(event) {
161
+ this.open() ? this.hide() : this.show(event);
162
+ }
163
+ // --- Interactions ---------------------------------------------------------
164
+ /** @ignore Trigger event on the target/document: hijack it and open at the pointer. */
165
+ onTrigger(event) {
166
+ event.preventDefault();
167
+ event.stopPropagation();
168
+ this.show(event);
169
+ }
170
+ /** @ignore A new pointer press outside every overlay closes the menu.
171
+ * Presses inside an overlay (menu panel, flyout side panels) are kept;
172
+ * a press on the attached zone closes then immediately reopens through
173
+ * the trigger handler (native repositioning behavior). */
174
+ onDocumentPointerdown(event) {
175
+ if (event.target instanceof Element && event.target.closest('.cdk-overlay-container'))
176
+ return;
177
+ this.hide();
178
+ }
179
+ /** @ignore */
180
+ onEscape(event) {
181
+ event.stopPropagation();
182
+ this.hide();
183
+ this.resolvedTarget()?.focus?.();
184
+ }
185
+ /** @ignore Activation of a leaf item: re-emit and close. */
186
+ onItemClick(event) {
187
+ this.itemClick.emit(event);
188
+ this.hide();
189
+ }
190
+ /** @ignore Focus the menu's first entry once the overlay is rendered.
191
+ * The overlay attaches after change detection: retry over macrotasks
192
+ * (NOT rAF — it never fires in throttled/background tabs). */
193
+ queueFocusFirst(attempts = 20) {
194
+ setTimeout(() => {
195
+ const menu = this.menu();
196
+ if (menu)
197
+ menu.focusFirst();
198
+ else if (attempts > 0)
199
+ this.queueFocusFirst(attempts - 1);
200
+ });
201
+ }
202
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiContextMenu, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
203
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", type: UiContextMenu, isStandalone: true, selector: "ui-context-menu", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null }, global: { classPropertyName: "global", publicName: "global", isSignal: true, isRequired: false, transformFunction: null }, triggerEvent: { classPropertyName: "triggerEvent", publicName: "triggerEvent", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, submenus: { classPropertyName: "submenus", publicName: "submenus", isSignal: true, isRequired: false, transformFunction: null }, motion: { classPropertyName: "motion", publicName: "motion", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "opened", closed: "closed", itemClick: "itemClick" }, queries: [{ propertyName: "itemTemplateContent", first: true, predicate: ["item"], descendants: true, isSignal: true }, { propertyName: "submenuHeaderTemplateContent", first: true, predicate: ["submenuheader"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "menu", first: true, predicate: ["menu"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayPoint()\"\n [cdkConnectedOverlayOpen]=\"open()\"\n [cdkConnectedOverlayPositions]=\"overlayPositions\"\n (detach)=\"hide()\"\n>\n <!-- Context menu: Escape handled on the container, focus lives on the\n menu items (roving). -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"ui-context-menu\"\n [uiMotion]=\"'zoom'\"\n [motionDisabled]=\"!motion()\"\n #panelMotion=\"uiMotion\"\n motionOnInsert\n (keydown.escape)=\"onEscape($event)\"\n >\n <!-- Projected #item / #submenuheader templates are forwarded as inputs:\n the embedded menu outlets them with its own item context. -->\n <ui-menu\n #menu\n [items]=\"items()\"\n [level]=\"level()\"\n [size]=\"size()\"\n [motion]=\"motion()\"\n [submenus]=\"submenus()\"\n [styleClass]=\"menuClasses()\"\n [ariaLabel]=\"ariaLabel()\"\n [itemTemplate]=\"itemTemplateContent()\"\n [submenuHeaderTemplate]=\"submenuHeaderTemplateContent()\"\n (itemClick)=\"onItemClick($event)\"\n />\n </div>\n</ng-template>\n", styles: [".ui-context-menu{display:block}\n"], dependencies: [{ kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "component", type: UiMenu, selector: "ui-menu", inputs: ["items", "popup", "expandedKeys", "ariaLabel", "ariaLabelledBy", "styleClass", "level", "size", "submenus", "motion", "autoFlip", "tabindex", "itemTemplate", "submenuHeaderTemplate"], outputs: ["expandedKeysChange", "opened", "closed", "itemClick"] }, { kind: "directive", type: UiMotion, selector: "[uiMotion]", inputs: ["uiMotion", "motionDuration", "motionDelay", "motionEasing", "motionEnterEasing", "motionLeaveEasing", "motionDistance", "motionScale", "motionDisabled", "motionOnInsert"], exportAs: ["uiMotion"] }] }); }
204
+ }
205
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiContextMenu, decorators: [{
206
+ type: Component,
207
+ args: [{ selector: 'ui-context-menu', imports: [OverlayModule, UiMenu, UiMotion], template: "<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayPoint()\"\n [cdkConnectedOverlayOpen]=\"open()\"\n [cdkConnectedOverlayPositions]=\"overlayPositions\"\n (detach)=\"hide()\"\n>\n <!-- Context menu: Escape handled on the container, focus lives on the\n menu items (roving). -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"ui-context-menu\"\n [uiMotion]=\"'zoom'\"\n [motionDisabled]=\"!motion()\"\n #panelMotion=\"uiMotion\"\n motionOnInsert\n (keydown.escape)=\"onEscape($event)\"\n >\n <!-- Projected #item / #submenuheader templates are forwarded as inputs:\n the embedded menu outlets them with its own item context. -->\n <ui-menu\n #menu\n [items]=\"items()\"\n [level]=\"level()\"\n [size]=\"size()\"\n [motion]=\"motion()\"\n [submenus]=\"submenus()\"\n [styleClass]=\"menuClasses()\"\n [ariaLabel]=\"ariaLabel()\"\n [itemTemplate]=\"itemTemplateContent()\"\n [submenuHeaderTemplate]=\"submenuHeaderTemplateContent()\"\n (itemClick)=\"onItemClick($event)\"\n />\n </div>\n</ng-template>\n", styles: [".ui-context-menu{display:block}\n"] }]
208
+ }], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: false }] }], global: [{ type: i0.Input, args: [{ isSignal: true, alias: "global", required: false }] }], triggerEvent: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerEvent", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], submenus: [{ type: i0.Input, args: [{ isSignal: true, alias: "submenus", required: false }] }], motion: [{ type: i0.Input, args: [{ isSignal: true, alias: "motion", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], itemTemplateContent: [{ type: i0.ContentChild, args: ['item', { isSignal: true }] }], submenuHeaderTemplateContent: [{ type: i0.ContentChild, args: ['submenuheader', { isSignal: true }] }], menu: [{ type: i0.ViewChild, args: ['menu', { isSignal: true }] }] } });
209
+
210
+ /*
211
+ * Public API Surface of ui-kit/ui-context-menu
212
+ */
213
+
214
+ /**
215
+ * Generated bundle index. Do not edit.
216
+ */
217
+
218
+ export { UiContextMenu };
219
+ //# sourceMappingURL=4sh-ui-kit-ui-context-menu.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"4sh-ui-kit-ui-context-menu.mjs","sources":["../../../projects/ui-kit/ui-context-menu/src/lib/ui-context-menu.ts","../../../projects/ui-kit/ui-context-menu/src/lib/ui-context-menu.html","../../../projects/ui-kit/ui-context-menu/src/public-api.ts","../../../projects/ui-kit/ui-context-menu/src/4sh-ui-kit-ui-context-menu.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n contentChild,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n TemplateRef,\n viewChild,\n} from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { ConnectedPosition, OverlayModule } from '@angular/cdk/overlay';\nimport { UiSubLevel } from '@4sh/ui-kit/types';\nimport {\n MenuSize,\n MenuSubmenuMode,\n UiMenu,\n UiMenuItem,\n UiMenuItemCommandEvent,\n} from '@4sh/ui-kit/ui-menu';\nimport { UiMotion } from '@4sh/ui-kit/motion';\nimport { closeOnNavigation } from '@4sh/ui-kit/overlay';\n\n/** Accepted shapes for the `target` input. */\nexport type ContextMenuTarget = HTMLElement | ElementRef<HTMLElement> | null;\n\n/**\n * ui-context-menu — contextual menu opened with a right-click (or any\n * `triggerEvent`), positioned at the pointer.\n *\n * Attach it to an element with `target` (template reference variable), or to\n * the whole document with `global`. The panel is a {@link UiMenu} rendered in\n * a CDK overlay anchored on the click coordinates: same declarative\n * {@link UiMenuItem} model (nested submenus, `command`, `routerLink` / `url`),\n * same keyboard navigation, same `navigation.*` tokens — compact density\n * (`size=\"small\"`) by default.\n *\n * Manual wiring is also possible through the public `show(event)` / `hide()` /\n * `toggle(event)` methods.\n *\n * Customisation: `#item` and `#submenuheader` templates (forwarded to the\n * embedded menu), `styleClass`, `level`, `size`.\n */\n@Component({\n selector: 'ui-context-menu',\n imports: [OverlayModule, UiMenu, UiMotion],\n templateUrl: './ui-context-menu.html',\n styleUrl: './ui-context-menu.scss',\n})\nexport class UiContextMenu {\n /** Menu entries (see {@link UiMenuItem}). */\n items = input<UiMenuItem[]>([]);\n /** Element the context menu is attached to (template reference variable). */\n target = input<ContextMenuTarget>(null);\n /** Attach to the whole document instead of a specific `target`. */\n global = input(false, { transform: booleanAttribute });\n /** DOM event opening the menu on the target (right-click by default). */\n triggerEvent = input<string>('contextmenu');\n /** Accessible name of the menu list. */\n ariaLabel = input<string>();\n /** Extra class(es) applied to the panel (scoped custom styling). */\n styleClass = input<string>();\n /** Color family: `high` (default) or `low` navigation tokens. */\n level = input<UiSubLevel>('high');\n /** Density — compact by default (contextual action menus). */\n size = input<MenuSize>('small');\n /** Group rendering — cascading side panels by default (classic context menus). */\n submenus = input<MenuSubmenuMode>('flyout');\n /** Animate the menu entrance (reduced-motion always wins). */\n motion = input(true, { transform: booleanAttribute });\n\n /** Emitted when the menu opens. */\n opened = output<void>();\n /** Emitted when the menu closes. */\n closed = output<void>();\n /** Emitted when a leaf item is clicked / keyboard-activated. */\n itemClick = output<UiMenuItemCommandEvent>();\n\n /** Custom menuitem content: `<ng-template #item let-item>` (forwarded to the menu). */\n protected readonly itemTemplateContent = contentChild<TemplateRef<unknown>>('item');\n /** Custom group-header content: `<ng-template #submenuheader let-item>` (forwarded). */\n protected readonly submenuHeaderTemplateContent = contentChild<TemplateRef<unknown>>('submenuheader');\n\n /** @ignore Embedded menu (roving focus entry point). */\n private readonly menu = viewChild<UiMenu>('menu');\n /** @ignore */\n private readonly doc = inject(DOCUMENT);\n\n /** @ignore Menu visibility. */\n protected readonly open = signal(false);\n /** @ignore Viewport coordinates the overlay is anchored on (derived from `anchorPage`). */\n protected readonly overlayPoint = signal<{ x: number; y: number }>({ x: 0, y: 0 });\n /** @ignore DOCUMENT coordinates of the anchor: the menu belongs to the content,\n * not to the screen — it must follow the page when it scrolls. */\n private anchorPage = { x: 0, y: 0 };\n\n /** @ignore Below-right of the pointer, flipping on the viewport edges. */\n protected readonly overlayPositions: ConnectedPosition[] = [\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'top' },\n { originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top' },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },\n { originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'bottom' },\n ];\n\n /** @ignore `_floating` gives the embedded panel its own viewport cap +\n * internal scroll (a wrapper overflow would clip the panel's shadow). */\n protected readonly menuClasses = computed(() =>\n ['_floating', this.styleClass()].filter(Boolean).join(' '),\n );\n\n /** @ignore */\n private readonly resolvedTarget = computed<HTMLElement | null>(() => {\n const target = this.target();\n return target instanceof ElementRef ? target.nativeElement : (target ?? null);\n });\n\n constructor() {\n // The anchor is a point of the page that just left: never carry the menu\n // over to the next one (a `global` context menu outlives every view).\n closeOnNavigation(() => this.hide());\n\n // Bind the trigger listener on the target (or the document when `global`);\n // re-bound whenever target/global/triggerEvent change. Browser only.\n effect((onCleanup) => {\n const trigger = this.triggerEvent();\n const host: EventTarget | null = this.global() ? this.doc : this.resolvedTarget();\n if (!host || typeof window === 'undefined') return;\n const handler = (event: Event) => this.onTrigger(event as MouseEvent);\n host.addEventListener(trigger, handler);\n onCleanup(() => host.removeEventListener(trigger, handler));\n });\n\n // While open, follow the page scroll: the anchor is a DOCUMENT point\n // (page coordinates captured at open), re-projected into the viewport on\n // every scroll — the menu stays where it was opened, like a DOM node.\n effect((onCleanup) => {\n if (!this.open() || typeof window === 'undefined') return;\n const handler = () =>\n this.overlayPoint.set({\n x: this.anchorPage.x - window.scrollX,\n y: this.anchorPage.y - window.scrollY,\n });\n this.doc.addEventListener('scroll', handler, { capture: true, passive: true });\n onCleanup(() => this.doc.removeEventListener('scroll', handler, true));\n });\n\n // While open, close on the PRESS of any pointer outside the overlays —\n // not on release: CDK's outside-click dispatcher attributes the opening\n // right-click's own `auxclick` (fired on release) to its pre-open\n // `pointerdown` and would close the menu as soon as the button is let go.\n effect((onCleanup) => {\n if (!this.open() || typeof window === 'undefined') return;\n const handler = (event: Event) => this.onDocumentPointerdown(event as PointerEvent);\n this.doc.addEventListener('pointerdown', handler, true);\n onCleanup(() => this.doc.removeEventListener('pointerdown', handler, true));\n });\n }\n\n // --- Public API ---------------------------------------------------------\n\n /** Opens the menu at the event's pointer coordinates. */\n show(event: MouseEvent): void {\n const scrollX = typeof window === 'undefined' ? 0 : window.scrollX;\n const scrollY = typeof window === 'undefined' ? 0 : window.scrollY;\n this.anchorPage = { x: event.clientX + scrollX, y: event.clientY + scrollY };\n this.overlayPoint.set({ x: event.clientX, y: event.clientY });\n if (!this.open()) {\n this.open.set(true);\n this.opened.emit();\n }\n this.queueFocusFirst();\n }\n\n /** Closes the menu. */\n hide(): void {\n if (!this.open()) return;\n this.open.set(false);\n this.closed.emit();\n }\n\n /** Toggles the menu at the event's pointer coordinates. */\n toggle(event: MouseEvent): void {\n this.open() ? this.hide() : this.show(event);\n }\n\n // --- Interactions ---------------------------------------------------------\n\n /** @ignore Trigger event on the target/document: hijack it and open at the pointer. */\n private onTrigger(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.show(event);\n }\n\n /** @ignore A new pointer press outside every overlay closes the menu.\n * Presses inside an overlay (menu panel, flyout side panels) are kept;\n * a press on the attached zone closes then immediately reopens through\n * the trigger handler (native repositioning behavior). */\n private onDocumentPointerdown(event: PointerEvent): void {\n if (event.target instanceof Element && event.target.closest('.cdk-overlay-container')) return;\n this.hide();\n }\n\n /** @ignore */\n protected onEscape(event: Event): void {\n event.stopPropagation();\n this.hide();\n this.resolvedTarget()?.focus?.();\n }\n\n /** @ignore Activation of a leaf item: re-emit and close. */\n protected onItemClick(event: UiMenuItemCommandEvent): void {\n this.itemClick.emit(event);\n this.hide();\n }\n\n /** @ignore Focus the menu's first entry once the overlay is rendered.\n * The overlay attaches after change detection: retry over macrotasks\n * (NOT rAF — it never fires in throttled/background tabs). */\n private queueFocusFirst(attempts = 20): void {\n setTimeout(() => {\n const menu = this.menu();\n if (menu) menu.focusFirst();\n else if (attempts > 0) this.queueFocusFirst(attempts - 1);\n });\n }\n}\n","<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayPoint()\"\n [cdkConnectedOverlayOpen]=\"open()\"\n [cdkConnectedOverlayPositions]=\"overlayPositions\"\n (detach)=\"hide()\"\n>\n <!-- Context menu: Escape handled on the container, focus lives on the\n menu items (roving). -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"ui-context-menu\"\n [uiMotion]=\"'zoom'\"\n [motionDisabled]=\"!motion()\"\n #panelMotion=\"uiMotion\"\n motionOnInsert\n (keydown.escape)=\"onEscape($event)\"\n >\n <!-- Projected #item / #submenuheader templates are forwarded as inputs:\n the embedded menu outlets them with its own item context. -->\n <ui-menu\n #menu\n [items]=\"items()\"\n [level]=\"level()\"\n [size]=\"size()\"\n [motion]=\"motion()\"\n [submenus]=\"submenus()\"\n [styleClass]=\"menuClasses()\"\n [ariaLabel]=\"ariaLabel()\"\n [itemTemplate]=\"itemTemplateContent()\"\n [submenuHeaderTemplate]=\"submenuHeaderTemplateContent()\"\n (itemClick)=\"onItemClick($event)\"\n />\n </div>\n</ng-template>\n","/*\n * Public API Surface of ui-kit/ui-context-menu\n */\n\nexport * from './lib/ui-context-menu';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AA8BA;;;;;;;;;;;;;;;;AAgBG;MAOU,aAAa,CAAA;AAmExB,IAAA,WAAA,GAAA;;QAjEA,IAAA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