@payfit/unity-components 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/action-bar/ActionBar.d.ts +153 -0
- package/dist/esm/components/action-bar/ActionBar.js +173 -0
- package/dist/esm/components/action-bar/parts/ActionBarAction.d.ts +44 -0
- package/dist/esm/components/action-bar/parts/ActionBarAction.js +45 -0
- package/dist/esm/components/action-bar/parts/ActionBarRoot.d.ts +44 -0
- package/dist/esm/components/action-bar/parts/ActionBarRoot.js +46 -0
- package/dist/esm/components/actionable/Actionable.js +20 -21
- package/dist/esm/components/alert/Alert.d.ts +1 -1
- package/dist/esm/components/alert/Alert.js +1 -1
- package/dist/esm/components/alert/parts/AlertActions.d.ts +1 -1
- package/dist/esm/components/alert/parts/AlertActions.js +1 -1
- package/dist/esm/components/alert/parts/AlertContent.d.ts +1 -1
- package/dist/esm/components/alert/parts/AlertTitle.d.ts +1 -1
- package/dist/esm/components/anchor/Anchor.js +1 -1
- package/dist/esm/components/app-layout/AppLayout.js +6 -6
- package/dist/esm/components/app-menu/parts/AppMenuFooter.js +30 -30
- package/dist/esm/components/app-menu/parts/AppMenuNavContent.js +1 -1
- package/dist/esm/components/autocomplete/Autocomplete.d.ts +1 -1
- package/dist/esm/components/autocomplete/Autocomplete.js +14 -14
- package/dist/esm/components/autocomplete/parts/AutocompleteClearButton.js +5 -5
- package/dist/esm/components/autocomplete/parts/AutocompleteItem.d.ts +1 -1
- package/dist/esm/components/autocomplete/parts/AutocompleteItem.js +4 -4
- package/dist/esm/components/autocomplete/parts/AutocompleteItemGroup.d.ts +1 -1
- package/dist/esm/components/autocomplete/parts/AutocompleteItemGroup.js +12 -12
- package/dist/esm/components/autocomplete/parts/AutocompletePanel.d.ts +1 -1
- package/dist/esm/components/autocomplete/parts/AutocompletePanel.js +7 -7
- package/dist/esm/components/avatar/Avatar.d.ts +1 -1
- package/dist/esm/components/avatar/Avatar.js +15 -16
- package/dist/esm/components/avatar/Avatar.variants.js +1 -1
- package/dist/esm/components/avatar/parts/AvatarFallback.d.ts +1 -1
- package/dist/esm/components/avatar/parts/AvatarFallback.js +9 -10
- package/dist/esm/components/avatar/parts/AvatarImage.js +12 -12
- package/dist/esm/components/avatar/parts/AvatarPair.d.ts +1 -1
- package/dist/esm/components/avatar/parts/AvatarPair.js +4 -4
- package/dist/esm/components/badge/Badge.d.ts +1 -1
- package/dist/esm/components/badge/Badge.js +31 -35
- package/dist/esm/components/bottom-sheet/BottomSheet.d.ts +1 -1
- package/dist/esm/components/bottom-sheet/BottomSheet.js +14 -14
- package/dist/esm/components/bottom-sheet/parts/BottomSheetContent.d.ts +1 -1
- package/dist/esm/components/bottom-sheet/parts/BottomSheetContent.js +4 -4
- package/dist/esm/components/bottom-sheet/parts/BottomSheetDragIndicator.js +11 -11
- package/dist/esm/components/bottom-sheet/parts/BottomSheetFooter.d.ts +1 -1
- package/dist/esm/components/bottom-sheet/parts/BottomSheetFooter.js +4 -4
- package/dist/esm/components/bottom-sheet/parts/BottomSheetHeader.d.ts +4 -4
- package/dist/esm/components/bottom-sheet/parts/BottomSheetHeader.js +6 -6
- package/dist/esm/components/breadcrumbs/Breadcrumbs.context.d.ts +1 -1
- package/dist/esm/components/breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/esm/components/breadcrumbs/Breadcrumbs.variant.js +3 -3
- package/dist/esm/components/button/Button.js +33 -41
- package/dist/esm/components/button/Button.variants.d.ts +1 -1
- package/dist/esm/components/button/Button.variants.js +1 -1
- package/dist/esm/components/checkbox/Checkbox.js +53 -49
- package/dist/esm/components/checkbox/Checkbox.variants.js +1 -1
- package/dist/esm/components/checkbox/parts/CheckboxIndicator.js +1 -1
- package/dist/esm/components/checkbox-field/CheckboxField.js +39 -34
- package/dist/esm/components/checkbox-group/CheckboxGroup.d.ts +1 -1
- package/dist/esm/components/checkbox-group/CheckboxGroup.js +12 -12
- package/dist/esm/components/collapsible/Collapsible.js +22 -16
- package/dist/esm/components/collapsible/parts/CollapsibleContent.js +16 -7
- package/dist/esm/components/collapsible/parts/CollapsibleTitle.js +23 -23
- package/dist/esm/components/data-table/DataTable.d.ts +48 -17
- package/dist/esm/components/data-table/DataTable.js +104 -60
- package/dist/esm/components/data-table/mocks/employee-columns.d.ts +4 -0
- package/dist/esm/components/data-table/parts/DataTableBulkActions.d.ts +55 -0
- package/dist/esm/components/data-table/parts/DataTableBulkActions.js +65 -0
- package/dist/esm/components/data-table/parts/DataTableRoot.d.ts +37 -0
- package/dist/esm/components/data-table/parts/DataTableRoot.js +13 -0
- package/dist/esm/components/date-calendar/DateCalendar.js +8 -8
- package/dist/esm/components/date-picker/DatePicker.js +9 -9
- package/dist/esm/components/date-picker/parts/DateInput.js +7 -7
- package/dist/esm/components/date-picker-field/DatePickerField.js +12 -12
- package/dist/esm/components/definition-tooltip/DefinitionTooltip.js +4 -4
- package/dist/esm/components/dialog/Dialog.d.ts +1 -1
- package/dist/esm/components/dialog/Dialog.js +9 -9
- package/dist/esm/components/dialog/parts/DialogActions/DialogButton.d.ts +1 -1
- package/dist/esm/components/fieldset/Fieldset.d.ts +1 -1
- package/dist/esm/components/fieldset/Fieldset.js +4 -4
- package/dist/esm/components/flex/Flex.d.ts +1 -1
- package/dist/esm/components/flex/Flex.variants.js +189 -207
- package/dist/esm/components/flex/FlexItem.d.ts +1 -1
- package/dist/esm/components/form/Form.context.d.ts +1 -4
- package/dist/esm/components/form/Form.context.js +11 -13
- package/dist/esm/components/form/Form.d.ts +13 -11
- package/dist/esm/components/form/Form.js +45 -48
- package/dist/esm/components/form-field/FormField.context.d.ts +1 -6
- package/dist/esm/components/form-field/FormField.context.js +39 -47
- package/dist/esm/components/form-field/FormField.d.ts +0 -2
- package/dist/esm/components/form-field/FormField.js +37 -42
- package/dist/esm/components/form-field/parts/FormContextualLink.js +17 -17
- package/dist/esm/components/form-field/parts/FormControl.js +39 -35
- package/dist/esm/components/form-field/parts/FormFeedbackText.js +15 -17
- package/dist/esm/components/full-page-loader/FullPageLoader.js +7 -7
- package/dist/esm/components/funnel-layout/FunnelLayout.d.ts +2 -2
- package/dist/esm/components/funnel-layout/FunnelLayout.js +26 -26
- package/dist/esm/components/funnel-layout/parts/FunnelBody.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelBody.js +4 -4
- package/dist/esm/components/funnel-layout/parts/FunnelPage.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelPage.js +10 -10
- package/dist/esm/components/funnel-layout/parts/FunnelPageAction.d.ts +1 -1
- package/dist/esm/components/funnel-layout/parts/FunnelPageActions.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelPageActions.js +13 -13
- package/dist/esm/components/funnel-layout/parts/FunnelPageContent.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelPageContent.js +1 -1
- package/dist/esm/components/funnel-layout/parts/FunnelPageFooter.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelPageFooter.js +7 -7
- package/dist/esm/components/funnel-layout/parts/FunnelPageHeader.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelPageHeader.js +4 -4
- package/dist/esm/components/funnel-layout/parts/FunnelProgressBar.d.ts +1 -1
- package/dist/esm/components/funnel-layout/parts/FunnelProgressBar.js +4 -4
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.js +7 -7
- package/dist/esm/components/funnel-layout/parts/FunnelTopBar.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelTopBar.js +9 -9
- package/dist/esm/components/grid/Grid.d.ts +1 -1
- package/dist/esm/components/grid/Grid.variants.d.ts +1 -1
- package/dist/esm/components/grid/Grid.variants.js +3 -3
- package/dist/esm/components/grid/GridItem.d.ts +1 -1
- package/dist/esm/components/icon/Icon.d.ts +1 -1
- package/dist/esm/components/icon/Icon.js +1 -1
- package/dist/esm/components/icon-button/CircularIconButton.d.ts +1 -1
- package/dist/esm/components/icon-button/CircularIconButton.js +21 -20
- package/dist/esm/components/icon-button/IconButton.variants.d.ts +1 -1
- package/dist/esm/components/icon-button/IconButton.variants.js +2 -2
- package/dist/esm/components/input/Input.js +6 -6
- package/dist/esm/components/label/Label.js +13 -13
- package/dist/esm/components/link/Link.d.ts +11 -1
- package/dist/esm/components/link/Link.js +32 -30
- package/dist/esm/components/link/Link.variants.d.ts +141 -30
- package/dist/esm/components/link/Link.variants.js +44 -16
- package/dist/esm/components/menu/parts/MenuItem.js +8 -8
- package/dist/esm/components/multi-select/parts/MultiSelectButton.js +14 -14
- package/dist/esm/components/multi-select/parts/MultiSelectOptGroup.js +5 -5
- package/dist/esm/components/multi-select/parts/MultiSelectOption.js +3 -3
- package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +1 -1
- package/dist/esm/components/multi-select-field/MultiSelectField.js +6 -6
- package/dist/esm/components/nav/parts/NavGroup.js +28 -29
- package/dist/esm/components/nav/parts/NavItem.d.ts +1 -1
- package/dist/esm/components/nav/parts/NavItem.js +13 -14
- package/dist/esm/components/number-field/NumberField.js +14 -14
- package/dist/esm/components/number-input/NumberInput.d.ts +2 -2
- package/dist/esm/components/number-input/NumberInput.js +37 -37
- package/dist/esm/components/page/Page.d.ts +1 -1
- package/dist/esm/components/page/Page.js +5 -5
- package/dist/esm/components/page/parts/PageHeader.d.ts +1 -1
- package/dist/esm/components/page/parts/PageHeader.js +4 -4
- package/dist/esm/components/pagination/Pagination.d.ts +1 -1
- package/dist/esm/components/pagination/Pagination.js +16 -16
- package/dist/esm/components/pagination/parts/PaginationEllipsis.d.ts +1 -1
- package/dist/esm/components/pagination/parts/PaginationEllipsis.js +8 -8
- package/dist/esm/components/pagination/parts/PaginationJumpDialog.js +9 -9
- package/dist/esm/components/pagination/parts/PaginationLink.d.ts +1 -1
- package/dist/esm/components/pagination/parts/PaginationLink.js +6 -6
- package/dist/esm/components/payfit-brand/PayFitBrand.js +4 -4
- package/dist/esm/components/pill/Pill.d.ts +1 -1
- package/dist/esm/components/pill/Pill.js +1 -1
- package/dist/esm/components/popover/Popover.js +5 -5
- package/dist/esm/components/popover/parts/PopoverHeader.js +7 -7
- package/dist/esm/components/progress-bar/ProgressBar.js +11 -11
- package/dist/esm/components/radio-button-group/parts/RadioButton.d.ts +1 -1
- package/dist/esm/components/radio-button-group/parts/RadioButton.js +5 -5
- package/dist/esm/components/search/Search.d.ts +1 -1
- package/dist/esm/components/search/Search.js +14 -14
- package/dist/esm/components/segmented-button-group/parts/ToggleButton.js +10 -10
- package/dist/esm/components/select/Select.js +12 -12
- package/dist/esm/components/select/parts/SearchInput.js +7 -7
- package/dist/esm/components/select/parts/SelectButton.js +17 -14
- package/dist/esm/components/select/parts/SelectOption.js +4 -4
- package/dist/esm/components/select/parts/SelectOptionGroup.js +8 -8
- package/dist/esm/components/select/parts/SelectOptionHelper.js +1 -1
- package/dist/esm/components/select-field/SelectField.d.ts +1 -1
- package/dist/esm/components/select-field/SelectField.js +16 -16
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.d.ts +1 -1
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.js +8 -8
- package/dist/esm/components/selectable-button-group/parts/SelectableButton.js +10 -10
- package/dist/esm/components/selectable-card/internals/Content.js +5 -5
- package/dist/esm/components/selectable-card/internals/Description.js +1 -1
- package/dist/esm/components/selectable-card/internals/Illustration.js +3 -3
- package/dist/esm/components/selectable-card/internals/SelectedIndicator.js +4 -4
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/parts/SelectableCardCheckbox.d.ts +1 -1
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/RadioIndicator.js +3 -3
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/SelectableCardRadio.d.ts +1 -1
- package/dist/esm/components/selectable-card/selectableCard.variant.js +1 -1
- package/dist/esm/components/selectable-card-radio-group-field/SelectableCardRadioGroupField.js +22 -22
- package/dist/esm/components/side-panel/SidePanel.d.ts +1 -1
- package/dist/esm/components/side-panel/SidePanel.js +6 -6
- package/dist/esm/components/side-panel/parts/SidePanelContent.d.ts +1 -1
- package/dist/esm/components/side-panel/parts/SidePanelContent.js +9 -9
- package/dist/esm/components/side-panel/parts/SidePanelDragIndicator.js +11 -11
- package/dist/esm/components/side-panel/parts/SidePanelFooter.d.ts +1 -1
- package/dist/esm/components/side-panel/parts/SidePanelFooter.js +4 -4
- package/dist/esm/components/side-panel/parts/SidePanelHeader.d.ts +4 -4
- package/dist/esm/components/side-panel/parts/SidePanelHeader.js +6 -6
- package/dist/esm/components/skip-links/SkipLinks.d.ts +79 -0
- package/dist/esm/components/skip-links/SkipLinks.js +80 -0
- package/dist/esm/components/spinner/Spinner.js +5 -5
- package/dist/esm/components/table/Table.js +101 -100
- package/dist/esm/components/table/hooks/useTableKeyboardNavigation.d.ts +1 -19
- package/dist/esm/components/table/hooks/useTableKeyboardNavigation.js +147 -95
- package/dist/esm/components/table/parts/TableBody.js +1 -1
- package/dist/esm/components/table/parts/TableCell.d.ts +17 -1
- package/dist/esm/components/table/parts/TableCell.js +45 -41
- package/dist/esm/components/table/parts/TableColumnHeader.d.ts +2 -1
- package/dist/esm/components/table/parts/TableColumnHeader.js +63 -57
- package/dist/esm/components/table/parts/TableEmptyState.d.ts +1 -1
- package/dist/esm/components/table/parts/TableEmptyState.js +1 -1
- package/dist/esm/components/table/parts/TableHeader.d.ts +3 -3
- package/dist/esm/components/table/parts/TableHeader.js +28 -26
- package/dist/esm/components/table/parts/TablePagination.d.ts +1 -1
- package/dist/esm/components/table/parts/TablePagination.js +9 -9
- package/dist/esm/components/table/parts/TableRow.d.ts +1 -1
- package/dist/esm/components/table/parts/TableRow.js +36 -34
- package/dist/esm/components/tabs/Tabs.context.d.ts +1 -1
- package/dist/esm/components/tabs/Tabs.d.ts +1 -1
- package/dist/esm/components/tabs/Tabs.variant.js +1 -1
- package/dist/esm/components/tabs/parts/NavigationButton.js +12 -12
- package/dist/esm/components/tabs/parts/Tab.d.ts +3 -2
- package/dist/esm/components/tabs/parts/Tab.js +12 -12
- package/dist/esm/components/tabs/parts/TabPanel.d.ts +4 -2
- package/dist/esm/components/tabs/parts/TabPanel.js +7 -7
- package/dist/esm/components/task-menu/TaskMenu.d.ts +1 -1
- package/dist/esm/components/task-menu/TaskMenu.js +7 -7
- package/dist/esm/components/task-menu/parts/Content.js +6 -6
- package/dist/esm/components/task-menu/parts/Header.js +7 -7
- package/dist/esm/components/task-menu/parts/SubTask.js +6 -6
- package/dist/esm/components/task-menu/parts/Task.d.ts +1 -1
- package/dist/esm/components/task-menu/parts/Task.js +12 -12
- package/dist/esm/components/task-menu/parts/TaskGroup.js +7 -7
- package/dist/esm/components/task-menu/parts/task.variants.js +1 -1
- package/dist/esm/components/text/Text.d.ts +1 -1
- package/dist/esm/components/text/Text.variants.js +1 -1
- package/dist/esm/components/text-area/TextArea.js +6 -6
- package/dist/esm/components/text-field/TextField.js +5 -5
- package/dist/esm/components/toast/UnityToast.d.ts +1 -1
- package/dist/esm/components/toast/UnityToast.js +11 -11
- package/dist/esm/components/toggle-switch/ToggleSwitch.d.ts +1 -1
- package/dist/esm/components/toggle-switch/ToggleSwitch.js +4 -4
- package/dist/esm/components/toggle-switch-field/ToggleSwitchField.js +35 -31
- package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.d.ts +1 -1
- package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.js +5 -5
- package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.js +43 -38
- package/dist/esm/components/tooltip/Tooltip.d.ts +2 -0
- package/dist/esm/components/tooltip/Tooltip.js +27 -19
- package/dist/esm/hooks/use-form.js +7 -7
- package/dist/esm/index.d.ts +6 -1
- package/dist/esm/index.js +366 -352
- package/dist/esm/integrations/react-router/v5/UnityReactRouterV5Provider.js +28 -0
- package/dist/esm/integrations/react-router/v5/index.d.ts +1 -0
- package/dist/esm/integrations/react-router/v5.js +4 -0
- package/i18n/en-GB.json +6 -0
- package/i18n/es-ES.json +6 -0
- package/i18n/fr-FR.json +6 -0
- package/package.json +38 -35
- package/dist/esm/providers/router/integrations/UnityReactRouterV5Provider.js +0 -28
- /package/dist/esm/{providers/router/integrations → integrations/react-router/v5}/UnityReactRouterV5Provider.d.ts +0 -0
|
@@ -1,49 +1,54 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useFormContext as
|
|
4
|
-
import { Checkbox as
|
|
5
|
-
import { FormField as
|
|
1
|
+
import { jsxs as k, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as C, useMemo as y } from "react";
|
|
3
|
+
import { useFormContext as R } from "react-hook-form";
|
|
4
|
+
import { Checkbox as q } from "../checkbox/Checkbox.js";
|
|
5
|
+
import { FormField as P } from "../form-field/FormField.js";
|
|
6
6
|
import { FormControl as j } from "../form-field/parts/FormControl.js";
|
|
7
|
-
import { FormFeedbackText as
|
|
8
|
-
|
|
7
|
+
import { FormFeedbackText as v } from "../form-field/parts/FormFeedbackText.js";
|
|
8
|
+
import { isFieldRequired as w } from "../form-field/utils/isFieldRequired.js";
|
|
9
|
+
import { useUnityFormProvider as N } from "../form/Form.context.js";
|
|
10
|
+
function S({
|
|
9
11
|
name: o,
|
|
10
12
|
children: e,
|
|
11
13
|
defaultSelected: r,
|
|
12
|
-
helperText:
|
|
14
|
+
helperText: t,
|
|
13
15
|
contextualLink: c,
|
|
14
|
-
isRequired:
|
|
15
|
-
isInvalid:
|
|
16
|
-
isLoading:
|
|
17
|
-
isDisabled:
|
|
18
|
-
isReadOnly:
|
|
16
|
+
isRequired: s,
|
|
17
|
+
isInvalid: d,
|
|
18
|
+
isLoading: l,
|
|
19
|
+
isDisabled: n,
|
|
20
|
+
isReadOnly: f,
|
|
19
21
|
requiredVariant: p,
|
|
20
|
-
...
|
|
21
|
-
},
|
|
22
|
-
const { control: F, watch:
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
...u
|
|
23
|
+
}, x) {
|
|
24
|
+
const { control: F, watch: h } = R(), { schema: m } = N(), a = y(
|
|
25
|
+
() => w(m, o),
|
|
26
|
+
[m, o]
|
|
27
|
+
), b = h(o);
|
|
28
|
+
return /* @__PURE__ */ k(
|
|
29
|
+
P,
|
|
25
30
|
{
|
|
26
31
|
control: F,
|
|
27
32
|
name: o,
|
|
28
33
|
className: "uy:flex uy:flex-col uy:gap-100",
|
|
29
34
|
...{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
isReadOnly: s
|
|
35
|
+
isInvalid: d,
|
|
36
|
+
isLoading: l,
|
|
37
|
+
isDisabled: n,
|
|
38
|
+
isReadOnly: f
|
|
35
39
|
},
|
|
36
40
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
41
|
+
/* @__PURE__ */ i(j, { children: /* @__PURE__ */ i(
|
|
42
|
+
q,
|
|
39
43
|
{
|
|
40
|
-
ref:
|
|
44
|
+
ref: x,
|
|
41
45
|
defaultSelected: r,
|
|
42
|
-
isSelected:
|
|
46
|
+
isSelected: b,
|
|
43
47
|
requiredVariant: p,
|
|
44
|
-
helperText:
|
|
45
|
-
feedbackText: /* @__PURE__ */
|
|
46
|
-
...
|
|
48
|
+
helperText: t,
|
|
49
|
+
feedbackText: /* @__PURE__ */ i(v, {}),
|
|
50
|
+
...u,
|
|
51
|
+
isRequired: a ?? s,
|
|
47
52
|
children: e
|
|
48
53
|
}
|
|
49
54
|
) }),
|
|
@@ -52,10 +57,10 @@ function N({
|
|
|
52
57
|
}
|
|
53
58
|
);
|
|
54
59
|
}
|
|
55
|
-
const
|
|
56
|
-
return
|
|
60
|
+
const T = C(function(e, r) {
|
|
61
|
+
return S(e, r);
|
|
57
62
|
});
|
|
58
|
-
|
|
63
|
+
T.displayName = "CheckboxField";
|
|
59
64
|
export {
|
|
60
|
-
|
|
65
|
+
T as CheckboxField
|
|
61
66
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { VariantProps } from '@payfit/unity-themes';
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
3
|
import { CheckboxGroupProps as AriaCheckboxGroupProps } from 'react-aria-components';
|
|
3
|
-
import { VariantProps } from 'tailwind-variants';
|
|
4
4
|
export declare const checkboxGroup: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, "uy:flex uy:flex-col uy:gap-50", {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, "uy:flex uy:flex-col uy:gap-50", unknown, unknown, undefined>>;
|
|
5
5
|
export interface CheckboxGroupProps extends VariantProps<typeof checkboxGroup>, Omit<AriaCheckboxGroupProps, 'className' | 'class'> {
|
|
6
6
|
/** The label for the checkbox group. */
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { jsxs as f, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as d, isValidElement as x, cloneElement as h } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { uyTv as g } from "@payfit/unity-themes";
|
|
4
|
+
import { CheckboxGroup as b } from "react-aria-components";
|
|
5
5
|
import { Label as v } from "../label/Label.js";
|
|
6
6
|
import { Text as c } from "../text/Text.js";
|
|
7
|
-
const G =
|
|
7
|
+
const G = g({
|
|
8
8
|
base: "uy:flex uy:flex-col uy:gap-50"
|
|
9
9
|
}), C = d(
|
|
10
10
|
({
|
|
11
|
-
label:
|
|
12
|
-
helperText:
|
|
11
|
+
label: l,
|
|
12
|
+
helperText: m,
|
|
13
13
|
feedbackText: o,
|
|
14
14
|
isDisabled: e,
|
|
15
15
|
isReadOnly: n,
|
|
16
|
-
isInvalid:
|
|
16
|
+
isInvalid: t,
|
|
17
17
|
isRequired: s,
|
|
18
18
|
isLoading: a,
|
|
19
19
|
children: p,
|
|
20
20
|
requiredVariant: i,
|
|
21
21
|
...u
|
|
22
22
|
}, y) => /* @__PURE__ */ f(
|
|
23
|
-
|
|
23
|
+
b,
|
|
24
24
|
{
|
|
25
25
|
...{
|
|
26
26
|
isDisabled: e,
|
|
27
27
|
isReadOnly: n,
|
|
28
|
-
isInvalid:
|
|
28
|
+
isInvalid: t,
|
|
29
29
|
isRequired: s,
|
|
30
30
|
isLoading: a
|
|
31
31
|
},
|
|
@@ -33,14 +33,14 @@ const G = b({
|
|
|
33
33
|
ref: y,
|
|
34
34
|
className: G(),
|
|
35
35
|
children: [
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
l && /* @__PURE__ */ r(v, { isRequired: s, requiredVariant: i, children: l }),
|
|
37
|
+
m && /* @__PURE__ */ r(
|
|
38
38
|
c,
|
|
39
39
|
{
|
|
40
40
|
variant: "bodySmall",
|
|
41
41
|
color: "content.neutral.low",
|
|
42
42
|
slot: "description",
|
|
43
|
-
children:
|
|
43
|
+
children: m
|
|
44
44
|
}
|
|
45
45
|
),
|
|
46
46
|
/* @__PURE__ */ r(
|
|
@@ -51,7 +51,7 @@ const G = b({
|
|
|
51
51
|
children: p
|
|
52
52
|
}
|
|
53
53
|
),
|
|
54
|
-
|
|
54
|
+
t && (typeof o == "string" ? /* @__PURE__ */ r(
|
|
55
55
|
c,
|
|
56
56
|
{
|
|
57
57
|
variant: "bodySmallStrong",
|
|
@@ -1,23 +1,29 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
6
|
-
base:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as u } from "react";
|
|
3
|
+
import { uyTv as e } from "@payfit/unity-themes";
|
|
4
|
+
import { Disclosure as l } from "react-aria-components";
|
|
5
|
+
const r = e({
|
|
6
|
+
base: [
|
|
7
|
+
"uy:w-full uy:rounded-50",
|
|
8
|
+
"uy:data-[focus-visible-within=true]:not-has-data-[focus-visible-within=true]:outline-2",
|
|
9
|
+
"uy:data-[focus-visible-within=true]:not-has-data-[focus-visible-within=true]:outline-solid",
|
|
10
|
+
"uy:data-[focus-visible-within=true]:not-has-data-[focus-visible-within=true]:outline-offset-2",
|
|
11
|
+
"uy:data-[focus-visible-within=true]:not-has-data-[focus-visible-within=true]:outline-utility-focus-ring"
|
|
12
|
+
]
|
|
13
|
+
}), n = u(
|
|
14
|
+
({ children: i, isExpanded: t, ...o }, s) => /* @__PURE__ */ a(
|
|
15
|
+
l,
|
|
10
16
|
{
|
|
11
17
|
"data-dd-privacy": "allow",
|
|
12
|
-
...
|
|
13
|
-
className:
|
|
14
|
-
ref:
|
|
15
|
-
isExpanded:
|
|
16
|
-
children:
|
|
18
|
+
...o,
|
|
19
|
+
className: r(),
|
|
20
|
+
ref: s,
|
|
21
|
+
isExpanded: t,
|
|
22
|
+
children: i
|
|
17
23
|
}
|
|
18
24
|
)
|
|
19
25
|
);
|
|
20
|
-
|
|
26
|
+
n.displayName = "Collapsible";
|
|
21
27
|
export {
|
|
22
|
-
|
|
28
|
+
n as Collapsible
|
|
23
29
|
};
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { DisclosurePanel as
|
|
4
|
-
const
|
|
5
|
-
({ children:
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { DisclosurePanel as e } from "react-aria-components";
|
|
4
|
+
const l = t(
|
|
5
|
+
({ children: i, ...o }, r) => /* @__PURE__ */ a(
|
|
6
|
+
e,
|
|
7
|
+
{
|
|
8
|
+
ref: r,
|
|
9
|
+
"data-dd-privacy": "allow",
|
|
10
|
+
...o,
|
|
11
|
+
className: "uy:transition-all uy:transition-discrete uy:duration-200 uy:origin-top-left uy:aria-hidden:opacity-0 uy:aria-hidden:scale-y-0",
|
|
12
|
+
children: /* @__PURE__ */ a("div", { className: "uy:ml-400 uy:typography-body", children: i })
|
|
13
|
+
}
|
|
14
|
+
)
|
|
6
15
|
);
|
|
7
|
-
|
|
16
|
+
l.displayName = "CollapsibleContent";
|
|
8
17
|
export {
|
|
9
|
-
|
|
18
|
+
l as CollapsibleContent
|
|
10
19
|
};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { jsx as t, jsxs as y } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d, useContext as m } from "react";
|
|
3
|
+
import { uyTv as p } from "@payfit/unity-themes";
|
|
4
|
+
import { DisclosureStateContext as f, Heading as x, Button as b } from "react-aria-components";
|
|
5
5
|
import { Icon as v } from "../../icon/Icon.js";
|
|
6
6
|
import { Text as r } from "../../text/Text.js";
|
|
7
|
-
const
|
|
7
|
+
const g = p({
|
|
8
8
|
slots: {
|
|
9
9
|
base: "uy:w-full",
|
|
10
|
-
button:
|
|
10
|
+
button: [
|
|
11
|
+
"uy:flex uy:gap-50 uy:pb-100 uy:pt-100 uy:w-full uy:hover:text-content-neutral-hover uy:focus-visible:outline-none"
|
|
12
|
+
],
|
|
11
13
|
title: "uy:flex uy:grow uy:text-left uy:items-center",
|
|
12
|
-
icon: "uy:mr-100"
|
|
14
|
+
icon: "uy:mr-100 uy:transition-transform uy:duration-150 uy:ease-linear uy:origin-center"
|
|
13
15
|
},
|
|
14
16
|
variants: {
|
|
15
17
|
isExpanded: {
|
|
@@ -24,24 +26,22 @@ const h = b({
|
|
|
24
26
|
defaultVariants: {
|
|
25
27
|
isExpanded: !1
|
|
26
28
|
}
|
|
27
|
-
}), w =
|
|
29
|
+
}), w = d(
|
|
28
30
|
({ children: a, suffix: o, ...n }, i) => {
|
|
29
|
-
const
|
|
30
|
-
isExpanded:
|
|
31
|
+
const e = m(f), { base: l, button: s, title: u, icon: c } = g({
|
|
32
|
+
isExpanded: e == null ? void 0 : e.isExpanded
|
|
31
33
|
});
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
] }),
|
|
44
|
-
o ? /* @__PURE__ */ e(r, { variant: "body", children: o }) : null
|
|
34
|
+
return /* @__PURE__ */ t(x, { "data-dd-privacy": "allow", ...n, ref: i, className: l(), children: /* @__PURE__ */ y(b, { className: s(), slot: "trigger", children: [
|
|
35
|
+
/* @__PURE__ */ t(
|
|
36
|
+
v,
|
|
37
|
+
{
|
|
38
|
+
src: "CaretDownOutlined",
|
|
39
|
+
className: c(),
|
|
40
|
+
role: "presentation"
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ t(r, { variant: "bodyStrong", className: u(), children: a }),
|
|
44
|
+
o ? /* @__PURE__ */ t(r, { variant: "body", children: o }) : null
|
|
45
45
|
] }) });
|
|
46
46
|
}
|
|
47
47
|
);
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { Row, Table as TableType } from '@tanstack/react-table';
|
|
2
|
+
import { Row, RowData, Table as TableType } from '@tanstack/react-table';
|
|
3
3
|
import { TablePaginationProps } from '../table/parts/TablePagination.js';
|
|
4
4
|
import { TableProps, TableRootProps } from '../table/Table.js';
|
|
5
|
+
declare module '@tanstack/react-table' {
|
|
6
|
+
interface ColumnMeta<TData extends RowData, TValue> {
|
|
7
|
+
isRowHeader?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
helperText?: string;
|
|
10
|
+
isFocusable?: boolean;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
5
13
|
export interface DataTablePaginationLabels {
|
|
6
14
|
/** Label for the "rows per page" and pagination label dropdown */
|
|
7
15
|
itemLabel?: string;
|
|
@@ -50,39 +58,62 @@ export interface DataTableProps<TData> extends Omit<TableRootProps, 'children'>,
|
|
|
50
58
|
* @see {@link DataTableProps} for all available props
|
|
51
59
|
* @example
|
|
52
60
|
* ```tsx
|
|
53
|
-
* import { DataTable, TableRow, TableCell } from '@payfit/unity-components'
|
|
61
|
+
* import { DataTableRoot, DataTable, DataTableBulkActions, TableRow, TableCell } from '@payfit/unity-components'
|
|
54
62
|
* import { flexRender, useReactTable, getCoreRowModel, getPaginationRowModel } from '@tanstack/react-table'
|
|
55
|
-
* import { useState } from 'react'
|
|
63
|
+
* import { useState, useMemo } from 'react'
|
|
56
64
|
*
|
|
57
65
|
* function EmployeeTable() {
|
|
58
66
|
* const [pagination, setPagination] = useState({ pageIndex: 0, pageSize: 10 })
|
|
67
|
+
* const [rowSelection, setRowSelection] = useState({})
|
|
68
|
+
*
|
|
69
|
+
* // Memoize columns to prevent unnecessary re-renders
|
|
70
|
+
* const columns = useMemo(() => employeeColumns, [])
|
|
59
71
|
*
|
|
60
72
|
* const table = useReactTable({
|
|
61
73
|
* data: employees,
|
|
62
|
-
* columns
|
|
63
|
-
*
|
|
74
|
+
* columns,
|
|
75
|
+
* // Provide stable row ID for better performance
|
|
76
|
+
* getRowId: (row) => row.id,
|
|
77
|
+
* state: {
|
|
78
|
+
* pagination,
|
|
79
|
+
* rowSelection,
|
|
80
|
+
* },
|
|
64
81
|
* onPaginationChange: setPagination,
|
|
82
|
+
* onRowSelectionChange: setRowSelection,
|
|
65
83
|
* getCoreRowModel: getCoreRowModel(),
|
|
66
84
|
* getPaginationRowModel: getPaginationRowModel(),
|
|
85
|
+
* // Enable row selection features
|
|
86
|
+
* enableRowSelection: true,
|
|
87
|
+
* enableMultiRowSelection: true,
|
|
67
88
|
* })
|
|
68
89
|
*
|
|
90
|
+
* const actions = [
|
|
91
|
+
* { id: 'delete', label: 'Delete', onPress: handleDelete },
|
|
92
|
+
* { id: 'archive', label: 'Archive', onPress: handleArchive },
|
|
93
|
+
* ]
|
|
94
|
+
*
|
|
69
95
|
* return (
|
|
70
|
-
* <
|
|
71
|
-
* {
|
|
72
|
-
*
|
|
73
|
-
* {row.
|
|
74
|
-
*
|
|
75
|
-
* {
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
96
|
+
* <DataTableRoot>
|
|
97
|
+
* <DataTable table={table} minRows={5} maxRows={10}>
|
|
98
|
+
* {row => (
|
|
99
|
+
* <TableRow key={row.id} isSelected={row.getIsSelected()}>
|
|
100
|
+
* {row.getVisibleCells().map(cell => (
|
|
101
|
+
* <TableCell key={cell.id}>
|
|
102
|
+
* {flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
103
|
+
* </TableCell>
|
|
104
|
+
* ))}
|
|
105
|
+
* </TableRow>
|
|
106
|
+
* )}
|
|
107
|
+
* </DataTable>
|
|
108
|
+
* <DataTableBulkActions table={table} actions={actions} />
|
|
109
|
+
* </DataTableRoot>
|
|
81
110
|
* )
|
|
82
111
|
* }
|
|
83
112
|
* ```
|
|
84
113
|
* @remarks
|
|
85
|
-
*
|
|
114
|
+
* - For bulk actions, use DataTableBulkActions component alongside DataTable within DataTableRoot
|
|
115
|
+
* - DataTableBulkActions provides the F6 keyboard shortcut for accessibility
|
|
116
|
+
* - [API](https://unity-components.payfit.io/?path=/docs/data-datatable--docs) • [Demo](https://unity-components.payfit.io/?path=/docs/data-datatable--docs)
|
|
86
117
|
*/
|
|
87
118
|
declare function DataTable<TData extends object>({ table, isLoading, error, emptyState, loadingState, errorState, pagination, minRows, maxRows, children, ...rest }: DataTableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
88
119
|
declare namespace DataTable {
|
|
@@ -1,82 +1,126 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { flexRender as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsxs as c, jsx as e, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as v, useEffect as I } from "react";
|
|
3
|
+
import { flexRender as x } from "@tanstack/react-table";
|
|
4
|
+
import { useId as N } from "react-aria";
|
|
5
|
+
import { CircularIconButton as M } from "../icon-button/CircularIconButton.js";
|
|
6
|
+
import { TableBody as F } from "../table/parts/TableBody.js";
|
|
7
|
+
import { TableColumnHeader as O } from "../table/parts/TableColumnHeader.js";
|
|
8
|
+
import { TableEmptyStateLoading as j, TableEmptyStateError as B, TableEmptyStateNoData as $ } from "../table/parts/TableEmptyState.js";
|
|
9
|
+
import { TableHeader as G } from "../table/parts/TableHeader.js";
|
|
10
|
+
import { TablePagination as L } from "../table/parts/TablePagination.js";
|
|
11
|
+
import { TableRoot as Q, Table as W } from "../table/Table.js";
|
|
12
|
+
import { ColumnSortHeader as k } from "./parts/ColumnSortHeader.js";
|
|
13
|
+
const S = ({
|
|
14
|
+
children: o,
|
|
15
|
+
columnNameId: m,
|
|
16
|
+
helperText: l
|
|
17
|
+
}) => l !== void 0 ? /* @__PURE__ */ c("div", { className: "uy:flex uy:gap-50 uy:items-center", children: [
|
|
18
|
+
o,
|
|
19
|
+
/* @__PURE__ */ e(
|
|
20
|
+
M,
|
|
21
|
+
{
|
|
22
|
+
"aria-labelledby": m,
|
|
23
|
+
className: "uy:text-content-neutral-low uy:hover:bg-surface-neutral-hover uy:hover:text-content-neutral-low",
|
|
24
|
+
icon: "QuestionOutlined",
|
|
25
|
+
title: l,
|
|
26
|
+
color: "content.neutral.low"
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
] }) : /* @__PURE__ */ e(H, { children: o });
|
|
30
|
+
function q({
|
|
31
|
+
table: o,
|
|
32
|
+
isLoading: m,
|
|
33
|
+
error: l,
|
|
15
34
|
emptyState: i,
|
|
16
|
-
loadingState:
|
|
17
|
-
errorState:
|
|
35
|
+
loadingState: w,
|
|
36
|
+
errorState: C,
|
|
18
37
|
pagination: n,
|
|
19
|
-
minRows:
|
|
20
|
-
maxRows:
|
|
21
|
-
children:
|
|
22
|
-
...
|
|
38
|
+
minRows: y,
|
|
39
|
+
maxRows: P,
|
|
40
|
+
children: D,
|
|
41
|
+
...u
|
|
23
42
|
}) {
|
|
24
|
-
var
|
|
25
|
-
const
|
|
26
|
-
|
|
43
|
+
var g;
|
|
44
|
+
const s = v(null), E = N(), { pageIndex: d, pageSize: p } = o.getState().pagination;
|
|
45
|
+
I(() => {
|
|
27
46
|
var r;
|
|
28
|
-
(r =
|
|
29
|
-
}, [
|
|
30
|
-
const
|
|
31
|
-
label:
|
|
32
|
-
description:
|
|
33
|
-
isHorizontalScrollEnabled:
|
|
34
|
-
},
|
|
47
|
+
(r = s.current) == null || r.scrollToTop();
|
|
48
|
+
}, [d, p]);
|
|
49
|
+
const R = {
|
|
50
|
+
label: u.label,
|
|
51
|
+
description: u.description,
|
|
52
|
+
isHorizontalScrollEnabled: u.isHorizontalScrollEnabled
|
|
53
|
+
}, f = () => {
|
|
54
|
+
if (m)
|
|
55
|
+
return w ?? /* @__PURE__ */ e(j, {});
|
|
35
56
|
if (l)
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
return C ?? /* @__PURE__ */ e(B, {});
|
|
58
|
+
}, z = () => m || l ? f() : o.getRowModel().rows.length === 0 ? i ?? /* @__PURE__ */ e($, {}) : i;
|
|
59
|
+
return /* @__PURE__ */ c(Q, { minRows: y, maxRows: P, children: [
|
|
60
|
+
/* @__PURE__ */ c(W, { ref: s, ...R, children: [
|
|
61
|
+
/* @__PURE__ */ e(G, { children: o.getHeaderGroups().map(
|
|
62
|
+
(r) => r.headers.map((t) => {
|
|
63
|
+
var b, T, h;
|
|
64
|
+
const a = `${E}-column-name-${t.column.columnDef.id}`;
|
|
65
|
+
return /* @__PURE__ */ e(
|
|
66
|
+
O,
|
|
67
|
+
{
|
|
68
|
+
isFocusable: (b = t.column.columnDef.meta) == null ? void 0 : b.isFocusable,
|
|
69
|
+
children: o.getRowModel().rows.length > 0 && t.column.getCanSort() ? /* @__PURE__ */ e(k, { header: t, children: /* @__PURE__ */ e(
|
|
70
|
+
S,
|
|
71
|
+
{
|
|
72
|
+
columnNameId: a,
|
|
73
|
+
helperText: (T = t.column.columnDef.meta) == null ? void 0 : T.helperText,
|
|
74
|
+
children: /* @__PURE__ */ e("span", { id: a, children: x(
|
|
75
|
+
t.column.columnDef.header,
|
|
76
|
+
t.getContext()
|
|
77
|
+
) })
|
|
78
|
+
}
|
|
79
|
+
) }) : /* @__PURE__ */ e(
|
|
80
|
+
S,
|
|
81
|
+
{
|
|
82
|
+
columnNameId: a,
|
|
83
|
+
helperText: (h = t.column.columnDef.meta) == null ? void 0 : h.helperText,
|
|
84
|
+
children: /* @__PURE__ */ e("span", { id: a, children: x(
|
|
85
|
+
t.column.columnDef.header,
|
|
86
|
+
t.getContext()
|
|
87
|
+
) })
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
},
|
|
91
|
+
t.id
|
|
92
|
+
);
|
|
93
|
+
})
|
|
50
94
|
) }),
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
|
|
95
|
+
/* @__PURE__ */ e(
|
|
96
|
+
F,
|
|
53
97
|
{
|
|
54
|
-
renderEmptyState:
|
|
55
|
-
renderDataState:
|
|
56
|
-
children: !
|
|
98
|
+
renderEmptyState: z,
|
|
99
|
+
renderDataState: f,
|
|
100
|
+
children: !m && !l && o.getRowModel().rows.map(D)
|
|
57
101
|
}
|
|
58
102
|
)
|
|
59
103
|
] }),
|
|
60
|
-
|
|
61
|
-
|
|
104
|
+
o.getPageCount() > 1 && /* @__PURE__ */ e(
|
|
105
|
+
L,
|
|
62
106
|
{
|
|
63
|
-
pageCount:
|
|
64
|
-
rowCount:
|
|
65
|
-
currentPage:
|
|
66
|
-
rowsPerPage:
|
|
107
|
+
pageCount: o.getPageCount(),
|
|
108
|
+
rowCount: o.getPaginationRowModel().rows.length,
|
|
109
|
+
currentPage: d + 1,
|
|
110
|
+
rowsPerPage: p,
|
|
67
111
|
pageSizeOptions: n == null ? void 0 : n.pageSizeOptions,
|
|
68
112
|
onPageChange: (r) => {
|
|
69
|
-
|
|
113
|
+
o.setPageIndex(r - 1);
|
|
70
114
|
},
|
|
71
115
|
onPageSizeChange: (r) => {
|
|
72
|
-
|
|
116
|
+
o.setPageSize(r);
|
|
73
117
|
},
|
|
74
|
-
itemLabel: (
|
|
118
|
+
itemLabel: (g = n == null ? void 0 : n.labels) == null ? void 0 : g.itemLabel
|
|
75
119
|
}
|
|
76
120
|
)
|
|
77
121
|
] });
|
|
78
122
|
}
|
|
79
|
-
|
|
123
|
+
q.displayName = "DataTable";
|
|
80
124
|
export {
|
|
81
|
-
|
|
125
|
+
q as DataTable
|
|
82
126
|
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { Employee } from './employee-data.js';
|
|
2
|
+
/**
|
|
3
|
+
* Creates optimized checkbox column with stable handlers to prevent unnecessary re-renders
|
|
4
|
+
*/
|
|
5
|
+
export declare const createCheckboxColumn: () => import('@tanstack/table-core').DisplayColumnDef<Employee, unknown>;
|
|
2
6
|
export declare const employeeColumns: (import('@tanstack/table-core').AccessorKeyColumnDefBase<Employee, string> & Partial<import('@tanstack/table-core').IdIdentifier<Employee, string>>)[];
|
|
3
7
|
export declare const employeeColumnsWithCheckbox: ((import('@tanstack/table-core').AccessorKeyColumnDefBase<Employee, string> & Partial<import('@tanstack/table-core').IdIdentifier<Employee, string>>) | import('@tanstack/table-core').DisplayColumnDef<Employee, unknown>)[];
|