@economic/taco 2.41.4 → 2.42.1-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (470) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +2 -2
  2. package/dist/components/Alert/Alert.d.ts +1 -1
  3. package/dist/components/AlertDialog/AlertDialog.d.ts +2 -0
  4. package/dist/components/AlertDialog/components/Content.d.ts +1 -1
  5. package/dist/components/Calendar/Calendar.d.ts +1 -1
  6. package/dist/components/Datepicker/Datepicker.d.ts +1 -1
  7. package/dist/components/Dialog/components/Content.d.ts +1 -1
  8. package/dist/components/Dialog/components/DialogDrawer.d.ts +1 -1
  9. package/dist/components/Drawer/components/Content.d.ts +2 -2
  10. package/dist/components/Header/components/Agreement/Badge.d.ts +1 -1
  11. package/dist/components/Header/components/Agreement/Display.d.ts +2 -2
  12. package/dist/components/Header/components/Agreement/Item.d.ts +2 -2
  13. package/dist/components/Header/components/AgreementSelector.d.ts +2 -2
  14. package/dist/components/Header/components/Button.d.ts +1 -1
  15. package/dist/components/HoverCard/HoverCard.d.ts +1 -1
  16. package/dist/components/Icon/components/AccountPreview.d.ts +1 -1
  17. package/dist/components/Icon/components/Accounting.d.ts +1 -1
  18. package/dist/components/Icon/components/AccountingYear.d.ts +1 -1
  19. package/dist/components/Icon/components/AccountingYearCancel.d.ts +1 -1
  20. package/dist/components/Icon/components/AiChatSolid.d.ts +1 -1
  21. package/dist/components/Icon/components/AiStars.d.ts +1 -1
  22. package/dist/components/Icon/components/ArrowBottom.d.ts +1 -1
  23. package/dist/components/Icon/components/ArrowDown.d.ts +1 -1
  24. package/dist/components/Icon/components/ArrowEnd.d.ts +1 -1
  25. package/dist/components/Icon/components/ArrowLeft.d.ts +1 -1
  26. package/dist/components/Icon/components/ArrowRight.d.ts +1 -1
  27. package/dist/components/Icon/components/ArrowStart.d.ts +1 -1
  28. package/dist/components/Icon/components/ArrowTop.d.ts +1 -1
  29. package/dist/components/Icon/components/ArrowUp.d.ts +1 -1
  30. package/dist/components/Icon/components/Attach.d.ts +1 -1
  31. package/dist/components/Icon/components/AttachAuto.d.ts +1 -1
  32. package/dist/components/Icon/components/AttachCancel.d.ts +1 -1
  33. package/dist/components/Icon/components/AttachWarning.d.ts +1 -1
  34. package/dist/components/Icon/components/Autotext.d.ts +1 -1
  35. package/dist/components/Icon/components/AutotextInsert.d.ts +1 -1
  36. package/dist/components/Icon/components/Basic.d.ts +1 -1
  37. package/dist/components/Icon/components/BasicTabs.d.ts +1 -1
  38. package/dist/components/Icon/components/BellSolid.d.ts +1 -1
  39. package/dist/components/Icon/components/Book.d.ts +1 -1
  40. package/dist/components/Icon/components/Booking.d.ts +1 -1
  41. package/dist/components/Icon/components/Budget.d.ts +1 -1
  42. package/dist/components/Icon/components/Calendar.d.ts +1 -1
  43. package/dist/components/Icon/components/CashAccount.d.ts +1 -1
  44. package/dist/components/Icon/components/CashReports.d.ts +1 -1
  45. package/dist/components/Icon/components/ChartArea.d.ts +1 -1
  46. package/dist/components/Icon/components/ChartBar.d.ts +1 -1
  47. package/dist/components/Icon/components/ChartLine.d.ts +1 -1
  48. package/dist/components/Icon/components/ChartPie.d.ts +1 -1
  49. package/dist/components/Icon/components/ChartTable.d.ts +1 -1
  50. package/dist/components/Icon/components/Chat.d.ts +1 -1
  51. package/dist/components/Icon/components/ChatSolid.d.ts +1 -1
  52. package/dist/components/Icon/components/ChevronDown.d.ts +1 -1
  53. package/dist/components/Icon/components/ChevronDownDouble.d.ts +1 -1
  54. package/dist/components/Icon/components/ChevronDownSolid.d.ts +1 -1
  55. package/dist/components/Icon/components/ChevronLeft.d.ts +1 -1
  56. package/dist/components/Icon/components/ChevronLeftDouble.d.ts +1 -1
  57. package/dist/components/Icon/components/ChevronLeftSolid.d.ts +1 -1
  58. package/dist/components/Icon/components/ChevronRight.d.ts +1 -1
  59. package/dist/components/Icon/components/ChevronRightDouble.d.ts +1 -1
  60. package/dist/components/Icon/components/ChevronRightSolid.d.ts +1 -1
  61. package/dist/components/Icon/components/ChevronUp.d.ts +1 -1
  62. package/dist/components/Icon/components/ChevronUpDouble.d.ts +1 -1
  63. package/dist/components/Icon/components/ChevronUpSolid.d.ts +1 -1
  64. package/dist/components/Icon/components/CircleClose.d.ts +1 -1
  65. package/dist/components/Icon/components/CircleInformation.d.ts +1 -1
  66. package/dist/components/Icon/components/CircleMinus.d.ts +1 -1
  67. package/dist/components/Icon/components/CirclePlus.d.ts +1 -1
  68. package/dist/components/Icon/components/CircleQuestionmark.d.ts +1 -1
  69. package/dist/components/Icon/components/CircleTick.d.ts +1 -1
  70. package/dist/components/Icon/components/CircleWarning.d.ts +1 -1
  71. package/dist/components/Icon/components/Clamp.d.ts +1 -1
  72. package/dist/components/Icon/components/ClampOpen.d.ts +1 -1
  73. package/dist/components/Icon/components/Close.d.ts +1 -1
  74. package/dist/components/Icon/components/ColumnFreeze.d.ts +1 -1
  75. package/dist/components/Icon/components/ColumnUnfreeze.d.ts +1 -1
  76. package/dist/components/Icon/components/Columns.d.ts +1 -1
  77. package/dist/components/Icon/components/ConnectionEnable.d.ts +1 -1
  78. package/dist/components/Icon/components/ConnectionRevoke.d.ts +1 -1
  79. package/dist/components/Icon/components/Contacts.d.ts +1 -1
  80. package/dist/components/Icon/components/Copy.d.ts +1 -1
  81. package/dist/components/Icon/components/Courses.d.ts +1 -1
  82. package/dist/components/Icon/components/Credit.d.ts +1 -1
  83. package/dist/components/Icon/components/Delete.d.ts +1 -1
  84. package/dist/components/Icon/components/DeletePermanently.d.ts +1 -1
  85. package/dist/components/Icon/components/Depecriate.d.ts +1 -1
  86. package/dist/components/Icon/components/Developer.d.ts +1 -1
  87. package/dist/components/Icon/components/DistributionTemplate.d.ts +1 -1
  88. package/dist/components/Icon/components/Document.d.ts +1 -1
  89. package/dist/components/Icon/components/DocumentApprove.d.ts +1 -1
  90. package/dist/components/Icon/components/DocumentCreateEntry.d.ts +1 -1
  91. package/dist/components/Icon/components/DocumentCut.d.ts +1 -1
  92. package/dist/components/Icon/components/DocumentError.d.ts +1 -1
  93. package/dist/components/Icon/components/DocumentIsolatePage.d.ts +1 -1
  94. package/dist/components/Icon/components/DocumentMerge.d.ts +1 -1
  95. package/dist/components/Icon/components/DocumentMove.d.ts +1 -1
  96. package/dist/components/Icon/components/DocumentPreview.d.ts +1 -1
  97. package/dist/components/Icon/components/DocumentReceived.d.ts +1 -1
  98. package/dist/components/Icon/components/DocumentRejectedRequest.d.ts +1 -1
  99. package/dist/components/Icon/components/DocumentSigned.d.ts +1 -1
  100. package/dist/components/Icon/components/DocumentSignedSolid.d.ts +1 -1
  101. package/dist/components/Icon/components/DocumentSplit.d.ts +1 -1
  102. package/dist/components/Icon/components/DocumentTime.d.ts +1 -1
  103. package/dist/components/Icon/components/Download.d.ts +1 -1
  104. package/dist/components/Icon/components/Drag.d.ts +1 -1
  105. package/dist/components/Icon/components/ECopedia.d.ts +1 -1
  106. package/dist/components/Icon/components/Edit.d.ts +1 -1
  107. package/dist/components/Icon/components/EditSimple.d.ts +1 -1
  108. package/dist/components/Icon/components/EllipsisHorizontal.d.ts +1 -1
  109. package/dist/components/Icon/components/EllipsisVertical.d.ts +1 -1
  110. package/dist/components/Icon/components/EntriesOnAccount.d.ts +1 -1
  111. package/dist/components/Icon/components/EntriesOpen.d.ts +1 -1
  112. package/dist/components/Icon/components/EntriesWarning.d.ts +1 -1
  113. package/dist/components/Icon/components/EntryTypeCustomerInvoice.d.ts +1 -1
  114. package/dist/components/Icon/components/EntryTypeCustomerPayment.d.ts +1 -1
  115. package/dist/components/Icon/components/EntryTypeJournalEntry.d.ts +1 -1
  116. package/dist/components/Icon/components/EntryTypeManualCustomerInvoice.d.ts +1 -1
  117. package/dist/components/Icon/components/EntryTypeSupplierInvoice.d.ts +1 -1
  118. package/dist/components/Icon/components/EntryTypeSupplierPayment.d.ts +1 -1
  119. package/dist/components/Icon/components/Envelope.d.ts +1 -1
  120. package/dist/components/Icon/components/EnvelopeApproved.d.ts +1 -1
  121. package/dist/components/Icon/components/EnvelopeSolid.d.ts +1 -1
  122. package/dist/components/Icon/components/ExpandView.d.ts +1 -1
  123. package/dist/components/Icon/components/Expenses.d.ts +1 -1
  124. package/dist/components/Icon/components/Export.d.ts +1 -1
  125. package/dist/components/Icon/components/ExportToExcel.d.ts +1 -1
  126. package/dist/components/Icon/components/ExportToPdf.d.ts +1 -1
  127. package/dist/components/Icon/components/EyeOff.d.ts +1 -1
  128. package/dist/components/Icon/components/EyeOn.d.ts +1 -1
  129. package/dist/components/Icon/components/Filter.d.ts +1 -1
  130. package/dist/components/Icon/components/FilterSolid.d.ts +1 -1
  131. package/dist/components/Icon/components/FontSize.d.ts +1 -1
  132. package/dist/components/Icon/components/GraphSolid.d.ts +1 -1
  133. package/dist/components/Icon/components/Hash.d.ts +1 -1
  134. package/dist/components/Icon/components/HeightExtraTall.d.ts +1 -1
  135. package/dist/components/Icon/components/HeightMedium.d.ts +1 -1
  136. package/dist/components/Icon/components/HeightShort.d.ts +1 -1
  137. package/dist/components/Icon/components/HeightTall.d.ts +1 -1
  138. package/dist/components/Icon/components/House.d.ts +1 -1
  139. package/dist/components/Icon/components/HouseSolid.d.ts +1 -1
  140. package/dist/components/Icon/components/Id.d.ts +1 -1
  141. package/dist/components/Icon/components/Images.d.ts +1 -1
  142. package/dist/components/Icon/components/Import.d.ts +1 -1
  143. package/dist/components/Icon/components/Inbox.d.ts +1 -1
  144. package/dist/components/Icon/components/InboxEinvoicing.d.ts +1 -1
  145. package/dist/components/Icon/components/InboxScanning.d.ts +1 -1
  146. package/dist/components/Icon/components/InboxSmart.d.ts +1 -1
  147. package/dist/components/Icon/components/Info.d.ts +1 -1
  148. package/dist/components/Icon/components/Inventory.d.ts +1 -1
  149. package/dist/components/Icon/components/InventoryMatrix.d.ts +1 -1
  150. package/dist/components/Icon/components/JournalPro.d.ts +1 -1
  151. package/dist/components/Icon/components/Layout.d.ts +1 -1
  152. package/dist/components/Icon/components/LayoutBoth.d.ts +1 -1
  153. package/dist/components/Icon/components/LayoutFirst.d.ts +1 -1
  154. package/dist/components/Icon/components/LayoutLast.d.ts +1 -1
  155. package/dist/components/Icon/components/LayoutNone.d.ts +1 -1
  156. package/dist/components/Icon/components/LedgerCard.d.ts +1 -1
  157. package/dist/components/Icon/components/LedgerCardCustomerReminder.d.ts +1 -1
  158. package/dist/components/Icon/components/LedgerCardManualCustomerInvoice.d.ts +1 -1
  159. package/dist/components/Icon/components/LedgerCardObsoleteStock.d.ts +1 -1
  160. package/dist/components/Icon/components/LedgerCardOpeningEntry.d.ts +1 -1
  161. package/dist/components/Icon/components/LedgerCardReservedEntry.d.ts +1 -1
  162. package/dist/components/Icon/components/LedgerCardShrinkagePilferage.d.ts +1 -1
  163. package/dist/components/Icon/components/LedgerCardStockAdjustment.d.ts +1 -1
  164. package/dist/components/Icon/components/LedgerCardTransferredOpeningEntry.d.ts +1 -1
  165. package/dist/components/Icon/components/Lightbulb.d.ts +1 -1
  166. package/dist/components/Icon/components/Line.d.ts +1 -1
  167. package/dist/components/Icon/components/LinkExternal.d.ts +1 -1
  168. package/dist/components/Icon/components/List.d.ts +1 -1
  169. package/dist/components/Icon/components/ListBulleted.d.ts +1 -1
  170. package/dist/components/Icon/components/ListSearch.d.ts +1 -1
  171. package/dist/components/Icon/components/Location.d.ts +1 -1
  172. package/dist/components/Icon/components/Lock.d.ts +1 -1
  173. package/dist/components/Icon/components/LockOpen.d.ts +1 -1
  174. package/dist/components/Icon/components/Log.d.ts +1 -1
  175. package/dist/components/Icon/components/LogOut.d.ts +1 -1
  176. package/dist/components/Icon/components/Market.d.ts +1 -1
  177. package/dist/components/Icon/components/MastercardOs.d.ts +1 -1
  178. package/dist/components/Icon/components/MatchAmount.d.ts +1 -1
  179. package/dist/components/Icon/components/MatchEntries.d.ts +1 -1
  180. package/dist/components/Icon/components/Menu.d.ts +1 -1
  181. package/dist/components/Icon/components/Mileage.d.ts +1 -1
  182. package/dist/components/Icon/components/ModalResize.d.ts +1 -1
  183. package/dist/components/Icon/components/ModalShrink.d.ts +1 -1
  184. package/dist/components/Icon/components/More.d.ts +1 -1
  185. package/dist/components/Icon/components/MoreSolid.d.ts +1 -1
  186. package/dist/components/Icon/components/Move.d.ts +1 -1
  187. package/dist/components/Icon/components/NavigationList.d.ts +1 -1
  188. package/dist/components/Icon/components/Note.d.ts +1 -1
  189. package/dist/components/Icon/components/NoteFollowUp.d.ts +1 -1
  190. package/dist/components/Icon/components/NoteRead.d.ts +1 -1
  191. package/dist/components/Icon/components/NovemberFirst.d.ts +1 -1
  192. package/dist/components/Icon/components/Numbers.d.ts +1 -1
  193. package/dist/components/Icon/components/PartnerApi.d.ts +1 -1
  194. package/dist/components/Icon/components/PaymentPaid.d.ts +1 -1
  195. package/dist/components/Icon/components/PaymentUnpaid.d.ts +1 -1
  196. package/dist/components/Icon/components/Period.d.ts +1 -1
  197. package/dist/components/Icon/components/PersonChange.d.ts +1 -1
  198. package/dist/components/Icon/components/PersonMinus.d.ts +1 -1
  199. package/dist/components/Icon/components/PersonPlus.d.ts +1 -1
  200. package/dist/components/Icon/components/PersonTick.d.ts +1 -1
  201. package/dist/components/Icon/components/Phone.d.ts +1 -1
  202. package/dist/components/Icon/components/PhoneSolid.d.ts +1 -1
  203. package/dist/components/Icon/components/Play.d.ts +1 -1
  204. package/dist/components/Icon/components/PlusMinus.d.ts +1 -1
  205. package/dist/components/Icon/components/Print.d.ts +1 -1
  206. package/dist/components/Icon/components/ProcessPayment.d.ts +1 -1
  207. package/dist/components/Icon/components/ProductLedgerCard.d.ts +1 -1
  208. package/dist/components/Icon/components/Profile.d.ts +1 -1
  209. package/dist/components/Icon/components/ProjectCards.d.ts +1 -1
  210. package/dist/components/Icon/components/Projects.d.ts +1 -1
  211. package/dist/components/Icon/components/QuestionMark.d.ts +1 -1
  212. package/dist/components/Icon/components/QuestionMarkBold.d.ts +1 -1
  213. package/dist/components/Icon/components/Quicklinks.d.ts +1 -1
  214. package/dist/components/Icon/components/RatingBankruptcy.d.ts +1 -1
  215. package/dist/components/Icon/components/RatingPaymentProblems.d.ts +1 -1
  216. package/dist/components/Icon/components/Reconciled.d.ts +1 -1
  217. package/dist/components/Icon/components/Refresh.d.ts +1 -1
  218. package/dist/components/Icon/components/Report.d.ts +1 -1
  219. package/dist/components/Icon/components/ReportSolid.d.ts +1 -1
  220. package/dist/components/Icon/components/Restore.d.ts +1 -1
  221. package/dist/components/Icon/components/RotateLeft.d.ts +1 -1
  222. package/dist/components/Icon/components/RotateRight.d.ts +1 -1
  223. package/dist/components/Icon/components/Sales.d.ts +1 -1
  224. package/dist/components/Icon/components/Search.d.ts +1 -1
  225. package/dist/components/Icon/components/SearchBold.d.ts +1 -1
  226. package/dist/components/Icon/components/Secure.d.ts +1 -1
  227. package/dist/components/Icon/components/SecureTick.d.ts +1 -1
  228. package/dist/components/Icon/components/Settings.d.ts +1 -1
  229. package/dist/components/Icon/components/SettingsSolid.d.ts +1 -1
  230. package/dist/components/Icon/components/Shortcuts.d.ts +1 -1
  231. package/dist/components/Icon/components/ShowAll.d.ts +1 -1
  232. package/dist/components/Icon/components/ShowLess.d.ts +1 -1
  233. package/dist/components/Icon/components/ShowMore.d.ts +1 -1
  234. package/dist/components/Icon/components/ShowTemplate.d.ts +1 -1
  235. package/dist/components/Icon/components/Sliders.d.ts +1 -1
  236. package/dist/components/Icon/components/Smartpay.d.ts +1 -1
  237. package/dist/components/Icon/components/SortBy.d.ts +1 -1
  238. package/dist/components/Icon/components/Star.d.ts +1 -1
  239. package/dist/components/Icon/components/StarSolid.d.ts +1 -1
  240. package/dist/components/Icon/components/Subscriptions.d.ts +1 -1
  241. package/dist/components/Icon/components/SystemEntries.d.ts +1 -1
  242. package/dist/components/Icon/components/Tag.d.ts +1 -1
  243. package/dist/components/Icon/components/TemplateOverride.d.ts +1 -1
  244. package/dist/components/Icon/components/Templates.d.ts +1 -1
  245. package/dist/components/Icon/components/ThumbBoth.d.ts +1 -1
  246. package/dist/components/Icon/components/ThumbDown.d.ts +1 -1
  247. package/dist/components/Icon/components/ThumbDownSolid.d.ts +1 -1
  248. package/dist/components/Icon/components/ThumbUp.d.ts +1 -1
  249. package/dist/components/Icon/components/ThumbUpSolid.d.ts +1 -1
  250. package/dist/components/Icon/components/Tick.d.ts +1 -1
  251. package/dist/components/Icon/components/TickBold.d.ts +1 -1
  252. package/dist/components/Icon/components/Time.d.ts +1 -1
  253. package/dist/components/Icon/components/Transfer.d.ts +1 -1
  254. package/dist/components/Icon/components/TransferCancel.d.ts +1 -1
  255. package/dist/components/Icon/components/TransferLocked.d.ts +1 -1
  256. package/dist/components/Icon/components/Undo.d.ts +1 -1
  257. package/dist/components/Icon/components/Undock.d.ts +1 -1
  258. package/dist/components/Icon/components/Unreconciled.d.ts +1 -1
  259. package/dist/components/Icon/components/Warning.d.ts +1 -1
  260. package/dist/components/Icon/components/Webshop.d.ts +1 -1
  261. package/dist/components/Icon/components/Website.d.ts +1 -1
  262. package/dist/components/Icon/components/Workflow.d.ts +1 -1
  263. package/dist/components/Icon/components/WorkflowTemplateBasic.d.ts +1 -1
  264. package/dist/components/Icon/components/Zoom.d.ts +1 -1
  265. package/dist/components/IconButton/IconButton.d.ts +2 -2
  266. package/dist/components/Input/Input.d.ts +2 -2
  267. package/dist/components/Input/util.d.ts +11 -1
  268. package/dist/components/Layout/components/Sidebar.d.ts +14 -2
  269. package/dist/components/Layout/components/Top.d.ts +2 -2
  270. package/dist/components/List/List.d.ts +7 -7
  271. package/dist/components/List/components/Button.d.ts +1 -1
  272. package/dist/components/List/components/Collapsible.d.ts +1 -1
  273. package/dist/components/List/components/Group.d.ts +1 -1
  274. package/dist/components/List/components/Item.d.ts +1 -1
  275. package/dist/components/List/components/Link.d.ts +1 -1
  276. package/dist/components/List/components/Toggle.d.ts +2 -2
  277. package/dist/components/Listbox/Listbox.d.ts +2 -2
  278. package/dist/components/Listbox/ScrollableList.d.ts +1 -1
  279. package/dist/components/Listbox/util.d.ts +2 -2
  280. package/dist/components/Menu/components/Checkbox.d.ts +1 -1
  281. package/dist/components/Menu/components/Content.d.ts +2 -2
  282. package/dist/components/Menu/components/Item.d.ts +8 -8
  283. package/dist/components/Menu/components/Link.d.ts +1 -1
  284. package/dist/components/Menu/components/RadioGroup.d.ts +1 -1
  285. package/dist/components/Menu/components/SubMenu.d.ts +1 -1
  286. package/dist/components/Menu/components/Trigger.d.ts +1 -1
  287. package/dist/components/Navigation2/components/Group.d.ts +1 -1
  288. package/dist/components/Popover/Popover.d.ts +2 -2
  289. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  290. package/dist/components/ScrollArea/ScrollArea.d.ts +2 -2
  291. package/dist/components/SearchInput/SearchInput.d.ts +1 -1
  292. package/dist/components/Select/Select.d.ts +1 -1
  293. package/dist/components/Select2/components/All.d.ts +2 -2
  294. package/dist/components/Select2/components/Collection.d.ts +1 -1
  295. package/dist/components/Select2/components/Create.d.ts +1 -1
  296. package/dist/components/Select2/components/Edit.d.ts +2 -2
  297. package/dist/components/Select2/components/Group.d.ts +1 -1
  298. package/dist/components/Select2/components/Option.d.ts +1 -1
  299. package/dist/components/Select2/components/Search.d.ts +3 -3
  300. package/dist/components/Select2/components/Trigger.d.ts +1 -1
  301. package/dist/components/Select2/hooks/useChildren.d.ts +2 -2
  302. package/dist/components/Shortcut/Shortcut.d.ts +1 -1
  303. package/dist/components/Table3/components/Columns/Cell/Cell.d.ts +2 -2
  304. package/dist/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.d.ts +1 -1
  305. package/dist/components/Table3/components/Columns/Cell/EditingControlCell.d.ts +2 -2
  306. package/dist/components/Table3/components/Columns/Internal/EditingActionsMenu.d.ts +2 -2
  307. package/dist/components/Table3/components/Editing/Alert.d.ts +1 -1
  308. package/dist/components/Table3/components/Row/Editing/CreateRowButton.d.ts +2 -2
  309. package/dist/components/Table3/components/Row/Editing/SaveStatus.d.ts +2 -2
  310. package/dist/components/Table3/components/Row/Row.d.ts +2 -2
  311. package/dist/components/Table3/components/Toolbar/Editing/Editing.d.ts +1 -1
  312. package/dist/components/Table3/features/useTableEditing.d.ts +2 -2
  313. package/dist/components/Table3/util/editing.d.ts +3 -2
  314. package/dist/components/Tag/Tag.d.ts +2 -2
  315. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  316. package/dist/components/Tour/Tour.d.ts +3 -3
  317. package/dist/components/Truncate/Truncate.d.ts +1 -1
  318. package/dist/esm/packages/taco/src/components/Accordion/Accordion.js +14 -6
  319. package/dist/esm/packages/taco/src/components/Accordion/Accordion.js.map +1 -1
  320. package/dist/esm/packages/taco/src/components/AlertDialog/AlertDialog.js.map +1 -1
  321. package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js +31 -3
  322. package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js.map +1 -1
  323. package/dist/esm/packages/taco/src/components/Card/Card.js +7 -5
  324. package/dist/esm/packages/taco/src/components/Card/Card.js.map +1 -1
  325. package/dist/esm/packages/taco/src/components/Datepicker/useDatepicker.js.map +1 -1
  326. package/dist/esm/packages/taco/src/components/Dialog/Dialog.js.map +1 -1
  327. package/dist/esm/packages/taco/src/components/Dialog/components/Content.js +3 -3
  328. package/dist/esm/packages/taco/src/components/Dialog/components/Content.js.map +1 -1
  329. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Avatar.js.map +1 -1
  330. package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js +5 -3
  331. package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js.map +1 -1
  332. package/dist/esm/packages/taco/src/components/Input/util.js.map +1 -1
  333. package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js.map +1 -1
  334. package/dist/esm/packages/taco/src/components/Layout/components/Top.js.map +1 -1
  335. package/dist/esm/packages/taco/src/components/Listbox/util.js +7 -1
  336. package/dist/esm/packages/taco/src/components/Listbox/util.js.map +1 -1
  337. package/dist/esm/packages/taco/src/components/Menu/components/Item.js.map +1 -1
  338. package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js.map +1 -1
  339. package/dist/esm/packages/taco/src/components/Popover/Popover.js.map +1 -1
  340. package/dist/esm/packages/taco/src/components/Popover/Primitives.js +2 -1
  341. package/dist/esm/packages/taco/src/components/Popover/Primitives.js.map +1 -1
  342. package/dist/esm/packages/taco/src/components/RadioGroup/RadioGroup.js.map +1 -1
  343. package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js +4 -4
  344. package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js.map +1 -1
  345. package/dist/esm/packages/taco/src/components/Select/Select.js.map +1 -1
  346. package/dist/esm/packages/taco/src/components/Select/useSelect.js.map +1 -1
  347. package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
  348. package/dist/esm/packages/taco/src/components/Select2/components/Create.js +11 -10
  349. package/dist/esm/packages/taco/src/components/Select2/components/Create.js.map +1 -1
  350. package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +0 -2
  351. package/dist/esm/packages/taco/src/components/Select2/components/Edit.js.map +1 -1
  352. package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
  353. package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
  354. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
  355. package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js.map +1 -1
  356. package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowEditing.js.map +1 -1
  357. package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
  358. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js.map +1 -1
  359. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js.map +1 -1
  360. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js.map +1 -1
  361. package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js.map +1 -1
  362. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateRowButton.js.map +1 -1
  363. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/SaveStatus.js.map +1 -1
  364. package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js +4 -1
  365. package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js.map +1 -1
  366. package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js +7 -4
  367. package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js.map +1 -1
  368. package/dist/esm/packages/taco/src/components/Table3/util/editing.js +9 -7
  369. package/dist/esm/packages/taco/src/components/Table3/util/editing.js.map +1 -1
  370. package/dist/esm/packages/taco/src/components/Toast/Toast.js.map +1 -1
  371. package/dist/esm/packages/taco/src/components/Tour/Tour.js +3 -3
  372. package/dist/esm/packages/taco/src/components/Tour/Tour.js.map +1 -1
  373. package/dist/esm/packages/taco/src/hooks/useGlobalKeyDown.js.map +1 -1
  374. package/dist/esm/packages/taco/src/hooks/useIntersectionObserver.js.map +1 -1
  375. package/dist/esm/packages/taco/src/primitives/Sortable/components/Container.js +1 -1
  376. package/dist/esm/packages/taco/src/primitives/Sortable/components/Container.js.map +1 -1
  377. package/dist/esm/packages/taco/src/primitives/Sortable/components/Item.js.map +1 -1
  378. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/util.js +4 -4
  379. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/util.js.map +1 -1
  380. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/util.js +3 -1
  381. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/util.js.map +1 -1
  382. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Expansion.js.map +1 -1
  383. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/Header.js +1 -1
  384. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/Header.js.map +1 -1
  385. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Goto.js.map +1 -1
  386. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js +2 -2
  387. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js.map +1 -1
  388. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js.map +1 -1
  389. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/SortIndicator.js.map +1 -1
  390. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/util.js.map +1 -1
  391. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/Filters.js.map +1 -1
  392. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.js +1 -1
  393. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.js.map +1 -1
  394. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js +3 -1
  395. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js.map +1 -1
  396. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/util.js +5 -7
  397. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/util.js.map +1 -1
  398. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/Print.js.map +1 -1
  399. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/HideOrOrderPopover.js.map +1 -1
  400. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/Settings.js.map +1 -1
  401. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js.map +1 -1
  402. package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
  403. package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js.map +1 -1
  404. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSettings.js.map +1 -1
  405. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js +3 -1
  406. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js.map +1 -1
  407. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSettingsListener.js.map +1 -1
  408. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableShortcutsListener.js.map +1 -1
  409. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +4 -2
  410. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -1
  411. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js +4 -17
  412. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js.map +1 -1
  413. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/dataTypes.js +62 -0
  414. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/dataTypes.js.map +1 -0
  415. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/filtering.js +1 -15
  416. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/filtering.js.map +1 -1
  417. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/search.js +37 -7
  418. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/search.js.map +1 -1
  419. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/settings.js.map +1 -1
  420. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js +22 -8
  421. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js.map +1 -1
  422. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/sorting.js +4 -6
  423. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/sorting.js.map +1 -1
  424. package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
  425. package/dist/primitives/BubbleSelect.d.ts +1 -1
  426. package/dist/primitives/Sortable/components/Container.d.ts +2 -2
  427. package/dist/primitives/Sortable/components/Item.d.ts +2 -1
  428. package/dist/primitives/Sortable/components/List.d.ts +1 -1
  429. package/dist/primitives/Table/Core/Table.d.ts +2 -2
  430. package/dist/primitives/Table/Core/components/Body/Body.d.ts +1 -1
  431. package/dist/primitives/Table/Core/components/Body/EmptyStateBody.d.ts +1 -1
  432. package/dist/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.d.ts +2 -2
  433. package/dist/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.d.ts +2 -2
  434. package/dist/primitives/Table/Core/components/Columns/Cell/Cell.d.ts +1 -1
  435. package/dist/primitives/Table/Core/components/Columns/Internal/Actions.d.ts +2 -2
  436. package/dist/primitives/Table/Core/components/Footer/Footer.d.ts +3 -3
  437. package/dist/primitives/Table/Core/components/Footer/Summary.d.ts +2 -2
  438. package/dist/primitives/Table/Core/components/Header/Header.d.ts +1 -1
  439. package/dist/primitives/Table/Core/components/Header/components/Goto.d.ts +2 -2
  440. package/dist/primitives/Table/Core/components/Header/components/Menu.d.ts +1 -1
  441. package/dist/primitives/Table/Core/components/Header/components/Resizer.d.ts +2 -2
  442. package/dist/primitives/Table/Core/components/Header/components/SortIndicator.d.ts +3 -3
  443. package/dist/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.d.ts +2 -2
  444. package/dist/primitives/Table/Core/components/Row/Row.d.ts +1 -1
  445. package/dist/primitives/Table/Core/components/Toolbar/Toolbar.d.ts +1 -1
  446. package/dist/primitives/Table/Core/components/Toolbar/components/Filters/Filters.d.ts +2 -2
  447. package/dist/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.d.ts +2 -2
  448. package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.d.ts +2 -2
  449. package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.d.ts +1 -1
  450. package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterComparator.d.ts +2 -2
  451. package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.d.ts +2 -2
  452. package/dist/primitives/Table/Core/components/Toolbar/components/Print/Print.d.ts +1 -1
  453. package/dist/primitives/Table/Core/components/Toolbar/components/Print/PrintDialog.d.ts +2 -2
  454. package/dist/primitives/Table/Core/components/Toolbar/components/Search/Search.d.ts +1 -1
  455. package/dist/primitives/Table/Core/components/Toolbar/components/Settings/HideOrOrderPopover.d.ts +2 -2
  456. package/dist/primitives/Table/Core/components/Toolbar/components/Settings/Settings.d.ts +2 -2
  457. package/dist/primitives/Table/types.d.ts +1 -1
  458. package/dist/primitives/Table/useTableManager/util/columns.d.ts +2 -2
  459. package/dist/primitives/Table/useTableManager/util/dataTypes.d.ts +12 -0
  460. package/dist/primitives/Table/useTableManager/util/filtering.d.ts +0 -2
  461. package/dist/primitives/Table/useTableManager/util/search.d.ts +6 -2
  462. package/dist/primitives/Table/useTableManager/util/settings.d.ts +1 -1
  463. package/dist/primitives/Table/useTableManager/util/setup.d.ts +3 -2
  464. package/dist/primitives/Table/useTableManager/util/sorting.d.ts +2 -1
  465. package/dist/taco.cjs.development.js +380 -259
  466. package/dist/taco.cjs.development.js.map +1 -1
  467. package/dist/taco.cjs.production.min.js +1 -1
  468. package/dist/taco.cjs.production.min.js.map +1 -1
  469. package/dist/utils/dom.d.ts +1 -1
  470. package/package.json +10 -12
@@ -1 +1 @@
1
- {"version":3,"file":"Trigger.js","sources":["../../../../../../../../src/components/Select2/components/Trigger.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport { Tag } from '../../Tag/Tag';\nimport { Tooltip } from '../../Tooltip/Tooltip';\nimport { Icon } from '../../Icon/Icon';\nimport { Badge } from '../../Badge/Badge';\nimport { getInputClasses } from '../../Input/util';\nimport { Select2OptionValue } from '../types';\nimport { useSelect2Context } from './Context';\nimport { Select2OptionProps } from './Option';\nimport { getIndexOfFirstChildOverflowingParent } from '../../../utils/dom';\nimport { ScrollArea } from '../../ScrollArea/ScrollArea';\nimport { useMergedRef } from '../../../hooks/useMergedRef';\nimport { getFontSize } from '../utilities';\n\ntype Select2TriggerProps = Omit<React.HTMLAttributes<HTMLButtonElement>, 'children' | 'defaultValue' | 'onChange' | 'value'> & {\n emptyValue?: Select2OptionValue;\n placeholder?: string;\n children: React.ReactElement<Select2OptionProps>[];\n};\n\nconst Placeholder = ({ disabled, readOnly, ...props }) => {\n if (readOnly) {\n return null;\n }\n return <div {...props} className={cn({ 'text-grey-700': disabled, 'text-grey-500': !disabled })} />;\n};\n\nexport const Trigger = React.forwardRef<HTMLButtonElement, Select2TriggerProps>(function Select2Trigger(props, ref) {\n const { multiple, value } = useSelect2Context();\n\n if (Array.isArray(value) || multiple) {\n const values = Array.isArray(value) ? value : value !== undefined ? [value] : undefined;\n return <Multiple {...props} ref={ref} values={values} />;\n }\n\n return <Single {...props} ref={ref} value={value} />;\n});\n\ntype ButtonProps = React.HTMLAttributes<HTMLButtonElement> &\n Omit<Select2TriggerProps, 'children' | 'open' | 'setValue' | 'value'>;\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Select2TriggerButton(props, ref) {\n const { children, onClick, tabIndex = 0, ...otherProps } = props;\n const { disabled, fontSize, highlighted, invalid, open, readOnly } = useSelect2Context();\n\n const className = cn(\n 'px-1.5 h-fit',\n getInputClasses({ ...props, disabled, highlighted, invalid, readOnly })\n .replace('w-full', '')\n .replace('px-2', ''),\n getFontSize(fontSize),\n {\n 'select-text': readOnly,\n 'w-full': !props.className?.includes('w-'),\n },\n props.className\n );\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled || readOnly) {\n event.preventDefault();\n return;\n }\n\n if (typeof onClick === 'function') {\n onClick(event);\n }\n };\n\n // select the value text if the select is readonly\n const handleFocus = (event: React.FocusEvent<HTMLButtonElement>) => {\n if (readOnly) {\n const value = event.currentTarget.querySelector(':first-child');\n\n if (value) {\n window.getSelection()?.selectAllChildren?.(value);\n }\n }\n };\n\n return (\n <button\n {...otherProps}\n aria-invalid={invalid ? true : undefined}\n aria-readonly={readOnly ? true : undefined}\n className={className}\n disabled={disabled}\n onClick={handleClick}\n onFocus={handleFocus}\n ref={ref}\n role=\"combobox\"\n tabIndex={disabled ? -1 : tabIndex}\n type=\"button\">\n {children}\n {readOnly ? null : <Icon name={open ? 'chevron-up' : 'chevron-down'} className=\"pointer-events-none -mr-1 ml-auto\" />}\n </button>\n );\n});\n\ntype SingleProps = Omit<Select2TriggerProps, 'value'> & { value?: Select2OptionValue; placeholder?: string };\n\nconst Single = React.forwardRef<HTMLButtonElement, SingleProps>(function Select2TriggerSingle(props, ref) {\n const { children, emptyValue, value, placeholder, ...buttonProps } = props;\n const { disabled, readOnly, tags } = useSelect2Context();\n const contentClassName = cn('truncate items-center gap-1');\n\n const currentValue = children.find(matchesValue(value));\n\n let output;\n\n if (placeholder && currentValue === undefined) {\n output = (\n <Placeholder disabled={disabled} readOnly={readOnly}>\n {placeholder}\n </Placeholder>\n );\n } else if (currentValue) {\n if (tags && emptyValue !== value) {\n output = (\n <Tag\n className=\"truncate\"\n color={currentValue.props.color}\n disabled={disabled}\n icon={currentValue.props.prefix}\n readOnly={readOnly}>\n {currentValue.props.children}\n </Tag>\n );\n } else {\n output = (\n <>\n {currentValue.props.prefix ? (\n typeof currentValue.props.prefix === 'string' ? (\n <Icon name={currentValue.props.prefix} className=\"mr-1 !h-5 !w-5\" />\n ) : (\n currentValue.props.prefix\n )\n ) : null}\n {currentValue.props.children}\n </>\n );\n }\n }\n\n return (\n <Button {...buttonProps} ref={ref}>\n <div className={contentClassName}>{output}</div>\n </Button>\n );\n});\n\ntype MultipleProps = Omit<Select2TriggerProps, 'value'> & {\n values?: Select2OptionValue[];\n};\n\nconst Multiple = React.forwardRef<HTMLButtonElement, MultipleProps>(function Select2TriggerMultiple(props, ref) {\n const { children, emptyValue: _, values = [], placeholder, ...buttonProps } = props;\n const { disabled, open, readOnly, setValue, tags } = useSelect2Context();\n const buttonRef = useMergedRef<HTMLButtonElement>(ref);\n\n const valuesAsChildren = values\n .map(value => children.find(c => c.props.value === value))\n .filter(c => !!c) as React.ReactElement<Select2OptionProps>[];\n\n const forwardClick = event => {\n event.preventDefault();\n buttonRef.current?.click();\n };\n\n let content;\n let { className } = buttonProps;\n\n if (open) {\n className = cn('!absolute z-20 !h-fit', buttonProps.className);\n content = (\n <ScrollArea className=\"my-1 flex max-h-[5.5rem] flex-col\" onClick={forwardClick}>\n <div className=\"flex flex-wrap gap-1\">\n {valuesAsChildren.length === 0 ? (\n <Placeholder disabled={disabled} readOnly={readOnly}>\n {placeholder}\n </Placeholder>\n ) : (\n valuesAsChildren.map(child => (\n <Tag\n key={String(child.props.value)}\n className=\"truncate\"\n color={tags ? child.props.color : undefined}\n disabled={disabled}\n icon={child.props.prefix}\n onDelete={event => {\n event?.stopPropagation();\n event?.preventDefault();\n\n if (!disabled && !readOnly) {\n setValue(child.props.value);\n }\n }}\n readOnly={readOnly}>\n {child.props.children}\n </Tag>\n ))\n )}\n </div>\n </ScrollArea>\n );\n } else {\n content = <MultipleValue onClick={forwardClick} valuesAsChildren={valuesAsChildren} placeholder={placeholder} />;\n }\n\n return (\n <div\n className=\"relative inline-flex h-fit flex-grow\"\n data-taco=\"select2-container\"\n style={{ width: open ? buttonRef.current?.offsetWidth : undefined }}>\n <Button {...buttonProps} className={className} ref={buttonRef}>\n {content}\n </Button>\n </div>\n );\n});\n\ntype MultipleValueProps = Omit<Select2TriggerProps, 'value' | 'children'> & {\n valuesAsChildren: React.ReactElement<Select2OptionProps>[];\n placeholder?: string;\n onClick?: (event: any) => void;\n};\n\nconst MultipleValue = ({ onClick, valuesAsChildren, placeholder }: MultipleValueProps) => {\n const { disabled, readOnly, tags } = useSelect2Context();\n const [contentRef, setContentRef] = React.useState<HTMLDivElement | null>(null);\n const boundaryIndex = contentRef ? getIndexOfFirstChildOverflowingParent(contentRef, 30) : undefined;\n\n return (\n <div className=\"relative flex w-full items-center gap-1 overflow-hidden\" onClick={onClick}>\n <div className=\"flex flex-1 gap-1 truncate\" ref={ref => setContentRef(ref)}>\n {valuesAsChildren.length === 0 ? (\n <Placeholder disabled={disabled} readOnly={readOnly}>\n {placeholder}\n </Placeholder>\n ) : (\n valuesAsChildren.map((child, index) => {\n const tag = (\n <Tag\n key={String(child.props.value)}\n className={cn('cursor-pointer', {\n truncate: index === boundaryIndex,\n hidden: boundaryIndex !== undefined && boundaryIndex !== null ? index > boundaryIndex : false,\n })}\n color={tags ? child.props.color : undefined}\n disabled={disabled}\n icon={child.props.prefix}\n readOnly={readOnly}>\n {child.props.children}\n </Tag>\n );\n\n if (index === boundaryIndex) {\n return (\n <Tooltip key={String(child.props.value)} title={String(child.props.children)}>\n {tag}\n </Tooltip>\n );\n }\n\n return tag;\n })\n )}\n </div>\n {boundaryIndex !== undefined && boundaryIndex !== null && boundaryIndex < valuesAsChildren.length - 1 ? (\n <Tooltip\n title={valuesAsChildren\n .slice(boundaryIndex + 1)\n .map(child => (child ? String(child.props.children) : ''))\n .join(', ')}>\n <Badge className=\"flex-shrink-0\">+{valuesAsChildren.length - (boundaryIndex + 1)}</Badge>\n </Tooltip>\n ) : null}\n </div>\n );\n};\n\nconst matchesValue = (value: undefined | any | any[]) => (child: React.ReactElement<any>) => {\n if (Array.isArray(value)) {\n return value.includes(child.props.value);\n }\n\n return child.props.value === value;\n};\n"],"names":["Placeholder","disabled","readOnly","props","React","className","cn","Trigger","forwardRef","Select2Trigger","ref","multiple","value","useSelect2Context","Array","isArray","values","undefined","Multiple","Single","Button","Select2TriggerButton","children","onClick","tabIndex","otherProps","fontSize","highlighted","invalid","open","getInputClasses","replace","getFontSize","_props$className","includes","handleClick","event","preventDefault","handleFocus","currentTarget","querySelector","_window$getSelection","_window$getSelection$","window","getSelection","selectAllChildren","call","onFocus","role","type","Icon","name","Select2TriggerSingle","emptyValue","placeholder","buttonProps","tags","contentClassName","currentValue","find","matchesValue","output","Tag","color","icon","prefix","Select2TriggerMultiple","_","setValue","buttonRef","useMergedRef","valuesAsChildren","map","c","filter","forwardClick","_buttonRef$current","current","click","content","ScrollArea","length","child","key","String","onDelete","stopPropagation","MultipleValue","style","width","_buttonRef$current2","offsetWidth","contentRef","setContentRef","useState","boundaryIndex","getIndexOfFirstChildOverflowingParent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IACV,IAAI,CACN;AAEd,CAAC;AAED,MAAMnC,YAAY,GAAIhD,KAA8B,IAAMsE,KAA8B;EACpF,IAAIpE,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,EAAE;IACtB,OAAOA,KAAK,CAACsB,QAAQ,CAACgD,KAAK,CAAC/E,KAAK,CAACS,KAAK,CAAC;;EAG5C,OAAOsE,KAAK,CAAC/E,KAAK,CAACS,KAAK,KAAKA,KAAK;AACtC,CAAC;;;;"}
1
+ {"version":3,"file":"Trigger.js","sources":["../../../../../../../../src/components/Select2/components/Trigger.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport { Tag } from '../../Tag/Tag';\nimport { Tooltip } from '../../Tooltip/Tooltip';\nimport { Icon } from '../../Icon/Icon';\nimport { Badge } from '../../Badge/Badge';\nimport { getInputClasses } from '../../Input/util';\nimport { Select2OptionValue } from '../types';\nimport { useSelect2Context } from './Context';\nimport { Select2OptionProps } from './Option';\nimport { getIndexOfFirstChildOverflowingParent } from '../../../utils/dom';\nimport { ScrollArea } from '../../ScrollArea/ScrollArea';\nimport { useMergedRef } from '../../../hooks/useMergedRef';\nimport { getFontSize } from '../utilities';\n\ntype Select2TriggerProps = Omit<React.HTMLAttributes<HTMLButtonElement>, 'children' | 'defaultValue' | 'onChange' | 'value'> & {\n emptyValue?: Select2OptionValue;\n placeholder?: string;\n children: React.ReactElement<Select2OptionProps>[];\n};\n\nconst Placeholder = ({ disabled, readOnly, ...props }: { disabled: boolean; readOnly: boolean; children: React.ReactNode }) => {\n if (readOnly) {\n return null;\n }\n return <div {...props} className={cn({ 'text-grey-700': disabled, 'text-grey-500': !disabled })} />;\n};\n\nexport const Trigger = React.forwardRef<HTMLButtonElement, Select2TriggerProps>(function Select2Trigger(props, ref) {\n const { multiple, value } = useSelect2Context();\n\n if (Array.isArray(value) || multiple) {\n const values = Array.isArray(value) ? value : value !== undefined ? [value] : undefined;\n return <Multiple {...props} ref={ref} values={values} />;\n }\n\n return <Single {...props} ref={ref} value={value} />;\n});\n\ntype ButtonProps = React.HTMLAttributes<HTMLButtonElement> &\n Omit<Select2TriggerProps, 'children' | 'open' | 'setValue' | 'value'>;\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Select2TriggerButton(props, ref) {\n const { children, onClick, tabIndex = 0, ...otherProps } = props;\n const { disabled, fontSize, highlighted, invalid, open, readOnly } = useSelect2Context();\n\n const className = cn(\n 'px-1.5 h-fit',\n getInputClasses({ ...props, disabled, highlighted, invalid, readOnly })\n .replace('w-full', '')\n .replace('px-2', ''),\n getFontSize(fontSize),\n {\n 'select-text': readOnly,\n 'w-full': !props.className?.includes('w-'),\n },\n props.className\n );\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled || readOnly) {\n event.preventDefault();\n return;\n }\n\n if (typeof onClick === 'function') {\n onClick(event);\n }\n };\n\n // select the value text if the select is readonly\n const handleFocus = (event: React.FocusEvent<HTMLButtonElement>) => {\n if (readOnly) {\n const value = event.currentTarget.querySelector(':first-child');\n\n if (value) {\n window.getSelection()?.selectAllChildren?.(value);\n }\n }\n };\n\n return (\n <button\n {...otherProps}\n aria-invalid={invalid ? true : undefined}\n aria-readonly={readOnly ? true : undefined}\n className={className}\n disabled={disabled}\n onClick={handleClick}\n onFocus={handleFocus}\n ref={ref}\n role=\"combobox\"\n tabIndex={disabled ? -1 : tabIndex}\n type=\"button\">\n {children}\n {readOnly ? null : <Icon name={open ? 'chevron-up' : 'chevron-down'} className=\"pointer-events-none -mr-1 ml-auto\" />}\n </button>\n );\n});\n\ntype SingleProps = Omit<Select2TriggerProps, 'value'> & { value?: Select2OptionValue; placeholder?: string };\n\nconst Single = React.forwardRef<HTMLButtonElement, SingleProps>(function Select2TriggerSingle(props, ref) {\n const { children, emptyValue, value, placeholder, ...buttonProps } = props;\n const { disabled, readOnly, tags } = useSelect2Context();\n const contentClassName = cn('truncate items-center gap-1');\n\n const currentValue = children.find(matchesValue(value));\n\n let output;\n\n if (placeholder && currentValue === undefined) {\n output = (\n <Placeholder disabled={disabled} readOnly={readOnly}>\n {placeholder}\n </Placeholder>\n );\n } else if (currentValue) {\n if (tags && emptyValue !== value) {\n output = (\n <Tag\n className=\"truncate\"\n color={currentValue.props.color}\n disabled={disabled}\n icon={currentValue.props.prefix}\n readOnly={readOnly}>\n {currentValue.props.children}\n </Tag>\n );\n } else {\n output = (\n <>\n {currentValue.props.prefix ? (\n typeof currentValue.props.prefix === 'string' ? (\n <Icon name={currentValue.props.prefix} className=\"mr-1 !h-5 !w-5\" />\n ) : (\n currentValue.props.prefix\n )\n ) : null}\n {currentValue.props.children}\n </>\n );\n }\n }\n\n return (\n <Button {...buttonProps} ref={ref}>\n <div className={contentClassName}>{output}</div>\n </Button>\n );\n});\n\ntype MultipleProps = Omit<Select2TriggerProps, 'value'> & {\n values?: Select2OptionValue[];\n};\n\nconst Multiple = React.forwardRef<HTMLButtonElement, MultipleProps>(function Select2TriggerMultiple(props, ref) {\n const { children, emptyValue: _, values = [], placeholder, ...buttonProps } = props;\n const { disabled, open, readOnly, setValue, tags } = useSelect2Context();\n const buttonRef = useMergedRef<HTMLButtonElement>(ref);\n\n const valuesAsChildren = values\n .map(value => children.find(c => c.props.value === value))\n .filter(c => !!c) as React.ReactElement<Select2OptionProps>[];\n\n const forwardClick = (event: any) => {\n event.preventDefault();\n buttonRef.current?.click();\n };\n\n let content;\n let { className } = buttonProps;\n\n if (open) {\n className = cn('!absolute z-20 !h-fit', buttonProps.className);\n content = (\n <ScrollArea className=\"my-1 flex max-h-[5.5rem] flex-col\" onClick={forwardClick}>\n <div className=\"flex flex-wrap gap-1\">\n {valuesAsChildren.length === 0 ? (\n <Placeholder disabled={disabled} readOnly={readOnly}>\n {placeholder}\n </Placeholder>\n ) : (\n valuesAsChildren.map(child => (\n <Tag\n key={String(child.props.value)}\n className=\"truncate\"\n color={tags ? child.props.color : undefined}\n disabled={disabled}\n icon={child.props.prefix}\n onDelete={event => {\n event?.stopPropagation();\n event?.preventDefault();\n\n if (!disabled && !readOnly) {\n setValue(child.props.value);\n }\n }}\n readOnly={readOnly}>\n {child.props.children}\n </Tag>\n ))\n )}\n </div>\n </ScrollArea>\n );\n } else {\n content = <MultipleValue onClick={forwardClick} valuesAsChildren={valuesAsChildren} placeholder={placeholder} />;\n }\n\n return (\n <div\n className=\"relative inline-flex h-fit flex-grow\"\n data-taco=\"select2-container\"\n style={{ width: open ? buttonRef.current?.offsetWidth : undefined }}>\n <Button {...buttonProps} className={className} ref={buttonRef}>\n {content}\n </Button>\n </div>\n );\n});\n\ntype MultipleValueProps = Omit<Select2TriggerProps, 'value' | 'children'> & {\n valuesAsChildren: React.ReactElement<Select2OptionProps>[];\n placeholder?: string;\n onClick?: (event: any) => void;\n};\n\nconst MultipleValue = ({ onClick, valuesAsChildren, placeholder }: MultipleValueProps) => {\n const { disabled, readOnly, tags } = useSelect2Context();\n const [contentRef, setContentRef] = React.useState<HTMLDivElement | null>(null);\n const boundaryIndex = contentRef ? getIndexOfFirstChildOverflowingParent(contentRef, 30) : undefined;\n\n return (\n <div className=\"relative flex w-full items-center gap-1 overflow-hidden\" onClick={onClick}>\n <div className=\"flex flex-1 gap-1 truncate\" ref={ref => setContentRef(ref)}>\n {valuesAsChildren.length === 0 ? (\n <Placeholder disabled={disabled} readOnly={readOnly}>\n {placeholder}\n </Placeholder>\n ) : (\n valuesAsChildren.map((child, index) => {\n const tag = (\n <Tag\n key={String(child.props.value)}\n className={cn('cursor-pointer', {\n truncate: index === boundaryIndex,\n hidden: boundaryIndex !== undefined && boundaryIndex !== null ? index > boundaryIndex : false,\n })}\n color={tags ? child.props.color : undefined}\n disabled={disabled}\n icon={child.props.prefix}\n readOnly={readOnly}>\n {child.props.children}\n </Tag>\n );\n\n if (index === boundaryIndex) {\n return (\n <Tooltip key={String(child.props.value)} title={String(child.props.children)}>\n {tag}\n </Tooltip>\n );\n }\n\n return tag;\n })\n )}\n </div>\n {boundaryIndex !== undefined && boundaryIndex !== null && boundaryIndex < valuesAsChildren.length - 1 ? (\n <Tooltip\n title={valuesAsChildren\n .slice(boundaryIndex + 1)\n .map(child => (child ? String(child.props.children) : ''))\n .join(', ')}>\n <Badge className=\"flex-shrink-0\">+{valuesAsChildren.length - (boundaryIndex + 1)}</Badge>\n </Tooltip>\n ) : null}\n </div>\n );\n};\n\nconst matchesValue = (value: undefined | any | any[]) => (child: React.ReactElement<any>) => {\n if (Array.isArray(value)) {\n return value.includes(child.props.value);\n }\n\n return child.props.value === value;\n};\n"],"names":["Placeholder","disabled","readOnly","props","React","className","cn","Trigger","forwardRef","Select2Trigger","ref","multiple","value","useSelect2Context","Array","isArray","values","undefined","Multiple","Single","Button","Select2TriggerButton","children","onClick","tabIndex","otherProps","fontSize","highlighted","invalid","open","getInputClasses","replace","getFontSize","_props$className","includes","handleClick","event","preventDefault","handleFocus","currentTarget","querySelector","_window$getSelection","_window$getSelection$","window","getSelection","selectAllChildren","call","onFocus","role","type","Icon","name","Select2TriggerSingle","emptyValue","placeholder","buttonProps","tags","contentClassName","currentValue","find","matchesValue","output","Tag","color","icon","prefix","Select2TriggerMultiple","_","setValue","buttonRef","useMergedRef","valuesAsChildren","map","c","filter","forwardClick","_buttonRef$current","current","click","content","ScrollArea","length","child","key","String","onDelete","stopPropagation","MultipleValue","style","width","_buttonRef$current2","offsetWidth","contentRef","setContentRef","useState","boundaryIndex","getIndexOfFirstChildOverflowingParent","index","tag","truncate","hidden","Tooltip","title","slice","join","Badge"],"mappings":";;;;;;;;;;;;;AAqBA,MAAMA,WAAW,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,QAAQ;EAAE,GAAGC;CAA4E;EACtH,IAAID,QAAQ,EAAE;IACV,OAAO,IAAI;;EAEf,oBAAOE,sDAASD,KAAK;IAAEE,SAAS,EAAEC,EAAE,CAAC;MAAE,eAAe,EAAEL,QAAQ;MAAE,eAAe,EAAE,CAACA;KAAU;KAAK;AACvG,CAAC;MAEYM,OAAO,gBAAGH,cAAK,CAACI,UAAU,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/components/WindowedTable.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport { PluginHook } from 'react-table';\nimport { areEqual, VariableSizeList } from 'react-window';\nimport InfiniteLoader from 'react-window-infinite-loader';\nimport { LegacyTableProps, ForwardedGenericTableWithStatics, LegacyTableRef } from '../types';\nimport { useTable } from '../hooks/useTable';\nimport { useBoundingClientRectListener } from '../../../hooks/useBoundingClientRectListener';\nimport { useMergedRef } from '../../../hooks/useMergedRef';\nimport { Row } from '../util/renderRow';\nimport { DefaultEmptyState, BaseTable } from './BaseTable';\nimport { useLocalization } from '../../Provider/Localization';\n\nconst ROW_HEIGHT = 40;\n\nconst VariableRow = React.memo(({ data, index, style: { height: _, ...style } }: any) => {\n const { texts } = useLocalization();\n const { rows, setRowHeight, rowProps, tableProps, instance, prepareRow, rowHeights } = data;\n const row = rows[index];\n const ref = React.useRef<HTMLDivElement>(null);\n\n React.useEffect(() => {\n if (ref?.current) {\n setRowHeight(index, ref.current.getBoundingClientRect().height);\n }\n }, [rowHeights[index]]);\n\n if (row) {\n prepareRow(row, index);\n\n return (\n <Row\n {...rowProps}\n style={style}\n key={index}\n index={index}\n row={row}\n instance={instance}\n headerGroups={tableProps.headerGroups}\n setRowHeight={setRowHeight}\n ref={ref}\n />\n );\n }\n\n return (\n <div className=\"yt-table__row\" role=\"row\" style={style}>\n <div className=\"yt-table__cell text-grey-300\">{texts.legacyTable.loading}</div>\n </div>\n );\n}, areEqual);\n\nconst getAverageRowHeight = (rowHeights = {}) => {\n const keys = Object.keys(rowHeights);\n const estimatedHeight = keys.reduce((p, i) => p + rowHeights[i], 0);\n return estimatedHeight / keys.length;\n};\n\nexport const WindowedTable = React.forwardRef(function WindowedTable<T extends {}>(\n props: LegacyTableProps<T> & { plugins: PluginHook<{}>[] },\n ref: React.Ref<LegacyTableRef>\n) {\n const tableRef: any = useMergedRef<HTMLDivElement>(ref);\n const { emptyStateRenderer = DefaultEmptyState, length, loadMore, ...otherProps } = props;\n const { rowProps, tableProps, rows, prepareRow, instance, state } = useTable<T>({ ...otherProps, windowed: true }, tableRef);\n\n // determine heights for windowing calculations\n const headerRef = React.useRef<HTMLDivElement>(null);\n const [rowsRef, setRowsRef] = React.useState<any>(null);\n const tableDimensions = useBoundingClientRectListener(tableRef);\n const headerDimensions = useBoundingClientRectListener(headerRef);\n const height = tableDimensions && headerDimensions ? tableDimensions.height - headerDimensions.height : null;\n\n // variable row height calculations\n const estimatedRowHeight = rowProps.rowHeight || ROW_HEIGHT;\n const rowHeights = React.useRef<Record<string, number>>({});\n const setRowHeight = React.useCallback((index: number, size: number) => {\n if (rowHeights.current[index] !== size) {\n rowHeights.current = {\n ...rowHeights.current,\n [index]: size,\n };\n\n if (rowsRef) {\n rowsRef.resetAfterIndex(0);\n }\n }\n }, []);\n const getRowHeight = React.useCallback(index => rowHeights.current[index] || estimatedRowHeight, []);\n\n React.useEffect(() => {\n if (rowsRef && rowProps.activeIndex !== undefined) {\n rowsRef.scrollToItem(rowProps.activeIndex, 'start');\n }\n }, [rowsRef, rowProps.activeIndex]);\n\n // trigger recalculation of variable row heights if the data changes\n React.useEffect(() => {\n rowHeights.current = {};\n\n if (rowsRef) {\n rowsRef.resetAfterIndex(0);\n }\n }, [rows.length]);\n\n const contentHeight = estimatedRowHeight * props.data.length || 0;\n const isScrollbarVisible = height !== null ? contentHeight > height : false;\n\n const className = cn(tableProps.className, 'yt-table--windowed', { 'table-with-scrollbar': isScrollbarVisible });\n\n let list;\n\n const itemData = {\n rows,\n setRowHeight,\n rowProps,\n tableProps,\n instance,\n prepareRow,\n state,\n rowHeights: rowHeights.current,\n };\n\n if (height && rows.length) {\n const listProps = {\n height,\n itemData,\n estimatedItemSize: getAverageRowHeight(rowHeights.current),\n itemSize: getRowHeight,\n width: '100%',\n };\n\n if (loadMore && length) {\n const isLoaded = (index: number) => !!rows[index];\n\n list = (\n <InfiniteLoader isItemLoaded={isLoaded} itemCount={length} loadMoreItems={loadMore as any}>\n {({ onItemsRendered, ref }: any) => (\n <VariableSizeList\n {...listProps}\n itemCount={length}\n onItemsRendered={onItemsRendered}\n ref={list => {\n ref(list);\n setRowsRef(list);\n }}>\n {VariableRow}\n </VariableSizeList>\n )}\n </InfiniteLoader>\n );\n } else {\n list = (\n <VariableSizeList\n {...listProps}\n itemCount={rows.length}\n ref={ref => {\n setRowsRef(ref);\n }}>\n {VariableRow}\n </VariableSizeList>\n );\n }\n }\n\n return (\n <BaseTable {...tableProps} className={className} headerRef={headerRef} ref={tableRef}>\n {list ? list : emptyStateRenderer()}\n </BaseTable>\n );\n}) as ForwardedGenericTableWithStatics;\n\nWindowedTable.Column = () => null;\nWindowedTable.Group = () => null;\n"],"names":["ROW_HEIGHT","VariableRow","React","memo","data","index","style","height","_","texts","useLocalization","rows","setRowHeight","rowProps","tableProps","instance","prepareRow","rowHeights","row","ref","useRef","useEffect","current","getBoundingClientRect","Row","key","headerGroups","className","role","legacyTable","loading","areEqual","getAverageRowHeight","keys","Object","estimatedHeight","reduce","p","i","length","WindowedTable","forwardRef","props","tableRef","useMergedRef","emptyStateRenderer","DefaultEmptyState","loadMore","otherProps","state","useTable","windowed","headerRef","rowsRef","setRowsRef","useState","tableDimensions","useBoundingClientRectListener","headerDimensions","estimatedRowHeight","rowHeight","useCallback","size","resetAfterIndex","getRowHeight","activeIndex","undefined","scrollToItem","contentHeight","isScrollbarVisible","cn","list","itemData","listProps","estimatedItemSize","itemSize","width","isLoaded","InfiniteLoader","isItemLoaded","itemCount","loadMoreItems","onItemsRendered","VariableSizeList","BaseTable","Column","Group"],"mappings":";;;;;;;;;;;AAaA,MAAMA,UAAU,GAAG,EAAE;AAErB,MAAMC,WAAW,gBAAGC,cAAK,CAACC,IAAI,CAAC,CAAC;EAAEC,IAAI;EAAEC,KAAK;EAAEC,KAAK,EAAE;IAAEC,MAAM,EAAEC,CAAC;IAAE,GAAGF;;CAAc;EAChF,MAAM;IAAEG;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAM;IAAEC,IAAI;IA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IAAII,IAAI,CAAC4B,MAAM,EAAE;IACvB,MAAMkC,SAAS,GAAG;MACdlE,MAAM;MACNiE,QAAQ;MACRE,iBAAiB,EAAE1C,mBAAmB,CAACf,UAAU,CAACK,OAAO,CAAC;MAC1DqD,QAAQ,EAAEX,YAAY;MACtBY,KAAK,EAAE;KACV;IAED,IAAI7B,QAAQ,IAAIR,MAAM,EAAE;MACpB,MAAMsC,QAAQ,GAAIxE,KAAa,IAAK,CAAC,CAACM,IAAI,CAACN,KAAK,CAAC;MAEjDkE,IAAI,gBACArE,6BAAC4E,cAAc;QAACC,YAAY,EAAEF,QAAQ;QAAEG,SAAS,EAAEzC,MAAM;QAAE0C,aAAa,EAAElC;SACrE,CAAC;QAAEmC,eAAe;QAAE/D;OAAU,mBAC3BjB,6BAACiF,gBAAgB,oBACTV,SAAS;QACbO,SAAS,EAAEzC,MAAM;QACjB2C,eAAe,EAAEA,eAAe;QAChC/D,GAAG,EAAEoD,IAAI;UACLpD,GAAG,CAACoD,IAAI,CAAC;UACTjB,UAAU,CAACiB,IAAI,CAAC;;UAEnBtE,WAAW,CACG,CACtB,CAER;KACJ,MAAM;MACHsE,IAAI,gBACArE,6BAACiF,gBAAgB,oBACTV,SAAS;QACbO,SAAS,EAAErE,IAAI,CAAC4B,MAAM;QACtBpB,GAAG,EAAEA,GAAG;UACJmC,UAAU,CAACnC,GAAG,CAAC;;UAElBlB,WAAW,CAEnB;;;EAIT,oBACIC,6BAACkF,SAAS,oBAAKtE,UAAU;IAAEa,SAAS,EAAEA,SAAS;IAAEyB,SAAS,EAAEA,SAAS;IAAEjC,GAAG,EAAEwB;MACvE4B,IAAI,GAAGA,IAAI,GAAG1B,kBAAkB,EAAE,CAC3B;AAEpB,CAAC;AAEDL,aAAa,CAAC6C,MAAM,GAAG,MAAM,IAAI;AACjC7C,aAAa,CAAC8C,KAAK,GAAG,MAAM,IAAI;;;;"}
1
+ {"version":3,"file":"WindowedTable.js","sources":["../../../../../../../../src/components/Table/components/WindowedTable.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport { PluginHook } from 'react-table';\nimport { areEqual, VariableSizeList } from 'react-window';\nimport InfiniteLoader from 'react-window-infinite-loader';\nimport { LegacyTableProps, ForwardedGenericTableWithStatics, LegacyTableRef } from '../types';\nimport { useTable } from '../hooks/useTable';\nimport { useBoundingClientRectListener } from '../../../hooks/useBoundingClientRectListener';\nimport { useMergedRef } from '../../../hooks/useMergedRef';\nimport { Row } from '../util/renderRow';\nimport { DefaultEmptyState, BaseTable } from './BaseTable';\nimport { useLocalization } from '../../Provider/Localization';\n\nconst ROW_HEIGHT = 40;\n\nconst VariableRow = React.memo(({ data, index, style: { height: _, ...style } }: any) => {\n const { texts } = useLocalization();\n const { rows, setRowHeight, rowProps, tableProps, instance, prepareRow, rowHeights } = data;\n const row = rows[index];\n const ref = React.useRef<HTMLDivElement>(null);\n\n React.useEffect(() => {\n if (ref?.current) {\n setRowHeight(index, ref.current.getBoundingClientRect().height);\n }\n }, [rowHeights[index]]);\n\n if (row) {\n prepareRow(row, index);\n\n return (\n <Row\n {...rowProps}\n style={style}\n key={index}\n index={index}\n row={row}\n instance={instance}\n headerGroups={tableProps.headerGroups}\n setRowHeight={setRowHeight}\n ref={ref}\n />\n );\n }\n\n return (\n <div className=\"yt-table__row\" role=\"row\" style={style}>\n <div className=\"yt-table__cell text-grey-300\">{texts.legacyTable.loading}</div>\n </div>\n );\n}, areEqual);\n\nconst getAverageRowHeight = (rowHeights: Record<string, number> = {}) => {\n const keys = Object.keys(rowHeights);\n const estimatedHeight = keys.reduce((p, i) => p + rowHeights[i], 0);\n return estimatedHeight / keys.length;\n};\n\nexport const WindowedTable = React.forwardRef(function WindowedTable<T extends {}>(\n props: LegacyTableProps<T> & { plugins: PluginHook<{}>[] },\n ref: React.Ref<LegacyTableRef>\n) {\n const tableRef: any = useMergedRef<HTMLDivElement>(ref);\n const { emptyStateRenderer = DefaultEmptyState, length, loadMore, ...otherProps } = props;\n const { rowProps, tableProps, rows, prepareRow, instance, state } = useTable<T>({ ...otherProps, windowed: true }, tableRef);\n\n // determine heights for windowing calculations\n const headerRef = React.useRef<HTMLDivElement>(null);\n const [rowsRef, setRowsRef] = React.useState<any>(null);\n const tableDimensions = useBoundingClientRectListener(tableRef);\n const headerDimensions = useBoundingClientRectListener(headerRef);\n const height = tableDimensions && headerDimensions ? tableDimensions.height - headerDimensions.height : null;\n\n // variable row height calculations\n const estimatedRowHeight = rowProps.rowHeight || ROW_HEIGHT;\n const rowHeights = React.useRef<Record<string, number>>({});\n const setRowHeight = React.useCallback((index: number, size: number) => {\n if (rowHeights.current[index] !== size) {\n rowHeights.current = {\n ...rowHeights.current,\n [index]: size,\n };\n\n if (rowsRef) {\n rowsRef.resetAfterIndex(0);\n }\n }\n }, []);\n const getRowHeight = React.useCallback((index: number) => rowHeights.current[index] || estimatedRowHeight, []);\n\n React.useEffect(() => {\n if (rowsRef && rowProps.activeIndex !== undefined) {\n rowsRef.scrollToItem(rowProps.activeIndex, 'start');\n }\n }, [rowsRef, rowProps.activeIndex]);\n\n // trigger recalculation of variable row heights if the data changes\n React.useEffect(() => {\n rowHeights.current = {};\n\n if (rowsRef) {\n rowsRef.resetAfterIndex(0);\n }\n }, [rows.length]);\n\n const contentHeight = estimatedRowHeight * props.data.length || 0;\n const isScrollbarVisible = height !== null ? contentHeight > height : false;\n\n const className = cn(tableProps.className, 'yt-table--windowed', { 'table-with-scrollbar': isScrollbarVisible });\n\n let list;\n\n const itemData = {\n rows,\n setRowHeight,\n rowProps,\n tableProps,\n instance,\n prepareRow,\n state,\n rowHeights: rowHeights.current,\n };\n\n if (height && rows.length) {\n const listProps = {\n height,\n itemData,\n estimatedItemSize: getAverageRowHeight(rowHeights.current),\n itemSize: getRowHeight,\n width: '100%',\n };\n\n if (loadMore && length) {\n const isLoaded = (index: number) => !!rows[index];\n\n list = (\n <InfiniteLoader isItemLoaded={isLoaded} itemCount={length} loadMoreItems={loadMore as any}>\n {({ onItemsRendered, ref }: any) => (\n <VariableSizeList\n {...listProps}\n itemCount={length}\n onItemsRendered={onItemsRendered}\n ref={list => {\n ref(list);\n setRowsRef(list);\n }}>\n {VariableRow}\n </VariableSizeList>\n )}\n </InfiniteLoader>\n );\n } else {\n list = (\n <VariableSizeList\n {...listProps}\n itemCount={rows.length}\n ref={ref => {\n setRowsRef(ref);\n }}>\n {VariableRow}\n </VariableSizeList>\n );\n }\n }\n\n return (\n <BaseTable {...tableProps} className={className} headerRef={headerRef} ref={tableRef}>\n {list ? list : emptyStateRenderer()}\n </BaseTable>\n );\n}) as ForwardedGenericTableWithStatics;\n\nWindowedTable.Column = () => null;\nWindowedTable.Group = () => null;\n"],"names":["ROW_HEIGHT","VariableRow","React","memo","data","index","style","height","_","texts","useLocalization","rows","setRowHeight","rowProps","tableProps","instance","prepareRow","rowHeights","row","ref","useRef","useEffect","current","getBoundingClientRect","Row","key","headerGroups","className","role","legacyTable","loading","areEqual","getAverageRowHeight","keys","Object","estimatedHeight","reduce","p","i","length","WindowedTable","forwardRef","props","tableRef","useMergedRef","emptyStateRenderer","DefaultEmptyState","loadMore","otherProps","state","useTable","windowed","headerRef","rowsRef","setRowsRef","useState","tableDimensions","useBoundingClientRectListener","headerDimensions","estimatedRowHeight","rowHeight","useCallback","size","resetAfterIndex","getRowHeight","activeIndex","undefined","scrollToItem","contentHeight","isScrollbarVisible","cn","list","itemData","listProps","estimatedItemSize","itemSize","width","isLoaded","InfiniteLoader","isItemLoaded","itemCount","loadMoreItems","onItemsRendered","VariableSizeList","BaseTable","Column","Group"],"mappings":";;;;;;;;;;;AAaA,MAAMA,UAAU,GAAG,EAAE;AAErB,MAAMC,WAAW,gBAAGC,cAAK,CAACC,IAAI,CAAC,CAAC;EAAEC,IAAI;EAAEC,KAAK;EAAEC,KAAK,EAAE;IAAEC,MAAM,EAAEC,CAAC;IAAE,GAAGF;;CAAc;EAChF,MAAM;IAAEG;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAM;IAAEC,IA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../src/components/Table/hooks/plugins/useRowEditing.tsx"],"sourcesContent":["import React from 'react';\nimport { actions, PluginHook } from 'react-table';\n\nconst pluginName = 'useRowEditing';\n\nactions.resetRowEditing = 'resetRowEditing';\nactions.toggleRowEditing = 'toggleRowEditing';\nactions.toggleEditing = 'toggleEditing';\n\nfunction reducer(state: any, action: any): object {\n if (action.type === actions.init) {\n return {\n allowEditing: true,\n editingRowUniqueId: null,\n ...state,\n };\n }\n\n if (action.type === actions.resetRowEditing || action.type === actions.resetPage || action.type === actions.gotoPage) {\n return {\n ...state,\n editingRowUniqueId: null,\n };\n }\n\n if (action.type === actions.toggleRowEditing) {\n const { id } = action;\n return {\n ...state,\n editingRowUniqueId: id,\n };\n }\n\n if (action.type === actions.toggleEditing) {\n return {\n ...state,\n allowEditing: !state.allowEditing,\n };\n }\n\n return state;\n}\n\nfunction useInstance(instance: any): void {\n const { dispatch } = instance;\n\n const resetRowEditing = React.useCallback(() => {\n dispatch({ type: actions.resetRowEditing });\n }, [dispatch]);\n\n const toggleRowEditing = React.useCallback(\n id => {\n dispatch({ type: actions.toggleRowEditing, id });\n },\n [dispatch]\n );\n\n const toggleEditing = React.useCallback(() => {\n dispatch({ type: actions.toggleEditing });\n }, [dispatch]);\n\n Object.assign(instance, {\n resetRowEditing,\n toggleRowEditing,\n toggleEditing,\n });\n}\n\nconst prepareRow =\n <T extends {}>(uniqueId: keyof T) =>\n (row: any, { instance }: any): void => {\n const id = row.original[uniqueId];\n\n row.toggleRowEditing = () => {\n if (instance.state.editingRowUniqueId === id) {\n instance.resetRowEditing();\n } else {\n instance.toggleRowEditing(id);\n }\n };\n\n row.isEditing = row.original._createKey\n ? instance.state.editingRowUniqueId === row.original._createKey\n : instance.state.editingRowUniqueId === id;\n row.canEdit = instance.state.allowEditing && (row.isEditing || !instance.state.editingRowUniqueId);\n };\n\nexport const useRowEditing = <T extends {}>(uniqueId: keyof T | undefined): PluginHook<{}> => {\n const plugin = (hooks: any): void => {\n if (uniqueId) {\n hooks.stateReducers.push(reducer);\n hooks.useInstance.push(useInstance);\n hooks.prepareRow.push(prepareRow<T>(uniqueId));\n }\n };\n plugin.pluginName = pluginName;\n\n return plugin;\n};\n"],"names":["pluginName","actions","resetRowEditing","toggleRowEditing","toggleEditing","reducer","state","action","type","init","allowEditing","editingRowUniqueId","resetPage","gotoPage","id","useInstance","instance","dispatch","React","useCallback","Object","assign","prepareRow","uniqueId","row","original","isEditing","_createKey","canEdit","useRowEditing","plugin","hooks","stateReducers","push"],"mappings":";;;AAGA,MAAMA,UAAU,GAAG,eAAe;AAElCC,OAAO,CAACC,eAAe,GAAG,iBAAiB;AAC3CD,OAAO,CAACE,gBAAgB,GAAG,kBAAkB;AAC7CF,OAAO,CAACG,aAAa,GAAG,eAAe;AAEvC,SAASC,OAAOA,CAACC,KAAU,EAAEC,MAAW;EACpC,IAAIA,MAAM,CAACC,IAAI,KAAKP,OAAO,CAACQ,IAAI,EAAE;IAC9B,OAAO;MACHC,YAAY,EAAE,IAAI;MAClBC,kBAAkB,EAAE,IAAI;MACxB,GAAGL;KACN;;EAGL,IAAIC,MAAM,CAACC,IAAI,KAAKP,OAAO,CAACC,eAAe,IAAIK,MAAM,CAACC,IAAI,KAAKP,OAAO,CAACW,SAAS,IAAIL,MAAM,CAACC,IAAI,KAAKP,OAAO,CAACY,QAAQ,EAAE;IAClH,OAAO;MACH,GAAGP,KAAK;MACRK,kBAAkB,EAAE;KACvB;;EAGL,IAAIJ,MAAM,CAACC,IAAI,KAAKP,OAAO,CAACE,gBAAgB,EAAE;IAC1C,MAAM;MAAEW;KAAI,GAAGP,MAAM;IACrB,OAAO;MACH,GAAGD,KAAK;MACRK,kBAAkB,EAAEG;KACvB;;EAGL,IAAIP,MAAM,CAACC,IAAI,KAAKP,OAAO,CAACG,aAAa,EAAE;IACvC,OAAO;MACH,GAAGE,KAAK;MACRI,YAAY,EAAE,CAACJ,KAAK,CAACI;KACxB;;EAGL,OAAOJ,KAAK;AAChB;AAEA,SAASS,W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,YAAY,KAAKc,GAAG,CAACE,SAAS,IAAI,CAACV,QAAQ,CAACV,KAAK,CAACK,kBAAkB,CAAC;AACtG,CAAC;MAEQkB,aAAa,GAAkBN,QAA6B;EACrE,MAAMO,MAAM,GAAIC,KAAU;IACtB,IAAIR,QAAQ,EAAE;MACVQ,KAAK,CAACC,aAAa,CAACC,IAAI,CAAC5B,OAAO,CAAC;MACjC0B,KAAK,CAAChB,WAAW,CAACkB,IAAI,CAAClB,WAAW,CAAC;MACnCgB,KAAK,CAACT,UAAU,CAACW,IAAI,CAACX,UAAU,CAAIC,QAAQ,CAAC,CAAC;;GAErD;EACDO,MAAM,CAAC9B,UAAU,GAAGA,UAAU;EAE9B,OAAO8B,MAAM;AACjB;;;;"}
1
+ {"version":3,"file":"useRowEditing.js","sources":["../../../../../../../../../src/components/Table/hooks/plugins/useRowEditing.tsx"],"sourcesContent":["import React from 'react';\nimport { actions, PluginHook } from 'react-table';\n\nconst pluginName = 'useRowEditing';\n\nactions.resetRowEditing = 'resetRowEditing';\nactions.toggleRowEditing = 'toggleRowEditing';\nactions.toggleEditing = 'toggleEditing';\n\nfunction reducer(state: any, action: any): object {\n if (action.type === actions.init) {\n return {\n allowEditing: true,\n editingRowUniqueId: null,\n ...state,\n };\n }\n\n if (action.type === actions.resetRowEditing || action.type === actions.resetPage || action.type === actions.gotoPage) {\n return {\n ...state,\n editingRowUniqueId: null,\n };\n }\n\n if (action.type === actions.toggleRowEditing) {\n const { id } = action;\n return {\n ...state,\n editingRowUniqueId: id,\n };\n }\n\n if (action.type === actions.toggleEditing) {\n return {\n ...state,\n allowEditing: !state.allowEditing,\n };\n }\n\n return state;\n}\n\nfunction useInstance(instance: any): void {\n const { dispatch } = instance;\n\n const resetRowEditing = React.useCallback(() => {\n dispatch({ type: actions.resetRowEditing });\n }, [dispatch]);\n\n const toggleRowEditing = React.useCallback(\n (id: string) => {\n dispatch({ type: actions.toggleRowEditing, id });\n },\n [dispatch]\n );\n\n const toggleEditing = React.useCallback(() => {\n dispatch({ type: actions.toggleEditing });\n }, [dispatch]);\n\n Object.assign(instance, {\n resetRowEditing,\n toggleRowEditing,\n toggleEditing,\n });\n}\n\nconst prepareRow =\n <T extends {}>(uniqueId: keyof T) =>\n (row: any, { instance }: any): void => {\n const id = row.original[uniqueId];\n\n row.toggleRowEditing = () => {\n if (instance.state.editingRowUniqueId === id) {\n instance.resetRowEditing();\n } else {\n instance.toggleRowEditing(id);\n }\n };\n\n row.isEditing = row.original._createKey\n ? instance.state.editingRowUniqueId === row.original._createKey\n : instance.state.editingRowUniqueId === id;\n row.canEdit = instance.state.allowEditing && (row.isEditing || !instance.state.editingRowUniqueId);\n };\n\nexport const useRowEditing = <T extends {}>(uniqueId: keyof T | undefined): PluginHook<{}> => {\n const plugin = (hooks: any): void => {\n if (uniqueId) {\n hooks.stateReducers.push(reducer);\n hooks.useInstance.push(useInstance);\n hooks.prepareRow.push(prepareRow<T>(uniqueId));\n }\n };\n plugin.pluginName = pluginName;\n\n return plugin;\n};\n"],"names":["pluginName","actions","resetRowEditing","toggleRowEditing","toggleEditing","reducer","state","action","type","init","allowEditing","editingRowUniqueId","resetPage","gotoPage","id","useInstance","instance","dispatch","React","useCallback","Object","assign","prepareRow","uniqueId","row","original","isEditing","_createKey","canEdit","useRowEditing","plugin","hooks","stateReducers","push"],"mappings":";;;AAGA,MAAMA,UAAU,GAAG,eAAe;AAElCC,OAAO,CAACC,eAAe,GAAG,iBAAiB;AAC3CD,OAAO,CAACE,gBAAgB,GAAG,kBAAkB;AAC7CF,OAAO,CAACG,aAAa,GAAG,eAAe;AAEvC,SAASC,OAAOA,CAACC,KAAU,EAAEC,MAAW;EACpC,IAAIA,MAAM,CAACC,IAAI,KAAKP,OAAO,CAACQ,IAAI,EAAE;IAC9B,OAAO;MACHC,YAAY,EAAE,IAAI;MAClBC,kBAAkB,EAAE,IAAI;MACxB,GAAGL;KACN;;EAGL,IAAIC,MAAM,CAACC,IAAI,KAAKP,OAAO,CAACC,eAAe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E,GAAGU,GAAG,CAACC,QAAQ,CAACF,QAAQ,CAAC;EAEjCC,GAAG,CAACrB,gBAAgB,GAAG;IACnB,IAAIa,QAAQ,CAACV,KAAK,CAACK,kBAAkB,KAAKG,EAAE,EAAE;MAC1CE,QAAQ,CAACd,eAAe,EAAE;KAC7B,MAAM;MACHc,QAAQ,CAACb,gBAAgB,CAACW,EAAE,CAAC;;GAEpC;EAEDU,GAAG,CAACE,SAAS,GAAGF,GAAG,CAACC,QAAQ,CAACE,UAAU,GACjCX,QAAQ,CAACV,KAAK,CAACK,kBAAkB,KAAKa,GAAG,CAACC,QAAQ,CAACE,UAAU,GAC7DX,QAAQ,CAACV,KAAK,CAACK,kBAAkB,KAAKG,EAAE;EAC9CU,GAAG,CAACI,OAAO,GAAGZ,QAAQ,CAACV,KAAK,CAACI,YAAY,KAAKc,GAAG,CAACE,SAAS,IAAI,CAACV,QAAQ,CAACV,KAAK,CAACK,kBAAkB,CAAC;AACtG,CAAC;MAEQkB,aAAa,GAAkBN,QAA6B;EACrE,MAAMO,MAAM,GAAIC,KAAU;IACtB,IAAIR,QAAQ,EAAE;MACVQ,KAAK,CAACC,aAAa,CAACC,IAAI,CAAC5B,OAAO,CAAC;MACjC0B,KAAK,CAAChB,WAAW,CAACkB,IAAI,CAAClB,WAAW,CAAC;MACnCgB,KAAK,CAACT,UAAU,CAACW,IAAI,CAACX,UAAU,CAAIC,QAAQ,CAAC,CAAC;;GAErD;EACDO,MAAM,CAAC9B,UAAU,GAAGA,UAAU;EAE9B,OAAO8B,MAAM;AACjB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useRowSelect.js","sources":["../../../../../../../../../src/components/Table/hooks/plugins/useRowSelect.tsx"],"sourcesContent":["// this wraps react-table's internal useRowSelect hook\nimport React from 'react';\nimport { useRowSelect as useBaseRowSelect, Row, PluginHook } from 'react-table';\nimport { Checkbox } from '../../../Checkbox/Checkbox';\nimport { SelectedRowsHandler } from '../../types';\n\nconst toggleBetween = (fromRowIndex: number, toRowIndex: number): [number, number] => {\n const fromIndex = toRowIndex < fromRowIndex ? toRowIndex : fromRowIndex;\n const toIndex = toRowIndex > fromRowIndex ? toRowIndex : fromRowIndex;\n\n return [fromIndex, toIndex];\n};\n\n// react-table calls \"index paths\" row ids. we named them indexPaths to reduce confusion with natural ids\n// the selection hook usess react-table's row selection, so this hok references row.id - it is the index path\n\nexport const useRowSelect = (onSelectedRows: SelectedRowsHandler | undefined): PluginHook<{}> => {\n const plugin = (hooks: any): void => {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useBaseRowSelect(hooks);\n\n if (onSelectedRows) {\n const toggleRowSelected = (indexPath: string, checked: boolean): void =>\n onSelectedRows(state => {\n const nextState = { ...state };\n\n if (checked) {\n nextState[indexPath] = true;\n } else {\n delete nextState[indexPath];\n }\n\n return nextState;\n });\n\n const prepareRow = (row: any) => {\n row.toggleRowSelected = () => toggleRowSelected(row.id, !row.isSelected);\n };\n\n hooks.prepareRow.push(prepareRow);\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const lastSelectedSortedIndex = React.useRef();\n\n hooks.visibleColumns.push((columns: any) => [\n {\n id: 'selection',\n Header: ({ getToggleAllRowsSelectedProps, rows }: any) => {\n const { onChange: _, ...props } = getToggleAllRowsSelectedProps();\n\n const onChange = (checked): void => {\n if (checked) {\n // this intentionally only selects top level rows - sub rows add too much complexity\n onSelectedRows(Object.assign({}, Array(rows.length).fill(true)));\n } else {\n onSelectedRows({});\n }\n };\n\n return <Checkbox {...props} onChange={onChange} />;\n },\n Cell: ({ row, rows }: any) => {\n const { onChange: _, ...props } = row.getToggleRowSelectedProps();\n // row.index refers to the index in the original data, not the current index\n const sortedIndex = rows.findIndex((r: Row) => r.index === row.index);\n\n const onClick = (event: React.MouseEvent): void => {\n if (event.shiftKey) {\n const [fromIndex, toIndex] = toggleBetween(lastSelectedSortedIndex.current || 0, sortedIndex);\n\n for (let i = fromIndex; i <= toIndex; i++) {\n toggleRowSelected(rows[i].id, true);\n }\n } else {\n toggleRowSelected(row.id, !props.checked);\n }\n\n lastSelectedSortedIndex.current = sortedIndex;\n };\n\n return (\n <Checkbox\n {...props}\n className=\"!mt-2.5\"\n onClick={onClick}\n // this is necessary to remove console spam from eslint\n onChange={() => false}\n />\n );\n },\n flex: '0 0 36px',\n className: 'flex-col justify-start !py-0',\n },\n ...columns,\n ]);\n }\n };\n plugin.pluginName = 'useRowSelect';\n return plugin;\n};\n"],"names":["toggleBetween","fromRowIndex","toRowIndex","fromIndex","toIndex","useRowSelect","onSelectedRows","plugin","hooks","useBaseRowSelect","toggleRowSelected","indexPath","checked","state","nextState","prepareRow","row","id","isSelected","push","lastSelectedSortedIndex","React","useRef","visibleColumns","columns","Header","getToggleAllRowsSelectedProps","rows","onChange","_","props","Object","assign","Array","length","fill","Checkbox","Cell","getToggleRowSelectedProps","sortedIndex","findIndex","r","index","onClick","event","shiftKey","current","i","className","flex","pluginName"],"mappings":";;;;AAAA;AAMA,MAAMA,aAAa,GAAGA,CAACC,YAAoB,EAAEC,UAAkB;EAC3D,MAAMC,SAAS,GAAGD,UAAU,GAAGD,YAAY,GAAGC,UAAU,GAAGD,YAAY;EACvE,MAAMG,OAAO,GAAGF,UAAU,GAAGD,YAAY,GAAGC,UAAU,GAAGD,YAAY;EAErE,OAAO,CAACE,SAAS,EAAEC,OAAO,CAAC;AAC/B,CAAC;AAED;AACA;MAEaC,YAAY,GAAIC,cAA+C;EACxE,MAAMC,MAAM,GAAIC,KAAU;;IAEtBC,cAAgB,CAACD,KAAK,CAAC;IAEvB,IAAIF,cAAc,EAAE;MAChB,MAAMI,iBAAiB,GAAGA,CAACC,SAAiB,EAAEC,OAAgB,KAC1DN,cAAc,CAACO,KAAK;QAChB,MAAMC,SAAS,GAAG;UAAE,GAAGD;SAAO;QAE9B,IAAID,OAAO,EAAE;UACTE,SAAS,CAACH,SAAS,CAAC,GAAG,IAAI;SAC9B,MAAM;UACH,OAAOG,SAAS,CAACH,SAAS,CAAC;;QAG/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,aAAa,CAACoB,uBAAuB,CAAC0B,OAAO,IAAI,CAAC,EAAEP,WAAW,CAAC;cAE7F,KAAK,IAAIQ,CAAC,GAAG5C,SAAS,EAAE4C,CAAC,IAAI3C,OAAO,EAAE2C,CAAC,EAAE,EAAE;gBACvCrC,iBAAiB,CAACiB,IAAI,CAACoB,CAAC,CAAC,CAAC9B,EAAE,EAAE,IAAI,CAAC;;aAE1C,MAAM;cACHP,iBAAiB,CAACM,GAAG,CAACC,EAAE,EAAE,CAACa,KAAK,CAAClB,OAAO,CAAC;;YAG7CQ,uBAAuB,CAAC0B,OAAO,GAAGP,WAAW;WAChD;UAED,oBACIlB,6BAACe,QAAQ,oBACDN,KAAK;YACTkB,SAAS,EAAC,SAAS;YACnBL,OAAO,EAAEA,OAAO;;YAEhBf,QAAQ,EAAEA,MAAM;aAClB;SAET;QACDqB,IAAI,EAAE,UAAU;QAChBD,SAAS,EAAE;OACd,EACD,GAAGxB,OAAO,CACb,CAAC;;GAET;EACDjB,MAAM,CAAC2C,UAAU,GAAG,cAAc;EAClC,OAAO3C,MAAM;AACjB;;;;"}
1
+ {"version":3,"file":"useRowSelect.js","sources":["../../../../../../../../../src/components/Table/hooks/plugins/useRowSelect.tsx"],"sourcesContent":["// this wraps react-table's internal useRowSelect hook\nimport React from 'react';\nimport { useRowSelect as useBaseRowSelect, Row, PluginHook } from 'react-table';\nimport { Checkbox } from '../../../Checkbox/Checkbox';\nimport { SelectedRowsHandler } from '../../types';\n\nconst toggleBetween = (fromRowIndex: number, toRowIndex: number): [number, number] => {\n const fromIndex = toRowIndex < fromRowIndex ? toRowIndex : fromRowIndex;\n const toIndex = toRowIndex > fromRowIndex ? toRowIndex : fromRowIndex;\n\n return [fromIndex, toIndex];\n};\n\n// react-table calls \"index paths\" row ids. we named them indexPaths to reduce confusion with natural ids\n// the selection hook usess react-table's row selection, so this hok references row.id - it is the index path\n\nexport const useRowSelect = (onSelectedRows: SelectedRowsHandler | undefined): PluginHook<{}> => {\n const plugin = (hooks: any): void => {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useBaseRowSelect(hooks);\n\n if (onSelectedRows) {\n const toggleRowSelected = (indexPath: string, checked: boolean): void =>\n onSelectedRows(state => {\n const nextState = { ...state };\n\n if (checked) {\n nextState[indexPath as any] = true;\n } else {\n delete nextState[indexPath as any];\n }\n\n return nextState;\n });\n\n const prepareRow = (row: any) => {\n row.toggleRowSelected = () => toggleRowSelected(row.id, !row.isSelected);\n };\n\n hooks.prepareRow.push(prepareRow);\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const lastSelectedSortedIndex = React.useRef();\n\n hooks.visibleColumns.push((columns: any) => [\n {\n id: 'selection',\n Header: ({ getToggleAllRowsSelectedProps, rows }: any) => {\n const { onChange: _, ...props } = getToggleAllRowsSelectedProps();\n\n const onChange = (checked: boolean): void => {\n if (checked) {\n // this intentionally only selects top level rows - sub rows add too much complexity\n onSelectedRows(Object.assign({}, Array(rows.length).fill(true)));\n } else {\n onSelectedRows({});\n }\n };\n\n return <Checkbox {...props} onChange={onChange} />;\n },\n Cell: ({ row, rows }: any) => {\n const { onChange: _, ...props } = row.getToggleRowSelectedProps();\n // row.index refers to the index in the original data, not the current index\n const sortedIndex = rows.findIndex((r: Row) => r.index === row.index);\n\n const onClick = (event: React.MouseEvent): void => {\n if (event.shiftKey) {\n const [fromIndex, toIndex] = toggleBetween(lastSelectedSortedIndex.current || 0, sortedIndex);\n\n for (let i = fromIndex; i <= toIndex; i++) {\n toggleRowSelected(rows[i].id, true);\n }\n } else {\n toggleRowSelected(row.id, !props.checked);\n }\n\n lastSelectedSortedIndex.current = sortedIndex;\n };\n\n return (\n <Checkbox\n {...props}\n className=\"!mt-2.5\"\n onClick={onClick}\n // this is necessary to remove console spam from eslint\n onChange={() => false}\n />\n );\n },\n flex: '0 0 36px',\n className: 'flex-col justify-start !py-0',\n },\n ...columns,\n ]);\n }\n };\n plugin.pluginName = 'useRowSelect';\n return plugin;\n};\n"],"names":["toggleBetween","fromRowIndex","toRowIndex","fromIndex","toIndex","useRowSelect","onSelectedRows","plugin","hooks","useBaseRowSelect","toggleRowSelected","indexPath","checked","state","nextState","prepareRow","row","id","isSelected","push","lastSelectedSortedIndex","React","useRef","visibleColumns","columns","Header","getToggleAllRowsSelectedProps","rows","onChange","_","props","Object","assign","Array","length","fill","Checkbox","Cell","getToggleRowSelectedProps","sortedIndex","findIndex","r","index","onClick","event","shiftKey","current","i","className","flex","pluginName"],"mappings":";;;;AAAA;AAMA,MAAMA,aAAa,GAAGA,CAACC,YAAoB,EAAEC,UAAkB;EAC3D,MAAMC,SAAS,GAAGD,UAAU,GAAGD,YAAY,GAAGC,UAAU,GAAGD,YAAY;EACvE,MAAMG,OAAO,GAAGF,UAAU,GAAGD,YAAY,GAAGC,UAAU,GAAGD,YAAY;EAErE,OAAO,CAACE,SAAS,EAAEC,OAAO,CAAC;AAC/B,CAAC;AAED;AACA;MAEaC,YAAY,GAAIC,cAA+C;EACxE,MAAMC,MAAM,GAAIC,KAAU;;IAEtBC,cAAgB,CAACD,KAAK,CAAC;IAEvB,IAAIF,cAAc,EAAE;MAChB,MAAMI,iBAAiB,GAAGA,CAACC,SAAiB,EAAEC,OAAgB,KAC1DN,cAAc,CAACO,KAAK;QAChB,MAAMC,SAAS,GAAG;UAAE,GAAGD;SAAO;QAE9B,IAAID,OAAO,EAAE;UACTE,SAAS,CAACH,SAAgB,CAAC,GAAG,IAAI;SACrC,MAAM;UACH,OAAOG,SAAS,CAACH,SAAgB,CAAC;;QAGtC,OAAOG,SAAS;OACnB,CAAC;MAEN,MAAMC,UAAU,GAAIC,GAAQ;QACxBA,GAAG,CAACN,iBAAiB,GAAG,MAAMA,iBAAiB,CAACM,GAAG,CAACC,EAAE,EAAE,CAACD,GAAG,CAACE,UAAU,CAAC;OAC3E;MAEDV,KAAK,CAACO,UAAU,CAACI,IAAI,CAACJ,UAAU,CAAC;;MAGjC,MAAMK,uBAAuB,GAAGC,cAAK,CAACC,MAAM,EAA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GAAG,CAACC,EAAE,EAAE,CAACa,KAAK,CAAClB,OAAO,CAAC;;YAG7CQ,uBAAuB,CAAC0B,OAAO,GAAGP,WAAW;WAChD;UAED,oBACIlB,6BAACe,QAAQ,oBACDN,KAAK;YACTkB,SAAS,EAAC,SAAS;YACnBL,OAAO,EAAEA,OAAO;;YAEhBf,QAAQ,EAAEA,MAAM;aAClB;SAET;QACDqB,IAAI,EAAE,UAAU;QAChBD,SAAS,EAAE;OACd,EACD,GAAGxB,OAAO,CACb,CAAC;;GAET;EACDjB,MAAM,CAAC2C,UAAU,GAAG,cAAc;EAClC,OAAO3C,MAAM;AACjB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RowMoveIndicator.js","sources":["../../../../../../../../../../../src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.tsx"],"sourcesContent":["import React from 'react';\nimport { Cell as ReactTableCell, TableMeta as ReactTableMeta, ColumnMeta as ReactTableColumnMeta } from '@tanstack/react-table';\nimport { Tooltip } from '../../../../../Tooltip/Tooltip';\nimport { useLocalization } from '../../../../../Provider/Localization';\nimport { Icon } from '../../../../../Icon/Icon';\n\ntype TableRowMoveIndicatorProps<TType = unknown> = {\n cell: ReactTableCell<TType, unknown>;\n cellRef: React.RefObject<HTMLTableCellElement>;\n isActiveRow: boolean;\n};\n\nexport function RowMoveIndicator<TType = unknown>(props: TableRowMoveIndicatorProps<TType>) {\n const { cell, cellRef, isActiveRow } = props;\n const { texts } = useLocalization();\n const [show, setShow] = React.useState(false);\n const tableMeta = cell.getContext().table.options.meta as ReactTableMeta<TType>;\n const columnMeta = (cell.column.columnDef.meta ?? {}) as ReactTableColumnMeta<TType, unknown>;\n const moveReason = tableMeta.editing.getRowMoveReason(cell.row.id);\n\n React.useEffect(() => {\n if (cellRef.current) {\n if (isActiveRow && !!moveReason) {\n const firstChild = cellRef.current.parentElement?.querySelector(`td[data-taco=\"cell-control\"]`);\n\n if (cellRef.current === firstChild) {\n setShow(true);\n cellRef.current.parentElement?.setAttribute('data-row-editing-move', 'true');\n }\n } else {\n setShow(false);\n cellRef.current.parentElement?.removeAttribute('data-row-editing-move');\n }\n }\n\n return () => {\n if (cellRef.current) {\n cellRef.current.parentElement?.removeAttribute('data-row-editing-move');\n }\n };\n }, [cellRef, isActiveRow, moveReason]);\n\n if (!show) {\n return null;\n }\n\n const className =\n 'wcag-blue-500 absolute left-0 top-full ml-1 whitespace-nowrap rounded-b-md px-1 py-1 text-xs font-bold z-10';\n\n const { title, description } = getMessageFromReason(texts, moveReason);\n\n return (\n <Tooltip placement=\"bottom\" title={description.replace('[COLUMN]', columnMeta.header)}>\n <span className={className}>\n <Icon name=\"info\" className=\"-mt-0.5 mr-1 !h-4 !w-4 rounded-full bg-white !p-0 text-blue-500\" />\n {title}\n </span>\n </Tooltip>\n );\n}\n\nfunction getMessageFromReason(texts, reason) {\n let title = '';\n let description = '';\n\n switch (reason) {\n case 'filter':\n title = texts.table3.editing.rowIndicator.rowWillBeHidden;\n description = texts.table3.editing.rowIndicator.rowWillMoveReasonFilter;\n break;\n\n case 'search':\n title = texts.table3.editing.rowIndicator.rowWillBeHidden;\n description = texts.table3.editing.rowIndicator.rowWillMoveReasonSearch;\n break;\n\n case 'sorting':\n title = texts.table3.editing.rowIndicator.rowWillMove;\n description = texts.table3.editing.rowIndicator.rowWillMoveReasonSorting;\n break;\n }\n\n return { title, description };\n}\n"],"names":["RowMoveIndicator","props","cell","cellRef","isActiveRow","texts","useLocalization","show","setShow","React","useState","tableMeta","getContext","table","options","meta","columnMeta","_cell$column$columnDe","column","columnDef","moveReason","editing","getRowMoveReason","row","id","useEffect","current","_cellRef$current$pare","firstChild","parentElement","querySelector","_cellRef$current$pare2","setAttribute","_cellRef$current$pare3","removeAttribute","_cellRef$current$pare4","className","title","description","getMessageFromReason","Tooltip","placement","replace","header","Icon","name","reason","table3","rowIndicator","rowWillBeHidden","rowWillMoveReasonFilter","rowWillMoveReasonSearch","rowWillMove","rowWillMoveReasonSorting"],"mappings":";;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AAC1B,OAAO,CAAC2B,YAAY,CAACG,uBAAuB;MACvE;IAEJ,KAAK,SAAS;MACVd,KAAK,GAAGhC,KAAK,CAAC0C,MAAM,CAAC1B,OAAO,CAAC2B,YAAY,CAACI,WAAW;MACrDd,WAAW,GAAGjC,KAAK,CAAC0C,MAAM,CAAC1B,OAAO,CAAC2B,YAAY,CAACK,wBAAwB;MACxE;;EAGR,OAAO;IAAEhB,KAAK;IAAEC;GAAa;AACjC;;;;"}
1
+ {"version":3,"file":"RowMoveIndicator.js","sources":["../../../../../../../../../../../src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.tsx"],"sourcesContent":["import React from 'react';\nimport { Cell as ReactTableCell, TableMeta as ReactTableMeta, ColumnMeta as ReactTableColumnMeta } from '@tanstack/react-table';\nimport { Tooltip } from '../../../../../Tooltip/Tooltip';\nimport { LocalizationTexts, useLocalization } from '../../../../../Provider/Localization';\nimport { Icon } from '../../../../../Icon/Icon';\n\ntype TableRowMoveIndicatorProps<TType = unknown> = {\n cell: ReactTableCell<TType, unknown>;\n cellRef: React.RefObject<HTMLTableCellElement>;\n isActiveRow: boolean;\n};\n\nexport function RowMoveIndicator<TType = unknown>(props: TableRowMoveIndicatorProps<TType>) {\n const { cell, cellRef, isActiveRow } = props;\n const { texts } = useLocalization();\n const [show, setShow] = React.useState(false);\n const tableMeta = cell.getContext().table.options.meta as ReactTableMeta<TType>;\n const columnMeta = (cell.column.columnDef.meta ?? {}) as ReactTableColumnMeta<TType, unknown>;\n const moveReason = tableMeta.editing.getRowMoveReason(cell.row.id);\n\n React.useEffect(() => {\n if (cellRef.current) {\n if (isActiveRow && !!moveReason) {\n const firstChild = cellRef.current.parentElement?.querySelector(`td[data-taco=\"cell-control\"]`);\n\n if (cellRef.current === firstChild) {\n setShow(true);\n cellRef.current.parentElement?.setAttribute('data-row-editing-move', 'true');\n }\n } else {\n setShow(false);\n cellRef.current.parentElement?.removeAttribute('data-row-editing-move');\n }\n }\n\n return () => {\n if (cellRef.current) {\n cellRef.current.parentElement?.removeAttribute('data-row-editing-move');\n }\n };\n }, [cellRef, isActiveRow, moveReason]);\n\n if (!show) {\n return null;\n }\n\n const className =\n 'wcag-blue-500 absolute left-0 top-full ml-1 whitespace-nowrap rounded-b-md px-1 py-1 text-xs font-bold z-10';\n\n const { title, description } = getMessageFromReason(texts, moveReason);\n\n return (\n <Tooltip placement=\"bottom\" title={description.replace('[COLUMN]', columnMeta.header)}>\n <span className={className}>\n <Icon name=\"info\" className=\"-mt-0.5 mr-1 !h-4 !w-4 rounded-full bg-white !p-0 text-blue-500\" />\n {title}\n </span>\n </Tooltip>\n );\n}\n\nfunction getMessageFromReason(texts: LocalizationTexts, reason: 'search' | 'sorting' | 'filter' | undefined) {\n let title = '';\n let description = '';\n\n switch (reason) {\n case 'filter':\n title = texts.table3.editing.rowIndicator.rowWillBeHidden;\n description = texts.table3.editing.rowIndicator.rowWillMoveReasonFilter;\n break;\n\n case 'search':\n title = texts.table3.editing.rowIndicator.rowWillBeHidden;\n description = texts.table3.editing.rowIndicator.rowWillMoveReasonSearch;\n break;\n\n case 'sorting':\n title = texts.table3.editing.rowIndicator.rowWillMove;\n description = texts.table3.editing.rowIndicator.rowWillMoveReasonSorting;\n break;\n }\n\n return { title, description };\n}\n"],"names":["RowMoveIndicator","props","cell","cellRef","isActiveRow","texts","useLocalization","show","setShow","React","useState","tableMeta","getContext","table","options","meta","columnMeta","_cell$column$columnDe","column","columnDef","moveReason","editing","getRowMoveReason","row","id","useEffect","current","_cellRef$current$pare","firstChild","parentElement","querySelector","_cellRef$current$pare2","setAttribute","_cellRef$current$pare3","removeAttribute","_cellRef$current$pare4","className","title","description","getMessageFromReason","Tooltip","placement","replace","header","Icon","name","reason","table3","rowIndicator","rowWillBeHidden","rowWillMoveReasonFilter","rowWillMoveReasonSearch","rowWillMove","rowWillMoveReasonSorting"],"mappings":";;;;;SAYgBA,gBAAgBA,CAAkBC,KAAwC;;EACtF,MAAM;IAAEC,IAAI;IAAEC,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ACVd,KAAK,GAAGhC,KAAK,CAAC0C,MAAM,CAAC1B,OAAO,CAAC2B,YAAY,CAACI,WAAW;MACrDd,WAAW,GAAGjC,KAAK,CAAC0C,MAAM,CAAC1B,OAAO,CAAC2B,YAAY,CAACK,wBAAwB;MACxE;;EAGR,OAAO;IAAEhB,KAAK;IAAEC;GAAa;AACjC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EditingControlCell.js","sources":["../../../../../../../../../../src/components/Table3/components/Columns/Cell/EditingControlCell.tsx"],"sourcesContent":["import React from 'react';\nimport { TableMeta as ReactTableMeta, ColumnMeta as ReactTableColumnMeta } from '@tanstack/react-table';\nimport { isDate } from 'date-fns';\nimport { Datepicker } from '../../../../Datepicker/Datepicker';\nimport { Switch } from '../../../../Switch/Switch';\nimport { Input } from '../../../../Input/Input';\nimport { TableColumnDataType, TableColumnRendererControl, TableFontSize } from '../../../../../primitives/Table/types';\nimport { isWeakEqual as isWeakEqualDate } from '../../../../../utils/date';\nimport { RowMoveIndicator } from './Editing/RowMoveIndicator';\nimport { TextareaWithAutosizing } from './Editing/TextareaWithAutosizing';\nimport { Field } from '../../../../Field/Field';\nimport { isElementInsideOrTriggeredFromContainer } from '../../../../../utils/dom';\nimport { TableCellRendererProps } from '../../../../../primitives/Table/Core/types';\nimport { RowContext } from '../../../../../primitives/Table/Core/components/Row/RowContext';\nimport { getCellAttributes } from '../../../../../primitives/Table/Core/components/Columns/Cell/util';\nimport { useEditingCellAutofocus } from './util';\nimport { isPressingMetaKey } from '../../../../../utils/keyboard';\n\nexport function EditingControlCell<TType = unknown>(props: TableCellRendererProps<TType>) {\n const { cell, cellRef, isHighlighted, index } = props;\n const { rowIndex } = React.useContext(RowContext);\n const tableMeta = cell.getContext().table.options.meta as ReactTableMeta<TType>;\n const columnMeta = cell.column.columnDef.meta as ReactTableColumnMeta<TType, unknown>;\n const isActiveRow = tableMeta.rowActive.rowActiveIndex === rowIndex;\n\n const handleFocus = useEditingCellAutofocus<TType>(props);\n\n const handleBlur = () => {\n tableMeta.editing.toggleDetailedMode(false);\n tableMeta.editing.validateCell(cell);\n };\n\n // ensure that blur runs when the cell gets unmounted (when vertically arrow key navigating)\n React.useEffect(() => {\n const ref = cellRef.current;\n\n return () => {\n if (document.activeElement === ref || isElementInsideOrTriggeredFromContainer(document.activeElement, ref)) {\n handleBlur();\n }\n };\n }, []);\n\n const error = tableMeta.editing.getCellError<TType>(cell);\n\n const controlProps = {\n dataType: columnMeta.dataType,\n fontSize: tableMeta.fontSize.size,\n id: cell.column.id,\n invalid: !!error,\n isDetailedMode: tableMeta.editing.isDetailedMode,\n isTruncated: !!columnMeta.enableTruncate,\n onBlur: handleBlur,\n onChange: (value: unknown) => tableMeta.editing.setCellValue(cell, value, rowIndex),\n row: cell.row.original,\n tabIndex: isActiveRow ? 0 : -1,\n toggleEditing: tableMeta.editing.toggleEditing,\n toggleDetailedMode: tableMeta.editing.toggleDetailedMode,\n type: columnMeta.control ?? 'input',\n value: cell.getValue(),\n };\n\n const cellAttributes = {\n ...getCellAttributes(cell, index, isHighlighted),\n 'data-cell-editing-invalid': error ? true : undefined,\n 'data-taco': 'cell-control',\n onFocus: handleFocus,\n ref: cellRef,\n tabIndex: -1,\n };\n\n return (\n <td {...cellAttributes}>\n <Field invalid={!!error} message={error}>\n <MemoedEditingCell<TType> {...controlProps} />\n </Field>\n {\n // we show row move indicator here within the cell rather than the row because it is\n // an editing only feature, and we don't want to leak editing into the shared row component\n }\n <RowMoveIndicator cell={cell} cellRef={cellRef} isActiveRow={isActiveRow} />\n </td>\n );\n}\n\ntype MemoedEditingCellProps<TType = unknown, TValue = unknown> = {\n dataType?: TableColumnDataType;\n fontSize: TableFontSize;\n id: string;\n invalid: boolean;\n isDetailedMode: boolean;\n isTruncated: boolean;\n onBlur: () => void;\n onChange: (value: TValue) => void;\n row: TType;\n tabIndex?: number;\n toggleEditing: (editing: React.SetStateAction<boolean>) => void;\n toggleDetailedMode: (detailed: React.SetStateAction<boolean>) => void;\n type: TableColumnRendererControl<TType>;\n value: TValue;\n};\n\nconst MemoedEditingCell = React.memo(function MemoedEditingCell<TType = unknown>(props: MemoedEditingCellProps<TType>) {\n const {\n dataType,\n fontSize,\n id,\n invalid,\n isDetailedMode,\n isTruncated,\n onBlur,\n onChange,\n row,\n tabIndex = -1,\n toggleEditing,\n toggleDetailedMode,\n type = 'input',\n value,\n } = props;\n const controlRef = React.useRef<HTMLElement>(null);\n const currentValue = row[id];\n const commonProps = {\n onBlur,\n ref: controlRef,\n tabIndex,\n };\n\n if (typeof type === 'function') {\n const controlFnProps = {\n ...commonProps,\n invalid,\n setValue: onChange,\n value,\n };\n return type(controlFnProps, row);\n }\n\n if (type === 'switch') {\n return (\n <Switch\n {...commonProps}\n checked={Boolean(value)}\n onChange={onChange}\n ref={controlRef as React.RefObject<HTMLButtonElement>}\n />\n );\n }\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const target = event.target as HTMLInputElement | HTMLTextAreaElement;\n\n if (target.readOnly) {\n return;\n }\n\n // prevent active row navigation while in detailed mode\n if (\n isDetailedMode &&\n (event.key === 'ArrowUp' || event.key === 'ArrowDown' || event.key === 'ArrowLeft' || event.key === 'ArrowRight')\n ) {\n event.stopPropagation();\n }\n\n // enter or exit detail mode when pressing enter\n if (event.key === 'Enter') {\n // textareas support shift and enter, don't prevent default in that case\n if (event.shiftKey && isDetailedMode) {\n return;\n }\n\n event.preventDefault();\n\n if (isDetailedMode) {\n target.select?.();\n } else {\n target.setSelectionRange?.(target.value?.length, target.value?.length);\n }\n\n toggleDetailedMode(editing => !editing);\n return;\n }\n\n // reset the value, or exit edit mode when pressing escape\n if (event.key === 'Escape') {\n event.preventDefault();\n\n if (isDetailedMode) {\n toggleDetailedMode(false);\n\n if (value !== currentValue) {\n props.onChange(currentValue);\n }\n\n // have to let onChange run before selecting, otherwise the value changes\n requestAnimationFrame(() => target.select?.());\n } else {\n toggleEditing(false);\n }\n\n return;\n }\n\n // toggle into detailed mode when actually inputting something\n if (!isPressingMetaKey(event) && (/^[a-z0-9]$/i.test(event.key) || event.key === 'Backspace')) {\n toggleDetailedMode(true);\n }\n };\n\n const handleFocus = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (!isDetailedMode) {\n event.target.select();\n }\n };\n\n if (type === 'datepicker') {\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const newDate = (event as any).detail;\n\n if (!value || !newDate || (isDate(value) && isDate(newDate) && !isWeakEqualDate(value as Date, newDate as Date))) {\n props.onChange((event as any).detail);\n }\n };\n\n return (\n <Datepicker\n {...commonProps}\n invalid={invalid}\n onChange={handleChange}\n onFocus={handleFocus}\n onKeyDown={handleInputKeyDown}\n ref={controlRef as React.RefObject<HTMLInputElement>}\n value={value as Date}\n />\n );\n }\n\n if (type === 'textarea') {\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n onChange(event.target.value);\n };\n\n return (\n <TextareaWithAutosizing\n {...commonProps}\n fontSize={fontSize}\n invalid={invalid}\n isTruncated={isTruncated}\n onChange={handleChange}\n onFocus={handleFocus}\n onKeyDown={handleInputKeyDown}\n ref={controlRef as React.RefObject<HTMLTextAreaElement>}\n value={String(value ?? '')}\n />\n );\n }\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n onChange(dataType === 'number' && event.target.value ? Number.parseInt(event.target.value) : event.target.value);\n };\n\n return (\n <Input\n {...commonProps}\n invalid={invalid}\n onChange={handleChange}\n onFocus={handleFocus}\n onKeyDown={handleInputKeyDown}\n ref={controlRef as React.RefObject<HTMLInputElement>}\n type={dataType === 'number' ? 'number' : undefined}\n value={dataType === 'number' ? (value as number) : String(value ?? '')}\n />\n );\n}) as <TType = unknown>(props: MemoedEditingCellProps<TType>) => JSX.Element;\n"],"names":["EditingControlCell","props","cell","cellRef","isHighlighted","index","rowIndex","React","useContext","RowContext","tableMeta","getContext","table","options","meta","columnMeta","column","columnDef","isActiveRow","rowActive","rowActiveIndex","handleFocus","useEditingCellAutofocus","handleBlur","editing","toggleDetailedMode","validateCell","useEffect","ref","current","document","activeElement","isElementInsideOrTriggeredFromContainer","error","getCellError","controlProps","dataType","fontSize","size","id","invalid","isDetailedMode","isTruncated","enableTruncate","onBlur","onChange","value","setCellValue","row","original","tabIndex","toggleEditing","type","_columnMeta$control","control","getValue","cellAttributes","getCellAttributes","undefined","onFocus","Field","message","MemoedEditingCell","RowMoveIndicator","memo","controlRef","useRef","currentValue","commonProps","controlFnProps","setValue","Switch","checked","Boolean","handleInputKeyDown","event","target","readOnly","key","stopPropagation","shiftKey","preventDefault","_target$select","select","call","_target$setSelectionR","_target$value","_target$value2","setSelectionRange","length","requestAnimationFrame","_target$select2","isPressingMetaKey","test","handleChange","newDate","detail","isDate","isWeakEqualDate","Datepicker","onKeyDown","TextareaWithAutosizing","String","Number","parseInt","Input"],"mappings":";;;;;;;;;;;;;;;SAkBgBA,kBAAkBA,CAAkBC,KAAoC;;EACpF,MAAM;IAAEC,IAAI;IAAEC,OAAO;IAAEC,aAAa;IAAEC;GAAO,GAAGJ,KAAK;EACrD,MAAM;IAAEK;GAAU,GAAGC,cAAK,CAACC,UAAU,CAACC,UAAU,CAAC;EACjD,MAAMC,SAAS,GAAGR,IAAI,CAACS,UAAU,EAAE,CAACC,KAAK,CAACC,OAAO,CAACC,IAA6B;EAC/E,MAAMC,UAAU,GAAGb,IAAI,CAACc,MAAM,CAACC,SAAS,CAACH,IAA4C;EACrF,MAAMI,WAAW,GAAGR,SAAS,CAACS,SAAS,CAACC,cAAc,KAAKd,QAAQ;EAEnE,MAAMe,WAAW,GAAGC,uBAAuB,CAAQrB,KAAK,CAAC;EAEzD,MAAMsB,UAAU,GAAGA;IACfb,SAAS,CAACc,OAAO,CAACC,kBAAkB,CAAC,KAAK,CAAC;IAC3Cf,SAAS,CAACc,OAAO,CAACE,YAAY,CAACxB,IAAI,CAAC;GACvC;;EAGDK,cAAK,CAACoB,SAAS,CAAC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/components/Table3/components/Columns/Cell/EditingControlCell.tsx"],"sourcesContent":["import React from 'react';\nimport { TableMeta as ReactTableMeta, ColumnMeta as ReactTableColumnMeta } from '@tanstack/react-table';\nimport { isDate } from 'date-fns';\nimport { Datepicker } from '../../../../Datepicker/Datepicker';\nimport { Switch } from '../../../../Switch/Switch';\nimport { Input } from '../../../../Input/Input';\nimport { TableColumnDataType, TableColumnRendererControl, TableFontSize } from '../../../../../primitives/Table/types';\nimport { isWeakEqual as isWeakEqualDate } from '../../../../../utils/date';\nimport { RowMoveIndicator } from './Editing/RowMoveIndicator';\nimport { TextareaWithAutosizing } from './Editing/TextareaWithAutosizing';\nimport { Field } from '../../../../Field/Field';\nimport { isElementInsideOrTriggeredFromContainer } from '../../../../../utils/dom';\nimport { TableCellRendererProps } from '../../../../../primitives/Table/Core/types';\nimport { RowContext } from '../../../../../primitives/Table/Core/components/Row/RowContext';\nimport { getCellAttributes } from '../../../../../primitives/Table/Core/components/Columns/Cell/util';\nimport { useEditingCellAutofocus } from './util';\nimport { isPressingMetaKey } from '../../../../../utils/keyboard';\n\nexport function EditingControlCell<TType = unknown>(props: TableCellRendererProps<TType>) {\n const { cell, cellRef, isHighlighted, index } = props;\n const { rowIndex } = React.useContext(RowContext);\n const tableMeta = cell.getContext().table.options.meta as ReactTableMeta<TType>;\n const columnMeta = cell.column.columnDef.meta as ReactTableColumnMeta<TType, unknown>;\n const isActiveRow = tableMeta.rowActive.rowActiveIndex === rowIndex;\n\n const handleFocus = useEditingCellAutofocus<TType>(props);\n\n const handleBlur = () => {\n tableMeta.editing.toggleDetailedMode(false);\n tableMeta.editing.validateCell(cell);\n };\n\n // ensure that blur runs when the cell gets unmounted (when vertically arrow key navigating)\n React.useEffect(() => {\n const ref = cellRef.current;\n\n return () => {\n if (document.activeElement === ref || isElementInsideOrTriggeredFromContainer(document.activeElement, ref)) {\n handleBlur();\n }\n };\n }, []);\n\n const error = tableMeta.editing.getCellError<TType>(cell);\n\n const controlProps = {\n dataType: columnMeta.dataType,\n fontSize: tableMeta.fontSize.size,\n id: cell.column.id,\n invalid: !!error,\n isDetailedMode: tableMeta.editing.isDetailedMode,\n isTruncated: !!columnMeta.enableTruncate,\n onBlur: handleBlur,\n onChange: (value: unknown) => tableMeta.editing.setCellValue(cell, value, rowIndex),\n row: cell.row.original,\n tabIndex: isActiveRow ? 0 : -1,\n toggleEditing: tableMeta.editing.toggleEditing,\n toggleDetailedMode: tableMeta.editing.toggleDetailedMode,\n type: columnMeta.control ?? 'input',\n value: cell.getValue(),\n };\n\n const cellAttributes = {\n ...getCellAttributes(cell, index, isHighlighted),\n 'data-cell-editing-invalid': error ? true : undefined,\n 'data-taco': 'cell-control',\n onFocus: handleFocus,\n ref: cellRef,\n tabIndex: -1,\n };\n\n return (\n <td {...cellAttributes}>\n <Field invalid={!!error} message={error}>\n <MemoedEditingCell<TType> {...controlProps} />\n </Field>\n {\n // we show row move indicator here within the cell rather than the row because it is\n // an editing only feature, and we don't want to leak editing into the shared row component\n }\n <RowMoveIndicator cell={cell} cellRef={cellRef} isActiveRow={isActiveRow} />\n </td>\n );\n}\n\ntype MemoedEditingCellProps<TType = unknown, TValue = unknown> = {\n dataType?: TableColumnDataType;\n fontSize: TableFontSize;\n id: string;\n invalid: boolean;\n isDetailedMode: boolean;\n isTruncated: boolean;\n onBlur: () => void;\n onChange: (value: TValue) => void;\n row: TType;\n tabIndex?: number;\n toggleEditing: (editing: React.SetStateAction<boolean>) => void;\n toggleDetailedMode: (detailed: React.SetStateAction<boolean>) => void;\n type: TableColumnRendererControl<TType>;\n value: TValue;\n};\n\nconst MemoedEditingCell = React.memo(function MemoedEditingCell<TType = unknown>(props: MemoedEditingCellProps<TType>) {\n const {\n dataType,\n fontSize,\n id,\n invalid,\n isDetailedMode,\n isTruncated,\n onBlur,\n onChange,\n row,\n tabIndex = -1,\n toggleEditing,\n toggleDetailedMode,\n type = 'input',\n value,\n } = props;\n const controlRef = React.useRef<HTMLElement>(null);\n const currentValue = (row as any)[id];\n const commonProps = {\n onBlur,\n ref: controlRef,\n tabIndex,\n };\n\n if (typeof type === 'function') {\n const controlFnProps = {\n ...commonProps,\n invalid,\n setValue: onChange,\n value,\n };\n return type(controlFnProps, row);\n }\n\n if (type === 'switch') {\n return (\n <Switch\n {...commonProps}\n checked={Boolean(value)}\n onChange={onChange}\n ref={controlRef as React.RefObject<HTMLButtonElement>}\n />\n );\n }\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const target = event.target as HTMLInputElement | HTMLTextAreaElement;\n\n if (target.readOnly) {\n return;\n }\n\n // prevent active row navigation while in detailed mode\n if (\n isDetailedMode &&\n (event.key === 'ArrowUp' || event.key === 'ArrowDown' || event.key === 'ArrowLeft' || event.key === 'ArrowRight')\n ) {\n event.stopPropagation();\n }\n\n // enter or exit detail mode when pressing enter\n if (event.key === 'Enter') {\n // textareas support shift and enter, don't prevent default in that case\n if (event.shiftKey && isDetailedMode) {\n return;\n }\n\n event.preventDefault();\n\n if (isDetailedMode) {\n target.select?.();\n } else {\n target.setSelectionRange?.(target.value?.length, target.value?.length);\n }\n\n toggleDetailedMode(editing => !editing);\n return;\n }\n\n // reset the value, or exit edit mode when pressing escape\n if (event.key === 'Escape') {\n event.preventDefault();\n\n if (isDetailedMode) {\n toggleDetailedMode(false);\n\n if (value !== currentValue) {\n props.onChange(currentValue);\n }\n\n // have to let onChange run before selecting, otherwise the value changes\n requestAnimationFrame(() => target.select?.());\n } else {\n toggleEditing(false);\n }\n\n return;\n }\n\n // toggle into detailed mode when actually inputting something\n if (!isPressingMetaKey(event) && (/^[a-z0-9]$/i.test(event.key) || event.key === 'Backspace')) {\n toggleDetailedMode(true);\n }\n };\n\n const handleFocus = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (!isDetailedMode) {\n event.target.select();\n }\n };\n\n if (type === 'datepicker') {\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const newDate = (event as any).detail;\n\n if (!value || !newDate || (isDate(value) && isDate(newDate) && !isWeakEqualDate(value as Date, newDate as Date))) {\n props.onChange((event as any).detail);\n }\n };\n\n return (\n <Datepicker\n {...commonProps}\n invalid={invalid}\n onChange={handleChange}\n onFocus={handleFocus}\n onKeyDown={handleInputKeyDown}\n ref={controlRef as React.RefObject<HTMLInputElement>}\n value={value as Date}\n />\n );\n }\n\n if (type === 'textarea') {\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n onChange(event.target.value);\n };\n\n return (\n <TextareaWithAutosizing\n {...commonProps}\n fontSize={fontSize}\n invalid={invalid}\n isTruncated={isTruncated}\n onChange={handleChange}\n onFocus={handleFocus}\n onKeyDown={handleInputKeyDown}\n ref={controlRef as React.RefObject<HTMLTextAreaElement>}\n value={String(value ?? '')}\n />\n );\n }\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n onChange(dataType === 'number' && event.target.value ? Number.parseInt(event.target.value) : event.target.value);\n };\n\n return (\n <Input\n {...commonProps}\n invalid={invalid}\n onChange={handleChange}\n onFocus={handleFocus}\n onKeyDown={handleInputKeyDown}\n ref={controlRef as React.RefObject<HTMLInputElement>}\n type={dataType === 'number' ? 'number' : undefined}\n value={dataType === 'number' ? (value as number) : String(value ?? '')}\n />\n );\n}) as <TType = unknown>(props: MemoedEditingCellProps<TType>) => JSX.Element;\n"],"names":["EditingControlCell","props","cell","cellRef","isHighlighted","index","rowIndex","React","useContext","RowContext","tableMeta","getContext","table","options","meta","columnMeta","column","columnDef","isActiveRow","rowActive","rowActiveIndex","handleFocus","useEditingCellAutofocus","handleBlur","editing","toggleDetailedMode","validateCell","useEffect","ref","current","document","activeElement","isElementInsideOrTriggeredFromContainer","error","getCellError","controlProps","dataType","fontSize","size","id","invalid","isDetailedMode","isTruncated","enableTruncate","onBlur","onChange","value","setCellValue","row","original","tabIndex","toggleEditing","type","_columnMeta$control","control","getValue","cellAttributes","getCellAttributes","undefined","onFocus","Field","message","MemoedEditingCell","RowMoveIndicator","memo","controlRef","useRef","currentValue","commonProps","controlFnProps","setValue","Switch","checked","Boolean","handleInputKeyDown","event","target","readOnly","key","stopPropagation","shiftKey","preventDefault","_target$select","select","call","_target$setSelectionR","_target$value","_target$value2","setSelectionRange","length","requestAnimationFrame","_target$select2","isPressingMetaKey","test","handleChange","newDate","detail","isDate","isWeakEqualDate","Datepicker","onKeyDown","TextareaWithAutosizing","String","Number","parseInt","Input"],"mappings":";;;;;;;;;;;;;;;SAkBgBA,kBAAkBA,CAAkBC,KAAoC;;EACpF,MAAM;IAAEC,IAAI;IAAEC,OAAO;IAAEC,aAAa;IAAEC;GAAO,GAAGJ,KAAK;EACrD,MAAM;IAAEK;GAAU,GAAGC,cAAK,CAACC,UAAU,CAACC,UAAU,CAAC;EACjD,MAAMC,SAAS,GAAGR,IAAI,CAACS,UAAU,EAAE,CAACC,KAAK,CAACC,OAAO,CAACC,IAA6B;EAC/E,MAAMC,UAAU,GAAGb,IAAI,CAACc,MAAM,CAACC,SAAS,CAACH,IAA4C;EACrF,MAAMI,WAAW,GAAGR,SAAS,CAACS,SAAS,CAACC,cAAc,KAAKd,QAAQ;EAEnE,MAAMe,WAAW,GAAGC,uBAAuB,CAAQrB,KAAK,CAAC;EAEzD,MAAMsB,UAAU,GAAGA;IACfb,SAAS,CAACc,OAAO,CAACC,kBAAkB,CAAC,KAAK,CAAC;IAC3Cf,SAAS,CAACc,OAAO,CAACE,YAAY,CAACxB,IAAI,CAAC;GACvC;;EAGDK,cAAK,CAACoB,SAAS,CAAC;IACZ,MAAMC,GAAG,GAAGzB,OAAO,CAAC0B,OAAO;IAE3B,OAAO;MACH,IAAIC,QAAQ,CAACC,aAAa,KAAKH,GAAG,IAAII,uCAAuC,CAACF,QAAQ,CAACC,aAAa,EAAEH,GAAG,CAAC,EAAE;QACxGL,UAAU,EAAE;;KAEnB;GACJ,EAAE,EAAE,CAAC;EAEN,MAAMU,KAAK,GAAGvB,SAAS,CAACc,OAAO,CAACU,YAAY,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AEA,OAAO;MAChBE,WAAW,EAAEA,WAAW;MACxBG,QAAQ,EAAEiD,YAAY;MACtBnC,OAAO,EAAEtC,WAAW;MACpB+E,SAAS,EAAE1B,kBAAkB;MAC7B9C,GAAG,EAAEqC,UAAkD;MACvDnB,KAAK,EAAEwD,MAAM,CAACxD,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE;OAC3B;;EAIV,MAAMgD,YAAY,GAAInB,KAA0C;IAC5D9B,QAAQ,CAACT,QAAQ,KAAK,QAAQ,IAAIuC,KAAK,CAACC,MAAM,CAAC9B,KAAK,GAAGyD,MAAM,CAACC,QAAQ,CAAC7B,KAAK,CAACC,MAAM,CAAC9B,KAAK,CAAC,GAAG6B,KAAK,CAACC,MAAM,CAAC9B,KAAK,CAAC;GACnH;EAED,oBACIvC,6BAACkG,KAAK,oBACErC,WAAW;IACf5B,OAAO,EAAEA,OAAO;IAChBK,QAAQ,EAAEiD,YAAY;IACtBnC,OAAO,EAAEtC,WAAW;IACpB+E,SAAS,EAAE1B,kBAAkB;IAC7B9C,GAAG,EAAEqC,UAA+C;IACpDb,IAAI,EAAEhB,QAAQ,KAAK,QAAQ,GAAG,QAAQ,GAAGsB,SAAS;IAClDZ,KAAK,EAAEV,QAAQ,KAAK,QAAQ,GAAIU,KAAgB,GAAGwD,MAAM,CAACxD,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE;KACvE;AAEV,CAAC,CAA2E;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EditingActionsMenu.js","sources":["../../../../../../../../../../src/components/Table3/components/Columns/Internal/EditingActionsMenu.tsx"],"sourcesContent":["import React from 'react';\nimport { IconButton } from '../../../../IconButton/IconButton';\nimport { Menu } from '../../../../Menu/Menu';\nimport { useLocalization } from '../../../../Provider/Localization';\nimport { Dialog, DialogProps } from '../../../../Dialog/Dialog';\nimport { Group } from '../../../../Group/Group';\nimport { Button } from '../../../../Button/Button';\n\ntype EditingActionMenuProps = {\n hasChanges: boolean;\n hasErrors: boolean;\n onClear: () => void;\n onExit: () => void;\n onEditingSave: () => Promise<void>;\n isLastRow: boolean;\n};\n\nexport function EditingActionMenu(props: EditingActionMenuProps) {\n const { hasChanges, hasErrors, onClear: handleClear, onExit: handleExit, onEditingSave: handleSave, isLastRow } = props;\n const { texts } = useLocalization();\n\n const handleKeyDown = event => {\n // normally we handle this on change of active row, but when tabbing out of the last row the active row state stays on the last one.\n if (isLastRow && hasChanges && event.key === 'Tab') {\n handleSave();\n }\n };\n\n return (\n <IconButton\n appearance=\"transparent\"\n aria-label={texts.table3.editing.actions.tooltip}\n className=\"group-[[data-row-editing-status]]/row:hidden\"\n icon=\"more\"\n onKeyDown={handleKeyDown}\n menu={menuProps => (\n <Menu {...menuProps}>\n <Menu.Content>\n <Menu.Item icon=\"tick\" disabled={!hasChanges || hasErrors} onClick={handleSave}>\n {texts.table3.editing.actions.save}\n </Menu.Item>\n <Menu.Item\n icon=\"close\"\n disabled={!hasChanges}\n dialog={props => <ConfirmClearChangesDialog {...props} onClear={handleClear} />}>\n {texts.table3.editing.actions.clear}\n </Menu.Item>\n <Menu.Item icon=\"undo\" onClick={handleExit}>\n {texts.table3.editing.actions.exit}\n </Menu.Item>\n </Menu.Content>\n </Menu>\n )}\n />\n );\n}\n\ntype ConfirmClearChangesDialogProps = Partial<DialogProps> & {\n onClear: () => void;\n};\n\nfunction ConfirmClearChangesDialog(props: ConfirmClearChangesDialogProps) {\n const { onClear: handleClear, ...dialogProps } = props;\n const { texts } = useLocalization();\n\n return (\n <Dialog {...dialogProps}>\n <Dialog.Content aria-label={texts.table3.editing.clearChangesConfirmationDialog.title}>\n <Dialog.Title>{texts.table3.editing.clearChangesConfirmationDialog.title}</Dialog.Title>\n\n <p>{texts.table3.editing.clearChangesConfirmationDialog.description}</p>\n\n <Dialog.Footer>\n <Group>\n <Dialog.Close>\n <Button tabIndex={0}>{texts.table3.editing.clearChangesConfirmationDialog.cancel}</Button>\n </Dialog.Close>\n <Dialog.Close>\n <Button tabIndex={0} appearance=\"primary\" autoFocus onClick={handleClear}>\n {texts.table3.editing.clearChangesConfirmationDialog.confirm}\n </Button>\n </Dialog.Close>\n </Group>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog>\n );\n}\n"],"names":["EditingActionMenu","props","hasChanges","hasErrors","onClear","handleClear","onExit","handleExit","onEditingSave","handleSave","isLastRow","texts","useLocalization","handleKeyDown","event","key","React","IconButton","appearance","table3","editing","actions","tooltip","className","icon","onKeyDown","menu","menuProps","Menu","Content","Item","disabled","onClick","save","dialog","ConfirmClearChangesDialog","clear","exit","dialogProps","Dialog","clearChangesConfirmationDialog","title","Title","description","Footer","Group","Close","Button","tabIndex","cancel","autoFocus","confirm"],"mappings":";;;;;;;;SAiBgBA,iBAAiBA,CAACC,KAA6B;EAC3D,MAAM;IAAEC,UAAU;IAAEC,SAAS;IAAEC,OAAO,EAAEC,WAAW;IAAEC,MAAM,EAAEC,UAAU;IAAEC,aAAa,EAAEC,UAAU;IAAEC;GAAW,GAAGT,KAAK;EACvH,MAAM;IAAEU;GAAO,GAAGC,eAAe,EAAE;EAEnC,MAAMC,aAAa,GAAGC,KAAK;;IAEvB,IAAIJ,SAAS,IAAIR,UAAU,IAAIY,KAAK,CAACC,GAAG,KAAK,KAAK,EAAE;MAChDN,UAAU,EAAE;;GAEnB;EAED,oBACIO,6BAACC,UAAU;IACPC,UAAU,EAAC,aAAa;kBACZP,KAAK,CAACQ,MAAM,CAACC,OAAO,CAACC,OAAO,CAACC,OAAO;IAChDC,SAAS,EAAC,8CAA8C;IACxDC,IAAI,EAAC,MAAM;IACXC,SAAS,EAAEZ,aAAa;IACxBa,IAAI,EAAEC,SAAS,kBACXX,6BAACY,IAAI,oBAAKD,SAAS,gBACfX,6BAACY,IAAI,CAACC,OAAO,qBACTb,6BAACY,IAAI,CAACE,IAAI;MAACN,IAAI,EAAC,MAAM;MAACO,QAAQ,EAAE,CAAC7B,UAAU,IAAIC,SAAS;MAAE6B,OAAO,EAAE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,KAAK,qBACT9B,6BAAC+B,MAAM;IAACC,QAAQ,EAAE,CAAC;IAAE9B,UAAU,EAAC,SAAS;IAACgC,SAAS;IAAClB,OAAO,EAAE3B;KACxDM,KAAK,CAACQ,MAAM,CAACC,OAAO,CAACoB,8BAA8B,CAACW,OAAO,CACvD,CACE,CACX,CACI,CACH,CACZ;AAEjB;;;;"}
1
+ {"version":3,"file":"EditingActionsMenu.js","sources":["../../../../../../../../../../src/components/Table3/components/Columns/Internal/EditingActionsMenu.tsx"],"sourcesContent":["import React from 'react';\nimport { IconButton } from '../../../../IconButton/IconButton';\nimport { Menu } from '../../../../Menu/Menu';\nimport { useLocalization } from '../../../../Provider/Localization';\nimport { Dialog, DialogProps } from '../../../../Dialog/Dialog';\nimport { Group } from '../../../../Group/Group';\nimport { Button } from '../../../../Button/Button';\n\ntype EditingActionMenuProps = {\n hasChanges: boolean;\n hasErrors: boolean;\n onClear: () => void;\n onExit: () => void;\n onEditingSave: () => Promise<void>;\n isLastRow: boolean;\n};\n\nexport function EditingActionMenu(props: EditingActionMenuProps) {\n const { hasChanges, hasErrors, onClear: handleClear, onExit: handleExit, onEditingSave: handleSave, isLastRow } = props;\n const { texts } = useLocalization();\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n // normally we handle this on change of active row, but when tabbing out of the last row the active row state stays on the last one.\n if (isLastRow && hasChanges && event.key === 'Tab') {\n handleSave();\n }\n };\n\n return (\n <IconButton\n appearance=\"transparent\"\n aria-label={texts.table3.editing.actions.tooltip}\n className=\"group-[[data-row-editing-status]]/row:hidden\"\n icon=\"more\"\n onKeyDown={handleKeyDown}\n menu={menuProps => (\n <Menu {...menuProps}>\n <Menu.Content>\n <Menu.Item icon=\"tick\" disabled={!hasChanges || hasErrors} onClick={handleSave}>\n {texts.table3.editing.actions.save}\n </Menu.Item>\n <Menu.Item\n icon=\"close\"\n disabled={!hasChanges}\n dialog={props => <ConfirmClearChangesDialog {...props} onClear={handleClear} />}>\n {texts.table3.editing.actions.clear}\n </Menu.Item>\n <Menu.Item icon=\"undo\" onClick={handleExit}>\n {texts.table3.editing.actions.exit}\n </Menu.Item>\n </Menu.Content>\n </Menu>\n )}\n />\n );\n}\n\ntype ConfirmClearChangesDialogProps = Partial<DialogProps> & {\n onClear: () => void;\n};\n\nfunction ConfirmClearChangesDialog(props: ConfirmClearChangesDialogProps) {\n const { onClear: handleClear, ...dialogProps } = props;\n const { texts } = useLocalization();\n\n return (\n <Dialog {...dialogProps}>\n <Dialog.Content aria-label={texts.table3.editing.clearChangesConfirmationDialog.title}>\n <Dialog.Title>{texts.table3.editing.clearChangesConfirmationDialog.title}</Dialog.Title>\n\n <p>{texts.table3.editing.clearChangesConfirmationDialog.description}</p>\n\n <Dialog.Footer>\n <Group>\n <Dialog.Close>\n <Button tabIndex={0}>{texts.table3.editing.clearChangesConfirmationDialog.cancel}</Button>\n </Dialog.Close>\n <Dialog.Close>\n <Button tabIndex={0} appearance=\"primary\" autoFocus onClick={handleClear}>\n {texts.table3.editing.clearChangesConfirmationDialog.confirm}\n </Button>\n </Dialog.Close>\n </Group>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog>\n );\n}\n"],"names":["EditingActionMenu","props","hasChanges","hasErrors","onClear","handleClear","onExit","handleExit","onEditingSave","handleSave","isLastRow","texts","useLocalization","handleKeyDown","event","key","React","IconButton","appearance","table3","editing","actions","tooltip","className","icon","onKeyDown","menu","menuProps","Menu","Content","Item","disabled","onClick","save","dialog","ConfirmClearChangesDialog","clear","exit","dialogProps","Dialog","clearChangesConfirmationDialog","title","Title","description","Footer","Group","Close","Button","tabIndex","cancel","autoFocus","confirm"],"mappings":";;;;;;;;SAiBgBA,iBAAiBA,CAACC,KAA6B;EAC3D,MAAM;IAAEC,UAAU;IAAEC,SAAS;IAAEC,OAAO,EAAEC,WAAW;IAAEC,MAAM,EAAEC,UAAU;IAAEC,aAAa,EAAEC,UAAU;IAAEC;GAAW,GAAGT,KAAK;EACvH,MAAM;IAAEU;GAAO,GAAG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6BAACuB,MAAM,oBAAKD,WAAW,gBACnBtB,6BAACuB,MAAM,CAACV,OAAO;kBAAalB,KAAK,CAACQ,MAAM,CAACC,OAAO,CAACoB,8BAA8B,CAACC;kBAC5EzB,6BAACuB,MAAM,CAACG,KAAK,QAAE/B,KAAK,CAACQ,MAAM,CAACC,OAAO,CAACoB,8BAA8B,CAACC,KAAK,CAAgB,eAExFzB,wCAAIL,KAAK,CAACQ,MAAM,CAACC,OAAO,CAACoB,8BAA8B,CAACG,WAAW,CAAK,eAExE3B,6BAACuB,MAAM,CAACK,MAAM,qBACV5B,6BAAC6B,KAAK,qBACF7B,6BAACuB,MAAM,CAACO,KAAK,qBACT9B,6BAAC+B,MAAM;IAACC,QAAQ,EAAE;KAAIrC,KAAK,CAACQ,MAAM,CAACC,OAAO,CAACoB,8BAA8B,CAACS,MAAM,CAAU,CAC/E,eACfjC,6BAACuB,MAAM,CAACO,KAAK,qBACT9B,6BAAC+B,MAAM;IAACC,QAAQ,EAAE,CAAC;IAAE9B,UAAU,EAAC,SAAS;IAACgC,SAAS;IAAClB,OAAO,EAAE3B;KACxDM,KAAK,CAACQ,MAAM,CAACC,OAAO,CAACoB,8BAA8B,CAACW,OAAO,CACvD,CACE,CACX,CACI,CACH,CACZ;AAEjB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","sources":["../../../../../../../../../src/components/Table3/components/Editing/Alert.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { ScrollToOptions as ReactVirtualScrollToOptions } from '@tanstack/react-virtual';\nimport { Alert as BaseAlert, AlertProps as BaseAlertProps } from '../../../Alert/Alert';\nimport { TableRef } from '../../../../primitives/Table/types';\nimport { Tooltip } from '../../../Tooltip/Tooltip';\nimport { useLocalization } from '../../../Provider/Localization';\nimport { Dialog, DialogProps } from '../../../Dialog/Dialog';\nimport { Group } from '../../../Group/Group';\nimport { Button } from '../../../Button/Button';\n\ntype AlertProps<TType = unknown> = Omit<BaseAlertProps, 'children'> & {\n scrollToIndex: (index: number, options: ReactVirtualScrollToOptions) => void;\n table: ReactTable<TType>;\n tableRef: React.RefObject<TableRef>;\n};\n\nexport function Alert<TType = unknown>(props: AlertProps<TType>) {\n const { scrollToIndex, table, tableRef, ...attributes } = props;\n const { texts } = useLocalization();\n const validationTexts = texts.table3.editing.validation;\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n const [showFilterResetDialog, setShowFilterResetDialog] = React.useState<string | false>(false);\n\n const pendingChangesWithErrors = tableMeta.editing.getErrors<TType>();\n\n const activeRow = React.useMemo(\n () => (tableMeta.rowActive.rowActiveIndex ? table.getRowModel().rows[tableMeta.rowActive.rowActiveIndex] : undefined),\n [tableMeta.rowActive.rowActiveIndex]\n );\n\n // mark errors being rendered as seen\n React.useEffect(() => {\n pendingChangesWithErrors.forEach(error => {\n if (activeRow && error.rowId === activeRow.id) {\n return;\n }\n\n tableMeta.editing.setRowErrorsSeen(error.rowId);\n });\n }, [pendingChangesWithErrors]);\n\n function scrollToRow(rowIndex: number) {\n tableMeta.rowActive.setRowActiveIndex(rowIndex);\n scrollToIndex(rowIndex, { align: 'center' });\n\n requestAnimationFrame(() => {\n const cell = tableRef.current?.querySelector(\n 'tbody > tr[data-row-active=\"true\"] > td[data-cell-editing-invalid=\"true\"]'\n );\n\n if (cell) {\n (cell as HTMLElement).focus?.();\n }\n });\n }\n\n // generate the \"N unsaved entries\" title\n const title = (\n pendingChangesWithErrors.length === 1 ? validationTexts.alert.titleOne : validationTexts.alert.titlePlural\n ).replace('[COUNT]', String(pendingChangesWithErrors.length));\n\n // generate links to each invalid row, to go into the error message\n const links: React.ReactNode[] = [];\n const rowIdentityColumn = tableMeta.rowIdentityColumnId ? table.getColumn(tableMeta.rowIdentityColumnId) : undefined;\n\n pendingChangesWithErrors.forEach((error, index) => {\n // if appropriate, concatenate the item with the text \"and\"\n if (pendingChangesWithErrors.length > 1 && index === pendingChangesWithErrors.length - 1) {\n // Add space before and after `messageAnd` text\n links.push(` ${validationTexts.alert.messageAnd} `);\n }\n const rowIndex = table.getRowModel().rows.findIndex(row => row.id === error.rowId);\n\n const handleClick = () => {\n if (rowIndex > -1) {\n scrollToRow(rowIndex);\n } else {\n setShowFilterResetDialog(error.rowId);\n }\n };\n\n let tooltip;\n\n if (error.pendingChange._meta.errors.row) {\n tooltip = error.pendingChange._meta.errors.row;\n } else {\n const firstCellErrorColumnId = Object.keys(error.pendingChange._meta.errors.cells)[0];\n const columnName = table.getAllColumns().find(column => column.id === firstCellErrorColumnId)?.columnDef.meta?.header;\n tooltip = `${columnName}: ${error.pendingChange._meta.errors.cells[firstCellErrorColumnId]}`;\n }\n\n links.push(\n <Tooltip key={error.rowId} title={tooltip}>\n <span className=\"text-blue\" onClick={handleClick} role=\"button\">\n {rowIdentityColumn ? error.pendingChange._meta.original[rowIdentityColumn.id] : rowIndex + 1}\n </span>\n </Tooltip>\n );\n\n // if appropriate, concatenate the item with the text \",\"\n if (pendingChangesWithErrors.length > 2 && index < pendingChangesWithErrors.length - 2) {\n links.push(', ');\n }\n });\n\n // generate the \"Row N is incomplete and hasn't been saved\" error message\n const message = (links.length === 1 ? validationTexts.alert.messageOne : validationTexts.alert.messagePlural)\n .split(/(\\[\\w+\\])/)\n .map(part => {\n if (part === '[COLUMN]') {\n return rowIdentityColumn?.columnDef.meta?.header ?? validationTexts.alert.messageRow;\n }\n\n if (part === '[ROW]') {\n return links;\n }\n\n return part;\n });\n\n const handleResetFilters = () => {\n table.resetGlobalFilter();\n table.resetColumnFilters();\n\n requestAnimationFrame(() => {\n const rowIndex = table.getRowModel().rows.findIndex(row => row.id === showFilterResetDialog);\n\n if (rowIndex > -1) {\n scrollToRow(rowIndex);\n }\n\n setShowFilterResetDialog(false);\n });\n };\n\n return (\n <>\n <BaseAlert {...attributes} state=\"error\">\n <span className=\"font-bold\">{title}</span>&nbsp;{message}\n </BaseAlert>\n <FilterResetDialog\n open={showFilterResetDialog !== false}\n onChange={() => setShowFilterResetDialog(false)}\n onSubmit={handleResetFilters}\n />\n </>\n );\n}\n\ntype FilterResetDialogProps = Omit<DialogProps, 'children'> & {\n onSubmit: () => void;\n};\n\nfunction FilterResetDialog(props: FilterResetDialogProps) {\n const { onSubmit: handleSubmit, ...dialogProps } = props;\n const { texts } = useLocalization();\n\n return (\n <Dialog {...dialogProps} size=\"xs\">\n <Dialog.Content aria-label=\"Create a new account\">\n <Dialog.Title>{texts.table3.editing.validation.resetFiltersDialog.title}</Dialog.Title>\n\n <p>{texts.table3.editing.validation.resetFiltersDialog.description}</p>\n\n <Dialog.Footer>\n <Group>\n <Dialog.Close>\n <Button>{texts.table3.editing.validation.resetFiltersDialog.cancel}</Button>\n </Dialog.Close>\n <Button appearance=\"primary\" onClick={handleSubmit}>\n {texts.table3.editing.validation.resetFiltersDialog.confirm}\n </Button>\n </Group>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog>\n );\n}\n"],"names":["Alert","props","scrollToIndex","table","tableRef","attributes","texts","useLocalization","validationTexts","table3","editing","validation","tableMeta","options","meta","showFilterResetDialog","setShowFilterResetDialog","React","useState","pendingChangesWithErrors","getErrors","activeRow","useMemo","rowActive","rowActiveIndex","getRowModel","rows","undefined","useEffect","forEach","error","rowId","id","setRowErrorsSeen","scrollToRow","rowIndex","setRowActiveIndex","align","requestAnimationFrame","cell","_tableRef$current","current","querySelector","_cell$focus","focus","call","title","length","alert","titleOne","titlePlural","replace","String","links","rowIdentityColumn","rowIdentityColumnId","getColumn","index","push","messageAnd","findIndex","row","handleClick","tooltip","pendingChange","_meta","errors","_table$getAllColumns$","_table$getAllColumns$2","firstCellErrorColumnId","Object","keys","cells","columnName","getAllColumns","find","column","columnDef","header","Tooltip","key","className","onClick","role","original","message","messageOne","messagePlural","split","map","part","_rowIdentityColumn$co","_rowIdentityColumn$co2","messageRow","handleResetFilters","resetGlobalFilter","resetColumnFilters","BaseAlert","state","FilterResetDialog","open","onChange","onSubmit","handleSubmit","dialogProps","Dialog","size","Content","Title","resetFiltersDialog","description","Footer","Group","Close","Button","cancel","appearance","confirm"],"mappings":";;;;;;;;SAiBgBA,KAAKA,CAAkBC,KAAwB;EAC3D,MAAM;IAAEC,aAAa;IAAEC,KAAK;IAAEC,QAAQ;IAAE,GAAGC;GAAY,GAAGJ,KAAK;EAC/D,MAAM;IAAEK;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMC,eAAe,GAAGF,KAAK,CAACG,MAAM,CAACC,OAAO,CAACC,UAAU;EACvD,MAAMC,SAAS,GAAGT,KAAK,CAACU,OAAO,CAACC,IAA6B;EAC7D,MAAM,CAACC,qBAAqB,EAAEC,wBAAwB,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAiB,KAAK,CAAC;EAE/F,MAAMC,wBAAwB,GAAGP,SAAS,CAACF,OAAO,CAACU,SAAS,EAAS;EAErE,MAAMC,SAAS,GAAGJ,cAAK,CAACK,OAAO,CAC3B,MAAOV,SAAS,CAACW,SAAS,CAACC,cAAc,GAAGrB,KAAK,CAACsB,WAAW,EAAE,CAACC,IAAI,CAACd,SAAS,CAACW,SAAS,CAACC,cAAc,CAAC,GAAGG,SAAU,EACrH,CAACf,SAAS,CAACW,SAAS,CAACC,cAAc,CAAC,CACvC;;EAGDP,cAAK,CAACW,SAAS,CAAC;IACZT,wBAAwB,CAACU,OAAO,CAACC,KAAK;MAClC,IAAIT,SAAS,IAAIS,KAAK,CAACC,KAAK,KAAKV,SAAS,CAACW,EAAE,EAAE;QAC3C;;MAGJpB,SAAS,CAACF,OAAO,CAACuB,gBAAgB,CAACH,KAAK,CAACC,KAAK,CAAC;KAClD,CAAC;GACL,EAAE,CAACZ,wBAAwB,CAAC,CAAC;EAE9B,SAASe,WAAWA,CAACC,QAAgB;IACjCvB,SAAS,CAACW,SAAS,CAACa,iBAAiB,CAACD,QAAQ,CAAC;IAC/CjC,aAAa,CAACiC,QAAQ,EAAE;MAAEE,KAAK,EAAE;KAAU,CAAC;IAE5CC,qBAA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kF,iBAAiB;IACdC,IAAI,EAAErF,qBAAqB,KAAK,KAAK;IACrCsF,QAAQ,EAAEA,MAAMrF,wBAAwB,CAAC,KAAK,CAAC;IAC/CsF,QAAQ,EAAER;IACZ,CACH;AAEX;AAMA,SAASK,iBAAiBA,CAAClG,KAA6B;EACpD,MAAM;IAAEqG,QAAQ,EAAEC,YAAY;IAAE,GAAGC;GAAa,GAAGvG,KAAK;EACxD,MAAM;IAAEK;GAAO,GAAGC,eAAe,EAAE;EAEnC,oBACIU,6BAACwF,MAAM,oBAAKD,WAAW;IAAEE,IAAI,EAAC;mBAC1BzF,6BAACwF,MAAM,CAACE,OAAO;kBAAY;kBACvB1F,6BAACwF,MAAM,CAACG,KAAK,QAAEtG,KAAK,CAACG,MAAM,CAACC,OAAO,CAACC,UAAU,CAACkG,kBAAkB,CAAC/D,KAAK,CAAgB,eAEvF7B,wCAAIX,KAAK,CAACG,MAAM,CAACC,OAAO,CAACC,UAAU,CAACkG,kBAAkB,CAACC,WAAW,CAAK,eAEvE7F,6BAACwF,MAAM,CAACM,MAAM,qBACV9F,6BAAC+F,KAAK,qBACF/F,6BAACwF,MAAM,CAACQ,KAAK,qBACThG,6BAACiG,MAAM,QAAE5G,KAAK,CAACG,MAAM,CAACC,OAAO,CAACC,UAAU,CAACkG,kBAAkB,CAACM,MAAM,CAAU,CACjE,eACflG,6BAACiG,MAAM;IAACE,UAAU,EAAC,SAAS;IAAClC,OAAO,EAAEqB;KACjCjG,KAAK,CAACG,MAAM,CAACC,OAAO,CAACC,UAAU,CAACkG,kBAAkB,CAACQ,OAAO,CACtD,CACL,CACI,CACH,CACZ;AAEjB;;;;"}
1
+ {"version":3,"file":"Alert.js","sources":["../../../../../../../../../src/components/Table3/components/Editing/Alert.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { ScrollToOptions as ReactVirtualScrollToOptions } from '@tanstack/react-virtual';\nimport { Alert as BaseAlert, AlertProps as BaseAlertProps } from '../../../Alert/Alert';\nimport { TableRef } from '../../../../primitives/Table/types';\nimport { Tooltip } from '../../../Tooltip/Tooltip';\nimport { useLocalization } from '../../../Provider/Localization';\nimport { Dialog, DialogProps } from '../../../Dialog/Dialog';\nimport { Group } from '../../../Group/Group';\nimport { Button } from '../../../Button/Button';\n\ntype AlertProps<TType = unknown> = Omit<BaseAlertProps, 'children'> & {\n scrollToIndex: (index: number, options: ReactVirtualScrollToOptions) => void;\n table: ReactTable<TType>;\n tableRef: React.RefObject<TableRef>;\n};\n\nexport function Alert<TType = unknown>(props: AlertProps<TType>) {\n const { scrollToIndex, table, tableRef, ...attributes } = props;\n const { texts } = useLocalization();\n const validationTexts = texts.table3.editing.validation;\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n const [showFilterResetDialog, setShowFilterResetDialog] = React.useState<string | false>(false);\n\n const pendingChangesWithErrors = tableMeta.editing.getErrors<TType>();\n\n const activeRow = React.useMemo(\n () => (tableMeta.rowActive.rowActiveIndex ? table.getRowModel().rows[tableMeta.rowActive.rowActiveIndex] : undefined),\n [tableMeta.rowActive.rowActiveIndex]\n );\n\n // mark errors being rendered as seen\n React.useEffect(() => {\n pendingChangesWithErrors.forEach(error => {\n if (activeRow && error.rowId === activeRow.id) {\n return;\n }\n\n tableMeta.editing.setRowErrorsSeen(error.rowId);\n });\n }, [pendingChangesWithErrors]);\n\n function scrollToRow(rowIndex: number) {\n tableMeta.rowActive.setRowActiveIndex(rowIndex);\n scrollToIndex(rowIndex, { align: 'center' });\n\n requestAnimationFrame(() => {\n const cell = tableRef.current?.querySelector(\n 'tbody > tr[data-row-active=\"true\"] > td[data-cell-editing-invalid=\"true\"]'\n );\n\n if (cell) {\n (cell as HTMLElement).focus?.();\n }\n });\n }\n\n // generate the \"N unsaved entries\" title\n const title = (\n pendingChangesWithErrors.length === 1 ? validationTexts.alert.titleOne : validationTexts.alert.titlePlural\n ).replace('[COUNT]', String(pendingChangesWithErrors.length));\n\n // generate links to each invalid row, to go into the error message\n const links: React.ReactNode[] = [];\n const rowIdentityColumn = tableMeta.rowIdentityColumnId ? table.getColumn(tableMeta.rowIdentityColumnId) : undefined;\n\n pendingChangesWithErrors.forEach((error, index) => {\n // if appropriate, concatenate the item with the text \"and\"\n if (pendingChangesWithErrors.length > 1 && index === pendingChangesWithErrors.length - 1) {\n // Add space before and after `messageAnd` text\n links.push(` ${validationTexts.alert.messageAnd} `);\n }\n const rowIndex = table.getRowModel().rows.findIndex(row => row.id === error.rowId);\n\n const handleClick = () => {\n if (rowIndex > -1) {\n scrollToRow(rowIndex);\n } else {\n setShowFilterResetDialog(error.rowId);\n }\n };\n\n let tooltip;\n\n if (error.pendingChange._meta.errors.row) {\n tooltip = error.pendingChange._meta.errors.row;\n } else {\n const firstCellErrorColumnId = Object.keys(error.pendingChange._meta.errors.cells)[0];\n const columnName = table.getAllColumns().find(column => column.id === firstCellErrorColumnId)?.columnDef.meta?.header;\n tooltip = `${columnName}: ${error.pendingChange._meta.errors.cells[firstCellErrorColumnId]}`;\n }\n\n links.push(\n <Tooltip key={error.rowId} title={tooltip}>\n <span className=\"text-blue\" onClick={handleClick} role=\"button\">\n {rowIdentityColumn ? (error.pendingChange._meta.original as any)[rowIdentityColumn.id] : rowIndex + 1}\n </span>\n </Tooltip>\n );\n\n // if appropriate, concatenate the item with the text \",\"\n if (pendingChangesWithErrors.length > 2 && index < pendingChangesWithErrors.length - 2) {\n links.push(', ');\n }\n });\n\n // generate the \"Row N is incomplete and hasn't been saved\" error message\n const message = (links.length === 1 ? validationTexts.alert.messageOne : validationTexts.alert.messagePlural)\n .split(/(\\[\\w+\\])/)\n .map(part => {\n if (part === '[COLUMN]') {\n return rowIdentityColumn?.columnDef.meta?.header ?? validationTexts.alert.messageRow;\n }\n\n if (part === '[ROW]') {\n return links;\n }\n\n return part;\n });\n\n const handleResetFilters = () => {\n table.resetGlobalFilter();\n table.resetColumnFilters();\n\n requestAnimationFrame(() => {\n const rowIndex = table.getRowModel().rows.findIndex(row => row.id === showFilterResetDialog);\n\n if (rowIndex > -1) {\n scrollToRow(rowIndex);\n }\n\n setShowFilterResetDialog(false);\n });\n };\n\n return (\n <>\n <BaseAlert {...attributes} state=\"error\">\n <span className=\"font-bold\">{title}</span>&nbsp;{message}\n </BaseAlert>\n <FilterResetDialog\n open={showFilterResetDialog !== false}\n onChange={() => setShowFilterResetDialog(false)}\n onSubmit={handleResetFilters}\n />\n </>\n );\n}\n\ntype FilterResetDialogProps = Omit<DialogProps, 'children'> & {\n onSubmit: () => void;\n};\n\nfunction FilterResetDialog(props: FilterResetDialogProps) {\n const { onSubmit: handleSubmit, ...dialogProps } = props;\n const { texts } = useLocalization();\n\n return (\n <Dialog {...dialogProps} size=\"xs\">\n <Dialog.Content aria-label=\"Create a new account\">\n <Dialog.Title>{texts.table3.editing.validation.resetFiltersDialog.title}</Dialog.Title>\n\n <p>{texts.table3.editing.validation.resetFiltersDialog.description}</p>\n\n <Dialog.Footer>\n <Group>\n <Dialog.Close>\n <Button>{texts.table3.editing.validation.resetFiltersDialog.cancel}</Button>\n </Dialog.Close>\n <Button appearance=\"primary\" onClick={handleSubmit}>\n {texts.table3.editing.validation.resetFiltersDialog.confirm}\n </Button>\n </Group>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog>\n );\n}\n"],"names":["Alert","props","scrollToIndex","table","tableRef","attributes","texts","useLocalization","validationTexts","table3","editing","validation","tableMeta","options","meta","showFilterResetDialog","setShowFilterResetDialog","React","useState","pendingChangesWithErrors","getErrors","activeRow","useMemo","rowActive","rowActiveIndex","getRowModel","rows","undefined","useEffect","forEach","error","rowId","id","setRowErrorsSeen","scrollToRow","rowIndex","setRowActiveIndex","align","requestAnimationFrame","cell","_tableRef$current","current","querySelector","_cell$focus","focus","call","title","length","alert","titleOne","titlePlural","replace","String","links","rowIdentityColumn","rowIdentityColumnId","getColumn","index","push","messageAnd","findIndex","row","handleClick","tooltip","pendingChange","_meta","errors","_table$getAllColumns$","_table$getAllColumns$2","firstCellErrorColumnId","Object","keys","cells","columnName","getAllColumns","find","column","columnDef","header","Tooltip","key","className","onClick","role","original","message","messageOne","messagePlural","split","map","part","_rowIdentityColumn$co","_rowIdentityColumn$co2","messageRow","handleResetFilters","resetGlobalFilter","resetColumnFilters","BaseAlert","state","FilterResetDialog","open","onChange","onSubmit","handleSubmit","dialogProps","Dialog","size","Content","Title","resetFiltersDialog","description","Footer","Group","Close","Button","cancel","appearance","confirm"],"mappings":";;;;;;;;SAiBgBA,KAAKA,CAAkBC,KAAwB;EAC3D,MAAM;IAAEC,aAAa;IAAEC,KAAK;IAAEC,QAAQ;IAAE,GAAGC;GAAY,GAAGJ,KAAK;EAC/D,MAAM;IAAEK;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMC,eAAe,GAAGF,KAAK,CAACG,MAAM,CAACC,OAAO,CAACC,UAAU;EACvD,MAAMC,SAAS,GAAGT,KAAK,CAACU,OAAO,CAACC,IAA6B;EAC7D,MAAM,CAACC,qBAAqB,EAAEC,wBAAwB,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAiB,KAAK,CAAC;EAE/F,MAAMC,wBAAwB,GAAGP,SAAS,CAACF,OAAO,CAACU,SAAS,EAAS;EAErE,MAAMC,SAAS,GAAGJ,cAAK,CAACK,OAAO,CAC3B,MAAOV,SAAS,CAACW,SAAS,CAACC,cAAc,GAAGrB,KAAK,CAACsB,WAAW,EAAE,CAACC,IAAI,CAACd,SAAS,CAACW,SAAS,CAACC,cAAc,CAAC,GAAGG,SAAU,EACrH,CAACf,SAAS,CAACW,SAAS,CAACC,cAAc,CAAC,CACvC;;EAGDP,cAAK,CAACW,SAAS,CAAC;IACZT,wBAAwB,CAACU,OAAO,CAACC,KAAK;MAClC,IAAIT,SAAS,IAAIS,KAAK,CAACC,KAAK,KAAKV,SAAS,CAACW,EAAE,EAAE;QAC3C;;MAGJpB,SAAS,CAACF,OAAO,CAACuB,gBAAgB,CAACH,KAAK,CAACC,KAAK,CAAC;KACl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AEjB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CreateRowButton.js","sources":["../../../../../../../../../../src/components/Table3/components/Row/Editing/CreateRowButton.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { ScrollToOptions } from '@tanstack/react-virtual';\nimport { Button } from '../../../../Button/Button';\nimport { useLocalization } from '../../../../Provider/Localization';\nimport { animateCreateRow } from '../../../util/editing';\n\ntype Props<TType = unknown> = {\n table: ReactTable<TType>;\n tableMeta: ReactTableMeta<TType>;\n onEditingCreate: (() => (row: Partial<TType>) => boolean) | undefined;\n scrollToIndex: (index: number, options?: ScrollToOptions) => void;\n};\n\nexport default function CreateNewRowButton<TType = unknown>(props: Props<TType>) {\n const { onEditingCreate, scrollToIndex, table, tableMeta } = props;\n const { texts } = useLocalization();\n const rows = table.getCoreRowModel().rows.filter(row => row.original !== undefined);\n\n const [rowCreated, setRowCreated] = React.useState<{ rowFinder: ((row: Partial<TType>) => boolean) | undefined }>({\n rowFinder: undefined,\n });\n\n const handleKeyDown = event => {\n if (!tableMeta.editing.hasChanges() && event.key === 'Tab') {\n !tableMeta.editing.saveChanges();\n }\n };\n\n const handleCreate = async () => {\n if (!onEditingCreate) {\n return;\n }\n const createdRow = rows.find(row => rowCreated?.rowFinder?.(row.original));\n\n if (createdRow) {\n await tableMeta.editing.saveChanges();\n\n if (!tableMeta.editing.hasRowErrors(createdRow.id)) {\n const rowFinder = onEditingCreate();\n\n setRowCreated({ rowFinder });\n }\n } else {\n const rowFinder = onEditingCreate();\n setRowCreated({ rowFinder });\n }\n };\n\n React.useEffect(() => {\n if (typeof rowCreated?.rowFinder === 'function') {\n const createdRow = rows.find(row => rowCreated?.rowFinder?.(row.original));\n\n if (createdRow) {\n const rowInTable = table\n .getRowModel()\n .rows.filter(row => row.original !== undefined)\n .find(row => rowCreated?.rowFinder?.(row.original));\n if (rowInTable) {\n tableMeta.editing.toggleEditing(true);\n tableMeta.rowActive.setRowActiveIndex(createdRow.index);\n scrollToIndex(createdRow.index);\n requestAnimationFrame(() => animateCreateRow(createdRow.id));\n }\n requestAnimationFrame(() => tableMeta.editing.addCreatedRowChangeset(createdRow));\n }\n }\n }, [rowCreated]);\n\n return (\n <tr\n onClick={handleCreate}\n className=\"border-grey-300 hover:bg-grey-100 group !sticky bottom-10 left-0 z-[21] !block cursor-pointer border-t\">\n <td className=\"!border-t-0 !bg-transparent\">\n <Button onKeyDown={handleKeyDown} className=\"group-hover:bg-grey-200 sticky left-0\" appearance=\"transparent\">\n + {texts.table3.editing.buttons.create.label}\n </Button>\n </td>\n </tr>\n );\n}\n"],"names":["CreateNewRowButton","props","onEditingCreate","scrollToIndex","table","tableMeta","texts","useLocalization","rows","getCoreRowModel","filter","row","original","undefined","rowCreated","setRowCreated","React","useState","rowFinder","handleKeyDown","event","editing","hasChanges","key","saveChanges","handleCreate","Promise","resolve","createdRow","find","_rowCreated$rowFinder","call","_temp","then","hasRowErrors","id","e","reject","useEffect","_rowCreated$rowFinder2","rowInTable","getRowModel","_rowCreated$rowFinder3","toggleEditing","rowActive","setRowActiveIndex","index","requestAnimationFrame","animateCreateRow","addCreatedRowChangeset","onClick","className","Button","onKeyDown","appearance","table3","buttons","create","label"],"mappings":";;;;;SAcwBA,kBAAkBA,CAAkBC,KAAmB;EAC3E,MAAM;IAAEC,eAAe;IAAEC,aAAa;IAAEC,KAAK;IAAEC;GAAW,GAAGJ,KAAK;EAClE,MAAM;IAAEK;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMC,IAAI,GAAGJ,KAAK,CAACK,eAAe,EAAE,CAACD,IAAI,CAACE,MAAM,CAACC,GAAG,IAAIA,GAAG,CAACC,QAAQ,KAAKC,SAAS,CAAC;EAEnF,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAgE;IAC9GC,SAAS,EAAEL;GACd,CAAC;EAEF,MAAMM,aAAa,GAAGC,KAAK;I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,CAACmC,OAAO,CAACC,MAAM,CAACC,KAAK,CACvC,CACR,CACJ;AAEb;;;;"}
1
+ {"version":3,"file":"CreateRowButton.js","sources":["../../../../../../../../../../src/components/Table3/components/Row/Editing/CreateRowButton.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { ScrollToOptions } from '@tanstack/react-virtual';\nimport { Button } from '../../../../Button/Button';\nimport { useLocalization } from '../../../../Provider/Localization';\nimport { animateCreateRow } from '../../../util/editing';\n\ntype Props<TType = unknown> = {\n table: ReactTable<TType>;\n tableMeta: ReactTableMeta<TType>;\n onEditingCreate: (() => (row: Partial<TType>) => boolean) | undefined;\n scrollToIndex: (index: number, options?: ScrollToOptions) => void;\n};\n\nexport default function CreateNewRowButton<TType = unknown>(props: Props<TType>) {\n const { onEditingCreate, scrollToIndex, table, tableMeta } = props;\n const { texts } = useLocalization();\n const rows = table.getCoreRowModel().rows.filter(row => row.original !== undefined);\n\n const [rowCreated, setRowCreated] = React.useState<{ rowFinder: ((row: Partial<TType>) => boolean) | undefined }>({\n rowFinder: undefined,\n });\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (!tableMeta.editing.hasChanges() && event.key === 'Tab') {\n !tableMeta.editing.saveChanges();\n }\n };\n\n const handleCreate = async () => {\n if (!onEditingCreate) {\n return;\n }\n const createdRow = rows.find(row => rowCreated?.rowFinder?.(row.original));\n\n if (createdRow) {\n await tableMeta.editing.saveChanges();\n\n if (!tableMeta.editing.hasRowErrors(createdRow.id)) {\n const rowFinder = onEditingCreate();\n\n setRowCreated({ rowFinder });\n }\n } else {\n const rowFinder = onEditingCreate();\n setRowCreated({ rowFinder });\n }\n };\n\n React.useEffect(() => {\n if (typeof rowCreated?.rowFinder === 'function') {\n const createdRow = rows.find(row => rowCreated?.rowFinder?.(row.original));\n\n if (createdRow) {\n const rowInTable = table\n .getRowModel()\n .rows.filter(row => row.original !== undefined)\n .find(row => rowCreated?.rowFinder?.(row.original));\n if (rowInTable) {\n tableMeta.editing.toggleEditing(true);\n tableMeta.rowActive.setRowActiveIndex(createdRow.index);\n scrollToIndex(createdRow.index);\n requestAnimationFrame(() => animateCreateRow(createdRow.id));\n }\n requestAnimationFrame(() => tableMeta.editing.addCreatedRowChangeset(createdRow as any));\n }\n }\n }, [rowCreated]);\n\n return (\n <tr\n onClick={handleCreate}\n className=\"border-grey-300 hover:bg-grey-100 group !sticky bottom-10 left-0 z-[21] !block cursor-pointer border-t\">\n <td className=\"!border-t-0 !bg-transparent\">\n <Button onKeyDown={handleKeyDown} className=\"group-hover:bg-grey-200 sticky left-0\" appearance=\"transparent\">\n + {texts.table3.editing.buttons.create.label}\n </Button>\n </td>\n </tr>\n );\n}\n"],"names":["CreateNewRowButton","props","onEditingCreate","scrollToIndex","table","tableMeta","texts","useLocalization","rows","getCoreRowModel","filter","row","original","undefined","rowCreated","setRowCreated","React","useState","rowFinder","handleKeyDown","event","editing","hasChanges","key","saveChanges","handleCreate","Promise","resolve","createdRow","find","_rowCreated$rowFinder","call","_temp","then","hasRowErrors","id","e","reject","useEffect","_rowCreated$rowFinder2","rowInTable","getRowModel","_rowCreated$rowFinder3","toggleEditing","rowActive","setRowActiveIndex","index","requestAnimationFrame","animateCreateRow","addCreatedRowChangeset","onClick","className","Button","onKeyDown","appearance","table3","buttons","create","label"],"mappings":";;;;;SAcwBA,kBAAkBA,CAAkBC,KAAmB;EAC3E,MAAM;IAAEC,eAAe;IAAEC,aAAa;IAAEC,KAAK;IAAEC;GAAW,GAAGJ,KAAK;EAClE,MAAM;IAAEK;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMC,IAAI,GAAGJ,KAAK,CAACK,eAAe,EAAE,CAACD,IAAI,CAACE,MAAM,CAACC,GAAG,IAAIA,GAAG,CAACC,QAAQ,KAAKC,SAAS,CAAC;EAEnF,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAgE;IAC9G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AAuC;IAACG,UAAU,EAAC;WACxFhD,KAAK,CAACiD,MAAM,CAAClC,OAAO,CAACmC,OAAO,CAACC,MAAM,CAACC,KAAK,CACvC,CACR,CACJ;AAEb;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SaveStatus.js","sources":["../../../../../../../../../../src/components/Table3/components/Row/Editing/SaveStatus.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport clsx from 'clsx';\nimport { Tooltip } from '../../../../Tooltip/Tooltip';\nimport { useLocalization } from '../../../../Provider/Localization';\nimport { Icon } from '../../../../Icon/Icon';\nimport { Spinner } from '../../../../Spinner/Spinner';\n\nconst COMPLETE_INDICATOR_DELAY = 3000;\n\ntype SaveStatusProps<TType = unknown> = {\n rowId: string;\n table: ReactTable<TType>;\n};\n\nexport function SaveStatus<TType = unknown>(props: SaveStatusProps<TType>) {\n const { rowId, table } = props;\n const { texts } = useLocalization();\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n const status = tableMeta.editing.getRowSaveStatus(rowId);\n\n React.useEffect(() => {\n let timeout;\n\n if (status === 'complete') {\n timeout = setTimeout(() => {\n tableMeta.editing.setRowSaveStatus(rowId, undefined);\n }, COMPLETE_INDICATOR_DELAY);\n }\n\n return () => {\n clearTimeout(timeout);\n };\n }, [status]);\n\n const className = clsx(\n 'col-span-full sticky ml-auto right-0 top-0 -mb-[100%] z-10 h-8 bg-[inherit] flex items-center px-1.5 shadow-[-6px_0px_6px_var(--table-row-actions-shadow)]',\n {\n 'mt-0.5': tableMeta.rowHeight.height === 'short',\n 'mt-1': tableMeta.rowHeight.height === 'medium',\n 'mt-1.5': tableMeta.rowHeight.height === 'tall',\n 'mt-2': tableMeta.rowHeight.height === 'extra-tall',\n }\n );\n\n return (\n <td className=\"!contents\">\n <span className={className}>\n {status === 'pending' ? (\n <Tooltip title={texts.table3.editing.saving.progress}>\n <Spinner delay={0} className=\"!text-grey-700 mr-1 !h-5 !w-5\" />\n </Tooltip>\n ) : (\n <Tooltip title={texts.table3.editing.saving.complete}>\n <Icon name=\"tick\" className=\"!text-grey-700 mr-1 !h-5 !w-5\" />\n </Tooltip>\n )}\n </span>\n </td>\n );\n}\n"],"names":["COMPLETE_INDICATOR_DELAY","SaveStatus","props","rowId","table","texts","useLocalization","tableMeta","options","meta","status","editing","getRowSaveStatus","React","useEffect","timeout","setTimeout","setRowSaveStatus","undefined","clearTimeout","className","clsx","rowHeight","height","Tooltip","title","table3","saving","progress","Spinner","delay","complete","Icon","name"],"mappings":";;;;;;;AAQA,MAAMA,wBAAwB,GAAG,IAAI;SAOrBC,UAAUA,CAAkBC,KAA6B;EACrE,MAAM;IAAEC,KAAK;IAAEC;GAAO,GAAGF,KAAK;EAC9B,MAAM;IAAEG;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMC,SAAS,GAAGH,KAAK,CAACI,OAAO,CAACC,IAA6B;EAC7D,MAAMC,MAAM,GAAGH,SAAS,CAACI,OAAO,CAACC,gBAAgB,CAACT,KAAK,CAAC;EAExDU,cAAK,CAACC,SAAS,CAAC;IACZ,IAAIC,OAAO;IAEX,IAAIL,MAAM,KAAK,UAAU,EAAE;MACvBK,OAAO,GAAGC,UAAU,CAAC;QACjBT,SAAS,CAACI,OAAO,CAACM,gBAAgB,CAACd,KAAK,EAAEe,SAAS,CAAC;OACvD,EAAElB,wBAAwB,CAAC;;IAGhC,OAAO;MACHmB,YAAY,CAACJ,OAAO,CAAC;KACxB;GACJ,EAAE,CAACL,MAAM,CAAC,CAAC;EAEZ,MAAMU,SAAS,GAAGC,EAAI,CAClB,4JAA4J,EAC5J;IACI,QAAQ,EAAEd,SAAS,CAACe,SAAS,CAACC,MAAM,KAAK,OAAO;IAChD,MAAM,EAAEhB,SAAS,CAACe,SAAS,CAACC,MAAM,KAAK,QAAQ;IAC/C,QAAQ,EAAEhB,SAAS,CAACe,SAAS,CAACC,MAAM,KAAK,MAAM;IAC/C,MAAM,EAAEhB,SAAS,CAACe,SAAS,CAACC,MAAM,KAAK;GAC1C,CACJ;EAED,oBACIV;IAAIO,SAAS,EAAC;kBACVP;IAAMO,SAAS,EAAEA;KACZV,MAAM,KAAK,SAAS,iBACjBG,6BAACW,OAAO;IAACC,KAAK,EAAEpB,KAAK,CAACqB,MAAM,CAACf,OAAO,CAACgB,MAAM,CAACC;kBACxCf,6BAACgB,OAAO;IAACC,KAAK,EAAE,CAAC;IAAEV,SAAS,EAAC;IAAkC,CACzD,kBAEVP,6BAACW,OAAO;IAACC,KAAK,EAAEpB,KAAK,CAACqB,MAAM,CAACf,OAAO,CAACgB,MAAM,CAACI;kBACxClB,6BAACmB,IAAI;IAACC,IAAI,EAAC,MAAM;IAACb,SAAS,EAAC;IAAkC,CACxD,CACb,CACE,CACN;AAEb;;;;"}
1
+ {"version":3,"file":"SaveStatus.js","sources":["../../../../../../../../../../src/components/Table3/components/Row/Editing/SaveStatus.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport clsx from 'clsx';\nimport { Tooltip } from '../../../../Tooltip/Tooltip';\nimport { useLocalization } from '../../../../Provider/Localization';\nimport { Icon } from '../../../../Icon/Icon';\nimport { Spinner } from '../../../../Spinner/Spinner';\n\nconst COMPLETE_INDICATOR_DELAY = 3000;\n\ntype SaveStatusProps<TType = unknown> = {\n rowId: string;\n table: ReactTable<TType>;\n};\n\nexport function SaveStatus<TType = unknown>(props: SaveStatusProps<TType>) {\n const { rowId, table } = props;\n const { texts } = useLocalization();\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n const status = tableMeta.editing.getRowSaveStatus(rowId);\n\n React.useEffect(() => {\n let timeout: NodeJS.Timeout;\n\n if (status === 'complete') {\n timeout = setTimeout(() => {\n tableMeta.editing.setRowSaveStatus(rowId, undefined);\n }, COMPLETE_INDICATOR_DELAY);\n }\n\n return () => {\n clearTimeout(timeout);\n };\n }, [status]);\n\n const className = clsx(\n 'col-span-full sticky ml-auto right-0 top-0 -mb-[100%] z-10 h-8 bg-[inherit] flex items-center px-1.5 shadow-[-6px_0px_6px_var(--table-row-actions-shadow)]',\n {\n 'mt-0.5': tableMeta.rowHeight.height === 'short',\n 'mt-1': tableMeta.rowHeight.height === 'medium',\n 'mt-1.5': tableMeta.rowHeight.height === 'tall',\n 'mt-2': tableMeta.rowHeight.height === 'extra-tall',\n }\n );\n\n return (\n <td className=\"!contents\">\n <span className={className}>\n {status === 'pending' ? (\n <Tooltip title={texts.table3.editing.saving.progress}>\n <Spinner delay={0} className=\"!text-grey-700 mr-1 !h-5 !w-5\" />\n </Tooltip>\n ) : (\n <Tooltip title={texts.table3.editing.saving.complete}>\n <Icon name=\"tick\" className=\"!text-grey-700 mr-1 !h-5 !w-5\" />\n </Tooltip>\n )}\n </span>\n </td>\n );\n}\n"],"names":["COMPLETE_INDICATOR_DELAY","SaveStatus","props","rowId","table","texts","useLocalization","tableMeta","options","meta","status","editing","getRowSaveStatus","React","useEffect","timeout","setTimeout","setRowSaveStatus","undefined","clearTimeout","className","clsx","rowHeight","height","Tooltip","title","table3","saving","progress","Spinner","delay","complete","Icon","name"],"mappings":";;;;;;;AAQA,MAAMA,wBAAwB,GAAG,IAAI;SAOrBC,UAAUA,CAAkBC,KAA6B;EACrE,MAAM;IAAEC,KAAK;IAAEC;GAAO,GAAGF,KAAK;EAC9B,MAAM;IAAEG;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMC,SAAS,GAAGH,KAAK,CAACI,OAAO,CAACC,IAA6B;EAC7D,MAAMC,MAAM,GAAGH,SAAS,CAACI,OAAO,CAACC,gBAAgB,CAACT,KAAK,CAAC;EAExDU,cAAK,CAACC,SAAS,CAAC;IACZ,IAAIC,OAAuB;IAE3B,IAAIL,MAAM,KAAK,UAAU,EAAE;MACvBK,OAAO,GAAGC,UAAU,CAAC;QACjBT,SAAS,CAACI,OAAO,CAACM,gBAAgB,CAACd,KAAK,EAAEe,SAAS,CAAC;OACvD,EAAElB,wBAAwB,CAAC;;IAGhC,OAAO;MACHmB,YAAY,CAACJ,OAAO,CAAC;KACxB;GACJ,EAAE,CAACL,MAAM,CAAC,CAAC;EAEZ,MAAMU,SAAS,GAAGC,EAAI,CAClB,4JAA4J,EAC5J;IACI,QAAQ,EAAEd,SAAS,CAACe,SAAS,CAACC,MAAM,KAAK,OAAO;IAChD,MAAM,EAAEhB,SAAS,CAACe,SAAS,CAACC,MAAM,KAAK,QAAQ;IAC/C,QAAQ,EAAEhB,SAAS,CAACe,SAAS,CAACC,MAAM,KAAK,MAAM;IAC/C,MAAM,EAAEhB,SAAS,CAACe,SAAS,CAACC,MAAM,KAAK;GAC1C,CACJ;EAED,oBACIV;IAAIO,SAAS,EAAC;kBACVP;IAAMO,SAAS,EAAEA;KACZV,MAAM,KAAK,SAAS,iBACjBG,6BAACW,OAAO;IAACC,KAAK,EAAEpB,KAAK,CAACqB,MAAM,CAACf,OAAO,CAACgB,MAAM,CAACC;kBACxCf,6BAACgB,OAAO;IAACC,KAAK,EAAE,CAAC;IAAEV,SAAS,EAAC;IAAkC,CACzD,kBAEVP,6BAACW,OAAO;IAACC,KAAK,EAAEpB,KAAK,CAACqB,MAAM,CAACf,OAAO,CAACgB,MAAM,CAACI;kBACxClB,6BAACmB,IAAI;IAACC,IAAI,EAAC,MAAM;IAACb,SAAS,EAAC;IAAkC,CACxD,CACb,CACE,CACN;AAEb;;;;"}
@@ -15,7 +15,10 @@ function Row(props) {
15
15
  const isActiveRow = tableMeta.rowActive.rowActiveIndex === index;
16
16
  React__default.useEffect(() => {
17
17
  if (tableMeta.editing.isEditing && isActiveRow && tableMeta.editing.lastFocusedCellIndex === undefined) {
18
- setDataFocusAttribute(focusManager.focusFirst());
18
+ const element = focusManager.focusFirst();
19
+ if (element) {
20
+ setDataFocusAttribute(element);
21
+ }
19
22
  }
20
23
  }, [tableMeta.editing.isEditing, tableMeta.rowActive.rowActiveIndex, tableMeta.editing.lastFocusedCellIndex]);
21
24
  const handleFocus = React__default.useCallback(event => {