@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.
- package/dist/esm/adapters/standardSchemaAdapter.d.ts +7 -0
- package/dist/esm/adapters/standardSchemaAdapter.js +20 -0
- package/dist/esm/adapters/zodAdapter.d.ts +13 -0
- package/dist/esm/adapters/zodAdapter.js +74 -0
- package/dist/esm/components/action-bar/ActionBar.js +62 -64
- package/dist/esm/components/actionable/Actionable.d.ts +50 -3
- package/dist/esm/components/actionable/Actionable.js +49 -39
- package/dist/esm/components/app-menu/parts/AppMenuFooter.js +63 -63
- package/dist/esm/components/autocomplete/parts/AutocompleteClearButton.js +5 -5
- package/dist/esm/components/bottom-sheet/parts/BottomSheetDragIndicator.js +30 -31
- package/dist/esm/components/checkbox-field/CheckboxField.d.ts +2 -2
- package/dist/esm/components/checkbox-field/CheckboxField.js +18 -17
- package/dist/esm/components/checkbox-group-field/CheckboxGroupField.d.ts +2 -2
- package/dist/esm/components/checkbox-group-field/CheckboxGroupField.js +4 -1
- package/dist/esm/components/code/Code.d.ts +37 -0
- package/dist/esm/components/code/Code.js +39 -0
- package/dist/esm/components/code/copyToClipboard.d.ts +1 -0
- package/dist/esm/components/code/copyToClipboard.js +10 -0
- package/dist/esm/components/collapsible/Collapsible.d.ts +1 -1
- package/dist/esm/components/collapsible/Collapsible.js +14 -13
- package/dist/esm/components/collapsible/parts/CollapsibleTitle.js +7 -7
- package/dist/esm/components/data-table/DataTable.d.ts +76 -10
- package/dist/esm/components/data-table/DataTable.js +81 -78
- package/dist/esm/components/data-table/parts/ColumnSortHeader.js +13 -13
- package/dist/esm/components/data-table/parts/DataTableBulkActions.js +20 -20
- package/dist/esm/components/date-calendar/DateCalendar.js +52 -52
- package/dist/esm/components/date-calendar/parts/DateSegmentSelect.js +30 -33
- package/dist/esm/components/date-picker/DatePicker.js +64 -64
- package/dist/esm/components/date-picker/parts/DateInput.js +33 -33
- package/dist/esm/components/date-picker-field/DatePickerField.d.ts +2 -2
- package/dist/esm/components/dialog/parts/DialogActions/DialogButton.js +12 -12
- package/dist/esm/components/error-state/ErrorState.d.ts +196 -0
- package/dist/esm/components/error-state/ErrorState.js +153 -0
- package/dist/esm/components/error-state/initConfig.d.ts +16 -0
- package/dist/esm/components/error-state/initConfig.js +149 -0
- package/dist/esm/components/error-state/parts/Collapsible.d.ts +59 -0
- package/dist/esm/components/error-state/parts/Collapsible.js +67 -0
- package/dist/esm/components/form/Form.d.ts +15 -9
- package/dist/esm/components/form/Form.js +53 -50
- package/dist/esm/components/form-field/FormField.js +24 -23
- package/dist/esm/components/form-field/utils/isFieldRequired.d.ts +4 -4
- package/dist/esm/components/form-field/utils/isFieldRequired.js +5 -20
- package/dist/esm/components/funnel-layout/FunnelLayout.d.ts +1 -1
- package/dist/esm/components/funnel-layout/FunnelLayout.js +61 -110
- package/dist/esm/components/funnel-layout/parts/FunnelPage.js +8 -9
- package/dist/esm/components/funnel-layout/parts/FunnelPageActions.js +24 -24
- package/dist/esm/components/funnel-layout/parts/FunnelPageFooter.js +6 -7
- package/dist/esm/components/funnel-layout/parts/FunnelPageHeader.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.js +9 -10
- package/dist/esm/components/funnel-layout/parts/FunnelTopBar.js +0 -1
- package/dist/esm/components/input/Input.js +28 -28
- package/dist/esm/components/label/Label.js +19 -19
- package/dist/esm/components/multi-select/MultiSelect.js +94 -94
- package/dist/esm/components/multi-select/hooks/use-multiselection-state.js +32 -32
- package/dist/esm/components/multi-select/parts/MultiSelectButton.js +38 -38
- package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +16 -16
- package/dist/esm/components/multi-select-field/MultiSelectField.d.ts +2 -2
- package/dist/esm/components/multi-select-field/MultiSelectField.js +53 -53
- package/dist/esm/components/nav/parts/NavGroup.js +21 -21
- package/dist/esm/components/number-field/NumberField.d.ts +3 -3
- package/dist/esm/components/number-input/NumberInput.js +58 -58
- package/dist/esm/components/pagination/Pagination.js +97 -101
- package/dist/esm/components/pagination/parts/PaginationJumpDialog.js +39 -40
- package/dist/esm/components/popover/parts/PopoverHeader.js +8 -8
- package/dist/esm/components/radio-button-group/parts/RadioButton.js +11 -11
- package/dist/esm/components/select-field/SelectField.d.ts +2 -2
- package/dist/esm/components/select-field/SelectField.js +4 -1
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.js +22 -23
- package/dist/esm/components/selectable-button-group-field/SelectableButtonGroupField.d.ts +2 -2
- package/dist/esm/components/side-panel/parts/SidePanelDragIndicator.js +30 -31
- package/dist/esm/components/skip-links/SkipLinks.js +50 -43
- package/dist/esm/components/table/Table.js +79 -76
- package/dist/esm/components/table/parts/TableBody.js +6 -6
- package/dist/esm/components/table/parts/TableCell.js +25 -25
- package/dist/esm/components/table/parts/TableColumnHeader.js +38 -38
- package/dist/esm/components/table/parts/TablePagination.js +61 -59
- package/dist/esm/components/table/parts/TableRow.js +16 -16
- package/dist/esm/components/tabs/parts/TabList.js +50 -54
- package/dist/esm/components/task-menu/parts/Content.js +24 -24
- package/dist/esm/components/task-menu/parts/Header.js +24 -24
- package/dist/esm/components/task-menu/parts/SubTask.js +74 -74
- package/dist/esm/components/task-menu/parts/Task.js +69 -69
- package/dist/esm/components/task-menu/parts/TaskGroup.js +45 -45
- package/dist/esm/components/text-area/TextArea.js +30 -31
- package/dist/esm/components/text-field/TextField.d.ts +2 -2
- package/dist/esm/components/toggle-switch-field/ToggleSwitchField.d.ts +2 -2
- package/dist/esm/components/toggle-switch-field/ToggleSwitchField.js +4 -1
- package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.js +74 -74
- package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.d.ts +2 -2
- package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.js +36 -32
- package/dist/esm/hooks/use-form.d.ts +5 -5
- package/dist/esm/hooks/use-form.types.d.ts +2 -2
- package/dist/esm/hooks/use-resizable.js +13 -14
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +22 -19
- package/dist/esm/types/schema.d.ts +8 -0
- package/dist/esm/utils/createSchemaAdapter.d.ts +7 -0
- package/dist/esm/utils/createSchemaAdapter.js +13 -0
- package/dist/esm/utils/platform.js +2 -3
- package/i18n/en-GB.json +16 -0
- package/i18n/es-ES.json +16 -0
- package/i18n/fr-FR.json +16 -0
- 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
|
|
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:
|
|
31
|
-
const
|
|
32
|
-
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", ...
|
|
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(
|
|
44
|
-
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Optional loading state
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
27
43
|
isLoading?: boolean;
|
|
28
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Optional error state
|
|
46
|
+
* @default null
|
|
47
|
+
*/
|
|
29
48
|
error?: Error | null;
|
|
30
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { flexRender as
|
|
4
|
-
import { useId as
|
|
5
|
-
import { CircularIconButton as
|
|
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
|
|
8
|
-
import { TableEmptyStateLoading as
|
|
9
|
-
import { TableHeader as
|
|
10
|
-
import { TablePagination as
|
|
11
|
-
import { TableRoot as
|
|
12
|
-
import { ColumnSortHeader as
|
|
13
|
-
const
|
|
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:
|
|
16
|
-
helperText:
|
|
17
|
-
}) =>
|
|
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
|
-
|
|
20
|
+
N,
|
|
21
21
|
{
|
|
22
|
-
"aria-labelledby":
|
|
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:
|
|
25
|
+
title: r,
|
|
26
26
|
color: "content.neutral.low"
|
|
27
27
|
}
|
|
28
28
|
)
|
|
29
|
-
] }) : /* @__PURE__ */ e(
|
|
30
|
-
function
|
|
29
|
+
] }) : /* @__PURE__ */ e(E, { children: o });
|
|
30
|
+
function k({
|
|
31
31
|
table: o,
|
|
32
|
-
isLoading:
|
|
33
|
-
error:
|
|
34
|
-
emptyState:
|
|
35
|
-
loadingState:
|
|
36
|
-
errorState:
|
|
37
|
-
pagination:
|
|
38
|
-
minRows:
|
|
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
|
-
|
|
41
|
-
|
|
40
|
+
onPageChange: S,
|
|
41
|
+
onPageHover: x,
|
|
42
|
+
onPageSizeChange: w,
|
|
43
|
+
children: y,
|
|
44
|
+
...i
|
|
42
45
|
}) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
66
|
+
M,
|
|
67
67
|
{
|
|
68
|
-
isFocusable:
|
|
69
|
-
children: o.getRowModel().rows.length > 0 && t.column.getCanSort() ? /* @__PURE__ */ e(
|
|
70
|
-
|
|
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:
|
|
73
|
-
helperText:
|
|
74
|
-
children: /* @__PURE__ */ e("span", { id:
|
|
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
|
-
|
|
80
|
+
b,
|
|
81
81
|
{
|
|
82
|
-
columnNameId:
|
|
83
|
-
helperText:
|
|
84
|
-
children: /* @__PURE__ */ e("span", { id:
|
|
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:
|
|
99
|
-
renderDataState:
|
|
100
|
-
children: !
|
|
98
|
+
renderEmptyState: v,
|
|
99
|
+
renderDataState: d,
|
|
100
|
+
children: !a && !r && o.getRowModel().rows.map(y)
|
|
101
101
|
}
|
|
102
102
|
)
|
|
103
103
|
] }),
|
|
104
|
-
o.getPageCount() >
|
|
105
|
-
|
|
104
|
+
o.getPageCount() > 0 && /* @__PURE__ */ e(
|
|
105
|
+
G,
|
|
106
106
|
{
|
|
107
107
|
pageCount: o.getPageCount(),
|
|
108
|
-
rowCount: o.
|
|
109
|
-
currentPage:
|
|
110
|
-
rowsPerPage:
|
|
111
|
-
pageSizeOptions:
|
|
112
|
-
onPageChange: (
|
|
113
|
-
o.setPageIndex(
|
|
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
|
-
|
|
116
|
-
|
|
115
|
+
onPageHover: (n) => {
|
|
116
|
+
x?.(n);
|
|
117
117
|
},
|
|
118
|
-
|
|
118
|
+
onPageSizeChange: (n) => {
|
|
119
|
+
o.setPageSize(n), w?.(n);
|
|
120
|
+
},
|
|
121
|
+
itemLabel: c?.labels?.itemLabel
|
|
119
122
|
}
|
|
120
123
|
)
|
|
121
124
|
] });
|
|
122
125
|
}
|
|
123
|
-
|
|
126
|
+
k.displayName = "DataTable";
|
|
124
127
|
export {
|
|
125
|
-
|
|
128
|
+
k as DataTable
|
|
126
129
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { Actionable as
|
|
3
|
-
import { Icon as
|
|
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:
|
|
5
|
+
children: n,
|
|
6
6
|
header: o,
|
|
7
|
-
...
|
|
7
|
+
...t
|
|
8
8
|
}) {
|
|
9
9
|
return /* @__PURE__ */ r(
|
|
10
|
-
|
|
10
|
+
i,
|
|
11
11
|
{
|
|
12
|
-
...
|
|
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
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
|
5
|
-
import { ActionBarAction as
|
|
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
|
|
7
|
+
function b({
|
|
8
8
|
table: e,
|
|
9
|
-
actions:
|
|
9
|
+
actions: s
|
|
10
10
|
}) {
|
|
11
|
-
const
|
|
12
|
-
|
|
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()) &&
|
|
16
|
-
const l =
|
|
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
|
|
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
|
|
37
|
+
return s ? /* @__PURE__ */ c(
|
|
38
38
|
B,
|
|
39
39
|
{
|
|
40
|
-
isVisible:
|
|
41
|
-
offsetBottom:
|
|
40
|
+
isVisible: f,
|
|
41
|
+
offsetBottom: d ? "$600" : 0,
|
|
42
42
|
children: /* @__PURE__ */ c(
|
|
43
|
-
|
|
43
|
+
S,
|
|
44
44
|
{
|
|
45
|
-
ref:
|
|
46
|
-
actions:
|
|
47
|
-
selectionCount:
|
|
48
|
-
onClearSelection:
|
|
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(
|
|
56
|
+
children: (o) => /* @__PURE__ */ c(p, { ...o, children: o.label }, o.id)
|
|
57
57
|
}
|
|
58
58
|
)
|
|
59
59
|
}
|
|
60
60
|
) : null;
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
b.displayName = "DataTableBulkActions";
|
|
63
63
|
export {
|
|
64
|
-
|
|
64
|
+
b as DataTableBulkActions
|
|
65
65
|
};
|