@economic/taco 2.19.0 → 2.20.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Provider/Localization.d.ts +18 -0
- package/dist/components/Report/components/Body/Body.d.ts +8 -0
- package/dist/components/Report/components/Cell/Cell.d.ts +3 -0
- package/dist/components/Report/components/Cell/DisplayCell.d.ts +7 -0
- package/dist/components/Report/components/Cell/GroupedCell.d.ts +7 -0
- package/dist/components/Report/components/Cell/util.d.ts +18 -0
- package/dist/components/Report/components/Footer/Footer.d.ts +6 -0
- package/dist/components/Report/components/Footer/Summary.d.ts +7 -0
- package/dist/components/Report/components/Header/Header.d.ts +37 -0
- package/dist/components/Report/components/Header/components/Goto.d.ts +6 -0
- package/dist/components/Report/components/Header/components/Menu.d.ts +17 -0
- package/dist/components/Report/components/Header/components/Resizer.d.ts +12 -0
- package/dist/components/Report/components/Header/components/SortIndicator.d.ts +15 -0
- package/dist/components/Report/components/Header/util.d.ts +4 -0
- package/dist/components/Report/components/Internal/Actions.d.ts +13 -0
- package/dist/components/Report/components/Internal/Expansion.d.ts +4 -0
- package/dist/components/Report/components/Internal/Selection.d.ts +4 -0
- package/dist/components/Report/components/Row/DisplayRow.d.ts +16 -0
- package/dist/components/Report/components/Row/Row.d.ts +8 -0
- package/dist/components/Report/components/Row/RowContext.d.ts +9 -0
- package/dist/components/Report/components/Row/SkeletonRow.d.ts +10 -0
- package/dist/components/Report/components/Toolbar/Toolbar.d.ts +15 -0
- package/dist/components/Report/components/Toolbar/components/Filters/Filters.d.ts +7 -0
- package/dist/components/Report/components/Toolbar/components/Filters/ManageFiltersPopover.d.ts +7 -0
- package/dist/components/Report/components/Toolbar/components/Filters/components/Filter.d.ts +12 -0
- package/dist/components/Report/components/Toolbar/components/Filters/components/FilterColumn.d.ts +9 -0
- package/dist/components/Report/components/Toolbar/components/Filters/components/FilterComparator.d.ts +7 -0
- package/dist/components/Report/components/Toolbar/components/Filters/components/FilterValue.d.ts +10 -0
- package/dist/components/Report/components/Toolbar/components/Filters/components/Placeholder.d.ts +12 -0
- package/dist/components/Report/components/Toolbar/components/Filters/util.d.ts +2 -0
- package/dist/components/Report/components/Toolbar/components/Print/Print.d.ts +9 -0
- package/dist/components/Report/components/Toolbar/components/Print/PrintDialog.d.ts +17 -0
- package/dist/components/Report/components/Toolbar/components/Search/Search.d.ts +8 -0
- package/dist/components/Report/components/Toolbar/components/Settings/HideOrOrderPopover.d.ts +7 -0
- package/dist/components/Report/components/Toolbar/components/Settings/Settings.d.ts +8 -0
- package/dist/components/Report/features/useReportExport.d.ts +3 -0
- package/dist/components/Report/styles/useColumnPinningStylesheet.d.ts +2 -0
- package/dist/components/Report/styles/useCssGridStylesheet.d.ts +3 -0
- package/dist/components/Report/styles/useStylesheet.d.ts +3 -0
- package/dist/components/Report/styles/util.d.ts +3 -0
- package/dist/components/Report/types.d.ts +20 -0
- package/dist/components/Report/useReport.d.ts +14 -0
- package/dist/components/Report/util/rows.d.ts +7 -0
- package/dist/components/Report/util/useTableGlobalShortcuts.d.ts +4 -0
- package/dist/components/Report/util/useTableRenderer.d.ts +9 -0
- package/dist/components/Table3/components/rows/Row.d.ts +1 -1
- package/dist/components/Table3/hooks/features/usePrinting.d.ts +7 -0
- package/dist/components/Table3/hooks/useTable.d.ts +5 -5
- package/dist/components/Table3/types.d.ts +21 -3
- package/dist/esm/packages/taco/src/components/Accordion/Accordion.js +1 -1
- package/dist/esm/packages/taco/src/components/Accordion/Accordion.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Alert/Alert.js +1 -1
- package/dist/esm/packages/taco/src/components/Alert/Alert.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.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 +1 -1
- package/dist/esm/packages/taco/src/components/Badge/Badge.js.map +1 -1
- package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js +1 -1
- package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Banner/Banner.js +2 -2
- package/dist/esm/packages/taco/src/components/Banner/Banner.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Button/Button.js +1 -1
- package/dist/esm/packages/taco/src/components/Button/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Calendar/Calendar.js +1 -1
- package/dist/esm/packages/taco/src/components/Calendar/Calendar.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Card/Card.js +2 -2
- package/dist/esm/packages/taco/src/components/Card/Card.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js +1 -1
- package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Combobox/Combobox.js +1 -1
- package/dist/esm/packages/taco/src/components/Combobox/Combobox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js +1 -1
- package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Content.js +5 -5
- 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 +1 -1
- 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 +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Extra.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/Drawer.js +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/Drawer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/components/Content.js +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/util.js +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Field/Field.js +1 -1
- package/dist/esm/packages/taco/src/components/Field/Field.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Form/Form.js +1 -1
- package/dist/esm/packages/taco/src/components/Form/Form.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Group/Group.js +1 -1
- package/dist/esm/packages/taco/src/components/Group/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Hanger/Hanger.js +2 -2
- package/dist/esm/packages/taco/src/components/Hanger/Hanger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/Header.js +1 -1
- 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 +1 -1
- 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/Display.js +2 -2
- 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 +2 -2
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Button.js +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/HoverCard/HoverCard.js +1 -1
- package/dist/esm/packages/taco/src/components/HoverCard/HoverCard.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/Icon.js +1 -1
- package/dist/esm/packages/taco/src/components/Icon/Icon.js.map +1 -1
- package/dist/esm/packages/taco/src/components/IconButton/IconButton.js +1 -1
- package/dist/esm/packages/taco/src/components/IconButton/IconButton.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Input/Input.js +1 -1
- package/dist/esm/packages/taco/src/components/Input/Input.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Input/util.js +1 -1
- package/dist/esm/packages/taco/src/components/Input/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/Layout.js +2 -2
- 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/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 +2 -2
- package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/Listbox.js +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/Listbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Content.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/RadioGroup.js +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/RadioGroup.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/SubMenu.js +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/SubMenu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js +1 -1
- package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation/Navigation.js +1 -1
- package/dist/esm/packages/taco/src/components/Navigation/Navigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js +1 -1
- 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 +1 -1
- 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 +2 -2
- 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 +1 -1
- 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 +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js +1 -1
- package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/Pagination.js +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Popover/Popover.js +1 -1
- package/dist/esm/packages/taco/src/components/Popover/Popover.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Progress/Progress.js +1 -1
- package/dist/esm/packages/taco/src/components/Progress/Progress.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +18 -0
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/esm/packages/taco/src/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/packages/taco/src/components/RadioGroup/util.js +1 -1
- package/dist/esm/packages/taco/src/components/RadioGroup/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js +1 -1
- package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js.map +1 -1
- package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js +3 -3
- package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select/Select.js +1 -1
- package/dist/esm/packages/taco/src/components/Select/Select.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select/useSelect.js +1 -1
- package/dist/esm/packages/taco/src/components/Select/useSelect.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Create.js +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +2 -2
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/utilities.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/utilities.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js +1 -1
- package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Spinner/Spinner.js +1 -1
- package/dist/esm/packages/taco/src/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Switch/Switch.js +1 -1
- package/dist/esm/packages/taco/src/components/Switch/Switch.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js +2 -2
- package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/renderColumn.js +1 -1
- 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 +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/renderRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +1 -6
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js +4 -2
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Highlight.js +2 -2
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Highlight.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Indicator.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Indicator.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js +2 -2
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Footer.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Footer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js +5 -2
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Resizer.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Resizer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Selection.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Selection.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js +2 -2
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js.map +1 -1
- package/dist/esm/packages/taco/src/{primitives/Table/useTable/features/useTablePrinting.js → components/Table3/hooks/features/usePrinting.js} +3 -3
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePrinting.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js +4 -3
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tabs/Tabs.js +1 -1
- package/dist/esm/packages/taco/src/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tag/Tag.js +2 -2
- package/dist/esm/packages/taco/src/components/Tag/Tag.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Textarea/Textarea.js +1 -1
- package/dist/esm/packages/taco/src/components/Textarea/Textarea.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Toast/Toast.js +2 -2
- package/dist/esm/packages/taco/src/components/Toast/Toast.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js +2 -2
- package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Treeview/Treeview.js +1 -1
- package/dist/esm/packages/taco/src/components/Treeview/Treeview.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/types.js +27 -0
- package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnOrdering.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnOrdering.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActive.js +11 -21
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActive.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowClick.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGoto.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGoto.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowSelection.js +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowSelection.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableServerLoading.js +42 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableServerLoading.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js +10 -8
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js +7 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js.map +1 -0
- package/dist/esm/packages/taco/src/utils/dom.js +10 -1
- package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
- package/dist/primitives/Table/types.d.ts +187 -2
- package/dist/primitives/Table/useTable/features/useTableColumnFreezing.d.ts +6 -0
- package/dist/primitives/Table/useTable/features/useTableFooter.d.ts +3 -0
- package/dist/primitives/Table/useTable/features/useTablePrinting.d.ts +1 -0
- package/dist/primitives/Table/useTable/features/useTableRef.d.ts +4 -0
- package/dist/primitives/Table/useTable/features/useTableRowActions.d.ts +6 -0
- package/dist/primitives/Table/useTable/features/useTableRowActive.d.ts +0 -1
- package/dist/primitives/Table/useTable/features/useTableRowClick.d.ts +1 -1
- package/dist/primitives/Table/useTable/features/useTableRowExpansion.d.ts +5 -0
- package/dist/primitives/Table/useTable/features/useTableRowGoto.d.ts +1 -1
- package/dist/primitives/Table/useTable/features/useTableRowGroups.d.ts +5 -0
- package/dist/primitives/Table/useTable/features/useTableRowSelection.d.ts +1 -0
- package/dist/primitives/Table/useTable/features/useTableSearch.d.ts +11 -0
- package/dist/primitives/Table/useTable/features/useTableServerLoading.d.ts +5 -2
- package/dist/primitives/Table/useTable/features/useTableSettings.d.ts +3 -0
- package/dist/primitives/Table/useTable/listeners/useTableRowHeightListener.d.ts +2 -0
- package/dist/primitives/Table/useTable/listeners/useTableSearchListener.d.ts +2 -0
- package/dist/primitives/Table/useTable/listeners/useTableSettingsListener.d.ts +3 -0
- package/dist/primitives/Table/useTable/useTable.d.ts +57 -0
- package/dist/primitives/Table/useTable/util/columns.d.ts +7 -1
- package/dist/primitives/Table/useTable/util/columns.spec.d.ts +1 -0
- package/dist/primitives/Table/useTable/util/filtering.d.ts +7 -0
- package/dist/primitives/Table/useTable/util/presets.d.ts +2 -0
- package/dist/primitives/Table/useTable/util/search.d.ts +2 -0
- package/dist/primitives/Table/useTable/util/settings.d.ts +13 -0
- package/dist/primitives/Table/useTable/util/setup.d.ts +14 -0
- package/dist/primitives/Table/useTable/util/sorting.d.ts +2 -0
- package/dist/primitives/Table/useTableDataLoader.d.ts +23 -0
- package/dist/taco.cjs.development.js +149 -68
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/dist/utils/dom.d.ts +1 -0
- package/package.json +4 -3
- package/types.json +20882 -7749
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTablePrinting.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Pagination.js","sources":["../../../../../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { PageNumbers } from './PageNumbers';\nimport { LocalizationTexts, useLocalization } from '../Provider/Localization';\nimport { Select } from '../Select/Select';\nimport { Group } from '../Group/Group';\nimport { IconButton } from '../IconButton/IconButton';\nimport { usePaginationValues } from './usePagination';\nimport { usePaginationShortcuts } from './usePaginationShortcuts';\n\nexport * from './usePagination';\n\nexport type PaginationTextsActions = {\n /**\n * Aria-label for first page action button.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n firstPage: string;\n /**\n * Aria-label for first page action button with shortcut.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n firstPageWithShortcut: string;\n /**\n * Aria-label for next page action button.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n nextPage: string;\n /**\n * Aria-label for next page action button with shortcut.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n nextPageWithShortcut: string;\n /**\n * Aria-label for previous page action button.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n previousPage: string;\n /**\n * Aria-label for previous page action button with shortcut.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n previousPageWithShortcut: string;\n /**\n * Aria-label for last page action button.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n lastPage: string;\n /**\n * Aria-label for last page action button with shortcut.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n lastPageWithShortcut: string;\n /**\n * Aria-label for page X action button.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n pageX: string;\n};\n\nexport type PaginationTexts = {\n /**\n * Aria-label provided for page numbers and page actions group.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n label: string;\n /**\n * Aria-label provided for page size selection.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n pageSize: string;\n /**\n * Text that indicates the number of the first and last element displayed on the current page, out of total items\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n showingXofYofTotal: string;\n /**\n * Aria-labels provided for page action buttons.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n actions: PaginationTextsActions;\n};\n\nexport type PaginationProps = React.HTMLAttributes<HTMLDivElement> &\n usePaginationValues & {\n /** Indicate total number of items that will be paginated */\n length: number;\n /** Page size options */\n pageSizes?: number[];\n /** Shows page controls */\n showPageControls?: boolean;\n /** Shows page numbers between navigation buttons, which allows users to quickly navigate to a specific page */\n showPageNumbers?: boolean;\n /** Shows a dropdown with page sizes, which allows user to change the number of items displayed on the page */\n showPageSize?: boolean;\n /** Enable pagination shortcuts */\n dangerouslyHijackGlobalKeyboardNavigation?: boolean;\n };\n\nconst getShowingLabel = (length: number, pageIndex: number, pageSize: number, texts: LocalizationTexts): string => {\n const minItemIndex = pageIndex * pageSize + 1;\n const maxItemIndex = (pageIndex + 1) * pageSize;\n\n return texts.pagination.showingXofYofTotal\n .replace('[X]', length === 0 ? '0' : String(minItemIndex))\n .replace('[Y]', String(maxItemIndex > length ? length : maxItemIndex))\n .replace('[total]', String(length));\n};\n\nexport const Pagination = React.forwardRef(function Pagination(props: PaginationProps, ref: React.Ref<HTMLDivElement>) {\n const {\n length,\n pageIndex,\n pageSize,\n pageSizes = [10, 25, 50, 100, 500],\n setPageIndex,\n setPageSize,\n showPageControls = true,\n showPageNumbers = true,\n showPageSize = true,\n dangerouslyHijackGlobalKeyboardNavigation = false,\n ...otherProps\n } = props;\n const { texts } = useLocalization();\n\n const maxPageIndex = Math.ceil(length / pageSize) - 1;\n const showShortcutTexts = dangerouslyHijackGlobalKeyboardNavigation;\n\n usePaginationShortcuts({\n setPageIndex,\n maxPageIndex,\n pageIndex,\n dangerouslyHijackGlobalKeyboardNavigation,\n });\n\n const pageCount = Math.ceil(length / pageSize);\n const canPreviousPage = pageIndex > 0;\n const canNextPage = pageIndex < pageCount - 1;\n\n const className = cn('inline-flex relative justify-between items-center', props.className);\n\n return (\n <div {...otherProps} className={className} data-taco=\"pagination\" ref={ref}>\n {showPageSize && (\n <span className=\"mr-4\">\n {getShowingLabel(length, pageIndex, pageSize, texts)}\n <Select\n aria-label={texts.pagination.pageSize}\n className=\"ml-4 !w-20\"\n data={pageSizes.map(pageSize => ({\n text: String(pageSize),\n value: pageSize,\n }))}\n onChange={event => {\n setPageIndex(0);\n setPageSize(Number(event.target.value));\n }}\n value={pageSize}\n />\n </span>\n )}\n {showPageControls && (\n <Group as=\"nav\" aria-label={texts.pagination.label}>\n <IconButton\n appearance=\"default\"\n disabled={!canPreviousPage}\n icon=\"arrow-start\"\n onClick={() => setPageIndex(0)}\n aria-label={\n showShortcutTexts\n ? texts.pagination.actions.firstPageWithShortcut\n : texts.pagination.actions.firstPage\n }\n tooltip={\n showShortcutTexts\n ? texts.pagination.actions.firstPageWithShortcut\n : texts.pagination.actions.firstPage\n }\n />\n <IconButton\n appearance=\"default\"\n disabled={!canPreviousPage}\n icon=\"arrow-left\"\n onClick={() => setPageIndex(pageIndex - 1)}\n aria-label={\n showShortcutTexts\n ? texts.pagination.actions.previousPageWithShortcut\n : texts.pagination.actions.previousPage\n }\n tooltip={\n showShortcutTexts\n ? texts.pagination.actions.previousPageWithShortcut\n : texts.pagination.actions.previousPage\n }\n />\n {showPageNumbers && pageCount > 0 && (\n <PageNumbers pageCount={pageCount} currentPageIndex={pageIndex} onClick={setPageIndex} />\n )}\n <IconButton\n appearance=\"default\"\n disabled={!canNextPage}\n icon=\"arrow-right\"\n onClick={() => setPageIndex(pageIndex + 1)}\n aria-label={\n showShortcutTexts ? texts.pagination.actions.nextPageWithShortcut : texts.pagination.actions.nextPage\n }\n tooltip={\n showShortcutTexts ? texts.pagination.actions.nextPageWithShortcut : texts.pagination.actions.nextPage\n }\n />\n <IconButton\n appearance=\"default\"\n disabled={!canNextPage}\n icon=\"arrow-end\"\n onClick={() => setPageIndex(pageCount - 1)}\n aria-label={\n showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage\n }\n tooltip={\n showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage\n }\n />\n </Group>\n )}\n </div>\n );\n});\n"],"names":["getShowingLabel","length","pageIndex","pageSize","texts","minItemIndex","maxItemIndex","pagination","showingXofYofTotal","replace","String","Pagination","React","props","ref","pageSizes","setPageIndex","setPageSize","showPageControls","showPageNumbers","showPageSize","dangerouslyHijackGlobalKeyboardNavigation","otherProps","useLocalization","maxPageIndex","Math","ceil","showShortcutTexts","usePaginationShortcuts","pageCount","canPreviousPage","canNextPage","className","cn","Select","data","map","text","value","onChange","event","Number","target","Group","as","label","IconButton","appearance","disabled","icon","onClick","actions","firstPageWithShortcut","firstPage","tooltip","previousPageWithShortcut","previousPage","PageNumbers","currentPageIndex","nextPageWithShortcut","nextPage","lastPageWithShortcut","lastPage"],"mappings":";;;;;;;;;;AAmGA,MAAMA,eAAe,GAAGA,CAACC,MAAc,EAAEC,SAAiB,EAAEC,QAAgB,EAAEC,KAAwB;EAClG,MAAMC,YAAY,GAAGH,SAAS,GAAGC,QAAQ,GAAG,CAAC;EAC7C,MAAMG,YAAY,GAAG,CAACJ,SAAS,GAAG,CAAC,IAAIC,QAAQ;EAE/C,OAAOC,KAAK,CAACG,UAAU,CAACC,kBAAkB,CACrCC,OAAO,CAAC,KAAK,EAAER,MAAM,KAAK,CAAC,GAAG,GAAG,GAAGS,MAAM,CAACL,YAAY,CAAC,CAAC,CACzDI,OAAO,CAAC,KAAK,EAAEC,MAAM,CAACJ,YAAY,GAAGL,MAAM,GAAGA,MAAM,GAAGK,YAAY,CAAC,CAAC,CACrEG,OAAO,CAAC,SAAS,EAAEC,MAAM,CAACT,MAAM,CAAC,CAAC;AAC3C,CAAC;MAEYU,UAAU,gBAAGC,UAAgB,CAAC,SAASD,UAAUA,CAACE,KAAsB,EAAEC,GAA8B;EACjH,MAAM;IACFb,MAAM;IACNC,SAAS;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B,EAAExD,SAAS;IAAEgD,OAAO,EAAElC;IAAgB,CAC5F,eACDJ,cAACkC,UAAU;IACPC,UAAU,EAAC,SAAS;IACpBC,QAAQ,EAAE,CAACjB,WAAW;IACtBkB,IAAI,EAAC,aAAa;IAClBC,OAAO,EAAEA,MAAMlC,YAAY,CAACd,SAAS,GAAG,CAAC,CAAC;kBAEtCyB,iBAAiB,GAAGvB,KAAK,CAACG,UAAU,CAAC4C,OAAO,CAACQ,oBAAoB,GAAGvD,KAAK,CAACG,UAAU,CAAC4C,OAAO,CAACS,QAAQ;IAEzGN,OAAO,EACH3B,iBAAiB,GAAGvB,KAAK,CAACG,UAAU,CAAC4C,OAAO,CAACQ,oBAAoB,GAAGvD,KAAK,CAACG,UAAU,CAAC4C,OAAO,CAACS;IAEnG,eACFhD,cAACkC,UAAU;IACPC,UAAU,EAAC,SAAS;IACpBC,QAAQ,EAAE,CAACjB,WAAW;IACtBkB,IAAI,EAAC,WAAW;IAChBC,OAAO,EAAEA,MAAMlC,YAAY,CAACa,SAAS,GAAG,CAAC,CAAC;kBAEtCF,iBAAiB,GAAGvB,KAAK,CAACG,UAAU,CAAC4C,OAAO,CAACU,oBAAoB,GAAGzD,KAAK,CAACG,UAAU,CAAC4C,OAAO,CAACW,QAAQ;IAEzGR,OAAO,EACH3B,iBAAiB,GAAGvB,KAAK,CAACG,UAAU,CAAC4C,OAAO,CAACU,oBAAoB,GAAGzD,KAAK,CAACG,UAAU,CAAC4C,OAAO,CAACW;IAEnG,CACE,CACX,CACC;AAEd,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"Pagination.js","sources":["../../../../../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport { PageNumbers } from './PageNumbers';\nimport { LocalizationTexts, useLocalization } from '../Provider/Localization';\nimport { Select } from '../Select/Select';\nimport { Group } from '../Group/Group';\nimport { IconButton } from '../IconButton/IconButton';\nimport { usePaginationValues } from './usePagination';\nimport { usePaginationShortcuts } from './usePaginationShortcuts';\n\nexport * from './usePagination';\n\nexport type PaginationTextsActions = {\n /**\n * Aria-label for first page action button.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n firstPage: string;\n /**\n * Aria-label for first page action button with shortcut.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n firstPageWithShortcut: string;\n /**\n * Aria-label for next page action button.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n nextPage: string;\n /**\n * Aria-label for next page action button with shortcut.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n nextPageWithShortcut: string;\n /**\n * Aria-label for previous page action button.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n previousPage: string;\n /**\n * Aria-label for previous page action button with shortcut.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n previousPageWithShortcut: string;\n /**\n * Aria-label for last page action button.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n lastPage: string;\n /**\n * Aria-label for last page action button with shortcut.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n lastPageWithShortcut: string;\n /**\n * Aria-label for page X action button.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n pageX: string;\n};\n\nexport type PaginationTexts = {\n /**\n * Aria-label provided for page numbers and page actions group.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n label: string;\n /**\n * Aria-label provided for page size selection.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n pageSize: string;\n /**\n * Text that indicates the number of the first and last element displayed on the current page, out of total items\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n showingXofYofTotal: string;\n /**\n * Aria-labels provided for page action buttons.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n actions: PaginationTextsActions;\n};\n\nexport type PaginationProps = React.HTMLAttributes<HTMLDivElement> &\n usePaginationValues & {\n /** Indicate total number of items that will be paginated */\n length: number;\n /** Page size options */\n pageSizes?: number[];\n /** Shows page controls */\n showPageControls?: boolean;\n /** Shows page numbers between navigation buttons, which allows users to quickly navigate to a specific page */\n showPageNumbers?: boolean;\n /** Shows a dropdown with page sizes, which allows user to change the number of items displayed on the page */\n showPageSize?: boolean;\n /** Enable pagination shortcuts */\n dangerouslyHijackGlobalKeyboardNavigation?: boolean;\n };\n\nconst getShowingLabel = (length: number, pageIndex: number, pageSize: number, texts: LocalizationTexts): string => {\n const minItemIndex = pageIndex * pageSize + 1;\n const maxItemIndex = (pageIndex + 1) * pageSize;\n\n return texts.pagination.showingXofYofTotal\n .replace('[X]', length === 0 ? '0' : String(minItemIndex))\n .replace('[Y]', String(maxItemIndex > length ? length : maxItemIndex))\n .replace('[total]', String(length));\n};\n\nexport const Pagination = React.forwardRef(function Pagination(props: PaginationProps, ref: React.Ref<HTMLDivElement>) {\n const {\n length,\n pageIndex,\n pageSize,\n pageSizes = [10, 25, 50, 100, 500],\n setPageIndex,\n setPageSize,\n showPageControls = true,\n showPageNumbers = true,\n showPageSize = true,\n dangerouslyHijackGlobalKeyboardNavigation = false,\n ...otherProps\n } = props;\n const { texts } = useLocalization();\n\n const maxPageIndex = Math.ceil(length / pageSize) - 1;\n const showShortcutTexts = dangerouslyHijackGlobalKeyboardNavigation;\n\n usePaginationShortcuts({\n setPageIndex,\n maxPageIndex,\n pageIndex,\n dangerouslyHijackGlobalKeyboardNavigation,\n });\n\n const pageCount = Math.ceil(length / pageSize);\n const canPreviousPage = pageIndex > 0;\n const canNextPage = pageIndex < pageCount - 1;\n\n const className = cn('inline-flex relative justify-between items-center', props.className);\n\n return (\n <div {...otherProps} className={className} data-taco=\"pagination\" ref={ref}>\n {showPageSize && (\n <span className=\"mr-4\">\n {getShowingLabel(length, pageIndex, pageSize, texts)}\n <Select\n aria-label={texts.pagination.pageSize}\n className=\"ml-4 !w-20\"\n data={pageSizes.map(pageSize => ({\n text: String(pageSize),\n value: pageSize,\n }))}\n onChange={event => {\n setPageIndex(0);\n setPageSize(Number(event.target.value));\n }}\n value={pageSize}\n />\n </span>\n )}\n {showPageControls && (\n <Group as=\"nav\" aria-label={texts.pagination.label}>\n <IconButton\n appearance=\"default\"\n disabled={!canPreviousPage}\n icon=\"arrow-start\"\n onClick={() => setPageIndex(0)}\n aria-label={\n showShortcutTexts\n ? texts.pagination.actions.firstPageWithShortcut\n : texts.pagination.actions.firstPage\n }\n tooltip={\n showShortcutTexts\n ? texts.pagination.actions.firstPageWithShortcut\n : texts.pagination.actions.firstPage\n }\n />\n <IconButton\n appearance=\"default\"\n disabled={!canPreviousPage}\n icon=\"arrow-left\"\n onClick={() => setPageIndex(pageIndex - 1)}\n aria-label={\n showShortcutTexts\n ? texts.pagination.actions.previousPageWithShortcut\n : texts.pagination.actions.previousPage\n }\n tooltip={\n showShortcutTexts\n ? texts.pagination.actions.previousPageWithShortcut\n : texts.pagination.actions.previousPage\n }\n />\n {showPageNumbers && pageCount > 0 && (\n <PageNumbers pageCount={pageCount} currentPageIndex={pageIndex} onClick={setPageIndex} />\n )}\n <IconButton\n appearance=\"default\"\n disabled={!canNextPage}\n icon=\"arrow-right\"\n onClick={() => setPageIndex(pageIndex + 1)}\n aria-label={\n showShortcutTexts ? texts.pagination.actions.nextPageWithShortcut : texts.pagination.actions.nextPage\n }\n tooltip={\n showShortcutTexts ? texts.pagination.actions.nextPageWithShortcut : texts.pagination.actions.nextPage\n }\n />\n <IconButton\n appearance=\"default\"\n disabled={!canNextPage}\n icon=\"arrow-end\"\n onClick={() => setPageIndex(pageCount - 1)}\n aria-label={\n showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage\n }\n tooltip={\n showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage\n }\n />\n </Group>\n )}\n </div>\n );\n});\n"],"names":["getShowingLabel","length","pageIndex","pageSize","texts","minItemIndex","maxItemIndex","pagination","showingXofYofTotal","replace","String","Pagination","React","props","ref","pageSizes","setPageIndex","setPageSize","showPageControls","showPageNumbers","showPageSize","dangerouslyHijackGlobalKeyboardNavigation","otherProps","useLocalization","maxPageIndex","Math","ceil","showShortcutTexts","usePaginationShortcuts","pageCount","canPreviousPage","canNextPage","className","cn","Select","data","map","text","value","onChange","event","Number","target","Group","as","label","IconButton","appearance","disabled","icon","onClick","actions","firstPageWithShortcut","firstPage","tooltip","previousPageWithShortcut","previousPage","PageNumbers","currentPageIndex","nextPageWithShortcut","nextPage","lastPageWithShortcut","lastPage"],"mappings":";;;;;;;;;;AAmGA,MAAMA,eAAe,GAAGA,CAACC,MAAc,EAAEC,SAAiB,EAAEC,QAAgB,EAAEC,KAAwB;EAClG,MAAMC,YAAY,GAAGH,SAAS,GAAGC,QAAQ,GAAG,CAAC;EAC7C,MAAMG,YAAY,GAAG,CAACJ,SAAS,GAAG,CAAC,IAAIC,QAAQ;EAE/C,OAAOC,KAAK,CAACG,UAAU,CAACC,kBAAkB,CACrCC,OAAO,CAAC,KAAK,EAAER,MAAM,KAAK,CAAC,GAAG,GAAG,GAAGS,MAAM,CAACL,YAAY,CAAC,CAAC,CACzDI,OAAO,CAAC,KAAK,EAAEC,MAAM,CAACJ,YAAY,GAAGL,MAAM,GAAGA,MAAM,GAAGK,YAAY,CAAC,CAAC,CACrEG,OAAO,CAAC,SAAS,EAAEC,MAAM,CAACT,MAAM,CAAC,CAAC;AAC3C,CAAC;MAEYU,UAAU,gBAAGC,UAAgB,CAAC,SAASD,UAAUA,CAACE,KAAsB,EAAEC,GAA8B;EACjH,MAAM;IACFb,MAAM;IACNC,SAAS;IACTC,QAAQ;IACRY,SAAS,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC;IAClCC,YAAY;IACZC,WAAW;IACXC,gBAAgB,GAAG,IAAI;IACvBC,eAAe,GAAG,IAAI;IACtBC,YAAY,GAAG,IAAI;IACnBC,yCAAyC,GAAG,KAAK;IACjD,GAAGC;GACN,GAAGT,KAAK;EACT,MAAM;IAAET;GAAO,GAAGmB,eAAe,EAAE;EAEnC,MAAMC,YAAY,GAAGC,IAAI,CAACC,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S,QAAQ;IAEzGN,OAAO,EACH3B,iBAAiB,GAAGvB,KAAK,CAACG,UAAU,CAAC4C,OAAO,CAACQ,oBAAoB,GAAGvD,KAAK,CAACG,UAAU,CAAC4C,OAAO,CAACS;IAEnG,eACFhD,cAACkC,UAAU;IACPC,UAAU,EAAC,SAAS;IACpBC,QAAQ,EAAE,CAACjB,WAAW;IACtBkB,IAAI,EAAC,WAAW;IAChBC,OAAO,EAAEA,MAAMlC,YAAY,CAACa,SAAS,GAAG,CAAC,CAAC;kBAEtCF,iBAAiB,GAAGvB,KAAK,CAACG,UAAU,CAAC4C,OAAO,CAACU,oBAAoB,GAAGzD,KAAK,CAACG,UAAU,CAAC4C,OAAO,CAACW,QAAQ;IAEzGR,OAAO,EACH3B,iBAAiB,GAAGvB,KAAK,CAACG,UAAU,CAAC4C,OAAO,CAACU,oBAAoB,GAAGzD,KAAK,CAACG,UAAU,CAAC4C,OAAO,CAACW;IAEnG,CACE,CACX,CACC;AAEd,CAAC;;;;"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { forwardRef, useMemo, createElement, createContext, useContext, isValidElement } from 'react';
|
2
|
-
import cn from '
|
2
|
+
import cn from 'clsx';
|
3
3
|
import { mergeRefs } from '../../utils/mergeRefs.js';
|
4
4
|
import { Root, Portal, Anchor as Anchor$1, Trigger as Trigger$1, Content as Content$1, Close as Close$1 } from '@radix-ui/react-popover';
|
5
5
|
import { UnstyledArrow } from './Primitives.js';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Popover.js","sources":["../../../../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from '
|
1
|
+
{"version":3,"file":"Popover.js","sources":["../../../../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { Placement } from '../..';\nimport { UnstyledArrow } from './Primitives';\nimport { mergeRefs } from '../../utils/mergeRefs';\nimport { getPopoverStyleClassnames } from './util';\n\ntype PopoverContextValue = { props: any; ref: React.Ref<HTMLElement> };\n\nconst PopoverContext = React.createContext<PopoverContextValue>({\n props: {},\n ref: null,\n});\n\nexport type PopoverAnchorProps = React.HTMLAttributes<HTMLElement>;\nconst Anchor = React.forwardRef(function PopoverAnchor(props: PopoverAnchorProps, ref: React.Ref<HTMLDivElement>) {\n return <PopoverPrimitive.Anchor {...props} asChild ref={ref} />;\n});\n\nexport type PopoverTriggerProps = React.HTMLAttributes<HTMLElement>;\nconst Trigger = React.forwardRef(function PopoverTrigger(props: PopoverTriggerProps, externalRef: React.Ref<HTMLElement>) {\n const { ref: parentRef, props: parentProps } = React.useContext(PopoverContext);\n const refCallback = mergeRefs([parentRef, externalRef]);\n\n let children = props.children;\n\n if (React.isValidElement(props.children) && typeof props.children?.type === 'function') {\n console.warn(\n `Popover.Trigger requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '${props.children.type.name}' in React.forwardRef()? Taco has wrapped '${props.children.type.name}' in a 'span' to maintain functionality, but this may cause unintended behaviour`\n );\n children = <span>{props.children}</span>;\n }\n\n return (\n <PopoverPrimitive.Trigger {...parentProps} {...props} ref={refCallback} asChild>\n {children}\n </PopoverPrimitive.Trigger>\n );\n});\n\nconst RenderPropWrapper = React.forwardRef(function RenderPropWrapper({ children, onClick }: any, ref) {\n const close = () => {\n onClick(new CustomEvent('hide'));\n };\n\n return children({ close, ref });\n});\n\nexport type PopoverContentRenderProps = { close: () => void };\nexport type PopoverContentProps = Omit<PopoverPrimitive.PopoverContentProps, 'side'> & {\n children: React.ReactNode | ((props: PopoverContentRenderProps) => React.ReactNode);\n /** Set the position of the Popover relative to its trigger. Default value is `bottom` */\n placement?: Placement;\n};\nconst Content = React.forwardRef(function PopoverContent(props: PopoverContentProps, ref: React.Ref<HTMLDivElement>) {\n const { placement: side, ...popoverContentProps } = props;\n const className = cn(getPopoverStyleClassnames(), props.className);\n\n let output;\n\n if (typeof props.children === 'function') {\n output = (\n <PopoverPrimitive.Close asChild>\n <RenderPropWrapper>{props.children}</RenderPropWrapper>\n </PopoverPrimitive.Close>\n );\n } else {\n output = props.children;\n }\n\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n {...popoverContentProps}\n className={className}\n data-taco=\"popover\"\n side={side}\n sideOffset={1}\n ref={ref}>\n {output}\n <UnstyledArrow className=\"text-white\" />\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n );\n});\n\nexport type PopoverCloseProps = React.HTMLAttributes<HTMLButtonElement>;\nconst Close = React.forwardRef(\n (props: PopoverCloseProps, ref: React.Ref<HTMLButtonElement>): JSX.Element => (\n <PopoverPrimitive.Close {...props} ref={ref} asChild />\n )\n);\n\nexport type PopoverProps = React.PropsWithChildren<{\n anchor?: JSX.Element;\n modal?: boolean;\n /** A trigger to be used for the popover, should not be set if `children` already contains a trigger */\n trigger?: JSX.Element;\n /** Set whether the popover is open by default or not, use when not providing a trigger */\n defaultOpen?: boolean;\n /** Control the open state of the popover from outside the component */\n open?: boolean;\n /** Called when the popover opens or closes, must be used in conjunction with open */\n onChange?: (open: boolean) => void;\n}>;\nexport type ForwardedPopoverWithStatics = React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLElement>> & {\n Anchor: React.ForwardRefExoticComponent<PopoverAnchorProps>;\n Trigger: React.ForwardRefExoticComponent<PopoverTriggerProps>;\n Content: React.ForwardRefExoticComponent<PopoverContentProps>;\n Close: React.ForwardRefExoticComponent<PopoverCloseProps>;\n Portal: React.FunctionComponent<PopoverPrimitive.PortalProps>;\n};\n\nexport const Popover = React.forwardRef<HTMLElement, PopoverProps>(function Popover(props, ref) {\n const { anchor, children, defaultOpen, modal = false, open, onChange, trigger, ...otherProps } = props;\n const context = React.useMemo(() => ({ props: otherProps, ref }), [otherProps]);\n\n return (\n <PopoverContext.Provider value={context}>\n <PopoverPrimitive.Root defaultOpen={defaultOpen} modal={modal} open={open} onOpenChange={onChange}>\n {anchor ? <Anchor>{anchor}</Anchor> : null}\n {trigger && !anchor ? <Trigger>{trigger}</Trigger> : null}\n {children}\n </PopoverPrimitive.Root>\n </PopoverContext.Provider>\n );\n}) as ForwardedPopoverWithStatics;\nPopover.Anchor = Anchor;\nPopover.Trigger = Trigger;\nPopover.Content = Content;\nPopover.Close = Close;\nPopover.Portal = PopoverPrimitive.Portal;\n"],"names":["PopoverContext","React","props","ref","Anchor","PopoverAnchor","PopoverPrimitive","asChild","Trigger","PopoverTrigger","externalRef","parentRef","parentProps","refCallback","mergeRefs","children","_props$children","type","console","warn","name","RenderPropWrapper","onClick","close","CustomEvent","Content","PopoverContent","placement","side","popoverContentProps","className","cn","getPopoverStyleClassnames","output","sideOffset","UnstyledArrow","Close","Popover","anchor","defaultOpen","modal","open","onChange","trigger","otherProps","context","Provider","value","onOpenChange","Portal"],"mappings":";;;;;;;AAUA,MAAMA,cAAc,gBAAGC,aAAmB,CAAsB;EAC5DC,KAAK,EAAE,EAAE;EACTC,GAAG,EAAE;CACR,CAAC;AAGF,MAAMC,MAAM,gBAAGH,UAAgB,CAAC,SAASI,aAAaA,CAACH,KAAyB,EAAEC,GAA8B;EAC5G,oBAAOF,cAACK,QAAuB,oBAAKJ,KAAK;IAAEK,OAAO;IAACJ,GAAG,EAAEA;KAAO;AACnE,CAAC,CAAC;AAGF,MAAMK,OAAO,gBAAGP,UAAgB,CAAC,SAASQ,cAAcA,CAACP,KAA0B,EAAEQ,WAAmC;;EACpH,MAAM;IAAEP,GAAG,EAAEQ,SAAS;IAAET,KAAK,EAAEU;GAAa,GAAGX,UAAgB,CAACD,cAAc,CAAC;EAC/E,MAAMa,WAAW,GAAGC,SAAS,CAAC,CAACH,SAAS,EAAED,WAAW,CAAC,CAAC;EAEvD,IAAIK,QAAQ,GAAGb,KAAK,CAACa,QAAQ;EAE7B,kBAAId,cAAoB,CAACC,KAAK,CAACa,QAAQ,CAAC,IAAI,SAAAC,eAAA,GAAOd,KAAK,CAACa,QAAQ,cAAAC,eAAA,u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KAAK,GAAGA,KAAK;AACrBC,OAAO,CAACY,MAAM,GAAG3C,MAAuB;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Progress.js","sources":["../../../../../../../src/components/Progress/Progress.tsx"],"sourcesContent":["import React from 'react';\nimport cn from '
|
1
|
+
{"version":3,"file":"Progress.js","sources":["../../../../../../../src/components/Progress/Progress.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport './Progress.css';\n\nexport type ProgressProps = React.HTMLAttributes<HTMLSpanElement> & {\n /**\n * Indicates how long (in milliseconds) a progress bar will take to progress through.\n * By default, progress bar has no duration\n */\n duration?: number;\n};\n\nexport const Progress = ({ duration = undefined, ...props }: ProgressProps): JSX.Element => {\n let style;\n\n if (duration) {\n style = {\n animationDuration: `${duration}ms`,\n };\n }\n\n const className = cn('bg-grey-100 rounded block h-1 overflow-hidden w-full', props.className);\n\n const progressClassName = cn('yt-progress__bar block h-1', {\n \"w-full before:h-1 before:bg-grey-300 before:block before:animate-[progress-indeterminate_2s_cubic-bezier(0.4,0,0.2,1)_infinite] before:content-[' ']\":\n !duration,\n [`w-0 bg-grey-300 animate-[progress_linear]`]: duration,\n });\n\n return (\n <span {...props} data-taco=\"progress\" className={className}>\n <span className={progressClassName} data-taco=\"progress-bar\" style={style} />\n </span>\n );\n};\n"],"names":["Progress","duration","undefined","props","style","animationDuration","className","cn","progressClassName","React"],"mappings":";;;MAYaA,QAAQ,GAAGA,CAAC;EAAEC,QAAQ,GAAGC,SAAS;EAAE,GAAGC;CAAsB;EACtE,IAAIC,KAAK;EAET,IAAIH,QAAQ,EAAE;IACVG,KAAK,GAAG;MACJC,iBAAiB,KAAKJ;KACzB;;EAGL,MAAMK,SAAS,GAAGC,EAAE,CAAC,sDAAsD,EAAEJ,KAAK,CAACG,SAAS,CAAC;EAE7F,MAAME,iBAAiB,GAAGD,EAAE,CAAC,4BAA4B,EAAE;IACvD,sJAAsJ,EAClJ,CAACN,QAAQ;IACb,4CAA4C,GAAGA;GAClD,CAAC;EAEF,oBACIQ,uDAAUN,KAAK;iBAAY,UAAU;IAACG,SAAS,EAAEA;mBAC7CG;IAAMH,SAAS,EAAEE,iBAAiB;iBAAY,cAAc;IAACJ,KAAK,EAAEA;IAAS,CAC1E;AAEf;;;;"}
|
@@ -180,6 +180,7 @@ const defaultLocalisationTexts = {
|
|
180
180
|
value: 'Value'
|
181
181
|
},
|
182
182
|
hiddenColumn: 'Hidden column',
|
183
|
+
hiddenGroupedColumn: 'Hidden grouped column',
|
183
184
|
tooltip: 'Apply filters',
|
184
185
|
total: 'Viewing [CURRENT] of [TOTAL]'
|
185
186
|
},
|
@@ -208,6 +209,23 @@ const defaultLocalisationTexts = {
|
|
208
209
|
checkboxVisibilityLabel: "Don't show again",
|
209
210
|
cancelButtonText: 'Cancel',
|
210
211
|
printButtonText: 'Print'
|
212
|
+
},
|
213
|
+
settingsDialog: {
|
214
|
+
title: 'Print settings',
|
215
|
+
size: 'Paper size',
|
216
|
+
sizeA5: 'A5',
|
217
|
+
sizeA4: 'A4',
|
218
|
+
sizeA3: 'A3',
|
219
|
+
sizeLetter: 'Letter',
|
220
|
+
sizeLegal: 'Legal',
|
221
|
+
orientation: 'Paper orientation',
|
222
|
+
orientationLandscape: 'Landscape',
|
223
|
+
orientationPortrait: 'Portrait',
|
224
|
+
rows: 'Print rows',
|
225
|
+
rowsAll: 'All',
|
226
|
+
rowsSelected: 'Selected',
|
227
|
+
layout: 'Page layout',
|
228
|
+
layoutSplitGroups: 'New page for each [COLUMN]'
|
211
229
|
}
|
212
230
|
},
|
213
231
|
rowHeight: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Localization.js","sources":["../../../../../../../src/components/Provider/Localization.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Locale } from '../../types';\nimport { CalendarTexts } from '../Calendar/Calendar';\nimport { ComboboxTexts } from '../Combobox/Combobox';\nimport { DialogTexts } from '../Dialog/Dialog';\nimport { PaginationTexts } from '../Pagination/Pagination';\nimport { ListboxTexts } from '../Listbox/Listbox';\nimport { ToastsTexts } from '../Toast/Toast';\nimport { DatepickerTexts } from '../Datepicker/Datepicker';\nimport { HeaderTexts } from '../Header/Header';\nimport { HangerTexts } from '../Hanger/Hanger';\nimport { SelectTexts } from '../Select/Select';\nimport { TourTexts } from '../Tour/Tour';\nimport { TableTexts } from '../Table/Table';\nimport { Table3Texts } from '../Table3/types';\nimport { SearchInputTexts } from '../SearchInput/SearchInput';\nimport { Select2Texts } from '../Select2/Select2';\nimport { BannerTexts } from '../Banner/Banner';\nimport { DrawerTexts } from '../Drawer/Drawer';\n\nexport type LocalizationTexts = {\n /** Localized texts and aria-labels for [Banner](component:banner) component */\n banner: BannerTexts;\n /** Localized texts and aria-labels for [Calendar](component:calendar) component */\n calendar: CalendarTexts;\n /** Localized texts and aria-labels for [Combobox](component:combobox) component */\n combobox: ComboboxTexts;\n /** Localized texts and aria-labels for [DatePicker](component:datepicker) component */\n datepicker: DatepickerTexts;\n /** Localized texts and aria-labels for [Dialog](component:dialog) component */\n dialog: DialogTexts;\n /** Localized texts and aria-labels for [Hanger](component:hanger) component */\n hanger: HangerTexts;\n /** Localized texts and aria-labels for [Header](component:header) component */\n header: HeaderTexts;\n /** Localized texts and aria-labels for [Listbox](component:listbox) component */\n listbox: ListboxTexts;\n /** Localized texts and aria-labels for [Pagination](component:pagination) component */\n pagination: PaginationTexts;\n /** Localized texts and aria-labels for [Table](component:table) component */\n table: TableTexts;\n /** Localized texts and aria-labels for [Table3](component:table3) component */\n table3: Table3Texts;\n /** Localized texts and aria-labels for [SearchInput](component:searchinput) component */\n searchInput: SearchInputTexts;\n /** Localized texts and aria-labels for [Select](component:select) component */\n select: SelectTexts;\n /** Localized texts and aria-labels for [Select2](component:select2) component */\n select2: Select2Texts;\n /** Localized texts and aria-labels for [Toast](component:toast) component */\n toasts: ToastsTexts;\n /** Localized texts and aria-labels for [Tour](component:tour) component */\n tour: TourTexts;\n /** Localized texts and aria-labels for [Drawer](component:drawer) component */\n drawer: DrawerTexts;\n};\n\nexport type Localization = {\n /**\n * Provide the language code used in application.\n * Default value is `en-GB`\n */\n locale: Locale;\n /** Provide the texts and aria-labels for components used within the provider */\n texts: LocalizationTexts;\n /** Provide the formatting */\n formatting: {\n /** Default value is `dd.mm.yy` */\n date: string;\n };\n};\n\nexport const defaultLocalisationTexts = {\n banner: {\n close: 'Close',\n },\n calendar: {\n months: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n actions: {\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n previousYear: 'Previous year',\n nextYear: 'Next year',\n today: 'Today',\n },\n },\n combobox: {\n tooltip: 'Search in list',\n },\n datepicker: {\n calendar: 'Calendar',\n clear: 'Clear',\n expand: 'Show calendar',\n shortcuts: 'Shortcuts',\n },\n dialog: {\n close: 'Close',\n drag: 'Drag',\n },\n hanger: {\n close: 'Close',\n },\n header: {\n addAgreement: 'Add agreement',\n logout: 'Log off',\n more: 'More',\n new: 'New',\n search: 'Search for agreement...',\n },\n listbox: {\n loading: 'Loading results...',\n empty: 'No results found',\n allOption: 'All',\n },\n pagination: {\n label: 'Pagination',\n pageSize: 'Items per page',\n showingXofYofTotal: 'Showing [X] - [Y] of [total]',\n actions: {\n firstPage: 'Goto first page',\n firstPageWithShortcut: 'Goto first page (Home)',\n previousPage: 'Goto previous page',\n previousPageWithShortcut: 'Goto previous page (Page Up)',\n nextPage: 'Goto next page',\n nextPageWithShortcut: 'Goto next page (Page Down)',\n lastPage: 'Goto last page',\n lastPageWithShortcut: 'Goto last page (End)',\n pageX: 'Goto page [X]',\n },\n },\n table: {\n actions: 'Other actions',\n edit: 'Edit (e)',\n copy: 'Copy (c)',\n del: 'Delete (del)',\n newSubRow: 'New row (shift + n)',\n loading: 'Loading...',\n },\n table3: {\n columns: {\n actions: {\n tooltip: 'Row actions',\n },\n drag: {\n tooltip: 'Drag row',\n },\n expansion: {\n collapse: 'Collapse row',\n collapseAll: 'Collapse all rows',\n expand: 'Expand row',\n expandAll: 'Expand all rows',\n },\n menu: {\n freezeFirstColumn: 'Freeze the first column',\n freezeUptoColumn: `Freeze first [TOTAL] columns`,\n freezeColumns: (count = 1) => (count === 1 ? 'Freeze the first column' : `Freeze first ${count} columns`),\n gotoRow: 'Go to',\n hideColumn: 'Hide column',\n unfreezeColumns: 'Unfreeze all columns',\n sorting: 'Sorting',\n sortingOrder: {\n ascending: 'Ascending order',\n descending: 'Descending order',\n unsorted: 'No sorting',\n },\n },\n resize: {\n tooltip: 'Resize column',\n },\n select: {\n deselect: 'Deselect row',\n deselectAll: 'Deselect all rows',\n select: 'Select row',\n selectAll: 'Select all rows',\n },\n },\n columnSettings: {\n search: 'Search column...',\n tooltip: 'Column settings',\n button: 'Column settings',\n noResults: 'No results',\n },\n editing: {\n actions: {\n tooltip: 'Row actions',\n save: 'Save',\n clear: 'Clear changes',\n exit: 'Exit edit mode',\n },\n buttons: {\n edit: {\n tooltip: 'Edit table',\n },\n },\n rowIndicator: {\n rowWillMove: 'Row will move due to sorting',\n rowWillBeHidden: 'Row will hide due to filtering',\n rowWillMoveReasonSearch:\n 'Due to a search filter applied to this table, this row will be hidden as soon as you select another row',\n rowWillMoveReasonFilter:\n \"Due to a filter applied to the column '[COLUMN]', this row will be hidden as soon as you select another row\",\n rowWillMoveReasonSorting:\n \"Due to sorting applied to the column '[COLUMN]', this row will move position as soon as you select another row\",\n },\n saving: {\n progress: 'Saving...',\n complete: 'Saved',\n },\n clearChangesConfirmationDialog: {\n title: 'Discard changes',\n description:\n 'Are you sure you want to discard changes on row ‘[ROW_IDENTIFIER] [ROW_IDENTIFIER_VALUE]’. Your changes will be lost.',\n cancel: 'Continue edititng',\n confirm: 'Discard',\n },\n },\n filters: {\n button: 'Filters',\n buttons: {\n addFilter: 'Add new filter',\n clearFilters: 'Clear all filters',\n },\n comparators: {\n contains: 'Contains',\n doesNotContain: 'Does not contain',\n isEqualTo: 'Is',\n isNotEqualTo: 'Is not',\n isGreaterThan: 'Is greater than',\n isLessThan: 'Is less than',\n isBetween: 'Is between',\n isOneOf: 'Is one of',\n isNoneOf: 'Is none of',\n isAllOf: 'Is all of',\n isEmpty: 'Is empty',\n isNotEmpty: 'Is not empty',\n isBefore: 'Is before',\n isAfter: 'Is after',\n isOnOrBefore: 'Is on or before',\n isOnOrAfter: 'Is on or after',\n isLessThanOrEqualTo: 'Is less than or equal to',\n isGreaterThanOrEqualTo: 'Is greater than or equal to',\n hasAnyOf: 'Has any of',\n hasAllOf: 'Has all of',\n hasNoneOf: 'Has none of',\n },\n conditions: {\n and: 'And',\n where: 'Where',\n },\n emptyFilter: {\n condition: 'Condition',\n value: 'Value',\n },\n hiddenColumn: 'Hidden column',\n tooltip: 'Apply filters',\n total: 'Viewing [CURRENT] of [TOTAL]',\n },\n fontSize: {\n tooltip: 'Font size',\n sizes: {\n small: 'Small',\n medium: 'Medium',\n large: 'Large',\n },\n },\n footer: {\n summary: {\n count: 'of',\n records: 'Records:',\n selected: 'Records selected:',\n },\n },\n print: {\n error: 'An error occurred while creating a print preview',\n loading: 'Creating a print preview',\n tooltip: 'Print',\n warningDialog: {\n title: 'Extra loading time',\n description:\n 'Please note that printing a large amount of data may result in a slightly longer waiting time due to data loading.',\n checkboxVisibilityLabel: \"Don't show again\",\n cancelButtonText: 'Cancel',\n printButtonText: 'Print',\n },\n },\n rowHeight: {\n tooltip: 'Row height',\n sizes: {\n short: 'Short',\n medium: 'Medium',\n tall: 'Tall',\n extraTall: 'Extra tall',\n },\n },\n search: {\n excludeUnmatchedResults: 'Show only search results',\n placeholder: 'Search...',\n },\n shortcuts: {\n tooltip: 'View keyboard shortcuts',\n search: 'Search',\n filter: 'Filter',\n previousRow: 'Previous row',\n nextRow: 'Next row',\n editCell: 'Edit cell',\n previousColumn: 'Previous column',\n nextColumn: 'Next column',\n rowClick: 'Activate current row',\n selectRow: 'Select current row',\n selectAllRows: 'Select all rows',\n expandRow: 'Expand current row',\n collapseRow: 'Collapse current row',\n },\n otherOptions: {\n tooltip: 'Table settings',\n },\n validation: {\n index: 'Index',\n alert: {\n unsavedEntries: (count = 1) => (count === 1 ? 'unsaved entry:' : 'unsaved entries:'),\n incompleteAndHavntBeenSaved: (count = 1) =>\n count === 1 ? 'is incomplete and haven’t been saved.' : 'are incomplete and haven’t been saved.',\n },\n resetFiltersDialog: {\n title: 'Row is hidden',\n description: 'The row is hidden due to filtering.',\n cancel: 'Cancel',\n confirm: 'Remove filters',\n },\n },\n },\n searchInput: {\n button: 'Search',\n findNext: 'Next',\n findPrevious: 'Previous',\n placeholder: 'Search...',\n clear: 'Clear',\n },\n select: {\n allOptionsSelected: 'All',\n },\n select2: {\n allSelect: 'Select all',\n allDeselect: 'Deselect all',\n cancel: 'Cancel',\n chooseColor: 'Pick a color',\n create: 'Create',\n delete: 'Delete',\n save: 'Save',\n search: 'Search...',\n searchOrCreate: 'Search or create...',\n },\n toasts: {\n dismiss: 'Dismiss',\n },\n tour: {\n back: 'Back',\n close: 'Close',\n skip: 'Close and complete',\n last: 'Done',\n next: 'Next',\n open: 'Open',\n },\n drawer: {\n close: 'Close',\n },\n};\n\nexport const defaultLocalizationContext: Localization = {\n locale: 'en-GB',\n texts: defaultLocalisationTexts,\n formatting: {\n date: 'dd.mm.yy',\n },\n};\n\nexport const LocalizationContext = React.createContext<Localization>(defaultLocalizationContext);\nexport interface LocalizationProviderProps {\n children: React.ReactNode;\n localization?: Localization;\n}\nexport const LocalizationProvider: React.FC<LocalizationProviderProps> = ({ localization, children }) => {\n return (\n <LocalizationContext.Provider value={localization ?? defaultLocalizationContext}>{children}</LocalizationContext.Provider>\n );\n};\n\nexport const useLocalization = () => React.useContext(LocalizationContext);\n"],"names":["defaultLocalisationTexts","banner","close","calendar","months","weekdaysShort","weekdays","actions","previousMonth","nextMonth","previousYear","nextYear","today","combobox","tooltip","datepicker","clear","expand","shortcuts","dialog","drag","hanger","header","addAgreement","logout","more","new","search","listbox","loading","empty","allOption","pagination","label","pageSize","showingXofYofTotal","firstPage","firstPageWithShortcut","previousPage","previousPageWithShortcut","nextPage","nextPageWithShortcut","lastPage","lastPageWithShortcut","pageX","table","edit","copy","del","newSubRow","table3","columns","expansion","collapse","collapseAll","expandAll","menu","freezeFirstColumn","freezeUptoColumn","freezeColumns","count","gotoRow","hideColumn","unfreezeColumns","sorting","sortingOrder","ascending","descending","unsorted","resize","select","deselect","deselectAll","selectAll","columnSettings","button","noResults","editing","save","exit","buttons","rowIndicator","rowWillMove","rowWillBeHidden","rowWillMoveReasonSearch","rowWillMoveReasonFilter","rowWillMoveReasonSorting","saving","progress","complete","clearChangesConfirmationDialog","title","description","cancel","confirm","filters","addFilter","clearFilters","comparators","contains","doesNotContain","isEqualTo","isNotEqualTo","isGreaterThan","isLessThan","isBetween","isOneOf","isNoneOf","isAllOf","isEmpty","isNotEmpty","isBefore","isAfter","isOnOrBefore","isOnOrAfter","isLessThanOrEqualTo","isGreaterThanOrEqualTo","hasAnyOf","hasAllOf","hasNoneOf","conditions","and","where","emptyFilter","condition","value","hiddenColumn","total","fontSize","sizes","small","medium","large","footer","summary","records","selected","print","error","warningDialog","checkboxVisibilityLabel","cancelButtonText","printButtonText","rowHeight","short","tall","extraTall","excludeUnmatchedResults","placeholder","filter","previousRow","nextRow","editCell","previousColumn","nextColumn","rowClick","selectRow","selectAllRows","expandRow","collapseRow","otherOptions","validation","index","alert","unsavedEntries","incompleteAndHavntBeenSaved","resetFiltersDialog","searchInput","findNext","findPrevious","allOptionsSelected","select2","allSelect","allDeselect","chooseColor","create","delete","searchOrCreate","toasts","dismiss","tour","back","skip","last","next","open","drawer","defaultLocalizationContext","locale","texts","formatting","date","LocalizationContext","React","LocalizationProvider","localization","children","Provider","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GACZ;EACDC,IAAI,EAAE;IACFC,IAAI,EAAE,MAAM;IACZnL,KAAK,EAAE,OAAO;IACdoL,IAAI,EAAE,oBAAoB;IAC1BC,IAAI,EAAE,MAAM;IACZC,IAAI,EAAE,MAAM;IACZC,IAAI,EAAE;GACT;EACDC,MAAM,EAAE;IACJxL,KAAK,EAAE;;;MAIFyL,0BAA0B,GAAiB;EACpDC,MAAM,EAAE,OAAO;EACfC,KAAK,EAAE7L,wBAAwB;EAC/B8L,UAAU,EAAE;IACRC,IAAI,EAAE;;;MAIDC,mBAAmB,gBAAGC,aAAmB,CAAeN,0BAA0B;MAKlFO,oBAAoB,GAAwCA,CAAC;EAAEC,YAAY;EAAEC;CAAU;EAChG,oBACIH,cAACD,mBAAmB,CAACK,QAAQ;IAACxE,KAAK,EAAEsE,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAIR;KAA6BS,QAAQ,CAAgC;AAElI;MAEaE,eAAe,GAAGA,MAAML,UAAgB,CAACD,mBAAmB;;;;"}
|
1
|
+
{"version":3,"file":"Localization.js","sources":["../../../../../../../src/components/Provider/Localization.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Locale } from '../../types';\nimport { CalendarTexts } from '../Calendar/Calendar';\nimport { ComboboxTexts } from '../Combobox/Combobox';\nimport { DialogTexts } from '../Dialog/Dialog';\nimport { PaginationTexts } from '../Pagination/Pagination';\nimport { ListboxTexts } from '../Listbox/Listbox';\nimport { ToastsTexts } from '../Toast/Toast';\nimport { DatepickerTexts } from '../Datepicker/Datepicker';\nimport { HeaderTexts } from '../Header/Header';\nimport { HangerTexts } from '../Hanger/Hanger';\nimport { SelectTexts } from '../Select/Select';\nimport { TourTexts } from '../Tour/Tour';\nimport { TableTexts } from '../Table/Table';\nimport { Table3Texts } from '../Table3/types';\nimport { SearchInputTexts } from '../SearchInput/SearchInput';\nimport { Select2Texts } from '../Select2/Select2';\nimport { BannerTexts } from '../Banner/Banner';\nimport { DrawerTexts } from '../Drawer/Drawer';\n\nexport type LocalizationTexts = {\n /** Localized texts and aria-labels for [Banner](component:banner) component */\n banner: BannerTexts;\n /** Localized texts and aria-labels for [Calendar](component:calendar) component */\n calendar: CalendarTexts;\n /** Localized texts and aria-labels for [Combobox](component:combobox) component */\n combobox: ComboboxTexts;\n /** Localized texts and aria-labels for [DatePicker](component:datepicker) component */\n datepicker: DatepickerTexts;\n /** Localized texts and aria-labels for [Dialog](component:dialog) component */\n dialog: DialogTexts;\n /** Localized texts and aria-labels for [Hanger](component:hanger) component */\n hanger: HangerTexts;\n /** Localized texts and aria-labels for [Header](component:header) component */\n header: HeaderTexts;\n /** Localized texts and aria-labels for [Listbox](component:listbox) component */\n listbox: ListboxTexts;\n /** Localized texts and aria-labels for [Pagination](component:pagination) component */\n pagination: PaginationTexts;\n /** Localized texts and aria-labels for [Table](component:table) component */\n table: TableTexts;\n /** Localized texts and aria-labels for [Table3](component:table3) component */\n table3: Table3Texts;\n /** Localized texts and aria-labels for [SearchInput](component:searchinput) component */\n searchInput: SearchInputTexts;\n /** Localized texts and aria-labels for [Select](component:select) component */\n select: SelectTexts;\n /** Localized texts and aria-labels for [Select2](component:select2) component */\n select2: Select2Texts;\n /** Localized texts and aria-labels for [Toast](component:toast) component */\n toasts: ToastsTexts;\n /** Localized texts and aria-labels for [Tour](component:tour) component */\n tour: TourTexts;\n /** Localized texts and aria-labels for [Drawer](component:drawer) component */\n drawer: DrawerTexts;\n};\n\nexport type Localization = {\n /**\n * Provide the language code used in application.\n * Default value is `en-GB`\n */\n locale: Locale;\n /** Provide the texts and aria-labels for components used within the provider */\n texts: LocalizationTexts;\n /** Provide the formatting */\n formatting: {\n /** Default value is `dd.mm.yy` */\n date: string;\n };\n};\n\nexport const defaultLocalisationTexts = {\n banner: {\n close: 'Close',\n },\n calendar: {\n months: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n actions: {\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n previousYear: 'Previous year',\n nextYear: 'Next year',\n today: 'Today',\n },\n },\n combobox: {\n tooltip: 'Search in list',\n },\n datepicker: {\n calendar: 'Calendar',\n clear: 'Clear',\n expand: 'Show calendar',\n shortcuts: 'Shortcuts',\n },\n dialog: {\n close: 'Close',\n drag: 'Drag',\n },\n hanger: {\n close: 'Close',\n },\n header: {\n addAgreement: 'Add agreement',\n logout: 'Log off',\n more: 'More',\n new: 'New',\n search: 'Search for agreement...',\n },\n listbox: {\n loading: 'Loading results...',\n empty: 'No results found',\n allOption: 'All',\n },\n pagination: {\n label: 'Pagination',\n pageSize: 'Items per page',\n showingXofYofTotal: 'Showing [X] - [Y] of [total]',\n actions: {\n firstPage: 'Goto first page',\n firstPageWithShortcut: 'Goto first page (Home)',\n previousPage: 'Goto previous page',\n previousPageWithShortcut: 'Goto previous page (Page Up)',\n nextPage: 'Goto next page',\n nextPageWithShortcut: 'Goto next page (Page Down)',\n lastPage: 'Goto last page',\n lastPageWithShortcut: 'Goto last page (End)',\n pageX: 'Goto page [X]',\n },\n },\n table: {\n actions: 'Other actions',\n edit: 'Edit (e)',\n copy: 'Copy (c)',\n del: 'Delete (del)',\n newSubRow: 'New row (shift + n)',\n loading: 'Loading...',\n },\n table3: {\n columns: {\n actions: {\n tooltip: 'Row actions',\n },\n drag: {\n tooltip: 'Drag row',\n },\n expansion: {\n collapse: 'Collapse row',\n collapseAll: 'Collapse all rows',\n expand: 'Expand row',\n expandAll: 'Expand all rows',\n },\n menu: {\n freezeFirstColumn: 'Freeze the first column',\n freezeUptoColumn: `Freeze first [TOTAL] columns`,\n freezeColumns: (count = 1) => (count === 1 ? 'Freeze the first column' : `Freeze first ${count} columns`),\n gotoRow: 'Go to',\n hideColumn: 'Hide column',\n unfreezeColumns: 'Unfreeze all columns',\n sorting: 'Sorting',\n sortingOrder: {\n ascending: 'Ascending order',\n descending: 'Descending order',\n unsorted: 'No sorting',\n },\n },\n resize: {\n tooltip: 'Resize column',\n },\n select: {\n deselect: 'Deselect row',\n deselectAll: 'Deselect all rows',\n select: 'Select row',\n selectAll: 'Select all rows',\n },\n },\n columnSettings: {\n search: 'Search column...',\n tooltip: 'Column settings',\n button: 'Column settings',\n noResults: 'No results',\n },\n editing: {\n actions: {\n tooltip: 'Row actions',\n save: 'Save',\n clear: 'Clear changes',\n exit: 'Exit edit mode',\n },\n buttons: {\n edit: {\n tooltip: 'Edit table',\n },\n },\n rowIndicator: {\n rowWillMove: 'Row will move due to sorting',\n rowWillBeHidden: 'Row will hide due to filtering',\n rowWillMoveReasonSearch:\n 'Due to a search filter applied to this table, this row will be hidden as soon as you select another row',\n rowWillMoveReasonFilter:\n \"Due to a filter applied to the column '[COLUMN]', this row will be hidden as soon as you select another row\",\n rowWillMoveReasonSorting:\n \"Due to sorting applied to the column '[COLUMN]', this row will move position as soon as you select another row\",\n },\n saving: {\n progress: 'Saving...',\n complete: 'Saved',\n },\n clearChangesConfirmationDialog: {\n title: 'Discard changes',\n description:\n 'Are you sure you want to discard changes on row ‘[ROW_IDENTIFIER] [ROW_IDENTIFIER_VALUE]’. Your changes will be lost.',\n cancel: 'Continue edititng',\n confirm: 'Discard',\n },\n },\n filters: {\n button: 'Filters',\n buttons: {\n addFilter: 'Add new filter',\n clearFilters: 'Clear all filters',\n },\n comparators: {\n contains: 'Contains',\n doesNotContain: 'Does not contain',\n isEqualTo: 'Is',\n isNotEqualTo: 'Is not',\n isGreaterThan: 'Is greater than',\n isLessThan: 'Is less than',\n isBetween: 'Is between',\n isOneOf: 'Is one of',\n isNoneOf: 'Is none of',\n isAllOf: 'Is all of',\n isEmpty: 'Is empty',\n isNotEmpty: 'Is not empty',\n isBefore: 'Is before',\n isAfter: 'Is after',\n isOnOrBefore: 'Is on or before',\n isOnOrAfter: 'Is on or after',\n isLessThanOrEqualTo: 'Is less than or equal to',\n isGreaterThanOrEqualTo: 'Is greater than or equal to',\n hasAnyOf: 'Has any of',\n hasAllOf: 'Has all of',\n hasNoneOf: 'Has none of',\n },\n conditions: {\n and: 'And',\n where: 'Where',\n },\n emptyFilter: {\n condition: 'Condition',\n value: 'Value',\n },\n hiddenColumn: 'Hidden column',\n hiddenGroupedColumn: 'Hidden grouped column',\n tooltip: 'Apply filters',\n total: 'Viewing [CURRENT] of [TOTAL]',\n },\n fontSize: {\n tooltip: 'Font size',\n sizes: {\n small: 'Small',\n medium: 'Medium',\n large: 'Large',\n },\n },\n footer: {\n summary: {\n count: 'of',\n records: 'Records:',\n selected: 'Records selected:',\n },\n },\n print: {\n error: 'An error occurred while creating a print preview',\n loading: 'Creating a print preview',\n tooltip: 'Print',\n warningDialog: {\n title: 'Extra loading time',\n description:\n 'Please note that printing a large amount of data may result in a slightly longer waiting time due to data loading.',\n checkboxVisibilityLabel: \"Don't show again\",\n cancelButtonText: 'Cancel',\n printButtonText: 'Print',\n },\n settingsDialog: {\n title: 'Print settings',\n size: 'Paper size',\n sizeA5: 'A5',\n sizeA4: 'A4',\n sizeA3: 'A3',\n sizeLetter: 'Letter',\n sizeLegal: 'Legal',\n orientation: 'Paper orientation',\n orientationLandscape: 'Landscape',\n orientationPortrait: 'Portrait',\n rows: 'Print rows',\n rowsAll: 'All',\n rowsSelected: 'Selected',\n layout: 'Page layout',\n layoutSplitGroups: 'New page for each [COLUMN]',\n },\n },\n rowHeight: {\n tooltip: 'Row height',\n sizes: {\n short: 'Short',\n medium: 'Medium',\n tall: 'Tall',\n extraTall: 'Extra tall',\n },\n },\n search: {\n excludeUnmatchedResults: 'Show only search results',\n placeholder: 'Search...',\n },\n shortcuts: {\n tooltip: 'View keyboard shortcuts',\n search: 'Search',\n filter: 'Filter',\n previousRow: 'Previous row',\n nextRow: 'Next row',\n editCell: 'Edit cell',\n previousColumn: 'Previous column',\n nextColumn: 'Next column',\n rowClick: 'Activate current row',\n selectRow: 'Select current row',\n selectAllRows: 'Select all rows',\n expandRow: 'Expand current row',\n collapseRow: 'Collapse current row',\n },\n otherOptions: {\n tooltip: 'Table settings',\n },\n validation: {\n index: 'Index',\n alert: {\n unsavedEntries: (count = 1) => (count === 1 ? 'unsaved entry:' : 'unsaved entries:'),\n incompleteAndHavntBeenSaved: (count = 1) =>\n count === 1 ? 'is incomplete and haven’t been saved.' : 'are incomplete and haven’t been saved.',\n },\n resetFiltersDialog: {\n title: 'Row is hidden',\n description: 'The row is hidden due to filtering.',\n cancel: 'Cancel',\n confirm: 'Remove filters',\n },\n },\n },\n searchInput: {\n button: 'Search',\n findNext: 'Next',\n findPrevious: 'Previous',\n placeholder: 'Search...',\n clear: 'Clear',\n },\n select: {\n allOptionsSelected: 'All',\n },\n select2: {\n allSelect: 'Select all',\n allDeselect: 'Deselect all',\n cancel: 'Cancel',\n chooseColor: 'Pick a color',\n create: 'Create',\n delete: 'Delete',\n save: 'Save',\n search: 'Search...',\n searchOrCreate: 'Search or create...',\n },\n toasts: {\n dismiss: 'Dismiss',\n },\n tour: {\n back: 'Back',\n close: 'Close',\n skip: 'Close and complete',\n last: 'Done',\n next: 'Next',\n open: 'Open',\n },\n drawer: {\n close: 'Close',\n },\n};\n\nexport const defaultLocalizationContext: Localization = {\n locale: 'en-GB',\n texts: defaultLocalisationTexts,\n formatting: {\n date: 'dd.mm.yy',\n },\n};\n\nexport const LocalizationContext = React.createContext<Localization>(defaultLocalizationContext);\nexport interface LocalizationProviderProps {\n children: React.ReactNode;\n localization?: Localization;\n}\nexport const LocalizationProvider: React.FC<LocalizationProviderProps> = ({ localization, children }) => {\n return (\n <LocalizationContext.Provider value={localization ?? defaultLocalizationContext}>{children}</LocalizationContext.Provider>\n );\n};\n\nexport const useLocalization = () => React.useContext(LocalizationContext);\n"],"names":["defaultLocalisationTexts","banner","close","calendar","months","weekdaysShort","weekdays","actions","previousMonth","nextMonth","previousYear","nextYear","today","combobox","tooltip","datepicker","clear","expand","shortcuts","dialog","drag","hanger","header","addAgreement","logout","more","new","search","listbox","loading","empty","allOption","pagination","label","pageSize","showingXofYofTotal","firstPage","firstPageWithShortcut","previousPage","previousPageWithShortcut","nextPage","nextPageWithShortcut","lastPage","lastPageWithShortcut","pageX","table","edit","copy","del","newSubRow","table3","columns","expansion","collapse","collapseAll","expandAll","menu","freezeFirstColumn","freezeUptoColumn","freezeColumns","count","gotoRow","hideColumn","unfreezeColumns","sorting","sortingOrder","ascending","descending","unsorted","resize","select","deselect","deselectAll","selectAll","columnSettings","button","noResults","editing","save","exit","buttons","rowIndicator","rowWillMove","rowWillBeHidden","rowWillMoveReasonSearch","rowWillMoveReasonFilter","rowWillMoveReasonSorting","saving","progress","complete","clearChangesConfirmationDialog","title","description","cancel","confirm","filters","addFilter","clearFilters","comparators","contains","doesNotContain","isEqualTo","isNotEqualTo","isGreaterThan","isLessThan","isBetween","isOneOf","isNoneOf","isAllOf","isEmpty","isNotEmpty","isBefore","isAfter","isOnOrBefore","isOnOrAfter","isLessThanOrEqualTo","isGreaterThanOrEqualTo","hasAnyOf","hasAllOf","hasNoneOf","conditions","and","where","emptyFilter","condition","value","hiddenColumn","hiddenGroupedColumn","total","fontSize","sizes","small","medium","large","footer","summary","records","selected","print","error","warningDialog","checkboxVisibilityLabel","cancelButtonText","printButtonText","settingsDialog","size","sizeA5","sizeA4","sizeA3","sizeLetter","sizeLegal","orientation","orientationLandscape","orientationPortrait","rows","rowsAll","rowsSelected","layout","layoutSplitGroups","rowHeight","short","tall","extraTall","excludeUnmatchedResults","placeholder","filter","previousRow","nextRow","editCell","previousColumn","nextColumn","rowClick","selectRow","selectAllRows","expandRow","collapseRow","otherOptions","validation","index","alert","unsavedEntries","incompleteAndHavntBeenSaved","resetFiltersDialog","searchInput","findNext","findPrevious","allOptionsSelected","select2","allSelect","allDeselect","chooseColor","create","delete","searchOrCreate","toasts","dismiss","tour","back","skip","last","next","open","drawer","defaultLocalizationContext","locale","texts","formatting","date","LocalizationContext","React","LocalizationProvider","localization","children","Provider","useLocalization"],"mappings":";;MAwEaA,wBAAwB,GAAG;EACpCC,MAAM,EAAE;IACJC,KAAK,EAAE;GACV;EACDC,QAAQ,EAAE;IACNC,MAAM,EAAE,CACJ,SAAS,EACT,UAAU,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,UAAU,EACV,UAAU,CACb;IACDC,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;IAChEC,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC;IACxFC,OAAO,EAAE;MACLC,aAAa,EAAE,gBAAgB;MAC/BC,SAAS,EAAE,YAAY;MACvBC,YAAY,EAAE,eAAe;MAC7BC,QAAQ,EAAE,WAAW;MACrBC,KAAK,EAAE;;GAEd;EACDC,QAAQ,EAAE;IACNC,OAAO,EAAE;GACZ;EACDC,UAAU,EAAE;IACRZ,QAAQ,EAAE,UAAU;IACpBa,KAAK,EAAE,OAAO;IACdC,MAAM,EAAE,eAAe;IACvBC,SAAS,EAAE;GACd;EACDC,MAAM,EAAE;IACJjB,KAAK,EAAE,OAAO;IACdkB,IAAI,EAAE;GACT;EACDC,MAAM,EAAE;IACJnB,KAAK,EAAE;GACV;EACDoB,MAAM,EAAE;IACJC,YAAY,EAAE,eAAe;IAC7BC,MAAM,EAAE,SAAS;IACjBC,IAAI,EAAE,MAAM;IACZC,GAAG,EAAE,KAAK;IACVC,MAAM,EAAE;GACX;EACDC,OAAO,EAAE;IACLC,OAAO,EAAE,oBAAoB;IAC7BC,KAAK,EAAE,kBAAkB;IACzBC,SAAS,EAAE;GACd;EACDC,UAAU,EAAE;IACRC,KAAK,EAAE,YAAY;IACnBC,QAA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WAAW,EAAE;IACT5G,MAAM,EAAE,QAAQ;IAChB6G,QAAQ,EAAE,MAAM;IAChBC,YAAY,EAAE,UAAU;IACxBrB,WAAW,EAAE,WAAW;IACxBpJ,KAAK,EAAE;GACV;EACDsD,MAAM,EAAE;IACJoH,kBAAkB,EAAE;GACvB;EACDC,OAAO,EAAE;IACLC,SAAS,EAAE,YAAY;IACvBC,WAAW,EAAE,cAAc;IAC3BhG,MAAM,EAAE,QAAQ;IAChBiG,WAAW,EAAE,cAAc;IAC3BC,MAAM,EAAE,QAAQ;IAChBC,MAAM,EAAE,QAAQ;IAChBlH,IAAI,EAAE,MAAM;IACZnD,MAAM,EAAE,WAAW;IACnBsK,cAAc,EAAE;GACnB;EACDC,MAAM,EAAE;IACJC,OAAO,EAAE;GACZ;EACDC,IAAI,EAAE;IACFC,IAAI,EAAE,MAAM;IACZnM,KAAK,EAAE,OAAO;IACdoM,IAAI,EAAE,oBAAoB;IAC1BC,IAAI,EAAE,MAAM;IACZC,IAAI,EAAE,MAAM;IACZC,IAAI,EAAE;GACT;EACDC,MAAM,EAAE;IACJxM,KAAK,EAAE;;;MAIFyM,0BAA0B,GAAiB;EACpDC,MAAM,EAAE,OAAO;EACfC,KAAK,EAAE7M,wBAAwB;EAC/B8M,UAAU,EAAE;IACRC,IAAI,EAAE;;;MAIDC,mBAAmB,gBAAGC,aAAmB,CAAeN,0BAA0B;MAKlFO,oBAAoB,GAAwCA,CAAC;EAAEC,YAAY;EAAEC;CAAU;EAChG,oBACIH,cAACD,mBAAmB,CAACK,QAAQ;IAACxF,KAAK,EAAEsF,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAIR;KAA6BS,QAAQ,CAAgC;AAElI;MAEaE,eAAe,GAAGA,MAAML,UAAgB,CAACD,mBAAmB;;;;"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { useMemo, Children, forwardRef, createElement, createContext, useContext, isValidElement } from 'react';
|
2
|
-
import cn from '
|
2
|
+
import cn from 'clsx';
|
3
3
|
import { Root, Item, Indicator } from '@radix-ui/react-radio-group';
|
4
4
|
import { getRadioClassnames } from './util.js';
|
5
5
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","sources":["../../../../../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from '
|
1
|
+
{"version":3,"file":"RadioGroup.js","sources":["../../../../../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport { Orientation } from '../../types';\nimport { getRadioClassnames } from './util';\n\nexport type RadioGroupItemValue = string | number | boolean | null;\n\nexport const getRadioGroupItemValueAsString = (value: RadioGroupItemValue): string => String(value ?? '');\n\nexport const findByValue = (values: RadioGroupItemValue[], valueAsString: string): RadioGroupItemValue =>\n values.find(value => getRadioGroupItemValueAsString(value) === valueAsString) as RadioGroupItemValue;\n\nconst RadioGroupContext = React.createContext({ disabled: false, invalid: false });\n\nexport type RadioGroupItemProps<T = HTMLButtonElement> = Omit<\n React.ButtonHTMLAttributes<T>,\n 'children' | 'onSelect' | 'value'\n> & {\n /** Label for the radio group item */\n children: React.ReactNode;\n /* Whether the radio group item is disabled */\n disabled?: boolean;\n /** Value of the radio button */\n value: RadioGroupItemValue;\n};\n\nconst RadioGroupItem = React.forwardRef(function RadioGroupItem(props: RadioGroupItemProps, ref: React.Ref<HTMLButtonElement>) {\n const context = React.useContext(RadioGroupContext);\n const { children, value, ...otherProps } = props;\n\n const isDisabled = context.disabled || props.disabled;\n\n const className = cn('self-start', getRadioClassnames(isDisabled, context.invalid));\n const labelClassName = cn(\n 'flex items-center gap-2',\n {\n 'cursor-pointer': !isDisabled,\n 'cursor-not-allowed text-grey-300': isDisabled,\n },\n props.className\n );\n\n return (\n <label className={labelClassName}>\n <RadioGroupPrimitive.Item\n {...otherProps}\n className={className}\n disabled={isDisabled}\n ref={ref}\n value={getRadioGroupItemValueAsString(value)}>\n <RadioGroupPrimitive.Indicator className=\"h-2 w-2 rounded-full bg-white\" />\n </RadioGroupPrimitive.Item>\n {children}\n </label>\n );\n});\n\ntype ReactGroupBaseChild = React.ReactElement<RadioGroupItemProps> | boolean | null;\n\ntype RadioGroupBaseProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'defaultValue' | 'onChange' | 'value'> & {\n children: ReactGroupBaseChild[];\n /* Whether the radio group is disabled */\n disabled?: boolean;\n /* Whether the radio group is in an invalid state */\n invalid?: boolean;\n /** The name of the radio group, used when submitting an HTML form */\n name?: string;\n /**\n * Orientation of the radio group\n * @defaultValue vertical\n */\n orientation?: Orientation;\n /* Whether the radio group requires user input */\n required?: boolean;\n};\n\ninterface UncontrolledRadioGroupProps extends RadioGroupBaseProps {\n /* The default value (uncontrolled) */\n defaultValue?: RadioGroupItemValue;\n onChange?: never;\n value?: never;\n}\n\ninterface ControlledRadioGroupProps extends RadioGroupBaseProps {\n defaultValue?: never;\n /** Handler called when the value changes */\n onChange: (value: RadioGroupItemValue) => void;\n /** The current value (controlled) */\n value?: RadioGroupItemValue;\n}\n\nexport type RadioGroupProps = UncontrolledRadioGroupProps | ControlledRadioGroupProps;\n\nexport type ForwardedRadioGroupWithStatics = React.ForwardRefExoticComponent<\n RadioGroupProps & React.RefAttributes<HTMLDivElement>\n> & {\n /** Item component rendered in a `RadioGroup` component */\n Item: React.ForwardRefExoticComponent<RadioGroupItemProps>;\n};\n\nexport const useRadioGroup = (props: RadioGroupProps) => {\n const { children, defaultValue, disabled, invalid, onChange, orientation = 'vertical', value, ...otherProps } = props;\n\n const values = React.useMemo<RadioGroupItemValue[]>(() => {\n const radioGroupItemValues: RadioGroupItemValue[] = [];\n\n React.Children.forEach(children, child => {\n if (React.isValidElement(child)) {\n radioGroupItemValues.push(child.props.value);\n }\n });\n\n return radioGroupItemValues;\n }, [children]);\n\n const context = React.useMemo(() => ({ disabled: disabled ?? false, invalid: invalid ?? false }), [disabled, invalid]);\n\n let valueProps;\n\n if (onChange !== undefined) {\n const handleChange = (value: string): void => onChange(findByValue(values, value));\n\n valueProps = {\n onValueChange: handleChange,\n value: value !== undefined ? getRadioGroupItemValueAsString(value) : undefined,\n };\n } else {\n valueProps = {\n defaultValue: defaultValue !== undefined ? getRadioGroupItemValueAsString(defaultValue) : undefined,\n };\n }\n\n return {\n context,\n props: {\n ...otherProps,\n ...valueProps,\n children,\n disabled,\n orientation,\n },\n };\n};\n\nexport const RadioGroup = React.forwardRef(function RadioGroup(props: RadioGroupProps, ref: React.Ref<HTMLDivElement>) {\n const { context, props: otherProps } = useRadioGroup(props);\n const className = cn(\n 'flex items-start gap-y-2',\n {\n 'flex-wrap gap-x-4 ': otherProps.orientation === 'horizontal',\n 'flex-col': otherProps.orientation === 'vertical',\n },\n otherProps.className\n );\n\n return (\n <RadioGroupContext.Provider value={context}>\n <RadioGroupPrimitive.Root {...otherProps} className={className} data-taco=\"radio-group\" ref={ref} />\n </RadioGroupContext.Provider>\n );\n}) as ForwardedRadioGroupWithStatics;\nRadioGroup.Item = RadioGroupItem;\n"],"names":["getRadioGroupItemValueAsString","value","String","findByValue","values","valueAsString","find","RadioGroupContext","React","disabled","invalid","RadioGroupItem","props","ref","context","children","otherProps","isDisabled","className","cn","getRadioClassnames","labelClassName","RadioGroupPrimitive","useRadioGroup","defaultValue","onChange","orientation","radioGroupItemValues","forEach","child","push","valueProps","undefined","handleChange","onValueChange","RadioGroup","Provider","Item"],"mappings":";;;;;MAQaA,8BAA8B,GAAIC,KAA0B,IAAaC,MAAM,CAACD,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE;MAE3FE,WAAW,GAAGA,CAACC,MAA6B,EAAEC,aAAqB,KAC5ED,MAAM,CAACE,IAAI,CAACL,KAAK,IAAID,8BAA8B,CAACC,KAAK,CAAC,KAAKI,aAAa;AAEhF,MAAME,iBAAiB,gBAAGC,aAAmB,CAAC;EAAEC,QAAQ,EAAE,KAAK;EAAEC,OAAO,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E,SAAS,CACvB;EAED,oBACIV,cAACD,iBAAiB,CAAC6B,QAAQ;IAACnC,KAAK,EAAEa;kBAC/BN,cAACc,IAAwB,oBAAKN,UAAU;IAAEE,SAAS,EAAEA,SAAS;iBAAY,aAAa;IAACL,GAAG,EAAEA;KAAO,CAC3E;AAErC,CAAC;AACDsB,UAAU,CAACE,IAAI,GAAG1B,cAAc;;;;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import cn from '
|
1
|
+
import cn from 'clsx';
|
2
2
|
|
3
3
|
const getRadioClassnames = (disabled = false, invalid = false) => {
|
4
4
|
return cn('flex flex-shrink-0 items-center justify-center h-4 w-4 mt-[0.2rem] rounded-full bg-white border-2 focus-visible:yt-focus disabled:cursor-not-allowed hover:border-4', invalid ? {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"util.js","sources":["../../../../../../../src/components/RadioGroup/util.ts"],"sourcesContent":["import cn from '
|
1
|
+
{"version":3,"file":"util.js","sources":["../../../../../../../src/components/RadioGroup/util.ts"],"sourcesContent":["import cn from 'clsx';\n\nexport const getRadioClassnames = (disabled = false, invalid = false) => {\n return cn(\n 'flex flex-shrink-0 items-center justify-center h-4 w-4 mt-[0.2rem] rounded-full bg-white border-2 focus-visible:yt-focus disabled:cursor-not-allowed hover:border-4',\n invalid\n ? {\n 'border-red-500 hover:border-red-700 aria-checked:bg-red-500 aria-checked:border-red-500 hover:aria-checked:border-red-700':\n !disabled,\n 'border-red-500/50 aria-checked:bg-red-500/50 aria-checked:border-red-500/50': disabled,\n }\n : {\n 'border-grey-500 hover:border-grey-700 aria-checked:bg-blue-500 aria-checked:border-blue-500 hover:aria-checked:border-blue-700':\n !disabled,\n 'border-grey-500/50 aria-checked:bg-blue-500/50 aria-checked:border-blue-500/50': disabled,\n }\n );\n};\n"],"names":["getRadioClassnames","disabled","invalid","cn"],"mappings":";;MAEaA,kBAAkB,GAAGA,CAACC,QAAQ,GAAG,KAAK,EAAEC,OAAO,GAAG,KAAK;EAChE,OAAOC,EAAE,CACL,qKAAqK,EACrKD,OAAO,GACD;IACI,2HAA2H,EACvH,CAACD,QAAQ;IACb,6EAA6E,EAAEA;GAClF,GACD;IACI,gIAAgI,EAC5H,CAACA,QAAQ;IACb,gFAAgF,EAAEA;GACrF,CACV;AACL;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ScrollArea.js","sources":["../../../../../../../src/components/ScrollArea/ScrollArea.tsx"],"sourcesContent":["import React from 'react';\nimport cn from '
|
1
|
+
{"version":3,"file":"ScrollArea.js","sources":["../../../../../../../src/components/ScrollArea/ScrollArea.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';\n\nconst Bar = props => {\n const className = cn(`flex select-none touch-none transition-colors hover:bg-grey`, {\n 'w-[7px] hover:w-[14px] mr-[2px] hover:px-[2px] hover:mr-0': props.orientation === 'vertical',\n 'flex-col h-[7px] hover:h-[14px] mb-[2px] hover:py-[2px] hover:mb-0': props.orientation === 'horizontal',\n });\n return <ScrollAreaPrimitive.Scrollbar {...props} className={className} />;\n};\n\nconst Thumb = props => <ScrollAreaPrimitive.Thumb {...props} className=\"flex-[1] rounded bg-black opacity-50\" />;\n\nconst Corner = props => <ScrollAreaPrimitive.Corner {...props} classname=\"bg-grey-500\" />;\n\nexport type ScrollbarProps = Omit<ScrollAreaPrimitive.ScrollAreaProps, 'scrollHideDelay'>;\n\nexport const ScrollArea = (props: ScrollbarProps) => {\n const { children, ...otherProps } = props;\n\n return (\n <ScrollAreaPrimitive.Root {...otherProps} className={cn('overflow-hidden', props.className)}>\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full\">{children}</ScrollAreaPrimitive.Viewport>\n <Bar orientation=\"vertical\">\n <Thumb />\n </Bar>\n <Bar orientation=\"horizontal\">\n <Thumb />\n </Bar>\n <Corner />\n </ScrollAreaPrimitive.Root>\n );\n};\n"],"names":["Bar","props","className","cn","orientation","React","ScrollAreaPrimitive","Thumb","Corner","classname","ScrollArea","children","otherProps"],"mappings":";;;;AAIA,MAAMA,GAAG,GAAGC,KAAK;EACb,MAAMC,SAAS,GAAGC,EAAE,8DAA8D,EAAE;IAChF,2DAA2D,EAAEF,KAAK,CAACG,WAAW,KAAK,UAAU;IAC7F,oEAAoE,EAAEH,KAAK,CAACG,WAAW,KAAK;GAC/F,CAAC;EACF,oBAAOC,6BAACC,SAA6B,oBAAKL,KAAK;IAAEC,SAAS,EAAEA;KAAa;AAC7E,CAAC;AAED,MAAMK,KAAK,GAAGN,KAAK,iBAAII,6BAACC,OAAyB,oBAAKL,KAAK;EAAEC,SAAS,EAAC;GAAyC;AAEhH,MAAMM,MAAM,GAAGP,KAAK,iBAAII,6BAACC,QAA0B,oBAAKL,KAAK;EAAEQ,SAAS,EAAC;GAAgB;MAI5EC,UAAU,GAAIT,KAAqB;EAC5C,MAAM;IAAEU,QAAQ;IAAE,GAAGC;GAAY,GAAGX,KAAK;EAEzC,oBACII,6BAACC,IAAwB,oBAAKM,UAAU;IAAEV,SAAS,EAAEC,EAAE,CAAC,iBAAiB,EAAEF,KAAK,CAACC,SAAS;mBACtFG,6BAACC,QAA4B;IAACJ,SAAS,EAAC;KAAiBS,QAAQ,CAAgC,eACjGN,6BAACL,GAAG;IAACI,WAAW,EAAC;kBACbC,6BAACE,KAAK,OAAG,CACP,eACNF,6BAACL,GAAG;IAACI,WAAW,EAAC;kBACbC,6BAACE,KAAK,OAAG,CACP,eACNF,6BAACG,MAAM,OAAG,CACa;AAEnC;;;;"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React__default from 'react';
|
2
|
-
import cn from '
|
2
|
+
import cn from 'clsx';
|
3
3
|
import { Icon } from '../Icon/Icon.js';
|
4
4
|
import { useMergedRef } from '../../hooks/useMergedRef.js';
|
5
5
|
import { useGlobalKeyDown } from '../../hooks/useGlobalKeyDown.js';
|
@@ -16,7 +16,7 @@ const SearchInput2 = /*#__PURE__*/React__default.forwardRef(function SearchInput
|
|
16
16
|
findTotal,
|
17
17
|
loading = false,
|
18
18
|
onChange: handleChange,
|
19
|
-
onClear
|
19
|
+
onClear,
|
20
20
|
onClickFindNext: handleClickFindNext,
|
21
21
|
onClickFindPrevious: handleClickFindPrevious,
|
22
22
|
settingsContent,
|
@@ -53,7 +53,7 @@ const SearchInput2 = /*#__PURE__*/React__default.forwardRef(function SearchInput
|
|
53
53
|
return (_internalRef$current2 = internalRef.current) === null || _internalRef$current2 === void 0 ? void 0 : _internalRef$current2.blur();
|
54
54
|
});
|
55
55
|
handleChange('');
|
56
|
-
|
56
|
+
onClear === null || onClear === void 0 ? void 0 : onClear();
|
57
57
|
};
|
58
58
|
const handleFocus = event => {
|
59
59
|
var _attributes$onFocus;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SearchInput2.js","sources":["../../../../../../../src/components/SearchInput2/SearchInput2.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { useGlobalKeyDown } from '../../hooks/useGlobalKeyDown';\nimport { useLocalization } from '../Provider/Localization';\nimport { IconButton } from '../IconButton/IconButton';\nimport { Input } from '../Input/Input';\nimport { Shortcut } from '../Shortcut/Shortcut';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { KeyDownHandlerOptions } from '../../utils/keyboard';\nimport { Spinner } from '../Spinner/Spinner';\nimport { Icon } from '../Icon/Icon';\n\ninterface CommonSearchInput2Props\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'defaultValue' | 'onChange' | 'value'> {\n loading?: boolean;\n onChange: (value: string) => void;\n onClear?: () => void;\n settingsContent?: JSX.Element;\n shortcut?: string | KeyDownHandlerOptions;\n value?: string;\n}\n\ninterface BasicSearchInput2Props extends CommonSearchInput2Props {\n findCurrent?: never;\n findTotal?: never;\n onClickFindNext?: never;\n onClickFindPrevious?: never;\n}\n\ninterface ComplexSearchInput2Props extends CommonSearchInput2Props {\n findCurrent: number | null;\n findTotal: number | null;\n onClickFindNext: () => void;\n onClickFindPrevious: () => void;\n}\n\nexport type SearchInput2Props = BasicSearchInput2Props | ComplexSearchInput2Props;\n\nexport const SearchInput2 = React.forwardRef(function SearchInput2(props: SearchInput2Props, ref: React.Ref<HTMLInputElement>) {\n const {\n findCurrent,\n findTotal,\n loading = false,\n onChange: handleChange,\n onClear: handleClearCallback,\n onClickFindNext: handleClickFindNext,\n onClickFindPrevious: handleClickFindPrevious,\n settingsContent,\n shortcut,\n value,\n ...attributes\n } = props;\n const internalRef = useMergedRef<HTMLInputElement>(ref);\n const containerRef = React.useRef<HTMLDivElement>(null);\n const [focused, setFocused] = React.useState(false);\n const { texts } = useLocalization();\n const isActive = value?.length;\n const hasFind = handleClickFindNext && handleClickFindPrevious && findCurrent !== undefined && findTotal !== undefined;\n\n useGlobalKeyDown(shortcut, (event: KeyboardEvent) => {\n if (document.activeElement !== internalRef.current) {\n event.preventDefault();\n internalRef.current?.focus();\n }\n });\n\n const handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n if (\n containerRef.current &&\n (containerRef.current === event.relatedTarget || containerRef.current?.contains(event.relatedTarget))\n ) {\n return;\n }\n\n setFocused(false);\n attributes.onBlur?.(event);\n };\n\n const handleClear = () => {\n requestAnimationFrame(() => internalRef.current?.blur());\n handleChange('');\n handleClearCallback?.();\n };\n\n const handleFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n setFocused(true);\n attributes.onFocus?.(event);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n props.onKeyDown?.(event);\n\n if (event.isDefaultPrevented()) {\n return;\n }\n if (event.key === 'Enter') {\n event.preventDefault();\n\n if (hasFind && isActive) {\n if (event.shiftKey) {\n handleClickFindPrevious?.();\n } else {\n handleClickFindNext?.();\n }\n }\n\n return;\n }\n\n if (event.key === 'Escape') {\n handleClear();\n return;\n }\n };\n\n let postfix;\n\n if (!attributes.disabled && !attributes.readOnly && (value || focused)) {\n if (value) {\n postfix = (\n <IconButton\n aria-label={texts.searchInput.clear}\n className=\"scale-75 !bg-transparent hover:!bg-black/[0.08] [&>svg]:scale-125\"\n icon=\"close\"\n onMouseDown={handleClear}\n tabIndex={-1}\n tooltip={\n focused ? (\n <>\n {texts.searchInput.clear} <Shortcut keys=\"Escape\" />\n </>\n ) : (\n texts.searchInput.clear\n )\n }\n />\n );\n }\n\n if (hasFind && isActive) {\n postfix = (\n <>\n <span className=\"text-grey-700 flex h-4 items-center border-r border-black/[0.25] pr-2\">\n {loading ? <Spinner className=\"h-4 w-4\" /> : `${findCurrent ?? 0}/${findTotal ?? 0}`}\n </span>\n {findCurrent ? (\n <>\n <IconButton\n aria-label={texts.searchInput.findPrevious}\n className=\"scale-75 !bg-transparent hover:!bg-black/[0.08] [&>svg]:scale-125\"\n icon=\"chevron-up\"\n onMouseDown={handleClickFindPrevious}\n tabIndex={-1}\n tooltip={\n focused ? (\n <>\n {texts.searchInput.findPrevious} <Shortcut keys={{ shift: true, key: 'Enter' }} />\n </>\n ) : (\n texts.searchInput.findPrevious\n )\n }\n />\n <IconButton\n aria-label={texts.searchInput.findNext}\n className=\"scale-75 !bg-transparent hover:!bg-black/[0.08] [&>svg]:scale-125\"\n icon=\"chevron-down\"\n onMouseDown={handleClickFindNext}\n tabIndex={-1}\n tooltip={\n focused ? (\n <>\n {texts.searchInput.findNext} <Shortcut keys=\"Enter\" />\n </>\n ) : (\n texts.searchInput.findNext\n )\n }\n />\n </>\n ) : null}\n {postfix}\n </>\n );\n }\n } else if (shortcut && !focused && !value) {\n postfix = <Shortcut keys={shortcut} onClickCapture={() => internalRef.current?.focus()} />;\n }\n\n const className = cn(\n '!pl-7 group-focus-within:!w-72 group-focus-within:yt-focus',\n hasFind\n ? {\n '!w-48': !value,\n '!w-72': value,\n }\n : '!w-48',\n {\n '!wcag-blue-100': isActive,\n },\n props.className\n );\n\n const icon = (\n <Icon\n aria-label={texts.searchInput.button}\n className=\"-ml-0.5 scale-95\"\n name=\"search\"\n onClickCapture={() => internalRef.current?.focus()}\n />\n );\n\n const input = (\n <Input\n {...attributes}\n aria-label={attributes['aria-label'] ?? texts.searchInput.placeholder}\n className={className}\n data-taco=\"search-input2\"\n onBlur={handleBlur}\n onChange={event => handleChange(event.target.value)}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n placeholder={attributes.placeholder ?? texts.searchInput.placeholder}\n prefix={icon}\n postfix={postfix}\n ref={internalRef}\n value={value ?? ''}\n />\n );\n\n if (settingsContent) {\n const settingsClassname = cn(\n 'border-grey-300 absolute left-0 right-0 -mt-0.5 hidden top-full group-focus-within:flex focus-within:flex flex-col gap-y-4 rounded-b border border-t-0 bg-white p-3 shadow !pt-[calc(theme(spacing.3)_+_theme(spacing[0.5]))]'\n );\n\n return (\n <div\n className={cn('group relative', { 'z-10 [&_[data-taco=input-container]]:z-10': focused })}\n ref={containerRef}\n // create a new stacking context so our internal z-indexes don't effect external components\n // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n style={{ opacity: 0.999 }}>\n {input}\n <div\n // We need to trigger blur when settings got blured as well, because settings is a part of SearchInput2 component\n onBlur={handleBlur}\n className={settingsClassname}\n onClickCapture={() => internalRef.current?.focus()}\n // tab index is important, it lets the element show as a relatedTarget on event handlers\n tabIndex={-1}>\n {settingsContent}\n </div>\n </div>\n );\n }\n\n return input;\n});\n"],"names":["SearchInput2","React","forwardRef","props","ref","findCurrent","findTotal","loading","onChange","handleChange","onClear","handleClearCallback","onClickFindNext","handleClickFindNext","onClickFindPrevious","handleClickFindPrevious","settingsContent","shortcut","value","attributes","internalRef","useMergedRef","containerRef","useRef","focused","setFocused","useState","texts","useLocalization","isActive","length","hasFind","undefined","useGlobalKeyDown","event","document","activeElement","current","_internalRef$current","preventDefault","focus","handleBlur","relatedTarget","_containerRef$current","contains","_attributes$onBlur","onBlur","call","handleClear","requestAnimationFrame","_internalRef$current2","blur","handleFocus","_attributes$onFocus","onFocus","handleKeyDown","_props$onKeyDown","onKeyDown","isDefaultPrevented","key","shiftKey","postfix","disabled","readOnly","IconButton","searchInput","clear","className","icon","onMouseDown","tabIndex","tooltip","Shortcut","keys","Spinner","findPrevious","shift","findNext","onClickCapture","_internalRef$current3","cn","Icon","button","name","_internalRef$current4","input","Input","_attributes$ariaLabe","placeholder","target","_attributes$placehold","prefix","settingsClassname","style","opacity","_internalRef$current5"],"mappings":";;;;;;;;;;;MAsCaA,YAAY,gBAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,YAAYA,CAACG,KAAwB,EAAEC,GAAgC;;EACzH,MAAM;IACFC,WAAW;IACXC,SAAS;IACTC,OAAO,GAAG,KAAK;IACfC,QAAQ,EAAEC,YAAY;IACtBC,OAAO,EAAEC,mBAAmB;IAC5BC,eAAe,EAAEC,mBAAmB;IACpCC,mBAAmB,EAAEC,uBAAuB;IAC5CC,eAAe;IACfC,QAAQ;IACRC,KAAK;IACL,GAAGC;GACN,GAAGhB,KAAK;EACT,MAAMiB,WAAW,GAAGC,YAAY,CAAmBjB,GAAG,CAAC;EACvD,MAAMkB,YAAY,GAAGrB,cAAK,CAACsB,MAAM,CAAiB,IAAI,CAAC;EACvD,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGxB,cAAK,CAACyB,QAAQ,CAAC,KAAK,CAAC;EACnD,MAAM;IAAEC;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMC,QAAQ,GAAGX,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEY,MAAM;EAC9B,MAAMC,OAAO,GAAGlB,mBAAmB,IAAIE,uBAAuB,IAAIV,WAAW,KAAK2B,SAAS,IAAI1B,SAAS,KAAK0B,SAAS;EAEtHC,gBAAgB,CAAChB,QAAQ,EAAGiB,KAAoB;IAC5C,IAAIC,QAAQ,CAACC,aAAa,KAAKhB,WAAW,CAACiB,OAAO,EAAE;MAAA,IAAAC,oBAAA;MAChDJ,KAAK,CAACK,cAAc,EAAE;MACtB,CAAAD,oBAAA,GAAAlB,WAAW,CAACiB,OAA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AiB,qBAAA;QAAA,QAAAA,qBAAA,GAAM3E,WAAW,CAACiB,OAAO,cAAA0D,qBAAA,uBAAnBA,qBAAA,CAAqBvD,KAAK,EAAE;;;MAElD8B,QAAQ,EAAE,CAAC;OACVtD,eAAe,CACd,CACJ;;EAId,OAAOqE,KAAK;AAChB,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"SearchInput2.js","sources":["../../../../../../../src/components/SearchInput2/SearchInput2.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport { useGlobalKeyDown } from '../../hooks/useGlobalKeyDown';\nimport { useLocalization } from '../Provider/Localization';\nimport { IconButton } from '../IconButton/IconButton';\nimport { Input } from '../Input/Input';\nimport { Shortcut } from '../Shortcut/Shortcut';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { KeyDownHandlerOptions } from '../../utils/keyboard';\nimport { Spinner } from '../Spinner/Spinner';\nimport { Icon } from '../Icon/Icon';\n\ninterface CommonSearchInput2Props\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'defaultValue' | 'onChange' | 'value'> {\n loading?: boolean;\n onChange: (value: string) => void;\n onClear?: () => void;\n settingsContent?: JSX.Element;\n shortcut?: string | KeyDownHandlerOptions;\n value?: string;\n}\n\ninterface BasicSearchInput2Props extends CommonSearchInput2Props {\n findCurrent?: never;\n findTotal?: never;\n onClickFindNext?: never;\n onClickFindPrevious?: never;\n}\n\ninterface ComplexSearchInput2Props extends CommonSearchInput2Props {\n findCurrent: number | null;\n findTotal: number | null;\n onClickFindNext: () => void;\n onClickFindPrevious: () => void;\n}\n\nexport type SearchInput2Props = BasicSearchInput2Props | ComplexSearchInput2Props;\n\nexport const SearchInput2 = React.forwardRef(function SearchInput2(props: SearchInput2Props, ref: React.Ref<HTMLInputElement>) {\n const {\n findCurrent,\n findTotal,\n loading = false,\n onChange: handleChange,\n onClear,\n onClickFindNext: handleClickFindNext,\n onClickFindPrevious: handleClickFindPrevious,\n settingsContent,\n shortcut,\n value,\n ...attributes\n } = props;\n const internalRef = useMergedRef<HTMLInputElement>(ref);\n const containerRef = React.useRef<HTMLDivElement>(null);\n const [focused, setFocused] = React.useState(false);\n const { texts } = useLocalization();\n const isActive = value?.length;\n const hasFind = handleClickFindNext && handleClickFindPrevious && findCurrent !== undefined && findTotal !== undefined;\n\n useGlobalKeyDown(shortcut, (event: KeyboardEvent) => {\n if (document.activeElement !== internalRef.current) {\n event.preventDefault();\n internalRef.current?.focus();\n }\n });\n\n const handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n if (\n containerRef.current &&\n (containerRef.current === event.relatedTarget || containerRef.current?.contains(event.relatedTarget))\n ) {\n return;\n }\n\n setFocused(false);\n attributes.onBlur?.(event);\n };\n\n const handleClear = () => {\n requestAnimationFrame(() => internalRef.current?.blur());\n handleChange('');\n onClear?.();\n };\n\n const handleFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n setFocused(true);\n attributes.onFocus?.(event);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n props.onKeyDown?.(event);\n\n if (event.isDefaultPrevented()) {\n return;\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n\n if (hasFind && isActive) {\n if (event.shiftKey) {\n handleClickFindPrevious?.();\n } else {\n handleClickFindNext?.();\n }\n }\n\n return;\n }\n\n if (event.key === 'Escape') {\n handleClear();\n return;\n }\n };\n\n let postfix;\n\n if (!attributes.disabled && !attributes.readOnly && (value || focused)) {\n if (value) {\n postfix = (\n <IconButton\n aria-label={texts.searchInput.clear}\n className=\"scale-75 !bg-transparent hover:!bg-black/[0.08] [&>svg]:scale-125\"\n icon=\"close\"\n onMouseDown={handleClear}\n tabIndex={-1}\n tooltip={\n focused ? (\n <>\n {texts.searchInput.clear} <Shortcut keys=\"Escape\" />\n </>\n ) : (\n texts.searchInput.clear\n )\n }\n />\n );\n }\n\n if (hasFind && isActive) {\n postfix = (\n <>\n <span className=\"text-grey-700 flex h-4 items-center border-r border-black/[0.25] pr-2\">\n {loading ? <Spinner className=\"h-4 w-4\" /> : `${findCurrent ?? 0}/${findTotal ?? 0}`}\n </span>\n {findCurrent ? (\n <>\n <IconButton\n aria-label={texts.searchInput.findPrevious}\n className=\"scale-75 !bg-transparent hover:!bg-black/[0.08] [&>svg]:scale-125\"\n icon=\"chevron-up\"\n onMouseDown={handleClickFindPrevious}\n tabIndex={-1}\n tooltip={\n focused ? (\n <>\n {texts.searchInput.findPrevious} <Shortcut keys={{ shift: true, key: 'Enter' }} />\n </>\n ) : (\n texts.searchInput.findPrevious\n )\n }\n />\n <IconButton\n aria-label={texts.searchInput.findNext}\n className=\"scale-75 !bg-transparent hover:!bg-black/[0.08] [&>svg]:scale-125\"\n icon=\"chevron-down\"\n onMouseDown={handleClickFindNext}\n tabIndex={-1}\n tooltip={\n focused ? (\n <>\n {texts.searchInput.findNext} <Shortcut keys=\"Enter\" />\n </>\n ) : (\n texts.searchInput.findNext\n )\n }\n />\n </>\n ) : null}\n {postfix}\n </>\n );\n }\n } else if (shortcut && !focused && !value) {\n postfix = <Shortcut keys={shortcut} onClickCapture={() => internalRef.current?.focus()} />;\n }\n\n const className = cn(\n '!pl-7 group-focus-within:!w-72 group-focus-within:yt-focus',\n hasFind\n ? {\n '!w-48': !value,\n '!w-72': value,\n }\n : '!w-48',\n {\n '!wcag-blue-100': isActive,\n },\n props.className\n );\n\n const icon = (\n <Icon\n aria-label={texts.searchInput.button}\n className=\"-ml-0.5 scale-95\"\n name=\"search\"\n onClickCapture={() => internalRef.current?.focus()}\n />\n );\n\n const input = (\n <Input\n {...attributes}\n aria-label={attributes['aria-label'] ?? texts.searchInput.placeholder}\n className={className}\n data-taco=\"search-input2\"\n onBlur={handleBlur}\n onChange={event => handleChange(event.target.value)}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n placeholder={attributes.placeholder ?? texts.searchInput.placeholder}\n prefix={icon}\n postfix={postfix}\n ref={internalRef}\n value={value ?? ''}\n />\n );\n\n if (settingsContent) {\n const settingsClassname = cn(\n 'border-grey-300 absolute left-0 right-0 -mt-0.5 hidden top-full group-focus-within:flex focus-within:flex flex-col gap-y-4 rounded-b border border-t-0 bg-white p-3 shadow !pt-[calc(theme(spacing.3)_+_theme(spacing[0.5]))]'\n );\n\n return (\n <div\n className={cn('group relative', { 'z-10 [&_[data-taco=input-container]]:z-10': focused })}\n ref={containerRef}\n // create a new stacking context so our internal z-indexes don't effect external components\n // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n style={{ opacity: 0.999 }}>\n {input}\n <div\n // We need to trigger blur when settings got blured as well, because settings is a part of SearchInput2 component\n onBlur={handleBlur}\n className={settingsClassname}\n onClickCapture={() => internalRef.current?.focus()}\n // tab index is important, it lets the element show as a relatedTarget on event handlers\n tabIndex={-1}>\n {settingsContent}\n </div>\n </div>\n );\n }\n\n return input;\n});\n"],"names":["SearchInput2","React","forwardRef","props","ref","findCurrent","findTotal","loading","onChange","handleChange","onClear","onClickFindNext","handleClickFindNext","onClickFindPrevious","handleClickFindPrevious","settingsContent","shortcut","value","attributes","internalRef","useMergedRef","containerRef","useRef","focused","setFocused","useState","texts","useLocalization","isActive","length","hasFind","undefined","useGlobalKeyDown","event","document","activeElement","current","_internalRef$current","preventDefault","focus","handleBlur","relatedTarget","_containerRef$current","contains","_attributes$onBlur","onBlur","call","handleClear","requestAnimationFrame","_internalRef$current2","blur","handleFocus","_attributes$onFocus","onFocus","handleKeyDown","_props$onKeyDown","onKeyDown","isDefaultPrevented","key","shiftKey","postfix","disabled","readOnly","IconButton","searchInput","clear","className","icon","onMouseDown","tabIndex","tooltip","Shortcut","keys","Spinner","findPrevious","shift","findNext","onClickCapture","_internalRef$current3","cn","Icon","button","name","_internalRef$current4","input","Input","_attributes$ariaLabe","placeholder","target","_attributes$placehold","prefix","settingsClassname","style","opacity","_internalRef$current5"],"mappings":";;;;;;;;;;;MAsCaA,YAAY,gBAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,YA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AA,cAAAA,oBAAA,GAAI5D,KAAK,CAACsC,WAAW,CAACuB,WAAW;IACrErB,SAAS,EAAEA,SAAS;iBACV,eAAe;IACzBrB,MAAM,EAAEL,UAAU;IAClBhC,QAAQ,EAAEyB,KAAK,IAAIxB,YAAY,CAACwB,KAAK,CAACuD,MAAM,CAACvE,KAAK,CAAC;IACnDoC,OAAO,EAAEF,WAAW;IACpBK,SAAS,EAAEF,aAAa;IACxBiC,WAAW,GAAAE,qBAAA,GAAEvE,UAAU,CAACqE,WAAW,cAAAE,qBAAA,cAAAA,qBAAA,GAAI/D,KAAK,CAACsC,WAAW,CAACuB,WAAW;IACpEG,MAAM,EAAEvB,IAAI;IACZP,OAAO,EAAEA,OAAO;IAChBxD,GAAG,EAAEe,WAAW;IAChBF,KAAK,EAAEA,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI;KAEvB;EAED,IAAIF,eAAe,EAAE;IACjB,MAAM4E,iBAAiB,GAAGZ,EAAE,CACxB,+NAA+N,CAClO;IAED,oBACI9E;MACIiE,SAAS,EAAEa,EAAE,CAAC,gBAAgB,EAAE;QAAE,2CAA2C,EAAExD;OAAS,CAAC;MACzFnB,GAAG,EAAEiB,YAAY;;;MAGjBuE,KAAK,EAAE;QAAEC,OAAO,EAAE;;OACjBT,KAAK,eACNnF;;MAEI4C,MAAM,EAAEL,UAAU;MAClB0B,SAAS,EAAEyB,iBAAiB;MAC5Bd,cAAc,EAAEA;QAAA,IAAAiB,qBAAA;QAAA,QAAAA,qBAAA,GAAM3E,WAAW,CAACiB,OAAO,cAAA0D,qBAAA,uBAAnBA,qBAAA,CAAqBvD,KAAK,EAAE;;;MAElD8B,QAAQ,EAAE,CAAC;OACVtD,eAAe,CACd,CACJ;;EAId,OAAOqE,KAAK;AAChB,CAAC;;;;"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { forwardRef, createElement, useRef, useEffect, Fragment } from 'react';
|
2
|
-
import cn from '
|
2
|
+
import cn from 'clsx';
|
3
3
|
import { Icon } from '../Icon/Icon.js';
|
4
4
|
import { Badge } from '../Badge/Badge.js';
|
5
5
|
import { Root, Trigger, Portal, Content } from '@radix-ui/react-popover';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../../../../../src/components/Select/Select.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from '
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../../../../../src/components/Select/Select.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { Icon } from '../Icon/Icon';\nimport { Listbox, MultiListbox, ListboxProps } from '../Listbox/Listbox';\nimport { useBoundingClientRectListener } from '../../hooks/useBoundingClientRectListener';\nimport { useSelect } from './useSelect';\nimport { Combobox, ComboboxProps } from '../Combobox/Combobox';\nimport { Badge } from '../Badge/Badge';\nimport { getInputClasses } from '../Input/util';\n\nexport type SelectTexts = {\n /**\n * The text displayed when all options are selected when multiselect mode in on.\n */\n allOptionsSelected: string;\n};\n\nexport type BaseSelectProps = Omit<ListboxProps, 'dialog'> &\n Omit<ComboboxProps, 'inline'> & {\n /**\n * Allows to select multiple values.\n * All the selected values will be combined in a comma-seperated string as the value of the input.\n */\n multiselect?: boolean;\n };\n\nexport type SelectProps = BaseSelectProps & {\n /**\n * Creates an editable select.\n * Setting this will render a inline Combobox which will display the provided data on click/focus,\n * even if there is no value in the input.\n * After user starts typing, matching data will be displayed.\n */\n editable?: boolean;\n};\n\nconst BaseSelect = React.forwardRef(function BaseSelect(props: BaseSelectProps, ref: React.Ref<HTMLInputElement>) {\n const { autoFocus, className: externalClassName, highlighted, style, ...otherProps } = props;\n const { button, listbox, popover, input, text, more = 0 } = useSelect(otherProps, ref);\n const internalRef = React.useRef<HTMLButtonElement>(null);\n const selectDimensions = useBoundingClientRectListener(internalRef);\n const className = cn('inline-flex relative w-full', { 'yt-select--readonly': props.readOnly }, externalClassName);\n const inputClassname = cn(getInputClasses(props), 'h-8 text-left !pr-0', {\n 'border-blue-500': popover.open,\n });\n\n React.useEffect(() => {\n if (autoFocus && internalRef.current) {\n internalRef.current.focus();\n }\n }, []);\n\n const renderMultiSelection = (): React.ReactNode => {\n return (\n <>\n <span className=\"flex-grow truncate text-left\">{text}</span>\n {more > 0 && <Badge className=\"ml-2\">{`+${more}`}</Badge>}\n </>\n );\n };\n\n const commonListboxProps: ListboxProps = {\n ...listbox,\n className: 'w-auto',\n invalid: undefined,\n style: { minWidth: selectDimensions?.width },\n tabIndex: popover.open ? 0 : -1,\n };\n\n return (\n <span className={className} data-taco=\"select\" style={style}>\n <PopoverPrimitive.Root {...popover}>\n <PopoverPrimitive.Trigger {...button} className={inputClassname} ref={internalRef}>\n {props.multiselect ? renderMultiSelection() : <span className=\"flex-grow truncate text-left\">{text}</span>}\n <span className=\"flex h-8 w-8 items-center justify-center\">\n <Icon className=\"pointer-events-none\" name={popover.open ? 'chevron-up' : 'chevron-down'} />\n </span>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content align=\"start\" sideOffset={4}>\n {props.multiselect ? <MultiListbox {...commonListboxProps} /> : <Listbox {...commonListboxProps} />}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n <input {...input} className=\"hidden\" type=\"text\" />\n </PopoverPrimitive.Root>\n </span>\n );\n});\n\nexport const Select = React.forwardRef(function Select(props: SelectProps, ref: React.Ref<HTMLInputElement>) {\n const { editable, ...otherProps } = props;\n\n if (editable) {\n return <Combobox {...otherProps} dialog={undefined} inline ref={ref} />;\n }\n\n return <BaseSelect {...otherProps} ref={ref} />;\n});\n"],"names":["BaseSelect","React","props","ref","autoFocus","className","externalClassName","highlighted","style","otherProps","button","listbox","popover","input","text","more","useSelect","internalRef","selectDimensions","useBoundingClientRectListener","cn","readOnly","inputClassname","getInputClasses","open","current","focus","renderMultiSelection","Badge","commonListboxProps","invalid","undefined","minWidth","width","tabIndex","PopoverPrimitive","multiselect","Icon","name","align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