@economic/taco 2.47.0-server.3 → 2.47.0-server.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Icon/components/Autopay.d.ts +3 -0
- package/dist/components/Icon/components/AutopayPaused.d.ts +3 -0
- package/dist/components/Icon/components/Person.d.ts +3 -0
- package/dist/components/Icon/components/PersonSolid.d.ts +3 -0
- package/dist/components/Icon/components/Wallet.d.ts +3 -0
- package/dist/components/Icon/components/index.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Menu/components/Item.d.ts +1 -1
- package/dist/components/Menu/components/Link.d.ts +1 -1
- package/dist/components/Navigation2/components/Link.d.ts +1 -1
- package/dist/components/Select2/components/Option.d.ts +4 -4
- package/dist/components/Select2/components/Search.d.ts +1 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +32 -0
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
- package/dist/esm/index.css +11 -2
- package/dist/esm/packages/taco/src/charts/components/Area/AreaChart.js +32 -24
- package/dist/esm/packages/taco/src/charts/components/Area/AreaChart.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Bar/BarChart.js +84 -61
- package/dist/esm/packages/taco/src/charts/components/Bar/BarChart.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Donut/ActiveShape.js +16 -15
- package/dist/esm/packages/taco/src/charts/components/Donut/ActiveShape.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Donut/CenteredLabel.js +12 -13
- package/dist/esm/packages/taco/src/charts/components/Donut/CenteredLabel.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Donut/DonutChart.js +104 -68
- package/dist/esm/packages/taco/src/charts/components/Donut/DonutChart.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Donut/Legend.js +38 -29
- package/dist/esm/packages/taco/src/charts/components/Donut/Legend.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Donut/util.js +2 -2
- package/dist/esm/packages/taco/src/charts/components/Donut/util.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Legend.js +45 -37
- package/dist/esm/packages/taco/src/charts/components/Legend.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Line/LineChart.js +32 -24
- package/dist/esm/packages/taco/src/charts/components/Line/LineChart.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/ResponsiveContainer.js +5 -3
- package/dist/esm/packages/taco/src/charts/components/ResponsiveContainer.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Tooltip.js +26 -25
- package/dist/esm/packages/taco/src/charts/components/Tooltip.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/utils/color.js +13 -12
- package/dist/esm/packages/taco/src/charts/utils/color.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/utils/common.js +39 -26
- package/dist/esm/packages/taco/src/charts/utils/common.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Accordion/Accordion.js +30 -31
- package/dist/esm/packages/taco/src/components/Accordion/Accordion.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Alert/Alert.js +7 -9
- package/dist/esm/packages/taco/src/components/Alert/Alert.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/AlertDialog.js +14 -13
- package/dist/esm/packages/taco/src/components/AlertDialog/AlertDialog.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/Context.js +2 -2
- package/dist/esm/packages/taco/src/components/AlertDialog/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js +10 -9
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Footer.js +4 -4
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Footer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Trigger.js +5 -6
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Backdrop/Backdrop.js +2 -2
- package/dist/esm/packages/taco/src/components/Backdrop/Backdrop.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Badge/Badge.js +26 -27
- package/dist/esm/packages/taco/src/components/Badge/Badge.js.map +1 -1
- package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js +12 -14
- package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Banner/Banner.js +7 -10
- package/dist/esm/packages/taco/src/components/Banner/Banner.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Banner/util.js +3 -3
- package/dist/esm/packages/taco/src/components/Banner/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Button/Button.js +28 -29
- package/dist/esm/packages/taco/src/components/Button/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Button/util.js +25 -24
- package/dist/esm/packages/taco/src/components/Button/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Calendar/Calendar.js +75 -71
- package/dist/esm/packages/taco/src/components/Calendar/Calendar.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Card/Card.js +14 -15
- package/dist/esm/packages/taco/src/components/Card/Card.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js +24 -22
- package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Combobox/Combobox.js +21 -23
- package/dist/esm/packages/taco/src/components/Combobox/Combobox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js +76 -64
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js +60 -57
- package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Datepicker/useDatepicker.js +27 -28
- package/dist/esm/packages/taco/src/components/Datepicker/useDatepicker.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/Context.js +4 -4
- package/dist/esm/packages/taco/src/components/Dialog/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/Dialog.js +54 -39
- package/dist/esm/packages/taco/src/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Content.js +36 -38
- package/dist/esm/packages/taco/src/components/Dialog/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/DialogDrawer.js +3 -3
- package/dist/esm/packages/taco/src/components/Dialog/components/DialogDrawer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Extra.js +2 -2
- package/dist/esm/packages/taco/src/components/Dialog/components/Extra.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Trigger.js +5 -6
- package/dist/esm/packages/taco/src/components/Dialog/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/util.js +7 -3
- package/dist/esm/packages/taco/src/components/Dialog/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/Context.js +5 -5
- package/dist/esm/packages/taco/src/components/Drawer/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/Drawer.js +61 -51
- package/dist/esm/packages/taco/src/components/Drawer/Drawer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/components/Content.js +134 -145
- package/dist/esm/packages/taco/src/components/Drawer/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/components/Trigger.js +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/util.js +5 -5
- package/dist/esm/packages/taco/src/components/Drawer/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Field/Field.js +14 -12
- package/dist/esm/packages/taco/src/components/Field/Field.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Form/Form.js +7 -6
- package/dist/esm/packages/taco/src/components/Form/Form.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Group/Group.js +9 -7
- package/dist/esm/packages/taco/src/components/Group/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Hanger/Hanger.js +37 -36
- package/dist/esm/packages/taco/src/components/Hanger/Hanger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/Header.js +2 -2
- package/dist/esm/packages/taco/src/components/Header/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Avatar.js +14 -10
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Avatar.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Badge.js +5 -4
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Badge.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Display.js +7 -9
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Display.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js +9 -9
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js +66 -46
- package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Button.js +12 -8
- package/dist/esm/packages/taco/src/components/Header/components/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Link.js +22 -18
- package/dist/esm/packages/taco/src/components/Header/components/Link.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Logo.js +4 -4
- package/dist/esm/packages/taco/src/components/Header/components/Logo.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js +2 -2
- package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js +10 -9
- package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js +2 -2
- package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/HoverCard/HoverCard.js +5 -7
- package/dist/esm/packages/taco/src/components/HoverCard/HoverCard.js.map +1 -1
- package/dist/esm/packages/taco/src/components/HoverCard/Primitives.js +1 -1
- package/dist/esm/packages/taco/src/components/HoverCard/Primitives.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/Icon.js +7 -7
- package/dist/esm/packages/taco/src/components/Icon/Icon.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Autopay.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Autopay.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/AutopayPaused.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/AutopayPaused.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Person.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Person.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/PersonSolid.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/PersonSolid.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Wallet.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Wallet.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/index.js +14 -4
- package/dist/esm/packages/taco/src/components/Icon/components/index.js.map +1 -1
- package/dist/esm/packages/taco/src/components/IconButton/IconButton.js +22 -23
- package/dist/esm/packages/taco/src/components/IconButton/IconButton.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Input/Input.js +45 -44
- package/dist/esm/packages/taco/src/components/Input/Input.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Input/util.js +8 -5
- package/dist/esm/packages/taco/src/components/Input/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/Layout.js +7 -5
- package/dist/esm/packages/taco/src/components/Layout/Layout.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/components/Content.js +2 -2
- package/dist/esm/packages/taco/src/components/Layout/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/components/Context.js +4 -2
- package/dist/esm/packages/taco/src/components/Layout/components/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/components/Page.js +2 -2
- package/dist/esm/packages/taco/src/components/Layout/components/Page.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js +34 -27
- package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/components/Top.js +9 -6
- package/dist/esm/packages/taco/src/components/Layout/components/Top.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Button.js +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Collapsible.js +10 -7
- package/dist/esm/packages/taco/src/components/List/components/Collapsible.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Group.js +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Item.js +15 -13
- package/dist/esm/packages/taco/src/components/List/components/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Link.js +3 -3
- package/dist/esm/packages/taco/src/components/List/components/Link.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Toggle.js +29 -27
- package/dist/esm/packages/taco/src/components/List/components/Toggle.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/Listbox.js +21 -26
- package/dist/esm/packages/taco/src/components/Listbox/Listbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js +82 -70
- package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/useListbox.js +56 -51
- package/dist/esm/packages/taco/src/components/Listbox/useListbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/useMultiListbox.js +83 -65
- package/dist/esm/packages/taco/src/components/Listbox/useMultiListbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/useTypeahead.js +9 -10
- package/dist/esm/packages/taco/src/components/Listbox/useTypeahead.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/util.js +78 -48
- package/dist/esm/packages/taco/src/components/Listbox/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/Context.js +2 -2
- package/dist/esm/packages/taco/src/components/Menu/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/Menu.js +42 -26
- package/dist/esm/packages/taco/src/components/Menu/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Checkbox.js +8 -8
- package/dist/esm/packages/taco/src/components/Menu/components/Checkbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Content.js +27 -21
- package/dist/esm/packages/taco/src/components/Menu/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Header.js +3 -3
- package/dist/esm/packages/taco/src/components/Menu/components/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Item.js +32 -32
- package/dist/esm/packages/taco/src/components/Menu/components/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Link.js +10 -10
- package/dist/esm/packages/taco/src/components/Menu/components/Link.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/RadioGroup.js +15 -16
- package/dist/esm/packages/taco/src/components/Menu/components/RadioGroup.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Separator.js +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Separator.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/SubMenu.js +7 -7
- package/dist/esm/packages/taco/src/components/Menu/components/SubMenu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js +5 -5
- package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js +6 -6
- package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation/Navigation.js +41 -36
- package/dist/esm/packages/taco/src/components/Navigation/Navigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js +6 -6
- package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js +6 -6
- package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js +14 -11
- package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js +31 -24
- package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js +7 -7
- package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/util.js +9 -7
- package/dist/esm/packages/taco/src/components/Navigation2/components/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js +48 -51
- package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/PageNumbers.js +26 -23
- package/dist/esm/packages/taco/src/components/Pagination/PageNumbers.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/Pagination.js +53 -39
- package/dist/esm/packages/taco/src/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/usePagination.js +17 -7
- package/dist/esm/packages/taco/src/components/Pagination/usePagination.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/usePaginationShortcuts.js +8 -9
- package/dist/esm/packages/taco/src/components/Pagination/usePaginationShortcuts.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Popover/Popover.js +45 -43
- package/dist/esm/packages/taco/src/components/Popover/Popover.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Popover/Primitives.js +1 -1
- package/dist/esm/packages/taco/src/components/Popover/Primitives.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Popover/util.js +3 -1
- package/dist/esm/packages/taco/src/components/Popover/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Progress/Progress.js +13 -11
- package/dist/esm/packages/taco/src/components/Progress/Progress.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +13 -12
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Provider.js +8 -8
- package/dist/esm/packages/taco/src/components/Provider/Provider.js.map +1 -1
- package/dist/esm/packages/taco/src/components/RadioGroup/RadioGroup.js +54 -47
- package/dist/esm/packages/taco/src/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/packages/taco/src/components/RadioGroup/util.js +7 -1
- package/dist/esm/packages/taco/src/components/RadioGroup/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/Report.js +7 -5
- package/dist/esm/packages/taco/src/components/Report/Report.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/useReport.js +1 -1
- package/dist/esm/packages/taco/src/components/Report/useReport.js.map +1 -1
- package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js +17 -13
- package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js.map +1 -1
- package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js +11 -11
- package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js +44 -39
- package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select/Select.js +28 -31
- package/dist/esm/packages/taco/src/components/Select/Select.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select/useSelect.js +79 -70
- package/dist/esm/packages/taco/src/components/Select/useSelect.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +154 -121
- package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Collection.js +2 -4
- package/dist/esm/packages/taco/src/components/Select2/components/Collection.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Context.js +4 -2
- package/dist/esm/packages/taco/src/components/Select2/components/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Create.js +45 -41
- package/dist/esm/packages/taco/src/components/Select2/components/Create.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +145 -129
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Group.js +8 -8
- package/dist/esm/packages/taco/src/components/Select2/components/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js +36 -35
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Search.js +9 -10
- package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Title.js +2 -2
- package/dist/esm/packages/taco/src/components/Select2/components/Title.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +173 -128
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js +32 -23
- package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/utilities.js +13 -6
- package/dist/esm/packages/taco/src/components/Select2/utilities.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js +16 -13
- package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Spinner/Spinner.js +17 -12
- package/dist/esm/packages/taco/src/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Switch/Switch.js +14 -14
- package/dist/esm/packages/taco/src/components/Switch/Switch.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js +28 -23
- package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/PaginatedTable.js +7 -3
- package/dist/esm/packages/taco/src/components/Table/components/PaginatedTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/Table.js +22 -18
- package/dist/esm/packages/taco/src/components/Table/components/Table.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js +100 -92
- package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js +136 -118
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowDraggable.js +55 -55
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowDraggable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowEditing.js +35 -41
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowEditing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowSelect.js +77 -71
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/useRowCreation.js +56 -30
- package/dist/esm/packages/taco/src/components/Table/hooks/useRowCreation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/useTable.js +151 -142
- package/dist/esm/packages/taco/src/components/Table/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/useTableKeyboardNavigation.js +22 -20
- package/dist/esm/packages/taco/src/components/Table/hooks/useTableKeyboardNavigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/renderColumn.js +9 -12
- package/dist/esm/packages/taco/src/components/Table/util/renderColumn.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/renderRow.js +41 -41
- package/dist/esm/packages/taco/src/components/Table/util/renderRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/rowIndexPath.js +16 -14
- package/dist/esm/packages/taco/src/components/Table/util/rowIndexPath.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/sortTypes.js +32 -26
- package/dist/esm/packages/taco/src/components/Table/util/sortTypes.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util.js +37 -30
- package/dist/esm/packages/taco/src/components/Table/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +23 -23
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Cell.js +13 -14
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Cell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js +21 -23
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/TextareaWithAutosizing.js +20 -17
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/TextareaWithAutosizing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js +67 -73
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingDisplayCell.js +2 -2
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingDisplayCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/util.js +19 -20
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js +26 -25
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js +45 -40
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/DiscardChangesConfirmationDialog.js +7 -8
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateNewRow.js +18 -19
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateNewRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/SaveStatus.js +7 -10
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/SaveStatus.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/TemporaryRow.js +38 -36
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/TemporaryRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js +15 -15
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Toolbar/Editing/Editing.js +8 -11
- package/dist/esm/packages/taco/src/components/Table3/components/Toolbar/Editing/Editing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/features/useEditingState.js +164 -201
- package/dist/esm/packages/taco/src/components/Table3/features/useEditingState.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js +40 -27
- package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js +18 -16
- package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/useTable3.js +25 -19
- package/dist/esm/packages/taco/src/components/Table3/useTable3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/util/editing.js +29 -35
- package/dist/esm/packages/taco/src/components/Table3/util/editing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tabs/Tabs.js +34 -35
- package/dist/esm/packages/taco/src/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tag/Tag.js +18 -16
- package/dist/esm/packages/taco/src/components/Tag/Tag.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Textarea/Textarea.js +8 -11
- package/dist/esm/packages/taco/src/components/Textarea/Textarea.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Toast/Toast.js +19 -20
- package/dist/esm/packages/taco/src/components/Toast/Toast.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Toast/Toaster.js +117 -96
- package/dist/esm/packages/taco/src/components/Toast/Toaster.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Toast/util.js +6 -4
- package/dist/esm/packages/taco/src/components/Toast/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js +10 -9
- package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tour/Tour.js +49 -46
- package/dist/esm/packages/taco/src/components/Tour/Tour.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Treeview/Treeview.js +33 -27
- package/dist/esm/packages/taco/src/components/Treeview/Treeview.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Truncate/Truncate.js +15 -13
- package/dist/esm/packages/taco/src/components/Truncate/Truncate.js.map +1 -1
- package/dist/esm/packages/taco/src/components/VisuallyHidden/VisuallyHidden.js +1 -1
- package/dist/esm/packages/taco/src/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useBoundaryOverflowDetection.js +11 -6
- package/dist/esm/packages/taco/src/hooks/useBoundaryOverflowDetection.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useBoundingClientRectListener.js +19 -13
- package/dist/esm/packages/taco/src/hooks/useBoundingClientRectListener.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useGlobalKeyDown.js +4 -4
- package/dist/esm/packages/taco/src/hooks/useGlobalKeyDown.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useId.js +4 -2
- package/dist/esm/packages/taco/src/hooks/useId.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useIntersectionObserver.js +20 -18
- package/dist/esm/packages/taco/src/hooks/useIntersectionObserver.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useIsFormControl.js +7 -5
- package/dist/esm/packages/taco/src/hooks/useIsFormControl.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useIsHoverStatePaused.js +9 -5
- package/dist/esm/packages/taco/src/hooks/useIsHoverStatePaused.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useIsLargeScreen.js +3 -1
- package/dist/esm/packages/taco/src/hooks/useIsLargeScreen.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useLazyEffect.js +2 -2
- package/dist/esm/packages/taco/src/hooks/useLazyEffect.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useLocalStorage.js +24 -22
- package/dist/esm/packages/taco/src/hooks/useLocalStorage.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useMatchMedia.js +13 -6
- package/dist/esm/packages/taco/src/hooks/useMatchMedia.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useMergedRef.js +3 -3
- package/dist/esm/packages/taco/src/hooks/useMergedRef.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/usePrevious.js +2 -2
- package/dist/esm/packages/taco/src/hooks/usePrevious.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/BubbleSelect.js +14 -14
- package/dist/esm/packages/taco/src/primitives/BubbleSelect.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Button.js +16 -13
- package/dist/esm/packages/taco/src/primitives/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js +50 -44
- package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Context.js +4 -2
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Group.js +9 -5
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Option.js +16 -18
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Option.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js +47 -40
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Title.js +9 -10
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Title.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Sortable/components/Container.js +22 -20
- package/dist/esm/packages/taco/src/primitives/Sortable/components/Container.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Sortable/components/Item.js +24 -27
- package/dist/esm/packages/taco/src/primitives/Sortable/components/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Sortable/components/List.js +11 -10
- package/dist/esm/packages/taco/src/primitives/Sortable/components/List.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js +22 -19
- package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/Body.js +25 -22
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/Body.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/EmptyStateBody.js +6 -6
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/EmptyStateBody.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/util.js +30 -14
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/util.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.js +18 -19
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.js +34 -34
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/Cell.js +10 -12
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/Cell.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/util.js +19 -18
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/util.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Actions.js +42 -40
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Actions.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js +5 -7
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Expansion.js +19 -24
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Expansion.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js +56 -55
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js +27 -23
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js +13 -16
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/Header.js +86 -87
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Goto.js +14 -11
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Goto.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js +85 -58
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js +18 -20
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/SortIndicator.js +3 -3
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/SortIndicator.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/util.js +11 -6
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/util.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js +58 -49
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.js +28 -32
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/Row.js +44 -37
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/RowContext.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/RowContext.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/Toolbar.js +11 -11
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/FilterContext.js +6 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/FilterContext.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/Filters.js +23 -22
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/Filters.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.js +59 -42
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.js +39 -39
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.js +21 -16
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterComparator.js +16 -15
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterComparator.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js +51 -40
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/util.js +13 -9
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/util.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/Print.js +57 -51
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/Print.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/PrintDialog.js +71 -67
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/PrintDialog.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Search/Search.js +40 -37
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Search/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/HideOrOrderPopover.js +64 -44
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/HideOrOrderPopover.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/Settings.js +62 -51
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/Settings.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableGlobalShortcuts.js +6 -6
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableGlobalShortcuts.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRef.js +13 -5
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRef.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js +93 -77
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyle.js +15 -15
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyle.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleColumnFreezing.js +31 -41
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleColumnFreezing.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js +31 -30
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/listeners/useTableRowActiveListener.js +3 -3
- package/dist/esm/packages/taco/src/primitives/Table/Core/listeners/useTableRowActiveListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/useTable.js +14 -15
- package/dist/esm/packages/taco/src/primitives/Table/Core/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/util/rows.js +2 -2
- package/dist/esm/packages/taco/src/primitives/Table/Core/util/rows.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js +42 -36
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader2.js +67 -74
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader2.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableColumnFreezing.js +11 -6
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableColumnFreezing.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableColumnOrdering.js +5 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableColumnOrdering.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFontSize.js +15 -5
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFontSize.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFooter.js +5 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFooter.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTablePrinting.js +26 -16
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTablePrinting.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActions.js +9 -3
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActions.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActive.js +42 -23
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActive.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowClick.js +9 -6
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowClick.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrag.js +9 -4
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrag.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrop.js +5 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrop.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowExpansion.js +9 -3
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowExpansion.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGoto.js +5 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGoto.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGroups.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGroups.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowHeight.js +15 -5
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowHeight.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowSelection.js +14 -9
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowSelection.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSearch.js +25 -13
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSearch.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableServerLoading.js +43 -22
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableServerLoading.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSettings.js +34 -24
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSettings.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableDataListener.js +4 -4
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableDataListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFilterListener.js +3 -3
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFilterListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFontSizeListener.js +18 -16
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFontSizeListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowHeightListener.js +2 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowHeightListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js +6 -4
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js +8 -8
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableServerLoadingListener.js +6 -6
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableServerLoadingListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSettingsListener.js +8 -6
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSettingsListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableShortcutsListener.js +17 -17
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableShortcutsListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSortingListener.js +2 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSortingListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +55 -55
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js +59 -30
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/dataTypes.js +4 -4
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/dataTypes.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/filtering.js +33 -19
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/filtering.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js +11 -11
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/search.js +21 -19
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/search.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/settings.js +6 -7
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/settings.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js +138 -106
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/sorting.js +3 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/sorting.js.map +1 -1
- package/dist/esm/packages/taco/src/types.js +1 -1
- package/dist/esm/packages/taco/src/types.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/aria.js +2 -2
- package/dist/esm/packages/taco/src/utils/aria.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/date.js +47 -23
- package/dist/esm/packages/taco/src/utils/date.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/debounce.js +10 -4
- package/dist/esm/packages/taco/src/utils/debounce.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/device.js +4 -2
- package/dist/esm/packages/taco/src/utils/device.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/dom.js +26 -20
- package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useDraggable.js +40 -38
- package/dist/esm/packages/taco/src/utils/hooks/useDraggable.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useDropTarget.js +9 -7
- package/dist/esm/packages/taco/src/utils/hooks/useDropTarget.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useListKeyboardNavigation.js +20 -9
- package/dist/esm/packages/taco/src/utils/hooks/useListKeyboardNavigation.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useListScrollTo.js +9 -9
- package/dist/esm/packages/taco/src/utils/hooks/useListScrollTo.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useOnClickOutside.js +8 -6
- package/dist/esm/packages/taco/src/utils/hooks/useOnClickOutside.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useTimer.js +16 -11
- package/dist/esm/packages/taco/src/utils/hooks/useTimer.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js +11 -6
- package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/input.js +10 -7
- package/dist/esm/packages/taco/src/utils/input.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/keyboard.js +8 -5
- package/dist/esm/packages/taco/src/utils/keyboard.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/mergeRefs.js +2 -2
- package/dist/esm/packages/taco/src/utils/mergeRefs.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/tailwind.js +5 -5
- package/dist/esm/packages/taco/src/utils/tailwind.js.map +1 -1
- package/dist/esm/packages/taco/tailwind.colors.js +1 -1
- package/dist/esm/packages/taco/tailwind.colors.js.map +1 -1
- package/dist/index.css +11 -2
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/FilterContext.d.ts +3 -0
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.d.ts +0 -1
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.d.ts +0 -3
- package/dist/primitives/Table/types.d.ts +1 -1
- package/dist/primitives/Table/useTableManager/features/useTableServerLoading.d.ts +2 -1
- package/dist/taco.cjs.development.js +7944 -6916
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/package.json +1 -2
@@ -1,4 +1,5 @@
|
|
1
1
|
import React__default from 'react';
|
2
|
+
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../../../../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
3
|
import { Alert } from '../../../../../../../components/Alert/Alert.js';
|
3
4
|
import { useLocalization } from '../../../../../../../components/Provider/Localization.js';
|
4
5
|
import { Button } from '../../../../../../../components/Button/Button.js';
|
@@ -9,79 +10,82 @@ import { Field } from '../../../../../../../components/Field/Field.js';
|
|
9
10
|
import { RadioGroup } from '../../../../../../../components/RadioGroup/RadioGroup.js';
|
10
11
|
import { Select2 } from '../../../../../../../components/Select2/Select2.js';
|
11
12
|
|
12
|
-
|
13
|
+
var _excluded = ["onAccept", "table", "orientation", "setOrientation", "size", "setSize", "allRows", "setAllRows", "splitGroups", "setSplitGroups"];
|
14
|
+
var SAFE_PRINT_CELL_COUNT = 10000;
|
13
15
|
function PrintDialog(props) {
|
14
16
|
var _columns$find, _columns$find$columnD;
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
const rowGroupingColumnName = table.getState().grouping.length ? (_columns$find = columns.find(column => column.id === table.getState().grouping[0])) === null || _columns$find === void 0 ? void 0 : (_columns$find$columnD = _columns$find.columnDef.meta) === null || _columns$find$columnD === void 0 ? void 0 : _columns$find$columnD.header : undefined;
|
17
|
+
var onAccept = props.onAccept,
|
18
|
+
table = props.table,
|
19
|
+
orientation = props.orientation,
|
20
|
+
setOrientation = props.setOrientation,
|
21
|
+
size = props.size,
|
22
|
+
setSize = props.setSize,
|
23
|
+
allRows = props.allRows,
|
24
|
+
setAllRows = props.setAllRows,
|
25
|
+
splitGroups = props.splitGroups,
|
26
|
+
setSplitGroups = props.setSplitGroups,
|
27
|
+
dialogProps = _objectWithoutPropertiesLoose(props, _excluded);
|
28
|
+
var _useLocalization = useLocalization(),
|
29
|
+
texts = _useLocalization.texts;
|
30
|
+
var columns = table.getVisibleFlatColumns();
|
31
|
+
var cellCount = table.getRowModel().rows.length * columns.length;
|
32
|
+
var rowGroupingColumnName = table.getState().grouping.length ? (_columns$find = columns.find(function (column) {
|
33
|
+
return column.id === table.getState().grouping[0];
|
34
|
+
})) === null || _columns$find === void 0 ? void 0 : (_columns$find$columnD = _columns$find.columnDef.meta) === null || _columns$find$columnD === void 0 ? void 0 : _columns$find$columnD.header : undefined;
|
34
35
|
return /*#__PURE__*/React__default.createElement(Dialog, Object.assign({}, dialogProps, {
|
35
36
|
size: "xs"
|
36
37
|
}), /*#__PURE__*/React__default.createElement(Dialog.Content, {
|
37
38
|
"aria-label": texts.table.print.warningDialog.title
|
38
|
-
}, ({
|
39
|
-
close
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
39
|
+
}, function (_ref) {
|
40
|
+
var close = _ref.close;
|
41
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Dialog.Title, null, texts.table.print.settingsDialog.title), /*#__PURE__*/React__default.createElement("div", {
|
42
|
+
className: "mt-4 flex flex-col gap-2"
|
43
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
44
|
+
className: "grid grid-cols-2 gap-4"
|
45
|
+
}, /*#__PURE__*/React__default.createElement(Field, null, texts.table.print.settingsDialog.size, /*#__PURE__*/React__default.createElement(Select2, {
|
46
|
+
onChange: setSize,
|
47
|
+
value: size
|
48
|
+
}, /*#__PURE__*/React__default.createElement(Select2.Option, {
|
49
|
+
value: "A5"
|
50
|
+
}, texts.table.print.settingsDialog.sizeA5), /*#__PURE__*/React__default.createElement(Select2.Option, {
|
51
|
+
value: "A4"
|
52
|
+
}, texts.table.print.settingsDialog.sizeA4), /*#__PURE__*/React__default.createElement(Select2.Option, {
|
53
|
+
value: "A3"
|
54
|
+
}, texts.table.print.settingsDialog.sizeA3), /*#__PURE__*/React__default.createElement(Select2.Option, {
|
55
|
+
value: "letter"
|
56
|
+
}, texts.table.print.settingsDialog.sizeLetter), /*#__PURE__*/React__default.createElement(Select2.Option, {
|
57
|
+
value: "legal"
|
58
|
+
}, texts.table.print.settingsDialog.sizeLegal))), /*#__PURE__*/React__default.createElement(Field, null, texts.table.print.settingsDialog.orientation, /*#__PURE__*/React__default.createElement(Select2, {
|
59
|
+
onChange: setOrientation,
|
60
|
+
value: orientation
|
61
|
+
}, /*#__PURE__*/React__default.createElement(Select2.Option, {
|
62
|
+
value: "landscape"
|
63
|
+
}, texts.table.print.settingsDialog.orientationLandscape), /*#__PURE__*/React__default.createElement(Select2.Option, {
|
64
|
+
value: "portrait"
|
65
|
+
}, texts.table.print.settingsDialog.orientationPortrait)))), table.options.enableRowSelection && table.getIsSomeRowsSelected() ? (/*#__PURE__*/React__default.createElement(Field, null, texts.table.print.settingsDialog.rows, /*#__PURE__*/React__default.createElement(RadioGroup, {
|
66
|
+
onChange: setAllRows,
|
67
|
+
value: allRows
|
68
|
+
}, /*#__PURE__*/React__default.createElement(RadioGroup.Item, {
|
69
|
+
value: true
|
70
|
+
}, texts.table.print.settingsDialog.rowsAll), /*#__PURE__*/React__default.createElement(RadioGroup.Item, {
|
71
|
+
value: false
|
72
|
+
}, texts.table.print.settingsDialog.rowsSelected)))) : undefined, rowGroupingColumnName ? (/*#__PURE__*/React__default.createElement(Field, null, texts.table.print.settingsDialog.layout, /*#__PURE__*/React__default.createElement(Checkbox, {
|
73
|
+
label: texts.table.print.settingsDialog.layoutSplitGroups.replace('[COLUMN]', rowGroupingColumnName),
|
74
|
+
checked: splitGroups,
|
75
|
+
onChange: setSplitGroups
|
76
|
+
}))) : null, cellCount > SAFE_PRINT_CELL_COUNT ? (/*#__PURE__*/React__default.createElement(Alert, {
|
77
|
+
state: "warning"
|
78
|
+
}, texts.table.print.warningDialog.description)) : null), /*#__PURE__*/React__default.createElement(Dialog.Footer, null, /*#__PURE__*/React__default.createElement(Group, null, /*#__PURE__*/React__default.createElement(Dialog.Close, null, /*#__PURE__*/React__default.createElement(Button, null, texts.table.print.warningDialog.cancelButtonText)), /*#__PURE__*/React__default.createElement(Button, {
|
79
|
+
appearance: "primary",
|
80
|
+
autoFocus: true,
|
81
|
+
onClick: function onClick() {
|
82
|
+
close();
|
83
|
+
setTimeout(function () {
|
84
|
+
return onAccept();
|
85
|
+
}, 1);
|
86
|
+
}
|
87
|
+
}, texts.table.print.warningDialog.printButtonText))));
|
88
|
+
}));
|
85
89
|
}
|
86
90
|
|
87
91
|
export { PrintDialog };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PrintDialog.js","sources":["../../../../../../../../../../../../src/primitives/Table/Core/components/Toolbar/components/Print/PrintDialog.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable } from '@tanstack/react-table';\nimport { Dialog } from '../../../../../../../components/Dialog/Dialog';\nimport { useLocalization } from '../../../../../../../components/Provider/Localization';\nimport { Checkbox } from '../../../../../../../components/Checkbox/Checkbox';\nimport { Group } from '../../../../../../../components/Group/Group';\nimport { Button } from '../../../../../../../components/Button/Button';\nimport { Field } from '../../../../../../../components/Field/Field';\nimport { Select2, Select2Value } from '../../../../../../../components/Select2/Select2';\nimport { RadioGroup, RadioGroupItemValue } from '../../../../../../../components/RadioGroup/RadioGroup';\nimport { Alert } from '../../../../../../../components/Alert/Alert';\n\nconst SAFE_PRINT_CELL_COUNT = 10000;\n\nexport type PrintDialogProps<TType = unknown> = {\n table: ReactTable<TType>;\n onAccept: () => void;\n orientation: Select2Value;\n setOrientation: (orientation: Select2Value) => void;\n size: Select2Value;\n setSize: (size: Select2Value) => void;\n allRows: RadioGroupItemValue;\n setAllRows: (allRows: RadioGroupItemValue) => void;\n splitGroups: boolean;\n setSplitGroups: (splitGroups: boolean) => void;\n};\n\nexport function PrintDialog<TType = unknown>(props: PrintDialogProps<TType>) {\n const {\n onAccept,\n table,\n orientation,\n setOrientation,\n size,\n setSize,\n allRows,\n setAllRows,\n splitGroups,\n setSplitGroups,\n ...dialogProps\n } = props;\n const { texts } = useLocalization();\n\n const columns = table.getVisibleFlatColumns();\n const cellCount = table.getRowModel().rows.length * columns.length;\n const rowGroupingColumnName = table.getState().grouping.length\n ? columns.find(column => column.id === table.getState().grouping[0])?.columnDef.meta?.header\n : undefined;\n\n return (\n <Dialog {...dialogProps} size=\"xs\">\n <Dialog.Content aria-label={texts.table.print.warningDialog.title}>\n {({ close }) => (\n <>\n <Dialog.Title>{texts.table.print.settingsDialog.title}</Dialog.Title>\n <div className=\"mt-4 flex flex-col gap-2\">\n <div className=\"grid grid-cols-2 gap-4\">\n <Field>\n {texts.table.print.settingsDialog.size}\n <Select2 onChange={setSize} value={size}>\n <Select2.Option value=\"A5\">{texts.table.print.settingsDialog.sizeA5}</Select2.Option>\n <Select2.Option value=\"A4\">{texts.table.print.settingsDialog.sizeA4}</Select2.Option>\n <Select2.Option value=\"A3\">{texts.table.print.settingsDialog.sizeA3}</Select2.Option>\n <Select2.Option value=\"letter\">\n {texts.table.print.settingsDialog.sizeLetter}\n </Select2.Option>\n <Select2.Option value=\"legal\">\n {texts.table.print.settingsDialog.sizeLegal}\n </Select2.Option>\n </Select2>\n </Field>\n <Field>\n {texts.table.print.settingsDialog.orientation}\n <Select2 onChange={setOrientation} value={orientation}>\n <Select2.Option value=\"landscape\">\n {texts.table.print.settingsDialog.orientationLandscape}\n </Select2.Option>\n <Select2.Option value=\"portrait\">\n {texts.table.print.settingsDialog.orientationPortrait}\n </Select2.Option>\n </Select2>\n </Field>\n </div>\n {table.options.enableRowSelection && table.getIsSomeRowsSelected() ? (\n <Field>\n {texts.table.print.settingsDialog.rows}\n <RadioGroup onChange={setAllRows} value={allRows}>\n <RadioGroup.Item value={true}>{texts.table.print.settingsDialog.rowsAll}</RadioGroup.Item>\n <RadioGroup.Item value={false}>\n {texts.table.print.settingsDialog.rowsSelected}\n </RadioGroup.Item>\n </RadioGroup>\n </Field>\n ) : undefined}\n {rowGroupingColumnName ? (\n <Field>\n {texts.table.print.settingsDialog.layout}\n <Checkbox\n label={texts.table.print.settingsDialog.layoutSplitGroups.replace(\n '[COLUMN]',\n rowGroupingColumnName\n )}\n checked={splitGroups}\n onChange={setSplitGroups}\n />\n </Field>\n ) : null}\n\n {cellCount > SAFE_PRINT_CELL_COUNT ? (\n <Alert state=\"warning\">{texts.table.print.warningDialog.description}</Alert>\n ) : null}\n </div>\n <Dialog.Footer>\n <Group>\n <Dialog.Close>\n <Button>{texts.table.print.warningDialog.cancelButtonText}</Button>\n </Dialog.Close>\n <Button\n appearance=\"primary\"\n autoFocus\n onClick={() => {\n close();\n setTimeout(() => onAccept(), 1);\n }}>\n {texts.table.print.warningDialog.printButtonText}\n </Button>\n </Group>\n </Dialog.Footer>\n </>\n )}\n </Dialog.Content>\n </Dialog>\n );\n}\n"],"names":["SAFE_PRINT_CELL_COUNT","PrintDialog","props","onAccept","table","orientation","setOrientation","size","setSize","allRows","setAllRows","splitGroups","setSplitGroups","dialogProps","texts","useLocalization","columns","getVisibleFlatColumns","cellCount","getRowModel","rows","length","rowGroupingColumnName","getState","grouping","_columns$find","find","column","id","_columns$find$columnD","columnDef","meta","header","undefined","React","Dialog","Content","print","warningDialog","title","close","Title","settingsDialog","className","Field","Select2","onChange","value","Option","sizeA5","sizeA4","sizeA3","sizeLetter","sizeLegal","orientationLandscape","orientationPortrait","options","enableRowSelection","getIsSomeRowsSelected","RadioGroup","Item","rowsAll","rowsSelected","layout","Checkbox","label","layoutSplitGroups","replace","checked","Alert","state","description","Footer","Group","Close","Button","cancelButtonText","appearance","autoFocus","onClick","setTimeout","printButtonText"],"mappings":";;;;;;;;;;;AAYA,MAAMA,qBAAqB,GAAG,KAAK;SAenBC,WAAWA,CAAkBC,KAA8B;;EACvE,MAAM;IACFC,QAAQ;IACRC,KAAK;IACLC,WAAW;IACXC,cAAc;IACdC,IAAI;IACJC,OAAO;IACPC,OAAO;IACPC,UAAU;IACVC,WAAW;IACXC,cAAc;IACd,GAAGC;GACN,GAAGX,KAAK;EACT,MAAM;IAAEY;GAAO,GAAGC,eAAe,EAAE;EAEnC,MAAMC,OAAO,GAAGZ,KAAK,CAACa,qBAAqB,EAAE;EAC7C,MAAMC,SAAS,GAAGd,KAAK,CAACe,WAAW,EAAE,CAACC,IAAI,CAACC,MAAM,GAAGL,OAAO,CAACK,MAAM;EAClE,MAAMC,qBAAqB,GAAGlB,KAAK,CAACmB,QAAQ,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M,eACxC7B,6BAAC8B,QAAQ;IACLC,KAAK,EAAEnD,KAAK,CAACV,KAAK,CAACiC,KAAK,CAACK,cAAc,CAACwB,iBAAiB,CAACC,OAAO,CAC7D,UAAU,EACV7C,qBAAqB,CACxB;IACD8C,OAAO,EAAEzD,WAAW;IACpBmC,QAAQ,EAAElC;IACZ,CACE,IACR,IAAI,EAEPM,SAAS,GAAGlB,qBAAqB,iBAC9BkC,6BAACmC,KAAK;IAACC,KAAK,EAAC;KAAWxD,KAAK,CAACV,KAAK,CAACiC,KAAK,CAACC,aAAa,CAACiC,WAAW,CAAS,IAC5E,IAAI,CACN,eACNrC,6BAACC,MAAM,CAACqC,MAAM,qBACVtC,6BAACuC,KAAK,qBACFvC,6BAACC,MAAM,CAACuC,KAAK,qBACTxC,6BAACyC,MAAM,QAAE7D,KAAK,CAACV,KAAK,CAACiC,KAAK,CAACC,aAAa,CAACsC,gBAAgB,CAAU,CACxD,eACf1C,6BAACyC,MAAM;IACHE,UAAU,EAAC,SAAS;IACpBC,SAAS;IACTC,OAAO,EAAEA;MACLvC,KAAK,EAAE;MACPwC,UAAU,CAAC,MAAM7E,QAAQ,EAAE,EAAE,CAAC,CAAC;;KAElCW,KAAK,CAACV,KAAK,CAACiC,KAAK,CAACC,aAAa,CAAC2C,eAAe,CAC3C,CACL,CACI,CACjB,CACN,CACY,CACZ;AAEjB;;;;"}
|
1
|
+
{"version":3,"file":"PrintDialog.js","sources":["../../../../../../../../../../../../src/primitives/Table/Core/components/Toolbar/components/Print/PrintDialog.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable } from '@tanstack/react-table';\nimport { Dialog } from '../../../../../../../components/Dialog/Dialog';\nimport { useLocalization } from '../../../../../../../components/Provider/Localization';\nimport { Checkbox } from '../../../../../../../components/Checkbox/Checkbox';\nimport { Group } from '../../../../../../../components/Group/Group';\nimport { Button } from '../../../../../../../components/Button/Button';\nimport { Field } from '../../../../../../../components/Field/Field';\nimport { Select2, Select2Value } from '../../../../../../../components/Select2/Select2';\nimport { RadioGroup, RadioGroupItemValue } from '../../../../../../../components/RadioGroup/RadioGroup';\nimport { Alert } from '../../../../../../../components/Alert/Alert';\n\nconst SAFE_PRINT_CELL_COUNT = 10000;\n\nexport type PrintDialogProps<TType = unknown> = {\n table: ReactTable<TType>;\n onAccept: () => void;\n orientation: Select2Value;\n setOrientation: (orientation: Select2Value) => void;\n size: Select2Value;\n setSize: (size: Select2Value) => void;\n allRows: RadioGroupItemValue;\n setAllRows: (allRows: RadioGroupItemValue) => void;\n splitGroups: boolean;\n setSplitGroups: (splitGroups: boolean) => void;\n};\n\nexport function PrintDialog<TType = unknown>(props: PrintDialogProps<TType>) {\n const {\n onAccept,\n table,\n orientation,\n setOrientation,\n size,\n setSize,\n allRows,\n setAllRows,\n splitGroups,\n setSplitGroups,\n ...dialogProps\n } = props;\n const { texts } = useLocalization();\n\n const columns = table.getVisibleFlatColumns();\n const cellCount = table.getRowModel().rows.length * columns.length;\n const rowGroupingColumnName = table.getState().grouping.length\n ? columns.find(column => column.id === table.getState().grouping[0])?.columnDef.meta?.header\n : undefined;\n\n return (\n <Dialog {...dialogProps} size=\"xs\">\n <Dialog.Content aria-label={texts.table.print.warningDialog.title}>\n {({ close }) => (\n <>\n <Dialog.Title>{texts.table.print.settingsDialog.title}</Dialog.Title>\n <div className=\"mt-4 flex flex-col gap-2\">\n <div className=\"grid grid-cols-2 gap-4\">\n <Field>\n {texts.table.print.settingsDialog.size}\n <Select2 onChange={setSize} value={size}>\n <Select2.Option value=\"A5\">{texts.table.print.settingsDialog.sizeA5}</Select2.Option>\n <Select2.Option value=\"A4\">{texts.table.print.settingsDialog.sizeA4}</Select2.Option>\n <Select2.Option value=\"A3\">{texts.table.print.settingsDialog.sizeA3}</Select2.Option>\n <Select2.Option value=\"letter\">\n {texts.table.print.settingsDialog.sizeLetter}\n </Select2.Option>\n <Select2.Option value=\"legal\">\n {texts.table.print.settingsDialog.sizeLegal}\n </Select2.Option>\n </Select2>\n </Field>\n <Field>\n {texts.table.print.settingsDialog.orientation}\n <Select2 onChange={setOrientation} value={orientation}>\n <Select2.Option value=\"landscape\">\n {texts.table.print.settingsDialog.orientationLandscape}\n </Select2.Option>\n <Select2.Option value=\"portrait\">\n {texts.table.print.settingsDialog.orientationPortrait}\n </Select2.Option>\n </Select2>\n </Field>\n </div>\n {table.options.enableRowSelection && table.getIsSomeRowsSelected() ? (\n <Field>\n {texts.table.print.settingsDialog.rows}\n <RadioGroup onChange={setAllRows} value={allRows}>\n <RadioGroup.Item value={true}>{texts.table.print.settingsDialog.rowsAll}</RadioGroup.Item>\n <RadioGroup.Item value={false}>\n {texts.table.print.settingsDialog.rowsSelected}\n </RadioGroup.Item>\n </RadioGroup>\n </Field>\n ) : undefined}\n {rowGroupingColumnName ? (\n <Field>\n {texts.table.print.settingsDialog.layout}\n <Checkbox\n label={texts.table.print.settingsDialog.layoutSplitGroups.replace(\n '[COLUMN]',\n rowGroupingColumnName\n )}\n checked={splitGroups}\n onChange={setSplitGroups}\n />\n </Field>\n ) : null}\n\n {cellCount > SAFE_PRINT_CELL_COUNT ? (\n <Alert state=\"warning\">{texts.table.print.warningDialog.description}</Alert>\n ) : null}\n </div>\n <Dialog.Footer>\n <Group>\n <Dialog.Close>\n <Button>{texts.table.print.warningDialog.cancelButtonText}</Button>\n </Dialog.Close>\n <Button\n appearance=\"primary\"\n autoFocus\n onClick={() => {\n close();\n setTimeout(() => onAccept(), 1);\n }}>\n {texts.table.print.warningDialog.printButtonText}\n </Button>\n </Group>\n </Dialog.Footer>\n </>\n )}\n </Dialog.Content>\n </Dialog>\n );\n}\n"],"names":["SAFE_PRINT_CELL_COUNT","PrintDialog","props","onAccept","table","orientation","setOrientation","size","setSize","allRows","setAllRows","splitGroups","setSplitGroups","dialogProps","_objectWithoutPropertiesLoose","_excluded","_useLocalization","useLocalization","texts","columns","getVisibleFlatColumns","cellCount","getRowModel","rows","length","rowGroupingColumnName","getState","grouping","_columns$find","find","column","id","_columns$find$columnD","columnDef","meta","header","undefined","React","Dialog","Content","print","warningDialog","title","_ref","close","Title","settingsDialog","className","Field","Select2","onChange","value","Option","sizeA5","sizeA4","sizeA3","sizeLetter","sizeLegal","orientationLandscape","orientationPortrait","options","enableRowSelection","getIsSomeRowsSelected","RadioGroup","Item","rowsAll","rowsSelected","layout","Checkbox","label","layoutSplitGroups","replace","checked","Alert","state","description","Footer","Group","Close","Button","cancelButtonText","appearance","autoFocus","onClick","setTimeout","printButtonText"],"mappings":";;;;;;;;;;;;;AAYA,IAAMA,qBAAqB,GAAG,KAAK;SAenBC,WAAWA,CAAkBC,KAA8B;;EACvE,IACIC,QAAQ,GAWRD,KAAK,CAXLC,QAAQ;IACRC,KAAK,GAULF,KAAK,CAVLE,KAAK;IACLC,WAAW,GASXH,KAAK,CATLG,WAAW;IACXC,cAAc,GAQdJ,KAAK,CARLI,cAAc;IACdC,IAAI,GAOJL,KAAK,CAPLK,IAAI;IACJC,OAAO,GAMPN,KAAK,CANLM,OAAO;IACPC,OAAO,GAKPP,KAAK,CALLO,OAAO;IACPC,UAAU,GAIVR,KAAK,CAJLQ,UAAU;IACVC,WAAW,GAGXT,KAAK,CAHLS,WAAW;IACXC,cAAc,GAEdV,KAAK,CAFLU,cAAc;IACXC,WAAW,GAAAC,6BAAA,CACdZ,KAAK,EAAAa,SAAA;EACT,IAAAC,gBAAA,GAAkBC,eAAe,EAAE;IAA3BC,KAAK,GAAAF,gBAAA,CAALE,KAAK;EAEb,IAAMC,OAAO,GAAGf,KAAK,CAACgB,qBAAqB,EAAE;EAC7C,IAAMC,SAAS,GAAGjB,KAAK,CAACkB,WAAW,EAAE,CAACC,IAAI,CAACC,MAAM,GAAGL,OAAO,CAACK,MAAM;EAClE,IAAMC,qBAAqB,GAAGrB,KAAK,CAACsB,QAAQ,EAAE,CAACC,QAAQ,CAACH,MAAM,IAAAI,aAAA,GACxDT,OAAO,CAACU,IAAI,CAAC,UAAAC,MAAM;IAAA,OAAIA,MAAM,CAACC,E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AAK,CAACd,KAAK,CAACoC,KAAK,CAACM,cAAc,CAACwB,iBAAiB,CAACC,OAAO,CAC7D,UAAU,EACV9C,qBAAqB,CACxB;MACD+C,OAAO,EAAE7D,WAAW;MACpBuC,QAAQ,EAAEtC;MACZ,CACE,IACR,IAAI,EAEPS,SAAS,GAAGrB,qBAAqB,iBAC9BqC,6BAACoC,KAAK;MAACC,KAAK,EAAC;OAAWxD,KAAK,CAACd,KAAK,CAACoC,KAAK,CAACC,aAAa,CAACkC,WAAW,CAAS,IAC5E,IAAI,CACN,eACNtC,6BAACC,MAAM,CAACsC,MAAM,qBACVvC,6BAACwC,KAAK,qBACFxC,6BAACC,MAAM,CAACwC,KAAK,qBACTzC,6BAAC0C,MAAM,QAAE7D,KAAK,CAACd,KAAK,CAACoC,KAAK,CAACC,aAAa,CAACuC,gBAAgB,CAAU,CACxD,eACf3C,6BAAC0C,MAAM;MACHE,UAAU,EAAC,SAAS;MACpBC,SAAS;MACTC,OAAO,EAAE,SAAAA;QACLvC,KAAK,EAAE;QACPwC,UAAU,CAAC;UAAA,OAAMjF,QAAQ,EAAE;WAAE,CAAC,CAAC;;OAElCe,KAAK,CAACd,KAAK,CAACoC,KAAK,CAACC,aAAa,CAAC4C,eAAe,CAC3C,CACL,CACI,CACjB;GACN,CACY,CACZ;AAEjB;;;;"}
|
@@ -6,30 +6,29 @@ import { getHiddenColumns } from '../../../../../useTableManager/util/columns.js
|
|
6
6
|
import { SearchInput2 } from '../../../../../../../components/SearchInput2/SearchInput2.js';
|
7
7
|
|
8
8
|
function Search(props) {
|
9
|
-
var _tableMeta$search$
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
React__default.useEffect(() => {
|
9
|
+
var _tableMeta$search$hig2, _tableMeta$search$hig3;
|
10
|
+
var scrollToIndex = props.scrollToIndex,
|
11
|
+
table = props.table,
|
12
|
+
tableRef = props.tableRef;
|
13
|
+
var _useLocalization = useLocalization(),
|
14
|
+
texts = _useLocalization.texts;
|
15
|
+
var ref = React__default.useRef(null);
|
16
|
+
var tableMeta = table.options.meta;
|
17
|
+
var query = table.getState().globalFilter;
|
18
|
+
var scrollTo = function scrollTo(rowIndex) {
|
19
|
+
return scrollToIndex(rowIndex, {
|
20
|
+
align: 'center'
|
21
|
+
});
|
22
|
+
};
|
23
|
+
var hiddenColumns = getHiddenColumns(table.getState().columnVisibility);
|
24
|
+
React__default.useEffect(function () {
|
26
25
|
if (tableMeta.search.highlightedColumnIndexes.length) {
|
27
26
|
scrollTo(tableMeta.search.highlightedColumnIndexes[0][0]);
|
28
27
|
}
|
29
28
|
}, [tableMeta.search.highlightedColumnIndexes.length]);
|
30
|
-
|
29
|
+
var handleFocus = function handleFocus() {
|
31
30
|
try {
|
32
|
-
|
31
|
+
var _temp = function () {
|
33
32
|
if (tableMeta.server.loadAllIfNeeded && !tableMeta.server._experimentalDataLoader2) {
|
34
33
|
// don't pass the search query because we need all data - not filtered data
|
35
34
|
return Promise.resolve(tableMeta.server.loadAllIfNeeded(table.getState().sorting, table.getState().columnFilters,
|
@@ -43,65 +42,69 @@ function Search(props) {
|
|
43
42
|
return Promise.reject(e);
|
44
43
|
}
|
45
44
|
};
|
46
|
-
|
47
|
-
|
48
|
-
|
45
|
+
var _React$useState = React__default.useState(false),
|
46
|
+
loading = _React$useState[0],
|
47
|
+
setLoading = _React$useState[1];
|
48
|
+
var searchTimeoutRef = React__default.useRef();
|
49
|
+
var handleChange = function handleChange(query) {
|
49
50
|
table.setGlobalFilter(String(query !== null && query !== void 0 ? query : ''));
|
50
51
|
if (tableMeta.search.enableGlobalFilter && tableMeta.search.handleSearch) {
|
51
52
|
clearTimeout(searchTimeoutRef.current);
|
52
|
-
searchTimeoutRef.current = setTimeout(()
|
53
|
+
searchTimeoutRef.current = setTimeout(function () {
|
53
54
|
var _tableMeta$search$han, _tableMeta$search;
|
54
55
|
setLoading(true);
|
55
|
-
(_tableMeta$search$han = (_tableMeta$search = tableMeta.search).handleSearch) === null || _tableMeta$search$han === void 0 ? void 0 : _tableMeta$search$han.call(_tableMeta$search, query, hiddenColumns).then(()
|
56
|
+
(_tableMeta$search$han = (_tableMeta$search = tableMeta.search).handleSearch) === null || _tableMeta$search$han === void 0 ? void 0 : _tableMeta$search$han.call(_tableMeta$search, query, hiddenColumns).then(function () {
|
56
57
|
setLoading(false);
|
57
58
|
});
|
58
59
|
}, 150);
|
59
60
|
}
|
60
61
|
};
|
61
|
-
|
62
|
+
var handleToggleExcludeUnmatchedResults = function handleToggleExcludeUnmatchedResults(enabled) {
|
62
63
|
tableMeta.search.setEnableGlobalFilter(enabled, table);
|
63
|
-
requestAnimationFrame(()
|
64
|
+
requestAnimationFrame(function () {
|
64
65
|
var _ref$current;
|
65
66
|
return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
|
66
67
|
});
|
67
68
|
if (tableMeta.search.handleSearch) {
|
68
69
|
setLoading(true);
|
69
|
-
tableMeta.search.handleSearch(enabled ? query : undefined, hiddenColumns).then(()
|
70
|
+
tableMeta.search.handleSearch(enabled ? query : undefined, hiddenColumns).then(function () {
|
70
71
|
setLoading(false);
|
71
72
|
});
|
72
73
|
}
|
73
74
|
};
|
74
|
-
|
75
|
+
var handleNextResult = function handleNextResult() {
|
75
76
|
if (!tableMeta.search.highlightedColumnIndexes.length) {
|
76
77
|
return;
|
77
78
|
}
|
78
|
-
|
79
|
+
var nextIndex = tableMeta.search.currentHighlightColumnIndex === undefined || tableMeta.search.currentHighlightColumnIndex === tableMeta.search.highlightedColumnIndexes.length - 1 ? 0 : tableMeta.search.currentHighlightColumnIndex + 1;
|
79
80
|
tableMeta.search.setCurrentHighlightColumnIndex(nextIndex);
|
80
81
|
// we scroll to the row here, the cell scrolls itself into view
|
81
82
|
scrollTo(tableMeta.search.highlightedColumnIndexes[nextIndex][0]);
|
82
83
|
};
|
83
|
-
|
84
|
+
var handlePreviousResult = function handlePreviousResult() {
|
84
85
|
if (!tableMeta.search.highlightedColumnIndexes.length) {
|
85
86
|
return;
|
86
87
|
}
|
87
|
-
|
88
|
+
var nextIndex = tableMeta.search.currentHighlightColumnIndex === undefined ? 0 : tableMeta.search.currentHighlightColumnIndex === 0 ? tableMeta.search.highlightedColumnIndexes.length - 1 : tableMeta.search.currentHighlightColumnIndex - 1;
|
88
89
|
tableMeta.search.setCurrentHighlightColumnIndex(nextIndex);
|
89
90
|
// we scroll to the row here, the cell scrolls itself into view
|
90
91
|
scrollTo(tableMeta.search.highlightedColumnIndexes[nextIndex][0]);
|
91
92
|
};
|
92
|
-
|
93
|
+
var settings = /*#__PURE__*/React__default.createElement(Switch, {
|
93
94
|
label: texts.table.search.excludeUnmatchedResults,
|
94
95
|
checked: !!table.options.enableGlobalFilter,
|
95
96
|
onChange: handleToggleExcludeUnmatchedResults
|
96
97
|
});
|
97
|
-
|
98
|
+
var handleKeyDown = function handleKeyDown(event) {
|
98
99
|
if (event.key === 'Escape' && tableMeta.search.currentHighlightColumnIndex !== undefined) {
|
99
|
-
|
100
|
+
var _tableMeta$search$hig = tableMeta.search.highlightedColumnIndexes[tableMeta.search.currentHighlightColumnIndex],
|
101
|
+
rowIndex = _tableMeta$search$hig[0],
|
102
|
+
cellIndex = _tableMeta$search$hig[1];
|
100
103
|
if (rowIndex !== undefined && cellIndex !== undefined) {
|
101
104
|
tableMeta.rowActive.setRowActiveIndex(rowIndex);
|
102
|
-
requestAnimationFrame(()
|
105
|
+
requestAnimationFrame(function () {
|
103
106
|
var _tableRef$current;
|
104
|
-
|
107
|
+
var cell = (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.querySelector("tbody > tr[data-row-index=\"" + rowIndex + "\"] > td[data-cell-index=\"" + cellIndex + "\"]");
|
105
108
|
if (cell) {
|
106
109
|
var _cell$focus;
|
107
110
|
(_cell$focus = cell.focus) === null || _cell$focus === void 0 ? void 0 : _cell$focus.call(cell);
|
@@ -112,7 +115,7 @@ function Search(props) {
|
|
112
115
|
};
|
113
116
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(SearchInput2, {
|
114
117
|
findCurrent: tableMeta.search.currentHighlightColumnIndex !== undefined ? tableMeta.search.currentHighlightColumnIndex + 1 : null,
|
115
|
-
findTotal: (_tableMeta$search$
|
118
|
+
findTotal: (_tableMeta$search$hig2 = (_tableMeta$search$hig3 = tableMeta.search.highlightedColumnIndexes) === null || _tableMeta$search$hig3 === void 0 ? void 0 : _tableMeta$search$hig3.length) !== null && _tableMeta$search$hig2 !== void 0 ? _tableMeta$search$hig2 : null,
|
116
119
|
loading: tableMeta.server._experimentalDataLoader2 ? loading : tableMeta.server.loadAllStatus === TableServerLoadAllState.Loading,
|
117
120
|
name: "table-search",
|
118
121
|
onClickFindPrevious: handlePreviousResult,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Search.js","sources":["../../../../../../../../../../../../src/primitives/Table/Core/components/Toolbar/components/Search/Search.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLocalization } from '../../../../../../../components/Provider/Localization';\nimport { SearchInput2 } from '../../../../../../../components/SearchInput2/SearchInput2';\nimport { Switch } from '../../../../../../../components/Switch/Switch';\nimport { TableRef, TableServerLoadAllState } from '../../../../../types';\nimport { getHiddenColumns } from '../../../../../useTableManager/util/columns';\n\ntype SearchProps<TType = unknown> = {\n scrollToIndex: any;\n table: ReactTable<TType>;\n tableRef: React.RefObject<TableRef>;\n};\n\nexport function Search<TType = unknown>(props: SearchProps<TType>) {\n const { scrollToIndex, table, tableRef } = props;\n const { texts } = useLocalization();\n const ref = React.useRef<HTMLInputElement>(null);\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n const query = table.getState().globalFilter;\n const scrollTo = (rowIndex: number) => scrollToIndex(rowIndex, { align: 'center' });\n const hiddenColumns = getHiddenColumns(table.getState().columnVisibility);\n\n React.useEffect(() => {\n if (tableMeta.search.highlightedColumnIndexes.length) {\n scrollTo(tableMeta.search.highlightedColumnIndexes[0][0]);\n }\n }, [tableMeta.search.highlightedColumnIndexes.length]);\n\n const handleFocus = async () => {\n // load all data if that is possible\n if (tableMeta.server.loadAllIfNeeded && !tableMeta.server._experimentalDataLoader2) {\n // don't pass the search query because we need all data - not filtered data\n await tableMeta.server.loadAllIfNeeded(\n table.getState().sorting,\n table.getState().columnFilters,\n // the old data loader doesn't have server side search\n undefined,\n hiddenColumns\n );\n }\n };\n\n const [loading, setLoading] = React.useState(false);\n\n const searchTimeoutRef = React.useRef<NodeJS.Timeout>();\n\n const handleChange = (query: any) => {\n table.setGlobalFilter(String(query ?? ''));\n\n if (tableMeta.search.enableGlobalFilter && tableMeta.search.handleSearch) {\n clearTimeout(searchTimeoutRef.current);\n searchTimeoutRef.current = setTimeout(() => {\n setLoading(true);\n tableMeta.search.handleSearch?.(query, hiddenColumns).then(() => {\n setLoading(false);\n });\n }, 150);\n }\n };\n\n const handleToggleExcludeUnmatchedResults = (enabled: boolean) => {\n tableMeta.search.setEnableGlobalFilter(enabled, table);\n requestAnimationFrame(() => ref.current?.focus());\n\n if (tableMeta.search.handleSearch) {\n setLoading(true);\n tableMeta.search.handleSearch(enabled ? query : undefined, hiddenColumns).then(() => {\n setLoading(false);\n });\n }\n };\n\n const handleNextResult = () => {\n if (!tableMeta.search.highlightedColumnIndexes.length) {\n return;\n }\n\n const nextIndex =\n tableMeta.search.currentHighlightColumnIndex === undefined ||\n tableMeta.search.currentHighlightColumnIndex === tableMeta.search.highlightedColumnIndexes.length - 1\n ? 0\n : tableMeta.search.currentHighlightColumnIndex + 1;\n\n tableMeta.search.setCurrentHighlightColumnIndex(nextIndex);\n // we scroll to the row here, the cell scrolls itself into view\n scrollTo(tableMeta.search.highlightedColumnIndexes[nextIndex][0]);\n };\n\n const handlePreviousResult = () => {\n if (!tableMeta.search.highlightedColumnIndexes.length) {\n return;\n }\n\n const nextIndex =\n tableMeta.search.currentHighlightColumnIndex === undefined\n ? 0\n : tableMeta.search.currentHighlightColumnIndex === 0\n ? tableMeta.search.highlightedColumnIndexes.length - 1\n : tableMeta.search.currentHighlightColumnIndex - 1;\n\n tableMeta.search.setCurrentHighlightColumnIndex(nextIndex);\n // we scroll to the row here, the cell scrolls itself into view\n scrollTo(tableMeta.search.highlightedColumnIndexes[nextIndex][0]);\n };\n\n const settings = (\n <Switch\n label={texts.table.search.excludeUnmatchedResults}\n checked={!!table.options.enableGlobalFilter}\n onChange={handleToggleExcludeUnmatchedResults}\n />\n );\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Escape' && tableMeta.search.currentHighlightColumnIndex !== undefined) {\n const [rowIndex, cellIndex] = tableMeta.search.highlightedColumnIndexes[tableMeta.search.currentHighlightColumnIndex];\n\n if (rowIndex !== undefined && cellIndex !== undefined) {\n tableMeta.rowActive.setRowActiveIndex(rowIndex);\n\n requestAnimationFrame(() => {\n const cell = tableRef.current?.querySelector(\n `tbody > tr[data-row-index=\"${rowIndex}\"] > td[data-cell-index=\"${cellIndex}\"]`\n );\n\n if (cell) {\n (cell as HTMLElement).focus?.();\n }\n });\n }\n }\n };\n\n return (\n <>\n <SearchInput2\n findCurrent={\n tableMeta.search.currentHighlightColumnIndex !== undefined\n ? tableMeta.search.currentHighlightColumnIndex + 1\n : null\n }\n findTotal={tableMeta.search.highlightedColumnIndexes?.length ?? null}\n loading={\n tableMeta.server._experimentalDataLoader2\n ? loading\n : tableMeta.server.loadAllStatus === TableServerLoadAllState.Loading\n }\n name=\"table-search\"\n onClickFindPrevious={handlePreviousResult}\n onClickFindNext={handleNextResult}\n onChange={handleChange}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n placeholder={texts.table.search.placeholder}\n settingsContent={settings}\n ref={ref}\n shortcut={{ key: 'f', meta: true, shift: false }}\n showTotal={!tableMeta.server._experimentalDataLoader2}\n value={query}\n />\n </>\n );\n}\n"],"names":["Search","props","scrollToIndex","table","tableRef","texts","useLocalization","ref","React","useRef","tableMeta","options","meta","query","getState","globalFilter","scrollTo","rowIndex","align","hiddenColumns","getHiddenColumns","columnVisibility","useEffect","search","highlightedColumnIndexes","length","handleFocus","server","loadAllIfNeeded","_experimentalDataLoader2","Promise","resolve","sorting","columnFilters","undefined","then","_temp","e","reject","loading","setLoading","useState","searchTimeoutRef","handleChange","setGlobalFilter","String","enableGlobalFilter","handleSearch","clearTimeout","current","setTimeout","_tableMeta$search$han","_tableMeta$search","call","handleToggleExcludeUnmatchedResults","enabled","setEnableGlobalFilter","requestAnimationFrame","_ref$current","focus","handleNextResult","nextIndex","currentHighlightColumnIndex","setCurrentHighlightColumnIndex","handlePreviousResult","settings","Switch","label","excludeUnmatchedResults","checked","onChange","handleKeyDown","event","key","cellIndex","rowActive","setRowActiveIndex","cell","_tableRef$current","querySelector","_cell$focus","SearchInput2","findCurrent","findTotal","_tableMeta$search$hig","_tableMeta$search$hig2","loadAllStatus","TableServerLoadAllState","Loading","name","onClickFindPrevious","onClickFindNext","onFocus","onKeyDown","placeholder","settingsContent","shortcut","shift","showTotal","value"],"mappings":";;;;;;;SAcgBA,MAAMA,CAAkBC,KAAyB;;EAC7D,MAAM;IAAEC,aAAa;IAAEC,KAAK;IAAEC;GAAU,GAAGH,KAAK;EAChD,MAAM;IAAEI;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMC,GAAG,GAAGC,cAAK,CAACC,MAAM,CAAmB,IAAI,CAAC;EAChD,MAAMC,SAAS,GAAGP,KAAK,CAACQ,OAAO,CAACC,IAA6B;EAC7D,MAAMC,KAAK,GAAGV,KAAK,CAACW,QAAQ,EAAE,CAACC,YAAY;EAC3C,MAAMC,QAAQ,GAAIC,QAAgB,IAAKf,aAAa,CAACe,QAAQ,EAAE;IAAEC,KAAK,EAAE;GAAU,CAAC;EACnF,MAAMC,aA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AG;IACRyF,QAAQ,EAAE;MAAEvB,GAAG,EAAE,GAAG;MAAE7D,IAAI,EAAE,IAAI;MAAEqF,KAAK,EAAE;KAAO;IAChDC,SAAS,EAAE,CAACxF,SAAS,CAACiB,MAAM,CAACE,wBAAwB;IACrDsE,KAAK,EAAEtF;IACT,CACH;AAEX;;;;"}
|
1
|
+
{"version":3,"file":"Search.js","sources":["../../../../../../../../../../../../src/primitives/Table/Core/components/Toolbar/components/Search/Search.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLocalization } from '../../../../../../../components/Provider/Localization';\nimport { SearchInput2 } from '../../../../../../../components/SearchInput2/SearchInput2';\nimport { Switch } from '../../../../../../../components/Switch/Switch';\nimport { TableRef, TableServerLoadAllState } from '../../../../../types';\nimport { getHiddenColumns } from '../../../../../useTableManager/util/columns';\n\ntype SearchProps<TType = unknown> = {\n scrollToIndex: any;\n table: ReactTable<TType>;\n tableRef: React.RefObject<TableRef>;\n};\n\nexport function Search<TType = unknown>(props: SearchProps<TType>) {\n const { scrollToIndex, table, tableRef } = props;\n const { texts } = useLocalization();\n const ref = React.useRef<HTMLInputElement>(null);\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n const query = table.getState().globalFilter;\n const scrollTo = (rowIndex: number) => scrollToIndex(rowIndex, { align: 'center' });\n const hiddenColumns = getHiddenColumns(table.getState().columnVisibility);\n\n React.useEffect(() => {\n if (tableMeta.search.highlightedColumnIndexes.length) {\n scrollTo(tableMeta.search.highlightedColumnIndexes[0][0]);\n }\n }, [tableMeta.search.highlightedColumnIndexes.length]);\n\n const handleFocus = async () => {\n // load all data if that is possible\n if (tableMeta.server.loadAllIfNeeded && !tableMeta.server._experimentalDataLoader2) {\n // don't pass the search query because we need all data - not filtered data\n await tableMeta.server.loadAllIfNeeded(\n table.getState().sorting,\n table.getState().columnFilters,\n // the old data loader doesn't have server side search\n undefined,\n hiddenColumns\n );\n }\n };\n\n const [loading, setLoading] = React.useState(false);\n\n const searchTimeoutRef = React.useRef<NodeJS.Timeout>();\n\n const handleChange = (query: any) => {\n table.setGlobalFilter(String(query ?? ''));\n\n if (tableMeta.search.enableGlobalFilter && tableMeta.search.handleSearch) {\n clearTimeout(searchTimeoutRef.current);\n searchTimeoutRef.current = setTimeout(() => {\n setLoading(true);\n tableMeta.search.handleSearch?.(query, hiddenColumns).then(() => {\n setLoading(false);\n });\n }, 150);\n }\n };\n\n const handleToggleExcludeUnmatchedResults = (enabled: boolean) => {\n tableMeta.search.setEnableGlobalFilter(enabled, table);\n requestAnimationFrame(() => ref.current?.focus());\n\n if (tableMeta.search.handleSearch) {\n setLoading(true);\n tableMeta.search.handleSearch(enabled ? query : undefined, hiddenColumns).then(() => {\n setLoading(false);\n });\n }\n };\n\n const handleNextResult = () => {\n if (!tableMeta.search.highlightedColumnIndexes.length) {\n return;\n }\n\n const nextIndex =\n tableMeta.search.currentHighlightColumnIndex === undefined ||\n tableMeta.search.currentHighlightColumnIndex === tableMeta.search.highlightedColumnIndexes.length - 1\n ? 0\n : tableMeta.search.currentHighlightColumnIndex + 1;\n\n tableMeta.search.setCurrentHighlightColumnIndex(nextIndex);\n // we scroll to the row here, the cell scrolls itself into view\n scrollTo(tableMeta.search.highlightedColumnIndexes[nextIndex][0]);\n };\n\n const handlePreviousResult = () => {\n if (!tableMeta.search.highlightedColumnIndexes.length) {\n return;\n }\n\n const nextIndex =\n tableMeta.search.currentHighlightColumnIndex === undefined\n ? 0\n : tableMeta.search.currentHighlightColumnIndex === 0\n ? tableMeta.search.highlightedColumnIndexes.length - 1\n : tableMeta.search.currentHighlightColumnIndex - 1;\n\n tableMeta.search.setCurrentHighlightColumnIndex(nextIndex);\n // we scroll to the row here, the cell scrolls itself into view\n scrollTo(tableMeta.search.highlightedColumnIndexes[nextIndex][0]);\n };\n\n const settings = (\n <Switch\n label={texts.table.search.excludeUnmatchedResults}\n checked={!!table.options.enableGlobalFilter}\n onChange={handleToggleExcludeUnmatchedResults}\n />\n );\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Escape' && tableMeta.search.currentHighlightColumnIndex !== undefined) {\n const [rowIndex, cellIndex] = tableMeta.search.highlightedColumnIndexes[tableMeta.search.currentHighlightColumnIndex];\n\n if (rowIndex !== undefined && cellIndex !== undefined) {\n tableMeta.rowActive.setRowActiveIndex(rowIndex);\n\n requestAnimationFrame(() => {\n const cell = tableRef.current?.querySelector(\n `tbody > tr[data-row-index=\"${rowIndex}\"] > td[data-cell-index=\"${cellIndex}\"]`\n );\n\n if (cell) {\n (cell as HTMLElement).focus?.();\n }\n });\n }\n }\n };\n\n return (\n <>\n <SearchInput2\n findCurrent={\n tableMeta.search.currentHighlightColumnIndex !== undefined\n ? tableMeta.search.currentHighlightColumnIndex + 1\n : null\n }\n findTotal={tableMeta.search.highlightedColumnIndexes?.length ?? null}\n loading={\n tableMeta.server._experimentalDataLoader2\n ? loading\n : tableMeta.server.loadAllStatus === TableServerLoadAllState.Loading\n }\n name=\"table-search\"\n onClickFindPrevious={handlePreviousResult}\n onClickFindNext={handleNextResult}\n onChange={handleChange}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n placeholder={texts.table.search.placeholder}\n settingsContent={settings}\n ref={ref}\n shortcut={{ key: 'f', meta: true, shift: false }}\n showTotal={!tableMeta.server._experimentalDataLoader2}\n value={query}\n />\n </>\n );\n}\n"],"names":["Search","props","scrollToIndex","table","tableRef","_useLocalization","useLocalization","texts","ref","React","useRef","tableMeta","options","meta","query","getState","globalFilter","scrollTo","rowIndex","align","hiddenColumns","getHiddenColumns","columnVisibility","useEffect","search","highlightedColumnIndexes","length","handleFocus","server","loadAllIfNeeded","_experimentalDataLoader2","Promise","resolve","sorting","columnFilters","undefined","then","_temp","e","reject","_React$useState","useState","loading","setLoading","searchTimeoutRef","handleChange","setGlobalFilter","String","enableGlobalFilter","handleSearch","clearTimeout","current","setTimeout","_tableMeta$search$han","_tableMeta$search","call","handleToggleExcludeUnmatchedResults","enabled","setEnableGlobalFilter","requestAnimationFrame","_ref$current","focus","handleNextResult","nextIndex","currentHighlightColumnIndex","setCurrentHighlightColumnIndex","handlePreviousResult","settings","Switch","label","excludeUnmatchedResults","checked","onChange","handleKeyDown","event","key","_tableMeta$search$hig","cellIndex","rowActive","setRowActiveIndex","cell","_tableRef$current","querySelector","_cell$focus","SearchInput2","findCurrent","findTotal","_tableMeta$search$hig2","_tableMeta$search$hig3","loadAllStatus","TableServerLoadAllState","Loading","name","onClickFindPrevious","onClickFindNext","onFocus","onKeyDown","placeholder","settingsContent","shortcut","shift","showTotal","value"],"mappings":";;;;;;;SAcgBA,MAAMA,CAAkBC,KAAyB;;EAC7D,IAAQC,aAAa,GAAsBD,KAAK,CAAxCC,aAAa;IAAEC,KAAK,GAAeF,KAAK,CAAzBE,KAAK;IAAEC,QAAQ,GAAKH,KAAK,CAAlBG,QAAQ;EACtC,IAAAC,gBAAA,GAAkBC,eAAe,EAAE;IAA3BC,KAAK,GAAAF,gBAAA,CAALE,KAAK;EACb,IAAMC,GAAG,GAAGC,cAAK,CAACC,MAAM,CAAmB,IAAI,CAAC;EAChD,IAAMC,SAAS,GAAGR,KAAK,CAACS,OAAO,CAACC,IAA6B;EAC7D,IAAMC,KAAK,GAAGX,KAAK,CAACY,QAAQ,EAAE,CAACC,YAAY;EAC3C,IAAMC,QAAQ,GAAG,SAAXA,QAAQA,CAAIC,QAAgB;IAAA,OAAKhB,aAAa,CAACgB,QAAQ,EAAE;MAAEC,KAAK,EAAE;KAAU,CAAC;;EACnF,IAAMC,aAAa,GAAGC,gBAAgB,CAAClB,KAAK,CAACY,QAAQ,EAAE,CAACO,gBAAgB,CAAC;EAEzEb,cAAK,CAACc,SAAS,CAAC;IACZ,IAAIZ,SAAS,CAACa,MAAM,CAACC,wBAAwB,CAACC,MAAM,EAAE;MAClDT,QAAQ,CAACN,SAAS,CAACa,MAAM,CAACC,wBAAwB,CAAC,CAAC,CA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IAAI,EAAE,IAAI;MAAEuF,KAAK,EAAE;KAAO;IAChDC,SAAS,EAAE,CAAC1F,SAAS,CAACiB,MAAM,CAACE,wBAAwB;IACrDwE,KAAK,EAAExF;IACT,CACH;AAEX;;;;"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React__default from 'react';
|
2
2
|
import cn from 'clsx';
|
3
|
+
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose, extends as _extends } from '../../../../../../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
3
4
|
import { Icon } from '../../../../../../../components/Icon/Icon.js';
|
4
5
|
import { useLocalization } from '../../../../../../../components/Provider/Localization.js';
|
5
6
|
import { Checkbox } from '../../../../../../../components/Checkbox/Checkbox.js';
|
@@ -11,25 +12,28 @@ import { arrayMove } from '@dnd-kit/sortable';
|
|
11
12
|
import { Item } from '../../../../../../Sortable/components/Item.js';
|
12
13
|
import { List } from '../../../../../../Sortable/components/List.js';
|
13
14
|
|
14
|
-
|
15
|
+
var _excluded = ["column", "draggable"],
|
16
|
+
_excluded2 = ["table", "trigger"];
|
17
|
+
var Column = /*#__PURE__*/React__default.forwardRef(function Column(props, ref) {
|
15
18
|
var _column$parent, _column$parent$column, _column$columnDef$met;
|
16
|
-
|
17
|
-
|
18
|
-
draggable = false,
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
const className = cn('group/column flex items-center gap-x-2 rounded py-1 px-2', {
|
19
|
+
var column = props.column,
|
20
|
+
_props$draggable = props.draggable,
|
21
|
+
draggable = _props$draggable === void 0 ? false : _props$draggable,
|
22
|
+
dragAttributes = _objectWithoutPropertiesLoose(props, _excluded);
|
23
|
+
var canHide = column.getCanHide();
|
24
|
+
var className = cn('group/column flex items-center gap-x-2 rounded py-1 px-2', {
|
23
25
|
'hover:bg-grey-200': canHide || draggable,
|
24
26
|
'hover:cursor-pointer': canHide,
|
25
27
|
'active:cursor-move active:bg-grey-300': draggable
|
26
28
|
});
|
27
|
-
|
28
|
-
|
29
|
-
|
29
|
+
var attributes = draggable ? dragAttributes : undefined;
|
30
|
+
var isVisible = column.getIsVisible();
|
31
|
+
var parentHeader = (_column$parent = column.parent) === null || _column$parent === void 0 ? void 0 : (_column$parent$column = _column$parent.columnDef) === null || _column$parent$column === void 0 ? void 0 : _column$parent$column.header;
|
30
32
|
return /*#__PURE__*/React__default.createElement("div", Object.assign({}, attributes, {
|
31
33
|
className: className,
|
32
|
-
onClick: ()
|
34
|
+
onClick: function onClick() {
|
35
|
+
return column.toggleVisibility(!isVisible);
|
36
|
+
},
|
33
37
|
ref: ref
|
34
38
|
}), draggable ? /*#__PURE__*/React__default.createElement(Icon, {
|
35
39
|
name: "drag",
|
@@ -40,46 +44,56 @@ const Column = /*#__PURE__*/React__default.forwardRef(function Column(props, ref
|
|
40
44
|
className: "italic"
|
41
45
|
}, "(", parentHeader, ")") : null), canHide ? /*#__PURE__*/React__default.createElement(Checkbox, {
|
42
46
|
checked: isVisible,
|
43
|
-
onChange: ()
|
47
|
+
onChange: function onChange() {
|
48
|
+
return column.toggleVisibility(!isVisible);
|
49
|
+
}
|
44
50
|
}) : null);
|
45
51
|
});
|
46
52
|
function HideOrOrderPopover(props) {
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
53
|
+
var table = props.table,
|
54
|
+
trigger = props.trigger,
|
55
|
+
popoverProps = _objectWithoutPropertiesLoose(props, _excluded2);
|
56
|
+
var _useLocalization = useLocalization(),
|
57
|
+
texts = _useLocalization.texts;
|
58
|
+
var _React$useState = React__default.useState(''),
|
59
|
+
query = _React$useState[0],
|
60
|
+
setQuery = _React$useState[1];
|
61
|
+
var allColumns = table.getAllLeafColumns();
|
62
|
+
var tableMeta = table.options.meta;
|
63
|
+
var columns = React__default.useMemo(function () {
|
64
|
+
return allColumns.filter(function (column) {
|
65
|
+
return !isInternalColumn(column.id);
|
66
|
+
}).filter(function (column) {
|
67
|
+
var _column$columnDef$met2, _column$parent2, _column$parent2$colum;
|
68
|
+
return query !== null && query !== void 0 && query.length ? ((_column$columnDef$met2 = column.columnDef.meta) === null || _column$columnDef$met2 === void 0 ? void 0 : _column$columnDef$met2.header.toLowerCase().includes(query.toLowerCase())) || ((_column$parent2 = column.parent) === null || _column$parent2 === void 0 ? void 0 : (_column$parent2$colum = _column$parent2.columnDef.meta) === null || _column$parent2$colum === void 0 ? void 0 : _column$parent2$colum.header.toLowerCase().includes(query.toLowerCase())) : true;
|
69
|
+
});
|
70
|
+
}, [allColumns, query]);
|
71
|
+
var listClassName = 'flex max-h-64 flex-col gap-y-px overflow-auto';
|
72
|
+
var handleReorder = function handleReorder(activeId, overId) {
|
73
|
+
if (columns.find(function (column) {
|
65
74
|
var _column$columnDef$met3;
|
66
75
|
return column.id === overId && ((_column$columnDef$met3 = column.columnDef.meta) === null || _column$columnDef$met3 === void 0 ? void 0 : _column$columnDef$met3.enableOrdering) === false;
|
67
76
|
})) {
|
68
77
|
return;
|
69
78
|
}
|
70
|
-
|
71
|
-
|
79
|
+
var currentOrder = table.getState().columnOrder;
|
80
|
+
var nextOrder = ensureOrdering(allColumns, arrayMove(currentOrder, currentOrder.findIndex(function (c) {
|
81
|
+
return c === activeId;
|
82
|
+
}), currentOrder.findIndex(function (c) {
|
83
|
+
return c === overId;
|
84
|
+
})));
|
72
85
|
// update column order
|
73
86
|
table.setColumnOrder(nextOrder);
|
74
87
|
// update pinned columns - because we do index based "freezing" instead of just pinning, pinned state needs updating to align with ordering
|
75
88
|
if (table.getIsSomeColumnsPinned()) {
|
76
89
|
var _table$getState$colum, _table$getState$colum2;
|
77
|
-
|
90
|
+
var currentFrozenIndex = (_table$getState$colum = (_table$getState$colum2 = table.getState().columnPinning.left) === null || _table$getState$colum2 === void 0 ? void 0 : _table$getState$colum2.length) !== null && _table$getState$colum !== void 0 ? _table$getState$colum : -1;
|
78
91
|
if (currentFrozenIndex > -1) {
|
79
|
-
table.setColumnPinning(currentPinning
|
80
|
-
|
81
|
-
|
82
|
-
|
92
|
+
table.setColumnPinning(function (currentPinning) {
|
93
|
+
return _extends({}, currentPinning, {
|
94
|
+
left: nextOrder.slice(0, currentFrozenIndex)
|
95
|
+
});
|
96
|
+
});
|
83
97
|
}
|
84
98
|
}
|
85
99
|
};
|
@@ -88,7 +102,9 @@ function HideOrOrderPopover(props) {
|
|
88
102
|
}), /*#__PURE__*/React__default.createElement(Popover.Content, null, /*#__PURE__*/React__default.createElement("div", {
|
89
103
|
className: "flex min-w-[100px] max-w-sm flex-col gap-2"
|
90
104
|
}, table.options.enableHiding ? (/*#__PURE__*/React__default.createElement(Input, {
|
91
|
-
onChange:
|
105
|
+
onChange: function onChange(event) {
|
106
|
+
return setQuery(event.target.value);
|
107
|
+
},
|
92
108
|
placeholder: texts.table.columnSettings.search,
|
93
109
|
value: query
|
94
110
|
})) : null, tableMeta.columnOrdering.isEnabled && columns.length && !(query !== null && query !== void 0 && query.length) ? (/*#__PURE__*/React__default.createElement(Container, {
|
@@ -96,7 +112,9 @@ function HideOrOrderPopover(props) {
|
|
96
112
|
}, /*#__PURE__*/React__default.createElement(List, {
|
97
113
|
id: "columns",
|
98
114
|
className: listClassName
|
99
|
-
}, columns.filter(
|
115
|
+
}, columns.filter(function (column) {
|
116
|
+
return !column.getIsGrouped();
|
117
|
+
}).map(function (column) {
|
100
118
|
var _column$columnDef$met4, _column$columnDef$met5;
|
101
119
|
return /*#__PURE__*/React__default.createElement(Item, {
|
102
120
|
key: column.id,
|
@@ -109,10 +127,12 @@ function HideOrOrderPopover(props) {
|
|
109
127
|
}));
|
110
128
|
})))) : (/*#__PURE__*/React__default.createElement("div", {
|
111
129
|
className: listClassName
|
112
|
-
}, columns.length ? columns.map(
|
113
|
-
|
114
|
-
|
115
|
-
|
130
|
+
}, columns.length ? columns.map(function (column) {
|
131
|
+
return /*#__PURE__*/React__default.createElement(Column, {
|
132
|
+
column: column,
|
133
|
+
key: column.id
|
134
|
+
});
|
135
|
+
}) : texts.table.columnSettings.noResults)))));
|
116
136
|
}
|
117
137
|
|
118
138
|
export { HideOrOrderPopover };
|