@alfadocs/ui-kit 0.67.1 → 0.69.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 (347) hide show
  1. package/dist/_chunks/{accordion-9lJSMMsZ.js → accordion-DnIa7OHX.js} +69 -47
  2. package/dist/_chunks/actions-cell-renderer-DrcaxB0w.js +2061 -0
  3. package/dist/_chunks/address-autocomplete-BEX9PXty.js +496 -0
  4. package/dist/_chunks/{agenda-card.agent-B_R47-c9.js → agenda-card.agent-mTCrkKSZ.js} +6 -1
  5. package/dist/_chunks/{agenda-tray-T-BumlGZ.js → agenda-tray-g0kg7HwB.js} +36 -24
  6. package/dist/_chunks/{ai-consent-banner-Dxtx_WAh.js → ai-consent-banner-CXlsNX1c.js} +3 -3
  7. package/dist/_chunks/{ai-prompt-input-BwEACCPm.js → ai-prompt-input-CuhTo9mh.js} +80 -61
  8. package/dist/_chunks/{ai-tools-rail-CInA_1-E.js → ai-tools-rail-BA_sqy1A.js} +87 -70
  9. package/dist/_chunks/{alia-sidebar-Ckv0yCKi.js → alia-sidebar-B47qRQb5.js} +5 -5
  10. package/dist/_chunks/{anamnesis-card-N8pIKWuS.js → anamnesis-card-DRmE24OQ.js} +2 -2
  11. package/dist/_chunks/{appointment-tray-BMl89NPW.js → appointment-tray-CZtvtaH-.js} +32 -20
  12. package/dist/_chunks/{audio-recorder-DjXLP4aF.js → audio-recorder-DYXXnGug.js} +59 -56
  13. package/dist/_chunks/{autocomplete-CcCFlVf-.js → autocomplete-DOeGouCL.js} +157 -132
  14. package/dist/_chunks/bishop-score-PJI3AXzA.js +304 -0
  15. package/dist/_chunks/bmi-calculator-BZtIJ53x.js +434 -0
  16. package/dist/_chunks/{booking-L8-YP8BJ.js → booking-C3VqFReX.js} +420 -397
  17. package/dist/_chunks/{breadcrumb-OTbaY70e.js → breadcrumb-CchdeG7d.js} +42 -28
  18. package/dist/_chunks/{calculator-dialog-CFk4I91b.js → calculator-dialog-BR5iU0kf.js} +2 -2
  19. package/dist/_chunks/{calendar-oYWOCrnf.js → calendar-CZUjL8SZ.js} +258 -201
  20. package/dist/_chunks/{care-plan-card-BwVUyUBb.js → care-plan-card-CvFGXa2z.js} +10 -6
  21. package/dist/_chunks/{care-plan-entry-card-VzdQHcOL.js → care-plan-entry-card-C3E_gClk.js} +17 -13
  22. package/dist/_chunks/{carousel.agent-vt21A_el.js → carousel.agent-4v8Emr9E.js} +219 -198
  23. package/dist/_chunks/{chart-Cg3e9EH9.js → chart-CMr3eW62.js} +150 -109
  24. package/dist/_chunks/{chat-container-ogB4OskO.js → chat-container-DWho5hPR.js} +47 -34
  25. package/dist/_chunks/{chat-input-B5zjNEUN.js → chat-input-BcXTetgM.js} +57 -41
  26. package/dist/_chunks/{checkbox-DRcOdmXv.js → checkbox-BuZ1u__2.js} +41 -27
  27. package/dist/_chunks/{checkbox-group-CpUwlHug.js → checkbox-group-PqNmQ-cE.js} +3 -3
  28. package/dist/_chunks/{clinical-note-card-gtrxv6zn.js → clinical-note-card-DqQYf_D4.js} +2 -2
  29. package/dist/_chunks/{collapsible-X3oaLPU3.js → collapsible-BrnRiCC6.js} +26 -23
  30. package/dist/_chunks/{color-picker-FXpItIaF.js → color-picker-C_fZl6sA.js} +124 -112
  31. package/dist/_chunks/{combobox-BC-DFx8G.js → combobox-Clum7gJ1.js} +165 -128
  32. package/dist/_chunks/{command-palette-BiPAAno-.js → command-palette-CJzmc5pC.js} +87 -64
  33. package/dist/_chunks/{contact-profile-card-7BMB85T6.js → contact-profile-card-Dramqa9C.js} +13 -11
  34. package/dist/_chunks/{copy-field-CCq7j6Zc.js → copy-field-Bjw9u2cV.js} +42 -35
  35. package/dist/_chunks/counter-dRlTNC_y.js +55 -0
  36. package/dist/_chunks/{cycle-calculator-BF0ointe.js → cycle-calculator-DmRGJNaT.js} +3 -3
  37. package/dist/_chunks/{date-picker-oGg5BnXL.js → date-picker-Dl9RKxaV.js} +76 -57
  38. package/dist/_chunks/{date-range-picker-C5BWfH_T.js → date-range-picker-CTUeR6Bj.js} +73 -46
  39. package/dist/_chunks/{date-time-picker-Ze1My59T.js → date-time-picker-BhoogS5Q.js} +64 -40
  40. package/dist/_chunks/{dependent-selector-DpzGtr_J.js → dependent-selector-CG_FOHya.js} +44 -30
  41. package/dist/_chunks/{dialog-DMGnSelc.js → dialog-ZNuboNmy.js} +35 -28
  42. package/dist/_chunks/{document-scanner-D2qehl3-.js → document-scanner-CTubA0-N.js} +12 -4
  43. package/dist/_chunks/{dropdown-menu-DwwPovMZ.js → dropdown-menu-qrxjymfw.js} +94 -93
  44. package/dist/_chunks/{due-date-calculator-DU9AEWNy.js → due-date-calculator-BTmsIQqD.js} +4 -4
  45. package/dist/_chunks/editable-currency-cell-renderer-kgqp_mIw.js +448 -0
  46. package/dist/_chunks/{email-input-lQivsFrw.js → email-input-B_Y55f5G.js} +3 -3
  47. package/dist/_chunks/{fetal-weight-BVSzOhuR.js → fetal-weight-CRz7KE2D.js} +2 -2
  48. package/dist/_chunks/{file-upload-BosbPDb1.js → file-upload-5ScQd4fE.js} +118 -100
  49. package/dist/_chunks/{fiscal-code-input-DPtqluVb.js → fiscal-code-input-Cf-8O4Fj.js} +76 -63
  50. package/dist/_chunks/{freemium-paywall-CkWjv3o6.js → freemium-paywall-DZ2mBS3w.js} +78 -71
  51. package/dist/_chunks/{gestational-age-calculator-DBlFdoiP.js → gestational-age-calculator-BleUdhbI.js} +5 -5
  52. package/dist/_chunks/{hcg-doubling-if4Q8aSX.js → hcg-doubling-CnjDXX6U.js} +3 -3
  53. package/dist/_chunks/{header-settings-CNOqIhoW.js → header-settings-DJqoAl5m.js} +86 -46
  54. package/dist/_chunks/{index.modern-D2LGACWg.js → index.modern-Zta-A4Jm.js} +3 -3
  55. package/dist/_chunks/{list-BOwqwy03.js → list-DgE1xWBM.js} +99 -84
  56. package/dist/_chunks/{locale-picker-C9JmBht3.js → locale-picker-ChYYSX2N.js} +47 -35
  57. package/dist/_chunks/{map-view-Tb5VfK9Y.js → map-view-BkOoGoX2.js} +160 -115
  58. package/dist/_chunks/{marketplace-app-shell-D4-T9Qzz.js → marketplace-app-shell-6T9W4Knl.js} +4 -4
  59. package/dist/_chunks/{message-card.agent-4IeIgrnJ.js → message-card.agent-ZLhx3Bs5.js} +6 -1
  60. package/dist/_chunks/{message-tray-CVyJajVJ.js → message-tray-DwrBLJlf.js} +90 -48
  61. package/dist/_chunks/{multi-select-BcPylvHR.js → multi-select-BdHHDrRN.js} +196 -153
  62. package/dist/_chunks/{navigation-menu-C6lBYVv9.js → navigation-menu-DRUi6sSj.js} +75 -42
  63. package/dist/_chunks/{notification-card.agent-Rqt3ofk9.js → notification-card.agent-DxGBZb8T.js} +5 -1
  64. package/dist/_chunks/{notification-tray-DlgenTEe.js → notification-tray-Btb9oQeZ.js} +112 -97
  65. package/dist/_chunks/{number-input-Dj5L3pXK.js → number-input-DxphVG_A.js} +36 -27
  66. package/dist/_chunks/{operator-hero-f_KaRhw5.js → operator-hero-CP2Nhupm.js} +12 -8
  67. package/dist/_chunks/{otp-input-xQ4Ps5VY.js → otp-input-DzBQ-CpE.js} +52 -33
  68. package/dist/_chunks/{pagination-DQOgnxxw.js → pagination-D58kglCr.js} +181 -162
  69. package/dist/_chunks/{patient-search-DR9XUYRQ.js → patient-search-CBC_ySF6.js} +69 -60
  70. package/dist/_chunks/{patient-shell-BfgufL_q.js → patient-shell-DV3XEtIB.js} +3 -3
  71. package/dist/_chunks/{patient-summary-card-hEmr4eTW.js → patient-summary-card-B836_fDB.js} +95 -103
  72. package/dist/_chunks/patient-table-CDuosVru.js +889 -0
  73. package/dist/_chunks/{payment-form-nXocS_MX.js → payment-form-DvjwYVIT.js} +56 -44
  74. package/dist/_chunks/{payment-request-card-CYE5vhZ0.js → payment-request-card-DioWKBUq.js} +2 -2
  75. package/dist/_chunks/{pdf-viewer-GsfNqeeT.js → pdf-viewer-D6BPfW2D.js} +205 -157
  76. package/dist/_chunks/{periodontal-chart-card-Dh3KgvYG.js → periodontal-chart-card-BuDEMbHE.js} +2 -2
  77. package/dist/_chunks/{phone-input-DVXhNlIl.js → phone-input-DjU-XmO_.js} +64 -47
  78. package/dist/_chunks/{popover-DTbfAuR0.js → popover-B2qCDhJC.js} +37 -32
  79. package/dist/_chunks/{practice-results-DND2SAt7.js → practice-results-KrTHqZua.js} +278 -242
  80. package/dist/_chunks/{pregnancy-dating-QY-sqpvj.js → pregnancy-dating-DORUAOHB.js} +6 -6
  81. package/dist/_chunks/{pregnancy-weight-gain-DOJXXNYP.js → pregnancy-weight-gain-DVz4rr7-.js} +3 -3
  82. package/dist/_chunks/{privacy-lock-C7JyMf0y.js → privacy-lock-BzMLQu-j.js} +32 -28
  83. package/dist/_chunks/{product-hub-panel-CAXDFeGP.js → product-hub-panel-e6pW220e.js} +45 -27
  84. package/dist/_chunks/{progress-kzIRcdaq.js → progress-DA413-zn.js} +2 -2
  85. package/dist/_chunks/{public-footer.agent-CfXuW1x6.js → public-footer.agent-D0cFbjWl.js} +151 -146
  86. package/dist/_chunks/{public-header.agent-BOhJgZEU.js → public-header.agent-DqkqA-ca.js} +107 -102
  87. package/dist/_chunks/{qr-code-DNXhi6se.js → qr-code-CPkEs5mG.js} +52 -46
  88. package/dist/_chunks/{radio-group-CLjK-SlK.js → radio-group-BPt7pKZW.js} +5 -5
  89. package/dist/_chunks/{recaptcha-widget-BCNHsgqt.js → recaptcha-widget-BC-4To9b.js} +9 -2
  90. package/dist/_chunks/registry-DvAUVLHh.js +51 -0
  91. package/dist/_chunks/{resizable-3vzqDlg6.js → resizable-DVGcfOrk.js} +193 -173
  92. package/dist/_chunks/{reviews-panel-DBktKm7i.js → reviews-panel-Dq7LMDcH.js} +87 -68
  93. package/dist/_chunks/rich-text-editor-BsV7zUdg.js +2142 -0
  94. package/dist/_chunks/{search-bar-SY2BcV2N.js → search-bar-C_T3pBJn.js} +105 -78
  95. package/dist/_chunks/{search-input-DbxrnHkW.js → search-input-DQvGxR74.js} +2 -2
  96. package/dist/_chunks/{search-input.agent-CfZvViOd.js → search-input.agent-DRH54coT.js} +19 -4
  97. package/dist/_chunks/{select-CEtRcon5.js → select-DMLG44F5.js} +72 -56
  98. package/dist/_chunks/{session-countdown-LPnhTHjn.js → session-countdown-X1Ki6i0M.js} +3 -3
  99. package/dist/_chunks/{sheet-taJer-Ha.js → sheet-BxsE7eQm.js} +59 -45
  100. package/dist/_chunks/{sidebar-DaB4ulxH.js → sidebar-DY9jGjgt.js} +254 -248
  101. package/dist/_chunks/{sign-document-CdAiHiCh.js → sign-document-B4DeRhTe.js} +75 -49
  102. package/dist/_chunks/{signature-capture-COi0Uiqu.js → signature-capture-Ct_4Md4e.js} +138 -104
  103. package/dist/_chunks/{slider-BHWzXdjt.js → slider-DN1CWkKB.js} +85 -65
  104. package/dist/_chunks/{sparkline-DGhCSw8M.js → sparkline-iOXYgvJe.js} +75 -53
  105. package/dist/_chunks/{stepper-accordion.agent-C4quJ-MD.js → stepper-accordion.agent-cmEguIdx.js} +7 -1
  106. package/dist/_chunks/{stepper-progress-DDjq5nei.js → stepper-progress-Bv0njx4g.js} +30 -24
  107. package/dist/_chunks/{suggestion-chip.agent-6sNWFj7m.js → suggestion-chip.agent-Brn3CiFE.js} +9 -8
  108. package/dist/_chunks/{switch-BJ6HD3Mn.js → switch-OILsBLWo.js} +25 -19
  109. package/dist/_chunks/{tabs-BIQ0ew1T.js → tabs-BxcOziCo.js} +67 -58
  110. package/dist/_chunks/{task-card.agent-CUPKYd7w.js → task-card.agent-Bt14CzUd.js} +4 -1
  111. package/dist/_chunks/{task-tray-CAncV-QQ.js → task-tray-qOEQflu4.js} +74 -57
  112. package/dist/_chunks/{text-area-BIx0tZ05.js → text-area-Bt3p7Pt0.js} +41 -34
  113. package/dist/_chunks/{text-input-BaClJL8Y.js → text-input-B-OWQ1Je.js} +15 -8
  114. package/dist/_chunks/{theme-toggle-DETmSu_h.js → theme-toggle-XB6o_lgs.js} +38 -26
  115. package/dist/_chunks/{time-picker-B5umYwfv.js → time-picker-BPlJWm8w.js} +41 -31
  116. package/dist/_chunks/{timeline-DQa5Tyz4.js → timeline-CqA4nKTI.js} +33 -25
  117. package/dist/_chunks/{toast.agent-vuLRRn2a.js → toast.agent-57UzyR9U.js} +62 -45
  118. package/dist/_chunks/{tooth-scheme-BIx1O2aJ.js → tooth-scheme-yBr53cvv.js} +421 -348
  119. package/dist/_chunks/{transcript-panel-CLHmv83g.js → transcript-panel-3THQX6nJ.js} +47 -33
  120. package/dist/_chunks/unit-converter-YEpD9evj.js +337 -0
  121. package/dist/_chunks/{use-password-requirements-DsgduV1x.js → use-password-requirements-BXvS2MBS.js} +131 -117
  122. package/dist/_chunks/users-MBVtUzwd.js +17 -0
  123. package/dist/_chunks/warning-stack-BsgaEbL8.js +283 -0
  124. package/dist/_chunks/{whatsapp-button-DUjlWGKf.js → whatsapp-button-BIy6NaJK.js} +6 -3
  125. package/dist/_chunks/{workflow-map-JAZryZJr.js → workflow-map-Bdam9pGp.js} +99 -88
  126. package/dist/agent/index.d.ts +4 -4
  127. package/dist/agent/index.js +36 -0
  128. package/dist/agent/registry.d.ts +33 -0
  129. package/dist/agent/types.d.ts +78 -2
  130. package/dist/agent-catalog.json +6905 -509
  131. package/dist/agent-i18n/en.json +1175 -0
  132. package/dist/components/accordion/index.js +1 -1
  133. package/dist/components/address-autocomplete/address-autocomplete.agent.d.ts +4 -0
  134. package/dist/components/address-autocomplete/address-autocomplete.d.ts +18 -0
  135. package/dist/components/address-autocomplete/index.d.ts +2 -1
  136. package/dist/components/address-autocomplete/index.js +3 -2
  137. package/dist/components/agenda-card/index.js +1 -1
  138. package/dist/components/agenda-tray/index.js +1 -1
  139. package/dist/components/ai-consent-banner/index.js +1 -1
  140. package/dist/components/ai-prompt-input/index.js +1 -1
  141. package/dist/components/ai-tools-rail/index.js +1 -1
  142. package/dist/components/anamnesis-card/index.js +1 -1
  143. package/dist/components/appointment-card/index.js +1 -1
  144. package/dist/components/audio-recorder/index.js +1 -1
  145. package/dist/components/autocomplete/index.js +1 -1
  146. package/dist/components/bishop-score/bishop-score.agent.d.ts +4 -0
  147. package/dist/components/bishop-score/bishop-score.d.ts +17 -1
  148. package/dist/components/bishop-score/index.js +1 -1
  149. package/dist/components/bmi-calculator/bmi-calculator.agent.d.ts +4 -0
  150. package/dist/components/bmi-calculator/bmi-calculator.d.ts +26 -0
  151. package/dist/components/bmi-calculator/index.js +1 -1
  152. package/dist/components/booking/index.js +1 -1
  153. package/dist/components/breadcrumb/index.js +1 -1
  154. package/dist/components/calculator-dialog/index.js +1 -1
  155. package/dist/components/calendar/index.js +1 -1
  156. package/dist/components/care-plan-card/index.js +1 -1
  157. package/dist/components/care-plan-entry-card/index.js +1 -1
  158. package/dist/components/carousel/index.js +1 -1
  159. package/dist/components/chart/index.js +1 -1
  160. package/dist/components/chat-container/index.js +1 -1
  161. package/dist/components/chat-input/index.js +1 -1
  162. package/dist/components/checkbox/index.js +1 -1
  163. package/dist/components/checkbox-group/index.js +1 -1
  164. package/dist/components/clinical-note-card/index.js +1 -1
  165. package/dist/components/collapsible/index.js +1 -1
  166. package/dist/components/color-picker/index.js +1 -1
  167. package/dist/components/combobox/index.js +1 -1
  168. package/dist/components/command-palette/index.js +1 -1
  169. package/dist/components/contact-profile-card/index.js +1 -1
  170. package/dist/components/copy-field/index.js +1 -1
  171. package/dist/components/counter/counter.d.ts +22 -0
  172. package/dist/components/counter/index.d.ts +3 -0
  173. package/dist/components/counter/index.js +5 -0
  174. package/dist/components/cycle-calculator/index.js +1 -1
  175. package/dist/components/data-table/data-table.d.ts +1 -1
  176. package/dist/components/data-table/filters/date-range-filter.d.ts +1 -1
  177. package/dist/components/data-table/index.js +31 -30
  178. package/dist/components/data-table/toolbar.d.ts +4 -1
  179. package/dist/components/date-picker/index.js +1 -1
  180. package/dist/components/date-range-picker/index.js +1 -1
  181. package/dist/components/date-time-picker/index.js +1 -1
  182. package/dist/components/dependent-selector/index.js +1 -1
  183. package/dist/components/dialog/index.js +1 -1
  184. package/dist/components/document-scanner/index.js +1 -1
  185. package/dist/components/dropdown-menu/index.js +1 -1
  186. package/dist/components/due-date-calculator/index.js +1 -1
  187. package/dist/components/email-input/index.js +1 -1
  188. package/dist/components/fetal-weight/index.js +1 -1
  189. package/dist/components/file-upload/index.js +1 -1
  190. package/dist/components/fiscal-code-input/index.js +1 -1
  191. package/dist/components/freemium-paywall/freemium-paywall.d.ts +6 -0
  192. package/dist/components/freemium-paywall/index.js +1 -1
  193. package/dist/components/gestational-age-calculator/index.js +1 -1
  194. package/dist/components/hcg-doubling/index.js +1 -1
  195. package/dist/components/header-settings/index.js +1 -1
  196. package/dist/components/index.d.ts +2 -0
  197. package/dist/components/list/index.js +1 -1
  198. package/dist/components/locale-picker/index.js +1 -1
  199. package/dist/components/map-view/index.js +1 -1
  200. package/dist/components/message-card/index.js +1 -1
  201. package/dist/components/message-tray/index.js +1 -1
  202. package/dist/components/multi-select/index.js +1 -1
  203. package/dist/components/navigation-menu/index.js +1 -1
  204. package/dist/components/notification-card/index.js +1 -1
  205. package/dist/components/notification-tray/index.js +1 -1
  206. package/dist/components/number-input/index.js +1 -1
  207. package/dist/components/operator-hero/index.js +1 -1
  208. package/dist/components/otp-input/index.js +1 -1
  209. package/dist/components/pagination/index.js +1 -1
  210. package/dist/components/password-input/index.js +1 -1
  211. package/dist/components/patient-search/index.js +1 -1
  212. package/dist/components/patient-summary-card/index.js +1 -1
  213. package/dist/components/patient-table/cell-renderers/balance-badge-cell.d.ts +13 -0
  214. package/dist/components/patient-table/cell-renderers/care-plan-status-cell.d.ts +43 -0
  215. package/dist/components/patient-table/cell-renderers/contact-cell.d.ts +45 -0
  216. package/dist/components/patient-table/cell-renderers/next-appointment-cell.d.ts +24 -0
  217. package/dist/components/patient-table/cell-renderers/patient-identity-cell.d.ts +26 -0
  218. package/dist/components/patient-table/columns.d.ts +102 -0
  219. package/dist/components/patient-table/index.d.ts +24 -0
  220. package/dist/components/patient-table/index.js +13 -0
  221. package/dist/components/patient-table/patient-table.d.ts +138 -0
  222. package/dist/components/patient-table/types.d.ts +172 -0
  223. package/dist/components/patient-table/use-responsive-columns.d.ts +109 -0
  224. package/dist/components/payment-card/index.js +1 -1
  225. package/dist/components/payment-form/index.js +1 -1
  226. package/dist/components/pdf-viewer/index.js +1 -1
  227. package/dist/components/periodontal-chart-card/index.js +1 -1
  228. package/dist/components/phone-input/index.js +1 -1
  229. package/dist/components/popover/index.js +1 -1
  230. package/dist/components/practice-results/index.js +1 -1
  231. package/dist/components/pregnancy-dating/index.js +1 -1
  232. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  233. package/dist/components/privacy-lock/index.js +1 -1
  234. package/dist/components/product-hub-tray/index.js +1 -1
  235. package/dist/components/progress/index.js +1 -1
  236. package/dist/components/public-footer/index.js +1 -1
  237. package/dist/components/public-header/index.js +1 -1
  238. package/dist/components/qr-code/index.js +1 -1
  239. package/dist/components/radio-group/index.js +1 -1
  240. package/dist/components/recaptcha-widget/index.js +1 -1
  241. package/dist/components/resizable/index.js +1 -1
  242. package/dist/components/reviews-panel/index.js +1 -1
  243. package/dist/components/rich-text-editor/index.js +1 -1
  244. package/dist/components/rich-text-editor/rich-text-editor.d.ts +15 -0
  245. package/dist/components/search-bar/index.js +1 -1
  246. package/dist/components/search-input/index.js +2 -2
  247. package/dist/components/select/index.js +1 -1
  248. package/dist/components/session-countdown/index.js +1 -1
  249. package/dist/components/sheet/index.js +1 -1
  250. package/dist/components/sidebar/index.js +1 -1
  251. package/dist/components/sidebar/sidebar.d.ts +7 -0
  252. package/dist/components/sign-document/index.js +1 -1
  253. package/dist/components/signature-capture/index.js +1 -1
  254. package/dist/components/slider/index.js +1 -1
  255. package/dist/components/sparkline/index.js +1 -1
  256. package/dist/components/stepper-accordion/index.js +1 -1
  257. package/dist/components/stepper-progress/index.js +1 -1
  258. package/dist/components/suggestion-chip/index.js +1 -1
  259. package/dist/components/switch/index.js +1 -1
  260. package/dist/components/tabs/index.js +1 -1
  261. package/dist/components/task-card/index.js +1 -1
  262. package/dist/components/task-tray/index.js +1 -1
  263. package/dist/components/text-area/index.js +1 -1
  264. package/dist/components/text-input/index.js +1 -1
  265. package/dist/components/theme-toggle/index.js +1 -1
  266. package/dist/components/time-picker/index.js +1 -1
  267. package/dist/components/timeline/index.js +1 -1
  268. package/dist/components/toast/index.js +1 -1
  269. package/dist/components/tooth-scheme/index.js +1 -1
  270. package/dist/components/transcript-panel/index.js +1 -1
  271. package/dist/components/unit-converter/index.js +1 -1
  272. package/dist/components/unit-converter/unit-converter.agent.d.ts +4 -0
  273. package/dist/components/unit-converter/unit-converter.d.ts +27 -0
  274. package/dist/components/warning-stack/index.js +1 -1
  275. package/dist/components/warning-stack/warning-stack.d.ts +9 -0
  276. package/dist/components/whatsapp-button/index.d.ts +1 -1
  277. package/dist/components/whatsapp-button/index.js +3 -2
  278. package/dist/components/whatsapp-button/whatsapp-button.d.ts +3 -0
  279. package/dist/components/workflow/index.js +1 -1
  280. package/dist/i18n/locales/ar.d.ts +74 -0
  281. package/dist/i18n/locales/ar.js +76 -2
  282. package/dist/i18n/locales/de.d.ts +74 -0
  283. package/dist/i18n/locales/de.js +76 -2
  284. package/dist/i18n/locales/el.d.ts +74 -0
  285. package/dist/i18n/locales/el.js +76 -2
  286. package/dist/i18n/locales/en.d.ts +92 -0
  287. package/dist/i18n/locales/en.js +94 -2
  288. package/dist/i18n/locales/es.d.ts +74 -0
  289. package/dist/i18n/locales/es.js +76 -2
  290. package/dist/i18n/locales/fr.d.ts +74 -0
  291. package/dist/i18n/locales/fr.js +76 -2
  292. package/dist/i18n/locales/hi.d.ts +74 -0
  293. package/dist/i18n/locales/hi.js +76 -2
  294. package/dist/i18n/locales/it.d.ts +74 -0
  295. package/dist/i18n/locales/it.js +76 -2
  296. package/dist/i18n/locales/ja.d.ts +74 -0
  297. package/dist/i18n/locales/ja.js +76 -2
  298. package/dist/i18n/locales/nl.d.ts +74 -0
  299. package/dist/i18n/locales/nl.js +76 -2
  300. package/dist/i18n/locales/pl.d.ts +74 -0
  301. package/dist/i18n/locales/pl.js +76 -2
  302. package/dist/i18n/locales/pt.d.ts +74 -0
  303. package/dist/i18n/locales/pt.js +76 -2
  304. package/dist/i18n/locales/ro.d.ts +74 -0
  305. package/dist/i18n/locales/ro.js +76 -2
  306. package/dist/i18n/locales/ru.d.ts +74 -0
  307. package/dist/i18n/locales/ru.js +76 -2
  308. package/dist/i18n/locales/sq.d.ts +74 -0
  309. package/dist/i18n/locales/sq.js +76 -2
  310. package/dist/i18n/locales/sv.d.ts +74 -0
  311. package/dist/i18n/locales/sv.js +76 -2
  312. package/dist/i18n/locales/tr.d.ts +74 -0
  313. package/dist/i18n/locales/tr.js +76 -2
  314. package/dist/i18n/locales/zh.d.ts +74 -0
  315. package/dist/i18n/locales/zh.js +76 -2
  316. package/dist/index.js +688 -673
  317. package/dist/locales/ar.json +76 -2
  318. package/dist/locales/de.json +76 -2
  319. package/dist/locales/el.json +76 -2
  320. package/dist/locales/en.json +76 -2
  321. package/dist/locales/es.json +76 -2
  322. package/dist/locales/fr.json +76 -2
  323. package/dist/locales/hi.json +76 -2
  324. package/dist/locales/it.json +76 -2
  325. package/dist/locales/ja.json +76 -2
  326. package/dist/locales/nl.json +76 -2
  327. package/dist/locales/pl.json +76 -2
  328. package/dist/locales/pt.json +76 -2
  329. package/dist/locales/ro.json +76 -2
  330. package/dist/locales/ru.json +76 -2
  331. package/dist/locales/sq.json +76 -2
  332. package/dist/locales/sv.json +76 -2
  333. package/dist/locales/tr.json +76 -2
  334. package/dist/locales/zh.json +76 -2
  335. package/dist/patterns/alia-assistant/index.js +1 -1
  336. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  337. package/dist/patterns/patient-shell/index.js +1 -1
  338. package/dist/tokens.css +3 -2
  339. package/package.json +14 -1
  340. package/dist/_chunks/address-autocomplete-CT-9AOli.js +0 -358
  341. package/dist/_chunks/bishop-score-CjsB9bM-.js +0 -185
  342. package/dist/_chunks/bmi-calculator-n-823_1V.js +0 -258
  343. package/dist/_chunks/editable-currency-cell-renderer-D1ewvJKO.js +0 -2391
  344. package/dist/_chunks/registry-nPAVE19X.js +0 -21
  345. package/dist/_chunks/rich-text-editor-DAeCXiQG.js +0 -1973
  346. package/dist/_chunks/unit-converter-C1V3ACM9.js +0 -196
  347. package/dist/_chunks/warning-stack-Cv4fr5zo.js +0 -220
@@ -1,2391 +0,0 @@
1
- import { jsx as s, jsxs as I } from "react/jsx-runtime";
2
- import { useMemo as z, forwardRef as $, useState as D, useCallback as M, useEffect as P, useRef as Z, createContext as Se, useContext as we, isValidElement as Fe, cloneElement as Re, useImperativeHandle as Tt } from "react";
3
- import { S as Ct } from "./skeleton-CZbwyJAA.js";
4
- import { E as xt } from "./empty-state-BLy7tigq.js";
5
- import { c as Nt } from "./index-D2ZczOXr.js";
6
- import { useTranslation as F } from "react-i18next";
7
- import { useGridFilter as Y, AgGridReact as St } from "ag-grid-react";
8
- import { ModuleRegistry as wt, AllCommunityModule as Ft } from "ag-grid-community";
9
- import { B as L } from "./button-DD_0Xdmr.js";
10
- import { I as G } from "./icon-button-LqoiKcUN.js";
11
- import { P as ee } from "./popover-DTbfAuR0.js";
12
- import { C as De } from "./checkbox-DRcOdmXv.js";
13
- import { T as pe } from "./text-input-BaClJL8Y.js";
14
- import { T as J } from "./tag-BQXwuJq1.js";
15
- import { D as B } from "./dropdown-menu-DwwPovMZ.js";
16
- import { X as ke } from "./x-CCcI3eJp.js";
17
- import { R as Rt } from "./refresh-cw-CC8jSKMr.js";
18
- import { S as me } from "./search-BonnQsHv.js";
19
- import { C as Dt } from "./columns-2-BTOBZbep.js";
20
- import { G as kt } from "./grip-vertical-Dlg0_k5C.js";
21
- import { P as It } from "./printer-CeVEWfQq.js";
22
- import { F as Ie } from "./file-text-DSNuv2B8.js";
23
- import { D as ne } from "./download-CDF1sbL9.js";
24
- import { F as Et } from "./file-spreadsheet-zUkY8rJ2.js";
25
- import zt from "i18next";
26
- import { S as Ee } from "./select-CEtRcon5.js";
27
- import { u as At } from "./use-prefers-reduced-motion-BMwIQRjB.js";
28
- import { u as Pt } from "./use-theme-CAuo6EYT.js";
29
- import { u as Ot } from "./registry-nPAVE19X.js";
30
- import { D as ze } from "./date-range-picker-C5BWfH_T.js";
31
- import { M as Mt } from "./multi-select-BcPylvHR.js";
32
- import { A as Ae } from "./autocomplete-CcCFlVf-.js";
33
- import { N as te } from "./number-input-Dj5L3pXK.js";
34
- import { B as jt } from "./badge-CqGsX32l.js";
35
- import { A as Pe } from "./avatar-BNQNhoyL.js";
36
- import { T as Lt } from "./tooltip-DvmfrNvB.js";
37
- import { T as ve } from "./timestamp-BV2lC-wV.js";
38
- import { I as qt } from "./icon-button-group-C48khLE0.js";
39
- import { E as $t } from "./ellipsis-rgGdiK_9.js";
40
- import { S as _t } from "./square-check-big-Jr-0202D.js";
41
- import { S as Bt } from "./square-CZoGU14v.js";
42
- import { u as Gt } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
43
- import { c as Oe, a as Me, b as je, d as Le } from "./input-surface-xyERuLU_.js";
44
- function Vt(t) {
45
- if (!Fe(t)) return t;
46
- const e = t, a = e.props.className ?? "", n = /\bsize-|\bw-|\bh-/.test(a) ? a : `${a} ds:size-4`.trim();
47
- return Re(e, { className: n, size: e.props.size ?? 16 });
48
- }
49
- const qe = Se(null);
50
- function _(t) {
51
- const e = we(qe);
52
- if (!e)
53
- throw new Error(
54
- `${t} must be rendered inside <DataTable.Toolbar> as a descendant of <DataTable>.`
55
- );
56
- return e;
57
- }
58
- function Ut({
59
- getApi: t,
60
- selectionCount: e,
61
- onPrint: a,
62
- children: n
63
- }) {
64
- const r = z(
65
- () => ({ getApi: t, selectionCount: e, onPrint: a }),
66
- [t, e, a]
67
- );
68
- return /* @__PURE__ */ s(qe.Provider, { value: r, children: n });
69
- }
70
- const Kt = [
71
- "data-table-toolbar",
72
- // Mobile (<sm) keeps `flex-wrap` so a wide QuickSearch can flow above the
73
- // Actions cluster on narrow screens. From `sm` (≥640px) we switch to
74
- // `flex-nowrap` + `min-w-0` so the row stays single-line at every common
75
- // desktop width (1024 / 1280 / 1440) — the QuickSearch slot shrinks via
76
- // its own `min-w-0` instead of pushing the trailing Actions to a new row.
77
- "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
78
- "ds:sm:flex-nowrap ds:min-w-0",
79
- // Brand-polish: give the toolbar its own card surface so it doesn't
80
- // sit flush above the grid as a bare row. The `--card` token resolves to
81
- // `--background` on the default light theme (white), which makes a
82
- // shadow-only chrome invisible on the page — pair the card fill with the
83
- // standard `--card-border` outline (same recipe as `<Card>`) so the
84
- // toolbar reads as a discrete surface in both light and dark themes.
85
- "ds:bg-[var(--card)] ds:rounded-[var(--radius-md)]",
86
- "ds:border ds:border-[color:var(--card-border)]",
87
- "ds:shadow-[var(--shadow-sm)]",
88
- "ds:py-[var(--spacing-sm)] ds:px-[var(--spacing-md)]"
89
- ].join(" "), $e = $(
90
- ({ className: t, children: e, ...a }, n) => /* @__PURE__ */ s(
91
- "div",
92
- {
93
- ref: n,
94
- role: "toolbar",
95
- className: [Kt, t ?? ""].join(" ").trim(),
96
- ...a,
97
- children: e
98
- }
99
- )
100
- );
101
- $e.displayName = "DataTable.Toolbar";
102
- const _e = $(
103
- ({ className: t, children: e, ...a }, n) => /* @__PURE__ */ s(
104
- "div",
105
- {
106
- ref: n,
107
- className: [
108
- "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
109
- // `grow` lets FilterBar absorb the free space; `min-w-0` lets the
110
- // QuickSearch slot inside shrink below its intrinsic width when the
111
- // toolbar runs `flex-nowrap` at `sm` and above, so the trailing
112
- // Actions cluster stays pinned on a single row.
113
- "ds:grow ds:min-w-0",
114
- t ?? ""
115
- ].join(" ").trim(),
116
- ...a,
117
- children: e
118
- }
119
- )
120
- );
121
- _e.displayName = "DataTable.Toolbar.FilterBar";
122
- const Be = $(
123
- ({ className: t, children: e, ...a }, n) => /* @__PURE__ */ s(
124
- "div",
125
- {
126
- ref: n,
127
- className: [
128
- "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]",
129
- "ds:ms-auto",
130
- t ?? ""
131
- ].join(" ").trim(),
132
- ...a,
133
- children: e
134
- }
135
- )
136
- );
137
- Be.displayName = "DataTable.Toolbar.Actions";
138
- const Ge = $(
139
- ({ label: t, onExport: e, intent: a = "outline", ...n }, r) => {
140
- const { t: l } = F(), { getApi: o } = _("DataTable.Toolbar.ExportCsv"), f = M(() => {
141
- const d = o();
142
- d && (e ? e(d) : d.exportDataAsCsv());
143
- }, [o, e]);
144
- return /* @__PURE__ */ s(
145
- G,
146
- {
147
- ref: r,
148
- type: "button",
149
- intent: a,
150
- icon: /* @__PURE__ */ s(ne, { "aria-hidden": !0 }),
151
- tooltip: t ?? l("dataTable.exportCsv"),
152
- onClick: f,
153
- ...n
154
- }
155
- );
156
- }
157
- );
158
- Ge.displayName = "DataTable.Toolbar.ExportCsv";
159
- function H(t, e = [30, 30, 30]) {
160
- if (typeof document > "u") return e;
161
- const a = document.createElement("span");
162
- a.style.color = `hsl(var(${t}))`, a.style.position = "absolute", a.style.visibility = "hidden", document.body.appendChild(a);
163
- const n = getComputedStyle(a).color;
164
- document.body.removeChild(a);
165
- const r = n.match(/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)/i);
166
- return r ? [Number(r[1]), Number(r[2]), Number(r[3])] : e;
167
- }
168
- async function Ve(t, e) {
169
- if (!t) return;
170
- const [{ jsPDF: a }, { default: n }] = await Promise.all([
171
- import("./jspdf.es.min-DaapWjR1.js").then((b) => b.j),
172
- import("./jspdf.plugin.autotable-CSiDNyPn.js")
173
- ]), l = (t.getColumns() ?? []).filter((b) => b.isVisible()), o = [
174
- l.map((b) => t.getDisplayNameForColumn(b, null) ?? "")
175
- ], f = [];
176
- t.forEachNodeAfterFilterAndSort((b) => {
177
- if (!b.data) return;
178
- const x = l.map((T) => {
179
- const h = t.getCellValue({
180
- rowNode: b,
181
- colKey: T,
182
- useFormatter: !0
183
- });
184
- return h == null ? "" : String(h);
185
- });
186
- f.push(x);
187
- });
188
- const d = H("--muted", [240, 240, 240]), c = H("--foreground", [30, 30, 30]), i = H("--card-foreground", [30, 30, 30]), u = H("--card", [250, 250, 250]), y = new a({ orientation: "landscape" });
189
- n(y, {
190
- head: o,
191
- body: f,
192
- headStyles: { fillColor: d, textColor: c },
193
- bodyStyles: { textColor: i },
194
- alternateRowStyles: { fillColor: u },
195
- styles: {
196
- font: "helvetica",
197
- fontSize: 10,
198
- cellPadding: 4
199
- }
200
- }), y.save(e.fileName);
201
- }
202
- const Ue = $(
203
- ({ label: t, onClick: e, fileName: a, intent: n = "outline", ...r }, l) => {
204
- const { t: o } = F(), { getApi: f } = _("DataTable.Toolbar.ExportPdf"), d = M(() => {
205
- const c = f();
206
- if (e) {
207
- e(c);
208
- return;
209
- }
210
- Ve(c, {
211
- fileName: a ?? "data-table-export.pdf"
212
- });
213
- }, [f, e, a]);
214
- return /* @__PURE__ */ s(
215
- G,
216
- {
217
- ref: l,
218
- type: "button",
219
- intent: n,
220
- icon: /* @__PURE__ */ s(Ie, { "aria-hidden": !0 }),
221
- tooltip: t ?? o("dataTable.exportPdf"),
222
- onClick: d,
223
- ...r
224
- }
225
- );
226
- }
227
- );
228
- Ue.displayName = "DataTable.Toolbar.ExportPdf";
229
- const Ke = $(
230
- ({ label: t, intent: e = "outline", ...a }, n) => {
231
- const { t: r } = F(), { onPrint: l } = _("DataTable.Toolbar.Print");
232
- return /* @__PURE__ */ s(
233
- G,
234
- {
235
- ref: n,
236
- type: "button",
237
- intent: e,
238
- icon: /* @__PURE__ */ s(It, { "aria-hidden": !0 }),
239
- tooltip: t ?? r("dataTable.print"),
240
- onClick: l,
241
- ...a
242
- }
243
- );
244
- }
245
- );
246
- Ke.displayName = "DataTable.Toolbar.Print";
247
- const We = ({ placeholder: t, debounceMs: e = 150 }) => {
248
- const { t: a } = F(), { getApi: n } = _("DataTable.Toolbar.QuickSearch"), [r, l] = D(""), o = Z(void 0);
249
- return P(() => (o.current && window.clearTimeout(o.current), o.current = window.setTimeout(() => {
250
- const f = n();
251
- f && f.setGridOption("quickFilterText", r);
252
- }, e), () => {
253
- o.current && window.clearTimeout(o.current);
254
- }), [r, e, n]), // Slot wrapper caps the search at a sensible legible width on desktop —
255
- // without this, TextInput's `w-full` lets the QuickSearch absorb the
256
- // entire FilterBar row and push trailing Actions onto a second line at
257
- // 1024 / 1280 / 1440. `min-w-0` lets the slot shrink below `24rem` when
258
- // the toolbar is squeezed on narrow viewports. There is no
259
- // `--toolbar-search-max` token in the kit yet — see this component's
260
- // summary for a follow-up note recommending we add one.
261
- /* @__PURE__ */ s("div", { className: "ds:w-full ds:max-w-[24rem] ds:min-w-0", children: /* @__PURE__ */ s(
262
- pe,
263
- {
264
- type: "search",
265
- size: "sm",
266
- value: r,
267
- onChange: (f) => l(f.target.value),
268
- placeholder: t ?? a("dataTable.quickSearch.placeholder", "Search…"),
269
- startAdornment: /* @__PURE__ */ s(me, { "aria-hidden": !0, className: "ds:size-4" }),
270
- clearable: !0,
271
- onClear: () => l(""),
272
- "aria-label": a("dataTable.quickSearch.label", "Quick search")
273
- }
274
- ) });
275
- };
276
- We.displayName = "DataTable.Toolbar.QuickSearch";
277
- const He = $(
278
- ({ onRefresh: t, label: e, intent: a = "outline", ...n }, r) => {
279
- const { t: l } = F();
280
- return /* @__PURE__ */ s(
281
- G,
282
- {
283
- ref: r,
284
- type: "button",
285
- intent: a,
286
- icon: /* @__PURE__ */ s(Rt, { "aria-hidden": !0 }),
287
- tooltip: e ?? l("dataTable.refresh", "Refresh"),
288
- onClick: t,
289
- ...n
290
- }
291
- );
292
- }
293
- );
294
- He.displayName = "DataTable.Toolbar.Refresh";
295
- function Wt(t) {
296
- if (!t || typeof t != "object") return "";
297
- const e = t;
298
- if (typeof e.filter == "string" || typeof e.filter == "number") {
299
- const a = typeof e.type == "string" ? e.type : "", n = typeof e.filterTo == "string" || typeof e.filterTo == "number" ? String(e.filterTo) : "";
300
- return a === "inRange" && n ? `${e.filter} – ${n}` : a ? `${a} ${e.filter}` : String(e.filter);
301
- }
302
- return typeof e.dateFrom == "string" ? typeof e.dateTo == "string" && e.dateTo ? `${e.dateFrom} – ${e.dateTo}` : String(e.dateFrom) : Array.isArray(e.values) ? e.values.map(String).join(", ") : "";
303
- }
304
- const Qe = () => {
305
- const { t } = F(), { getApi: e } = _("DataTable.Toolbar.FilterChips"), [a, n] = D([]), [r, l] = D(""), o = M(() => {
306
- const i = e();
307
- if (!i) {
308
- n([]), l("");
309
- return;
310
- }
311
- const u = i.getFilterModel() ?? {}, y = i.getColumns() ?? [], b = [];
312
- for (const T of Object.keys(u)) {
313
- const h = y.find((g) => g.getColId() === T), p = i.getDisplayNameForColumn(h, null) ?? T;
314
- b.push({
315
- colId: T,
316
- headerName: p,
317
- text: Wt(u[T])
318
- });
319
- }
320
- n(b);
321
- const x = i.getGridOption("quickFilterText");
322
- l(typeof x == "string" ? x : "");
323
- }, [e]);
324
- if (P(() => {
325
- const i = e();
326
- if (!i) return;
327
- const u = (y) => o();
328
- return i.addEventListener("filterChanged", u), o(), () => {
329
- i.removeEventListener("filterChanged", u);
330
- };
331
- }, [e, o]), a.length + (r ? 1 : 0) === 0) return null;
332
- function d(i) {
333
- const u = e();
334
- u && u.destroyFilter(i);
335
- }
336
- function c() {
337
- const i = e();
338
- i && (i.setFilterModel(null), i.setGridOption("quickFilterText", ""), l(""));
339
- }
340
- return /* @__PURE__ */ I(
341
- "div",
342
- {
343
- role: "group",
344
- "aria-label": t("dataTable.filterChips.label", "Active filters"),
345
- className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
346
- children: [
347
- r && /* @__PURE__ */ s(
348
- J,
349
- {
350
- label: `${t("dataTable.quickSearch.label", "Quick search")}: ${r}`,
351
- size: "sm",
352
- fill: "outline",
353
- onRemove: () => {
354
- const i = e();
355
- i == null || i.setGridOption("quickFilterText", ""), l("");
356
- }
357
- }
358
- ),
359
- a.map((i) => /* @__PURE__ */ s(
360
- J,
361
- {
362
- label: i.text ? `${i.headerName}: ${i.text}` : i.headerName,
363
- size: "sm",
364
- fill: "outline",
365
- onRemove: () => d(i.colId)
366
- },
367
- i.colId
368
- )),
369
- /* @__PURE__ */ s(
370
- L,
371
- {
372
- type: "button",
373
- intent: "ghost",
374
- size: "sm",
375
- onClick: c,
376
- startIcon: /* @__PURE__ */ s(ke, { "aria-hidden": !0, className: "ds:size-4" }),
377
- children: t("dataTable.filterChips.clearAll", "Clear all")
378
- }
379
- )
380
- ]
381
- }
382
- );
383
- };
384
- Qe.displayName = "DataTable.Toolbar.FilterChips";
385
- const Xe = ({
386
- field: t,
387
- options: e,
388
- label: a
389
- }) => {
390
- const { t: n } = F(), { getApi: r } = _("DataTable.Toolbar.FacetFilter"), [l, o] = D(null);
391
- function f(d) {
392
- o(d);
393
- const c = r();
394
- if (c) {
395
- if (d === null) {
396
- c.destroyFilter(t);
397
- return;
398
- }
399
- c.setColumnFilterModel(t, {
400
- type: "equals",
401
- filter: d
402
- }), c.onFilterChanged();
403
- }
404
- }
405
- return /* @__PURE__ */ s(
406
- "div",
407
- {
408
- role: "group",
409
- "aria-label": a ?? n("dataTable.facetFilter.label", "Filter"),
410
- className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]",
411
- children: e.map((d) => {
412
- const c = l === d.value;
413
- return /* @__PURE__ */ s(
414
- L,
415
- {
416
- type: "button",
417
- size: "sm",
418
- intent: c ? "primary" : "secondary",
419
- "aria-pressed": c,
420
- onClick: () => f(d.value),
421
- children: d.label
422
- },
423
- String(d.value)
424
- );
425
- })
426
- }
427
- );
428
- };
429
- Xe.displayName = "DataTable.Toolbar.FacetFilter";
430
- const Ht = ["csv", "xlsx", "pdf"];
431
- async function Qt(t, e) {
432
- if (!t) return;
433
- const a = await import("./exceljs.min-DUJ-5CGx.js").then((T) => T.e), n = new a.Workbook(), r = n.addWorksheet("Sheet1"), o = (t.getColumns() ?? []).filter((T) => T.isVisible());
434
- r.addRow(
435
- o.map(
436
- (T) => t.getDisplayNameForColumn(T, null) ?? T.getColId()
437
- )
438
- ), t.forEachNodeAfterFilterAndSort((T) => {
439
- T.data && r.addRow(
440
- o.map((h) => {
441
- const p = t.getCellValue({
442
- rowNode: T,
443
- colKey: h,
444
- useFormatter: !0
445
- });
446
- return p ?? "";
447
- })
448
- );
449
- });
450
- const f = H("--muted", [240, 240, 240]), d = H("--foreground", [30, 30, 30]), c = r.getRow(1), i = ([T, h, p]) => `${T.toString(16).padStart(2, "0")}${h.toString(16).padStart(2, "0")}${p.toString(16).padStart(2, "0")}`.toUpperCase();
451
- c.eachCell((T) => {
452
- T.font = { bold: !0, color: { argb: `FF${i(d)}` } }, T.fill = {
453
- type: "pattern",
454
- pattern: "solid",
455
- fgColor: { argb: `FF${i(f)}` }
456
- };
457
- });
458
- const u = await n.xlsx.writeBuffer(), y = new Blob([u], {
459
- type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
460
- }), b = URL.createObjectURL(y), x = document.createElement("a");
461
- x.href = b, x.download = e.fileName, document.body.appendChild(x), x.click(), document.body.removeChild(x), URL.revokeObjectURL(b);
462
- }
463
- const Je = Se(null);
464
- function Xt() {
465
- const t = we(Je);
466
- if (!t)
467
- throw new Error(
468
- "DataTable.Toolbar.ExportMenu.Item must be rendered inside DataTable.Toolbar.ExportMenu."
469
- );
470
- return t;
471
- }
472
- const Ze = ({ children: t, label: e }) => {
473
- const { t: a } = F(), { getApi: n } = _("DataTable.Toolbar.ExportMenu"), r = z(() => ({ getApi: n }), [n]), l = t ?? Ht.map((o) => /* @__PURE__ */ s(ge, { format: o }, o));
474
- return /* @__PURE__ */ s(Je.Provider, { value: r, children: /* @__PURE__ */ I(B.Root, { children: [
475
- /* @__PURE__ */ s(B.Trigger, { asChild: !0, children: /* @__PURE__ */ s(
476
- G,
477
- {
478
- type: "button",
479
- intent: "outline",
480
- icon: /* @__PURE__ */ s(ne, { "aria-hidden": !0 }),
481
- tooltip: e ?? a("dataTable.export.menu", "Export"),
482
- "aria-label": e ?? a("dataTable.export.menu", "Export"),
483
- "aria-haspopup": "menu"
484
- }
485
- ) }),
486
- /* @__PURE__ */ s(B.Content, { align: "end", sideOffset: 4, children: l })
487
- ] }) });
488
- };
489
- Ze.displayName = "DataTable.Toolbar.ExportMenu";
490
- function Jt(t, e) {
491
- return e === "csv" ? t("dataTable.export.csv", "Export CSV") : e === "xlsx" ? t("dataTable.export.xlsx", "Export Excel") : e === "pdf" ? t("dataTable.export.pdf", "Export PDF") : t("dataTable.export.custom", "Export");
492
- }
493
- function Zt(t) {
494
- return t === "csv" ? /* @__PURE__ */ s(ne, { "aria-hidden": !0, className: "ds:size-4" }) : t === "xlsx" ? /* @__PURE__ */ s(Et, { "aria-hidden": !0, className: "ds:size-4" }) : t === "pdf" ? /* @__PURE__ */ s(Ie, { "aria-hidden": !0, className: "ds:size-4" }) : /* @__PURE__ */ s(ne, { "aria-hidden": !0, className: "ds:size-4" });
495
- }
496
- const ge = ({
497
- format: t,
498
- label: e,
499
- onClick: a,
500
- fileName: n
501
- }) => {
502
- const { t: r } = F(), { getApi: l } = Xt(), o = M(() => {
503
- const f = l();
504
- if (t === "csv") {
505
- f == null || f.exportDataAsCsv();
506
- return;
507
- }
508
- if (t === "pdf") {
509
- Ve(f, {
510
- fileName: n ?? "data-table-export.pdf"
511
- });
512
- return;
513
- }
514
- if (t === "xlsx") {
515
- Qt(f, {
516
- fileName: n ?? "data-table-export.xlsx"
517
- });
518
- return;
519
- }
520
- a == null || a(f);
521
- }, [t, n, a, l]);
522
- return /* @__PURE__ */ s(B.Item, { onSelect: o, children: /* @__PURE__ */ I("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
523
- Zt(t),
524
- /* @__PURE__ */ s("span", { children: e ?? Jt(r, t) })
525
- ] }) });
526
- };
527
- ge.displayName = "DataTable.Toolbar.ExportMenu.Item";
528
- function Yt(t) {
529
- return t ? (t.getColumns() ?? []).map((a) => a.getColDef().hide === void 0 && a.getColId().startsWith("ag-Grid-") ? null : {
530
- colId: a.getColId(),
531
- displayName: t.getDisplayNameForColumn(a, null) || a.getColId(),
532
- visible: a.isVisible()
533
- }).filter((a) => a !== null) : [];
534
- }
535
- const Ye = ({ label: t, icon: e, footer: a }) => {
536
- const { t: n } = F(), { getApi: r } = _("DataTable.Toolbar.ColumnToggle"), [l, o] = D(!1), [f, d] = D([]), [c, i] = D(null), [u, y] = D(null);
537
- P(() => {
538
- l && d(Yt(r()));
539
- }, [l, r]);
540
- const b = M(
541
- (h, p) => {
542
- const g = r();
543
- g && (g.setColumnsVisible([h], p), d(
544
- (m) => m.map(
545
- (v) => v.colId === h ? { ...v, visible: p } : v
546
- )
547
- ));
548
- },
549
- [r]
550
- ), x = M(
551
- (h, p) => {
552
- if (h === p) return;
553
- const g = r();
554
- if (!g) return;
555
- d((v) => {
556
- const S = v.findIndex((R) => R.colId === h), E = v.findIndex((R) => R.colId === p);
557
- if (S < 0 || E < 0) return v;
558
- const k = [...v], [q] = k.splice(S, 1);
559
- return k.splice(E, 0, q), k;
560
- });
561
- const m = f.findIndex((v) => v.colId === p);
562
- m >= 0 && g.moveColumns([h], m);
563
- },
564
- [r, f]
565
- ), T = t ?? n("dataTable.columnToggle");
566
- return /* @__PURE__ */ I(ee.Root, { open: l, onOpenChange: o, children: [
567
- /* @__PURE__ */ s(ee.Trigger, { asChild: !0, children: /* @__PURE__ */ s(
568
- G,
569
- {
570
- type: "button",
571
- intent: "outline",
572
- icon: e ?? /* @__PURE__ */ s(Dt, { "aria-hidden": !0 }),
573
- "aria-label": T,
574
- "aria-haspopup": "dialog"
575
- }
576
- ) }),
577
- /* @__PURE__ */ I(ee.Content, { size: "sm", align: "end", children: [
578
- /* @__PURE__ */ s(ee.Heading, { children: T }),
579
- /* @__PURE__ */ s(
580
- "ul",
581
- {
582
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
583
- "aria-label": T,
584
- children: f.map((h) => {
585
- const p = c === h.colId, g = u === h.colId && c !== h.colId;
586
- return /* @__PURE__ */ I(
587
- "li",
588
- {
589
- draggable: !0,
590
- onDragStart: (m) => {
591
- i(h.colId), m.dataTransfer.effectAllowed = "move", m.dataTransfer.setData("text/plain", h.colId);
592
- },
593
- onDragOver: (m) => {
594
- m.preventDefault(), m.dataTransfer.dropEffect = "move", y(h.colId);
595
- },
596
- onDragLeave: () => {
597
- y((m) => m === h.colId ? null : m);
598
- },
599
- onDrop: (m) => {
600
- m.preventDefault();
601
- const v = m.dataTransfer.getData("text/plain");
602
- v && x(v, h.colId), i(null), y(null);
603
- },
604
- onDragEnd: () => {
605
- i(null), y(null);
606
- },
607
- className: [
608
- "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-xs)] ds:py-[var(--spacing-2xs,var(--spacing-xs))] ds:transition-colors",
609
- p ? "ds:opacity-50" : "",
610
- g ? "ds:bg-[color:color-mix(in_srgb,var(--primary)_8%,transparent)]" : ""
611
- ].filter(Boolean).join(" "),
612
- children: [
613
- /* @__PURE__ */ s(
614
- "span",
615
- {
616
- "aria-hidden": "true",
617
- className: "ds:cursor-grab ds:text-[color:var(--muted-foreground)] ds:active:cursor-grabbing",
618
- children: /* @__PURE__ */ s(kt, { className: "ds:size-4" })
619
- }
620
- ),
621
- /* @__PURE__ */ s(
622
- De,
623
- {
624
- label: h.displayName,
625
- checked: h.visible,
626
- onCheckedChange: (m) => b(h.colId, m === !0)
627
- }
628
- )
629
- ]
630
- },
631
- h.colId
632
- );
633
- })
634
- }
635
- ),
636
- a ? /* @__PURE__ */ s("div", { className: "ds:mt-[var(--spacing-xs)] ds:border-t ds:border-[color:var(--border)] ds:pt-[var(--spacing-sm)]", children: a }) : null
637
- ] })
638
- ] });
639
- };
640
- Ye.displayName = "DataTable.Toolbar.ColumnToggle";
641
- const et = $(
642
- ({ label: t, icon: e, onClick: a, variant: n = "default", size: r = "sm", ...l }, o) => {
643
- const { t: f } = F(), { getApi: d, selectionCount: c } = _(
644
- "DataTable.Toolbar.BulkAction"
645
- );
646
- return c === 0 ? null : /* @__PURE__ */ I(
647
- L,
648
- {
649
- ref: o,
650
- type: "button",
651
- intent: n === "destructive" ? "destructive" : "secondary",
652
- size: r,
653
- startIcon: Vt(e),
654
- onClick: () => a(d()),
655
- "aria-label": `${t} (${f("dataTable.bulkAction", { count: c })})`,
656
- ...l,
657
- children: [
658
- /* @__PURE__ */ s("span", { children: t }),
659
- /* @__PURE__ */ s(
660
- "span",
661
- {
662
- "aria-hidden": "true",
663
- className: "ds:ms-[var(--spacing-xs)] ds:opacity-80",
664
- children: f("dataTable.bulkAction", { count: c })
665
- }
666
- )
667
- ]
668
- }
669
- );
670
- }
671
- );
672
- et.displayName = "DataTable.Toolbar.BulkAction";
673
- const ea = Object.assign(Ze, {
674
- Item: ge
675
- }), ae = Object.assign($e, {
676
- FilterBar: _e,
677
- Actions: Be,
678
- /** @deprecated Use `Toolbar.ExportMenu` with a `csv` item. */
679
- ExportCsv: Ge,
680
- /** @deprecated Use `Toolbar.ExportMenu` with a `pdf` item. */
681
- ExportPdf: Ue,
682
- Print: Ke,
683
- ColumnToggle: Ye,
684
- BulkAction: et,
685
- QuickSearch: We,
686
- Refresh: He,
687
- FilterChips: Qe,
688
- FacetFilter: Xe,
689
- ExportMenu: ea
690
- }), ta = [
691
- "contains",
692
- "equals",
693
- "startsWith",
694
- "endsWith",
695
- "notContains"
696
- ];
697
- function aa(t) {
698
- const e = new Intl.Collator(t, {
699
- sensitivity: "base",
700
- usage: "search"
701
- });
702
- function a(n, r) {
703
- if (r.length === 0) return 0;
704
- if (r.length > n.length) return -1;
705
- for (let l = 0; l <= n.length - r.length; l += 1)
706
- if (e.compare(n.slice(l, l + r.length), r) === 0)
707
- return l;
708
- return -1;
709
- }
710
- return {
711
- equals: (n, r) => e.compare(n, r) === 0,
712
- contains: (n, r) => a(n, r) !== -1,
713
- startsWith: (n, r) => r.length <= n.length && e.compare(n.slice(0, r.length), r) === 0,
714
- endsWith: (n, r) => r.length <= n.length && e.compare(
715
- n.slice(n.length - r.length),
716
- r
717
- ) === 0
718
- };
719
- }
720
- function na(t) {
721
- return t == null ? null : typeof t == "string" ? t : String(t);
722
- }
723
- function ra(t) {
724
- const { model: e, onModelChange: a, getValue: n, placeholder: r, defaultOperator: l } = t, { t: o } = F("ui"), f = (e == null ? void 0 : e.type) ?? l ?? "contains", [d, c] = D(f), [i, u] = D((e == null ? void 0 : e.filter) ?? "");
725
- P(() => {
726
- c((e == null ? void 0 : e.type) ?? l ?? "contains"), u((e == null ? void 0 : e.filter) ?? "");
727
- }, [e, l]);
728
- const y = z(() => aa(zt.language), []);
729
- Y({
730
- doesFilterPass: (p) => {
731
- const g = e;
732
- if (!g || g.filter === "") return !0;
733
- const m = na(n(p.node));
734
- if (m === null) return !1;
735
- switch (g.type) {
736
- case "equals":
737
- return y.equals(m, g.filter);
738
- case "contains":
739
- return y.contains(m, g.filter);
740
- case "startsWith":
741
- return y.startsWith(m, g.filter);
742
- case "endsWith":
743
- return y.endsWith(m, g.filter);
744
- case "notContains":
745
- return !y.contains(m, g.filter);
746
- default:
747
- return !0;
748
- }
749
- }
750
- });
751
- function b() {
752
- if (i.trim() === "") {
753
- a(null);
754
- return;
755
- }
756
- a({ type: d, filter: i });
757
- }
758
- function x() {
759
- u(""), c(l ?? "contains"), a(null);
760
- }
761
- const T = ta.map(
762
- (p) => ({
763
- value: p,
764
- label: o(`dataTable.textFilter.operators.${p}`)
765
- })
766
- ), h = r ?? o("dataTable.textFilter.placeholder");
767
- return /* @__PURE__ */ I(
768
- "div",
769
- {
770
- "data-component": "text-filter",
771
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)] ds:min-w-[240px]",
772
- children: [
773
- /* @__PURE__ */ s(
774
- Ee,
775
- {
776
- size: "sm",
777
- options: T,
778
- value: d,
779
- onValueChange: (p) => {
780
- p !== "" && c(p);
781
- },
782
- "aria-label": o("dataTable.textFilter.operators.contains")
783
- }
784
- ),
785
- /* @__PURE__ */ s(
786
- pe,
787
- {
788
- size: "sm",
789
- value: i,
790
- onChange: (p) => u(p.target.value),
791
- onKeyDown: (p) => {
792
- p.key === "Enter" && (p.preventDefault(), b());
793
- },
794
- placeholder: h,
795
- "aria-label": h,
796
- startAdornment: /* @__PURE__ */ s(me, { "aria-hidden": "true", className: "ds:size-4" })
797
- }
798
- ),
799
- /* @__PURE__ */ I("div", { className: "ds:flex ds:items-center ds:justify-end ds:gap-[var(--spacing-xs)] ds:pt-[var(--spacing-xs)] ds:border-t ds:border-[var(--border)]", children: [
800
- /* @__PURE__ */ s(L, { intent: "ghost", size: "sm", onClick: x, type: "button", children: o("dataTable.textFilter.clear") }),
801
- /* @__PURE__ */ s(L, { intent: "primary", size: "sm", onClick: b, type: "button", children: o("dataTable.textFilter.apply") })
802
- ] })
803
- ]
804
- }
805
- );
806
- }
807
- function sa(t) {
808
- var u, y;
809
- const { model: e, onModelChange: a, column: n } = t, { t: r } = F("ui"), l = ((y = (u = n == null ? void 0 : n.getColDef) == null ? void 0 : u.call(n)) == null ? void 0 : y.filterParams) ?? {}, o = l.defaultOperator ?? "contains", f = l.placeholder ?? r("dataTable.textFilter.placeholder"), [d, c] = D((e == null ? void 0 : e.filter) ?? "");
810
- P(() => {
811
- c((e == null ? void 0 : e.filter) ?? "");
812
- }, [e == null ? void 0 : e.filter]), P(() => {
813
- if (d === ((e == null ? void 0 : e.filter) ?? "")) return;
814
- const b = setTimeout(() => {
815
- if (d === "") {
816
- e && a(null);
817
- return;
818
- }
819
- a({ type: o, filter: d });
820
- }, 200);
821
- return () => clearTimeout(b);
822
- }, [d, o, e, a]);
823
- function i() {
824
- c(""), e && a(null);
825
- }
826
- return /* @__PURE__ */ s("div", { "data-component": "text-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ s(
827
- pe,
828
- {
829
- size: "sm",
830
- value: d,
831
- onChange: (b) => c(b.target.value),
832
- placeholder: f,
833
- "aria-label": f,
834
- startAdornment: /* @__PURE__ */ s(me, { "aria-hidden": "true", className: "ds:size-4" }),
835
- endAdornment: d.length > 0 ? /* @__PURE__ */ s(
836
- "button",
837
- {
838
- type: "button",
839
- "aria-label": r("dataTable.textFilter.clear"),
840
- onClick: i,
841
- className: "ds:pointer-events-auto ds:flex ds:items-center ds:text-[var(--muted-foreground)] ds:hover:text-[var(--foreground)] ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
842
- children: /* @__PURE__ */ s(ke, { "aria-hidden": "true", className: "ds:size-4" })
843
- }
844
- ) : void 0
845
- }
846
- ) });
847
- }
848
- const la = {
849
- id: "data-table",
850
- capabilities: [
851
- "select_single",
852
- "select_multiple",
853
- "range_pick",
854
- "filter",
855
- "sort",
856
- "paginate"
857
- ],
858
- state: {
859
- selection: {
860
- type: "string[]",
861
- descriptionKey: "ui.agent.dataTable.state.selection",
862
- description: "Row ids of currently-selected rows.",
863
- read: (t) => t.getSelection()
864
- },
865
- filter: {
866
- type: "object",
867
- descriptionKey: "ui.agent.dataTable.state.filter",
868
- description: "Current ag-grid filter model, keyed by column id.",
869
- read: (t) => t.getFilter()
870
- },
871
- sort: {
872
- type: "Array<{ colId, sort }>",
873
- descriptionKey: "ui.agent.dataTable.state.sort",
874
- description: "Active sort, in priority order.",
875
- read: (t) => t.getSort()
876
- },
877
- currentPage: {
878
- type: "number",
879
- descriptionKey: "ui.agent.dataTable.state.currentPage",
880
- description: "Zero-indexed page number.",
881
- read: (t) => t.getCurrentPage()
882
- }
883
- },
884
- actions: {
885
- select_rows: {
886
- safety: "read",
887
- argsType: "{ ids: string[] }",
888
- descriptionKey: "ui.agent.dataTable.actions.selectRows",
889
- description: "Replace the current selection with the given row ids.",
890
- invoke: (t, e) => {
891
- t.setSelection(e.ids);
892
- }
893
- },
894
- select_range: {
895
- safety: "read",
896
- argsType: "{ fromId: string, toId: string }",
897
- descriptionKey: "ui.agent.dataTable.actions.selectRange",
898
- description: "Select every row between fromId and toId, inclusive, in current sort order.",
899
- invoke: (t, e) => {
900
- t.selectRange(e.fromId, e.toId);
901
- }
902
- },
903
- clear_selection: {
904
- safety: "read",
905
- descriptionKey: "ui.agent.dataTable.actions.clearSelection",
906
- description: "Deselect all rows.",
907
- invoke: (t) => {
908
- t.clearSelection();
909
- }
910
- },
911
- apply_filter: {
912
- safety: "read",
913
- argsType: "{ model: Record<string, unknown> }",
914
- descriptionKey: "ui.agent.dataTable.actions.applyFilter",
915
- description: "Replace the filter model with the given object.",
916
- invoke: (t, e) => {
917
- t.setFilter(e.model);
918
- }
919
- },
920
- sort_by: {
921
- safety: "read",
922
- argsType: "{ model: DataTableSortEntry[] }",
923
- descriptionKey: "ui.agent.dataTable.actions.sortBy",
924
- description: "Replace the active sort with the given list (priority order).",
925
- invoke: (t, e) => {
926
- t.setSort(e.model);
927
- }
928
- },
929
- go_to_page: {
930
- safety: "read",
931
- argsType: "{ page: number }",
932
- descriptionKey: "ui.agent.dataTable.actions.goToPage",
933
- description: "Navigate to the given zero-indexed page.",
934
- invoke: (t, e) => {
935
- t.goToPage(e.page);
936
- }
937
- }
938
- },
939
- domHooks: {
940
- root: {
941
- attr: "data-component",
942
- value: "data-table",
943
- description: "Marks the DataTable wrapper."
944
- },
945
- instanceId: {
946
- attr: "data-component-id",
947
- sourceProp: "gridId",
948
- description: "Sourced from the gridId prop. Required to address a specific table from the agent."
949
- },
950
- item: {
951
- attr: "row-id",
952
- description: "Native ag-grid row-id attribute on each rendered row. Selection is performed via the curated handle, not by DOM mutation."
953
- }
954
- }
955
- };
956
- wt.registerModules([Ft]);
957
- const oa = Nt("ag-theme-alfadocs ds:w-full", {
958
- variants: {
959
- density: {
960
- default: "",
961
- compact: "data-table-compact",
962
- expanded: "data-table-expanded"
963
- },
964
- bordered: {
965
- true: "",
966
- false: "ds:[--ag-borders:none]"
967
- }
968
- },
969
- defaultVariants: {
970
- density: "default",
971
- bordered: !0
972
- }
973
- });
974
- function ia() {
975
- const { t } = F();
976
- return z(
977
- () => ({
978
- // Filter strings
979
- contains: t("dataTable.agGrid.contains"),
980
- notContains: t("dataTable.agGrid.notContains"),
981
- equals: t("dataTable.agGrid.equals"),
982
- notEqual: t("dataTable.agGrid.notEqual"),
983
- startsWith: t("dataTable.agGrid.startsWith"),
984
- endsWith: t("dataTable.agGrid.endsWith"),
985
- lessThan: t("dataTable.agGrid.lessThan"),
986
- greaterThan: t("dataTable.agGrid.greaterThan"),
987
- inRange: t("dataTable.agGrid.inRange"),
988
- blank: t("dataTable.agGrid.blank"),
989
- notBlank: t("dataTable.agGrid.notBlank"),
990
- filterOoo: t("dataTable.agGrid.filterOoo"),
991
- applyFilter: t("dataTable.agGrid.applyFilter"),
992
- resetFilter: t("dataTable.agGrid.resetFilter"),
993
- noRowsToShow: t("dataTable.agGrid.noRowsToShow"),
994
- selectAll: t("dataTable.agGrid.selectAll"),
995
- // Pagination
996
- page: t("dataTable.page"),
997
- of: t("dataTable.of"),
998
- to: t("dataTable.to"),
999
- nextPage: t("dataTable.nextPage"),
1000
- previousPage: t("dataTable.previousPage"),
1001
- firstPage: t("dataTable.firstPage"),
1002
- lastPage: t("dataTable.lastPage"),
1003
- pageSize: t("dataTable.pageSize")
1004
- }),
1005
- [t]
1006
- );
1007
- }
1008
- function ca() {
1009
- return /* @__PURE__ */ s(
1010
- "div",
1011
- {
1012
- role: "status",
1013
- "aria-live": "polite",
1014
- className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]",
1015
- children: Array.from({ length: 5 }).map((t, e) => /* @__PURE__ */ s(
1016
- Ct,
1017
- {
1018
- variant: "rectangular",
1019
- className: "ds:h-[var(--min-target-size)] ds:w-full"
1020
- },
1021
- e
1022
- ))
1023
- }
1024
- );
1025
- }
1026
- function da() {
1027
- const { t } = F();
1028
- return /* @__PURE__ */ s(
1029
- xt,
1030
- {
1031
- variant: "no-results",
1032
- size: "sm",
1033
- title: t("dataTable.noRows"),
1034
- description: t("dataTable.noRowsDescription")
1035
- }
1036
- );
1037
- }
1038
- function ua(t) {
1039
- try {
1040
- const e = localStorage.getItem(`data-table-col-state:${t}`);
1041
- return e ? JSON.parse(e) : null;
1042
- } catch {
1043
- return null;
1044
- }
1045
- }
1046
- function fa(t, e) {
1047
- try {
1048
- localStorage.setItem(
1049
- `data-table-col-state:${t}`,
1050
- JSON.stringify(e.getColumnState())
1051
- );
1052
- } catch {
1053
- }
1054
- }
1055
- function pa(t, e) {
1056
- const {
1057
- columnDefs: a,
1058
- rowData: n,
1059
- rowSelection: r,
1060
- pagination: l = !1,
1061
- paginationPageSize: o = 25,
1062
- paginationPageSizeSelector: f = [10, 25, 50, 100],
1063
- gridId: d,
1064
- onSelectionChanged: c,
1065
- onSortChanged: i,
1066
- onFilterChanged: u,
1067
- noRowsOverlay: y,
1068
- loadingOverlay: b,
1069
- gridOptions: x,
1070
- density: T,
1071
- bordered: h,
1072
- heightClass: p = "ds:h-[500px]",
1073
- className: g,
1074
- getRowClass: m,
1075
- pinnedBottomRowData: v,
1076
- printMode: S = !1,
1077
- children: E
1078
- } = t, { t: k, i18n: q } = F(), R = Z(null), [V, at] = D(0), [se, le] = D(""), nt = ia(), oe = z(
1079
- () => ({
1080
- getSelection: () => {
1081
- var w;
1082
- const C = (w = R.current) == null ? void 0 : w.api;
1083
- if (!C) return [];
1084
- const N = [];
1085
- for (const O of C.getSelectedNodes())
1086
- O.id != null && N.push(O.id);
1087
- return N;
1088
- },
1089
- setSelection: (C) => {
1090
- var O;
1091
- const N = (O = R.current) == null ? void 0 : O.api;
1092
- if (!N) return;
1093
- const w = new Set(C);
1094
- N.forEachNode((A) => {
1095
- A.id != null && A.setSelected(w.has(A.id));
1096
- });
1097
- },
1098
- selectRange: (C, N) => {
1099
- var he;
1100
- const w = (he = R.current) == null ? void 0 : he.api;
1101
- if (!w) return;
1102
- const O = [];
1103
- w.forEachNodeAfterFilterAndSort((K) => {
1104
- K.id != null && O.push(K.id);
1105
- });
1106
- const A = O.indexOf(C), j = O.indexOf(N);
1107
- if (A < 0 || j < 0) return;
1108
- const [U, ce] = A <= j ? [A, j] : [j, A], de = new Set(O.slice(U, ce + 1));
1109
- w.forEachNode((K) => {
1110
- K.id != null && K.setSelected(de.has(K.id));
1111
- });
1112
- },
1113
- clearSelection: () => {
1114
- var C, N;
1115
- (N = (C = R.current) == null ? void 0 : C.api) == null || N.deselectAll();
1116
- },
1117
- getFilter: () => {
1118
- var C, N;
1119
- return ((N = (C = R.current) == null ? void 0 : C.api) == null ? void 0 : N.getFilterModel()) ?? {};
1120
- },
1121
- setFilter: (C) => {
1122
- var N, w;
1123
- (w = (N = R.current) == null ? void 0 : N.api) == null || w.setFilterModel(C);
1124
- },
1125
- getSort: () => {
1126
- var N;
1127
- const C = (N = R.current) == null ? void 0 : N.api;
1128
- return C ? C.getColumnState().filter((w) => w.sort === "asc" || w.sort === "desc").map((w) => ({ colId: w.colId, sort: w.sort })) : [];
1129
- },
1130
- setSort: (C) => {
1131
- var O;
1132
- const N = (O = R.current) == null ? void 0 : O.api;
1133
- if (!N) return;
1134
- const w = N.getColumnState().map((A) => {
1135
- const j = C.find((U) => U.colId === A.colId);
1136
- return { ...A, sort: j ? j.sort : null };
1137
- });
1138
- N.applyColumnState({ state: w, defaultState: { sort: null } });
1139
- },
1140
- getCurrentPage: () => {
1141
- var C, N;
1142
- return ((N = (C = R.current) == null ? void 0 : C.api) == null ? void 0 : N.paginationGetCurrentPage()) ?? 0;
1143
- },
1144
- goToPage: (C) => {
1145
- var N, w;
1146
- (w = (N = R.current) == null ? void 0 : N.api) == null || w.paginationGoToPage(C);
1147
- },
1148
- getRawApi: () => {
1149
- var C;
1150
- return (C = R.current) == null ? void 0 : C.api;
1151
- }
1152
- }),
1153
- []
1154
- );
1155
- Tt(e, () => oe, [oe]), Ot(la, oe, d);
1156
- const rt = q.dir() === "rtl", st = n === void 0, lt = At(), { resolvedTheme: be } = Pt(), ot = (be === "light-accessible" || be === "dark-accessible") && T === "compact" ? "default" : T, it = z(() => {
1157
- if (r)
1158
- return r === "single" ? { mode: "singleRow" } : {
1159
- mode: "multiRow",
1160
- headerCheckbox: !0,
1161
- checkboxes: !0
1162
- };
1163
- }, [r]), ct = M(() => {
1164
- var N;
1165
- if (!d || !((N = R.current) != null && N.api)) return;
1166
- const C = ua(d);
1167
- C && R.current.api.applyColumnState({
1168
- state: C,
1169
- applyOrder: !0
1170
- });
1171
- }, [d]), ie = M(() => {
1172
- var C;
1173
- d && ((C = R.current) != null && C.api) && fa(d, R.current.api);
1174
- }, [d]), dt = M(() => {
1175
- var w;
1176
- const C = (w = R.current) == null ? void 0 : w.api;
1177
- if (!C) return;
1178
- const N = C.getSelectedRows();
1179
- at(N.length), c == null || c(N);
1180
- }, [c]), ut = M(
1181
- (C) => {
1182
- var w;
1183
- const N = (w = R.current) == null ? void 0 : w.api;
1184
- if (N) {
1185
- const A = N.getColumnState().find((j) => j.sort);
1186
- if (A) {
1187
- const j = A.colId, U = N.getColumnDef(j), ce = (U == null ? void 0 : U.headerName) ?? j, de = A.sort === "asc" ? "dataTable.sortAscending" : "dataTable.sortDescending";
1188
- le(
1189
- k("dataTable.sortAnnounce", {
1190
- column: ce,
1191
- direction: k(de)
1192
- })
1193
- );
1194
- } else
1195
- le("");
1196
- }
1197
- i == null || i(C);
1198
- },
1199
- [i, k]
1200
- ), ft = M(
1201
- (C) => {
1202
- u == null || u(C);
1203
- },
1204
- [u]
1205
- );
1206
- P(() => {
1207
- if (!se) return;
1208
- const C = setTimeout(() => le(""), 3e3);
1209
- return () => clearTimeout(C);
1210
- }, [se]);
1211
- const pt = y ?? da, mt = b ?? ca, gt = M(
1212
- () => {
1213
- var C;
1214
- return (C = R.current) == null ? void 0 : C.api;
1215
- },
1216
- []
1217
- ), bt = M(() => {
1218
- typeof window < "u" && window.print();
1219
- }, []), ht = oa({
1220
- density: ot,
1221
- bordered: h,
1222
- className: g
1223
- }), vt = E ?? /* @__PURE__ */ s(ae, { children: /* @__PURE__ */ s(ae.Actions, { children: /* @__PURE__ */ s(ae.ExportMenu, {}) }) }), yt = S ? !1 : l;
1224
- return /* @__PURE__ */ I(
1225
- "div",
1226
- {
1227
- className: "ds:flex ds:w-full ds:min-h-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-sm)]",
1228
- "aria-busy": st ? "true" : void 0,
1229
- "data-component": "data-table",
1230
- "data-component-id": d,
1231
- "data-print-mode": S ? "true" : void 0,
1232
- children: [
1233
- !S && /* @__PURE__ */ s(
1234
- Ut,
1235
- {
1236
- getApi: gt,
1237
- selectionCount: V,
1238
- onPrint: bt,
1239
- children: vt
1240
- }
1241
- ),
1242
- /* @__PURE__ */ s(
1243
- "div",
1244
- {
1245
- className: [ht, S ? "" : p].join(" ").trim(),
1246
- children: /* @__PURE__ */ s(
1247
- St,
1248
- {
1249
- ref: R,
1250
- theme: "legacy",
1251
- columnDefs: a,
1252
- rowData: n,
1253
- defaultColDef: {
1254
- sortable: !0,
1255
- // Default filter = DS-styled text filter so untyped columns
1256
- // (no explicit `filter:` override) inherit the kit's form
1257
- // language instead of AG Grid's stock browser-skinned input.
1258
- // Number / date / select columns opt into their dedicated
1259
- // wrapper per-column.
1260
- filter: ra,
1261
- floatingFilterComponent: sa,
1262
- resizable: !0,
1263
- floatingFilter: !0,
1264
- // §13d — faint sort icon advertises which columns are
1265
- // sortable. v33+ moved this from grid-level to defaultColDef.
1266
- unSortIcon: !0,
1267
- ...x == null ? void 0 : x.defaultColDef
1268
- },
1269
- rowSelection: it,
1270
- pagination: yt,
1271
- paginationPageSize: o,
1272
- paginationPageSizeSelector: f,
1273
- paginationNumberFormatter: (C) => new Intl.NumberFormat(q.language).format(C.value),
1274
- animateRows: !lt,
1275
- enableRtl: rt,
1276
- ensureDomOrder: !0,
1277
- enableCellSpan: !0,
1278
- enableCellTextSelection: !0,
1279
- copyHeadersToClipboard: !0,
1280
- accentedSort: !0,
1281
- multiSortKey: "ctrl",
1282
- suppressDragLeaveHidesColumns: !0,
1283
- suppressRowClickSelection: r ? !0 : void 0,
1284
- tooltipShowDelay: 500,
1285
- tooltipHideDelay: 5e3,
1286
- tooltipInteraction: !0,
1287
- stopEditingWhenCellsLoseFocus: !0,
1288
- maintainColumnOrder: !0,
1289
- undoRedoCellEditing: !0,
1290
- undoRedoCellEditingLimit: 20,
1291
- suppressCellFocus: !1,
1292
- rowBuffer: 10,
1293
- localeText: nt,
1294
- noRowsOverlayComponent: pt,
1295
- loadingOverlayComponent: mt,
1296
- getRowClass: m,
1297
- pinnedBottomRowData: v,
1298
- domLayout: S ? "autoHeight" : void 0,
1299
- onGridReady: ct,
1300
- onColumnMoved: ie,
1301
- onColumnResized: ie,
1302
- onColumnPinned: ie,
1303
- onSortChanged: ut,
1304
- onFilterChanged: ft,
1305
- onSelectionChanged: dt,
1306
- ...x
1307
- }
1308
- )
1309
- }
1310
- ),
1311
- !S && /* @__PURE__ */ s("div", { className: "ds:flex ds:items-center ds:justify-between type-body-sm ds:text-[color:var(--muted-foreground)]", children: V > 0 ? /* @__PURE__ */ s("span", { children: k("dataTable.selected", { count: V }) }) : /* @__PURE__ */ s("span", {}) }),
1312
- /* @__PURE__ */ s("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: se })
1313
- ]
1314
- }
1315
- );
1316
- }
1317
- const tt = $(pa);
1318
- tt.displayName = "DataTable";
1319
- const Sn = Object.assign(tt, {
1320
- Toolbar: ae
1321
- });
1322
- function wn(t, e, a) {
1323
- return z(() => {
1324
- const n = {};
1325
- for (const r of e) {
1326
- let l = 0;
1327
- for (const o of t ?? []) {
1328
- const f = o[r], d = typeof f == "number" ? f : Number(f);
1329
- Number.isFinite(d) && (l += d);
1330
- }
1331
- n[r] = l;
1332
- }
1333
- return a != null && a.labelField && a.labelValue !== void 0 && (n[a.labelField] = a.labelValue), n;
1334
- }, [t, e, a == null ? void 0 : a.labelField, a == null ? void 0 : a.labelValue]);
1335
- }
1336
- function re(t) {
1337
- return t ? t.toISOString().slice(0, 10) : null;
1338
- }
1339
- function X(t) {
1340
- if (!t) return;
1341
- const e = new Date(t);
1342
- return Number.isNaN(e.getTime()) ? void 0 : e;
1343
- }
1344
- function Fn(t) {
1345
- const { model: e, onModelChange: a, getValue: n, doesRowPassOtherFilter: r } = t, l = {
1346
- from: X(e == null ? void 0 : e.dateFrom),
1347
- to: X(e == null ? void 0 : e.dateTo)
1348
- }, [o, f] = D(l);
1349
- Y({
1350
- doesFilterPass: (c) => {
1351
- const i = n(c.node);
1352
- if (!i) return !1;
1353
- const u = i instanceof Date ? i : X(String(i));
1354
- return !(!u || o.from && u < o.from || o.to && u > o.to);
1355
- }
1356
- });
1357
- function d(c) {
1358
- if (f(c), !c.from && !c.to) {
1359
- a(null);
1360
- return;
1361
- }
1362
- a({
1363
- type: "inRange",
1364
- dateFrom: re(c.from),
1365
- dateTo: re(c.to)
1366
- });
1367
- }
1368
- return /* @__PURE__ */ s("div", { className: "ds:p-[var(--spacing-sm)] ds:min-w-[280px]", children: /* @__PURE__ */ s(ze, { value: o, onChange: d, size: "sm" }) });
1369
- }
1370
- function Rn(t) {
1371
- var d, c;
1372
- const { model: e, onModelChange: a, column: n } = t, r = ((c = (d = n == null ? void 0 : n.getColDef) == null ? void 0 : d.call(n)) == null ? void 0 : c.filterParams) ?? {}, [l, o] = D({
1373
- from: X(e == null ? void 0 : e.dateFrom),
1374
- to: X(e == null ? void 0 : e.dateTo)
1375
- });
1376
- function f(i) {
1377
- if (o(i), !i.from && !i.to) {
1378
- a(null);
1379
- return;
1380
- }
1381
- a({
1382
- type: "inRange",
1383
- dateFrom: re(i.from),
1384
- dateTo: re(i.to)
1385
- });
1386
- }
1387
- return /* @__PURE__ */ s("div", { "data-component": "date-range-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ s(
1388
- ze,
1389
- {
1390
- value: l,
1391
- onChange: f,
1392
- size: "sm",
1393
- placeholder: r.placeholder
1394
- }
1395
- ) });
1396
- }
1397
- function W(t) {
1398
- return typeof t == "number" ? `n:${t}` : `s:${t}`;
1399
- }
1400
- function Dn(t) {
1401
- const { model: e, onModelChange: a, getValue: n, api: r, column: l, options: o, placeholder: f } = t, { t: d } = F("ui"), c = z(() => {
1402
- if (o && o.length > 0) return o;
1403
- if (!r || !l) return [];
1404
- const p = /* @__PURE__ */ new Map();
1405
- return r.forEachNode((g) => {
1406
- const m = n(g);
1407
- if (m == null) return;
1408
- const v = typeof m == "string" || typeof m == "number" ? m : String(m), S = W(v);
1409
- p.has(S) || p.set(S, { value: v, label: String(v) });
1410
- }), Array.from(p.values()).sort(
1411
- (g, m) => String(g.label).localeCompare(String(m.label))
1412
- );
1413
- }, [o, r, l, n]), i = z(() => {
1414
- const p = /* @__PURE__ */ new Set(), g = (e == null ? void 0 : e.values) ?? [];
1415
- for (const m of g) p.add(W(m));
1416
- return p;
1417
- }, [e]), [u, y] = D(i);
1418
- P(() => {
1419
- y(i);
1420
- }, [i]), Y({
1421
- doesFilterPass: (p) => {
1422
- const g = e == null ? void 0 : e.values;
1423
- if (!g || g.length === 0) return !0;
1424
- const m = n(p.node);
1425
- if (m == null) return !1;
1426
- const v = typeof m == "string" || typeof m == "number" ? m : String(m), S = W(v);
1427
- return g.some((E) => W(E) === S);
1428
- }
1429
- });
1430
- function b(p) {
1431
- y((g) => {
1432
- const m = new Set(g);
1433
- return m.has(p) ? m.delete(p) : m.add(p), m;
1434
- });
1435
- }
1436
- function x() {
1437
- if (u.size === 0) {
1438
- a(null);
1439
- return;
1440
- }
1441
- const p = [];
1442
- for (const g of c)
1443
- u.has(W(g.value)) && p.push(g.value);
1444
- a({ type: "set", values: p });
1445
- }
1446
- function T() {
1447
- y(/* @__PURE__ */ new Set()), a(null);
1448
- }
1449
- const h = f ?? d("dataTable.selectFilter.all");
1450
- return /* @__PURE__ */ I(
1451
- "div",
1452
- {
1453
- "data-component": "select-filter",
1454
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)] ds:min-w-[200px] ds:max-w-[260px]",
1455
- children: [
1456
- /* @__PURE__ */ s(
1457
- "div",
1458
- {
1459
- role: "group",
1460
- "aria-label": h,
1461
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:max-h-[240px] ds:overflow-y-auto",
1462
- children: c.length === 0 ? /* @__PURE__ */ s("p", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[var(--muted-foreground)] ds:py-[var(--spacing-xs)]", children: d("dataTable.agGrid.noRowsToShow") }) : c.map((p) => {
1463
- const g = W(p.value);
1464
- return /* @__PURE__ */ s(
1465
- De,
1466
- {
1467
- size: "sm",
1468
- label: p.label,
1469
- checked: u.has(g),
1470
- onCheckedChange: () => b(g)
1471
- },
1472
- g
1473
- );
1474
- })
1475
- }
1476
- ),
1477
- /* @__PURE__ */ I("div", { className: "ds:flex ds:items-center ds:justify-end ds:gap-[var(--spacing-xs)] ds:pt-[var(--spacing-xs)] ds:border-t ds:border-[var(--border)]", children: [
1478
- /* @__PURE__ */ s(L, { intent: "ghost", size: "sm", onClick: T, type: "button", children: d("dataTable.selectFilter.clear") }),
1479
- /* @__PURE__ */ s(L, { intent: "primary", size: "sm", onClick: x, type: "button", children: d("dataTable.selectFilter.apply") })
1480
- ] })
1481
- ]
1482
- }
1483
- );
1484
- }
1485
- function kn(t) {
1486
- var y;
1487
- const { model: e, onModelChange: a, column: n } = t, r = (y = n == null ? void 0 : n.getColDef) == null ? void 0 : y.call(n), l = (r == null ? void 0 : r.filterParams) ?? {}, o = l.options ?? [], f = l.placeholder ?? (typeof (r == null ? void 0 : r.headerName) == "string" ? r.headerName : void 0), d = z(() => {
1488
- const b = /* @__PURE__ */ new Map();
1489
- for (const x of o) b.set(String(x.value), x.value);
1490
- return b;
1491
- }, [o]), c = z(
1492
- () => o.map((b) => ({
1493
- value: String(b.value),
1494
- label: b.label
1495
- })),
1496
- [o]
1497
- ), i = z(
1498
- () => ((e == null ? void 0 : e.values) ?? []).map((b) => String(b)),
1499
- [e]
1500
- );
1501
- function u(b) {
1502
- if (b.length === 0) {
1503
- a(null);
1504
- return;
1505
- }
1506
- const x = [];
1507
- for (const T of b) {
1508
- const h = d.get(T);
1509
- h !== void 0 && x.push(h);
1510
- }
1511
- a({ type: "set", values: x });
1512
- }
1513
- return /* @__PURE__ */ s("div", { "data-component": "select-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ s(
1514
- Mt,
1515
- {
1516
- size: "sm",
1517
- options: c,
1518
- value: i,
1519
- onChange: u,
1520
- placeholder: l.placeholder,
1521
- "aria-label": f,
1522
- allowClear: !0
1523
- }
1524
- ) });
1525
- }
1526
- function Q(t) {
1527
- return t.trim().toLocaleLowerCase();
1528
- }
1529
- function In(t) {
1530
- const {
1531
- model: e,
1532
- onModelChange: a,
1533
- getValue: n,
1534
- api: r,
1535
- column: l,
1536
- options: o,
1537
- loadOptions: f,
1538
- placeholder: d
1539
- } = t, { t: c } = F("ui"), i = z(() => {
1540
- if (o && o.length > 0) return o;
1541
- if (!r || !l) return [];
1542
- const g = /* @__PURE__ */ new Map();
1543
- return r.forEachNode((m) => {
1544
- const v = n(m);
1545
- if (v == null) return;
1546
- const S = typeof v == "string" ? v : String(v);
1547
- g.has(S) || g.set(S, { value: S, label: S });
1548
- }), Array.from(g.values()).sort(
1549
- (m, v) => m.label.localeCompare(v.label)
1550
- );
1551
- }, [o, r, l, n]), u = z(() => async (g, m) => {
1552
- if (f)
1553
- return (await f(g, m)).map((k) => ({ value: k.value, label: k.label }));
1554
- const v = Q(g);
1555
- return (v ? i.filter((E) => Q(E.label).includes(v)) : i).slice(0, 50).map((E) => ({ value: E.value, label: E.label }));
1556
- }, [f, i]), [y, b] = D((e == null ? void 0 : e.value) ?? "");
1557
- P(() => {
1558
- b((e == null ? void 0 : e.value) ?? "");
1559
- }, [e == null ? void 0 : e.value]), Y({
1560
- doesFilterPass: (g) => {
1561
- const m = e == null ? void 0 : e.value;
1562
- if (!m) return !0;
1563
- const v = n(g.node);
1564
- if (v == null) return !1;
1565
- const S = typeof v == "string" ? v : String(v);
1566
- return Q(S) === Q(m);
1567
- }
1568
- });
1569
- function x(g) {
1570
- b(g.label), a({ type: "equals", value: g.value });
1571
- }
1572
- function T(g) {
1573
- b(g), g === "" && e && a(null);
1574
- }
1575
- function h() {
1576
- b(""), a(null);
1577
- }
1578
- const p = d ?? c("dataTable.typeaheadFilter.placeholder");
1579
- return /* @__PURE__ */ I(
1580
- "div",
1581
- {
1582
- "data-component": "typeahead-filter",
1583
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)] ds:min-w-[240px]",
1584
- children: [
1585
- /* @__PURE__ */ s(
1586
- Ae,
1587
- {
1588
- size: "sm",
1589
- value: y,
1590
- onChange: T,
1591
- onSelect: x,
1592
- loadOptions: u,
1593
- placeholder: p,
1594
- "aria-label": p
1595
- }
1596
- ),
1597
- /* @__PURE__ */ s("div", { className: "ds:flex ds:items-center ds:justify-end ds:pt-[var(--spacing-xs)] ds:border-t ds:border-[var(--border)]", children: /* @__PURE__ */ s(L, { intent: "ghost", size: "sm", onClick: h, type: "button", children: c("dataTable.typeaheadFilter.clear") }) })
1598
- ]
1599
- }
1600
- );
1601
- }
1602
- function En(t) {
1603
- var x, T;
1604
- const { model: e, onModelChange: a, column: n } = t, { t: r } = F("ui"), l = ((T = (x = n == null ? void 0 : n.getColDef) == null ? void 0 : x.call(n)) == null ? void 0 : T.filterParams) ?? {}, o = l.options ?? [], f = l.loadOptions, d = l.placeholder ?? r("dataTable.typeaheadFilter.placeholder"), c = z(() => async (h, p) => {
1605
- if (f)
1606
- return (await f(h, p)).map((S) => ({ value: S.value, label: S.label }));
1607
- const g = Q(h);
1608
- return (g ? o.filter((v) => Q(v.label).includes(g)) : o).slice(0, 50).map((v) => ({ value: v.value, label: v.label }));
1609
- }, [f, o]), [i, u] = D((e == null ? void 0 : e.value) ?? "");
1610
- P(() => {
1611
- u((e == null ? void 0 : e.value) ?? "");
1612
- }, [e == null ? void 0 : e.value]);
1613
- function y(h) {
1614
- u(h.label), a({ type: "equals", value: h.value });
1615
- }
1616
- function b(h) {
1617
- u(h), h === "" && e && a(null);
1618
- }
1619
- return /* @__PURE__ */ s("div", { "data-component": "typeahead-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ s(
1620
- Ae,
1621
- {
1622
- size: "sm",
1623
- value: i,
1624
- onChange: b,
1625
- onSelect: y,
1626
- loadOptions: c,
1627
- placeholder: d,
1628
- "aria-label": d
1629
- }
1630
- ) });
1631
- }
1632
- const ma = [
1633
- "equals",
1634
- "notEqual",
1635
- "greaterThan",
1636
- "greaterThanOrEqual",
1637
- "lessThan",
1638
- "lessThanOrEqual",
1639
- "inRange",
1640
- "blank",
1641
- "notBlank"
1642
- ];
1643
- function ye(t) {
1644
- return t !== "blank" && t !== "notBlank";
1645
- }
1646
- function Te(t) {
1647
- return t === "inRange";
1648
- }
1649
- function ga(t, e, a, n) {
1650
- if (t === "blank") return e === null;
1651
- if (t === "notBlank") return e !== null;
1652
- if (e === null) return !1;
1653
- if (a === null) return !0;
1654
- switch (t) {
1655
- case "equals":
1656
- return e === a;
1657
- case "notEqual":
1658
- return e !== a;
1659
- case "greaterThan":
1660
- return e > a;
1661
- case "greaterThanOrEqual":
1662
- return e >= a;
1663
- case "lessThan":
1664
- return e < a;
1665
- case "lessThanOrEqual":
1666
- return e <= a;
1667
- case "inRange": {
1668
- if (n === null) return e >= a;
1669
- const r = Math.min(a, n), l = Math.max(a, n);
1670
- return e >= r && e <= l;
1671
- }
1672
- default:
1673
- return !0;
1674
- }
1675
- }
1676
- function ba(t) {
1677
- if (t == null || t === "") return null;
1678
- const e = typeof t == "number" ? t : Number(t);
1679
- return Number.isNaN(e) ? null : e;
1680
- }
1681
- function zn(t) {
1682
- const {
1683
- model: e,
1684
- onModelChange: a,
1685
- getValue: n,
1686
- defaultOperator: r,
1687
- min: l,
1688
- max: o,
1689
- step: f,
1690
- placeholder: d
1691
- } = t, { t: c } = F("ui"), i = (e == null ? void 0 : e.type) ?? r ?? "equals", [u, y] = D(i), [b, x] = D((e == null ? void 0 : e.filter) ?? null), [T, h] = D(
1692
- (e == null ? void 0 : e.filterTo) ?? null
1693
- );
1694
- P(() => {
1695
- if (e === null) {
1696
- y(r ?? "equals"), x(null), h(null);
1697
- return;
1698
- }
1699
- y(e.type), x(e.filter ?? null), h(e.filterTo ?? null);
1700
- }, [e, r]), Y({
1701
- doesFilterPass: (k) => {
1702
- if (!e) return !0;
1703
- const q = ba(n(k.node));
1704
- return ga(
1705
- e.type,
1706
- q,
1707
- e.filter ?? null,
1708
- e.filterTo ?? null
1709
- );
1710
- }
1711
- });
1712
- const p = z(
1713
- () => ma.map((k) => ({
1714
- value: k,
1715
- label: c(`dataTable.numberFilter.operators.${k}`)
1716
- })),
1717
- [c]
1718
- ), g = d ?? c("dataTable.numberFilter.placeholder");
1719
- function m() {
1720
- if (!ye(u)) {
1721
- a({ type: u, filter: 0 });
1722
- return;
1723
- }
1724
- if (b === null) {
1725
- a(null);
1726
- return;
1727
- }
1728
- if (Te(u)) {
1729
- a({
1730
- type: u,
1731
- filter: b,
1732
- filterTo: T ?? void 0
1733
- });
1734
- return;
1735
- }
1736
- a({ type: u, filter: b });
1737
- }
1738
- function v() {
1739
- y(r ?? "equals"), x(null), h(null), a(null);
1740
- }
1741
- const S = ye(u), E = Te(u);
1742
- return /* @__PURE__ */ I(
1743
- "div",
1744
- {
1745
- "data-component": "number-filter",
1746
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)] ds:min-w-[240px]",
1747
- children: [
1748
- /* @__PURE__ */ s(
1749
- Ee,
1750
- {
1751
- size: "sm",
1752
- options: p,
1753
- value: u,
1754
- onValueChange: (k) => {
1755
- k !== "" && y(k);
1756
- },
1757
- "aria-label": c("dataTable.numberFilter.operators.equals")
1758
- }
1759
- ),
1760
- S && !E && /* @__PURE__ */ s(
1761
- te,
1762
- {
1763
- size: "sm",
1764
- value: b,
1765
- onChange: x,
1766
- min: l,
1767
- max: o,
1768
- step: f,
1769
- placeholder: g,
1770
- "aria-label": g
1771
- }
1772
- ),
1773
- E && /* @__PURE__ */ I("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
1774
- /* @__PURE__ */ s(
1775
- te,
1776
- {
1777
- size: "sm",
1778
- value: b,
1779
- onChange: x,
1780
- min: l,
1781
- max: o,
1782
- step: f,
1783
- placeholder: c("dataTable.numberFilter.from"),
1784
- "aria-label": c("dataTable.numberFilter.from")
1785
- }
1786
- ),
1787
- /* @__PURE__ */ s(
1788
- te,
1789
- {
1790
- size: "sm",
1791
- value: T,
1792
- onChange: h,
1793
- min: l,
1794
- max: o,
1795
- step: f,
1796
- placeholder: c("dataTable.numberFilter.to"),
1797
- "aria-label": c("dataTable.numberFilter.to")
1798
- }
1799
- )
1800
- ] }),
1801
- /* @__PURE__ */ I("div", { className: "ds:flex ds:items-center ds:justify-end ds:gap-[var(--spacing-xs)] ds:pt-[var(--spacing-xs)] ds:border-t ds:border-[var(--border)]", children: [
1802
- /* @__PURE__ */ s(L, { intent: "ghost", size: "sm", onClick: v, type: "button", children: c("dataTable.numberFilter.clear") }),
1803
- /* @__PURE__ */ s(L, { intent: "primary", size: "sm", onClick: m, type: "button", children: c("dataTable.numberFilter.apply") })
1804
- ] })
1805
- ]
1806
- }
1807
- );
1808
- }
1809
- function An(t) {
1810
- var i, u;
1811
- const { model: e, onModelChange: a, column: n } = t, { t: r } = F("ui"), l = ((u = (i = n == null ? void 0 : n.getColDef) == null ? void 0 : i.call(n)) == null ? void 0 : u.filterParams) ?? {}, o = l.defaultOperator ?? "equals", f = l.placeholder ?? r("dataTable.numberFilter.placeholder"), [d, c] = D((e == null ? void 0 : e.filter) ?? null);
1812
- return P(() => {
1813
- c((e == null ? void 0 : e.filter) ?? null);
1814
- }, [e == null ? void 0 : e.filter]), P(() => {
1815
- if (d === ((e == null ? void 0 : e.filter) ?? null)) return;
1816
- const y = setTimeout(() => {
1817
- if (d === null || Number.isNaN(d)) {
1818
- a(null);
1819
- return;
1820
- }
1821
- a({ type: o, filter: d });
1822
- }, 200);
1823
- return () => clearTimeout(y);
1824
- }, [d, o]), /* @__PURE__ */ s("div", { "data-component": "number-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ s(
1825
- te,
1826
- {
1827
- size: "sm",
1828
- value: d,
1829
- onChange: c,
1830
- min: l.min,
1831
- max: l.max,
1832
- step: l.step,
1833
- placeholder: f,
1834
- "aria-label": f
1835
- }
1836
- ) });
1837
- }
1838
- function Pn(t) {
1839
- const { value: e, variantMap: a } = t, n = (a == null ? void 0 : a[e]) ?? "neutral";
1840
- return /* @__PURE__ */ s(jt, { variant: n, withDot: !0, size: "sm", children: String(e ?? "") });
1841
- }
1842
- function On(t) {
1843
- const { value: e } = t;
1844
- return e ? /* @__PURE__ */ I("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
1845
- /* @__PURE__ */ s(Pe, { name: e.name, src: e.src, size: "sm" }),
1846
- /* @__PURE__ */ s("span", { children: e.name })
1847
- ] }) : null;
1848
- }
1849
- const ha = {
1850
- sm: "ds:size-8",
1851
- md: "ds:size-10",
1852
- lg: "ds:size-12"
1853
- }, va = {
1854
- square: "ds:rounded-none",
1855
- rounded: "ds:rounded-[var(--radius-md)]",
1856
- circle: "ds:rounded-[var(--radius-full)]"
1857
- };
1858
- function ue(t, e) {
1859
- if (!t || typeof t != "object") return;
1860
- const a = t[e];
1861
- return typeof a == "string" ? a : void 0;
1862
- }
1863
- const ya = /^(?:https?:|data:image\/)/i;
1864
- function Ta(t) {
1865
- if (!t) return;
1866
- const e = t.trim();
1867
- if (e.length !== 0)
1868
- return ya.test(e) ? e : void 0;
1869
- }
1870
- function Mn(t) {
1871
- const {
1872
- data: e,
1873
- srcField: a,
1874
- altField: n,
1875
- fallbackField: r,
1876
- size: l = "md",
1877
- shape: o = "rounded"
1878
- } = t;
1879
- if (!e) return null;
1880
- const f = ue(e, a), d = Ta(f), c = n ? ue(e, n) ?? "" : "", i = r ? ue(e, r) : void 0;
1881
- return d ? /* @__PURE__ */ s(
1882
- "img",
1883
- {
1884
- src: d,
1885
- alt: c,
1886
- loading: "lazy",
1887
- decoding: "async",
1888
- className: ["ds:object-cover", ha[l], va[o]].join(
1889
- " "
1890
- )
1891
- }
1892
- ) : i ? /* @__PURE__ */ s(Pe, { name: i, size: l }) : null;
1893
- }
1894
- function jn(t) {
1895
- const { value: e, maxVisible: a = 3 } = t, { t: n } = F();
1896
- if (!Array.isArray(e) || e.length === 0) return null;
1897
- const r = e.slice(0, a), l = e.length - a;
1898
- return /* @__PURE__ */ I("span", { className: "ds:inline-flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
1899
- r.map((o) => /* @__PURE__ */ s(J, { label: o, size: "sm" }, o)),
1900
- l > 0 && /* @__PURE__ */ s(Lt, { label: e.slice(a).join(", "), children: /* @__PURE__ */ s(
1901
- J,
1902
- {
1903
- label: n("inputs.multiSelect.overflow", { count: l }),
1904
- size: "sm",
1905
- variant: "neutral",
1906
- fill: "outline"
1907
- }
1908
- ) })
1909
- ] });
1910
- }
1911
- function Ca() {
1912
- return /* @__PURE__ */ s(
1913
- "svg",
1914
- {
1915
- viewBox: "0 0 24 24",
1916
- fill: "none",
1917
- stroke: "currentColor",
1918
- strokeWidth: 1.75,
1919
- strokeLinecap: "round",
1920
- strokeLinejoin: "round",
1921
- "aria-hidden": "true",
1922
- className: "ds:size-3.5",
1923
- children: /* @__PURE__ */ s("path", { d: "M12 5.5c-1.074 -1.426 -2.45 -2.2 -4 -2c-2.5 .323 -3.7 2.5 -3.5 5c.1 1.5 .5 3 .5 4.5c0 1.5 .5 3.5 1 5c.3 .9 .5 2 1.5 2s1.3 -1.5 1.5 -2.5c.2 -1 .5 -2 1.5 -2s1.3 1 1.5 2c.2 1 .5 2.5 1.5 2.5s1.2 -1.1 1.5 -2c.5 -1.5 1 -3.5 1 -5c0 -1.5 .4 -3 .5 -4.5c.2 -2.5 -1 -4.677 -3.5 -5c-1.55 -.2 -2.926 .574 -4 2z" })
1924
- }
1925
- );
1926
- }
1927
- function Ln(t) {
1928
- const { value: e, maxInlineSize: a = "8rem" } = t;
1929
- return !Array.isArray(e) || e.length === 0 ? null : /* @__PURE__ */ s(
1930
- J,
1931
- {
1932
- label: e.join(", "),
1933
- size: "sm",
1934
- fill: "outline",
1935
- leading: /* @__PURE__ */ s(Ca, {}),
1936
- maxInlineSize: a
1937
- }
1938
- );
1939
- }
1940
- const xa = {
1941
- date: { year: "numeric", month: "short", day: "numeric" },
1942
- time: { hour: "2-digit", minute: "2-digit" },
1943
- datetime: {
1944
- year: "numeric",
1945
- month: "short",
1946
- day: "numeric",
1947
- hour: "2-digit",
1948
- minute: "2-digit"
1949
- }
1950
- };
1951
- function qn(t) {
1952
- const { value: e, format: a = "date", options: n } = t;
1953
- return e == null || e === "" ? null : a === "relative" && !n ? /* @__PURE__ */ s(ve, { value: e, shape: "bare" }) : /* @__PURE__ */ s(
1954
- ve,
1955
- {
1956
- value: e,
1957
- format: "absolute",
1958
- shape: "bare",
1959
- absoluteFormat: n ?? xa[a === "relative" ? "date" : a]
1960
- }
1961
- );
1962
- }
1963
- function Na(t) {
1964
- if (t == null || t === "") return null;
1965
- const e = typeof t == "number" ? t : Number(t);
1966
- return Number.isFinite(e) ? e : null;
1967
- }
1968
- function $n(t) {
1969
- const {
1970
- value: e,
1971
- currency: a = "EUR",
1972
- colorNegative: n,
1973
- strikethrough: r,
1974
- options: l
1975
- } = t, { i18n: o } = F(), f = Na(e);
1976
- if (f === null) return null;
1977
- const d = o.language || "en", c = new Intl.NumberFormat(d, {
1978
- style: "currency",
1979
- currency: a,
1980
- ...l
1981
- }).format(f), i = ["ds:tabular-nums"];
1982
- return n && f < 0 && i.push("ds:text-[color:var(--destructive)]"), r && i.push("line-through"), /* @__PURE__ */ s("span", { className: i.join(" "), children: c });
1983
- }
1984
- function Ce(t) {
1985
- if (!Fe(t)) return t;
1986
- const e = t, a = e.props.className ?? "", n = /\bsize-|\bw-|\bh-/.test(a) ? a : `${a} size-4`.trim();
1987
- return Re(e, { className: n, size: e.props.size ?? 16 });
1988
- }
1989
- function fe(t, e) {
1990
- return typeof t == "function" ? t(e) : !!t;
1991
- }
1992
- const Sa = "ds:text-[color:var(--destructive)] ds:hover:text-[color:var(--destructive-hover)]";
1993
- function _n(t) {
1994
- const { data: e, actions: a, intent: n = "ghost", group: r, label: l, collapsed: o } = t, { t: f } = F();
1995
- if (!e) return null;
1996
- const d = a.filter((u) => !fe(u.hidden, e));
1997
- if (typeof o == "function" ? o() : !!o)
1998
- return /* @__PURE__ */ I(B.Root, { children: [
1999
- /* @__PURE__ */ s(B.Trigger, { asChild: !0, children: /* @__PURE__ */ s(
2000
- G,
2001
- {
2002
- size: "sm",
2003
- intent: n,
2004
- icon: /* @__PURE__ */ s($t, { "aria-hidden": !0 }),
2005
- "aria-label": l ?? f("dataTable.actions", "Actions")
2006
- }
2007
- ) }),
2008
- /* @__PURE__ */ s(B.Content, { align: "end", children: d.map((u, y) => /* @__PURE__ */ s(
2009
- B.Item,
2010
- {
2011
- startIcon: Ce(u.icon),
2012
- disabled: fe(u.disabled, e),
2013
- onSelect: () => u.onClick(e),
2014
- className: u.variant === "destructive" ? "ds:text-[color:var(--destructive)]" : void 0,
2015
- children: u.label
2016
- },
2017
- y
2018
- )) })
2019
- ] });
2020
- const i = d.map((u, y) => {
2021
- const b = fe(u.disabled, e), x = b && u.disabledReason ? u.disabledReason : u.label;
2022
- return /* @__PURE__ */ s(
2023
- G,
2024
- {
2025
- size: "sm",
2026
- intent: n,
2027
- icon: Ce(u.icon),
2028
- tooltip: x,
2029
- "aria-label": u.label,
2030
- disabled: b,
2031
- onClick: (T) => {
2032
- T.stopPropagation(), u.onClick(e);
2033
- },
2034
- className: u.variant === "destructive" ? Sa : void 0
2035
- },
2036
- y
2037
- );
2038
- });
2039
- return r ? /* @__PURE__ */ s(
2040
- qt,
2041
- {
2042
- "aria-label": l ?? f("dataTable.actions", "Actions"),
2043
- size: "sm",
2044
- children: i
2045
- }
2046
- ) : /* @__PURE__ */ s("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: i });
2047
- }
2048
- function xe(t, e) {
2049
- return typeof t == "function" ? t(e) : t;
2050
- }
2051
- function wa(t) {
2052
- return /^(https?:\/\/|\/|#|mailto:|tel:)/i.test(t) ? t : "#";
2053
- }
2054
- function Bn(t) {
2055
- const { value: e, data: a, href: n, onClick: r, secondary: l } = t;
2056
- if (!a) return null;
2057
- const o = xe(n, a), f = xe(l, a), d = e == null || e === "" ? "" : String(e), c = [
2058
- "ds:text-[color:var(--primary)]",
2059
- "ds:hover:underline",
2060
- "ds:focus-visible:outline-[length:var(--focus-ring-width)]",
2061
- "ds:focus-visible:outline-solid",
2062
- "ds:focus-visible:outline-[color:var(--ring)]",
2063
- "ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
2064
- "ds:rounded-[var(--radius-sm)]"
2065
- ].join(" "), i = (u) => {
2066
- r && (o || u.preventDefault(), u.stopPropagation(), r(a));
2067
- };
2068
- return /* @__PURE__ */ I("span", { className: "ds:flex ds:flex-col ds:leading-tight", children: [
2069
- o ? /* @__PURE__ */ s(
2070
- "a",
2071
- {
2072
- href: wa(o),
2073
- onClick: i,
2074
- className: c,
2075
- children: d
2076
- }
2077
- ) : /* @__PURE__ */ s(
2078
- "button",
2079
- {
2080
- type: "button",
2081
- onClick: i,
2082
- className: [
2083
- "ds:appearance-none ds:bg-transparent ds:p-0 ds:text-start",
2084
- c
2085
- ].join(" "),
2086
- children: d
2087
- }
2088
- ),
2089
- f ? /* @__PURE__ */ s("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: f }) : null
2090
- ] });
2091
- }
2092
- function Gn(t) {
2093
- const {
2094
- value: e,
2095
- data: a,
2096
- onToggle: n,
2097
- onError: r,
2098
- trueIcon: l,
2099
- falseIcon: o,
2100
- trueClass: f = "ds:text-[color:var(--success)]",
2101
- falseClass: d = "ds:text-[color:var(--muted-foreground)]",
2102
- label: c
2103
- } = t, { t: i } = F(), [u, y] = D(!1);
2104
- if (!a) return null;
2105
- const b = !!e, x = b ? l ?? /* @__PURE__ */ s(_t, { "aria-hidden": !0, className: "ds:size-4" }) : o ?? /* @__PURE__ */ s(Bt, { "aria-hidden": !0, className: "ds:size-4" }), T = b ? f : d, h = c ?? i(b ? "inputs.switch.on" : "inputs.switch.off");
2106
- async function p(g) {
2107
- if (g.stopPropagation(), u || !a) return;
2108
- const v = n(a, !b);
2109
- if (v && typeof v.then == "function") {
2110
- y(!0);
2111
- try {
2112
- await v;
2113
- } catch (S) {
2114
- r == null || r(a, S);
2115
- } finally {
2116
- y(!1);
2117
- }
2118
- }
2119
- }
2120
- return /* @__PURE__ */ s(
2121
- "button",
2122
- {
2123
- type: "button",
2124
- role: "switch",
2125
- "aria-checked": b,
2126
- "aria-busy": u,
2127
- "aria-label": h,
2128
- disabled: u,
2129
- onClick: p,
2130
- className: [
2131
- "ds:inline-flex ds:items-center ds:justify-center",
2132
- "ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]",
2133
- "ds:appearance-none ds:bg-transparent ds:p-[var(--spacing-xs)]",
2134
- "ds:rounded-[var(--radius-sm)]",
2135
- "ds:focus-visible:outline-[length:var(--focus-ring-width)]",
2136
- "ds:focus-visible:outline-solid",
2137
- "ds:focus-visible:outline-[color:var(--ring)]",
2138
- "ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
2139
- "ds:disabled:opacity-50",
2140
- T
2141
- ].join(" "),
2142
- children: x
2143
- }
2144
- );
2145
- }
2146
- const Fa = {
2147
- sm: "ds:size-[var(--icon-size-sm)]",
2148
- md: "ds:size-[var(--icon-size-md)]",
2149
- lg: "ds:size-[var(--icon-size-lg)]"
2150
- };
2151
- function Ne(t, e) {
2152
- if (!t || typeof t != "object") return;
2153
- const a = t[e];
2154
- return typeof a == "string" ? a : void 0;
2155
- }
2156
- const Ra = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i, Da = /^rgba?\(\s*[\d.\s,%/]+\)$/i, ka = /^hsla?\(\s*[\d.\s,%/]+\)$/i, Ia = /^var\(--[a-z0-9-]+(?:,\s*[^)]+)?\)$/i;
2157
- function Ea(t) {
2158
- if (!t) return;
2159
- const e = t.trim();
2160
- if (Ra.test(e) || Da.test(e) || ka.test(e) || Ia.test(e))
2161
- return e;
2162
- }
2163
- function Vn(t) {
2164
- const { data: e, colorField: a, size: n = "md", labelField: r } = t, l = Z(null), o = e ? Ne(e, a) : void 0, f = Ea(o), d = e && r ? Ne(e, r) : void 0;
2165
- return Gt(() => {
2166
- const c = l.current;
2167
- c && (f ? c.style.setProperty("--data-table-dot-color", f) : c.style.removeProperty("--data-table-dot-color"));
2168
- }, [f]), f ? /* @__PURE__ */ I("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
2169
- /* @__PURE__ */ s(
2170
- "span",
2171
- {
2172
- ref: l,
2173
- "aria-hidden": "true",
2174
- className: [
2175
- "ds:inline-block ds:shrink-0 ds:rounded-[var(--radius-full)]",
2176
- "ds:bg-[var(--data-table-dot-color)]",
2177
- "ds:border ds:border-[color:var(--border)]",
2178
- Fa[n]
2179
- ].join(" ")
2180
- }
2181
- ),
2182
- d ? /* @__PURE__ */ s("span", { children: d }) : null
2183
- ] }) : null;
2184
- }
2185
- function za(t, e) {
2186
- if (!t || typeof t != "object") return null;
2187
- const a = t[e], n = typeof a == "number" ? a : Number(a);
2188
- return Number.isFinite(n) ? n : null;
2189
- }
2190
- function Un(t) {
2191
- const { data: e, lines: a, currency: n = "EUR", highlightNegative: r } = t, { i18n: l } = F();
2192
- if (!e) return null;
2193
- const o = l.language || "en", f = (c) => {
2194
- const i = za(e, c.valueField);
2195
- if (i === null) return null;
2196
- let u;
2197
- switch (c.format ?? "number") {
2198
- case "currency":
2199
- u = new Intl.NumberFormat(o, {
2200
- style: "currency",
2201
- currency: n
2202
- }).format(i);
2203
- break;
2204
- case "percent":
2205
- u = new Intl.NumberFormat(o, {
2206
- style: "percent",
2207
- maximumFractionDigits: 1
2208
- }).format(i / 100);
2209
- break;
2210
- default:
2211
- u = new Intl.NumberFormat(o).format(i);
2212
- }
2213
- return {
2214
- label: c.label,
2215
- formatted: u,
2216
- negative: !!r && i < 0
2217
- };
2218
- }, d = a.map(f).filter(
2219
- (c) => c !== null
2220
- );
2221
- return d.length === 0 ? null : /* @__PURE__ */ s(
2222
- "div",
2223
- {
2224
- className: [
2225
- "ds:flex",
2226
- "ds:flex-wrap",
2227
- "ds:items-center",
2228
- "ds:gap-x-[var(--spacing-sm)]",
2229
- "ds:gap-y-0",
2230
- "type-meta",
2231
- "ds:leading-tight"
2232
- ].join(" "),
2233
- children: d.map((c, i) => /* @__PURE__ */ I(
2234
- "span",
2235
- {
2236
- className: "ds:inline-flex ds:items-baseline ds:gap-x-[var(--spacing-xs)]",
2237
- children: [
2238
- i > 0 ? /* @__PURE__ */ s(
2239
- "span",
2240
- {
2241
- "aria-hidden": "true",
2242
- className: "ds:me-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]",
2243
- children: "·"
2244
- }
2245
- ) : null,
2246
- /* @__PURE__ */ s("span", { className: "ds:text-[color:var(--muted-foreground)]", children: c.label }),
2247
- /* @__PURE__ */ s(
2248
- "span",
2249
- {
2250
- className: [
2251
- "ds:tabular-nums",
2252
- "ds:font-medium",
2253
- c.negative ? "ds:text-[color:var(--destructive)]" : ""
2254
- ].filter(Boolean).join(" "),
2255
- children: c.formatted
2256
- }
2257
- )
2258
- ]
2259
- },
2260
- `${c.label}-${i}`
2261
- ))
2262
- }
2263
- );
2264
- }
2265
- function Kn(t) {
2266
- var c, i;
2267
- const { initialValue: e, onValueChange: a, stopEditing: n, column: r } = t, [l, o] = D(e ?? ""), f = Z(null);
2268
- P(() => {
2269
- const u = f.current;
2270
- u && (u.focus(), u.select());
2271
- }, []);
2272
- const d = ((i = (c = r == null ? void 0 : r.getColDef) == null ? void 0 : c.call(r)) == null ? void 0 : i.headerName) ?? void 0;
2273
- return /* @__PURE__ */ s(
2274
- "input",
2275
- {
2276
- ref: f,
2277
- type: "text",
2278
- value: l,
2279
- "aria-label": d,
2280
- onChange: (u) => {
2281
- const y = u.target.value;
2282
- o(y), a(y);
2283
- },
2284
- onKeyDown: (u) => {
2285
- u.key === "Enter" && (u.preventDefault(), n());
2286
- },
2287
- className: [
2288
- "ds:block ds:w-full ds:appearance-none",
2289
- // Input surface chrome: rounded border + bg + focus halo.
2290
- Oe,
2291
- // Use the `md` height (`--min-target-size`) so the input
2292
- // auto-lifts to 48px under `.theme-accessible` to satisfy
2293
- // WCAG 2.5.5 target size.
2294
- Me.md,
2295
- je.sm,
2296
- Le.sm
2297
- ].join(" ")
2298
- }
2299
- );
2300
- }
2301
- function Wn(t) {
2302
- var T, h;
2303
- const {
2304
- initialValue: e,
2305
- onValueChange: a,
2306
- stopEditing: n,
2307
- column: r,
2308
- decimals: l = 2,
2309
- min: o,
2310
- max: f
2311
- } = t, { i18n: d } = F(), c = Z(null), i = ((h = (T = r == null ? void 0 : r.getColDef) == null ? void 0 : T.call(r)) == null ? void 0 : h.headerName) ?? void 0, [u, y] = D(() => e == null || Number.isNaN(e) ? "" : String(e));
2312
- P(() => {
2313
- const p = c.current;
2314
- p && (p.focus(), p.select());
2315
- }, []);
2316
- function b(p) {
2317
- var q, R;
2318
- if (p.trim().length === 0) return null;
2319
- const g = d.language || "en", m = new Intl.NumberFormat(g).formatToParts(12345.6), v = ((q = m.find((V) => V.type === "group")) == null ? void 0 : q.value) ?? "", S = ((R = m.find((V) => V.type === "decimal")) == null ? void 0 : R.value) ?? ".", E = p.replace(new RegExp(`\\${v}`, "g"), "").replace(S, ".").replace(/[^\d.-]/g, ""), k = Number(E);
2320
- return Number.isFinite(k) ? k : null;
2321
- }
2322
- function x(p) {
2323
- const g = b(p);
2324
- if (g == null) {
2325
- a(null);
2326
- return;
2327
- }
2328
- let m = g;
2329
- typeof o == "number" && (m = Math.max(o, m)), typeof f == "number" && (m = Math.min(f, m));
2330
- const v = 10 ** l;
2331
- a(Math.round(m * v) / v);
2332
- }
2333
- return /* @__PURE__ */ s(
2334
- "input",
2335
- {
2336
- ref: c,
2337
- type: "text",
2338
- inputMode: "decimal",
2339
- value: u,
2340
- "aria-label": i,
2341
- onChange: (p) => {
2342
- const g = p.target.value;
2343
- y(g), x(g);
2344
- },
2345
- onKeyDown: (p) => {
2346
- p.key === "Enter" && (p.preventDefault(), n());
2347
- },
2348
- className: [
2349
- "ds:block ds:w-full ds:appearance-none ds:text-end ds:tabular-nums",
2350
- Oe,
2351
- // Use `md` height — see editable-text-cell-renderer for rationale.
2352
- Me.md,
2353
- je.sm,
2354
- Le.sm
2355
- ].join(" ")
2356
- }
2357
- );
2358
- }
2359
- export {
2360
- _n as A,
2361
- Un as B,
2362
- Vn as C,
2363
- Sn as D,
2364
- Wn as E,
2365
- Mn as I,
2366
- Bn as L,
2367
- zn as N,
2368
- Dn as S,
2369
- jn as T,
2370
- On as U,
2371
- $n as a,
2372
- qn as b,
2373
- Fn as c,
2374
- Rn as d,
2375
- Kn as e,
2376
- An as f,
2377
- kn as g,
2378
- Pn as h,
2379
- ra as i,
2380
- sa as j,
2381
- Gn as k,
2382
- ae as l,
2383
- Ut as m,
2384
- Ln as n,
2385
- In as o,
2386
- En as p,
2387
- la as q,
2388
- Ve as r,
2389
- wn as u
2390
- };
2391
- //# sourceMappingURL=editable-currency-cell-renderer-D1ewvJKO.js.map