@ds-mo/ui 14.34.0 → 14.36.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 (397) hide show
  1. package/dist/.package-ready.json +1 -1
  2. package/dist/agent-patterns.json +1 -1
  3. package/dist/agent.json +1423 -218
  4. package/dist/angular/ds-button-inverted.d.ts +17 -0
  5. package/dist/angular/ds-button-inverted.js +46 -0
  6. package/dist/angular/ds-calendar.d.ts +15 -0
  7. package/dist/angular/ds-calendar.js +43 -0
  8. package/dist/angular/ds-field.d.ts +1 -1
  9. package/dist/angular/ds-field.js +1 -1
  10. package/dist/angular/ds-filter-menu.d.ts +1 -1
  11. package/dist/angular/ds-filter-menu.js +3 -3
  12. package/dist/angular/ds-input-date.d.ts +15 -0
  13. package/dist/angular/ds-input-date.js +43 -0
  14. package/dist/angular/ds-input-time.d.ts +15 -0
  15. package/dist/angular/ds-input-time.js +43 -0
  16. package/dist/angular/ds-input.d.ts +1 -1
  17. package/dist/angular/ds-input.js +3 -3
  18. package/dist/angular/ds-menu.d.ts +1 -1
  19. package/dist/angular/ds-menu.js +3 -3
  20. package/dist/angular/ds-select.d.ts +1 -1
  21. package/dist/angular/ds-select.js +3 -3
  22. package/dist/angular/ds-tab-group.d.ts +1 -1
  23. package/dist/angular/ds-tab-group.js +3 -3
  24. package/dist/angular/ds-table-filter.d.ts +1 -1
  25. package/dist/angular/ds-table-filter.js +3 -3
  26. package/dist/angular/ds-table-group.d.ts +1 -1
  27. package/dist/angular/ds-table-group.js +3 -3
  28. package/dist/angular/ds-table-preferences.d.ts +39 -0
  29. package/dist/angular/ds-table-preferences.js +69 -0
  30. package/dist/angular/ds-table-saved-views.d.ts +1 -1
  31. package/dist/angular/ds-table-saved-views.js +3 -3
  32. package/dist/angular/ds-table-search.d.ts +1 -1
  33. package/dist/angular/ds-table-search.js +3 -3
  34. package/dist/angular/ds-table-sort.d.ts +1 -1
  35. package/dist/angular/ds-table-sort.js +3 -3
  36. package/dist/angular/ds-table-toolbar.d.ts +1 -1
  37. package/dist/angular/ds-table-toolbar.js +3 -3
  38. package/dist/angular/ds-table.d.ts +3 -1
  39. package/dist/angular/ds-table.js +8 -5
  40. package/dist/angular/ds-time-picker.d.ts +15 -0
  41. package/dist/angular/ds-time-picker.js +43 -0
  42. package/dist/angular/index.d.ts +1 -1
  43. package/dist/angular/index.js +6 -0
  44. package/dist/angular/proxies.d.ts +6 -0
  45. package/dist/angular/proxies.js +6 -0
  46. package/dist/angular/text-value-accessor.d.ts +1 -1
  47. package/dist/angular/text-value-accessor.js +2 -2
  48. package/dist/components/ds-agent-activity.js +1 -1
  49. package/dist/components/ds-agent-questionnaire.js +1 -1
  50. package/dist/components/ds-agent-response.js +1 -1
  51. package/dist/components/ds-agent-source-list.js +1 -1
  52. package/dist/components/ds-agent-tool-call.js +1 -1
  53. package/dist/components/ds-attachment-list.js +1 -1
  54. package/dist/components/ds-badge.js +1 -1
  55. package/dist/components/ds-banner.js +1 -1
  56. package/dist/components/ds-bar-action.js +1 -1
  57. package/dist/components/ds-bar-nav.js +1 -1
  58. package/dist/components/ds-bar-page-title.js +1 -1
  59. package/dist/components/ds-bar-title.js +1 -1
  60. package/dist/components/ds-bar-workflow.js +1 -1
  61. package/dist/components/ds-breadcrumb.js +1 -1
  62. package/dist/components/ds-button-filled.js +1 -1
  63. package/dist/components/ds-button-inverted.d.ts +11 -0
  64. package/dist/components/ds-button-inverted.js +2 -0
  65. package/dist/components/ds-button-inverted.js.map +1 -0
  66. package/dist/components/ds-button-unfilled.js +1 -1
  67. package/dist/components/ds-calendar.d.ts +11 -0
  68. package/dist/components/ds-calendar.js +2 -0
  69. package/dist/components/ds-calendar.js.map +1 -0
  70. package/dist/components/ds-card-action-center.js +1 -1
  71. package/dist/components/ds-card-chart.js +1 -1
  72. package/dist/components/ds-card-navigation.js +1 -1
  73. package/dist/components/ds-card-navigation.js.map +1 -1
  74. package/dist/components/ds-card-overview.js +1 -1
  75. package/dist/components/ds-card-setting.js +1 -1
  76. package/dist/components/ds-card-settings-scope.js +1 -1
  77. package/dist/components/ds-card-settings-scope.js.map +1 -1
  78. package/dist/components/ds-chart-legend.js +1 -1
  79. package/dist/components/ds-chart.js +1 -1
  80. package/dist/components/ds-checkbox.js +1 -1
  81. package/dist/components/ds-chip.js +1 -1
  82. package/dist/components/ds-code-block.js +1 -1
  83. package/dist/components/ds-conversation-list-item.js +1 -1
  84. package/dist/components/ds-conversation-list-item.js.map +1 -1
  85. package/dist/components/ds-conversation-list-section.js +1 -1
  86. package/dist/components/ds-conversation-list.js +1 -1
  87. package/dist/components/ds-divider.js +1 -1
  88. package/dist/components/ds-empty-state.js +1 -1
  89. package/dist/components/ds-field.js +1 -1
  90. package/dist/components/ds-filter-menu.js +1 -1
  91. package/dist/components/ds-input-date.d.ts +11 -0
  92. package/dist/components/ds-input-date.js +2 -0
  93. package/dist/components/ds-input-date.js.map +1 -0
  94. package/dist/components/ds-input-time.d.ts +11 -0
  95. package/dist/components/ds-input-time.js +2 -0
  96. package/dist/components/ds-input-time.js.map +1 -0
  97. package/dist/components/ds-input.js +1 -1
  98. package/dist/components/ds-markdown.js +1 -1
  99. package/dist/components/ds-menu.js +1 -1
  100. package/dist/components/ds-message-actions.js +1 -1
  101. package/dist/components/ds-message-bubble.js +1 -1
  102. package/dist/components/ds-message-composer.js +1 -1
  103. package/dist/components/ds-message-scroller.js +1 -1
  104. package/dist/components/ds-message.js +1 -1
  105. package/dist/components/ds-mobile-bar-nav.js +1 -1
  106. package/dist/components/ds-mobile-header.js +1 -1
  107. package/dist/components/ds-mobile-section-switcher.js +1 -1
  108. package/dist/components/ds-mobile-sheet-nav.js +1 -1
  109. package/dist/components/ds-modal.js +1 -1
  110. package/dist/components/ds-pagination.js +1 -1
  111. package/dist/components/ds-panel-nav.js +1 -1
  112. package/dist/components/ds-panel-sub-nav.js +1 -1
  113. package/dist/components/ds-panel-tool-header.js +1 -1
  114. package/dist/components/ds-panel-tool-search.js +1 -1
  115. package/dist/components/ds-panel-tools.js +1 -1
  116. package/dist/components/ds-paper-texture.js +1 -1
  117. package/dist/components/ds-radio.js +1 -1
  118. package/dist/components/ds-score.js +1 -1
  119. package/dist/components/ds-scroll-overlay.js +1 -1
  120. package/dist/components/ds-select.js +1 -1
  121. package/dist/components/ds-shell-app.js +1 -1
  122. package/dist/components/ds-shell-app.js.map +1 -1
  123. package/dist/components/ds-shell-page.js +1 -1
  124. package/dist/components/ds-shell-tools.js +1 -1
  125. package/dist/components/ds-skeleton.js +1 -1
  126. package/dist/components/ds-slider.js +1 -1
  127. package/dist/components/ds-slider.js.map +1 -1
  128. package/dist/components/ds-swatch-picker.js +1 -1
  129. package/dist/components/ds-switch.js +1 -1
  130. package/dist/components/ds-tab-group.js +1 -1
  131. package/dist/components/ds-table-filter.js +1 -1
  132. package/dist/components/ds-table-filter.js.map +1 -1
  133. package/dist/components/ds-table-group.js +1 -1
  134. package/dist/components/ds-table-group.js.map +1 -1
  135. package/dist/components/ds-table-preferences.d.ts +11 -0
  136. package/dist/components/ds-table-preferences.js +2 -0
  137. package/dist/components/ds-table-preferences.js.map +1 -0
  138. package/dist/components/ds-table-saved-views.js +1 -1
  139. package/dist/components/ds-table-saved-views.js.map +1 -1
  140. package/dist/components/ds-table-search.js +1 -1
  141. package/dist/components/ds-table-search.js.map +1 -1
  142. package/dist/components/ds-table-sort.js +1 -1
  143. package/dist/components/ds-table-sort.js.map +1 -1
  144. package/dist/components/ds-table-toolbar.js +1 -1
  145. package/dist/components/ds-table-toolbar.js.map +1 -1
  146. package/dist/components/ds-table.js +1 -1
  147. package/dist/components/ds-table.js.map +1 -1
  148. package/dist/components/ds-tag.js +1 -1
  149. package/dist/components/ds-text.js +1 -1
  150. package/dist/components/ds-textarea.js +1 -1
  151. package/dist/components/ds-textarea.js.map +1 -1
  152. package/dist/components/ds-time-picker.d.ts +11 -0
  153. package/dist/components/ds-time-picker.js +2 -0
  154. package/dist/components/ds-time-picker.js.map +1 -0
  155. package/dist/components/ds-toast.js +1 -1
  156. package/dist/components/ds-tooltip-chart.js +1 -1
  157. package/dist/components/ds-tooltip.js +1 -1
  158. package/dist/components/ds-typing-indicator.js +1 -1
  159. package/dist/components/{p-B5QVra1K.js → p-2GVGhrh0.js} +2 -2
  160. package/dist/components/p-7O-2D29W.js +2 -0
  161. package/dist/components/p-7O-2D29W.js.map +1 -0
  162. package/dist/components/{p-BqGdNrVl.js → p-8oRkhvjy.js} +2 -2
  163. package/dist/components/p-B27_chI7.js +2 -0
  164. package/dist/components/p-B27_chI7.js.map +1 -0
  165. package/dist/components/{p-ya8A_SMw.js → p-BOhpMUwO.js} +2 -2
  166. package/dist/components/{p-ya8A_SMw.js.map → p-BOhpMUwO.js.map} +1 -1
  167. package/dist/components/{p-CqeMumqy.js → p-BV5T1hzN.js} +2 -2
  168. package/dist/components/{p-CIoeHcCk.js → p-BWfzaSc3.js} +2 -2
  169. package/dist/components/{p-AkSwrAKR.js → p-BgLI9JoT.js} +2 -2
  170. package/dist/components/{p-BwsS_Hyr.js → p-C-dHtQMi.js} +2 -2
  171. package/dist/components/p-C0CE2v5D.js +2 -0
  172. package/dist/components/{p-CHBuzAYH.js.map → p-C0CE2v5D.js.map} +1 -1
  173. package/dist/components/{p-CoE7yza3.js → p-C2JnoaWI.js} +2 -2
  174. package/dist/components/{p-lv4YQEsa.js → p-C4m8y9ki.js} +2 -2
  175. package/dist/components/{p-BEttT0UB.js → p-CDJ2Ntcq.js} +2 -2
  176. package/dist/components/p-CKarsuR2.js +2 -0
  177. package/dist/components/p-CKarsuR2.js.map +1 -0
  178. package/dist/components/{p-Dj296RmE.js → p-CMQUuGvl.js} +2 -2
  179. package/dist/components/{p-DyyfWSLB.js → p-CQ5RwY2C.js} +2 -2
  180. package/dist/components/p-CQIh2yRP.js +2 -0
  181. package/dist/components/p-CQIh2yRP.js.map +1 -0
  182. package/dist/components/{p-CQqZgTYk.js → p-CWPT3aOB.js} +2 -2
  183. package/dist/components/p-CWog26I_.js +2 -0
  184. package/dist/components/p-CWog26I_.js.map +1 -0
  185. package/dist/components/{p-LZ8F08Fj.js → p-CaNCGKEJ.js} +2 -2
  186. package/dist/components/p-CaNCGKEJ.js.map +1 -0
  187. package/dist/components/p-CbSUyv5B.js +2 -0
  188. package/dist/components/{p-CnK36Be0.js.map → p-CbSUyv5B.js.map} +1 -1
  189. package/dist/components/{p-Dhw_W8nk.js → p-Cc3ZUQlJ.js} +2 -2
  190. package/dist/components/p-Cc3ZUQlJ.js.map +1 -0
  191. package/dist/components/{p-OxdAzO4v.js → p-Ce4zy8q1.js} +2 -2
  192. package/dist/components/p-CeXf9-X3.js +2 -0
  193. package/dist/components/p-CeXf9-X3.js.map +1 -0
  194. package/dist/components/{p-CNDTHTf6.js → p-Cga6Ex0E.js} +2 -2
  195. package/dist/components/{p-CBQzTgvI.js → p-Cl9phSf0.js} +2 -2
  196. package/dist/components/{p-DzbEJN1A.js → p-ClJhuG5Y.js} +2 -2
  197. package/dist/components/{p-D_QtZZR8.js → p-CqW2eyiF.js} +2 -2
  198. package/dist/components/{p-CHUdAW1Q.js → p-Cus1Sigh.js} +2 -2
  199. package/dist/components/{p-CzbsTZt7.js → p-Cxr0IQjC.js} +2 -2
  200. package/dist/components/p-D7yBIPB6.js +2 -0
  201. package/dist/components/{p-DEyvEIYL.js.map → p-D7yBIPB6.js.map} +1 -1
  202. package/dist/components/p-D8rpKod8.js +2 -0
  203. package/dist/components/p-D8rpKod8.js.map +1 -0
  204. package/dist/components/{p-Da9VpZX2.js → p-DBwa1OXP.js} +2 -2
  205. package/dist/components/{p-Br0dx2uP.js → p-DK9Ex3aY.js} +2 -2
  206. package/dist/components/{p-CweS0FfJ.js → p-DLXXGgmf.js} +2 -2
  207. package/dist/components/{p-CvplapTD.js → p-DVd1TIxi.js} +2 -2
  208. package/dist/components/p-DZ58Sg5a.js.map +1 -1
  209. package/dist/components/{p-Dx7WcWW1.js → p-DgG9W9N4.js} +2 -2
  210. package/dist/components/{p-4DNyCYKM.js → p-DkfM55x8.js} +2 -2
  211. package/dist/components/p-DkikNSSO.js +2 -0
  212. package/dist/components/p-DkikNSSO.js.map +1 -0
  213. package/dist/components/{p-DjCnGxSd.js → p-Dryt3COt.js} +2 -2
  214. package/dist/components/{p-eo_pmPqp.js → p-Ds51RgCi.js} +2 -2
  215. package/dist/components/p-DtkLtKY0.js +2 -0
  216. package/dist/components/p-DtkLtKY0.js.map +1 -0
  217. package/dist/components/{p-DBZwI7HY.js → p-DvzI2A_M.js} +2 -2
  218. package/dist/components/p-J5x-QtlD.js +2 -0
  219. package/dist/components/{p-CIYJhyKt.js.map → p-J5x-QtlD.js.map} +1 -1
  220. package/dist/components/{p-C51ytXM6.js → p-Jaqdfw4E.js} +2 -2
  221. package/dist/components/{p-BMERUCe1.js → p-KBrC9IG4.js} +2 -2
  222. package/dist/components/p-MQ36mEgn.js +2 -0
  223. package/dist/components/p-MQ36mEgn.js.map +1 -0
  224. package/dist/components/{p-CXAa9TUM.js → p-PmcUwTQ_.js} +2 -2
  225. package/dist/components/p-TjXGRPik.js +2 -0
  226. package/dist/components/{p-ByoywoBH.js.map → p-TjXGRPik.js.map} +1 -1
  227. package/dist/components/{p-zZuAAiiI.js → p-bM3LH3kc.js} +2 -2
  228. package/dist/components/{p-CK2S28gU.js → p-ji09W9el.js} +2 -2
  229. package/dist/components/{p-DrjY8Mpy.js → p-neWTRxmf.js} +2 -2
  230. package/dist/components/{p-CMq-jKEI.js → p-rYePOPbJ.js} +2 -2
  231. package/dist/components/{p-C1QHxVvP.js → p-su6y4hLK.js} +2 -2
  232. package/dist/components/p-su6y4hLK.js.map +1 -0
  233. package/dist/components/{p-CKo2nySr.js → p-tNQ0YulU.js} +2 -2
  234. package/dist/components/{p-C8XJgV1n.js → p-x1wf38q3.js} +2 -2
  235. package/dist/docs/components.json +17368 -12812
  236. package/dist/lib/components/ShellApp/shell-app-types.d.ts +3 -1
  237. package/dist/lib/utils/button-render.d.ts +1 -1
  238. package/dist/lib/utils/clock-time.d.ts +22 -0
  239. package/dist/lib/utils/date-filter-value.d.ts +4 -0
  240. package/dist/lib/utils/index.d.ts +3 -1
  241. package/dist/lib/utils/index.js +133 -0
  242. package/dist/lib/utils/index.js.map +4 -4
  243. package/dist/mcp-data/registry/bar-title.json +2 -2
  244. package/dist/mcp-data/registry/button-inverted.json +580 -0
  245. package/dist/mcp-data/registry/calendar.json +273 -0
  246. package/dist/mcp-data/registry/card-navigation.json +4 -2
  247. package/dist/mcp-data/registry/field.json +19 -14
  248. package/dist/mcp-data/registry/filter-menu.json +106 -23
  249. package/dist/mcp-data/registry/input-date.json +516 -0
  250. package/dist/mcp-data/registry/input-time.json +535 -0
  251. package/dist/mcp-data/registry/input.json +56 -8
  252. package/dist/mcp-data/registry/menu.json +22 -3
  253. package/dist/mcp-data/registry/registry.json +1434 -211
  254. package/dist/mcp-data/registry/select.json +105 -14
  255. package/dist/mcp-data/registry/shell-app.json +4 -3
  256. package/dist/mcp-data/registry/tab-group.json +20 -3
  257. package/dist/mcp-data/registry/table-filter.json +26 -6
  258. package/dist/mcp-data/registry/table-group.json +59 -7
  259. package/dist/mcp-data/registry/table-preferences.json +511 -0
  260. package/dist/mcp-data/registry/table-saved-views.json +50 -10
  261. package/dist/mcp-data/registry/table-search.json +24 -6
  262. package/dist/mcp-data/registry/table-sort.json +22 -4
  263. package/dist/mcp-data/registry/table-toolbar.json +26 -6
  264. package/dist/mcp-data/registry/table.json +70 -4
  265. package/dist/mcp-data/registry/textarea.json +2 -2
  266. package/dist/mcp-data/registry/time-picker.json +259 -0
  267. package/dist/react/components.d.ts +6 -0
  268. package/dist/react/components.js +6 -0
  269. package/dist/react/ds-button-inverted.d.ts +13 -0
  270. package/dist/react/ds-button-inverted.js +15 -0
  271. package/dist/react/ds-calendar.d.ts +12 -0
  272. package/dist/react/ds-calendar.js +12 -0
  273. package/dist/react/ds-field.d.ts +1 -1
  274. package/dist/react/ds-input-date.d.ts +12 -0
  275. package/dist/react/ds-input-date.js +12 -0
  276. package/dist/react/ds-input-time.d.ts +12 -0
  277. package/dist/react/ds-input-time.js +12 -0
  278. package/dist/react/ds-table-preferences.d.ts +21 -0
  279. package/dist/react/ds-table-preferences.js +23 -0
  280. package/dist/react/ds-table.d.ts +1 -0
  281. package/dist/react/ds-table.js +1 -0
  282. package/dist/react/ds-time-picker.d.ts +12 -0
  283. package/dist/react/ds-time-picker.js +12 -0
  284. package/dist/types/components/BarTitle/BarTitle.d.ts +1 -0
  285. package/dist/types/components/BarTitle/bar-title-action-chrome.d.ts +2 -0
  286. package/dist/types/components/ButtonInverted/ButtonInverted.d.ts +83 -0
  287. package/dist/types/components/ButtonInverted/index.d.ts +2 -0
  288. package/dist/types/components/Calendar/Calendar.d.ts +32 -0
  289. package/dist/types/components/Calendar/calendar-grid.d.ts +19 -0
  290. package/dist/types/components/Field/Field.d.ts +7 -2
  291. package/dist/types/components/FilterMenu/FilterMenu.d.ts +16 -10
  292. package/dist/types/components/Input/Input.d.ts +10 -0
  293. package/dist/types/components/InputDate/InputDate.d.ts +78 -0
  294. package/dist/types/components/InputTime/InputTime.d.ts +80 -0
  295. package/dist/types/components/Menu/Menu.d.ts +2 -0
  296. package/dist/types/components/Select/Select.d.ts +13 -2
  297. package/dist/types/components/ShellApp/shell-app-types.d.ts +3 -1
  298. package/dist/types/components/TabGroup/TabGroup.d.ts +1 -0
  299. package/dist/types/components/Table/Table.d.ts +8 -0
  300. package/dist/types/components/TableFilter/TableFilter.d.ts +2 -0
  301. package/dist/types/components/TableGroup/TableGroup.d.ts +5 -0
  302. package/dist/types/components/TablePreferences/TablePreferences.d.ts +56 -0
  303. package/dist/types/components/TableSavedViews/TableSavedViews.d.ts +4 -0
  304. package/dist/types/components/TableSearch/TableSearch.d.ts +2 -0
  305. package/dist/types/components/TableSort/TableSort.d.ts +2 -0
  306. package/dist/types/components/TableToolbar/TableToolbar.d.ts +2 -0
  307. package/dist/types/components/TimePicker/TimePicker.d.ts +33 -0
  308. package/dist/types/components.d.ts +1299 -66
  309. package/dist/types/utils/button-render.d.ts +1 -1
  310. package/dist/types/utils/clock-time.d.ts +23 -0
  311. package/dist/types/utils/date-filter-value.d.ts +4 -0
  312. package/dist/types/utils/index.d.ts +3 -1
  313. package/dist/vue/components.d.ts +6 -0
  314. package/dist/vue/components.js +6 -0
  315. package/dist/vue/ds-button-inverted.d.ts +3 -0
  316. package/dist/vue/ds-button-inverted.js +33 -0
  317. package/dist/vue/ds-calendar.d.ts +3 -0
  318. package/dist/vue/ds-calendar.js +16 -0
  319. package/dist/vue/ds-filter-menu.js +5 -0
  320. package/dist/vue/ds-input-date.d.ts +3 -0
  321. package/dist/vue/ds-input-date.js +31 -0
  322. package/dist/vue/ds-input-time.d.ts +3 -0
  323. package/dist/vue/ds-input-time.js +32 -0
  324. package/dist/vue/ds-input.js +2 -0
  325. package/dist/vue/ds-menu.js +1 -0
  326. package/dist/vue/ds-select.js +5 -0
  327. package/dist/vue/ds-tab-group.js +1 -0
  328. package/dist/vue/ds-table-filter.js +1 -0
  329. package/dist/vue/ds-table-group.js +3 -0
  330. package/dist/vue/ds-table-preferences.d.ts +3 -0
  331. package/dist/vue/ds-table-preferences.js +45 -0
  332. package/dist/vue/ds-table-saved-views.js +2 -0
  333. package/dist/vue/ds-table-search.js +1 -0
  334. package/dist/vue/ds-table-sort.js +1 -0
  335. package/dist/vue/ds-table-toolbar.js +2 -1
  336. package/dist/vue/ds-table.js +5 -0
  337. package/dist/vue/ds-time-picker.d.ts +3 -0
  338. package/dist/vue/ds-time-picker.js +16 -0
  339. package/package.json +1 -1
  340. package/dist/components/p-B_nPct4G.js +0 -2
  341. package/dist/components/p-B_nPct4G.js.map +0 -1
  342. package/dist/components/p-BlWNMytv.js +0 -2
  343. package/dist/components/p-BlWNMytv.js.map +0 -1
  344. package/dist/components/p-ByoywoBH.js +0 -2
  345. package/dist/components/p-C1QHxVvP.js.map +0 -1
  346. package/dist/components/p-CHBuzAYH.js +0 -2
  347. package/dist/components/p-CIYJhyKt.js +0 -2
  348. package/dist/components/p-CUL5_8JM.js +0 -2
  349. package/dist/components/p-CUL5_8JM.js.map +0 -1
  350. package/dist/components/p-CnK36Be0.js +0 -2
  351. package/dist/components/p-Cw_npFwN.js +0 -2
  352. package/dist/components/p-Cw_npFwN.js.map +0 -1
  353. package/dist/components/p-DEyvEIYL.js +0 -2
  354. package/dist/components/p-DVWOUQfT.js +0 -2
  355. package/dist/components/p-DVWOUQfT.js.map +0 -1
  356. package/dist/components/p-Dhw_W8nk.js.map +0 -1
  357. package/dist/components/p-LZ8F08Fj.js.map +0 -1
  358. package/dist/components/p-xxuHxP3u.js +0 -2
  359. package/dist/components/p-xxuHxP3u.js.map +0 -1
  360. package/dist/types/components/FilterMenu/filter-menu-calendar.d.ts +0 -13
  361. /package/dist/components/{p-B5QVra1K.js.map → p-2GVGhrh0.js.map} +0 -0
  362. /package/dist/components/{p-BqGdNrVl.js.map → p-8oRkhvjy.js.map} +0 -0
  363. /package/dist/components/{p-CqeMumqy.js.map → p-BV5T1hzN.js.map} +0 -0
  364. /package/dist/components/{p-CIoeHcCk.js.map → p-BWfzaSc3.js.map} +0 -0
  365. /package/dist/components/{p-AkSwrAKR.js.map → p-BgLI9JoT.js.map} +0 -0
  366. /package/dist/components/{p-BwsS_Hyr.js.map → p-C-dHtQMi.js.map} +0 -0
  367. /package/dist/components/{p-CoE7yza3.js.map → p-C2JnoaWI.js.map} +0 -0
  368. /package/dist/components/{p-lv4YQEsa.js.map → p-C4m8y9ki.js.map} +0 -0
  369. /package/dist/components/{p-BEttT0UB.js.map → p-CDJ2Ntcq.js.map} +0 -0
  370. /package/dist/components/{p-Dj296RmE.js.map → p-CMQUuGvl.js.map} +0 -0
  371. /package/dist/components/{p-DyyfWSLB.js.map → p-CQ5RwY2C.js.map} +0 -0
  372. /package/dist/components/{p-CQqZgTYk.js.map → p-CWPT3aOB.js.map} +0 -0
  373. /package/dist/components/{p-OxdAzO4v.js.map → p-Ce4zy8q1.js.map} +0 -0
  374. /package/dist/components/{p-CNDTHTf6.js.map → p-Cga6Ex0E.js.map} +0 -0
  375. /package/dist/components/{p-CBQzTgvI.js.map → p-Cl9phSf0.js.map} +0 -0
  376. /package/dist/components/{p-DzbEJN1A.js.map → p-ClJhuG5Y.js.map} +0 -0
  377. /package/dist/components/{p-D_QtZZR8.js.map → p-CqW2eyiF.js.map} +0 -0
  378. /package/dist/components/{p-CHUdAW1Q.js.map → p-Cus1Sigh.js.map} +0 -0
  379. /package/dist/components/{p-CzbsTZt7.js.map → p-Cxr0IQjC.js.map} +0 -0
  380. /package/dist/components/{p-Da9VpZX2.js.map → p-DBwa1OXP.js.map} +0 -0
  381. /package/dist/components/{p-Br0dx2uP.js.map → p-DK9Ex3aY.js.map} +0 -0
  382. /package/dist/components/{p-CweS0FfJ.js.map → p-DLXXGgmf.js.map} +0 -0
  383. /package/dist/components/{p-CvplapTD.js.map → p-DVd1TIxi.js.map} +0 -0
  384. /package/dist/components/{p-Dx7WcWW1.js.map → p-DgG9W9N4.js.map} +0 -0
  385. /package/dist/components/{p-4DNyCYKM.js.map → p-DkfM55x8.js.map} +0 -0
  386. /package/dist/components/{p-DjCnGxSd.js.map → p-Dryt3COt.js.map} +0 -0
  387. /package/dist/components/{p-eo_pmPqp.js.map → p-Ds51RgCi.js.map} +0 -0
  388. /package/dist/components/{p-DBZwI7HY.js.map → p-DvzI2A_M.js.map} +0 -0
  389. /package/dist/components/{p-C51ytXM6.js.map → p-Jaqdfw4E.js.map} +0 -0
  390. /package/dist/components/{p-BMERUCe1.js.map → p-KBrC9IG4.js.map} +0 -0
  391. /package/dist/components/{p-CXAa9TUM.js.map → p-PmcUwTQ_.js.map} +0 -0
  392. /package/dist/components/{p-zZuAAiiI.js.map → p-bM3LH3kc.js.map} +0 -0
  393. /package/dist/components/{p-CK2S28gU.js.map → p-ji09W9el.js.map} +0 -0
  394. /package/dist/components/{p-DrjY8Mpy.js.map → p-neWTRxmf.js.map} +0 -0
  395. /package/dist/components/{p-CMq-jKEI.js.map → p-rYePOPbJ.js.map} +0 -0
  396. /package/dist/components/{p-CKo2nySr.js.map → p-tNQ0YulU.js.map} +0 -0
  397. /package/dist/components/{p-C8XJgV1n.js.map → p-x1wf38q3.js.map} +0 -0
@@ -38,14 +38,15 @@
38
38
  "commonlyComposedWith": [
39
39
  "component:ds-select",
40
40
  "component:ds-table",
41
- "component:ds-checkbox"
41
+ "component:ds-checkbox",
42
+ "component:ds-calendar"
42
43
  ],
43
44
  "accessibility": [
44
45
  "The built-in select trigger exposes combobox semantics with a dialog popup, synchronizes expanded state, holds the pressed interaction wash without changing resting foreground while open, and restores focus after dismissal.",
45
46
  "The category pane is a vertical tab list. Arrow Up and Arrow Down wrap, Home and End jump, Arrow Right enters the option pane, and Arrow Left returns to the active category.",
46
47
  "Every non-date category begins with a labelled search field. Arrow Down and Arrow Up enter the first or last visible option, while Left and Right retain native text-caret behavior. Search matches option labels and descriptions without changing selected values.",
47
48
  "Escape and outside activation close the popup and restore trigger focus. Tab moves through option controls and closes only when it leaves the popup boundary.",
48
- "Date filters expose containerless Range and Relative tabs in a secondary-background header with 4px padding around the 32px medium control. Relative presets use listbox semantics; the range calendar exposes a labelled grid, one tab stop, arrow-key day navigation, Home and End week navigation, and Page Up or Page Down month navigation. After a range start is chosen, pointer hover and keyboard focus preview the possible inclusive range without changing selection semantics.",
49
+ "Date filters expose containerless Range and Relative tabs in a secondary-background header with 4px padding around the 32px medium control. Relative presets use listbox semantics. Range selection hosts Calendar, which owns the labelled month grid, one tab stop, arrow-key day navigation, Home and End week navigation, and Page Up or Page Down month navigation. After a range start is chosen, pointer hover and keyboard focus preview the possible inclusive range without changing selection semantics.",
49
50
  "When an external trigger is inside an open shadow tree, pass its HTMLElement through anchor so outside activation, focus return, and Tab continuation use the composed tree.",
50
51
  "The trigger count reports active filter categories. Multiple-choice category tags report individual selected criteria, while an applied Date category uses a visual dot because its value is singular. The default summary footer announces the total; the categories-clear footer recipe reserves a visually empty category-pane action row and exposes its divider and only Clear when criteria are active."
51
52
  ],
@@ -60,7 +61,10 @@
60
61
  "Selection applies immediately and does not close the popup.",
61
62
  "Changing category replaces the option-pane subtree so checkbox and other option visuals mount in their new state instead of transitioning from the previous category's row state.",
62
63
  "The trigger reports how many filter categories have selections. footerLayout=summary adds a full-width selected-count footer only while values are selected; footerLayout=categories-clear always reserves the category-pane footer height while keeping its inactive divider hidden, then reveals the divider and only its left-aligned Clear action while values are selected.",
63
- "The built-in trigger derives the shared surface-open wash from the rendered popup lifecycle, including closing. For an external trigger, the application owns that relationship and retains the wash until dsAfterClose; selected filter values remain independent."
64
+ "The built-in trigger derives the shared surface-open wash from the rendered popup lifecycle, including closing. For an external trigger, the application owns that relationship and retains the wash until dsAfterClose; selected filter values remain independent.",
65
+ "Embedded mode renders the same controlled content inside a parent-owned surface; the parent owns positioning, initial focus, Escape, Tab exit, and dismissal.",
66
+ "Apply-required filtering stages edits locally, including match mode. Clear immediately emits dsClear and discards pending edits. The footer appears when filters are selected or applied; Apply stays in place and inactive without pending changes; applying emits controlled changes. Closing discards unapplied edits.",
67
+ "Vertical presentation renders initially expanded, independently collapsible filter categories and emits edits immediately to its controlled owner. The owning panel supplies the draft and action footer."
64
68
  ],
65
69
  "responsiveBehavior": [
66
70
  "The popup defaults to the large menu-width token and clamps to the nearest data-ds-overlay-boundary rectangle or the viewport fallback.",
@@ -98,8 +102,7 @@
98
102
  "attribute": "active-fill",
99
103
  "default": "false",
100
104
  "required": false,
101
- "mutable": false,
102
- "description": "Show selected interaction fill when one or more criteria are active."
105
+ "mutable": false
103
106
  },
104
107
  "activeFilterId": {
105
108
  "type": "string | undefined",
@@ -142,6 +145,15 @@
142
145
  "mutable": false,
143
146
  "description": "ID of the external trigger element used for positioning and focus return."
144
147
  },
148
+ "applyRequired": {
149
+ "type": "boolean",
150
+ "resolvedType": "boolean",
151
+ "attribute": "apply-required",
152
+ "default": "false",
153
+ "required": false,
154
+ "mutable": false,
155
+ "description": "Stage filter edits until Apply is pressed."
156
+ },
145
157
  "ariaLabel": {
146
158
  "type": "string | null",
147
159
  "resolvedType": "null | string",
@@ -185,6 +197,15 @@
185
197
  "mutable": false,
186
198
  "description": "Opt into table-caption icon-only chrome below 900px. The trigger omits its\nvisible label and chevron; keep an accessible name via aria-label."
187
199
  },
200
+ "embedded": {
201
+ "type": "boolean",
202
+ "resolvedType": "boolean",
203
+ "attribute": "embedded",
204
+ "default": "false",
205
+ "required": false,
206
+ "mutable": false,
207
+ "description": "Render content inside a parent-owned surface; the parent owns dismissal and positioning."
208
+ },
188
209
  "filters": {
189
210
  "type": "FilterMenuFilter[]",
190
211
  "resolvedType": "FilterMenuFilter[]",
@@ -208,8 +229,7 @@
208
229
  "attribute": "has-border",
209
230
  "default": "true",
210
231
  "required": false,
211
- "mutable": false,
212
- "description": "Show the surface-aware inset border around the select trigger."
232
+ "mutable": false
213
233
  },
214
234
  "icon": {
215
235
  "type": "string | undefined",
@@ -263,6 +283,15 @@
263
283
  "mutable": false,
264
284
  "description": "Popup width. It remains clamped to its collision boundary by the component recipe."
265
285
  },
286
+ "neutralTrigger": {
287
+ "type": "boolean",
288
+ "resolvedType": "boolean",
289
+ "attribute": "neutral-trigger",
290
+ "default": "false",
291
+ "required": false,
292
+ "mutable": false,
293
+ "description": "Keep trigger colors neutral when a value is selected."
294
+ },
266
295
  "noResultsText": {
267
296
  "type": "string",
268
297
  "resolvedType": "string",
@@ -278,8 +307,7 @@
278
307
  "attribute": "open",
279
308
  "default": "false",
280
309
  "required": false,
281
- "mutable": true,
282
- "description": "Controlled popup visibility."
310
+ "mutable": true
283
311
  },
284
312
  "searchPlaceholder": {
285
313
  "type": "string",
@@ -290,6 +318,15 @@
290
318
  "mutable": false,
291
319
  "description": "Placeholder shown in each non-date option search header."
292
320
  },
321
+ "showIndicator": {
322
+ "type": "boolean",
323
+ "resolvedType": "boolean",
324
+ "attribute": "show-indicator",
325
+ "default": "true",
326
+ "required": false,
327
+ "mutable": false,
328
+ "description": "Show the trigger chevron."
329
+ },
293
330
  "showSelectedCount": {
294
331
  "type": "boolean",
295
332
  "resolvedType": "boolean",
@@ -343,6 +380,15 @@
343
380
  "mutable": false,
344
381
  "description": "Controlled values keyed by filter id."
345
382
  },
383
+ "vertical": {
384
+ "type": "boolean",
385
+ "resolvedType": "boolean",
386
+ "attribute": "vertical",
387
+ "default": "false",
388
+ "required": false,
389
+ "mutable": false,
390
+ "description": "Stacked, collapsible sections for a configuration panel."
391
+ },
346
392
  "width": {
347
393
  "type": "FilterMenuWidth",
348
394
  "resolvedType": "\"fill\" | \"hug\"",
@@ -421,8 +467,7 @@
421
467
  "attribute": "active-fill",
422
468
  "default": "false",
423
469
  "required": false,
424
- "mutable": false,
425
- "description": "Show selected interaction fill when one or more criteria are active."
470
+ "mutable": false
426
471
  },
427
472
  "activeFilterId": {
428
473
  "type": "string | undefined",
@@ -465,6 +510,15 @@
465
510
  "mutable": false,
466
511
  "description": "ID of the external trigger element used for positioning and focus return."
467
512
  },
513
+ "applyRequired": {
514
+ "type": "boolean",
515
+ "resolvedType": "boolean",
516
+ "attribute": "apply-required",
517
+ "default": "false",
518
+ "required": false,
519
+ "mutable": false,
520
+ "description": "Stage filter edits until Apply is pressed."
521
+ },
468
522
  "ariaLabel": {
469
523
  "type": "string | null",
470
524
  "resolvedType": "null | string",
@@ -508,6 +562,15 @@
508
562
  "mutable": false,
509
563
  "description": "Opt into table-caption icon-only chrome below 900px. The trigger omits its\nvisible label and chevron; keep an accessible name via aria-label."
510
564
  },
565
+ "embedded": {
566
+ "type": "boolean",
567
+ "resolvedType": "boolean",
568
+ "attribute": "embedded",
569
+ "default": "false",
570
+ "required": false,
571
+ "mutable": false,
572
+ "description": "Render content inside a parent-owned surface; the parent owns dismissal and positioning."
573
+ },
511
574
  "filters": {
512
575
  "type": "FilterMenuFilter[]",
513
576
  "resolvedType": "FilterMenuFilter[]",
@@ -531,8 +594,7 @@
531
594
  "attribute": "has-border",
532
595
  "default": "true",
533
596
  "required": false,
534
- "mutable": false,
535
- "description": "Show the surface-aware inset border around the select trigger."
597
+ "mutable": false
536
598
  },
537
599
  "icon": {
538
600
  "type": "string | undefined",
@@ -586,6 +648,15 @@
586
648
  "mutable": false,
587
649
  "description": "Popup width. It remains clamped to its collision boundary by the component recipe."
588
650
  },
651
+ "neutralTrigger": {
652
+ "type": "boolean",
653
+ "resolvedType": "boolean",
654
+ "attribute": "neutral-trigger",
655
+ "default": "false",
656
+ "required": false,
657
+ "mutable": false,
658
+ "description": "Keep trigger colors neutral when a value is selected."
659
+ },
589
660
  "noResultsText": {
590
661
  "type": "string",
591
662
  "resolvedType": "string",
@@ -601,8 +672,7 @@
601
672
  "attribute": "open",
602
673
  "default": "false",
603
674
  "required": false,
604
- "mutable": true,
605
- "description": "Controlled popup visibility."
675
+ "mutable": true
606
676
  },
607
677
  "searchPlaceholder": {
608
678
  "type": "string",
@@ -613,6 +683,15 @@
613
683
  "mutable": false,
614
684
  "description": "Placeholder shown in each non-date option search header."
615
685
  },
686
+ "showIndicator": {
687
+ "type": "boolean",
688
+ "resolvedType": "boolean",
689
+ "attribute": "show-indicator",
690
+ "default": "true",
691
+ "required": false,
692
+ "mutable": false,
693
+ "description": "Show the trigger chevron."
694
+ },
616
695
  "showSelectedCount": {
617
696
  "type": "boolean",
618
697
  "resolvedType": "boolean",
@@ -666,6 +745,15 @@
666
745
  "mutable": false,
667
746
  "description": "Controlled values keyed by filter id."
668
747
  },
748
+ "vertical": {
749
+ "type": "boolean",
750
+ "resolvedType": "boolean",
751
+ "attribute": "vertical",
752
+ "default": "false",
753
+ "required": false,
754
+ "mutable": false,
755
+ "description": "Stacked, collapsible sections for a configuration panel."
756
+ },
669
757
  "width": {
670
758
  "type": "FilterMenuWidth",
671
759
  "resolvedType": "\"fill\" | \"hug\"",
@@ -778,7 +866,7 @@
778
866
  ],
779
867
  "registryDependencies": [
780
868
  "badge",
781
- "button-unfilled",
869
+ "calendar",
782
870
  "checkbox",
783
871
  "empty-state",
784
872
  "icon",
@@ -791,17 +879,12 @@
791
879
  "files": [
792
880
  {
793
881
  "path": "src/wc/components/FilterMenu/FilterMenu.css",
794
- "content": "@import '../../utils/radius.css';\n@import '../../utils/choice-list.css';\n@import '../../utils/chrome-header.css';\n@import '../../utils/control-parts.css';\n@import '../../utils/control-width.css';\n@import '../../utils/select-trigger.css';\n@import '../../utils/search-control.css';\n@import '../../utils/table-caption-control.css';\n\n:host(.filter-menu-host--external-trigger) {\n display: contents;\n}\n\n.filter-menu {\n display: flex;\n min-height: 0;\n flex-direction: column;\n color: var(--color-foreground-secondary);\n}\n\n.filter-menu__body {\n display: grid;\n grid-template-columns: var(--dimension-menu-width-xs) var(--dimension-menu-width-sm);\n min-height: calc(var(--dimension-size-800) * 4 + var(--dimension-space-150));\n max-height: calc(100vh - var(--dimension-size-800) - var(--dimension-size-600));\n}\n\n.filter-menu__category-pane {\n display: flex;\n min-width: 0;\n min-height: 0;\n flex-direction: column;\n border-inline-end: var(--dimension-stroke-width-012) solid var(--color-border-tertiary);\n}\n\n.filter-menu__categories {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.filter-menu__category-section {\n display: flex;\n min-width: 0;\n flex-direction: column;\n}\n\n.filter-menu__category-section.ds-choice-section--divided {\n padding-block-end: var(--dimension-space-050);\n}\n\n.filter-menu__category {\n justify-content: space-between;\n width: 100%;\n border: 0;\n background: transparent;\n color: var(--color-foreground-secondary);\n cursor: default;\n text-align: start;\n}\n\n.filter-menu__category--active {\n color: var(--color-foreground-primary);\n}\n\n.filter-menu__category-dot-box {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--ds-control-icon, var(--dimension-iconography-md));\n height: var(--ds-control-icon, var(--dimension-iconography-md));\n pointer-events: none;\n}\n\n.filter-menu__options {\n display: flex;\n min-width: 0;\n min-height: 0;\n flex-direction: column;\n overflow: hidden;\n}\n\n.filter-menu__options-content {\n display: flex;\n min-width: 0;\n min-height: 0;\n flex: 1 1 auto;\n flex-direction: column;\n overflow: auto;\n}\n\n.filter-menu__option-search {\n position: relative;\n flex: 0 0 var(--dimension-size-500);\n min-width: 0;\n min-height: var(--dimension-size-500);\n background: transparent;\n}\n\n.filter-menu__option-search::after {\n content: '';\n position: absolute;\n inset: auto 0 0;\n height: var(--dimension-stroke-width-012);\n background-color: var(--color-border-tertiary);\n pointer-events: none;\n}\n\n.filter-menu__option-search .select-search {\n height: 100%;\n background: transparent;\n}\n\n.filter-menu__options--date,\n.filter-menu__option-list--date,\n.filter-menu__date {\n display: flex;\n min-width: 0;\n min-height: 0;\n flex-direction: column;\n}\n\n.filter-menu__option-list--date,\n.filter-menu__date {\n flex: 1 1 auto;\n}\n\n.filter-menu__date-header {\n flex: 0 0 var(--dimension-size-500);\n justify-content: center;\n min-block-size: var(--dimension-size-500);\n padding: var(--dimension-space-050);\n background: var(--color-background-secondary);\n}\n\n.filter-menu__date-body {\n display: flex;\n flex: 1 1 auto;\n min-height: 0;\n flex-direction: column;\n}\n\n.filter-menu__date-relative {\n flex: 1 1 auto;\n}\n\n.filter-menu__calendar {\n display: flex;\n min-height: 0;\n flex-direction: column;\n padding: var(--dimension-space-100);\n}\n\n.filter-menu__calendar-heading {\n display: grid;\n grid-template-columns: var(--dimension-size-400) minmax(0, 1fr) var(--dimension-size-400);\n align-items: center;\n text-align: center;\n}\n\n.filter-menu__calendar-nav--previous {\n justify-self: start;\n}\n\n.filter-menu__calendar-nav--next {\n justify-self: end;\n}\n\n.filter-menu__calendar-weekdays,\n.filter-menu__calendar-grid {\n display: grid;\n grid-template-columns: repeat(7, minmax(0, 1fr));\n column-gap: var(--dimension-space-050);\n}\n\n.filter-menu__calendar-grid {\n row-gap: var(--dimension-space-050);\n}\n\n.filter-menu__calendar-weekdays {\n align-items: center;\n min-height: var(--dimension-size-400);\n margin-block-start: var(--dimension-space-050);\n color: var(--color-foreground-secondary);\n text-align: center;\n}\n\n.filter-menu__calendar-day {\n appearance: none;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 0;\n width: 100%;\n height: var(--dimension-size-400);\n padding: 0;\n border: 0;\n border-radius: var(--dimension-radius-025);\n background: transparent;\n color: var(--color-foreground-primary);\n cursor: default;\n}\n\n.filter-menu__calendar-day--outside {\n color: var(--color-foreground-tertiary);\n}\n\n.filter-menu__calendar-day--in-range {\n background: var(--color-background-faint-brand);\n color: var(--color-foreground-primary);\n}\n\n/* Pending range preview stays faint while the already-selected start keeps its bold edge. */\n.filter-menu__calendar-day--range-preview {\n background: var(--color-background-faint-brand);\n}\n\n.filter-menu__calendar-day--today {\n color: var(--color-foreground-primary);\n}\n\n.filter-menu__calendar-day--range-edge {\n background: var(--color-background-bold-brand);\n color: var(--color-foreground-on-bold-background-primary);\n}\n\n.filter-menu__footer {\n flex: 0 0 auto;\n}\n\n.filter-menu__footer--categories-clear .ds-choice-footer__content {\n justify-content: flex-start;\n}\n\n.filter-menu__footer--categories-clear[aria-hidden='true']::before {\n visibility: hidden;\n}\n\n.filter-menu__clear {\n color: var(--color-foreground-bold-brand);\n}\n\n.filter-menu__match-mode-footer {\n flex: 0 0 auto;\n}\n\n.filter-menu__match-mode-content {\n justify-content: flex-start;\n padding-inline: calc(\n var(--dimension-space-050) + var(--ds-control-padding-inline, var(--dimension-space-075)) +\n var(--ds-control-label-inset, var(--dimension-space-025))\n );\n}\n\n.filter-menu__match-mode-toggle {\n appearance: none;\n display: inline-flex;\n align-items: center;\n padding: 0;\n border: 0;\n border-radius: var(--dimension-radius-025);\n background: transparent;\n cursor: default;\n}\n\n@media (forced-colors: active) {\n .filter-menu__category-pane {\n border-inline-end-color: var(--ds-forced-color-content);\n }\n\n .filter-menu__calendar-day--range-edge {\n outline: var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);\n }\n}\n",
882
+ "content": "@import '../../utils/radius.css';\n@import '../../utils/choice-list.css';\n@import '../../utils/chrome-header.css';\n@import '../../utils/control-parts.css';\n@import '../../utils/control-width.css';\n@import '../../utils/select-trigger.css';\n@import '../../utils/search-control.css';\n@import '../../utils/table-caption-control.css';\n\n:host(.filter-menu-host--external-trigger) {\n display: contents;\n}\n\n.filter-menu {\n display: flex;\n min-height: 0;\n flex-direction: column;\n color: var(--color-foreground-secondary);\n}\n\n.filter-menu__body {\n display: grid;\n grid-template-columns: var(--dimension-menu-width-xs) var(--dimension-menu-width-sm);\n min-height: calc(var(--dimension-size-800) * 4 + var(--dimension-space-150));\n max-height: calc(100vh - var(--dimension-size-800) - var(--dimension-size-600));\n}\n\n.filter-menu__category-pane {\n display: flex;\n min-width: 0;\n min-height: 0;\n flex-direction: column;\n border-inline-end: var(--dimension-stroke-width-012) solid var(--color-border-tertiary);\n}\n\n.filter-menu__categories {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.filter-menu__category-section {\n display: flex;\n min-width: 0;\n flex-direction: column;\n}\n\n.filter-menu__category-section.ds-choice-section--divided {\n padding-block-end: var(--dimension-space-050);\n}\n\n.filter-menu__category {\n justify-content: space-between;\n width: 100%;\n border: 0;\n background: transparent;\n color: var(--color-foreground-secondary);\n cursor: default;\n text-align: start;\n}\n\n.filter-menu__category--active {\n color: var(--color-foreground-primary);\n}\n\n.filter-menu__category-dot-box {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--ds-control-icon, var(--dimension-iconography-md));\n height: var(--ds-control-icon, var(--dimension-iconography-md));\n pointer-events: none;\n}\n\n.filter-menu__options {\n display: flex;\n min-width: 0;\n min-height: 0;\n flex-direction: column;\n overflow: hidden;\n}\n\n.filter-menu__options-content {\n display: flex;\n min-width: 0;\n min-height: 0;\n flex: 1 1 auto;\n flex-direction: column;\n overflow: auto;\n}\n\n.filter-menu__option-search {\n position: relative;\n flex: 0 0 var(--dimension-size-500);\n min-width: 0;\n min-height: var(--dimension-size-500);\n background: transparent;\n}\n\n.filter-menu__option-search::after {\n content: '';\n position: absolute;\n inset: auto 0 0;\n height: var(--dimension-stroke-width-012);\n background-color: var(--color-border-tertiary);\n pointer-events: none;\n}\n\n.filter-menu__option-search .select-search {\n height: 100%;\n background: transparent;\n}\n\n.filter-menu__options--date,\n.filter-menu__option-list--date,\n.filter-menu__date {\n display: flex;\n min-width: 0;\n min-height: 0;\n flex-direction: column;\n}\n\n.filter-menu__option-list--date,\n.filter-menu__date {\n flex: 1 1 auto;\n}\n\n.filter-menu__date-header {\n flex: 0 0 var(--dimension-size-500);\n justify-content: center;\n min-block-size: var(--dimension-size-500);\n padding: var(--dimension-space-050);\n background: var(--color-background-secondary);\n}\n\n.filter-menu__date-body {\n display: flex;\n flex: 1 1 auto;\n min-height: 0;\n flex-direction: column;\n}\n\n.filter-menu__date-relative {\n flex: 1 1 auto;\n}\n\n.filter-menu__date-body > ds-calendar {\n flex: 1 1 auto;\n min-width: 0;\n min-height: 0;\n}\n\n.filter-menu__footer {\n flex: 0 0 auto;\n}\n\n.filter-menu__footer--categories-clear .ds-choice-footer__content {\n justify-content: flex-start;\n}\n\n.filter-menu__footer--categories-clear[aria-hidden='true']::before {\n visibility: hidden;\n}\n\n.ds-choice-footer__content:has(.filter-menu__apply) {\n column-gap: var(--dimension-space-100);\n}\n\n.filter-menu__apply ds-text {\n padding-right: 0;\n}\n\n.filter-menu__action-separator + .filter-menu__clear ds-text {\n padding-left: 0;\n}\n\n.filter-menu__apply {\n color: var(--color-foreground-bold-brand);\n}\n\n.filter-menu__apply:disabled {\n color: var(--color-foreground-tertiary);\n text-decoration-line: none;\n}\n\n.filter-menu__clear {\n --ds-text-action-foreground: var(--color-foreground-bold-negative);\n\n color: var(--ds-text-action-foreground);\n}\n\n.filter-menu__match-mode-footer {\n flex: 0 0 auto;\n}\n\n.filter-menu__match-mode-content {\n justify-content: flex-start;\n padding-inline: calc(\n var(--dimension-space-050) + var(--ds-control-padding-inline, var(--dimension-space-075)) +\n var(--ds-control-label-inset, var(--dimension-space-025))\n );\n}\n\n.filter-menu__match-mode-toggle {\n appearance: none;\n display: inline-flex;\n align-items: center;\n padding: 0;\n border: 0;\n border-radius: var(--dimension-radius-025);\n background: transparent;\n cursor: default;\n}\n\n@media (forced-colors: active) {\n .filter-menu__category-pane {\n border-inline-end-color: var(--ds-forced-color-content);\n }\n}\n\n.table-preferences-embedded {\n display: flex;\n flex-direction: column;\n min-width: 0;\n min-height: 0;\n color: var(--color-foreground-secondary);\n}\n\n.table-preferences-embedded .filter-menu__body {\n grid-template-columns: min(var(--dimension-menu-width-xs), 40%) minmax(0, 1fr);\n}\n\n.filter-menu-vertical__section {\n border-bottom: var(--dimension-stroke-width-012) solid var(--color-border-tertiary);\n}\n.filter-menu-vertical__section > summary {\n cursor: default;\n padding: var(--dimension-space-200);\n}\n.filter-menu-vertical__section > summary ds-text {\n display: inline;\n}\n\n.filter-menu-vertical__section > summary {\n display: flex;\n align-items: center;\n gap: var(--dimension-space-100);\n list-style: none;\n}\n.filter-menu-vertical__section > summary::-webkit-details-marker {\n display: none;\n}\n.filter-menu-vertical__section:not([open]) .filter-menu-vertical__chevron {\n transform: rotate(-90deg);\n}\n",
795
883
  "type": "registry:ui"
796
884
  },
797
885
  {
798
886
  "path": "src/wc/components/FilterMenu/FilterMenu.tsx",
799
- "content": "import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n type VNode,\n Watch,\n} from '@stencil/core';\nimport {\n CONTROL_TEXT_VARIANT,\n DATE_FILTER_RELATIVE_PRESETS,\n controlWidthClass,\n dateFilterRangeValue,\n dateFilterRelativeValue,\n parseDateFilterValue,\n resolveChoicePopupAlignOffset,\n resolveCssLengthPx,\n resolveMotionTimeMs,\n shiftIsoCalendarDate,\n TOKEN_CSS_LENGTHS,\n TOKEN_DEFAULTS,\n type ControlWidth,\n} from '../../utils';\nimport { observeTableCaptionCompact } from '../../utils/table-caption-compact';\nimport type { AnchoredAlign, AnchoredSide } from '../../utils/anchored-position';\nimport { AnchoredPositionController } from '../../utils/anchored-position-controller';\nimport { AnchoredOverlayInteractionController } from '../../utils/anchored-overlay-interaction-controller';\nimport { resolveAnchoredOverlayBoundaryRect } from '../../utils/anchored-overlay-boundary';\nimport { ChoiceOptionRow, ChoiceSearch } from '../../utils/choice-list-parts';\nimport { choiceListUsesSubtext } from '../../utils/choice-list';\nimport {\n FILTER_MENU_WEEKDAYS,\n filterMenuCalendarDays,\n filterMenuCalendarMonth,\n filterMenuCalendarMonthLabel,\n filterMenuToday,\n shiftFilterMenuCalendarMonth,\n} from './filter-menu-calendar';\n\nexport type FilterMenuFilterKind = 'single' | 'multiple' | 'boolean' | 'date';\nexport type FilterMenuSize = 'lg' | 'md' | 'sm' | 'xs';\nexport type FilterMenuWidth = ControlWidth;\nexport type FilterMenuFooterLayout = 'summary' | 'categories-clear';\nexport type FilterMenuMatchMode = 'any' | 'all';\ntype FilterMenuDateMode = 'range' | 'relative';\n\nexport interface FilterMenuOption {\n label: string;\n value: string;\n description?: string;\n isInactive?: boolean;\n}\n\nexport interface FilterMenuFilter {\n id: string;\n label: string;\n kind: FilterMenuFilterKind;\n options?: FilterMenuOption[];\n description?: string;\n fieldLabel?: string;\n /** Draw a standard menu-section divider after this category. */\n divider?: boolean;\n}\n\nexport type FilterMenuValue = string[] | boolean | string;\nexport type FilterMenuValues = Record<string, FilterMenuValue | undefined>;\nexport type FilterMenuMatchModes = Record<string, FilterMenuMatchMode | undefined>;\n\nexport interface FilterMenuChangeDetail {\n filterId: string;\n value: FilterMenuValue;\n}\n\nexport interface FilterMenuMatchModeChangeDetail {\n filterId: string;\n mode: FilterMenuMatchMode;\n}\n\nlet filterMenuId = 0;\n\nconst ICON_SIZE: Record<FilterMenuSize, 'lg' | 'md' | 'sm' | 'xs'> = {\n lg: 'lg',\n md: 'md',\n sm: 'sm',\n xs: 'xs',\n};\n\nconst DATE_MODE_TABS = [\n { id: 'relative', label: 'Relative' },\n { id: 'range', label: 'Range' },\n];\n\nconst RELATIVE_DATE_OPTIONS: FilterMenuOption[] = DATE_FILTER_RELATIVE_PRESETS.map(preset => ({\n label: preset.label,\n value: dateFilterRelativeValue(preset.value),\n}));\n\n@Component({\n tag: 'ds-filter-menu',\n styleUrl: 'FilterMenu.css',\n scoped: true,\n})\nexport class FilterMenu {\n @Element() el!: HTMLElement;\n\n /** Controlled popup visibility. */\n @Prop({ mutable: true }) open: boolean = false;\n /** Select trigger text. */\n @Prop() triggerLabel: string = 'Filters';\n /** Append the active-filter count to the visible trigger label. */\n @Prop() showSelectedCount: boolean = true;\n /** Optional select trigger prefix icon name. */\n @Prop() icon: string | undefined = 'Filters';\n /** Select trigger density. */\n @Prop() size: FilterMenuSize = 'md';\n /** Select trigger width fit. */\n @Prop() width: FilterMenuWidth = 'hug';\n /** Show the surface-aware inset border around the select trigger. */\n @Prop() hasBorder: boolean = true;\n /** Show selected interaction fill when one or more criteria are active. */\n @Prop() activeFill: boolean = false;\n /**\n * Opt into table-caption icon-only chrome below 900px. The trigger omits its\n * visible label and chevron; keep an accessible name via aria-label.\n */\n @Prop({ reflect: true }) collapseLabel: boolean = false;\n /** ID applied to the internal select trigger. */\n @Prop() inputId: string | undefined;\n /** Direct accessible name for the internal select trigger. */\n @Prop({ attribute: 'aria-label' }) ariaLabel: string | null = null;\n /** Product-owned filter categories and option definitions. */\n @Prop() filters: FilterMenuFilter[] = [];\n /** Controlled values keyed by filter id. */\n @Prop() values: FilterMenuValues = {};\n /** Controlled any/all match mode keyed by multiple-choice filter id. Defaults to any. */\n @Prop() matchModes: FilterMenuMatchModes = {};\n /** Controlled category shown in the option pane. */\n @Prop() activeFilterId: string | undefined;\n /** External trigger element to position against. */\n @Prop() anchor: HTMLElement | undefined;\n /** ID of the external trigger element used for positioning and focus return. */\n @Prop() anchorId: string | undefined;\n /** Explicit collision owner; otherwise the nearest data-ds-overlay-boundary ancestor is used. */\n @Prop() boundary: HTMLElement | undefined;\n /** Preferred popup side; collision handling may flip it. */\n @Prop() side: AnchoredSide = 'bottom';\n /** Cross-axis alignment against the trigger. */\n @Prop() align: AnchoredAlign = 'end';\n /** Gap between trigger and popup — number in px or a TokoMo length. */\n @Prop() sideOffset: number | string = TOKEN_CSS_LENGTHS.space050;\n /** Cross-axis offset — number in px or a TokoMo length. */\n @Prop() alignOffset: number | string = 0;\n /** Popup width. It remains clamped to its collision boundary by the component recipe. */\n @Prop() menuWidth: string = TOKEN_CSS_LENGTHS.menuWidthLg;\n /** Accessible name for the non-modal filter dialog. */\n @Prop() menuLabel: string = 'Filters';\n /** Accessible name for the category tab list. */\n @Prop() categoriesLabel: string = 'Filter categories';\n /** Footer action and date-clear accessible label. */\n @Prop() clearLabel: string = 'Clear';\n /** Placeholder shown in each non-date option search header. */\n @Prop() searchPlaceholder: string = 'Search';\n /** Empty-state text shown when an option search has no matches. */\n @Prop() noResultsText: string = 'No results';\n /** Footer recipe: full-width selected summary or reserved category-pane Clear action. */\n @Prop() footerLayout: FilterMenuFooterLayout = 'summary';\n /** Show a visible focus ring on initial entry after keyboard activation. */\n @Prop() initialFocusVisible: boolean = false;\n\n @State() private shouldRender = false;\n @State() private closing = false;\n @State() private positionReady = false;\n @State() private pos: { x: number; y: number } = { x: 0, y: 0 };\n @State() private focusRingVisible = false;\n @State() private activeOptionIndex = 0;\n @State() private captionCompact = false;\n @State() private dateModeByFilter: Record<string, FilterMenuDateMode> = {};\n @State() private calendarMonthByFilter: Record<string, string> = {};\n @State() private pendingRangeStartByFilter: Record<string, string> = {};\n @State() private previewRangeEndByFilter: Record<string, string> = {};\n @State() private optionQueryByFilter: Record<string, string> = {};\n\n /** Requests a controlled value replacement without closing the popup. */\n @Event() dsChange!: EventEmitter<FilterMenuChangeDetail>;\n /** Requests that the consumer clear every filter value. */\n @Event() dsClear!: EventEmitter<void>;\n /** Requests a controlled any/all mode replacement for a multiple-choice filter. */\n @Event() dsMatchModeChange!: EventEmitter<FilterMenuMatchModeChangeDetail>;\n /** Requests a controlled active-category replacement. */\n @Event() dsActiveFilterChange!: EventEmitter<string>;\n /** Requests that the controlled popup close. */\n @Event() dsClose!: EventEmitter<void>;\n /** Emitted whenever internal select-trigger activation changes popup visibility. */\n @Event() dsOpenChange!: EventEmitter<boolean>;\n /** Emitted after exit motion and rendered popup removal complete. */\n @Event() dsAfterClose!: EventEmitter<void>;\n\n private readonly generatedId = `ds-filter-menu-${++filterMenuId}`;\n private triggerElement: HTMLButtonElement | null = null;\n private pendingInitialFocusVisible = false;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n private captionCompactDisconnect: (() => void) | undefined;\n private hasLoaded = false;\n private closingSnapshot: {\n filters: FilterMenuFilter[];\n values: FilterMenuValues;\n matchModes: FilterMenuMatchModes;\n activeFilterId: string | undefined;\n } | null = null;\n\n private readonly position = new AnchoredPositionController({\n getAnchor: () => this.resolvedAnchor,\n getPopup: () => this.el.querySelector<HTMLElement>('.filter-menu-popup'),\n getOwnerDocument: () => this.el.ownerDocument,\n measure: (anchor, popup) => {\n if (!this.open) return null;\n const anchorRect = anchor.getBoundingClientRect();\n const sectionInsetPx = resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050);\n return {\n anchorRect,\n popupWidth: popup.offsetWidth || this.popupFallbackWidth,\n popupHeight: popup.offsetHeight || this.popupFallbackHeight,\n side: this.side,\n align: this.align,\n sideOffsetPx: resolveCssLengthPx(this.sideOffset, TOKEN_DEFAULTS.space050),\n alignOffsetPx: resolveChoicePopupAlignOffset({\n align: this.align,\n alignOffsetPx: resolveCssLengthPx(this.alignOffset, 0),\n sectionInsetPx,\n }),\n viewportPadPx: this.viewportPad,\n viewportWidth: window.innerWidth,\n viewportHeight: window.innerHeight,\n collisionRect: resolveAnchoredOverlayBoundaryRect(anchor, this.boundary),\n };\n },\n apply: ({ x, y }) => {\n this.pos = { x, y };\n },\n onReady: () => {\n this.positionReady = true;\n },\n liveUpdate: 'double-frame',\n observeResize: true,\n topLayer: true,\n });\n private readonly interaction = new AnchoredOverlayInteractionController({\n getAnchor: () => this.resolvedAnchor,\n getPopup: () => this.el.querySelector<HTMLElement>('.filter-menu-popup'),\n getOwnerDocument: () => this.el.ownerDocument,\n onOutsideActivation: () => this.close(),\n });\n\n componentDidLoad() {\n this.hasLoaded = true;\n this.syncCaptionCompactObserver();\n if (this.open) this.onOpenChange(true);\n }\n\n connectedCallback() {\n if (!this.hasLoaded) return;\n this.syncCaptionCompactObserver();\n if (this.open) this.onOpenChange(true);\n }\n\n disconnectedCallback() {\n this.disconnectCaptionCompactObserver();\n this.position.unobserve();\n this.teardownListeners();\n }\n\n @Watch('collapseLabel')\n onCollapseLabelChange() {\n this.syncCaptionCompactObserver();\n }\n\n @Watch('open')\n onOpenChange(isOpen: boolean) {\n if (isOpen) {\n this.teardownListeners();\n this.closingSnapshot = null;\n this.shouldRender = true;\n this.closing = false;\n this.positionReady = false;\n this.focusRingVisible = this.pendingInitialFocusVisible || this.initialFocusVisible;\n this.setupListeners();\n this.position.schedule(() => this.focusInitialCategory());\n return;\n }\n\n if (!this.shouldRender) return;\n this.position.cancel();\n this.captureClosingSnapshot();\n this.closing = true;\n this.teardownListeners();\n const duration = resolveMotionTimeMs(\n TOKEN_DEFAULTS.motionShort2,\n TOKEN_DEFAULTS.animationDurationShort3\n );\n if (duration <= 0) {\n this.finishClose();\n return;\n }\n this.closeTimer = setTimeout(() => this.finishClose(), duration);\n }\n\n @Watch('anchor')\n @Watch('anchorId')\n @Watch('boundary')\n @Watch('side')\n @Watch('align')\n @Watch('sideOffset')\n @Watch('alignOffset')\n @Watch('menuWidth')\n onPositionInputChange() {\n if (this.open) this.position.schedule();\n }\n\n @Listen('keydown')\n handleKeyDown(event: KeyboardEvent) {\n if (!this.shouldRender || this.closing) return;\n if (event.key === 'Escape') {\n event.preventDefault();\n this.close();\n return;\n }\n if (event.key !== 'Tab' || !this.tabLeavesPopup(event)) return;\n event.preventDefault();\n this.close(false);\n this.interaction.moveFocusAfterTab(event.shiftKey);\n }\n\n private get resolvedAnchor(): HTMLElement | null {\n if (this.anchor) return this.anchor;\n if (this.anchorId) return document.getElementById(this.anchorId);\n return this.triggerElement;\n }\n\n private get usesInternalTrigger(): boolean {\n return !this.anchor && !this.anchorId;\n }\n\n private get viewportPad(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050);\n }\n\n private get popupFallbackWidth(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.menuWidthLg, TOKEN_DEFAULTS.menuWidthLg);\n }\n\n private get popupFallbackHeight(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.menuFallbackHeight, TOKEN_DEFAULTS.menuFallbackHeight);\n }\n\n private setupListeners() {\n this.interaction.connect();\n this.position.observe();\n }\n\n private teardownListeners() {\n this.position.unobserve();\n this.interaction.disconnect();\n if (this.closeTimer) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n }\n\n private close(restoreFocus = true) {\n this.captureClosingSnapshot();\n if (restoreFocus) this.interaction.focusAnchor();\n this.dsOpenChange.emit(false);\n this.dsClose.emit();\n this.open = false;\n this.onOpenChange(false);\n }\n\n private toggleFromTrigger(event: MouseEvent) {\n if (this.open) {\n this.close();\n return;\n }\n this.pendingInitialFocusVisible = event.detail === 0;\n this.open = true;\n this.dsOpenChange.emit(true);\n this.onOpenChange(true);\n }\n\n private handleTriggerKeyDown(event: KeyboardEvent) {\n if (event.key !== 'ArrowDown' || this.open) return;\n event.preventDefault();\n this.pendingInitialFocusVisible = true;\n this.open = true;\n this.dsOpenChange.emit(true);\n this.onOpenChange(true);\n }\n\n private finishClose() {\n const popup = this.el.querySelector<HTMLElement>('.filter-menu-popup');\n if (popup?.matches(':popover-open')) popup.hidePopover();\n this.shouldRender = false;\n this.closing = false;\n this.closingSnapshot = null;\n this.closeTimer = null;\n this.dateModeByFilter = {};\n this.calendarMonthByFilter = {};\n this.pendingRangeStartByFilter = {};\n this.previewRangeEndByFilter = {};\n this.optionQueryByFilter = {};\n this.dsAfterClose.emit();\n }\n\n private captureClosingSnapshot() {\n if (this.closingSnapshot) return;\n this.closingSnapshot = {\n filters: this.filters.map(filter => ({\n ...filter,\n options: filter.options?.map(option => ({ ...option })),\n })),\n values: Object.fromEntries(\n Object.entries(this.values).map(([key, value]) => [\n key,\n Array.isArray(value) ? [...value] : value,\n ])\n ),\n matchModes: { ...this.matchModes },\n activeFilterId: this.activeFilterId,\n };\n }\n\n private focusInitialCategory() {\n requestAnimationFrame(() => {\n this.el.querySelector<HTMLElement>('.filter-menu__category[tabindex=\"0\"]')?.focus();\n this.pendingInitialFocusVisible = false;\n });\n }\n\n private tabLeavesPopup(event: KeyboardEvent): boolean {\n return this.interaction.tabLeavesPopup(event);\n }\n\n private selectedFilter(filters: FilterMenuFilter[], activeFilterId: string | undefined) {\n return filters.find(filter => filter.id === activeFilterId) ?? filters[0];\n }\n\n private selectedCount(filter: FilterMenuFilter, values: FilterMenuValues): number {\n const value = values[filter.id];\n if (filter.kind === 'multiple') return Array.isArray(value) ? value.length : 0;\n if (filter.kind === 'boolean') return value === true ? 1 : 0;\n return typeof value === 'string' && value.length > 0 ? 1 : 0;\n }\n\n private totalSelected(filters: FilterMenuFilter[], values: FilterMenuValues): number {\n return filters.reduce((total, filter) => total + this.selectedCount(filter, values), 0);\n }\n\n private activeFilterCount(filters: FilterMenuFilter[], values: FilterMenuValues): number {\n return filters.filter(filter => this.selectedCount(filter, values) > 0).length;\n }\n\n private selectCategory(filterId: string, focus = false) {\n this.activeOptionIndex = 0;\n this.dsActiveFilterChange.emit(filterId);\n if (!focus) return;\n requestAnimationFrame(() => {\n this.el.querySelector<HTMLElement>(`[data-filter-category=\"${filterId}\"]`)?.focus();\n });\n }\n\n private handleCategoryKeyDown(\n event: KeyboardEvent,\n filters: FilterMenuFilter[],\n filterId: string\n ) {\n const currentIndex = filters.findIndex(filter => filter.id === filterId);\n let nextIndex: number;\n if (event.key === 'ArrowDown') nextIndex = (currentIndex + 1) % filters.length;\n else if (event.key === 'ArrowUp')\n nextIndex = (currentIndex - 1 + filters.length) % filters.length;\n else if (event.key === 'Home') nextIndex = 0;\n else if (event.key === 'End') nextIndex = filters.length - 1;\n else if (event.key === 'ArrowRight') {\n event.preventDefault();\n requestAnimationFrame(() => {\n this.el\n .querySelector<HTMLElement>(\n '.filter-menu__options [role=\"option\"], .filter-menu__options [data-date-option], .filter-menu__options input'\n )\n ?.focus();\n });\n return;\n } else return;\n\n event.preventDefault();\n this.focusRingVisible = true;\n this.selectCategory(filters[nextIndex].id, true);\n }\n\n private handlePanelKeyDown(event: KeyboardEvent, filterId: string) {\n if (event.key !== 'ArrowLeft') return;\n event.preventDefault();\n this.el.querySelector<HTMLElement>(`[data-filter-category=\"${filterId}\"]`)?.focus();\n }\n\n private handleOptionKeyDown(\n event: KeyboardEvent,\n filter: FilterMenuFilter,\n option: FilterMenuOption,\n index: number,\n values: FilterMenuValues,\n visibleOptions: FilterMenuOption[] = filter.options ?? []\n ) {\n if (event.key === 'ArrowLeft') {\n this.handlePanelKeyDown(event, filter.id);\n return;\n }\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.selectOption(filter, option, values);\n return;\n }\n if (!['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) return;\n event.preventDefault();\n const enabled = visibleOptions\n .map((candidate, optionIndex) => ({ candidate, optionIndex }))\n .filter(({ candidate }) => !candidate.isInactive)\n .map(({ optionIndex }) => optionIndex);\n if (!enabled.length) return;\n const current = enabled.indexOf(index);\n let next: number;\n if (event.key === 'Home') next = enabled[0];\n else if (event.key === 'End') next = enabled[enabled.length - 1];\n else {\n const direction = event.key === 'ArrowDown' ? 1 : -1;\n const start = current >= 0 ? current : direction === 1 ? -1 : 0;\n next = enabled[(start + direction + enabled.length) % enabled.length];\n }\n this.activeOptionIndex = next;\n this.focusRingVisible = true;\n requestAnimationFrame(() => {\n this.el\n .querySelector<HTMLElement>(`#${this.generatedId}-${filter.id}-option-${next}`)\n ?.focus();\n });\n }\n\n private optionMatchesQuery(option: FilterMenuOption, query: string): boolean {\n const normalized = query.trim().toLocaleLowerCase();\n if (!normalized) return true;\n return `${option.label} ${option.description ?? ''}`.toLocaleLowerCase().includes(normalized);\n }\n\n private visibleOptions(\n filter: FilterMenuFilter,\n query = this.optionQueryByFilter[filter.id] ?? ''\n ) {\n if (filter.kind === 'boolean') {\n const option = this.booleanOption(filter);\n return this.optionMatchesQuery(option, query) ? [option] : [];\n }\n return (filter.options ?? []).filter(option => this.optionMatchesQuery(option, query));\n }\n\n private booleanOption(filter: FilterMenuFilter): FilterMenuOption {\n return {\n label: filter.fieldLabel ?? filter.label,\n value: 'true',\n description: filter.description,\n };\n }\n\n private setOptionQuery(filter: FilterMenuFilter, value: string) {\n const visibleOptions = this.visibleOptions(filter, value);\n const firstEnabled = visibleOptions.findIndex(option => !option.isInactive);\n this.activeOptionIndex = firstEnabled;\n this.focusRingVisible = false;\n this.optionQueryByFilter = { ...this.optionQueryByFilter, [filter.id]: value };\n requestAnimationFrame(() => {\n const content = this.el.querySelector<HTMLElement>('.filter-menu__options-content');\n if (content) content.scrollTop = 0;\n this.position.schedule();\n });\n }\n\n private handleOptionSearchKeyDown(event: KeyboardEvent, filter: FilterMenuFilter) {\n if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') return;\n const visibleOptions = this.visibleOptions(filter);\n const enabled = visibleOptions\n .map((option, index) => ({ option, index }))\n .filter(({ option }) => !option.isInactive)\n .map(({ index }) => index);\n if (!enabled.length) return;\n event.preventDefault();\n const next = event.key === 'ArrowDown' ? enabled[0] : enabled[enabled.length - 1];\n this.activeOptionIndex = next;\n this.focusRingVisible = true;\n requestAnimationFrame(() => {\n this.el\n .querySelector<HTMLElement>(`#${this.generatedId}-${filter.id}-option-${next}`)\n ?.focus();\n });\n }\n\n private toggleMultiple(\n filter: FilterMenuFilter,\n option: FilterMenuOption,\n checked: boolean,\n values: FilterMenuValues\n ) {\n if (option.isInactive) return;\n const current = Array.isArray(values[filter.id]) ? (values[filter.id] as string[]) : [];\n const selected = new Set(current);\n if (checked) selected.add(option.value);\n else selected.delete(option.value);\n const ordered = (filter.options ?? [])\n .map(candidate => candidate.value)\n .filter(value => selected.has(value));\n this.dsChange.emit({ filterId: filter.id, value: ordered });\n }\n\n private selectOption(\n filter: FilterMenuFilter,\n option: FilterMenuOption,\n values: FilterMenuValues\n ) {\n if (option.isInactive) return;\n if (filter.kind === 'single') {\n this.dsChange.emit({ filterId: filter.id, value: option.value });\n return;\n }\n const selected = Array.isArray(values[filter.id])\n ? (values[filter.id] as string[]).includes(option.value)\n : false;\n this.toggleMultiple(filter, option, !selected, values);\n }\n\n private dateMode(filterId: string, value: FilterMenuValue | undefined): FilterMenuDateMode {\n return this.dateModeByFilter[filterId] ?? parseDateFilterValue(value)?.kind ?? 'relative';\n }\n\n private setDateMode(filter: FilterMenuFilter, value: FilterMenuValue | undefined, mode: string) {\n if (mode !== 'range' && mode !== 'relative') return;\n this.dateModeByFilter = { ...this.dateModeByFilter, [filter.id]: mode };\n this.activeOptionIndex = 0;\n if (mode === 'range' && !this.calendarMonthByFilter[filter.id]) {\n const parsed = parseDateFilterValue(value);\n const initialDate = parsed?.kind === 'range' ? parsed.start : filterMenuToday();\n this.calendarMonthByFilter = {\n ...this.calendarMonthByFilter,\n [filter.id]: filterMenuCalendarMonth(initialDate),\n };\n }\n if (mode === 'relative' && this.pendingRangeStartByFilter[filter.id]) {\n const next = { ...this.pendingRangeStartByFilter };\n delete next[filter.id];\n this.pendingRangeStartByFilter = next;\n }\n if (mode === 'relative') this.clearCalendarRangePreview(filter.id);\n }\n\n private calendarMonth(filterId: string, value: FilterMenuValue | undefined): string {\n const parsed = parseDateFilterValue(value);\n const initialDate = parsed?.kind === 'range' ? parsed.start : filterMenuToday();\n return this.calendarMonthByFilter[filterId] ?? filterMenuCalendarMonth(initialDate);\n }\n\n private moveCalendarMonth(filterId: string, month: string, offset: number) {\n this.clearCalendarRangePreview(filterId);\n this.calendarMonthByFilter = {\n ...this.calendarMonthByFilter,\n [filterId]: shiftFilterMenuCalendarMonth(month, offset),\n };\n }\n\n private selectCalendarDate(filterId: string, value: string) {\n this.clearCalendarRangePreview(filterId);\n const pendingStart = this.pendingRangeStartByFilter[filterId];\n const next = { ...this.pendingRangeStartByFilter };\n if (pendingStart) delete next[filterId];\n else next[filterId] = value;\n this.pendingRangeStartByFilter = next;\n this.dsChange.emit({\n filterId,\n value: dateFilterRangeValue(pendingStart ?? value, value),\n });\n }\n\n private previewCalendarRange(filterId: string, value: string) {\n if (!this.pendingRangeStartByFilter[filterId]) return;\n if (this.previewRangeEndByFilter[filterId] === value) return;\n this.previewRangeEndByFilter = { ...this.previewRangeEndByFilter, [filterId]: value };\n }\n\n private clearCalendarRangePreview(filterId: string) {\n if (!this.previewRangeEndByFilter[filterId]) return;\n const next = { ...this.previewRangeEndByFilter };\n delete next[filterId];\n this.previewRangeEndByFilter = next;\n }\n\n private focusCalendarDate(filterId: string, value: string) {\n this.previewCalendarRange(filterId, value);\n const targetMonth = filterMenuCalendarMonth(value);\n if (this.calendarMonthByFilter[filterId] !== targetMonth) {\n this.calendarMonthByFilter = { ...this.calendarMonthByFilter, [filterId]: targetMonth };\n }\n requestAnimationFrame(() => {\n this.el.querySelector<HTMLElement>(`[data-date-option=\"${value}\"]`)?.focus();\n });\n }\n\n private handleCalendarDayKeyDown(event: KeyboardEvent, filterId: string, value: string) {\n let offset: number | null = null;\n if (event.key === 'ArrowLeft') offset = -1;\n else if (event.key === 'ArrowRight') offset = 1;\n else if (event.key === 'ArrowUp') offset = -7;\n else if (event.key === 'ArrowDown') offset = 7;\n else if (event.key === 'Home') {\n offset = -new Date(`${value}T00:00:00Z`).getUTCDay();\n } else if (event.key === 'End') {\n offset = 6 - new Date(`${value}T00:00:00Z`).getUTCDay();\n } else if (event.key === 'PageUp') {\n const month = shiftFilterMenuCalendarMonth(filterMenuCalendarMonth(value), -1);\n const day = value.slice(8, 10);\n const candidate = `${month}-${day}`;\n const target = parseDateFilterValue(candidate) ? candidate : `${month}-01`;\n event.preventDefault();\n this.focusCalendarDate(filterId, target);\n return;\n } else if (event.key === 'PageDown') {\n const month = shiftFilterMenuCalendarMonth(filterMenuCalendarMonth(value), 1);\n const day = value.slice(8, 10);\n const candidate = `${month}-${day}`;\n const target = parseDateFilterValue(candidate) ? candidate : `${month}-01`;\n event.preventDefault();\n this.focusCalendarDate(filterId, target);\n return;\n }\n if (offset === null) return;\n event.preventDefault();\n this.focusCalendarDate(filterId, shiftIsoCalendarDate(value, offset));\n }\n\n private renderRelativeDateOptions(filter: FilterMenuFilter, value: FilterMenuValue | undefined) {\n const relativeFilter: FilterMenuFilter = {\n ...filter,\n kind: 'single',\n options: RELATIVE_DATE_OPTIONS,\n };\n return (\n <div\n class=\"filter-menu__date-relative ds-choice-list ds-chrome-column ds-chrome-space--sm\"\n role=\"listbox\"\n aria-label=\"Relative date\"\n >\n {RELATIVE_DATE_OPTIONS.map((option, index) => (\n <ChoiceOptionRow\n size=\"md\"\n id={`${this.generatedId}-${filter.id}-relative-${index}`}\n option={option}\n selected={value === option.value}\n active={index === this.activeOptionIndex}\n focusRingVisible={this.focusRingVisible}\n usesSubtext={false}\n tabIndex={index === this.activeOptionIndex ? 0 : -1}\n onFocus={() => {\n this.activeOptionIndex = index;\n }}\n onKeyDown={(event: KeyboardEvent) =>\n this.handleOptionKeyDown(event, relativeFilter, option, index, {\n [filter.id]: value,\n })\n }\n onHover={() => {\n this.focusRingVisible = false;\n this.activeOptionIndex = index;\n }}\n onSelect={() => this.dsChange.emit({ filterId: filter.id, value: option.value })}\n />\n ))}\n </div>\n );\n }\n\n private renderDateCalendar(filter: FilterMenuFilter, value: FilterMenuValue | undefined) {\n const parsed = parseDateFilterValue(value);\n const range = parsed?.kind === 'range' ? parsed : null;\n const month = this.calendarMonth(filter.id, value);\n const days = filterMenuCalendarDays(month);\n const today = filterMenuToday();\n const pendingStart = this.pendingRangeStartByFilter[filter.id];\n const previewEnd = this.previewRangeEndByFilter[filter.id];\n const previewStart = pendingStart && previewEnd ? [pendingStart, previewEnd].sort()[0] : null;\n const previewFinish = pendingStart && previewEnd ? [pendingStart, previewEnd].sort()[1] : null;\n const preferredFocus =\n this.pendingRangeStartByFilter[filter.id] ??\n range?.end ??\n (month === today.slice(0, 7) ? today : '');\n const focusDate = days.some(day => day.value === preferredFocus)\n ? preferredFocus\n : (days.find(day => day.inMonth)?.value ?? days[0]?.value);\n\n return (\n <div class=\"filter-menu__calendar\">\n <div class=\"filter-menu__calendar-heading ds-control--md\">\n <ds-button-unfilled\n class=\"filter-menu__calendar-nav filter-menu__calendar-nav--previous\"\n variant=\"icon\"\n icon=\"ChevronLeft\"\n size=\"md\"\n hasBorder={false}\n ariaLabel=\"Previous month\"\n onDsClick={() => this.moveCalendarMonth(filter.id, month, -1)}\n />\n <ds-text as=\"span\" variant=\"text-body-medium\" emphasis color=\"primary\">\n {filterMenuCalendarMonthLabel(month)}\n </ds-text>\n <ds-button-unfilled\n class=\"filter-menu__calendar-nav filter-menu__calendar-nav--next\"\n variant=\"icon\"\n icon=\"ChevronRight\"\n size=\"md\"\n hasBorder={false}\n ariaLabel=\"Next month\"\n onDsClick={() => this.moveCalendarMonth(filter.id, month, 1)}\n />\n </div>\n <div class=\"filter-menu__calendar-weekdays\" aria-hidden=\"true\">\n {FILTER_MENU_WEEKDAYS.map(day => (\n <ds-text as=\"span\" variant=\"text-body-small\" color=\"secondary\">\n {day}\n </ds-text>\n ))}\n </div>\n <div\n class=\"filter-menu__calendar-grid\"\n role=\"grid\"\n aria-label={filterMenuCalendarMonthLabel(month)}\n onMouseLeave={() => this.clearCalendarRangePreview(filter.id)}\n >\n {days.map(day => {\n const selectedInRange = Boolean(\n range && day.value >= range.start && day.value <= range.end\n );\n const previewInRange = Boolean(\n previewStart &&\n previewFinish &&\n day.value >= previewStart &&\n day.value <= previewFinish\n );\n const inRange = previewInRange || selectedInRange;\n const rangeEdge = Boolean(\n previewStart\n ? day.value === pendingStart\n : range && (day.value === range.start || day.value === range.end)\n );\n const textColor = rangeEdge\n ? 'on-bold'\n : inRange || day.value === today\n ? 'primary'\n : day.inMonth\n ? 'secondary'\n : 'tertiary';\n return (\n <button\n type=\"button\"\n role=\"gridcell\"\n data-date-option={day.value}\n class={{\n 'filter-menu__calendar-day': true,\n 'filter-menu__calendar-day--outside': !day.inMonth,\n 'filter-menu__calendar-day--today': day.value === today,\n 'filter-menu__calendar-day--in-range': inRange,\n 'filter-menu__calendar-day--range-preview': previewInRange,\n 'filter-menu__calendar-day--range-edge': rangeEdge,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n }}\n aria-label={day.label}\n aria-selected={selectedInRange ? 'true' : 'false'}\n tabIndex={day.value === focusDate ? 0 : -1}\n onMouseEnter={() => this.previewCalendarRange(filter.id, day.value)}\n onFocus={() => this.previewCalendarRange(filter.id, day.value)}\n onClick={() => this.selectCalendarDate(filter.id, day.value)}\n onKeyDown={(event: KeyboardEvent) =>\n this.handleCalendarDayKeyDown(event, filter.id, day.value)\n }\n >\n <ds-text\n class=\"ds-interaction-fill__content\"\n as=\"span\"\n variant=\"text-body-medium\"\n color={textColor}\n emphasis={day.value === today}\n >\n {day.day}\n </ds-text>\n </button>\n );\n })}\n </div>\n </div>\n );\n }\n\n private renderDateFilter(filter: FilterMenuFilter, value: FilterMenuValue | undefined) {\n const mode = this.dateMode(filter.id, value);\n return (\n <div class=\"filter-menu__date\">\n <header class=\"filter-menu__date-header ds-chrome-header ds-chrome-header--bounded\">\n <ds-tab-group\n ariaLabel=\"Date filter mode\"\n size=\"md\"\n width=\"fill\"\n hasContainer={false}\n value={mode}\n tabs={DATE_MODE_TABS}\n onDsChange={(event: CustomEvent<string>) => {\n event.stopPropagation();\n this.setDateMode(filter, value, event.detail);\n }}\n />\n </header>\n <div class=\"filter-menu__date-body\">\n {mode === 'relative'\n ? this.renderRelativeDateOptions(filter, value)\n : this.renderDateCalendar(filter, value)}\n </div>\n </div>\n );\n }\n\n private renderOptionSearch(filter: FilterMenuFilter) {\n return (\n <div class=\"filter-menu__option-search\">\n <ChoiceSearch\n size=\"md\"\n hasFocusBoundary={false}\n hasInteractionFill={false}\n value={this.optionQueryByFilter[filter.id] ?? ''}\n placeholder={this.searchPlaceholder}\n ariaLabel={`Search ${filter.label} options`}\n controls={`${this.generatedId}-${filter.id}-options`}\n inputRef={() => undefined}\n clearLabel={`Clear ${filter.label} search`}\n onValueChange={value => this.setOptionQuery(filter, value)}\n onKeyDown={(event: KeyboardEvent) => this.handleOptionSearchKeyDown(event, filter)}\n />\n </div>\n );\n }\n\n private renderNoOptionResults() {\n return (\n <div\n class=\"ds-choice-empty ds-empty-region\"\n role=\"option\"\n aria-selected=\"false\"\n aria-disabled=\"true\"\n aria-label={this.noResultsText}\n aria-live=\"polite\"\n >\n <ds-empty-state body={this.noResultsText} />\n </div>\n );\n }\n\n private renderOptions(filter: FilterMenuFilter, values: FilterMenuValues) {\n const value = values[filter.id];\n if (filter.kind === 'multiple' || filter.kind === 'single') {\n const selected = Array.isArray(value) ? value : [];\n const allOptions = filter.options ?? [];\n const options = this.visibleOptions(filter);\n const usesSubtext = choiceListUsesSubtext(\n allOptions.map(option => ({\n label: option.label,\n value: option.value,\n subtext: option.description,\n }))\n );\n if (!options.length) return this.renderNoOptionResults();\n return options.map((option, index) => {\n const isSelected =\n filter.kind === 'multiple' ? selected.includes(option.value) : value === option.value;\n return (\n <ChoiceOptionRow\n size=\"md\"\n id={`${this.generatedId}-${filter.id}-option-${index}`}\n option={{\n label: option.label,\n value: option.value,\n subtext: option.description,\n isInactive: option.isInactive,\n }}\n selected={isSelected}\n active={index === this.activeOptionIndex}\n focusRingVisible={this.focusRingVisible}\n usesSubtext={usesSubtext}\n tabIndex={index === this.activeOptionIndex ? 0 : -1}\n leading={\n filter.kind === 'multiple' ? (\n <span\n class=\"ds-choice-item__icon ds-control-icon-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-checkbox label=\"\" size=\"md\" checked={isSelected} presentation />\n </span>\n ) : undefined\n }\n onFocus={() => {\n this.activeOptionIndex = index;\n }}\n onKeyDown={(event: KeyboardEvent) =>\n this.handleOptionKeyDown(event, filter, option, index, values, options)\n }\n onHover={() => {\n this.focusRingVisible = false;\n this.activeOptionIndex = index;\n }}\n onSelect={() => this.selectOption(filter, option, values)}\n />\n );\n });\n }\n\n if (filter.kind === 'boolean') {\n const [option] = this.visibleOptions(filter);\n if (!option) return this.renderNoOptionResults();\n return (\n <ChoiceOptionRow\n size=\"md\"\n id={`${this.generatedId}-${filter.id}-option-0`}\n option={{\n label: option.label,\n value: option.value,\n subtext: option.description,\n }}\n selected={value === true}\n active\n focusRingVisible={this.focusRingVisible}\n usesSubtext={Boolean(option.description)}\n tabIndex={0}\n leading={\n <span\n class=\"ds-choice-item__icon ds-control-icon-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-checkbox label=\"\" size=\"md\" checked={value === true} presentation />\n </span>\n }\n onKeyDown={(event: KeyboardEvent) => {\n if (event.key === 'ArrowLeft') this.handlePanelKeyDown(event, filter.id);\n else if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.dsChange.emit({ filterId: filter.id, value: value !== true });\n }\n }}\n onHover={() => {\n this.focusRingVisible = false;\n }}\n onSelect={() => this.dsChange.emit({ filterId: filter.id, value: value !== true })}\n />\n );\n }\n\n return this.renderDateFilter(filter, value);\n }\n\n private get captionIconOnly(): boolean {\n return (\n this.collapseLabel && this.captionCompact && this.usesInternalTrigger && Boolean(this.icon)\n );\n }\n\n private syncCaptionCompactObserver(): void {\n this.disconnectCaptionCompactObserver();\n if (!this.collapseLabel) {\n if (this.captionCompact) this.captionCompact = false;\n return;\n }\n this.captionCompactDisconnect = observeTableCaptionCompact(this.el, compact => {\n if (this.captionCompact !== compact) this.captionCompact = compact;\n });\n }\n\n private disconnectCaptionCompactObserver(): void {\n this.captionCompactDisconnect?.();\n this.captionCompactDisconnect = undefined;\n }\n\n private renderCaptionTooltip(trigger: VNode, label: string): VNode {\n if (!this.collapseLabel) return trigger;\n return (\n <ds-tooltip label={label} side=\"top\" size=\"sm\">\n {trigger}\n </ds-tooltip>\n );\n }\n\n private renderFooter(totalSelected: number, categoriesClear: boolean) {\n return (\n <div\n class={{\n 'filter-menu__footer': true,\n 'filter-menu__footer--categories-clear': categoriesClear,\n 'ds-choice-footer': true,\n }}\n aria-hidden={categoriesClear && totalSelected === 0 ? 'true' : undefined}\n >\n <div class=\"ds-choice-footer__content ds-control--md\">\n {!categoriesClear ? (\n <ds-text\n class=\"ds-choice-footer__summary\"\n as=\"span\"\n variant=\"text-body-medium\"\n color=\"secondary\"\n aria-live=\"polite\"\n >\n {totalSelected} selected\n </ds-text>\n ) : null}\n {totalSelected > 0 ? (\n <button\n class=\"filter-menu__clear ds-choice-footer__clear ds-text-action\"\n type=\"button\"\n onClick={() => {\n this.pendingRangeStartByFilter = {};\n this.dsClear.emit();\n }}\n >\n <ds-text as=\"span\" variant=\"text-body-medium\" color=\"inherit\">\n {this.clearLabel}\n </ds-text>\n </button>\n ) : null}\n </div>\n </div>\n );\n }\n\n private renderMatchModeFooter(filter: FilterMenuFilter, matchModes: FilterMenuMatchModes) {\n const mode: FilterMenuMatchMode = matchModes[filter.id] === 'all' ? 'all' : 'any';\n const nextMode: FilterMenuMatchMode = mode === 'any' ? 'all' : 'any';\n return (\n <div class=\"filter-menu__match-mode-footer ds-choice-footer\">\n <div class=\"filter-menu__match-mode-content ds-choice-footer__content ds-control--md\">\n <ds-text as=\"span\" variant=\"text-body-medium\" color=\"secondary\">\n Limit results to\n </ds-text>\n <button\n class=\"filter-menu__match-mode-toggle ds-text-action ds-focus-ring\"\n type=\"button\"\n aria-label={`Limit ${filter.label} results to ${nextMode} selected`}\n onClick={() => this.dsMatchModeChange.emit({ filterId: filter.id, mode: nextMode })}\n onKeyDown={(event: KeyboardEvent) => this.handlePanelKeyDown(event, filter.id)}\n >\n <ds-text as=\"span\" variant=\"text-body-medium\" color=\"inherit\">\n {mode}\n </ds-text>\n </button>\n <ds-text as=\"span\" variant=\"text-body-medium\" color=\"secondary\">\n selected\n </ds-text>\n </div>\n </div>\n );\n }\n\n render() {\n const state =\n this.closing && this.closingSnapshot\n ? this.closingSnapshot\n : {\n filters: this.filters,\n values: this.values,\n matchModes: this.matchModes,\n activeFilterId: this.activeFilterId,\n };\n const activeFilter = this.selectedFilter(state.filters, state.activeFilterId);\n const totalSelected = this.totalSelected(state.filters, state.values);\n const activeFilterCount = this.activeFilterCount(state.filters, state.values);\n const hasActiveFilters = activeFilterCount > 0;\n const categoriesClearFooter = this.footerLayout === 'categories-clear';\n const label = `${this.triggerLabel}${\n this.showSelectedCount && hasActiveFilters ? ` · ${activeFilterCount}` : ''\n }`;\n const textVariant = CONTROL_TEXT_VARIANT[this.size];\n const iconSize = ICON_SIZE[this.size];\n const popupId = `${this.generatedId}-popup`;\n const popupStyle: Record<string, string> = {\n position: 'fixed',\n left: '0',\n top: '0',\n width: this.menuWidth,\n transform: `translate(${Math.round(this.pos.x)}px, ${Math.round(this.pos.y)}px)`,\n zIndex: '9998',\n visibility: this.positionReady ? 'visible' : 'hidden',\n };\n\n return (\n <Host\n class={{\n 'filter-menu-host': true,\n 'filter-menu-host--external-trigger': !this.usesInternalTrigger,\n 'ds-select-trigger-host': this.usesInternalTrigger,\n [`ds-control--${this.size}`]: true,\n 'ds-table-caption-control': this.collapseLabel,\n 'ds-table-caption-control--compact': this.captionIconOnly,\n ...controlWidthClass(this.width),\n }}\n >\n {this.usesInternalTrigger\n ? this.renderCaptionTooltip(\n <button\n ref={element => {\n this.triggerElement = (element as HTMLButtonElement) ?? null;\n }}\n id={this.inputId ?? `${this.generatedId}-trigger`}\n type=\"button\"\n class={{\n trigger: true,\n 'ds-control-frame': true,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n 'ds-interaction-fill--selected': this.activeFill && hasActiveFilters,\n 'trigger--expanded': this.open || this.closing,\n 'ds-interaction-fill--surface-open': this.open || this.closing,\n 'trigger--bordered': this.hasBorder,\n 'trigger--has-value': hasActiveFilters,\n [`ds-control--${this.size}`]: true,\n }}\n role=\"combobox\"\n aria-haspopup=\"dialog\"\n aria-expanded={String(this.open)}\n aria-controls={this.open ? popupId : undefined}\n aria-label={this.ariaLabel ?? this.menuLabel}\n onClick={(event: MouseEvent) => this.toggleFromTrigger(event)}\n onKeyDown={(event: KeyboardEvent) => this.handleTriggerKeyDown(event)}\n >\n {this.icon ? (\n <span\n class=\"trigger__prefix ds-control-icon-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-icon name={this.icon} size={iconSize} color=\"inherit\" />\n </span>\n ) : null}\n {this.captionIconOnly ? null : (\n <ds-text\n class=\"trigger__label-box trigger__label trigger__label-content ds-control-label-box ds-interaction-fill__content\"\n as=\"span\"\n variant={textVariant}\n color=\"inherit\"\n lineTruncation={1}\n >\n {label}\n </ds-text>\n )}\n {this.captionIconOnly ? null : (\n <span\n class=\"trigger__chevron ds-control-icon-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-icon name=\"ChevronDown\" size={iconSize} color=\"inherit\" />\n </span>\n )}\n </button>,\n this.captionIconOnly ? label : ''\n )\n : null}\n\n {this.shouldRender ? (\n <div\n id={popupId}\n popover=\"manual\"\n class={{\n 'filter-menu-popup': true,\n 'ds-choice-popup': true,\n 'ds-choice-popup--closing': this.closing,\n }}\n style={popupStyle}\n role=\"dialog\"\n aria-label={this.menuLabel}\n >\n {activeFilter ? (\n <div class=\"filter-menu\">\n <div class=\"filter-menu__body\">\n <div class=\"filter-menu__category-pane\">\n <div\n class=\"filter-menu__categories ds-choice-list ds-chrome-column ds-chrome-space--sm\"\n role=\"tablist\"\n aria-label={this.categoriesLabel}\n aria-orientation=\"vertical\"\n >\n {state.filters.map(filter => {\n const active = filter.id === activeFilter.id;\n const count = this.selectedCount(filter, state.values);\n return (\n <div\n key={filter.id}\n class={{\n 'filter-menu__category-section': true,\n 'ds-choice-section--divided': Boolean(filter.divider),\n }}\n >\n <button\n id={`${this.generatedId}-${filter.id}-tab`}\n type=\"button\"\n role=\"tab\"\n data-filter-category={filter.id}\n class={{\n 'filter-menu__category': true,\n 'filter-menu__category--active': active,\n 'ds-choice-item': true,\n 'ds-control-frame': true,\n 'ds-control--md': true,\n 'ds-focus-ring-inset': true,\n 'ds-focus-ring--visible': active && this.focusRingVisible,\n 'ds-interaction-fill': true,\n 'ds-interaction-fill--selected': active,\n }}\n aria-selected={String(active)}\n aria-controls={`${this.generatedId}-panel`}\n tabIndex={active ? 0 : -1}\n onMouseDown={() => {\n this.focusRingVisible = false;\n }}\n onClick={() => this.selectCategory(filter.id)}\n onKeyDown={(event: KeyboardEvent) =>\n this.handleCategoryKeyDown(event, state.filters, filter.id)\n }\n >\n <ds-text\n class=\"ds-choice-item__content ds-choice-item__label ds-control-label-box ds-interaction-fill__content\"\n as=\"span\"\n variant=\"text-body-medium\"\n color={active ? 'primary' : 'secondary'}\n >\n {filter.label}\n </ds-text>\n {count > 0 && filter.kind === 'date' ? (\n <span\n class=\"filter-menu__category-dot-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-badge variant=\"dot\" hasRing={false} label=\"\" />\n </span>\n ) : count > 0 ? (\n <ds-tag\n class=\"ds-choice-item__tag ds-interaction-fill__content\"\n label={String(count)}\n size=\"sm\"\n intent=\"brand\"\n contrast=\"bold\"\n isInset\n rounded\n />\n ) : null}\n </button>\n </div>\n );\n })}\n </div>\n {categoriesClearFooter ? this.renderFooter(totalSelected, true) : null}\n </div>\n\n <div\n id={`${this.generatedId}-panel`}\n class={{\n 'filter-menu__options': true,\n 'filter-menu__options--date': activeFilter.kind === 'date',\n }}\n role=\"tabpanel\"\n aria-labelledby={`${this.generatedId}-${activeFilter.id}-tab`}\n >\n {activeFilter.kind === 'date' ? null : this.renderOptionSearch(activeFilter)}\n <div class=\"filter-menu__options-content\">\n {activeFilter.kind === 'date' ? (\n <div key={activeFilter.id} class=\"filter-menu__option-list--date\">\n {this.renderOptions(activeFilter, state.values)}\n </div>\n ) : (\n <div\n id={`${this.generatedId}-${activeFilter.id}-options`}\n key={activeFilter.id}\n class=\"filter-menu__option-list ds-choice-list ds-chrome-column ds-chrome-space--sm\"\n role=\"listbox\"\n aria-label={activeFilter.label}\n aria-multiselectable={\n activeFilter.kind === 'multiple' ? 'true' : undefined\n }\n >\n {this.renderOptions(activeFilter, state.values)}\n </div>\n )}\n </div>\n {activeFilter.kind === 'multiple'\n ? this.renderMatchModeFooter(activeFilter, state.matchModes)\n : null}\n </div>\n </div>\n\n {!categoriesClearFooter && totalSelected > 0\n ? this.renderFooter(totalSelected, false)\n : null}\n </div>\n ) : null}\n </div>\n ) : null}\n </Host>\n );\n }\n}\n",
800
- "type": "registry:ui"
801
- },
802
- {
803
- "path": "src/wc/components/FilterMenu/filter-menu-calendar.ts",
804
- "content": "import { isIsoCalendarDate, shiftIsoCalendarDate } from '../../utils';\n\nexport interface FilterMenuCalendarDay {\n value: string;\n day: number;\n inMonth: boolean;\n label: string;\n}\n\nexport const FILTER_MENU_WEEKDAYS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\nconst MONTH_FORMATTER = new Intl.DateTimeFormat('en-US', {\n month: 'long',\n year: 'numeric',\n timeZone: 'UTC',\n});\nconst DATE_FORMATTER = new Intl.DateTimeFormat('en-US', {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n timeZone: 'UTC',\n});\n\nexport function filterMenuToday(): string {\n const today = new Date();\n const year = today.getFullYear();\n const month = String(today.getMonth() + 1).padStart(2, '0');\n const day = String(today.getDate()).padStart(2, '0');\n return `${year}-${month}-${day}`;\n}\n\nexport function filterMenuCalendarMonth(value: string): string {\n return isIsoCalendarDate(value) ? value.slice(0, 7) : filterMenuToday().slice(0, 7);\n}\n\nexport function shiftFilterMenuCalendarMonth(value: string, offset: number): string {\n const [year, month] = value.split('-').map(Number);\n const date = new Date(Date.UTC(year, month - 1 + offset, 1));\n return `${date.getUTCFullYear()}-${String(date.getUTCMonth() + 1).padStart(2, '0')}`;\n}\n\nexport function filterMenuCalendarMonthLabel(value: string): string {\n const [year, month] = value.split('-').map(Number);\n return MONTH_FORMATTER.format(new Date(Date.UTC(year, month - 1, 1)));\n}\n\nexport function filterMenuCalendarDays(value: string): FilterMenuCalendarDay[] {\n const [year, month] = value.split('-').map(Number);\n const firstOfMonth = `${year}-${String(month).padStart(2, '0')}-01`;\n const firstWeekday = new Date(`${firstOfMonth}T00:00:00Z`).getUTCDay();\n const gridStart = shiftIsoCalendarDate(firstOfMonth, -firstWeekday);\n return Array.from({ length: 42 }, (_, index) => {\n const dateValue = shiftIsoCalendarDate(gridStart, index);\n const date = new Date(`${dateValue}T00:00:00Z`);\n return {\n value: dateValue,\n day: date.getUTCDate(),\n inMonth: dateValue.startsWith(`${value}-`),\n label: DATE_FORMATTER.format(date),\n };\n });\n}\n",
887
+ "content": "import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n type VNode,\n Watch,\n} from '@stencil/core';\nimport {\n CONTROL_TEXT_VARIANT,\n DATE_FILTER_RELATIVE_PRESETS,\n controlWidthClass,\n dateFilterRelativeValue,\n parseDateFilterValue,\n resolveChoicePopupAlignOffset,\n resolveCssLengthPx,\n resolveMotionTimeMs,\n TOKEN_CSS_LENGTHS,\n TOKEN_DEFAULTS,\n type ControlWidth,\n} from '../../utils';\nimport { observeTableCaptionCompact } from '../../utils/table-caption-compact';\nimport type { AnchoredAlign, AnchoredSide } from '../../utils/anchored-position';\nimport { AnchoredPositionController } from '../../utils/anchored-position-controller';\nimport { AnchoredOverlayInteractionController } from '../../utils/anchored-overlay-interaction-controller';\nimport { resolveAnchoredOverlayBoundaryRect } from '../../utils/anchored-overlay-boundary';\nimport { ChoiceOptionRow, ChoiceSearch } from '../../utils/choice-list-parts';\nimport { choiceListUsesSubtext } from '../../utils/choice-list';\n\nexport type FilterMenuFilterKind = 'single' | 'multiple' | 'boolean' | 'date';\nexport type FilterMenuSize = 'lg' | 'md' | 'sm' | 'xs';\nexport type FilterMenuWidth = ControlWidth;\nexport type FilterMenuFooterLayout = 'summary' | 'categories-clear';\nexport type FilterMenuMatchMode = 'any' | 'all';\ntype FilterMenuDateMode = 'range' | 'relative';\n\nexport interface FilterMenuOption {\n label: string;\n value: string;\n description?: string;\n isInactive?: boolean;\n}\n\nexport interface FilterMenuFilter {\n id: string;\n label: string;\n kind: FilterMenuFilterKind;\n options?: FilterMenuOption[];\n description?: string;\n fieldLabel?: string;\n /** Draw a standard menu-section divider after this category. */\n divider?: boolean;\n}\n\nexport type FilterMenuValue = string[] | boolean | string;\nexport type FilterMenuValues = Record<string, FilterMenuValue | undefined>;\nexport type FilterMenuMatchModes = Record<string, FilterMenuMatchMode | undefined>;\n\nexport interface FilterMenuChangeDetail {\n filterId: string;\n value: FilterMenuValue;\n}\n\nexport interface FilterMenuMatchModeChangeDetail {\n filterId: string;\n mode: FilterMenuMatchMode;\n}\n\nlet filterMenuId = 0;\n\nconst ICON_SIZE: Record<FilterMenuSize, 'lg' | 'md' | 'sm' | 'xs'> = {\n lg: 'lg',\n md: 'md',\n sm: 'sm',\n xs: 'xs',\n};\n\nconst DATE_MODE_TABS = [\n { id: 'relative', label: 'Relative' },\n { id: 'range', label: 'Range' },\n];\n\nconst RELATIVE_DATE_OPTIONS: FilterMenuOption[] = DATE_FILTER_RELATIVE_PRESETS.map(preset => ({\n label: preset.label,\n value: dateFilterRelativeValue(preset.value),\n}));\n\n@Component({\n tag: 'ds-filter-menu',\n styleUrl: 'FilterMenu.css',\n scoped: true,\n})\nexport class FilterMenu {\n @Element() el!: HTMLElement;\n\n /** Controlled popup visibility. */\n /** Render content inside a parent-owned surface; the parent owns dismissal and positioning. */\n @Prop() embedded: boolean = false;\n /** Stacked, collapsible sections for a configuration panel. */\n @Prop() vertical: boolean = false;\n @Prop({ mutable: true }) open: boolean = false;\n /** Select trigger text. */\n @Prop() triggerLabel: string = 'Filters';\n /** Append the active-filter count to the visible trigger label. */\n @Prop() showSelectedCount: boolean = true;\n /** Optional select trigger prefix icon name. */\n @Prop() icon: string | undefined = 'Filters';\n /** Select trigger density. */\n @Prop() size: FilterMenuSize = 'md';\n /** Select trigger width fit. */\n @Prop() width: FilterMenuWidth = 'hug';\n /** Show the surface-aware inset border around the select trigger. */\n /** Show the trigger chevron. */\n @Prop() showIndicator: boolean = true;\n @Prop() hasBorder: boolean = true;\n /** Show selected interaction fill when one or more criteria are active. */\n /** Keep trigger colors neutral when a value is selected. */\n @Prop() neutralTrigger: boolean = false;\n /** Stage filter edits until Apply is pressed. */\n @Prop() applyRequired: boolean = false;\n @State() private draftValues?: FilterMenuValues;\n @State() private draftModes?: FilterMenuMatchModes;\n\n private changeValue(detail: FilterMenuChangeDetail): void {\n if (this.applyRequired)\n this.draftValues = { ...(this.draftValues ?? this.values), [detail.filterId]: detail.value };\n else this.dsChange.emit(detail);\n }\n private changeMode(detail: FilterMenuMatchModeChangeDetail): void {\n if (this.applyRequired)\n this.draftModes = { ...(this.draftModes ?? this.matchModes), [detail.filterId]: detail.mode };\n else this.dsMatchModeChange.emit(detail);\n }\n private get hasPendingChanges(): boolean {\n const normalize = (value: FilterMenuValue | undefined) =>\n Array.isArray(value) ? (value.length ? [...value].sort() : undefined) : value || undefined;\n const values = this.draftValues ?? this.values;\n const modes = this.draftModes ?? this.matchModes;\n return this.filters.some(\n filter =>\n JSON.stringify(normalize(values[filter.id])) !==\n JSON.stringify(normalize(this.values[filter.id])) ||\n (modes[filter.id] ?? 'any') !== (this.matchModes[filter.id] ?? 'any')\n );\n }\n private applyDraft(): void {\n if (!this.hasPendingChanges) return;\n if (this.draftValues && Object.keys(this.draftValues).length === 0) {\n this.dsClear.emit();\n } else if (this.draftValues) {\n for (const id of new Set([...Object.keys(this.values), ...Object.keys(this.draftValues)])) {\n if (JSON.stringify(this.values[id]) !== JSON.stringify(this.draftValues[id]))\n this.dsChange.emit({\n filterId: id,\n value:\n this.draftValues[id] ??\n (Array.isArray(this.values[id])\n ? []\n : typeof this.values[id] === 'boolean'\n ? false\n : ''),\n });\n }\n }\n if (this.draftModes) {\n for (const filterId of new Set([\n ...Object.keys(this.matchModes),\n ...Object.keys(this.draftModes),\n ])) {\n const mode = this.draftModes[filterId] ?? 'any';\n if ((this.matchModes[filterId] ?? 'any') !== mode)\n this.dsMatchModeChange.emit({ filterId, mode });\n }\n }\n }\n @Prop() activeFill: boolean = false;\n /**\n * Opt into table-caption icon-only chrome below 900px. The trigger omits its\n * visible label and chevron; keep an accessible name via aria-label.\n */\n @Prop({ reflect: true }) collapseLabel: boolean = false;\n /** ID applied to the internal select trigger. */\n @Prop() inputId: string | undefined;\n /** Direct accessible name for the internal select trigger. */\n @Prop({ attribute: 'aria-label' }) ariaLabel: string | null = null;\n /** Product-owned filter categories and option definitions. */\n @Prop() filters: FilterMenuFilter[] = [];\n /** Controlled values keyed by filter id. */\n @Prop() values: FilterMenuValues = {};\n /** Controlled any/all match mode keyed by multiple-choice filter id. Defaults to any. */\n @Prop() matchModes: FilterMenuMatchModes = {};\n /** Controlled category shown in the option pane. */\n @Prop() activeFilterId: string | undefined;\n /** External trigger element to position against. */\n @Prop() anchor: HTMLElement | undefined;\n /** ID of the external trigger element used for positioning and focus return. */\n @Prop() anchorId: string | undefined;\n /** Explicit collision owner; otherwise the nearest data-ds-overlay-boundary ancestor is used. */\n @Prop() boundary: HTMLElement | undefined;\n /** Preferred popup side; collision handling may flip it. */\n @Prop() side: AnchoredSide = 'bottom';\n /** Cross-axis alignment against the trigger. */\n @Prop() align: AnchoredAlign = 'end';\n /** Gap between trigger and popup — number in px or a TokoMo length. */\n @Prop() sideOffset: number | string = TOKEN_CSS_LENGTHS.space050;\n /** Cross-axis offset — number in px or a TokoMo length. */\n @Prop() alignOffset: number | string = 0;\n /** Popup width. It remains clamped to its collision boundary by the component recipe. */\n @Prop() menuWidth: string = TOKEN_CSS_LENGTHS.menuWidthLg;\n /** Accessible name for the non-modal filter dialog. */\n @Prop() menuLabel: string = 'Filters';\n /** Accessible name for the category tab list. */\n @Prop() categoriesLabel: string = 'Filter categories';\n /** Footer action and date-clear accessible label. */\n @Prop() clearLabel: string = 'Clear';\n /** Placeholder shown in each non-date option search header. */\n @Prop() searchPlaceholder: string = 'Search';\n /** Empty-state text shown when an option search has no matches. */\n @Prop() noResultsText: string = 'No results';\n /** Footer recipe: full-width selected summary or reserved category-pane Clear action. */\n @Prop() footerLayout: FilterMenuFooterLayout = 'summary';\n /** Show a visible focus ring on initial entry after keyboard activation. */\n @Prop() initialFocusVisible: boolean = false;\n\n @State() private shouldRender = false;\n @State() private closing = false;\n @State() private positionReady = false;\n @State() private pos: { x: number; y: number } = { x: 0, y: 0 };\n @State() private focusRingVisible = false;\n @State() private activeOptionIndex = 0;\n @State() private captionCompact = false;\n @State() private dateModeByFilter: Record<string, FilterMenuDateMode> = {};\n @State() private optionQueryByFilter: Record<string, string> = {};\n\n /** Requests a controlled value replacement without closing the popup. */\n @Event() dsChange!: EventEmitter<FilterMenuChangeDetail>;\n /** Requests that the consumer clear every filter value. */\n @Event() dsClear!: EventEmitter<void>;\n /** Requests a controlled any/all mode replacement for a multiple-choice filter. */\n @Event() dsMatchModeChange!: EventEmitter<FilterMenuMatchModeChangeDetail>;\n /** Requests a controlled active-category replacement. */\n @Event() dsActiveFilterChange!: EventEmitter<string>;\n /** Requests that the controlled popup close. */\n @Event() dsClose!: EventEmitter<void>;\n /** Emitted whenever internal select-trigger activation changes popup visibility. */\n @Event() dsOpenChange!: EventEmitter<boolean>;\n /** Emitted after exit motion and rendered popup removal complete. */\n @Event() dsAfterClose!: EventEmitter<void>;\n\n private readonly generatedId = `ds-filter-menu-${++filterMenuId}`;\n private triggerElement: HTMLButtonElement | null = null;\n private pendingInitialFocusVisible = false;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n private captionCompactDisconnect: (() => void) | undefined;\n private hasLoaded = false;\n private closingSnapshot: {\n filters: FilterMenuFilter[];\n values: FilterMenuValues;\n matchModes: FilterMenuMatchModes;\n activeFilterId: string | undefined;\n } | null = null;\n\n private readonly position = new AnchoredPositionController({\n getAnchor: () => this.resolvedAnchor,\n getPopup: () => this.el.querySelector<HTMLElement>('.filter-menu-popup'),\n getOwnerDocument: () => this.el.ownerDocument,\n measure: (anchor, popup) => {\n if (!this.open) return null;\n const anchorRect = anchor.getBoundingClientRect();\n const sectionInsetPx = resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050);\n return {\n anchorRect,\n popupWidth: popup.offsetWidth || this.popupFallbackWidth,\n popupHeight: popup.offsetHeight || this.popupFallbackHeight,\n side: this.side,\n align: this.align,\n sideOffsetPx: resolveCssLengthPx(this.sideOffset, TOKEN_DEFAULTS.space050),\n alignOffsetPx: resolveChoicePopupAlignOffset({\n align: this.align,\n alignOffsetPx: resolveCssLengthPx(this.alignOffset, 0),\n sectionInsetPx,\n }),\n viewportPadPx: this.viewportPad,\n viewportWidth: window.innerWidth,\n viewportHeight: window.innerHeight,\n collisionRect: resolveAnchoredOverlayBoundaryRect(anchor, this.boundary),\n };\n },\n apply: ({ x, y }) => {\n this.pos = { x, y };\n },\n onReady: () => {\n this.positionReady = true;\n },\n liveUpdate: 'double-frame',\n observeResize: true,\n topLayer: true,\n });\n private readonly interaction = new AnchoredOverlayInteractionController({\n getAnchor: () => this.resolvedAnchor,\n getPopup: () => this.el.querySelector<HTMLElement>('.filter-menu-popup'),\n getOwnerDocument: () => this.el.ownerDocument,\n onOutsideActivation: () => this.close(),\n });\n\n componentDidLoad() {\n this.hasLoaded = true;\n this.syncCaptionCompactObserver();\n if (this.open) this.onOpenChange(true);\n }\n\n connectedCallback() {\n if (!this.hasLoaded) return;\n this.syncCaptionCompactObserver();\n if (this.open) this.onOpenChange(true);\n }\n\n disconnectedCallback() {\n this.disconnectCaptionCompactObserver();\n this.position.unobserve();\n this.teardownListeners();\n }\n\n @Watch('collapseLabel')\n onCollapseLabelChange() {\n this.syncCaptionCompactObserver();\n }\n\n @Watch('open')\n onOpenChange(isOpen: boolean) {\n if (!isOpen) {\n this.draftValues = undefined;\n this.draftModes = undefined;\n }\n if (this.embedded) return;\n if (isOpen) {\n this.teardownListeners();\n this.closingSnapshot = null;\n this.shouldRender = true;\n this.closing = false;\n this.positionReady = false;\n this.focusRingVisible = this.pendingInitialFocusVisible || this.initialFocusVisible;\n this.setupListeners();\n this.position.schedule(() => this.focusInitialCategory());\n return;\n }\n\n if (!this.shouldRender) return;\n this.position.cancel();\n this.captureClosingSnapshot();\n this.closing = true;\n this.teardownListeners();\n const duration = resolveMotionTimeMs(\n TOKEN_DEFAULTS.motionShort2,\n TOKEN_DEFAULTS.animationDurationShort3\n );\n if (duration <= 0) {\n this.finishClose();\n return;\n }\n this.closeTimer = setTimeout(() => this.finishClose(), duration);\n }\n\n @Watch('anchor')\n @Watch('anchorId')\n @Watch('boundary')\n @Watch('side')\n @Watch('align')\n @Watch('sideOffset')\n @Watch('alignOffset')\n @Watch('menuWidth')\n onPositionInputChange() {\n if (this.open) this.position.schedule();\n }\n\n @Listen('keydown')\n handleKeyDown(event: KeyboardEvent) {\n if (this.embedded && (event.key === 'Escape' || event.key === 'Tab')) return;\n if ((!this.shouldRender && !this.embedded) || this.closing) return;\n if (event.key === 'Escape') {\n event.preventDefault();\n this.close();\n return;\n }\n if (event.key !== 'Tab' || !this.tabLeavesPopup(event)) return;\n event.preventDefault();\n this.close(false);\n this.interaction.moveFocusAfterTab(event.shiftKey);\n }\n\n private get resolvedAnchor(): HTMLElement | null {\n if (this.anchor) return this.anchor;\n if (this.anchorId) return document.getElementById(this.anchorId);\n return this.triggerElement;\n }\n\n private get usesInternalTrigger(): boolean {\n return !this.embedded && !this.anchor && !this.anchorId;\n }\n\n private get viewportPad(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050);\n }\n\n private get popupFallbackWidth(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.menuWidthLg, TOKEN_DEFAULTS.menuWidthLg);\n }\n\n private get popupFallbackHeight(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.menuFallbackHeight, TOKEN_DEFAULTS.menuFallbackHeight);\n }\n\n private setupListeners() {\n this.interaction.connect();\n this.position.observe();\n }\n\n private teardownListeners() {\n this.position.unobserve();\n this.interaction.disconnect();\n if (this.closeTimer) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n }\n\n private close(restoreFocus = true) {\n this.captureClosingSnapshot();\n if (restoreFocus) this.interaction.focusAnchor();\n this.dsOpenChange.emit(false);\n this.dsClose.emit();\n this.open = false;\n this.onOpenChange(false);\n }\n\n private toggleFromTrigger(event: MouseEvent) {\n if (this.open) {\n this.close();\n return;\n }\n this.pendingInitialFocusVisible = event.detail === 0;\n this.open = true;\n this.dsOpenChange.emit(true);\n this.onOpenChange(true);\n }\n\n private handleTriggerKeyDown(event: KeyboardEvent) {\n if (event.key !== 'ArrowDown' || this.open) return;\n event.preventDefault();\n this.pendingInitialFocusVisible = true;\n this.open = true;\n this.dsOpenChange.emit(true);\n this.onOpenChange(true);\n }\n\n private finishClose() {\n const popup = this.el.querySelector<HTMLElement>('.filter-menu-popup');\n if (popup?.matches(':popover-open')) popup.hidePopover();\n this.shouldRender = false;\n this.closing = false;\n this.closingSnapshot = null;\n this.closeTimer = null;\n this.dateModeByFilter = {};\n this.optionQueryByFilter = {};\n this.dsAfterClose.emit();\n }\n\n private captureClosingSnapshot() {\n if (this.closingSnapshot) return;\n this.closingSnapshot = {\n filters: this.filters.map(filter => ({\n ...filter,\n options: filter.options?.map(option => ({ ...option })),\n })),\n values: Object.fromEntries(\n Object.entries(this.values).map(([key, value]) => [\n key,\n Array.isArray(value) ? [...value] : value,\n ])\n ),\n matchModes: { ...this.matchModes },\n activeFilterId: this.activeFilterId,\n };\n }\n\n private focusInitialCategory() {\n requestAnimationFrame(() => {\n this.el.querySelector<HTMLElement>('.filter-menu__category[tabindex=\"0\"]')?.focus();\n this.pendingInitialFocusVisible = false;\n });\n }\n\n private tabLeavesPopup(event: KeyboardEvent): boolean {\n return this.interaction.tabLeavesPopup(event);\n }\n\n private selectedFilter(filters: FilterMenuFilter[], activeFilterId: string | undefined) {\n return filters.find(filter => filter.id === activeFilterId) ?? filters[0];\n }\n\n private selectedCount(filter: FilterMenuFilter, values: FilterMenuValues): number {\n const value = values[filter.id];\n if (filter.kind === 'multiple') return Array.isArray(value) ? value.length : 0;\n if (filter.kind === 'boolean') return value === true ? 1 : 0;\n return typeof value === 'string' && value.length > 0 ? 1 : 0;\n }\n\n private totalSelected(filters: FilterMenuFilter[], values: FilterMenuValues): number {\n return filters.reduce((total, filter) => total + this.selectedCount(filter, values), 0);\n }\n\n private activeFilterCount(filters: FilterMenuFilter[], values: FilterMenuValues): number {\n return filters.filter(filter => this.selectedCount(filter, values) > 0).length;\n }\n\n private selectCategory(filterId: string, focus = false) {\n this.activeOptionIndex = 0;\n this.dsActiveFilterChange.emit(filterId);\n if (!focus) return;\n requestAnimationFrame(() => {\n this.el.querySelector<HTMLElement>(`[data-filter-category=\"${filterId}\"]`)?.focus();\n });\n }\n\n private handleCategoryKeyDown(\n event: KeyboardEvent,\n filters: FilterMenuFilter[],\n filterId: string\n ) {\n const currentIndex = filters.findIndex(filter => filter.id === filterId);\n let nextIndex: number;\n if (event.key === 'ArrowDown') nextIndex = (currentIndex + 1) % filters.length;\n else if (event.key === 'ArrowUp')\n nextIndex = (currentIndex - 1 + filters.length) % filters.length;\n else if (event.key === 'Home') nextIndex = 0;\n else if (event.key === 'End') nextIndex = filters.length - 1;\n else if (event.key === 'ArrowRight') {\n event.preventDefault();\n requestAnimationFrame(() => {\n this.el\n .querySelector<HTMLElement>(\n '.filter-menu__options [role=\"option\"], .filter-menu__options [data-date-option], .filter-menu__options input'\n )\n ?.focus();\n });\n return;\n } else return;\n\n event.preventDefault();\n this.focusRingVisible = true;\n this.selectCategory(filters[nextIndex].id, true);\n }\n\n private handlePanelKeyDown(event: KeyboardEvent, filterId: string) {\n if (event.key !== 'ArrowLeft') return;\n event.preventDefault();\n this.el.querySelector<HTMLElement>(`[data-filter-category=\"${filterId}\"]`)?.focus();\n }\n\n private handleOptionKeyDown(\n event: KeyboardEvent,\n filter: FilterMenuFilter,\n option: FilterMenuOption,\n index: number,\n values: FilterMenuValues,\n visibleOptions: FilterMenuOption[] = filter.options ?? []\n ) {\n if (event.key === 'ArrowLeft') {\n this.handlePanelKeyDown(event, filter.id);\n return;\n }\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.selectOption(filter, option, values);\n return;\n }\n if (!['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) return;\n event.preventDefault();\n const enabled = visibleOptions\n .map((candidate, optionIndex) => ({ candidate, optionIndex }))\n .filter(({ candidate }) => !candidate.isInactive)\n .map(({ optionIndex }) => optionIndex);\n if (!enabled.length) return;\n const current = enabled.indexOf(index);\n let next: number;\n if (event.key === 'Home') next = enabled[0];\n else if (event.key === 'End') next = enabled[enabled.length - 1];\n else {\n const direction = event.key === 'ArrowDown' ? 1 : -1;\n const start = current >= 0 ? current : direction === 1 ? -1 : 0;\n next = enabled[(start + direction + enabled.length) % enabled.length];\n }\n this.activeOptionIndex = next;\n this.focusRingVisible = true;\n requestAnimationFrame(() => {\n this.el\n .querySelector<HTMLElement>(`#${this.generatedId}-${filter.id}-option-${next}`)\n ?.focus();\n });\n }\n\n private optionMatchesQuery(option: FilterMenuOption, query: string): boolean {\n const normalized = query.trim().toLocaleLowerCase();\n if (!normalized) return true;\n return `${option.label} ${option.description ?? ''}`.toLocaleLowerCase().includes(normalized);\n }\n\n private visibleOptions(\n filter: FilterMenuFilter,\n query = this.optionQueryByFilter[filter.id] ?? ''\n ) {\n if (filter.kind === 'boolean') {\n const option = this.booleanOption(filter);\n return this.optionMatchesQuery(option, query) ? [option] : [];\n }\n return (filter.options ?? []).filter(option => this.optionMatchesQuery(option, query));\n }\n\n private booleanOption(filter: FilterMenuFilter): FilterMenuOption {\n return {\n label: filter.fieldLabel ?? filter.label,\n value: 'true',\n description: filter.description,\n };\n }\n\n private setOptionQuery(filter: FilterMenuFilter, value: string) {\n const visibleOptions = this.visibleOptions(filter, value);\n const firstEnabled = visibleOptions.findIndex(option => !option.isInactive);\n this.activeOptionIndex = firstEnabled;\n this.focusRingVisible = false;\n this.optionQueryByFilter = { ...this.optionQueryByFilter, [filter.id]: value };\n requestAnimationFrame(() => {\n const content = this.el.querySelector<HTMLElement>('.filter-menu__options-content');\n if (content) content.scrollTop = 0;\n this.position.schedule();\n });\n }\n\n private handleOptionSearchKeyDown(event: KeyboardEvent, filter: FilterMenuFilter) {\n if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') return;\n const visibleOptions = this.visibleOptions(filter);\n const enabled = visibleOptions\n .map((option, index) => ({ option, index }))\n .filter(({ option }) => !option.isInactive)\n .map(({ index }) => index);\n if (!enabled.length) return;\n event.preventDefault();\n const next = event.key === 'ArrowDown' ? enabled[0] : enabled[enabled.length - 1];\n this.activeOptionIndex = next;\n this.focusRingVisible = true;\n requestAnimationFrame(() => {\n this.el\n .querySelector<HTMLElement>(`#${this.generatedId}-${filter.id}-option-${next}`)\n ?.focus();\n });\n }\n\n private toggleMultiple(\n filter: FilterMenuFilter,\n option: FilterMenuOption,\n checked: boolean,\n values: FilterMenuValues\n ) {\n if (option.isInactive) return;\n const current = Array.isArray(values[filter.id]) ? (values[filter.id] as string[]) : [];\n const selected = new Set(current);\n if (checked) selected.add(option.value);\n else selected.delete(option.value);\n const ordered = (filter.options ?? [])\n .map(candidate => candidate.value)\n .filter(value => selected.has(value));\n this.changeValue({ filterId: filter.id, value: ordered });\n }\n\n private selectOption(\n filter: FilterMenuFilter,\n option: FilterMenuOption,\n values: FilterMenuValues\n ) {\n if (option.isInactive) return;\n if (filter.kind === 'single') {\n this.changeValue({ filterId: filter.id, value: option.value });\n return;\n }\n const selected = Array.isArray(values[filter.id])\n ? (values[filter.id] as string[]).includes(option.value)\n : false;\n this.toggleMultiple(filter, option, !selected, values);\n }\n\n private dateMode(filterId: string, value: FilterMenuValue | undefined): FilterMenuDateMode {\n return this.dateModeByFilter[filterId] ?? parseDateFilterValue(value)?.kind ?? 'relative';\n }\n\n private setDateMode(filter: FilterMenuFilter, mode: string) {\n if (mode !== 'range' && mode !== 'relative') return;\n this.dateModeByFilter = { ...this.dateModeByFilter, [filter.id]: mode };\n this.activeOptionIndex = 0;\n }\n\n private renderRelativeDateOptions(filter: FilterMenuFilter, value: FilterMenuValue | undefined) {\n const relativeFilter: FilterMenuFilter = {\n ...filter,\n kind: 'single',\n options: RELATIVE_DATE_OPTIONS,\n };\n return (\n <div\n class=\"filter-menu__date-relative ds-choice-list ds-chrome-column ds-chrome-space--sm\"\n role=\"listbox\"\n aria-label=\"Relative date\"\n >\n {RELATIVE_DATE_OPTIONS.map((option, index) => (\n <ChoiceOptionRow\n size=\"md\"\n id={`${this.generatedId}-${filter.id}-relative-${index}`}\n option={option}\n selected={value === option.value}\n active={index === this.activeOptionIndex}\n focusRingVisible={this.focusRingVisible}\n usesSubtext={false}\n tabIndex={index === this.activeOptionIndex ? 0 : -1}\n onFocus={() => {\n this.activeOptionIndex = index;\n }}\n onKeyDown={(event: KeyboardEvent) =>\n this.handleOptionKeyDown(event, relativeFilter, option, index, {\n [filter.id]: value,\n })\n }\n onHover={() => {\n this.focusRingVisible = false;\n this.activeOptionIndex = index;\n }}\n onSelect={() => this.changeValue({ filterId: filter.id, value: option.value })}\n />\n ))}\n </div>\n );\n }\n\n private renderDateCalendar(filter: FilterMenuFilter, value: FilterMenuValue | undefined) {\n return (\n <ds-calendar\n selectionMode=\"range\"\n value={typeof value === 'string' ? value : ''}\n onDsChange={(event: CustomEvent<string>) => {\n event.stopPropagation();\n this.changeValue({ filterId: filter.id, value: event.detail });\n }}\n />\n );\n }\n\n private renderDateFilter(filter: FilterMenuFilter, value: FilterMenuValue | undefined) {\n const mode = this.dateMode(filter.id, value);\n return (\n <div class=\"filter-menu__date\">\n <header class=\"filter-menu__date-header ds-chrome-header ds-chrome-header--bounded\">\n <ds-tab-group\n ariaLabel=\"Date filter mode\"\n size=\"md\"\n width=\"fill\"\n hasContainer={false}\n value={mode}\n tabs={DATE_MODE_TABS}\n onDsChange={(event: CustomEvent<string>) => {\n event.stopPropagation();\n this.setDateMode(filter, event.detail);\n }}\n />\n </header>\n <div class=\"filter-menu__date-body\">\n {mode === 'relative'\n ? this.renderRelativeDateOptions(filter, value)\n : this.renderDateCalendar(filter, value)}\n </div>\n </div>\n );\n }\n\n private renderOptionSearch(filter: FilterMenuFilter) {\n return (\n <div class=\"filter-menu__option-search\">\n <ChoiceSearch\n size=\"md\"\n hasFocusBoundary={false}\n hasInteractionFill={false}\n value={this.optionQueryByFilter[filter.id] ?? ''}\n placeholder={this.searchPlaceholder}\n ariaLabel={`Search ${filter.label} options`}\n controls={`${this.generatedId}-${filter.id}-options`}\n inputRef={() => undefined}\n clearLabel={`Clear ${filter.label} search`}\n onValueChange={value => this.setOptionQuery(filter, value)}\n onKeyDown={(event: KeyboardEvent) => this.handleOptionSearchKeyDown(event, filter)}\n />\n </div>\n );\n }\n\n private renderNoOptionResults() {\n return (\n <div\n class=\"ds-choice-empty ds-empty-region\"\n role=\"option\"\n aria-selected=\"false\"\n aria-disabled=\"true\"\n aria-label={this.noResultsText}\n aria-live=\"polite\"\n >\n <ds-empty-state body={this.noResultsText} />\n </div>\n );\n }\n\n private renderOptions(filter: FilterMenuFilter, values: FilterMenuValues) {\n const value = values[filter.id];\n if (filter.kind === 'multiple' || filter.kind === 'single') {\n const selected = Array.isArray(value) ? value : [];\n const allOptions = filter.options ?? [];\n const options = this.visibleOptions(filter);\n const usesSubtext = choiceListUsesSubtext(\n allOptions.map(option => ({\n label: option.label,\n value: option.value,\n subtext: option.description,\n }))\n );\n if (!options.length) return this.renderNoOptionResults();\n return options.map((option, index) => {\n const isSelected =\n filter.kind === 'multiple' ? selected.includes(option.value) : value === option.value;\n return (\n <ChoiceOptionRow\n size=\"md\"\n id={`${this.generatedId}-${filter.id}-option-${index}`}\n option={{\n label: option.label,\n value: option.value,\n subtext: option.description,\n isInactive: option.isInactive,\n }}\n selected={isSelected}\n active={index === this.activeOptionIndex}\n focusRingVisible={this.focusRingVisible}\n usesSubtext={usesSubtext}\n tabIndex={index === this.activeOptionIndex ? 0 : -1}\n leading={\n filter.kind === 'multiple' ? (\n <span\n class=\"ds-choice-item__icon ds-control-icon-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-checkbox label=\"\" size=\"md\" checked={isSelected} presentation />\n </span>\n ) : undefined\n }\n onFocus={() => {\n this.activeOptionIndex = index;\n }}\n onKeyDown={(event: KeyboardEvent) =>\n this.handleOptionKeyDown(event, filter, option, index, values, options)\n }\n onHover={() => {\n this.focusRingVisible = false;\n this.activeOptionIndex = index;\n }}\n onSelect={() => this.selectOption(filter, option, values)}\n />\n );\n });\n }\n\n if (filter.kind === 'boolean') {\n const [option] = this.visibleOptions(filter);\n if (!option) return this.renderNoOptionResults();\n return (\n <ChoiceOptionRow\n size=\"md\"\n id={`${this.generatedId}-${filter.id}-option-0`}\n option={{\n label: option.label,\n value: option.value,\n subtext: option.description,\n }}\n selected={value === true}\n active\n focusRingVisible={this.focusRingVisible}\n usesSubtext={Boolean(option.description)}\n tabIndex={0}\n leading={\n <span\n class=\"ds-choice-item__icon ds-control-icon-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-checkbox label=\"\" size=\"md\" checked={value === true} presentation />\n </span>\n }\n onKeyDown={(event: KeyboardEvent) => {\n if (event.key === 'ArrowLeft') this.handlePanelKeyDown(event, filter.id);\n else if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.changeValue({ filterId: filter.id, value: value !== true });\n }\n }}\n onHover={() => {\n this.focusRingVisible = false;\n }}\n onSelect={() => this.changeValue({ filterId: filter.id, value: value !== true })}\n />\n );\n }\n\n return this.renderDateFilter(filter, value);\n }\n\n private get captionIconOnly(): boolean {\n return (\n this.collapseLabel && this.captionCompact && this.usesInternalTrigger && Boolean(this.icon)\n );\n }\n\n private syncCaptionCompactObserver(): void {\n this.disconnectCaptionCompactObserver();\n if (!this.collapseLabel) {\n if (this.captionCompact) this.captionCompact = false;\n return;\n }\n this.captionCompactDisconnect = observeTableCaptionCompact(this.el, compact => {\n if (this.captionCompact !== compact) this.captionCompact = compact;\n });\n }\n\n private disconnectCaptionCompactObserver(): void {\n this.captionCompactDisconnect?.();\n this.captionCompactDisconnect = undefined;\n }\n\n private renderCaptionTooltip(trigger: VNode, label: string): VNode {\n if (!this.collapseLabel) return trigger;\n return (\n <ds-tooltip label={label} side=\"top\" size=\"sm\">\n {trigger}\n </ds-tooltip>\n );\n }\n\n private renderFooter(totalSelected: number, categoriesClear: boolean) {\n const appliedCount = this.totalSelected(this.filters, this.values);\n if (this.applyRequired && totalSelected === 0 && appliedCount === 0) return null;\n return (\n <div\n class={{\n 'filter-menu__footer': true,\n 'filter-menu__footer--categories-clear': categoriesClear,\n 'ds-choice-footer': true,\n }}\n aria-hidden={\n !this.applyRequired &&\n categoriesClear &&\n totalSelected === 0 &&\n !this.draftValues &&\n !this.draftModes\n ? 'true'\n : undefined\n }\n >\n <div class=\"ds-choice-footer__content ds-control--md\">\n {!categoriesClear ? (\n <ds-text\n class=\"ds-choice-footer__summary\"\n as=\"span\"\n variant=\"text-body-medium\"\n color=\"secondary\"\n aria-live=\"polite\"\n >\n {totalSelected} selected\n </ds-text>\n ) : null}\n {this.applyRequired ? (\n <button\n class=\"filter-menu__apply ds-choice-footer__clear ds-text-action\"\n type=\"button\"\n disabled={!this.hasPendingChanges}\n onClick={() => this.applyDraft()}\n >\n <ds-text as=\"span\" variant=\"text-body-medium\" color=\"inherit\">\n Apply\n </ds-text>\n </button>\n ) : null}\n {this.applyRequired && (totalSelected > 0 || appliedCount > 0) ? (\n <ds-text\n class=\"filter-menu__action-separator\"\n as=\"span\"\n variant=\"text-body-medium\"\n color=\"tertiary\"\n aria-hidden=\"true\"\n >\n ·\n </ds-text>\n ) : null}\n {totalSelected > 0 || (this.applyRequired && appliedCount > 0) ? (\n <button\n class=\"filter-menu__clear ds-choice-footer__clear ds-text-action\"\n type=\"button\"\n onClick={() => {\n if (this.applyRequired) {\n this.draftValues = {};\n this.draftModes = {};\n }\n this.dsClear.emit();\n }}\n >\n <ds-text as=\"span\" variant=\"text-body-medium\" color=\"inherit\">\n {this.clearLabel}\n </ds-text>\n </button>\n ) : null}\n </div>\n </div>\n );\n }\n\n private renderMatchModeFooter(filter: FilterMenuFilter, matchModes: FilterMenuMatchModes) {\n const mode: FilterMenuMatchMode = matchModes[filter.id] === 'all' ? 'all' : 'any';\n const nextMode: FilterMenuMatchMode = mode === 'any' ? 'all' : 'any';\n return (\n <div class=\"filter-menu__match-mode-footer ds-choice-footer\">\n <div class=\"filter-menu__match-mode-content ds-choice-footer__content ds-control--md\">\n <ds-text as=\"span\" variant=\"text-body-medium\" color=\"secondary\">\n Limit results to\n </ds-text>\n <button\n class=\"filter-menu__match-mode-toggle ds-text-action ds-focus-ring\"\n type=\"button\"\n aria-label={`Limit ${filter.label} results to ${nextMode} selected`}\n onClick={() => this.changeMode({ filterId: filter.id, mode: nextMode })}\n onKeyDown={(event: KeyboardEvent) => this.handlePanelKeyDown(event, filter.id)}\n >\n <ds-text as=\"span\" variant=\"text-body-medium\" color=\"inherit\">\n {mode}\n </ds-text>\n </button>\n <ds-text as=\"span\" variant=\"text-body-medium\" color=\"secondary\">\n selected\n </ds-text>\n </div>\n </div>\n );\n }\n\n render() {\n if (this.vertical)\n return (\n <Host class=\"filter-menu-vertical\">\n {this.filters.map(filter => (\n <details open key={filter.id} class=\"filter-menu-vertical__section\">\n <summary>\n <ds-icon class=\"filter-menu-vertical__chevron\" name=\"ChevronDown\" size=\"md\" />\n <ds-text variant=\"text-body-medium\" emphasis>\n {filter.label}\n </ds-text>\n </summary>\n {filter.kind !== 'date' && this.renderOptionSearch(filter)}\n <div\n id={`${this.generatedId}-${filter.id}-options`}\n role={filter.kind === 'date' ? undefined : 'listbox'}\n aria-label={filter.label}\n aria-multiselectable={filter.kind === 'multiple' ? 'true' : undefined}\n class=\"ds-choice-list ds-chrome-column ds-chrome-space--sm\"\n >\n {this.renderOptions(filter, this.values)}\n </div>\n {filter.kind === 'multiple' && this.renderMatchModeFooter(filter, this.matchModes)}\n </details>\n ))}\n </Host>\n );\n const state =\n this.closing && this.closingSnapshot\n ? this.closingSnapshot\n : {\n filters: this.filters,\n values: this.draftValues ?? this.values,\n matchModes: this.draftModes ?? this.matchModes,\n activeFilterId: this.activeFilterId,\n };\n const activeFilter = this.selectedFilter(state.filters, state.activeFilterId);\n const totalSelected = this.totalSelected(state.filters, state.values);\n const activeFilterCount = this.activeFilterCount(state.filters, state.values);\n const hasActiveFilters = activeFilterCount > 0;\n const categoriesClearFooter = this.footerLayout === 'categories-clear';\n const label = `${this.triggerLabel}${\n this.showSelectedCount && hasActiveFilters ? ` · ${activeFilterCount}` : ''\n }`;\n const textVariant = CONTROL_TEXT_VARIANT[this.size];\n const iconSize = ICON_SIZE[this.size];\n const popupId = `${this.generatedId}-popup`;\n const popupStyle: Record<string, string> = {\n position: 'fixed',\n left: '0',\n top: '0',\n width: this.menuWidth,\n transform: `translate(${Math.round(this.pos.x)}px, ${Math.round(this.pos.y)}px)`,\n zIndex: '9998',\n visibility: this.positionReady ? 'visible' : 'hidden',\n };\n\n return (\n <Host\n class={{\n 'filter-menu-host': true,\n 'filter-menu-host--external-trigger': !this.usesInternalTrigger,\n 'ds-select-trigger-host': this.usesInternalTrigger,\n [`ds-control--${this.size}`]: true,\n 'ds-table-caption-control': this.collapseLabel,\n 'ds-table-caption-control--compact': this.captionIconOnly,\n ...controlWidthClass(this.width),\n }}\n >\n {this.usesInternalTrigger\n ? this.renderCaptionTooltip(\n <button\n ref={element => {\n this.triggerElement = (element as HTMLButtonElement) ?? null;\n }}\n id={this.inputId ?? `${this.generatedId}-trigger`}\n type=\"button\"\n class={{\n trigger: true,\n 'ds-control-frame': true,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n 'ds-interaction-fill--selected': this.activeFill && hasActiveFilters,\n 'trigger--expanded': this.open || this.closing,\n 'ds-interaction-fill--surface-open': this.open || this.closing,\n 'trigger--bordered': this.hasBorder,\n 'trigger--has-value': hasActiveFilters && !this.neutralTrigger,\n [`ds-control--${this.size}`]: true,\n }}\n role=\"combobox\"\n aria-haspopup=\"dialog\"\n aria-expanded={String(this.open)}\n aria-controls={this.open ? popupId : undefined}\n aria-label={this.ariaLabel ?? this.menuLabel}\n onClick={(event: MouseEvent) => this.toggleFromTrigger(event)}\n onKeyDown={(event: KeyboardEvent) => this.handleTriggerKeyDown(event)}\n >\n {this.icon ? (\n <span\n class=\"trigger__prefix ds-control-icon-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-icon name={this.icon} size={iconSize} color=\"inherit\" />\n </span>\n ) : null}\n {this.captionIconOnly ? null : (\n <ds-text\n class=\"trigger__label-box trigger__label trigger__label-content ds-control-label-box ds-interaction-fill__content\"\n as=\"span\"\n variant={textVariant}\n color=\"inherit\"\n lineTruncation={1}\n >\n {label}\n </ds-text>\n )}\n {this.captionIconOnly || !this.showIndicator ? null : (\n <span\n class=\"trigger__chevron ds-control-icon-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-icon name=\"ChevronDown\" size={iconSize} color=\"inherit\" />\n </span>\n )}\n </button>,\n this.captionIconOnly ? label : ''\n )\n : null}\n\n {this.shouldRender || this.embedded ? (\n <div\n id={popupId}\n popover={this.embedded ? undefined : 'manual'}\n class={{\n 'filter-menu-popup': true,\n 'ds-choice-popup': !this.embedded,\n 'table-preferences-embedded': this.embedded,\n 'ds-choice-popup--closing': this.closing,\n }}\n style={this.embedded ? undefined : popupStyle}\n role=\"dialog\"\n aria-label={this.menuLabel}\n >\n {activeFilter ? (\n <div class=\"filter-menu\">\n <div class=\"filter-menu__body\">\n <div class=\"filter-menu__category-pane\">\n <div\n class=\"filter-menu__categories ds-choice-list ds-chrome-column ds-chrome-space--sm\"\n role=\"tablist\"\n aria-label={this.categoriesLabel}\n aria-orientation=\"vertical\"\n >\n {state.filters.map(filter => {\n const active = filter.id === activeFilter.id;\n const count = this.selectedCount(filter, state.values);\n return (\n <div\n key={filter.id}\n class={{\n 'filter-menu__category-section': true,\n 'ds-choice-section--divided': Boolean(filter.divider),\n }}\n >\n <button\n id={`${this.generatedId}-${filter.id}-tab`}\n type=\"button\"\n role=\"tab\"\n data-filter-category={filter.id}\n class={{\n 'filter-menu__category': true,\n 'filter-menu__category--active': active,\n 'ds-choice-item': true,\n 'ds-control-frame': true,\n 'ds-control--md': true,\n 'ds-focus-ring-inset': true,\n 'ds-focus-ring--visible': active && this.focusRingVisible,\n 'ds-interaction-fill': true,\n 'ds-interaction-fill--selected': active,\n }}\n aria-selected={String(active)}\n aria-controls={`${this.generatedId}-panel`}\n tabIndex={active ? 0 : -1}\n onMouseDown={() => {\n this.focusRingVisible = false;\n }}\n onClick={() => this.selectCategory(filter.id)}\n onKeyDown={(event: KeyboardEvent) =>\n this.handleCategoryKeyDown(event, state.filters, filter.id)\n }\n >\n <ds-text\n class=\"ds-choice-item__content ds-choice-item__label ds-control-label-box ds-interaction-fill__content\"\n as=\"span\"\n variant=\"text-body-medium\"\n color={active ? 'primary' : 'secondary'}\n >\n {filter.label}\n </ds-text>\n {count > 0 && filter.kind === 'date' ? (\n <span\n class=\"filter-menu__category-dot-box ds-interaction-fill__content\"\n aria-hidden=\"true\"\n >\n <ds-badge variant=\"dot\" hasRing={false} label=\"\" />\n </span>\n ) : count > 0 ? (\n <ds-tag\n class=\"ds-choice-item__tag ds-interaction-fill__content\"\n label={String(count)}\n size=\"sm\"\n intent=\"brand\"\n contrast=\"bold\"\n isInset\n rounded\n />\n ) : null}\n </button>\n </div>\n );\n })}\n </div>\n {categoriesClearFooter ? this.renderFooter(totalSelected, true) : null}\n </div>\n\n <div\n id={`${this.generatedId}-panel`}\n class={{\n 'filter-menu__options': true,\n 'filter-menu__options--date': activeFilter.kind === 'date',\n }}\n role=\"tabpanel\"\n aria-labelledby={`${this.generatedId}-${activeFilter.id}-tab`}\n >\n {activeFilter.kind === 'date' ? null : this.renderOptionSearch(activeFilter)}\n <div class=\"filter-menu__options-content\">\n {activeFilter.kind === 'date' ? (\n <div key={activeFilter.id} class=\"filter-menu__option-list--date\">\n {this.renderOptions(activeFilter, state.values)}\n </div>\n ) : (\n <div\n id={`${this.generatedId}-${activeFilter.id}-options`}\n key={activeFilter.id}\n class=\"filter-menu__option-list ds-choice-list ds-chrome-column ds-chrome-space--sm\"\n role=\"listbox\"\n aria-label={activeFilter.label}\n aria-multiselectable={\n activeFilter.kind === 'multiple' ? 'true' : undefined\n }\n >\n {this.renderOptions(activeFilter, state.values)}\n </div>\n )}\n </div>\n {activeFilter.kind === 'multiple'\n ? this.renderMatchModeFooter(activeFilter, state.matchModes)\n : null}\n </div>\n </div>\n\n {!categoriesClearFooter && totalSelected > 0\n ? this.renderFooter(totalSelected, false)\n : null}\n </div>\n ) : null}\n </div>\n ) : null}\n </Host>\n );\n }\n}\n",
805
888
  "type": "registry:ui"
806
889
  }
807
890
  ]