@economic/taco 0.0.17-alpha.0 → 0.0.20-alpha.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 (378) hide show
  1. package/README.md +84 -84
  2. package/dist/components/Dialog/components/Drawer.d.ts +2 -1
  3. package/dist/components/Dialog/components/Extra.d.ts +2 -1
  4. package/dist/components/Hanger/Hanger.d.ts +7 -3
  5. package/dist/esm/components/Accordion/Accordion.js +3 -3
  6. package/dist/esm/components/Accordion/Accordion.js.map +1 -1
  7. package/dist/esm/components/Backdrop/Backdrop.js +1 -1
  8. package/dist/esm/components/Backdrop/Backdrop.js.map +1 -1
  9. package/dist/esm/components/Badge/Badge.js.map +1 -1
  10. package/dist/esm/components/Banner/Banner.js.map +1 -1
  11. package/dist/esm/components/Banner/util.js +1 -1
  12. package/dist/esm/components/Banner/util.js.map +1 -1
  13. package/dist/esm/components/Button/Button.js.map +1 -1
  14. package/dist/esm/components/Button/util.js +18 -23
  15. package/dist/esm/components/Button/util.js.map +1 -1
  16. package/dist/esm/components/Calendar/Calendar.js.map +1 -1
  17. package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
  18. package/dist/esm/components/Combobox/Combobox.js +1 -1
  19. package/dist/esm/components/Combobox/Combobox.js.map +1 -1
  20. package/dist/esm/components/Combobox/useCombobox.js +64 -84
  21. package/dist/esm/components/Combobox/useCombobox.js.map +1 -1
  22. package/dist/esm/components/Datepicker/Datepicker.js.map +1 -1
  23. package/dist/esm/components/Datepicker/useDatepicker.js +27 -34
  24. package/dist/esm/components/Datepicker/useDatepicker.js.map +1 -1
  25. package/dist/esm/components/Dialog/Context.js +3 -3
  26. package/dist/esm/components/Dialog/Context.js.map +1 -1
  27. package/dist/esm/components/Dialog/Dialog.js +4 -4
  28. package/dist/esm/components/Dialog/Dialog.js.map +1 -1
  29. package/dist/esm/components/Dialog/components/Content.js +39 -44
  30. package/dist/esm/components/Dialog/components/Content.js.map +1 -1
  31. package/dist/esm/components/Dialog/components/Drawer.js +4 -3
  32. package/dist/esm/components/Dialog/components/Drawer.js.map +1 -1
  33. package/dist/esm/components/Dialog/components/Extra.js +3 -2
  34. package/dist/esm/components/Dialog/components/Extra.js.map +1 -1
  35. package/dist/esm/components/Dialog/components/Trigger.js +2 -2
  36. package/dist/esm/components/Dialog/components/Trigger.js.map +1 -1
  37. package/dist/esm/components/Field/Field.js.map +1 -1
  38. package/dist/esm/components/Form/Form.js.map +1 -1
  39. package/dist/esm/components/Group/Group.js.map +1 -1
  40. package/dist/esm/components/Hanger/Hanger.js +10 -6
  41. package/dist/esm/components/Hanger/Hanger.js.map +1 -1
  42. package/dist/esm/components/Icon/Icon.js.map +1 -1
  43. package/dist/esm/components/Icon/components/AccountPreview.js.map +1 -1
  44. package/dist/esm/components/Icon/components/Accounting.js.map +1 -1
  45. package/dist/esm/components/Icon/components/AccountingYear.js.map +1 -1
  46. package/dist/esm/components/Icon/components/AccountingYearCancel.js.map +1 -1
  47. package/dist/esm/components/Icon/components/ArrowBottom.js.map +1 -1
  48. package/dist/esm/components/Icon/components/ArrowDown.js.map +1 -1
  49. package/dist/esm/components/Icon/components/ArrowEnd.js.map +1 -1
  50. package/dist/esm/components/Icon/components/ArrowLeft.js.map +1 -1
  51. package/dist/esm/components/Icon/components/ArrowRight.js.map +1 -1
  52. package/dist/esm/components/Icon/components/ArrowStart.js.map +1 -1
  53. package/dist/esm/components/Icon/components/ArrowTop.js.map +1 -1
  54. package/dist/esm/components/Icon/components/ArrowUp.js.map +1 -1
  55. package/dist/esm/components/Icon/components/Attach.js.map +1 -1
  56. package/dist/esm/components/Icon/components/AttachAuto.js.map +1 -1
  57. package/dist/esm/components/Icon/components/AttachCancel.js.map +1 -1
  58. package/dist/esm/components/Icon/components/Autotext.js.map +1 -1
  59. package/dist/esm/components/Icon/components/AutotextInsert.js.map +1 -1
  60. package/dist/esm/components/Icon/components/Basic.js.map +1 -1
  61. package/dist/esm/components/Icon/components/BasicTabs.js.map +1 -1
  62. package/dist/esm/components/Icon/components/BellSolid.js.map +1 -1
  63. package/dist/esm/components/Icon/components/Book.js.map +1 -1
  64. package/dist/esm/components/Icon/components/Booking.js.map +1 -1
  65. package/dist/esm/components/Icon/components/Budget.js.map +1 -1
  66. package/dist/esm/components/Icon/components/Calendar.js.map +1 -1
  67. package/dist/esm/components/Icon/components/CashAccount.js.map +1 -1
  68. package/dist/esm/components/Icon/components/CashReports.js.map +1 -1
  69. package/dist/esm/components/Icon/components/Chat.js.map +1 -1
  70. package/dist/esm/components/Icon/components/ChatSolid.js.map +1 -1
  71. package/dist/esm/components/Icon/components/ChevronDown.js.map +1 -1
  72. package/dist/esm/components/Icon/components/ChevronDownDouble.js.map +1 -1
  73. package/dist/esm/components/Icon/components/ChevronDownSolid.js.map +1 -1
  74. package/dist/esm/components/Icon/components/ChevronLeft.js.map +1 -1
  75. package/dist/esm/components/Icon/components/ChevronLeftDouble.js.map +1 -1
  76. package/dist/esm/components/Icon/components/ChevronRight.js.map +1 -1
  77. package/dist/esm/components/Icon/components/ChevronRightDouble.js.map +1 -1
  78. package/dist/esm/components/Icon/components/ChevronUp.js.map +1 -1
  79. package/dist/esm/components/Icon/components/ChevronUpDouble.js.map +1 -1
  80. package/dist/esm/components/Icon/components/ChevronUpSolid.js.map +1 -1
  81. package/dist/esm/components/Icon/components/Clamp.js.map +1 -1
  82. package/dist/esm/components/Icon/components/ClampOpen.js.map +1 -1
  83. package/dist/esm/components/Icon/components/Close.js.map +1 -1
  84. package/dist/esm/components/Icon/components/ConnectionEnable.js.map +1 -1
  85. package/dist/esm/components/Icon/components/ConnectionRevoke.js.map +1 -1
  86. package/dist/esm/components/Icon/components/Contacts.js.map +1 -1
  87. package/dist/esm/components/Icon/components/Copy.js.map +1 -1
  88. package/dist/esm/components/Icon/components/Courses.js.map +1 -1
  89. package/dist/esm/components/Icon/components/Credit.js.map +1 -1
  90. package/dist/esm/components/Icon/components/Delete.js.map +1 -1
  91. package/dist/esm/components/Icon/components/DeletePermanently.js.map +1 -1
  92. package/dist/esm/components/Icon/components/Depecriate.js.map +1 -1
  93. package/dist/esm/components/Icon/components/Developer.js.map +1 -1
  94. package/dist/esm/components/Icon/components/DistributionTemplate.js.map +1 -1
  95. package/dist/esm/components/Icon/components/Document.js.map +1 -1
  96. package/dist/esm/components/Icon/components/DocumentApprove.js.map +1 -1
  97. package/dist/esm/components/Icon/components/DocumentCreateEntry.js.map +1 -1
  98. package/dist/esm/components/Icon/components/DocumentCut.js.map +1 -1
  99. package/dist/esm/components/Icon/components/DocumentError.js.map +1 -1
  100. package/dist/esm/components/Icon/components/DocumentIsolatePage.js.map +1 -1
  101. package/dist/esm/components/Icon/components/DocumentMerge.js.map +1 -1
  102. package/dist/esm/components/Icon/components/DocumentMove.js.map +1 -1
  103. package/dist/esm/components/Icon/components/DocumentPreview.js.map +1 -1
  104. package/dist/esm/components/Icon/components/DocumentReceived.js.map +1 -1
  105. package/dist/esm/components/Icon/components/DocumentRejectedRequest.js.map +1 -1
  106. package/dist/esm/components/Icon/components/DocumentSplit.js.map +1 -1
  107. package/dist/esm/components/Icon/components/DocumentTime.js.map +1 -1
  108. package/dist/esm/components/Icon/components/Download.js.map +1 -1
  109. package/dist/esm/components/Icon/components/Drag.js.map +1 -1
  110. package/dist/esm/components/Icon/components/ECopedia.js.map +1 -1
  111. package/dist/esm/components/Icon/components/ESignature.js.map +1 -1
  112. package/dist/esm/components/Icon/components/Edit.js.map +1 -1
  113. package/dist/esm/components/Icon/components/EllipsisHorizontal.js.map +1 -1
  114. package/dist/esm/components/Icon/components/EllipsisVertical.js.map +1 -1
  115. package/dist/esm/components/Icon/components/EntriesOnAccount.js.map +1 -1
  116. package/dist/esm/components/Icon/components/EntriesOpen.js.map +1 -1
  117. package/dist/esm/components/Icon/components/EntriesWarning.js.map +1 -1
  118. package/dist/esm/components/Icon/components/EntryTypeCustomerInvoice.js.map +1 -1
  119. package/dist/esm/components/Icon/components/EntryTypeCustomerPayment.js.map +1 -1
  120. package/dist/esm/components/Icon/components/EntryTypeJournalEntry.js.map +1 -1
  121. package/dist/esm/components/Icon/components/EntryTypeManualCustomerInvoice.js.map +1 -1
  122. package/dist/esm/components/Icon/components/EntryTypeSupplierInvoice.js.map +1 -1
  123. package/dist/esm/components/Icon/components/EntryTypeSupplierPayment.js.map +1 -1
  124. package/dist/esm/components/Icon/components/Envelope.js.map +1 -1
  125. package/dist/esm/components/Icon/components/EnvelopeApproved.js.map +1 -1
  126. package/dist/esm/components/Icon/components/ExpandView.js.map +1 -1
  127. package/dist/esm/components/Icon/components/Expenses.js.map +1 -1
  128. package/dist/esm/components/Icon/components/Export.js.map +1 -1
  129. package/dist/esm/components/Icon/components/ExportToExcel.js.map +1 -1
  130. package/dist/esm/components/Icon/components/ExportToExcelCopy.js.map +1 -1
  131. package/dist/esm/components/Icon/components/Filter.js.map +1 -1
  132. package/dist/esm/components/Icon/components/FilterSolid.js.map +1 -1
  133. package/dist/esm/components/Icon/components/GraphSolid.js.map +1 -1
  134. package/dist/esm/components/Icon/components/Hash.js.map +1 -1
  135. package/dist/esm/components/Icon/components/Home.js.map +1 -1
  136. package/dist/esm/components/Icon/components/Images.js.map +1 -1
  137. package/dist/esm/components/Icon/components/Import.js.map +1 -1
  138. package/dist/esm/components/Icon/components/Inbox.js.map +1 -1
  139. package/dist/esm/components/Icon/components/InboxSmart.js.map +1 -1
  140. package/dist/esm/components/Icon/components/Info.js.map +1 -1
  141. package/dist/esm/components/Icon/components/Inventory.js.map +1 -1
  142. package/dist/esm/components/Icon/components/InventoryMatrix.js.map +1 -1
  143. package/dist/esm/components/Icon/components/JournalPro.js.map +1 -1
  144. package/dist/esm/components/Icon/components/Layout.js.map +1 -1
  145. package/dist/esm/components/Icon/components/LayoutBoth.js.map +1 -1
  146. package/dist/esm/components/Icon/components/LayoutFirst.js.map +1 -1
  147. package/dist/esm/components/Icon/components/LayoutLast.js.map +1 -1
  148. package/dist/esm/components/Icon/components/LayoutNone.js.map +1 -1
  149. package/dist/esm/components/Icon/components/LedgerCard.js.map +1 -1
  150. package/dist/esm/components/Icon/components/LedgerCardCustomerReminder.js.map +1 -1
  151. package/dist/esm/components/Icon/components/LedgerCardManualCustomerInvoice.js.map +1 -1
  152. package/dist/esm/components/Icon/components/LedgerCardObsoleteStock.js.map +1 -1
  153. package/dist/esm/components/Icon/components/LedgerCardOpeningEntry.js.map +1 -1
  154. package/dist/esm/components/Icon/components/LedgerCardReservedEntry.js.map +1 -1
  155. package/dist/esm/components/Icon/components/LedgerCardShrinkagePilferage.js.map +1 -1
  156. package/dist/esm/components/Icon/components/LedgerCardStockAdjustment.js.map +1 -1
  157. package/dist/esm/components/Icon/components/LedgerCardTransferredOpeningEntry.js.map +1 -1
  158. package/dist/esm/components/Icon/components/Lightbulb.js.map +1 -1
  159. package/dist/esm/components/Icon/components/Line.js.map +1 -1
  160. package/dist/esm/components/Icon/components/List.js.map +1 -1
  161. package/dist/esm/components/Icon/components/ListBulleted.js.map +1 -1
  162. package/dist/esm/components/Icon/components/ListSearch.js.map +1 -1
  163. package/dist/esm/components/Icon/components/LockOpen.js.map +1 -1
  164. package/dist/esm/components/Icon/components/Log.js.map +1 -1
  165. package/dist/esm/components/Icon/components/Market.js.map +1 -1
  166. package/dist/esm/components/Icon/components/MatchAmount.js.map +1 -1
  167. package/dist/esm/components/Icon/components/MatchEntries.js.map +1 -1
  168. package/dist/esm/components/Icon/components/Mileage.js.map +1 -1
  169. package/dist/esm/components/Icon/components/Minus.js.map +1 -1
  170. package/dist/esm/components/Icon/components/ModalResize.js.map +1 -1
  171. package/dist/esm/components/Icon/components/ModalShrink.js.map +1 -1
  172. package/dist/esm/components/Icon/components/More.js.map +1 -1
  173. package/dist/esm/components/Icon/components/MoreSolid.js.map +1 -1
  174. package/dist/esm/components/Icon/components/Move.js.map +1 -1
  175. package/dist/esm/components/Icon/components/NavigationList.js.map +1 -1
  176. package/dist/esm/components/Icon/components/Note.js.map +1 -1
  177. package/dist/esm/components/Icon/components/NoteFollowUp.js.map +1 -1
  178. package/dist/esm/components/Icon/components/NoteRead.js.map +1 -1
  179. package/dist/esm/components/Icon/components/PartnerApi.js.map +1 -1
  180. package/dist/esm/components/Icon/components/Period.js.map +1 -1
  181. package/dist/esm/components/Icon/components/PersonChange.js.map +1 -1
  182. package/dist/esm/components/Icon/components/PersonMinus.js.map +1 -1
  183. package/dist/esm/components/Icon/components/PersonPlus.js.map +1 -1
  184. package/dist/esm/components/Icon/components/PersonTick.js.map +1 -1
  185. package/dist/esm/components/Icon/components/Play.js.map +1 -1
  186. package/dist/esm/components/Icon/components/PlusCircle.js.map +1 -1
  187. package/dist/esm/components/Icon/components/PlusMinus.js.map +1 -1
  188. package/dist/esm/components/Icon/components/Print.js.map +1 -1
  189. package/dist/esm/components/Icon/components/ProcessPayment.js.map +1 -1
  190. package/dist/esm/components/Icon/components/ProductLedgerCard.js.map +1 -1
  191. package/dist/esm/components/Icon/components/ProjectCards.js.map +1 -1
  192. package/dist/esm/components/Icon/components/Projects.js.map +1 -1
  193. package/dist/esm/components/Icon/components/Quicklinks.js.map +1 -1
  194. package/dist/esm/components/Icon/components/RatingBankruptcy.js.map +1 -1
  195. package/dist/esm/components/Icon/components/RatingPaymentProblems.js.map +1 -1
  196. package/dist/esm/components/Icon/components/Reconciled.js.map +1 -1
  197. package/dist/esm/components/Icon/components/Refresh.js.map +1 -1
  198. package/dist/esm/components/Icon/components/Report.js.map +1 -1
  199. package/dist/esm/components/Icon/components/ReportSolid.js.map +1 -1
  200. package/dist/esm/components/Icon/components/Restore.js.map +1 -1
  201. package/dist/esm/components/Icon/components/RotateLeft.js.map +1 -1
  202. package/dist/esm/components/Icon/components/RotateRight.js.map +1 -1
  203. package/dist/esm/components/Icon/components/Sales.js.map +1 -1
  204. package/dist/esm/components/Icon/components/Search.js.map +1 -1
  205. package/dist/esm/components/Icon/components/SearchBold.js.map +1 -1
  206. package/dist/esm/components/Icon/components/Secure.js.map +1 -1
  207. package/dist/esm/components/Icon/components/SecureTick.js.map +1 -1
  208. package/dist/esm/components/Icon/components/Settings.js.map +1 -1
  209. package/dist/esm/components/Icon/components/SettingsSolid.js.map +1 -1
  210. package/dist/esm/components/Icon/components/Shortcuts.js.map +1 -1
  211. package/dist/esm/components/Icon/components/ShowAll.js.map +1 -1
  212. package/dist/esm/components/Icon/components/ShowLess.js.map +1 -1
  213. package/dist/esm/components/Icon/components/ShowMore.js.map +1 -1
  214. package/dist/esm/components/Icon/components/ShowTemplate.js.map +1 -1
  215. package/dist/esm/components/Icon/components/Sliders.js.map +1 -1
  216. package/dist/esm/components/Icon/components/Smartpay.js.map +1 -1
  217. package/dist/esm/components/Icon/components/SortBy.js.map +1 -1
  218. package/dist/esm/components/Icon/components/Spinner.js.map +1 -1
  219. package/dist/esm/components/Icon/components/Star.js.map +1 -1
  220. package/dist/esm/components/Icon/components/StarSolid.js.map +1 -1
  221. package/dist/esm/components/Icon/components/Subscriptions.js.map +1 -1
  222. package/dist/esm/components/Icon/components/SystemEntries.js.map +1 -1
  223. package/dist/esm/components/Icon/components/Tag.js.map +1 -1
  224. package/dist/esm/components/Icon/components/TemplateOverride.js.map +1 -1
  225. package/dist/esm/components/Icon/components/Templates.js.map +1 -1
  226. package/dist/esm/components/Icon/components/Thumb.js.map +1 -1
  227. package/dist/esm/components/Icon/components/ThumbBoth.js.map +1 -1
  228. package/dist/esm/components/Icon/components/ThumbDown.js.map +1 -1
  229. package/dist/esm/components/Icon/components/ThumbDownSolid.js.map +1 -1
  230. package/dist/esm/components/Icon/components/ThumbUpSolid.js.map +1 -1
  231. package/dist/esm/components/Icon/components/Tick.js.map +1 -1
  232. package/dist/esm/components/Icon/components/TickCircle.js.map +1 -1
  233. package/dist/esm/components/Icon/components/Time.js.map +1 -1
  234. package/dist/esm/components/Icon/components/Transfer.js.map +1 -1
  235. package/dist/esm/components/Icon/components/TransferCancel.js.map +1 -1
  236. package/dist/esm/components/Icon/components/TransferLocked.js.map +1 -1
  237. package/dist/esm/components/Icon/components/Undock.js.map +1 -1
  238. package/dist/esm/components/Icon/components/Unreconciled.js.map +1 -1
  239. package/dist/esm/components/Icon/components/Warning.js.map +1 -1
  240. package/dist/esm/components/Icon/components/Webshop.js.map +1 -1
  241. package/dist/esm/components/Icon/components/Website.js.map +1 -1
  242. package/dist/esm/components/Icon/components/Workflow.js.map +1 -1
  243. package/dist/esm/components/Icon/components/Zoom.js.map +1 -1
  244. package/dist/esm/components/Icon/components/index.js +4 -4
  245. package/dist/esm/components/Icon/components/index.js.map +1 -1
  246. package/dist/esm/components/IconButton/IconButton.js.map +1 -1
  247. package/dist/esm/components/Input/Input.js.map +1 -1
  248. package/dist/esm/components/Input/util.js +9 -8
  249. package/dist/esm/components/Input/util.js.map +1 -1
  250. package/dist/esm/components/Listbox/Listbox.js.map +1 -1
  251. package/dist/esm/components/Listbox/ScrollableList.js +63 -82
  252. package/dist/esm/components/Listbox/ScrollableList.js.map +1 -1
  253. package/dist/esm/components/Listbox/useListbox.js +49 -58
  254. package/dist/esm/components/Listbox/useListbox.js.map +1 -1
  255. package/dist/esm/components/Listbox/useMultiListbox.js +63 -91
  256. package/dist/esm/components/Listbox/useMultiListbox.js.map +1 -1
  257. package/dist/esm/components/Listbox/useTypeahead.js +10 -9
  258. package/dist/esm/components/Listbox/useTypeahead.js.map +1 -1
  259. package/dist/esm/components/Listbox/util.js +48 -84
  260. package/dist/esm/components/Listbox/util.js.map +1 -1
  261. package/dist/esm/components/Menu/Context.js +2 -2
  262. package/dist/esm/components/Menu/Context.js.map +1 -1
  263. package/dist/esm/components/Menu/Menu.js +1 -0
  264. package/dist/esm/components/Menu/Menu.js.map +1 -1
  265. package/dist/esm/components/Menu/components/Checkbox.js +8 -9
  266. package/dist/esm/components/Menu/components/Checkbox.js.map +1 -1
  267. package/dist/esm/components/Menu/components/Content.js +10 -13
  268. package/dist/esm/components/Menu/components/Content.js.map +1 -1
  269. package/dist/esm/components/Menu/components/Header.js +4 -4
  270. package/dist/esm/components/Menu/components/Header.js.map +1 -1
  271. package/dist/esm/components/Menu/components/Item.js +34 -35
  272. package/dist/esm/components/Menu/components/Item.js.map +1 -1
  273. package/dist/esm/components/Menu/components/Link.js +10 -11
  274. package/dist/esm/components/Menu/components/Link.js.map +1 -1
  275. package/dist/esm/components/Menu/components/RadioGroup.js +16 -18
  276. package/dist/esm/components/Menu/components/RadioGroup.js.map +1 -1
  277. package/dist/esm/components/Menu/components/Separator.js +4 -4
  278. package/dist/esm/components/Menu/components/Separator.js.map +1 -1
  279. package/dist/esm/components/Menu/components/Trigger.js +5 -5
  280. package/dist/esm/components/Menu/components/Trigger.js.map +1 -1
  281. package/dist/esm/components/Navigation/Navigation.js.map +1 -1
  282. package/dist/esm/components/Pagination/PageNumbers.js +23 -28
  283. package/dist/esm/components/Pagination/PageNumbers.js.map +1 -1
  284. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  285. package/dist/esm/components/Pagination/usePagination.js +7 -21
  286. package/dist/esm/components/Pagination/usePagination.js.map +1 -1
  287. package/dist/esm/components/Pagination/usePaginationShortcuts.js +9 -9
  288. package/dist/esm/components/Pagination/usePaginationShortcuts.js.map +1 -1
  289. package/dist/esm/components/Popover/Popover.js +4 -4
  290. package/dist/esm/components/Popover/Popover.js.map +1 -1
  291. package/dist/esm/components/Popover/Primitives.js +7 -11
  292. package/dist/esm/components/Popover/Primitives.js.map +1 -1
  293. package/dist/esm/components/Progress/Progress.js.map +1 -1
  294. package/dist/esm/components/Provider/Provider.js.map +1 -1
  295. package/dist/esm/components/RadioGroup/RadioGroup.js.map +1 -1
  296. package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
  297. package/dist/esm/components/Select/Select.js.map +1 -1
  298. package/dist/esm/components/Select/useSelect.js +63 -82
  299. package/dist/esm/components/Select/useSelect.js.map +1 -1
  300. package/dist/esm/components/Spinner/Spinner.js.map +1 -1
  301. package/dist/esm/components/Switch/Switch.js.map +1 -1
  302. package/dist/esm/components/Table/components/BaseTable.js +23 -30
  303. package/dist/esm/components/Table/components/BaseTable.js.map +1 -1
  304. package/dist/esm/components/Table/components/PaginatedTable.js +3 -7
  305. package/dist/esm/components/Table/components/PaginatedTable.js.map +1 -1
  306. package/dist/esm/components/Table/components/Table.js +18 -25
  307. package/dist/esm/components/Table/components/Table.js.map +1 -1
  308. package/dist/esm/components/Table/components/WindowedTable.js +88 -104
  309. package/dist/esm/components/Table/components/WindowedTable.js.map +1 -1
  310. package/dist/esm/components/Table/hooks/plugins/useRowActions.js +122 -146
  311. package/dist/esm/components/Table/hooks/plugins/useRowActions.js.map +1 -1
  312. package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js +57 -61
  313. package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js.map +1 -1
  314. package/dist/esm/components/Table/hooks/plugins/useRowEditing.js +39 -36
  315. package/dist/esm/components/Table/hooks/plugins/useRowEditing.js.map +1 -1
  316. package/dist/esm/components/Table/hooks/plugins/useRowSelect.js +80 -90
  317. package/dist/esm/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
  318. package/dist/esm/components/Table/hooks/useRowCreation.js +29 -64
  319. package/dist/esm/components/Table/hooks/useRowCreation.js.map +1 -1
  320. package/dist/esm/components/Table/hooks/useTable.js +119 -141
  321. package/dist/esm/components/Table/hooks/useTable.js.map +1 -1
  322. package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js +12 -15
  323. package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js.map +1 -1
  324. package/dist/esm/components/Table/util/renderColumn.js +10 -10
  325. package/dist/esm/components/Table/util/renderColumn.js.map +1 -1
  326. package/dist/esm/components/Table/util/renderRow.js +37 -46
  327. package/dist/esm/components/Table/util/renderRow.js.map +1 -1
  328. package/dist/esm/components/Table/util/rowIndexPath.js +14 -16
  329. package/dist/esm/components/Table/util/rowIndexPath.js.map +1 -1
  330. package/dist/esm/components/Table/util/sortTypes.js +23 -31
  331. package/dist/esm/components/Table/util/sortTypes.js.map +1 -1
  332. package/dist/esm/components/Table/util.js +29 -41
  333. package/dist/esm/components/Table/util.js.map +1 -1
  334. package/dist/esm/components/Tabs/Tabs.js.map +1 -1
  335. package/dist/esm/components/Textarea/Textarea.js.map +1 -1
  336. package/dist/esm/components/Toast/Toast.js +20 -21
  337. package/dist/esm/components/Toast/Toast.js.map +1 -1
  338. package/dist/esm/components/Toast/Toaster.js.map +1 -1
  339. package/dist/esm/components/Toast/util.js +2 -2
  340. package/dist/esm/components/Toast/util.js.map +1 -1
  341. package/dist/esm/components/Tooltip/Tooltip.js +1 -1
  342. package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
  343. package/dist/esm/components/Tour/Tour.js.map +1 -1
  344. package/dist/esm/components/Treeview/Treeview.js +3 -3
  345. package/dist/esm/components/Treeview/Treeview.js.map +1 -1
  346. package/dist/esm/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
  347. package/dist/esm/index.css +642 -642
  348. package/dist/esm/index.js +1 -1
  349. package/dist/esm/primitives/Button.js +9 -13
  350. package/dist/esm/primitives/Button.js.map +1 -1
  351. package/dist/esm/utils/date.js.map +1 -1
  352. package/dist/esm/utils/hooks/useBoundingClientRectListener.js.map +1 -1
  353. package/dist/esm/utils/hooks/useDraggable.js +16 -18
  354. package/dist/esm/utils/hooks/useDraggable.js.map +1 -1
  355. package/dist/esm/utils/hooks/useDropTarget.js +7 -10
  356. package/dist/esm/utils/hooks/useDropTarget.js.map +1 -1
  357. package/dist/esm/utils/hooks/useListKeyboardNavigation.js.map +1 -1
  358. package/dist/esm/utils/hooks/useListScrollTo.js.map +1 -1
  359. package/dist/esm/utils/hooks/useOnClickOutside.js.map +1 -1
  360. package/dist/esm/utils/hooks/useProxiedRef.js +3 -3
  361. package/dist/esm/utils/hooks/useProxiedRef.js.map +1 -1
  362. package/dist/esm/utils/hooks/useTimer.js +9 -17
  363. package/dist/esm/utils/hooks/useTimer.js.map +1 -1
  364. package/dist/esm/utils/input.js +7 -11
  365. package/dist/esm/utils/input.js.map +1 -1
  366. package/dist/esm/utils/mergeRefs.js +2 -2
  367. package/dist/esm/utils/mergeRefs.js.map +1 -1
  368. package/dist/esm/utils/taillwind.js +2 -2
  369. package/dist/esm/utils/taillwind.js.map +1 -1
  370. package/dist/index.css +642 -642
  371. package/dist/taco.cjs.development.js +1519 -1843
  372. package/dist/taco.cjs.development.js.map +1 -1
  373. package/dist/taco.cjs.production.min.js +1 -1
  374. package/dist/taco.cjs.production.min.js.map +1 -1
  375. package/package.json +2 -2
  376. package/plugins/tailwindcss-aria-attributes.js +73 -73
  377. package/tailwind.config.js +297 -297
  378. package/types.json +379 -405
@@ -1 +1 @@
1
- {"version":3,"file":"useSelect.js","sources":["../../../../src/components/Select/useSelect.tsx"],"sourcesContent":["import * as React from 'react';\nimport keycode from 'keycode';\nimport cn from 'classnames';\nimport { v4 as uuid } from 'uuid';\nimport { useLocalization } from '../Provider/Provider';\nimport { SelectProps } from './Select';\nimport { ListboxProps } from '../Listbox/Listbox';\nimport { useProxiedRef } from '../../utils/hooks/useProxiedRef';\nimport { setInputValueByRef, findByValue, useFlattenedData, sanitizeItem } from '../Listbox/util';\nimport { ScrollableListItemValue } from '../Listbox/ScrollableList';\n\ntype useSelect = React.HtmlHTMLAttributes<HTMLDivElement> & {\n button: React.ButtonHTMLAttributes<HTMLButtonElement>;\n listbox: ListboxProps;\n input: any;\n popover: { open: boolean; onOpenChange: (open: boolean) => void };\n text: string | JSX.Element;\n more?: number;\n};\n\nexport const useSelect = (\n {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n data = [],\n defaultValue,\n disabled,\n emptyValue,\n id: nativeId,\n multiselect,\n onClick,\n onChange,\n readOnly,\n value = emptyValue,\n ...otherProps\n }: SelectProps,\n ref: React.Ref<HTMLInputElement>\n): useSelect => {\n const { texts } = useLocalization();\n const searchData = useFlattenedData(data);\n const inputRef = useProxiedRef<HTMLInputElement>(ref);\n const [open, setOpen] = React.useState(false);\n const id = React.useMemo(() => nativeId || `select_${uuid()}`, [nativeId]);\n const internalInputRef = React.useRef(null);\n const buttonId = `${id}-button`;\n // support 'escape' resetting to the value that was set when the listbox opened\n const [lastValue, setLastValue] = React.useState<ScrollableListItemValue | undefined>(value);\n\n React.useEffect(() => {\n setLastValue(value);\n }, [open]);\n\n React.useEffect(() => {\n if (defaultValue !== undefined && value === undefined) {\n setInputValueByRef(internalInputRef.current, defaultValue);\n }\n }, [defaultValue]);\n\n React.useEffect(() => {\n if (value !== undefined) {\n setInputValueByRef(internalInputRef.current, value);\n }\n }, []);\n\n // event handlers\n const handleButtonKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>): void => {\n if (event.keyCode === keycode('up') || event.keyCode === keycode('down')) {\n event.preventDefault();\n setOpen(true);\n }\n };\n\n const handleListboxKeyDown = (event: React.KeyboardEvent<HTMLElement>): void => {\n switch (event.keyCode) {\n case keycode('escape'): {\n event.preventDefault();\n if (lastValue !== undefined) {\n setInputValueByRef(inputRef.current, lastValue);\n }\n\n setOpen(false);\n break;\n }\n\n case keycode('tab'):\n case keycode('enter'): {\n if (event.keyCode !== keycode('tab')) {\n event.preventDefault();\n }\n setOpen(false);\n break;\n }\n\n default:\n }\n\n if (otherProps.onKeyDown) {\n otherProps.onKeyDown(event);\n }\n };\n\n const handleListboxClick = (event: React.MouseEvent<HTMLLIElement>): void => {\n event.preventDefault();\n if (!multiselect) {\n setOpen(false);\n }\n };\n\n let text: string | JSX.Element = '';\n let more = 0;\n\n if (value !== undefined) {\n if (multiselect) {\n const selectedValues = value?.toString().split(',') || [];\n\n if (selectedValues.length === searchData.filter(item => !item.disabled).length) {\n text = texts.select.allOptionsSelected;\n } else {\n text = findByValue(searchData, selectedValues[0])?.text ?? '';\n more = selectedValues.length > 1 ? selectedValues.length - 1 : 0;\n }\n } else {\n const item = findByValue(searchData, value);\n\n if (item) {\n text = item.icon ? (\n <>\n {React.cloneElement(item.icon, {\n className: cn(item.icon.props.className, 'mr-1 -mt-px'),\n })}\n {item.text}\n </>\n ) : (\n item.text\n );\n }\n }\n }\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n event.persist();\n\n if (onChange) {\n const item = findByValue(searchData, event.target.value);\n (event as any).detail = sanitizeItem(item);\n\n const indexes = item?.path?.split('.') ?? [];\n\n if (indexes.length > 1) {\n // we don't want to map the current item\n indexes.pop();\n // we need to rebuild the path as we map\n let lastPath: string;\n\n (event as any).detail.parents = indexes.map(i => {\n lastPath = lastPath ? [lastPath, i].join('.') : i;\n return sanitizeItem(searchData.find(i => i.path === lastPath));\n });\n }\n\n onChange(event);\n }\n };\n\n const button: React.ButtonHTMLAttributes<HTMLButtonElement> = {\n 'aria-haspopup': 'listbox' as const,\n 'aria-label': ariaLabel ? `${ariaLabel} ${text}` : undefined,\n 'aria-labelledby': ariaLabelledBy ? `${ariaLabelledBy} ${buttonId}` : undefined,\n disabled,\n id: buttonId,\n onKeyDown: !disabled && !readOnly ? handleButtonKeyDown : undefined,\n type: 'button',\n };\n\n const listbox = {\n ...otherProps,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n data,\n disabled,\n emptyValue,\n onClick: handleListboxClick,\n onChange: event => {\n setInputValueByRef(internalInputRef.current, event.detail.value);\n },\n onKeyDown: handleListboxKeyDown,\n ref: inputRef,\n value,\n multiselect,\n };\n\n const input = {\n onChange: handleInputChange,\n ref: internalInputRef,\n value: value ?? '',\n };\n\n return {\n button,\n listbox,\n input,\n popover: {\n open,\n onOpenChange: setOpen,\n },\n text,\n more,\n };\n};\n"],"names":["useSelect","ref","ariaLabel","ariaLabelledBy","data","defaultValue","disabled","emptyValue","nativeId","id","multiselect","onChange","readOnly","value","otherProps","useLocalization","texts","searchData","useFlattenedData","inputRef","useProxiedRef","React","open","setOpen","uuid","internalInputRef","buttonId","lastValue","setLastValue","undefined","setInputValueByRef","current","handleButtonKeyDown","event","keyCode","keycode","preventDefault","handleListboxKeyDown","onKeyDown","handleListboxClick","text","more","selectedValues","toString","split","length","filter","item","select","allOptionsSelected","findByValue","icon","className","cn","props","handleInputChange","persist","target","detail","sanitizeItem","indexes","path","pop","lastPath","parents","map","i","join","find","button","type","listbox","onClick","input","popover","onOpenChange"],"mappings":";;;;;;;;;;IAoBaA,SAAS,GAAG,SAAZA,SAAY,OAgBrBC,GAhBqB;MAEHC,iBAAd;MACmBC,sBAAnB;uBACAC;MAAAA,8BAAO;MACPC,oBAAAA;MACAC,gBAAAA;MACAC,kBAAAA;MACIC,gBAAJC;MACAC,mBAAAA;MAEAC,gBAAAA;MACAC,gBAAAA;wBACAC;MAAAA,gCAAQN;MACLO;;AAIP,yBAAkBC,eAAe,EAAjC;AAAA,MAAQC,KAAR,oBAAQA,KAAR;;AACA,MAAMC,UAAU,GAAGC,gBAAgB,CAACd,IAAD,CAAnC;AACA,MAAMe,QAAQ,GAAGC,aAAa,CAAmBnB,GAAnB,CAA9B;;AACA,wBAAwBoB,QAAA,CAAe,KAAf,CAAxB;AAAA,MAAOC,IAAP;AAAA,MAAaC,OAAb;;AACA,MAAMd,EAAE,GAAGY,OAAA,CAAc;AAAA,WAAMb,QAAQ,gBAAcgB,EAAI,EAAhC;AAAA,GAAd,EAAoD,CAAChB,QAAD,CAApD,CAAX;AACA,MAAMiB,gBAAgB,GAAGJ,MAAA,CAAa,IAAb,CAAzB;AACA,MAAMK,QAAQ,GAAMjB,EAAN,YAAd;;AAEA,yBAAkCY,QAAA,CAAoDR,KAApD,CAAlC;AAAA,MAAOc,SAAP;AAAA,MAAkBC,YAAlB;;AAEAP,EAAAA,SAAA,CAAgB;AACZO,IAAAA,YAAY,CAACf,KAAD,CAAZ;AACH,GAFD,EAEG,CAACS,IAAD,CAFH;AAIAD,EAAAA,SAAA,CAAgB;AACZ,QAAIhB,YAAY,KAAKwB,SAAjB,IAA8BhB,KAAK,KAAKgB,SAA5C,EAAuD;AACnDC,MAAAA,kBAAkB,CAACL,gBAAgB,CAACM,OAAlB,EAA2B1B,YAA3B,CAAlB;AACH;AACJ,GAJD,EAIG,CAACA,YAAD,CAJH;AAMAgB,EAAAA,SA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1DG,IAAAA,EAAE,EAAEiB,QALsD;AAM1DY,IAAAA,SAAS,EAAE,CAAChC,QAAD,IAAa,CAACM,QAAd,GAAyBoB,mBAAzB,GAA+CH,SANA;AAO1DyC,IAAAA,IAAI,EAAE;AAPoD,GAA9D;;AAUA,MAAMC,OAAO,gBACNzD,UADM;AAET,kBAAcZ,SAFL;AAGT,uBAAmBC,cAHV;AAITC,IAAAA,IAAI,EAAJA,IAJS;AAKTE,IAAAA,QAAQ,EAARA,QALS;AAMTC,IAAAA,UAAU,EAAVA,UANS;AAOTiE,IAAAA,OAAO,EAAEjC,kBAPA;AAQT5B,IAAAA,QAAQ,EAAE,kBAAAsB,KAAK;AACXH,MAAAA,kBAAkB,CAACL,gBAAgB,CAACM,OAAlB,EAA2BE,KAAK,CAACyB,MAAN,CAAa7C,KAAxC,CAAlB;AACH,KAVQ;AAWTyB,IAAAA,SAAS,EAAED,oBAXF;AAYTpC,IAAAA,GAAG,EAAEkB,QAZI;AAaTN,IAAAA,KAAK,EAALA,KAbS;AAcTH,IAAAA,WAAW,EAAXA;AAdS,IAAb;;AAiBA,MAAM+D,KAAK,GAAG;AACV9D,IAAAA,QAAQ,EAAE4C,iBADA;AAEVtD,IAAAA,GAAG,EAAEwB,gBAFK;AAGVZ,IAAAA,KAAK,EAAEA,KAAF,aAAEA,KAAF,cAAEA,KAAF,GAAW;AAHN,GAAd;AAMA,SAAO;AACHwD,IAAAA,MAAM,EAANA,MADG;AAEHE,IAAAA,OAAO,EAAPA,OAFG;AAGHE,IAAAA,KAAK,EAALA,KAHG;AAIHC,IAAAA,OAAO,EAAE;AACLpD,MAAAA,IAAI,EAAJA,IADK;AAELqD,MAAAA,YAAY,EAAEpD;AAFT,KAJN;AAQHiB,IAAAA,IAAI,EAAJA,IARG;AASHC,IAAAA,IAAI,EAAJA;AATG,GAAP;AAWH;;;;"}
1
+ {"version":3,"file":"useSelect.js","sources":["../../../../src/components/Select/useSelect.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport keycode from 'keycode';\r\nimport cn from 'classnames';\r\nimport { v4 as uuid } from 'uuid';\r\nimport { useLocalization } from '../Provider/Provider';\r\nimport { SelectProps } from './Select';\r\nimport { ListboxProps } from '../Listbox/Listbox';\r\nimport { useProxiedRef } from '../../utils/hooks/useProxiedRef';\r\nimport { setInputValueByRef, findByValue, useFlattenedData, sanitizeItem } from '../Listbox/util';\r\nimport { ScrollableListItemValue } from '../Listbox/ScrollableList';\r\n\r\ntype useSelect = React.HtmlHTMLAttributes<HTMLDivElement> & {\r\n button: React.ButtonHTMLAttributes<HTMLButtonElement>;\r\n listbox: ListboxProps;\r\n input: any;\r\n popover: { open: boolean; onOpenChange: (open: boolean) => void };\r\n text: string | JSX.Element;\r\n more?: number;\r\n};\r\n\r\nexport const useSelect = (\r\n {\r\n 'aria-label': ariaLabel,\r\n 'aria-labelledby': ariaLabelledBy,\r\n data = [],\r\n defaultValue,\r\n disabled,\r\n emptyValue,\r\n id: nativeId,\r\n multiselect,\r\n onClick,\r\n onChange,\r\n readOnly,\r\n value = emptyValue,\r\n ...otherProps\r\n }: SelectProps,\r\n ref: React.Ref<HTMLInputElement>\r\n): useSelect => {\r\n const { texts } = useLocalization();\r\n const searchData = useFlattenedData(data);\r\n const inputRef = useProxiedRef<HTMLInputElement>(ref);\r\n const [open, setOpen] = React.useState(false);\r\n const id = React.useMemo(() => nativeId || `select_${uuid()}`, [nativeId]);\r\n const internalInputRef = React.useRef(null);\r\n const buttonId = `${id}-button`;\r\n // support 'escape' resetting to the value that was set when the listbox opened\r\n const [lastValue, setLastValue] = React.useState<ScrollableListItemValue | undefined>(value);\r\n\r\n React.useEffect(() => {\r\n setLastValue(value);\r\n }, [open]);\r\n\r\n React.useEffect(() => {\r\n if (defaultValue !== undefined && value === undefined) {\r\n setInputValueByRef(internalInputRef.current, defaultValue);\r\n }\r\n }, [defaultValue]);\r\n\r\n React.useEffect(() => {\r\n if (value !== undefined) {\r\n setInputValueByRef(internalInputRef.current, value);\r\n }\r\n }, []);\r\n\r\n // event handlers\r\n const handleButtonKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>): void => {\r\n if (event.keyCode === keycode('up') || event.keyCode === keycode('down')) {\r\n event.preventDefault();\r\n setOpen(true);\r\n }\r\n };\r\n\r\n const handleListboxKeyDown = (event: React.KeyboardEvent<HTMLElement>): void => {\r\n switch (event.keyCode) {\r\n case keycode('escape'): {\r\n event.preventDefault();\r\n if (lastValue !== undefined) {\r\n setInputValueByRef(inputRef.current, lastValue);\r\n }\r\n\r\n setOpen(false);\r\n break;\r\n }\r\n\r\n case keycode('tab'):\r\n case keycode('enter'): {\r\n if (event.keyCode !== keycode('tab')) {\r\n event.preventDefault();\r\n }\r\n setOpen(false);\r\n break;\r\n }\r\n\r\n default:\r\n }\r\n\r\n if (otherProps.onKeyDown) {\r\n otherProps.onKeyDown(event);\r\n }\r\n };\r\n\r\n const handleListboxClick = (event: React.MouseEvent<HTMLLIElement>): void => {\r\n event.preventDefault();\r\n if (!multiselect) {\r\n setOpen(false);\r\n }\r\n };\r\n\r\n let text: string | JSX.Element = '';\r\n let more = 0;\r\n\r\n if (value !== undefined) {\r\n if (multiselect) {\r\n const selectedValues = value?.toString().split(',') || [];\r\n\r\n if (selectedValues.length === searchData.filter(item => !item.disabled).length) {\r\n text = texts.select.allOptionsSelected;\r\n } else {\r\n text = findByValue(searchData, selectedValues[0])?.text ?? '';\r\n more = selectedValues.length > 1 ? selectedValues.length - 1 : 0;\r\n }\r\n } else {\r\n const item = findByValue(searchData, value);\r\n\r\n if (item) {\r\n text = item.icon ? (\r\n <>\r\n {React.cloneElement(item.icon, {\r\n className: cn(item.icon.props.className, 'mr-1 -mt-px'),\r\n })}\r\n {item.text}\r\n </>\r\n ) : (\r\n item.text\r\n );\r\n }\r\n }\r\n }\r\n\r\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\r\n event.persist();\r\n\r\n if (onChange) {\r\n const item = findByValue(searchData, event.target.value);\r\n (event as any).detail = sanitizeItem(item);\r\n\r\n const indexes = item?.path?.split('.') ?? [];\r\n\r\n if (indexes.length > 1) {\r\n // we don't want to map the current item\r\n indexes.pop();\r\n // we need to rebuild the path as we map\r\n let lastPath: string;\r\n\r\n (event as any).detail.parents = indexes.map(i => {\r\n lastPath = lastPath ? [lastPath, i].join('.') : i;\r\n return sanitizeItem(searchData.find(i => i.path === lastPath));\r\n });\r\n }\r\n\r\n onChange(event);\r\n }\r\n };\r\n\r\n const button: React.ButtonHTMLAttributes<HTMLButtonElement> = {\r\n 'aria-haspopup': 'listbox' as const,\r\n 'aria-label': ariaLabel ? `${ariaLabel} ${text}` : undefined,\r\n 'aria-labelledby': ariaLabelledBy ? `${ariaLabelledBy} ${buttonId}` : undefined,\r\n disabled,\r\n id: buttonId,\r\n onKeyDown: !disabled && !readOnly ? handleButtonKeyDown : undefined,\r\n type: 'button',\r\n };\r\n\r\n const listbox = {\r\n ...otherProps,\r\n 'aria-label': ariaLabel,\r\n 'aria-labelledby': ariaLabelledBy,\r\n data,\r\n disabled,\r\n emptyValue,\r\n onClick: handleListboxClick,\r\n onChange: event => {\r\n setInputValueByRef(internalInputRef.current, event.detail.value);\r\n },\r\n onKeyDown: handleListboxKeyDown,\r\n ref: inputRef,\r\n value,\r\n multiselect,\r\n };\r\n\r\n const input = {\r\n onChange: handleInputChange,\r\n ref: internalInputRef,\r\n value: value ?? '',\r\n };\r\n\r\n return {\r\n button,\r\n listbox,\r\n input,\r\n popover: {\r\n open,\r\n onOpenChange: setOpen,\r\n },\r\n text,\r\n more,\r\n };\r\n};\r\n"],"names":["useSelect","ariaLabel","ariaLabelledBy","data","defaultValue","disabled","emptyValue","id","nativeId","multiselect","onClick","onChange","readOnly","value","otherProps","ref","texts","useLocalization","searchData","useFlattenedData","inputRef","useProxiedRef","open","setOpen","React","uuid","internalInputRef","buttonId","lastValue","setLastValue","undefined","setInputValueByRef","current","handleButtonKeyDown","event","keyCode","keycode","preventDefault","handleListboxKeyDown","onKeyDown","handleListboxClick","text","more","selectedValues","toString","split","length","filter","item","select","allOptionsSelected","findByValue","icon","className","cn","props","handleInputChange","persist","target","detail","sanitizeItem","indexes","path","pop","lastPath","parents","map","i","join","find","button","type","listbox","input","popover","onOpenChange"],"mappings":";;;;;;;;MAoBaA,SAAS,GAAG,CACrB;AACI,gBAAcC,SADlB;AAEI,qBAAmBC,cAFvB;AAGIC,EAAAA,IAAI,GAAG,EAHX;AAIIC,EAAAA,YAJJ;AAKIC,EAAAA,QALJ;AAMIC,EAAAA,UANJ;AAOIC,EAAAA,EAAE,EAAEC,QAPR;AAQIC,EAAAA,WARJ;AASIC,EAAAA,OATJ;AAUIC,EAAAA,QAVJ;AAWIC,EAAAA,QAXJ;AAYIC,EAAAA,KAAK,GAAGP,UAZZ;AAaI,KAAGQ;AAbP,CADqB,EAgBrBC,GAhBqB;AAkBrB,QAAM;AAAEC,IAAAA;AAAF,MAAYC,eAAe,EAAjC;AACA,QAAMC,UAAU,GAAGC,gBAAgB,CAAChB,IAAD,CAAnC;AACA,QAAMiB,QAAQ,GAAGC,aAAa,CAAmBN,GAAnB,CAA9B;AACA,QAAM,CAACO,IAAD,EAAOC,OAAP,IAAkBC,QAAA,CAAe,KAAf,CAAxB;AACA,QAAMjB,EAAE,GAAGiB,OAAA,CAAc,MAAMhB,QAAQ,cAAciB,EAAI,IAA9C,EAAoD,CAACjB,QAAD,CAApD,CAAX;AACA,QAAMkB,gBAAgB,GAAGF,MAAA,CAAa,IAAb,CAAzB;AACA,QAAMG,QAAQ,MAAMpB,WAApB;;AAEA,QAAM,CAACqB,SAAD,EAAYC,YAAZ,IAA4BL,QAAA,CAAoDX,KAApD,CAAlC;AAEAW,EAAAA,SAAA,CAAgB;AACZK,IAAAA,YAAY,CAAChB,KAAD,CAAZ;AACH,GAFD,EAEG,CAACS,IAAD,CAFH;AAIAE,EAAAA,SAAA,CAAgB;AACZ,QAAIpB,YAAY,KAAK0B,SAAjB,IAA8BjB,KAAK,KAAKiB,SAA5C,EAAu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AM1DY,IAAAA,SAAS,EAAE,CAAClC,QAAD,IAAa,CAACO,QAAd,GAAyBqB,mBAAzB,GAA+CH,SANA;AAO1DyC,IAAAA,IAAI,EAAE;AAPoD,GAA9D;AAUA,QAAMC,OAAO,GAAG,EACZ,GAAG1D,UADS;AAEZ,kBAAcb,SAFF;AAGZ,uBAAmBC,cAHP;AAIZC,IAAAA,IAJY;AAKZE,IAAAA,QALY;AAMZC,IAAAA,UANY;AAOZI,IAAAA,OAAO,EAAE8B,kBAPG;AAQZ7B,IAAAA,QAAQ,EAAEuB,KAAK;AACXH,MAAAA,kBAAkB,CAACL,gBAAgB,CAACM,OAAlB,EAA2BE,KAAK,CAACyB,MAAN,CAAa9C,KAAxC,CAAlB;AACH,KAVW;AAWZ0B,IAAAA,SAAS,EAAED,oBAXC;AAYZvB,IAAAA,GAAG,EAAEK,QAZO;AAaZP,IAAAA,KAbY;AAcZJ,IAAAA;AAdY,GAAhB;AAiBA,QAAMgE,KAAK,GAAG;AACV9D,IAAAA,QAAQ,EAAE6C,iBADA;AAEVzC,IAAAA,GAAG,EAAEW,gBAFK;AAGVb,IAAAA,KAAK,EAAEA,KAAF,aAAEA,KAAF,cAAEA,KAAF,GAAW;AAHN,GAAd;AAMA,SAAO;AACHyD,IAAAA,MADG;AAEHE,IAAAA,OAFG;AAGHC,IAAAA,KAHG;AAIHC,IAAAA,OAAO,EAAE;AACLpD,MAAAA,IADK;AAELqD,MAAAA,YAAY,EAAEpD;AAFT,KAJN;AAQHkB,IAAAA,IARG;AASHC,IAAAA;AATG,GAAP;AAWH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner.js","sources":["../../../../src/components/Spinner/Spinner.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport './Spinner.css';\n\nexport type SpinnerProps = React.HTMLAttributes<HTMLDivElement> & {\n /**\n * Define a delay in milliseconds after which the spinner is shown.\n * Default value is `500`ms\n */\n delay?: number;\n /** Define a text that will be displayed below spinner */\n label?: string;\n};\n\nexport const Spinner = React.forwardRef(function Spinner(props: SpinnerProps, ref: React.Ref<HTMLDivElement>) {\n const { delay = 500, label, ...otherProps } = props;\n const [visible, setVisibility] = React.useState(!delay);\n\n React.useEffect(() => {\n let timeout: number;\n\n if (delay) {\n timeout = window.setTimeout(() => setVisibility(true), delay);\n }\n\n return () => {\n if (timeout) {\n clearTimeout(timeout);\n }\n };\n }, [delay]);\n\n if (!visible) {\n return null;\n }\n\n const className = cn('inline-flex flex-col relative items-center', otherProps.className);\n\n return (\n <div {...otherProps} className={className} data-taco=\"spinner\" ref={ref}>\n <svg\n className=\"h-10 w-10 animate-[spinnerRotation_2s_linear_infinite]\"\n viewBox=\"0 0 100 100\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"50\" cy=\"50\" r=\"45\"></circle>\n </svg>\n {label && <span className=\"mt-4\">{label}</span>}\n </div>\n );\n});\n"],"names":["Spinner","React","forwardRef","props","ref","delay","label","otherProps","useState","visible","setVisibility","useEffect","timeout","window","setTimeout","clearTimeout","className","cn","viewBox","xmlns","cx","cy","r"],"mappings":";;;;;IAcaA,OAAO,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,OAAT,CAAiBG,KAAjB,EAAsCC,GAAtC;AACpC,qBAA8CD,KAA9C,CAAQE,KAAR;AAAA,MAAQA,KAAR,6BAAgB,GAAhB;AAAA,MAAqBC,KAArB,GAA8CH,KAA9C,CAAqBG,KAArB;AAAA,MAA+BC,UAA/B,iCAA8CJ,KAA9C;;AACA,wBAAiCF,cAAK,CAACO,QAAN,CAAe,CAACH,KAAhB,CAAjC;AAAA,MAAOI,OAAP;AAAA,MAAgBC,aAAhB;;AAEAT,EAAAA,cAAK,CAACU,SAAN,CAAgB;AACZ,QAAIC,OAAJ;;AAEA,QAAIP,KAAJ,EAAW;AACPO,MAAAA,OAAO,GAAGC,MAAM,CAACC,UAAP,CAAkB;AAAA,eAAMJ,aAAa,CAAC,IAAD,CAAnB;AAAA,OAAlB,EAA6CL,KAA7C,CAAV;AACH;;AAED,WAAO;AACH,UAAIO,OAAJ,EAAa;AACTG,QAAAA,YAAY,CAACH,OAAD,CAAZ;AACH;AACJ,KAJD;AAKH,GAZD,EAYG,CAACP,KAAD,CAZH;;AAcA,MAAI,CAACI,OAAL,EAAc;AACV,WAAO,IAAP;AACH;;AAED,MAAMO,SAAS,GAAGC,EAAE,CAAC,4CAAD,EAA+CV,UAAU,CAACS,SAA1D,CAApB;AAEA,SACIf,4BAAA,MAAA,oBAASM;AAAYS,IAAAA,SAAS,EAAEA;iBAAqB;AAAUZ,IAAAA,GAAG,EAAEA;IAApE,EACIH,4BAAA,MAAA;AACIe,IAAAA,SAAS,EAAC;AACVE,IAAAA,OAAO,EAAC;AACRC,IAAAA,KAAK,EAAC;GAHV,EAKIlB,4BAAA,SAAA;AAAQmB,IAAAA,EAAE,EAAC;AAAKC,IAAAA,EAAE,EAAC;AAAKC,IAAAA,CAAC,EAAC;GAA1B,CALJ,CADJ,EAQKhB,KAAK,IAAIL,4BAAA,OAAA;AAAMe,IAAAA,SAAS,EAAC;GAAhB,EAAwBV,KAAxB,CARd,CADJ;AAYH,CApCsB;;;;"}
1
+ {"version":3,"file":"Spinner.js","sources":["../../../../src/components/Spinner/Spinner.tsx"],"sourcesContent":["import React from 'react';\r\nimport cn from 'classnames';\r\nimport './Spinner.css';\r\n\r\nexport type SpinnerProps = React.HTMLAttributes<HTMLDivElement> & {\r\n /**\r\n * Define a delay in milliseconds after which the spinner is shown.\r\n * Default value is `500`ms\r\n */\r\n delay?: number;\r\n /** Define a text that will be displayed below spinner */\r\n label?: string;\r\n};\r\n\r\nexport const Spinner = React.forwardRef(function Spinner(props: SpinnerProps, ref: React.Ref<HTMLDivElement>) {\r\n const { delay = 500, label, ...otherProps } = props;\r\n const [visible, setVisibility] = React.useState(!delay);\r\n\r\n React.useEffect(() => {\r\n let timeout: number;\r\n\r\n if (delay) {\r\n timeout = window.setTimeout(() => setVisibility(true), delay);\r\n }\r\n\r\n return () => {\r\n if (timeout) {\r\n clearTimeout(timeout);\r\n }\r\n };\r\n }, [delay]);\r\n\r\n if (!visible) {\r\n return null;\r\n }\r\n\r\n const className = cn('inline-flex flex-col relative items-center', otherProps.className);\r\n\r\n return (\r\n <div {...otherProps} className={className} data-taco=\"spinner\" ref={ref}>\r\n <svg\r\n className=\"h-10 w-10 animate-[spinnerRotation_2s_linear_infinite]\"\r\n viewBox=\"0 0 100 100\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n >\r\n <circle cx=\"50\" cy=\"50\" r=\"45\"></circle>\r\n </svg>\r\n {label && <span className=\"mt-4\">{label}</span>}\r\n </div>\r\n );\r\n});\r\n"],"names":["Spinner","React","forwardRef","props","ref","delay","label","otherProps","useState","visible","setVisibility","useEffect","timeout","window","setTimeout","clearTimeout","className","cn","viewBox","xmlns","cx","cy","r"],"mappings":";;;;;IAcaA,OAAO,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,OAAT,CAAiBG,KAAjB,EAAsCC,GAAtC;AACpC,qBAA8CD,KAA9C,CAAQE,KAAR;AAAA,MAAQA,KAAR,6BAAgB,GAAhB;AAAA,MAAqBC,KAArB,GAA8CH,KAA9C,CAAqBG,KAArB;AAAA,MAA+BC,UAA/B,iCAA8CJ,KAA9C;;AACA,wBAAiCF,cAAK,CAACO,QAAN,CAAe,CAACH,KAAhB,CAAjC;AAAA,MAAOI,OAAP;AAAA,MAAgBC,aAAhB;;AAEAT,EAAAA,cAAK,CAACU,SAAN,CAAgB;AACZ,QAAIC,OAAJ;;AAEA,QAAIP,KAAJ,EAAW;AACPO,MAAAA,OAAO,GAAGC,MAAM,CAACC,UAAP,CAAkB;AAAA,eAAMJ,aAAa,CAAC,IAAD,CAAnB;AAAA,OAAlB,EAA6CL,KAA7C,CAAV;AACH;;AAED,WAAO;AACH,UAAIO,OAAJ,EAAa;AACTG,QAAAA,YAAY,CAACH,OAAD,CAAZ;AACH;AACJ,KAJD;AAKH,GAZD,EAYG,CAACP,KAAD,CAZH;;AAcA,MAAI,CAACI,OAAL,EAAc;AACV,WAAO,IAAP;AACH;;AAED,MAAMO,SAAS,GAAGC,EAAE,CAAC,4CAAD,EAA+CV,UAAU,CAACS,SAA1D,CAApB;AAEA,SACIf,4BAAA,MAAA,oBAASM;AAAYS,IAAAA,SAAS,EAAEA;iBAAqB;AAAUZ,IAAAA,GAAG,EAAEA;IAApE,EACIH,4BAAA,MAAA;AACIe,IAAAA,SAAS,EAAC;AACVE,IAAAA,OAAO,EAAC;AACRC,IAAAA,KAAK,EAAC;GAHV,EAKIlB,4BAAA,SAAA;AAAQmB,IAAAA,EAAE,EAAC;AAAKC,IAAAA,EAAE,EAAC;AAAKC,IAAAA,CAAC,EAAC;GAA1B,CALJ,CADJ,EAQKhB,KAAK,IAAIL,4BAAA,OAAA;AAAMe,IAAAA,SAAS,EAAC;GAAhB,EAAwBV,KAAxB,CARd,CADJ;AAYH,CApCsB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","sources":["../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as PrimitiveSwitch from '@radix-ui/react-switch';\n\ntype SwitchBaseProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange'> & {\n /** Label for the switch */\n label?: React.ReactNode;\n /* Whether user input is required */\n required?: boolean;\n};\n\ninterface UncontrolledSwitchProps extends SwitchBaseProps {\n checked?: never;\n onChange?: never;\n /* The default checked state (uncontrolled) */\n defaultChecked?: boolean;\n}\n\ninterface ControlledSwitchProps extends SwitchBaseProps {\n defaultChecked?: never;\n /* The current checked state (controlled) */\n checked: boolean;\n /* Handler called when the checked state changes */\n onChange: (checked: boolean) => void;\n}\n\nexport type SwitchProps = UncontrolledSwitchProps | ControlledSwitchProps;\n\nexport const Switch = React.forwardRef(function Switch(props: SwitchProps, ref: React.Ref<HTMLButtonElement>) {\n const { label, onChange, ...otherProps } = props;\n\n const className = cn(\n 'group h-6 w-10 flex rounded-full inline-flex',\n {\n 'mr-2': !!label,\n 'bg-grey-darker aria-checked:bg-blue focus:yt-focus': !props.disabled,\n 'bg-grey-light cursor-not-allowed aria-checked:bg-blue-light': props.disabled,\n },\n props.className\n );\n\n const element = (\n <PrimitiveSwitch.Root {...otherProps} className={className} onCheckedChange={onChange} ref={ref}>\n <PrimitiveSwitch.Thumb className=\"'will-change-transform transition-transform translate-x-1 group-aria-checked:translate-x-5 h-4 w-4 mt-1 bg-white rounded-full\" />\n </PrimitiveSwitch.Root>\n );\n\n if (label) {\n const labelClassName = cn('flex items-center cursor-pointer', {\n 'cursor-not-allowed text-grey-dark': props.disabled,\n });\n\n return (\n <label className={labelClassName}>\n {element}\n {label}\n </label>\n );\n }\n\n return element;\n});\n"],"names":["Switch","React","props","ref","label","onChange","otherProps","className","cn","disabled","element","PrimitiveSwitch","onCheckedChange","labelClassName"],"mappings":";;;;;;IA4BaA,MAAM,gBAAGC,UAAA,CAAiB,SAASD,MAAT,CAAgBE,KAAhB,EAAoCC,GAApC;AACnC,MAAQC,KAAR,GAA2CF,KAA3C,CAAQE,KAAR;AAAA,MAAeC,QAAf,GAA2CH,KAA3C,CAAeG,QAAf;AAAA,MAA4BC,UAA5B,iCAA2CJ,KAA3C;;AAEA,MAAMK,SAAS,GAAGC,EAAE,CAChB,8CADgB,EAEhB;AACI,YAAQ,CAAC,CAACJ,KADd;AAEI,0DAAsD,CAACF,KAAK,CAACO,QAFjE;AAGI,mEAA+DP,KAAK,CAACO;AAHzE,GAFgB,EAOhBP,KAAK,CAACK,SAPU,CAApB;AAUA,MAAMG,OAAO,GACTT,aAAA,CAACU,IAAD,oBAA0BL;AAAYC,IAAAA,SAAS,EAAEA;AAAWK,IAAAA,eAAe,EAAEP;AAAUF,IAAAA,GAAG,EAAEA;IAA5F,EACIF,aAAA,CAACU,KAAD;AAAuBJ,IAAAA,SAAS,EAAC;GAAjC,CADJ,CADJ;;AAMA,MAAIH,KAAJ,EAAW;AACP,QAAMS,cAAc,GAAGL,EAAE,CAAC,kCAAD,EAAqC;AAC1D,2CAAqCN,KAAK,CAACO;AADe,KAArC,CAAzB;AAIA,WACIR,aAAA,QAAA;AAAOM,MAAAA,SAAS,EAAEM;KAAlB,EACKH,OADL,EAEKN,KAFL,CADJ;AAMH;;AAED,SAAOM,OAAP;AACH,CAjCqB;;;;"}
1
+ {"version":3,"file":"Switch.js","sources":["../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport * as PrimitiveSwitch from '@radix-ui/react-switch';\r\n\r\ntype SwitchBaseProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange'> & {\r\n /** Label for the switch */\r\n label?: React.ReactNode;\r\n /* Whether user input is required */\r\n required?: boolean;\r\n};\r\n\r\ninterface UncontrolledSwitchProps extends SwitchBaseProps {\r\n checked?: never;\r\n onChange?: never;\r\n /* The default checked state (uncontrolled) */\r\n defaultChecked?: boolean;\r\n}\r\n\r\ninterface ControlledSwitchProps extends SwitchBaseProps {\r\n defaultChecked?: never;\r\n /* The current checked state (controlled) */\r\n checked: boolean;\r\n /* Handler called when the checked state changes */\r\n onChange: (checked: boolean) => void;\r\n}\r\n\r\nexport type SwitchProps = UncontrolledSwitchProps | ControlledSwitchProps;\r\n\r\nexport const Switch = React.forwardRef(function Switch(props: SwitchProps, ref: React.Ref<HTMLButtonElement>) {\r\n const { label, onChange, ...otherProps } = props;\r\n\r\n const className = cn(\r\n 'group h-6 w-10 flex rounded-full inline-flex',\r\n {\r\n 'mr-2': !!label,\r\n 'bg-grey-darker aria-checked:bg-blue focus:yt-focus': !props.disabled,\r\n 'bg-grey-light cursor-not-allowed aria-checked:bg-blue-light': props.disabled,\r\n },\r\n props.className\r\n );\r\n\r\n const element = (\r\n <PrimitiveSwitch.Root {...otherProps} className={className} onCheckedChange={onChange} ref={ref}>\r\n <PrimitiveSwitch.Thumb className=\"'will-change-transform transition-transform translate-x-1 group-aria-checked:translate-x-5 h-4 w-4 mt-1 bg-white rounded-full\" />\r\n </PrimitiveSwitch.Root>\r\n );\r\n\r\n if (label) {\r\n const labelClassName = cn('flex items-center cursor-pointer', {\r\n 'cursor-not-allowed text-grey-dark': props.disabled,\r\n });\r\n\r\n return (\r\n <label className={labelClassName}>\r\n {element}\r\n {label}\r\n </label>\r\n );\r\n }\r\n\r\n return element;\r\n});\r\n"],"names":["Switch","React","props","ref","label","onChange","otherProps","className","cn","disabled","element","PrimitiveSwitch","onCheckedChange","labelClassName"],"mappings":";;;;;;IA4BaA,MAAM,gBAAGC,UAAA,CAAiB,SAASD,MAAT,CAAgBE,KAAhB,EAAoCC,GAApC;AACnC,MAAQC,KAAR,GAA2CF,KAA3C,CAAQE,KAAR;AAAA,MAAeC,QAAf,GAA2CH,KAA3C,CAAeG,QAAf;AAAA,MAA4BC,UAA5B,iCAA2CJ,KAA3C;;AAEA,MAAMK,SAAS,GAAGC,EAAE,CAChB,8CADgB,EAEhB;AACI,YAAQ,CAAC,CAACJ,KADd;AAEI,0DAAsD,CAACF,KAAK,CAACO,QAFjE;AAGI,mEAA+DP,KAAK,CAACO;AAHzE,GAFgB,EAOhBP,KAAK,CAACK,SAPU,CAApB;AAUA,MAAMG,OAAO,GACTT,aAAA,CAACU,IAAD,oBAA0BL;AAAYC,IAAAA,SAAS,EAAEA;AAAWK,IAAAA,eAAe,EAAEP;AAAUF,IAAAA,GAAG,EAAEA;IAA5F,EACIF,aAAA,CAACU,KAAD;AAAuBJ,IAAAA,SAAS,EAAC;GAAjC,CADJ,CADJ;;AAMA,MAAIH,KAAJ,EAAW;AACP,QAAMS,cAAc,GAAGL,EAAE,CAAC,kCAAD,EAAqC;AAC1D,2CAAqCN,KAAK,CAACO;AADe,KAArC,CAAzB;AAIA,WACIR,aAAA,QAAA;AAAOM,MAAAA,SAAS,EAAEM;KAAlB,EACKH,OADL,EAEKN,KAFL,CADJ;AAMH;;AAED,SAAOM,OAAP;AACH,CAjCqB;;;;"}
@@ -1,29 +1,26 @@
1
- import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import React__default from 'react';
3
2
  import cn from 'classnames';
4
3
  import { useProxiedRef } from '../../../utils/hooks/useProxiedRef.js';
5
4
  import { Column } from '../util/renderColumn.js';
6
5
 
7
- var _excluded = ["autoFocus", "children", "disableSorting", "headerGroups", "headerRef", "bodyRef"];
8
- var DefaultEmptyState = function DefaultEmptyState() {
9
- return null;
10
- };
11
- var BaseTable = /*#__PURE__*/React__default.forwardRef(function BaseTable(props, ref) {
12
- var tableRef = useProxiedRef(ref);
13
-
14
- var autoFocus = props.autoFocus,
15
- children = props.children,
16
- headerGroups = props.headerGroups,
17
- headerRef = props.headerRef,
18
- bodyRef = props.bodyRef,
19
- otherProps = _objectWithoutPropertiesLoose(props, _excluded);
20
-
21
- React__default.useEffect(function () {
6
+ const DefaultEmptyState = () => null;
7
+ const BaseTable = /*#__PURE__*/React__default.forwardRef(function BaseTable(props, ref) {
8
+ const tableRef = useProxiedRef(ref);
9
+ const {
10
+ autoFocus,
11
+ children,
12
+ disableSorting: _,
13
+ headerGroups,
14
+ headerRef,
15
+ bodyRef,
16
+ ...otherProps
17
+ } = props;
18
+ React__default.useEffect(() => {
22
19
  if (autoFocus && tableRef.current) {
23
20
  tableRef.current.focus();
24
21
  }
25
22
  }, []);
26
- var className = cn('yt-table flex flex-col focus:yt-focus focus:rounded-sm', props.className);
23
+ const className = cn('yt-table flex flex-col focus:yt-focus focus:rounded-sm', props.className);
27
24
  return React__default.createElement("div", Object.assign({}, otherProps, {
28
25
  role: "table",
29
26
  className: className,
@@ -32,19 +29,15 @@ var BaseTable = /*#__PURE__*/React__default.forwardRef(function BaseTable(props,
32
29
  role: "rowgroup",
33
30
  className: "yt-table__head",
34
31
  ref: headerRef
35
- }, headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.map(function (headerGroup, index) {
36
- return React__default.createElement("div", {
37
- key: index,
38
- role: "row",
39
- className: "border-grey-light flex h-auto min-h-[2.5rem] w-full select-none border-b border-t-0 border-b-2 font-bold"
40
- }, headerGroup.headers.map(function (cell, index) {
41
- return React__default.createElement(Column, {
42
- key: index,
43
- index: index,
44
- cell: cell
45
- });
46
- }));
47
- })), React__default.createElement("div", {
32
+ }, headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.map((headerGroup, index) => React__default.createElement("div", {
33
+ key: index,
34
+ role: "row",
35
+ className: "border-grey-light flex h-auto min-h-[2.5rem] w-full select-none border-b border-t-0 border-b-2 font-bold"
36
+ }, headerGroup.headers.map((cell, index) => React__default.createElement(Column, {
37
+ key: index,
38
+ index: index,
39
+ cell: cell
40
+ }))))), React__default.createElement("div", {
48
41
  role: "rowgroup",
49
42
  className: "yt-table__body",
50
43
  ref: bodyRef
@@ -1 +1 @@
1
- {"version":3,"file":"BaseTable.js","sources":["../../../../../src/components/Table/components/BaseTable.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { HeaderGroup } from 'react-table';\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\nimport { InternalBaseTable } from '../types';\nimport './Table.css';\nimport { Column } from '../util/renderColumn';\n\nexport const DefaultEmptyState = (): React.ReactNode => null;\n\nexport const BaseTable = React.forwardRef(function BaseTable(props: InternalBaseTable, ref: React.Ref<HTMLDivElement>) {\n const tableRef = useProxiedRef<HTMLDivElement>(ref);\n const { autoFocus, children, disableSorting: _, headerGroups, headerRef, bodyRef, ...otherProps } = props;\n\n React.useEffect(() => {\n if (autoFocus && tableRef.current) {\n tableRef.current.focus();\n }\n }, []);\n\n const className = cn('yt-table flex flex-col focus:yt-focus focus:rounded-sm', props.className);\n\n return (\n <div {...otherProps} role=\"table\" className={className} ref={tableRef}>\n <div role=\"rowgroup\" className=\"yt-table__head\" ref={headerRef}>\n {headerGroups?.map((headerGroup: HeaderGroup<object>, index: number) => (\n <div\n key={index}\n role=\"row\"\n className=\"border-grey-light flex h-auto min-h-[2.5rem] w-full select-none border-b border-t-0 border-b-2 font-bold\"\n >\n {headerGroup.headers.map((cell: any, index: number) => (\n <Column key={index} index={index} cell={cell} />\n ))}\n </div>\n ))}\n </div>\n\n <div role=\"rowgroup\" className=\"yt-table__body\" ref={bodyRef}>\n {children}\n </div>\n </div>\n );\n});\n"],"names":["DefaultEmptyState","BaseTable","React","forwardRef","props","ref","tableRef","useProxiedRef","autoFocus","children","headerGroups","headerRef","bodyRef","otherProps","useEffect","current","focus","className","cn","role","map","headerGroup","index","key","headers","cell","Column"],"mappings":";;;;;;;IAQaA,iBAAiB,GAAG,SAApBA,iBAAoB;AAAA,SAAuB,IAAvB;AAAA;IAEpBC,SAAS,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,SAAT,CAAmBG,KAAnB,EAA6CC,GAA7C;AACtC,MAAMC,QAAQ,GAAGC,aAAa,CAAiBF,GAAjB,CAA9B;;AACA,MAAQG,SAAR,GAAoGJ,KAApG,CAAQI,SAAR;AAAA,MAAmBC,QAAnB,GAAoGL,KAApG,CAAmBK,QAAnB;AAAA,MAAgDC,YAAhD,GAAoGN,KAApG,CAAgDM,YAAhD;AAAA,MAA8DC,SAA9D,GAAoGP,KAApG,CAA8DO,SAA9D;AAAA,MAAyEC,OAAzE,GAAoGR,KAApG,CAAyEQ,OAAzE;AAAA,MAAqFC,UAArF,iCAAoGT,KAApG;;AAEAF,EAAAA,cAAK,CAACY,SAAN,CAAgB;AACZ,QAAIN,SAAS,IAAIF,QAAQ,CAACS,OAA1B,EAAmC;AAC/BT,MAAAA,QAAQ,CAACS,OAAT,CAAiBC,KAAjB;AACH;AACJ,GAJD,EAIG,EAJH;AAMA,MAAMC,SAAS,GAAGC,EAAE,CAAC,wDAAD,EAA2Dd,KAAK,CAACa,SAAjE,CAApB;AAEA,SACIf,4BAAA,MAAA,oBAASW;AAAYM,IAAAA,IAAI,EAAC;AAAQF,IAAAA,SAAS,EAAEA;AAAWZ,IAAAA,GAAG,EAAEC;IAA7D,EACIJ,4BAAA,MAAA;AAAKiB,IAAAA,IAAI,EAAC;AAAWF,IAAAA,SAAS,EAAC;AAAiBZ,IAAAA,GAAG,EAAEM;GAArD,EACKD,YADL,aACKA,YADL,uBACKA,YAAY,CAAEU,GAAd,CAAkB,UAACC,WAAD,EAAmCC,KAAnC;AAAA,WACfpB,4BAAA,MAAA;AACIqB,MAAAA,GAAG,EAAED;AACLH,MAAAA,IAAI,EAAC;AACLF,MAAAA,SAAS,EAAC;KAHd,EAKKI,WAAW,CAACG,OAAZ,CAAoBJ,GAApB,CAAwB,UAACK,IAAD,EAAYH,KAAZ;AAAA,aACrBpB,4BAAA,CAACwB,MAAD;AAAQH,QAAAA,GAAG,EAAED;AAAOA,QAAAA,KAAK,EAAEA;AAAOG,QAAAA,IAAI,EAAEA;OAAxC,CADqB;AAAA,KAAxB,CALL,CADe;AAAA,GAAlB,CADL,CADJ,EAeIvB,4BAAA,MAAA;AAAKiB,IAAAA,IAAI,EAAC;AAAWF,IAAAA,SAAS,EAAC;AAAiBZ,IAAAA,GAAG,EAAEO;GAArD,EACKH,QADL,CAfJ,CADJ;AAqBH,CAjCwB;;;;"}
1
+ {"version":3,"file":"BaseTable.js","sources":["../../../../../src/components/Table/components/BaseTable.tsx"],"sourcesContent":["import React from 'react';\r\nimport cn from 'classnames';\r\nimport { HeaderGroup } from 'react-table';\r\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\r\nimport { InternalBaseTable } from '../types';\r\nimport './Table.css';\r\nimport { Column } from '../util/renderColumn';\r\n\r\nexport const DefaultEmptyState = (): React.ReactNode => null;\r\n\r\nexport const BaseTable = React.forwardRef(function BaseTable(props: InternalBaseTable, ref: React.Ref<HTMLDivElement>) {\r\n const tableRef = useProxiedRef<HTMLDivElement>(ref);\r\n const { autoFocus, children, disableSorting: _, headerGroups, headerRef, bodyRef, ...otherProps } = props;\r\n\r\n React.useEffect(() => {\r\n if (autoFocus && tableRef.current) {\r\n tableRef.current.focus();\r\n }\r\n }, []);\r\n\r\n const className = cn('yt-table flex flex-col focus:yt-focus focus:rounded-sm', props.className);\r\n\r\n return (\r\n <div {...otherProps} role=\"table\" className={className} ref={tableRef}>\r\n <div role=\"rowgroup\" className=\"yt-table__head\" ref={headerRef}>\r\n {headerGroups?.map((headerGroup: HeaderGroup<object>, index: number) => (\r\n <div\r\n key={index}\r\n role=\"row\"\r\n className=\"border-grey-light flex h-auto min-h-[2.5rem] w-full select-none border-b border-t-0 border-b-2 font-bold\"\r\n >\r\n {headerGroup.headers.map((cell: any, index: number) => (\r\n <Column key={index} index={index} cell={cell} />\r\n ))}\r\n </div>\r\n ))}\r\n </div>\r\n\r\n <div role=\"rowgroup\" className=\"yt-table__body\" ref={bodyRef}>\r\n {children}\r\n </div>\r\n </div>\r\n );\r\n});\r\n"],"names":["DefaultEmptyState","BaseTable","React","forwardRef","props","ref","tableRef","useProxiedRef","autoFocus","children","disableSorting","_","headerGroups","headerRef","bodyRef","otherProps","useEffect","current","focus","className","cn","role","map","headerGroup","index","key","headers","cell","Column"],"mappings":";;;;;MAQaA,iBAAiB,GAAG,MAAuB;MAE3CC,SAAS,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,SAAT,CAAmBG,KAAnB,EAA6CC,GAA7C;AACtC,QAAMC,QAAQ,GAAGC,aAAa,CAAiBF,GAAjB,CAA9B;AACA,QAAM;AAAEG,IAAAA,SAAF;AAAaC,IAAAA,QAAb;AAAuBC,IAAAA,cAAc,EAAEC,CAAvC;AAA0CC,IAAAA,YAA1C;AAAwDC,IAAAA,SAAxD;AAAmEC,IAAAA,OAAnE;AAA4E,OAAGC;AAA/E,MAA8FX,KAApG;AAEAF,EAAAA,cAAK,CAACc,SAAN,CAAgB;AACZ,QAAIR,SAAS,IAAIF,QAAQ,CAACW,OAA1B,EAAmC;AAC/BX,MAAAA,QAAQ,CAACW,OAAT,CAAiBC,KAAjB;AACH;AACJ,GAJD,EAIG,EAJH;AAMA,QAAMC,SAAS,GAAGC,EAAE,CAAC,wDAAD,EAA2DhB,KAAK,CAACe,SAAjE,CAApB;AAEA,SACIjB,4BAAA,MAAA,oBAASa;AAAYM,IAAAA,IAAI,EAAC;AAAQF,IAAAA,SAAS,EAAEA;AAAWd,IAAAA,GAAG,EAAEC;IAA7D,EACIJ,4BAAA,MAAA;AAAKmB,IAAAA,IAAI,EAAC;AAAWF,IAAAA,SAAS,EAAC;AAAiBd,IAAAA,GAAG,EAAEQ;GAArD,EACKD,YADL,aACKA,YADL,uBACKA,YAAY,CAAEU,GAAd,CAAkB,CAACC,WAAD,EAAmCC,KAAnC,KACftB,4BAAA,MAAA;AACIuB,IAAAA,GAAG,EAAED;AACLH,IAAAA,IAAI,EAAC;AACLF,IAAAA,SAAS,EAAC;GAHd,EAKKI,WAAW,CAACG,OAAZ,CAAoBJ,GAApB,CAAwB,CAACK,IAAD,EAAYH,KAAZ,KACrBtB,4BAAA,CAAC0B,MAAD;AAAQH,IAAAA,GAAG,EAAED;AAAOA,IAAAA,KAAK,EAAEA;AAAOG,IAAAA,IAAI,EAAEA;GAAxC,CADH,CALL,CADH,CADL,CADJ,EAeIzB,4BAAA,MAAA;AAAKmB,IAAAA,IAAI,EAAC;AAAWF,IAAAA,SAAS,EAAC;AAAiBd,IAAAA,GAAG,EAAES;GAArD,EACKL,QADL,CAfJ,CADJ;AAqBH,CAjCwB;;;;"}
@@ -1,20 +1,16 @@
1
1
  import React__default from 'react';
2
2
  import { Table } from './Table.js';
3
3
 
4
- var PaginatedTable = /*#__PURE__*/React__default.forwardRef(function PaginatedTable(props, ref) {
4
+ const PaginatedTable = /*#__PURE__*/React__default.forwardRef(function PaginatedTable(props, ref) {
5
5
  return React__default.createElement(Table, Object.assign({}, props, {
6
6
  disablePagination: false,
7
7
  ref: ref
8
8
  }));
9
9
  });
10
10
 
11
- PaginatedTable.Column = function () {
12
- return null;
13
- };
11
+ PaginatedTable.Column = () => null;
14
12
 
15
- PaginatedTable.Group = function () {
16
- return null;
17
- };
13
+ PaginatedTable.Group = () => null;
18
14
 
19
15
  export { PaginatedTable };
20
16
  //# sourceMappingURL=PaginatedTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaginatedTable.js","sources":["../../../../../src/components/Table/components/PaginatedTable.tsx"],"sourcesContent":["import React from 'react';\nimport { ForwardedGenericTableWithStatics, TableProps, TableRef } from '../types';\nimport { Table } from './Table';\n\nexport const PaginatedTable = React.forwardRef(function PaginatedTable<T>(props: TableProps<T>, ref: React.Ref<TableRef>) {\n return <Table {...props} disablePagination={false} ref={ref} />;\n}) as ForwardedGenericTableWithStatics;\n\nPaginatedTable.Column = () => null;\nPaginatedTable.Group = () => null;\n"],"names":["PaginatedTable","React","forwardRef","props","ref","Table","disablePagination","Column","Group"],"mappings":";;;IAIaA,cAAc,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,cAAT,CAA2BG,KAA3B,EAAiDC,GAAjD;AAC3C,SAAOH,4BAAA,CAACI,KAAD,oBAAWF;AAAOG,IAAAA,iBAAiB,EAAE;AAAOF,IAAAA,GAAG,EAAEA;IAAjD,CAAP;AACH,CAF6B;;AAI9BJ,cAAc,CAACO,MAAf,GAAwB;AAAA,SAAM,IAAN;AAAA,CAAxB;;AACAP,cAAc,CAACQ,KAAf,GAAuB;AAAA,SAAM,IAAN;AAAA,CAAvB;;;;"}
1
+ {"version":3,"file":"PaginatedTable.js","sources":["../../../../../src/components/Table/components/PaginatedTable.tsx"],"sourcesContent":["import React from 'react';\r\nimport { ForwardedGenericTableWithStatics, TableProps, TableRef } from '../types';\r\nimport { Table } from './Table';\r\n\r\nexport const PaginatedTable = React.forwardRef(function PaginatedTable<T>(props: TableProps<T>, ref: React.Ref<TableRef>) {\r\n return <Table {...props} disablePagination={false} ref={ref} />;\r\n}) as ForwardedGenericTableWithStatics;\r\n\r\nPaginatedTable.Column = () => null;\r\nPaginatedTable.Group = () => null;\r\n"],"names":["PaginatedTable","React","forwardRef","props","ref","Table","disablePagination","Column","Group"],"mappings":";;;MAIaA,cAAc,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,cAAT,CAA2BG,KAA3B,EAAiDC,GAAjD;AAC3C,SAAOH,4BAAA,CAACI,KAAD,oBAAWF;AAAOG,IAAAA,iBAAiB,EAAE;AAAOF,IAAAA,GAAG,EAAEA;IAAjD,CAAP;AACH,CAF6B;;AAI9BJ,cAAc,CAACO,MAAf,GAAwB,MAAM,IAA9B;;AACAP,cAAc,CAACQ,KAAf,GAAuB,MAAM,IAA7B;;;;"}
@@ -1,4 +1,3 @@
1
- import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import React__default from 'react';
3
2
  import { useProxiedRef } from '../../../utils/hooks/useProxiedRef.js';
4
3
  import { Pagination } from '../../Pagination/Pagination.js';
@@ -6,23 +5,21 @@ import { useTable } from '../hooks/useTable.js';
6
5
  import { Row } from '../util/renderRow.js';
7
6
  import { BaseTable, DefaultEmptyState } from './BaseTable.js';
8
7
 
9
- var _excluded = ["emptyStateRenderer"];
10
- var Table = /*#__PURE__*/React__default.forwardRef(function Table(props, ref) {
11
- var _props$emptyStateRend = props.emptyStateRenderer,
12
- emptyStateRenderer = _props$emptyStateRend === void 0 ? DefaultEmptyState : _props$emptyStateRend,
13
- otherProps = _objectWithoutPropertiesLoose(props, _excluded);
14
-
15
- var tableRef = useProxiedRef(ref);
16
-
17
- var _useTable = useTable(otherProps, tableRef),
18
- rowProps = _useTable.rowProps,
19
- tableProps = _useTable.tableProps,
20
- rows = _useTable.rows,
21
- prepareRow = _useTable.prepareRow,
22
- pagination = _useTable.pagination,
23
- instance = _useTable.instance;
24
-
25
- var paginationElement;
8
+ const Table = /*#__PURE__*/React__default.forwardRef(function Table(props, ref) {
9
+ const {
10
+ emptyStateRenderer = DefaultEmptyState,
11
+ ...otherProps
12
+ } = props;
13
+ const tableRef = useProxiedRef(ref);
14
+ const {
15
+ rowProps,
16
+ tableProps,
17
+ rows,
18
+ prepareRow,
19
+ pagination,
20
+ instance
21
+ } = useTable(otherProps, tableRef);
22
+ let paginationElement;
26
23
 
27
24
  if (pagination) {
28
25
  paginationElement = React__default.createElement(Pagination, {
@@ -39,7 +36,7 @@ var Table = /*#__PURE__*/React__default.forwardRef(function Table(props, ref) {
39
36
 
40
37
  return React__default.createElement(React__default.Fragment, null, paginationElement, React__default.createElement(BaseTable, Object.assign({}, tableProps, {
41
38
  ref: tableRef
42
- }), rows.length ? rows.map(function (row, index) {
39
+ }), rows.length ? rows.map((row, index) => {
43
40
  prepareRow(row, index);
44
41
  return React__default.createElement(Row, Object.assign({}, rowProps, {
45
42
  key: index,
@@ -51,13 +48,9 @@ var Table = /*#__PURE__*/React__default.forwardRef(function Table(props, ref) {
51
48
  }) : emptyStateRenderer()), paginationElement);
52
49
  });
53
50
 
54
- Table.Column = function () {
55
- return null;
56
- };
51
+ Table.Column = () => null;
57
52
 
58
- Table.Group = function () {
59
- return null;
60
- };
53
+ Table.Group = () => null;
61
54
 
62
55
  export { Table };
63
56
  //# sourceMappingURL=Table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","sources":["../../../../../src/components/Table/components/Table.tsx"],"sourcesContent":["import React from 'react';\nimport { PluginHook } from 'react-table';\nimport { TableProps, InternalTableRow, ForwardedGenericTableWithStatics, TableRef } from '../types';\nimport { useTable } from '../hooks/useTable';\nimport { Pagination } from '../../Pagination/Pagination';\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\nimport { Row } from '../util/renderRow';\nimport { DefaultEmptyState, BaseTable } from './BaseTable';\n\nexport const Table = React.forwardRef(function Table<T>(\n props: TableProps<T> & { plugins: PluginHook<{}>[] },\n ref: React.Ref<TableRef>\n) {\n const { emptyStateRenderer = DefaultEmptyState, ...otherProps } = props;\n const tableRef: any = useProxiedRef<HTMLDivElement>(ref);\n const { rowProps, tableProps, rows, prepareRow, pagination, instance } = useTable(otherProps, tableRef);\n\n let paginationElement;\n\n if (pagination) {\n paginationElement = (\n <Pagination\n className=\"my-4 w-full\"\n length={pagination.length}\n pageIndex={pagination.pageIndex}\n pageSize={pagination.pageSize}\n setPageIndex={pagination.setPageIndex}\n setPageSize={pagination.setPageSize}\n showPageControls={pagination.length > pagination.pageSize}\n dangerouslyHijackGlobalKeyboardNavigation={props.dangerouslyHijackGlobalKeyboardNavigation}\n />\n );\n }\n\n return (\n <>\n {paginationElement}\n <BaseTable {...tableProps} ref={tableRef}>\n {rows.length\n ? rows.map((row: InternalTableRow, index: number) => {\n prepareRow(row, index);\n return (\n <Row\n {...rowProps}\n key={index}\n index={index}\n row={row}\n instance={instance}\n headerGroups={tableProps.headerGroups}\n />\n );\n })\n : emptyStateRenderer()}\n </BaseTable>\n {paginationElement}\n </>\n );\n}) as ForwardedGenericTableWithStatics;\n\nTable.Column = () => null;\nTable.Group = () => null;\n"],"names":["Table","React","forwardRef","props","ref","emptyStateRenderer","DefaultEmptyState","otherProps","tableRef","useProxiedRef","useTable","rowProps","tableProps","rows","prepareRow","pagination","instance","paginationElement","Pagination","className","length","pageIndex","pageSize","setPageIndex","setPageSize","showPageControls","dangerouslyHijackGlobalKeyboardNavigation","BaseTable","map","row","index","Row","key","headerGroups","Column","Group"],"mappings":";;;;;;;;;IASaA,KAAK,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,KAAT,CAClCG,KADkC,EAElCC,GAFkC;AAIlC,8BAAkED,KAAlE,CAAQE,kBAAR;AAAA,MAAQA,kBAAR,sCAA6BC,iBAA7B;AAAA,MAAmDC,UAAnD,iCAAkEJ,KAAlE;;AACA,MAAMK,QAAQ,GAAQC,aAAa,CAAiBL,GAAjB,CAAnC;;AACA,kBAAyEM,QAAQ,CAACH,UAAD,EAAaC,QAAb,CAAjF;AAAA,MAAQG,QAAR,aAAQA,QAAR;AAAA,MAAkBC,UAAlB,aAAkBA,UAAlB;AAAA,MAA8BC,IAA9B,aAA8BA,IAA9B;AAAA,MAAoCC,UAApC,aAAo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"file":"Table.js","sources":["../../../../../src/components/Table/components/Table.tsx"],"sourcesContent":["import React from 'react';\r\nimport { PluginHook } from 'react-table';\r\nimport { TableProps, InternalTableRow, ForwardedGenericTableWithStatics, TableRef } from '../types';\r\nimport { useTable } from '../hooks/useTable';\r\nimport { Pagination } from '../../Pagination/Pagination';\r\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\r\nimport { Row } from '../util/renderRow';\r\nimport { DefaultEmptyState, BaseTable } from './BaseTable';\r\n\r\nexport const Table = React.forwardRef(function Table<T>(\r\n props: TableProps<T> & { plugins: PluginHook<{}>[] },\r\n ref: React.Ref<TableRef>\r\n) {\r\n const { emptyStateRenderer = DefaultEmptyState, ...otherProps } = props;\r\n const tableRef: any = useProxiedRef<HTMLDivElement>(ref);\r\n const { rowProps, tableProps, rows, prepareRow, pagination, instance } = useTable(otherProps, tableRef);\r\n\r\n let paginationElement;\r\n\r\n if (pagination) {\r\n paginationElement = (\r\n <Pagination\r\n className=\"my-4 w-full\"\r\n length={pagination.length}\r\n pageIndex={pagination.pageIndex}\r\n pageSize={pagination.pageSize}\r\n setPageIndex={pagination.setPageIndex}\r\n setPageSize={pagination.setPageSize}\r\n showPageControls={pagination.length > pagination.pageSize}\r\n dangerouslyHijackGlobalKeyboardNavigation={props.dangerouslyHijackGlobalKeyboardNavigation}\r\n />\r\n );\r\n }\r\n\r\n return (\r\n <>\r\n {paginationElement}\r\n <BaseTable {...tableProps} ref={tableRef}>\r\n {rows.length\r\n ? rows.map((row: InternalTableRow, index: number) => {\r\n prepareRow(row, index);\r\n return (\r\n <Row\r\n {...rowProps}\r\n key={index}\r\n index={index}\r\n row={row}\r\n instance={instance}\r\n headerGroups={tableProps.headerGroups}\r\n />\r\n );\r\n })\r\n : emptyStateRenderer()}\r\n </BaseTable>\r\n {paginationElement}\r\n </>\r\n );\r\n}) as ForwardedGenericTableWithStatics;\r\n\r\nTable.Column = () => null;\r\nTable.Group = () => null;\r\n"],"names":["Table","React","forwardRef","props","ref","emptyStateRenderer","DefaultEmptyState","otherProps","tableRef","useProxiedRef","rowProps","tableProps","rows","prepareRow","pagination","instance","useTable","paginationElement","Pagination","className","length","pageIndex","pageSize","setPageIndex","setPageSize","showPageControls","dangerouslyHijackGlobalKeyboardNavigation","BaseTable","map","row","index","Row","key","headerGroups","Column","Group"],"mappings":";;;;;;;MASaA,KAAK,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,KAAT,CAClCG,KADkC,EAElCC,GAFkC;AAIlC,QAAM;AAAEC,IAAAA,kBAAkB,GAAGC,iBAAvB;AAA0C,OAAGC;AAA7C,MAA4DJ,KAAlE;AACA,QAAMK,QAAQ,GAAQC,aAAa,CAAiBL,GAAjB,CAAnC;AACA,QAAM;AAAEM,IAAAA,QAAF;AAAYC,IAAAA,UAAZ;AAAwBC,IAAAA,IAAxB;AAA8BC,IAAAA,UAA9B;AAA0CC,IAAAA,UAA1C;AAAsDC,IAAAA;AAAtD,MAAmEC,QAAQ,CAACT,UAAD,EAAaC,QAAb,CAAjF;AAEA,MAAIS,iBAAJ;;AAEA,MAAIH,UAAJ,EAAgB;AACZG,IAAAA,iBAAiB,GACbhB,4BAAA,CAACiB,UAAD;AACIC,MAAAA,SAAS,EAAC;AACVC,MAAAA,MAAM,EAAEN,UAAU,CAACM;AACnBC,MAAAA,SAAS,EAAEP,UAAU,CAACO;AACtBC,MAAAA,QAAQ,EAAER,UAAU,CAACQ;AACrBC,MAAAA,YAAY,EAAET,UAAU,CAACS;AACzBC,MAAAA,WAAW,EAAEV,UAAU,CAACU;AACxBC,MAAAA,gBAAgB,EAAEX,UAAU,CAACM,MAAX,GAAoBN,UAAU,CAACQ;AACjDI,MAAAA,yCAAyC,EAAEvB,KAAK,CAACuB;KARrD,CADJ;AAYH;;AAED,SACIzB,4BAAA,wBAAA,MAAA,EACKgB,iBADL,EAEIhB,4BAAA,CAAC0B,SAAD,oBAAehB;AAAYP,IAAAA,GAAG,EAAEI;IAAhC,EACKI,IAAI,CAACQ,MAAL,GACKR,IAAI,CAACgB,GAAL,CAAS,CAACC,GAAD,EAAwBC,KAAxB;AACLjB,IAAAA,UAAU,CAACgB,GAAD,EAAMC,KAAN,CAAV;AACA,WACI7B,4BAAA,CAAC8B,GAAD,oBACQrB;AACJsB,MAAAA,GAAG,EAAEF;AACLA,MAAAA,KAAK,EAAEA;AACPD,MAAAA,GAAG,EAAEA;AACLd,MAAAA,QAAQ,EAAEA;AACVkB,MAAAA,YAAY,EAAEtB,UAAU,CAACsB;MAN7B,CADJ;AAUH,GAZD,CADL,GAcK5B,kBAAkB,EAf5B,CAFJ,EAmBKY,iBAnBL,CADJ;AAuBH,CAhDoB;;AAkDrBjB,KAAK,CAACkC,MAAN,GAAe,MAAM,IAArB;;AACAlC,KAAK,CAACmC,KAAN,GAAc,MAAM,IAApB;;;;"}
@@ -1,4 +1,3 @@
1
- import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import React__default from 'react';
3
2
  import cn from 'classnames';
4
3
  import { useLocalization } from '../../Provider/Provider.js';
@@ -10,28 +9,30 @@ import { BaseTable, DefaultEmptyState } from './BaseTable.js';
10
9
  import { VariableSizeList, areEqual } from 'react-window';
11
10
  import InfiniteLoader from 'react-window-infinite-loader';
12
11
 
13
- var _excluded = ["height"],
14
- _excluded2 = ["emptyStateRenderer", "length", "loadMore"];
15
- var ROW_HEIGHT = 40;
16
- var VariableRow = /*#__PURE__*/React__default.memo(function (_ref) {
17
- var data = _ref.data,
18
- index = _ref.index,
19
- _ref$style = _ref.style,
20
- style = _objectWithoutPropertiesLoose(_ref$style, _excluded);
21
-
22
- var _useLocalization = useLocalization(),
23
- texts = _useLocalization.texts;
24
-
25
- var rows = data.rows,
26
- setRowHeight = data.setRowHeight,
27
- rowProps = data.rowProps,
28
- tableProps = data.tableProps,
29
- instance = data.instance,
30
- prepareRow = data.prepareRow,
31
- rowHeights = data.rowHeights;
32
- var row = rows[index];
33
- var ref = React__default.useRef(null);
34
- React__default.useEffect(function () {
12
+ const ROW_HEIGHT = 40;
13
+ const VariableRow = /*#__PURE__*/React__default.memo(({
14
+ data,
15
+ index,
16
+ style: {
17
+ height: _,
18
+ ...style
19
+ }
20
+ }) => {
21
+ const {
22
+ texts
23
+ } = useLocalization();
24
+ const {
25
+ rows,
26
+ setRowHeight,
27
+ rowProps,
28
+ tableProps,
29
+ instance,
30
+ prepareRow,
31
+ rowHeights
32
+ } = data;
33
+ const row = rows[index];
34
+ const ref = React__default.useRef(null);
35
+ React__default.useEffect(() => {
35
36
  if (ref !== null && ref !== void 0 && ref.current) {
36
37
  setRowHeight(index, ref.current.getBoundingClientRect().height);
37
38
  }
@@ -60,121 +61,108 @@ var VariableRow = /*#__PURE__*/React__default.memo(function (_ref) {
60
61
  }, texts.table.loading));
61
62
  }, areEqual);
62
63
 
63
- var getAverageRowHeight = function getAverageRowHeight(rowHeights) {
64
- if (rowHeights === void 0) {
65
- rowHeights = {};
66
- }
67
-
68
- var keys = Object.keys(rowHeights);
69
- var estimatedHeight = keys.reduce(function (p, i) {
70
- return p + rowHeights[i];
71
- }, 0);
64
+ const getAverageRowHeight = (rowHeights = {}) => {
65
+ const keys = Object.keys(rowHeights);
66
+ const estimatedHeight = keys.reduce((p, i) => p + rowHeights[i], 0);
72
67
  return estimatedHeight / keys.length;
73
68
  };
74
69
 
75
- var WindowedTable = /*#__PURE__*/React__default.forwardRef(function WindowedTable(props, ref) {
76
- var tableRef = useProxiedRef(ref);
70
+ const WindowedTable = /*#__PURE__*/React__default.forwardRef(function WindowedTable(props, ref) {
71
+ const tableRef = useProxiedRef(ref);
72
+ const {
73
+ emptyStateRenderer = DefaultEmptyState,
74
+ length,
75
+ loadMore,
76
+ ...otherProps
77
+ } = props;
78
+ const {
79
+ rowProps,
80
+ tableProps,
81
+ rows,
82
+ prepareRow,
83
+ instance,
84
+ state
85
+ } = useTable({ ...otherProps,
86
+ windowed: true
87
+ }, tableRef); // determine heights for windowing calculations
77
88
 
78
- var _props$emptyStateRend = props.emptyStateRenderer,
79
- emptyStateRenderer = _props$emptyStateRend === void 0 ? DefaultEmptyState : _props$emptyStateRend,
80
- length = props.length,
81
- loadMore = props.loadMore,
82
- otherProps = _objectWithoutPropertiesLoose(props, _excluded2);
89
+ const headerRef = React__default.useRef(null);
90
+ const rowsRef = React__default.useRef(null);
91
+ const tableDimensions = useBoundingClientRectListener(tableRef);
92
+ const headerDimensions = useBoundingClientRectListener(headerRef);
93
+ const height = tableDimensions && headerDimensions ? tableDimensions.height - headerDimensions.height : null; // variable row height calculations
83
94
 
84
- var _useTable = useTable(_extends({}, otherProps, {
85
- windowed: true
86
- }), tableRef),
87
- rowProps = _useTable.rowProps,
88
- tableProps = _useTable.tableProps,
89
- rows = _useTable.rows,
90
- prepareRow = _useTable.prepareRow,
91
- instance = _useTable.instance,
92
- state = _useTable.state; // determine heights for windowing calculations
93
-
94
-
95
- var headerRef = React__default.useRef(null);
96
- var rowsRef = React__default.useRef(null);
97
- var tableDimensions = useBoundingClientRectListener(tableRef);
98
- var headerDimensions = useBoundingClientRectListener(headerRef);
99
- var height = tableDimensions && headerDimensions ? tableDimensions.height - headerDimensions.height : null; // variable row height calculations
100
-
101
- var estimatedRowHeight = rowProps.rowHeight || ROW_HEIGHT;
102
- var rowHeights = React__default.useRef({});
103
- var setRowHeight = React__default.useCallback(function (index, size) {
95
+ const estimatedRowHeight = rowProps.rowHeight || ROW_HEIGHT;
96
+ const rowHeights = React__default.useRef({});
97
+ const setRowHeight = React__default.useCallback((index, size) => {
104
98
  if (rowHeights.current[index] !== size) {
105
- var _extends2;
106
-
107
- rowHeights.current = _extends({}, rowHeights.current, (_extends2 = {}, _extends2[index] = size, _extends2));
99
+ rowHeights.current = { ...rowHeights.current,
100
+ [index]: size
101
+ };
108
102
 
109
103
  if (rowsRef.current) {
110
104
  rowsRef.current.resetAfterIndex(0);
111
105
  }
112
106
  }
113
107
  }, []);
114
- var getRowHeight = React__default.useCallback(function (index) {
115
- return rowHeights.current[index] || estimatedRowHeight;
116
- }, []);
117
- React__default.useEffect(function () {
108
+ const getRowHeight = React__default.useCallback(index => rowHeights.current[index] || estimatedRowHeight, []);
109
+ React__default.useEffect(() => {
118
110
  if (rowsRef && rowsRef.current && rowProps.activeIndex !== undefined) {
119
111
  rowsRef.current.scrollToItem(rowProps.activeIndex);
120
112
  }
121
113
  }, [rowProps.activeIndex]); // trigger recalculation of variable row heights if the data changes
122
114
 
123
- React__default.useEffect(function () {
115
+ React__default.useEffect(() => {
124
116
  rowHeights.current = {};
125
117
 
126
118
  if (rowsRef.current) {
127
119
  rowsRef.current.resetAfterIndex(0);
128
120
  }
129
121
  }, [rows.length]);
130
- var contentHeight = estimatedRowHeight * props.data.length || 0;
131
- var isScrollbarVisible = height !== null ? contentHeight > height : false;
132
- var className = cn(tableProps.className, 'yt-table--windowed', {
122
+ const contentHeight = estimatedRowHeight * props.data.length || 0;
123
+ const isScrollbarVisible = height !== null ? contentHeight > height : false;
124
+ const className = cn(tableProps.className, 'yt-table--windowed', {
133
125
  'table-with-scrollbar': isScrollbarVisible
134
126
  });
135
- var list;
136
- var itemData = {
137
- rows: rows,
138
- setRowHeight: setRowHeight,
139
- rowProps: rowProps,
140
- tableProps: tableProps,
141
- instance: instance,
142
- prepareRow: prepareRow,
143
- state: state,
127
+ let list;
128
+ const itemData = {
129
+ rows,
130
+ setRowHeight,
131
+ rowProps,
132
+ tableProps,
133
+ instance,
134
+ prepareRow,
135
+ state,
144
136
  rowHeights: rowHeights.current
145
137
  };
146
138
 
147
139
  if (height && rows.length) {
148
- var listProps = {
149
- height: height,
150
- itemData: itemData,
140
+ const listProps = {
141
+ height,
142
+ itemData,
151
143
  estimatedItemSize: getAverageRowHeight(rowHeights.current),
152
144
  itemSize: getRowHeight,
153
145
  width: '100%'
154
146
  };
155
147
 
156
148
  if (loadMore && length) {
157
- var isLoaded = function isLoaded(index) {
158
- return !!rows[index];
159
- };
149
+ const isLoaded = index => !!rows[index];
160
150
 
161
151
  list = React__default.createElement(InfiniteLoader, {
162
152
  isItemLoaded: isLoaded,
163
153
  itemCount: length,
164
154
  loadMoreItems: loadMore
165
- }, function (_ref2) {
166
- var onItemsRendered = _ref2.onItemsRendered,
167
- _ref3 = _ref2.ref;
168
- return React__default.createElement(VariableSizeList, Object.assign({}, listProps, {
169
- itemCount: length,
170
- onItemsRendered: onItemsRendered,
171
- ref: function ref(list) {
172
- _ref3(list);
173
-
174
- rowsRef.current = list;
175
- }
176
- }), VariableRow);
177
- });
155
+ }, ({
156
+ onItemsRendered,
157
+ ref
158
+ }) => React__default.createElement(VariableSizeList, Object.assign({}, listProps, {
159
+ itemCount: length,
160
+ onItemsRendered: onItemsRendered,
161
+ ref: list => {
162
+ ref(list);
163
+ rowsRef.current = list;
164
+ }
165
+ }), VariableRow));
178
166
  } else {
179
167
  list = React__default.createElement(VariableSizeList, Object.assign({}, listProps, {
180
168
  itemCount: rows.length,
@@ -190,13 +178,9 @@ var WindowedTable = /*#__PURE__*/React__default.forwardRef(function WindowedTabl
190
178
  }), list ? list : emptyStateRenderer());
191
179
  });
192
180
 
193
- WindowedTable.Column = function () {
194
- return null;
195
- };
181
+ WindowedTable.Column = () => null;
196
182
 
197
- WindowedTable.Group = function () {
198
- return null;
199
- };
183
+ WindowedTable.Group = () => null;
200
184
 
201
185
  export { WindowedTable };
202
186
  //# sourceMappingURL=WindowedTable.js.map