@economic/taco 0.0.29-alpha.0 → 0.0.31-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -84
- package/dist/components/Datepicker/Datepicker.d.ts +1 -1
- package/dist/components/SearchInput/SearchInput.d.ts +1 -1
- package/dist/esm/components/Accordion/Accordion.js.map +1 -1
- package/dist/esm/components/Backdrop/Backdrop.js.map +1 -1
- package/dist/esm/components/Badge/Badge.js.map +1 -1
- package/dist/esm/components/Banner/Banner.js.map +1 -1
- package/dist/esm/components/Banner/util.js +1 -1
- package/dist/esm/components/Banner/util.js.map +1 -1
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/Button/util.js +19 -24
- package/dist/esm/components/Button/util.js.map +1 -1
- package/dist/esm/components/Calendar/Calendar.js.map +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/components/Combobox/Combobox.js.map +1 -1
- package/dist/esm/components/Combobox/useCombobox.js +67 -87
- package/dist/esm/components/Combobox/useCombobox.js.map +1 -1
- package/dist/esm/components/Datepicker/Datepicker.js.map +1 -1
- package/dist/esm/components/Datepicker/useDatepicker.js +27 -34
- package/dist/esm/components/Datepicker/useDatepicker.js.map +1 -1
- package/dist/esm/components/Dialog/Context.js +4 -4
- package/dist/esm/components/Dialog/Context.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/Dialog/components/Content.js +39 -44
- package/dist/esm/components/Dialog/components/Content.js.map +1 -1
- package/dist/esm/components/Dialog/components/Drawer.js +3 -3
- package/dist/esm/components/Dialog/components/Drawer.js.map +1 -1
- package/dist/esm/components/Dialog/components/Extra.js +2 -2
- package/dist/esm/components/Dialog/components/Extra.js.map +1 -1
- package/dist/esm/components/Dialog/components/Trigger.js +2 -2
- package/dist/esm/components/Dialog/components/Trigger.js.map +1 -1
- package/dist/esm/components/Field/Field.js.map +1 -1
- package/dist/esm/components/Form/Form.js.map +1 -1
- package/dist/esm/components/Group/Group.js.map +1 -1
- package/dist/esm/components/Hanger/Hanger.js.map +1 -1
- package/dist/esm/components/Icon/Icon.js.map +1 -1
- package/dist/esm/components/Icon/components/AccountPreview.js.map +1 -1
- package/dist/esm/components/Icon/components/Accounting.js.map +1 -1
- package/dist/esm/components/Icon/components/AccountingYear.js.map +1 -1
- package/dist/esm/components/Icon/components/AccountingYearCancel.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowBottom.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowDown.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowEnd.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowLeft.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowRight.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowStart.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowTop.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowUp.js.map +1 -1
- package/dist/esm/components/Icon/components/Attach.js.map +1 -1
- package/dist/esm/components/Icon/components/AttachAuto.js.map +1 -1
- package/dist/esm/components/Icon/components/AttachCancel.js.map +1 -1
- package/dist/esm/components/Icon/components/Autotext.js.map +1 -1
- package/dist/esm/components/Icon/components/AutotextInsert.js.map +1 -1
- package/dist/esm/components/Icon/components/Basic.js.map +1 -1
- package/dist/esm/components/Icon/components/BasicTabs.js.map +1 -1
- package/dist/esm/components/Icon/components/BellSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Book.js.map +1 -1
- package/dist/esm/components/Icon/components/Booking.js.map +1 -1
- package/dist/esm/components/Icon/components/Budget.js.map +1 -1
- package/dist/esm/components/Icon/components/Calendar.js.map +1 -1
- package/dist/esm/components/Icon/components/CashAccount.js.map +1 -1
- package/dist/esm/components/Icon/components/CashReports.js.map +1 -1
- package/dist/esm/components/Icon/components/Chat.js.map +1 -1
- package/dist/esm/components/Icon/components/ChatSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronDown.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronDownDouble.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronDownSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronLeft.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronLeftDouble.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronRight.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronRightDouble.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronUp.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronUpDouble.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronUpSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Clamp.js.map +1 -1
- package/dist/esm/components/Icon/components/ClampOpen.js.map +1 -1
- package/dist/esm/components/Icon/components/Close.js.map +1 -1
- package/dist/esm/components/Icon/components/ConnectionEnable.js.map +1 -1
- package/dist/esm/components/Icon/components/ConnectionRevoke.js.map +1 -1
- package/dist/esm/components/Icon/components/Contacts.js.map +1 -1
- package/dist/esm/components/Icon/components/Copy.js.map +1 -1
- package/dist/esm/components/Icon/components/Courses.js.map +1 -1
- package/dist/esm/components/Icon/components/Credit.js.map +1 -1
- package/dist/esm/components/Icon/components/Delete.js.map +1 -1
- package/dist/esm/components/Icon/components/DeletePermanently.js.map +1 -1
- package/dist/esm/components/Icon/components/Depecriate.js.map +1 -1
- package/dist/esm/components/Icon/components/Developer.js.map +1 -1
- package/dist/esm/components/Icon/components/DistributionTemplate.js.map +1 -1
- package/dist/esm/components/Icon/components/Document.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentApprove.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentCreateEntry.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentCut.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentError.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentIsolatePage.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentMerge.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentMove.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentPreview.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentReceived.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentRejectedRequest.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentSplit.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentTime.js.map +1 -1
- package/dist/esm/components/Icon/components/Download.js.map +1 -1
- package/dist/esm/components/Icon/components/Drag.js.map +1 -1
- package/dist/esm/components/Icon/components/ECopedia.js.map +1 -1
- package/dist/esm/components/Icon/components/ESignature.js.map +1 -1
- package/dist/esm/components/Icon/components/Edit.js.map +1 -1
- package/dist/esm/components/Icon/components/EllipsisHorizontal.js.map +1 -1
- package/dist/esm/components/Icon/components/EllipsisVertical.js.map +1 -1
- package/dist/esm/components/Icon/components/EntriesOnAccount.js.map +1 -1
- package/dist/esm/components/Icon/components/EntriesOpen.js.map +1 -1
- package/dist/esm/components/Icon/components/EntriesWarning.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeCustomerInvoice.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeCustomerPayment.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeJournalEntry.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeManualCustomerInvoice.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeSupplierInvoice.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeSupplierPayment.js.map +1 -1
- package/dist/esm/components/Icon/components/Envelope.js.map +1 -1
- package/dist/esm/components/Icon/components/EnvelopeApproved.js.map +1 -1
- package/dist/esm/components/Icon/components/ExpandView.js.map +1 -1
- package/dist/esm/components/Icon/components/Expenses.js.map +1 -1
- package/dist/esm/components/Icon/components/Export.js.map +1 -1
- package/dist/esm/components/Icon/components/ExportToExcel.js.map +1 -1
- package/dist/esm/components/Icon/components/ExportToPdf.js.map +1 -1
- package/dist/esm/components/Icon/components/Filter.js.map +1 -1
- package/dist/esm/components/Icon/components/FilterSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/GraphSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Hash.js.map +1 -1
- package/dist/esm/components/Icon/components/Home.js.map +1 -1
- package/dist/esm/components/Icon/components/Images.js.map +1 -1
- package/dist/esm/components/Icon/components/Import.js.map +1 -1
- package/dist/esm/components/Icon/components/Inbox.js.map +1 -1
- package/dist/esm/components/Icon/components/InboxEinvoicing.js.map +1 -1
- package/dist/esm/components/Icon/components/InboxScanning.js.map +1 -1
- package/dist/esm/components/Icon/components/InboxSmart.js.map +1 -1
- package/dist/esm/components/Icon/components/Info.js.map +1 -1
- package/dist/esm/components/Icon/components/Inventory.js.map +1 -1
- package/dist/esm/components/Icon/components/InventoryMatrix.js.map +1 -1
- package/dist/esm/components/Icon/components/JournalPro.js.map +1 -1
- package/dist/esm/components/Icon/components/Layout.js.map +1 -1
- package/dist/esm/components/Icon/components/LayoutBoth.js.map +1 -1
- package/dist/esm/components/Icon/components/LayoutFirst.js.map +1 -1
- package/dist/esm/components/Icon/components/LayoutLast.js.map +1 -1
- package/dist/esm/components/Icon/components/LayoutNone.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCard.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardCustomerReminder.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardManualCustomerInvoice.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardObsoleteStock.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardOpeningEntry.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardReservedEntry.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardShrinkagePilferage.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardStockAdjustment.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardTransferredOpeningEntry.js.map +1 -1
- package/dist/esm/components/Icon/components/Lightbulb.js.map +1 -1
- package/dist/esm/components/Icon/components/Line.js.map +1 -1
- package/dist/esm/components/Icon/components/List.js.map +1 -1
- package/dist/esm/components/Icon/components/ListBulleted.js.map +1 -1
- package/dist/esm/components/Icon/components/ListSearch.js.map +1 -1
- package/dist/esm/components/Icon/components/LockOpen.js.map +1 -1
- package/dist/esm/components/Icon/components/Log.js.map +1 -1
- package/dist/esm/components/Icon/components/Market.js.map +1 -1
- package/dist/esm/components/Icon/components/MatchAmount.js.map +1 -1
- package/dist/esm/components/Icon/components/MatchEntries.js.map +1 -1
- package/dist/esm/components/Icon/components/Mileage.js.map +1 -1
- package/dist/esm/components/Icon/components/Minus.js.map +1 -1
- package/dist/esm/components/Icon/components/ModalResize.js.map +1 -1
- package/dist/esm/components/Icon/components/ModalShrink.js.map +1 -1
- package/dist/esm/components/Icon/components/More.js.map +1 -1
- package/dist/esm/components/Icon/components/MoreSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Move.js.map +1 -1
- package/dist/esm/components/Icon/components/NavigationList.js.map +1 -1
- package/dist/esm/components/Icon/components/Note.js.map +1 -1
- package/dist/esm/components/Icon/components/NoteFollowUp.js.map +1 -1
- package/dist/esm/components/Icon/components/NoteRead.js.map +1 -1
- package/dist/esm/components/Icon/components/PartnerApi.js.map +1 -1
- package/dist/esm/components/Icon/components/Period.js.map +1 -1
- package/dist/esm/components/Icon/components/PersonChange.js.map +1 -1
- package/dist/esm/components/Icon/components/PersonMinus.js.map +1 -1
- package/dist/esm/components/Icon/components/PersonPlus.js.map +1 -1
- package/dist/esm/components/Icon/components/PersonTick.js.map +1 -1
- package/dist/esm/components/Icon/components/Play.js.map +1 -1
- package/dist/esm/components/Icon/components/PlusCircle.js.map +1 -1
- package/dist/esm/components/Icon/components/PlusMinus.js.map +1 -1
- package/dist/esm/components/Icon/components/Print.js.map +1 -1
- package/dist/esm/components/Icon/components/ProcessPayment.js.map +1 -1
- package/dist/esm/components/Icon/components/ProductLedgerCard.js.map +1 -1
- package/dist/esm/components/Icon/components/ProjectCards.js.map +1 -1
- package/dist/esm/components/Icon/components/Projects.js.map +1 -1
- package/dist/esm/components/Icon/components/Quicklinks.js.map +1 -1
- package/dist/esm/components/Icon/components/RatingBankruptcy.js.map +1 -1
- package/dist/esm/components/Icon/components/RatingPaymentProblems.js.map +1 -1
- package/dist/esm/components/Icon/components/Reconciled.js.map +1 -1
- package/dist/esm/components/Icon/components/Refresh.js.map +1 -1
- package/dist/esm/components/Icon/components/Report.js.map +1 -1
- package/dist/esm/components/Icon/components/ReportSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Restore.js.map +1 -1
- package/dist/esm/components/Icon/components/RotateLeft.js.map +1 -1
- package/dist/esm/components/Icon/components/RotateRight.js.map +1 -1
- package/dist/esm/components/Icon/components/Sales.js.map +1 -1
- package/dist/esm/components/Icon/components/Search.js.map +1 -1
- package/dist/esm/components/Icon/components/SearchBold.js.map +1 -1
- package/dist/esm/components/Icon/components/Secure.js.map +1 -1
- package/dist/esm/components/Icon/components/SecureTick.js.map +1 -1
- package/dist/esm/components/Icon/components/Settings.js.map +1 -1
- package/dist/esm/components/Icon/components/SettingsSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Shortcuts.js.map +1 -1
- package/dist/esm/components/Icon/components/ShowAll.js.map +1 -1
- package/dist/esm/components/Icon/components/ShowLess.js.map +1 -1
- package/dist/esm/components/Icon/components/ShowMore.js.map +1 -1
- package/dist/esm/components/Icon/components/ShowTemplate.js.map +1 -1
- package/dist/esm/components/Icon/components/Sliders.js.map +1 -1
- package/dist/esm/components/Icon/components/Smartpay.js.map +1 -1
- package/dist/esm/components/Icon/components/SortBy.js.map +1 -1
- package/dist/esm/components/Icon/components/Spinner.js.map +1 -1
- package/dist/esm/components/Icon/components/Star.js.map +1 -1
- package/dist/esm/components/Icon/components/StarSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Subscriptions.js.map +1 -1
- package/dist/esm/components/Icon/components/SystemEntries.js.map +1 -1
- package/dist/esm/components/Icon/components/Tag.js.map +1 -1
- package/dist/esm/components/Icon/components/TemplateOverride.js.map +1 -1
- package/dist/esm/components/Icon/components/Templates.js.map +1 -1
- package/dist/esm/components/Icon/components/ThumbBoth.js.map +1 -1
- package/dist/esm/components/Icon/components/ThumbDown.js.map +1 -1
- package/dist/esm/components/Icon/components/ThumbDownSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/ThumbUp.js.map +1 -1
- package/dist/esm/components/Icon/components/ThumbUpSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Tick.js.map +1 -1
- package/dist/esm/components/Icon/components/TickCircle.js.map +1 -1
- package/dist/esm/components/Icon/components/Time.js.map +1 -1
- package/dist/esm/components/Icon/components/Transfer.js.map +1 -1
- package/dist/esm/components/Icon/components/TransferCancel.js.map +1 -1
- package/dist/esm/components/Icon/components/TransferLocked.js.map +1 -1
- package/dist/esm/components/Icon/components/Undock.js.map +1 -1
- package/dist/esm/components/Icon/components/Unreconciled.js.map +1 -1
- package/dist/esm/components/Icon/components/Warning.js.map +1 -1
- package/dist/esm/components/Icon/components/Webshop.js.map +1 -1
- package/dist/esm/components/Icon/components/Website.js.map +1 -1
- package/dist/esm/components/Icon/components/Workflow.js.map +1 -1
- package/dist/esm/components/Icon/components/Zoom.js.map +1 -1
- package/dist/esm/components/Icon/components/index.js +4 -4
- package/dist/esm/components/Icon/components/index.js.map +1 -1
- package/dist/esm/components/IconButton/IconButton.js.map +1 -1
- package/dist/esm/components/Input/Input.js.map +1 -1
- package/dist/esm/components/Input/util.js +2 -2
- package/dist/esm/components/Input/util.js.map +1 -1
- package/dist/esm/components/Listbox/Listbox.js.map +1 -1
- package/dist/esm/components/Listbox/ScrollableList.js +64 -83
- package/dist/esm/components/Listbox/ScrollableList.js.map +1 -1
- package/dist/esm/components/Listbox/useListbox.js +51 -60
- package/dist/esm/components/Listbox/useListbox.js.map +1 -1
- package/dist/esm/components/Listbox/useMultiListbox.js +63 -91
- package/dist/esm/components/Listbox/useMultiListbox.js.map +1 -1
- package/dist/esm/components/Listbox/useTypeahead.js +10 -9
- package/dist/esm/components/Listbox/useTypeahead.js.map +1 -1
- package/dist/esm/components/Listbox/util.js +48 -84
- package/dist/esm/components/Listbox/util.js.map +1 -1
- package/dist/esm/components/Menu/Context.js +2 -2
- package/dist/esm/components/Menu/Context.js.map +1 -1
- package/dist/esm/components/Menu/Menu.js.map +1 -1
- package/dist/esm/components/Menu/components/Checkbox.js +8 -9
- package/dist/esm/components/Menu/components/Checkbox.js.map +1 -1
- package/dist/esm/components/Menu/components/Content.js +10 -13
- package/dist/esm/components/Menu/components/Content.js.map +1 -1
- package/dist/esm/components/Menu/components/Header.js +4 -4
- package/dist/esm/components/Menu/components/Header.js.map +1 -1
- package/dist/esm/components/Menu/components/Item.js +39 -40
- package/dist/esm/components/Menu/components/Item.js.map +1 -1
- package/dist/esm/components/Menu/components/Link.js +10 -11
- package/dist/esm/components/Menu/components/Link.js.map +1 -1
- package/dist/esm/components/Menu/components/RadioGroup.js +16 -18
- package/dist/esm/components/Menu/components/RadioGroup.js.map +1 -1
- package/dist/esm/components/Menu/components/Separator.js +4 -4
- package/dist/esm/components/Menu/components/Separator.js.map +1 -1
- package/dist/esm/components/Menu/components/Trigger.js +5 -5
- package/dist/esm/components/Menu/components/Trigger.js.map +1 -1
- package/dist/esm/components/Navigation/Navigation.js.map +1 -1
- package/dist/esm/components/Pagination/PageNumbers.js +23 -28
- package/dist/esm/components/Pagination/PageNumbers.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Pagination/usePagination.js +7 -21
- package/dist/esm/components/Pagination/usePagination.js.map +1 -1
- package/dist/esm/components/Pagination/usePaginationShortcuts.js +9 -9
- package/dist/esm/components/Pagination/usePaginationShortcuts.js.map +1 -1
- package/dist/esm/components/Popover/Popover.js.map +1 -1
- package/dist/esm/components/Popover/Primitives.js +7 -8
- package/dist/esm/components/Popover/Primitives.js.map +1 -1
- package/dist/esm/components/Progress/Progress.js.map +1 -1
- package/dist/esm/components/Provider/Provider.js.map +1 -1
- package/dist/esm/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Select/useSelect.js +64 -85
- package/dist/esm/components/Select/useSelect.js.map +1 -1
- package/dist/esm/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/esm/components/Table/components/BaseTable.js +23 -30
- package/dist/esm/components/Table/components/BaseTable.js.map +1 -1
- package/dist/esm/components/Table/components/PaginatedTable.js +3 -7
- package/dist/esm/components/Table/components/PaginatedTable.js.map +1 -1
- package/dist/esm/components/Table/components/Table.js +18 -25
- package/dist/esm/components/Table/components/Table.js.map +1 -1
- package/dist/esm/components/Table/components/WindowedTable.js +88 -104
- package/dist/esm/components/Table/components/WindowedTable.js.map +1 -1
- package/dist/esm/components/Table/hooks/plugins/useRowActions.js +122 -146
- package/dist/esm/components/Table/hooks/plugins/useRowActions.js.map +1 -1
- package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js +57 -61
- package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js.map +1 -1
- package/dist/esm/components/Table/hooks/plugins/useRowEditing.js +39 -36
- package/dist/esm/components/Table/hooks/plugins/useRowEditing.js.map +1 -1
- package/dist/esm/components/Table/hooks/plugins/useRowSelect.js +80 -90
- package/dist/esm/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
- package/dist/esm/components/Table/hooks/useRowCreation.js +29 -64
- package/dist/esm/components/Table/hooks/useRowCreation.js.map +1 -1
- package/dist/esm/components/Table/hooks/useTable.js +119 -141
- package/dist/esm/components/Table/hooks/useTable.js.map +1 -1
- package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js +12 -15
- package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js.map +1 -1
- package/dist/esm/components/Table/util/renderColumn.js +10 -10
- package/dist/esm/components/Table/util/renderColumn.js.map +1 -1
- package/dist/esm/components/Table/util/renderRow.js +37 -46
- package/dist/esm/components/Table/util/renderRow.js.map +1 -1
- package/dist/esm/components/Table/util/rowIndexPath.js +14 -16
- package/dist/esm/components/Table/util/rowIndexPath.js.map +1 -1
- package/dist/esm/components/Table/util/sortTypes.js +23 -31
- package/dist/esm/components/Table/util/sortTypes.js.map +1 -1
- package/dist/esm/components/Table/util.js +29 -41
- package/dist/esm/components/Table/util.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/Textarea/Textarea.js.map +1 -1
- package/dist/esm/components/Toast/Toast.js +20 -21
- package/dist/esm/components/Toast/Toast.js.map +1 -1
- package/dist/esm/components/Toast/Toaster.js.map +1 -1
- package/dist/esm/components/Toast/util.js +2 -2
- package/dist/esm/components/Toast/util.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/Tour/Tour.js.map +1 -1
- package/dist/esm/components/Treeview/Treeview.js.map +1 -1
- package/dist/esm/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/dist/esm/index.css +665 -662
- package/dist/esm/index.js +1 -1
- package/dist/esm/primitives/Button.js +9 -13
- package/dist/esm/primitives/Button.js.map +1 -1
- package/dist/esm/utils/date.js.map +1 -1
- package/dist/esm/utils/hooks/useBoundingClientRectListener.js.map +1 -1
- package/dist/esm/utils/hooks/useDraggable.js +16 -18
- package/dist/esm/utils/hooks/useDraggable.js.map +1 -1
- package/dist/esm/utils/hooks/useDropTarget.js +7 -10
- package/dist/esm/utils/hooks/useDropTarget.js.map +1 -1
- package/dist/esm/utils/hooks/useListKeyboardNavigation.js.map +1 -1
- package/dist/esm/utils/hooks/useListScrollTo.js.map +1 -1
- package/dist/esm/utils/hooks/useOnClickOutside.js.map +1 -1
- package/dist/esm/utils/hooks/useProxiedRef.js +3 -3
- package/dist/esm/utils/hooks/useProxiedRef.js.map +1 -1
- package/dist/esm/utils/hooks/useTimer.js +9 -17
- package/dist/esm/utils/hooks/useTimer.js.map +1 -1
- package/dist/esm/utils/input.js +7 -11
- package/dist/esm/utils/input.js.map +1 -1
- package/dist/esm/utils/mergeRefs.js +2 -2
- package/dist/esm/utils/mergeRefs.js.map +1 -1
- package/dist/esm/utils/taillwind.js +2 -2
- package/dist/esm/utils/taillwind.js.map +1 -1
- package/dist/index.css +665 -662
- package/dist/taco.cjs.development.js +1497 -1828
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/package.json +3 -3
- package/plugins/tailwindcss-aria-attributes.js +73 -73
- package/tailwind.config.js +297 -297
@@ -1,4 +1,3 @@
|
|
1
|
-
import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
1
|
import React__default from 'react';
|
3
2
|
import { v4 } from 'uuid';
|
4
3
|
import set from 'lodash-es/set';
|
@@ -8,27 +7,17 @@ import get from 'lodash-es/get';
|
|
8
7
|
import compact from 'lodash-es/compact';
|
9
8
|
import pullAt from 'lodash-es/pullAt';
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
}
|
15
|
-
|
16
|
-
if (values === void 0) {
|
17
|
-
values = {};
|
18
|
-
}
|
19
|
-
|
20
|
-
var nexTRow = JSON.parse(JSON.stringify(data));
|
21
|
-
var childRowIndexPath;
|
10
|
+
const insertChildTableRow = (data, rowIndexPath = undefined, values = {}) => {
|
11
|
+
const nexTRow = JSON.parse(JSON.stringify(data));
|
12
|
+
let childRowIndexPath;
|
22
13
|
|
23
14
|
if (rowIndexPath) {
|
24
15
|
var _currentRow$subRows;
|
25
16
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
return "[" + i + "]";
|
31
|
-
}).join('.subRows') + '.subRows';
|
17
|
+
const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);
|
18
|
+
const currentRow = getByRowIndexPath(nexTRow, rowIndexes.join('.'));
|
19
|
+
const nextSubRows = (_currentRow$subRows = currentRow === null || currentRow === void 0 ? void 0 : currentRow.subRows) !== null && _currentRow$subRows !== void 0 ? _currentRow$subRows : [];
|
20
|
+
const path = rowIndexes.map(i => `[${i}]`).join('.subRows') + '.subRows';
|
32
21
|
nextSubRows.unshift(values);
|
33
22
|
set(nexTRow, path, nextSubRows); // rebuild the new id
|
34
23
|
|
@@ -41,22 +30,18 @@ var insertChildTableRow = function insertChildTableRow(data, rowIndexPath, value
|
|
41
30
|
|
42
31
|
return [nexTRow, childRowIndexPath];
|
43
32
|
};
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
33
|
+
const removeChildTableRow = (data, rowIndexPath) => {
|
34
|
+
const nexTRow = JSON.parse(JSON.stringify(data));
|
35
|
+
const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);
|
36
|
+
const rootIndex = Number(rowIndexes.shift());
|
48
37
|
|
49
38
|
if (rowIndexes.length) {
|
50
39
|
// unset
|
51
|
-
|
52
|
-
return "subRows[" + index + "]";
|
53
|
-
}).join('.');
|
40
|
+
const unsetPath = rowIndexes.map(index => `subRows[${index}]`).join('.');
|
54
41
|
unset(nexTRow[rootIndex], unsetPath); // remove empty value from subRows
|
55
42
|
|
56
43
|
rowIndexes.pop();
|
57
|
-
|
58
|
-
return "subRows[" + index + "]";
|
59
|
-
}).join('.') + '.subRows' : 'subRows';
|
44
|
+
const setPath = rowIndexes.length ? rowIndexes.map(index => `subRows[${index}]`).join('.') + '.subRows' : 'subRows';
|
60
45
|
set(nexTRow[rootIndex], setPath, compact(get(nexTRow[rootIndex], setPath)));
|
61
46
|
} else {
|
62
47
|
pullAt(nexTRow, rootIndex);
|
@@ -64,26 +49,17 @@ var removeChildTableRow = function removeChildTableRow(data, rowIndexPath) {
|
|
64
49
|
|
65
50
|
return nexTRow;
|
66
51
|
};
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
var _React$useState2 = React__default.useState(undefined),
|
73
|
-
activeRowIndexPath = _React$useState2[0],
|
74
|
-
setActiveRowIndexPath = _React$useState2[1];
|
75
|
-
|
76
|
-
React__default.useEffect(function () {
|
52
|
+
const useTableRowCreation = (data, tableRef) => {
|
53
|
+
const [internalData, setInternalData] = React__default.useState(JSON.parse(JSON.stringify(data)));
|
54
|
+
const [activeRowIndexPath, setActiveRowIndexPath] = React__default.useState(undefined);
|
55
|
+
React__default.useEffect(() => {
|
77
56
|
if (activeRowIndexPath !== undefined) {
|
78
57
|
// keep the same edit key, so that we don't remount the row/form
|
79
|
-
|
58
|
+
const currentRow = getByRowIndexPath(internalData, activeRowIndexPath); // get the active creation rows parent
|
80
59
|
|
81
|
-
|
82
|
-
|
83
|
-
var _insertChildTableRow = insertChildTableRow(JSON.parse(JSON.stringify(data)), parentId, currentRow),
|
84
|
-
nexTRow = _insertChildTableRow[0],
|
85
|
-
newRowIndexPath = _insertChildTableRow[1]; // update and set that row as active, we basically just changed it's position in our internal data
|
60
|
+
const parentId = getParentRowIndexPath(activeRowIndexPath); // insert a new empty row in the external data (with the same key)
|
86
61
|
|
62
|
+
const [nexTRow, newRowIndexPath] = insertChildTableRow(JSON.parse(JSON.stringify(data)), parentId, currentRow); // update and set that row as active, we basically just changed it's position in our internal data
|
87
63
|
|
88
64
|
setActiveRowIndexPath(newRowIndexPath);
|
89
65
|
setInternalData(nexTRow);
|
@@ -96,23 +72,12 @@ var useTableRowCreation = function useTableRowCreation(data, tableRef) {
|
|
96
72
|
}
|
97
73
|
}, [JSON.stringify(data)]);
|
98
74
|
|
99
|
-
|
100
|
-
|
101
|
-
rowIndexPath = undefined;
|
102
|
-
}
|
103
|
-
|
104
|
-
if (values === void 0) {
|
105
|
-
values = {};
|
106
|
-
}
|
107
|
-
|
108
|
-
var _createKey = v4();
|
109
|
-
|
110
|
-
var _insertChildTableRow2 = insertChildTableRow(internalData, rowIndexPath, _extends({}, values, {
|
111
|
-
_createKey: _createKey
|
112
|
-
})),
|
113
|
-
nexTRow = _insertChildTableRow2[0],
|
114
|
-
newRowIndexPath = _insertChildTableRow2[1];
|
75
|
+
const create = (rowIndexPath = undefined, values = {}) => {
|
76
|
+
const _createKey = v4();
|
115
77
|
|
78
|
+
const [nexTRow, newRowIndexPath] = insertChildTableRow(internalData, rowIndexPath, { ...values,
|
79
|
+
_createKey
|
80
|
+
});
|
116
81
|
setActiveRowIndexPath(newRowIndexPath);
|
117
82
|
setInternalData(nexTRow);
|
118
83
|
|
@@ -123,16 +88,16 @@ var useTableRowCreation = function useTableRowCreation(data, tableRef) {
|
|
123
88
|
return newRowIndexPath;
|
124
89
|
};
|
125
90
|
|
126
|
-
|
127
|
-
|
91
|
+
const remove = rowIndexPath => {
|
92
|
+
const nexTRow = removeChildTableRow(internalData, rowIndexPath);
|
128
93
|
setInternalData(nexTRow);
|
129
94
|
setActiveRowIndexPath(undefined);
|
130
95
|
};
|
131
96
|
|
132
97
|
return {
|
133
98
|
data: internalData,
|
134
|
-
create
|
135
|
-
remove
|
99
|
+
create,
|
100
|
+
remove,
|
136
101
|
isCreating: activeRowIndexPath !== undefined
|
137
102
|
};
|
138
103
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useRowCreation.js","sources":["../../../../../src/components/Table/hooks/useRowCreation.tsx"],"sourcesContent":["import React from 'react';\nimport { v4 as uuid } from 'uuid';\nimport set from 'lodash/set';\nimport unset from 'lodash/unset';\nimport get from 'lodash/get';\nimport compact from 'lodash/compact';\nimport pullAt from 'lodash/pullAt';\n\nimport { convertRowIndexPathToNumberArray, getByRowIndexPath, getParentRowIndexPath } from '../util/rowIndexPath';\nimport { Row, RowIndexPath, TableRef } from '../types';\n\nexport const insertChildTableRow = <TRow,>(\n data: Row<TRow>[],\n rowIndexPath: RowIndexPath = undefined,\n values: any = {}\n): [Row<TRow>[], RowIndexPath] => {\n const nexTRow: Row<TRow>[] = JSON.parse(JSON.stringify(data));\n\n let childRowIndexPath;\n\n if (rowIndexPath) {\n const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);\n const currentRow = getByRowIndexPath(nexTRow, rowIndexes.join('.'));\n const nextSubRows = currentRow?.subRows ?? [];\n\n const path = rowIndexes.map(i => `[${i}]`).join('.subRows') + '.subRows';\n nextSubRows.unshift(values);\n set(nexTRow, path, nextSubRows);\n\n // rebuild the new id\n rowIndexes.push(0);\n childRowIndexPath = rowIndexes.join('.');\n } else {\n nexTRow.unshift(values);\n childRowIndexPath = '0';\n }\n\n return [nexTRow, childRowIndexPath];\n};\n\nexport const removeChildTableRow = <TRow,>(data: Row<TRow>[], rowIndexPath: RowIndexPath): Row<TRow>[] => {\n const nexTRow = JSON.parse(JSON.stringify(data));\n\n const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);\n const rootIndex = Number(rowIndexes.shift());\n\n if (rowIndexes.length) {\n // unset\n const unsetPath = rowIndexes.map(index => `subRows[${index}]`).join('.');\n unset(nexTRow[rootIndex], unsetPath);\n\n // remove empty value from subRows\n rowIndexes.pop();\n const setPath = rowIndexes.length ? rowIndexes.map(index => `subRows[${index}]`).join('.') + '.subRows' : 'subRows';\n set(nexTRow[rootIndex], setPath, compact(get(nexTRow[rootIndex], setPath)));\n } else {\n pullAt(nexTRow, rootIndex);\n }\n\n return nexTRow;\n};\n\nexport type useTableRowCreation<TRow> = {\n data: Row<TRow>[];\n create: (rowIndexPath: RowIndexPath, values?: object | undefined) => RowIndexPath;\n remove: (rowIndexPath: RowIndexPath) => void;\n isCreating: boolean;\n};\n\nexport const useTableRowCreation = <TRow,>(data: Row<TRow>[], tableRef: React.RefObject<TableRef>): useTableRowCreation<TRow> => {\n const [internalData, setInternalData] = React.useState(JSON.parse(JSON.stringify(data)));\n const [activeRowIndexPath, setActiveRowIndexPath] = React.useState<string | undefined>(undefined);\n\n React.useEffect(() => {\n if (activeRowIndexPath !== undefined) {\n // keep the same edit key, so that we don't remount the row/form\n const currentRow: any = getByRowIndexPath(internalData, activeRowIndexPath);\n\n // get the active creation rows parent\n const parentId = getParentRowIndexPath(activeRowIndexPath);\n\n // insert a new empty row in the external data (with the same key)\n const [nexTRow, newRowIndexPath] = insertChildTableRow(JSON.parse(JSON.stringify(data)), parentId, currentRow);\n\n // update and set that row as active, we basically just changed it's position in our internal data\n setActiveRowIndexPath(newRowIndexPath);\n setInternalData(nexTRow);\n\n if (tableRef?.current) {\n tableRef.current.instance.toggleRowEditing(currentRow?._createKey);\n }\n } else {\n setInternalData(data);\n }\n }, [JSON.stringify(data)]);\n\n const create = (rowIndexPath: RowIndexPath = undefined, values: object | undefined = {}): RowIndexPath => {\n const _createKey = uuid();\n const [nexTRow, newRowIndexPath] = insertChildTableRow(internalData, rowIndexPath, { ...values, _createKey });\n setActiveRowIndexPath(newRowIndexPath);\n setInternalData(nexTRow);\n\n if (tableRef?.current) {\n tableRef.current.instance.toggleRowEditing(_createKey);\n }\n\n return newRowIndexPath;\n };\n\n const remove = (rowIndexPath: any): void => {\n const nexTRow = removeChildTableRow(internalData, rowIndexPath);\n setInternalData(nexTRow);\n setActiveRowIndexPath(undefined);\n };\n\n return {\n data: internalData,\n create,\n remove,\n isCreating: activeRowIndexPath !== undefined,\n };\n};\n"],"names":["insertChildTableRow","data","rowIndexPath","
|
1
|
+
{"version":3,"file":"useRowCreation.js","sources":["../../../../../src/components/Table/hooks/useRowCreation.tsx"],"sourcesContent":["import React from 'react';\r\nimport { v4 as uuid } from 'uuid';\r\nimport set from 'lodash/set';\r\nimport unset from 'lodash/unset';\r\nimport get from 'lodash/get';\r\nimport compact from 'lodash/compact';\r\nimport pullAt from 'lodash/pullAt';\r\n\r\nimport { convertRowIndexPathToNumberArray, getByRowIndexPath, getParentRowIndexPath } from '../util/rowIndexPath';\r\nimport { Row, RowIndexPath, TableRef } from '../types';\r\n\r\nexport const insertChildTableRow = <TRow,>(\r\n data: Row<TRow>[],\r\n rowIndexPath: RowIndexPath = undefined,\r\n values: any = {}\r\n): [Row<TRow>[], RowIndexPath] => {\r\n const nexTRow: Row<TRow>[] = JSON.parse(JSON.stringify(data));\r\n\r\n let childRowIndexPath;\r\n\r\n if (rowIndexPath) {\r\n const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);\r\n const currentRow = getByRowIndexPath(nexTRow, rowIndexes.join('.'));\r\n const nextSubRows = currentRow?.subRows ?? [];\r\n\r\n const path = rowIndexes.map(i => `[${i}]`).join('.subRows') + '.subRows';\r\n nextSubRows.unshift(values);\r\n set(nexTRow, path, nextSubRows);\r\n\r\n // rebuild the new id\r\n rowIndexes.push(0);\r\n childRowIndexPath = rowIndexes.join('.');\r\n } else {\r\n nexTRow.unshift(values);\r\n childRowIndexPath = '0';\r\n }\r\n\r\n return [nexTRow, childRowIndexPath];\r\n};\r\n\r\nexport const removeChildTableRow = <TRow,>(data: Row<TRow>[], rowIndexPath: RowIndexPath): Row<TRow>[] => {\r\n const nexTRow = JSON.parse(JSON.stringify(data));\r\n\r\n const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);\r\n const rootIndex = Number(rowIndexes.shift());\r\n\r\n if (rowIndexes.length) {\r\n // unset\r\n const unsetPath = rowIndexes.map(index => `subRows[${index}]`).join('.');\r\n unset(nexTRow[rootIndex], unsetPath);\r\n\r\n // remove empty value from subRows\r\n rowIndexes.pop();\r\n const setPath = rowIndexes.length ? rowIndexes.map(index => `subRows[${index}]`).join('.') + '.subRows' : 'subRows';\r\n set(nexTRow[rootIndex], setPath, compact(get(nexTRow[rootIndex], setPath)));\r\n } else {\r\n pullAt(nexTRow, rootIndex);\r\n }\r\n\r\n return nexTRow;\r\n};\r\n\r\nexport type useTableRowCreation<TRow> = {\r\n data: Row<TRow>[];\r\n create: (rowIndexPath: RowIndexPath, values?: object | undefined) => RowIndexPath;\r\n remove: (rowIndexPath: RowIndexPath) => void;\r\n isCreating: boolean;\r\n};\r\n\r\nexport const useTableRowCreation = <TRow,>(data: Row<TRow>[], tableRef: React.RefObject<TableRef>): useTableRowCreation<TRow> => {\r\n const [internalData, setInternalData] = React.useState(JSON.parse(JSON.stringify(data)));\r\n const [activeRowIndexPath, setActiveRowIndexPath] = React.useState<string | undefined>(undefined);\r\n\r\n React.useEffect(() => {\r\n if (activeRowIndexPath !== undefined) {\r\n // keep the same edit key, so that we don't remount the row/form\r\n const currentRow: any = getByRowIndexPath(internalData, activeRowIndexPath);\r\n\r\n // get the active creation rows parent\r\n const parentId = getParentRowIndexPath(activeRowIndexPath);\r\n\r\n // insert a new empty row in the external data (with the same key)\r\n const [nexTRow, newRowIndexPath] = insertChildTableRow(JSON.parse(JSON.stringify(data)), parentId, currentRow);\r\n\r\n // update and set that row as active, we basically just changed it's position in our internal data\r\n setActiveRowIndexPath(newRowIndexPath);\r\n setInternalData(nexTRow);\r\n\r\n if (tableRef?.current) {\r\n tableRef.current.instance.toggleRowEditing(currentRow?._createKey);\r\n }\r\n } else {\r\n setInternalData(data);\r\n }\r\n }, [JSON.stringify(data)]);\r\n\r\n const create = (rowIndexPath: RowIndexPath = undefined, values: object | undefined = {}): RowIndexPath => {\r\n const _createKey = uuid();\r\n const [nexTRow, newRowIndexPath] = insertChildTableRow(internalData, rowIndexPath, { ...values, _createKey });\r\n setActiveRowIndexPath(newRowIndexPath);\r\n setInternalData(nexTRow);\r\n\r\n if (tableRef?.current) {\r\n tableRef.current.instance.toggleRowEditing(_createKey);\r\n }\r\n\r\n return newRowIndexPath;\r\n };\r\n\r\n const remove = (rowIndexPath: any): void => {\r\n const nexTRow = removeChildTableRow(internalData, rowIndexPath);\r\n setInternalData(nexTRow);\r\n setActiveRowIndexPath(undefined);\r\n };\r\n\r\n return {\r\n data: internalData,\r\n create,\r\n remove,\r\n isCreating: activeRowIndexPath !== undefined,\r\n };\r\n};\r\n"],"names":["insertChildTableRow","data","rowIndexPath","undefined","values","nexTRow","JSON","parse","stringify","childRowIndexPath","rowIndexes","convertRowIndexPathToNumberArray","currentRow","getByRowIndexPath","join","nextSubRows","subRows","path","map","i","unshift","set","push","removeChildTableRow","rootIndex","Number","shift","length","unsetPath","index","unset","pop","setPath","compact","get","pullAt","useTableRowCreation","tableRef","internalData","setInternalData","React","useState","activeRowIndexPath","setActiveRowIndexPath","useEffect","parentId","getParentRowIndexPath","newRowIndexPath","current","instance","toggleRowEditing","_createKey","create","uuid","remove","isCreating"],"mappings":"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"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { extends as _extends, objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
1
|
import React__default from 'react';
|
3
2
|
import { useLocalization } from '../../Provider/Provider.js';
|
4
3
|
import { useTable as useTable$1, useRowState, useSortBy, useExpanded, usePagination } from 'react-table';
|
@@ -10,36 +9,31 @@ import { useRowSelect } from './plugins/useRowSelect.js';
|
|
10
9
|
import { useTableKeyboardNavigation } from './useTableKeyboardNavigation.js';
|
11
10
|
import { useRowDraggable } from './plugins/useRowDraggable.js';
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
var useTableRowActive = function useTableRowActive(activeIndex, rows, rowExpansionRenderer, handleonRowActive) {
|
17
|
-
React__default.useEffect(function () {
|
12
|
+
const useTableRowActive = (activeIndex, rows, rowExpansionRenderer, handleonRowActive) => {
|
13
|
+
React__default.useEffect(() => {
|
18
14
|
if (activeIndex !== undefined && rows.length && handleonRowActive) {
|
19
|
-
|
15
|
+
const focusedRow = rows[activeIndex];
|
20
16
|
|
21
17
|
if (focusedRow) {
|
22
|
-
|
18
|
+
const sanitizedFocusedRow = sanitizeRowProps(focusedRow, rowExpansionRenderer);
|
23
19
|
handleonRowActive(sanitizedFocusedRow);
|
24
20
|
}
|
25
21
|
}
|
26
22
|
}, [activeIndex, rows]);
|
27
23
|
};
|
28
24
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
}, []);
|
42
|
-
React__default.useEffect(function () {
|
25
|
+
const useTableInstance = (instance, ref) => {
|
26
|
+
const sanitizedInstance = React__default.useMemo(() => ({
|
27
|
+
toggleAllRowsExpanded: instance.toggleAllRowsExpanded,
|
28
|
+
toggleHideAllColumns: instance.toggleHideAllColumns,
|
29
|
+
toggleHideColumn: instance.toggleHideColumn,
|
30
|
+
toggleEditing: instance.toggleEditing,
|
31
|
+
toggleRowEditing: instance.toggleRowEditing,
|
32
|
+
resetRowEditing: instance.resetRowEditing,
|
33
|
+
toggleRowExpanded: instance.toggleRowExpanded,
|
34
|
+
toggleSortBy: instance.toggleSortBy
|
35
|
+
}), []);
|
36
|
+
React__default.useEffect(() => {
|
43
37
|
if (ref !== null && ref !== void 0 && ref.current) {
|
44
38
|
ref.current.instance = sanitizedInstance;
|
45
39
|
}
|
@@ -47,33 +41,29 @@ var useTableInstance = function useTableInstance(instance, ref) {
|
|
47
41
|
return sanitizedInstance;
|
48
42
|
};
|
49
43
|
|
50
|
-
|
51
|
-
React__default.useEffect(
|
44
|
+
const useTablePaginationListener = (disablePagination, onPaginate, state) => {
|
45
|
+
React__default.useEffect(() => {
|
52
46
|
if (!disablePagination && onPaginate) {
|
53
47
|
onPaginate(state.pageIndex, state.pageSize);
|
54
48
|
}
|
55
49
|
}, [state.pageIndex, state.pageSize]);
|
56
50
|
};
|
57
51
|
|
58
|
-
|
59
|
-
React__default.useEffect(
|
52
|
+
const useTableSortingListener = (data, sortedRows, onSort, manualSorting, state) => {
|
53
|
+
React__default.useEffect(() => {
|
60
54
|
if (onSort) {
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
};
|
66
|
-
});
|
55
|
+
const sortRules = state.sortBy.map(rule => ({
|
56
|
+
accessor: rule.id,
|
57
|
+
desc: rule.desc
|
58
|
+
}));
|
67
59
|
|
68
60
|
if (manualSorting) {
|
69
61
|
onSort(sortRules);
|
70
62
|
} else {
|
71
|
-
|
63
|
+
let sortedData;
|
72
64
|
|
73
65
|
if (sortRules.length && sortedRows !== null && sortedRows !== void 0 && sortedRows.length) {
|
74
|
-
sortedData = sortedRows.map(
|
75
|
-
return row.original;
|
76
|
-
});
|
66
|
+
sortedData = sortedRows.map(row => row.original);
|
77
67
|
}
|
78
68
|
|
79
69
|
onSort(sortRules, sortedData || data);
|
@@ -82,61 +72,71 @@ var useTableSortingListener = function useTableSortingListener(data, sortedRows,
|
|
82
72
|
}, [onSort && JSON.stringify(state.sortBy), manualSorting]);
|
83
73
|
};
|
84
74
|
|
85
|
-
|
86
|
-
|
75
|
+
const DEFAULT_PAGE_SIZE = 10;
|
76
|
+
const useTable = (props, ref) => {
|
87
77
|
var _otherProps$tabIndex;
|
88
78
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
79
|
+
const {
|
80
|
+
children,
|
81
|
+
data,
|
82
|
+
dangerouslyHijackGlobalKeyboardNavigation: _1,
|
83
|
+
onRowClick,
|
84
|
+
onRowDrag,
|
85
|
+
onSelectedRows,
|
86
|
+
rowClassName,
|
87
|
+
rowExpansionRenderer,
|
88
|
+
rowHeight,
|
89
|
+
selectedRows,
|
90
|
+
// sorting
|
91
|
+
disableSorting,
|
92
|
+
manualSorting,
|
93
|
+
onSort,
|
94
|
+
sortRules,
|
95
|
+
// pagination
|
96
|
+
disablePagination = true,
|
97
|
+
length,
|
98
|
+
onPaginate,
|
99
|
+
pageSize = DEFAULT_PAGE_SIZE,
|
100
|
+
pageIndex = 0,
|
101
|
+
// row editing
|
102
|
+
inlineEditingUniqueId = undefined,
|
103
|
+
onRowCreate,
|
104
|
+
// actions
|
105
|
+
actions,
|
106
|
+
onRowEdit,
|
107
|
+
onRowCopy,
|
108
|
+
onRowDelete,
|
109
|
+
onRowActive,
|
110
|
+
windowed = false,
|
111
|
+
...otherProps
|
112
|
+
} = props;
|
121
113
|
|
122
114
|
if (onSelectedRows && !selectedRows || !onSelectedRows && selectedRows) {
|
123
115
|
throw new Error('Selected rows in a Table component are fully controlled - you must pass both the `onSelectedRows` and `selectedRows` props when using row selection');
|
124
116
|
}
|
125
117
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
118
|
+
const {
|
119
|
+
texts
|
120
|
+
} = useLocalization();
|
121
|
+
const {
|
122
|
+
columns,
|
123
|
+
sortRules: defaultSortRules
|
124
|
+
} = React__default.useMemo(() => getColumnsFromChildren(children, rowExpansionRenderer), [children, rowExpansionRenderer]);
|
125
|
+
const manualPagination = !disablePagination && !!onPaginate && !!length;
|
126
|
+
const {
|
127
|
+
headerGroups,
|
128
|
+
rows,
|
129
|
+
sortedRows,
|
130
|
+
prepareRow: prepareBaseRow,
|
131
|
+
state,
|
132
|
+
// pagination
|
133
|
+
page,
|
134
|
+
gotoPage,
|
135
|
+
setPageSize,
|
136
|
+
...instance
|
137
|
+
} = useTable$1({
|
138
|
+
columns,
|
139
|
+
data,
|
140
140
|
initialState: {
|
141
141
|
// eslint-disable-next-line
|
142
142
|
// @ts-ignore: not sure how to type this correctly right now
|
@@ -144,7 +144,7 @@ var useTable = function useTable(props, ref) {
|
|
144
144
|
pageSize: !disablePagination ? pageSize : undefined,
|
145
145
|
pageIndex: !disablePagination ? pageIndex : undefined
|
146
146
|
},
|
147
|
-
manualPagination
|
147
|
+
manualPagination,
|
148
148
|
pageCount: manualPagination && length ? Math.ceil(length / pageSize) : -1,
|
149
149
|
manualSortBy: manualSorting,
|
150
150
|
disableSortBy: disableSorting,
|
@@ -153,75 +153,53 @@ var useTable = function useTable(props, ref) {
|
|
153
153
|
autoResetSelectedRows: false,
|
154
154
|
autoResetSortBy: false,
|
155
155
|
autoResetPage: false,
|
156
|
-
sortTypes: React__default.useMemo(
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
return _extends({}, currentState, {
|
162
|
-
selectedRowIds: selectedRows || []
|
163
|
-
});
|
164
|
-
}, [currentState, selectedRows]);
|
156
|
+
sortTypes: React__default.useMemo(() => sortTypes, []),
|
157
|
+
useControlledState: currentState => {
|
158
|
+
return React__default.useMemo(() => ({ ...currentState,
|
159
|
+
selectedRowIds: selectedRows || []
|
160
|
+
}), [currentState, selectedRows]);
|
165
161
|
}
|
166
162
|
}, useRowState, useSortBy, useExpanded, usePagination, useRowSelect(onSelectedRows), useRowDraggable(onRowDrag), useRowEditing(inlineEditingUniqueId), useRowActions(inlineEditingUniqueId, {
|
167
|
-
onRowCreate
|
168
|
-
onRowEdit
|
169
|
-
onRowCopy
|
170
|
-
onRowDelete
|
171
|
-
}, actions, rowExpansionRenderer, texts, windowed))
|
172
|
-
headerGroups = _useReactTable.headerGroups,
|
173
|
-
rows = _useReactTable.rows,
|
174
|
-
sortedRows = _useReactTable.sortedRows,
|
175
|
-
prepareBaseRow = _useReactTable.prepareRow,
|
176
|
-
state = _useReactTable.state,
|
177
|
-
page = _useReactTable.page,
|
178
|
-
gotoPage = _useReactTable.gotoPage,
|
179
|
-
setPageSize = _useReactTable.setPageSize,
|
180
|
-
instance = _objectWithoutPropertiesLoose(_useReactTable, _excluded2);
|
181
|
-
|
163
|
+
onRowCreate,
|
164
|
+
onRowEdit,
|
165
|
+
onRowCopy,
|
166
|
+
onRowDelete
|
167
|
+
}, actions, rowExpansionRenderer, texts, windowed));
|
182
168
|
useTablePaginationListener(disablePagination, onPaginate, state);
|
183
169
|
useTableSortingListener(data, sortedRows, onSort, !!manualSorting, state);
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
}, ref),
|
195
|
-
activeIndex = _useTableKeyboardNavi[0],
|
196
|
-
setActiveIndex = _useTableKeyboardNavi[1],
|
197
|
-
handleKeyDown = _useTableKeyboardNavi[2],
|
198
|
-
handleFocus = _useTableKeyboardNavi[3];
|
199
|
-
|
170
|
+
const sanitizedInstance = useTableInstance(instance, ref);
|
171
|
+
const visibleRows = !disablePagination && !manualPagination ? page : rows;
|
172
|
+
const [activeIndex, setActiveIndex, handleKeyDown, handleFocus] = useTableKeyboardNavigation(props, visibleRows, {
|
173
|
+
onRowClick,
|
174
|
+
onRowCreate,
|
175
|
+
onRowEdit,
|
176
|
+
onRowCopy,
|
177
|
+
onRowDelete,
|
178
|
+
rowExpansionRenderer
|
179
|
+
}, ref);
|
200
180
|
useTableRowActive(activeIndex, rows, rowExpansionRenderer, onRowActive);
|
201
|
-
|
181
|
+
const prepareRow = React__default.useCallback((row, index) => {
|
202
182
|
prepareBaseRow(row);
|
203
183
|
|
204
|
-
row.setActive =
|
205
|
-
return setActiveIndex(index);
|
206
|
-
};
|
184
|
+
row.setActive = () => setActiveIndex(index);
|
207
185
|
}, [prepareBaseRow, setActiveIndex]);
|
208
186
|
return {
|
209
187
|
rowProps: {
|
210
|
-
activeIndex
|
211
|
-
setActiveIndex
|
212
|
-
onRowClick
|
213
|
-
rowClassName
|
214
|
-
rowExpansionRenderer
|
215
|
-
rowHeight
|
216
|
-
inlineEditingUniqueId
|
188
|
+
activeIndex,
|
189
|
+
setActiveIndex,
|
190
|
+
onRowClick,
|
191
|
+
rowClassName,
|
192
|
+
rowExpansionRenderer,
|
193
|
+
rowHeight,
|
194
|
+
inlineEditingUniqueId
|
217
195
|
},
|
218
|
-
tableProps:
|
219
|
-
headerGroups
|
196
|
+
tableProps: { ...otherProps,
|
197
|
+
headerGroups,
|
220
198
|
onFocus: handleFocus,
|
221
199
|
onKeyDown: handleKeyDown,
|
222
200
|
tabIndex: (_otherProps$tabIndex = otherProps.tabIndex) !== null && _otherProps$tabIndex !== void 0 ? _otherProps$tabIndex : 0
|
223
|
-
}
|
224
|
-
state
|
201
|
+
},
|
202
|
+
state,
|
225
203
|
pagination: !disablePagination ? {
|
226
204
|
length: manualPagination && length ? length : data.length,
|
227
205
|
pageIndex: state.pageIndex,
|
@@ -230,7 +208,7 @@ var useTable = function useTable(props, ref) {
|
|
230
208
|
setPageSize: setPageSize
|
231
209
|
} : null,
|
232
210
|
rows: visibleRows,
|
233
|
-
prepareRow
|
211
|
+
prepareRow,
|
234
212
|
instance: sanitizedInstance
|
235
213
|
};
|
236
214
|
};
|