@payfit/unity-components 1.1.0 → 1.2.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.
Files changed (104) hide show
  1. package/dist/esm/adapters/standardSchemaAdapter.d.ts +7 -0
  2. package/dist/esm/adapters/standardSchemaAdapter.js +20 -0
  3. package/dist/esm/adapters/zodAdapter.d.ts +13 -0
  4. package/dist/esm/adapters/zodAdapter.js +74 -0
  5. package/dist/esm/components/action-bar/ActionBar.js +62 -64
  6. package/dist/esm/components/actionable/Actionable.d.ts +50 -3
  7. package/dist/esm/components/actionable/Actionable.js +49 -39
  8. package/dist/esm/components/app-menu/parts/AppMenuFooter.js +63 -63
  9. package/dist/esm/components/autocomplete/parts/AutocompleteClearButton.js +5 -5
  10. package/dist/esm/components/bottom-sheet/parts/BottomSheetDragIndicator.js +30 -31
  11. package/dist/esm/components/checkbox-field/CheckboxField.d.ts +2 -2
  12. package/dist/esm/components/checkbox-field/CheckboxField.js +18 -17
  13. package/dist/esm/components/checkbox-group-field/CheckboxGroupField.d.ts +2 -2
  14. package/dist/esm/components/checkbox-group-field/CheckboxGroupField.js +4 -1
  15. package/dist/esm/components/code/Code.d.ts +37 -0
  16. package/dist/esm/components/code/Code.js +39 -0
  17. package/dist/esm/components/code/copyToClipboard.d.ts +1 -0
  18. package/dist/esm/components/code/copyToClipboard.js +10 -0
  19. package/dist/esm/components/collapsible/Collapsible.d.ts +1 -1
  20. package/dist/esm/components/collapsible/Collapsible.js +14 -13
  21. package/dist/esm/components/collapsible/parts/CollapsibleTitle.js +7 -7
  22. package/dist/esm/components/data-table/DataTable.d.ts +76 -10
  23. package/dist/esm/components/data-table/DataTable.js +81 -78
  24. package/dist/esm/components/data-table/parts/ColumnSortHeader.js +13 -13
  25. package/dist/esm/components/data-table/parts/DataTableBulkActions.js +20 -20
  26. package/dist/esm/components/date-calendar/DateCalendar.js +52 -52
  27. package/dist/esm/components/date-calendar/parts/DateSegmentSelect.js +30 -33
  28. package/dist/esm/components/date-picker/DatePicker.js +64 -64
  29. package/dist/esm/components/date-picker/parts/DateInput.js +33 -33
  30. package/dist/esm/components/date-picker-field/DatePickerField.d.ts +2 -2
  31. package/dist/esm/components/dialog/parts/DialogActions/DialogButton.js +12 -12
  32. package/dist/esm/components/error-state/ErrorState.d.ts +196 -0
  33. package/dist/esm/components/error-state/ErrorState.js +153 -0
  34. package/dist/esm/components/error-state/initConfig.d.ts +16 -0
  35. package/dist/esm/components/error-state/initConfig.js +149 -0
  36. package/dist/esm/components/error-state/parts/Collapsible.d.ts +59 -0
  37. package/dist/esm/components/error-state/parts/Collapsible.js +67 -0
  38. package/dist/esm/components/form/Form.d.ts +15 -9
  39. package/dist/esm/components/form/Form.js +53 -50
  40. package/dist/esm/components/form-field/FormField.js +24 -23
  41. package/dist/esm/components/form-field/utils/isFieldRequired.d.ts +4 -4
  42. package/dist/esm/components/form-field/utils/isFieldRequired.js +5 -20
  43. package/dist/esm/components/funnel-layout/FunnelLayout.d.ts +1 -1
  44. package/dist/esm/components/funnel-layout/FunnelLayout.js +61 -110
  45. package/dist/esm/components/funnel-layout/parts/FunnelPage.js +8 -9
  46. package/dist/esm/components/funnel-layout/parts/FunnelPageActions.js +24 -24
  47. package/dist/esm/components/funnel-layout/parts/FunnelPageFooter.js +6 -7
  48. package/dist/esm/components/funnel-layout/parts/FunnelPageHeader.d.ts +2 -2
  49. package/dist/esm/components/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
  50. package/dist/esm/components/funnel-layout/parts/FunnelSidebar.js +9 -10
  51. package/dist/esm/components/funnel-layout/parts/FunnelTopBar.js +0 -1
  52. package/dist/esm/components/input/Input.js +28 -28
  53. package/dist/esm/components/label/Label.js +19 -19
  54. package/dist/esm/components/multi-select/MultiSelect.js +94 -94
  55. package/dist/esm/components/multi-select/hooks/use-multiselection-state.js +32 -32
  56. package/dist/esm/components/multi-select/parts/MultiSelectButton.js +38 -38
  57. package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +16 -16
  58. package/dist/esm/components/multi-select-field/MultiSelectField.d.ts +2 -2
  59. package/dist/esm/components/multi-select-field/MultiSelectField.js +53 -53
  60. package/dist/esm/components/nav/parts/NavGroup.js +21 -21
  61. package/dist/esm/components/number-field/NumberField.d.ts +3 -3
  62. package/dist/esm/components/number-input/NumberInput.js +58 -58
  63. package/dist/esm/components/pagination/Pagination.js +97 -101
  64. package/dist/esm/components/pagination/parts/PaginationJumpDialog.js +39 -40
  65. package/dist/esm/components/popover/parts/PopoverHeader.js +8 -8
  66. package/dist/esm/components/radio-button-group/parts/RadioButton.js +11 -11
  67. package/dist/esm/components/select-field/SelectField.d.ts +2 -2
  68. package/dist/esm/components/select-field/SelectField.js +4 -1
  69. package/dist/esm/components/selectable-button-group/SelectableButtonGroup.js +22 -23
  70. package/dist/esm/components/selectable-button-group-field/SelectableButtonGroupField.d.ts +2 -2
  71. package/dist/esm/components/side-panel/parts/SidePanelDragIndicator.js +30 -31
  72. package/dist/esm/components/skip-links/SkipLinks.js +50 -43
  73. package/dist/esm/components/table/Table.js +79 -76
  74. package/dist/esm/components/table/parts/TableBody.js +6 -6
  75. package/dist/esm/components/table/parts/TableCell.js +25 -25
  76. package/dist/esm/components/table/parts/TableColumnHeader.js +38 -38
  77. package/dist/esm/components/table/parts/TablePagination.js +61 -59
  78. package/dist/esm/components/table/parts/TableRow.js +16 -16
  79. package/dist/esm/components/tabs/parts/TabList.js +50 -54
  80. package/dist/esm/components/task-menu/parts/Content.js +24 -24
  81. package/dist/esm/components/task-menu/parts/Header.js +24 -24
  82. package/dist/esm/components/task-menu/parts/SubTask.js +74 -74
  83. package/dist/esm/components/task-menu/parts/Task.js +69 -69
  84. package/dist/esm/components/task-menu/parts/TaskGroup.js +45 -45
  85. package/dist/esm/components/text-area/TextArea.js +30 -31
  86. package/dist/esm/components/text-field/TextField.d.ts +2 -2
  87. package/dist/esm/components/toggle-switch-field/ToggleSwitchField.d.ts +2 -2
  88. package/dist/esm/components/toggle-switch-field/ToggleSwitchField.js +4 -1
  89. package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.js +74 -74
  90. package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.d.ts +2 -2
  91. package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.js +36 -32
  92. package/dist/esm/hooks/use-form.d.ts +5 -5
  93. package/dist/esm/hooks/use-form.types.d.ts +2 -2
  94. package/dist/esm/hooks/use-resizable.js +13 -14
  95. package/dist/esm/index.d.ts +1 -0
  96. package/dist/esm/index.js +22 -19
  97. package/dist/esm/types/schema.d.ts +8 -0
  98. package/dist/esm/utils/createSchemaAdapter.d.ts +7 -0
  99. package/dist/esm/utils/createSchemaAdapter.js +13 -0
  100. package/dist/esm/utils/platform.js +2 -3
  101. package/i18n/en-GB.json +16 -0
  102. package/i18n/es-ES.json +16 -0
  103. package/i18n/fr-FR.json +16 -0
  104. package/package.json +25 -19
@@ -3,7 +3,7 @@ import { forwardRef as d, useContext as m } from "react";
3
3
  import { uyTv as p } from "@payfit/unity-themes";
4
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
- import { Text as r } from "../../text/Text.js";
6
+ import { Text as o } from "../../text/Text.js";
7
7
  const g = p({
8
8
  slots: {
9
9
  base: "uy:w-full",
@@ -27,11 +27,11 @@ const g = p({
27
27
  isExpanded: !1
28
28
  }
29
29
  }), w = d(
30
- ({ children: a, suffix: o, ...n }, i) => {
31
- const e = m(f), { base: l, button: s, title: u, icon: c } = g({
32
- isExpanded: e == null ? void 0 : e.isExpanded
30
+ ({ children: a, suffix: e, ...r }, n) => {
31
+ const i = m(f), { base: l, button: s, title: u, icon: c } = g({
32
+ isExpanded: i?.isExpanded
33
33
  });
34
- return /* @__PURE__ */ t(x, { "data-dd-privacy": "allow", ...n, ref: i, className: l(), children: /* @__PURE__ */ y(b, { className: s(), slot: "trigger", children: [
34
+ return /* @__PURE__ */ t(x, { "data-dd-privacy": "allow", ...r, ref: n, className: l(), children: /* @__PURE__ */ y(b, { className: s(), slot: "trigger", children: [
35
35
  /* @__PURE__ */ t(
36
36
  v,
37
37
  {
@@ -40,8 +40,8 @@ const g = p({
40
40
  role: "presentation"
41
41
  }
42
42
  ),
43
- /* @__PURE__ */ t(r, { variant: "bodyStrong", className: u(), children: a }),
44
- o ? /* @__PURE__ */ t(r, { variant: "body", children: o }) : null
43
+ /* @__PURE__ */ t(o, { variant: "bodyStrong", className: u(), children: a }),
44
+ e ? /* @__PURE__ */ t(o, { variant: "body", children: e }) : null
45
45
  ] }) });
46
46
  }
47
47
  );
@@ -15,27 +15,90 @@ export interface DataTablePaginationLabels {
15
15
  itemLabel?: string;
16
16
  }
17
17
  export interface DataTablePaginationOptions {
18
- /** Available options in the "rows per page" dropdown */
18
+ /**
19
+ * Available options in the "rows per page" dropdown, see {@link TablePaginationProps['pageSizeOptions']}
20
+ * @default [
21
+ * { value: '10', label: '10' },
22
+ * { value: '50', label: '50' },
23
+ * { value: '100', label: '100' },
24
+ * { value: '200', label: '200' },
25
+ * ]
26
+ */
19
27
  pageSizeOptions?: TablePaginationProps['pageSizeOptions'];
20
- /** Custom labels for pagination */
28
+ /**
29
+ * Custom labels for pagination, see {@link DataTablePaginationLabels}
30
+ * @default {
31
+ * itemLabel: 'unity:component:table:pagination:item',
32
+ * }
33
+ */
21
34
  labels?: DataTablePaginationLabels;
22
35
  }
23
36
  export interface DataTableProps<TData> extends Omit<TableRootProps, 'children'>, Omit<TableProps, 'children'> {
24
37
  /** The table instance from @tanstack/react-table */
25
38
  table: TableType<TData>;
26
- /** Optional loading state */
39
+ /**
40
+ * Optional loading state
41
+ * @default false
42
+ */
27
43
  isLoading?: boolean;
28
- /** Optional error state */
44
+ /**
45
+ * Optional error state
46
+ * @default null
47
+ */
29
48
  error?: Error | null;
30
- /** Custom empty state when there's no data */
49
+ /**
50
+ * Custom empty state when there's no data. Use it to override the default empty state.
51
+ * @default <TableEmptyStateNoData />
52
+ */
31
53
  emptyState?: React.ReactNode;
32
- /** Custom loading state */
54
+ /**
55
+ * Custom loading state to show when `isLoading` is true. Use it to override the default loading state.
56
+ * @default <TableEmptyStateLoading />
57
+ */
33
58
  loadingState?: React.ReactNode;
34
- /** Custom error state */
59
+ /**
60
+ * Custom error state to show when `error` prop is not null. Use it to override the default error state.
61
+ * @default <TableEmptyStateError />
62
+ */
35
63
  errorState?: React.ReactNode;
36
- /** Pagination customization */
64
+ /**
65
+ * Pagination customization options, including page size options and labels
66
+ * @default {
67
+ * pageSizeOptions: [
68
+ * { value: '10', label: '10' },
69
+ * { value: '50', label: '50' },
70
+ * { value: '100', label: '100' },
71
+ * { value: '200', label: '200' },
72
+ * ],
73
+ * labels: {
74
+ * itemLabel: 'unity:component:table:pagination:item',
75
+ * },
76
+ * }
77
+ */
37
78
  pagination?: DataTablePaginationOptions;
38
- /** Render function for table rows */
79
+ /**
80
+ * Callback fired when the current tablepage changes
81
+ * @param page - The new page number
82
+ * @param previous - The previous page number
83
+ * @param direction - The direction of navigation (1 for forward, -1 for backward)
84
+ */
85
+ onPageChange?: TablePaginationProps['onPageChange'];
86
+ /**
87
+ * A callback function that is triggered when a page is hovered over in the pagination component.
88
+ *
89
+ * This function is intended for handling hover events on individual pagination controls or elements.
90
+ * It is derived from the `onPageHover` property in the `Pagination` component.
91
+ */
92
+ onPageHover?: TablePaginationProps['onPageHover'];
93
+ /**
94
+ * Callback fired when the number of rows per page changes
95
+ * @param pageSize - The new number of rows per page
96
+ */
97
+ onPageSizeChange?: TablePaginationProps['onPageSizeChange'];
98
+ /**
99
+ * Render function for table rows
100
+ * @param row - The row data of a given row in the table
101
+ */
39
102
  children: (row: Row<TData>) => React.ReactNode;
40
103
  }
41
104
  /**
@@ -54,6 +117,9 @@ export interface DataTableProps<TData> extends Omit<TableRootProps, 'children'>,
54
117
  * @param props.loadingState - Custom loading state to show when `isLoading` is true
55
118
  * @param props.errorState - Custom error state to show when `error` is not null
56
119
  * @param props.pagination - Optional pagination customization, see {@link DataTablePaginationOptions}
120
+ * @param props.onPageChange - Optional callback for pagination change
121
+ * @param props.onPageHover - Optional callback for pagination hover
122
+ * @param props.onPageSizeChange - Optional callback for pagination size change
57
123
  * @param props.children - Render function that takes care of rendering the table rows
58
124
  * @see {@link DataTableProps} for all available props
59
125
  * @example
@@ -115,7 +181,7 @@ export interface DataTableProps<TData> extends Omit<TableRootProps, 'children'>,
115
181
  * - DataTableBulkActions provides the F6 keyboard shortcut for accessibility
116
182
  * - [API](https://unity-components.payfit.io/?path=/docs/data-datatable--docs) • [Demo](https://unity-components.payfit.io/?path=/docs/data-datatable--docs)
117
183
  */
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;
184
+ declare function DataTable<TData extends object>({ table, isLoading, error, emptyState, loadingState, errorState, pagination, minRows, maxRows, onPageChange: onPaginationChange, onPageHover: onPaginationPageHover, onPageSizeChange: onPaginationSizeChange, children, ...rest }: DataTableProps<TData>): import("react/jsx-runtime").JSX.Element;
119
185
  declare namespace DataTable {
120
186
  var displayName: string;
121
187
  }
@@ -1,87 +1,87 @@
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";
1
+ import { jsxs as m, jsx as e, Fragment as E } from "react/jsx-runtime";
2
+ import { useRef as R, useEffect as z } from "react";
3
+ import { flexRender as f } from "@tanstack/react-table";
4
+ import { useId as I } from "react-aria";
5
+ import { CircularIconButton as N } from "../icon-button/CircularIconButton.js";
6
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 = ({
7
+ import { TableColumnHeader as M } from "../table/parts/TableColumnHeader.js";
8
+ import { TableEmptyStateLoading as O, TableEmptyStateError as j, TableEmptyStateNoData as B } from "../table/parts/TableEmptyState.js";
9
+ import { TableHeader as $ } from "../table/parts/TableHeader.js";
10
+ import { TablePagination as G } from "../table/parts/TablePagination.js";
11
+ import { TableRoot as L, Table as Q } from "../table/Table.js";
12
+ import { ColumnSortHeader as W } from "./parts/ColumnSortHeader.js";
13
+ const b = ({
14
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: [
15
+ columnNameId: a,
16
+ helperText: r
17
+ }) => r !== void 0 ? /* @__PURE__ */ m("div", { className: "uy:flex uy:gap-50 uy:items-center", children: [
18
18
  o,
19
19
  /* @__PURE__ */ e(
20
- M,
20
+ N,
21
21
  {
22
- "aria-labelledby": m,
22
+ "aria-labelledby": a,
23
23
  className: "uy:text-content-neutral-low uy:hover:bg-surface-neutral-hover uy:hover:text-content-neutral-low",
24
24
  icon: "QuestionOutlined",
25
- title: l,
25
+ title: r,
26
26
  color: "content.neutral.low"
27
27
  }
28
28
  )
29
- ] }) : /* @__PURE__ */ e(H, { children: o });
30
- function q({
29
+ ] }) : /* @__PURE__ */ e(E, { children: o });
30
+ function k({
31
31
  table: o,
32
- isLoading: m,
33
- error: l,
34
- emptyState: i,
35
- loadingState: w,
36
- errorState: C,
37
- pagination: n,
38
- minRows: y,
32
+ isLoading: a,
33
+ error: r,
34
+ emptyState: u,
35
+ loadingState: C,
36
+ errorState: T,
37
+ pagination: c,
38
+ minRows: h,
39
39
  maxRows: P,
40
- children: D,
41
- ...u
40
+ onPageChange: S,
41
+ onPageHover: x,
42
+ onPageSizeChange: w,
43
+ children: y,
44
+ ...i
42
45
  }) {
43
- var g;
44
- const s = v(null), E = N(), { pageIndex: d, pageSize: p } = o.getState().pagination;
45
- I(() => {
46
- var r;
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, {});
56
- if (l)
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}`;
46
+ const p = R(null), D = I(), { pageIndex: s, pageSize: g } = o.getState().pagination;
47
+ z(() => {
48
+ p.current?.scrollToTop();
49
+ }, [s, g]);
50
+ const H = {
51
+ label: i.label,
52
+ description: i.description,
53
+ isHorizontalScrollEnabled: i.isHorizontalScrollEnabled
54
+ }, d = () => {
55
+ if (a)
56
+ return C ?? /* @__PURE__ */ e(O, {});
57
+ if (r)
58
+ return T ?? /* @__PURE__ */ e(j, {});
59
+ }, v = () => a || r ? d() : o.getRowModel().rows.length === 0 ? u ?? /* @__PURE__ */ e(B, {}) : u;
60
+ return /* @__PURE__ */ m(L, { minRows: h, maxRows: P, children: [
61
+ /* @__PURE__ */ m(Q, { ref: p, ...H, children: [
62
+ /* @__PURE__ */ e($, { children: o.getHeaderGroups().map(
63
+ (n) => n.headers.map((t) => {
64
+ const l = `${D}-column-name-${t.column.columnDef.id}`;
65
65
  return /* @__PURE__ */ e(
66
- O,
66
+ M,
67
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,
68
+ isFocusable: t.column.columnDef.meta?.isFocusable,
69
+ children: o.getRowModel().rows.length > 0 && t.column.getCanSort() ? /* @__PURE__ */ e(W, { header: t, children: /* @__PURE__ */ e(
70
+ b,
71
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(
72
+ columnNameId: l,
73
+ helperText: t.column.columnDef.meta?.helperText,
74
+ children: /* @__PURE__ */ e("span", { id: l, children: f(
75
75
  t.column.columnDef.header,
76
76
  t.getContext()
77
77
  ) })
78
78
  }
79
79
  ) }) : /* @__PURE__ */ e(
80
- S,
80
+ b,
81
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(
82
+ columnNameId: l,
83
+ helperText: t.column.columnDef.meta?.helperText,
84
+ children: /* @__PURE__ */ e("span", { id: l, children: f(
85
85
  t.column.columnDef.header,
86
86
  t.getContext()
87
87
  ) })
@@ -95,32 +95,35 @@ function q({
95
95
  /* @__PURE__ */ e(
96
96
  F,
97
97
  {
98
- renderEmptyState: z,
99
- renderDataState: f,
100
- children: !m && !l && o.getRowModel().rows.map(D)
98
+ renderEmptyState: v,
99
+ renderDataState: d,
100
+ children: !a && !r && o.getRowModel().rows.map(y)
101
101
  }
102
102
  )
103
103
  ] }),
104
- o.getPageCount() > 1 && /* @__PURE__ */ e(
105
- L,
104
+ o.getPageCount() > 0 && /* @__PURE__ */ e(
105
+ G,
106
106
  {
107
107
  pageCount: o.getPageCount(),
108
- rowCount: o.getPaginationRowModel().rows.length,
109
- currentPage: d + 1,
110
- rowsPerPage: p,
111
- pageSizeOptions: n == null ? void 0 : n.pageSizeOptions,
112
- onPageChange: (r) => {
113
- o.setPageIndex(r - 1);
108
+ rowCount: o.getRowCount(),
109
+ currentPage: s + 1,
110
+ rowsPerPage: g,
111
+ pageSizeOptions: c?.pageSizeOptions,
112
+ onPageChange: (n, t, l) => {
113
+ o.setPageIndex(n - 1), S?.(n - 1, t, l);
114
114
  },
115
- onPageSizeChange: (r) => {
116
- o.setPageSize(r);
115
+ onPageHover: (n) => {
116
+ x?.(n);
117
117
  },
118
- itemLabel: (g = n == null ? void 0 : n.labels) == null ? void 0 : g.itemLabel
118
+ onPageSizeChange: (n) => {
119
+ o.setPageSize(n), w?.(n);
120
+ },
121
+ itemLabel: c?.labels?.itemLabel
119
122
  }
120
123
  )
121
124
  ] });
122
125
  }
123
- q.displayName = "DataTable";
126
+ k.displayName = "DataTable";
124
127
  export {
125
- q as DataTable
128
+ k as DataTable
126
129
  };
@@ -1,31 +1,31 @@
1
- import { jsx as r, jsxs as m, Fragment as s } from "react/jsx-runtime";
2
- import { Actionable as c } from "../../actionable/Actionable.js";
3
- import { Icon as i } from "../../icon/Icon.js";
1
+ import { jsx as r, jsxs as l, Fragment as c } from "react/jsx-runtime";
2
+ import { Actionable as i } from "../../actionable/Actionable.js";
3
+ import { Icon as m } from "../../icon/Icon.js";
4
4
  function u({
5
- children: t,
5
+ children: n,
6
6
  header: o,
7
- ...n
7
+ ...t
8
8
  }) {
9
9
  return /* @__PURE__ */ r(
10
- c,
10
+ i,
11
11
  {
12
- ...n,
12
+ ...t,
13
13
  className: "uy:flex uy:items-center uy:gap-50",
14
14
  onPress: () => {
15
15
  o.column.getCanSort() && o.column.toggleSorting();
16
16
  },
17
17
  children: ({ isHovered: e }) => {
18
- const l = o.column.getCanSort() && (o.column.getIsSorted() || e);
19
- return /* @__PURE__ */ m(s, { children: [
20
- t,
21
- l && /* @__PURE__ */ r(
22
- i,
18
+ const s = o.column.getCanSort() && (o.column.getIsSorted() || e);
19
+ return /* @__PURE__ */ l(c, { children: [
20
+ n,
21
+ s ? /* @__PURE__ */ r(
22
+ m,
23
23
  {
24
24
  src: o.column.getIsSorted() === "asc" ? "ArrowUpOutlined" : "ArrowDownOutlined",
25
25
  role: "presentation",
26
26
  size: 20
27
27
  }
28
- )
28
+ ) : /* @__PURE__ */ r("span", { "aria-hidden": "true", className: "uy:size-250 uy:block" })
29
29
  ] });
30
30
  }
31
31
  }
@@ -1,19 +1,19 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
2
  import { useRef as i, useState as A, useCallback as R } from "react";
3
3
  import { useHotkeys as u } from "react-hotkeys-hook";
4
- import { ActionBar as p } from "../../action-bar/ActionBar.js";
5
- import { ActionBarAction as w } from "../../action-bar/parts/ActionBarAction.js";
4
+ import { ActionBar as S } from "../../action-bar/ActionBar.js";
5
+ import { ActionBarAction as p } from "../../action-bar/parts/ActionBarAction.js";
6
6
  import { ActionBarRoot as B } from "../../action-bar/parts/ActionBarRoot.js";
7
- function k({
7
+ function b({
8
8
  table: e,
9
- actions: n
9
+ actions: s
10
10
  }) {
11
- const s = i(null), r = i(null), [a, t] = A(!1), f = e.getState().rowSelection;
12
- Object.keys(f).sort().join(","), u(
11
+ const n = i(null), r = i(null), [a, t] = A(!1);
12
+ u(
13
13
  "f6",
14
14
  () => {
15
- if ((e.getIsAllPageRowsSelected() || e.getIsSomePageRowsSelected()) && n && s.current) {
16
- const l = s.current.querySelectorAll(
15
+ if ((e.getIsAllPageRowsSelected() || e.getIsSomePageRowsSelected()) && s && n.current) {
16
+ const l = n.current.querySelectorAll(
17
17
  'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
18
18
  );
19
19
  r.current = document.activeElement, l.length > 0 && (l[0].focus(), t(!0));
@@ -31,21 +31,21 @@ function k({
31
31
  enableOnFormTags: !0
32
32
  }
33
33
  );
34
- const m = e.getIsAllPageRowsSelected() || e.getIsSomePageRowsSelected(), d = e.getSelectedRowModel().rows.length, g = e.getPageCount() > 1, S = R(() => {
34
+ const f = e.getIsAllPageRowsSelected() || e.getIsSomePageRowsSelected(), m = e.getSelectedRowModel().rows.length, d = e.getPageCount() > 0, g = R(() => {
35
35
  e.resetRowSelection();
36
36
  }, [e]);
37
- return n ? /* @__PURE__ */ c(
37
+ return s ? /* @__PURE__ */ c(
38
38
  B,
39
39
  {
40
- isVisible: m,
41
- offsetBottom: g ? "$600" : 0,
40
+ isVisible: f,
41
+ offsetBottom: d ? "$600" : 0,
42
42
  children: /* @__PURE__ */ c(
43
- p,
43
+ S,
44
44
  {
45
- ref: s,
46
- actions: n,
47
- selectionCount: d,
48
- onClearSelection: S,
45
+ ref: n,
46
+ actions: s,
47
+ selectionCount: m,
48
+ onClearSelection: g,
49
49
  onFocus: () => {
50
50
  t(!0);
51
51
  },
@@ -53,13 +53,13 @@ function k({
53
53
  t(!1);
54
54
  },
55
55
  "aria-keyshortcuts": "f6",
56
- children: (o) => /* @__PURE__ */ c(w, { ...o, children: o.label }, o.id)
56
+ children: (o) => /* @__PURE__ */ c(p, { ...o, children: o.label }, o.id)
57
57
  }
58
58
  )
59
59
  }
60
60
  ) : null;
61
61
  }
62
- k.displayName = "DataTableBulkActions";
62
+ b.displayName = "DataTableBulkActions";
63
63
  export {
64
- k as DataTableBulkActions
64
+ b as DataTableBulkActions
65
65
  };