@slotted/react 0.1.0-beta.10 → 0.1.0-beta.11

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 (336) hide show
  1. package/dist/action-bar-z2DPc1Wy.js +285 -0
  2. package/dist/action-bar.js +1 -1
  3. package/dist/action-sheet-BnedGewu.js +360 -0
  4. package/dist/action-sheet.js +1 -1
  5. package/dist/{alert-BTcqbG8w.js → alert-BTAXJ69M.js} +5 -5
  6. package/dist/alert.js +1 -1
  7. package/dist/{app-shell-BlkqQrOx.js → app-shell-Cb_kDBeV.js} +232 -173
  8. package/dist/app-shell.js +1 -1
  9. package/dist/{attachment-zlOPJvIm.js → attachment-D1O4qS8H.js} +28 -28
  10. package/dist/attachment.js +1 -1
  11. package/dist/{breadcrumb-DCGynpkb.js → breadcrumb-CnFjxxI2.js} +10 -10
  12. package/dist/breadcrumb.js +1 -1
  13. package/dist/{button-BCVjdzkn.js → button-D31perSu.js} +2 -2
  14. package/dist/button.js +2 -2
  15. package/dist/{calendar-qGUJ-kAy.js → calendar-DZyC1gAT.js} +8 -8
  16. package/dist/calendar.js +1 -1
  17. package/dist/{carousel-CjRTu8m7.js → carousel-Dso3gcYd.js} +14 -14
  18. package/dist/carousel.js +1 -1
  19. package/dist/cascader-BbajBwsX.js +1157 -0
  20. package/dist/cascader.js +1 -1
  21. package/dist/{chart-CPFq3jIE.js → chart-Bb6ctahn.js} +9 -9
  22. package/dist/chart.js +1 -1
  23. package/dist/{checkbox-CMY2KIih.js → checkbox-C_8GVtjD.js} +3 -3
  24. package/dist/{checkbox-group-DzMtLF7f.js → checkbox-group-DXCcusol.js} +2 -2
  25. package/dist/checkbox-group.js +1 -1
  26. package/dist/checkbox.js +1 -1
  27. package/dist/{code-block-Bh_2Eg3M.js → code-block-C4mtsROE.js} +8 -8
  28. package/dist/code-block.js +1 -1
  29. package/dist/{color-picker-DlepH5co.js → color-picker-JZPnPb7s.js} +49 -49
  30. package/dist/color-picker.js +1 -1
  31. package/dist/{column-manager-CV9tCnKa.js → column-manager-BDUj-WIs.js} +31 -31
  32. package/dist/column-manager.js +1 -1
  33. package/dist/combobox-Dn69QwGX.js +904 -0
  34. package/dist/combobox.js +1 -1
  35. package/dist/command-palette-Dh1HKz_F.js +744 -0
  36. package/dist/command-palette.js +1 -1
  37. package/dist/{context-menu-Dbc0KkFp.js → context-menu-uJjEmAN3.js} +1 -1
  38. package/dist/context-menu.js +1 -1
  39. package/dist/{currency-field--wIfgVAx.js → currency-field-lHcrNJ7X.js} +13 -13
  40. package/dist/currency-field.js +1 -1
  41. package/dist/{dashboard-grid-D_LbWfdZ.js → dashboard-grid-z-SOm9H0.js} +65 -65
  42. package/dist/dashboard-grid.js +1 -1
  43. package/dist/{data-grid-XH5fGoGj.js → data-grid-DQCvXMJA.js} +1330 -1278
  44. package/dist/data-grid.js +1 -1
  45. package/dist/data-list-BgdkA3bD.js +587 -0
  46. package/dist/data-list.js +1 -1
  47. package/dist/{date-field-BrNyJBiJ.js → date-field-B2lQzE3p.js} +5 -5
  48. package/dist/date-field.js +1 -1
  49. package/dist/{date-picker-Nl55so0C.js → date-picker-DpTRb-Y1.js} +16 -16
  50. package/dist/date-picker.js +1 -1
  51. package/dist/{date-range-picker-DLkvfUJD.js → date-range-picker-CBUPJep5.js} +17 -17
  52. package/dist/date-range-picker.js +1 -1
  53. package/dist/{datetime-field-CZRhRDPb.js → datetime-field-BZ44uJ_B.js} +7 -7
  54. package/dist/datetime-field.js +1 -1
  55. package/dist/{datetime-picker-_GHra2WL.js → datetime-picker-BK_bV3Yr.js} +21 -21
  56. package/dist/datetime-picker.js +1 -1
  57. package/dist/{datetime-range-picker-Dy1A0Wqy.js → datetime-range-picker-ChdbRgzQ.js} +21 -21
  58. package/dist/datetime-range-picker.js +1 -1
  59. package/dist/{description-list-Cc4JYZ-3.js → description-list-CYlfHDwx.js} +11 -11
  60. package/dist/description-list.js +1 -1
  61. package/dist/{detail-panel-BI_wHSoz.js → detail-panel-DimjnPI8.js} +91 -91
  62. package/dist/detail-panel.js +1 -1
  63. package/dist/{dialog-B6MP7GYI.js → dialog-BB5MdJex.js} +108 -108
  64. package/dist/dialog.js +1 -1
  65. package/dist/docs/action-bar.json +4 -4
  66. package/dist/docs/action-bar.md +3 -3
  67. package/dist/docs/calendar.md +2 -2
  68. package/dist/docs/command-palette.json +1 -0
  69. package/dist/docs/command-palette.md +1 -1
  70. package/dist/docs/data-grid.examples.md +8 -2
  71. package/dist/docs/data-grid.json +25 -3
  72. package/dist/docs/data-grid.md +4 -1
  73. package/dist/docs/data-grid.props.md +2 -1
  74. package/dist/docs/detail-panel.json +4 -2
  75. package/dist/docs/detail-panel.md +15 -5
  76. package/dist/docs/dialog.json +1 -0
  77. package/dist/docs/dialog.md +1 -1
  78. package/dist/docs/drawer.json +6 -4
  79. package/dist/docs/drawer.md +3 -3
  80. package/dist/docs/event-calendar.md +2 -2
  81. package/dist/docs/guidelines/index.md +4 -3
  82. package/dist/docs/guidelines/layout-alignment.md +17 -7
  83. package/dist/docs/guidelines/list-pages.md +3 -3
  84. package/dist/docs/page-header.json +18 -2
  85. package/dist/docs/page-header.md +5 -3
  86. package/dist/docs/page.json +1 -0
  87. package/dist/docs/page.md +1 -1
  88. package/dist/docs/rating.md +1 -1
  89. package/dist/docs/section.json +1 -1
  90. package/dist/docs/section.md +1 -1
  91. package/dist/docs/skills/compose-screen/SKILL.md +12 -4
  92. package/dist/docs/skills/review-screen/SKILL.md +20 -18
  93. package/dist/docs/skills/theme-app/SKILL.md +12 -1
  94. package/dist/docs/toast.json +1 -0
  95. package/dist/docs/toast.md +1 -1
  96. package/dist/docs/tokens.md +1 -1
  97. package/dist/docs/toolbar.json +1 -1
  98. package/dist/docs/toolbar.md +1 -1
  99. package/dist/docs/typography.md +1 -1
  100. package/dist/{drawer-CkpFlKYa.js → drawer-fyPyxnYQ.js} +216 -206
  101. package/dist/drawer.js +1 -1
  102. package/dist/entity-picker-ClyhBTyK.js +1283 -0
  103. package/dist/entity-picker.js +1 -1
  104. package/dist/{event-calendar-BDjI5T44.js → event-calendar-COgC24UG.js} +23 -23
  105. package/dist/event-calendar.js +1 -1
  106. package/dist/{field-group-CCM2vPKL.js → field-group-Bj-EbPIU.js} +2 -2
  107. package/dist/field-group.js +1 -1
  108. package/dist/{field-CzSGs7wo.js → field-tnEZiRLg.js} +19 -19
  109. package/dist/field.js +1 -1
  110. package/dist/filter-bar-BRuCz79-.js +1342 -0
  111. package/dist/filter-bar.js +1 -1
  112. package/dist/{form-CDq04WDY.js → form-DEcJ7tHf.js} +1 -1
  113. package/dist/form.js +1 -1
  114. package/dist/{fullscreen-6GW4naDP.js → fullscreen-BwweNj3-.js} +13 -13
  115. package/dist/fullscreen.js +1 -1
  116. package/dist/{hover-card-aadyPXzF.js → hover-card-BWcU37Yp.js} +1 -1
  117. package/dist/hover-card.js +1 -1
  118. package/dist/{i18n-DpW8lqJ1.js → i18n-D7xXDd8-.js} +11 -4
  119. package/dist/i18n.js +1 -1
  120. package/dist/{icon-button-CRB218_z.js → icon-button-DbSZKGT4.js} +73 -71
  121. package/dist/{import-export-center-DUrNwRKP.js → import-export-center-CYf0Qxl_.js} +291 -289
  122. package/dist/import-export-center.js +1 -1
  123. package/dist/index.js +100 -100
  124. package/dist/{kbd-Z4YmSPRy.js → kbd-dNz8QHfL.js} +1 -1
  125. package/dist/kbd.js +1 -1
  126. package/dist/{link-BsSlZ1ts.js → link-DLPyg54C.js} +5 -5
  127. package/dist/link.js +1 -1
  128. package/dist/{listbox-VFcfZT70.js → listbox-BSqx_ARf.js} +1 -1
  129. package/dist/listbox.js +1 -1
  130. package/dist/{loading-overlay-BZPBDK4w.js → loading-overlay-BLIrcaoj.js} +9 -9
  131. package/dist/loading-overlay.js +1 -1
  132. package/dist/{markdown-BmCU_sOv.js → markdown-DccRb1xf.js} +17 -17
  133. package/dist/markdown.js +1 -1
  134. package/dist/{menu-parts-DS9JEUCt.js → menu-parts-CNNHRduK.js} +42 -42
  135. package/dist/menu.js +1 -1
  136. package/dist/{menubar-BV43BKep.js → menubar-Bdr6zigi.js} +1 -1
  137. package/dist/menubar.js +1 -1
  138. package/dist/message-BkTiWsUp.js +436 -0
  139. package/dist/message-scroller-akQEtQLn.js +218 -0
  140. package/dist/message-scroller.js +1 -1
  141. package/dist/message.js +1 -1
  142. package/dist/{multi-select-YaxhhH9y.js → multi-select-BvlJIEtz.js} +445 -443
  143. package/dist/multi-select.js +1 -1
  144. package/dist/{navigation-menu-parts-B64gKl8B.js → navigation-menu-parts-CEW4fgCo.js} +12 -12
  145. package/dist/navigation-menu.js +1 -1
  146. package/dist/{notification-center-Ci-OLWTO.js → notification-center-BQO0Ey3h.js} +40 -40
  147. package/dist/notification-center.js +1 -1
  148. package/dist/{number-field-BYQmPyM-.js → number-field-D1MqT8_A.js} +13 -13
  149. package/dist/number-field.js +1 -1
  150. package/dist/{otp-input-BKO0WPZc.js → otp-input-Cub9H9Di.js} +1 -1
  151. package/dist/otp-input.js +1 -1
  152. package/dist/{page-CfjGviUA.js → page-CwYmBoZQ.js} +1 -1
  153. package/dist/{page-header-w_PFLnLG.js → page-header-CMxCQqu_.js} +117 -114
  154. package/dist/page-header.js +1 -1
  155. package/dist/page.js +1 -1
  156. package/dist/{pagination-Cm9665gb.js → pagination-IEuos7H1.js} +12 -12
  157. package/dist/pagination.js +1 -1
  158. package/dist/{popover-D1krYeP-.js → popover-C7NpEzq6.js} +22 -22
  159. package/dist/popover.js +1 -1
  160. package/dist/prompt-composer-Cu8bj1Vb.js +276 -0
  161. package/dist/prompt-composer.js +1 -1
  162. package/dist/{prose-Bl5OjXTb.js → prose-CQN4Bqqh.js} +1 -1
  163. package/dist/prose.js +1 -1
  164. package/dist/{radio-group-D9VTBLUB.js → radio-group-BHlDgCLk.js} +2 -2
  165. package/dist/radio-group.js +1 -1
  166. package/dist/{rating-BRqsV5OF.js → rating-Cr0lXaAV.js} +15 -15
  167. package/dist/rating.js +1 -1
  168. package/dist/{saved-views-C_76obIv.js → saved-views-CyLSn8a2.js} +151 -151
  169. package/dist/saved-views.js +1 -1
  170. package/dist/{scroll-area-vrm2bbtZ.js → scroll-area-Fr0PmnRS.js} +1 -1
  171. package/dist/scroll-area.js +1 -1
  172. package/dist/{segmented-control-5DTOKO3g.js → segmented-control-uPnQYklX.js} +2 -2
  173. package/dist/segmented-control.js +1 -1
  174. package/dist/select-C0JYHwBy.js +1020 -0
  175. package/dist/select.js +1 -1
  176. package/dist/{side-navigation-MNMSkj9b.js → side-navigation-D8lRpHwj.js} +64 -64
  177. package/dist/side-navigation.js +1 -1
  178. package/dist/{skeleton-DyOwgYmF.js → skeleton-DeEOmm1y.js} +1 -1
  179. package/dist/skeleton.js +1 -1
  180. package/dist/{slider-OMe1DAC-.js → slider-BSI1xvjw.js} +2 -2
  181. package/dist/slider.js +1 -1
  182. package/dist/{sparkline-ChkaLVdY.js → sparkline-CYU4_lCD.js} +1 -1
  183. package/dist/sparkline.js +1 -1
  184. package/dist/spinner-ring-DyfaYloA.js +19 -0
  185. package/dist/{split-button-DbmRwfMC.js → split-button-CkbylOMN.js} +2 -2
  186. package/dist/split-button.js +1 -1
  187. package/dist/{stat-card-BSnsTmsq.js → stat-card-CAh4SdeY.js} +16 -16
  188. package/dist/stat-card.js +1 -1
  189. package/dist/{status-indicator-CyKhBdvN.js → status-indicator-BVMnpcm8.js} +4 -4
  190. package/dist/status-indicator.js +1 -1
  191. package/dist/{stepper-Cw1Auv3n.js → stepper-BLfvMz04.js} +16 -16
  192. package/dist/stepper.js +1 -1
  193. package/dist/styles/action-bar.css +1 -1
  194. package/dist/styles/action-sheet.css +2 -2
  195. package/dist/styles/button.css +2 -2
  196. package/dist/styles/cascader.css +2 -2
  197. package/dist/styles/chart.css +1 -1
  198. package/dist/styles/column-manager.css +3 -3
  199. package/dist/styles/command-palette.css +3 -3
  200. package/dist/styles/dashboard-grid.css +2 -2
  201. package/dist/styles/data-grid.css +3 -3
  202. package/dist/styles/data-list.css +2 -2
  203. package/dist/styles/detail-panel.css +4 -4
  204. package/dist/styles/dialog.css +1 -1
  205. package/dist/styles/drawer.css +1 -1
  206. package/dist/styles/entity-picker.css +1 -1
  207. package/dist/styles/event-calendar.css +1 -1
  208. package/dist/styles/filter-bar.css +3 -3
  209. package/dist/styles/import-export-center.css +4 -4
  210. package/dist/styles/index.css +12 -12
  211. package/dist/styles/markdown.css +2 -2
  212. package/dist/styles/multi-select.css +1 -1
  213. package/dist/styles/notification-center.css +3 -3
  214. package/dist/styles/page-header.css +2 -2
  215. package/dist/styles/page.css +1 -1
  216. package/dist/styles/prompt-composer.css +1 -1
  217. package/dist/styles/saved-views.css +2 -2
  218. package/dist/styles/split-button.css +2 -2
  219. package/dist/styles/table.css +2 -2
  220. package/dist/styles/tabs.css +1 -1
  221. package/dist/styles/timeline.css +1 -1
  222. package/dist/styles/toast.css +1 -1
  223. package/dist/styles/tour.css +2 -2
  224. package/dist/styles/transfer.css +2 -2
  225. package/dist/styles/upload.css +1 -1
  226. package/dist/styles/wizard.css +2 -2
  227. package/dist/styles.css +1 -1
  228. package/dist/{switch-CQ1rpuKa.js → switch-BHyKHqeI.js} +5 -5
  229. package/dist/switch.js +1 -1
  230. package/dist/{table-DpGTPtnb.js → table-C8zOHDcY.js} +30 -30
  231. package/dist/{table-of-contents-BFVERMZy.js → table-of-contents-BAIuPCdy.js} +8 -8
  232. package/dist/table-of-contents.js +1 -1
  233. package/dist/table.js +1 -1
  234. package/dist/{tag-aX7uyAN0.js → tag-XYGEPUHR.js} +14 -14
  235. package/dist/tag.js +1 -1
  236. package/dist/{tags-input-BgpS22sf.js → tags-input-ClYSd-No.js} +40 -40
  237. package/dist/tags-input.js +1 -1
  238. package/dist/text-field-Cguj75tn.js +205 -0
  239. package/dist/text-field.js +1 -1
  240. package/dist/{textarea-DNCjsQYd.js → textarea-BKsh_jAo.js} +1 -1
  241. package/dist/textarea.js +1 -1
  242. package/dist/{time-field-Cm6iBjwH.js → time-field-BIE4WMpS.js} +7 -7
  243. package/dist/time-field.js +1 -1
  244. package/dist/{time-picker-Ce18FSO2.js → time-picker-CNfafRDF.js} +18 -18
  245. package/dist/time-picker.js +1 -1
  246. package/dist/{time-range-picker-kDnw4PQ3.js → time-range-picker-D7gM_Wno.js} +20 -20
  247. package/dist/time-range-picker.js +1 -1
  248. package/dist/timeline-BLadNUkS.js +449 -0
  249. package/dist/timeline.js +1 -1
  250. package/dist/{toast-58ex8PDK.js → toast-CjbiXiza.js} +16 -16
  251. package/dist/toast.js +1 -1
  252. package/dist/{toggle-group-YxVJlCnI.js → toggle-group-BZmghKac.js} +1 -1
  253. package/dist/toggle-group.js +1 -1
  254. package/dist/toolbar-BI4ZepBs.js +243 -0
  255. package/dist/toolbar.js +1 -1
  256. package/dist/{top-navigation-DorkYBnR.js → top-navigation-BTZpx5VA.js} +13 -13
  257. package/dist/top-navigation.js +1 -1
  258. package/dist/{tour-CwK_m_Jp.js → tour-_CQ1kYov.js} +23 -23
  259. package/dist/tour.js +1 -1
  260. package/dist/{transfer-DxGDWIEt.js → transfer-BVhBdIGp.js} +59 -59
  261. package/dist/transfer.js +1 -1
  262. package/dist/tree-DfI9UWLA.js +794 -0
  263. package/dist/tree.js +1 -1
  264. package/dist/types/action-bar/action-bar-overflow.d.ts.map +1 -1
  265. package/dist/types/action-bar/action-bar.types.d.ts +2 -2
  266. package/dist/types/action-sheet/action-sheet-parts.d.ts.map +1 -1
  267. package/dist/types/app-shell/app-shell-parts.d.ts.map +1 -1
  268. package/dist/types/app-shell/app-shell.d.ts.map +1 -1
  269. package/dist/types/app-shell/app-shell.types.d.ts +21 -14
  270. package/dist/types/app-shell/app-shell.types.d.ts.map +1 -1
  271. package/dist/types/app-shell/index.d.ts +1 -1
  272. package/dist/types/app-shell/index.d.ts.map +1 -1
  273. package/dist/types/button/button-indicator.d.ts.map +1 -1
  274. package/dist/types/button/spinner-ring.d.ts +8 -0
  275. package/dist/types/button/spinner-ring.d.ts.map +1 -0
  276. package/dist/types/cascader/cascader-surface.d.ts.map +1 -1
  277. package/dist/types/cascader/cascader.d.ts.map +1 -1
  278. package/dist/types/combobox/combobox-parts.d.ts.map +1 -1
  279. package/dist/types/command-palette/command-palette.d.ts.map +1 -1
  280. package/dist/types/data-grid/data-grid-body.d.ts +7 -2
  281. package/dist/types/data-grid/data-grid-body.d.ts.map +1 -1
  282. package/dist/types/data-grid/data-grid-context.d.ts +2 -1
  283. package/dist/types/data-grid/data-grid-context.d.ts.map +1 -1
  284. package/dist/types/data-grid/data-grid-header.d.ts.map +1 -1
  285. package/dist/types/data-grid/data-grid.d.ts +1 -1
  286. package/dist/types/data-grid/data-grid.d.ts.map +1 -1
  287. package/dist/types/data-grid/data-grid.types.d.ts +12 -0
  288. package/dist/types/data-grid/data-grid.types.d.ts.map +1 -1
  289. package/dist/types/data-grid/index.d.ts +1 -1
  290. package/dist/types/data-grid/index.d.ts.map +1 -1
  291. package/dist/types/detail-panel/detail-panel-parts.d.ts +2 -1
  292. package/dist/types/detail-panel/detail-panel-parts.d.ts.map +1 -1
  293. package/dist/types/drawer/drawer-parts.d.ts.map +1 -1
  294. package/dist/types/entity-picker/entity-picker-control.d.ts.map +1 -1
  295. package/dist/types/filter-bar/filter-bar.d.ts.map +1 -1
  296. package/dist/types/i18n/slotted-provider.d.ts +6 -0
  297. package/dist/types/i18n/slotted-provider.d.ts.map +1 -1
  298. package/dist/types/import-export-center/import-export-center.d.ts.map +1 -1
  299. package/dist/types/message/message-parts.d.ts.map +1 -1
  300. package/dist/types/message-scroller/message-scroller.d.ts.map +1 -1
  301. package/dist/types/multi-select/multi-select-parts.d.ts.map +1 -1
  302. package/dist/types/page-header/page-header-defaults.d.ts +1 -1
  303. package/dist/types/page-header/page-header-defaults.d.ts.map +1 -1
  304. package/dist/types/page-header/page-header.d.ts +1 -1
  305. package/dist/types/page-header/page-header.d.ts.map +1 -1
  306. package/dist/types/page-header/page-header.types.d.ts +9 -0
  307. package/dist/types/page-header/page-header.types.d.ts.map +1 -1
  308. package/dist/types/prompt-composer/prompt-composer.d.ts.map +1 -1
  309. package/dist/types/select/select-parts.d.ts.map +1 -1
  310. package/dist/types/text-field/text-field.d.ts.map +1 -1
  311. package/dist/types/timeline/timeline-parts.d.ts.map +1 -1
  312. package/dist/types/timeline/timeline.d.ts.map +1 -1
  313. package/dist/types/toolbar/toolbar-overflow.d.ts.map +1 -1
  314. package/dist/types/toolbar/toolbar.types.d.ts +2 -2
  315. package/dist/types/tree/tree-parts.d.ts.map +1 -1
  316. package/dist/{upload-CEDsfMWz.js → upload-N2-nyO8x.js} +65 -65
  317. package/dist/upload.js +1 -1
  318. package/dist/{wizard-B3p7zCSj.js → wizard-CK1x2fs3.js} +16 -16
  319. package/dist/wizard.js +1 -1
  320. package/package.json +6 -6
  321. package/dist/action-bar-CJgBierN.js +0 -283
  322. package/dist/action-sheet-tRrjm7WQ.js +0 -358
  323. package/dist/cascader-DqlC1z5b.js +0 -1154
  324. package/dist/combobox-YWFkxaQ3.js +0 -902
  325. package/dist/command-palette-DXNq-zKN.js +0 -741
  326. package/dist/data-list-DZCN_uW1.js +0 -587
  327. package/dist/entity-picker-CFwLGQeU.js +0 -1281
  328. package/dist/filter-bar-G50WdRac.js +0 -1340
  329. package/dist/message-Dtck9RJy.js +0 -434
  330. package/dist/message-scroller-niUJ8RoL.js +0 -216
  331. package/dist/prompt-composer-sh_TXKYZ.js +0 -273
  332. package/dist/select-BFx5EgAa.js +0 -1018
  333. package/dist/text-field-DL_uhNXV.js +0 -203
  334. package/dist/timeline-pEL30Jp8.js +0 -446
  335. package/dist/toolbar-BtIyVbs4.js +0 -241
  336. package/dist/tree-DbLRyItM.js +0 -792
@@ -1,1340 +0,0 @@
1
- import { n as e, t } from "./icon-DjqSEQ-o.js";
2
- import { _ as n, a as r, c as i, d as a, h as o, m as s, n as c, t as l, u } from "./menu-parts-DS9JEUCt.js";
3
- import { r as d } from "./i18n-DpW8lqJ1.js";
4
- import { a as f, c as p, i as m, n as h, o as g, t as ee, u as te } from "./drawer-CkpFlKYa.js";
5
- import { n as _, t as v } from "./icon-button-CRB218_z.js";
6
- import { t as ne } from "./text-field-DL_uhNXV.js";
7
- import { a as re, d as ie, f as ae, l as oe, p as se, r as ce } from "./popover-D1krYeP-.js";
8
- import { n as le } from "./kbd-Z4YmSPRy.js";
9
- import { t as ue } from "./date-picker-Nl55so0C.js";
10
- import { t as de } from "./datetime-picker-_GHra2WL.js";
11
- import { a as fe, i as pe, n as me, s as he } from "./multi-select-YaxhhH9y.js";
12
- import { t as ge } from "./number-field-BYQmPyM-.js";
13
- import { a as _e, t as y } from "./segmented-control-5DTOKO3g.js";
14
- import { c as ve, i as ye, n as be, o as xe, s as Se } from "./select-BFx5EgAa.js";
15
- import { t as b } from "./time-picker-Ce18FSO2.js";
16
- import { withSelectorKey as x } from "@slotted/core/selector-key";
17
- import { createRemovalFocus as Ce, createRovingTabindex as we } from "@slotted/core/focus";
18
- import { createControllable as Te } from "@slotted/core/state";
19
- import { Fragment as S, createContext as Ee, useCallback as De, useContext as Oe, useEffect as C, useId as ke, useImperativeHandle as Ae, useLayoutEffect as je, useMemo as Me, useRef as w, useState as T } from "react";
20
- import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
21
- import { filterBarMessages as Ne } from "@slotted/core/i18n";
22
- import { getLiveAnnouncer as Pe } from "@slotted/core/live-announcer";
23
- import { isPlainDate as Fe, isPlainDateTime as Ie, isPlainTime as Le, parseISODate as Re, parseISODateTime as ze, parseISOTime as Be, toISODate as k, toISODateTime as Ve, toISOTime as He } from "@slotted/core/date";
24
- import { defaultOperator as A, describeFilter as Ue, describeFilterGroup as We, emptyFilter as Ge, emptyFilterGroup as Ke, firstLevelRules as qe, insertNodeAt as Je, isFilterActive as Ye, isFilterGroup as Xe, normalizeFilterGroup as j, operandCount as M, operatorsFor as Ze, removeNodeAt as Qe, ruleFor as N, serializeFilterGroup as $e, spokenOperator as et, updateNodeAt as tt, withCondition as nt, withGroupJoin as rt, withRuleFor as it, withoutRuleFor as at } from "@slotted/core/filter";
25
- //#region src/filter-bar/filter-bar-defaults.tsx
26
- var ot = Ee({});
27
- function st() {
28
- return Oe(ot);
29
- }
30
- function ct({ children: e, ...t }) {
31
- let n = st();
32
- return /* @__PURE__ */ D(ot.Provider, {
33
- value: {
34
- apply: t.apply ?? n.apply,
35
- chipLimit: t.chipLimit ?? n.chipLimit,
36
- queryDelay: t.queryDelay ?? n.queryDelay,
37
- shortcut: t.shortcut === void 0 ? n.shortcut : t.shortcut,
38
- size: t.size ?? n.size
39
- },
40
- children: e
41
- });
42
- }
43
- //#endregion
44
- //#region src/filter-bar/filter-bar-rules.tsx
45
- function P(e, t) {
46
- return e.find((e) => e.key === t);
47
- }
48
- function lt(e, t) {
49
- return t in Ne.base.operators ? e(`operators.${t}`) : t;
50
- }
51
- function ut(e) {
52
- let [t = "", n = ""] = e("\0").split("\0");
53
- return [t.trim(), n.trim()];
54
- }
55
- function F(e) {
56
- if (e.defaultValue) return e.defaultValue;
57
- let t = e.defaultOperator ?? A(e.kind);
58
- return Ge(e.kind, t);
59
- }
60
- function dt(e, t, n) {
61
- let r = n?.kind ?? t?.kind ?? "text", i = n?.conditions[0] ?? { operator: t ? t.defaultOperator ?? A(t.kind) : "contains" }, a = M(i.operator), o = lt(e, et(r, i)), s = (e) => t?.options?.find((t) => t.value === e)?.label ?? String(e), c = (e) => e != null && e !== "" && !(Array.isArray(e) && e.length === 0);
62
- if (a === 0) return {
63
- operator: o,
64
- value: "",
65
- full: "",
66
- operands: a
67
- };
68
- if (r === "set") {
69
- let t = (i.value ?? []).map(s), n = t.join(", ");
70
- return {
71
- operator: o,
72
- value: t.length > 2 ? e("moreValues", {
73
- values: t.slice(0, 2).join(", "),
74
- count: t.length - 2
75
- }) : n,
76
- full: n,
77
- operands: a
78
- };
79
- }
80
- if (a === 2) {
81
- if (!c(i.value) || !c(i.end)) return {
82
- operator: o,
83
- value: "",
84
- full: "",
85
- operands: a
86
- };
87
- let e = `${s(i.value)} – ${s(i.end)}`;
88
- return {
89
- operator: o,
90
- value: e,
91
- full: e,
92
- operands: a
93
- };
94
- }
95
- let l = c(i.value) ? s(i.value) : "";
96
- return {
97
- operator: o,
98
- value: l,
99
- full: l,
100
- operands: a
101
- };
102
- }
103
- function ft({ icon: n }) {
104
- return n == null || n === !1 ? null : /* @__PURE__ */ D(t, { children: typeof n == "string" ? /* @__PURE__ */ D(e, { name: n }) : n });
105
- }
106
- function I(e) {
107
- return (t) => {
108
- t.key === "Enter" && !t.defaultPrevented && e();
109
- };
110
- }
111
- var L = (e) => e ? Re(String(e)) : null, R = (e) => e ? Be(String(e)) : null, z = (e) => e ? ze(String(e)) : null;
112
- function pt(e) {
113
- let { apply: t, field: n, label: r, onValueChange: i, render: a, size: o, value: s } = e, c = a?.(e);
114
- if (c != null) return /* @__PURE__ */ D(E, { children: c });
115
- let l = {
116
- ...n.min === void 0 ? {} : { min: n.min },
117
- ...n.max === void 0 ? {} : { max: n.max }
118
- };
119
- switch (n.kind) {
120
- case "number": return /* @__PURE__ */ D(ge, {
121
- "aria-label": r,
122
- onKeyDown: I(t),
123
- onValueChange: (e) => i(e),
124
- placeholder: r,
125
- size: o,
126
- value: s ?? null,
127
- ...typeof n.min == "number" ? { min: n.min } : {},
128
- ...typeof n.max == "number" ? { max: n.max } : {},
129
- ...n.step === void 0 ? {} : { step: n.step }
130
- });
131
- case "date": return /* @__PURE__ */ D(ue, {
132
- "aria-label": r,
133
- onKeyDown: I(t),
134
- onValueChange: (e) => i(Fe(e) ? k(e) : null),
135
- size: o,
136
- value: L(s),
137
- ...L(l.min) ? { min: L(l.min) } : {},
138
- ...L(l.max) ? { max: L(l.max) } : {}
139
- });
140
- case "time": return /* @__PURE__ */ D(b, {
141
- "aria-label": r,
142
- onKeyDown: I(t),
143
- onValueChange: (e) => i(Le(e) ? He(e, "minute") : null),
144
- size: o,
145
- value: R(s)
146
- });
147
- case "datetime": return /* @__PURE__ */ D(de, {
148
- "aria-label": r,
149
- onKeyDown: I(t),
150
- onValueChange: (e) => i(Ie(e) ? Ve(e) : null),
151
- size: o,
152
- value: z(s)
153
- });
154
- case "boolean": return /* @__PURE__ */ O(ve, {
155
- fullWidth: !0,
156
- items: [{
157
- label: "true",
158
- value: "true"
159
- }, {
160
- label: "false",
161
- value: "false"
162
- }],
163
- onValueChange: (e) => i(e === "true"),
164
- size: o,
165
- value: s === !0 ? "true" : s === !1 ? "false" : null,
166
- children: [/* @__PURE__ */ D(xe, {
167
- "aria-label": r,
168
- children: /* @__PURE__ */ D(Se, {})
169
- }), /* @__PURE__ */ O(ye, { children: [/* @__PURE__ */ D(be, {
170
- value: "true",
171
- children: "true"
172
- }), /* @__PURE__ */ D(be, {
173
- value: "false",
174
- children: "false"
175
- })] })]
176
- });
177
- case "set": {
178
- let e = n.options ?? [];
179
- return /* @__PURE__ */ O(he, {
180
- items: e,
181
- onValueChange: (e) => i([...e]),
182
- size: o,
183
- value: s ?? [],
184
- children: [/* @__PURE__ */ D(fe, {
185
- "aria-label": r,
186
- placeholder: r
187
- }), /* @__PURE__ */ D(pe, {
188
- "aria-label": r,
189
- children: e.map((e) => /* @__PURE__ */ D(me, {
190
- value: e.value,
191
- children: e.label
192
- }, e.value))
193
- })]
194
- });
195
- }
196
- default: return /* @__PURE__ */ D(ne, {
197
- "aria-label": r,
198
- onKeyDown: I(t),
199
- onValueChange: (e) => i(e),
200
- placeholder: r,
201
- size: o,
202
- value: s ?? ""
203
- });
204
- }
205
- }
206
- function mt({ condition: e, environment: t, field: n, ids: r, invalid: i, onConditionChange: a, withOperator: o = !0 }) {
207
- let { apply: s, renderOperand: c, size: l, t: u } = t, d = n.operators ?? Ze(n.kind), f = M(e.operator);
208
- function p(t) {
209
- let n = M(e.operator), r = M(t);
210
- a({
211
- operator: t,
212
- ...r >= 1 && n >= 1 ? { value: e.value } : {},
213
- ...r === 2 && n === 2 ? { end: e.end } : {}
214
- });
215
- }
216
- let m = (t) => ({
217
- apply: s,
218
- field: n,
219
- index: t,
220
- label: u(f === 2 ? t === 0 ? "from" : "to" : "value"),
221
- onValueChange: (n) => a(t === 0 ? {
222
- ...e,
223
- value: n
224
- } : {
225
- ...e,
226
- end: n
227
- }),
228
- operator: e.operator,
229
- size: l,
230
- value: (t === 0 ? e.value : e.end) ?? null
231
- });
232
- return /* @__PURE__ */ O(E, { children: [o ? /* @__PURE__ */ D("div", {
233
- "data-part": "operator",
234
- "data-part-operator": "",
235
- id: r?.operator,
236
- children: /* @__PURE__ */ O(ve, {
237
- fullWidth: !0,
238
- ...i ? { invalid: !0 } : {},
239
- items: d.map((e) => ({
240
- label: lt(u, e),
241
- value: e
242
- })),
243
- onValueChange: (e) => p(e),
244
- size: l,
245
- value: e.operator,
246
- children: [/* @__PURE__ */ D(xe, {
247
- "aria-label": u("operator"),
248
- children: /* @__PURE__ */ D(Se, {})
249
- }), /* @__PURE__ */ D(ye, { children: d.map((e) => /* @__PURE__ */ D(be, {
250
- value: e,
251
- children: lt(u, e)
252
- }, e)) })]
253
- })
254
- }) : null, /* @__PURE__ */ D("div", {
255
- "data-part": "operand",
256
- "data-part-operand": "",
257
- id: r?.operand,
258
- children: Array.from({ length: f }, (e, t) => /* @__PURE__ */ D(pt, {
259
- render: c,
260
- ...m(t)
261
- }, t))
262
- })] });
263
- }
264
- function ht({ choices: n, environment: r, invalid: i, onRemove: a, onRuleChange: o, path: s, rule: c }) {
265
- let { fields: l, size: u, t: d } = r, f = ke(), p = s.join("."), m = r.expanded === p, h = P(l, c.field), g = c.filter.conditions[0] ?? { operator: h ? h.defaultOperator ?? A(h.kind) : "contains" }, ee = h ? M(g.operator) : 0, te = n ?? l;
266
- function _(e) {
267
- let t = P(l, e);
268
- t && o({
269
- field: e,
270
- filter: F(t)
271
- });
272
- }
273
- let v = dt(d, h, c.filter), ne = h?.label ?? d("unknownField", { field: c.field });
274
- return /* @__PURE__ */ O("div", {
275
- "data-kind": h?.kind,
276
- "data-operands": ee,
277
- "data-part": "rule",
278
- "data-part-rule": "",
279
- ...i || !h ? { "data-invalid": "" } : {},
280
- ...m ? { "data-expanded": "" } : {},
281
- children: [
282
- /* @__PURE__ */ O("button", {
283
- "aria-controls": `${f}field ${f}operator ${f}operand`,
284
- "aria-expanded": m,
285
- "data-part": "rule-summary",
286
- "data-part-rule-summary": "",
287
- onClick: () => r.onExpandedChange?.(m ? null : p),
288
- type: "button",
289
- children: [/* @__PURE__ */ O("span", {
290
- "data-sentence": "",
291
- children: [
292
- /* @__PURE__ */ D("span", {
293
- "data-field": "",
294
- children: ne
295
- }),
296
- " ",
297
- /* @__PURE__ */ D("span", {
298
- "data-operator": "",
299
- children: v.operator
300
- }),
301
- v.operands > 0 ? /* @__PURE__ */ O(E, { children: [" ", /* @__PURE__ */ D("span", {
302
- "data-value": "",
303
- children: v.value || d("noValue")
304
- })] }) : null
305
- ]
306
- }), /* @__PURE__ */ D(t, { children: /* @__PURE__ */ D(e, { name: "chevron-down" }) })]
307
- }),
308
- /* @__PURE__ */ D("div", {
309
- "data-part": "field",
310
- "data-part-field": "",
311
- id: `${f}field`,
312
- children: /* @__PURE__ */ O(ve, {
313
- fullWidth: !0,
314
- ...i || !h ? { invalid: !0 } : {},
315
- items: te.map((e) => ({
316
- label: e.label,
317
- value: e.key
318
- })),
319
- onValueChange: (e) => _(e),
320
- size: u,
321
- value: c.field,
322
- children: [/* @__PURE__ */ D(xe, {
323
- "aria-label": d("field"),
324
- children: /* @__PURE__ */ D(Se, { placeholder: h ? void 0 : d("unknownField", { field: c.field }) })
325
- }), /* @__PURE__ */ D(ye, { children: te.map((e) => /* @__PURE__ */ D(be, {
326
- value: e.key,
327
- children: e.label
328
- }, e.key)) })]
329
- })
330
- }),
331
- h ? /* @__PURE__ */ D(mt, {
332
- condition: g,
333
- environment: r,
334
- field: h,
335
- ids: {
336
- operand: `${f}operand`,
337
- operator: `${f}operator`
338
- },
339
- invalid: i,
340
- onConditionChange: (e) => o({
341
- field: c.field,
342
- filter: nt(c.filter, 0, e)
343
- })
344
- }) : /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("div", {
345
- "data-part": "operator",
346
- "data-part-operator": "",
347
- id: `${f}operator`
348
- }), /* @__PURE__ */ D("div", {
349
- "data-part": "operand",
350
- "data-part-operand": "",
351
- id: `${f}operand`
352
- })] }),
353
- a ? /* @__PURE__ */ D("button", {
354
- "aria-label": d("removeRule"),
355
- "data-part": "remove",
356
- "data-part-remove": "",
357
- onClick: a,
358
- type: "button",
359
- children: /* @__PURE__ */ D(t, { children: /* @__PURE__ */ D(e, { name: "x" }) })
360
- }) : /* @__PURE__ */ D("span", {})
361
- ]
362
- });
363
- }
364
- function gt({ environment: n, extra: r, firstField: i, group: a, onRootChange: o, path: s, root: c }) {
365
- let { size: l, t: u } = n, d = s.length, f = /* @__PURE__ */ O(y, {
366
- "aria-label": u("match"),
367
- onValueChange: (e) => o(rt(c, s, e)),
368
- size: "sm",
369
- value: a.join,
370
- children: [/* @__PURE__ */ D(_e, {
371
- value: "and",
372
- children: u("matchAll")
373
- }), /* @__PURE__ */ D(_e, {
374
- value: "or",
375
- children: u("matchAny")
376
- })]
377
- }), [p, m] = ut((e) => u("matches", { join: e })), h = a.join === "and" ? u("matchAll") : u("matchAny"), g = d > 0 ? /* @__PURE__ */ D(v, {
378
- "aria-label": u("removeGroup"),
379
- onClick: () => o(Qe(c, s)),
380
- render: (e) => /* @__PURE__ */ D("button", { ...x(e, "part", "remove-group") }),
381
- size: l === "lg" ? "md" : "sm",
382
- title: u("removeGroup"),
383
- tone: "secondary",
384
- variant: "ghost",
385
- children: /* @__PURE__ */ D(t, { children: /* @__PURE__ */ D(e, { name: "trash" }) })
386
- }) : null;
387
- function ee() {
388
- i && (o(Je(c, s, {
389
- field: i.key,
390
- filter: F(i)
391
- })), n.onExpandedChange?.([...s, a.rules.length].join(".")));
392
- }
393
- function te() {
394
- i && (o(Je(c, s, {
395
- join: a.join === "and" ? "or" : "and",
396
- rules: [{
397
- field: i.key,
398
- filter: F(i)
399
- }]
400
- })), n.onExpandedChange?.([
401
- ...s,
402
- a.rules.length,
403
- 0
404
- ].join(".")));
405
- }
406
- return /* @__PURE__ */ O("fieldset", {
407
- "data-depth": d,
408
- "data-part": "group",
409
- "data-part-group": "",
410
- children: [
411
- /* @__PURE__ */ D("legend", { children: u("matches", { join: h }) }),
412
- /* @__PURE__ */ O("div", {
413
- "data-part": "join",
414
- "data-part-join": "",
415
- children: [
416
- p ? /* @__PURE__ */ D("span", { children: p }) : null,
417
- f,
418
- m ? /* @__PURE__ */ D("span", { children: m }) : null,
419
- g
420
- ]
421
- }),
422
- /* @__PURE__ */ D("div", {
423
- "data-part": "rules",
424
- "data-part-rules": "",
425
- children: a.rules.map((e, t) => {
426
- let r = [...s, t], l = /* @__PURE__ */ D("span", {
427
- "data-part": "conjunction",
428
- "data-part-conjunction": "",
429
- children: u(t === 0 ? "where" : `joins.${a.join}`)
430
- });
431
- if (Xe(e)) return /* @__PURE__ */ O(S, { children: [l, /* @__PURE__ */ D(gt, {
432
- environment: n,
433
- firstField: i,
434
- group: e,
435
- onRootChange: o,
436
- path: r,
437
- root: c
438
- })] }, t);
439
- let d = P(n.fields, e.field);
440
- return /* @__PURE__ */ O(S, { children: [l, /* @__PURE__ */ D(ht, {
441
- environment: n,
442
- path: r,
443
- onRemove: d?.required ? void 0 : () => o(Qe(c, r)),
444
- onRuleChange: (e) => o(tt(c, r, e)),
445
- rule: e
446
- })] }, t);
447
- })
448
- }),
449
- /* @__PURE__ */ O("div", {
450
- "data-part": "actions",
451
- "data-part-actions": "",
452
- children: [
453
- /* @__PURE__ */ D(_, {
454
- disabled: !i,
455
- onClick: ee,
456
- render: (e) => /* @__PURE__ */ D("button", { ...x(e, "part", "add-rule") }),
457
- size: l === "lg" ? "md" : "sm",
458
- start: /* @__PURE__ */ D(t, { children: /* @__PURE__ */ D(e, { name: "plus" }) }),
459
- tone: "secondary",
460
- variant: d === 0 ? "outline" : "ghost",
461
- children: u("addRule")
462
- }),
463
- /* @__PURE__ */ D(_, {
464
- disabled: !i,
465
- onClick: te,
466
- render: (e) => /* @__PURE__ */ D("button", { ...x(e, "part", "add-group") }),
467
- size: l === "lg" ? "md" : "sm",
468
- start: /* @__PURE__ */ D(t, { children: /* @__PURE__ */ D(e, { name: "plus" }) }),
469
- tone: "secondary",
470
- variant: d === 0 ? "outline" : "ghost",
471
- children: u("addGroup")
472
- }),
473
- d === 0 ? r : null
474
- ]
475
- })
476
- ]
477
- });
478
- }
479
- //#endregion
480
- //#region src/filter-bar/filter-bar.tsx
481
- var _t = {
482
- apply: "live",
483
- chipLimit: 6,
484
- queryDelay: 320,
485
- shortcut: null,
486
- size: "md"
487
- }, vt = [
488
- "summary",
489
- "pill",
490
- "chip-operator",
491
- "chip-value",
492
- "chip-remove",
493
- "more",
494
- "add",
495
- "clear",
496
- "reset",
497
- "apply"
498
- ].map((e) => `[data-part='${e}']`).join(", "), B = 36;
499
- function yt(e, t) {
500
- let n = parseFloat(e.ownerDocument.defaultView?.getComputedStyle(e.ownerDocument.documentElement).fontSize ?? "16");
501
- return t * (Number.isFinite(n) ? n : 16);
502
- }
503
- function bt(e, t) {
504
- return $e(e) === $e(t);
505
- }
506
- function xt(e) {
507
- if (!e) return !1;
508
- let t = e.tagName;
509
- return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || e.isContentEditable;
510
- }
511
- var V = "--slotted-page-sticky-top", St = typeof document > "u" ? C : je;
512
- function Ct(e) {
513
- let [t, n] = T(!1);
514
- return C(() => {
515
- let t = e.current;
516
- if (!t || typeof ResizeObserver > "u") return;
517
- let r = new ResizeObserver(() => {
518
- let e = t.getBoundingClientRect().width;
519
- n(e > 0 && e < yt(t, B));
520
- });
521
- return r.observe(t), () => r.disconnect();
522
- }, []), t;
523
- }
524
- function wt() {
525
- let [e, t] = T(!1);
526
- return C(() => {
527
- let e = typeof window > "u" ? void 0 : window;
528
- if (!e?.matchMedia) return;
529
- let n = e.matchMedia(`(max-width: ${B}rem)`), r = () => t(n.matches);
530
- return r(), n.addEventListener?.("change", r), () => n.removeEventListener?.("change", r);
531
- }, []), e;
532
- }
533
- function H({ apply: se, children: ue, chipLimit: de, count: fe, defaultOpen: pe, defaultPreset: me, defaultQuery: he, defaultRevealed: ge, defaultValue: _e, disabled: y = !1, fields: b, loading: S = !1, messages: Ee, onOpenChange: Oe, onPresetChange: je, onPresetSave: Fe, onQueryChange: Ie, onRevealedChange: Le, onValueChange: Re, open: ze, preset: Be, presets: k, query: Ve, queryDelay: He, readOnly: A = !1, ref: Ge, renderOperand: Je, revealed: $e, shortcut: et, size: tt, sticky: rt = !1, container: ot, total: ct, value: ut, ...I }) {
534
- let L = st(), R = d(Ne, Ee), z = se ?? L.apply ?? _t.apply, pt = de ?? L.chipLimit ?? _t.chipLimit, mt = He ?? L.queryDelay ?? _t.queryDelay, ht = et === void 0 ? L.shortcut ?? _t.shortcut : et, B = tt ?? L.size ?? _t.size, yt = ke(), H = w(null), Ot = w(null), kt = w(null), At = Ct(H), jt = wt(), [Mt, Nt] = T(_e ?? null), U = ut === void 0 ? Mt : ut, [Pt, Ft] = T(he ?? ""), It = Ve === void 0 ? Pt : Ve, [Lt, Rt] = T(me ?? null), zt = Be === void 0 ? Lt : Be, [Bt, Vt] = T(pe ?? !1), Ht = ze === void 0 ? Bt : ze, [Ut, Wt] = T(ge ?? !1), Gt = $e === void 0 ? Ut : $e;
535
- function W(e) {
536
- Pe(H.current?.ownerDocument).announce(e);
537
- }
538
- let Kt = Me(() => ({
539
- field: (e) => P(b, e)?.label ?? e,
540
- join: (e) => R(`joins.${e}`),
541
- operator: (e) => lt(R, e)
542
- }), [b, R]), qt = De((e, t) => Ue(t, {
543
- ...Kt,
544
- value: (t) => e?.options?.find((e) => e.value === t)?.label ?? String(t)
545
- }), [Kt]), Jt = De((e, t, n) => {
546
- let r = j(e);
547
- Te({
548
- controlled: ut,
549
- equals: bt,
550
- initial: U,
551
- onRequest: (e) => Re?.(e.value, e)
552
- }).request(r, t, n) && Nt(r);
553
- }, [
554
- Re,
555
- U,
556
- ut
557
- ]), Yt = De((e, t, n) => {
558
- Te({
559
- controlled: Ve,
560
- initial: It,
561
- onRequest: (e) => Ie?.(e.value, e)
562
- }).request(e, t, n) && Ft(e);
563
- }, [
564
- Ie,
565
- It,
566
- Ve
567
- ]);
568
- function Xt(e, t, n) {
569
- Te({
570
- controlled: Be,
571
- initial: zt,
572
- onRequest: (e) => je?.(e.value, e)
573
- }).request(e, t, n) && Rt(e);
574
- }
575
- function Zt(e, t, n) {
576
- Te({
577
- controlled: ze,
578
- initial: Ht,
579
- onRequest: (e) => Oe?.(e.value, e)
580
- }).request(e, t, n) && Vt(e);
581
- }
582
- function Qt(e, t, n) {
583
- Te({
584
- controlled: $e,
585
- initial: Gt,
586
- onRequest: (e) => Le?.(e.value, e)
587
- }).request(e, t, n) && Wt(e);
588
- }
589
- let [G, K] = T(null), q = z === "manual" && G ? G.value : U, $t = z === "manual" && G ? G.query : It, en = z === "manual" && G !== null && (!bt(G.value, U) || G.query !== It), tn = w(U);
590
- C(() => {
591
- bt(tn.current, U) || (tn.current = U, K(null));
592
- }, [U]);
593
- let nn = Me(() => {
594
- let e = k?.find((e) => e.key === zt);
595
- return e !== void 0 && !bt(j(e.value), U);
596
- }, [
597
- zt,
598
- k,
599
- U
600
- ]);
601
- function J(e, t, n) {
602
- if (z === "manual") {
603
- K({
604
- value: e,
605
- query: $t
606
- });
607
- return;
608
- }
609
- Jt(e, t, n);
610
- }
611
- let rn = Me(() => b.filter((e) => e.required), [b]);
612
- function an() {
613
- let e = null;
614
- for (let t of rn) t.defaultValue && (e = it(e, t.key, t.defaultValue));
615
- return j(e);
616
- }
617
- function on(e) {
618
- return rn.filter((t) => !Ye(N(e, t.key) ?? null));
619
- }
620
- function sn(e) {
621
- if (!G) return;
622
- let t = on(G.value);
623
- if (t.length > 0) {
624
- let e = t[0];
625
- Y(e.key), W(R("required", { field: e.label })), H.current?.querySelector(`[data-part='pill'][data-field='${CSS.escape(e.key)}']`)?.focus();
626
- return;
627
- }
628
- Y(null), Jt(G.value, "submit", e), G.query !== It && Yt(G.query, "submit", e), K(null);
629
- let n = j(G.value);
630
- W(n ? R("appliedCount", {
631
- count: qe(n).length,
632
- filters: We(n, Kt)
633
- }) : R("cleared"));
634
- }
635
- function cn() {
636
- K(null), Y(null);
637
- }
638
- function ln(e) {
639
- let t = an();
640
- Y(null), Z(null), z === "manual" ? K({
641
- value: t,
642
- query: ""
643
- }) : (Jt(t, "clear", e), It !== "" && Yt("", "clear", e)), W(t ? R("clearedTo", { filters: We(t, Kt) }) : R("cleared"));
644
- }
645
- function un(e, t) {
646
- let n = P(b, e);
647
- if (n?.required) {
648
- Y(e), W(R("required", { field: n.label }));
649
- return;
650
- }
651
- X?.key === e && (Z(null), N(q, e) === void 0) || (J(at(q, e), "remove", t), W(R("removed", { field: n?.label ?? e })));
652
- }
653
- function dn(e, t) {
654
- q && J(Qe(q, e), "remove", t);
655
- }
656
- function fn(e, t) {
657
- Xt(e, e === null ? "clear" : "select", t);
658
- let n = k?.find((t) => t.key === e);
659
- n && (K(null), Jt(n.value, "select", t), W(n.label));
660
- }
661
- let [pn, Y] = T(null), [X, Z] = T(null), [mn, hn] = T(null), gn = w(null);
662
- function _n(e, t, n) {
663
- if (z === "manual") {
664
- K({
665
- value: q,
666
- query: e
667
- });
668
- return;
669
- }
670
- if (hn(e), gn.current && clearTimeout(gn.current), t === "clear" || mt === 0) {
671
- hn(null), Yt(e, t, n);
672
- return;
673
- }
674
- gn.current = setTimeout(() => {
675
- gn.current = null, hn(null), Yt(e, t, n);
676
- }, mt);
677
- }
678
- C(() => () => {
679
- gn.current && clearTimeout(gn.current);
680
- }, []);
681
- function vn(e) {
682
- e.defaultPrevented || (e.key === "Escape" && (mn ?? $t) !== "" && (e.preventDefault(), _n("", "clear", e)), e.key === "Enter" && z === "manual" && sn(e));
683
- }
684
- C(() => {
685
- if (!ht || y) return;
686
- let e = H.current?.ownerDocument;
687
- if (!e) return;
688
- let t = (t) => {
689
- t.defaultPrevented || t.metaKey || t.ctrlKey || t.altKey || t.key === ht && (xt(e.activeElement) || (t.preventDefault(), Ot.current?.focus()));
690
- };
691
- return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
692
- }, [y, ht]);
693
- let yn = w(null);
694
- C(() => {
695
- let e = kt.current;
696
- if (!e) return;
697
- let t = we(e, {
698
- includeAriaDisabled: !0,
699
- itemSelector: vt
700
- }), n = Ce(e, {
701
- fallback: () => e.querySelector("[data-part='add']") ?? null,
702
- itemSelector: vt
703
- });
704
- return yn.current = t, () => {
705
- t.destroy(), n.destroy(), yn.current = null;
706
- };
707
- }, []), C(() => {
708
- yn.current?.refresh();
709
- });
710
- let bn = w(null);
711
- St(() => {
712
- let e = bn.current;
713
- e && (bn.current = null, (e.isConnected ? e : kt.current?.querySelector("[data-part='add']"))?.focus());
714
- }), C(() => {
715
- let e = H.current;
716
- if (!rt || !e || typeof ResizeObserver > "u") return;
717
- let t = e.parentElement, n = e.ownerDocument.defaultView;
718
- if (!t || !n) return;
719
- let r = t.style.getPropertyValue(V), i = () => r ? t.style.setProperty(V, r) : t.style.removeProperty(V), a = new ResizeObserver(() => {
720
- i();
721
- let r = n.getComputedStyle(t).getPropertyValue(V).trim() || "0px", a = e.getBoundingClientRect().height;
722
- e.style.setProperty(V, r), t.style.setProperty(V, `calc(${r} + ${a}px)`);
723
- });
724
- return a.observe(e), () => {
725
- a.disconnect(), e.style.removeProperty(V), i();
726
- };
727
- }, [rt]);
728
- let xn = fe === void 0 ? null : ct === void 0 ? R("countOnly", { count: fe }) : R("count", {
729
- count: fe,
730
- total: ct
731
- }), [Sn, Cn] = T(null), wn = w(null), Q = Tt(Ht, q, wn);
732
- function Tn(e, t, n) {
733
- n?.tree !== void 0 && (wn.current = n.tree), Cn(n ? n.path.join(".") : null), Zt(!0, e, t);
734
- }
735
- function En(e, t) {
736
- let n = P(b, e), r = q ? q.rules.findIndex((t) => !Xe(t) && t.field === e) : -1;
737
- if (r !== -1 && X?.key !== e) {
738
- Tn("pointer", t, { path: [r] });
739
- return;
740
- }
741
- let i = X?.key === e ? X.filter : n ? F(n) : null;
742
- if (!i) return;
743
- let a = it(q, e, i);
744
- Z(null), Tn("pointer", t, {
745
- path: [a.rules.findIndex((t) => !Xe(t) && t.field === e)],
746
- tree: a
747
- });
748
- }
749
- Ae(Ge, () => ({
750
- focusSearch: () => Ot.current?.focus(),
751
- open: (e) => Tn("programmatic", void 0, e ? { path: e } : void 0),
752
- get root() {
753
- return H.current;
754
- }
755
- }), []);
756
- let Dn = {
757
- apply: () => z === "manual" ? sn() : void 0,
758
- fields: b,
759
- renderOperand: Je,
760
- size: B,
761
- t: R
762
- }, On = y || A, kn = b.filter((e) => e.pinned || e.required), An = new Set(kn.map((e) => e.key)), jn = q ? Et(q) : 0, [Mn, Nn] = T(null), Pn = b.filter((e) => !An.has(e.key) && N(q, e.key) === void 0 && e.key !== X?.key), Fn = /* @__PURE__ */ new Map();
763
- for (let e of Pn) {
764
- let t = Fn.get(e.section) ?? [];
765
- t.push(e), Fn.set(e.section, t);
766
- }
767
- function In(e, t) {
768
- let n = P(b, e);
769
- if (!n || On) return;
770
- if (At) {
771
- En(e, t);
772
- return;
773
- }
774
- let r = F(n);
775
- Ye(r) ? J(it(q, e, r), "pointer", t) : Z({
776
- key: e,
777
- filter: r
778
- }), Nn(e);
779
- }
780
- function Ln(e, t, n) {
781
- let r = P(b, e);
782
- if (t === null) {
783
- if (r?.required) {
784
- Y(e), W(R("required", { field: r.label }));
785
- return;
786
- }
787
- X?.key === e && Z(null), J(at(q, e), "clear");
788
- return;
789
- }
790
- if (Y(null), !Ye(t)) {
791
- if (z === "manual") {
792
- J(it(q, e, t), n);
793
- return;
794
- }
795
- let r = q ? q.rules.findIndex((t) => !Xe(t) && t.field === e) : -1;
796
- Z({
797
- key: e,
798
- filter: t,
799
- ...r === -1 ? {} : { at: r }
800
- }), r !== -1 && J(at(q, e), n);
801
- return;
802
- }
803
- X?.key === e && Z(null), J(it(q, e, t), n);
804
- }
805
- function Rn(e, t, n, r) {
806
- let i = t.conditions[0] ?? { operator: n }, a = M(i.operator), o = M(n), s = nt(t, 0, {
807
- operator: n,
808
- ...o >= 1 && a >= 1 ? { value: i.value } : {},
809
- ...o === 2 && a === 2 ? { end: i.end } : {}
810
- });
811
- Ln(e, s, "pointer"), o > 0 && !Ye(s) && Nn(e);
812
- }
813
- function zn(e, t) {
814
- if (e.key !== "Delete" && e.key !== "Backspace") return;
815
- let n = e.target.closest("[data-part='chip-operator'], [data-part='chip-value'], [data-part='chip-remove']");
816
- if (!n || On || e.defaultPrevented) return;
817
- if (e.preventDefault(), P(b, t)?.required) {
818
- un(t, e);
819
- return;
820
- }
821
- let r = [...kt.current?.querySelectorAll("[data-part='chip']") ?? []].filter((e) => e.checkVisibility?.() ?? !0), i = n.closest("[data-part='chip']"), a = i ? r.indexOf(i) : -1, o = n.getAttribute("data-part"), s = r[a + 1] ?? r[a - 1];
822
- bn.current = s?.querySelector(`[data-part='${o}']`) ?? s?.querySelector("button") ?? kt.current?.querySelector("[data-part='add']") ?? null, un(t, e);
823
- }
824
- function Bn(r, i, a) {
825
- let u = P(b, r), d = u === void 0, f = u?.label ?? r, p = dt(R, u, i), m = a.incomplete === !0 || !Ye(i), h = p.value || R("noValue"), g = R("rule", {
826
- condition: p.operands > 0 ? R("condition", {
827
- operator: p.operator,
828
- value: h
829
- }) : p.operator,
830
- field: d ? R("unknownField", { field: r }) : f
831
- }), ee = m ? R("incomplete", { rule: g }) : g, te = i.conditions[0], _ = u?.operators ?? (u ? Ze(u.kind) : []), v = A ? { "aria-disabled": !0 } : {}, ne = y || d, se = A || d ? /* @__PURE__ */ D("button", {
832
- "data-part": "chip-operator",
833
- "data-part-chip-operator": "",
834
- disabled: y,
835
- type: "button",
836
- ...d ? { "aria-disabled": !0 } : v,
837
- children: p.operator
838
- }) : /* @__PURE__ */ O(n, { children: [/* @__PURE__ */ D(c, { render: (e) => /* @__PURE__ */ D("button", {
839
- ...x(e, "part", "chip-operator"),
840
- disabled: ne,
841
- type: "button",
842
- children: p.operator
843
- }) }), /* @__PURE__ */ D(l, {
844
- "aria-label": R("operator"),
845
- children: /* @__PURE__ */ D(s, {
846
- onValueChange: (e, t) => Rn(r, i, e, t.source),
847
- value: te?.operator ?? "",
848
- children: _.map((e) => /* @__PURE__ */ D(o, {
849
- value: e,
850
- children: lt(R, e)
851
- }, e))
852
- })
853
- })] }), le = /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("span", {
854
- "data-operator": "",
855
- children: p.operator
856
- }), /* @__PURE__ */ D("span", {
857
- "data-value": "",
858
- children: h
859
- })] }), ue = R("condition", {
860
- operator: p.operator,
861
- value: p.full || h
862
- }), de = p.full && p.full !== p.value ? p.full : void 0, fe = null;
863
- return (p.operands > 0 || m) && (fe = A || !u || At ? /* @__PURE__ */ D("button", {
864
- "aria-haspopup": At && !A && !d ? "dialog" : void 0,
865
- "aria-label": ue,
866
- "data-part": "chip-value",
867
- "data-part-chip-value": "",
868
- disabled: y,
869
- onClick: (e) => At && !A && !d ? En(r, e) : void 0,
870
- title: de,
871
- type: "button",
872
- ...A || d ? { "aria-disabled": !0 } : {},
873
- children: le
874
- }) : /* @__PURE__ */ O(ae, {
875
- onOpenChange: (e) => Nn(e ? r : Mn === r ? null : Mn),
876
- open: Mn === r,
877
- children: [/* @__PURE__ */ D(ie, { render: (e) => /* @__PURE__ */ D("button", {
878
- ...x(e, "part", "chip-value"),
879
- "aria-haspopup": "dialog",
880
- "aria-label": ue,
881
- disabled: y,
882
- title: de,
883
- type: "button",
884
- children: le
885
- }) }), /* @__PURE__ */ D(oe, { children: /* @__PURE__ */ D(re, {
886
- "aria-label": f,
887
- children: /* @__PURE__ */ D(ce, { children: /* @__PURE__ */ D(Dt, {
888
- apply: z,
889
- current: i,
890
- environment: Dn,
891
- field: u,
892
- invalid: pn === r,
893
- onChange: (e) => Ln(r, e, "keyboard"),
894
- onDone: () => {
895
- let e = N(q, r);
896
- e && Ye(e) && W(R("rule", {
897
- condition: qt(u, e),
898
- field: f
899
- }));
900
- },
901
- queryDelay: mt,
902
- withOperator: !1
903
- }) })
904
- }) })]
905
- })), /* @__PURE__ */ O("div", {
906
- "aria-label": ee,
907
- "data-field": r,
908
- "data-operands": p.operands,
909
- "data-part": "chip",
910
- "data-part-chip": "",
911
- onKeyDown: (e) => zn(e, r),
912
- role: "group",
913
- ...a.pinned ? { "data-pinned": "" } : {},
914
- ...m ? { "data-incomplete": "" } : {},
915
- ...a.folded ? { "data-folded": "" } : {},
916
- ...d || pn === r ? { "data-invalid": "" } : {},
917
- children: [
918
- /* @__PURE__ */ O("span", {
919
- "data-part": "chip-field",
920
- "data-part-chip-field": "",
921
- children: [/* @__PURE__ */ D(ft, { icon: u?.icon }), /* @__PURE__ */ D("span", { children: f })]
922
- }),
923
- se,
924
- fe,
925
- u?.required || A ? null : /* @__PURE__ */ D("button", {
926
- "aria-label": R("remove", { name: f }),
927
- "data-part": "chip-remove",
928
- "data-part-chip-remove": "",
929
- disabled: y,
930
- onClick: (e) => un(r, e),
931
- type: "button",
932
- children: /* @__PURE__ */ D(t, { children: /* @__PURE__ */ D(e, { name: "x" }) })
933
- })
934
- ]
935
- }, r);
936
- }
937
- function Vn(n, r, i) {
938
- let a = `(${We(n, Kt)})`;
939
- return /* @__PURE__ */ O("div", {
940
- "aria-label": a,
941
- "data-operands": 1,
942
- "data-part": "chip",
943
- "data-part-chip": "",
944
- onKeyDown: (e) => {
945
- (e.key === "Delete" || e.key === "Backspace") && !On && (e.preventDefault(), dn(r, e));
946
- },
947
- role: "group",
948
- ...i ? { "data-folded": "" } : {},
949
- children: [/* @__PURE__ */ D("button", {
950
- "aria-haspopup": "dialog",
951
- "data-part": "chip-value",
952
- "data-part-chip-value": "",
953
- disabled: y,
954
- onClick: (e) => A ? void 0 : Tn("pointer", e, { path: r }),
955
- title: a,
956
- type: "button",
957
- ...A ? { "aria-disabled": !0 } : {},
958
- children: /* @__PURE__ */ D("span", {
959
- "data-value": "",
960
- children: a
961
- })
962
- }), A ? null : /* @__PURE__ */ D("button", {
963
- "aria-label": R("remove", { name: a }),
964
- "data-part": "chip-remove",
965
- "data-part-chip-remove": "",
966
- disabled: y,
967
- onClick: (e) => dn(r, e),
968
- type: "button",
969
- children: /* @__PURE__ */ D(t, { children: /* @__PURE__ */ D(e, { name: "x" }) })
970
- })]
971
- }, `group-${r.join(".")}`);
972
- }
973
- let $ = [], Hn = 0, Un = () => Hn++ >= pt;
974
- for (let n of kn) {
975
- let r = N(q, n.key);
976
- r === void 0 ? X?.key === n.key ? $.push(Bn(n.key, X.filter, {
977
- pinned: !0,
978
- incomplete: !0,
979
- folded: Un()
980
- })) : A || $.push(/* @__PURE__ */ O("button", {
981
- "aria-haspopup": "dialog",
982
- "data-field": n.key,
983
- "data-part": "pill",
984
- "data-part-pill": "",
985
- disabled: y,
986
- onClick: (e) => In(n.key, e),
987
- type: "button",
988
- ...pn === n.key ? {
989
- "data-invalid": "",
990
- "aria-invalid": !0
991
- } : {},
992
- children: [/* @__PURE__ */ D(t, { children: /* @__PURE__ */ D(e, { name: "plus" }) }), /* @__PURE__ */ D("span", { children: n.label })]
993
- }, n.key)) : $.push(Bn(n.key, r, {
994
- pinned: !0,
995
- folded: Un()
996
- }));
997
- }
998
- let Wn = X && !An.has(X.key) && N(q, X.key) === void 0 ? X : null, Gn = () => Wn ? Bn(Wn.key, Wn.filter, {
999
- incomplete: !0,
1000
- folded: Un()
1001
- }) : null, Kn = !1;
1002
- (q?.rules ?? []).forEach((e, t) => {
1003
- Wn?.at === t && ($.push(Gn()), Kn = !0), Xe(e) ? $.push(Vn(e, [t], Un())) : An.has(e.field) || $.push(Bn(e.field, e.filter, { folded: Un() }));
1004
- }), Wn && !Kn && $.push(Gn());
1005
- let qn = Hn, Jn = Math.max(0, qn - pt);
1006
- return /* @__PURE__ */ O("div", {
1007
- "aria-label": R("bar"),
1008
- role: "search",
1009
- ...x(I, "part", "root"),
1010
- "data-apply": z,
1011
- "data-size": B,
1012
- "data-ui": "filter-bar",
1013
- "data-ui-filter-bar": "",
1014
- ref: H,
1015
- ...y ? { "data-disabled": "" } : {},
1016
- ...A ? { "data-readonly": "" } : {},
1017
- ...S ? { "data-loading": "" } : {},
1018
- ...en || nn ? { "data-dirty": "" } : {},
1019
- ...Ht ? { "data-open": "" } : {},
1020
- ...rt ? { "data-sticky": "" } : {},
1021
- children: [/* @__PURE__ */ O("div", {
1022
- "data-part": "frame",
1023
- "data-part-frame": "",
1024
- children: [
1025
- /* @__PURE__ */ D("div", {
1026
- "data-part": "search",
1027
- "data-part-search": "",
1028
- children: /* @__PURE__ */ D(ne, {
1029
- "aria-label": R("search"),
1030
- clearable: !0,
1031
- disabled: y,
1032
- end: ht ? /* @__PURE__ */ D(le, {
1033
- size: "sm",
1034
- children: ht
1035
- }) : void 0,
1036
- onKeyDown: vn,
1037
- onValueChange: (e, t) => _n(e, t.reason === "clear" ? "clear" : "keyboard", t.source),
1038
- placeholder: R("search"),
1039
- ref: Ot,
1040
- size: B,
1041
- start: /* @__PURE__ */ D(t, { children: /* @__PURE__ */ D(e, { name: "search" }) }),
1042
- type: "search",
1043
- value: mn ?? $t
1044
- })
1045
- }),
1046
- /* @__PURE__ */ O("div", {
1047
- "aria-label": R("filters"),
1048
- "data-part": "bar",
1049
- "data-part-bar": "",
1050
- ref: kt,
1051
- role: "toolbar",
1052
- ...A ? { "aria-description": R("readOnly") } : {},
1053
- ...Gt ? { "data-revealed": "" } : {},
1054
- children: [
1055
- /* @__PURE__ */ D(_, {
1056
- "aria-haspopup": "dialog",
1057
- disabled: y,
1058
- onClick: (e) => Tn("pointer", e),
1059
- render: (e) => /* @__PURE__ */ D("button", { ...x(e, "part", "summary") }),
1060
- size: B,
1061
- start: /* @__PURE__ */ D(t, { children: /* @__PURE__ */ D(e, { name: "funnel" }) }),
1062
- tone: "secondary",
1063
- variant: "outline",
1064
- children: /* @__PURE__ */ D("span", { children: R("summary", { count: jn }) })
1065
- }),
1066
- $,
1067
- Jn > 0 ? /* @__PURE__ */ D("button", {
1068
- "aria-expanded": Gt,
1069
- "data-part": "more",
1070
- "data-part-more": "",
1071
- disabled: y,
1072
- onClick: (e) => Qt(!Gt, "pointer", e),
1073
- type: "button",
1074
- children: Gt ? R("less") : R("more", { count: Jn })
1075
- }) : null,
1076
- A ? null : /* @__PURE__ */ O(n, { children: [/* @__PURE__ */ D(c, { render: (n) => qn > 0 ? /* @__PURE__ */ D(v, {
1077
- ...n,
1078
- "aria-label": R("add"),
1079
- disabled: y || Pn.length === 0,
1080
- render: (e) => /* @__PURE__ */ D("button", {
1081
- ...x(e, "part", "add"),
1082
- "data-compact": ""
1083
- }),
1084
- shape: "circle",
1085
- size: B,
1086
- title: R("add"),
1087
- tone: "secondary",
1088
- variant: "outline",
1089
- children: /* @__PURE__ */ D(t, { children: /* @__PURE__ */ D(e, { name: "plus" }) })
1090
- }) : /* @__PURE__ */ D(_, {
1091
- ...n,
1092
- disabled: y || Pn.length === 0,
1093
- render: (e) => /* @__PURE__ */ D("button", { ...x(e, "part", "add") }),
1094
- size: B,
1095
- start: /* @__PURE__ */ D(t, { children: /* @__PURE__ */ D(e, { name: "plus" }) }),
1096
- tone: "secondary",
1097
- variant: "ghost",
1098
- children: R("add")
1099
- }) }), /* @__PURE__ */ D(l, {
1100
- "aria-label": R("add"),
1101
- children: [...Fn.entries()].map(([e, t]) => {
1102
- let n = t.map((e) => /* @__PURE__ */ O(i, {
1103
- onSelect: (t) => In(e.key, t),
1104
- children: [e.icon ? /* @__PURE__ */ D(u, { children: /* @__PURE__ */ D(ft, { icon: e.icon }) }) : null, /* @__PURE__ */ D(a, { children: e.label })]
1105
- }, e.key));
1106
- return e === void 0 ? n : /* @__PURE__ */ D(r, {
1107
- label: e,
1108
- children: n
1109
- }, e);
1110
- })
1111
- })] }),
1112
- !A && (jn > 0 || $t !== "" || X) ? /* @__PURE__ */ D(_, {
1113
- disabled: y,
1114
- onClick: (e) => ln(e),
1115
- render: (e) => /* @__PURE__ */ D("button", { ...x(e, "part", "clear") }),
1116
- size: B,
1117
- tone: "secondary",
1118
- variant: "ghost",
1119
- children: R("clear")
1120
- }) : null,
1121
- z === "manual" && !A ? /* @__PURE__ */ O("div", {
1122
- "data-part": "actions",
1123
- "data-part-actions": "",
1124
- children: [/* @__PURE__ */ D(_, {
1125
- disabled: y || !en,
1126
- onClick: cn,
1127
- render: (e) => /* @__PURE__ */ D("button", { ...x(e, "part", "reset") }),
1128
- size: B,
1129
- tone: "secondary",
1130
- variant: "ghost",
1131
- children: R("reset")
1132
- }), /* @__PURE__ */ D(_, {
1133
- disabled: y || S || !en,
1134
- onClick: (e) => sn(e),
1135
- render: (e) => /* @__PURE__ */ D("button", { ...x(e, "part", "apply") }),
1136
- size: B,
1137
- children: R("apply")
1138
- })]
1139
- }) : null
1140
- ]
1141
- }),
1142
- /* @__PURE__ */ O("div", {
1143
- "data-part": "end",
1144
- "data-part-end": "",
1145
- children: [k && k.length > 0 ? /* @__PURE__ */ D("div", {
1146
- "data-part": "preset",
1147
- "data-part-preset": "",
1148
- children: /* @__PURE__ */ O(ve, {
1149
- clearable: !0,
1150
- disabled: y || A,
1151
- items: k.map((e) => ({
1152
- label: e.label,
1153
- value: e.key
1154
- })),
1155
- onValueChange: (e, t) => fn(e ?? null, t.source),
1156
- size: B,
1157
- value: zt,
1158
- children: [/* @__PURE__ */ D(xe, {
1159
- "aria-label": R("preset"),
1160
- children: /* @__PURE__ */ D(Se, { placeholder: R("presetNone") })
1161
- }), /* @__PURE__ */ D(ye, { children: k.map((e) => /* @__PURE__ */ D(be, {
1162
- value: e.key,
1163
- children: e.label
1164
- }, e.key)) })]
1165
- })
1166
- }) : null, ue]
1167
- }),
1168
- xn !== null || S ? /* @__PURE__ */ O("p", {
1169
- "aria-live": "polite",
1170
- "data-part": "count",
1171
- "data-part-count": "",
1172
- ...S ? { "aria-busy": !0 } : {},
1173
- children: [S ? /* @__PURE__ */ D("span", {
1174
- "data-ui": "spinner",
1175
- "data-ui-spinner": "",
1176
- "data-part": "root",
1177
- "data-part-root": "",
1178
- "data-size": "sm",
1179
- role: "progressbar",
1180
- "aria-label": R("filters")
1181
- }) : null, xn]
1182
- }) : null
1183
- ]
1184
- }), /* @__PURE__ */ D(te, {
1185
- container: ot,
1186
- onOpenChange: (e, t) => {
1187
- Zt(e, t.reason, t.source);
1188
- },
1189
- open: Ht,
1190
- side: jt ? "bottom" : "end",
1191
- size: jt ? "content" : "xl",
1192
- children: /* @__PURE__ */ O(g, { children: [
1193
- /* @__PURE__ */ O(f, { children: [/* @__PURE__ */ D(p, { children: R("builder") }), /* @__PURE__ */ D(h, {})] }),
1194
- /* @__PURE__ */ D(ee, { children: /* @__PURE__ */ D("div", {
1195
- "data-part": "builder",
1196
- "data-part-builder": "",
1197
- "data-ui": "filter-bar",
1198
- "data-ui-filter-bar": "",
1199
- id: `${yt}builder`,
1200
- children: /* @__PURE__ */ D(gt, {
1201
- environment: {
1202
- ...Dn,
1203
- apply: () => Yn(),
1204
- expanded: Sn,
1205
- onExpandedChange: Cn
1206
- },
1207
- extra: /* @__PURE__ */ O(E, { children: [Q.value && Et(Q.value) > 0 ? /* @__PURE__ */ D(_, {
1208
- onClick: () => Q.set(an()),
1209
- render: (e) => /* @__PURE__ */ D("button", { ...x(e, "part", "clear") }),
1210
- size: "sm",
1211
- tone: "secondary",
1212
- variant: "ghost",
1213
- children: R("clear")
1214
- }) : null, Fe ? /* @__PURE__ */ D(_, {
1215
- onClick: () => Fe(j(Q.value)),
1216
- render: (e) => /* @__PURE__ */ D("button", { ...x(e, "part", "save-preset") }),
1217
- size: "sm",
1218
- tone: "secondary",
1219
- variant: "ghost",
1220
- children: R("savePreset")
1221
- }) : null] }),
1222
- firstField: b[0],
1223
- group: Q.value ?? Ke(),
1224
- onRootChange: (e) => Q.set(e),
1225
- path: [],
1226
- root: Q.value ?? Ke()
1227
- })
1228
- }) }),
1229
- /* @__PURE__ */ O(m, { children: [/* @__PURE__ */ D(_, {
1230
- onClick: (e) => Zt(!1, "dismiss", e),
1231
- size: "sm",
1232
- tone: "secondary",
1233
- variant: "ghost",
1234
- children: R("cancel")
1235
- }), /* @__PURE__ */ D(_, {
1236
- onClick: () => Yn(),
1237
- size: "sm",
1238
- children: R("apply")
1239
- })] })
1240
- ] })
1241
- })]
1242
- });
1243
- function Yn() {
1244
- let e = Q.value, t = on(e);
1245
- if (t.length > 0) {
1246
- let e = t[0];
1247
- Y(e.key), W(R("required", { field: e.label }));
1248
- return;
1249
- }
1250
- Y(null), J(e, "submit");
1251
- let n = j(e);
1252
- W(n ? R("appliedCount", {
1253
- count: Et(n),
1254
- filters: We(n, Kt)
1255
- }) : R("cleared")), Zt(!1, "submit");
1256
- }
1257
- }
1258
- function Tt(e, t, n) {
1259
- let [r, i] = T(t), a = w(!1);
1260
- return C(() => {
1261
- e && !a.current && (i(n.current ?? t), n.current = null), a.current = e;
1262
- }, [
1263
- e,
1264
- n,
1265
- t
1266
- ]), {
1267
- set: i,
1268
- value: r
1269
- };
1270
- }
1271
- function Et(e) {
1272
- let t = j(e);
1273
- if (!t) return 0;
1274
- let n = 0, r = (e) => {
1275
- Xe(e) ? e.rules.forEach(r) : n += 1;
1276
- };
1277
- return r(t), n;
1278
- }
1279
- function Dt({ current: e, environment: t, field: n, invalid: r, onChange: i, onDone: a, queryDelay: o, withOperator: s = !0 }) {
1280
- let c = se(), l = () => c.toggle(!1, "dismiss"), [u, d] = T(e ?? F(n)), f = w(null), p = JSON.stringify(e ?? null);
1281
- C(() => {
1282
- !f.current && e && d(e);
1283
- }, [p]), C(() => () => {
1284
- f.current && clearTimeout(f.current);
1285
- }, []);
1286
- function m(e) {
1287
- if (d(e), f.current && clearTimeout(f.current), n.kind !== "text" && n.kind !== "number" || o === 0) {
1288
- i(e);
1289
- return;
1290
- }
1291
- f.current = setTimeout(() => {
1292
- f.current = null, i(e);
1293
- }, o);
1294
- }
1295
- function h() {
1296
- f.current && (clearTimeout(f.current), f.current = null, i(u)), a(), l();
1297
- }
1298
- let g = u.conditions[0] ?? { operator: n.defaultOperator ?? "contains" };
1299
- return /* @__PURE__ */ O("div", {
1300
- "data-kind": n.kind,
1301
- "data-part": "rule",
1302
- "data-part-rule": "",
1303
- "data-ui": "filter-bar",
1304
- "data-ui-filter-bar": "",
1305
- ...r ? { "data-invalid": "" } : {},
1306
- children: [/* @__PURE__ */ D(mt, {
1307
- condition: g,
1308
- environment: {
1309
- ...t,
1310
- apply: h
1311
- },
1312
- field: n,
1313
- invalid: r,
1314
- withOperator: s,
1315
- onConditionChange: (e) => m({
1316
- ...u,
1317
- conditions: [e]
1318
- })
1319
- }), /* @__PURE__ */ O("div", {
1320
- "data-part": "actions",
1321
- "data-part-actions": "",
1322
- children: [/* @__PURE__ */ D(_, {
1323
- disabled: n.required === !0,
1324
- onClick: () => {
1325
- f.current && clearTimeout(f.current), d(F(n)), i(null), l();
1326
- },
1327
- size: "sm",
1328
- tone: "secondary",
1329
- variant: "ghost",
1330
- children: t.t("clearRule")
1331
- }), /* @__PURE__ */ D(_, {
1332
- onClick: h,
1333
- size: "sm",
1334
- children: t.t("done")
1335
- })]
1336
- })]
1337
- });
1338
- }
1339
- //#endregion
1340
- export { st as i, H as n, ct as r, _t as t };