ngwr 7.3.0 → 8.0.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 (261) hide show
  1. package/README.md +5 -4
  2. package/alert/styles/_index.scss +44 -17
  3. package/avatar/styles/_index.scss +2 -2
  4. package/badge/styles/_index.scss +11 -7
  5. package/badge/styles/_tag.scss +1 -1
  6. package/bar-chart/styles/_index.scss +1 -2
  7. package/breadcrumbs/styles/_index.scss +4 -2
  8. package/burger/styles/_index.scss +2 -2
  9. package/button/styles/_index.scss +30 -20
  10. package/calendar/styles/_index.scss +11 -9
  11. package/calendar-heatmap/styles/_index.scss +2 -0
  12. package/card/styles/_index.scss +1 -1
  13. package/carousel/styles/_index.scss +1 -1
  14. package/cascader/styles/_index.scss +54 -14
  15. package/checkbox/styles/_index.scss +21 -4
  16. package/collapse/styles/_index.scss +1 -1
  17. package/color-picker/styles/_index.scss +11 -12
  18. package/command-palette/styles/_index.scss +3 -3
  19. package/compare/styles/_index.scss +3 -3
  20. package/context-menu/styles/_index.scss +1 -1
  21. package/date-picker/styles/_index.scss +5 -6
  22. package/density/styles/_index.scss +3 -3
  23. package/dialog/styles/_index.scss +3 -3
  24. package/divider/styles/_index.scss +1 -1
  25. package/drawer/styles/_index.scss +11 -11
  26. package/dropdown/styles/_index.scss +2 -2
  27. package/fesm2022/ngwr-affix.mjs +3 -3
  28. package/fesm2022/ngwr-alert.mjs +22 -10
  29. package/fesm2022/ngwr-alert.mjs.map +1 -1
  30. package/fesm2022/ngwr-anchor.mjs +3 -3
  31. package/fesm2022/ngwr-aurora.mjs +3 -3
  32. package/fesm2022/ngwr-avatar.mjs +3 -3
  33. package/fesm2022/ngwr-back-top.mjs +3 -3
  34. package/fesm2022/ngwr-badge.mjs +6 -6
  35. package/fesm2022/ngwr-bar-chart.mjs +3 -3
  36. package/fesm2022/ngwr-blur-text.mjs +3 -3
  37. package/fesm2022/ngwr-border-glow.mjs +3 -3
  38. package/fesm2022/ngwr-breadcrumbs.mjs +7 -7
  39. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  40. package/fesm2022/ngwr-burger.mjs +3 -3
  41. package/fesm2022/ngwr-button.mjs +6 -6
  42. package/fesm2022/ngwr-calendar-heatmap.mjs +3 -3
  43. package/fesm2022/ngwr-calendar.mjs +4 -4
  44. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  45. package/fesm2022/ngwr-card.mjs +10 -10
  46. package/fesm2022/ngwr-card.mjs.map +1 -1
  47. package/fesm2022/ngwr-carousel.mjs +6 -6
  48. package/fesm2022/ngwr-cascader.mjs +12 -35
  49. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  50. package/fesm2022/ngwr-checkbox.mjs +13 -30
  51. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  52. package/fesm2022/ngwr-circular-text.mjs +3 -3
  53. package/fesm2022/ngwr-click-spark.mjs +25 -6
  54. package/fesm2022/ngwr-click-spark.mjs.map +1 -1
  55. package/fesm2022/ngwr-clipboard.mjs +27 -6
  56. package/fesm2022/ngwr-clipboard.mjs.map +1 -1
  57. package/fesm2022/ngwr-collapse.mjs +9 -9
  58. package/fesm2022/ngwr-color-picker.mjs +7 -7
  59. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  60. package/fesm2022/ngwr-command-palette.mjs +3 -3
  61. package/fesm2022/ngwr-compare.mjs +3 -3
  62. package/fesm2022/ngwr-confetti.mjs +3 -3
  63. package/fesm2022/ngwr-context-menu.mjs +40 -88
  64. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  65. package/fesm2022/ngwr-cookie.mjs +3 -3
  66. package/fesm2022/ngwr-counter.mjs +12 -8
  67. package/fesm2022/ngwr-counter.mjs.map +1 -1
  68. package/fesm2022/ngwr-date-adapter-fns.mjs +3 -3
  69. package/fesm2022/ngwr-date-adapter-luxon.mjs +3 -3
  70. package/fesm2022/ngwr-date-adapter.mjs +3 -3
  71. package/fesm2022/ngwr-date-picker.mjs +25 -11
  72. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  73. package/fesm2022/ngwr-decrypt-text.mjs +3 -3
  74. package/fesm2022/ngwr-density.mjs +14 -14
  75. package/fesm2022/ngwr-density.mjs.map +1 -1
  76. package/fesm2022/ngwr-descriptions.mjs +6 -6
  77. package/fesm2022/ngwr-dialog.mjs +15 -15
  78. package/fesm2022/ngwr-directives.mjs +15 -87
  79. package/fesm2022/ngwr-directives.mjs.map +1 -1
  80. package/fesm2022/ngwr-divider.mjs +3 -3
  81. package/fesm2022/ngwr-donut-chart.mjs +10 -4
  82. package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
  83. package/fesm2022/ngwr-drag-drop.mjs +6 -6
  84. package/fesm2022/ngwr-drawer.mjs +15 -15
  85. package/fesm2022/ngwr-dropdown.mjs +9 -9
  86. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  87. package/fesm2022/ngwr-empty.mjs +3 -3
  88. package/fesm2022/ngwr-falling-text.mjs +3 -3
  89. package/fesm2022/ngwr-file-upload.mjs +3 -3
  90. package/fesm2022/ngwr-form.mjs +9 -9
  91. package/fesm2022/ngwr-fuzzy-text.mjs +8 -7
  92. package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
  93. package/fesm2022/ngwr-gauge.mjs +3 -3
  94. package/fesm2022/ngwr-glitch-text.mjs +15 -7
  95. package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
  96. package/fesm2022/ngwr-gradient-text.mjs +3 -3
  97. package/fesm2022/ngwr-hotkey.mjs +6 -6
  98. package/fesm2022/ngwr-i18n.mjs +9 -9
  99. package/fesm2022/ngwr-icon.mjs +3 -3
  100. package/fesm2022/ngwr-image-cropper.mjs +3 -3
  101. package/fesm2022/ngwr-input-number.mjs +4 -4
  102. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  103. package/fesm2022/ngwr-input-otp.mjs +10 -4
  104. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  105. package/fesm2022/ngwr-input.mjs +25 -16
  106. package/fesm2022/ngwr-input.mjs.map +1 -1
  107. package/fesm2022/ngwr-keyboard.mjs +3 -3
  108. package/fesm2022/ngwr-knob.mjs +3 -3
  109. package/fesm2022/ngwr-layout.mjs +15 -15
  110. package/fesm2022/ngwr-lightbox.mjs +17 -5
  111. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  112. package/fesm2022/ngwr-line-chart.mjs +3 -3
  113. package/fesm2022/ngwr-list.mjs +7 -7
  114. package/fesm2022/ngwr-list.mjs.map +1 -1
  115. package/fesm2022/ngwr-loading-bar.mjs +6 -6
  116. package/fesm2022/ngwr-marquee.mjs +3 -3
  117. package/fesm2022/ngwr-media.mjs +3 -3
  118. package/fesm2022/ngwr-mention.mjs +6 -6
  119. package/fesm2022/ngwr-meta.mjs +6 -6
  120. package/fesm2022/ngwr-meter-group.mjs +3 -3
  121. package/fesm2022/ngwr-overlay.mjs +3 -3
  122. package/fesm2022/ngwr-page-header.mjs +3 -3
  123. package/fesm2022/ngwr-pagination.mjs +5 -15
  124. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  125. package/fesm2022/ngwr-pipes.mjs +21 -21
  126. package/fesm2022/ngwr-platform.mjs +3 -3
  127. package/fesm2022/ngwr-popconfirm.mjs +6 -6
  128. package/fesm2022/ngwr-popover.mjs +6 -6
  129. package/fesm2022/ngwr-progress.mjs +3 -3
  130. package/fesm2022/ngwr-qr.mjs +3 -3
  131. package/fesm2022/ngwr-radio.mjs +28 -26
  132. package/fesm2022/ngwr-radio.mjs.map +1 -1
  133. package/fesm2022/ngwr-rating.mjs +12 -23
  134. package/fesm2022/ngwr-rating.mjs.map +1 -1
  135. package/fesm2022/ngwr-result.mjs +12 -12
  136. package/fesm2022/ngwr-rotating-text.mjs +3 -3
  137. package/fesm2022/ngwr-scroll.mjs +3 -3
  138. package/fesm2022/ngwr-segmented.mjs +10 -22
  139. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  140. package/fesm2022/ngwr-select.mjs +26 -13
  141. package/fesm2022/ngwr-select.mjs.map +1 -1
  142. package/fesm2022/ngwr-shiny-text.mjs +6 -6
  143. package/fesm2022/ngwr-sidebar.mjs +3 -3
  144. package/fesm2022/ngwr-skeleton.mjs +3 -3
  145. package/fesm2022/ngwr-slider.mjs +3 -3
  146. package/fesm2022/ngwr-sparkline.mjs +3 -3
  147. package/fesm2022/ngwr-speed-dial.mjs +3 -3
  148. package/fesm2022/ngwr-spinner.mjs +3 -3
  149. package/fesm2022/ngwr-splash-cursor.mjs +3 -3
  150. package/fesm2022/ngwr-split-text.mjs +3 -3
  151. package/fesm2022/ngwr-splitter.mjs +3 -3
  152. package/fesm2022/ngwr-spotlight-card.mjs +8 -8
  153. package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
  154. package/fesm2022/ngwr-squircle.mjs +6 -6
  155. package/fesm2022/ngwr-star-border.mjs +3 -3
  156. package/fesm2022/ngwr-statistic.mjs +79 -10
  157. package/fesm2022/ngwr-statistic.mjs.map +1 -1
  158. package/fesm2022/ngwr-stepper.mjs +6 -6
  159. package/fesm2022/ngwr-storage.mjs +3 -3
  160. package/fesm2022/ngwr-switch.mjs +10 -14
  161. package/fesm2022/ngwr-switch.mjs.map +1 -1
  162. package/fesm2022/ngwr-table.mjs +12 -12
  163. package/fesm2022/ngwr-tabs.mjs +8 -6
  164. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  165. package/fesm2022/ngwr-textarea.mjs +84 -25
  166. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  167. package/fesm2022/ngwr-theme.mjs +3 -3
  168. package/fesm2022/ngwr-tilt-card.mjs +6 -6
  169. package/fesm2022/ngwr-timeline.mjs +6 -6
  170. package/fesm2022/ngwr-toast.mjs +46 -24
  171. package/fesm2022/ngwr-toast.mjs.map +1 -1
  172. package/fesm2022/ngwr-toolbar.mjs +3 -3
  173. package/fesm2022/ngwr-tree.mjs +3 -3
  174. package/fesm2022/ngwr-typewriter.mjs +3 -3
  175. package/fesm2022/ngwr-typography.mjs +3 -3
  176. package/fesm2022/ngwr-validators.mjs +41 -3
  177. package/fesm2022/ngwr-validators.mjs.map +1 -1
  178. package/fesm2022/ngwr-version.mjs +1 -1
  179. package/fesm2022/ngwr-version.mjs.map +1 -1
  180. package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
  181. package/fesm2022/ngwr-waves.mjs +3 -3
  182. package/fesm2022/ngwr-window.mjs +12 -12
  183. package/file-upload/styles/_index.scss +3 -3
  184. package/form/styles/_index.scss +5 -5
  185. package/glitch-text/styles/_index.scss +3 -6
  186. package/image-cropper/styles/_index.scss +3 -3
  187. package/input/styles/_index.scss +26 -7
  188. package/input-otp/styles/_index.scss +23 -5
  189. package/keyboard/styles/_index.scss +6 -4
  190. package/knob/styles/_index.scss +1 -1
  191. package/lightbox/styles/_index.scss +29 -10
  192. package/list/styles/_index.scss +3 -3
  193. package/llms-full.txt +14 -19
  194. package/mention/styles/_index.scss +2 -2
  195. package/overlay/styles/_index.scss +1 -1
  196. package/package.json +1 -6
  197. package/pagination/styles/_index.scss +3 -26
  198. package/popconfirm/styles/_index.scss +1 -1
  199. package/popover/styles/_index.scss +2 -2
  200. package/radio/styles/_index.scss +20 -5
  201. package/rating/styles/_index.scss +12 -1
  202. package/schematics/migrations/v8/index.js +122 -0
  203. package/schematics/migrations.json +5 -0
  204. package/schematics/ng-add/index.js +3 -3
  205. package/schematics/ng-add/schema.json +6 -6
  206. package/schematics/provider/schema.json +1 -1
  207. package/schematics/use/symbol-map.json +11 -2
  208. package/segmented/styles/_index.scss +31 -8
  209. package/select/styles/_index.scss +73 -25
  210. package/sidebar/styles/_index.scss +3 -3
  211. package/slider/styles/_index.scss +2 -3
  212. package/speed-dial/styles/_index.scss +1 -0
  213. package/splitter/styles/_index.scss +4 -4
  214. package/spotlight-card/styles/_index.scss +8 -4
  215. package/stepper/styles/_index.scss +4 -4
  216. package/styles/_animations.scss +0 -23
  217. package/styles.scss +0 -1
  218. package/switch/styles/_index.scss +25 -6
  219. package/table/styles/_index.scss +9 -9
  220. package/tabs/styles/_index.scss +22 -3
  221. package/textarea/styles/_index.scss +59 -4
  222. package/theme/styles/_colors.scss +57 -0
  223. package/theme/styles/_dark.scss +22 -8
  224. package/theme/styles/_focus.scss +5 -0
  225. package/theme/styles/_variables.scss +24 -0
  226. package/timeline/styles/_index.scss +11 -2
  227. package/toast/styles/_index.scss +13 -5
  228. package/toolbar/styles/_index.scss +1 -1
  229. package/tree/styles/_index.scss +18 -17
  230. package/types/ngwr-alert.d.ts +16 -6
  231. package/types/ngwr-cascader.d.ts +5 -2
  232. package/types/ngwr-checkbox.d.ts +5 -2
  233. package/types/ngwr-click-spark.d.ts +13 -1
  234. package/types/ngwr-clipboard.d.ts +12 -1
  235. package/types/ngwr-context-menu.d.ts +20 -25
  236. package/types/ngwr-date-picker.d.ts +3 -0
  237. package/types/ngwr-density.d.ts +7 -7
  238. package/types/ngwr-directives.d.ts +17 -49
  239. package/types/ngwr-fuzzy-text.d.ts +1 -1
  240. package/types/ngwr-glitch-text.d.ts +9 -3
  241. package/types/ngwr-input-otp.d.ts +6 -2
  242. package/types/ngwr-input.d.ts +27 -13
  243. package/types/ngwr-lightbox.d.ts +9 -1
  244. package/types/ngwr-pagination.d.ts +3 -9
  245. package/types/ngwr-radio.d.ts +14 -3
  246. package/types/ngwr-rating.d.ts +5 -1
  247. package/types/ngwr-segmented.d.ts +5 -2
  248. package/types/ngwr-select.d.ts +6 -2
  249. package/types/ngwr-spotlight-card.d.ts +1 -1
  250. package/types/ngwr-statistic.d.ts +35 -1
  251. package/types/ngwr-switch.d.ts +5 -1
  252. package/types/ngwr-textarea.d.ts +25 -3
  253. package/types/ngwr-toast.d.ts +7 -1
  254. package/types/ngwr-validators.d.ts +3 -1
  255. package/types/ngwr-version.d.ts +1 -1
  256. package/window/styles/_index.scss +8 -8
  257. package/fesm2022/ngwr-scramble-text.mjs +0 -165
  258. package/fesm2022/ngwr-scramble-text.mjs.map +0 -1
  259. package/scramble-text/scramble-text.scss +0 -1
  260. package/scramble-text/styles/_index.scss +0 -8
  261. package/types/ngwr-scramble-text.d.ts +0 -49
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-color-picker.mjs","sources":["../../../projects/lib/color-picker/color/rgb-to-hsv.ts","../../../projects/lib/color-picker/color/hsv-to-rgb.ts","../../../projects/lib/color-picker/color/rgb-to-hsl.ts","../../../projects/lib/color-picker/color/hsl-to-rgb.ts","../../../projects/lib/color-picker/color/parse-hex.ts","../../../projects/lib/color-picker/color/to-hex.ts","../../../projects/lib/color-picker/color-picker.ts","../../../projects/lib/color-picker/color-picker.html","../../../projects/lib/color-picker/color-picker-trigger.ts","../../../projects/lib/color-picker/ngwr-color-picker.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrHsv } from './wr-hsv';\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Convert sRGB to HSV. Preserves alpha.\n */\nexport function rgbToHsv(rgb: WrRgb): WrHsv {\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const d = max - min;\n\n let h = 0;\n if (d !== 0) {\n if (max === r) h = ((g - b) / d) % 6;\n else if (max === g) h = (b - r) / d + 2;\n else h = (r - g) / d + 4;\n h *= 60;\n if (h < 0) h += 360;\n }\n\n const s = max === 0 ? 0 : d / max;\n const v = max;\n\n return { h, s, v, a: rgb.a };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrHsv } from './wr-hsv';\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Convert HSV to sRGB. Preserves alpha. Returns integer channels in `[0, 255]`.\n */\nexport function hsvToRgb(hsv: WrHsv): WrRgb {\n const { h, s, v } = hsv;\n const c = v * s;\n const x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n const m = v - c;\n\n let r = 0;\n let g = 0;\n let b = 0;\n\n if (h < 60) {\n r = c;\n g = x;\n } else if (h < 120) {\n r = x;\n g = c;\n } else if (h < 180) {\n g = c;\n b = x;\n } else if (h < 240) {\n g = x;\n b = c;\n } else if (h < 300) {\n r = x;\n b = c;\n } else {\n r = c;\n b = x;\n }\n\n return {\n r: Math.round((r + m) * 255),\n g: Math.round((g + m) * 255),\n b: Math.round((b + m) * 255),\n a: hsv.a,\n };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrHsl } from './wr-hsl';\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Convert sRGB to HSL. Preserves alpha.\n */\nexport function rgbToHsl(rgb: WrRgb): WrHsl {\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const d = max - min;\n const l = (max + min) / 2;\n\n let h = 0;\n let s = 0;\n\n if (d !== 0) {\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n if (max === r) h = (g - b) / d + (g < b ? 6 : 0);\n else if (max === g) h = (b - r) / d + 2;\n else h = (r - g) / d + 4;\n\n h *= 60;\n }\n\n return { h, s, l, a: rgb.a };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrHsl } from './wr-hsl';\nimport type { WrRgb } from './wr-rgb';\n\nfunction hueToChannel(p: number, q: number, t: number): number {\n let x = t;\n if (x < 0) x += 1;\n if (x > 1) x -= 1;\n if (x < 1 / 6) return p + (q - p) * 6 * x;\n if (x < 1 / 2) return q;\n if (x < 2 / 3) return p + (q - p) * (2 / 3 - x) * 6;\n return p;\n}\n\n/**\n * Convert HSL to sRGB. Preserves alpha. Returns integer channels in `[0, 255]`.\n */\nexport function hslToRgb(hsl: WrHsl): WrRgb {\n const h = hsl.h / 360;\n const { s, l } = hsl;\n\n let r: number;\n let g: number;\n let b: number;\n\n if (s === 0) {\n r = l;\n g = l;\n b = l;\n } else {\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hueToChannel(p, q, h + 1 / 3);\n g = hueToChannel(p, q, h);\n b = hueToChannel(p, q, h - 1 / 3);\n }\n\n return {\n r: Math.round(r * 255),\n g: Math.round(g * 255),\n b: Math.round(b * 255),\n a: hsl.a,\n };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Parse a CSS hex colour into {@link WrRgb}. Accepts 3, 4, 6, or 8 digit\n * forms with or without a leading `#`. Returns `null` for anything that\n * isn't a valid hex string.\n *\n * @example\n * ```ts\n * parseHex('#f00'); // { r: 255, g: 0, b: 0, a: 1 }\n * parseHex('3969e2'); // { r: 57, g: 105, b: 226, a: 1 }\n * parseHex('#3969e2ff'); // { r: 57, g: 105, b: 226, a: 1 }\n * parseHex('nope'); // null\n * ```\n */\nexport function parseHex(input: string): WrRgb | null {\n if (typeof input !== 'string') return null;\n\n let str = input.trim().replace(/^#/, '').toLowerCase();\n\n // Expand shorthand: rgb → rrggbb, rgba → rrggbbaa\n if (str.length === 3 || str.length === 4) {\n str = str\n .split('')\n .map(c => c + c)\n .join('');\n }\n\n if (str.length !== 6 && str.length !== 8) return null;\n if (!/^[0-9a-f]+$/.test(str)) return null;\n\n const r = parseInt(str.slice(0, 2), 16);\n const g = parseInt(str.slice(2, 4), 16);\n const b = parseInt(str.slice(4, 6), 16);\n const a = str.length === 8 ? parseInt(str.slice(6, 8), 16) / 255 : 1;\n\n return { r, g, b, a };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrRgb } from './wr-rgb';\n\nfunction channelToHex(n: number): string {\n const clamped = Math.max(0, Math.min(255, Math.round(n)));\n return clamped.toString(16).padStart(2, '0');\n}\n\n/**\n * Format a {@link WrRgb} as a CSS hex string with a leading `#`. When\n * `withAlpha` is `true` the result is 8 digits (`#rrggbbaa`); otherwise\n * 6 digits.\n *\n * @example\n * ```ts\n * toHex({ r: 57, g: 105, b: 226, a: 1 }); // '#3969e2'\n * toHex({ r: 57, g: 105, b: 226, a: 0.5 }, true); // '#3969e280'\n * ```\n */\nexport function toHex(rgb: WrRgb, withAlpha = false): string {\n const r = channelToHex(rgb.r);\n const g = channelToHex(rgb.g);\n const b = channelToHex(rgb.b);\n if (withAlpha) {\n const a = channelToHex(rgb.a * 255);\n return `#${r}${g}${b}${a}`;\n }\n return `#${r}${g}${b}`;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { DecimalPipe } from '@angular/common';\nimport { Component, ViewEncapsulation, computed, forwardRef, input, signal } from '@angular/core';\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { WrSegmented, type WrSegmentedOption } from 'ngwr/segmented';\nimport { clamp, noop } from 'ngwr/utils';\n\nimport { hslToRgb, hsvToRgb, parseHex, rgbToHsl, rgbToHsv, toHex, type WrHsl, type WrRgb } from './color';\nimport type { WrColorFormat } from './interfaces';\n\ntype Tab = 'hex' | 'rgb' | 'hsl';\n\ntype Edges = 'sv' | 'hue' | 'alpha';\n\n/**\n * Inline colour picker — HSV canvas, hue slider, optional alpha slider, HEX\n * input. Implements `ControlValueAccessor`, so it binds with `[(ngModel)]`,\n * `[formControl]`, or `formControlName`. Output is always a string in the\n * format chosen via `[format]`.\n *\n * @example\n * ```html\n * <wr-color-picker [(ngModel)]=\"brandColor\" />\n * <wr-color-picker [(ngModel)]=\"brandColor\" [alpha]=\"false\" />\n * ```\n *\n * @see https://ngwr.dev/components/color-picker\n */\n@Component({\n selector: 'wr-color-picker',\n templateUrl: './color-picker.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n '[class]': 'classes()',\n '[style.--wr-color-picker-hue]': 'hueCss()',\n '[style.--wr-color-picker-rgb]': 'rgbCss()',\n },\n imports: [DecimalPipe, WrSegmented],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrColorPicker),\n multi: true,\n },\n ],\n})\nexport class WrColorPicker implements ControlValueAccessor {\n /** Render the alpha slider and emit 8-digit hex / `rgba()`. @default true */\n readonly alpha = input(true, { transform: coerceBooleanProperty });\n\n /** Disable interaction. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /** Output format produced through the CVA. @default 'hex' */\n readonly format = input<WrColorFormat>('hex');\n\n /** Preset hex colours rendered as a clickable row beneath the inputs. Empty = no row. @default [] */\n readonly swatches = input<readonly string[]>([]);\n\n // Source of truth: HSV + alpha\n\n protected readonly h = signal(0);\n protected readonly s = signal(0);\n protected readonly v = signal(0);\n protected readonly a = signal(1);\n\n private readonly disabledFromCva = signal(false);\n\n protected readonly effectiveDisabled = computed(() => this.disabled() || this.disabledFromCva());\n\n // Derived values\n\n /** RGB view of the current colour, computed lazily. */\n protected readonly rgb = computed<WrRgb>(() => hsvToRgb({ h: this.h(), s: this.s(), v: this.v(), a: this.a() }));\n\n /** Canonical hex (used by the input field and by drag emits). */\n protected readonly hex = computed(() => toHex(this.rgb(), this.alpha()));\n\n /** SV canvas background colour (full-saturation hue). */\n protected readonly hueCss = computed(() => `hsl(${this.h()}, 100%, 50%)`);\n\n /** RGB string used for the alpha-slider gradient. */\n protected readonly rgbCss = computed(() => {\n const { r, g, b } = this.rgb();\n return `${r}, ${g}, ${b}`;\n });\n\n /** Thumb positions in % for each surface. */\n protected readonly svThumbX = computed(() => this.s() * 100);\n protected readonly svThumbY = computed(() => (1 - this.v()) * 100);\n protected readonly hueThumbX = computed(() => (this.h() / 360) * 100);\n protected readonly alphaThumbX = computed(() => this.a() * 100);\n\n /** Mirror of the canonical hex, edited by the user via the input field. */\n protected readonly hexInput = signal('');\n\n /** Active tab in the input switcher. */\n protected readonly activeTab = signal<Tab>('hex');\n\n /** HSL view of the current colour, computed lazily. */\n protected readonly hslView = computed<WrHsl>(() => rgbToHsl(this.rgb()));\n\n /** Alpha as integer percent for display in numeric tabs. */\n protected readonly alphaPercent = computed(() => Math.round(this.a() * 100));\n\n protected readonly tabOptions: readonly WrSegmentedOption<Tab>[] = [\n { value: 'hex', label: 'HEX' },\n { value: 'rgb', label: 'RGB' },\n { value: 'hsl', label: 'HSL' },\n ];\n\n protected readonly classes = computed(() => {\n const parts = ['wr-color-picker'];\n if (this.alpha()) parts.push('wr-color-picker--alpha');\n if (this.effectiveDisabled()) parts.push('wr-color-picker--disabled');\n return parts.join(' ');\n });\n\n // ControlValueAccessor\n\n private onChange: (value: string) => void = noop;\n private onTouched: () => void = noop;\n\n writeValue(value: string | null): void {\n const rgb = parseHex(value ?? '') ?? { r: 0, g: 0, b: 0, a: 1 };\n const hsv = rgbToHsv(rgb);\n this.h.set(hsv.h);\n this.s.set(hsv.s);\n this.v.set(hsv.v);\n this.a.set(hsv.a);\n this.hexInput.set(this.hex());\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabledFromCva.set(coerceBooleanProperty(isDisabled));\n }\n\n // Drag handlers\n\n protected onPointerDown(event: PointerEvent, surface: Edges): void {\n if (this.effectiveDisabled()) return;\n event.preventDefault();\n const target = event.currentTarget as HTMLElement;\n target.setPointerCapture(event.pointerId);\n\n const update = (e: PointerEvent): void => this.updateFromEvent(e, target, surface);\n const cleanup = (e: PointerEvent): void => {\n target.releasePointerCapture(e.pointerId);\n target.removeEventListener('pointermove', update);\n target.removeEventListener('pointerup', cleanup);\n this.onTouched();\n };\n\n target.addEventListener('pointermove', update);\n target.addEventListener('pointerup', cleanup);\n this.updateFromEvent(event, target, surface);\n }\n\n private updateFromEvent(event: PointerEvent, target: HTMLElement, surface: Edges): void {\n const rect = target.getBoundingClientRect();\n const x = clamp((event.clientX - rect.left) / rect.width, 0, 1);\n\n if (surface === 'sv') {\n const y = clamp((event.clientY - rect.top) / rect.height, 0, 1);\n this.s.set(x);\n this.v.set(1 - y);\n } else if (surface === 'hue') {\n this.h.set(x * 360);\n } else {\n this.a.set(x);\n }\n this.emit();\n }\n\n // Hex input handlers\n\n protected onHexInput(event: Event): void {\n const raw = (event.target as HTMLInputElement).value;\n this.hexInput.set(raw);\n const rgb = parseHex(raw);\n if (!rgb) return;\n const hsv = rgbToHsv(rgb);\n this.h.set(hsv.h);\n this.s.set(hsv.s);\n this.v.set(hsv.v);\n this.a.set(hsv.a);\n this.emitWithoutHexSync();\n }\n\n protected onHexBlur(): void {\n // Re-sync the input with the canonical value (in case the user typed invalid).\n this.hexInput.set(this.hex());\n this.onTouched();\n }\n\n // Emission\n\n private emit(): void {\n this.emitWithoutHexSync();\n this.hexInput.set(this.hex());\n }\n\n private emitWithoutHexSync(): void {\n this.onChange(this.hex());\n }\n\n // Tab + channel handlers\n\n protected onTabChange(tab: Tab | null): void {\n if (tab) this.activeTab.set(tab);\n }\n\n protected onRgbChannel(channel: 'r' | 'g' | 'b', event: Event): void {\n const n = clamp(Number((event.target as HTMLInputElement).value), 0, 255);\n if (Number.isNaN(n)) return;\n const current = this.rgb();\n const next: WrRgb = { ...current, [channel]: n };\n this.applyRgb(next);\n }\n\n protected onHslChannel(channel: 'h' | 's' | 'l', event: Event): void {\n const n = Number((event.target as HTMLInputElement).value);\n if (Number.isNaN(n)) return;\n const current = this.hslView();\n const next: WrHsl =\n channel === 'h' ? { ...current, h: clamp(n, 0, 360) } : { ...current, [channel]: clamp(n, 0, 100) / 100 };\n this.applyRgb(hslToRgb(next));\n }\n\n protected onAlphaPercent(event: Event): void {\n const n = clamp(Number((event.target as HTMLInputElement).value), 0, 100);\n if (Number.isNaN(n)) return;\n this.a.set(n / 100);\n this.emit();\n }\n\n protected onSwatchClick(hex: string): void {\n if (this.effectiveDisabled()) return;\n const rgb = parseHex(hex);\n if (!rgb) return;\n this.applyRgb(rgb);\n }\n\n /** Push an RGB triple into the HSV source of truth (preserving the current alpha if the swap removes it). */\n private applyRgb(rgb: WrRgb): void {\n const hsv = rgbToHsv(rgb);\n this.h.set(hsv.h);\n this.s.set(hsv.s);\n this.v.set(hsv.v);\n this.a.set(hsv.a);\n this.emit();\n }\n}\n","<div class=\"wr-color-picker__sv\" (pointerdown)=\"onPointerDown($event, 'sv')\">\n <span class=\"wr-color-picker__thumb\" [style.left.%]=\"svThumbX()\" [style.top.%]=\"svThumbY()\"></span>\n</div>\n\n<div class=\"wr-color-picker__slider wr-color-picker__slider--hue\" (pointerdown)=\"onPointerDown($event, 'hue')\">\n <span class=\"wr-color-picker__thumb wr-color-picker__thumb--slider\" [style.left.%]=\"hueThumbX()\"></span>\n</div>\n\n@if (alpha()) {\n <div class=\"wr-color-picker__slider wr-color-picker__slider--alpha\" (pointerdown)=\"onPointerDown($event, 'alpha')\">\n <span class=\"wr-color-picker__thumb wr-color-picker__thumb--slider\" [style.left.%]=\"alphaThumbX()\"></span>\n </div>\n}\n\n<div class=\"wr-color-picker__chrome\">\n <span class=\"wr-color-picker__preview\" [style.background]=\"hex()\"></span>\n <wr-segmented\n class=\"wr-color-picker__tabs\"\n [options]=\"tabOptions\"\n [value]=\"activeTab()\"\n (valueChange)=\"onTabChange($event)\"\n />\n</div>\n\n@switch (activeTab()) {\n @case ('hex') {\n <div class=\"wr-color-picker__inputs wr-color-picker__inputs--hex\">\n <label class=\"wr-color-picker__field wr-color-picker__field--wide\">\n <input\n type=\"text\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n [value]=\"hexInput()\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onHexInput($event)\"\n (blur)=\"onHexBlur()\"\n />\n <span class=\"wr-color-picker__field-label\">HEX</span>\n </label>\n </div>\n }\n @case ('rgb') {\n <div class=\"wr-color-picker__inputs\">\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [value]=\"rgb().r\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onRgbChannel('r', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">R</span>\n </label>\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [value]=\"rgb().g\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onRgbChannel('g', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">G</span>\n </label>\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [value]=\"rgb().b\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onRgbChannel('b', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">B</span>\n </label>\n @if (alpha()) {\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [value]=\"alphaPercent()\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onAlphaPercent($event)\"\n />\n <span class=\"wr-color-picker__field-label\">A%</span>\n </label>\n }\n </div>\n }\n @case ('hsl') {\n <div class=\"wr-color-picker__inputs\">\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"360\"\n [value]=\"hslView().h | number: '1.0-0'\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onHslChannel('h', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">H</span>\n </label>\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [value]=\"hslView().s * 100 | number: '1.0-0'\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onHslChannel('s', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">S%</span>\n </label>\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [value]=\"hslView().l * 100 | number: '1.0-0'\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onHslChannel('l', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">L%</span>\n </label>\n @if (alpha()) {\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [value]=\"alphaPercent()\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onAlphaPercent($event)\"\n />\n <span class=\"wr-color-picker__field-label\">A%</span>\n </label>\n }\n </div>\n }\n}\n\n@if (swatches().length > 0) {\n <div class=\"wr-color-picker__swatches\">\n @for (color of swatches(); track color) {\n <button\n type=\"button\"\n class=\"wr-color-picker__swatch\"\n [style.background]=\"color\"\n [attr.aria-label]=\"color\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onSwatchClick(color)\"\n ></button>\n }\n </div>\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n ViewContainerRef,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { WR_OVERLAY } from 'ngwr/overlay';\n\nimport { WrColorPicker } from './color-picker';\nimport type { WrColorFormat } from './interfaces';\n\n/**\n * Opens a `<wr-color-picker>` in an overlay anchored to the host element.\n *\n * Apply to any clickable element (typically a button). Two-way binds the\n * current colour through `[(value)]`; forwards `alpha` / `format` /\n * `swatches` / `disabled` to the inner picker.\n *\n * Same overlay isolation as the rest of the lib — uses {@link WR_OVERLAY},\n * not CDK's root container.\n *\n * @example\n * ```html\n * <button wrColorPickerTrigger\n * [(value)]=\"brandColor\"\n * [swatches]=\"palette\">\n * <span class=\"swatch\" [style.background]=\"brandColor\"></span>\n * {{ brandColor }}\n * </button>\n * ```\n *\n * @see https://ngwr.dev/components/color-picker\n */\n@Directive({\n selector: '[wrColorPickerTrigger]',\n host: { '(click)': 'toggle()' },\n})\nexport class WrColorPickerTrigger {\n /** Two-way bindable colour value (hex string). */\n readonly value = model<string>('');\n\n /** Forwarded to the inner picker. @default true */\n readonly alpha = input(true, { transform: coerceBooleanProperty });\n\n /** Forwarded to the inner picker. @default 'hex' */\n readonly format = input<WrColorFormat>('hex');\n\n /** Forwarded to the inner picker. @default [] */\n readonly swatches = input<readonly string[]>([]);\n\n /** Disable the trigger entirely. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /** Fires after the picker opens. */\n readonly opened = output<void>();\n\n /** Fires after the picker closes. */\n readonly closed = output<void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly isOpen = signal(false);\n private overlayRef: OverlayRef | null = null;\n\n constructor() {\n this.destroyRef.onDestroy(() => this.dispose());\n }\n\n /** Toggle the picker. Open if closed, close if open. */\n toggle(): void {\n if (this.disabled()) return;\n if (this.isOpen()) {\n this.close();\n } else {\n this.open();\n }\n }\n\n /** Open the picker. No-op if already open. */\n open(): void {\n if (this.isOpen() || this.disabled()) return;\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions([\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },\n { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 4 },\n { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -4 },\n ])\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: 'wr-color-picker-overlay',\n });\n\n const portal = new ComponentPortal(WrColorPicker, this.vcr);\n const ref = this.overlayRef.attach(portal);\n\n ref.setInput('alpha', this.alpha());\n ref.setInput('format', this.format());\n ref.setInput('swatches', this.swatches());\n ref.setInput('disabled', this.disabled());\n ref.instance.writeValue(this.value());\n\n // Bridge inner picker's CVA onChange to our two-way [(value)] model.\n ref.instance.registerOnChange((next: string) => this.value.set(next));\n\n // Outside-click → close (CDK's outsidePointerEvents only fires for clicks\n // outside the overlay pane; we also need to ignore re-clicks on the host).\n this.overlayRef\n .outsidePointerEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.close();\n });\n\n // Escape → close.\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.close();\n }\n });\n\n this.isOpen.set(true);\n this.opened.emit();\n }\n\n /** Close the picker. No-op if already closed. */\n close(): void {\n if (!this.isOpen()) return;\n this.dispose();\n this.isOpen.set(false);\n this.closed.emit();\n }\n\n private dispose(): void {\n if (this.overlayRef) {\n this.overlayRef.dispose();\n this.overlayRef = null;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;AAKG;AAKH;;AAEG;AACG,SAAU,QAAQ,CAAC,GAAU,EAAA;AACjC,IAAA,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG;AACrB,IAAA,MAAM,CAAC,GAAG,GAAG,CAA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EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,KAAA,EAAA,aAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,UAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,wBAAwB;AAClC,oBAAA,IAAI,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;AAChC,iBAAA;;;ACrDD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-color-picker.mjs","sources":["../../../projects/lib/color-picker/color/rgb-to-hsv.ts","../../../projects/lib/color-picker/color/hsv-to-rgb.ts","../../../projects/lib/color-picker/color/rgb-to-hsl.ts","../../../projects/lib/color-picker/color/hsl-to-rgb.ts","../../../projects/lib/color-picker/color/parse-hex.ts","../../../projects/lib/color-picker/color/to-hex.ts","../../../projects/lib/color-picker/color-picker.ts","../../../projects/lib/color-picker/color-picker.html","../../../projects/lib/color-picker/color-picker-trigger.ts","../../../projects/lib/color-picker/ngwr-color-picker.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrHsv } from './wr-hsv';\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Convert sRGB to HSV. Preserves alpha.\n */\nexport function rgbToHsv(rgb: WrRgb): WrHsv {\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const d = max - min;\n\n let h = 0;\n if (d !== 0) {\n if (max === r) h = ((g - b) / d) % 6;\n else if (max === g) h = (b - r) / d + 2;\n else h = (r - g) / d + 4;\n h *= 60;\n if (h < 0) h += 360;\n }\n\n const s = max === 0 ? 0 : d / max;\n const v = max;\n\n return { h, s, v, a: rgb.a };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrHsv } from './wr-hsv';\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Convert HSV to sRGB. Preserves alpha. Returns integer channels in `[0, 255]`.\n */\nexport function hsvToRgb(hsv: WrHsv): WrRgb {\n const { h, s, v } = hsv;\n const c = v * s;\n const x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n const m = v - c;\n\n let r = 0;\n let g = 0;\n let b = 0;\n\n if (h < 60) {\n r = c;\n g = x;\n } else if (h < 120) {\n r = x;\n g = c;\n } else if (h < 180) {\n g = c;\n b = x;\n } else if (h < 240) {\n g = x;\n b = c;\n } else if (h < 300) {\n r = x;\n b = c;\n } else {\n r = c;\n b = x;\n }\n\n return {\n r: Math.round((r + m) * 255),\n g: Math.round((g + m) * 255),\n b: Math.round((b + m) * 255),\n a: hsv.a,\n };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrHsl } from './wr-hsl';\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Convert sRGB to HSL. Preserves alpha.\n */\nexport function rgbToHsl(rgb: WrRgb): WrHsl {\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const d = max - min;\n const l = (max + min) / 2;\n\n let h = 0;\n let s = 0;\n\n if (d !== 0) {\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n if (max === r) h = (g - b) / d + (g < b ? 6 : 0);\n else if (max === g) h = (b - r) / d + 2;\n else h = (r - g) / d + 4;\n\n h *= 60;\n }\n\n return { h, s, l, a: rgb.a };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrHsl } from './wr-hsl';\nimport type { WrRgb } from './wr-rgb';\n\nfunction hueToChannel(p: number, q: number, t: number): number {\n let x = t;\n if (x < 0) x += 1;\n if (x > 1) x -= 1;\n if (x < 1 / 6) return p + (q - p) * 6 * x;\n if (x < 1 / 2) return q;\n if (x < 2 / 3) return p + (q - p) * (2 / 3 - x) * 6;\n return p;\n}\n\n/**\n * Convert HSL to sRGB. Preserves alpha. Returns integer channels in `[0, 255]`.\n */\nexport function hslToRgb(hsl: WrHsl): WrRgb {\n const h = hsl.h / 360;\n const { s, l } = hsl;\n\n let r: number;\n let g: number;\n let b: number;\n\n if (s === 0) {\n r = l;\n g = l;\n b = l;\n } else {\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hueToChannel(p, q, h + 1 / 3);\n g = hueToChannel(p, q, h);\n b = hueToChannel(p, q, h - 1 / 3);\n }\n\n return {\n r: Math.round(r * 255),\n g: Math.round(g * 255),\n b: Math.round(b * 255),\n a: hsl.a,\n };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrRgb } from './wr-rgb';\n\n/**\n * Parse a CSS hex colour into {@link WrRgb}. Accepts 3, 4, 6, or 8 digit\n * forms with or without a leading `#`. Returns `null` for anything that\n * isn't a valid hex string.\n *\n * @example\n * ```ts\n * parseHex('#f00'); // { r: 255, g: 0, b: 0, a: 1 }\n * parseHex('3969e2'); // { r: 57, g: 105, b: 226, a: 1 }\n * parseHex('#3969e2ff'); // { r: 57, g: 105, b: 226, a: 1 }\n * parseHex('nope'); // null\n * ```\n */\nexport function parseHex(input: string): WrRgb | null {\n if (typeof input !== 'string') return null;\n\n let str = input.trim().replace(/^#/, '').toLowerCase();\n\n // Expand shorthand: rgb → rrggbb, rgba → rrggbbaa\n if (str.length === 3 || str.length === 4) {\n str = str\n .split('')\n .map(c => c + c)\n .join('');\n }\n\n if (str.length !== 6 && str.length !== 8) return null;\n if (!/^[0-9a-f]+$/.test(str)) return null;\n\n const r = parseInt(str.slice(0, 2), 16);\n const g = parseInt(str.slice(2, 4), 16);\n const b = parseInt(str.slice(4, 6), 16);\n const a = str.length === 8 ? parseInt(str.slice(6, 8), 16) / 255 : 1;\n\n return { r, g, b, a };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrRgb } from './wr-rgb';\n\nfunction channelToHex(n: number): string {\n const clamped = Math.max(0, Math.min(255, Math.round(n)));\n return clamped.toString(16).padStart(2, '0');\n}\n\n/**\n * Format a {@link WrRgb} as a CSS hex string with a leading `#`. When\n * `withAlpha` is `true` the result is 8 digits (`#rrggbbaa`); otherwise\n * 6 digits.\n *\n * @example\n * ```ts\n * toHex({ r: 57, g: 105, b: 226, a: 1 }); // '#3969e2'\n * toHex({ r: 57, g: 105, b: 226, a: 0.5 }, true); // '#3969e280'\n * ```\n */\nexport function toHex(rgb: WrRgb, withAlpha = false): string {\n const r = channelToHex(rgb.r);\n const g = channelToHex(rgb.g);\n const b = channelToHex(rgb.b);\n if (withAlpha) {\n const a = channelToHex(rgb.a * 255);\n return `#${r}${g}${b}${a}`;\n }\n return `#${r}${g}${b}`;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { DecimalPipe } from '@angular/common';\nimport { Component, ViewEncapsulation, computed, forwardRef, input, signal } from '@angular/core';\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { WrSegmented, type WrSegmentedOption } from 'ngwr/segmented';\nimport { clamp, noop } from 'ngwr/utils';\n\nimport { hslToRgb, hsvToRgb, parseHex, rgbToHsl, rgbToHsv, toHex, type WrHsl, type WrRgb } from './color';\nimport type { WrColorFormat } from './interfaces';\n\ntype Tab = 'hex' | 'rgb' | 'hsl';\n\ntype Edges = 'sv' | 'hue' | 'alpha';\n\n/**\n * Inline colour picker — HSV canvas, hue slider, optional alpha slider, HEX\n * input. Implements `ControlValueAccessor`, so it binds with `[(ngModel)]`,\n * `[formControl]`, or `formControlName`. Output is always a string in the\n * format chosen via `[format]`.\n *\n * @example\n * ```html\n * <wr-color-picker [(ngModel)]=\"brandColor\" />\n * <wr-color-picker [(ngModel)]=\"brandColor\" [alpha]=\"false\" />\n * ```\n *\n * @see https://ngwr.dev/components/color-picker\n */\n@Component({\n selector: 'wr-color-picker',\n templateUrl: './color-picker.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n '[class]': 'classes()',\n '[style.--wr-color-picker-hue]': 'hueCss()',\n '[style.--wr-color-picker-rgb]': 'rgbCss()',\n },\n imports: [DecimalPipe, WrSegmented],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrColorPicker),\n multi: true,\n },\n ],\n})\nexport class WrColorPicker implements ControlValueAccessor {\n /** Render the alpha slider and emit 8-digit hex / `rgba()`. @default true */\n readonly alpha = input(true, { transform: coerceBooleanProperty });\n\n /** Disable interaction. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /** Output format produced through the CVA. @default 'hex' */\n readonly format = input<WrColorFormat>('hex');\n\n /** Preset hex colours rendered as a clickable row beneath the inputs. Empty = no row. @default [] */\n readonly swatches = input<readonly string[]>([]);\n\n // Source of truth: HSV + alpha\n\n protected readonly h = signal(0);\n protected readonly s = signal(0);\n protected readonly v = signal(0);\n protected readonly a = signal(1);\n\n private readonly disabledFromCva = signal(false);\n\n protected readonly effectiveDisabled = computed(() => this.disabled() || this.disabledFromCva());\n\n // Derived values\n\n /** RGB view of the current colour, computed lazily. */\n protected readonly rgb = computed<WrRgb>(() => hsvToRgb({ h: this.h(), s: this.s(), v: this.v(), a: this.a() }));\n\n /** Canonical hex (used by the input field and by drag emits). */\n protected readonly hex = computed(() => toHex(this.rgb(), this.alpha()));\n\n /** SV canvas background colour (full-saturation hue). */\n protected readonly hueCss = computed(() => `hsl(${this.h()}, 100%, 50%)`);\n\n /** RGB string used for the alpha-slider gradient. */\n protected readonly rgbCss = computed(() => {\n const { r, g, b } = this.rgb();\n return `${r}, ${g}, ${b}`;\n });\n\n /** Thumb positions in % for each surface. */\n protected readonly svThumbX = computed(() => this.s() * 100);\n protected readonly svThumbY = computed(() => (1 - this.v()) * 100);\n protected readonly hueThumbX = computed(() => (this.h() / 360) * 100);\n protected readonly alphaThumbX = computed(() => this.a() * 100);\n\n /** Mirror of the canonical hex, edited by the user via the input field. */\n protected readonly hexInput = signal('');\n\n /** Active tab in the input switcher. */\n protected readonly activeTab = signal<Tab>('hex');\n\n /** HSL view of the current colour, computed lazily. */\n protected readonly hslView = computed<WrHsl>(() => rgbToHsl(this.rgb()));\n\n /** Alpha as integer percent for display in numeric tabs. */\n protected readonly alphaPercent = computed(() => Math.round(this.a() * 100));\n\n protected readonly tabOptions: readonly WrSegmentedOption<Tab>[] = [\n { value: 'hex', label: 'HEX' },\n { value: 'rgb', label: 'RGB' },\n { value: 'hsl', label: 'HSL' },\n ];\n\n protected readonly classes = computed(() => {\n const parts = ['wr-color-picker'];\n if (this.alpha()) parts.push('wr-color-picker--alpha');\n if (this.effectiveDisabled()) parts.push('wr-color-picker--disabled');\n return parts.join(' ');\n });\n\n // ControlValueAccessor\n\n private onChange: (value: string) => void = noop;\n private onTouched: () => void = noop;\n\n writeValue(value: string | null): void {\n const rgb = parseHex(value ?? '') ?? { r: 0, g: 0, b: 0, a: 1 };\n const hsv = rgbToHsv(rgb);\n this.h.set(hsv.h);\n this.s.set(hsv.s);\n this.v.set(hsv.v);\n this.a.set(hsv.a);\n this.hexInput.set(this.hex());\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabledFromCva.set(coerceBooleanProperty(isDisabled));\n }\n\n // Drag handlers\n\n protected onPointerDown(event: PointerEvent, surface: Edges): void {\n if (this.effectiveDisabled()) return;\n event.preventDefault();\n const target = event.currentTarget as HTMLElement;\n target.setPointerCapture(event.pointerId);\n\n const update = (e: PointerEvent): void => this.updateFromEvent(e, target, surface);\n const cleanup = (e: PointerEvent): void => {\n target.releasePointerCapture(e.pointerId);\n target.removeEventListener('pointermove', update);\n target.removeEventListener('pointerup', cleanup);\n this.onTouched();\n };\n\n target.addEventListener('pointermove', update);\n target.addEventListener('pointerup', cleanup);\n this.updateFromEvent(event, target, surface);\n }\n\n private updateFromEvent(event: PointerEvent, target: HTMLElement, surface: Edges): void {\n const rect = target.getBoundingClientRect();\n const x = clamp((event.clientX - rect.left) / rect.width, 0, 1);\n\n if (surface === 'sv') {\n const y = clamp((event.clientY - rect.top) / rect.height, 0, 1);\n this.s.set(x);\n this.v.set(1 - y);\n } else if (surface === 'hue') {\n this.h.set(x * 360);\n } else {\n this.a.set(x);\n }\n this.emit();\n }\n\n // Hex input handlers\n\n protected onHexInput(event: Event): void {\n const raw = (event.target as HTMLInputElement).value;\n this.hexInput.set(raw);\n const rgb = parseHex(raw);\n if (!rgb) return;\n const hsv = rgbToHsv(rgb);\n this.h.set(hsv.h);\n this.s.set(hsv.s);\n this.v.set(hsv.v);\n this.a.set(hsv.a);\n this.emitWithoutHexSync();\n }\n\n protected onHexBlur(): void {\n // Re-sync the input with the canonical value (in case the user typed invalid).\n this.hexInput.set(this.hex());\n this.onTouched();\n }\n\n // Emission\n\n private emit(): void {\n this.emitWithoutHexSync();\n this.hexInput.set(this.hex());\n }\n\n private emitWithoutHexSync(): void {\n this.onChange(this.hex());\n }\n\n // Tab + channel handlers\n\n protected onTabChange(tab: Tab | null): void {\n if (tab) this.activeTab.set(tab);\n }\n\n protected onRgbChannel(channel: 'r' | 'g' | 'b', event: Event): void {\n const n = clamp(Number((event.target as HTMLInputElement).value), 0, 255);\n if (Number.isNaN(n)) return;\n const current = this.rgb();\n const next: WrRgb = { ...current, [channel]: n };\n this.applyRgb(next);\n }\n\n protected onHslChannel(channel: 'h' | 's' | 'l', event: Event): void {\n const n = Number((event.target as HTMLInputElement).value);\n if (Number.isNaN(n)) return;\n const current = this.hslView();\n const next: WrHsl =\n channel === 'h' ? { ...current, h: clamp(n, 0, 360) } : { ...current, [channel]: clamp(n, 0, 100) / 100 };\n this.applyRgb(hslToRgb(next));\n }\n\n protected onAlphaPercent(event: Event): void {\n const n = clamp(Number((event.target as HTMLInputElement).value), 0, 100);\n if (Number.isNaN(n)) return;\n this.a.set(n / 100);\n this.emit();\n }\n\n protected onSwatchClick(hex: string): void {\n if (this.effectiveDisabled()) return;\n const rgb = parseHex(hex);\n if (!rgb) return;\n this.applyRgb(rgb);\n }\n\n /** Push an RGB triple into the HSV source of truth (preserving the current alpha if the swap removes it). */\n private applyRgb(rgb: WrRgb): void {\n const hsv = rgbToHsv(rgb);\n this.h.set(hsv.h);\n this.s.set(hsv.s);\n this.v.set(hsv.v);\n this.a.set(hsv.a);\n this.emit();\n }\n}\n","<div class=\"wr-color-picker__sv\" (pointerdown)=\"onPointerDown($event, 'sv')\">\n <span class=\"wr-color-picker__thumb\" [style.left.%]=\"svThumbX()\" [style.top.%]=\"svThumbY()\"></span>\n</div>\n\n<div class=\"wr-color-picker__slider wr-color-picker__slider--hue\" (pointerdown)=\"onPointerDown($event, 'hue')\">\n <span class=\"wr-color-picker__thumb wr-color-picker__thumb--slider\" [style.left.%]=\"hueThumbX()\"></span>\n</div>\n\n@if (alpha()) {\n <div class=\"wr-color-picker__slider wr-color-picker__slider--alpha\" (pointerdown)=\"onPointerDown($event, 'alpha')\">\n <span class=\"wr-color-picker__thumb wr-color-picker__thumb--slider\" [style.left.%]=\"alphaThumbX()\"></span>\n </div>\n}\n\n<div class=\"wr-color-picker__chrome\">\n <span class=\"wr-color-picker__preview\" [style.background]=\"hex()\"></span>\n <wr-segmented\n class=\"wr-color-picker__tabs\"\n [options]=\"tabOptions\"\n [value]=\"activeTab()\"\n (valueChange)=\"onTabChange($event)\"\n />\n</div>\n\n@switch (activeTab()) {\n @case ('hex') {\n <div class=\"wr-color-picker__inputs wr-color-picker__inputs--hex\">\n <label class=\"wr-color-picker__field wr-color-picker__field--wide\">\n <input\n type=\"text\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n [value]=\"hexInput()\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onHexInput($event)\"\n (blur)=\"onHexBlur()\"\n />\n <span class=\"wr-color-picker__field-label\">HEX</span>\n </label>\n </div>\n }\n @case ('rgb') {\n <div class=\"wr-color-picker__inputs\">\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [value]=\"rgb().r\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onRgbChannel('r', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">R</span>\n </label>\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [value]=\"rgb().g\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onRgbChannel('g', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">G</span>\n </label>\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"255\"\n [value]=\"rgb().b\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onRgbChannel('b', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">B</span>\n </label>\n @if (alpha()) {\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [value]=\"alphaPercent()\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onAlphaPercent($event)\"\n />\n <span class=\"wr-color-picker__field-label\">A%</span>\n </label>\n }\n </div>\n }\n @case ('hsl') {\n <div class=\"wr-color-picker__inputs\">\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"360\"\n [value]=\"hslView().h | number: '1.0-0'\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onHslChannel('h', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">H</span>\n </label>\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [value]=\"hslView().s * 100 | number: '1.0-0'\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onHslChannel('s', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">S%</span>\n </label>\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [value]=\"hslView().l * 100 | number: '1.0-0'\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onHslChannel('l', $event)\"\n />\n <span class=\"wr-color-picker__field-label\">L%</span>\n </label>\n @if (alpha()) {\n <label class=\"wr-color-picker__field\">\n <input\n type=\"number\"\n min=\"0\"\n max=\"100\"\n [value]=\"alphaPercent()\"\n [disabled]=\"effectiveDisabled()\"\n (input)=\"onAlphaPercent($event)\"\n />\n <span class=\"wr-color-picker__field-label\">A%</span>\n </label>\n }\n </div>\n }\n}\n\n@if (swatches().length > 0) {\n <div class=\"wr-color-picker__swatches\">\n @for (color of swatches(); track color) {\n <button\n type=\"button\"\n class=\"wr-color-picker__swatch\"\n [style.background]=\"color\"\n [attr.aria-label]=\"color\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"onSwatchClick(color)\"\n ></button>\n }\n </div>\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n ViewContainerRef,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { WR_OVERLAY } from 'ngwr/overlay';\n\nimport { WrColorPicker } from './color-picker';\nimport type { WrColorFormat } from './interfaces';\n\n/**\n * Opens a `<wr-color-picker>` in an overlay anchored to the host element.\n *\n * Apply to any clickable element (typically a button). Two-way binds the\n * current colour through `[(value)]`; forwards `alpha` / `format` /\n * `swatches` / `disabled` to the inner picker.\n *\n * Same overlay isolation as the rest of the lib — uses {@link WR_OVERLAY},\n * not CDK's root container.\n *\n * @example\n * ```html\n * <button wrColorPickerTrigger\n * [(value)]=\"brandColor\"\n * [swatches]=\"palette\">\n * <span class=\"swatch\" [style.background]=\"brandColor\"></span>\n * {{ brandColor }}\n * </button>\n * ```\n *\n * @see https://ngwr.dev/components/color-picker\n */\n@Directive({\n selector: '[wrColorPickerTrigger]',\n host: { '(click)': 'toggle()' },\n})\nexport class WrColorPickerTrigger {\n /** Two-way bindable colour value (hex string). */\n readonly value = model<string>('');\n\n /** Forwarded to the inner picker. @default true */\n readonly alpha = input(true, { transform: coerceBooleanProperty });\n\n /** Forwarded to the inner picker. @default 'hex' */\n readonly format = input<WrColorFormat>('hex');\n\n /** Forwarded to the inner picker. @default [] */\n readonly swatches = input<readonly string[]>([]);\n\n /** Disable the trigger entirely. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /** Fires after the picker opens. */\n readonly opened = output<void>();\n\n /** Fires after the picker closes. */\n readonly closed = output<void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly isOpen = signal(false);\n private overlayRef: OverlayRef | null = null;\n\n constructor() {\n this.destroyRef.onDestroy(() => this.dispose());\n }\n\n /** Toggle the picker. Open if closed, close if open. */\n toggle(): void {\n if (this.disabled()) return;\n if (this.isOpen()) {\n this.close();\n } else {\n this.open();\n }\n }\n\n /** Open the picker. No-op if already open. */\n open(): void {\n if (this.isOpen() || this.disabled()) return;\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions([\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },\n { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 4 },\n { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -4 },\n ])\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: 'wr-color-picker-overlay',\n });\n\n const portal = new ComponentPortal(WrColorPicker, this.vcr);\n const ref = this.overlayRef.attach(portal);\n\n ref.setInput('alpha', this.alpha());\n ref.setInput('format', this.format());\n ref.setInput('swatches', this.swatches());\n ref.setInput('disabled', this.disabled());\n ref.instance.writeValue(this.value());\n\n // Bridge inner picker's CVA onChange to our two-way [(value)] model.\n ref.instance.registerOnChange((next: string) => this.value.set(next));\n\n // Outside-click → close (CDK's outsidePointerEvents only fires for clicks\n // outside the overlay pane; we also need to ignore re-clicks on the host).\n this.overlayRef\n .outsidePointerEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.close();\n });\n\n // Escape → close.\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.close();\n }\n });\n\n this.isOpen.set(true);\n this.opened.emit();\n }\n\n /** Close the picker. No-op if already closed. */\n close(): void {\n if (!this.isOpen()) return;\n this.dispose();\n this.isOpen.set(false);\n this.closed.emit();\n }\n\n private dispose(): void {\n if (this.overlayRef) {\n this.overlayRef.dispose();\n this.overlayRef = null;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;AAKG;AAKH;;AAEG;AACG,SAAU,QAAQ,CAAC,GAAU,EAAA;AACjC,IAAA,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG;AACrB,IAAA,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG;AACrB,IAAA,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG;AACrB,IAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAC7B,IAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAC7B,IAAA,MAAM,CAAC,GAAG,GAAG,GAAG,GAAG;IAEnB,IAAI,CAAC,GAAG,CAAC;AACT,IAAA,IAAI,CAAC,KAAK,CAAC,EAAE;QACX,IAAI,GAAG,KAAK,CAAC;AAAE,YAAA,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;aAC/B,IAAI,GAAG,KAAK,CAAC;YAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC;;YAClC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC;QACxB,CAAC,IAAI,EAAE;QACP,IAAI,CAAC,GAAG,CAAC;YAAE,CAAC,IAAI,GAAG;IACrB;AAEA,IAAA,MAAM,CAAC,GAAG,GAAG,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AA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,KAAA,EAAA,aAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,UAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,wBAAwB;AAClC,oBAAA,IAAI,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;AAChC,iBAAA;;;ACrDD;;AAEG;;;;"}
@@ -257,10 +257,10 @@ class WrCommandPalette {
257
257
  if (this.closeOnPick())
258
258
  this.close();
259
259
  }
260
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrCommandPalette, deps: [], target: i0.ɵɵFactoryTarget.Component });
261
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: WrCommandPalette, isStandalone: true, selector: "wr-command-palette", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, trigger: { classPropertyName: "trigger", publicName: "trigger", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, closeOnPick: { classPropertyName: "closeOnPick", publicName: "closeOnPick", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", picked: "picked" }, viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["input"], descendants: true, isSignal: true }, { propertyName: "panelEl", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (open()) {\n <div\n class=\"wr-command-palette\"\n [class.wr-command-palette--sheet]=\"presentAsSheet()\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Command palette\"\n >\n <!-- Backdrop captures clicks to close. Not focusable \u2014 keyboard users use\n Esc on the panel below. -->\n\n <div class=\"wr-command-palette__backdrop\" aria-hidden=\"true\" (click)=\"onBackdropClick()\"></div>\n\n <!-- Keydown is delegated from the search input; tabindex enables Esc when\n the input is unfocused. -->\n <div #panel class=\"wr-command-palette__panel\" tabindex=\"-1\" (keydown)=\"onKeydown($event)\">\n <div class=\"wr-command-palette__search\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <circle cx=\"7\" cy=\"7\" r=\"5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" />\n <path d=\"M11 11 L14 14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n <input\n #input\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-expanded]=\"true\"\n [attr.aria-activedescendant]=\"activeOptionId() || null\"\n [placeholder]=\"resolvedPlaceholder()\"\n [value]=\"query()\"\n (input)=\"onQueryInput($event)\"\n />\n <kbd class=\"wr-command-palette__hint\">esc</kbd>\n </div>\n\n <div class=\"wr-command-palette__body\" role=\"listbox\" [attr.id]=\"listboxId\">\n @if (filtered().length === 0) {\n <div class=\"wr-command-palette__empty\">{{ resolvedEmpty() }}</div>\n } @else {\n @for (bucket of buckets(); track bucket.title) {\n <div class=\"wr-command-palette__group\">\n @if (bucket.title) {\n <div class=\"wr-command-palette__group-title\">{{ bucket.title }}</div>\n }\n @for (item of bucket.items; track item.id) {\n <div\n class=\"wr-command-palette__option\"\n role=\"option\"\n [attr.id]=\"optionId(indexOf(item))\"\n [class.wr-command-palette__option--active]=\"indexOf(item) === activeIndex()\"\n [attr.aria-selected]=\"indexOf(item) === activeIndex()\"\n (mouseenter)=\"onItemHover(item)\"\n (mousedown)=\"onItemClick(item, $event)\"\n >\n @if (item.icon) {\n <wr-icon class=\"wr-command-palette__option-icon\" [name]=\"item.icon\" size=\"16\" />\n } @else {\n <span class=\"wr-command-palette__option-icon\" aria-hidden=\"true\"></span>\n }\n <div class=\"wr-command-palette__option-body\">\n <div class=\"wr-command-palette__option-label\">{{ item.label }}</div>\n @if (item.description) {\n <div class=\"wr-command-palette__option-description\">{{ item.description }}</div>\n }\n </div>\n @if (item.shortcut) {\n <kbd class=\"wr-command-palette__option-shortcut\">{{ item.shortcut }}</kbd>\n }\n </div>\n }\n </div>\n }\n }\n </div>\n </div>\n </div>\n}\n", dependencies: [{ kind: "component", type: WrIcon, selector: "wr-icon", inputs: ["name"] }], encapsulation: i0.ViewEncapsulation.None });
260
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: WrCommandPalette, deps: [], target: i0.ɵɵFactoryTarget.Component });
261
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: WrCommandPalette, isStandalone: true, selector: "wr-command-palette", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, trigger: { classPropertyName: "trigger", publicName: "trigger", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, closeOnPick: { classPropertyName: "closeOnPick", publicName: "closeOnPick", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", picked: "picked" }, viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["input"], descendants: true, isSignal: true }, { propertyName: "panelEl", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (open()) {\n <div\n class=\"wr-command-palette\"\n [class.wr-command-palette--sheet]=\"presentAsSheet()\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Command palette\"\n >\n <!-- Backdrop captures clicks to close. Not focusable \u2014 keyboard users use\n Esc on the panel below. -->\n\n <div class=\"wr-command-palette__backdrop\" aria-hidden=\"true\" (click)=\"onBackdropClick()\"></div>\n\n <!-- Keydown is delegated from the search input; tabindex enables Esc when\n the input is unfocused. -->\n <div #panel class=\"wr-command-palette__panel\" tabindex=\"-1\" (keydown)=\"onKeydown($event)\">\n <div class=\"wr-command-palette__search\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <circle cx=\"7\" cy=\"7\" r=\"5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" />\n <path d=\"M11 11 L14 14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n <input\n #input\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-expanded]=\"true\"\n [attr.aria-activedescendant]=\"activeOptionId() || null\"\n [placeholder]=\"resolvedPlaceholder()\"\n [value]=\"query()\"\n (input)=\"onQueryInput($event)\"\n />\n <kbd class=\"wr-command-palette__hint\">esc</kbd>\n </div>\n\n <div class=\"wr-command-palette__body\" role=\"listbox\" [attr.id]=\"listboxId\">\n @if (filtered().length === 0) {\n <div class=\"wr-command-palette__empty\">{{ resolvedEmpty() }}</div>\n } @else {\n @for (bucket of buckets(); track bucket.title) {\n <div class=\"wr-command-palette__group\">\n @if (bucket.title) {\n <div class=\"wr-command-palette__group-title\">{{ bucket.title }}</div>\n }\n @for (item of bucket.items; track item.id) {\n <div\n class=\"wr-command-palette__option\"\n role=\"option\"\n [attr.id]=\"optionId(indexOf(item))\"\n [class.wr-command-palette__option--active]=\"indexOf(item) === activeIndex()\"\n [attr.aria-selected]=\"indexOf(item) === activeIndex()\"\n (mouseenter)=\"onItemHover(item)\"\n (mousedown)=\"onItemClick(item, $event)\"\n >\n @if (item.icon) {\n <wr-icon class=\"wr-command-palette__option-icon\" [name]=\"item.icon\" size=\"16\" />\n } @else {\n <span class=\"wr-command-palette__option-icon\" aria-hidden=\"true\"></span>\n }\n <div class=\"wr-command-palette__option-body\">\n <div class=\"wr-command-palette__option-label\">{{ item.label }}</div>\n @if (item.description) {\n <div class=\"wr-command-palette__option-description\">{{ item.description }}</div>\n }\n </div>\n @if (item.shortcut) {\n <kbd class=\"wr-command-palette__option-shortcut\">{{ item.shortcut }}</kbd>\n }\n </div>\n }\n </div>\n }\n }\n </div>\n </div>\n </div>\n}\n", dependencies: [{ kind: "component", type: WrIcon, selector: "wr-icon", inputs: ["name"] }], encapsulation: i0.ViewEncapsulation.None });
262
262
  }
263
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrCommandPalette, decorators: [{
263
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: WrCommandPalette, decorators: [{
264
264
  type: Component,
265
265
  args: [{ selector: 'wr-command-palette', encapsulation: ViewEncapsulation.None, imports: [WrIcon], template: "@if (open()) {\n <div\n class=\"wr-command-palette\"\n [class.wr-command-palette--sheet]=\"presentAsSheet()\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Command palette\"\n >\n <!-- Backdrop captures clicks to close. Not focusable \u2014 keyboard users use\n Esc on the panel below. -->\n\n <div class=\"wr-command-palette__backdrop\" aria-hidden=\"true\" (click)=\"onBackdropClick()\"></div>\n\n <!-- Keydown is delegated from the search input; tabindex enables Esc when\n the input is unfocused. -->\n <div #panel class=\"wr-command-palette__panel\" tabindex=\"-1\" (keydown)=\"onKeydown($event)\">\n <div class=\"wr-command-palette__search\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <circle cx=\"7\" cy=\"7\" r=\"5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" />\n <path d=\"M11 11 L14 14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n <input\n #input\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-expanded]=\"true\"\n [attr.aria-activedescendant]=\"activeOptionId() || null\"\n [placeholder]=\"resolvedPlaceholder()\"\n [value]=\"query()\"\n (input)=\"onQueryInput($event)\"\n />\n <kbd class=\"wr-command-palette__hint\">esc</kbd>\n </div>\n\n <div class=\"wr-command-palette__body\" role=\"listbox\" [attr.id]=\"listboxId\">\n @if (filtered().length === 0) {\n <div class=\"wr-command-palette__empty\">{{ resolvedEmpty() }}</div>\n } @else {\n @for (bucket of buckets(); track bucket.title) {\n <div class=\"wr-command-palette__group\">\n @if (bucket.title) {\n <div class=\"wr-command-palette__group-title\">{{ bucket.title }}</div>\n }\n @for (item of bucket.items; track item.id) {\n <div\n class=\"wr-command-palette__option\"\n role=\"option\"\n [attr.id]=\"optionId(indexOf(item))\"\n [class.wr-command-palette__option--active]=\"indexOf(item) === activeIndex()\"\n [attr.aria-selected]=\"indexOf(item) === activeIndex()\"\n (mouseenter)=\"onItemHover(item)\"\n (mousedown)=\"onItemClick(item, $event)\"\n >\n @if (item.icon) {\n <wr-icon class=\"wr-command-palette__option-icon\" [name]=\"item.icon\" size=\"16\" />\n } @else {\n <span class=\"wr-command-palette__option-icon\" aria-hidden=\"true\"></span>\n }\n <div class=\"wr-command-palette__option-body\">\n <div class=\"wr-command-palette__option-label\">{{ item.label }}</div>\n @if (item.description) {\n <div class=\"wr-command-palette__option-description\">{{ item.description }}</div>\n }\n </div>\n @if (item.shortcut) {\n <kbd class=\"wr-command-palette__option-shortcut\">{{ item.shortcut }}</kbd>\n }\n </div>\n }\n </div>\n }\n }\n </div>\n </div>\n </div>\n}\n" }]
266
266
  }], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], trigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "trigger", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], closeOnPick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnPick", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], picked: [{ type: i0.Output, args: ["picked"] }], inputEl: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }], panelEl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }] } });
@@ -121,10 +121,10 @@ class WrCompare {
121
121
  : ((event.clientY - rect.top) / rect.height) * 100;
122
122
  this.position.set(clamp(raw, this.minPosition(), this.maxPosition()));
123
123
  }
124
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrCompare, deps: [], target: i0.ɵɵFactoryTarget.Component });
125
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: WrCompare, isStandalone: true, selector: "wr-compare", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, showHandle: { classPropertyName: "showHandle", publicName: "showHandle", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, minPosition: { classPropertyName: "minPosition", publicName: "minPosition", isSignal: true, isRequired: false, transformFunction: null }, maxPosition: { classPropertyName: "maxPosition", publicName: "maxPosition", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { position: "positionChange" }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: "<div\n class=\"wr-compare__surface\"\n role=\"slider\"\n aria-label=\"Comparison divider\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-valuemin]=\"minPosition()\"\n [attr.aria-valuemax]=\"maxPosition()\"\n [attr.aria-valuenow]=\"position()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (keydown)=\"onKeydown($event)\"\n>\n <div class=\"wr-compare__layers\">\n <div class=\"wr-compare__layer wr-compare__layer--before\">\n <ng-content select=\"[wrCompareBefore]\" />\n </div>\n <div class=\"wr-compare__layer wr-compare__layer--after\" [style.clip-path]=\"clipPath()\">\n <ng-content select=\"[wrCompareAfter]\" />\n </div>\n </div>\n\n <div\n class=\"wr-compare__divider\"\n [style.left.%]=\"orientation() === 'horizontal' ? position() : null\"\n [style.top.%]=\"orientation() === 'vertical' ? position() : null\"\n aria-hidden=\"true\"\n >\n @if (showHandle()) {\n <span class=\"wr-compare__handle\">\n @if (orientation() === 'horizontal') {\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path\n d=\"M5 4 L1 8 L5 12 M11 4 L15 8 L11 12\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n } @else {\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path\n d=\"M4 5 L8 1 L12 5 M4 11 L8 15 L12 11\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n }\n </span>\n }\n </div>\n</div>\n", encapsulation: i0.ViewEncapsulation.None });
124
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: WrCompare, deps: [], target: i0.ɵɵFactoryTarget.Component });
125
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: WrCompare, isStandalone: true, selector: "wr-compare", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, showHandle: { classPropertyName: "showHandle", publicName: "showHandle", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, minPosition: { classPropertyName: "minPosition", publicName: "minPosition", isSignal: true, isRequired: false, transformFunction: null }, maxPosition: { classPropertyName: "maxPosition", publicName: "maxPosition", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { position: "positionChange" }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: "<div\n class=\"wr-compare__surface\"\n role=\"slider\"\n aria-label=\"Comparison divider\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-valuemin]=\"minPosition()\"\n [attr.aria-valuemax]=\"maxPosition()\"\n [attr.aria-valuenow]=\"position()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (keydown)=\"onKeydown($event)\"\n>\n <div class=\"wr-compare__layers\">\n <div class=\"wr-compare__layer wr-compare__layer--before\">\n <ng-content select=\"[wrCompareBefore]\" />\n </div>\n <div class=\"wr-compare__layer wr-compare__layer--after\" [style.clip-path]=\"clipPath()\">\n <ng-content select=\"[wrCompareAfter]\" />\n </div>\n </div>\n\n <div\n class=\"wr-compare__divider\"\n [style.left.%]=\"orientation() === 'horizontal' ? position() : null\"\n [style.top.%]=\"orientation() === 'vertical' ? position() : null\"\n aria-hidden=\"true\"\n >\n @if (showHandle()) {\n <span class=\"wr-compare__handle\">\n @if (orientation() === 'horizontal') {\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path\n d=\"M5 4 L1 8 L5 12 M11 4 L15 8 L11 12\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n } @else {\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path\n d=\"M4 5 L8 1 L12 5 M4 11 L8 15 L12 11\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n }\n </span>\n }\n </div>\n</div>\n", encapsulation: i0.ViewEncapsulation.None });
126
126
  }
127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrCompare, decorators: [{
127
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: WrCompare, decorators: [{
128
128
  type: Component,
129
129
  args: [{ selector: 'wr-compare', encapsulation: ViewEncapsulation.None, host: { '[class]': 'classes()' }, template: "<div\n class=\"wr-compare__surface\"\n role=\"slider\"\n aria-label=\"Comparison divider\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-valuemin]=\"minPosition()\"\n [attr.aria-valuemax]=\"maxPosition()\"\n [attr.aria-valuenow]=\"position()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (keydown)=\"onKeydown($event)\"\n>\n <div class=\"wr-compare__layers\">\n <div class=\"wr-compare__layer wr-compare__layer--before\">\n <ng-content select=\"[wrCompareBefore]\" />\n </div>\n <div class=\"wr-compare__layer wr-compare__layer--after\" [style.clip-path]=\"clipPath()\">\n <ng-content select=\"[wrCompareAfter]\" />\n </div>\n </div>\n\n <div\n class=\"wr-compare__divider\"\n [style.left.%]=\"orientation() === 'horizontal' ? position() : null\"\n [style.top.%]=\"orientation() === 'vertical' ? position() : null\"\n aria-hidden=\"true\"\n >\n @if (showHandle()) {\n <span class=\"wr-compare__handle\">\n @if (orientation() === 'horizontal') {\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path\n d=\"M5 4 L1 8 L5 12 M11 4 L15 8 L11 12\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n } @else {\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path\n d=\"M4 5 L8 1 L12 5 M4 11 L8 15 L12 11\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n }\n </span>\n }\n </div>\n</div>\n" }]
130
130
  }], propDecorators: { position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }, { type: i0.Output, args: ["positionChange"] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], showHandle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showHandle", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], minPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "minPosition", required: false }] }], maxPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxPosition", required: false }] }] } });
@@ -145,10 +145,10 @@ class WrConfetti {
145
145
  this.rafId = null;
146
146
  }
147
147
  }
148
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrConfetti, deps: [], target: i0.ɵɵFactoryTarget.Service });
149
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.0.2", ngImport: i0, type: WrConfetti });
148
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: WrConfetti, deps: [], target: i0.ɵɵFactoryTarget.Service });
149
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.0.4", ngImport: i0, type: WrConfetti });
150
150
  }
151
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrConfetti, decorators: [{
151
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: WrConfetti, decorators: [{
152
152
  type: Service
153
153
  }] });
154
154
 
@@ -89,6 +89,20 @@ class WrContextMenuItem {
89
89
  constructor() {
90
90
  this.destroyRef.onDestroy(() => this.disposeSubmenu(true));
91
91
  }
92
+ /**
93
+ * @internal Pointer activation — selecting a leaf item dismisses the
94
+ * whole menu chain. The consumer's own `(click)` binding on the host
95
+ * runs in the same event; we defer the close to a microtask so that
96
+ * handler (the actual "select") always completes before the overlay
97
+ * tears down, regardless of listener registration order. Items that
98
+ * own a submenu (or are disabled) don't dismiss — clicking them just
99
+ * drills into / ignores the row.
100
+ */
101
+ onClick() {
102
+ if (this.disabled() || this.submenu())
103
+ return;
104
+ queueMicrotask(() => WrContextMenu.closeActive());
105
+ }
92
106
  /** @internal Keyboard activation — Enter / Space. */
93
107
  activate(event) {
94
108
  if (this.disabled())
@@ -300,10 +314,10 @@ class WrContextMenuItem {
300
314
  pane.classList.remove('wr-context-menu-overlay--open');
301
315
  setTimeout(() => ref.dispose(), SUBMENU_TRANSITION_MS);
302
316
  }
303
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrContextMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
304
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: WrContextMenuItem, isStandalone: true, selector: "wr-context-menu-item", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, submenu: { classPropertyName: "submenu", publicName: "submenu", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "menuitem" }, listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave($event)", "keydown.enter": "activate($event)", "keydown.space": "activate($event)", "keydown.arrowRight": "onArrowRight($event)", "keydown.arrowLeft": "onArrowLeft($event)" }, properties: { "class": "classes()", "attr.tabindex": "-1", "attr.aria-disabled": "disabled() ? true : null", "attr.aria-haspopup": "submenu() ? \"menu\" : null", "attr.aria-expanded": "submenu() ? (submenuOpen ? \"true\" : \"false\") : null" } }, ngImport: i0, template: "@if (icon(); as name) {\n <wr-icon class=\"wr-context-menu-item__icon\" [name]=\"name\" size=\"14\" />\n}\n<span class=\"wr-context-menu-item__label\"><ng-content /></span>\n@if (submenu()) {\n <svg\n class=\"wr-icon__svg wr-context-menu-item__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n}\n", dependencies: [{ kind: "component", type: WrIcon, selector: "wr-icon", inputs: ["name"] }], encapsulation: i0.ViewEncapsulation.None });
317
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: WrContextMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
318
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: WrContextMenuItem, isStandalone: true, selector: "wr-context-menu-item", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, submenu: { classPropertyName: "submenu", publicName: "submenu", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "menuitem" }, listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave($event)", "click": "onClick()", "keydown.enter": "activate($event)", "keydown.space": "activate($event)", "keydown.arrowRight": "onArrowRight($event)", "keydown.arrowLeft": "onArrowLeft($event)" }, properties: { "class": "classes()", "attr.tabindex": "-1", "attr.aria-disabled": "disabled() ? true : null", "attr.aria-haspopup": "submenu() ? \"menu\" : null", "attr.aria-expanded": "submenu() ? (submenuOpen ? \"true\" : \"false\") : null" } }, ngImport: i0, template: "@if (icon(); as name) {\n <wr-icon class=\"wr-context-menu-item__icon\" [name]=\"name\" size=\"14\" />\n}\n<span class=\"wr-context-menu-item__label\"><ng-content /></span>\n@if (submenu()) {\n <svg\n class=\"wr-icon__svg wr-context-menu-item__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n}\n", dependencies: [{ kind: "component", type: WrIcon, selector: "wr-icon", inputs: ["name"] }], encapsulation: i0.ViewEncapsulation.None });
305
319
  }
306
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrContextMenuItem, decorators: [{
320
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: WrContextMenuItem, decorators: [{
307
321
  type: Component,
308
322
  args: [{ selector: 'wr-context-menu-item', encapsulation: ViewEncapsulation.None, host: {
309
323
  role: 'menuitem',
@@ -314,6 +328,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
314
328
  '[attr.aria-expanded]': 'submenu() ? (submenuOpen ? "true" : "false") : null',
315
329
  '(mouseenter)': 'onMouseEnter()',
316
330
  '(mouseleave)': 'onMouseLeave($event)',
331
+ '(click)': 'onClick()',
317
332
  '(keydown.enter)': 'activate($event)',
318
333
  '(keydown.space)': 'activate($event)',
319
334
  '(keydown.arrowRight)': 'onArrowRight($event)',
@@ -329,9 +344,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
329
344
  */
330
345
  /**
331
346
  * Attach to any element to show a `<wr-context-menu>` at the pointer
332
- * position when the user right-clicks, long-presses on touch, or otherwise
333
- * sends a `contextmenu` event (Shift+F10, etc.). The native browser menu is
334
- * suppressed for the host element.
347
+ * position when the user right-clicks or otherwise sends a `contextmenu`
348
+ * event (Shift+F10, etc.). The native browser menu is suppressed for the
349
+ * host element.
335
350
  *
336
351
  * @example
337
352
  * ```html
@@ -373,6 +388,15 @@ class WrContextMenu {
373
388
  static scheduleChainClose() {
374
389
  WrContextMenu.activeRoot?.scheduleLeave();
375
390
  }
391
+ /**
392
+ * Called from a `<wr-context-menu-item>` click — selecting an item
393
+ * dismisses the whole chain (root + any open submenus). Items live in
394
+ * a detached overlay portal, so they reach their owning root through
395
+ * this static handle rather than DI.
396
+ */
397
+ static closeActive() {
398
+ WrContextMenu.activeRoot?.closeOverlay();
399
+ }
376
400
  /**
377
401
  * Open/close animation duration in ms. Matches the longest SCSS
378
402
  * transition on `.wr-context-menu-overlay` (the spring-scale curve).
@@ -388,30 +412,13 @@ class WrContextMenu {
388
412
  * on a deliberate hover-out.
389
413
  */
390
414
  static LEAVE_DELAY = 240;
391
- /** Hold duration (ms) before a stationary touch press opens the menu. */
392
- static LONG_PRESS_MS = 500;
393
- /** Movement (px) that reclassifies a press as a scroll and cancels it. */
394
- static LONG_PRESS_MOVE_TOLERANCE = 10;
395
- longPressTimer = null;
396
- touchStartX = 0;
397
- touchStartY = 0;
398
- longPressFired = false;
399
- suppressContextMenuUntil = 0;
400
415
  constructor() {
401
- this.destroyRef.onDestroy(() => {
402
- this.clearLongPress();
403
- this.closeOverlay();
404
- });
416
+ this.destroyRef.onDestroy(() => this.closeOverlay());
405
417
  }
406
418
  /** @internal Right-click handler — opens at the pointer (or re-positions if already open). */
407
419
  onContextMenu(event) {
408
420
  event.preventDefault();
409
421
  event.stopPropagation();
410
- // A touch long-press just opened the menu; ignore the synthetic
411
- // `contextmenu` some platforms (Android) fire at the same threshold so we
412
- // don't close-and-reopen with a flicker.
413
- if (performance.now() < this.suppressContextMenuUntil)
414
- return;
415
422
  // Re-open at the new position even if it was already open.
416
423
  // Use page coords (document-relative) so the menu anchors to the
417
424
  // zone it was opened over — scrolling the page carries the menu
@@ -419,57 +426,6 @@ class WrContextMenu {
419
426
  this.closeOverlay();
420
427
  this.openOverlay(event.pageX, event.pageY);
421
428
  }
422
- /**
423
- * @internal Touch long-press → open the menu. Native `contextmenu` is
424
- * unreliable on touch (iOS doesn't fire it, Android's timing varies), so we
425
- * detect the press ourselves: a stationary hold for `LONG_PRESS_MS` opens
426
- * the menu at the touch point; moving the finger reclassifies it as a
427
- * scroll and cancels.
428
- */
429
- onTouchStart(event) {
430
- const touch = event.touches[0];
431
- if (!touch)
432
- return;
433
- this.touchStartX = touch.pageX;
434
- this.touchStartY = touch.pageY;
435
- this.longPressFired = false;
436
- this.clearLongPress();
437
- this.longPressTimer = setTimeout(() => {
438
- this.longPressTimer = null;
439
- this.longPressFired = true;
440
- this.suppressContextMenuUntil = performance.now() + 700;
441
- this.closeOverlay();
442
- this.openOverlay(this.touchStartX, this.touchStartY);
443
- }, WrContextMenu.LONG_PRESS_MS);
444
- }
445
- /** @internal Cancel a pending long-press once the finger travels (a scroll). */
446
- onTouchMove(event) {
447
- if (this.longPressTimer === null)
448
- return;
449
- const touch = event.touches[0];
450
- if (!touch)
451
- return;
452
- const moved = Math.abs(touch.pageX - this.touchStartX) > WrContextMenu.LONG_PRESS_MOVE_TOLERANCE ||
453
- Math.abs(touch.pageY - this.touchStartY) > WrContextMenu.LONG_PRESS_MOVE_TOLERANCE;
454
- if (moved)
455
- this.clearLongPress();
456
- }
457
- /** @internal Release — drop a pending press; swallow the synthetic click a fired press would emit. */
458
- onTouchEnd(event) {
459
- this.clearLongPress();
460
- if (this.longPressFired) {
461
- this.longPressFired = false;
462
- // Stop the browser turning this long-press into a synthetic click that
463
- // would land outside the freshly-opened menu and dismiss it.
464
- event.preventDefault();
465
- }
466
- }
467
- clearLongPress() {
468
- if (this.longPressTimer !== null) {
469
- clearTimeout(this.longPressTimer);
470
- this.longPressTimer = null;
471
- }
472
- }
473
429
  /** Close the menu. */
474
430
  close() {
475
431
  this.closeOverlay();
@@ -624,19 +580,15 @@ class WrContextMenu {
624
580
  this.closeOverlay();
625
581
  }, WrContextMenu.LEAVE_DELAY);
626
582
  }
627
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrContextMenu, deps: [], target: i0.ɵɵFactoryTarget.Directive });
628
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: WrContextMenu, isStandalone: true, selector: "[wrContextMenu]", inputs: { menu: { classPropertyName: "menu", publicName: "wrContextMenu", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "contextmenu": "onContextMenu($event)", "touchstart": "onTouchStart($event)", "touchmove": "onTouchMove($event)", "touchend": "onTouchEnd($event)", "touchcancel": "onTouchEnd($event)" } }, ngImport: i0 });
583
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: WrContextMenu, deps: [], target: i0.ɵɵFactoryTarget.Directive });
584
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.4", type: WrContextMenu, isStandalone: true, selector: "[wrContextMenu]", inputs: { menu: { classPropertyName: "menu", publicName: "wrContextMenu", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "contextmenu": "onContextMenu($event)" } }, ngImport: i0 });
629
585
  }
630
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrContextMenu, decorators: [{
586
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: WrContextMenu, decorators: [{
631
587
  type: Directive,
632
588
  args: [{
633
589
  selector: '[wrContextMenu]',
634
590
  host: {
635
591
  '(contextmenu)': 'onContextMenu($event)',
636
- '(touchstart)': 'onTouchStart($event)',
637
- '(touchmove)': 'onTouchMove($event)',
638
- '(touchend)': 'onTouchEnd($event)',
639
- '(touchcancel)': 'onTouchEnd($event)',
640
592
  },
641
593
  }]
642
594
  }], ctorParameters: () => [], propDecorators: { menu: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrContextMenu", required: true }] }] } });
@@ -664,10 +616,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
664
616
  class WrContextMenuPanel {
665
617
  /** The internal template the directive portals into the overlay. @internal */
666
618
  contentTpl = viewChild.required(TemplateRef);
667
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrContextMenuPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
668
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.2", type: WrContextMenuPanel, isStandalone: true, selector: "wr-context-menu", host: { styleAttribute: "display:none" }, viewQueries: [{ propertyName: "contentTpl", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], exportAs: ["wrContextMenu"], ngImport: i0, template: '<ng-template><div class="wr-context-menu" role="menu"><ng-content /></div></ng-template>', isInline: true, encapsulation: i0.ViewEncapsulation.None });
619
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: WrContextMenuPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
620
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.4", type: WrContextMenuPanel, isStandalone: true, selector: "wr-context-menu", host: { styleAttribute: "display:none" }, viewQueries: [{ propertyName: "contentTpl", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], exportAs: ["wrContextMenu"], ngImport: i0, template: '<ng-template><div class="wr-context-menu" role="menu"><ng-content /></div></ng-template>', isInline: true, encapsulation: i0.ViewEncapsulation.None });
669
621
  }
670
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrContextMenuPanel, decorators: [{
622
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: WrContextMenuPanel, decorators: [{
671
623
  type: Component,
672
624
  args: [{
673
625
  selector: 'wr-context-menu',
@@ -700,10 +652,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
700
652
  * ```
701
653
  */
702
654
  class WrContextMenuDivider {
703
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrContextMenuDivider, deps: [], target: i0.ɵɵFactoryTarget.Component });
704
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.2", type: WrContextMenuDivider, isStandalone: true, selector: "wr-context-menu-divider", host: { attributes: { "role": "separator", "aria-orientation": "horizontal" }, classAttribute: "wr-context-menu-divider" }, ngImport: i0, template: '', isInline: true, encapsulation: i0.ViewEncapsulation.None });
655
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: WrContextMenuDivider, deps: [], target: i0.ɵɵFactoryTarget.Component });
656
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.4", type: WrContextMenuDivider, isStandalone: true, selector: "wr-context-menu-divider", host: { attributes: { "role": "separator", "aria-orientation": "horizontal" }, classAttribute: "wr-context-menu-divider" }, ngImport: i0, template: '', isInline: true, encapsulation: i0.ViewEncapsulation.None });
705
657
  }
706
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: WrContextMenuDivider, decorators: [{
658
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: WrContextMenuDivider, decorators: [{
707
659
  type: Component,
708
660
  args: [{
709
661
  selector: 'wr-context-menu-divider',