@economic/taco 0.0.11-alpha.0 → 0.0.14-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/{Label/Label.d.ts → Field/Field.d.ts} +9 -9
- 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 +49 -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 +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/{Label/Label.js → Field/Field.js} +3 -3
- package/dist/esm/components/Field/Field.js.map +1 -0
- 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/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.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 +27 -30
- 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 +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 +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 +63 -82
- 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 +634 -638
- package/dist/esm/index.js +2 -2
- 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 +634 -638
- package/dist/index.d.ts +1 -1
- package/dist/taco.cjs.development.js +1624 -1906
- 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 +2 -2
- package/plugins/tailwindcss-aria-attributes.js +73 -73
- package/tailwind.config.js +297 -297
- package/types.json +443 -443
- package/dist/esm/components/Label/Label.js.map +0 -1
@@ -1,78 +1,73 @@
|
|
1
|
-
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
1
|
import React__default from 'react';
|
3
2
|
import cn from 'classnames';
|
4
3
|
import { sanitizeRowProps } from '../util.js';
|
5
4
|
import { FocusScope } from '@react-aria/focus';
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
var renderCell = function renderCell(cell, row) {
|
10
|
-
var props = _extends({}, cell.getCellProps(), {
|
6
|
+
const renderCell = (cell, row) => {
|
7
|
+
const props = { ...cell.getCellProps(),
|
11
8
|
className: cn('yt-table__cell flex-1 truncate p-2 align-middle', cell.column.className, {
|
12
9
|
'justify-start text-left': cell.column.align === 'left',
|
13
10
|
'justify-end text-right': cell.column.align === 'right',
|
14
11
|
'text-center': !cell.column.align
|
15
12
|
}),
|
16
|
-
style:
|
13
|
+
style: { ...cell.column.style,
|
17
14
|
flex: typeof cell.column.flex === 'function' ? cell.column.flex(row) : cell.column.flex
|
18
|
-
}
|
19
|
-
}
|
20
|
-
|
15
|
+
}
|
16
|
+
};
|
21
17
|
return React__default.createElement("div", Object.assign({}, props, {
|
22
18
|
role: "gridcell",
|
23
19
|
"data-taco": "table-cell"
|
24
20
|
}), cell.render('Cell') || null);
|
25
21
|
};
|
26
22
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
23
|
+
const Row = /*#__PURE__*/React__default.forwardRef(({
|
24
|
+
row,
|
25
|
+
index,
|
26
|
+
instance,
|
27
|
+
headerGroups,
|
28
|
+
...rowProps
|
29
|
+
}, ref) => {
|
30
|
+
const {
|
31
|
+
activeIndex,
|
32
|
+
onRowClick,
|
33
|
+
rowClassName,
|
34
|
+
rowExpansionRenderer,
|
35
|
+
rowHeight,
|
36
|
+
setActiveIndex,
|
37
|
+
style,
|
38
|
+
inlineEditingUniqueId
|
39
|
+
} = rowProps;
|
40
|
+
const sanitizedRow = sanitizeRowProps(row, rowExpansionRenderer);
|
41
|
+
const props = { ...row.getRowProps(),
|
42
|
+
style: { ...style,
|
43
|
+
minHeight: rowHeight ? `${rowHeight}px` : undefined,
|
44
|
+
paddingLeft: row.depth ? `${row.depth * 2}rem` : undefined
|
45
|
+
},
|
48
46
|
className: cn('yt-table__row border-grey-light flex border-b min-h-[2.5rem] hover:bg-grey-light', {
|
49
47
|
'yt-table__row--active bg-grey-light hover:bg-grey-light': activeIndex === index,
|
50
48
|
'yt-table__row--clickable': !!onRowClick,
|
51
49
|
'yt-table__row--dragging': !!row.isDragging,
|
52
50
|
'yt-table__row--editing': !!row.isEditing
|
53
51
|
}, typeof rowClassName === 'function' ? rowClassName(sanitizedRow) : rowClassName),
|
54
|
-
onClick: onRowClick ?
|
52
|
+
onClick: onRowClick ? event => {
|
55
53
|
if (event.target === event.currentTarget || event.target.classList.contains('yt-table__cell')) {
|
56
54
|
event.preventDefault();
|
57
55
|
event.persist();
|
58
56
|
setActiveIndex(index);
|
59
57
|
onRowClick(sanitizedRow);
|
60
58
|
}
|
61
|
-
} :
|
59
|
+
} : () => {
|
62
60
|
setActiveIndex(index);
|
63
61
|
}
|
64
|
-
}
|
65
|
-
|
66
|
-
var cells = row.cells;
|
62
|
+
};
|
63
|
+
let cells = row.cells;
|
67
64
|
|
68
65
|
if (row.depth > 0) {
|
69
|
-
cells = row.cells.filter(
|
70
|
-
return !cell.column.hiddenOnSubRows;
|
71
|
-
});
|
66
|
+
cells = row.cells.filter(cell => !cell.column.hiddenOnSubRows);
|
72
67
|
}
|
73
68
|
|
74
|
-
|
75
|
-
|
69
|
+
const expandedRow = rowExpansionRenderer && row.isExpanded && React__default.createElement("div", null, rowExpansionRenderer(sanitizedRow, instance));
|
70
|
+
const rowContent = React__default.useMemo(() => {
|
76
71
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement(FocusScope, {
|
77
72
|
key: row.original._createKey,
|
78
73
|
contain: true,
|
@@ -89,9 +84,7 @@ var Row = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
89
84
|
type: "hidden",
|
90
85
|
name: "_inlineEditingUniqueId",
|
91
86
|
value: row.original[inlineEditingUniqueId]
|
92
|
-
}), cells.map(
|
93
|
-
return renderCell(cell, sanitizedRow);
|
94
|
-
}))), expandedRow);
|
87
|
+
}), cells.map(cell => renderCell(cell, sanitizedRow)))), expandedRow);
|
95
88
|
}, [row.original._createKey]);
|
96
89
|
|
97
90
|
if (row.isEditing) {
|
@@ -101,9 +94,7 @@ var Row = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
101
94
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", Object.assign({}, props, {
|
102
95
|
role: "row",
|
103
96
|
ref: ref
|
104
|
-
}), cells.map(
|
105
|
-
return renderCell(cell, sanitizedRow);
|
106
|
-
})), expandedRow);
|
97
|
+
}), cells.map(cell => renderCell(cell, sanitizedRow))), expandedRow);
|
107
98
|
});
|
108
99
|
|
109
100
|
export { Row };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderRow.js","sources":["../../../../../src/components/Table/util/renderRow.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { FocusScope } from '@react-aria/focus';\nimport { InternalTableCell, TableRow } from '../types';\nimport { sanitizeRowProps } from '../util';\n\nconst renderCell = (cell: InternalTableCell, row: TableRow<any>): JSX.Element => {\n const props = {\n ...cell.getCellProps(),\n className: cn('yt-table__cell flex-1 truncate p-2 align-middle', cell.column.className, {\n 'justify-start text-left': cell.column.align === 'left',\n 'justify-end text-right': cell.column.align === 'right',\n 'text-center': !cell.column.align,\n }),\n style: {\n ...cell.column.style,\n flex: typeof cell.column.flex === 'function' ? cell.column.flex(row) : cell.column.flex,\n },\n };\n return (\n <div {...props} role=\"gridcell\" data-taco=\"table-cell\">\n {cell.render('Cell') || null}\n </div>\n );\n};\n\nexport const Row = React.forwardRef(({ row, index, instance, headerGroups, ...rowProps }: any, ref: any): JSX.Element => {\n const {\n activeIndex,\n onRowClick,\n rowClassName,\n rowExpansionRenderer,\n rowHeight,\n setActiveIndex,\n style,\n inlineEditingUniqueId,\n } = rowProps;\n const sanitizedRow = sanitizeRowProps(row, rowExpansionRenderer);\n\n const props = {\n ...row.getRowProps(),\n style: {\n ...style,\n minHeight: rowHeight ? `${rowHeight}px` : undefined,\n paddingLeft: row.depth ? `${row.depth * 2}rem` : undefined,\n },\n className: cn(\n 'yt-table__row border-grey-light flex border-b min-h-[2.5rem] hover:bg-grey-light',\n {\n 'yt-table__row--active bg-grey-light hover:bg-grey-light': activeIndex === index,\n 'yt-table__row--clickable': !!onRowClick,\n 'yt-table__row--dragging': !!row.isDragging,\n 'yt-table__row--editing': !!row.isEditing,\n },\n typeof rowClassName === 'function' ? rowClassName(sanitizedRow) : rowClassName\n ),\n onClick: onRowClick\n ? (event: React.MouseEvent<HTMLElement>) => {\n if (\n event.target === event.currentTarget ||\n (event.target as HTMLElement).classList.contains('yt-table__cell')\n ) {\n event.preventDefault();\n event.persist();\n setActiveIndex(index);\n onRowClick(sanitizedRow);\n }\n }\n : () => {\n setActiveIndex(index);\n },\n };\n\n let cells = row.cells;\n\n if (row.depth > 0) {\n cells = row.cells.filter((cell: any) => !cell.column.hiddenOnSubRows);\n }\n\n const expandedRow = rowExpansionRenderer && row.isExpanded && <div>{rowExpansionRenderer(sanitizedRow, instance)}</div>;\n const rowContent = React.useMemo(() => {\n return (\n <>\n <FocusScope key={row.original._createKey} contain restoreFocus autoFocus>\n <div {...props} role=\"row\" ref={ref}>\n <input type=\"hidden\" name=\"_rowIndexPath\" value={row.id} />\n <input type=\"hidden\" name=\"_inlineEditingUniqueId\" value={row.original[inlineEditingUniqueId]} />\n {cells.map((cell: InternalTableCell) => renderCell(cell, sanitizedRow))}\n </div>\n </FocusScope>\n {expandedRow}\n </>\n );\n }, [row.original._createKey]);\n\n if (row.isEditing) {\n return rowContent;\n }\n\n return (\n <>\n <div {...props} role=\"row\" ref={ref}>\n {cells.map((cell: InternalTableCell) => renderCell(cell, sanitizedRow))}\n </div>\n {expandedRow}\n </>\n );\n});\n"],"names":["renderCell","cell","row","props","getCellProps","className","cn","column","align","style","flex","React","role","render","Row","forwardRef","
|
1
|
+
{"version":3,"file":"renderRow.js","sources":["../../../../../src/components/Table/util/renderRow.tsx"],"sourcesContent":["import React from 'react';\r\nimport cn from 'classnames';\r\nimport { FocusScope } from '@react-aria/focus';\r\nimport { InternalTableCell, TableRow } from '../types';\r\nimport { sanitizeRowProps } from '../util';\r\n\r\nconst renderCell = (cell: InternalTableCell, row: TableRow<any>): JSX.Element => {\r\n const props = {\r\n ...cell.getCellProps(),\r\n className: cn('yt-table__cell flex-1 truncate p-2 align-middle', cell.column.className, {\r\n 'justify-start text-left': cell.column.align === 'left',\r\n 'justify-end text-right': cell.column.align === 'right',\r\n 'text-center': !cell.column.align,\r\n }),\r\n style: {\r\n ...cell.column.style,\r\n flex: typeof cell.column.flex === 'function' ? cell.column.flex(row) : cell.column.flex,\r\n },\r\n };\r\n return (\r\n <div {...props} role=\"gridcell\" data-taco=\"table-cell\">\r\n {cell.render('Cell') || null}\r\n </div>\r\n );\r\n};\r\n\r\nexport const Row = React.forwardRef(({ row, index, instance, headerGroups, ...rowProps }: any, ref: any): JSX.Element => {\r\n const {\r\n activeIndex,\r\n onRowClick,\r\n rowClassName,\r\n rowExpansionRenderer,\r\n rowHeight,\r\n setActiveIndex,\r\n style,\r\n inlineEditingUniqueId,\r\n } = rowProps;\r\n const sanitizedRow = sanitizeRowProps(row, rowExpansionRenderer);\r\n\r\n const props = {\r\n ...row.getRowProps(),\r\n style: {\r\n ...style,\r\n minHeight: rowHeight ? `${rowHeight}px` : undefined,\r\n paddingLeft: row.depth ? `${row.depth * 2}rem` : undefined,\r\n },\r\n className: cn(\r\n 'yt-table__row border-grey-light flex border-b min-h-[2.5rem] hover:bg-grey-light',\r\n {\r\n 'yt-table__row--active bg-grey-light hover:bg-grey-light': activeIndex === index,\r\n 'yt-table__row--clickable': !!onRowClick,\r\n 'yt-table__row--dragging': !!row.isDragging,\r\n 'yt-table__row--editing': !!row.isEditing,\r\n },\r\n typeof rowClassName === 'function' ? rowClassName(sanitizedRow) : rowClassName\r\n ),\r\n onClick: onRowClick\r\n ? (event: React.MouseEvent<HTMLElement>) => {\r\n if (\r\n event.target === event.currentTarget ||\r\n (event.target as HTMLElement).classList.contains('yt-table__cell')\r\n ) {\r\n event.preventDefault();\r\n event.persist();\r\n setActiveIndex(index);\r\n onRowClick(sanitizedRow);\r\n }\r\n }\r\n : () => {\r\n setActiveIndex(index);\r\n },\r\n };\r\n\r\n let cells = row.cells;\r\n\r\n if (row.depth > 0) {\r\n cells = row.cells.filter((cell: any) => !cell.column.hiddenOnSubRows);\r\n }\r\n\r\n const expandedRow = rowExpansionRenderer && row.isExpanded && <div>{rowExpansionRenderer(sanitizedRow, instance)}</div>;\r\n const rowContent = React.useMemo(() => {\r\n return (\r\n <>\r\n <FocusScope key={row.original._createKey} contain restoreFocus autoFocus>\r\n <div {...props} role=\"row\" ref={ref}>\r\n <input type=\"hidden\" name=\"_rowIndexPath\" value={row.id} />\r\n <input type=\"hidden\" name=\"_inlineEditingUniqueId\" value={row.original[inlineEditingUniqueId]} />\r\n {cells.map((cell: InternalTableCell) => renderCell(cell, sanitizedRow))}\r\n </div>\r\n </FocusScope>\r\n {expandedRow}\r\n </>\r\n );\r\n }, [row.original._createKey]);\r\n\r\n if (row.isEditing) {\r\n return rowContent;\r\n }\r\n\r\n return (\r\n <>\r\n <div {...props} role=\"row\" ref={ref}>\r\n {cells.map((cell: InternalTableCell) => renderCell(cell, sanitizedRow))}\r\n </div>\r\n {expandedRow}\r\n </>\r\n );\r\n});\r\n"],"names":["renderCell","cell","row","props","getCellProps","className","cn","column","align","style","flex","React","role","render","Row","forwardRef","index","instance","headerGroups","rowProps","ref","activeIndex","onRowClick","rowClassName","rowExpansionRenderer","rowHeight","setActiveIndex","inlineEditingUniqueId","sanitizedRow","sanitizeRowProps","getRowProps","minHeight","undefined","paddingLeft","depth","isDragging","isEditing","onClick","event","target","currentTarget","classList","contains","preventDefault","persist","cells","filter","hiddenOnSubRows","expandedRow","isExpanded","rowContent","useMemo","FocusScope","key","original","_createKey","contain","restoreFocus","autoFocus","type","name","value","id","map"],"mappings":";;;;;AAMA,MAAMA,UAAU,GAAG,CAACC,IAAD,EAA0BC,GAA1B;AACf,QAAMC,KAAK,GAAG,EACV,GAAGF,IAAI,CAACG,YAAL,EADO;AAEVC,IAAAA,SAAS,EAAEC,EAAE,CAAC,iDAAD,EAAoDL,IAAI,CAACM,MAAL,CAAYF,SAAhE,EAA2E;AACpF,iCAA2BJ,IAAI,CAACM,MAAL,CAAYC,KAAZ,KAAsB,MADmC;AAEpF,gCAA0BP,IAAI,CAACM,MAAL,CAAYC,KAAZ,KA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AG,CAACoD,QAAJ,CAAaC;AAAYC,MAAAA,OAAO;AAACC,MAAAA,YAAY;AAACC,MAAAA,SAAS;KAAxE,EACI/C,4BAAA,MAAA,oBAASR;AAAOS,MAAAA,IAAI,EAAC;AAAMQ,MAAAA,GAAG,EAAEA;MAAhC,EACIT,4BAAA,QAAA;AAAOgD,MAAAA,IAAI,EAAC;AAASC,MAAAA,IAAI,EAAC;AAAgBC,MAAAA,KAAK,EAAE3D,GAAG,CAAC4D;KAArD,CADJ,EAEInD,4BAAA,QAAA;AAAOgD,MAAAA,IAAI,EAAC;AAASC,MAAAA,IAAI,EAAC;AAAyBC,MAAAA,KAAK,EAAE3D,GAAG,CAACoD,QAAJ,CAAa3B,qBAAb;KAA1D,CAFJ,EAGKkB,KAAK,CAACkB,GAAN,CAAW9D,IAAD,IAA6BD,UAAU,CAACC,IAAD,EAAO2B,YAAP,CAAjD,CAHL,CADJ,CADJ,EAQKoB,WARL,CADJ;AAYH,GAbkB,EAahB,CAAC9C,GAAG,CAACoD,QAAJ,CAAaC,UAAd,CAbgB,CAAnB;;AAeA,MAAIrD,GAAG,CAACkC,SAAR,EAAmB;AACf,WAAOc,UAAP;AACH;;AAED,SACIvC,4BAAA,wBAAA,MAAA,EACIA,4BAAA,MAAA,oBAASR;AAAOS,IAAAA,IAAI,EAAC;AAAMQ,IAAAA,GAAG,EAAEA;IAAhC,EACKyB,KAAK,CAACkB,GAAN,CAAW9D,IAAD,IAA6BD,UAAU,CAACC,IAAD,EAAO2B,YAAP,CAAjD,CADL,CADJ,EAIKoB,WAJL,CADJ;AAQH,CAjFkB;;;;"}
|
@@ -1,21 +1,21 @@
|
|
1
1
|
import set from 'lodash-es/set';
|
2
2
|
|
3
|
-
|
3
|
+
const convertRowIndexPathToNumberArray = rowIndexPath => {
|
4
4
|
var _rowIndexPath$split$m;
|
5
5
|
|
6
6
|
return (_rowIndexPath$split$m = rowIndexPath === null || rowIndexPath === void 0 ? void 0 : rowIndexPath.split('.').map(Number)) !== null && _rowIndexPath$split$m !== void 0 ? _rowIndexPath$split$m : [];
|
7
7
|
};
|
8
|
-
|
8
|
+
const getByRowIndexPath = (data, rowIndexPath) => {
|
9
9
|
if (!rowIndexPath) {
|
10
10
|
return undefined;
|
11
11
|
}
|
12
12
|
|
13
|
-
|
14
|
-
|
13
|
+
const currenTRow = [...data];
|
14
|
+
const indexes = convertRowIndexPathToNumberArray(String(rowIndexPath));
|
15
15
|
|
16
16
|
if (indexes.length) {
|
17
|
-
|
18
|
-
return indexes.reduce(
|
17
|
+
const startIndex = indexes.shift();
|
18
|
+
return indexes.reduce((value, index) => {
|
19
19
|
var _value$subRows;
|
20
20
|
|
21
21
|
return value === null || value === void 0 ? void 0 : (_value$subRows = value.subRows) === null || _value$subRows === void 0 ? void 0 : _value$subRows[index];
|
@@ -24,15 +24,13 @@ var getByRowIndexPath = function getByRowIndexPath(data, rowIndexPath) {
|
|
24
24
|
|
25
25
|
return undefined;
|
26
26
|
};
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
const setByRowIndexPath = (data, rowIndexPath, values) => {
|
28
|
+
const nexTRow = [...data];
|
29
|
+
const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);
|
30
|
+
const rootIndex = rowIndexes.shift();
|
31
31
|
|
32
32
|
if (rowIndexes.length) {
|
33
|
-
|
34
|
-
return "subRows[" + index + "]";
|
35
|
-
}).join('.');
|
33
|
+
const path = rowIndexes.map(index => `subRows[${index}]`).join('.');
|
36
34
|
set(nexTRow[rootIndex], path, values);
|
37
35
|
} else {
|
38
36
|
nexTRow[rootIndex] = values;
|
@@ -40,11 +38,11 @@ var setByRowIndexPath = function setByRowIndexPath(data, rowIndexPath, values) {
|
|
40
38
|
|
41
39
|
return nexTRow;
|
42
40
|
};
|
43
|
-
|
44
|
-
|
41
|
+
const getParentRowIndexPath = rowIndexPath => {
|
42
|
+
let parentIndexPath;
|
45
43
|
|
46
44
|
if (rowIndexPath) {
|
47
|
-
|
45
|
+
const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);
|
48
46
|
rowIndexes.pop();
|
49
47
|
|
50
48
|
if (rowIndexes.length) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"rowIndexPath.js","sources":["../../../../../src/components/Table/util/rowIndexPath.ts"],"sourcesContent":["import set from 'lodash/set';\nimport { Row, RowIndexPath } from '../types';\n\nexport const convertRowIndexPathToNumberArray = (rowIndexPath: RowIndexPath): number[] =>\n rowIndexPath?.split('.').map(Number) ?? [];\n\nexport const getByRowIndexPath = <TRow>(data: Row<TRow>[], rowIndexPath: RowIndexPath): Row<TRow> | undefined => {\n if (!rowIndexPath) {\n return undefined;\n }\n\n const currenTRow = [...data];\n const indexes = convertRowIndexPathToNumberArray(String(rowIndexPath));\n\n if (indexes.length) {\n const startIndex = indexes.shift() as number;\n return indexes.reduce((value, index) => value?.subRows?.[index], currenTRow[startIndex]);\n }\n\n return undefined;\n};\n\nexport const setByRowIndexPath = <TRow>(data: Row<TRow>[], rowIndexPath: RowIndexPath, values: any): Row<TRow>[] => {\n const nexTRow = [...data];\n\n const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);\n const rootIndex = rowIndexes.shift() as number;\n\n if (rowIndexes.length) {\n const path = rowIndexes.map(index => `subRows[${index}]`).join('.');\n set(nexTRow[rootIndex], path, values);\n } else {\n nexTRow[rootIndex] = values;\n }\n\n return nexTRow;\n};\n\nexport const getParentRowIndexPath = (rowIndexPath: RowIndexPath): RowIndexPath => {\n let parentIndexPath;\n\n if (rowIndexPath) {\n const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);\n rowIndexes.pop();\n\n if (rowIndexes.length) {\n parentIndexPath = rowIndexes.join('.');\n }\n }\n\n return parentIndexPath;\n};\n"],"names":["convertRowIndexPathToNumberArray","rowIndexPath","split","map","Number","getByRowIndexPath","data","undefined","currenTRow","indexes","String","length","startIndex","shift","reduce","value","index","subRows","setByRowIndexPath","values","nexTRow","rowIndexes","rootIndex","path","join","set","getParentRowIndexPath","parentIndexPath","pop"],"mappings":";;
|
1
|
+
{"version":3,"file":"rowIndexPath.js","sources":["../../../../../src/components/Table/util/rowIndexPath.ts"],"sourcesContent":["import set from 'lodash/set';\r\nimport { Row, RowIndexPath } from '../types';\r\n\r\nexport const convertRowIndexPathToNumberArray = (rowIndexPath: RowIndexPath): number[] =>\r\n rowIndexPath?.split('.').map(Number) ?? [];\r\n\r\nexport const getByRowIndexPath = <TRow>(data: Row<TRow>[], rowIndexPath: RowIndexPath): Row<TRow> | undefined => {\r\n if (!rowIndexPath) {\r\n return undefined;\r\n }\r\n\r\n const currenTRow = [...data];\r\n const indexes = convertRowIndexPathToNumberArray(String(rowIndexPath));\r\n\r\n if (indexes.length) {\r\n const startIndex = indexes.shift() as number;\r\n return indexes.reduce((value, index) => value?.subRows?.[index], currenTRow[startIndex]);\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\nexport const setByRowIndexPath = <TRow>(data: Row<TRow>[], rowIndexPath: RowIndexPath, values: any): Row<TRow>[] => {\r\n const nexTRow = [...data];\r\n\r\n const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);\r\n const rootIndex = rowIndexes.shift() as number;\r\n\r\n if (rowIndexes.length) {\r\n const path = rowIndexes.map(index => `subRows[${index}]`).join('.');\r\n set(nexTRow[rootIndex], path, values);\r\n } else {\r\n nexTRow[rootIndex] = values;\r\n }\r\n\r\n return nexTRow;\r\n};\r\n\r\nexport const getParentRowIndexPath = (rowIndexPath: RowIndexPath): RowIndexPath => {\r\n let parentIndexPath;\r\n\r\n if (rowIndexPath) {\r\n const rowIndexes = convertRowIndexPathToNumberArray(rowIndexPath);\r\n rowIndexes.pop();\r\n\r\n if (rowIndexes.length) {\r\n parentIndexPath = rowIndexes.join('.');\r\n }\r\n }\r\n\r\n return parentIndexPath;\r\n};\r\n"],"names":["convertRowIndexPathToNumberArray","rowIndexPath","split","map","Number","getByRowIndexPath","data","undefined","currenTRow","indexes","String","length","startIndex","shift","reduce","value","index","subRows","setByRowIndexPath","values","nexTRow","rowIndexes","rootIndex","path","join","set","getParentRowIndexPath","parentIndexPath","pop"],"mappings":";;MAGaA,gCAAgC,GAAIC,YAAD;AAAA;;AAAA,kCAC5CA,YAD4C,aAC5CA,YAD4C,uBAC5CA,YAAY,CAAEC,KAAd,CAAoB,GAApB,EAAyBC,GAAzB,CAA6BC,MAA7B,CAD4C,yEACJ,EADI;AAAA;MAGnCC,iBAAiB,GAAG,CAAOC,IAAP,EAA0BL,YAA1B;AAC7B,MAAI,CAACA,YAAL,EAAmB;AACf,WAAOM,SAAP;AACH;;AAED,QAAMC,UAAU,GAAG,CAAC,GAAGF,IAAJ,CAAnB;AACA,QAAMG,OAAO,GAAGT,gCAAgC,CAACU,MAAM,CAACT,YAAD,CAAP,CAAhD;;AAEA,MAAIQ,OAAO,CAACE,MAAZ,EAAoB;AAChB,UAAMC,UAAU,GAAGH,OAAO,CAACI,KAAR,EAAnB;AACA,WAAOJ,OAAO,CAACK,MAAR,CAAe,CAACC,KAAD,EAAQC,KAAR;AAAA;;AAAA,aAAkBD,KAAlB,aAAkBA,KAAlB,yCAAkBA,KAAK,CAAEE,OAAzB,mDAAkB,eAAiBD,KAAjB,CAAlB;AAAA,KAAf,EAA0DR,UAAU,CAACI,UAAD,CAApE,CAAP;AACH;;AAED,SAAOL,SAAP;AACH;MAEYW,iBAAiB,GAAG,CAAOZ,IAAP,EAA0BL,YAA1B,EAAsDkB,MAAtD;AAC7B,QAAMC,OAAO,GAAG,CAAC,GAAGd,IAAJ,CAAhB;AAEA,QAAMe,UAAU,GAAGrB,gCAAgC,CAACC,YAAD,CAAnD;AACA,QAAMqB,SAAS,GAAGD,UAAU,CAACR,KAAX,EAAlB;;AAEA,MAAIQ,UAAU,CAACV,MAAf,EAAuB;AACnB,UAAMY,IAAI,GAAGF,UAAU,CAAClB,GAAX,CAAea,KAAK,eAAeA,QAAnC,EAA6CQ,IAA7C,CAAkD,GAAlD,CAAb;AACAC,IAAAA,GAAG,CAACL,OAAO,CAACE,SAAD,CAAR,EAAqBC,IAArB,EAA2BJ,MAA3B,CAAH;AACH,GAHD,MAGO;AACHC,IAAAA,OAAO,CAACE,SAAD,CAAP,GAAqBH,MAArB;AACH;;AAED,SAAOC,OAAP;AACH;MAEYM,qBAAqB,GAAIzB,YAAD;AACjC,MAAI0B,eAAJ;;AAEA,MAAI1B,YAAJ,EAAkB;AACd,UAAMoB,UAAU,GAAGrB,gCAAgC,CAACC,YAAD,CAAnD;AACAoB,IAAAA,UAAU,CAACO,GAAX;;AAEA,QAAIP,UAAU,CAACV,MAAf,EAAuB;AACnBgB,MAAAA,eAAe,GAAGN,UAAU,CAACG,IAAX,CAAgB,GAAhB,CAAlB;AACH;AACJ;;AAED,SAAOG,eAAP;AACH;;;;"}
|
@@ -1,17 +1,9 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
const getTime = value => {
|
2
|
+
const parsedValue = typeof value === 'string' ? new Date(value) : value;
|
3
3
|
return parsedValue !== null && parsedValue !== void 0 && parsedValue.getTime ? parsedValue.getTime() : undefined;
|
4
4
|
};
|
5
5
|
|
6
|
-
|
7
|
-
if (amount === void 0) {
|
8
|
-
amount = '';
|
9
|
-
}
|
10
|
-
|
11
|
-
if (decimalSeparator === void 0) {
|
12
|
-
decimalSeparator = ',';
|
13
|
-
}
|
14
|
-
|
6
|
+
const getNumber = (amount = '', decimalSeparator = ',') => {
|
15
7
|
if (typeof amount === 'number') {
|
16
8
|
return amount;
|
17
9
|
}
|
@@ -20,7 +12,7 @@ var getNumber = function getNumber(amount, decimalSeparator) {
|
|
20
12
|
return undefined;
|
21
13
|
}
|
22
14
|
|
23
|
-
|
15
|
+
let value;
|
24
16
|
|
25
17
|
if (decimalSeparator === ',') {
|
26
18
|
// replace digit seperator then replace decimal separator
|
@@ -33,7 +25,7 @@ var getNumber = function getNumber(amount, decimalSeparator) {
|
|
33
25
|
return Number.isNaN(value) ? undefined : value;
|
34
26
|
};
|
35
27
|
|
36
|
-
|
28
|
+
const getString = value => {
|
37
29
|
if (value) {
|
38
30
|
return String(value).toLowerCase();
|
39
31
|
}
|
@@ -41,7 +33,7 @@ var getString = function getString(value) {
|
|
41
33
|
return undefined;
|
42
34
|
};
|
43
35
|
|
44
|
-
|
36
|
+
const guess = value => {
|
45
37
|
if (typeof value === 'boolean') {
|
46
38
|
return !!value;
|
47
39
|
}
|
@@ -49,7 +41,7 @@ var guess = function guess(value) {
|
|
49
41
|
return isNaN(value) ? getString(value) : Number(value);
|
50
42
|
};
|
51
43
|
|
52
|
-
|
44
|
+
const compareBasic = (a, b) => {
|
53
45
|
// places undefined values first in ascending order instead of descending
|
54
46
|
if (a !== undefined && b === undefined) {
|
55
47
|
return 1;
|
@@ -58,30 +50,30 @@ var compareBasic = function compareBasic(a, b) {
|
|
58
50
|
return a === b ? 0 : a > b ? 1 : -1;
|
59
51
|
};
|
60
52
|
|
61
|
-
|
62
|
-
datetime:
|
63
|
-
|
64
|
-
|
53
|
+
const sortTypes = {
|
54
|
+
datetime: (rowA, rowB, columnId) => {
|
55
|
+
const a = getTime(rowA.values[columnId]);
|
56
|
+
const b = getTime(rowB.values[columnId]);
|
65
57
|
return compareBasic(a, b);
|
66
58
|
},
|
67
|
-
string:
|
68
|
-
|
69
|
-
|
59
|
+
string: (rowA, rowB, columnId) => {
|
60
|
+
const a = getString(rowA.values[columnId]);
|
61
|
+
const b = getString(rowB.values[columnId]);
|
70
62
|
return compareBasic(a, b);
|
71
63
|
},
|
72
|
-
number:
|
73
|
-
|
74
|
-
|
64
|
+
number: (rowA, rowB, columnId) => {
|
65
|
+
const a = getNumber(rowA.values[columnId]);
|
66
|
+
const b = getNumber(rowB.values[columnId]);
|
75
67
|
return compareBasic(a, b);
|
76
68
|
},
|
77
|
-
|
78
|
-
|
79
|
-
|
69
|
+
boolean: (rowA, rowB, columnId) => {
|
70
|
+
const a = !!rowA.values[columnId];
|
71
|
+
const b = !!rowB.values[columnId];
|
80
72
|
return compareBasic(a, b);
|
81
73
|
},
|
82
|
-
auto:
|
83
|
-
|
84
|
-
|
74
|
+
auto: (rowA, rowB, columnId) => {
|
75
|
+
const a = guess(rowA.values[columnId]);
|
76
|
+
const b = guess(rowB.values[columnId]);
|
85
77
|
return compareBasic(a, b);
|
86
78
|
}
|
87
79
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sortTypes.js","sources":["../../../../../src/components/Table/util/sortTypes.ts"],"sourcesContent":["import { SortTypes, TableRow } from '../types';\n\nconst getTime = (value: any): number | undefined => {\n const parsedValue: Date = typeof value === 'string' ? new Date(value) : value;\n return parsedValue?.getTime ? parsedValue.getTime() : undefined;\n};\n\nconst getNumber = (amount = '', decimalSeparator = ','): number | undefined => {\n if (typeof amount === 'number') {\n return amount;\n }\n\n if (amount === null || !amount.length) {\n return undefined;\n }\n\n let value;\n\n if (decimalSeparator === ',') {\n // replace digit seperator then replace decimal separator\n value = Number(amount.replace(/\\./g, '').replace(',', '.'));\n } else {\n // replace digit seperator\n value = Number(amount.replace(/,/g, ''));\n }\n\n return Number.isNaN(value) ? undefined : value;\n};\n\nconst getString = (value: any): string | undefined => {\n if (value) {\n return String(value).toLowerCase();\n }\n\n return undefined;\n};\n\nconst guess = (value: any): any => {\n if (typeof value === 'boolean') {\n return !!value;\n }\n\n return isNaN(value) ? getString(value) : Number(value);\n};\n\nconst compareBasic = (a: any, b: any) => {\n // places undefined values first in ascending order instead of descending\n if (a !== undefined && b === undefined) {\n return 1;\n }\n\n return a === b ? 0 : a > b ? 1 : -1;\n};\n\ntype SortHandler<T> = (rowA: TableRow<T>, rowB: TableRow<T>, columnId: string) => 0 | 1 | -1;\n\nexport const sortTypes: Record<SortTypes, SortHandler<any>> = {\n datetime: (rowA, rowB, columnId) => {\n const a = getTime(rowA.values[columnId]);\n const b = getTime(rowB.values[columnId]);\n return compareBasic(a, b);\n },\n string: (rowA, rowB, columnId) => {\n const a = getString(rowA.values[columnId]);\n const b = getString(rowB.values[columnId]);\n return compareBasic(a, b);\n },\n number: (rowA, rowB, columnId) => {\n const a = getNumber(rowA.values[columnId]);\n const b = getNumber(rowB.values[columnId]);\n return compareBasic(a, b);\n },\n boolean: (rowA, rowB, columnId) => {\n const a = !!rowA.values[columnId];\n const b = !!rowB.values[columnId];\n return compareBasic(a, b);\n },\n auto: (rowA, rowB, columnId) => {\n const a = guess(rowA.values[columnId]);\n const b = guess(rowB.values[columnId]);\n return compareBasic(a, b);\n },\n};\n"],"names":["getTime","value","parsedValue","Date","undefined","getNumber","amount","decimalSeparator","length","Number","replace","isNaN","getString","String","toLowerCase","guess","compareBasic","a","b","sortTypes","datetime","rowA","rowB","columnId","values","string","number","auto"],"mappings":"AAEA,
|
1
|
+
{"version":3,"file":"sortTypes.js","sources":["../../../../../src/components/Table/util/sortTypes.ts"],"sourcesContent":["import { SortTypes, TableRow } from '../types';\r\n\r\nconst getTime = (value: any): number | undefined => {\r\n const parsedValue: Date = typeof value === 'string' ? new Date(value) : value;\r\n return parsedValue?.getTime ? parsedValue.getTime() : undefined;\r\n};\r\n\r\nconst getNumber = (amount = '', decimalSeparator = ','): number | undefined => {\r\n if (typeof amount === 'number') {\r\n return amount;\r\n }\r\n\r\n if (amount === null || !amount.length) {\r\n return undefined;\r\n }\r\n\r\n let value;\r\n\r\n if (decimalSeparator === ',') {\r\n // replace digit seperator then replace decimal separator\r\n value = Number(amount.replace(/\\./g, '').replace(',', '.'));\r\n } else {\r\n // replace digit seperator\r\n value = Number(amount.replace(/,/g, ''));\r\n }\r\n\r\n return Number.isNaN(value) ? undefined : value;\r\n};\r\n\r\nconst getString = (value: any): string | undefined => {\r\n if (value) {\r\n return String(value).toLowerCase();\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\nconst guess = (value: any): any => {\r\n if (typeof value === 'boolean') {\r\n return !!value;\r\n }\r\n\r\n return isNaN(value) ? getString(value) : Number(value);\r\n};\r\n\r\nconst compareBasic = (a: any, b: any) => {\r\n // places undefined values first in ascending order instead of descending\r\n if (a !== undefined && b === undefined) {\r\n return 1;\r\n }\r\n\r\n return a === b ? 0 : a > b ? 1 : -1;\r\n};\r\n\r\ntype SortHandler<T> = (rowA: TableRow<T>, rowB: TableRow<T>, columnId: string) => 0 | 1 | -1;\r\n\r\nexport const sortTypes: Record<SortTypes, SortHandler<any>> = {\r\n datetime: (rowA, rowB, columnId) => {\r\n const a = getTime(rowA.values[columnId]);\r\n const b = getTime(rowB.values[columnId]);\r\n return compareBasic(a, b);\r\n },\r\n string: (rowA, rowB, columnId) => {\r\n const a = getString(rowA.values[columnId]);\r\n const b = getString(rowB.values[columnId]);\r\n return compareBasic(a, b);\r\n },\r\n number: (rowA, rowB, columnId) => {\r\n const a = getNumber(rowA.values[columnId]);\r\n const b = getNumber(rowB.values[columnId]);\r\n return compareBasic(a, b);\r\n },\r\n boolean: (rowA, rowB, columnId) => {\r\n const a = !!rowA.values[columnId];\r\n const b = !!rowB.values[columnId];\r\n return compareBasic(a, b);\r\n },\r\n auto: (rowA, rowB, columnId) => {\r\n const a = guess(rowA.values[columnId]);\r\n const b = guess(rowB.values[columnId]);\r\n return compareBasic(a, b);\r\n },\r\n};\r\n"],"names":["getTime","value","parsedValue","Date","undefined","getNumber","amount","decimalSeparator","length","Number","replace","isNaN","getString","String","toLowerCase","guess","compareBasic","a","b","sortTypes","datetime","rowA","rowB","columnId","values","string","number","boolean","auto"],"mappings":"AAEA,MAAMA,OAAO,GAAIC,KAAD;AACZ,QAAMC,WAAW,GAAS,OAAOD,KAAP,KAAiB,QAAjB,GAA4B,IAAIE,IAAJ,CAASF,KAAT,CAA5B,GAA8CA,KAAxE;AACA,SAAOC,WAAW,SAAX,IAAAA,WAAW,WAAX,IAAAA,WAAW,CAAEF,OAAb,GAAuBE,WAAW,CAACF,OAAZ,EAAvB,GAA+CI,SAAtD;AACH,CAHD;;AAKA,MAAMC,SAAS,GAAG,CAACC,MAAM,GAAG,EAAV,EAAcC,gBAAgB,GAAG,GAAjC;AACd,MAAI,OAAOD,MAAP,KAA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AACF,UAAMN,CAAC,GAAGF,KAAK,CAACM,IAAI,CAACG,MAAL,CAAYD,QAAZ,CAAD,CAAf;AACA,UAAML,CAAC,GAAGH,KAAK,CAACO,IAAI,CAACE,MAAL,CAAYD,QAAZ,CAAD,CAAf;AACA,WAAOP,YAAY,CAACC,CAAD,EAAIC,CAAJ,CAAnB;AACH;AAzByD;;;;"}
|
@@ -1,11 +1,9 @@
|
|
1
|
-
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
2
1
|
import React__default from 'react';
|
3
2
|
|
4
|
-
|
5
|
-
var sanitizeRowProps = function sanitizeRowProps(row, rowExpansionRenderer) {
|
3
|
+
const sanitizeRowProps = (row, rowExpansionRenderer) => {
|
6
4
|
var _row$subRows;
|
7
5
|
|
8
|
-
|
6
|
+
const props = {
|
9
7
|
index: row.index,
|
10
8
|
indexPath: row.id,
|
11
9
|
values: row.original
|
@@ -15,15 +13,11 @@ var sanitizeRowProps = function sanitizeRowProps(row, rowExpansionRenderer) {
|
|
15
13
|
props.isExpanded = !!row.isExpanded;
|
16
14
|
props.depth = row.depth;
|
17
15
|
|
18
|
-
props.toggleRowExpanded =
|
19
|
-
return row.toggleRowExpanded(!props.isExpanded);
|
20
|
-
};
|
16
|
+
props.toggleRowExpanded = () => row.toggleRowExpanded(!props.isExpanded);
|
21
17
|
} else if (rowExpansionRenderer) {
|
22
18
|
props.isExpanded = !!row.isExpanded;
|
23
19
|
|
24
|
-
props.toggleRowExpanded =
|
25
|
-
return row.toggleRowExpanded(!props.isExpanded);
|
26
|
-
};
|
20
|
+
props.toggleRowExpanded = () => row.toggleRowExpanded(!props.isExpanded);
|
27
21
|
}
|
28
22
|
|
29
23
|
if (row.toggleRowEditing) {
|
@@ -33,40 +27,36 @@ var sanitizeRowProps = function sanitizeRowProps(row, rowExpansionRenderer) {
|
|
33
27
|
|
34
28
|
return props;
|
35
29
|
};
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
30
|
+
const getColumnsFromChildren = (children, rowExpansionRenderer) => {
|
31
|
+
const sortRules = [];
|
32
|
+
const columns = React__default.Children.toArray(children).filter(child => !!child && !child.props.hidden) // skip falsey or hidden columns
|
33
|
+
.map(({
|
34
|
+
props: {
|
35
|
+
children: groupChildren,
|
36
|
+
...props
|
37
|
+
}
|
38
|
+
}) => {
|
39
|
+
const column = { ...props
|
40
|
+
};
|
48
41
|
column.sortType = column.sortType || 'auto';
|
49
42
|
column.disableSortBy = column.disableSorting; // this is a Table.Group - TODO: Find a better way to determine the child type
|
50
43
|
|
51
44
|
if (props.title && groupChildren) {
|
52
45
|
column.Header = props.title;
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
46
|
+
const {
|
47
|
+
columns: groupColumns,
|
48
|
+
sortRules: groupSortRules
|
49
|
+
} = getColumnsFromChildren(groupChildren, rowExpansionRenderer);
|
58
50
|
column.columns = groupColumns;
|
59
|
-
groupSortRules.forEach(
|
60
|
-
return sortRules.push(sort);
|
61
|
-
});
|
51
|
+
groupSortRules.forEach(sort => sortRules.push(sort));
|
62
52
|
} else {
|
63
53
|
column.accessor = props.accessor;
|
64
54
|
column.Header = props.headRenderer || '';
|
65
55
|
|
66
|
-
column.Cell =
|
56
|
+
column.Cell = columnProps => {
|
67
57
|
var _props$cellRenderer, _cell$value;
|
68
58
|
|
69
|
-
|
59
|
+
const cell = {
|
70
60
|
accessor: columnProps.cell.column.id,
|
71
61
|
row: sanitizeRowProps(columnProps.cell.row, rowExpansionRenderer),
|
72
62
|
value: columnProps.cell.value
|
@@ -94,17 +84,15 @@ var getColumnsFromChildren = function getColumnsFromChildren(children, rowExpans
|
|
94
84
|
return column;
|
95
85
|
});
|
96
86
|
return {
|
97
|
-
columns
|
98
|
-
sortRules
|
87
|
+
columns,
|
88
|
+
sortRules
|
99
89
|
};
|
100
90
|
};
|
101
|
-
|
102
|
-
return sortRules === null || sortRules === void 0 ? void 0 : sortRules.map(
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
};
|
107
|
-
});
|
91
|
+
const getInternalSortRules = sortRules => {
|
92
|
+
return sortRules === null || sortRules === void 0 ? void 0 : sortRules.map(rule => ({
|
93
|
+
id: rule.accessor,
|
94
|
+
desc: rule.desc
|
95
|
+
}));
|
108
96
|
};
|
109
97
|
|
110
98
|
export { getColumnsFromChildren, getInternalSortRules, sanitizeRowProps };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"util.js","sources":["../../../../src/components/Table/util.ts"],"sourcesContent":["import React from 'react';\nimport { TableRow, TableCell, TableChildren, InternalTableRow, InternalTableColumn, SortRule } from './types';\nimport { SortingRule } from 'react-table';\n\nexport const sanitizeRowProps = (row: InternalTableRow, rowExpansionRenderer: any): TableRow<any> => {\n const props: TableRow<any> = {\n index: row.index,\n indexPath: row.id,\n values: row.original,\n };\n\n if (row.subRows?.length > 0) {\n props.isExpanded = !!row.isExpanded;\n props.depth = row.depth;\n props.toggleRowExpanded = () => row.toggleRowExpanded(!props.isExpanded);\n } else if (rowExpansionRenderer) {\n props.isExpanded = !!row.isExpanded;\n props.toggleRowExpanded = () => row.toggleRowExpanded(!props.isExpanded);\n }\n\n if (row.toggleRowEditing) {\n props.isEditing = !!row.isEditing;\n props.toggleRowEditing = row.toggleRowEditing;\n }\n\n return props;\n};\n\nexport const getColumnsFromChildren = (children: TableChildren<any>, rowExpansionRenderer: any) => {\n const sortRules: SortingRule<any>[] = [];\n\n const columns = React.Children.toArray(children)\n .filter((child: any) => !!child && !child.props.hidden) // skip falsey or hidden columns\n .map(({ props: { children: groupChildren, ...props } }: any) => {\n const column: InternalTableColumn & { disableSortBy: boolean | undefined } = { ...props };\n\n column.sortType = column.sortType || 'auto';\n column.disableSortBy = column.disableSorting;\n\n // this is a Table.Group - TODO: Find a better way to determine the child type\n if (props.title && groupChildren) {\n column.Header = props.title;\n\n const { columns: groupColumns, sortRules: groupSortRules } = getColumnsFromChildren(\n groupChildren,\n rowExpansionRenderer\n );\n column.columns = groupColumns;\n groupSortRules.forEach(sort => sortRules.push(sort));\n } else {\n column.accessor = props.accessor;\n column.Header = props.headRenderer || '';\n column.Cell = (columnProps: any) => {\n const cell: TableCell<any> = {\n accessor: columnProps.cell.column.id,\n row: sanitizeRowProps(columnProps.cell.row, rowExpansionRenderer),\n value: columnProps.cell.value,\n };\n\n if (cell.row.isEditing && typeof props.editRenderer === 'function') {\n return props.editRenderer(cell);\n }\n\n return typeof props.cellRenderer === 'function' ? props.cellRenderer(cell) ?? null : cell.value ?? null;\n };\n\n // custom props\n column.align = props.align;\n column.flex = props.flex;\n\n if (props.sort && !props.disableSorting) {\n sortRules.push({\n id: props.accessor,\n desc: props.sort === 'desc',\n });\n }\n }\n\n return column;\n });\n\n return { columns, sortRules };\n};\n\nexport const getInternalSortRules = <T>(sortRules: SortRule<T>[] | undefined): SortingRule<T>[] | undefined => {\n return sortRules?.map<SortingRule<T>>(rule => ({ id: rule.accessor, desc: rule.desc }));\n};\n"],"names":["sanitizeRowProps","row","rowExpansionRenderer","props","index","indexPath","id","values","original","subRows","length","isExpanded","depth","toggleRowExpanded","toggleRowEditing","isEditing","getColumnsFromChildren","children","sortRules","columns","React","Children","toArray","filter","child","hidden","map","groupChildren","column","sortType","disableSortBy","disableSorting","title","Header","groupColumns","groupSortRules","forEach","sort","push","accessor","headRenderer","Cell","columnProps","cell","value","editRenderer","cellRenderer","align","flex","desc","getInternalSortRules","rule"],"mappings":"
|
1
|
+
{"version":3,"file":"util.js","sources":["../../../../src/components/Table/util.ts"],"sourcesContent":["import React from 'react';\r\nimport { TableRow, TableCell, TableChildren, InternalTableRow, InternalTableColumn, SortRule } from './types';\r\nimport { SortingRule } from 'react-table';\r\n\r\nexport const sanitizeRowProps = (row: InternalTableRow, rowExpansionRenderer: any): TableRow<any> => {\r\n const props: TableRow<any> = {\r\n index: row.index,\r\n indexPath: row.id,\r\n values: row.original,\r\n };\r\n\r\n if (row.subRows?.length > 0) {\r\n props.isExpanded = !!row.isExpanded;\r\n props.depth = row.depth;\r\n props.toggleRowExpanded = () => row.toggleRowExpanded(!props.isExpanded);\r\n } else if (rowExpansionRenderer) {\r\n props.isExpanded = !!row.isExpanded;\r\n props.toggleRowExpanded = () => row.toggleRowExpanded(!props.isExpanded);\r\n }\r\n\r\n if (row.toggleRowEditing) {\r\n props.isEditing = !!row.isEditing;\r\n props.toggleRowEditing = row.toggleRowEditing;\r\n }\r\n\r\n return props;\r\n};\r\n\r\nexport const getColumnsFromChildren = (children: TableChildren<any>, rowExpansionRenderer: any) => {\r\n const sortRules: SortingRule<any>[] = [];\r\n\r\n const columns = React.Children.toArray(children)\r\n .filter((child: any) => !!child && !child.props.hidden) // skip falsey or hidden columns\r\n .map(({ props: { children: groupChildren, ...props } }: any) => {\r\n const column: InternalTableColumn & { disableSortBy: boolean | undefined } = { ...props };\r\n\r\n column.sortType = column.sortType || 'auto';\r\n column.disableSortBy = column.disableSorting;\r\n\r\n // this is a Table.Group - TODO: Find a better way to determine the child type\r\n if (props.title && groupChildren) {\r\n column.Header = props.title;\r\n\r\n const { columns: groupColumns, sortRules: groupSortRules } = getColumnsFromChildren(\r\n groupChildren,\r\n rowExpansionRenderer\r\n );\r\n column.columns = groupColumns;\r\n groupSortRules.forEach(sort => sortRules.push(sort));\r\n } else {\r\n column.accessor = props.accessor;\r\n column.Header = props.headRenderer || '';\r\n column.Cell = (columnProps: any) => {\r\n const cell: TableCell<any> = {\r\n accessor: columnProps.cell.column.id,\r\n row: sanitizeRowProps(columnProps.cell.row, rowExpansionRenderer),\r\n value: columnProps.cell.value,\r\n };\r\n\r\n if (cell.row.isEditing && typeof props.editRenderer === 'function') {\r\n return props.editRenderer(cell);\r\n }\r\n\r\n return typeof props.cellRenderer === 'function' ? props.cellRenderer(cell) ?? null : cell.value ?? null;\r\n };\r\n\r\n // custom props\r\n column.align = props.align;\r\n column.flex = props.flex;\r\n\r\n if (props.sort && !props.disableSorting) {\r\n sortRules.push({\r\n id: props.accessor,\r\n desc: props.sort === 'desc',\r\n });\r\n }\r\n }\r\n\r\n return column;\r\n });\r\n\r\n return { columns, sortRules };\r\n};\r\n\r\nexport const getInternalSortRules = <T>(sortRules: SortRule<T>[] | undefined): SortingRule<T>[] | undefined => {\r\n return sortRules?.map<SortingRule<T>>(rule => ({ id: rule.accessor, desc: rule.desc }));\r\n};\r\n"],"names":["sanitizeRowProps","row","rowExpansionRenderer","props","index","indexPath","id","values","original","subRows","length","isExpanded","depth","toggleRowExpanded","toggleRowEditing","isEditing","getColumnsFromChildren","children","sortRules","columns","React","Children","toArray","filter","child","hidden","map","groupChildren","column","sortType","disableSortBy","disableSorting","title","Header","groupColumns","groupSortRules","forEach","sort","push","accessor","headRenderer","Cell","columnProps","cell","value","editRenderer","cellRenderer","align","flex","desc","getInternalSortRules","rule"],"mappings":";;MAIaA,gBAAgB,GAAG,CAACC,GAAD,EAAwBC,oBAAxB;;;AAC5B,QAAMC,KAAK,GAAkB;AACzBC,IAAAA,KAAK,EAAEH,GAAG,CAACG,KADc;AAEzBC,IAAAA,SAAS,EAAEJ,GAAG,CAACK,EAFU;AAGzBC,IAAAA,MAAM,EAAEN,GAAG,CAACO;AAHa,GAA7B;;AAMA,MAAI,iBAAAP,GAAG,CAACQ,OAAJ,8DAAaC,MAAb,IAAsB,CAA1B,EAA6B;AACzBP,IAAAA,KAAK,CAACQ,UAAN,GAAmB,CAAC,CAACV,GAAG,CAACU,UAAzB;AACAR,IAAAA,KAAK,CAACS,KAAN,GAAcX,GAAG,CAACW,KAAlB;;AACAT,IAAAA,KAAK,CAACU,iBAAN,GAA0B,MAAMZ,GAAG,CAACY,iBAAJ,CAAsB,CAACV,KAAK,CAACQ,UAA7B,CAAhC;AACH,GAJD,MAIO,IAAIT,oBAAJ,EAA0B;AAC7BC,IAAAA,KAAK,CAACQ,UAAN,GAAmB,CAA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I,EAAE9C,KAAK,CAACkC,IAAN,KAAe;AAFV,SAAf;AAIH;AACJ;;AAED,WAAOT,MAAP;AACH,GAhDW,CAAhB;AAkDA,SAAO;AAAET,IAAAA,OAAF;AAAWD,IAAAA;AAAX,GAAP;AACH;MAEYgC,oBAAoB,GAAOhC,SAAJ;AAChC,SAAOA,SAAP,aAAOA,SAAP,uBAAOA,SAAS,CAAEQ,GAAX,CAA+ByB,IAAI,KAAK;AAAE7C,IAAAA,EAAE,EAAE6C,IAAI,CAACZ,QAAX;AAAqBU,IAAAA,IAAI,EAAEE,IAAI,CAACF;AAAhC,GAAL,CAAnC,CAAP;AACH;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Tabs.js","sources":["../../../../src/components/Tabs/Tabs.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\n\nimport { Orientation } from '../../types';\nimport './Tabs.css';\n\nexport type TabsProps = React.HTMLAttributes<HTMLDivElement> & {\n /**\n * The controlled value of the tab to activate. Should be used in conjunction with `onChange`.\n */\n id?: string;\n /**\n * Set which tab is selected on mount.\n * This has to be one of the existing ids provided for tabs\n */\n defaultId?: string;\n /**\n * Content should be one or an array of `Tabs.Trigger` components inside `Tabs.List` and then\n * followed by one or an array of `Tabs.Content`.\n * *Note* that there can also be tabs that are rendered conditionally.\n */\n children: React.ReactNode;\n /**\n * Define orientation of tabs.\n * @defaultValue horizontal\n */\n orientation?: Orientation;\n /**\n * Callback that is called when tab is changed.\n */\n onChange?: (id: string) => void;\n};\n\nexport type TabListProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport type TabTriggerProps = React.HTMLAttributes<HTMLButtonElement> & {\n /**\n * A unique value that associates the trigger with a content.\n */\n id: string;\n /**\n * When true, prevents the user from interacting with the tab.\n */\n disabled?: boolean;\n};\n\nexport type TabContentProps = React.HTMLAttributes<HTMLDivElement> & {\n /**\n * A unique value that associates the content with a trigger.\n */\n id: string;\n};\n\nexport type ForwardedTabsWithStatics = React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>> & {\n /** Tab list component containing all tab triggers, rendered in a `Tabs` group component */\n List: React.ForwardRefExoticComponent<TabListProps & React.RefAttributes<HTMLDivElement>>;\n /** Tab trigger component rendered in a `Tabs.List` component */\n Trigger: React.ForwardRefExoticComponent<TabTriggerProps & React.RefAttributes<HTMLButtonElement>>;\n /** Tab content component rendered in a `Tabs` group component */\n Content: React.ForwardRefExoticComponent<TabContentProps & React.RefAttributes<HTMLDivElement>>;\n};\n\nexport const Tabs = React.forwardRef(function Tabs(props: TabsProps, ref: React.Ref<HTMLDivElement>) {\n const { id, defaultId, children, onChange, orientation = 'horizontal', ...otherProps } = props;\n const className = cn(\n 'yt-tabs',\n `yt-tabs--${orientation}`,\n {\n 'flex w-full': orientation === 'vertical',\n },\n props.className\n );\n\n return (\n <TabsPrimitive.Root\n {...otherProps}\n className={className}\n data-taco=\"tabs\"\n defaultValue={defaultId}\n dir=\"ltr\"\n onValueChange={onChange}\n orientation={orientation}\n ref={ref}\n value={id}\n >\n {children}\n </TabsPrimitive.Root>\n );\n}) as ForwardedTabsWithStatics;\n\nconst TabList = React.forwardRef(function Tab(props: TabListProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn('yt-tab__list border-b border-grey-light flex flex-row m-0 mb-4', props.className);\n\n return <TabsPrimitive.List {...props} className={className} ref={ref} />;\n});\n\nconst TabTrigger = React.forwardRef(function Tab(props: TabTriggerProps, ref: React.Ref<HTMLButtonElement>) {\n const { id, disabled, ...otherProps } = props;\n const className = cn(\n 'yt-tab bg-transparent border-b-2 border-transparent text-grey-darkest m-0 py-2 px-4',\n disabled\n ? 'cursor-not-allowed !text-grey'\n : 'cursor-pointer rounded-t hover:border-grey-light hover:text-black active:yt-focus active:border-blue focus:yt-focus focus:border-blue',\n props.className\n );\n\n return (\n <TabsPrimitive.Trigger\n {...otherProps}\n className={className}\n disabled={disabled}\n ref={ref}\n style={{\n transition: 'border 0.2s ease-in',\n }}\n value={id}\n />\n );\n});\n\nconst TabContent = React.forwardRef(function Tab(props: TabContentProps, ref: React.Ref<HTMLDivElement>) {\n const { id, ...otherProps } = props;\n const className = cn('yt-tab__panel outline-none', props.className);\n\n return <TabsPrimitive.Content {...otherProps} className={className} ref={ref} value={id} />;\n});\n\nTabs.List = TabList;\nTabs.Trigger = TabTrigger;\nTabs.Content = TabContent;\n"],"names":["Tabs","React","props","ref","id","defaultId","children","onChange","orientation","otherProps","className","cn","TabsPrimitive","defaultValue","dir","onValueChange","value","TabList","Tab","TabTrigger","disabled","style","transition","TabContent","List","Trigger","Content"],"mappings":";;;;;;;;IA+DaA,IAAI,gBAAGC,UAAA,CAAiB,SAASD,IAAT,CAAcE,KAAd,EAAgCC,GAAhC;AACjC,MAAQC,EAAR,GAAyFF,KAAzF,CAAQE,EAAR;AAAA,MAAYC,SAAZ,GAAyFH,KAAzF,CAAYG,SAAZ;AAAA,MAAuBC,QAAvB,GAAyFJ,KAAzF,CAAuBI,QAAvB;AAAA,MAAiCC,QAAjC,GAAyFL,KAAzF,CAAiCK,QAAjC;AAAA,2BAAyFL,KAAzF,CAA2CM,WAA3C;AAAA,MAA2CA,WAA3C,mCAAyD,YAAzD;AAAA,MAA0EC,UAA1E,iCAAyFP,KAAzF;;AACA,MAAMQ,SAAS,GAAGC,EAAE,CAChB,SADgB,gBAEJH,WAFI,EAGhB;AACI,mBAAeA,WAAW,KAAK;AADnC,GAHgB,EAMhBN,KAAK,CAACQ,SANU,CAApB;AASA,SACIT,aAAA,CAACW,IAAD,oBACQH;AACJC,IAAAA,SAAS,EAAEA;iBACD;AACVG,IAAAA,YAAY,EAAER;AACdS,IAAAA,GAAG,EAAC;AACJC,IAAAA,aAAa,EAAER;AACfC,IAAAA,WAAW,EAAEA;AACbL,IAAAA,GAAG,EAAEA;AACLa,IAAAA,KAAK,EAAEZ;IATX,EAWKE,QAXL,CADJ;AAeH,CA1BmB;AA4BpB,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AK,EAAEZ;IAA9E,CAAP;AACH,CALkB,CAAnB;AAOAJ,IAAI,CAACwB,IAAL,GAAYP,OAAZ;AACAjB,IAAI,CAACyB,OAAL,GAAeN,UAAf;AACAnB,IAAI,CAAC0B,OAAL,GAAeH,UAAf;;;;"}
|
1
|
+
{"version":3,"file":"Tabs.js","sources":["../../../../src/components/Tabs/Tabs.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\r\n\r\nimport { Orientation } from '../../types';\r\nimport './Tabs.css';\r\n\r\nexport type TabsProps = React.HTMLAttributes<HTMLDivElement> & {\r\n /**\r\n * The controlled value of the tab to activate. Should be used in conjunction with `onChange`.\r\n */\r\n id?: string;\r\n /**\r\n * Set which tab is selected on mount.\r\n * This has to be one of the existing ids provided for tabs\r\n */\r\n defaultId?: string;\r\n /**\r\n * Content should be one or an array of `Tabs.Trigger` components inside `Tabs.List` and then\r\n * followed by one or an array of `Tabs.Content`.\r\n * *Note* that there can also be tabs that are rendered conditionally.\r\n */\r\n children: React.ReactNode;\r\n /**\r\n * Define orientation of tabs.\r\n * @defaultValue horizontal\r\n */\r\n orientation?: Orientation;\r\n /**\r\n * Callback that is called when tab is changed.\r\n */\r\n onChange?: (id: string) => void;\r\n};\r\n\r\nexport type TabListProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nexport type TabTriggerProps = React.HTMLAttributes<HTMLButtonElement> & {\r\n /**\r\n * A unique value that associates the trigger with a content.\r\n */\r\n id: string;\r\n /**\r\n * When true, prevents the user from interacting with the tab.\r\n */\r\n disabled?: boolean;\r\n};\r\n\r\nexport type TabContentProps = React.HTMLAttributes<HTMLDivElement> & {\r\n /**\r\n * A unique value that associates the content with a trigger.\r\n */\r\n id: string;\r\n};\r\n\r\nexport type ForwardedTabsWithStatics = React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>> & {\r\n /** Tab list component containing all tab triggers, rendered in a `Tabs` group component */\r\n List: React.ForwardRefExoticComponent<TabListProps & React.RefAttributes<HTMLDivElement>>;\r\n /** Tab trigger component rendered in a `Tabs.List` component */\r\n Trigger: React.ForwardRefExoticComponent<TabTriggerProps & React.RefAttributes<HTMLButtonElement>>;\r\n /** Tab content component rendered in a `Tabs` group component */\r\n Content: React.ForwardRefExoticComponent<TabContentProps & React.RefAttributes<HTMLDivElement>>;\r\n};\r\n\r\nexport const Tabs = React.forwardRef(function Tabs(props: TabsProps, ref: React.Ref<HTMLDivElement>) {\r\n const { id, defaultId, children, onChange, orientation = 'horizontal', ...otherProps } = props;\r\n const className = cn(\r\n 'yt-tabs',\r\n `yt-tabs--${orientation}`,\r\n {\r\n 'flex w-full': orientation === 'vertical',\r\n },\r\n props.className\r\n );\r\n\r\n return (\r\n <TabsPrimitive.Root\r\n {...otherProps}\r\n className={className}\r\n data-taco=\"tabs\"\r\n defaultValue={defaultId}\r\n dir=\"ltr\"\r\n onValueChange={onChange}\r\n orientation={orientation}\r\n ref={ref}\r\n value={id}\r\n >\r\n {children}\r\n </TabsPrimitive.Root>\r\n );\r\n}) as ForwardedTabsWithStatics;\r\n\r\nconst TabList = React.forwardRef(function Tab(props: TabListProps, ref: React.Ref<HTMLDivElement>) {\r\n const className = cn('yt-tab__list border-b border-grey-light flex flex-row m-0 mb-4', props.className);\r\n\r\n return <TabsPrimitive.List {...props} className={className} ref={ref} />;\r\n});\r\n\r\nconst TabTrigger = React.forwardRef(function Tab(props: TabTriggerProps, ref: React.Ref<HTMLButtonElement>) {\r\n const { id, disabled, ...otherProps } = props;\r\n const className = cn(\r\n 'yt-tab bg-transparent border-b-2 border-transparent text-grey-darkest m-0 py-2 px-4',\r\n disabled\r\n ? 'cursor-not-allowed !text-grey'\r\n : 'cursor-pointer rounded-t hover:border-grey-light hover:text-black active:yt-focus active:border-blue focus:yt-focus focus:border-blue',\r\n props.className\r\n );\r\n\r\n return (\r\n <TabsPrimitive.Trigger\r\n {...otherProps}\r\n className={className}\r\n disabled={disabled}\r\n ref={ref}\r\n style={{\r\n transition: 'border 0.2s ease-in',\r\n }}\r\n value={id}\r\n />\r\n );\r\n});\r\n\r\nconst TabContent = React.forwardRef(function Tab(props: TabContentProps, ref: React.Ref<HTMLDivElement>) {\r\n const { id, ...otherProps } = props;\r\n const className = cn('yt-tab__panel outline-none', props.className);\r\n\r\n return <TabsPrimitive.Content {...otherProps} className={className} ref={ref} value={id} />;\r\n});\r\n\r\nTabs.List = TabList;\r\nTabs.Trigger = TabTrigger;\r\nTabs.Content = TabContent;\r\n"],"names":["Tabs","React","props","ref","id","defaultId","children","onChange","orientation","otherProps","className","cn","TabsPrimitive","defaultValue","dir","onValueChange","value","TabList","Tab","TabTrigger","disabled","style","transition","TabContent","List","Trigger","Content"],"mappings":";;;;;;;;IA+DaA,IAAI,gBAAGC,UAAA,CAAiB,SAASD,IAAT,CAAcE,KAAd,EAAgCC,GAAhC;AACjC,MAAQC,EAAR,GAAyFF,KAAzF,CAAQE,EAAR;AAAA,MAAYC,SAAZ,GAAyFH,KAAzF,CAAYG,SAAZ;AAAA,MAAuBC,QAAvB,GAAyFJ,KAAzF,CAAuBI,QAAvB;AAAA,MAAiCC,QAAjC,GAAyFL,KAAzF,CAAiCK,QAAjC;AAAA,2BAAyFL,KAAzF,CAA2CM,WAA3C;AAAA,MAA2CA,WAA3C,mCAAyD,YAAzD;AAAA,MAA0EC,UAA1E,iCAAyFP,KAAzF;;AACA,MAAMQ,SAAS,GAAGC,EAAE,CAChB,SADgB,gBAEJH,WAFI,EAGhB;AACI,mBAAeA,WAAW,KAAK;AADnC,GAHgB,EAMhBN,KAAK,CAACQ,SANU,CAApB;AASA,SACIT,aAAA,CAACW,IAAD,oBACQH;AACJC,IAAAA,SAAS,EAAEA;iBACD;AACVG,IAAAA,YAAY,EAAER;AACdS,IAAAA,GAAG,EAAC;AACJC,IAAAA,aAAa,EAAER;AACfC,IAAAA,WAAW,EAAEA;AACbL,IAAAA,GAAG,EAAEA;AACLa,IAAAA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