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