@economic/taco 0.0.10-alpha.0 → 0.0.13-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -84
- package/dist/components/IconButton/IconButton.d.ts +10 -14
- package/dist/components/Menu/Menu.d.ts +1 -0
- package/dist/components/Menu/components/Item.d.ts +3 -0
- 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 +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 +57 -36
- 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 +64 -84
- 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 +35 -33
- package/dist/esm/components/Datepicker/useDatepicker.js.map +1 -1
- package/dist/esm/components/Dialog/Context.js +3 -3
- 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/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/ExportToExcelCopy.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/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/Thumb.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/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 +9 -8
- package/dist/esm/components/Input/util.js.map +1 -1
- package/dist/esm/components/Label/Label.js.map +1 -1
- package/dist/esm/components/Listbox/Listbox.js.map +1 -1
- package/dist/esm/components/Listbox/ScrollableList.js +63 -82
- package/dist/esm/components/Listbox/ScrollableList.js.map +1 -1
- package/dist/esm/components/Listbox/useListbox.js +49 -58
- 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 +59 -43
- package/dist/esm/components/Menu/components/Item.js.map +1 -1
- package/dist/esm/components/Menu/components/Link.js +7 -8
- 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 +39 -56
- 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 +29 -34
- package/dist/esm/components/Popover/Popover.js.map +1 -1
- package/dist/esm/components/Popover/Primitives.js +27 -30
- package/dist/esm/components/Popover/Primitives.js.map +1 -1
- package/dist/esm/components/Progress/Progress.js +11 -15
- package/dist/esm/components/Progress/Progress.js.map +1 -1
- package/dist/esm/components/Provider/Provider.js +14 -19
- package/dist/esm/components/Provider/Provider.js.map +1 -1
- package/dist/esm/components/RadioGroup/RadioGroup.js +45 -57
- 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 +30 -31
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Select/useSelect.js +63 -82
- package/dist/esm/components/Select/useSelect.js.map +1 -1
- package/dist/esm/components/Spinner/Spinner.js +12 -19
- package/dist/esm/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/components/Switch/Switch.js +9 -10
- 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 +25 -27
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/Textarea/Textarea.js +8 -6
- 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 +88 -118
- 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 +7 -8
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/Tour/Tour.js +44 -50
- package/dist/esm/components/Tour/Tour.js.map +1 -1
- package/dist/esm/components/Treeview/Treeview.js +26 -36
- package/dist/esm/components/Treeview/Treeview.js.map +1 -1
- package/dist/esm/components/VisuallyHidden/VisuallyHidden.js +1 -1
- package/dist/esm/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/dist/esm/index.css +638 -638
- 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 +12 -20
- 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 +638 -638
- package/dist/taco.cjs.development.js +1944 -2316
- 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/dist/utils/tailwind.d.ts +1 -1
- package/package.json +2 -2
- package/plugins/tailwindcss-aria-attributes.js +73 -73
- package/tailwind.config.js +297 -297
- package/types.json +550 -454
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useSelect.js","sources":["../../../../src/components/Select/useSelect.tsx"],"sourcesContent":["import * as React from 'react';\nimport keycode from 'keycode';\nimport cn from 'classnames';\nimport { v4 as uuid } from 'uuid';\nimport { useLocalization } from '../Provider/Provider';\nimport { SelectProps } from './Select';\nimport { ListboxProps } from '../Listbox/Listbox';\nimport { useProxiedRef } from '../../utils/hooks/useProxiedRef';\nimport { setInputValueByRef, findByValue, useFlattenedData, sanitizeItem } from '../Listbox/util';\nimport { ScrollableListItemValue } from '../Listbox/ScrollableList';\n\ntype useSelect = React.HtmlHTMLAttributes<HTMLDivElement> & {\n button: React.ButtonHTMLAttributes<HTMLButtonElement>;\n listbox: ListboxProps;\n input: any;\n popover: { open: boolean; onOpenChange: (open: boolean) => void };\n text: string | JSX.Element;\n more?: number;\n};\n\nexport const useSelect = (\n {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n data = [],\n defaultValue,\n disabled,\n emptyValue,\n id: nativeId,\n multiselect,\n onClick,\n onChange,\n readOnly,\n value = emptyValue,\n ...otherProps\n }: SelectProps,\n ref: React.Ref<HTMLInputElement>\n): useSelect => {\n const { texts } = useLocalization();\n const searchData = useFlattenedData(data);\n const inputRef = useProxiedRef<HTMLInputElement>(ref);\n const [open, setOpen] = React.useState(false);\n const id = React.useMemo(() => nativeId || `select_${uuid()}`, [nativeId]);\n const internalInputRef = React.useRef(null);\n const buttonId = `${id}-button`;\n // support 'escape' resetting to the value that was set when the listbox opened\n const [lastValue, setLastValue] = React.useState<ScrollableListItemValue | undefined>(value);\n\n React.useEffect(() => {\n setLastValue(value);\n }, [open]);\n\n React.useEffect(() => {\n if (defaultValue !== undefined && value === undefined) {\n setInputValueByRef(internalInputRef.current, defaultValue);\n }\n }, [defaultValue]);\n\n React.useEffect(() => {\n if (value !== undefined) {\n setInputValueByRef(internalInputRef.current, value);\n }\n }, []);\n\n // event handlers\n const handleButtonKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>): void => {\n if (event.keyCode === keycode('up') || event.keyCode === keycode('down')) {\n event.preventDefault();\n setOpen(true);\n }\n };\n\n const handleListboxKeyDown = (event: React.KeyboardEvent<HTMLElement>): void => {\n switch (event.keyCode) {\n case keycode('escape'): {\n event.preventDefault();\n if (lastValue !== undefined) {\n setInputValueByRef(inputRef.current, lastValue);\n }\n\n setOpen(false);\n break;\n }\n\n case keycode('tab'):\n case keycode('enter'): {\n if (event.keyCode !== keycode('tab')) {\n event.preventDefault();\n }\n setOpen(false);\n break;\n }\n\n default:\n }\n\n if (otherProps.onKeyDown) {\n otherProps.onKeyDown(event);\n }\n };\n\n const handleListboxClick = (event: React.MouseEvent<HTMLLIElement>): void => {\n event.preventDefault();\n if (!multiselect) {\n setOpen(false);\n }\n };\n\n let text: string | JSX.Element = '';\n let more = 0;\n\n if (value !== undefined) {\n if (multiselect) {\n const selectedValues = value?.toString().split(',') || [];\n\n if (selectedValues.length === searchData.filter(item => !item.disabled).length) {\n text = texts.select.allOptionsSelected;\n } else {\n text = findByValue(searchData, selectedValues[0])?.text ?? '';\n more = selectedValues.length > 1 ? selectedValues.length - 1 : 0;\n }\n } else {\n const item = findByValue(searchData, value);\n\n if (item) {\n text = item.icon ? (\n <>\n {React.cloneElement(item.icon, {\n className: cn(item.icon.props.className, 'mr-1 -mt-px'),\n })}\n {item.text}\n </>\n ) : (\n item.text\n );\n }\n }\n }\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n event.persist();\n\n if (onChange) {\n const item = findByValue(searchData, event.target.value);\n (event as any).detail = sanitizeItem(item);\n\n const indexes = item?.path?.split('.') ?? [];\n\n if (indexes.length > 1) {\n // we don't want to map the current item\n indexes.pop();\n // we need to rebuild the path as we map\n let lastPath: string;\n\n (event as any).detail.parents = indexes.map(i => {\n lastPath = lastPath ? [lastPath, i].join('.') : i;\n return sanitizeItem(searchData.find(i => i.path === lastPath));\n });\n }\n\n onChange(event);\n }\n };\n\n const button: React.ButtonHTMLAttributes<HTMLButtonElement> = {\n 'aria-haspopup': 'listbox' as const,\n 'aria-label': ariaLabel ? `${ariaLabel} ${text}` : undefined,\n 'aria-labelledby': ariaLabelledBy ? `${ariaLabelledBy} ${buttonId}` : undefined,\n disabled,\n id: buttonId,\n onKeyDown: !disabled && !readOnly ? handleButtonKeyDown : undefined,\n type: 'button',\n };\n\n const listbox = {\n ...otherProps,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n data,\n disabled,\n emptyValue,\n onClick: handleListboxClick,\n onChange: event => {\n setInputValueByRef(internalInputRef.current, event.detail.value);\n },\n onKeyDown: handleListboxKeyDown,\n ref: inputRef,\n value,\n multiselect,\n };\n\n const input = {\n onChange: handleInputChange,\n ref: internalInputRef,\n value: value ?? '',\n };\n\n return {\n button,\n listbox,\n input,\n popover: {\n open,\n onOpenChange: setOpen,\n },\n text,\n more,\n };\n};\n"],"names":["useSelect","ref","ariaLabel","ariaLabelledBy","data","defaultValue","disabled","emptyValue","nativeId","id","multiselect","onChange","readOnly","value","otherProps","useLocalization","texts","searchData","useFlattenedData","inputRef","useProxiedRef","React","open","setOpen","uuid","internalInputRef","buttonId","lastValue","setLastValue","undefined","setInputValueByRef","current","handleButtonKeyDown","event","keyCode","keycode","preventDefault","handleListboxKeyDown","onKeyDown","handleListboxClick","text","more","selectedValues","toString","split","length","filter","item","select","allOptionsSelected","findByValue","icon","className","cn","props","handleInputChange","persist","target","detail","sanitizeItem","indexes","path","pop","lastPath","parents","map","i","join","find","button","type","listbox","onClick","input","popover","onOpenChange"],"mappings":";;;;;;;;;;IAoBaA,SAAS,GAAG,SAAZA,SAAY,OAgBrBC,GAhBqB;MAEHC,iBAAd;MACmBC,sBAAnB;uBACAC;MAAAA,8BAAO;MACPC,oBAAAA;MACAC,gBAAAA;MACAC,kBAAAA;MACIC,gBAAJC;MACAC,mBAAAA;MAEAC,gBAAAA;MACAC,gBAAAA;wBACAC;MAAAA,gCAAQN;MACLO;;AAIP,yBAAkBC,eAAe,EAAjC;AAAA,MAAQC,KAAR,oBAAQA,KAAR;;AACA,MAAMC,UAAU,GAAGC,gBAAgB,CAACd,IAAD,CAAnC;AACA,MAAMe,QAAQ,GAAGC,aAAa,CAAmBnB,GAAnB,CAA9B;;AACA,wBAAwBoB,QAAA,CAAe,KAAf,CAAxB;AAAA,MAAOC,IAAP;AAAA,MAAaC,OAAb;;AACA,MAAMd,EAAE,GAAGY,OAAA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KAAK,EAALA,KAbS;AAcTH,IAAAA,WAAW,EAAXA;AAdS,IAAb;;AAiBA,MAAM+D,KAAK,GAAG;AACV9D,IAAAA,QAAQ,EAAE4C,iBADA;AAEVtD,IAAAA,GAAG,EAAEwB,gBAFK;AAGVZ,IAAAA,KAAK,EAAEA,KAAF,aAAEA,KAAF,cAAEA,KAAF,GAAW;AAHN,GAAd;AAMA,SAAO;AACHwD,IAAAA,MAAM,EAANA,MADG;AAEHE,IAAAA,OAAO,EAAPA,OAFG;AAGHE,IAAAA,KAAK,EAALA,KAHG;AAIHC,IAAAA,OAAO,EAAE;AACLpD,MAAAA,IAAI,EAAJA,IADK;AAELqD,MAAAA,YAAY,EAAEpD;AAFT,KAJN;AAQHiB,IAAAA,IAAI,EAAJA,IARG;AASHC,IAAAA,IAAI,EAAJA;AATG,GAAP;AAWH;;;;"}
|
1
|
+
{"version":3,"file":"useSelect.js","sources":["../../../../src/components/Select/useSelect.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport keycode from 'keycode';\r\nimport cn from 'classnames';\r\nimport { v4 as uuid } from 'uuid';\r\nimport { useLocalization } from '../Provider/Provider';\r\nimport { SelectProps } from './Select';\r\nimport { ListboxProps } from '../Listbox/Listbox';\r\nimport { useProxiedRef } from '../../utils/hooks/useProxiedRef';\r\nimport { setInputValueByRef, findByValue, useFlattenedData, sanitizeItem } from '../Listbox/util';\r\nimport { ScrollableListItemValue } from '../Listbox/ScrollableList';\r\n\r\ntype useSelect = React.HtmlHTMLAttributes<HTMLDivElement> & {\r\n button: React.ButtonHTMLAttributes<HTMLButtonElement>;\r\n listbox: ListboxProps;\r\n input: any;\r\n popover: { open: boolean; onOpenChange: (open: boolean) => void };\r\n text: string | JSX.Element;\r\n more?: number;\r\n};\r\n\r\nexport const useSelect = (\r\n {\r\n 'aria-label': ariaLabel,\r\n 'aria-labelledby': ariaLabelledBy,\r\n data = [],\r\n defaultValue,\r\n disabled,\r\n emptyValue,\r\n id: nativeId,\r\n multiselect,\r\n onClick,\r\n onChange,\r\n readOnly,\r\n value = emptyValue,\r\n ...otherProps\r\n }: SelectProps,\r\n ref: React.Ref<HTMLInputElement>\r\n): useSelect => {\r\n const { texts } = useLocalization();\r\n const searchData = useFlattenedData(data);\r\n const inputRef = useProxiedRef<HTMLInputElement>(ref);\r\n const [open, setOpen] = React.useState(false);\r\n const id = React.useMemo(() => nativeId || `select_${uuid()}`, [nativeId]);\r\n const internalInputRef = React.useRef(null);\r\n const buttonId = `${id}-button`;\r\n // support 'escape' resetting to the value that was set when the listbox opened\r\n const [lastValue, setLastValue] = React.useState<ScrollableListItemValue | undefined>(value);\r\n\r\n React.useEffect(() => {\r\n setLastValue(value);\r\n }, [open]);\r\n\r\n React.useEffect(() => {\r\n if (defaultValue !== undefined && value === undefined) {\r\n setInputValueByRef(internalInputRef.current, defaultValue);\r\n }\r\n }, [defaultValue]);\r\n\r\n React.useEffect(() => {\r\n if (value !== undefined) {\r\n setInputValueByRef(internalInputRef.current, value);\r\n }\r\n }, []);\r\n\r\n // event handlers\r\n const handleButtonKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>): void => {\r\n if (event.keyCode === keycode('up') || event.keyCode === keycode('down')) {\r\n event.preventDefault();\r\n setOpen(true);\r\n }\r\n };\r\n\r\n const handleListboxKeyDown = (event: React.KeyboardEvent<HTMLElement>): void => {\r\n switch (event.keyCode) {\r\n case keycode('escape'): {\r\n event.preventDefault();\r\n if (lastValue !== undefined) {\r\n setInputValueByRef(inputRef.current, lastValue);\r\n }\r\n\r\n setOpen(false);\r\n break;\r\n }\r\n\r\n case keycode('tab'):\r\n case keycode('enter'): {\r\n if (event.keyCode !== keycode('tab')) {\r\n event.preventDefault();\r\n }\r\n setOpen(false);\r\n break;\r\n }\r\n\r\n default:\r\n }\r\n\r\n if (otherProps.onKeyDown) {\r\n otherProps.onKeyDown(event);\r\n }\r\n };\r\n\r\n const handleListboxClick = (event: React.MouseEvent<HTMLLIElement>): void => {\r\n event.preventDefault();\r\n if (!multiselect) {\r\n setOpen(false);\r\n }\r\n };\r\n\r\n let text: string | JSX.Element = '';\r\n let more = 0;\r\n\r\n if (value !== undefined) {\r\n if (multiselect) {\r\n const selectedValues = value?.toString().split(',') || [];\r\n\r\n if (selectedValues.length === searchData.filter(item => !item.disabled).length) {\r\n text = texts.select.allOptionsSelected;\r\n } else {\r\n text = findByValue(searchData, selectedValues[0])?.text ?? '';\r\n more = selectedValues.length > 1 ? selectedValues.length - 1 : 0;\r\n }\r\n } else {\r\n const item = findByValue(searchData, value);\r\n\r\n if (item) {\r\n text = item.icon ? (\r\n <>\r\n {React.cloneElement(item.icon, {\r\n className: cn(item.icon.props.className, 'mr-1 -mt-px'),\r\n })}\r\n {item.text}\r\n </>\r\n ) : (\r\n item.text\r\n );\r\n }\r\n }\r\n }\r\n\r\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\r\n event.persist();\r\n\r\n if (onChange) {\r\n const item = findByValue(searchData, event.target.value);\r\n (event as any).detail = sanitizeItem(item);\r\n\r\n const indexes = item?.path?.split('.') ?? [];\r\n\r\n if (indexes.length > 1) {\r\n // we don't want to map the current item\r\n indexes.pop();\r\n // we need to rebuild the path as we map\r\n let lastPath: string;\r\n\r\n (event as any).detail.parents = indexes.map(i => {\r\n lastPath = lastPath ? [lastPath, i].join('.') : i;\r\n return sanitizeItem(searchData.find(i => i.path === lastPath));\r\n });\r\n }\r\n\r\n onChange(event);\r\n }\r\n };\r\n\r\n const button: React.ButtonHTMLAttributes<HTMLButtonElement> = {\r\n 'aria-haspopup': 'listbox' as const,\r\n 'aria-label': ariaLabel ? `${ariaLabel} ${text}` : undefined,\r\n 'aria-labelledby': ariaLabelledBy ? `${ariaLabelledBy} ${buttonId}` : undefined,\r\n disabled,\r\n id: buttonId,\r\n onKeyDown: !disabled && !readOnly ? handleButtonKeyDown : undefined,\r\n type: 'button',\r\n };\r\n\r\n const listbox = {\r\n ...otherProps,\r\n 'aria-label': ariaLabel,\r\n 'aria-labelledby': ariaLabelledBy,\r\n data,\r\n disabled,\r\n emptyValue,\r\n onClick: handleListboxClick,\r\n onChange: event => {\r\n setInputValueByRef(internalInputRef.current, event.detail.value);\r\n },\r\n onKeyDown: handleListboxKeyDown,\r\n ref: inputRef,\r\n value,\r\n multiselect,\r\n };\r\n\r\n const input = {\r\n onChange: handleInputChange,\r\n ref: internalInputRef,\r\n value: value ?? '',\r\n };\r\n\r\n return {\r\n button,\r\n listbox,\r\n input,\r\n popover: {\r\n open,\r\n onOpenChange: setOpen,\r\n },\r\n text,\r\n more,\r\n };\r\n};\r\n"],"names":["useSelect","ariaLabel","ariaLabelledBy","data","defaultValue","disabled","emptyValue","id","nativeId","multiselect","onClick","onChange","readOnly","value","otherProps","ref","texts","useLocalization","searchData","useFlattenedData","inputRef","useProxiedRef","open","setOpen","React","uuid","internalInputRef","buttonId","lastValue","setLastValue","undefined","setInputValueByRef","current","handleButtonKeyDown","event","keyCode","keycode","preventDefault","handleListboxKeyDown","onKeyDown","handleListboxClick","text","more","selectedValues","toString","split","length","filter","item","select","allOptionsSelected","findByValue","icon","className","cn","props","handleInputChange","persist","target","detail","sanitizeItem","indexes","path","pop","lastPath","parents","map","i","join","find","button","type","listbox","input","popover","onOpenChange"],"mappings":";;;;;;;;MAoBaA,SAAS,GAAG,CACrB;AACI,gBAAcC,SADlB;AAEI,qBAAmBC,cAFvB;AAGIC,EAAAA,IAAI,GAAG,EAHX;AAIIC,EAAAA,YAJJ;AAKIC,EAAAA,QALJ;AAMIC,EAAAA,UANJ;AAOIC,EAAAA,EAAE,EAAEC,QAPR;AAQIC,EAAAA,WARJ;AASIC,EAAAA,OATJ;AAUIC,EAAAA,QAVJ;AAWIC,EAAAA,QAXJ;AAYIC,EAAAA,KAAK,GAAGP,UAZZ;AAaI,KAAGQ;AAbP,CADqB,EAgBrBC,GAhBqB;AAkBrB,QAAM;AAAEC,IAAAA;AAAF,MAAYC,eAAe,EAAjC;AACA,QAAMC,UAAU,GAAGC,gBAAgB,CAA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AACV9D,IAAAA,QAAQ,EAAE6C,iBADA;AAEVzC,IAAAA,GAAG,EAAEW,gBAFK;AAGVb,IAAAA,KAAK,EAAEA,KAAF,aAAEA,KAAF,cAAEA,KAAF,GAAW;AAHN,GAAd;AAMA,SAAO;AACHyD,IAAAA,MADG;AAEHE,IAAAA,OAFG;AAGHC,IAAAA,KAHG;AAIHC,IAAAA,OAAO,EAAE;AACLpD,MAAAA,IADK;AAELqD,MAAAA,YAAY,EAAEpD;AAFT,KAJN;AAQHkB,IAAAA,IARG;AASHC,IAAAA;AATG,GAAP;AAWH;;;;"}
|
@@ -1,28 +1,21 @@
|
|
1
|
-
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
2
1
|
import React__default from 'react';
|
3
2
|
import cn from 'classnames';
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
setVisibility = _React$useState[1];
|
15
|
-
|
16
|
-
React__default.useEffect(function () {
|
17
|
-
var timeout;
|
4
|
+
const Spinner = /*#__PURE__*/React__default.forwardRef(function Spinner(props, ref) {
|
5
|
+
const {
|
6
|
+
delay = 500,
|
7
|
+
label,
|
8
|
+
...otherProps
|
9
|
+
} = props;
|
10
|
+
const [visible, setVisibility] = React__default.useState(!delay);
|
11
|
+
React__default.useEffect(() => {
|
12
|
+
let timeout;
|
18
13
|
|
19
14
|
if (delay) {
|
20
|
-
timeout = window.setTimeout(
|
21
|
-
return setVisibility(true);
|
22
|
-
}, delay);
|
15
|
+
timeout = window.setTimeout(() => setVisibility(true), delay);
|
23
16
|
}
|
24
17
|
|
25
|
-
return
|
18
|
+
return () => {
|
26
19
|
if (timeout) {
|
27
20
|
clearTimeout(timeout);
|
28
21
|
}
|
@@ -33,7 +26,7 @@ var Spinner = /*#__PURE__*/React__default.forwardRef(function Spinner(props, ref
|
|
33
26
|
return null;
|
34
27
|
}
|
35
28
|
|
36
|
-
|
29
|
+
const className = cn('inline-flex flex-col relative items-center', otherProps.className);
|
37
30
|
return React__default.createElement("div", Object.assign({}, otherProps, {
|
38
31
|
className: className,
|
39
32
|
"data-taco": "spinner",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Spinner.js","sources":["../../../../src/components/Spinner/Spinner.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport './Spinner.css';\n\nexport type SpinnerProps = React.HTMLAttributes<HTMLDivElement> & {\n /**\n * Define a delay in milliseconds after which the spinner is shown.\n * Default value is `500`ms\n */\n delay?: number;\n /** Define a text that will be displayed below spinner */\n label?: string;\n};\n\nexport const Spinner = React.forwardRef(function Spinner(props: SpinnerProps, ref: React.Ref<HTMLDivElement>) {\n const { delay = 500, label, ...otherProps } = props;\n const [visible, setVisibility] = React.useState(!delay);\n\n React.useEffect(() => {\n let timeout: number;\n\n if (delay) {\n timeout = window.setTimeout(() => setVisibility(true), delay);\n }\n\n return () => {\n if (timeout) {\n clearTimeout(timeout);\n }\n };\n }, [delay]);\n\n if (!visible) {\n return null;\n }\n\n const className = cn('inline-flex flex-col relative items-center', otherProps.className);\n\n return (\n <div {...otherProps} className={className} data-taco=\"spinner\" ref={ref}>\n <svg\n className=\"h-10 w-10 animate-[spinnerRotation_2s_linear_infinite]\"\n viewBox=\"0 0 100 100\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"50\" cy=\"50\" r=\"45\"></circle>\n </svg>\n {label && <span className=\"mt-4\">{label}</span>}\n </div>\n );\n});\n"],"names":["Spinner","React","forwardRef","props","ref","delay","label","otherProps","
|
1
|
+
{"version":3,"file":"Spinner.js","sources":["../../../../src/components/Spinner/Spinner.tsx"],"sourcesContent":["import React from 'react';\r\nimport cn from 'classnames';\r\nimport './Spinner.css';\r\n\r\nexport type SpinnerProps = React.HTMLAttributes<HTMLDivElement> & {\r\n /**\r\n * Define a delay in milliseconds after which the spinner is shown.\r\n * Default value is `500`ms\r\n */\r\n delay?: number;\r\n /** Define a text that will be displayed below spinner */\r\n label?: string;\r\n};\r\n\r\nexport const Spinner = React.forwardRef(function Spinner(props: SpinnerProps, ref: React.Ref<HTMLDivElement>) {\r\n const { delay = 500, label, ...otherProps } = props;\r\n const [visible, setVisibility] = React.useState(!delay);\r\n\r\n React.useEffect(() => {\r\n let timeout: number;\r\n\r\n if (delay) {\r\n timeout = window.setTimeout(() => setVisibility(true), delay);\r\n }\r\n\r\n return () => {\r\n if (timeout) {\r\n clearTimeout(timeout);\r\n }\r\n };\r\n }, [delay]);\r\n\r\n if (!visible) {\r\n return null;\r\n }\r\n\r\n const className = cn('inline-flex flex-col relative items-center', otherProps.className);\r\n\r\n return (\r\n <div {...otherProps} className={className} data-taco=\"spinner\" ref={ref}>\r\n <svg\r\n className=\"h-10 w-10 animate-[spinnerRotation_2s_linear_infinite]\"\r\n viewBox=\"0 0 100 100\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n >\r\n <circle cx=\"50\" cy=\"50\" r=\"45\"></circle>\r\n </svg>\r\n {label && <span className=\"mt-4\">{label}</span>}\r\n </div>\r\n );\r\n});\r\n"],"names":["Spinner","React","forwardRef","props","ref","delay","label","otherProps","visible","setVisibility","useState","useEffect","timeout","window","setTimeout","clearTimeout","className","cn","viewBox","xmlns","cx","cy","r"],"mappings":";;;MAcaA,OAAO,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,OAAT,CAAiBG,KAAjB,EAAsCC,GAAtC;AACpC,QAAM;AAAEC,IAAAA,KAAK,GAAG,GAAV;AAAeC,IAAAA,KAAf;AAAsB,OAAGC;AAAzB,MAAwCJ,KAA9C;AACA,QAAM,CAACK,OAAD,EAAUC,aAAV,IAA2BR,cAAK,CAACS,QAAN,CAAe,CAACL,KAAhB,CAAjC;AAEAJ,EAAAA,cAAK,CAACU,SAAN,CAAgB;AACZ,QAAIC,OAAJ;;AAEA,QAAIP,KAAJ,EAAW;AACPO,MAAAA,OAAO,GAAGC,MAAM,CAACC,UAAP,CAAkB,MAAML,aAAa,CAAC,IAAD,CAArC,EAA6CJ,KAA7C,CAAV;AACH;;AAED,WAAO;AACH,UAAIO,OAAJ,EAAa;AACTG,QAAAA,YAAY,CAACH,OAAD,CAAZ;AACH;AACJ,KAJD;AAKH,GAZD,EAYG,CAACP,KAAD,CAZH;;AAcA,MAAI,CAACG,OAAL,EAAc;AACV,WAAO,IAAP;AACH;;AAED,QAAMQ,SAAS,GAAGC,EAAE,CAAC,4CAAD,EAA+CV,UAAU,CAACS,SAA1D,CAApB;AAEA,SACIf,4BAAA,MAAA,oBAASM;AAAYS,IAAAA,SAAS,EAAEA;iBAAqB;AAAUZ,IAAAA,GAAG,EAAEA;IAApE,EACIH,4BAAA,MAAA;AACIe,IAAAA,SAAS,EAAC;AACVE,IAAAA,OAAO,EAAC;AACRC,IAAAA,KAAK,EAAC;GAHV,EAKIlB,4BAAA,SAAA;AAAQmB,IAAAA,EAAE,EAAC;AAAKC,IAAAA,EAAE,EAAC;AAAKC,IAAAA,CAAC,EAAC;GAA1B,CALJ,CADJ,EAQKhB,KAAK,IAAIL,4BAAA,OAAA;AAAMe,IAAAA,SAAS,EAAC;GAAhB,EAAwBV,KAAxB,CARd,CADJ;AAYH,CApCsB;;;;"}
|
@@ -1,20 +1,19 @@
|
|
1
|
-
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
2
1
|
import { forwardRef, createElement } from 'react';
|
3
2
|
import cn from 'classnames';
|
4
3
|
import { Root, Thumb } from '@radix-ui/react-switch';
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
const Switch = /*#__PURE__*/forwardRef(function Switch(props, ref) {
|
6
|
+
const {
|
7
|
+
label,
|
8
|
+
onChange,
|
9
|
+
...otherProps
|
10
|
+
} = props;
|
11
|
+
const className = cn('group h-6 w-10 flex rounded-full inline-flex', {
|
13
12
|
'mr-2': !!label,
|
14
13
|
'bg-grey-darker aria-checked:bg-blue focus:yt-focus': !props.disabled,
|
15
14
|
'bg-grey-light cursor-not-allowed aria-checked:bg-blue-light': props.disabled
|
16
15
|
}, props.className);
|
17
|
-
|
16
|
+
const element = createElement(Root, Object.assign({}, otherProps, {
|
18
17
|
className: className,
|
19
18
|
onCheckedChange: onChange,
|
20
19
|
ref: ref
|
@@ -23,7 +22,7 @@ var Switch = /*#__PURE__*/forwardRef(function Switch(props, ref) {
|
|
23
22
|
}));
|
24
23
|
|
25
24
|
if (label) {
|
26
|
-
|
25
|
+
const labelClassName = cn('flex items-center cursor-pointer', {
|
27
26
|
'cursor-not-allowed text-grey-dark': props.disabled
|
28
27
|
});
|
29
28
|
return createElement("label", {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Switch.js","sources":["../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as PrimitiveSwitch from '@radix-ui/react-switch';\n\ntype SwitchBaseProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange'> & {\n /** Label for the switch */\n label?: React.ReactNode;\n /* Whether user input is required */\n required?: boolean;\n};\n\ninterface UncontrolledSwitchProps extends SwitchBaseProps {\n checked?: never;\n onChange?: never;\n /* The default checked state (uncontrolled) */\n defaultChecked?: boolean;\n}\n\ninterface ControlledSwitchProps extends SwitchBaseProps {\n defaultChecked?: never;\n /* The current checked state (controlled) */\n checked: boolean;\n /* Handler called when the checked state changes */\n onChange: (checked: boolean) => void;\n}\n\nexport type SwitchProps = UncontrolledSwitchProps | ControlledSwitchProps;\n\nexport const Switch = React.forwardRef(function Switch(props: SwitchProps, ref: React.Ref<HTMLButtonElement>) {\n const { label, onChange, ...otherProps } = props;\n\n const className = cn(\n 'group h-6 w-10 flex rounded-full inline-flex',\n {\n 'mr-2': !!label,\n 'bg-grey-darker aria-checked:bg-blue focus:yt-focus': !props.disabled,\n 'bg-grey-light cursor-not-allowed aria-checked:bg-blue-light': props.disabled,\n },\n props.className\n );\n\n const element = (\n <PrimitiveSwitch.Root {...otherProps} className={className} onCheckedChange={onChange} ref={ref}>\n <PrimitiveSwitch.Thumb className=\"'will-change-transform transition-transform translate-x-1 group-aria-checked:translate-x-5 h-4 w-4 mt-1 bg-white rounded-full\" />\n </PrimitiveSwitch.Root>\n );\n\n if (label) {\n const labelClassName = cn('flex items-center cursor-pointer', {\n 'cursor-not-allowed text-grey-dark': props.disabled,\n });\n\n return (\n <label className={labelClassName}>\n {element}\n {label}\n </label>\n );\n }\n\n return element;\n});\n"],"names":["Switch","React","props","ref","label","onChange","otherProps","className","cn","disabled","element","PrimitiveSwitch","onCheckedChange","labelClassName"],"mappings":"
|
1
|
+
{"version":3,"file":"Switch.js","sources":["../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport * as PrimitiveSwitch from '@radix-ui/react-switch';\r\n\r\ntype SwitchBaseProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange'> & {\r\n /** Label for the switch */\r\n label?: React.ReactNode;\r\n /* Whether user input is required */\r\n required?: boolean;\r\n};\r\n\r\ninterface UncontrolledSwitchProps extends SwitchBaseProps {\r\n checked?: never;\r\n onChange?: never;\r\n /* The default checked state (uncontrolled) */\r\n defaultChecked?: boolean;\r\n}\r\n\r\ninterface ControlledSwitchProps extends SwitchBaseProps {\r\n defaultChecked?: never;\r\n /* The current checked state (controlled) */\r\n checked: boolean;\r\n /* Handler called when the checked state changes */\r\n onChange: (checked: boolean) => void;\r\n}\r\n\r\nexport type SwitchProps = UncontrolledSwitchProps | ControlledSwitchProps;\r\n\r\nexport const Switch = React.forwardRef(function Switch(props: SwitchProps, ref: React.Ref<HTMLButtonElement>) {\r\n const { label, onChange, ...otherProps } = props;\r\n\r\n const className = cn(\r\n 'group h-6 w-10 flex rounded-full inline-flex',\r\n {\r\n 'mr-2': !!label,\r\n 'bg-grey-darker aria-checked:bg-blue focus:yt-focus': !props.disabled,\r\n 'bg-grey-light cursor-not-allowed aria-checked:bg-blue-light': props.disabled,\r\n },\r\n props.className\r\n );\r\n\r\n const element = (\r\n <PrimitiveSwitch.Root {...otherProps} className={className} onCheckedChange={onChange} ref={ref}>\r\n <PrimitiveSwitch.Thumb className=\"'will-change-transform transition-transform translate-x-1 group-aria-checked:translate-x-5 h-4 w-4 mt-1 bg-white rounded-full\" />\r\n </PrimitiveSwitch.Root>\r\n );\r\n\r\n if (label) {\r\n const labelClassName = cn('flex items-center cursor-pointer', {\r\n 'cursor-not-allowed text-grey-dark': props.disabled,\r\n });\r\n\r\n return (\r\n <label className={labelClassName}>\r\n {element}\r\n {label}\r\n </label>\r\n );\r\n }\r\n\r\n return element;\r\n});\r\n"],"names":["Switch","React","props","ref","label","onChange","otherProps","className","cn","disabled","element","PrimitiveSwitch","onCheckedChange","labelClassName"],"mappings":";;;;MA4BaA,MAAM,gBAAGC,UAAA,CAAiB,SAASD,MAAT,CAAgBE,KAAhB,EAAoCC,GAApC;AACnC,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA,QAAT;AAAmB,OAAGC;AAAtB,MAAqCJ,KAA3C;AAEA,QAAMK,SAAS,GAAGC,EAAE,CAChB,8CADgB,EAEhB;AACI,YAAQ,CAAC,CAACJ,KADd;AAEI,0DAAsD,CAACF,KAAK,CAACO,QAFjE;AAGI,mEAA+DP,KAAK,CAACO;AAHzE,GAFgB,EAOhBP,KAAK,CAACK,SAPU,CAApB;AAUA,QAAMG,OAAO,GACTT,aAAA,CAACU,IAAD,oBAA0BL;AAAYC,IAAAA,SAAS,EAAEA;AAAWK,IAAAA,eAAe,EAAEP;AAAUF,IAAAA,GAAG,EAAEA;IAA5F,EACIF,aAAA,CAACU,KAAD;AAAuBJ,IAAAA,SAAS,EAAC;GAAjC,CADJ,CADJ;;AAMA,MAAIH,KAAJ,EAAW;AACP,UAAMS,cAAc,GAAGL,EAAE,CAAC,kCAAD,EAAqC;AAC1D,2CAAqCN,KAAK,CAACO;AADe,KAArC,CAAzB;AAIA,WACIR,aAAA,QAAA;AAAOM,MAAAA,SAAS,EAAEM;KAAlB,EACKH,OADL,EAEKN,KAFL,CADJ;AAMH;;AAED,SAAOM,OAAP;AACH,CAjCqB;;;;"}
|
@@ -1,29 +1,26 @@
|
|
1
|
-
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
1
|
import React__default from 'react';
|
3
2
|
import cn from 'classnames';
|
4
3
|
import { useProxiedRef } from '../../../utils/hooks/useProxiedRef.js';
|
5
4
|
import { Column } from '../util/renderColumn.js';
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
React__default.useEffect(function () {
|
6
|
+
const DefaultEmptyState = () => null;
|
7
|
+
const BaseTable = /*#__PURE__*/React__default.forwardRef(function BaseTable(props, ref) {
|
8
|
+
const tableRef = useProxiedRef(ref);
|
9
|
+
const {
|
10
|
+
autoFocus,
|
11
|
+
children,
|
12
|
+
disableSorting: _,
|
13
|
+
headerGroups,
|
14
|
+
headerRef,
|
15
|
+
bodyRef,
|
16
|
+
...otherProps
|
17
|
+
} = props;
|
18
|
+
React__default.useEffect(() => {
|
22
19
|
if (autoFocus && tableRef.current) {
|
23
20
|
tableRef.current.focus();
|
24
21
|
}
|
25
22
|
}, []);
|
26
|
-
|
23
|
+
const className = cn('yt-table flex flex-col focus:yt-focus focus:rounded-sm', props.className);
|
27
24
|
return React__default.createElement("div", Object.assign({}, otherProps, {
|
28
25
|
role: "table",
|
29
26
|
className: className,
|
@@ -32,19 +29,15 @@ var BaseTable = /*#__PURE__*/React__default.forwardRef(function BaseTable(props,
|
|
32
29
|
role: "rowgroup",
|
33
30
|
className: "yt-table__head",
|
34
31
|
ref: headerRef
|
35
|
-
}, headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.map(
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
cell: cell
|
45
|
-
});
|
46
|
-
}));
|
47
|
-
})), React__default.createElement("div", {
|
32
|
+
}, headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.map((headerGroup, index) => React__default.createElement("div", {
|
33
|
+
key: index,
|
34
|
+
role: "row",
|
35
|
+
className: "border-grey-light flex h-auto min-h-[2.5rem] w-full select-none border-b border-t-0 border-b-2 font-bold"
|
36
|
+
}, headerGroup.headers.map((cell, index) => React__default.createElement(Column, {
|
37
|
+
key: index,
|
38
|
+
index: index,
|
39
|
+
cell: cell
|
40
|
+
}))))), React__default.createElement("div", {
|
48
41
|
role: "rowgroup",
|
49
42
|
className: "yt-table__body",
|
50
43
|
ref: bodyRef
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BaseTable.js","sources":["../../../../../src/components/Table/components/BaseTable.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { HeaderGroup } from 'react-table';\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\nimport { InternalBaseTable } from '../types';\nimport './Table.css';\nimport { Column } from '../util/renderColumn';\n\nexport const DefaultEmptyState = (): React.ReactNode => null;\n\nexport const BaseTable = React.forwardRef(function BaseTable(props: InternalBaseTable, ref: React.Ref<HTMLDivElement>) {\n const tableRef = useProxiedRef<HTMLDivElement>(ref);\n const { autoFocus, children, disableSorting: _, headerGroups, headerRef, bodyRef, ...otherProps } = props;\n\n React.useEffect(() => {\n if (autoFocus && tableRef.current) {\n tableRef.current.focus();\n }\n }, []);\n\n const className = cn('yt-table flex flex-col focus:yt-focus focus:rounded-sm', props.className);\n\n return (\n <div {...otherProps} role=\"table\" className={className} ref={tableRef}>\n <div role=\"rowgroup\" className=\"yt-table__head\" ref={headerRef}>\n {headerGroups?.map((headerGroup: HeaderGroup<object>, index: number) => (\n <div\n key={index}\n role=\"row\"\n className=\"border-grey-light flex h-auto min-h-[2.5rem] w-full select-none border-b border-t-0 border-b-2 font-bold\"\n >\n {headerGroup.headers.map((cell: any, index: number) => (\n <Column key={index} index={index} cell={cell} />\n ))}\n </div>\n ))}\n </div>\n\n <div role=\"rowgroup\" className=\"yt-table__body\" ref={bodyRef}>\n {children}\n </div>\n </div>\n );\n});\n"],"names":["DefaultEmptyState","BaseTable","React","forwardRef","props","ref","tableRef","useProxiedRef","autoFocus","children","headerGroups","headerRef","bodyRef","otherProps","useEffect","current","focus","className","cn","role","map","headerGroup","index","key","headers","cell","Column"],"mappings":"
|
1
|
+
{"version":3,"file":"BaseTable.js","sources":["../../../../../src/components/Table/components/BaseTable.tsx"],"sourcesContent":["import React from 'react';\r\nimport cn from 'classnames';\r\nimport { HeaderGroup } from 'react-table';\r\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\r\nimport { InternalBaseTable } from '../types';\r\nimport './Table.css';\r\nimport { Column } from '../util/renderColumn';\r\n\r\nexport const DefaultEmptyState = (): React.ReactNode => null;\r\n\r\nexport const BaseTable = React.forwardRef(function BaseTable(props: InternalBaseTable, ref: React.Ref<HTMLDivElement>) {\r\n const tableRef = useProxiedRef<HTMLDivElement>(ref);\r\n const { autoFocus, children, disableSorting: _, headerGroups, headerRef, bodyRef, ...otherProps } = props;\r\n\r\n React.useEffect(() => {\r\n if (autoFocus && tableRef.current) {\r\n tableRef.current.focus();\r\n }\r\n }, []);\r\n\r\n const className = cn('yt-table flex flex-col focus:yt-focus focus:rounded-sm', props.className);\r\n\r\n return (\r\n <div {...otherProps} role=\"table\" className={className} ref={tableRef}>\r\n <div role=\"rowgroup\" className=\"yt-table__head\" ref={headerRef}>\r\n {headerGroups?.map((headerGroup: HeaderGroup<object>, index: number) => (\r\n <div\r\n key={index}\r\n role=\"row\"\r\n className=\"border-grey-light flex h-auto min-h-[2.5rem] w-full select-none border-b border-t-0 border-b-2 font-bold\"\r\n >\r\n {headerGroup.headers.map((cell: any, index: number) => (\r\n <Column key={index} index={index} cell={cell} />\r\n ))}\r\n </div>\r\n ))}\r\n </div>\r\n\r\n <div role=\"rowgroup\" className=\"yt-table__body\" ref={bodyRef}>\r\n {children}\r\n </div>\r\n </div>\r\n );\r\n});\r\n"],"names":["DefaultEmptyState","BaseTable","React","forwardRef","props","ref","tableRef","useProxiedRef","autoFocus","children","disableSorting","_","headerGroups","headerRef","bodyRef","otherProps","useEffect","current","focus","className","cn","role","map","headerGroup","index","key","headers","cell","Column"],"mappings":";;;;;MAQaA,iBAAiB,GAAG,MAAuB;MAE3CC,SAAS,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,SAAT,CAAmBG,KAAnB,EAA6CC,GAA7C;AACtC,QAAMC,QAAQ,GAAGC,aAAa,CAAiBF,GAAjB,CAA9B;AACA,QAAM;AAAEG,IAAAA,SAAF;AAAaC,IAAAA,QAAb;AAAuBC,IAAAA,cAAc,EAAEC,CAAvC;AAA0CC,IAAAA,YAA1C;AAAwDC,IAAAA,SAAxD;AAAmEC,IAAAA,OAAnE;AAA4E,OAAGC;AAA/E,MAA8FX,KAApG;AAEAF,EAAAA,cAAK,CAACc,SAAN,CAAgB;AACZ,QAAIR,SAAS,IAAIF,QAAQ,CAACW,OAA1B,EAAmC;AAC/BX,MAAAA,QAAQ,CAACW,OAAT,CAAiBC,KAAjB;AACH;AACJ,GAJD,EAIG,EAJH;AAMA,QAAMC,SAAS,GAAGC,EAAE,CAAC,wDAAD,EAA2DhB,KAAK,CAACe,SAAjE,CAApB;AAEA,SACIjB,4BAAA,MAAA,oBAASa;AAAYM,IAAAA,IAAI,EAAC;AAAQF,IAAAA,SAAS,EAAEA;AAAWd,IAAAA,GAAG,EAAEC;IAA7D,EACIJ,4BAAA,MAAA;AAAKmB,IAAAA,IAAI,EAAC;AAAWF,IAAAA,SAAS,EAAC;AAAiBd,IAAAA,GAAG,EAAEQ;GAArD,EACKD,YADL,aACKA,YADL,uBACKA,YAAY,CAAEU,GAAd,CAAkB,CAACC,WAAD,EAAmCC,KAAnC,KACftB,4BAAA,MAAA;AACIuB,IAAAA,GAAG,EAAED;AACLH,IAAAA,IAAI,EAAC;AACLF,IAAAA,SAAS,EAAC;GAHd,EAKKI,WAAW,CAACG,OAAZ,CAAoBJ,GAApB,CAAwB,CAACK,IAAD,EAAYH,KAAZ,KACrBtB,4BAAA,CAAC0B,MAAD;AAAQH,IAAAA,GAAG,EAAED;AAAOA,IAAAA,KAAK,EAAEA;AAAOG,IAAAA,IAAI,EAAEA;GAAxC,CADH,CALL,CADH,CADL,CADJ,EAeIzB,4BAAA,MAAA;AAAKmB,IAAAA,IAAI,EAAC;AAAWF,IAAAA,SAAS,EAAC;AAAiBd,IAAAA,GAAG,EAAES;GAArD,EACKL,QADL,CAfJ,CADJ;AAqBH,CAjCwB;;;;"}
|
@@ -1,20 +1,16 @@
|
|
1
1
|
import React__default from 'react';
|
2
2
|
import { Table } from './Table.js';
|
3
3
|
|
4
|
-
|
4
|
+
const PaginatedTable = /*#__PURE__*/React__default.forwardRef(function PaginatedTable(props, ref) {
|
5
5
|
return React__default.createElement(Table, Object.assign({}, props, {
|
6
6
|
disablePagination: false,
|
7
7
|
ref: ref
|
8
8
|
}));
|
9
9
|
});
|
10
10
|
|
11
|
-
PaginatedTable.Column =
|
12
|
-
return null;
|
13
|
-
};
|
11
|
+
PaginatedTable.Column = () => null;
|
14
12
|
|
15
|
-
PaginatedTable.Group =
|
16
|
-
return null;
|
17
|
-
};
|
13
|
+
PaginatedTable.Group = () => null;
|
18
14
|
|
19
15
|
export { PaginatedTable };
|
20
16
|
//# sourceMappingURL=PaginatedTable.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PaginatedTable.js","sources":["../../../../../src/components/Table/components/PaginatedTable.tsx"],"sourcesContent":["import React from 'react';\nimport { ForwardedGenericTableWithStatics, TableProps, TableRef } from '../types';\nimport { Table } from './Table';\n\nexport const PaginatedTable = React.forwardRef(function PaginatedTable<T>(props: TableProps<T>, ref: React.Ref<TableRef>) {\n return <Table {...props} disablePagination={false} ref={ref} />;\n}) as ForwardedGenericTableWithStatics;\n\nPaginatedTable.Column = () => null;\nPaginatedTable.Group = () => null;\n"],"names":["PaginatedTable","React","forwardRef","props","ref","Table","disablePagination","Column","Group"],"mappings":";;;
|
1
|
+
{"version":3,"file":"PaginatedTable.js","sources":["../../../../../src/components/Table/components/PaginatedTable.tsx"],"sourcesContent":["import React from 'react';\r\nimport { ForwardedGenericTableWithStatics, TableProps, TableRef } from '../types';\r\nimport { Table } from './Table';\r\n\r\nexport const PaginatedTable = React.forwardRef(function PaginatedTable<T>(props: TableProps<T>, ref: React.Ref<TableRef>) {\r\n return <Table {...props} disablePagination={false} ref={ref} />;\r\n}) as ForwardedGenericTableWithStatics;\r\n\r\nPaginatedTable.Column = () => null;\r\nPaginatedTable.Group = () => null;\r\n"],"names":["PaginatedTable","React","forwardRef","props","ref","Table","disablePagination","Column","Group"],"mappings":";;;MAIaA,cAAc,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,cAAT,CAA2BG,KAA3B,EAAiDC,GAAjD;AAC3C,SAAOH,4BAAA,CAACI,KAAD,oBAAWF;AAAOG,IAAAA,iBAAiB,EAAE;AAAOF,IAAAA,GAAG,EAAEA;IAAjD,CAAP;AACH,CAF6B;;AAI9BJ,cAAc,CAACO,MAAf,GAAwB,MAAM,IAA9B;;AACAP,cAAc,CAACQ,KAAf,GAAuB,MAAM,IAA7B;;;;"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
1
|
import React__default from 'react';
|
3
2
|
import { useProxiedRef } from '../../../utils/hooks/useProxiedRef.js';
|
4
3
|
import { Pagination } from '../../Pagination/Pagination.js';
|
@@ -6,23 +5,21 @@ import { useTable } from '../hooks/useTable.js';
|
|
6
5
|
import { Row } from '../util/renderRow.js';
|
7
6
|
import { BaseTable, DefaultEmptyState } from './BaseTable.js';
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
var paginationElement;
|
8
|
+
const Table = /*#__PURE__*/React__default.forwardRef(function Table(props, ref) {
|
9
|
+
const {
|
10
|
+
emptyStateRenderer = DefaultEmptyState,
|
11
|
+
...otherProps
|
12
|
+
} = props;
|
13
|
+
const tableRef = useProxiedRef(ref);
|
14
|
+
const {
|
15
|
+
rowProps,
|
16
|
+
tableProps,
|
17
|
+
rows,
|
18
|
+
prepareRow,
|
19
|
+
pagination,
|
20
|
+
instance
|
21
|
+
} = useTable(otherProps, tableRef);
|
22
|
+
let paginationElement;
|
26
23
|
|
27
24
|
if (pagination) {
|
28
25
|
paginationElement = React__default.createElement(Pagination, {
|
@@ -39,7 +36,7 @@ var Table = /*#__PURE__*/React__default.forwardRef(function Table(props, ref) {
|
|
39
36
|
|
40
37
|
return React__default.createElement(React__default.Fragment, null, paginationElement, React__default.createElement(BaseTable, Object.assign({}, tableProps, {
|
41
38
|
ref: tableRef
|
42
|
-
}), rows.length ? rows.map(
|
39
|
+
}), rows.length ? rows.map((row, index) => {
|
43
40
|
prepareRow(row, index);
|
44
41
|
return React__default.createElement(Row, Object.assign({}, rowProps, {
|
45
42
|
key: index,
|
@@ -51,13 +48,9 @@ var Table = /*#__PURE__*/React__default.forwardRef(function Table(props, ref) {
|
|
51
48
|
}) : emptyStateRenderer()), paginationElement);
|
52
49
|
});
|
53
50
|
|
54
|
-
Table.Column =
|
55
|
-
return null;
|
56
|
-
};
|
51
|
+
Table.Column = () => null;
|
57
52
|
|
58
|
-
Table.Group =
|
59
|
-
return null;
|
60
|
-
};
|
53
|
+
Table.Group = () => null;
|
61
54
|
|
62
55
|
export { Table };
|
63
56
|
//# sourceMappingURL=Table.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Table.js","sources":["../../../../../src/components/Table/components/Table.tsx"],"sourcesContent":["import React from 'react';\nimport { PluginHook } from 'react-table';\nimport { TableProps, InternalTableRow, ForwardedGenericTableWithStatics, TableRef } from '../types';\nimport { useTable } from '../hooks/useTable';\nimport { Pagination } from '../../Pagination/Pagination';\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\nimport { Row } from '../util/renderRow';\nimport { DefaultEmptyState, BaseTable } from './BaseTable';\n\nexport const Table = React.forwardRef(function Table<T>(\n props: TableProps<T> & { plugins: PluginHook<{}>[] },\n ref: React.Ref<TableRef>\n) {\n const { emptyStateRenderer = DefaultEmptyState, ...otherProps } = props;\n const tableRef: any = useProxiedRef<HTMLDivElement>(ref);\n const { rowProps, tableProps, rows, prepareRow, pagination, instance } = useTable(otherProps, tableRef);\n\n let paginationElement;\n\n if (pagination) {\n paginationElement = (\n <Pagination\n className=\"my-4 w-full\"\n length={pagination.length}\n pageIndex={pagination.pageIndex}\n pageSize={pagination.pageSize}\n setPageIndex={pagination.setPageIndex}\n setPageSize={pagination.setPageSize}\n showPageControls={pagination.length > pagination.pageSize}\n dangerouslyHijackGlobalKeyboardNavigation={props.dangerouslyHijackGlobalKeyboardNavigation}\n />\n );\n }\n\n return (\n <>\n {paginationElement}\n <BaseTable {...tableProps} ref={tableRef}>\n {rows.length\n ? rows.map((row: InternalTableRow, index: number) => {\n prepareRow(row, index);\n return (\n <Row\n {...rowProps}\n key={index}\n index={index}\n row={row}\n instance={instance}\n headerGroups={tableProps.headerGroups}\n />\n );\n })\n : emptyStateRenderer()}\n </BaseTable>\n {paginationElement}\n </>\n );\n}) as ForwardedGenericTableWithStatics;\n\nTable.Column = () => null;\nTable.Group = () => null;\n"],"names":["Table","React","forwardRef","props","ref","emptyStateRenderer","DefaultEmptyState","otherProps","tableRef","useProxiedRef","
|
1
|
+
{"version":3,"file":"Table.js","sources":["../../../../../src/components/Table/components/Table.tsx"],"sourcesContent":["import React from 'react';\r\nimport { PluginHook } from 'react-table';\r\nimport { TableProps, InternalTableRow, ForwardedGenericTableWithStatics, TableRef } from '../types';\r\nimport { useTable } from '../hooks/useTable';\r\nimport { Pagination } from '../../Pagination/Pagination';\r\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\r\nimport { Row } from '../util/renderRow';\r\nimport { DefaultEmptyState, BaseTable } from './BaseTable';\r\n\r\nexport const Table = React.forwardRef(function Table<T>(\r\n props: TableProps<T> & { plugins: PluginHook<{}>[] },\r\n ref: React.Ref<TableRef>\r\n) {\r\n const { emptyStateRenderer = DefaultEmptyState, ...otherProps } = props;\r\n const tableRef: any = useProxiedRef<HTMLDivElement>(ref);\r\n const { rowProps, tableProps, rows, prepareRow, pagination, instance } = useTable(otherProps, tableRef);\r\n\r\n let paginationElement;\r\n\r\n if (pagination) {\r\n paginationElement = (\r\n <Pagination\r\n className=\"my-4 w-full\"\r\n length={pagination.length}\r\n pageIndex={pagination.pageIndex}\r\n pageSize={pagination.pageSize}\r\n setPageIndex={pagination.setPageIndex}\r\n setPageSize={pagination.setPageSize}\r\n showPageControls={pagination.length > pagination.pageSize}\r\n dangerouslyHijackGlobalKeyboardNavigation={props.dangerouslyHijackGlobalKeyboardNavigation}\r\n />\r\n );\r\n }\r\n\r\n return (\r\n <>\r\n {paginationElement}\r\n <BaseTable {...tableProps} ref={tableRef}>\r\n {rows.length\r\n ? rows.map((row: InternalTableRow, index: number) => {\r\n prepareRow(row, index);\r\n return (\r\n <Row\r\n {...rowProps}\r\n key={index}\r\n index={index}\r\n row={row}\r\n instance={instance}\r\n headerGroups={tableProps.headerGroups}\r\n />\r\n );\r\n })\r\n : emptyStateRenderer()}\r\n </BaseTable>\r\n {paginationElement}\r\n </>\r\n );\r\n}) as ForwardedGenericTableWithStatics;\r\n\r\nTable.Column = () => null;\r\nTable.Group = () => null;\r\n"],"names":["Table","React","forwardRef","props","ref","emptyStateRenderer","DefaultEmptyState","otherProps","tableRef","useProxiedRef","rowProps","tableProps","rows","prepareRow","pagination","instance","useTable","paginationElement","Pagination","className","length","pageIndex","pageSize","setPageIndex","setPageSize","showPageControls","dangerouslyHijackGlobalKeyboardNavigation","BaseTable","map","row","index","Row","key","headerGroups","Column","Group"],"mappings":";;;;;;;MASaA,KAAK,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,KAAT,CAClCG,KADkC,EAElCC,GAFkC;AAIlC,QAAM;AAAEC,IAAAA,kBAAkB,GAAGC,iBAAvB;AAA0C,OAAGC;AAA7C,MAA4DJ,KAAlE;AACA,QAAMK,QAAQ,GAAQC,aAAa,CAAiBL,GAAjB,CAAnC;AACA,QAAM;AAAEM,IAAAA,QAAF;AAAYC,IAAAA,UAAZ;AAAwBC,IAAAA,IAAxB;AAA8BC,IAAAA,UAA9B;AAA0CC,IAAAA,UAA1C;AAAsDC,IAAAA;AAAtD,MAAmEC,QAAQ,CAACT,UAAD,EAAaC,QAAb,CAAjF;AAEA,MAAIS,iBAAJ;;AAEA,MAAIH,UAAJ,EAAgB;AACZG,IAAAA,iBAAiB,GACbhB,4BAAA,CAACiB,UAAD;AACIC,MAAAA,SAAS,EAAC;AACVC,MAAAA,MAAM,EAAEN,UAAU,CAACM;AACnBC,MAAAA,SAAS,EAAEP,UAAU,CAACO;AACtBC,MAAAA,QAAQ,EAAER,UAAU,CAACQ;AACrBC,MAAAA,YAAY,EAAET,UAAU,CAACS;AACzBC,MAAAA,WAAW,EAAEV,UAAU,CAACU;AACxBC,MAAAA,gBAAgB,EAAEX,UAAU,CAACM,MAAX,GAAoBN,UAAU,CAACQ;AACjDI,MAAAA,yCAAyC,EAAEvB,KAAK,CAACuB;KARrD,CADJ;AAYH;;AAED,SACIzB,4BAAA,wBAAA,MAAA,EACKgB,iBADL,EAEIhB,4BAAA,CAAC0B,SAAD,oBAAehB;AAAYP,IAAAA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