@economic/taco 2.47.0-server.3 → 2.47.0-server.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Icon/components/Autopay.d.ts +3 -0
- package/dist/components/Icon/components/AutopayPaused.d.ts +3 -0
- package/dist/components/Icon/components/Person.d.ts +3 -0
- package/dist/components/Icon/components/PersonSolid.d.ts +3 -0
- package/dist/components/Icon/components/Wallet.d.ts +3 -0
- package/dist/components/Icon/components/index.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Menu/components/Item.d.ts +1 -1
- package/dist/components/Menu/components/Link.d.ts +1 -1
- package/dist/components/Navigation2/components/Link.d.ts +1 -1
- package/dist/components/Select2/components/Option.d.ts +4 -4
- package/dist/components/Select2/components/Search.d.ts +1 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +32 -0
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
- package/dist/esm/index.css +11 -2
- package/dist/esm/packages/taco/src/charts/components/Area/AreaChart.js +32 -24
- package/dist/esm/packages/taco/src/charts/components/Area/AreaChart.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Bar/BarChart.js +84 -61
- package/dist/esm/packages/taco/src/charts/components/Bar/BarChart.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Donut/ActiveShape.js +16 -15
- package/dist/esm/packages/taco/src/charts/components/Donut/ActiveShape.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Donut/CenteredLabel.js +12 -13
- package/dist/esm/packages/taco/src/charts/components/Donut/CenteredLabel.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Donut/DonutChart.js +104 -68
- package/dist/esm/packages/taco/src/charts/components/Donut/DonutChart.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Donut/Legend.js +38 -29
- package/dist/esm/packages/taco/src/charts/components/Donut/Legend.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Donut/util.js +2 -2
- package/dist/esm/packages/taco/src/charts/components/Donut/util.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Legend.js +45 -37
- package/dist/esm/packages/taco/src/charts/components/Legend.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Line/LineChart.js +32 -24
- package/dist/esm/packages/taco/src/charts/components/Line/LineChart.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/ResponsiveContainer.js +5 -3
- package/dist/esm/packages/taco/src/charts/components/ResponsiveContainer.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Tooltip.js +26 -25
- package/dist/esm/packages/taco/src/charts/components/Tooltip.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/utils/color.js +13 -12
- package/dist/esm/packages/taco/src/charts/utils/color.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/utils/common.js +39 -26
- package/dist/esm/packages/taco/src/charts/utils/common.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Accordion/Accordion.js +30 -31
- package/dist/esm/packages/taco/src/components/Accordion/Accordion.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Alert/Alert.js +7 -9
- package/dist/esm/packages/taco/src/components/Alert/Alert.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/AlertDialog.js +14 -13
- package/dist/esm/packages/taco/src/components/AlertDialog/AlertDialog.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/Context.js +2 -2
- package/dist/esm/packages/taco/src/components/AlertDialog/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js +10 -9
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Footer.js +4 -4
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Footer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Trigger.js +5 -6
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Backdrop/Backdrop.js +2 -2
- package/dist/esm/packages/taco/src/components/Backdrop/Backdrop.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Badge/Badge.js +26 -27
- package/dist/esm/packages/taco/src/components/Badge/Badge.js.map +1 -1
- package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js +12 -14
- package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Banner/Banner.js +7 -10
- package/dist/esm/packages/taco/src/components/Banner/Banner.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Banner/util.js +3 -3
- package/dist/esm/packages/taco/src/components/Banner/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Button/Button.js +28 -29
- package/dist/esm/packages/taco/src/components/Button/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Button/util.js +25 -24
- package/dist/esm/packages/taco/src/components/Button/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Calendar/Calendar.js +75 -71
- package/dist/esm/packages/taco/src/components/Calendar/Calendar.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Card/Card.js +14 -15
- package/dist/esm/packages/taco/src/components/Card/Card.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js +24 -22
- package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Combobox/Combobox.js +21 -23
- package/dist/esm/packages/taco/src/components/Combobox/Combobox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js +76 -64
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js +60 -57
- package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Datepicker/useDatepicker.js +27 -28
- package/dist/esm/packages/taco/src/components/Datepicker/useDatepicker.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/Context.js +4 -4
- package/dist/esm/packages/taco/src/components/Dialog/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/Dialog.js +54 -39
- package/dist/esm/packages/taco/src/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Content.js +36 -38
- package/dist/esm/packages/taco/src/components/Dialog/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/DialogDrawer.js +3 -3
- package/dist/esm/packages/taco/src/components/Dialog/components/DialogDrawer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Extra.js +2 -2
- package/dist/esm/packages/taco/src/components/Dialog/components/Extra.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Trigger.js +5 -6
- package/dist/esm/packages/taco/src/components/Dialog/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/util.js +7 -3
- package/dist/esm/packages/taco/src/components/Dialog/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/Context.js +5 -5
- package/dist/esm/packages/taco/src/components/Drawer/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/Drawer.js +61 -51
- package/dist/esm/packages/taco/src/components/Drawer/Drawer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/components/Content.js +134 -145
- package/dist/esm/packages/taco/src/components/Drawer/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/components/Trigger.js +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/util.js +5 -5
- package/dist/esm/packages/taco/src/components/Drawer/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Field/Field.js +14 -12
- package/dist/esm/packages/taco/src/components/Field/Field.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Form/Form.js +7 -6
- package/dist/esm/packages/taco/src/components/Form/Form.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Group/Group.js +9 -7
- package/dist/esm/packages/taco/src/components/Group/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Hanger/Hanger.js +37 -36
- package/dist/esm/packages/taco/src/components/Hanger/Hanger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/Header.js +2 -2
- package/dist/esm/packages/taco/src/components/Header/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Avatar.js +14 -10
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Avatar.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Badge.js +5 -4
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Badge.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Display.js +7 -9
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Display.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js +9 -9
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js +66 -46
- package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Button.js +12 -8
- package/dist/esm/packages/taco/src/components/Header/components/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Link.js +22 -18
- package/dist/esm/packages/taco/src/components/Header/components/Link.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Logo.js +4 -4
- package/dist/esm/packages/taco/src/components/Header/components/Logo.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js +2 -2
- package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js +10 -9
- package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js +2 -2
- package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/HoverCard/HoverCard.js +5 -7
- package/dist/esm/packages/taco/src/components/HoverCard/HoverCard.js.map +1 -1
- package/dist/esm/packages/taco/src/components/HoverCard/Primitives.js +1 -1
- package/dist/esm/packages/taco/src/components/HoverCard/Primitives.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/Icon.js +7 -7
- package/dist/esm/packages/taco/src/components/Icon/Icon.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Autopay.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Autopay.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/AutopayPaused.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/AutopayPaused.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Person.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Person.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/PersonSolid.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/PersonSolid.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Wallet.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Wallet.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/index.js +14 -4
- package/dist/esm/packages/taco/src/components/Icon/components/index.js.map +1 -1
- package/dist/esm/packages/taco/src/components/IconButton/IconButton.js +22 -23
- package/dist/esm/packages/taco/src/components/IconButton/IconButton.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Input/Input.js +45 -44
- package/dist/esm/packages/taco/src/components/Input/Input.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Input/util.js +8 -5
- package/dist/esm/packages/taco/src/components/Input/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/Layout.js +7 -5
- package/dist/esm/packages/taco/src/components/Layout/Layout.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/components/Content.js +2 -2
- package/dist/esm/packages/taco/src/components/Layout/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/components/Context.js +4 -2
- package/dist/esm/packages/taco/src/components/Layout/components/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/components/Page.js +2 -2
- package/dist/esm/packages/taco/src/components/Layout/components/Page.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js +34 -27
- package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/components/Top.js +9 -6
- package/dist/esm/packages/taco/src/components/Layout/components/Top.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Button.js +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Collapsible.js +10 -7
- package/dist/esm/packages/taco/src/components/List/components/Collapsible.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Group.js +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Item.js +15 -13
- package/dist/esm/packages/taco/src/components/List/components/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Link.js +3 -3
- package/dist/esm/packages/taco/src/components/List/components/Link.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Toggle.js +29 -27
- package/dist/esm/packages/taco/src/components/List/components/Toggle.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/Listbox.js +21 -26
- package/dist/esm/packages/taco/src/components/Listbox/Listbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js +82 -70
- package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/useListbox.js +56 -51
- package/dist/esm/packages/taco/src/components/Listbox/useListbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/useMultiListbox.js +83 -65
- package/dist/esm/packages/taco/src/components/Listbox/useMultiListbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/useTypeahead.js +9 -10
- package/dist/esm/packages/taco/src/components/Listbox/useTypeahead.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/util.js +78 -48
- package/dist/esm/packages/taco/src/components/Listbox/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/Context.js +2 -2
- package/dist/esm/packages/taco/src/components/Menu/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/Menu.js +42 -26
- package/dist/esm/packages/taco/src/components/Menu/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Checkbox.js +8 -8
- package/dist/esm/packages/taco/src/components/Menu/components/Checkbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Content.js +27 -21
- package/dist/esm/packages/taco/src/components/Menu/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Header.js +3 -3
- package/dist/esm/packages/taco/src/components/Menu/components/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Item.js +32 -32
- package/dist/esm/packages/taco/src/components/Menu/components/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Link.js +10 -10
- package/dist/esm/packages/taco/src/components/Menu/components/Link.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/RadioGroup.js +15 -16
- package/dist/esm/packages/taco/src/components/Menu/components/RadioGroup.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Separator.js +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Separator.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/SubMenu.js +7 -7
- package/dist/esm/packages/taco/src/components/Menu/components/SubMenu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js +5 -5
- package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js +6 -6
- package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation/Navigation.js +41 -36
- package/dist/esm/packages/taco/src/components/Navigation/Navigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js +6 -6
- package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js +6 -6
- package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js +14 -11
- package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js +31 -24
- package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js +7 -7
- package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/util.js +9 -7
- package/dist/esm/packages/taco/src/components/Navigation2/components/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js +48 -51
- package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/PageNumbers.js +26 -23
- package/dist/esm/packages/taco/src/components/Pagination/PageNumbers.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/Pagination.js +53 -39
- package/dist/esm/packages/taco/src/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/usePagination.js +17 -7
- package/dist/esm/packages/taco/src/components/Pagination/usePagination.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/usePaginationShortcuts.js +8 -9
- package/dist/esm/packages/taco/src/components/Pagination/usePaginationShortcuts.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Popover/Popover.js +45 -43
- package/dist/esm/packages/taco/src/components/Popover/Popover.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Popover/Primitives.js +1 -1
- package/dist/esm/packages/taco/src/components/Popover/Primitives.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Popover/util.js +3 -1
- package/dist/esm/packages/taco/src/components/Popover/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Progress/Progress.js +13 -11
- package/dist/esm/packages/taco/src/components/Progress/Progress.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +13 -12
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Provider.js +8 -8
- package/dist/esm/packages/taco/src/components/Provider/Provider.js.map +1 -1
- package/dist/esm/packages/taco/src/components/RadioGroup/RadioGroup.js +54 -47
- package/dist/esm/packages/taco/src/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/packages/taco/src/components/RadioGroup/util.js +7 -1
- package/dist/esm/packages/taco/src/components/RadioGroup/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/Report.js +7 -5
- package/dist/esm/packages/taco/src/components/Report/Report.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/useReport.js +1 -1
- package/dist/esm/packages/taco/src/components/Report/useReport.js.map +1 -1
- package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js +17 -13
- package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js.map +1 -1
- package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js +11 -11
- package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js +44 -39
- package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select/Select.js +28 -31
- package/dist/esm/packages/taco/src/components/Select/Select.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select/useSelect.js +79 -70
- package/dist/esm/packages/taco/src/components/Select/useSelect.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +154 -121
- package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Collection.js +2 -4
- package/dist/esm/packages/taco/src/components/Select2/components/Collection.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Context.js +4 -2
- package/dist/esm/packages/taco/src/components/Select2/components/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Create.js +45 -41
- package/dist/esm/packages/taco/src/components/Select2/components/Create.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +145 -129
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Group.js +8 -8
- package/dist/esm/packages/taco/src/components/Select2/components/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js +36 -35
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Search.js +9 -10
- package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Title.js +2 -2
- package/dist/esm/packages/taco/src/components/Select2/components/Title.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +173 -128
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js +32 -23
- package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/utilities.js +13 -6
- package/dist/esm/packages/taco/src/components/Select2/utilities.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js +16 -13
- package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Spinner/Spinner.js +17 -12
- package/dist/esm/packages/taco/src/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Switch/Switch.js +14 -14
- package/dist/esm/packages/taco/src/components/Switch/Switch.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js +28 -23
- package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/PaginatedTable.js +7 -3
- package/dist/esm/packages/taco/src/components/Table/components/PaginatedTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/Table.js +22 -18
- package/dist/esm/packages/taco/src/components/Table/components/Table.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js +100 -92
- package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js +136 -118
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowDraggable.js +55 -55
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowDraggable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowEditing.js +35 -41
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowEditing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowSelect.js +77 -71
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/useRowCreation.js +56 -30
- package/dist/esm/packages/taco/src/components/Table/hooks/useRowCreation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/useTable.js +151 -142
- package/dist/esm/packages/taco/src/components/Table/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/useTableKeyboardNavigation.js +22 -20
- package/dist/esm/packages/taco/src/components/Table/hooks/useTableKeyboardNavigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/renderColumn.js +9 -12
- package/dist/esm/packages/taco/src/components/Table/util/renderColumn.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/renderRow.js +41 -41
- package/dist/esm/packages/taco/src/components/Table/util/renderRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/rowIndexPath.js +16 -14
- package/dist/esm/packages/taco/src/components/Table/util/rowIndexPath.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/sortTypes.js +32 -26
- package/dist/esm/packages/taco/src/components/Table/util/sortTypes.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util.js +37 -30
- package/dist/esm/packages/taco/src/components/Table/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +23 -23
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Cell.js +13 -14
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Cell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js +21 -23
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/TextareaWithAutosizing.js +20 -17
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/TextareaWithAutosizing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js +67 -73
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingDisplayCell.js +2 -2
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingDisplayCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/util.js +19 -20
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js +26 -25
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js +45 -40
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/DiscardChangesConfirmationDialog.js +7 -8
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateNewRow.js +18 -19
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateNewRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/SaveStatus.js +7 -10
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/SaveStatus.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/TemporaryRow.js +38 -36
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/TemporaryRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js +15 -15
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Toolbar/Editing/Editing.js +8 -11
- package/dist/esm/packages/taco/src/components/Table3/components/Toolbar/Editing/Editing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/features/useEditingState.js +164 -201
- package/dist/esm/packages/taco/src/components/Table3/features/useEditingState.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js +40 -27
- package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js +18 -16
- package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/useTable3.js +25 -19
- package/dist/esm/packages/taco/src/components/Table3/useTable3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/util/editing.js +29 -35
- package/dist/esm/packages/taco/src/components/Table3/util/editing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tabs/Tabs.js +34 -35
- package/dist/esm/packages/taco/src/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tag/Tag.js +18 -16
- package/dist/esm/packages/taco/src/components/Tag/Tag.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Textarea/Textarea.js +8 -11
- package/dist/esm/packages/taco/src/components/Textarea/Textarea.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Toast/Toast.js +19 -20
- package/dist/esm/packages/taco/src/components/Toast/Toast.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Toast/Toaster.js +117 -96
- package/dist/esm/packages/taco/src/components/Toast/Toaster.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Toast/util.js +6 -4
- package/dist/esm/packages/taco/src/components/Toast/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js +10 -9
- package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tour/Tour.js +49 -46
- package/dist/esm/packages/taco/src/components/Tour/Tour.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Treeview/Treeview.js +33 -27
- package/dist/esm/packages/taco/src/components/Treeview/Treeview.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Truncate/Truncate.js +15 -13
- package/dist/esm/packages/taco/src/components/Truncate/Truncate.js.map +1 -1
- package/dist/esm/packages/taco/src/components/VisuallyHidden/VisuallyHidden.js +1 -1
- package/dist/esm/packages/taco/src/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useBoundaryOverflowDetection.js +11 -6
- package/dist/esm/packages/taco/src/hooks/useBoundaryOverflowDetection.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useBoundingClientRectListener.js +19 -13
- package/dist/esm/packages/taco/src/hooks/useBoundingClientRectListener.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useGlobalKeyDown.js +4 -4
- package/dist/esm/packages/taco/src/hooks/useGlobalKeyDown.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useId.js +4 -2
- package/dist/esm/packages/taco/src/hooks/useId.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useIntersectionObserver.js +20 -18
- package/dist/esm/packages/taco/src/hooks/useIntersectionObserver.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useIsFormControl.js +7 -5
- package/dist/esm/packages/taco/src/hooks/useIsFormControl.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useIsHoverStatePaused.js +9 -5
- package/dist/esm/packages/taco/src/hooks/useIsHoverStatePaused.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useIsLargeScreen.js +3 -1
- package/dist/esm/packages/taco/src/hooks/useIsLargeScreen.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useLazyEffect.js +2 -2
- package/dist/esm/packages/taco/src/hooks/useLazyEffect.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useLocalStorage.js +24 -22
- package/dist/esm/packages/taco/src/hooks/useLocalStorage.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useMatchMedia.js +13 -6
- package/dist/esm/packages/taco/src/hooks/useMatchMedia.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useMergedRef.js +3 -3
- package/dist/esm/packages/taco/src/hooks/useMergedRef.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/usePrevious.js +2 -2
- package/dist/esm/packages/taco/src/hooks/usePrevious.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/BubbleSelect.js +14 -14
- package/dist/esm/packages/taco/src/primitives/BubbleSelect.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Button.js +16 -13
- package/dist/esm/packages/taco/src/primitives/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js +50 -44
- package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Context.js +4 -2
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Group.js +9 -5
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Option.js +16 -18
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Option.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js +47 -40
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Title.js +9 -10
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Title.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Sortable/components/Container.js +22 -20
- package/dist/esm/packages/taco/src/primitives/Sortable/components/Container.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Sortable/components/Item.js +24 -27
- package/dist/esm/packages/taco/src/primitives/Sortable/components/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Sortable/components/List.js +11 -10
- package/dist/esm/packages/taco/src/primitives/Sortable/components/List.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js +22 -19
- package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/Body.js +25 -22
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/Body.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/EmptyStateBody.js +6 -6
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/EmptyStateBody.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/util.js +30 -14
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/util.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.js +18 -19
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.js +34 -34
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/Cell.js +10 -12
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/Cell.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/util.js +19 -18
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/util.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Actions.js +42 -40
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Actions.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js +5 -7
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Expansion.js +19 -24
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Expansion.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js +56 -55
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js +27 -23
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js +13 -16
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/Header.js +86 -87
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Goto.js +14 -11
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Goto.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js +85 -58
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js +18 -20
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/SortIndicator.js +3 -3
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/SortIndicator.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/util.js +11 -6
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/util.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js +58 -49
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.js +28 -32
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/Row.js +44 -37
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/RowContext.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/RowContext.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/Toolbar.js +11 -11
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/FilterContext.js +6 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/FilterContext.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/Filters.js +23 -22
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/Filters.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.js +59 -42
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.js +39 -39
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.js +21 -16
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterComparator.js +16 -15
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterComparator.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js +51 -40
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/util.js +13 -9
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/util.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/Print.js +57 -51
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/Print.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/PrintDialog.js +71 -67
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/PrintDialog.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Search/Search.js +40 -37
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Search/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/HideOrOrderPopover.js +64 -44
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/HideOrOrderPopover.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/Settings.js +62 -51
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/Settings.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableGlobalShortcuts.js +6 -6
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableGlobalShortcuts.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRef.js +13 -5
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRef.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js +93 -77
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyle.js +15 -15
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyle.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleColumnFreezing.js +31 -41
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleColumnFreezing.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js +31 -30
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/listeners/useTableRowActiveListener.js +3 -3
- package/dist/esm/packages/taco/src/primitives/Table/Core/listeners/useTableRowActiveListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/useTable.js +14 -15
- package/dist/esm/packages/taco/src/primitives/Table/Core/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/util/rows.js +2 -2
- package/dist/esm/packages/taco/src/primitives/Table/Core/util/rows.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js +42 -36
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader2.js +67 -74
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader2.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableColumnFreezing.js +11 -6
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableColumnFreezing.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableColumnOrdering.js +5 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableColumnOrdering.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFontSize.js +15 -5
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFontSize.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFooter.js +5 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFooter.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTablePrinting.js +26 -16
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTablePrinting.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActions.js +9 -3
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActions.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActive.js +42 -23
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActive.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowClick.js +9 -6
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowClick.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrag.js +9 -4
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrag.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrop.js +5 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrop.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowExpansion.js +9 -3
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowExpansion.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGoto.js +5 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGoto.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGroups.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGroups.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowHeight.js +15 -5
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowHeight.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowSelection.js +14 -9
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowSelection.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSearch.js +25 -13
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSearch.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableServerLoading.js +43 -22
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableServerLoading.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSettings.js +34 -24
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSettings.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableDataListener.js +4 -4
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableDataListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFilterListener.js +3 -3
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFilterListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFontSizeListener.js +18 -16
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFontSizeListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowHeightListener.js +2 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowHeightListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js +6 -4
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js +8 -8
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableServerLoadingListener.js +6 -6
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableServerLoadingListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSettingsListener.js +8 -6
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSettingsListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableShortcutsListener.js +17 -17
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableShortcutsListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSortingListener.js +2 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSortingListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +55 -55
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js +59 -30
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/dataTypes.js +4 -4
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/dataTypes.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/filtering.js +33 -19
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/filtering.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js +11 -11
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/search.js +21 -19
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/search.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/settings.js +6 -7
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/settings.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js +138 -106
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/sorting.js +3 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/sorting.js.map +1 -1
- package/dist/esm/packages/taco/src/types.js +1 -1
- package/dist/esm/packages/taco/src/types.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/aria.js +2 -2
- package/dist/esm/packages/taco/src/utils/aria.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/date.js +47 -23
- package/dist/esm/packages/taco/src/utils/date.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/debounce.js +10 -4
- package/dist/esm/packages/taco/src/utils/debounce.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/device.js +4 -2
- package/dist/esm/packages/taco/src/utils/device.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/dom.js +26 -20
- package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useDraggable.js +40 -38
- package/dist/esm/packages/taco/src/utils/hooks/useDraggable.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useDropTarget.js +9 -7
- package/dist/esm/packages/taco/src/utils/hooks/useDropTarget.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useListKeyboardNavigation.js +20 -9
- package/dist/esm/packages/taco/src/utils/hooks/useListKeyboardNavigation.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useListScrollTo.js +9 -9
- package/dist/esm/packages/taco/src/utils/hooks/useListScrollTo.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useOnClickOutside.js +8 -6
- package/dist/esm/packages/taco/src/utils/hooks/useOnClickOutside.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useTimer.js +16 -11
- package/dist/esm/packages/taco/src/utils/hooks/useTimer.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js +11 -6
- package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/input.js +10 -7
- package/dist/esm/packages/taco/src/utils/input.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/keyboard.js +8 -5
- package/dist/esm/packages/taco/src/utils/keyboard.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/mergeRefs.js +2 -2
- package/dist/esm/packages/taco/src/utils/mergeRefs.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/tailwind.js +5 -5
- package/dist/esm/packages/taco/src/utils/tailwind.js.map +1 -1
- package/dist/esm/packages/taco/tailwind.colors.js +1 -1
- package/dist/esm/packages/taco/tailwind.colors.js.map +1 -1
- package/dist/index.css +11 -2
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/FilterContext.d.ts +3 -0
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.d.ts +0 -1
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.d.ts +0 -3
- package/dist/primitives/Table/types.d.ts +1 -1
- package/dist/primitives/Table/useTableManager/features/useTableServerLoading.d.ts +2 -1
- package/dist/taco.cjs.development.js +7944 -6916
- 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 +1 -2
@@ -2,44 +2,43 @@ import React__default from 'react';
|
|
2
2
|
import { _finallyRethrows, _catch } from '../../../../../node_modules/babel-plugin-transform-async-to-promises/helpers.mjs.js';
|
3
3
|
import { DEFAULT_PAGE_SIZE } from './useTableDataLoader.js';
|
4
4
|
|
5
|
-
|
6
|
-
function useTableDataLoader2(fetchPage, fetchAll, options
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
var DATASET_SIZE_MULTIPLIER = 15;
|
6
|
+
function useTableDataLoader2(fetchPage, fetchAll, options) {
|
7
|
+
var loadPage = function loadPage(pageIndex, sorting, filters, search, hiddenColumns, reset) {
|
8
|
+
if (reset === void 0) {
|
9
|
+
reset = false;
|
10
|
+
}
|
10
11
|
try {
|
11
|
-
if (
|
12
|
-
return Promise.resolve();
|
13
|
-
}
|
14
|
-
// if page is already loading, abort, otherwise mark it as loading
|
15
|
-
if (_pendingPageRequests.current[pageIndex]) {
|
12
|
+
if (_pendingPageRequests.current[pageIndex] && !reset) {
|
16
13
|
return Promise.resolve();
|
17
|
-
} else {
|
18
|
-
_pendingPageRequests.current[pageIndex] = true;
|
19
14
|
}
|
15
|
+
var hasChangedData = JSON.stringify(sorting) !== JSON.stringify(_lastUsedSorting.current) || JSON.stringify(filters) !== JSON.stringify(_lastUsedFilters.current) || search !== _lastUsedSearch.current;
|
16
|
+
// set values so we can track if they changed between loads
|
17
|
+
_lastUsedSorting.current = sorting;
|
18
|
+
_lastUsedFilters.current = filters;
|
19
|
+
_lastUsedSearch.current = search;
|
20
|
+
_lastUsedHiddenColumns.current = hiddenColumns;
|
20
21
|
// if the page is already loaded and has actual rows, abort
|
21
|
-
if (data.pages.includes(pageIndex)) {
|
22
|
-
|
22
|
+
if (data.pages.includes(pageIndex) && !hasChangedData && !reset) {
|
23
|
+
var position = data.pages.indexOf(pageIndex);
|
23
24
|
if (data.rows[position * pageSize] !== undefined) {
|
24
25
|
return Promise.resolve();
|
25
26
|
}
|
26
27
|
}
|
27
|
-
// set the
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
const direction = getDirection2(pageIndex, _lastFetchedPage.current);
|
32
|
-
const _temp2 = _finallyRethrows(function () {
|
28
|
+
// set the page as loading, so that subsequent requests don't retrigger it
|
29
|
+
_pendingPageRequests.current[pageIndex] = true;
|
30
|
+
var direction = getDirection2(pageIndex, _lastFetchedPage.current);
|
31
|
+
var _temp2 = _finallyRethrows(function () {
|
33
32
|
return _catch(function () {
|
34
33
|
return Promise.resolve(fetchPage(pageIndex, pageSize, sorting, filters, search, hiddenColumns)).then(function (response) {
|
35
34
|
length.current = response.length;
|
36
35
|
// update state, here we do some "magic" to support "load in place"
|
37
|
-
setData(currentData
|
38
|
-
|
39
|
-
|
36
|
+
setData(function (currentData) {
|
37
|
+
var nextPages = getPages(pageIndex, _lastFetchedPage.current, reset ? [] : currentData.pages, direction);
|
38
|
+
var nextRows = currentData.rows;
|
40
39
|
if (reset || !direction) {
|
41
|
-
|
42
|
-
|
40
|
+
var index = nextPages.indexOf(pageIndex);
|
41
|
+
var startIndex = (index > -1 ? index : 0) * pageSize;
|
43
42
|
if (reset) {
|
44
43
|
nextRows = [].concat(response.data);
|
45
44
|
} else if (startIndex > 0 || pageIndex === 0) {
|
@@ -70,13 +69,12 @@ function useTableDataLoader2(fetchPage, fetchAll, options = {
|
|
70
69
|
});
|
71
70
|
}, function () {});
|
72
71
|
}, function (_wasThrown2, _result2) {
|
73
|
-
_hasFetchedAll.current = false;
|
74
72
|
// reset pending requests
|
75
73
|
delete _pendingPageRequests.current[pageIndex];
|
76
74
|
// update the last loaded page
|
77
75
|
_lastFetchedPage.current = {
|
78
76
|
index: pageIndex,
|
79
|
-
direction
|
77
|
+
direction: direction
|
80
78
|
};
|
81
79
|
if (_wasThrown2) throw _result2;
|
82
80
|
return _result2;
|
@@ -86,36 +84,41 @@ function useTableDataLoader2(fetchPage, fetchAll, options = {
|
|
86
84
|
return Promise.reject(e);
|
87
85
|
}
|
88
86
|
};
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
87
|
+
if (options === void 0) {
|
88
|
+
options = {
|
89
|
+
pageSize: DEFAULT_PAGE_SIZE
|
90
|
+
};
|
91
|
+
}
|
92
|
+
var _options = options,
|
93
|
+
pageSize = _options.pageSize;
|
94
|
+
var DATASET_SIZE = DATASET_SIZE_MULTIPLIER * pageSize;
|
93
95
|
// track the data length, we don't know it until the first request
|
94
|
-
|
96
|
+
var length = React__default.useRef(0);
|
95
97
|
// data will be filled after the first request
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
98
|
+
var _React$useState = React__default.useState({
|
99
|
+
rows: [],
|
100
|
+
pages: []
|
101
|
+
}),
|
102
|
+
data = _React$useState[0],
|
103
|
+
setData = _React$useState[1];
|
100
104
|
// track which pages have been loaded to dedupe requests
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
105
|
+
var _pendingPageRequests = React__default.useRef({});
|
106
|
+
var _lastUsedSorting = React__default.useRef([]);
|
107
|
+
var _lastUsedFilters = React__default.useRef([]);
|
108
|
+
var _lastUsedSearch = React__default.useRef();
|
109
|
+
var _lastUsedHiddenColumns = React__default.useRef([]);
|
110
|
+
var _lastFetchedPage = React__default.useRef({
|
107
111
|
index: undefined,
|
108
112
|
direction: undefined
|
109
113
|
});
|
110
|
-
|
111
|
-
const loadAll = function (sorting, filters, search, hiddenColumns) {
|
114
|
+
var loadAll = function loadAll(sorting, filters, search, hiddenColumns) {
|
112
115
|
try {
|
113
|
-
|
114
|
-
// set the sorting so we can track if it changed between loads
|
116
|
+
// set values so we can track if they changed between loads
|
115
117
|
_lastUsedSorting.current = sorting;
|
116
|
-
// set the filters so we can track if it changed between loads
|
117
118
|
_lastUsedFilters.current = filters;
|
118
|
-
|
119
|
+
_lastUsedSearch.current = search;
|
120
|
+
_lastUsedHiddenColumns.current = hiddenColumns;
|
121
|
+
var _temp = _finallyRethrows(function () {
|
119
122
|
return _catch(function () {
|
120
123
|
return Promise.resolve(fetchAll(sorting, filters, search, hiddenColumns)).then(function (response) {
|
121
124
|
length.current = response.length;
|
@@ -136,49 +139,39 @@ function useTableDataLoader2(fetchPage, fetchAll, options = {
|
|
136
139
|
return Promise.reject(e);
|
137
140
|
}
|
138
141
|
};
|
139
|
-
|
142
|
+
var invalidate = function invalidate() {
|
140
143
|
try {
|
144
|
+
console.log('invalidate');
|
141
145
|
// reset stuff
|
142
146
|
_pendingPageRequests.current = {};
|
143
|
-
|
144
|
-
// load the last page that we scrolled to
|
147
|
+
// load the current page again
|
145
148
|
return loadPage(getCurrentPage(data.pages, _lastFetchedPage.current), _lastUsedSorting.current, _lastUsedFilters.current, _lastUsedSearch.current, _lastUsedHiddenColumns.current, true);
|
146
149
|
} catch (e) {
|
147
150
|
return Promise.reject(e);
|
148
151
|
}
|
149
152
|
};
|
150
|
-
|
151
|
-
// if a search is currently "active", we need to re load all because
|
152
|
-
const handleSort = function (sorting) {
|
153
|
+
var handleSort = function handleSort(sorting) {
|
153
154
|
try {
|
154
|
-
|
155
|
-
// reset stuff
|
155
|
+
// reset before loading the current page
|
156
156
|
_pendingPageRequests.current = {};
|
157
|
-
_hasFetchedAll.current = false;
|
158
157
|
return loadPage(getCurrentPage(data.pages, _lastFetchedPage.current), sorting, _lastUsedFilters.current, _lastUsedSearch.current, _lastUsedHiddenColumns.current, true);
|
159
158
|
} catch (e) {
|
160
159
|
return Promise.reject(e);
|
161
160
|
}
|
162
161
|
};
|
163
|
-
|
162
|
+
var handleFilter = function handleFilter(filters, hiddenColumns) {
|
164
163
|
try {
|
165
|
-
|
166
|
-
_lastUsedHiddenColumns.current = hiddenColumns;
|
167
|
-
// reset stuff
|
164
|
+
// reset before loading the current page
|
168
165
|
_pendingPageRequests.current = {};
|
169
|
-
_hasFetchedAll.current = false;
|
170
166
|
return loadPage(getCurrentPage(data.pages, _lastFetchedPage.current), _lastUsedSorting.current, filters, _lastUsedSearch.current, hiddenColumns, true);
|
171
167
|
} catch (e) {
|
172
168
|
return Promise.reject(e);
|
173
169
|
}
|
174
170
|
};
|
175
|
-
|
171
|
+
var handleSearch = function handleSearch(search, hiddenColumns) {
|
176
172
|
try {
|
177
|
-
|
178
|
-
_lastUsedHiddenColumns.current = hiddenColumns;
|
179
|
-
// reset stuff
|
173
|
+
// reset before loading the current page
|
180
174
|
_pendingPageRequests.current = {};
|
181
|
-
_hasFetchedAll.current = false;
|
182
175
|
return loadPage(getCurrentPage(data.pages, _lastFetchedPage.current), _lastUsedSorting.current, _lastUsedFilters.current, search, hiddenColumns, true);
|
183
176
|
} catch (e) {
|
184
177
|
return Promise.reject(e);
|
@@ -188,12 +181,12 @@ function useTableDataLoader2(fetchPage, fetchAll, options = {
|
|
188
181
|
data: data.rows,
|
189
182
|
pages: data.pages,
|
190
183
|
length: length.current,
|
191
|
-
loadAll,
|
192
|
-
loadPage,
|
184
|
+
loadAll: loadAll,
|
185
|
+
loadPage: loadPage,
|
193
186
|
onChangeFilter: handleFilter,
|
194
187
|
onChangeSearch: handleSearch,
|
195
188
|
onChangeSort: handleSort,
|
196
|
-
pageSize,
|
189
|
+
pageSize: pageSize,
|
197
190
|
_experimentalDataLoader2: true
|
198
191
|
}, invalidate];
|
199
192
|
}
|
@@ -202,7 +195,7 @@ function getCurrentPage(currentPages, lastFetchedPage) {
|
|
202
195
|
var _currentPages$;
|
203
196
|
return (_currentPages$ = currentPages[0]) !== null && _currentPages$ !== void 0 ? _currentPages$ : 0;
|
204
197
|
}
|
205
|
-
|
198
|
+
var middle = Math.floor(DATASET_SIZE_MULTIPLIER / 2);
|
206
199
|
if (lastFetchedPage.index) {
|
207
200
|
if (!lastFetchedPage.direction) {
|
208
201
|
return lastFetchedPage.index;
|
@@ -231,12 +224,12 @@ function getPages(pageIndex, lastUsedPage, currentPages, direction) {
|
|
231
224
|
return currentPages;
|
232
225
|
}
|
233
226
|
if (direction === 'forward') {
|
234
|
-
|
227
|
+
var nextPages = currentPages.length === DATASET_SIZE_MULTIPLIER ? currentPages.slice(1) : currentPages;
|
235
228
|
return nextPages.concat(pageIndex);
|
236
229
|
}
|
237
230
|
if (direction === 'backward') {
|
238
|
-
|
239
|
-
return [pageIndex].concat(
|
231
|
+
var _nextPages = currentPages.length === DATASET_SIZE_MULTIPLIER ? currentPages.slice(0, -1) : currentPages;
|
232
|
+
return [pageIndex].concat(_nextPages);
|
240
233
|
}
|
241
234
|
if (pageIndex === 0) {
|
242
235
|
return [0];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableDataLoader2.js","sources":["../../../../../../../src/primitives/Table/useTableDataLoader2.ts"],"sourcesContent":["import React from 'react';\nimport {\n TableColumnFilter,\n TableColumnSort,\n TableFilterHandler,\n TableServerLoadPageHandler,\n TableServerLoadAllHandler,\n TableSortHandler,\n TableSearchHandler,\n} from './types';\nimport { DEFAULT_PAGE_SIZE, useTableDataLoaderOptions } from './useTableDataLoader';\n\nconst DATASET_SIZE_MULTIPLIER = 15;\n\nexport type useTableDataPageFetcher2<TType = unknown> = (\n pageIndex: number,\n pageSize: number,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined,\n hiddenColumns: string[]\n) => Promise<{ data: TType[]; length: number }>;\n\nexport type useTableDataAllFetcher2<TType = unknown> = (\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined,\n hiddenColumns: string[]\n) => Promise<{ data: TType[]; length: number }>;\n\nexport type useTableDataLoaderValues2<TType = unknown> = {\n data: TType[];\n length: number | undefined;\n loadAll: TableServerLoadAllHandler;\n loadPage: TableServerLoadPageHandler;\n onChangeFilter: TableFilterHandler;\n onChangeSearch: TableSearchHandler;\n onChangeSort: TableSortHandler;\n pageSize: number;\n pages: number[];\n _experimentalDataLoader2: boolean;\n};\n\ntype Data<TType = unknown> = {\n rows: TType[];\n pages: number[];\n};\ntype Direction = 'forward' | 'backward' | undefined;\ntype LastFetchedPage = {\n index: number | undefined;\n direction: Direction;\n};\n\nexport function useTableDataLoader2<TType = unknown>(\n fetchPage: useTableDataPageFetcher2<TType>,\n fetchAll: useTableDataAllFetcher2<TType>,\n options: useTableDataLoaderOptions = { pageSize: DEFAULT_PAGE_SIZE }\n): [useTableDataLoaderValues2<TType>, () => void] {\n const { pageSize } = options;\n const DATASET_SIZE = DATASET_SIZE_MULTIPLIER * pageSize;\n\n // track the data length, we don't know it until the first request\n const length = React.useRef<number>(0);\n // data will be filled after the first request\n const [data, setData] = React.useState<Data<TType>>({ rows: [], pages: [] });\n // track which pages have been loaded to dedupe requests\n const _pendingPageRequests = React.useRef({});\n const _lastUsedSorting = React.useRef<TableColumnSort[]>([]);\n const _lastUsedFilters = React.useRef<TableColumnFilter[]>([]);\n const _lastUsedSearch = React.useRef<string | undefined>();\n const _lastUsedHiddenColumns = React.useRef<string[]>([]);\n const _lastFetchedPage = React.useRef<LastFetchedPage>({\n index: undefined,\n direction: undefined,\n });\n const _hasFetchedAll = React.useRef<boolean>(false);\n\n async function loadPage(\n pageIndex: number,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined,\n hiddenColumns: string[],\n reset = false\n ) {\n if (_hasFetchedAll.current) {\n return;\n }\n\n // if page is already loading, abort, otherwise mark it as loading\n if (_pendingPageRequests.current[pageIndex]) {\n return;\n } else {\n _pendingPageRequests.current[pageIndex] = true;\n }\n\n // if the page is already loaded and has actual rows, abort\n if (data.pages.includes(pageIndex)) {\n const position = data.pages.indexOf(pageIndex);\n\n if (data.rows[position * pageSize] !== undefined) {\n return;\n }\n }\n\n // set the sorting so we can track if it changed between loads\n _lastUsedSorting.current = sorting;\n // set the filters so we can track if it changed between loads\n _lastUsedFilters.current = filters;\n\n const direction = getDirection2(pageIndex, _lastFetchedPage.current);\n\n try {\n const response = await fetchPage(pageIndex, pageSize, sorting, filters, search, hiddenColumns);\n length.current = response.length;\n\n // update state, here we do some \"magic\" to support \"load in place\"\n setData(currentData => {\n const nextPages = getPages(pageIndex, _lastFetchedPage.current, reset ? [] : currentData.pages, direction);\n let nextRows = currentData.rows;\n\n if (reset || !direction) {\n const index = nextPages.indexOf(pageIndex);\n const startIndex = (index > -1 ? index : 0) * pageSize;\n\n if (reset) {\n nextRows = ([] as TType[]).concat(response.data);\n } else if (startIndex > 0 || pageIndex === 0) {\n nextRows = Array(startIndex).fill(undefined).concat(response.data);\n } else if (startIndex === 0) {\n nextRows = response.data.concat(currentData.rows.slice(pageSize));\n }\n } else if (direction === 'forward') {\n // if the new data will exceed the dataset size, then chop off the start or end\n // this keeps the stored dataset to our preferred size\n if (currentData.rows.length >= DATASET_SIZE) {\n nextRows = currentData.rows.slice(DEFAULT_PAGE_SIZE).concat(response.data);\n } else {\n nextRows = currentData.rows.concat(response.data);\n }\n } else if (direction === 'backward') {\n if (currentData.rows.length >= DATASET_SIZE) {\n nextRows = response.data.concat(currentData.rows.slice(0, -1 * pageSize));\n } else {\n nextRows = currentData.rows.concat(response.data);\n }\n }\n\n return {\n rows: nextRows,\n pages: nextPages,\n };\n });\n } catch {\n //\n } finally {\n _hasFetchedAll.current = false;\n // reset pending requests\n delete _pendingPageRequests.current[pageIndex];\n // update the last loaded page\n _lastFetchedPage.current = {\n index: pageIndex,\n direction,\n };\n }\n }\n\n const loadAll = async (\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined,\n hiddenColumns: string[]\n ) => {\n _hasFetchedAll.current = true;\n // set the sorting so we can track if it changed between loads\n _lastUsedSorting.current = sorting;\n // set the filters so we can track if it changed between loads\n _lastUsedFilters.current = filters;\n\n try {\n const response = await fetchAll(sorting, filters, search, hiddenColumns);\n length.current = response.length;\n\n setData({\n rows: response.data,\n pages: Array.from(Array(response.length / pageSize).keys()),\n });\n } catch {\n //\n } finally {\n // reset pending requests\n _pendingPageRequests.current = {};\n }\n };\n\n const invalidate = async () => {\n // reset stuff\n _pendingPageRequests.current = {};\n _hasFetchedAll.current = false;\n\n // load the last page that we scrolled to\n return loadPage(\n getCurrentPage(data.pages, _lastFetchedPage.current),\n _lastUsedSorting.current,\n _lastUsedFilters.current,\n _lastUsedSearch.current,\n _lastUsedHiddenColumns.current,\n true\n );\n };\n\n // search works client side - it fetches all then works client side - so these handlers are a little \"weird\"\n // if a search is currently \"active\", we need to re load all because\n const handleSort = async (sorting: TableColumnSort[]) => {\n _lastUsedSorting.current = sorting;\n // reset stuff\n _pendingPageRequests.current = {};\n _hasFetchedAll.current = false;\n\n return loadPage(\n getCurrentPage(data.pages, _lastFetchedPage.current),\n sorting,\n _lastUsedFilters.current,\n _lastUsedSearch.current,\n _lastUsedHiddenColumns.current,\n true\n );\n };\n const handleFilter = async (filters: TableColumnFilter[], hiddenColumns: string[]) => {\n _lastUsedFilters.current = filters;\n _lastUsedHiddenColumns.current = hiddenColumns;\n\n // reset stuff\n _pendingPageRequests.current = {};\n _hasFetchedAll.current = false;\n\n return loadPage(\n getCurrentPage(data.pages, _lastFetchedPage.current),\n _lastUsedSorting.current,\n filters,\n _lastUsedSearch.current,\n hiddenColumns,\n true\n );\n };\n const handleSearch = async (search: string | undefined, hiddenColumns: string[]) => {\n _lastUsedSearch.current = search;\n _lastUsedHiddenColumns.current = hiddenColumns;\n\n // reset stuff\n _pendingPageRequests.current = {};\n _hasFetchedAll.current = false;\n\n return loadPage(\n getCurrentPage(data.pages, _lastFetchedPage.current),\n _lastUsedSorting.current,\n _lastUsedFilters.current,\n search,\n hiddenColumns,\n true\n );\n };\n\n return [\n {\n data: data.rows,\n pages: data.pages,\n length: length.current,\n loadAll,\n loadPage,\n onChangeFilter: handleFilter,\n onChangeSearch: handleSearch,\n onChangeSort: handleSort,\n pageSize,\n _experimentalDataLoader2: true,\n },\n invalidate,\n ];\n}\n\nfunction getCurrentPage(currentPages: number[], lastFetchedPage: LastFetchedPage): number {\n if (currentPages.length <= 2) {\n return currentPages[0] ?? 0;\n }\n\n const middle = Math.floor(DATASET_SIZE_MULTIPLIER / 2);\n\n if (lastFetchedPage.index) {\n if (!lastFetchedPage.direction) {\n return lastFetchedPage.index;\n }\n\n return lastFetchedPage.direction === 'forward' ? lastFetchedPage.index + middle : lastFetchedPage.index - middle;\n }\n\n return 0;\n}\n\nfunction getDirection2(pageIndex: number, lastUsedPage: LastFetchedPage): Direction {\n if (lastUsedPage.index === undefined) {\n return undefined;\n }\n\n if (pageIndex > lastUsedPage.index) {\n if (lastUsedPage.index + 1 === pageIndex || lastUsedPage.index + DATASET_SIZE_MULTIPLIER === pageIndex) {\n return 'forward';\n }\n } else if (pageIndex < lastUsedPage.index) {\n if (lastUsedPage.index - 1 === pageIndex || lastUsedPage.index - DATASET_SIZE_MULTIPLIER === pageIndex) {\n return 'backward';\n }\n }\n\n return undefined;\n}\n\nfunction getPages(pageIndex: number, lastUsedPage: LastFetchedPage, currentPages: number[], direction: Direction) {\n if (currentPages.length && (pageIndex === lastUsedPage.index || currentPages.includes(pageIndex))) {\n return currentPages;\n }\n\n if (direction === 'forward') {\n const nextPages = currentPages.length === DATASET_SIZE_MULTIPLIER ? currentPages.slice(1) : currentPages;\n return nextPages.concat(pageIndex);\n }\n\n if (direction === 'backward') {\n const nextPages = currentPages.length === DATASET_SIZE_MULTIPLIER ? currentPages.slice(0, -1) : currentPages;\n return [pageIndex].concat(nextPages);\n }\n\n if (pageIndex === 0) {\n return [0];\n }\n\n // don't go forward, the current page will trigger load of the next page\n return [pageIndex - 1, pageIndex];\n}\n"],"names":["DATASET_SIZE_MULTIPLIER","useTableDataLoader2","fetchPage","fetchAll","options","pageSize","DEFAULT_PAGE_SIZE","loadPage","pageIndex","sorting","filters","search","hiddenColumns","reset","_hasFetchedAll","current","Promise","resolve","_pendingPageRequests","data","pages","includes","position","indexOf","rows","undefined","_lastUsedSorting","_lastUsedFilters","direction","getDirection2","_lastFetchedPage","_temp2","_finallyRethrows","_catch","then","response","length","setData","currentData","nextPages","getPages","nextRows","index","startIndex","concat","Array","fill","slice","DATASET_SIZE","_wasThrown2","_result2","e","reject","React","useRef","useState","_lastUsedSearch","_lastUsedHiddenColumns","loadAll","_temp","from","keys","_wasThrown","_result","invalidate","getCurrentPage","handleSort","handleFilter","handleSearch","onChangeFilter","onChangeSearch","onChangeSort","_experimentalDataLoader2","currentPages","lastFetchedPage","_currentPages$","middle","Math","floor","lastUsedPage"],"mappings":";;;;AAYA,MAAMA,uBAAuB,GAAG,EAAE;SAyClBC,mBAAmBA,CAC/BC,SAA0C,EAC1CC,QAAwC,EACxCC,UAAqC;EAAEC,QAAQ,EAAEC;CAAmB;QAqBrDC,QAAQ,aACnBC,SAAiB,EACjBC,OAA0B,EAC1BC,OAA4B,EAC5BC,MAA0B,EAC1BC,aAAuB,EACvBC,KAAK,GAAG,KAAK;IAAA;MAEb,IAAIC,cAAc,CAACC,OAAO,EAAE;QACxB,OAAAC,OAAA,CAAAC,OAAA;;;MAIJ,IAAIC,oBAAoB,CAACH,OAAO,CAACP,SAAS,CAAC,EAAE;QACzC,OAAAQ,OAAA,CAAAC,OAAA;OACH,MAAM;QACHC,oBAAoB,CAACH,OAAO,CAACP,SAAS,CAAC,GAAG,IAAI;;;MAIlD,IAAIW,IAAI,CAACC,KAAK,CAACC,QAAQ,CAACb,SAAS,CAAC,EAAE;QAChC,MAAMc,QAAQ,GAAGH,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":"useTableDataLoader2.js","sources":["../../../../../../../src/primitives/Table/useTableDataLoader2.ts"],"sourcesContent":["import React from 'react';\nimport {\n TableColumnFilter,\n TableColumnSort,\n TableFilterHandler,\n TableServerLoadPageHandler,\n TableServerLoadAllHandler,\n TableSortHandler,\n TableSearchHandler,\n} from './types';\nimport { DEFAULT_PAGE_SIZE, useTableDataLoaderOptions } from './useTableDataLoader';\n\nconst DATASET_SIZE_MULTIPLIER = 15;\n\nexport type useTableDataPageFetcher2<TType = unknown> = (\n pageIndex: number,\n pageSize: number,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined,\n hiddenColumns: string[]\n) => Promise<{ data: TType[]; length: number }>;\n\nexport type useTableDataAllFetcher2<TType = unknown> = (\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined,\n hiddenColumns: string[]\n) => Promise<{ data: TType[]; length: number }>;\n\nexport type useTableDataLoaderValues2<TType = unknown> = {\n data: TType[];\n length: number | undefined;\n loadAll: TableServerLoadAllHandler;\n loadPage: TableServerLoadPageHandler;\n onChangeFilter: TableFilterHandler;\n onChangeSearch: TableSearchHandler;\n onChangeSort: TableSortHandler;\n pageSize: number;\n pages: number[];\n _experimentalDataLoader2: boolean;\n};\n\ntype Data<TType = unknown> = {\n rows: TType[];\n pages: number[];\n};\ntype Direction = 'forward' | 'backward' | undefined;\ntype LastFetchedPage = {\n index: number | undefined;\n direction: Direction;\n};\n\nexport function useTableDataLoader2<TType = unknown>(\n fetchPage: useTableDataPageFetcher2<TType>,\n fetchAll: useTableDataAllFetcher2<TType>,\n options: useTableDataLoaderOptions = { pageSize: DEFAULT_PAGE_SIZE }\n): [useTableDataLoaderValues2<TType>, () => void] {\n const { pageSize } = options;\n const DATASET_SIZE = DATASET_SIZE_MULTIPLIER * pageSize;\n\n // track the data length, we don't know it until the first request\n const length = React.useRef<number>(0);\n // data will be filled after the first request\n const [data, setData] = React.useState<Data<TType>>({ rows: [], pages: [] });\n // track which pages have been loaded to dedupe requests\n const _pendingPageRequests = React.useRef({});\n const _lastUsedSorting = React.useRef<TableColumnSort[]>([]);\n const _lastUsedFilters = React.useRef<TableColumnFilter[]>([]);\n const _lastUsedSearch = React.useRef<string | undefined>();\n const _lastUsedHiddenColumns = React.useRef<string[]>([]);\n const _lastFetchedPage = React.useRef<LastFetchedPage>({\n index: undefined,\n direction: undefined,\n });\n\n async function loadPage(\n pageIndex: number,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined,\n hiddenColumns: string[],\n reset = false\n ) {\n if (_pendingPageRequests.current[pageIndex] && !reset) {\n return;\n }\n\n const hasChangedData =\n JSON.stringify(sorting) !== JSON.stringify(_lastUsedSorting.current) ||\n JSON.stringify(filters) !== JSON.stringify(_lastUsedFilters.current) ||\n search !== _lastUsedSearch.current;\n\n // set values so we can track if they changed between loads\n _lastUsedSorting.current = sorting;\n _lastUsedFilters.current = filters;\n _lastUsedSearch.current = search;\n _lastUsedHiddenColumns.current = hiddenColumns;\n\n // if the page is already loaded and has actual rows, abort\n if (data.pages.includes(pageIndex) && !hasChangedData && !reset) {\n const position = data.pages.indexOf(pageIndex);\n\n if (data.rows[position * pageSize] !== undefined) {\n return;\n }\n }\n\n // set the page as loading, so that subsequent requests don't retrigger it\n _pendingPageRequests.current[pageIndex] = true;\n\n const direction = getDirection2(pageIndex, _lastFetchedPage.current);\n\n try {\n const response = await fetchPage(pageIndex, pageSize, sorting, filters, search, hiddenColumns);\n length.current = response.length;\n\n // update state, here we do some \"magic\" to support \"load in place\"\n setData(currentData => {\n const nextPages = getPages(pageIndex, _lastFetchedPage.current, reset ? [] : currentData.pages, direction);\n let nextRows = currentData.rows;\n\n if (reset || !direction) {\n const index = nextPages.indexOf(pageIndex);\n const startIndex = (index > -1 ? index : 0) * pageSize;\n\n if (reset) {\n nextRows = ([] as TType[]).concat(response.data);\n } else if (startIndex > 0 || pageIndex === 0) {\n nextRows = Array(startIndex).fill(undefined).concat(response.data);\n } else if (startIndex === 0) {\n nextRows = response.data.concat(currentData.rows.slice(pageSize));\n }\n } else if (direction === 'forward') {\n // if the new data will exceed the dataset size, then chop off the start or end\n // this keeps the stored dataset to our preferred size\n if (currentData.rows.length >= DATASET_SIZE) {\n nextRows = currentData.rows.slice(DEFAULT_PAGE_SIZE).concat(response.data);\n } else {\n nextRows = currentData.rows.concat(response.data);\n }\n } else if (direction === 'backward') {\n if (currentData.rows.length >= DATASET_SIZE) {\n nextRows = response.data.concat(currentData.rows.slice(0, -1 * pageSize));\n } else {\n nextRows = currentData.rows.concat(response.data);\n }\n }\n\n return {\n rows: nextRows,\n pages: nextPages,\n };\n });\n } catch {\n //\n } finally {\n // reset pending requests\n delete _pendingPageRequests.current[pageIndex];\n // update the last loaded page\n _lastFetchedPage.current = {\n index: pageIndex,\n direction,\n };\n }\n }\n\n const loadAll = async (\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined,\n hiddenColumns: string[]\n ) => {\n // set values so we can track if they changed between loads\n _lastUsedSorting.current = sorting;\n _lastUsedFilters.current = filters;\n _lastUsedSearch.current = search;\n _lastUsedHiddenColumns.current = hiddenColumns;\n\n try {\n const response = await fetchAll(sorting, filters, search, hiddenColumns);\n length.current = response.length;\n\n setData({\n rows: response.data,\n pages: Array.from(Array(response.length / pageSize).keys()),\n });\n } catch {\n //\n } finally {\n // reset pending requests\n _pendingPageRequests.current = {};\n }\n };\n\n const invalidate = async () => {\n console.log('invalidate');\n // reset stuff\n _pendingPageRequests.current = {};\n\n // load the current page again\n return loadPage(\n getCurrentPage(data.pages, _lastFetchedPage.current),\n _lastUsedSorting.current,\n _lastUsedFilters.current,\n _lastUsedSearch.current,\n _lastUsedHiddenColumns.current,\n true\n );\n };\n\n const handleSort = async (sorting: TableColumnSort[]) => {\n // reset before loading the current page\n _pendingPageRequests.current = {};\n\n return loadPage(\n getCurrentPage(data.pages, _lastFetchedPage.current),\n sorting,\n _lastUsedFilters.current,\n _lastUsedSearch.current,\n _lastUsedHiddenColumns.current,\n true\n );\n };\n const handleFilter = async (filters: TableColumnFilter[], hiddenColumns: string[]) => {\n // reset before loading the current page\n _pendingPageRequests.current = {};\n\n return loadPage(\n getCurrentPage(data.pages, _lastFetchedPage.current),\n _lastUsedSorting.current,\n filters,\n _lastUsedSearch.current,\n hiddenColumns,\n true\n );\n };\n const handleSearch = async (search: string | undefined, hiddenColumns: string[]) => {\n // reset before loading the current page\n _pendingPageRequests.current = {};\n\n return loadPage(\n getCurrentPage(data.pages, _lastFetchedPage.current),\n _lastUsedSorting.current,\n _lastUsedFilters.current,\n search,\n hiddenColumns,\n true\n );\n };\n\n return [\n {\n data: data.rows,\n pages: data.pages,\n length: length.current,\n loadAll,\n loadPage,\n onChangeFilter: handleFilter,\n onChangeSearch: handleSearch,\n onChangeSort: handleSort,\n pageSize,\n _experimentalDataLoader2: true,\n },\n invalidate,\n ];\n}\n\nfunction getCurrentPage(currentPages: number[], lastFetchedPage: LastFetchedPage): number {\n if (currentPages.length <= 2) {\n return currentPages[0] ?? 0;\n }\n\n const middle = Math.floor(DATASET_SIZE_MULTIPLIER / 2);\n\n if (lastFetchedPage.index) {\n if (!lastFetchedPage.direction) {\n return lastFetchedPage.index;\n }\n\n return lastFetchedPage.direction === 'forward' ? lastFetchedPage.index + middle : lastFetchedPage.index - middle;\n }\n\n return 0;\n}\n\nfunction getDirection2(pageIndex: number, lastUsedPage: LastFetchedPage): Direction {\n if (lastUsedPage.index === undefined) {\n return undefined;\n }\n\n if (pageIndex > lastUsedPage.index) {\n if (lastUsedPage.index + 1 === pageIndex || lastUsedPage.index + DATASET_SIZE_MULTIPLIER === pageIndex) {\n return 'forward';\n }\n } else if (pageIndex < lastUsedPage.index) {\n if (lastUsedPage.index - 1 === pageIndex || lastUsedPage.index - DATASET_SIZE_MULTIPLIER === pageIndex) {\n return 'backward';\n }\n }\n\n return undefined;\n}\n\nfunction getPages(pageIndex: number, lastUsedPage: LastFetchedPage, currentPages: number[], direction: Direction) {\n if (currentPages.length && (pageIndex === lastUsedPage.index || currentPages.includes(pageIndex))) {\n return currentPages;\n }\n\n if (direction === 'forward') {\n const nextPages = currentPages.length === DATASET_SIZE_MULTIPLIER ? currentPages.slice(1) : currentPages;\n return nextPages.concat(pageIndex);\n }\n\n if (direction === 'backward') {\n const nextPages = currentPages.length === DATASET_SIZE_MULTIPLIER ? currentPages.slice(0, -1) : currentPages;\n return [pageIndex].concat(nextPages);\n }\n\n if (pageIndex === 0) {\n return [0];\n }\n\n // don't go forward, the current page will trigger load of the next page\n return [pageIndex - 1, pageIndex];\n}\n"],"names":["DATASET_SIZE_MULTIPLIER","useTableDataLoader2","fetchPage","fetchAll","options","loadPage","pageIndex","sorting","filters","search","hiddenColumns","reset","_pendingPageRequests","current","Promise","resolve","hasChangedData","JSON","stringify","_lastUsedSorting","_lastUsedFilters","_lastUsedSearch","_lastUsedHiddenColumns","data","pages","includes","position","indexOf","rows","pageSize","undefined","direction","getDirection2","_lastFetchedPage","_temp2","_finallyRethrows","_catch","then","response","length","setData","currentData","nextPages","getPages","nextRows","index","startIndex","concat","Array","fill","slice","DATASET_SIZE","DEFAULT_PAGE_SIZE","_wasThrown2","_result2","e","reject","_options","React","useRef","_React$useState","useState","loadAll","_temp","from","keys","_wasThrown","_result","invalidate","console","log","getCurrentPage","handleSort","handleFilter","handleSearch","onChangeFilter","onChangeSearch","onChangeSort","_experimentalDataLoader2","currentPages","lastFetchedPage","_currentPages$","middle","Math","floor","lastUsedPage"],"mappings":";;;;AAYA,IAAMA,uBAAuB,GAAG,EAAE;SAyClBC,mBAAmBA,CAC/BC,SAA0C,EAC1CC,QAAwC,EACxCC;MAoBeC,QAAQ,YAARA,QAAQA,CACnBC,SAAiB,EACjBC,OAA0B,EAC1BC,OAA4B,EAC5BC,MAA0B,EAC1BC,aAAuB,EACvBC,KAAK;IAAA,IAALA,KAAK;MAALA,KAAK,GAAG,KAAK;;IAAA;MAEb,IAAIC,oBAAoB,CAACC,OAAO,CAACP,SAAS,CAAC,IAAI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S,CAACK,MAAM,CAACzC,SAAS,CAAC;;EAGtC,IAAIyB,SAAS,KAAK,UAAU,EAAE;IAC1B,IAAMW,UAAS,GAAGqC,YAAY,CAACxC,MAAM,KAAKvC,uBAAuB,GAAG+E,YAAY,CAAC7B,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG6B,YAAY;IAC5G,OAAO,CAACzE,SAAS,CAAC,CAACyC,MAAM,CAACL,UAAS,CAAC;;EAGxC,IAAIpC,SAAS,KAAK,CAAC,EAAE;IACjB,OAAO,CAAC,CAAC,CAAC;;;EAId,OAAO,CAACA,SAAS,GAAG,CAAC,EAAEA,SAAS,CAAC;AACrC;;;;"}
|
@@ -1,9 +1,14 @@
|
|
1
1
|
import React__default from 'react';
|
2
2
|
|
3
3
|
/* column freezing uses the native column pinning feature, this hook is really just a container for scrolled state */
|
4
|
-
function useTableColumnFreezing(isEnabled
|
5
|
-
|
6
|
-
|
4
|
+
function useTableColumnFreezing(isEnabled) {
|
5
|
+
if (isEnabled === void 0) {
|
6
|
+
isEnabled = false;
|
7
|
+
}
|
8
|
+
var _React$useState = React__default.useState(false),
|
9
|
+
isHorizontallyScrolled = _React$useState[0],
|
10
|
+
setHorizontallyScrolled = _React$useState[1];
|
11
|
+
var handleScroll = function handleScroll(event) {
|
7
12
|
if (event.currentTarget.scrollLeft > 0 && !isHorizontallyScrolled) {
|
8
13
|
setHorizontallyScrolled(true);
|
9
14
|
} else if (event.currentTarget.scrollLeft === 0 && isHorizontallyScrolled) {
|
@@ -11,9 +16,9 @@ function useTableColumnFreezing(isEnabled = false) {
|
|
11
16
|
}
|
12
17
|
};
|
13
18
|
return {
|
14
|
-
isEnabled,
|
15
|
-
isHorizontallyScrolled,
|
16
|
-
handleScroll
|
19
|
+
isEnabled: isEnabled,
|
20
|
+
isHorizontallyScrolled: isHorizontallyScrolled,
|
21
|
+
handleScroll: handleScroll
|
17
22
|
};
|
18
23
|
}
|
19
24
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableColumnFreezing.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableColumnFreezing.ts"],"sourcesContent":["import React from 'react';\n\n/* column freezing uses the native column pinning feature, this hook is really just a container for scrolled state */\nexport function useTableColumnFreezing(isEnabled = false) {\n const [isHorizontallyScrolled, setHorizontallyScrolled] = React.useState(false);\n\n const handleScroll = (event: React.MouseEvent<HTMLTableElement>) => {\n if (event.currentTarget.scrollLeft > 0 && !isHorizontallyScrolled) {\n setHorizontallyScrolled(true);\n } else if (event.currentTarget.scrollLeft === 0 && isHorizontallyScrolled) {\n setHorizontallyScrolled(false);\n }\n };\n\n return {\n isEnabled,\n isHorizontallyScrolled,\n handleScroll,\n };\n}\n"],"names":["useTableColumnFreezing","isEnabled","
|
1
|
+
{"version":3,"file":"useTableColumnFreezing.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableColumnFreezing.ts"],"sourcesContent":["import React from 'react';\n\n/* column freezing uses the native column pinning feature, this hook is really just a container for scrolled state */\nexport function useTableColumnFreezing(isEnabled = false) {\n const [isHorizontallyScrolled, setHorizontallyScrolled] = React.useState(false);\n\n const handleScroll = (event: React.MouseEvent<HTMLTableElement>) => {\n if (event.currentTarget.scrollLeft > 0 && !isHorizontallyScrolled) {\n setHorizontallyScrolled(true);\n } else if (event.currentTarget.scrollLeft === 0 && isHorizontallyScrolled) {\n setHorizontallyScrolled(false);\n }\n };\n\n return {\n isEnabled,\n isHorizontallyScrolled,\n handleScroll,\n };\n}\n"],"names":["useTableColumnFreezing","isEnabled","_React$useState","React","useState","isHorizontallyScrolled","setHorizontallyScrolled","handleScroll","event","currentTarget","scrollLeft"],"mappings":";;AAEA;SACgBA,sBAAsBA,CAACC,SAAS;MAATA,SAAS;IAATA,SAAS,GAAG,KAAK;;EACpD,IAAAC,eAAA,GAA0DC,cAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;IAAxEC,sBAAsB,GAAAH,eAAA;IAAEI,uBAAuB,GAAAJ,eAAA;EAEtD,IAAMK,YAAY,GAAG,SAAfA,YAAYA,CAAIC,KAAyC;IAC3D,IAAIA,KAAK,CAACC,aAAa,CAACC,UAAU,GAAG,CAAC,IAAI,CAACL,sBAAsB,EAAE;MAC/DC,uBAAuB,CAAC,IAAI,CAAC;KAChC,MAAM,IAAIE,KAAK,CAACC,aAAa,CAACC,UAAU,KAAK,CAAC,IAAIL,sBAAsB,EAAE;MACvEC,uBAAuB,CAAC,KAAK,CAAC;;GAErC;EAED,OAAO;IACHL,SAAS,EAATA,SAAS;IACTI,sBAAsB,EAAtBA,sBAAsB;IACtBE,YAAY,EAAZA;GACH;AACL;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableColumnOrdering.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableColumnOrdering.ts"],"sourcesContent":["export function useTableColumnOrdering(isEnabled = false) {\n return {\n isEnabled,\n };\n}\n"],"names":["useTableColumnOrdering","isEnabled"],"mappings":"SAAgBA,sBAAsBA,CAACC,SAAS,GAAG,KAAK
|
1
|
+
{"version":3,"file":"useTableColumnOrdering.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableColumnOrdering.ts"],"sourcesContent":["export function useTableColumnOrdering(isEnabled = false) {\n return {\n isEnabled,\n };\n}\n"],"names":["useTableColumnOrdering","isEnabled"],"mappings":"SAAgBA,sBAAsBA,CAACC,SAAS;MAATA,SAAS;IAATA,SAAS,GAAG,KAAK;;EACpD,OAAO;IACHA,SAAS,EAATA;GACH;AACL;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFontSize.js
CHANGED
@@ -1,11 +1,21 @@
|
|
1
1
|
import React__default from 'react';
|
2
2
|
|
3
|
-
function useTableFontSize(isEnabled
|
4
|
-
|
3
|
+
function useTableFontSize(isEnabled, defaultFontSize) {
|
4
|
+
if (isEnabled === void 0) {
|
5
|
+
isEnabled = false;
|
6
|
+
}
|
7
|
+
if (defaultFontSize === void 0) {
|
8
|
+
defaultFontSize = 'medium';
|
9
|
+
}
|
10
|
+
var _React$useState = React__default.useState(defaultFontSize),
|
11
|
+
size = _React$useState[0],
|
12
|
+
setSize = _React$useState[1];
|
5
13
|
return {
|
6
|
-
isEnabled,
|
7
|
-
size,
|
8
|
-
setSize: isEnabled ? setSize : ()
|
14
|
+
isEnabled: isEnabled,
|
15
|
+
size: size,
|
16
|
+
setSize: isEnabled ? setSize : function () {
|
17
|
+
return undefined;
|
18
|
+
}
|
9
19
|
};
|
10
20
|
}
|
11
21
|
|
package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFontSize.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableFontSize.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableFontSize.ts"],"sourcesContent":["import React from 'react';\nimport { FontSize } from '../../../../types';\n\nexport function useTableFontSize(isEnabled = false, defaultFontSize: FontSize = 'medium') {\n const [size, setSize] = React.useState<FontSize>(defaultFontSize);\n\n return {\n isEnabled,\n size,\n setSize: isEnabled ? setSize : () => undefined,\n };\n}\n"],"names":["useTableFontSize","isEnabled","defaultFontSize","
|
1
|
+
{"version":3,"file":"useTableFontSize.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableFontSize.ts"],"sourcesContent":["import React from 'react';\nimport { FontSize } from '../../../../types';\n\nexport function useTableFontSize(isEnabled = false, defaultFontSize: FontSize = 'medium') {\n const [size, setSize] = React.useState<FontSize>(defaultFontSize);\n\n return {\n isEnabled,\n size,\n setSize: isEnabled ? setSize : () => undefined,\n };\n}\n"],"names":["useTableFontSize","isEnabled","defaultFontSize","_React$useState","React","useState","size","setSize","undefined"],"mappings":";;SAGgBA,gBAAgBA,CAACC,SAAS,EAAUC;MAAnBD,SAAS;IAATA,SAAS,GAAG,KAAK;;EAAA,IAAEC;IAAAA,kBAA4B,QAAQ;;EACpF,IAAAC,eAAA,GAAwBC,cAAK,CAACC,QAAQ,CAAWH,eAAe,CAAC;IAA1DI,IAAI,GAAAH,eAAA;IAAEI,OAAO,GAAAJ,eAAA;EAEpB,OAAO;IACHF,SAAS,EAATA,SAAS;IACTK,IAAI,EAAJA,IAAI;IACJC,OAAO,EAAEN,SAAS,GAAGM,OAAO,GAAG;MAAA,OAAMC,SAAS;;GACjD;AACL;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFooter.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableFooter.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableFooter.ts"],"sourcesContent":["export function useTableFooter(isEnabled = false) {\n return {\n isEnabled,\n };\n}\n"],"names":["useTableFooter","isEnabled"],"mappings":"SAAgBA,cAAcA,CAACC,SAAS,GAAG,KAAK
|
1
|
+
{"version":3,"file":"useTableFooter.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableFooter.ts"],"sourcesContent":["export function useTableFooter(isEnabled = false) {\n return {\n isEnabled,\n };\n}\n"],"names":["useTableFooter","isEnabled"],"mappings":"SAAgBA,cAAcA,CAACC,SAAS;MAATA,SAAS;IAATA,SAAS,GAAG,KAAK;;EAC5C,OAAO;IACHA,SAAS,EAATA;GACH;AACL;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTablePrinting.js
CHANGED
@@ -1,33 +1,43 @@
|
|
1
1
|
import React__default from 'react';
|
2
|
+
import { extends as _extends } from '../../../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
3
|
import { useTacoSettings } from '../../../../hooks/useTacoSettings.js';
|
3
4
|
import { useLocalStorage } from '../../../../hooks/useLocalStorage.js';
|
4
5
|
|
5
|
-
function useTablePrinting(isEnabled
|
6
|
-
|
7
|
-
|
6
|
+
function useTablePrinting(isEnabled, tableId) {
|
7
|
+
if (isEnabled === void 0) {
|
8
|
+
isEnabled = false;
|
9
|
+
}
|
10
|
+
var _React$useState = React__default.useState(false),
|
11
|
+
isPrinting = _React$useState[0],
|
12
|
+
setIsPrinting = _React$useState[1];
|
13
|
+
var _useTablePrintingSett = useTablePrintingSettings(tableId),
|
14
|
+
settings = _useTablePrintingSett[0],
|
15
|
+
setSetting = _useTablePrintingSett[1];
|
8
16
|
return {
|
9
|
-
isEnabled,
|
10
|
-
isPrinting,
|
11
|
-
setIsPrinting,
|
12
|
-
settings,
|
13
|
-
setSetting
|
17
|
+
isEnabled: isEnabled,
|
18
|
+
isPrinting: isPrinting,
|
19
|
+
setIsPrinting: setIsPrinting,
|
20
|
+
settings: settings,
|
21
|
+
setSetting: setSetting
|
14
22
|
};
|
15
23
|
}
|
16
|
-
|
24
|
+
var DEFAULT_PRINT_SETTINGS = {
|
17
25
|
size: 'A4',
|
18
26
|
orientation: 'portrait',
|
19
27
|
allRows: true,
|
20
28
|
splitGroups: true
|
21
29
|
};
|
22
30
|
function useTablePrintingSettings(tableId) {
|
23
|
-
|
24
|
-
|
25
|
-
|
31
|
+
var tacoSettings = useTacoSettings();
|
32
|
+
var uniqueId = "taco." + tacoSettings.uniqueUserIdentifier + ".table." + tableId + ".print.settings";
|
33
|
+
var _useLocalStorage = useLocalStorage(uniqueId, DEFAULT_PRINT_SETTINGS),
|
34
|
+
persistedSettings = _useLocalStorage[0],
|
35
|
+
setPersistedSettings = _useLocalStorage[1];
|
26
36
|
function setSetting(key, value) {
|
27
|
-
setPersistedSettings(currentSettings
|
28
|
-
|
29
|
-
[key]
|
30
|
-
})
|
37
|
+
setPersistedSettings(function (currentSettings) {
|
38
|
+
var _extends2;
|
39
|
+
return _extends({}, currentSettings, (_extends2 = {}, _extends2[key] = value, _extends2));
|
40
|
+
});
|
31
41
|
}
|
32
42
|
return [persistedSettings, setSetting];
|
33
43
|
}
|
package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTablePrinting.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTablePrinting.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTablePrinting.ts"],"sourcesContent":["import React from 'react';\nimport { useTacoSettings } from '../../../../hooks/useTacoSettings';\nimport { useLocalStorage } from '../../../../hooks/useLocalStorage';\n\ntype TablePrintSettings = {\n allRows: boolean;\n orientation: 'portrait' | 'landscape';\n size: 'A3' | 'A4' | 'A5' | 'letter' | 'legal';\n splitGroups: boolean;\n};\n\nexport function useTablePrinting(isEnabled = false, tableId: string) {\n const [isPrinting, setIsPrinting] = React.useState(false);\n const [settings, setSetting] = useTablePrintingSettings(tableId);\n\n return {\n isEnabled,\n isPrinting,\n setIsPrinting,\n settings,\n setSetting,\n };\n}\n\nconst DEFAULT_PRINT_SETTINGS: TablePrintSettings = {\n size: 'A4',\n orientation: 'portrait',\n allRows: true,\n splitGroups: true,\n};\n\nfunction useTablePrintingSettings(tableId: string): [TablePrintSettings, (key: keyof TablePrintSettings, value: any) => void] {\n const tacoSettings = useTacoSettings();\n const uniqueId = `taco.${tacoSettings.uniqueUserIdentifier}.table.${tableId}.print.settings`;\n\n const [persistedSettings, setPersistedSettings] = useLocalStorage<TablePrintSettings>(uniqueId, DEFAULT_PRINT_SETTINGS);\n\n function setSetting(key: keyof TablePrintSettings, value: any) {\n setPersistedSettings(currentSettings => ({\n ...currentSettings,\n [key]: value,\n }));\n }\n\n return [persistedSettings, setSetting];\n}\n"],"names":["useTablePrinting","isEnabled","tableId","isPrinting","setIsPrinting","
|
1
|
+
{"version":3,"file":"useTablePrinting.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTablePrinting.ts"],"sourcesContent":["import React from 'react';\nimport { useTacoSettings } from '../../../../hooks/useTacoSettings';\nimport { useLocalStorage } from '../../../../hooks/useLocalStorage';\n\ntype TablePrintSettings = {\n allRows: boolean;\n orientation: 'portrait' | 'landscape';\n size: 'A3' | 'A4' | 'A5' | 'letter' | 'legal';\n splitGroups: boolean;\n};\n\nexport function useTablePrinting(isEnabled = false, tableId: string) {\n const [isPrinting, setIsPrinting] = React.useState(false);\n const [settings, setSetting] = useTablePrintingSettings(tableId);\n\n return {\n isEnabled,\n isPrinting,\n setIsPrinting,\n settings,\n setSetting,\n };\n}\n\nconst DEFAULT_PRINT_SETTINGS: TablePrintSettings = {\n size: 'A4',\n orientation: 'portrait',\n allRows: true,\n splitGroups: true,\n};\n\nfunction useTablePrintingSettings(tableId: string): [TablePrintSettings, (key: keyof TablePrintSettings, value: any) => void] {\n const tacoSettings = useTacoSettings();\n const uniqueId = `taco.${tacoSettings.uniqueUserIdentifier}.table.${tableId}.print.settings`;\n\n const [persistedSettings, setPersistedSettings] = useLocalStorage<TablePrintSettings>(uniqueId, DEFAULT_PRINT_SETTINGS);\n\n function setSetting(key: keyof TablePrintSettings, value: any) {\n setPersistedSettings(currentSettings => ({\n ...currentSettings,\n [key]: value,\n }));\n }\n\n return [persistedSettings, setSetting];\n}\n"],"names":["useTablePrinting","isEnabled","tableId","_React$useState","React","useState","isPrinting","setIsPrinting","_useTablePrintingSett","useTablePrintingSettings","settings","setSetting","DEFAULT_PRINT_SETTINGS","size","orientation","allRows","splitGroups","tacoSettings","useTacoSettings","uniqueId","uniqueUserIdentifier","_useLocalStorage","useLocalStorage","persistedSettings","setPersistedSettings","key","value","currentSettings","_extends2","_extends"],"mappings":";;;;;SAWgBA,gBAAgBA,CAACC,SAAS,EAAUC,OAAe;MAAlCD,SAAS;IAATA,SAAS,GAAG,KAAK;;EAC9C,IAAAE,eAAA,GAAoCC,cAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;IAAlDC,UAAU,GAAAH,eAAA;IAAEI,aAAa,GAAAJ,eAAA;EAChC,IAAAK,qBAAA,GAA+BC,wBAAwB,CAACP,OAAO,CAAC;IAAzDQ,QAAQ,GAAAF,qBAAA;IAAEG,UAAU,GAAAH,qBAAA;EAE3B,OAAO;IACHP,SAAS,EAATA,SAAS;IACTK,UAAU,EAAVA,UAAU;IACVC,aAAa,EAAbA,aAAa;IACbG,QAAQ,EAARA,QAAQ;IACRC,UAAU,EAAVA;GACH;AACL;AAEA,IAAMC,sBAAsB,GAAuB;EAC/CC,IAAI,EAAE,IAAI;EACVC,WAAW,EAAE,UAAU;EACvBC,OAAO,EAAE,IAAI;EACbC,WAAW,EAAE;CAChB;AAED,SAASP,wBAAwBA,CAACP,OAAe;EAC7C,IAAMe,YAAY,GAAGC,eAAe,EAAE;EACtC,IAAMC,QAAQ,aAAWF,YAAY,CAACG,oBAAoB,eAAUlB,OAAO,oBAAiB;EAE5F,IAAAmB,gBAAA,GAAkDC,eAAe,CAAqBH,QAAQ,EAAEP,sBAAsB,CAAC;IAAhHW,iBAAiB,GAAAF,gBAAA;IAAEG,oBAAoB,GAAAH,gBAAA;EAE9C,SAASV,UAAUA,CAACc,GAA6B,EAAEC,KAAU;IACzDF,oBAAoB,CAAC,UAAAG,eAAe;MAAA,IAAAC,SAAA;MAAA,OAAAC,QAAA,KAC7BF,eAAe,GAAAC,SAAA,OAAAA,SAAA,CACjBH,GAAG,IAAGC,KAAK,EAAAE,SAAA;KACd,CAAC;;EAGP,OAAO,CAACL,iBAAiB,EAAEZ,UAAU,CAAC;AAC1C;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActions.js
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
-
|
2
|
-
function useTableRowActions(isEnabled
|
1
|
+
var DEFAULT_ROW_ACTIONS_LENGTH = 4;
|
2
|
+
function useTableRowActions(isEnabled, rowActions, rowActionsLength) {
|
3
|
+
if (isEnabled === void 0) {
|
4
|
+
isEnabled = false;
|
5
|
+
}
|
6
|
+
if (rowActionsLength === void 0) {
|
7
|
+
rowActionsLength = DEFAULT_ROW_ACTIONS_LENGTH;
|
8
|
+
}
|
3
9
|
return {
|
4
|
-
isEnabled,
|
10
|
+
isEnabled: isEnabled,
|
5
11
|
rowActions: isEnabled ? rowActions : undefined,
|
6
12
|
rowActionsLength: rowActions ? Math.min(rowActions.length, rowActionsLength) : 0
|
7
13
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableRowActions.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableRowActions.ts"],"sourcesContent":["import { TableRowActionRenderer } from '../../types';\n\nconst DEFAULT_ROW_ACTIONS_LENGTH = 4;\n\nexport function useTableRowActions<TType = unknown>(\n isEnabled = false,\n rowActions?: TableRowActionRenderer<TType>[],\n rowActionsLength = DEFAULT_ROW_ACTIONS_LENGTH\n) {\n return {\n isEnabled,\n rowActions: isEnabled ? rowActions : undefined,\n rowActionsLength: rowActions ? Math.min(rowActions.length, rowActionsLength) : 0,\n };\n}\n"],"names":["DEFAULT_ROW_ACTIONS_LENGTH","useTableRowActions","isEnabled","rowActions","rowActionsLength","undefined","Math","min","length"],"mappings":"AAEA,
|
1
|
+
{"version":3,"file":"useTableRowActions.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableRowActions.ts"],"sourcesContent":["import { TableRowActionRenderer } from '../../types';\n\nconst DEFAULT_ROW_ACTIONS_LENGTH = 4;\n\nexport function useTableRowActions<TType = unknown>(\n isEnabled = false,\n rowActions?: TableRowActionRenderer<TType>[],\n rowActionsLength = DEFAULT_ROW_ACTIONS_LENGTH\n) {\n return {\n isEnabled,\n rowActions: isEnabled ? rowActions : undefined,\n rowActionsLength: rowActions ? Math.min(rowActions.length, rowActionsLength) : 0,\n };\n}\n"],"names":["DEFAULT_ROW_ACTIONS_LENGTH","useTableRowActions","isEnabled","rowActions","rowActionsLength","undefined","Math","min","length"],"mappings":"AAEA,IAAMA,0BAA0B,GAAG,CAAC;SAEpBC,kBAAkBA,CAC9BC,SAAS,EACTC,UAA4C,EAC5CC,gBAAgB;MAFhBF,SAAS;IAATA,SAAS,GAAG,KAAK;;EAAA,IAEjBE,gBAAgB;IAAhBA,gBAAgB,GAAGJ,0BAA0B;;EAE7C,OAAO;IACHE,SAAS,EAATA,SAAS;IACTC,UAAU,EAAED,SAAS,GAAGC,UAAU,GAAGE,SAAS;IAC9CD,gBAAgB,EAAED,UAAU,GAAGG,IAAI,CAACC,GAAG,CAACJ,UAAU,CAACK,MAAM,EAAEJ,gBAAgB,CAAC,GAAG;GAClF;AACL;;;;"}
|