@economic/taco 2.47.0-server.4 → 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 +2 -2
- 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/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 +21 -25
- 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 +29 -30
- 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 +136 -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 +12 -10
- 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 +12 -12
- 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 +34 -29
- 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 +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/FilterContext.js.map +1 -1
- 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 +54 -39
- 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 -37
- 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 +20 -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 +50 -41
- 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/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 -24
- 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/taco.cjs.development.js +7857 -6877
- 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 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableServerLoading.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableServerLoading.ts"],"sourcesContent":["import React from 'react';\nimport { TableServerLoadAllHandler, TableServerLoadAllState, TableServerLoadPageHandler } from '../../types';\nimport { DEFAULT_PAGE_SIZE } from '../../useTableDataLoader';\n\nexport function useTableServerLoading(\n length: number,\n loadPage?: TableServerLoadPageHandler,\n loadAll?: TableServerLoadAllHandler,\n pages?: number[],\n pageSize = DEFAULT_PAGE_SIZE,\n _experimentalDataLoader2 = false\n) {\n const isEnabled = !!loadPage && !!loadAll;\n const [isReady, setReady] = React.useState(false);\n const [loadAllStatus, setLoadedStatus] = React.useState<TableServerLoadAllState>(TableServerLoadAllState.Incomplete);\n\n let _loadPage: TableServerLoadPageHandler | undefined;\n let _loadAll: TableServerLoadAllHandler | undefined;\n let _loadAllIfNeeded: TableServerLoadAllHandler | undefined;\n\n if (typeof loadPage === 'function') {\n _loadPage = async (...args) => {\n if (typeof loadPage === 'function') {\n await loadPage(...args);\n setReady(true);\n }\n };\n }\n\n if (typeof loadAll === 'function') {\n _loadAll = async (...args) => {\n if (typeof loadAll === 'function') {\n setLoadedStatus(TableServerLoadAllState.Loading);\n await loadAll(...args);\n setLoadedStatus(TableServerLoadAllState.Completed);\n setReady(true);\n }\n };\n\n _loadAllIfNeeded = async (...args) => {\n if (loadAllStatus === TableServerLoadAllState.Incomplete) {\n await _loadAll?.(...args);\n }\n };\n }\n\n const pageCount = Math.ceil(length / pageSize);\n\n return {\n pages,\n isEnabled,\n isReady,\n loadPage: _loadPage,\n loadAll: _loadAll,\n loadAllIfNeeded: _loadAllIfNeeded,\n loadAllStatus,\n pageSize,\n pageCount,\n _experimentalDataLoader2,\n };\n}\n"],"names":["useTableServerLoading","length","loadPage","loadAll","pages","pageSize","
|
1
|
+
{"version":3,"file":"useTableServerLoading.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableServerLoading.ts"],"sourcesContent":["import React from 'react';\nimport { TableServerLoadAllHandler, TableServerLoadAllState, TableServerLoadPageHandler } from '../../types';\nimport { DEFAULT_PAGE_SIZE } from '../../useTableDataLoader';\n\nexport function useTableServerLoading(\n length: number,\n loadPage?: TableServerLoadPageHandler,\n loadAll?: TableServerLoadAllHandler,\n pages?: number[],\n pageSize = DEFAULT_PAGE_SIZE,\n _experimentalDataLoader2 = false\n) {\n const isEnabled = !!loadPage && !!loadAll;\n const [isReady, setReady] = React.useState(false);\n const [loadAllStatus, setLoadedStatus] = React.useState<TableServerLoadAllState>(TableServerLoadAllState.Incomplete);\n\n let _loadPage: TableServerLoadPageHandler | undefined;\n let _loadAll: TableServerLoadAllHandler | undefined;\n let _loadAllIfNeeded: TableServerLoadAllHandler | undefined;\n\n if (typeof loadPage === 'function') {\n _loadPage = async (...args) => {\n if (typeof loadPage === 'function') {\n await loadPage(...args);\n setReady(true);\n }\n };\n }\n\n if (typeof loadAll === 'function') {\n _loadAll = async (...args) => {\n if (typeof loadAll === 'function') {\n setLoadedStatus(TableServerLoadAllState.Loading);\n await loadAll(...args);\n setLoadedStatus(TableServerLoadAllState.Completed);\n setReady(true);\n }\n };\n\n _loadAllIfNeeded = async (...args) => {\n if (loadAllStatus === TableServerLoadAllState.Incomplete) {\n await _loadAll?.(...args);\n }\n };\n }\n\n const pageCount = Math.ceil(length / pageSize);\n\n return {\n pages,\n isEnabled,\n isReady,\n loadPage: _loadPage,\n loadAll: _loadAll,\n loadAllIfNeeded: _loadAllIfNeeded,\n loadAllStatus,\n pageSize,\n pageCount,\n _experimentalDataLoader2,\n };\n}\n"],"names":["useTableServerLoading","length","loadPage","loadAll","pages","pageSize","_experimentalDataLoader2","DEFAULT_PAGE_SIZE","isEnabled","_React$useState","React","useState","isReady","setReady","_React$useState2","TableServerLoadAllState","Incomplete","loadAllStatus","setLoadedStatus","_loadPage","_loadAll","_loadAllIfNeeded","_len","arguments","args","Array","_key","Promise","resolve","apply","then","_temp","e","reject","_len2","_key2","Loading","Completed","_temp2","_len3","_key3","_loadAll2","_temp3","pageCount","Math","ceil","loadAllIfNeeded"],"mappings":";;;;SAIgBA,qBAAqBA,CACjCC,MAAc,EACdC,QAAqC,EACrCC,OAAmC,EACnCC,KAAgB,EAChBC,QAAQ,EACRC,wBAAwB;MADxBD,QAAQ;IAARA,QAAQ,GAAGE,iBAAiB;;EAAA,IAC5BD,wBAAwB;IAAxBA,wBAAwB,GAAG,KAAK;;EAEhC,IAAME,SAAS,GAAG,CAAC,CAACN,QAAQ,IAAI,CAAC,CAACC,OAAO;EACzC,IAAAM,eAAA,GAA4BC,cAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;IAA1CC,OAAO,GAAAH,eAAA;IAAEI,QAAQ,GAAAJ,eAAA;EACxB,IAAAK,gBAAA,GAAyCJ,cAAK,CAACC,QAAQ,CAA0BI,uBAAuB,CAACC,UAAU,CAAC;IAA7GC,aAAa,GAAAH,gBAAA;IAAEI,eAAe,GAAAJ,gBAAA;EAErC,IAAIK,SAAiD;EACrD,IAAIC,QAA+C;EACnD,IAAIC,gBAAuD;EAE3D,IAAI,OAAOnB,QAAQ,KAAK,UAAU,EAAE;IAChCiB,SAAS,YAAAA;MAAA,SAAAG,IAAA,GAAAC,SAAA,CAAAtB,MAAA,EAAauB,IAAI,OAAAC,KAAA,CAAAH,IAAA,GAAAI,IAAA,MAAAA,IAAA,GAAAJ,IAAA,EAAAI,IAAA;QAAJF,IAAI,CAAAE,IAAA,IAAAH,SAAA,CAAAG,IAAA;;MAAA;;cAClB,OAAOxB,QAAQ,KAAK,UAAU;YAAA,OAAAyB,OAAA,CAAAC,OAAA,CACxB1B,QAAQ,CAAA2B,KAAA,SAAIL,IAAI,CAAC,EAAAM,IAAA;cACvBjB,QAAQ,CAAC,IAAI,CAAC;;;;QAAC,OAAAc,OAAA,CAAAC,OAAA,CAAAG,KAAA,IAAAA,KAAA,CAAAD,IAAA,GAAAC,KAAA,CAAAD,IAAA;OAEtB,QAAAE,CAAA;QAAA,OAAAL,OAAA,CAAAM,MAAA,CAAAD,CAAA;;;;EAGL,IAAI,OAAO7B,OAAO,KAAK,UAAU,EAAE;IAC/BiB,QAAQ,YAAAA;MAAA,SAAAc,KAAA,GAAAX,SAAA,CAAAtB,MAAA,EAAauB,IAAI,OAAAC,KAAA,CAAAS,KAAA,GAAAC,KAAA,MAAAA,KAAA,GAAAD,KAAA,EAAAC,KAAA;QAAJX,IAAI,CAAAW,KAAA,IAAAZ,SAAA,CAAAY,KAAA;;MAAA;;cACjB,OAAOhC,OAAO,KAAK,UAAU;YAC7Be,eAAe,CAACH,uBAAuB,CAACqB,OAAO,CAAC;YAAC,OAAAT,OAAA,CAAAC,OAAA,CAC3CzB,OAAO,CAAA0B,KAAA,SAAIL,IAAI,CAAC,EAAAM,IAAA;cACtBZ,eAAe,CAACH,uBAAuB,CAACsB,SAAS,CAAC;cAClDxB,QAAQ,CAAC,IAAI,CAAC;;;;QAAC,OAAAc,OAAA,CAAAC,OAAA,CAAAU,MAAA,IAAAA,MAAA,CAAAR,IAAA,GAAAQ,MAAA,CAAAR,IAAA;OAEtB,QAAAE,CAAA;QAAA,OAAAL,OAAA,CAAAM,MAAA,CAAAD,CAAA;;;IAEDX,gBAAgB,YAAAA;MAAA,SAAAkB,KAAA,GAAAhB,SAAA,CAAAtB,MAAA,EAAauB,IAAI,OAAAC,KAAA,CAAAc,KAAA,GAAAC,KAAA,MAAAA,KAAA,GAAAD,KAAA,EAAAC,KAAA;QAAJhB,IAAI,CAAAgB,KAAA,IAAAjB,SAAA,CAAAiB,KAAA;;MAAA;;cACzBvB,aAAa,KAAKF,uBAAuB,CAACC,UAAU;YAAA,IAAAyB,SAAA;YAAA,OAAAd,OAAA,CAAAC,OAAA,EAAAa,SAAA,GAC9CrB,QAAQ,cAAAqB,SAAA,uBAARA,SAAA,CAAAZ,KAAA,SAAcL,IAAI,CAAC,EAAAM,IAAA;;;QAAA,OAAAH,OAAA,CAAAC,OAAA,CAAAc,MAAA,IAAAA,MAAA,CAAAZ,IAAA,GAAAY,MAAA,CAAAZ,IAAA;OAEhC,QAAAE,CAAA;QAAA,OAAAL,OAAA,CAAAM,MAAA,CAAAD,CAAA;;;;EAGL,IAAMW,SAAS,GAAGC,IAAI,CAACC,IAAI,CAAC5C,MAAM,GAAGI,QAAQ,CAAC;EAE9C,OAAO;IACHD,KAAK,EAALA,KAAK;IACLI,SAAS,EAATA,SAAS;IACTI,OAAO,EAAPA,OAAO;IACPV,QAAQ,EAAEiB,SAAS;IACnBhB,OAAO,EAAEiB,QAAQ;IACjB0B,eAAe,EAAEzB,gBAAgB;IACjCJ,aAAa,EAAbA,aAAa;IACbZ,QAAQ,EAARA,QAAQ;IACRsC,SAAS,EAATA,SAAS;IACTrC,wBAAwB,EAAxBA;GACH;AACL;;;;"}
|
package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSettings.js
CHANGED
@@ -1,8 +1,9 @@
|
|
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
|
-
|
6
|
+
var DEFAULT_ENABLED_OPTIONS = {
|
6
7
|
columnOrder: true,
|
7
8
|
columnPinning: true,
|
8
9
|
columnSizing: true,
|
@@ -14,50 +15,59 @@ const DEFAULT_ENABLED_OPTIONS = {
|
|
14
15
|
sorting: true
|
15
16
|
};
|
16
17
|
function useUniqueTableId(tableId) {
|
17
|
-
|
18
|
-
return
|
18
|
+
var tacoSettings = useTacoSettings();
|
19
|
+
return "taco." + tacoSettings.uniqueUserIdentifier + ".table." + tableId + ".settings";
|
19
20
|
}
|
20
21
|
function useEnabledSettings(isEnabled) {
|
21
|
-
return React__default.useMemo(()
|
22
|
+
return React__default.useMemo(function () {
|
22
23
|
if (isEnabled === false) {
|
23
|
-
return [Object.keys(DEFAULT_ENABLED_OPTIONS).reduce((o, key)
|
24
|
-
|
25
|
-
[key]
|
26
|
-
}
|
24
|
+
return [Object.keys(DEFAULT_ENABLED_OPTIONS).reduce(function (o, key) {
|
25
|
+
var _extends2;
|
26
|
+
return _extends({}, o, (_extends2 = {}, _extends2[key] = false, _extends2));
|
27
|
+
}, {}), false];
|
27
28
|
} else if (isEnabled === true) {
|
28
29
|
return [DEFAULT_ENABLED_OPTIONS, true];
|
29
30
|
}
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
};
|
34
|
-
return [options, Object.values(options).some(o => o === true)];
|
31
|
+
var options = _extends({}, DEFAULT_ENABLED_OPTIONS, isEnabled);
|
32
|
+
return [options, Object.values(options).some(function (o) {
|
33
|
+
return o === true;
|
34
|
+
})];
|
35
35
|
}, [isEnabled]);
|
36
36
|
}
|
37
|
-
function useTableSettings(isEnabled
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
function useTableSettings(isEnabled, id, defaultSettings, onChangeSettings) {
|
38
|
+
if (isEnabled === void 0) {
|
39
|
+
isEnabled = false;
|
40
|
+
}
|
41
|
+
if (defaultSettings === void 0) {
|
42
|
+
defaultSettings = {};
|
43
|
+
}
|
44
|
+
var uniqueId = useUniqueTableId(id);
|
45
|
+
var _useEnabledSettings = useEnabledSettings(isEnabled),
|
46
|
+
enabledSettings = _useEnabledSettings[0],
|
47
|
+
hasSomeEnabledSettings = _useEnabledSettings[1];
|
48
|
+
var _useLocalStorage = useLocalStorage(hasSomeEnabledSettings ? uniqueId : undefined, removeDisabledSettings(defaultSettings, enabledSettings)),
|
49
|
+
persistedSettings = _useLocalStorage[0],
|
50
|
+
_setPersistedSettings = _useLocalStorage[1];
|
51
|
+
var setPersistedSettings = React__default.useCallback(function (value) {
|
42
52
|
if (!hasSomeEnabledSettings) {
|
43
53
|
return;
|
44
54
|
}
|
45
|
-
|
55
|
+
var sanitizedSettings = removeDisabledSettings(value, enabledSettings);
|
46
56
|
_setPersistedSettings(sanitizedSettings);
|
47
57
|
if (typeof onChangeSettings === 'function') {
|
48
58
|
onChangeSettings(sanitizedSettings);
|
49
59
|
}
|
50
60
|
}, [hasSomeEnabledSettings, onChangeSettings, JSON.stringify(enabledSettings)]);
|
51
61
|
if (!hasSomeEnabledSettings) {
|
52
|
-
return [defaultSettings, ()
|
62
|
+
return [defaultSettings, function () {
|
63
|
+
return undefined;
|
64
|
+
}];
|
53
65
|
}
|
54
66
|
return [persistedSettings, setPersistedSettings];
|
55
67
|
}
|
56
68
|
function removeDisabledSettings(settings, enabledSettings) {
|
57
|
-
|
58
|
-
|
59
|
-
};
|
60
|
-
Object.keys(enabledSettings).forEach(setting => {
|
69
|
+
var sanitizedSettings = _extends({}, settings);
|
70
|
+
Object.keys(enabledSettings).forEach(function (setting) {
|
61
71
|
if (!enabledSettings[setting]) {
|
62
72
|
delete sanitizedSettings[setting];
|
63
73
|
}
|
package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSettings.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableSettings.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableSettings.ts"],"sourcesContent":["import React from 'react';\nimport { useLocalStorage } from '../../../../hooks/useLocalStorage';\nimport { useTacoSettings } from '../../../../hooks/useTacoSettings';\nimport { TableEnableSettingsOptions, TableSettings, TableSettingsHandler } from '../../types';\n\nconst DEFAULT_ENABLED_OPTIONS = {\n columnOrder: true,\n columnPinning: true,\n columnSizing: true,\n columnVisibility: true,\n excludeUnmatchedRecordsInSearch: true,\n fontSize: true,\n grouping: true,\n rowHeight: true,\n sorting: true,\n};\n\nexport function useUniqueTableId(tableId: string) {\n const tacoSettings = useTacoSettings();\n return `taco.${tacoSettings.uniqueUserIdentifier}.table.${tableId}.settings`;\n}\n\nfunction useEnabledSettings(isEnabled: boolean | Partial<TableEnableSettingsOptions>): [TableEnableSettingsOptions, boolean] {\n return React.useMemo(() => {\n if (isEnabled === false) {\n return [\n Object.keys(DEFAULT_ENABLED_OPTIONS).reduce(\n (o, key) => ({ ...o, [key]: false }),\n {}\n ) as TableEnableSettingsOptions,\n false,\n ];\n } else if (isEnabled === true) {\n return [DEFAULT_ENABLED_OPTIONS, true];\n }\n\n const options = { ...DEFAULT_ENABLED_OPTIONS, ...isEnabled };\n return [options, Object.values(options).some(o => o === true)];\n }, [isEnabled]);\n}\n\nexport function useTableSettings(\n isEnabled: boolean | Partial<TableEnableSettingsOptions> = false,\n id: string,\n defaultSettings: TableSettings | undefined = {},\n onChangeSettings: TableSettingsHandler | undefined\n): [TableSettings, TableSettingsHandler] {\n const uniqueId = useUniqueTableId(id);\n const [enabledSettings, hasSomeEnabledSettings] = useEnabledSettings(isEnabled);\n\n const [persistedSettings, _setPersistedSettings] = useLocalStorage<TableSettings>(\n hasSomeEnabledSettings ? uniqueId : undefined,\n removeDisabledSettings(defaultSettings, enabledSettings)\n );\n\n const setPersistedSettings = React.useCallback(\n (value: TableSettings) => {\n if (!hasSomeEnabledSettings) {\n return;\n }\n\n const sanitizedSettings = removeDisabledSettings(value, enabledSettings);\n _setPersistedSettings(sanitizedSettings);\n\n if (typeof onChangeSettings === 'function') {\n onChangeSettings(sanitizedSettings);\n }\n },\n [hasSomeEnabledSettings, onChangeSettings, JSON.stringify(enabledSettings)]\n );\n\n if (!hasSomeEnabledSettings) {\n return [defaultSettings, () => undefined];\n }\n\n return [persistedSettings, setPersistedSettings];\n}\n\nfunction removeDisabledSettings(settings: TableSettings, enabledSettings: TableEnableSettingsOptions) {\n const sanitizedSettings: TableSettings = { ...settings };\n\n Object.keys(enabledSettings).forEach(setting => {\n if (!enabledSettings[setting]) {\n delete sanitizedSettings[setting];\n }\n });\n\n return sanitizedSettings;\n}\n"],"names":["DEFAULT_ENABLED_OPTIONS","columnOrder","columnPinning","columnSizing","columnVisibility","excludeUnmatchedRecordsInSearch","fontSize","grouping","rowHeight","sorting","useUniqueTableId","tableId","tacoSettings","useTacoSettings","uniqueUserIdentifier","useEnabledSettings","isEnabled","React","useMemo","Object","keys","reduce","o","key","options","values","some","useTableSettings","id","defaultSettings","onChangeSettings","uniqueId","
|
1
|
+
{"version":3,"file":"useTableSettings.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableSettings.ts"],"sourcesContent":["import React from 'react';\nimport { useLocalStorage } from '../../../../hooks/useLocalStorage';\nimport { useTacoSettings } from '../../../../hooks/useTacoSettings';\nimport { TableEnableSettingsOptions, TableSettings, TableSettingsHandler } from '../../types';\n\nconst DEFAULT_ENABLED_OPTIONS = {\n columnOrder: true,\n columnPinning: true,\n columnSizing: true,\n columnVisibility: true,\n excludeUnmatchedRecordsInSearch: true,\n fontSize: true,\n grouping: true,\n rowHeight: true,\n sorting: true,\n};\n\nexport function useUniqueTableId(tableId: string) {\n const tacoSettings = useTacoSettings();\n return `taco.${tacoSettings.uniqueUserIdentifier}.table.${tableId}.settings`;\n}\n\nfunction useEnabledSettings(isEnabled: boolean | Partial<TableEnableSettingsOptions>): [TableEnableSettingsOptions, boolean] {\n return React.useMemo(() => {\n if (isEnabled === false) {\n return [\n Object.keys(DEFAULT_ENABLED_OPTIONS).reduce(\n (o, key) => ({ ...o, [key]: false }),\n {}\n ) as TableEnableSettingsOptions,\n false,\n ];\n } else if (isEnabled === true) {\n return [DEFAULT_ENABLED_OPTIONS, true];\n }\n\n const options = { ...DEFAULT_ENABLED_OPTIONS, ...isEnabled };\n return [options, Object.values(options).some(o => o === true)];\n }, [isEnabled]);\n}\n\nexport function useTableSettings(\n isEnabled: boolean | Partial<TableEnableSettingsOptions> = false,\n id: string,\n defaultSettings: TableSettings | undefined = {},\n onChangeSettings: TableSettingsHandler | undefined\n): [TableSettings, TableSettingsHandler] {\n const uniqueId = useUniqueTableId(id);\n const [enabledSettings, hasSomeEnabledSettings] = useEnabledSettings(isEnabled);\n\n const [persistedSettings, _setPersistedSettings] = useLocalStorage<TableSettings>(\n hasSomeEnabledSettings ? uniqueId : undefined,\n removeDisabledSettings(defaultSettings, enabledSettings)\n );\n\n const setPersistedSettings = React.useCallback(\n (value: TableSettings) => {\n if (!hasSomeEnabledSettings) {\n return;\n }\n\n const sanitizedSettings = removeDisabledSettings(value, enabledSettings);\n _setPersistedSettings(sanitizedSettings);\n\n if (typeof onChangeSettings === 'function') {\n onChangeSettings(sanitizedSettings);\n }\n },\n [hasSomeEnabledSettings, onChangeSettings, JSON.stringify(enabledSettings)]\n );\n\n if (!hasSomeEnabledSettings) {\n return [defaultSettings, () => undefined];\n }\n\n return [persistedSettings, setPersistedSettings];\n}\n\nfunction removeDisabledSettings(settings: TableSettings, enabledSettings: TableEnableSettingsOptions) {\n const sanitizedSettings: TableSettings = { ...settings };\n\n Object.keys(enabledSettings).forEach(setting => {\n if (!enabledSettings[setting]) {\n delete sanitizedSettings[setting];\n }\n });\n\n return sanitizedSettings;\n}\n"],"names":["DEFAULT_ENABLED_OPTIONS","columnOrder","columnPinning","columnSizing","columnVisibility","excludeUnmatchedRecordsInSearch","fontSize","grouping","rowHeight","sorting","useUniqueTableId","tableId","tacoSettings","useTacoSettings","uniqueUserIdentifier","useEnabledSettings","isEnabled","React","useMemo","Object","keys","reduce","o","key","_extends2","_extends","options","values","some","useTableSettings","id","defaultSettings","onChangeSettings","uniqueId","_useEnabledSettings","enabledSettings","hasSomeEnabledSettings","_useLocalStorage","useLocalStorage","undefined","removeDisabledSettings","persistedSettings","_setPersistedSettings","setPersistedSettings","useCallback","value","sanitizedSettings","JSON","stringify","settings","forEach","setting"],"mappings":";;;;;AAKA,IAAMA,uBAAuB,GAAG;EAC5BC,WAAW,EAAE,IAAI;EACjBC,aAAa,EAAE,IAAI;EACnBC,YAAY,EAAE,IAAI;EAClBC,gBAAgB,EAAE,IAAI;EACtBC,+BAA+B,EAAE,IAAI;EACrCC,QAAQ,EAAE,IAAI;EACdC,QAAQ,EAAE,IAAI;EACdC,SAAS,EAAE,IAAI;EACfC,OAAO,EAAE;CACZ;SAEeC,gBAAgBA,CAACC,OAAe;EAC5C,IAAMC,YAAY,GAAGC,eAAe,EAAE;EACtC,iBAAeD,YAAY,CAACE,oBAAoB,eAAUH,OAAO;AACrE;AAEA,SAASI,kBAAkBA,CAACC,SAAwD;EAChF,OAAOC,cAAK,CAACC,OAAO,CAAC;IACjB,IAAIF,SAAS,KAAK,KAAK,EAAE;MACrB,OAAO,CACHG,MAAM,CAACC,IAAI,CAACpB,uBAAuB,CAAC,CAACqB,MAAM,CACvC,UAACC,CAAC,EAAEC,GAAG;QAAA,IAAAC,SAAA;QAAA,OAAAC,QAAA,KAAWH,CAAC,GAAAE,SAAA,OAAAA,SAAA,CAAGD,GAAG,IAAG,KAAK,EAAAC,SAAA;OAAG,EACpC,EAAE,CACyB,EAC/B,KAAK,CACR;KACJ,MAAM,IAAIR,SAAS,KAAK,IAAI,EAAE;MAC3B,OAAO,CAAChB,uBAAuB,EAAE,IAAI,CAAC;;IAG1C,IAAM0B,OAAO,GAAAD,QAAA,KAAQzB,uBAAuB,EAAKgB,SAAS,CAAE;IAC5D,OAAO,CAACU,OAAO,EAAEP,MAAM,CAACQ,MAAM,CAACD,OAAO,CAAC,CAACE,IAAI,CAAC,UAAAN,CAAC;MAAA,OAAIA,CAAC,KAAK,IAAI;MAAC,CAAC;GACjE,EAAE,CAACN,SAAS,CAAC,CAAC;AACnB;SAEgBa,gBAAgBA,CAC5Bb,WACAc,EAAU,EACVC,iBACAC,gBAAkD;MAHlDhB;IAAAA,YAA2D,KAAK;;EAAA,IAEhEe;IAAAA,kBAA6C,EAAE;;EAG/C,IAAME,QAAQ,GAAGvB,gBAAgB,CAACoB,EAAE,CAAC;EACrC,IAAAI,mBAAA,GAAkDnB,kBAAkB,CAACC,SAAS,CAAC;IAAxEmB,eAAe,GAAAD,mBAAA;IAAEE,sBAAsB,GAAAF,mBAAA;EAE9C,IAAAG,gBAAA,GAAmDC,eAAe,CAC9DF,sBAAsB,GAAGH,QAAQ,GAAGM,SAAS,EAC7CC,sBAAsB,CAACT,eAAe,EAAEI,eAAe,CAAC,CAC3D;IAHMM,iBAAiB,GAAAJ,gBAAA;IAAEK,qBAAqB,GAAAL,gBAAA;EAK/C,IAAMM,oBAAoB,GAAG1B,cAAK,CAAC2B,WAAW,CAC1C,UAACC,KAAoB;IACjB,IAAI,CAACT,sBAAsB,EAAE;MACzB;;IAGJ,IAAMU,iBAAiB,GAAGN,sBAAsB,CAACK,KAAK,EAAEV,eAAe,CAAC;IACxEO,qBAAqB,CAACI,iBAAiB,CAAC;IAExC,IAAI,OAAOd,gBAAgB,KAAK,UAAU,EAAE;MACxCA,gBAAgB,CAACc,iBAAiB,CAAC;;GAE1C,EACD,CAACV,sBAAsB,EAAEJ,gBAAgB,EAAEe,IAAI,CAACC,SAAS,CAACb,eAAe,CAAC,CAAC,CAC9E;EAED,IAAI,CAACC,sBAAsB,EAAE;IACzB,OAAO,CAACL,eAAe,EAAE;MAAA,OAAMQ,SAAS;MAAC;;EAG7C,OAAO,CAACE,iBAAiB,EAAEE,oBAAoB,CAAC;AACpD;AAEA,SAASH,sBAAsBA,CAACS,QAAuB,EAAEd,eAA2C;EAChG,IAAMW,iBAAiB,GAAArB,QAAA,KAAuBwB,QAAQ,CAAE;EAExD9B,MAAM,CAACC,IAAI,CAACe,eAAe,CAAC,CAACe,OAAO,CAAC,UAAAC,OAAO;IACxC,IAAI,CAAChB,eAAe,CAACgB,OAAO,CAAC,EAAE;MAC3B,OAAOL,iBAAiB,CAACK,OAAO,CAAC;;GAExC,CAAC;EAEF,OAAOL,iBAAiB;AAC5B;;;;"}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { useLazyEffect } from '../../../../hooks/useLazyEffect.js';
|
2
2
|
|
3
3
|
function useTableDataListener(table) {
|
4
|
-
|
5
|
-
|
6
|
-
useLazyEffect(()
|
7
|
-
|
4
|
+
var meta = table.options.meta;
|
5
|
+
var rows = table.getRowModel().rows;
|
6
|
+
useLazyEffect(function () {
|
7
|
+
var rowActiveIndex = meta.rowActive.rowActiveIndex;
|
8
8
|
if (rowActiveIndex !== undefined && rowActiveIndex > rows.length) {
|
9
9
|
meta.rowActive.setRowActiveIndex(0);
|
10
10
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableDataListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableDataListener.ts"],"sourcesContent":["import { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\n\nexport function useTableDataListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const rows = table.getRowModel().rows;\n\n useLazyEffect(() => {\n const rowActiveIndex = meta.rowActive.rowActiveIndex;\n\n if (rowActiveIndex !== undefined && rowActiveIndex > rows.length) {\n meta.rowActive.setRowActiveIndex(0);\n }\n }, [rows.length]);\n}\n"],"names":["useTableDataListener","table","meta","options","rows","getRowModel","useLazyEffect","rowActiveIndex","rowActive","undefined","length","setRowActiveIndex"],"mappings":";;SAGgBA,oBAAoBA,CAAkBC,KAAwB;EAC1E,
|
1
|
+
{"version":3,"file":"useTableDataListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableDataListener.ts"],"sourcesContent":["import { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\n\nexport function useTableDataListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const rows = table.getRowModel().rows;\n\n useLazyEffect(() => {\n const rowActiveIndex = meta.rowActive.rowActiveIndex;\n\n if (rowActiveIndex !== undefined && rowActiveIndex > rows.length) {\n meta.rowActive.setRowActiveIndex(0);\n }\n }, [rows.length]);\n}\n"],"names":["useTableDataListener","table","meta","options","rows","getRowModel","useLazyEffect","rowActiveIndex","rowActive","undefined","length","setRowActiveIndex"],"mappings":";;SAGgBA,oBAAoBA,CAAkBC,KAAwB;EAC1E,IAAMC,IAAI,GAAGD,KAAK,CAACE,OAAO,CAACD,IAA6B;EACxD,IAAME,IAAI,GAAGH,KAAK,CAACI,WAAW,EAAE,CAACD,IAAI;EAErCE,aAAa,CAAC;IACV,IAAMC,cAAc,GAAGL,IAAI,CAACM,SAAS,CAACD,cAAc;IAEpD,IAAIA,cAAc,KAAKE,SAAS,IAAIF,cAAc,GAAGH,IAAI,CAACM,MAAM,EAAE;MAC9DR,IAAI,CAACM,SAAS,CAACG,iBAAiB,CAAC,CAAC,CAAC;;GAE1C,EAAE,CAACP,IAAI,CAACM,MAAM,CAAC,CAAC;AACrB;;;;"}
|
@@ -5,10 +5,10 @@ import { useLazyEffect } from '../../../../hooks/useLazyEffect.js';
|
|
5
5
|
// to control the state outside the table. this listener is really here to let the consumer make a server request
|
6
6
|
// and provide the server with the filtering state, so that it can filter server side
|
7
7
|
function useTableFilterListener(table, onFilter) {
|
8
|
-
|
9
|
-
useLazyEffect(()
|
8
|
+
var columnFilters = table.getState().columnFilters;
|
9
|
+
useLazyEffect(function () {
|
10
10
|
if (table.options.enableColumnFilters && typeof onFilter === 'function') {
|
11
|
-
|
11
|
+
var hiddenColumns = getHiddenColumns(table.getState().columnVisibility);
|
12
12
|
onFilter(columnFilters, hiddenColumns);
|
13
13
|
if (table.options.enableRowSelection) {
|
14
14
|
table.resetRowSelection();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableFilterListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableFilterListener.ts"],"sourcesContent":["import { Table as ReactTable } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { TableFilterHandler } from '../../types';\nimport { getHiddenColumns } from '../util/columns';\n\n// we use a listener, and not the internal \"controlled\" change handlers because we don't actually want consumers\n// to control the state outside the table. this listener is really here to let the consumer make a server request\n// and provide the server with the filtering state, so that it can filter server side\nexport function useTableFilterListener<TType = unknown>(table: ReactTable<TType>, onFilter?: TableFilterHandler) {\n const columnFilters = table.getState().columnFilters;\n\n useLazyEffect(() => {\n if (table.options.enableColumnFilters && typeof onFilter === 'function') {\n const hiddenColumns = getHiddenColumns(table.getState().columnVisibility);\n onFilter(columnFilters, hiddenColumns);\n\n if (table.options.enableRowSelection) {\n table.resetRowSelection();\n }\n }\n }, [table.options.enableColumnFilters, columnFilters]);\n}\n"],"names":["useTableFilterListener","table","onFilter","columnFilters","getState","useLazyEffect","options","enableColumnFilters","hiddenColumns","getHiddenColumns","columnVisibility","enableRowSelection","resetRowSelection"],"mappings":";;;AAKA;AACA;AACA;SACgBA,sBAAsBA,CAAkBC,KAAwB,EAAEC,QAA6B;EAC3G,
|
1
|
+
{"version":3,"file":"useTableFilterListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableFilterListener.ts"],"sourcesContent":["import { Table as ReactTable } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { TableFilterHandler } from '../../types';\nimport { getHiddenColumns } from '../util/columns';\n\n// we use a listener, and not the internal \"controlled\" change handlers because we don't actually want consumers\n// to control the state outside the table. this listener is really here to let the consumer make a server request\n// and provide the server with the filtering state, so that it can filter server side\nexport function useTableFilterListener<TType = unknown>(table: ReactTable<TType>, onFilter?: TableFilterHandler) {\n const columnFilters = table.getState().columnFilters;\n\n useLazyEffect(() => {\n if (table.options.enableColumnFilters && typeof onFilter === 'function') {\n const hiddenColumns = getHiddenColumns(table.getState().columnVisibility);\n onFilter(columnFilters, hiddenColumns);\n\n if (table.options.enableRowSelection) {\n table.resetRowSelection();\n }\n }\n }, [table.options.enableColumnFilters, columnFilters]);\n}\n"],"names":["useTableFilterListener","table","onFilter","columnFilters","getState","useLazyEffect","options","enableColumnFilters","hiddenColumns","getHiddenColumns","columnVisibility","enableRowSelection","resetRowSelection"],"mappings":";;;AAKA;AACA;AACA;SACgBA,sBAAsBA,CAAkBC,KAAwB,EAAEC,QAA6B;EAC3G,IAAMC,aAAa,GAAGF,KAAK,CAACG,QAAQ,EAAE,CAACD,aAAa;EAEpDE,aAAa,CAAC;IACV,IAAIJ,KAAK,CAACK,OAAO,CAACC,mBAAmB,IAAI,OAAOL,QAAQ,KAAK,UAAU,EAAE;MACrE,IAAMM,aAAa,GAAGC,gBAAgB,CAACR,KAAK,CAACG,QAAQ,EAAE,CAACM,gBAAgB,CAAC;MACzER,QAAQ,CAACC,aAAa,EAAEK,aAAa,CAAC;MAEtC,IAAIP,KAAK,CAACK,OAAO,CAACK,kBAAkB,EAAE;QAClCV,KAAK,CAACW,iBAAiB,EAAE;;;GAGpC,EAAE,CAACX,KAAK,CAACK,OAAO,CAACC,mBAAmB,EAAEJ,aAAa,CAAC,CAAC;AAC1D;;;;"}
|
@@ -4,22 +4,24 @@ import { isInternalColumn, getCellMinWidth } from '../util/columns.js';
|
|
4
4
|
import { useLazyEffect } from '../../../../hooks/useLazyEffect.js';
|
5
5
|
|
6
6
|
function useTableFontSizeListener(table) {
|
7
|
-
|
8
|
-
|
9
|
-
useLazyEffect(()
|
10
|
-
|
11
|
-
|
12
|
-
table.setColumnSizing(sizes
|
13
|
-
return Object.fromEntries(Object.entries(sizes).map((
|
7
|
+
var meta = table.options.meta;
|
8
|
+
var previousFontSizeRef = React__default.useRef(meta.fontSize.size);
|
9
|
+
useLazyEffect(function () {
|
10
|
+
var cellWidthDifference = getCellWidthDifference(previousFontSizeRef.current + "-" + meta.fontSize.size);
|
11
|
+
var globalMinSize = getCellMinWidth(meta.fontSize.size);
|
12
|
+
table.setColumnSizing(function (sizes) {
|
13
|
+
return Object.fromEntries(Object.entries(sizes).map(function (_ref) {
|
14
14
|
var _column$columnDef$min;
|
15
|
-
|
15
|
+
var columnName = _ref[0],
|
16
|
+
prevColumnSize = _ref[1];
|
17
|
+
var column = table.getColumn(columnName);
|
16
18
|
if (isInternalColumn(columnName)) {
|
17
19
|
var _column$getSize;
|
18
20
|
return [columnName, (_column$getSize = column === null || column === void 0 ? void 0 : column.getSize()) !== null && _column$getSize !== void 0 ? _column$getSize : prevColumnSize];
|
19
21
|
}
|
20
22
|
// Prevents width value in the setting to go below the minColumnSize
|
21
|
-
|
22
|
-
|
23
|
+
var minColumnSize = (_column$columnDef$min = column === null || column === void 0 ? void 0 : column.columnDef.minSize) !== null && _column$columnDef$min !== void 0 ? _column$columnDef$min : globalMinSize;
|
24
|
+
var newSize = Math.max(minColumnSize, prevColumnSize + cellWidthDifference);
|
23
25
|
return [columnName, newSize];
|
24
26
|
}));
|
25
27
|
});
|
@@ -28,15 +30,15 @@ function useTableFontSizeListener(table) {
|
|
28
30
|
}
|
29
31
|
function getCellWidthDifference(fontSizeKey) {
|
30
32
|
switch (fontSizeKey) {
|
31
|
-
case
|
32
|
-
case
|
33
|
+
case FontSizes.small + "-" + FontSizes.medium:
|
34
|
+
case FontSizes.medium + "-" + FontSizes.large:
|
33
35
|
return 8;
|
34
|
-
case
|
35
|
-
case
|
36
|
+
case FontSizes.medium + "-" + FontSizes.small:
|
37
|
+
case FontSizes.large + "-" + FontSizes.medium:
|
36
38
|
return -8;
|
37
|
-
case
|
39
|
+
case FontSizes.small + "-" + FontSizes.large:
|
38
40
|
return 16;
|
39
|
-
case
|
41
|
+
case FontSizes.large + "-" + FontSizes.small:
|
40
42
|
return -16;
|
41
43
|
default:
|
42
44
|
return 0;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableFontSizeListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableFontSizeListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { FontSizes } from '../../../../types';\nimport { getCellMinWidth, isInternalColumn } from '../util/columns';\n\nexport function useTableFontSizeListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const previousFontSizeRef = React.useRef(meta.fontSize.size);\n\n useLazyEffect(() => {\n const cellWidthDifference = getCellWidthDifference(`${previousFontSizeRef.current}-${meta.fontSize.size}`);\n const globalMinSize = getCellMinWidth(meta.fontSize.size);\n\n table.setColumnSizing(sizes => {\n return Object.fromEntries(\n Object.entries(sizes).map(([columnName, prevColumnSize]) => {\n const column = table.getColumn(columnName);\n\n if (isInternalColumn(columnName)) {\n return [columnName, column?.getSize() ?? prevColumnSize];\n }\n\n // Prevents width value in the setting to go below the minColumnSize\n const minColumnSize = column?.columnDef.minSize ?? globalMinSize;\n const newSize = Math.max(minColumnSize, prevColumnSize + cellWidthDifference);\n return [columnName, newSize];\n })\n );\n });\n previousFontSizeRef.current = meta.fontSize.size;\n }, [meta.fontSize.size]);\n}\n\nfunction getCellWidthDifference(fontSizeKey: string) {\n switch (fontSizeKey) {\n case `${FontSizes.small}-${FontSizes.medium}`:\n case `${FontSizes.medium}-${FontSizes.large}`:\n return 8;\n\n case `${FontSizes.medium}-${FontSizes.small}`:\n case `${FontSizes.large}-${FontSizes.medium}`:\n return -8;\n\n case `${FontSizes.small}-${FontSizes.large}`:\n return 16;\n\n case `${FontSizes.large}-${FontSizes.small}`:\n return -16;\n\n default:\n return 0;\n }\n}\n"],"names":["useTableFontSizeListener","table","meta","options","previousFontSizeRef","React","useRef","fontSize","size","useLazyEffect","cellWidthDifference","getCellWidthDifference","current","globalMinSize","getCellMinWidth","setColumnSizing","sizes","Object","fromEntries","entries","map","columnName","prevColumnSize","column","getColumn","isInternalColumn","_column$getSize","getSize","minColumnSize","_column$columnDef$min","columnDef","minSize","newSize","Math","max","fontSizeKey","FontSizes","small","medium","large"],"mappings":";;;;;SAMgBA,wBAAwBA,CAAkBC,KAAwB;EAC9E,
|
1
|
+
{"version":3,"file":"useTableFontSizeListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableFontSizeListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { FontSizes } from '../../../../types';\nimport { getCellMinWidth, isInternalColumn } from '../util/columns';\n\nexport function useTableFontSizeListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const previousFontSizeRef = React.useRef(meta.fontSize.size);\n\n useLazyEffect(() => {\n const cellWidthDifference = getCellWidthDifference(`${previousFontSizeRef.current}-${meta.fontSize.size}`);\n const globalMinSize = getCellMinWidth(meta.fontSize.size);\n\n table.setColumnSizing(sizes => {\n return Object.fromEntries(\n Object.entries(sizes).map(([columnName, prevColumnSize]) => {\n const column = table.getColumn(columnName);\n\n if (isInternalColumn(columnName)) {\n return [columnName, column?.getSize() ?? prevColumnSize];\n }\n\n // Prevents width value in the setting to go below the minColumnSize\n const minColumnSize = column?.columnDef.minSize ?? globalMinSize;\n const newSize = Math.max(minColumnSize, prevColumnSize + cellWidthDifference);\n return [columnName, newSize];\n })\n );\n });\n previousFontSizeRef.current = meta.fontSize.size;\n }, [meta.fontSize.size]);\n}\n\nfunction getCellWidthDifference(fontSizeKey: string) {\n switch (fontSizeKey) {\n case `${FontSizes.small}-${FontSizes.medium}`:\n case `${FontSizes.medium}-${FontSizes.large}`:\n return 8;\n\n case `${FontSizes.medium}-${FontSizes.small}`:\n case `${FontSizes.large}-${FontSizes.medium}`:\n return -8;\n\n case `${FontSizes.small}-${FontSizes.large}`:\n return 16;\n\n case `${FontSizes.large}-${FontSizes.small}`:\n return -16;\n\n default:\n return 0;\n }\n}\n"],"names":["useTableFontSizeListener","table","meta","options","previousFontSizeRef","React","useRef","fontSize","size","useLazyEffect","cellWidthDifference","getCellWidthDifference","current","globalMinSize","getCellMinWidth","setColumnSizing","sizes","Object","fromEntries","entries","map","_ref","columnName","prevColumnSize","column","getColumn","isInternalColumn","_column$getSize","getSize","minColumnSize","_column$columnDef$min","columnDef","minSize","newSize","Math","max","fontSizeKey","FontSizes","small","medium","large"],"mappings":";;;;;SAMgBA,wBAAwBA,CAAkBC,KAAwB;EAC9E,IAAMC,IAAI,GAAGD,KAAK,CAACE,OAAO,CAACD,IAA6B;EACxD,IAAME,mBAAmB,GAAGC,cAAK,CAACC,MAAM,CAACJ,IAAI,CAACK,QAAQ,CAACC,IAAI,CAAC;EAE5DC,aAAa,CAAC;IACV,IAAMC,mBAAmB,GAAGC,sBAAsB,CAAIP,mBAAmB,CAACQ,OAAO,SAAIV,IAAI,CAACK,QAAQ,CAACC,IAAM,CAAC;IAC1G,IAAMK,aAAa,GAAGC,eAAe,CAACZ,IAAI,CAACK,QAAQ,CAACC,IAAI,CAAC;IAEzDP,KAAK,CAACc,eAAe,CAAC,UAAAC,KAAK;MACvB,OAAOC,MAAM,CAACC,WAAW,CACrBD,MAAM,CAACE,OAAO,CAACH,KAAK,CAAC,CAACI,GAAG,CAAC,UAAAC,IAAA;;YAAEC,UAAU,GAAAD,IAAA;UAAEE,cAAc,GAAAF,IAAA;QAClD,IAAMG,MAAM,GAAGvB,KAAK,CAACwB,SAAS,CAACH,UAAU,CAAC;QAE1C,IAAII,gBAAgB,CAACJ,UAAU,CAAC,EAAE;UAAA,IAAAK,eAAA;UAC9B,OAAO,CAACL,UAAU,GAAAK,eAAA,GAAEH,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEI,OAAO,EAAE,cAAAD,eAAA,cAAAA,eAAA,GAAIJ,cAAc,CAAC;;;QAI5D,IAAMM,aAAa,IAAAC,qBAAA,GAAGN,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEO,SAAS,CAACC,OAAO,cAAAF,qBAAA,cAAAA,qBAAA,GAAIjB,aAAa;QAChE,IAAMoB,OAAO,GAAGC,IAAI,CAACC,GAAG,CAACN,aAAa,EAAEN,cAAc,GAAGb,mBAAmB,CAAC;QAC7E,OAAO,CAACY,UAAU,EAAEW,OAAO,CAAC;OAC/B,CAAC,CACL;KACJ,CAAC;IACF7B,mBAAmB,CAACQ,OAAO,GAAGV,IAAI,CAACK,QAAQ,CAACC,IAAI;GACnD,EAAE,CAACN,IAAI,CAACK,QAAQ,CAACC,IAAI,CAAC,CAAC;AAC5B;AAEA,SAASG,sBAAsBA,CAACyB,WAAmB;EAC/C,QAAQA,WAAW;IACf,KAAQC,SAAS,CAACC,KAAK,SAAID,SAAS,CAACE,MAAM;IAC3C,KAAQF,SAAS,CAACE,MAAM,SAAIF,SAAS,CAACG,KAAK;MACvC,OAAO,CAAC;IAEZ,KAAQH,SAAS,CAACE,MAAM,SAAIF,SAAS,CAACC,KAAK;IAC3C,KAAQD,SAAS,CAACG,KAAK,SAAIH,SAAS,CAACE,MAAM;MACvC,OAAO,CAAC,CAAC;IAEb,KAAQF,SAAS,CAACC,KAAK,SAAID,SAAS,CAACG,KAAK;MACtC,OAAO,EAAE;IAEb,KAAQH,SAAS,CAACG,KAAK,SAAIH,SAAS,CAACC,KAAK;MACtC,OAAO,CAAC,EAAE;IAEd;MACI,OAAO,CAAC;;AAEpB;;;;"}
|
@@ -2,8 +2,8 @@ import { FontSizes } from '../../../../types.js';
|
|
2
2
|
import { useLazyEffect } from '../../../../hooks/useLazyEffect.js';
|
3
3
|
|
4
4
|
function useTableRowHeightListener(table) {
|
5
|
-
|
6
|
-
useLazyEffect(()
|
5
|
+
var meta = table.options.meta;
|
6
|
+
useLazyEffect(function () {
|
7
7
|
if (meta.rowHeight.height === 'short' && meta.fontSize.size === FontSizes.large) {
|
8
8
|
meta.fontSize.setSize(FontSizes.medium);
|
9
9
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableRowHeightListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableRowHeightListener.ts"],"sourcesContent":["import { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { FontSizes } from '../../../../types';\n\nexport function useTableRowHeightListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n\n useLazyEffect(() => {\n if (meta.rowHeight.height === 'short' && meta.fontSize.size === FontSizes.large) {\n meta.fontSize.setSize(FontSizes.medium);\n }\n }, [meta.rowHeight.height]);\n}\n"],"names":["useTableRowHeightListener","table","meta","options","useLazyEffect","rowHeight","height","fontSize","size","FontSizes","large","setSize","medium"],"mappings":";;;SAIgBA,yBAAyBA,CAAkBC,KAAwB;EAC/E,
|
1
|
+
{"version":3,"file":"useTableRowHeightListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableRowHeightListener.ts"],"sourcesContent":["import { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { FontSizes } from '../../../../types';\n\nexport function useTableRowHeightListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n\n useLazyEffect(() => {\n if (meta.rowHeight.height === 'short' && meta.fontSize.size === FontSizes.large) {\n meta.fontSize.setSize(FontSizes.medium);\n }\n }, [meta.rowHeight.height]);\n}\n"],"names":["useTableRowHeightListener","table","meta","options","useLazyEffect","rowHeight","height","fontSize","size","FontSizes","large","setSize","medium"],"mappings":";;;SAIgBA,yBAAyBA,CAAkBC,KAAwB;EAC/E,IAAMC,IAAI,GAAGD,KAAK,CAACE,OAAO,CAACD,IAA6B;EAExDE,aAAa,CAAC;IACV,IAAIF,IAAI,CAACG,SAAS,CAACC,MAAM,KAAK,OAAO,IAAIJ,IAAI,CAACK,QAAQ,CAACC,IAAI,KAAKC,SAAS,CAACC,KAAK,EAAE;MAC7ER,IAAI,CAACK,QAAQ,CAACI,OAAO,CAACF,SAAS,CAACG,MAAM,CAAC;;GAE9C,EAAE,CAACV,IAAI,CAACG,SAAS,CAACC,MAAM,CAAC,CAAC;AAC/B;;;;"}
|
@@ -2,11 +2,13 @@ import { useLazyEffect } from '../../../../hooks/useLazyEffect.js';
|
|
2
2
|
|
3
3
|
function useTableRowSelectionListener(table, onRowSelect) {
|
4
4
|
// note that the selected row model may not contain all rows in state when using server loading
|
5
|
-
|
6
|
-
|
7
|
-
useLazyEffect(()
|
5
|
+
var rows = table.getSelectedRowModel().flatRows;
|
6
|
+
var state = table.getState().rowSelection;
|
7
|
+
useLazyEffect(function () {
|
8
8
|
if (table.options.enableRowSelection && typeof onRowSelect === 'function') {
|
9
|
-
onRowSelect(rows.map(
|
9
|
+
onRowSelect(rows.map(function (row) {
|
10
|
+
return row.original;
|
11
|
+
}), Object.keys(state));
|
10
12
|
}
|
11
13
|
/**
|
12
14
|
* Casting to a boolean, since enableRowSelection can be a function,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableRowSelectionListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.ts"],"sourcesContent":["import { Table as ReactTable } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { TableRowSelectHandler } from '../../types';\n\nexport function useTableRowSelectionListener<TType = unknown>(\n table: ReactTable<TType>,\n onRowSelect?: TableRowSelectHandler<TType>\n) {\n // note that the selected row model may not contain all rows in state when using server loading\n const rows = table.getSelectedRowModel().flatRows;\n const state = table.getState().rowSelection;\n\n useLazyEffect(() => {\n if (table.options.enableRowSelection && typeof onRowSelect === 'function') {\n onRowSelect(\n rows.map(row => row.original),\n Object.keys(state)\n );\n }\n /**\n * Casting to a boolean, since enableRowSelection can be a function,\n * and setting a function as depoendency will lead to infinity loop. And in case of row selection useEffect,\n * we only need to know if selection was enabled or disabled, because enableRowSelection function\n * will be applied directly to particular rows.\n */\n }, [!!table.options.enableRowSelection, state]);\n}\n"],"names":["useTableRowSelectionListener","table","onRowSelect","rows","getSelectedRowModel","flatRows","state","getState","rowSelection","useLazyEffect","options","enableRowSelection","map","row","original","Object","keys"],"mappings":";;SAIgBA,4BAA4BA,CACxCC,KAAwB,EACxBC,WAA0C;;EAG1C,
|
1
|
+
{"version":3,"file":"useTableRowSelectionListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.ts"],"sourcesContent":["import { Table as ReactTable } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { TableRowSelectHandler } from '../../types';\n\nexport function useTableRowSelectionListener<TType = unknown>(\n table: ReactTable<TType>,\n onRowSelect?: TableRowSelectHandler<TType>\n) {\n // note that the selected row model may not contain all rows in state when using server loading\n const rows = table.getSelectedRowModel().flatRows;\n const state = table.getState().rowSelection;\n\n useLazyEffect(() => {\n if (table.options.enableRowSelection && typeof onRowSelect === 'function') {\n onRowSelect(\n rows.map(row => row.original),\n Object.keys(state)\n );\n }\n /**\n * Casting to a boolean, since enableRowSelection can be a function,\n * and setting a function as depoendency will lead to infinity loop. And in case of row selection useEffect,\n * we only need to know if selection was enabled or disabled, because enableRowSelection function\n * will be applied directly to particular rows.\n */\n }, [!!table.options.enableRowSelection, state]);\n}\n"],"names":["useTableRowSelectionListener","table","onRowSelect","rows","getSelectedRowModel","flatRows","state","getState","rowSelection","useLazyEffect","options","enableRowSelection","map","row","original","Object","keys"],"mappings":";;SAIgBA,4BAA4BA,CACxCC,KAAwB,EACxBC,WAA0C;;EAG1C,IAAMC,IAAI,GAAGF,KAAK,CAACG,mBAAmB,EAAE,CAACC,QAAQ;EACjD,IAAMC,KAAK,GAAGL,KAAK,CAACM,QAAQ,EAAE,CAACC,YAAY;EAE3CC,aAAa,CAAC;IACV,IAAIR,KAAK,CAACS,OAAO,CAACC,kBAAkB,IAAI,OAAOT,WAAW,KAAK,UAAU,EAAE;MACvEA,WAAW,CACPC,IAAI,CAACS,GAAG,CAAC,UAAAC,GAAG;QAAA,OAAIA,GAAG,CAACC,QAAQ;QAAC,EAC7BC,MAAM,CAACC,IAAI,CAACV,KAAK,CAAC,CACrB;;;;;;;;GAQR,EAAE,CAAC,CAAC,CAACL,KAAK,CAACS,OAAO,CAACC,kBAAkB,EAAEL,KAAK,CAAC,CAAC;AACnD;;;;"}
|
@@ -4,15 +4,15 @@ import { getHiddenColumns } from '../util/columns.js';
|
|
4
4
|
import { useLazyEffect } from '../../../../hooks/useLazyEffect.js';
|
5
5
|
|
6
6
|
function useTableSearchListener(table) {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
var meta = table.options.meta;
|
8
|
+
var localization = useLocalization();
|
9
|
+
var hiddenColumns = getHiddenColumns(table.getState().columnVisibility);
|
10
|
+
var query = table.getState().globalFilter;
|
11
11
|
// Need to re-run search when columns are getting shown/hidden.
|
12
|
-
useLazyEffect(()
|
12
|
+
useLazyEffect(function () {
|
13
13
|
if (meta.search.isEnabled) {
|
14
|
-
|
15
|
-
requestAnimationFrame(()
|
14
|
+
var currentFilter = query;
|
15
|
+
requestAnimationFrame(function () {
|
16
16
|
table.resetGlobalFilter();
|
17
17
|
table.setGlobalFilter(currentFilter);
|
18
18
|
});
|
@@ -22,7 +22,7 @@ function useTableSearchListener(table) {
|
|
22
22
|
}
|
23
23
|
}, [hiddenColumns.length]);
|
24
24
|
// recalculates highlighted indexes whenever something important changes
|
25
|
-
useLazyEffect(()
|
25
|
+
useLazyEffect(function () {
|
26
26
|
if (meta.search.isEnabled) {
|
27
27
|
resetHighlightedColumnIndexes(query, table, localization);
|
28
28
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableSearchListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableSearchListener.ts"],"sourcesContent":["import { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { resetHighlightedColumnIndexes } from '../util/search';\nimport { useLocalization } from '../../../../components/Provider/Localization';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { getHiddenColumns } from '../util/columns';\n\nexport function useTableSearchListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const localization = useLocalization();\n const hiddenColumns = getHiddenColumns(table.getState().columnVisibility);\n const query = table.getState().globalFilter;\n\n // Need to re-run search when columns are getting shown/hidden.\n useLazyEffect(() => {\n if (meta.search.isEnabled) {\n const currentFilter = query;\n requestAnimationFrame(() => {\n table.resetGlobalFilter();\n table.setGlobalFilter(currentFilter);\n });\n\n if (meta.search.handleSearch && meta.search.enableGlobalFilter && query) {\n meta.search.handleSearch(query, hiddenColumns);\n }\n }\n }, [hiddenColumns.length]);\n\n // recalculates highlighted indexes whenever something important changes\n useLazyEffect(() => {\n if (meta.search.isEnabled) {\n resetHighlightedColumnIndexes(query, table, localization);\n }\n }, [\n meta.server.loadAllStatus,\n meta.search.isEnabled,\n meta.search.enableGlobalFilter,\n table.getRowModel().rows.length,\n query,\n JSON.stringify(table.getState().sorting),\n ]);\n}\n"],"names":["useTableSearchListener","table","meta","options","localization","useLocalization","hiddenColumns","getHiddenColumns","getState","columnVisibility","query","globalFilter","useLazyEffect","search","isEnabled","currentFilter","requestAnimationFrame","resetGlobalFilter","setGlobalFilter","handleSearch","enableGlobalFilter","length","resetHighlightedColumnIndexes","server","loadAllStatus","getRowModel","rows","JSON","stringify","sorting"],"mappings":";;;;;SAMgBA,sBAAsBA,CAAkBC,KAAwB;EAC5E,
|
1
|
+
{"version":3,"file":"useTableSearchListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableSearchListener.ts"],"sourcesContent":["import { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { resetHighlightedColumnIndexes } from '../util/search';\nimport { useLocalization } from '../../../../components/Provider/Localization';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { getHiddenColumns } from '../util/columns';\n\nexport function useTableSearchListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const localization = useLocalization();\n const hiddenColumns = getHiddenColumns(table.getState().columnVisibility);\n const query = table.getState().globalFilter;\n\n // Need to re-run search when columns are getting shown/hidden.\n useLazyEffect(() => {\n if (meta.search.isEnabled) {\n const currentFilter = query;\n requestAnimationFrame(() => {\n table.resetGlobalFilter();\n table.setGlobalFilter(currentFilter);\n });\n\n if (meta.search.handleSearch && meta.search.enableGlobalFilter && query) {\n meta.search.handleSearch(query, hiddenColumns);\n }\n }\n }, [hiddenColumns.length]);\n\n // recalculates highlighted indexes whenever something important changes\n useLazyEffect(() => {\n if (meta.search.isEnabled) {\n resetHighlightedColumnIndexes(query, table, localization);\n }\n }, [\n meta.server.loadAllStatus,\n meta.search.isEnabled,\n meta.search.enableGlobalFilter,\n table.getRowModel().rows.length,\n query,\n JSON.stringify(table.getState().sorting),\n ]);\n}\n"],"names":["useTableSearchListener","table","meta","options","localization","useLocalization","hiddenColumns","getHiddenColumns","getState","columnVisibility","query","globalFilter","useLazyEffect","search","isEnabled","currentFilter","requestAnimationFrame","resetGlobalFilter","setGlobalFilter","handleSearch","enableGlobalFilter","length","resetHighlightedColumnIndexes","server","loadAllStatus","getRowModel","rows","JSON","stringify","sorting"],"mappings":";;;;;SAMgBA,sBAAsBA,CAAkBC,KAAwB;EAC5E,IAAMC,IAAI,GAAGD,KAAK,CAACE,OAAO,CAACD,IAA6B;EACxD,IAAME,YAAY,GAAGC,eAAe,EAAE;EACtC,IAAMC,aAAa,GAAGC,gBAAgB,CAACN,KAAK,CAACO,QAAQ,EAAE,CAACC,gBAAgB,CAAC;EACzE,IAAMC,KAAK,GAAGT,KAAK,CAACO,QAAQ,EAAE,CAACG,YAAY;;EAG3CC,aAAa,CAAC;IACV,IAAIV,IAAI,CAACW,MAAM,CAACC,SAAS,EAAE;MACvB,IAAMC,aAAa,GAAGL,KAAK;MAC3BM,qBAAqB,CAAC;QAClBf,KAAK,CAACgB,iBAAiB,EAAE;QACzBhB,KAAK,CAACiB,eAAe,CAACH,aAAa,CAAC;OACvC,CAAC;MAEF,IAAIb,IAAI,CAACW,MAAM,CAACM,YAAY,IAAIjB,IAAI,CAACW,MAAM,CAACO,kBAAkB,IAAIV,KAAK,EAAE;QACrER,IAAI,CAACW,MAAM,CAACM,YAAY,CAACT,KAAK,EAAEJ,aAAa,CAAC;;;GAGzD,EAAE,CAACA,aAAa,CAACe,MAAM,CAAC,CAAC;;EAG1BT,aAAa,CAAC;IACV,IAAIV,IAAI,CAACW,MAAM,CAACC,SAAS,EAAE;MACvBQ,6BAA6B,CAACZ,KAAK,EAAET,KAAK,EAAEG,YAAY,CAAC;;GAEhE,EAAE,CACCF,IAAI,CAACqB,MAAM,CAACC,aAAa,EACzBtB,IAAI,CAACW,MAAM,CAACC,SAAS,EACrBZ,IAAI,CAACW,MAAM,CAACO,kBAAkB,EAC9BnB,KAAK,CAACwB,WAAW,EAAE,CAACC,IAAI,CAACL,MAAM,EAC/BX,KAAK,EACLiB,IAAI,CAACC,SAAS,CAAC3B,KAAK,CAACO,QAAQ,EAAE,CAACqB,OAAO,CAAC,CAC3C,CAAC;AACN;;;;"}
|
@@ -2,14 +2,14 @@ import React__default from 'react';
|
|
2
2
|
import { getHiddenColumns } from '../util/columns.js';
|
3
3
|
|
4
4
|
function useTableServerLoadingListener(table, loadPage) {
|
5
|
-
|
5
|
+
var meta = table.options.meta;
|
6
6
|
// trigger load of the first page on mount
|
7
|
-
React__default.useEffect(()
|
7
|
+
React__default.useEffect(function () {
|
8
8
|
if (loadPage) {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
var sorting = table.getState().sorting;
|
10
|
+
var columnFilters = table.getState().columnFilters;
|
11
|
+
var search = meta.search.enableGlobalFilter ? table.getState().globalFilter : undefined;
|
12
|
+
var hiddenColumns = getHiddenColumns(table.getState().columnVisibility);
|
13
13
|
loadPage(0, sorting, columnFilters, search, hiddenColumns);
|
14
14
|
}
|
15
15
|
}, []);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableServerLoadingListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableServerLoadingListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { TableServerLoadPageHandler } from '../../types';\nimport { getHiddenColumns } from '../util/columns';\n\nexport function useTableServerLoadingListener<TType = unknown>(table: ReactTable<TType>, loadPage?: TableServerLoadPageHandler) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n\n // trigger load of the first page on mount\n React.useEffect(() => {\n if (loadPage) {\n const sorting = table.getState().sorting;\n const columnFilters = table.getState().columnFilters;\n const search = meta.search.enableGlobalFilter ? table.getState().globalFilter : undefined;\n const hiddenColumns = getHiddenColumns(table.getState().columnVisibility);\n\n loadPage(0, sorting, columnFilters, search, hiddenColumns);\n }\n }, []);\n}\n"],"names":["useTableServerLoadingListener","table","loadPage","meta","options","React","useEffect","sorting","getState","columnFilters","search","enableGlobalFilter","globalFilter","undefined","hiddenColumns","getHiddenColumns","columnVisibility"],"mappings":";;;SAKgBA,6BAA6BA,CAAkBC,KAAwB,EAAEC,QAAqC;EAC1H,
|
1
|
+
{"version":3,"file":"useTableServerLoadingListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableServerLoadingListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { TableServerLoadPageHandler } from '../../types';\nimport { getHiddenColumns } from '../util/columns';\n\nexport function useTableServerLoadingListener<TType = unknown>(table: ReactTable<TType>, loadPage?: TableServerLoadPageHandler) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n\n // trigger load of the first page on mount\n React.useEffect(() => {\n if (loadPage) {\n const sorting = table.getState().sorting;\n const columnFilters = table.getState().columnFilters;\n const search = meta.search.enableGlobalFilter ? table.getState().globalFilter : undefined;\n const hiddenColumns = getHiddenColumns(table.getState().columnVisibility);\n\n loadPage(0, sorting, columnFilters, search, hiddenColumns);\n }\n }, []);\n}\n"],"names":["useTableServerLoadingListener","table","loadPage","meta","options","React","useEffect","sorting","getState","columnFilters","search","enableGlobalFilter","globalFilter","undefined","hiddenColumns","getHiddenColumns","columnVisibility"],"mappings":";;;SAKgBA,6BAA6BA,CAAkBC,KAAwB,EAAEC,QAAqC;EAC1H,IAAMC,IAAI,GAAGF,KAAK,CAACG,OAAO,CAACD,IAA6B;;EAGxDE,cAAK,CAACC,SAAS,CAAC;IACZ,IAAIJ,QAAQ,EAAE;MACV,IAAMK,OAAO,GAAGN,KAAK,CAACO,QAAQ,EAAE,CAACD,OAAO;MACxC,IAAME,aAAa,GAAGR,KAAK,CAACO,QAAQ,EAAE,CAACC,aAAa;MACpD,IAAMC,MAAM,GAAGP,IAAI,CAACO,MAAM,CAACC,kBAAkB,GAAGV,KAAK,CAACO,QAAQ,EAAE,CAACI,YAAY,GAAGC,SAAS;MACzF,IAAMC,aAAa,GAAGC,gBAAgB,CAACd,KAAK,CAACO,QAAQ,EAAE,CAACQ,gBAAgB,CAAC;MAEzEd,QAAQ,CAAC,CAAC,EAAEK,OAAO,EAAEE,aAAa,EAAEC,MAAM,EAAEI,aAAa,CAAC;;GAEjE,EAAE,EAAE,CAAC;AACV;;;;"}
|
@@ -2,17 +2,19 @@ import React__default from 'react';
|
|
2
2
|
import { getSettings } from '../util/settings.js';
|
3
3
|
|
4
4
|
function useTableSettingsListener(table, onChangeSettings) {
|
5
|
-
|
6
|
-
|
7
|
-
React__default.useEffect(()
|
8
|
-
|
5
|
+
var meta = table.options.meta;
|
6
|
+
var state = table.getState();
|
7
|
+
React__default.useEffect(function () {
|
8
|
+
var handler;
|
9
9
|
if (typeof onChangeSettings === 'function') {
|
10
|
-
handler = setTimeout(()
|
10
|
+
handler = setTimeout(function () {
|
11
11
|
// some settings shouldn't be persisted, but we comment them out here to highlight the intention
|
12
12
|
onChangeSettings(getSettings(table));
|
13
13
|
}, 250);
|
14
14
|
}
|
15
|
-
return ()
|
15
|
+
return function () {
|
16
|
+
return clearTimeout(handler);
|
17
|
+
};
|
16
18
|
}, [
|
17
19
|
//state.columnFilters,
|
18
20
|
state.columnOrder, state.columnPinning, state.columnSizing, state.columnVisibility, table.options.enableGlobalFilter, meta.fontSize.size,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableSettingsListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableSettingsListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { TableSettingsHandler } from '../../types';\nimport { getSettings } from '../util/settings';\n\nexport function useTableSettingsListener<TType = unknown>(\n table: ReactTable<TType>,\n onChangeSettings: TableSettingsHandler | undefined\n) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const state = table.getState();\n\n React.useEffect(() => {\n let handler;\n\n if (typeof onChangeSettings === 'function') {\n handler = setTimeout(() => {\n // some settings shouldn't be persisted, but we comment them out here to highlight the intention\n onChangeSettings(getSettings(table));\n }, 250);\n }\n\n return () => clearTimeout(handler);\n }, [\n //state.columnFilters,\n state.columnOrder,\n state.columnPinning,\n state.columnSizing,\n state.columnVisibility,\n table.options.enableGlobalFilter,\n meta.fontSize.size,\n //state.grouping,\n meta.rowHeight.height,\n //state.globalFilter,\n state.sorting,\n ]);\n}\n"],"names":["useTableSettingsListener","table","onChangeSettings","meta","options","state","getState","React","useEffect","handler","setTimeout","getSettings","clearTimeout","columnOrder","columnPinning","columnSizing","columnVisibility","enableGlobalFilter","fontSize","size","rowHeight","height","sorting"],"mappings":";;;SAKgBA,wBAAwBA,CACpCC,KAAwB,EACxBC,gBAAkD;EAElD,
|
1
|
+
{"version":3,"file":"useTableSettingsListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableSettingsListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { TableSettingsHandler } from '../../types';\nimport { getSettings } from '../util/settings';\n\nexport function useTableSettingsListener<TType = unknown>(\n table: ReactTable<TType>,\n onChangeSettings: TableSettingsHandler | undefined\n) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const state = table.getState();\n\n React.useEffect(() => {\n let handler;\n\n if (typeof onChangeSettings === 'function') {\n handler = setTimeout(() => {\n // some settings shouldn't be persisted, but we comment them out here to highlight the intention\n onChangeSettings(getSettings(table));\n }, 250);\n }\n\n return () => clearTimeout(handler);\n }, [\n //state.columnFilters,\n state.columnOrder,\n state.columnPinning,\n state.columnSizing,\n state.columnVisibility,\n table.options.enableGlobalFilter,\n meta.fontSize.size,\n //state.grouping,\n meta.rowHeight.height,\n //state.globalFilter,\n state.sorting,\n ]);\n}\n"],"names":["useTableSettingsListener","table","onChangeSettings","meta","options","state","getState","React","useEffect","handler","setTimeout","getSettings","clearTimeout","columnOrder","columnPinning","columnSizing","columnVisibility","enableGlobalFilter","fontSize","size","rowHeight","height","sorting"],"mappings":";;;SAKgBA,wBAAwBA,CACpCC,KAAwB,EACxBC,gBAAkD;EAElD,IAAMC,IAAI,GAAGF,KAAK,CAACG,OAAO,CAACD,IAA6B;EACxD,IAAME,KAAK,GAAGJ,KAAK,CAACK,QAAQ,EAAE;EAE9BC,cAAK,CAACC,SAAS,CAAC;IACZ,IAAIC,OAAO;IAEX,IAAI,OAAOP,gBAAgB,KAAK,UAAU,EAAE;MACxCO,OAAO,GAAGC,UAAU,CAAC;;QAEjBR,gBAAgB,CAACS,WAAW,CAACV,KAAK,CAAC,CAAC;OACvC,EAAE,GAAG,CAAC;;IAGX,OAAO;MAAA,OAAMW,YAAY,CAACH,OAAO,CAAC;;GACrC,EAAE;;EAECJ,KAAK,CAACQ,WAAW,EACjBR,KAAK,CAACS,aAAa,EACnBT,KAAK,CAACU,YAAY,EAClBV,KAAK,CAACW,gBAAgB,EACtBf,KAAK,CAACG,OAAO,CAACa,kBAAkB,EAChCd,IAAI,CAACe,QAAQ,CAACC,IAAI;;EAElBhB,IAAI,CAACiB,SAAS,CAACC,MAAM;;EAErBhB,KAAK,CAACiB,OAAO,CAChB,CAAC;AACN;;;;"}
|
@@ -2,43 +2,43 @@ import React__default from 'react';
|
|
2
2
|
import { createShortcutKeyDownHandler } from '../../../../utils/keyboard.js';
|
3
3
|
|
4
4
|
function useTableShortcutsListener(table, shortcuts) {
|
5
|
-
|
6
|
-
|
7
|
-
React__default.useEffect(()
|
8
|
-
|
9
|
-
|
5
|
+
var meta = table.options.meta;
|
6
|
+
var rows = table.getRowModel().rows;
|
7
|
+
React__default.useEffect(function () {
|
8
|
+
var shortcutKeys = Object.keys(shortcuts !== null && shortcuts !== void 0 ? shortcuts : {});
|
9
|
+
var globalHandlers = [];
|
10
10
|
// convert the shortcut into the correct format to register it
|
11
11
|
if (shortcuts && shortcutKeys.length && meta.rowActive.rowActiveIndex !== undefined) {
|
12
|
-
|
13
|
-
shortcutKeys.forEach(key
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
var rowActive = rows[meta.rowActive.rowActiveIndex];
|
13
|
+
shortcutKeys.forEach(function (key) {
|
14
|
+
var handler = shortcuts[key];
|
15
|
+
var keyDownHandler;
|
16
|
+
var keyDownHandlerOptions;
|
17
17
|
if (typeof handler === 'function') {
|
18
18
|
keyDownHandler = handler;
|
19
19
|
keyDownHandlerOptions = {
|
20
|
-
key
|
20
|
+
key: key
|
21
21
|
};
|
22
22
|
} else {
|
23
|
-
|
23
|
+
var handlerObject = handler;
|
24
24
|
keyDownHandler = handlerObject.handler;
|
25
25
|
keyDownHandlerOptions = {
|
26
|
-
key,
|
26
|
+
key: key,
|
27
27
|
meta: handlerObject.meta,
|
28
28
|
shift: handlerObject.shift
|
29
29
|
};
|
30
30
|
}
|
31
|
-
globalHandlers.push(createShortcutKeyDownHandler(keyDownHandlerOptions, event
|
31
|
+
globalHandlers.push(createShortcutKeyDownHandler(keyDownHandlerOptions, function (event) {
|
32
32
|
event.preventDefault();
|
33
33
|
keyDownHandler(rowActive === null || rowActive === void 0 ? void 0 : rowActive.original);
|
34
34
|
}));
|
35
35
|
});
|
36
36
|
}
|
37
|
-
globalHandlers.forEach(handler
|
37
|
+
globalHandlers.forEach(function (handler) {
|
38
38
|
document.addEventListener('keydown', handler);
|
39
39
|
});
|
40
|
-
return ()
|
41
|
-
globalHandlers.forEach(handler
|
40
|
+
return function () {
|
41
|
+
globalHandlers.forEach(function (handler) {
|
42
42
|
document.removeEventListener('keydown', handler);
|
43
43
|
});
|
44
44
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTableShortcutsListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableShortcutsListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { KeyDownHandlerOptions, createShortcutKeyDownHandler } from '../../../../utils/keyboard';\nimport { TableShortcutHandlerObject, TableShortcuts } from '../../types';\n\nexport function useTableShortcutsListener<TType = unknown>(\n table: ReactTable<TType>,\n shortcuts: TableShortcuts<TType> | undefined\n) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const rows = table.getRowModel().rows;\n\n React.useEffect(() => {\n const shortcutKeys = Object.keys(shortcuts ?? {});\n const globalHandlers: Array<(event: KeyboardEvent) => void> = [];\n\n // convert the shortcut into the correct format to register it\n if (shortcuts && shortcutKeys.length && meta.rowActive.rowActiveIndex !== undefined) {\n const rowActive = rows[meta.rowActive.rowActiveIndex];\n\n shortcutKeys.forEach(key => {\n const handler = shortcuts[key];\n\n let keyDownHandler;\n let keyDownHandlerOptions: KeyDownHandlerOptions;\n\n if (typeof handler === 'function') {\n keyDownHandler = handler;\n keyDownHandlerOptions = {\n key,\n };\n } else {\n const handlerObject = handler as TableShortcutHandlerObject<TType>;\n keyDownHandler = handlerObject.handler;\n keyDownHandlerOptions = {\n key,\n meta: handlerObject.meta,\n shift: handlerObject.shift,\n };\n }\n\n globalHandlers.push(\n createShortcutKeyDownHandler(keyDownHandlerOptions, event => {\n event.preventDefault();\n keyDownHandler(rowActive?.original);\n })\n );\n });\n }\n\n globalHandlers.forEach(handler => {\n document.addEventListener('keydown', handler);\n });\n\n return () => {\n globalHandlers.forEach(handler => {\n document.removeEventListener('keydown', handler);\n });\n };\n }, [shortcuts, meta.rowActive.rowActiveIndex, rows.length]);\n}\n"],"names":["useTableShortcutsListener","table","shortcuts","meta","options","rows","getRowModel","React","useEffect","shortcutKeys","Object","keys","globalHandlers","length","rowActive","rowActiveIndex","undefined","forEach","key","handler","keyDownHandler","keyDownHandlerOptions","handlerObject","shift","push","createShortcutKeyDownHandler","event","preventDefault","original","document","addEventListener","removeEventListener"],"mappings":";;;SAKgBA,yBAAyBA,CACrCC,KAAwB,EACxBC,SAA4C;EAE5C,
|
1
|
+
{"version":3,"file":"useTableShortcutsListener.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/listeners/useTableShortcutsListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { KeyDownHandlerOptions, createShortcutKeyDownHandler } from '../../../../utils/keyboard';\nimport { TableShortcutHandlerObject, TableShortcuts } from '../../types';\n\nexport function useTableShortcutsListener<TType = unknown>(\n table: ReactTable<TType>,\n shortcuts: TableShortcuts<TType> | undefined\n) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const rows = table.getRowModel().rows;\n\n React.useEffect(() => {\n const shortcutKeys = Object.keys(shortcuts ?? {});\n const globalHandlers: Array<(event: KeyboardEvent) => void> = [];\n\n // convert the shortcut into the correct format to register it\n if (shortcuts && shortcutKeys.length && meta.rowActive.rowActiveIndex !== undefined) {\n const rowActive = rows[meta.rowActive.rowActiveIndex];\n\n shortcutKeys.forEach(key => {\n const handler = shortcuts[key];\n\n let keyDownHandler;\n let keyDownHandlerOptions: KeyDownHandlerOptions;\n\n if (typeof handler === 'function') {\n keyDownHandler = handler;\n keyDownHandlerOptions = {\n key,\n };\n } else {\n const handlerObject = handler as TableShortcutHandlerObject<TType>;\n keyDownHandler = handlerObject.handler;\n keyDownHandlerOptions = {\n key,\n meta: handlerObject.meta,\n shift: handlerObject.shift,\n };\n }\n\n globalHandlers.push(\n createShortcutKeyDownHandler(keyDownHandlerOptions, event => {\n event.preventDefault();\n keyDownHandler(rowActive?.original);\n })\n );\n });\n }\n\n globalHandlers.forEach(handler => {\n document.addEventListener('keydown', handler);\n });\n\n return () => {\n globalHandlers.forEach(handler => {\n document.removeEventListener('keydown', handler);\n });\n };\n }, [shortcuts, meta.rowActive.rowActiveIndex, rows.length]);\n}\n"],"names":["useTableShortcutsListener","table","shortcuts","meta","options","rows","getRowModel","React","useEffect","shortcutKeys","Object","keys","globalHandlers","length","rowActive","rowActiveIndex","undefined","forEach","key","handler","keyDownHandler","keyDownHandlerOptions","handlerObject","shift","push","createShortcutKeyDownHandler","event","preventDefault","original","document","addEventListener","removeEventListener"],"mappings":";;;SAKgBA,yBAAyBA,CACrCC,KAAwB,EACxBC,SAA4C;EAE5C,IAAMC,IAAI,GAAGF,KAAK,CAACG,OAAO,CAACD,IAA6B;EACxD,IAAME,IAAI,GAAGJ,KAAK,CAACK,WAAW,EAAE,CAACD,IAAI;EAErCE,cAAK,CAACC,SAAS,CAAC;IACZ,IAAMC,YAAY,GAAGC,MAAM,CAACC,IAAI,CAACT,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EAAE,CAAC;IACjD,IAAMU,cAAc,GAA0C,EAAE;;IAGhE,IAAIV,SAAS,IAAIO,YAAY,CAACI,MAAM,IAAIV,IAAI,CAACW,SAAS,CAACC,cAAc,KAAKC,SAAS,EAAE;MACjF,IAAMF,SAAS,GAAGT,IAAI,CAACF,IAAI,CAACW,SAAS,CAACC,cAAc,CAAC;MAErDN,YAAY,CAACQ,OAAO,CAAC,UAAAC,GAAG;QACpB,IAAMC,OAAO,GAAGjB,SAAS,CAACgB,GAAG,CAAC;QAE9B,IAAIE,cAAc;QAClB,IAAIC,qBAA4C;QAEhD,IAAI,OAAOF,OAAO,KAAK,UAAU,EAAE;UAC/BC,cAAc,GAAGD,OAAO;UACxBE,qBAAqB,GAAG;YACpBH,GAAG,EAAHA;WACH;SACJ,MAAM;UACH,IAAMI,aAAa,GAAGH,OAA4C;UAClEC,cAAc,GAAGE,aAAa,CAACH,OAAO;UACtCE,qBAAqB,GAAG;YACpBH,GAAG,EAAHA,GAAG;YACHf,IAAI,EAAEmB,aAAa,CAACnB,IAAI;YACxBoB,KAAK,EAAED,aAAa,CAACC;WACxB;;QAGLX,cAAc,CAACY,IAAI,CACfC,4BAA4B,CAACJ,qBAAqB,EAAE,UAAAK,KAAK;UACrDA,KAAK,CAACC,cAAc,EAAE;UACtBP,cAAc,CAACN,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEc,QAAQ,CAAC;SACtC,CAAC,CACL;OACJ,CAAC;;IAGNhB,cAAc,CAACK,OAAO,CAAC,UAAAE,OAAO;MAC1BU,QAAQ,CAACC,gBAAgB,CAAC,SAAS,EAAEX,OAAO,CAAC;KAChD,CAAC;IAEF,OAAO;MACHP,cAAc,CAACK,OAAO,CAAC,UAAAE,OAAO;QAC1BU,QAAQ,CAACE,mBAAmB,CAAC,SAAS,EAAEZ,OAAO,CAAC;OACnD,CAAC;KACL;GACJ,EAAE,CAACjB,SAAS,EAAEC,IAAI,CAACW,SAAS,CAACC,cAAc,EAAEV,IAAI,CAACQ,MAAM,CAAC,CAAC;AAC/D;;;;"}
|
@@ -4,8 +4,8 @@ import { useLazyEffect } from '../../../../hooks/useLazyEffect.js';
|
|
4
4
|
// to control the state outside the table. this listener is really here to let the consumer make a server request
|
5
5
|
// and provide the server with the sorting state, so that it can sort server side
|
6
6
|
function useTableSortingListener(table, onSort) {
|
7
|
-
|
8
|
-
useLazyEffect(()
|
7
|
+
var sorting = table.getState().sorting;
|
8
|
+
useLazyEffect(function () {
|
9
9
|
if (table.options.enableSorting && typeof onSort === 'function') {
|
10
10
|
onSort(sorting);
|
11
11
|
if (table.options.enableRowSelection) {
|