@economic/taco 1.0.3 → 1.0.6

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 (385) hide show
  1. package/README.md +84 -84
  2. package/dist/esm/components/Accordion/Accordion.js.map +1 -1
  3. package/dist/esm/components/Backdrop/Backdrop.js.map +1 -1
  4. package/dist/esm/components/Badge/Badge.js.map +1 -1
  5. package/dist/esm/components/Banner/Banner.js.map +1 -1
  6. package/dist/esm/components/Banner/util.js +1 -1
  7. package/dist/esm/components/Banner/util.js.map +1 -1
  8. package/dist/esm/components/Button/Button.js.map +1 -1
  9. package/dist/esm/components/Button/util.js +18 -23
  10. package/dist/esm/components/Button/util.js.map +1 -1
  11. package/dist/esm/components/Calendar/Calendar.js.map +1 -1
  12. package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
  13. package/dist/esm/components/Combobox/Combobox.js.map +1 -1
  14. package/dist/esm/components/Combobox/useCombobox.js +67 -87
  15. package/dist/esm/components/Combobox/useCombobox.js.map +1 -1
  16. package/dist/esm/components/Datepicker/Datepicker.js.map +1 -1
  17. package/dist/esm/components/Datepicker/useDatepicker.js +27 -34
  18. package/dist/esm/components/Datepicker/useDatepicker.js.map +1 -1
  19. package/dist/esm/components/Dialog/Context.js +4 -4
  20. package/dist/esm/components/Dialog/Context.js.map +1 -1
  21. package/dist/esm/components/Dialog/Dialog.js.map +1 -1
  22. package/dist/esm/components/Dialog/components/Content.js +39 -44
  23. package/dist/esm/components/Dialog/components/Content.js.map +1 -1
  24. package/dist/esm/components/Dialog/components/Drawer.js +3 -3
  25. package/dist/esm/components/Dialog/components/Drawer.js.map +1 -1
  26. package/dist/esm/components/Dialog/components/Extra.js +2 -2
  27. package/dist/esm/components/Dialog/components/Extra.js.map +1 -1
  28. package/dist/esm/components/Dialog/components/Trigger.js +2 -2
  29. package/dist/esm/components/Dialog/components/Trigger.js.map +1 -1
  30. package/dist/esm/components/Field/Field.js.map +1 -1
  31. package/dist/esm/components/Form/Form.js.map +1 -1
  32. package/dist/esm/components/Group/Group.js.map +1 -1
  33. package/dist/esm/components/Hanger/Hanger.js.map +1 -1
  34. package/dist/esm/components/HoverCard/HoverCard.js.map +1 -1
  35. package/dist/esm/components/Icon/Icon.js.map +1 -1
  36. package/dist/esm/components/Icon/components/AccountPreview.js.map +1 -1
  37. package/dist/esm/components/Icon/components/Accounting.js.map +1 -1
  38. package/dist/esm/components/Icon/components/AccountingYear.js.map +1 -1
  39. package/dist/esm/components/Icon/components/AccountingYearCancel.js.map +1 -1
  40. package/dist/esm/components/Icon/components/ArrowBottom.js.map +1 -1
  41. package/dist/esm/components/Icon/components/ArrowDown.js.map +1 -1
  42. package/dist/esm/components/Icon/components/ArrowEnd.js.map +1 -1
  43. package/dist/esm/components/Icon/components/ArrowLeft.js.map +1 -1
  44. package/dist/esm/components/Icon/components/ArrowRight.js.map +1 -1
  45. package/dist/esm/components/Icon/components/ArrowStart.js.map +1 -1
  46. package/dist/esm/components/Icon/components/ArrowTop.js.map +1 -1
  47. package/dist/esm/components/Icon/components/ArrowUp.js.map +1 -1
  48. package/dist/esm/components/Icon/components/Attach.js.map +1 -1
  49. package/dist/esm/components/Icon/components/AttachAuto.js.map +1 -1
  50. package/dist/esm/components/Icon/components/AttachCancel.js.map +1 -1
  51. package/dist/esm/components/Icon/components/Autotext.js.map +1 -1
  52. package/dist/esm/components/Icon/components/AutotextInsert.js.map +1 -1
  53. package/dist/esm/components/Icon/components/Basic.js.map +1 -1
  54. package/dist/esm/components/Icon/components/BasicTabs.js.map +1 -1
  55. package/dist/esm/components/Icon/components/BellSolid.js.map +1 -1
  56. package/dist/esm/components/Icon/components/Book.js.map +1 -1
  57. package/dist/esm/components/Icon/components/Booking.js.map +1 -1
  58. package/dist/esm/components/Icon/components/Budget.js.map +1 -1
  59. package/dist/esm/components/Icon/components/Calendar.js.map +1 -1
  60. package/dist/esm/components/Icon/components/CashAccount.js.map +1 -1
  61. package/dist/esm/components/Icon/components/CashReports.js.map +1 -1
  62. package/dist/esm/components/Icon/components/Chat.js.map +1 -1
  63. package/dist/esm/components/Icon/components/ChatSolid.js.map +1 -1
  64. package/dist/esm/components/Icon/components/ChevronDown.js.map +1 -1
  65. package/dist/esm/components/Icon/components/ChevronDownDouble.js.map +1 -1
  66. package/dist/esm/components/Icon/components/ChevronDownSolid.js.map +1 -1
  67. package/dist/esm/components/Icon/components/ChevronLeft.js.map +1 -1
  68. package/dist/esm/components/Icon/components/ChevronLeftDouble.js.map +1 -1
  69. package/dist/esm/components/Icon/components/ChevronRight.js.map +1 -1
  70. package/dist/esm/components/Icon/components/ChevronRightDouble.js.map +1 -1
  71. package/dist/esm/components/Icon/components/ChevronUp.js.map +1 -1
  72. package/dist/esm/components/Icon/components/ChevronUpDouble.js.map +1 -1
  73. package/dist/esm/components/Icon/components/ChevronUpSolid.js.map +1 -1
  74. package/dist/esm/components/Icon/components/CircleClose.js.map +1 -1
  75. package/dist/esm/components/Icon/components/CircleMinus.js.map +1 -1
  76. package/dist/esm/components/Icon/components/CirclePlus.js.map +1 -1
  77. package/dist/esm/components/Icon/components/CircleTick.js.map +1 -1
  78. package/dist/esm/components/Icon/components/Clamp.js.map +1 -1
  79. package/dist/esm/components/Icon/components/ClampOpen.js.map +1 -1
  80. package/dist/esm/components/Icon/components/Close.js.map +1 -1
  81. package/dist/esm/components/Icon/components/ConnectionEnable.js.map +1 -1
  82. package/dist/esm/components/Icon/components/ConnectionRevoke.js.map +1 -1
  83. package/dist/esm/components/Icon/components/Contacts.js.map +1 -1
  84. package/dist/esm/components/Icon/components/Copy.js.map +1 -1
  85. package/dist/esm/components/Icon/components/Courses.js.map +1 -1
  86. package/dist/esm/components/Icon/components/Credit.js.map +1 -1
  87. package/dist/esm/components/Icon/components/Delete.js.map +1 -1
  88. package/dist/esm/components/Icon/components/DeletePermanently.js.map +1 -1
  89. package/dist/esm/components/Icon/components/Depecriate.js.map +1 -1
  90. package/dist/esm/components/Icon/components/Developer.js.map +1 -1
  91. package/dist/esm/components/Icon/components/DistributionTemplate.js.map +1 -1
  92. package/dist/esm/components/Icon/components/Document.js.map +1 -1
  93. package/dist/esm/components/Icon/components/DocumentApprove.js.map +1 -1
  94. package/dist/esm/components/Icon/components/DocumentCreateEntry.js.map +1 -1
  95. package/dist/esm/components/Icon/components/DocumentCut.js.map +1 -1
  96. package/dist/esm/components/Icon/components/DocumentError.js.map +1 -1
  97. package/dist/esm/components/Icon/components/DocumentIsolatePage.js.map +1 -1
  98. package/dist/esm/components/Icon/components/DocumentMerge.js.map +1 -1
  99. package/dist/esm/components/Icon/components/DocumentMove.js.map +1 -1
  100. package/dist/esm/components/Icon/components/DocumentPreview.js.map +1 -1
  101. package/dist/esm/components/Icon/components/DocumentReceived.js.map +1 -1
  102. package/dist/esm/components/Icon/components/DocumentRejectedRequest.js.map +1 -1
  103. package/dist/esm/components/Icon/components/DocumentSplit.js.map +1 -1
  104. package/dist/esm/components/Icon/components/DocumentTime.js.map +1 -1
  105. package/dist/esm/components/Icon/components/Download.js.map +1 -1
  106. package/dist/esm/components/Icon/components/Drag.js.map +1 -1
  107. package/dist/esm/components/Icon/components/ECopedia.js.map +1 -1
  108. package/dist/esm/components/Icon/components/ESignature.js.map +1 -1
  109. package/dist/esm/components/Icon/components/Edit.js.map +1 -1
  110. package/dist/esm/components/Icon/components/EllipsisHorizontal.js.map +1 -1
  111. package/dist/esm/components/Icon/components/EllipsisVertical.js.map +1 -1
  112. package/dist/esm/components/Icon/components/EntriesOnAccount.js.map +1 -1
  113. package/dist/esm/components/Icon/components/EntriesOpen.js.map +1 -1
  114. package/dist/esm/components/Icon/components/EntriesWarning.js.map +1 -1
  115. package/dist/esm/components/Icon/components/EntryTypeCustomerInvoice.js.map +1 -1
  116. package/dist/esm/components/Icon/components/EntryTypeCustomerPayment.js.map +1 -1
  117. package/dist/esm/components/Icon/components/EntryTypeJournalEntry.js.map +1 -1
  118. package/dist/esm/components/Icon/components/EntryTypeManualCustomerInvoice.js.map +1 -1
  119. package/dist/esm/components/Icon/components/EntryTypeSupplierInvoice.js.map +1 -1
  120. package/dist/esm/components/Icon/components/EntryTypeSupplierPayment.js.map +1 -1
  121. package/dist/esm/components/Icon/components/Envelope.js.map +1 -1
  122. package/dist/esm/components/Icon/components/EnvelopeApproved.js.map +1 -1
  123. package/dist/esm/components/Icon/components/ExpandView.js.map +1 -1
  124. package/dist/esm/components/Icon/components/Expenses.js.map +1 -1
  125. package/dist/esm/components/Icon/components/Export.js.map +1 -1
  126. package/dist/esm/components/Icon/components/ExportToExcel.js.map +1 -1
  127. package/dist/esm/components/Icon/components/ExportToPdf.js.map +1 -1
  128. package/dist/esm/components/Icon/components/Filter.js.map +1 -1
  129. package/dist/esm/components/Icon/components/FilterSolid.js.map +1 -1
  130. package/dist/esm/components/Icon/components/GraphSolid.js.map +1 -1
  131. package/dist/esm/components/Icon/components/Hash.js.map +1 -1
  132. package/dist/esm/components/Icon/components/Home.js.map +1 -1
  133. package/dist/esm/components/Icon/components/Images.js.map +1 -1
  134. package/dist/esm/components/Icon/components/Import.js.map +1 -1
  135. package/dist/esm/components/Icon/components/Inbox.js.map +1 -1
  136. package/dist/esm/components/Icon/components/InboxEinvoicing.js.map +1 -1
  137. package/dist/esm/components/Icon/components/InboxScanning.js.map +1 -1
  138. package/dist/esm/components/Icon/components/InboxSmart.js.map +1 -1
  139. package/dist/esm/components/Icon/components/Info.js.map +1 -1
  140. package/dist/esm/components/Icon/components/Inventory.js.map +1 -1
  141. package/dist/esm/components/Icon/components/InventoryMatrix.js.map +1 -1
  142. package/dist/esm/components/Icon/components/JournalPro.js.map +1 -1
  143. package/dist/esm/components/Icon/components/Layout.js.map +1 -1
  144. package/dist/esm/components/Icon/components/LayoutBoth.js.map +1 -1
  145. package/dist/esm/components/Icon/components/LayoutFirst.js.map +1 -1
  146. package/dist/esm/components/Icon/components/LayoutLast.js.map +1 -1
  147. package/dist/esm/components/Icon/components/LayoutNone.js.map +1 -1
  148. package/dist/esm/components/Icon/components/LedgerCard.js.map +1 -1
  149. package/dist/esm/components/Icon/components/LedgerCardCustomerReminder.js.map +1 -1
  150. package/dist/esm/components/Icon/components/LedgerCardManualCustomerInvoice.js.map +1 -1
  151. package/dist/esm/components/Icon/components/LedgerCardObsoleteStock.js.map +1 -1
  152. package/dist/esm/components/Icon/components/LedgerCardOpeningEntry.js.map +1 -1
  153. package/dist/esm/components/Icon/components/LedgerCardReservedEntry.js.map +1 -1
  154. package/dist/esm/components/Icon/components/LedgerCardShrinkagePilferage.js.map +1 -1
  155. package/dist/esm/components/Icon/components/LedgerCardStockAdjustment.js.map +1 -1
  156. package/dist/esm/components/Icon/components/LedgerCardTransferredOpeningEntry.js.map +1 -1
  157. package/dist/esm/components/Icon/components/Lightbulb.js.map +1 -1
  158. package/dist/esm/components/Icon/components/Line.js.map +1 -1
  159. package/dist/esm/components/Icon/components/List.js.map +1 -1
  160. package/dist/esm/components/Icon/components/ListBulleted.js.map +1 -1
  161. package/dist/esm/components/Icon/components/ListSearch.js.map +1 -1
  162. package/dist/esm/components/Icon/components/LockOpen.js.map +1 -1
  163. package/dist/esm/components/Icon/components/Log.js.map +1 -1
  164. package/dist/esm/components/Icon/components/Market.js.map +1 -1
  165. package/dist/esm/components/Icon/components/MatchAmount.js.map +1 -1
  166. package/dist/esm/components/Icon/components/MatchEntries.js.map +1 -1
  167. package/dist/esm/components/Icon/components/Mileage.js.map +1 -1
  168. package/dist/esm/components/Icon/components/ModalResize.js.map +1 -1
  169. package/dist/esm/components/Icon/components/ModalShrink.js.map +1 -1
  170. package/dist/esm/components/Icon/components/More.js.map +1 -1
  171. package/dist/esm/components/Icon/components/MoreSolid.js.map +1 -1
  172. package/dist/esm/components/Icon/components/Move.js.map +1 -1
  173. package/dist/esm/components/Icon/components/NavigationList.js.map +1 -1
  174. package/dist/esm/components/Icon/components/Note.js.map +1 -1
  175. package/dist/esm/components/Icon/components/NoteFollowUp.js.map +1 -1
  176. package/dist/esm/components/Icon/components/NoteRead.js.map +1 -1
  177. package/dist/esm/components/Icon/components/PartnerApi.js.map +1 -1
  178. package/dist/esm/components/Icon/components/Period.js.map +1 -1
  179. package/dist/esm/components/Icon/components/PersonChange.js.map +1 -1
  180. package/dist/esm/components/Icon/components/PersonMinus.js.map +1 -1
  181. package/dist/esm/components/Icon/components/PersonPlus.js.map +1 -1
  182. package/dist/esm/components/Icon/components/PersonTick.js.map +1 -1
  183. package/dist/esm/components/Icon/components/Play.js.map +1 -1
  184. package/dist/esm/components/Icon/components/PlusMinus.js.map +1 -1
  185. package/dist/esm/components/Icon/components/Print.js.map +1 -1
  186. package/dist/esm/components/Icon/components/ProcessPayment.js.map +1 -1
  187. package/dist/esm/components/Icon/components/ProductLedgerCard.js.map +1 -1
  188. package/dist/esm/components/Icon/components/ProjectCards.js.map +1 -1
  189. package/dist/esm/components/Icon/components/Projects.js.map +1 -1
  190. package/dist/esm/components/Icon/components/Quicklinks.js.map +1 -1
  191. package/dist/esm/components/Icon/components/RatingBankruptcy.js.map +1 -1
  192. package/dist/esm/components/Icon/components/RatingPaymentProblems.js.map +1 -1
  193. package/dist/esm/components/Icon/components/Reconciled.js.map +1 -1
  194. package/dist/esm/components/Icon/components/Refresh.js.map +1 -1
  195. package/dist/esm/components/Icon/components/Report.js.map +1 -1
  196. package/dist/esm/components/Icon/components/ReportSolid.js.map +1 -1
  197. package/dist/esm/components/Icon/components/Restore.js.map +1 -1
  198. package/dist/esm/components/Icon/components/RotateLeft.js.map +1 -1
  199. package/dist/esm/components/Icon/components/RotateRight.js.map +1 -1
  200. package/dist/esm/components/Icon/components/Sales.js.map +1 -1
  201. package/dist/esm/components/Icon/components/Search.js.map +1 -1
  202. package/dist/esm/components/Icon/components/SearchBold.js.map +1 -1
  203. package/dist/esm/components/Icon/components/Secure.js.map +1 -1
  204. package/dist/esm/components/Icon/components/SecureTick.js.map +1 -1
  205. package/dist/esm/components/Icon/components/Settings.js.map +1 -1
  206. package/dist/esm/components/Icon/components/SettingsSolid.js.map +1 -1
  207. package/dist/esm/components/Icon/components/Shortcuts.js.map +1 -1
  208. package/dist/esm/components/Icon/components/ShowAll.js.map +1 -1
  209. package/dist/esm/components/Icon/components/ShowLess.js.map +1 -1
  210. package/dist/esm/components/Icon/components/ShowMore.js.map +1 -1
  211. package/dist/esm/components/Icon/components/ShowTemplate.js.map +1 -1
  212. package/dist/esm/components/Icon/components/Sliders.js.map +1 -1
  213. package/dist/esm/components/Icon/components/Smartpay.js.map +1 -1
  214. package/dist/esm/components/Icon/components/SortBy.js.map +1 -1
  215. package/dist/esm/components/Icon/components/Spinner.js.map +1 -1
  216. package/dist/esm/components/Icon/components/Star.js.map +1 -1
  217. package/dist/esm/components/Icon/components/StarSolid.js.map +1 -1
  218. package/dist/esm/components/Icon/components/Subscriptions.js.map +1 -1
  219. package/dist/esm/components/Icon/components/SystemEntries.js.map +1 -1
  220. package/dist/esm/components/Icon/components/Tag.js.map +1 -1
  221. package/dist/esm/components/Icon/components/TemplateOverride.js.map +1 -1
  222. package/dist/esm/components/Icon/components/Templates.js.map +1 -1
  223. package/dist/esm/components/Icon/components/ThumbBoth.js.map +1 -1
  224. package/dist/esm/components/Icon/components/ThumbDown.js.map +1 -1
  225. package/dist/esm/components/Icon/components/ThumbDownSolid.js.map +1 -1
  226. package/dist/esm/components/Icon/components/ThumbUp.js.map +1 -1
  227. package/dist/esm/components/Icon/components/ThumbUpSolid.js.map +1 -1
  228. package/dist/esm/components/Icon/components/Tick.js.map +1 -1
  229. package/dist/esm/components/Icon/components/Time.js.map +1 -1
  230. package/dist/esm/components/Icon/components/Transfer.js.map +1 -1
  231. package/dist/esm/components/Icon/components/TransferCancel.js.map +1 -1
  232. package/dist/esm/components/Icon/components/TransferLocked.js.map +1 -1
  233. package/dist/esm/components/Icon/components/Undock.js.map +1 -1
  234. package/dist/esm/components/Icon/components/Unreconciled.js.map +1 -1
  235. package/dist/esm/components/Icon/components/Warning.js.map +1 -1
  236. package/dist/esm/components/Icon/components/Webshop.js.map +1 -1
  237. package/dist/esm/components/Icon/components/Website.js.map +1 -1
  238. package/dist/esm/components/Icon/components/Workflow.js.map +1 -1
  239. package/dist/esm/components/Icon/components/Zoom.js.map +1 -1
  240. package/dist/esm/components/Icon/components/index.js +4 -4
  241. package/dist/esm/components/Icon/components/index.js.map +1 -1
  242. package/dist/esm/components/IconButton/IconButton.js.map +1 -1
  243. package/dist/esm/components/Input/Input.js.map +1 -1
  244. package/dist/esm/components/Input/util.js +2 -2
  245. package/dist/esm/components/Input/util.js.map +1 -1
  246. package/dist/esm/components/Listbox/Listbox.js.map +1 -1
  247. package/dist/esm/components/Listbox/ScrollableList.js +64 -83
  248. package/dist/esm/components/Listbox/ScrollableList.js.map +1 -1
  249. package/dist/esm/components/Listbox/useListbox.js +51 -60
  250. package/dist/esm/components/Listbox/useListbox.js.map +1 -1
  251. package/dist/esm/components/Listbox/useMultiListbox.js +64 -91
  252. package/dist/esm/components/Listbox/useMultiListbox.js.map +1 -1
  253. package/dist/esm/components/Listbox/useTypeahead.js +10 -9
  254. package/dist/esm/components/Listbox/useTypeahead.js.map +1 -1
  255. package/dist/esm/components/Listbox/util.js +48 -85
  256. package/dist/esm/components/Listbox/util.js.map +1 -1
  257. package/dist/esm/components/Menu/Context.js +2 -2
  258. package/dist/esm/components/Menu/Context.js.map +1 -1
  259. package/dist/esm/components/Menu/Menu.js.map +1 -1
  260. package/dist/esm/components/Menu/components/Checkbox.js +8 -9
  261. package/dist/esm/components/Menu/components/Checkbox.js.map +1 -1
  262. package/dist/esm/components/Menu/components/Content.js +10 -13
  263. package/dist/esm/components/Menu/components/Content.js.map +1 -1
  264. package/dist/esm/components/Menu/components/Header.js +4 -4
  265. package/dist/esm/components/Menu/components/Header.js.map +1 -1
  266. package/dist/esm/components/Menu/components/Item.js +34 -35
  267. package/dist/esm/components/Menu/components/Item.js.map +1 -1
  268. package/dist/esm/components/Menu/components/Link.js +10 -11
  269. package/dist/esm/components/Menu/components/Link.js.map +1 -1
  270. package/dist/esm/components/Menu/components/RadioGroup.js +16 -18
  271. package/dist/esm/components/Menu/components/RadioGroup.js.map +1 -1
  272. package/dist/esm/components/Menu/components/Separator.js +4 -4
  273. package/dist/esm/components/Menu/components/Separator.js.map +1 -1
  274. package/dist/esm/components/Menu/components/Trigger.js +5 -5
  275. package/dist/esm/components/Menu/components/Trigger.js.map +1 -1
  276. package/dist/esm/components/Navigation/Navigation.js +35 -44
  277. package/dist/esm/components/Navigation/Navigation.js.map +1 -1
  278. package/dist/esm/components/Pagination/PageNumbers.js +23 -28
  279. package/dist/esm/components/Pagination/PageNumbers.js.map +1 -1
  280. package/dist/esm/components/Pagination/Pagination.js +39 -56
  281. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  282. package/dist/esm/components/Pagination/usePagination.js +7 -21
  283. package/dist/esm/components/Pagination/usePagination.js.map +1 -1
  284. package/dist/esm/components/Pagination/usePaginationShortcuts.js +9 -9
  285. package/dist/esm/components/Pagination/usePaginationShortcuts.js.map +1 -1
  286. package/dist/esm/components/Popover/Popover.js +29 -34
  287. package/dist/esm/components/Popover/Popover.js.map +1 -1
  288. package/dist/esm/components/Popover/Primitives.js +7 -8
  289. package/dist/esm/components/Popover/Primitives.js.map +1 -1
  290. package/dist/esm/components/Progress/Progress.js +11 -15
  291. package/dist/esm/components/Progress/Progress.js.map +1 -1
  292. package/dist/esm/components/Provider/Provider.js +13 -18
  293. package/dist/esm/components/Provider/Provider.js.map +1 -1
  294. package/dist/esm/components/RadioGroup/RadioGroup.js +45 -57
  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 +30 -31
  298. package/dist/esm/components/Select/Select.js.map +1 -1
  299. package/dist/esm/components/Select/useSelect.js +63 -81
  300. package/dist/esm/components/Select/useSelect.js.map +1 -1
  301. package/dist/esm/components/Spinner/Spinner.js +12 -19
  302. package/dist/esm/components/Spinner/Spinner.js.map +1 -1
  303. package/dist/esm/components/Switch/Switch.js +9 -10
  304. package/dist/esm/components/Switch/Switch.js.map +1 -1
  305. package/dist/esm/components/Table/components/BaseTable.js +23 -30
  306. package/dist/esm/components/Table/components/BaseTable.js.map +1 -1
  307. package/dist/esm/components/Table/components/PaginatedTable.js +3 -7
  308. package/dist/esm/components/Table/components/PaginatedTable.js.map +1 -1
  309. package/dist/esm/components/Table/components/Table.js +18 -25
  310. package/dist/esm/components/Table/components/Table.js.map +1 -1
  311. package/dist/esm/components/Table/components/WindowedTable.js +88 -104
  312. package/dist/esm/components/Table/components/WindowedTable.js.map +1 -1
  313. package/dist/esm/components/Table/hooks/plugins/useRowActions.js +122 -147
  314. package/dist/esm/components/Table/hooks/plugins/useRowActions.js.map +1 -1
  315. package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js +57 -61
  316. package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js.map +1 -1
  317. package/dist/esm/components/Table/hooks/plugins/useRowEditing.js +39 -36
  318. package/dist/esm/components/Table/hooks/plugins/useRowEditing.js.map +1 -1
  319. package/dist/esm/components/Table/hooks/plugins/useRowSelect.js +79 -89
  320. package/dist/esm/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
  321. package/dist/esm/components/Table/hooks/useRowCreation.js +29 -64
  322. package/dist/esm/components/Table/hooks/useRowCreation.js.map +1 -1
  323. package/dist/esm/components/Table/hooks/useTable.js +119 -141
  324. package/dist/esm/components/Table/hooks/useTable.js.map +1 -1
  325. package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js +12 -15
  326. package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js.map +1 -1
  327. package/dist/esm/components/Table/util/renderColumn.js +10 -10
  328. package/dist/esm/components/Table/util/renderColumn.js.map +1 -1
  329. package/dist/esm/components/Table/util/renderRow.js +37 -46
  330. package/dist/esm/components/Table/util/renderRow.js.map +1 -1
  331. package/dist/esm/components/Table/util/rowIndexPath.js +14 -16
  332. package/dist/esm/components/Table/util/rowIndexPath.js.map +1 -1
  333. package/dist/esm/components/Table/util/sortTypes.js +23 -31
  334. package/dist/esm/components/Table/util/sortTypes.js.map +1 -1
  335. package/dist/esm/components/Table/util.js +29 -41
  336. package/dist/esm/components/Table/util.js.map +1 -1
  337. package/dist/esm/components/Tabs/Tabs.js +25 -27
  338. package/dist/esm/components/Tabs/Tabs.js.map +1 -1
  339. package/dist/esm/components/Textarea/Textarea.js +11 -9
  340. package/dist/esm/components/Textarea/Textarea.js.map +1 -1
  341. package/dist/esm/components/Toast/Toast.js +20 -21
  342. package/dist/esm/components/Toast/Toast.js.map +1 -1
  343. package/dist/esm/components/Toast/Toaster.js +88 -118
  344. package/dist/esm/components/Toast/Toaster.js.map +1 -1
  345. package/dist/esm/components/Toast/util.js +2 -2
  346. package/dist/esm/components/Toast/util.js.map +1 -1
  347. package/dist/esm/components/Tooltip/Tooltip.js +7 -8
  348. package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
  349. package/dist/esm/components/Tour/Tour.js +44 -50
  350. package/dist/esm/components/Tour/Tour.js.map +1 -1
  351. package/dist/esm/components/Treeview/Treeview.js +26 -36
  352. package/dist/esm/components/Treeview/Treeview.js.map +1 -1
  353. package/dist/esm/components/VisuallyHidden/VisuallyHidden.js +1 -1
  354. package/dist/esm/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
  355. package/dist/esm/index.css +661 -661
  356. package/dist/esm/index.js +1 -1
  357. package/dist/esm/primitives/Button.js +9 -13
  358. package/dist/esm/primitives/Button.js.map +1 -1
  359. package/dist/esm/utils/date.js.map +1 -1
  360. package/dist/esm/utils/hooks/useBoundingClientRectListener.js.map +1 -1
  361. package/dist/esm/utils/hooks/useDraggable.js +16 -18
  362. package/dist/esm/utils/hooks/useDraggable.js.map +1 -1
  363. package/dist/esm/utils/hooks/useDropTarget.js +7 -10
  364. package/dist/esm/utils/hooks/useDropTarget.js.map +1 -1
  365. package/dist/esm/utils/hooks/useListKeyboardNavigation.js.map +1 -1
  366. package/dist/esm/utils/hooks/useListScrollTo.js.map +1 -1
  367. package/dist/esm/utils/hooks/useOnClickOutside.js.map +1 -1
  368. package/dist/esm/utils/hooks/useProxiedRef.js +3 -3
  369. package/dist/esm/utils/hooks/useProxiedRef.js.map +1 -1
  370. package/dist/esm/utils/hooks/useTimer.js +9 -17
  371. package/dist/esm/utils/hooks/useTimer.js.map +1 -1
  372. package/dist/esm/utils/input.js +7 -11
  373. package/dist/esm/utils/input.js.map +1 -1
  374. package/dist/esm/utils/mergeRefs.js +2 -2
  375. package/dist/esm/utils/mergeRefs.js.map +1 -1
  376. package/dist/esm/utils/taillwind.js +2 -2
  377. package/dist/esm/utils/taillwind.js.map +1 -1
  378. package/dist/index.css +661 -661
  379. package/dist/taco.cjs.development.js +1895 -2318
  380. package/dist/taco.cjs.development.js.map +1 -1
  381. package/dist/taco.cjs.production.min.js +1 -1
  382. package/dist/taco.cjs.production.min.js.map +1 -1
  383. package/package.json +2 -2
  384. package/plugins/tailwindcss-aria-attributes.js +73 -73
  385. package/tailwind.config.js +297 -297
@@ -1,14 +1,14 @@
1
- import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import React__default from 'react';
3
2
  import cn from 'classnames';
4
3
  import { Icon } from '../../Icon/Icon.js';
5
4
 
6
- var Column = function Column(_ref) {
7
- var cell = _ref.cell;
8
-
9
- var props = _extends({}, cell.getHeaderProps(), cell.getSortByToggleProps && cell.getSortByToggleProps({
10
- title: undefined
11
- }), {
5
+ const Column = ({
6
+ cell
7
+ }) => {
8
+ const props = { ...cell.getHeaderProps(),
9
+ ...(cell.getSortByToggleProps && cell.getSortByToggleProps({
10
+ title: undefined
11
+ })),
12
12
  className: cn('yt-table__cell flex flex-1 truncate p-2 align-middle text-grey-darkest hover:text-black', cell.className, {
13
13
  'yt-table__cell__group': !!cell.columns,
14
14
  'cursor-pointer': !cell.disableSorting,
@@ -16,10 +16,10 @@ var Column = function Column(_ref) {
16
16
  'justify-end text-right': cell.align === 'right',
17
17
  'justify-center text-center': cell.align === 'center' || !cell.align
18
18
  }),
19
- style: _extends({}, cell.style, {
19
+ style: { ...cell.style,
20
20
  flex: cell.flex
21
- })
22
- });
21
+ }
22
+ };
23
23
 
24
24
  if (cell.isSorted) {
25
25
  props['aria-sort'] = cell.isSortedDesc ? 'descending' : 'ascending';
@@ -1 +1 @@
1
- {"version":3,"file":"renderColumn.js","sources":["../../../../../src/components/Table/util/renderColumn.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { Icon } from '../../Icon/Icon';\n\nexport const Column = ({ cell }: any): any => {\n const props = {\n ...cell.getHeaderProps(),\n ...(cell.getSortByToggleProps && cell.getSortByToggleProps({ title: undefined })),\n className: cn('yt-table__cell flex flex-1 truncate p-2 align-middle text-grey-darkest hover:text-black', cell.className, {\n 'yt-table__cell__group': !!cell.columns,\n 'cursor-pointer': !cell.disableSorting,\n 'justify-start text-left': cell.align === 'left',\n 'justify-end text-right': cell.align === 'right',\n 'justify-center text-center': cell.align === 'center' || !cell.align,\n }),\n style: { ...cell.style, flex: cell.flex },\n };\n\n if (cell.isSorted) {\n props['aria-sort'] = cell.isSortedDesc ? 'descending' : 'ascending';\n }\n\n return (\n <div {...props} key={cell.id} data-taco=\"table-column\">\n <span className=\"truncate\">{cell.render('Header')}</span>\n {cell.isSorted ? (\n <Icon name={cell.isSortedDesc ? 'chevron-down-solid' : 'chevron-up-solid'} className=\"-mt-0.5\" />\n ) : null}\n </div>\n );\n};\n"],"names":["Column","cell","props","getHeaderProps","getSortByToggleProps","title","undefined","className","cn","columns","disableSorting","align","style","flex","isSorted","isSortedDesc","React","key","id","render","Icon","name"],"mappings":";;;;;IAIaA,MAAM,GAAG,SAATA,MAAS;MAAGC,YAAAA;;AACrB,MAAMC,KAAK,gBACJD,IAAI,CAACE,cAAL,EADI,EAEHF,IAAI,CAACG,oBAAL,IAA6BH,IAAI,CAACG,oBAAL,CAA0B;AAAEC,IAAAA,KAAK,EAAEC;AAAT,GAA1B,CAF1B;AAGPC,IAAAA,SAAS,EAAEC,EAAE,CAAC,yFAAD,EAA4FP,IAAI,CAACM,SAAjG,EAA4G;AACrH,+BAAyB,CAAC,CAACN,IAAI,CAACQ,OADqF;AAErH,wBAAkB,CAACR,IAAI,CAACS,cAF6F;AAGrH,iCAA2BT,IAAI,CAACU,KAAL,KAAe,MAH2E;AAIrH,gCAA0BV,IAAI,CAACU,KAAL,KAAe,OAJ4E;AAKrH,oCAA8BV,IAAI,CAACU,KAAL,KAAe,QAAf,IAA2B,CAACV,IAAI,CAACU;AALsD,KAA5G,CAHN;AAUPC,IAAAA,KAAK,eAAOX,IAAI,CAACW,KAAZ;AAAmBC,MAAAA,IAAI,EAAEZ,IAAI,CAACY;AAA9B;AAVE,IAAX;;AAaA,MAAIZ,IAAI,CAACa,QAAT,EAAmB;AACfZ,IAAAA,KAAK,CAAC,WAAD,CAAL,GAAqBD,IAAI,CAACc,YAAL,GAAoB,YAApB,GAAmC,WAAxD;AACH;;AAED,SACIC,4BAAA,MAAA,oBAASd;AAAOe,IAAAA,GAAG,EAAEhB,IAAI,CAACiB;iBAAc;IAAxC,EACIF,4BAAA,OAAA;AAAMT,IAAAA,SAAS,EAAC;GAAhB,EAA4BN,IAAI,CAACkB,MAAL,CAAY,QAAZ,CAA5B,CADJ,EAEKlB,IAAI,CAACa,QAAL,GACGE,4BAAA,CAACI,IAAD;AAAMC,IAAAA,IAAI,EAAEpB,IAAI,CAACc,YAAL,GAAoB,oBAApB,GAA2C;AAAoBR,IAAAA,SAAS,EAAC;GAArF,CADH,GAEG,IAJR,CADJ;AAQH;;;;"}
1
+ {"version":3,"file":"renderColumn.js","sources":["../../../../../src/components/Table/util/renderColumn.tsx"],"sourcesContent":["import React from 'react';\r\nimport cn from 'classnames';\r\nimport { Icon } from '../../Icon/Icon';\r\n\r\nexport const Column = ({ cell }: any): any => {\r\n const props = {\r\n ...cell.getHeaderProps(),\r\n ...(cell.getSortByToggleProps && cell.getSortByToggleProps({ title: undefined })),\r\n className: cn('yt-table__cell flex flex-1 truncate p-2 align-middle text-grey-darkest hover:text-black', cell.className, {\r\n 'yt-table__cell__group': !!cell.columns,\r\n 'cursor-pointer': !cell.disableSorting,\r\n 'justify-start text-left': cell.align === 'left',\r\n 'justify-end text-right': cell.align === 'right',\r\n 'justify-center text-center': cell.align === 'center' || !cell.align,\r\n }),\r\n style: { ...cell.style, flex: cell.flex },\r\n };\r\n\r\n if (cell.isSorted) {\r\n props['aria-sort'] = cell.isSortedDesc ? 'descending' : 'ascending';\r\n }\r\n\r\n return (\r\n <div {...props} key={cell.id} data-taco=\"table-column\">\r\n <span className=\"truncate\">{cell.render('Header')}</span>\r\n {cell.isSorted ? (\r\n <Icon name={cell.isSortedDesc ? 'chevron-down-solid' : 'chevron-up-solid'} className=\"-mt-0.5\" />\r\n ) : null}\r\n </div>\r\n );\r\n};\r\n"],"names":["Column","cell","props","getHeaderProps","getSortByToggleProps","title","undefined","className","cn","columns","disableSorting","align","style","flex","isSorted","isSortedDesc","React","key","id","render","Icon","name"],"mappings":";;;;MAIaA,MAAM,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD;AAClB,QAAMC,KAAK,GAAG,EACV,GAAGD,IAAI,CAACE,cAAL,EADO;AAEV,QAAIF,IAAI,CAACG,oBAAL,IAA6BH,IAAI,CAACG,oBAAL,CAA0B;AAAEC,MAAAA,KAAK,EAAEC;AAAT,KAA1B,CAAjC,CAFU;AAGVC,IAAAA,SAAS,EAAEC,EAAE,CAAC,yFAAD,EAA4FP,IAAI,CAACM,SAAjG,EAA4G;AACrH,+BAAyB,CAAC,CAACN,IAAI,CAACQ,OADqF;AAErH,wBAAkB,CAACR,IAAI,CAACS,cAF6F;AAGrH,iCAA2BT,IAAI,CAACU,KAAL,KAAe,MAH2E;AAIrH,gCAA0BV,IAAI,CAACU,KAAL,KAAe,OAJ4E;AAKrH,oCAA8BV,IAAI,CAACU,KAAL,KAAe,QAAf,IAA2B,CAACV,IAAI,CAACU;AALsD,KAA5G,CAHH;AAUVC,IAAAA,KAAK,EAAE,EAAE,GAAGX,IAAI,CAACW,KAAV;AAAiBC,MAAAA,IAAI,EAAEZ,IAAI,CAACY;AAA5B;AAVG,GAAd;;AAaA,MAAIZ,IAAI,CAACa,QAAT,EAAmB;AACfZ,IAAAA,KAAK,CAAC,WAAD,CAAL,GAAqBD,IAAI,CAACc,YAAL,GAAoB,YAApB,GAAmC,WAAxD;AACH;;AAED,SACIC,4BAAA,MAAA,oBAASd;AAAOe,IAAAA,GAAG,EAAEhB,IAAI,CAACiB;iBAAc;IAAxC,EACIF,4BAAA,OAAA;AAAMT,IAAAA,SAAS,EAAC;GAAhB,EAA4BN,IAAI,CAACkB,MAAL,CAAY,QAAZ,CAA5B,CADJ,EAEKlB,IAAI,CAACa,QAAL,GACGE,4BAAA,CAACI,IAAD;AAAMC,IAAAA,IAAI,EAAEpB,IAAI,CAACc,YAAL,GAAoB,oBAApB,GAA2C;AAAoBR,IAAAA,SAAS,EAAC;GAArF,CADH,GAEG,IAJR,CADJ;AAQH;;;;"}
@@ -1,78 +1,73 @@
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 { sanitizeRowProps } from '../util.js';
5
4
  import { FocusScope } from '@react-aria/focus';
6
5
 
7
- var _excluded = ["row", "index", "instance", "headerGroups"];
8
-
9
- var renderCell = function renderCell(cell, row) {
10
- var props = _extends({}, cell.getCellProps(), {
6
+ const renderCell = (cell, row) => {
7
+ const props = { ...cell.getCellProps(),
11
8
  className: cn('yt-table__cell flex-1 truncate p-2 align-middle', cell.column.className, {
12
9
  'justify-start text-left': cell.column.align === 'left',
13
10
  'justify-end text-right': cell.column.align === 'right',
14
11
  'text-center': !cell.column.align
15
12
  }),
16
- style: _extends({}, cell.column.style, {
13
+ style: { ...cell.column.style,
17
14
  flex: typeof cell.column.flex === 'function' ? cell.column.flex(row) : cell.column.flex
18
- })
19
- });
20
-
15
+ }
16
+ };
21
17
  return React__default.createElement("div", Object.assign({}, props, {
22
18
  role: "gridcell",
23
19
  "data-taco": "table-cell"
24
20
  }), cell.render('Cell') || null);
25
21
  };
26
22
 
27
- var Row = /*#__PURE__*/React__default.forwardRef(function TableRow(_ref, ref) {
28
- var row = _ref.row,
29
- index = _ref.index,
30
- instance = _ref.instance,
31
- rowProps = _objectWithoutPropertiesLoose(_ref, _excluded);
32
-
33
- var activeIndex = rowProps.activeIndex,
34
- onRowClick = rowProps.onRowClick,
35
- rowClassName = rowProps.rowClassName,
36
- rowExpansionRenderer = rowProps.rowExpansionRenderer,
37
- rowHeight = rowProps.rowHeight,
38
- setActiveIndex = rowProps.setActiveIndex,
39
- style = rowProps.style,
40
- inlineEditingUniqueId = rowProps.inlineEditingUniqueId;
41
- var sanitizedRow = sanitizeRowProps(row, rowExpansionRenderer);
42
-
43
- var props = _extends({}, row.getRowProps(), {
44
- style: _extends({}, style, {
45
- minHeight: rowHeight ? rowHeight + "px" : undefined,
46
- paddingLeft: row.depth ? row.depth * 2 + "rem" : undefined
47
- }),
23
+ const Row = /*#__PURE__*/React__default.forwardRef(function TableRow({
24
+ row,
25
+ index,
26
+ instance,
27
+ headerGroups,
28
+ ...rowProps
29
+ }, ref) {
30
+ const {
31
+ activeIndex,
32
+ onRowClick,
33
+ rowClassName,
34
+ rowExpansionRenderer,
35
+ rowHeight,
36
+ setActiveIndex,
37
+ style,
38
+ inlineEditingUniqueId
39
+ } = rowProps;
40
+ const sanitizedRow = sanitizeRowProps(row, rowExpansionRenderer);
41
+ const props = { ...row.getRowProps(),
42
+ style: { ...style,
43
+ minHeight: rowHeight ? `${rowHeight}px` : undefined,
44
+ paddingLeft: row.depth ? `${row.depth * 2}rem` : undefined
45
+ },
48
46
  className: cn('yt-table__row border-grey-light flex border-b min-h-[2.5rem] hover:bg-grey-light', {
49
47
  'yt-table__row--active bg-grey-light hover:bg-grey-light': activeIndex === index,
50
48
  'yt-table__row--clickable': !!onRowClick,
51
49
  'yt-table__row--dragging': !!row.isDragging,
52
50
  'yt-table__row--editing': !!row.isEditing
53
51
  }, typeof rowClassName === 'function' ? rowClassName(sanitizedRow) : rowClassName),
54
- onClick: onRowClick ? function (event) {
52
+ onClick: onRowClick ? event => {
55
53
  if (event.target === event.currentTarget || event.target.classList.contains('yt-table__cell')) {
56
54
  event.preventDefault();
57
55
  event.persist();
58
56
  setActiveIndex(index);
59
57
  onRowClick(sanitizedRow);
60
58
  }
61
- } : function () {
59
+ } : () => {
62
60
  setActiveIndex(index);
63
61
  }
64
- });
65
-
66
- var cells = row.cells;
62
+ };
63
+ let cells = row.cells;
67
64
 
68
65
  if (row.depth > 0) {
69
- cells = row.cells.filter(function (cell) {
70
- return !cell.column.hiddenOnSubRows;
71
- });
66
+ cells = row.cells.filter(cell => !cell.column.hiddenOnSubRows);
72
67
  }
73
68
 
74
- var expandedRow = rowExpansionRenderer && row.isExpanded && React__default.createElement("div", null, rowExpansionRenderer(sanitizedRow, instance));
75
- var rowContent = React__default.useMemo(function () {
69
+ const expandedRow = rowExpansionRenderer && row.isExpanded && React__default.createElement("div", null, rowExpansionRenderer(sanitizedRow, instance));
70
+ const rowContent = React__default.useMemo(() => {
76
71
  return React__default.createElement(React__default.Fragment, null, React__default.createElement(FocusScope, {
77
72
  key: row.original._createKey,
78
73
  contain: true,
@@ -89,9 +84,7 @@ var Row = /*#__PURE__*/React__default.forwardRef(function TableRow(_ref, ref) {
89
84
  type: "hidden",
90
85
  name: "_inlineEditingUniqueId",
91
86
  value: row.original[inlineEditingUniqueId]
92
- }), cells.map(function (cell) {
93
- return renderCell(cell, sanitizedRow);
94
- }))), expandedRow);
87
+ }), cells.map(cell => renderCell(cell, sanitizedRow)))), expandedRow);
95
88
  }, [row.original._createKey]);
96
89
 
97
90
  if (row.isEditing) {
@@ -101,9 +94,7 @@ var Row = /*#__PURE__*/React__default.forwardRef(function TableRow(_ref, ref) {
101
94
  return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", Object.assign({}, props, {
102
95
  role: "row",
103
96
  ref: ref
104
- }), cells.map(function (cell) {
105
- return renderCell(cell, sanitizedRow);
106
- })), expandedRow);
97
+ }), cells.map(cell => renderCell(cell, sanitizedRow))), expandedRow);
107
98
  });
108
99
 
109
100
  export { Row };
@@ -1 +1 @@
1
- {"version":3,"file":"renderRow.js","sources":["../../../../../src/components/Table/util/renderRow.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { FocusScope } from '@react-aria/focus';\nimport { InternalTableCell, TableRow } from '../types';\nimport { sanitizeRowProps } from '../util';\n\nconst renderCell = (cell: InternalTableCell, row: TableRow<any>): JSX.Element => {\n const props = {\n ...cell.getCellProps(),\n className: cn('yt-table__cell flex-1 truncate p-2 align-middle', cell.column.className, {\n 'justify-start text-left': cell.column.align === 'left',\n 'justify-end text-right': cell.column.align === 'right',\n 'text-center': !cell.column.align,\n }),\n style: {\n ...cell.column.style,\n flex: typeof cell.column.flex === 'function' ? cell.column.flex(row) : cell.column.flex,\n },\n };\n return (\n <div {...props} role=\"gridcell\" data-taco=\"table-cell\">\n {cell.render('Cell') || null}\n </div>\n );\n};\n\nexport const Row = React.forwardRef(function TableRow({ row, index, instance, headerGroups, ...rowProps }: any, ref: any) {\n const {\n activeIndex,\n onRowClick,\n rowClassName,\n rowExpansionRenderer,\n rowHeight,\n setActiveIndex,\n style,\n inlineEditingUniqueId,\n } = rowProps;\n const sanitizedRow = sanitizeRowProps(row, rowExpansionRenderer);\n\n const props = {\n ...row.getRowProps(),\n style: {\n ...style,\n minHeight: rowHeight ? `${rowHeight}px` : undefined,\n paddingLeft: row.depth ? `${row.depth * 2}rem` : undefined,\n },\n className: cn(\n 'yt-table__row border-grey-light flex border-b min-h-[2.5rem] hover:bg-grey-light',\n {\n 'yt-table__row--active bg-grey-light hover:bg-grey-light': activeIndex === index,\n 'yt-table__row--clickable': !!onRowClick,\n 'yt-table__row--dragging': !!row.isDragging,\n 'yt-table__row--editing': !!row.isEditing,\n },\n typeof rowClassName === 'function' ? rowClassName(sanitizedRow) : rowClassName\n ),\n onClick: onRowClick\n ? (event: React.MouseEvent<HTMLElement>) => {\n if (\n event.target === event.currentTarget ||\n (event.target as HTMLElement).classList.contains('yt-table__cell')\n ) {\n event.preventDefault();\n event.persist();\n setActiveIndex(index);\n onRowClick(sanitizedRow);\n }\n }\n : () => {\n setActiveIndex(index);\n },\n };\n\n let cells = row.cells;\n\n if (row.depth > 0) {\n cells = row.cells.filter((cell: any) => !cell.column.hiddenOnSubRows);\n }\n\n const expandedRow = rowExpansionRenderer && row.isExpanded && <div>{rowExpansionRenderer(sanitizedRow, instance)}</div>;\n const rowContent = React.useMemo(() => {\n return (\n <>\n <FocusScope key={row.original._createKey} contain restoreFocus autoFocus>\n <div {...props} role=\"row\" ref={ref}>\n <input type=\"hidden\" name=\"_rowIndexPath\" value={row.id} />\n <input type=\"hidden\" name=\"_inlineEditingUniqueId\" value={row.original[inlineEditingUniqueId]} />\n {cells.map((cell: InternalTableCell) => renderCell(cell, sanitizedRow))}\n </div>\n </FocusScope>\n {expandedRow}\n </>\n );\n }, [row.original._createKey]);\n\n if (row.isEditing) {\n return rowContent;\n }\n\n return (\n <>\n <div {...props} role=\"row\" ref={ref}>\n {cells.map((cell: InternalTableCell) => renderCell(cell, sanitizedRow))}\n </div>\n {expandedRow}\n </>\n );\n});\n"],"names":["renderCell","cell","row","props","getCellProps","className","cn","column","align","style","flex","React","role","render","Row","forwardRef","TableRow","ref","index","instance","rowProps","activeIndex","onRowClick","rowClassName","rowExpansionRenderer","rowHeight","setActiveIndex","inlineEditingUniqueId","sanitizedRow","sanitizeRowProps","getRowProps","minHeight","undefined","paddingLeft","depth","isDragging","isEditing","onClick","event","target","currentTarget","classList","contains","preventDefault","persist","cells","filter","hiddenOnSubRows","expandedRow","isExpanded","rowContent","useMemo","FocusScope","key","original","_createKey","contain","restoreFocus","autoFocus","type","name","value","id","map"],"mappings":";;;;;;;;AAMA,IAAMA,U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ACIA,4BAAA,MAAA,oBAASR;AAAOS,IAAAA,IAAI,EAAC;AAAMK,IAAAA,GAAG,EAAEA;IAAhC,EACK4B,KAAK,CAACkB,GAAN,CAAU,UAAC9D,IAAD;AAAA,WAA6BD,UAAU,CAACC,IAAD,EAAO2B,YAAP,CAAvC;AAAA,GAAV,CADL,CADJ,EAIKoB,WAJL,CADJ;AAQH,CAjFkB;;;;"}
1
+ {"version":3,"file":"renderRow.js","sources":["../../../../../src/components/Table/util/renderRow.tsx"],"sourcesContent":["import React from 'react';\r\nimport cn from 'classnames';\r\nimport { FocusScope } from '@react-aria/focus';\r\nimport { InternalTableCell, TableRow } from '../types';\r\nimport { sanitizeRowProps } from '../util';\r\n\r\nconst renderCell = (cell: InternalTableCell, row: TableRow<any>): JSX.Element => {\r\n const props = {\r\n ...cell.getCellProps(),\r\n className: cn('yt-table__cell flex-1 truncate p-2 align-middle', cell.column.className, {\r\n 'justify-start text-left': cell.column.align === 'left',\r\n 'justify-end text-right': cell.column.align === 'right',\r\n 'text-center': !cell.column.align,\r\n }),\r\n style: {\r\n ...cell.column.style,\r\n flex: typeof cell.column.flex === 'function' ? cell.column.flex(row) : cell.column.flex,\r\n },\r\n };\r\n return (\r\n <div {...props} role=\"gridcell\" data-taco=\"table-cell\">\r\n {cell.render('Cell') || null}\r\n </div>\r\n );\r\n};\r\n\r\nexport const Row = React.forwardRef(function TableRow({ row, index, instance, headerGroups, ...rowProps }: any, ref: any) {\r\n const {\r\n activeIndex,\r\n onRowClick,\r\n rowClassName,\r\n rowExpansionRenderer,\r\n rowHeight,\r\n setActiveIndex,\r\n style,\r\n inlineEditingUniqueId,\r\n } = rowProps;\r\n const sanitizedRow = sanitizeRowProps(row, rowExpansionRenderer);\r\n\r\n const props = {\r\n ...row.getRowProps(),\r\n style: {\r\n ...style,\r\n minHeight: rowHeight ? `${rowHeight}px` : undefined,\r\n paddingLeft: row.depth ? `${row.depth * 2}rem` : undefined,\r\n },\r\n className: cn(\r\n 'yt-table__row border-grey-light flex border-b min-h-[2.5rem] hover:bg-grey-light',\r\n {\r\n 'yt-table__row--active bg-grey-light hover:bg-grey-light': activeIndex === index,\r\n 'yt-table__row--clickable': !!onRowClick,\r\n 'yt-table__row--dragging': !!row.isDragging,\r\n 'yt-table__row--editing': !!row.isEditing,\r\n },\r\n typeof rowClassName === 'function' ? rowClassName(sanitizedRow) : rowClassName\r\n ),\r\n onClick: onRowClick\r\n ? (event: React.MouseEvent<HTMLElement>) => {\r\n if (\r\n event.target === event.currentTarget ||\r\n (event.target as HTMLElement).classList.contains('yt-table__cell')\r\n ) {\r\n event.preventDefault();\r\n event.persist();\r\n setActiveIndex(index);\r\n onRowClick(sanitizedRow);\r\n }\r\n }\r\n : () => {\r\n setActiveIndex(index);\r\n },\r\n };\r\n\r\n let cells = row.cells;\r\n\r\n if (row.depth > 0) {\r\n cells = row.cells.filter((cell: any) => !cell.column.hiddenOnSubRows);\r\n }\r\n\r\n const expandedRow = rowExpansionRenderer && row.isExpanded && <div>{rowExpansionRenderer(sanitizedRow, instance)}</div>;\r\n const rowContent = React.useMemo(() => {\r\n return (\r\n <>\r\n <FocusScope key={row.original._createKey} contain restoreFocus autoFocus>\r\n <div {...props} role=\"row\" ref={ref}>\r\n <input type=\"hidden\" name=\"_rowIndexPath\" value={row.id} />\r\n <input type=\"hidden\" name=\"_inlineEditingUniqueId\" value={row.original[inlineEditingUniqueId]} />\r\n {cells.map((cell: InternalTableCell) => renderCell(cell, sanitizedRow))}\r\n </div>\r\n </FocusScope>\r\n {expandedRow}\r\n </>\r\n );\r\n }, [row.original._createKey]);\r\n\r\n if (row.isEditing) {\r\n return rowContent;\r\n }\r\n\r\n return (\r\n <>\r\n <div {...props} role=\"row\" ref={ref}>\r\n {cells.map((cell: InternalTableCell) => renderCell(cell, sanitizedRow))}\r\n </div>\r\n {expandedRow}\r\n </>\r\n );\r\n});\r\n"],"names":["renderCell","cell","row","props","getCellProps","className","cn","column","align","style","flex","React","role","render","Row","forwardRef","TableRow","index","instance","headerGroups","rowProps","ref","activeIndex","onRowClick","rowClassName","rowExpansionRenderer","rowHeight","setActiveIndex","inlineEditingUniqueId","sanitizedRow","sanitizeRowProps","getRowProps","minHeight","undefined","paddingLeft","depth","isDragging","isEditing","onClick","event","target","currentTarget","classList","contains","preventDefault","persist","cells","filter","hiddenOnSubRows","expandedRow","isExpanded","rowContent","useMemo","FocusScope","key","original","_createKey","contain","restoreFocus","autoFocus","type","name","value","id","map"],"mappings":";;;;;AAMA,MAAMA,UAAU,GAAG,CAACC,IAAD,EAA0BC,GAA1B;AACf,QAAMC,KAAK,GAAG,EACV,GAAGF,IAAI,CAACG,YAAL,EADO;AAEVC,IAAAA,SAAS,EAAEC,EAAE,CAAC,iDAAD,EAAoDL,IAAI,CAACM,MAAL,CAAYF,SAAhE,EAA2E;AACpF,iCAA2BJ,IAAI,CAACM,MAAL,CAAYC,KAAZ,KAAsB,MADmC;AAEpF,gCAA0BP,IAAI,CAACM,MAAL,CAAYC,KAAZ,KAAsB,OAFoC;AAGpF,qBAAe,CAACP,IAAI,CAACM,MAAL,CAAYC;AAHwD,KAA3E,CAFH;AAOVC,IAAAA,KAAK,EAAE,EACH,GAAGR,IAAI,CAACM,MAAL,CAAYE,KADZ;AAEHC,MAAAA,IAAI,EAAE,OAAOT,IAAI,CAACM,MAAL,CAAYG,IAAnB,KAA4B,UAA5B,GAAyCT,IAAI,CAACM,MAAL,CAAYG,IAAZ,CAAiBR,GAAjB,CAAzC,GAAiED,IAAI,CAACM,MAAL,CAAYG;AAFhF;AAPG,GAAd;AAYA,SACIC,4BAAA,MAAA,oBAASR;AAAOS,IAAAA,IAAI,EAAC;iBAAqB;IAA1C,EACKX,IAAI,CAACY,MAAL,CAAY,MAAZ,KAAuB,IAD5B,CADJ;AAKH,CAlBD;;MAoBaC,GAAG,gBAAGH,cAAK,CAACI,UAAN,CAAiB,SAASC,QAAT,CAAkB;AAAEd,EAAAA,GAAF;AAAOe,EAAAA,KAAP;AAAcC,EAA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AAYH,GAbkB,EAahB,CAAC/C,GAAG,CAACqD,QAAJ,CAAaC,UAAd,CAbgB,CAAnB;;AAeA,MAAItD,GAAG,CAACmC,SAAR,EAAmB;AACf,WAAOc,UAAP;AACH;;AAED,SACIxC,4BAAA,wBAAA,MAAA,EACIA,4BAAA,MAAA,oBAASR;AAAOS,IAAAA,IAAI,EAAC;AAAMS,IAAAA,GAAG,EAAEA;IAAhC,EACKyB,KAAK,CAACkB,GAAN,CAAW/D,IAAD,IAA6BD,UAAU,CAACC,IAAD,EAAO4B,YAAP,CAAjD,CADL,CADJ,EAIKoB,WAJL,CADJ;AAQH,CAjFkB;;;;"}
@@ -1,21 +1,21 @@
1
1
  import set from 'lodash-es/set';
2
2
 
3
- var convertRowIndexPathToNumberArray = function convertRowIndexPathToNumberArray(rowIndexPath) {
3
+ const convertRowIndexPathToNumberArray = rowIndexPath => {
4
4
  var _rowIndexPath$split$m;
5
5
 
6
6
  return (_rowIndexPath$split$m = rowIndexPath === null || rowIndexPath === void 0 ? void 0 : rowIndexPath.split('.').map(Number)) !== null && _rowIndexPath$split$m !== void 0 ? _rowIndexPath$split$m : [];
7
7
  };
8
- var getByRowIndexPath = function getByRowIndexPath(data, rowIndexPath) {
8
+ const getByRowIndexPath = (data, rowIndexPath) => {
9
9
  if (!rowIndexPath) {
10
10
  return undefined;
11
11
  }
12
12
 
13
- var currenTRow = [].concat(data);
14
- var indexes = convertRowIndexPathToNumberArray(String(rowIndexPath));
13
+ const currenTRow = [...data];
14
+ const indexes = convertRowIndexPathToNumberArray(String(rowIndexPath));
15
15
 
16
16
  if (indexes.length) {
17
- var startIndex = indexes.shift();
18
- return indexes.reduce(function (value, index) {
17
+ const startIndex = indexes.shift();
18
+ return indexes.reduce((value, index) => {
19
19
  var _value$subRows;
20
20
 
21
21
  return value === null || value === void 0 ? void 0 : (_value$subRows = value.subRows) === null || _value$subRows === void 0 ? void 0 : _value$subRows[index];
@@ -24,15 +24,13 @@ var getByRowIndexPath = function getByRowIndexPath(data, rowIndexPath) {
24
24
 
25
25
  return undefined;
26
26
  };
27
- var setByRowIndexPath = function setByRowIndexPath(data, rowIndexPath, values) {
28
- var nexTRow = [].concat(data);
29
- var rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);
30
- var rootIndex = rowIndexes.shift();
27
+ const setByRowIndexPath = (data, rowIndexPath, values) => {
28
+ const nexTRow = [...data];
29
+ const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);
30
+ const rootIndex = rowIndexes.shift();
31
31
 
32
32
  if (rowIndexes.length) {
33
- var path = rowIndexes.map(function (index) {
34
- return "subRows[" + index + "]";
35
- }).join('.');
33
+ const path = rowIndexes.map(index => `subRows[${index}]`).join('.');
36
34
  set(nexTRow[rootIndex], path, values);
37
35
  } else {
38
36
  nexTRow[rootIndex] = values;
@@ -40,11 +38,11 @@ var setByRowIndexPath = function setByRowIndexPath(data, rowIndexPath, values) {
40
38
 
41
39
  return nexTRow;
42
40
  };
43
- var getParentRowIndexPath = function getParentRowIndexPath(rowIndexPath) {
44
- var parentIndexPath;
41
+ const getParentRowIndexPath = rowIndexPath => {
42
+ let parentIndexPath;
45
43
 
46
44
  if (rowIndexPath) {
47
- var rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);
45
+ const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);
48
46
  rowIndexes.pop();
49
47
 
50
48
  if (rowIndexes.length) {
@@ -1 +1 @@
1
- {"version":3,"file":"rowIndexPath.js","sources":["../../../../../src/components/Table/util/rowIndexPath.ts"],"sourcesContent":["import set from 'lodash/set';\nimport { Row, RowIndexPath } from '../types';\n\nexport const convertRowIndexPathToNumberArray = (rowIndexPath: RowIndexPath): number[] =>\n rowIndexPath?.split('.').map(Number) ?? [];\n\nexport const getByRowIndexPath = <TRow>(data: Row<TRow>[], rowIndexPath: RowIndexPath): Row<TRow> | undefined => {\n if (!rowIndexPath) {\n return undefined;\n }\n\n const currenTRow = [...data];\n const indexes = convertRowIndexPathToNumberArray(String(rowIndexPath));\n\n if (indexes.length) {\n const startIndex = indexes.shift() as number;\n return indexes.reduce((value, index) => value?.subRows?.[index], currenTRow[startIndex]);\n }\n\n return undefined;\n};\n\nexport const setByRowIndexPath = <TRow>(data: Row<TRow>[], rowIndexPath: RowIndexPath, values: any): Row<TRow>[] => {\n const nexTRow = [...data];\n\n const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);\n const rootIndex = rowIndexes.shift() as number;\n\n if (rowIndexes.length) {\n const path = rowIndexes.map(index => `subRows[${index}]`).join('.');\n set(nexTRow[rootIndex], path, values);\n } else {\n nexTRow[rootIndex] = values;\n }\n\n return nexTRow;\n};\n\nexport const getParentRowIndexPath = (rowIndexPath: RowIndexPath): RowIndexPath => {\n let parentIndexPath;\n\n if (rowIndexPath) {\n const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);\n rowIndexes.pop();\n\n if (rowIndexes.length) {\n parentIndexPath = rowIndexes.join('.');\n }\n }\n\n return parentIndexPath;\n};\n"],"names":["convertRowIndexPathToNumberArray","rowIndexPath","split","map","Number","getByRowIndexPath","data","undefined","currenTRow","indexes","String","length","startIndex","shift","reduce","value","index","subRows","setByRowIndexPath","values","nexTRow","rowIndexes","rootIndex","path","join","set","getParentRowIndexPath","parentIndexPath","pop"],"mappings":";;IAGaA,gCAAgC,GAAG,SAAnCA,gCAAmC,CAACC,YAAD;AAAA;;AAAA,kCAC5CA,YAD4C,aAC5CA,YAD4C,uBAC5CA,YAAY,CAAEC,KAAd,CAAoB,GAApB,EAAyBC,GAAzB,CAA6BC,MAA7B,CAD4C,yEACJ,EADI;AAAA;IAGnCC,iBAAiB,GAAG,SAApBA,iBAAoB,CAAOC,IAAP,EAA0BL,YAA1B;AAC7B,MAAI,CAACA,YAAL,EAAmB;AACf,WAAOM,SAAP;AACH;;AAED,MAAMC,UAAU,aAAOF,IAAP,CAAhB;AACA,MAAMG,OAAO,GAAGT,gCAAgC,CAACU,MAAM,CAACT,YAAD,CAAP,CAAh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B;AACH;AACJ;;AAED,SAAOG,eAAP;AACH;;;;"}
1
+ {"version":3,"file":"rowIndexPath.js","sources":["../../../../../src/components/Table/util/rowIndexPath.ts"],"sourcesContent":["import set from 'lodash/set';\r\nimport { Row, RowIndexPath } from '../types';\r\n\r\nexport const convertRowIndexPathToNumberArray = (rowIndexPath: RowIndexPath): number[] =>\r\n rowIndexPath?.split('.').map(Number) ?? [];\r\n\r\nexport const getByRowIndexPath = <TRow>(data: Row<TRow>[], rowIndexPath: RowIndexPath): Row<TRow> | undefined => {\r\n if (!rowIndexPath) {\r\n return undefined;\r\n }\r\n\r\n const currenTRow = [...data];\r\n const indexes = convertRowIndexPathToNumberArray(String(rowIndexPath));\r\n\r\n if (indexes.length) {\r\n const startIndex = indexes.shift() as number;\r\n return indexes.reduce((value, index) => value?.subRows?.[index], currenTRow[startIndex]);\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\nexport const setByRowIndexPath = <TRow>(data: Row<TRow>[], rowIndexPath: RowIndexPath, values: any): Row<TRow>[] => {\r\n const nexTRow = [...data];\r\n\r\n const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);\r\n const rootIndex = rowIndexes.shift() as number;\r\n\r\n if (rowIndexes.length) {\r\n const path = rowIndexes.map(index => `subRows[${index}]`).join('.');\r\n set(nexTRow[rootIndex], path, values);\r\n } else {\r\n nexTRow[rootIndex] = values;\r\n }\r\n\r\n return nexTRow;\r\n};\r\n\r\nexport const getParentRowIndexPath = (rowIndexPath: RowIndexPath): RowIndexPath => {\r\n let parentIndexPath;\r\n\r\n if (rowIndexPath) {\r\n const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);\r\n rowIndexes.pop();\r\n\r\n if (rowIndexes.length) {\r\n parentIndexPath = rowIndexes.join('.');\r\n }\r\n }\r\n\r\n return parentIndexPath;\r\n};\r\n"],"names":["convertRowIndexPathToNumberArray","rowIndexPath","split","map","Number","getByRowIndexPath","data","undefined","currenTRow","indexes","String","length","startIndex","shift","reduce","value","index","subRows","setByRowIndexPath","values","nexTRow","rowIndexes","rootIndex","path","join","set","getParentRowIndexPath","parentIndexPath","pop"],"mappings":";;MAGaA,gCAAgC,GAAIC,YAAD;AAAA;;AAAA,kCAC5CA,YAD4C,aAC5CA,YAD4C,uBAC5CA,YAAY,CAAEC,KAAd,CAAoB,GAApB,EAAyBC,GAAzB,CAA6BC,MAA7B,CAD4C,yEACJ,EADI;AAAA;MAGnCC,iBAAiB,GAAG,CAAOC,IAAP,EAA0BL,YAA1B;AAC7B,MAAI,CAACA,YAAL,EAAmB;AACf,WAAOM,SAAP;AACH;;AAED,QAAMC,UAAU,GAAG,CAAC,GAAGF,IAAJ,CAAnB;AACA,QAAMG,OAAO,GAAGT,gCAAgC,CAACU,MAAM,CAACT,YAAD,CAAP,CAAhD;;AAEA,MAAIQ,OAAO,CAACE,MAAZ,EAAoB;AAChB,UAAMC,UAAU,GAAGH,OAAO,CAACI,KAAR,EAAnB;AACA,WAAOJ,OAAO,CAACK,MAAR,CAAe,CAACC,KAAD,EAAQC,KAAR;AAAA;;AAAA,aAAkBD,KAAlB,aAAkBA,KAAlB,yCAAkBA,KAAK,CAAEE,OAAzB,mDAAkB,eAAiBD,KAAjB,CAAlB;AAAA,KAAf,EAA0DR,UAAU,CAACI,UAAD,CAApE,CAAP;AACH;;AAED,SAAOL,SAAP;AACH;MAEYW,iBAAiB,GAAG,CAAOZ,IAAP,EAA0BL,YAA1B,EAAsDkB,MAAtD;AAC7B,QAAMC,OAAO,GAAG,CAAC,GAAGd,IAAJ,CAAhB;AAEA,QAAMe,UAAU,GAAGrB,gCAAgC,CAACC,YAAD,CAAnD;AACA,QAAMqB,SAAS,GAAGD,UAAU,CAACR,KAAX,EAAlB;;AAEA,MAAIQ,UAAU,CAACV,MAAf,EAAuB;AACnB,UAAMY,IAAI,GAAGF,UAAU,CAAClB,GAAX,CAAea,KAAK,eAAeA,QAAnC,EAA6CQ,IAA7C,CAAkD,GAAlD,CAAb;AACAC,IAAAA,GAAG,CAACL,OAAO,CAACE,SAAD,CAAR,EAAqBC,IAArB,EAA2BJ,MAA3B,CAAH;AACH,GAHD,MAGO;AACHC,IAAAA,OAAO,CAACE,SAAD,CAAP,GAAqBH,MAArB;AACH;;AAED,SAAOC,OAAP;AACH;MAEYM,qBAAqB,GAAIzB,YAAD;AACjC,MAAI0B,eAAJ;;AAEA,MAAI1B,YAAJ,EAAkB;AACd,UAAMoB,UAAU,GAAGrB,gCAAgC,CAACC,YAAD,CAAnD;AACAoB,IAAAA,UAAU,CAACO,GAAX;;AAEA,QAAIP,UAAU,CAACV,MAAf,EAAuB;AACnBgB,MAAAA,eAAe,GAAGN,UAAU,CAACG,IAAX,CAAgB,GAAhB,CAAlB;AACH;AACJ;;AAED,SAAOG,eAAP;AACH;;;;"}
@@ -1,17 +1,9 @@
1
- var getTime = function getTime(value) {
2
- var parsedValue = typeof value === 'string' ? new Date(value) : value;
1
+ const getTime = value => {
2
+ const parsedValue = typeof value === 'string' ? new Date(value) : value;
3
3
  return parsedValue !== null && parsedValue !== void 0 && parsedValue.getTime ? parsedValue.getTime() : undefined;
4
4
  };
5
5
 
6
- var getNumber = function getNumber(amount, decimalSeparator) {
7
- if (amount === void 0) {
8
- amount = '';
9
- }
10
-
11
- if (decimalSeparator === void 0) {
12
- decimalSeparator = ',';
13
- }
14
-
6
+ const getNumber = (amount = '', decimalSeparator = ',') => {
15
7
  if (typeof amount === 'number') {
16
8
  return amount;
17
9
  }
@@ -20,7 +12,7 @@ var getNumber = function getNumber(amount, decimalSeparator) {
20
12
  return undefined;
21
13
  }
22
14
 
23
- var value;
15
+ let value;
24
16
 
25
17
  if (decimalSeparator === ',') {
26
18
  // replace digit seperator then replace decimal separator
@@ -33,7 +25,7 @@ var getNumber = function getNumber(amount, decimalSeparator) {
33
25
  return Number.isNaN(value) ? undefined : value;
34
26
  };
35
27
 
36
- var getString = function getString(value) {
28
+ const getString = value => {
37
29
  if (value) {
38
30
  return String(value).toLowerCase();
39
31
  }
@@ -41,7 +33,7 @@ var getString = function getString(value) {
41
33
  return undefined;
42
34
  };
43
35
 
44
- var guess = function guess(value) {
36
+ const guess = value => {
45
37
  if (typeof value === 'boolean') {
46
38
  return !!value;
47
39
  }
@@ -49,7 +41,7 @@ var guess = function guess(value) {
49
41
  return isNaN(value) ? getString(value) : Number(value);
50
42
  };
51
43
 
52
- var compareBasic = function compareBasic(a, b) {
44
+ const compareBasic = (a, b) => {
53
45
  // places undefined values first in ascending order instead of descending
54
46
  if (a !== undefined && b === undefined) {
55
47
  return 1;
@@ -58,30 +50,30 @@ var compareBasic = function compareBasic(a, b) {
58
50
  return a === b ? 0 : a > b ? 1 : -1;
59
51
  };
60
52
 
61
- var sortTypes = {
62
- datetime: function datetime(rowA, rowB, columnId) {
63
- var a = getTime(rowA.values[columnId]);
64
- var b = getTime(rowB.values[columnId]);
53
+ const sortTypes = {
54
+ datetime: (rowA, rowB, columnId) => {
55
+ const a = getTime(rowA.values[columnId]);
56
+ const b = getTime(rowB.values[columnId]);
65
57
  return compareBasic(a, b);
66
58
  },
67
- string: function string(rowA, rowB, columnId) {
68
- var a = getString(rowA.values[columnId]);
69
- var b = getString(rowB.values[columnId]);
59
+ string: (rowA, rowB, columnId) => {
60
+ const a = getString(rowA.values[columnId]);
61
+ const b = getString(rowB.values[columnId]);
70
62
  return compareBasic(a, b);
71
63
  },
72
- number: function number(rowA, rowB, columnId) {
73
- var a = getNumber(rowA.values[columnId]);
74
- var b = getNumber(rowB.values[columnId]);
64
+ number: (rowA, rowB, columnId) => {
65
+ const a = getNumber(rowA.values[columnId]);
66
+ const b = getNumber(rowB.values[columnId]);
75
67
  return compareBasic(a, b);
76
68
  },
77
- "boolean": function boolean(rowA, rowB, columnId) {
78
- var a = !!rowA.values[columnId];
79
- var b = !!rowB.values[columnId];
69
+ boolean: (rowA, rowB, columnId) => {
70
+ const a = !!rowA.values[columnId];
71
+ const b = !!rowB.values[columnId];
80
72
  return compareBasic(a, b);
81
73
  },
82
- auto: function auto(rowA, rowB, columnId) {
83
- var a = guess(rowA.values[columnId]);
84
- var b = guess(rowB.values[columnId]);
74
+ auto: (rowA, rowB, columnId) => {
75
+ const a = guess(rowA.values[columnId]);
76
+ const b = guess(rowB.values[columnId]);
85
77
  return compareBasic(a, b);
86
78
  }
87
79
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sortTypes.js","sources":["../../../../../src/components/Table/util/sortTypes.ts"],"sourcesContent":["import { SortTypes, TableRow } from '../types';\n\nconst getTime = (value: any): number | undefined => {\n const parsedValue: Date = typeof value === 'string' ? new Date(value) : value;\n return parsedValue?.getTime ? parsedValue.getTime() : undefined;\n};\n\nconst getNumber = (amount = '', decimalSeparator = ','): number | undefined => {\n if (typeof amount === 'number') {\n return amount;\n }\n\n if (amount === null || !amount.length) {\n return undefined;\n }\n\n let value;\n\n if (decimalSeparator === ',') {\n // replace digit seperator then replace decimal separator\n value = Number(amount.replace(/\\./g, '').replace(',', '.'));\n } else {\n // replace digit seperator\n value = Number(amount.replace(/,/g, ''));\n }\n\n return Number.isNaN(value) ? undefined : value;\n};\n\nconst getString = (value: any): string | undefined => {\n if (value) {\n return String(value).toLowerCase();\n }\n\n return undefined;\n};\n\nconst guess = (value: any): any => {\n if (typeof value === 'boolean') {\n return !!value;\n }\n\n return isNaN(value) ? getString(value) : Number(value);\n};\n\nconst compareBasic = (a: any, b: any) => {\n // places undefined values first in ascending order instead of descending\n if (a !== undefined && b === undefined) {\n return 1;\n }\n\n return a === b ? 0 : a > b ? 1 : -1;\n};\n\ntype SortHandler<T> = (rowA: TableRow<T>, rowB: TableRow<T>, columnId: string) => 0 | 1 | -1;\n\nexport const sortTypes: Record<SortTypes, SortHandler<any>> = {\n datetime: (rowA, rowB, columnId) => {\n const a = getTime(rowA.values[columnId]);\n const b = getTime(rowB.values[columnId]);\n return compareBasic(a, b);\n },\n string: (rowA, rowB, columnId) => {\n const a = getString(rowA.values[columnId]);\n const b = getString(rowB.values[columnId]);\n return compareBasic(a, b);\n },\n number: (rowA, rowB, columnId) => {\n const a = getNumber(rowA.values[columnId]);\n const b = getNumber(rowB.values[columnId]);\n return compareBasic(a, b);\n },\n boolean: (rowA, rowB, columnId) => {\n const a = !!rowA.values[columnId];\n const b = !!rowB.values[columnId];\n return compareBasic(a, b);\n },\n auto: (rowA, rowB, columnId) => {\n const a = guess(rowA.values[columnId]);\n const b = guess(rowB.values[columnId]);\n return compareBasic(a, b);\n },\n};\n"],"names":["getTime","value","parsedValue","Date","undefined","getNumber","amount","decimalSeparator","length","Number","replace","isNaN","getString","String","toLowerCase","guess","compareBasic","a","b","sortTypes","datetime","rowA","rowB","columnId","values","string","number","auto"],"mappings":"AAEA,IAAMA,OAAO,GAAG,SAAVA,OAAU,CAACC,KAAD;AACZ,MAAMC,WAAW,GAAS,OAAOD,KAAP,KAAiB,QAAjB,GAA4B,IAAIE,IAAJ,CAASF,KAAT,CAA5B,GAA8CA,KAAxE;AACA,SAAOC,WAAW,SAAX,IAAAA,WAAW,WAAX,IAAAA,WAAW,CAAEF,OAAb,GAAuBE,WAAW,CAACF,OAAZ,EAAvB,GAA+CI,SAAtD;AACH,CAHD;;AAKA,IAAMC,SAAS,GAAG,SAAZA,SAAY,CAACC,MAAD,EAAcC,gBAAd;MAACD;AAAAA,IAAAA,SAAS;;;MAAIC;AAAAA,IAAAA,mBAAmB;;;AAC/C,MAAI,OAAOD,MAAP,KAAkB,QAAtB,EAAgC;AAC5B,WAAOA,MAAP;AACH;;AAED,MAAIA,MAAM,KAAK,IAAX,IAAmB,CAACA,MAAM,CAACE,MAA/B,EAAuC;AACnC,WAAOJ,SAAP;AACH;;AAED,MAAIH,KAAJ;;AAEA,MAAIM,gBAAgB,KAAK,GAAzB,EAA8B;AAC1B;AACAN,IAAAA,KAAK,GAAGQ,MAAM,CAACH,MAAM,CAACI,OAAP,CAAe,KAAf,EAAsB,EAAtB,EAA0BA,OAA1B,CAAkC,GAAlC,EAAuC,GAAvC,CAAD,CAAd;AACH,GAHD,MAGO;AACH;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,IAAD,EAAOC,IAAP,EAAaC,QAAb;AACJ,QAAMN,CAAC,GAAGL,SAAS,CAACS,IAAI,CAACG,MAAL,CAAYD,QAAZ,CAAD,CAAnB;AACA,QAAML,CAAC,GAAGN,SAAS,CAACU,IAAI,CAACE,MAAL,CAAYD,QAAZ,CAAD,CAAnB;AACA,WAAOP,YAAY,CAACC,CAAD,EAAIC,CAAJ,CAAnB;AACH,GAVyD;AAW1DQ,EAAAA,MAAM,EAAE,gBAACL,IAAD,EAAOC,IAAP,EAAaC,QAAb;AACJ,QAAMN,CAAC,GAAGZ,SAAS,CAACgB,IAAI,CAACG,MAAL,CAAYD,QAAZ,CAAD,CAAnB;AACA,QAAML,CAAC,GAAGb,SAAS,CAACiB,IAAI,CAACE,MAAL,CAAYD,QAAZ,CAAD,CAAnB;AACA,WAAOP,YAAY,CAACC,CAAD,EAAIC,CAAJ,CAAnB;AACH,GAfyD;AAgB1D,aAAS,iBAACG,IAAD,EAAOC,IAAP,EAAaC,QAAb;AACL,QAAMN,CAAC,GAAG,CAAC,CAACI,IAAI,CAACG,MAAL,CAAYD,QAAZ,CAAZ;AACA,QAAML,CAAC,GAAG,CAAC,CAACI,IAAI,CAACE,MAAL,CAAYD,QAAZ,CAAZ;AACA,WAAOP,YAAY,CAACC,CAAD,EAAIC,CAAJ,CAAnB;AACH,GApByD;AAqB1DS,EAAAA,IAAI,EAAE,cAACN,IAAD,EAAOC,IAAP,EAAaC,QAAb;AACF,QAAMN,CAAC,GAAGF,KAAK,CAACM,IAAI,CAACG,MAAL,CAAYD,QAAZ,CAAD,CAAf;AACA,QAAML,CAAC,GAAGH,KAAK,CAACO,IAAI,CAACE,MAAL,CAAYD,QAAZ,CAAD,CAAf;AACA,WAAOP,YAAY,CAACC,CAAD,EAAIC,CAAJ,CAAnB;AACH;AAzByD;;;;"}
1
+ {"version":3,"file":"sortTypes.js","sources":["../../../../../src/components/Table/util/sortTypes.ts"],"sourcesContent":["import { SortTypes, TableRow } from '../types';\r\n\r\nconst getTime = (value: any): number | undefined => {\r\n const parsedValue: Date = typeof value === 'string' ? new Date(value) : value;\r\n return parsedValue?.getTime ? parsedValue.getTime() : undefined;\r\n};\r\n\r\nconst getNumber = (amount = '', decimalSeparator = ','): number | undefined => {\r\n if (typeof amount === 'number') {\r\n return amount;\r\n }\r\n\r\n if (amount === null || !amount.length) {\r\n return undefined;\r\n }\r\n\r\n let value;\r\n\r\n if (decimalSeparator === ',') {\r\n // replace digit seperator then replace decimal separator\r\n value = Number(amount.replace(/\\./g, '').replace(',', '.'));\r\n } else {\r\n // replace digit seperator\r\n value = Number(amount.replace(/,/g, ''));\r\n }\r\n\r\n return Number.isNaN(value) ? undefined : value;\r\n};\r\n\r\nconst getString = (value: any): string | undefined => {\r\n if (value) {\r\n return String(value).toLowerCase();\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\nconst guess = (value: any): any => {\r\n if (typeof value === 'boolean') {\r\n return !!value;\r\n }\r\n\r\n return isNaN(value) ? getString(value) : Number(value);\r\n};\r\n\r\nconst compareBasic = (a: any, b: any) => {\r\n // places undefined values first in ascending order instead of descending\r\n if (a !== undefined && b === undefined) {\r\n return 1;\r\n }\r\n\r\n return a === b ? 0 : a > b ? 1 : -1;\r\n};\r\n\r\ntype SortHandler<T> = (rowA: TableRow<T>, rowB: TableRow<T>, columnId: string) => 0 | 1 | -1;\r\n\r\nexport const sortTypes: Record<SortTypes, SortHandler<any>> = {\r\n datetime: (rowA, rowB, columnId) => {\r\n const a = getTime(rowA.values[columnId]);\r\n const b = getTime(rowB.values[columnId]);\r\n return compareBasic(a, b);\r\n },\r\n string: (rowA, rowB, columnId) => {\r\n const a = getString(rowA.values[columnId]);\r\n const b = getString(rowB.values[columnId]);\r\n return compareBasic(a, b);\r\n },\r\n number: (rowA, rowB, columnId) => {\r\n const a = getNumber(rowA.values[columnId]);\r\n const b = getNumber(rowB.values[columnId]);\r\n return compareBasic(a, b);\r\n },\r\n boolean: (rowA, rowB, columnId) => {\r\n const a = !!rowA.values[columnId];\r\n const b = !!rowB.values[columnId];\r\n return compareBasic(a, b);\r\n },\r\n auto: (rowA, rowB, columnId) => {\r\n const a = guess(rowA.values[columnId]);\r\n const b = guess(rowB.values[columnId]);\r\n return compareBasic(a, b);\r\n },\r\n};\r\n"],"names":["getTime","value","parsedValue","Date","undefined","getNumber","amount","decimalSeparator","length","Number","replace","isNaN","getString","String","toLowerCase","guess","compareBasic","a","b","sortTypes","datetime","rowA","rowB","columnId","values","string","number","boolean","auto"],"mappings":"AAEA,MAAMA,OAAO,GAAIC,KAAD;AACZ,QAAMC,WAAW,GAAS,OAAOD,KAAP,KAAiB,QAAjB,GAA4B,IAAIE,IAAJ,CAASF,KAAT,CAA5B,GAA8CA,KAAxE;AACA,SAAOC,WAAW,SAAX,IAAAA,WAAW,WAAX,IAAAA,WAAW,CAAEF,OAAb,GAAuBE,WAAW,CAACF,OAAZ,EAAvB,GAA+CI,SAAtD;AACH,CAHD;;AAKA,MAAMC,SAAS,GAAG,CAACC,MAAM,GAAG,EAAV,EAAcC,gBAAgB,GAAG,GAAjC;AACd,MAAI,OAAOD,MAAP,KAAkB,QAAtB,EAAgC;AAC5B,WAAOA,MAAP;AACH;;AAED,MAAIA,MAAM,KAAK,IAAX,IAAmB,CAACA,MAAM,CAACE,MAA/B,EAAuC;AACnC,WAAOJ,SAAP;AACH;;AAED,MAAIH,KAAJ;;AAEA,MAAIM,gBAAgB,KAAK,GAAzB,EAA8B;AAC1B;AACAN,IAAAA,KAAK,GAAGQ,MAAM,CAACH,MAAM,CAACI,OAAP,CAAe,KAAf,EAAsB,EAAtB,EAA0BA,OAA1B,CAAkC,GAAlC,EAAuC,GAAvC,CAAD,CAAd;AACH,GAHD,MAGO;AACH;AACAT,IAAAA,KAAK,GAAGQ,MAAM,CAACH,MAAM,CAACI,OAAP,CAAe,IAAf,EAAqB,EAArB,CAAD,CAAd;AACH;;AAED,SAAOD,MAAM,CAACE,KAAP,CAAaV,KAAb,IAAsBG,SAAtB,G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AY,CAACC,CAAD,EAAIC,CAAJ,CAAnB;AACH,GAVyD;AAW1DQ,EAAAA,MAAM,EAAE,CAACL,IAAD,EAAOC,IAAP,EAAaC,QAAb;AACJ,UAAMN,CAAC,GAAGZ,SAAS,CAACgB,IAAI,CAACG,MAAL,CAAYD,QAAZ,CAAD,CAAnB;AACA,UAAML,CAAC,GAAGb,SAAS,CAACiB,IAAI,CAACE,MAAL,CAAYD,QAAZ,CAAD,CAAnB;AACA,WAAOP,YAAY,CAACC,CAAD,EAAIC,CAAJ,CAAnB;AACH,GAfyD;AAgB1DS,EAAAA,OAAO,EAAE,CAACN,IAAD,EAAOC,IAAP,EAAaC,QAAb;AACL,UAAMN,CAAC,GAAG,CAAC,CAACI,IAAI,CAACG,MAAL,CAAYD,QAAZ,CAAZ;AACA,UAAML,CAAC,GAAG,CAAC,CAACI,IAAI,CAACE,MAAL,CAAYD,QAAZ,CAAZ;AACA,WAAOP,YAAY,CAACC,CAAD,EAAIC,CAAJ,CAAnB;AACH,GApByD;AAqB1DU,EAAAA,IAAI,EAAE,CAACP,IAAD,EAAOC,IAAP,EAAaC,QAAb;AACF,UAAMN,CAAC,GAAGF,KAAK,CAACM,IAAI,CAACG,MAAL,CAAYD,QAAZ,CAAD,CAAf;AACA,UAAML,CAAC,GAAGH,KAAK,CAACO,IAAI,CAACE,MAAL,CAAYD,QAAZ,CAAD,CAAf;AACA,WAAOP,YAAY,CAACC,CAAD,EAAIC,CAAJ,CAAnB;AACH;AAzByD;;;;"}
@@ -1,11 +1,9 @@
1
- import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import React__default from 'react';
3
2
 
4
- var _excluded = ["children"];
5
- var sanitizeRowProps = function sanitizeRowProps(row, rowExpansionRenderer) {
3
+ const sanitizeRowProps = (row, rowExpansionRenderer) => {
6
4
  var _row$subRows;
7
5
 
8
- var props = {
6
+ const props = {
9
7
  index: row.index,
10
8
  indexPath: row.id,
11
9
  values: row.original
@@ -15,15 +13,11 @@ var sanitizeRowProps = function sanitizeRowProps(row, rowExpansionRenderer) {
15
13
  props.isExpanded = !!row.isExpanded;
16
14
  props.depth = row.depth;
17
15
 
18
- props.toggleRowExpanded = function () {
19
- return row.toggleRowExpanded(!props.isExpanded);
20
- };
16
+ props.toggleRowExpanded = () => row.toggleRowExpanded(!props.isExpanded);
21
17
  } else if (rowExpansionRenderer) {
22
18
  props.isExpanded = !!row.isExpanded;
23
19
 
24
- props.toggleRowExpanded = function () {
25
- return row.toggleRowExpanded(!props.isExpanded);
26
- };
20
+ props.toggleRowExpanded = () => row.toggleRowExpanded(!props.isExpanded);
27
21
  }
28
22
 
29
23
  if (row.toggleRowEditing) {
@@ -33,40 +27,36 @@ var sanitizeRowProps = function sanitizeRowProps(row, rowExpansionRenderer) {
33
27
 
34
28
  return props;
35
29
  };
36
- var getColumnsFromChildren = function getColumnsFromChildren(children, rowExpansionRenderer) {
37
- var sortRules = [];
38
- var columns = React__default.Children.toArray(children).filter(function (child) {
39
- return !!child && !child.props.hidden;
40
- }) // skip falsey or hidden columns
41
- .map(function (_ref) {
42
- var _ref$props = _ref.props,
43
- groupChildren = _ref$props.children,
44
- props = _objectWithoutPropertiesLoose(_ref$props, _excluded);
45
-
46
- var column = _extends({}, props);
47
-
30
+ const getColumnsFromChildren = (children, rowExpansionRenderer) => {
31
+ const sortRules = [];
32
+ const columns = React__default.Children.toArray(children).filter(child => !!child && !child.props.hidden) // skip falsey or hidden columns
33
+ .map(({
34
+ props: {
35
+ children: groupChildren,
36
+ ...props
37
+ }
38
+ }) => {
39
+ const column = { ...props
40
+ };
48
41
  column.sortType = column.sortType || 'auto';
49
42
  column.disableSortBy = column.disableSorting; // this is a Table.Group - TODO: Find a better way to determine the child type
50
43
 
51
44
  if (props.title && groupChildren) {
52
45
  column.Header = props.title;
53
-
54
- var _getColumnsFromChildr = getColumnsFromChildren(groupChildren, rowExpansionRenderer),
55
- groupColumns = _getColumnsFromChildr.columns,
56
- groupSortRules = _getColumnsFromChildr.sortRules;
57
-
46
+ const {
47
+ columns: groupColumns,
48
+ sortRules: groupSortRules
49
+ } = getColumnsFromChildren(groupChildren, rowExpansionRenderer);
58
50
  column.columns = groupColumns;
59
- groupSortRules.forEach(function (sort) {
60
- return sortRules.push(sort);
61
- });
51
+ groupSortRules.forEach(sort => sortRules.push(sort));
62
52
  } else {
63
53
  column.accessor = props.accessor;
64
54
  column.Header = props.headRenderer || '';
65
55
 
66
- column.Cell = function (columnProps) {
56
+ column.Cell = columnProps => {
67
57
  var _props$cellRenderer, _cell$value;
68
58
 
69
- var cell = {
59
+ const cell = {
70
60
  accessor: columnProps.cell.column.id,
71
61
  row: sanitizeRowProps(columnProps.cell.row, rowExpansionRenderer),
72
62
  value: columnProps.cell.value
@@ -94,17 +84,15 @@ var getColumnsFromChildren = function getColumnsFromChildren(children, rowExpans
94
84
  return column;
95
85
  });
96
86
  return {
97
- columns: columns,
98
- sortRules: sortRules
87
+ columns,
88
+ sortRules
99
89
  };
100
90
  };
101
- var getInternalSortRules = function getInternalSortRules(sortRules) {
102
- return sortRules === null || sortRules === void 0 ? void 0 : sortRules.map(function (rule) {
103
- return {
104
- id: rule.accessor,
105
- desc: rule.desc
106
- };
107
- });
91
+ const getInternalSortRules = sortRules => {
92
+ return sortRules === null || sortRules === void 0 ? void 0 : sortRules.map(rule => ({
93
+ id: rule.accessor,
94
+ desc: rule.desc
95
+ }));
108
96
  };
109
97
 
110
98
  export { getColumnsFromChildren, getInternalSortRules, sanitizeRowProps };