@servicetitan/anvil2 1.46.8 → 1.46.10
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/CHANGELOG.md +16 -0
- package/dist/{AnvilProvider-C_qRQnE6.js → AnvilProvider-DkHInQRh.js} +2 -2
- package/dist/{AnvilProvider-C_qRQnE6.js.map → AnvilProvider-DkHInQRh.js.map} +1 -1
- package/dist/AnvilProvider.js +1 -1
- package/dist/{Calendar-BqOvsaby.js → Calendar-DaVJ96Hp.js} +68 -30
- package/dist/Calendar-DaVJ96Hp.js.map +1 -0
- package/dist/Calendar.css +64 -48
- package/dist/Calendar.d.ts +3 -3
- package/dist/Calendar.js +9 -1
- package/dist/Calendar.js.map +1 -1
- package/dist/{Checkbox-DAODkzN3.js → Checkbox-B5VTqylq.js} +2 -2
- package/dist/{Checkbox-DAODkzN3.js.map → Checkbox-B5VTqylq.js.map} +1 -1
- package/dist/{Checkbox-C5PX8wur.js → Checkbox-Dv01A09v.js} +2 -2
- package/dist/{Checkbox-C5PX8wur.js.map → Checkbox-Dv01A09v.js.map} +1 -1
- package/dist/Checkbox.js +2 -2
- package/dist/{Combobox-BIBYdOCc.js → Combobox-C9-VQHxv.js} +18 -18
- package/dist/{Combobox-BIBYdOCc.js.map → Combobox-C9-VQHxv.js.map} +1 -1
- package/dist/Combobox.js +1 -1
- package/dist/DataTable-B17y3l8v.js +5640 -0
- package/dist/DataTable-B17y3l8v.js.map +1 -0
- package/dist/DataTable.css +648 -0
- package/dist/{DateField-BLLbVZBF.js → DateField-CKI7Zk4E.js} +5 -5
- package/dist/{DateField-BLLbVZBF.js.map → DateField-CKI7Zk4E.js.map} +1 -1
- package/dist/DateField.js +1 -1
- package/dist/{DateFieldRange-BYwuTSkT.js → DateFieldRange-DIycPI0Y.js} +64 -64
- package/dist/{DateFieldRange-BYwuTSkT.js.map → DateFieldRange-DIycPI0Y.js.map} +1 -1
- package/dist/DateFieldRange.js +1 -1
- package/dist/{DateFieldSingle-B70fKeo-.js → DateFieldSingle-BdkVUPvB.js} +6 -6
- package/dist/{DateFieldSingle-B70fKeo-.js.map → DateFieldSingle-BdkVUPvB.js.map} +1 -1
- package/dist/DateFieldSingle.js +1 -1
- package/dist/{DateFieldYearless-BmeKGaDc.js → DateFieldYearless-DvbW4vgm.js} +2 -2
- package/dist/{DateFieldYearless-BmeKGaDc.js.map → DateFieldYearless-DvbW4vgm.js.map} +1 -1
- package/dist/DateFieldYearless.js +1 -1
- package/dist/{DaysOfTheWeek-CvWu1j6-.js → DaysOfTheWeek-BcyYG7dD.js} +3 -3
- package/dist/{DaysOfTheWeek-CvWu1j6-.js.map → DaysOfTheWeek-BcyYG7dD.js.map} +1 -1
- package/dist/DaysOfTheWeek.js +1 -1
- package/dist/{Dialog-D3aUlrNr.js → Dialog-BLFx4TRs.js} +2 -2
- package/dist/{Dialog-D3aUlrNr.js.map → Dialog-BLFx4TRs.js.map} +1 -1
- package/dist/Dialog.js +1 -1
- package/dist/{Drawer-yG7C8Owv.js → Drawer-DPM-jPb7.js} +2 -2
- package/dist/{Drawer-yG7C8Owv.js.map → Drawer-DPM-jPb7.js.map} +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/{FieldLabel-Bgl3iu13.js → FieldLabel-C6XZKglC.js} +2 -2
- package/dist/{FieldLabel-Bgl3iu13.js.map → FieldLabel-C6XZKglC.js.map} +1 -1
- package/dist/FieldLabel.js +1 -1
- package/dist/{InputMask-B13KumrK.js → InputMask-DkNgXdFO.js} +2 -2
- package/dist/{InputMask-B13KumrK.js.map → InputMask-DkNgXdFO.js.map} +1 -1
- package/dist/InputMask.js +1 -1
- package/dist/{ListView-C-cVQZHp.js → ListView-DYKwVASE.js} +6 -6
- package/dist/{ListView-C-cVQZHp.js.map → ListView-DYKwVASE.js.map} +1 -1
- package/dist/ListView.js +1 -1
- package/dist/{ListView.module-MVsNF0X0.js → ListView.module-BilDg12y.js} +3 -3
- package/dist/ListView.module-BilDg12y.js.map +1 -0
- package/dist/{Listbox-DxGx630W.js → Listbox-CWi30Cwg.js} +9 -9
- package/dist/{Listbox-DxGx630W.js.map → Listbox-CWi30Cwg.js.map} +1 -1
- package/dist/Listbox.js +1 -1
- package/dist/{Listbox.module-DcBE8Zmo.js → Listbox.module-XuKszT3X.js} +3 -3
- package/dist/Listbox.module-XuKszT3X.js.map +1 -0
- package/dist/{Menu-BlHuE7TM.js → Menu-D22YbM7y.js} +3 -2
- package/dist/{Menu-BlHuE7TM.js.map → Menu-D22YbM7y.js.map} +1 -1
- package/dist/Menu.js +1 -1
- package/dist/{NumberField-DDjOcEFm.js → NumberField-B1hQ8jRn.js} +12 -12
- package/dist/{NumberField-DDjOcEFm.js.map → NumberField-B1hQ8jRn.js.map} +1 -1
- package/dist/NumberField.js +1 -1
- package/dist/{Page-DRSFpDAb.js → Page-DwBcDxi2.js} +5 -5
- package/dist/{Page-DRSFpDAb.js.map → Page-DwBcDxi2.js.map} +1 -1
- package/dist/Page.js +1 -1
- package/dist/{Pagination-UGCNBKo0.js → Pagination-B7uvkLb3.js} +2 -2
- package/dist/{Pagination-UGCNBKo0.js.map → Pagination-B7uvkLb3.js.map} +1 -1
- package/dist/Pagination.js +1 -1
- package/dist/{Popover-Du2PBdp1.js → Popover-BuhxFt5z.js} +2 -2
- package/dist/{Popover-Du2PBdp1.js.map → Popover-BuhxFt5z.js.map} +1 -1
- package/dist/Popover.js +1 -1
- package/dist/{ProgressBar-BwM_e5cP.js → ProgressBar-Bq8indkz.js} +2 -2
- package/dist/{ProgressBar-BwM_e5cP.js.map → ProgressBar-Bq8indkz.js.map} +1 -1
- package/dist/ProgressBar.js +1 -1
- package/dist/{Radio-C5riI-do.js → Radio-57ck6GTm.js} +2 -2
- package/dist/{Radio-C5riI-do.js.map → Radio-57ck6GTm.js.map} +1 -1
- package/dist/Radio.js +2 -2
- package/dist/{RadioGroup-B7O06pVu.js → RadioGroup-CcRLdoAl.js} +2 -2
- package/dist/{RadioGroup-B7O06pVu.js.map → RadioGroup-CcRLdoAl.js.map} +1 -1
- package/dist/{SearchField-CbwGErC4.js → SearchField-DqV9-0wR.js} +8 -8
- package/dist/{SearchField-CbwGErC4.js.map → SearchField-DqV9-0wR.js.map} +1 -1
- package/dist/SearchField.js +1 -1
- package/dist/{SelectCard-Ca07K1FW.js → SelectCard-dEhb5KAL.js} +3 -3
- package/dist/{SelectCard-Ca07K1FW.js.map → SelectCard-dEhb5KAL.js.map} +1 -1
- package/dist/SelectCard.js +1 -1
- package/dist/{SelectTrigger-CaXX1SHG.js → SelectTrigger-A96aYNm-.js} +2 -2
- package/dist/{SelectTrigger-CaXX1SHG.js.map → SelectTrigger-A96aYNm-.js.map} +1 -1
- package/dist/SelectTrigger.js +1 -1
- package/dist/{SelectTriggerBase-C7TLCna1.js → SelectTriggerBase-I4Qo37zM.js} +2 -2
- package/dist/{SelectTriggerBase-C7TLCna1.js.map → SelectTriggerBase-I4Qo37zM.js.map} +1 -1
- package/dist/Table.d.ts +2 -0
- package/dist/Table.js +2 -0
- package/dist/Table.js.map +1 -0
- package/dist/{TextField-D9gD-34Q.js → TextField-CP5kL2j7.js} +12 -12
- package/dist/{TextField-D9gD-34Q.js.map → TextField-CP5kL2j7.js.map} +1 -1
- package/dist/{TextField-uCHgwO5F.js → TextField-DLIaLKT1.js} +2 -2
- package/dist/{TextField-uCHgwO5F.js.map → TextField-DLIaLKT1.js.map} +1 -1
- package/dist/TextField.js +1 -1
- package/dist/{TextField.module-EkKlj66e.js → TextField.module-pD1felN8.js} +3 -3
- package/dist/TextField.module-pD1felN8.js.map +1 -0
- package/dist/{Textarea-B2-6m291.js → Textarea-Kb-RF4rR.js} +2 -2
- package/dist/{Textarea-B2-6m291.js.map → Textarea-Kb-RF4rR.js.map} +1 -1
- package/dist/Textarea.js +1 -1
- package/dist/{ThemeProvider-Be3Pvtpz.js → ThemeProvider-7X1D1GxO.js} +4 -4
- package/dist/{ThemeProvider-Be3Pvtpz.js.map → ThemeProvider-7X1D1GxO.js.map} +1 -1
- package/dist/ThemeProvider.css +96 -90
- package/dist/ThemeProvider.js +1 -1
- package/dist/{TimeField-CGg_yTaJ.js → TimeField-6OSTzIYV.js} +4 -4
- package/dist/{TimeField-CGg_yTaJ.js.map → TimeField-6OSTzIYV.js.map} +1 -1
- package/dist/TimeField.js +1 -1
- package/dist/Toast.js +2 -2
- package/dist/{Toaster-CH5FTmGv.js → Toaster-BVM24YZG.js} +2 -2
- package/dist/{Toaster-CH5FTmGv.js.map → Toaster-BVM24YZG.js.map} +1 -1
- package/dist/{Toaster-BKyvW8J8.js → Toaster-Du0zf4b-.js} +2 -2
- package/dist/{Toaster-BKyvW8J8.js.map → Toaster-Du0zf4b-.js.map} +1 -1
- package/dist/{Toolbar-CNgCvoy1.js → Toolbar-BGaVd-fy.js} +13 -13
- package/dist/{Toolbar-CNgCvoy1.js.map → Toolbar-BGaVd-fy.js.map} +1 -1
- package/dist/Toolbar.js +1 -1
- package/dist/{Tooltip-DhtVlhah.js → Tooltip-Dp9gWa2P.js} +3 -3
- package/dist/{Tooltip-DhtVlhah.js.map → Tooltip-Dp9gWa2P.js.map} +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/beta/components/Calendar/Calendar.d.ts +12 -0
- package/dist/beta/components/Calendar/CalendarBetaPropsContext.d.ts +2 -0
- package/dist/beta/components/Calendar/index.d.ts +2 -0
- package/dist/beta/components/Calendar/useCalendarBetaProps.d.ts +1 -0
- package/dist/beta/components/Table/DataTable/DataTable.d.ts +116 -0
- package/dist/beta/components/Table/DataTable/DataTable.test-data.d.ts +15 -0
- package/dist/beta/components/Table/DataTable/index.d.ts +1 -0
- package/dist/beta/components/Table/DataTable/internal/DataTableBody.d.ts +16 -0
- package/dist/beta/components/Table/DataTable/internal/DataTableContainer.d.ts +7 -0
- package/dist/beta/components/Table/DataTable/internal/DataTableContext.d.ts +26 -0
- package/dist/beta/components/Table/DataTable/internal/DataTableContextProvider.d.ts +28 -0
- package/dist/beta/components/Table/DataTable/internal/DataTableFooter.d.ts +48 -0
- package/dist/beta/components/Table/DataTable/internal/DataTableHeader.d.ts +17 -0
- package/dist/beta/components/Table/DataTable/internal/cells/DataTableBodyCell.d.ts +40 -0
- package/dist/beta/components/Table/DataTable/internal/cells/DataTableFooterCell.d.ts +18 -0
- package/dist/beta/components/Table/DataTable/internal/cells/DataTableHeaderCell.d.ts +21 -0
- package/dist/beta/components/Table/DataTable/internal/editable-cells/DataTableEditableCellEditIcon.d.ts +5 -0
- package/dist/beta/components/Table/DataTable/internal/editable-cells/DataTableEditableMultiselectCell.d.ts +26 -0
- package/dist/beta/components/Table/DataTable/internal/editable-cells/DataTableEditableSelectCell.d.ts +26 -0
- package/dist/beta/components/Table/DataTable/internal/editable-cells/DataTableEditableTextCell.d.ts +17 -0
- package/dist/beta/components/Table/DataTable/internal/editable-cells/types.d.ts +50 -0
- package/dist/beta/components/Table/DataTable/internal/editable-cells/useEditCell.d.ts +11 -0
- package/dist/beta/components/Table/DataTable/stories/DataTable.story-data.d.ts +27 -0
- package/dist/beta/components/Table/base/TableBase.d.ts +43 -0
- package/dist/beta/components/Table/base/TableBody.d.ts +25 -0
- package/dist/beta/components/Table/base/TableContainer.d.ts +28 -0
- package/dist/beta/components/Table/base/TableFooter.d.ts +25 -0
- package/dist/beta/components/Table/base/TableHeader.d.ts +25 -0
- package/dist/beta/components/Table/base/cells/TableBodyCell.d.ts +27 -0
- package/dist/beta/components/Table/base/cells/TableEmptyCellContent.d.ts +4 -0
- package/dist/beta/components/Table/base/cells/TableFooterCell.d.ts +30 -0
- package/dist/beta/components/Table/base/cells/TableHeaderCell.d.ts +40 -0
- package/dist/beta/components/Table/base/cells/types.d.ts +10 -0
- package/dist/beta/components/Table/createColumnHelper.d.ts +25 -0
- package/dist/beta/components/Table/formatters/chipsFormatter.d.ts +21 -0
- package/dist/beta/components/Table/formatters/currencyFormatter.d.ts +22 -0
- package/dist/beta/components/Table/formatters/index.d.ts +3 -0
- package/dist/beta/components/Table/formatters/percentFormatter.d.ts +22 -0
- package/dist/beta/components/Table/index.d.ts +3 -0
- package/dist/beta/components/Table/internal/ResizeHandle.d.ts +14 -0
- package/dist/beta/components/Table/internal/TruncateChips.d.ts +30 -0
- package/dist/beta/components/Table/internal/focus-management/types.d.ts +34 -0
- package/dist/beta/components/Table/internal/focus-management/useColumnOrder.d.ts +10 -0
- package/dist/beta/components/Table/internal/focus-management/useFocusManagement.d.ts +27 -0
- package/dist/beta/components/Table/internal/focus-management/useHandleKeyDown.d.ts +36 -0
- package/dist/beta/components/Table/internal/focus-management/useScrollIntoView.d.ts +9 -0
- package/dist/beta/components/Table/internal/getColSpanWidth.d.ts +7 -0
- package/dist/beta/components/Table/internal/getCommonPinningClasses.d.ts +5 -0
- package/dist/beta/components/Table/internal/getCommonPinningStyles.d.ts +6 -0
- package/dist/beta/components/Table/internal/getTanStackColumnDef.d.ts +24 -0
- package/dist/beta/components/Table/types.d.ts +97 -0
- package/dist/beta/components/index.d.ts +2 -0
- package/dist/beta.js +3 -1
- package/dist/beta.js.map +1 -1
- package/dist/components/Calendar/CalendarContext.d.ts +4 -0
- package/dist/components/Calendar/internal/utils.d.ts +1 -0
- package/dist/components/Menu/types.d.ts +2 -1
- package/dist/index.js +37 -37
- package/dist/token/core/raw.js +78 -73
- package/dist/token/core/semantic-variables.scss +92 -86
- package/dist/token/core/semantic.js +80 -59
- package/dist/token/core/semantic.scss +46 -43
- package/dist/token.js +126 -102
- package/dist/token.js.map +1 -1
- package/dist/{utils-Dh3aegV3.js → utils-CEgTTa9_.js} +2 -2
- package/dist/{utils-Dh3aegV3.js.map → utils-CEgTTa9_.js.map} +1 -1
- package/package.json +5 -4
- package/dist/Calendar-BqOvsaby.js.map +0 -1
- package/dist/ListView.module-MVsNF0X0.js.map +0 -1
- package/dist/Listbox.module-DcBE8Zmo.js.map +0 -1
- package/dist/TextField.module-EkKlj66e.js.map +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Header } from '@tanstack/react-table';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the ResizeHandle component
|
|
4
|
+
* @extends Header<T, unknown>
|
|
5
|
+
*/
|
|
6
|
+
export type ResizeHandleProps<T> = {
|
|
7
|
+
header: Header<T, unknown>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Resize handle component resizing table columns
|
|
11
|
+
* @param props - The props for the ResizeHandle component
|
|
12
|
+
* @param props.header - The header of the ResizeHandle component
|
|
13
|
+
*/
|
|
14
|
+
export declare function ResizeHandle<T>({ header }: ResizeHandleProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { ChipProps } from '../../../../components/Chip';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the TruncateChips component
|
|
5
|
+
*/
|
|
6
|
+
export type TruncateChipsProps = ComponentPropsWithoutRef<"div"> & {
|
|
7
|
+
/**
|
|
8
|
+
* Array of chip items to display
|
|
9
|
+
*/
|
|
10
|
+
items: ChipProps[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Optimized TruncateChips component using measurement-based calculation.
|
|
14
|
+
*
|
|
15
|
+
* Features:
|
|
16
|
+
* - Uses visible measurement chips to determine actual layout
|
|
17
|
+
* - Responsive to container width changes
|
|
18
|
+
* - Supports custom gap between chips
|
|
19
|
+
* - Clean, predictable behavior
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* <TruncateChips
|
|
23
|
+
* items={[
|
|
24
|
+
* { label: "React", onClose: () => {} },
|
|
25
|
+
* { label: "TypeScript", onClose: () => {} },
|
|
26
|
+
* { label: "JavaScript", onClose: () => {} }
|
|
27
|
+
* ]}
|
|
28
|
+
* />
|
|
29
|
+
*/
|
|
30
|
+
export declare const TruncateChips: ({ items, className, ...rest }: TruncateChipsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The position of a cell in the table
|
|
3
|
+
*/
|
|
4
|
+
export type CellPosition = {
|
|
5
|
+
/**
|
|
6
|
+
* The row index of the cell
|
|
7
|
+
*/
|
|
8
|
+
rowIndex: number;
|
|
9
|
+
/**
|
|
10
|
+
* The column index of the cell
|
|
11
|
+
*/
|
|
12
|
+
columnIndex: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Configuration options for a cell that can be focused
|
|
16
|
+
*/
|
|
17
|
+
export type FocusableCell = {
|
|
18
|
+
/**
|
|
19
|
+
* The position of the cell
|
|
20
|
+
*/
|
|
21
|
+
position: CellPosition;
|
|
22
|
+
/**
|
|
23
|
+
* The element of the cell
|
|
24
|
+
*/
|
|
25
|
+
element: HTMLElement;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the cell is a header cell
|
|
28
|
+
*/
|
|
29
|
+
isHeader?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The sorting handler for the cell
|
|
32
|
+
*/
|
|
33
|
+
sortingHandler?: (event: React.KeyboardEvent | React.MouseEvent) => void;
|
|
34
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Table as TanstackTable } from '@tanstack/react-table';
|
|
2
|
+
/**
|
|
3
|
+
* Hook to analyze the columns in the table to determine the visual position and pinning status
|
|
4
|
+
* @param table - The table to analyze
|
|
5
|
+
*/
|
|
6
|
+
export declare const useColumnOrder: <T>({ table }: {
|
|
7
|
+
table: TanstackTable<T>;
|
|
8
|
+
}) => {
|
|
9
|
+
columnOrder: number[];
|
|
10
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Table as TanstackTable } from '@tanstack/react-table';
|
|
2
|
+
import { CellPosition } from './types';
|
|
3
|
+
export type RegisterCellProps = {
|
|
4
|
+
position: CellPosition;
|
|
5
|
+
element: HTMLElement;
|
|
6
|
+
isHeader?: boolean;
|
|
7
|
+
sortingHandler?: (event: React.KeyboardEvent | React.MouseEvent) => void;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Hook to accessibly manage the focus state of a table
|
|
11
|
+
* @param table - The table to manage the focus of
|
|
12
|
+
* @param isExpandable - Whether the table supports row expansion
|
|
13
|
+
*/
|
|
14
|
+
export declare const useFocusManagement: <T>(table: TanstackTable<T>, isExpandable?: boolean) => {
|
|
15
|
+
focusedCell: CellPosition | null;
|
|
16
|
+
isTableFocused: boolean;
|
|
17
|
+
tableRef: import('react').RefObject<HTMLDivElement>;
|
|
18
|
+
registerCell: ({ position, element, isHeader, sortingHandler, }: RegisterCellProps) => void;
|
|
19
|
+
unregisterCell: (position: CellPosition) => void;
|
|
20
|
+
handleKeyDown: (event: React.KeyboardEvent) => void;
|
|
21
|
+
initializeFocus: () => void;
|
|
22
|
+
handleTableBlur: () => void;
|
|
23
|
+
getCellTabIndex: (position: CellPosition) => number;
|
|
24
|
+
focusCell: (position: CellPosition) => void;
|
|
25
|
+
isOffGridInteractionOccurring: boolean;
|
|
26
|
+
setIsOffGridInteractionOccurring: import('react').Dispatch<import('react').SetStateAction<boolean>>;
|
|
27
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
import { Table as TanstackTable } from '@tanstack/react-table';
|
|
3
|
+
import { CellPosition, FocusableCell } from './types';
|
|
4
|
+
export type UseHandleKeyDownProps<T> = {
|
|
5
|
+
isTableFocused: boolean;
|
|
6
|
+
focusedCell: CellPosition | null;
|
|
7
|
+
getCellKey: (position: CellPosition) => string;
|
|
8
|
+
cellRefs: MutableRefObject<Map<string, FocusableCell>>;
|
|
9
|
+
getSingleFocusableInCell: (cellElement: HTMLElement) => HTMLElement | null;
|
|
10
|
+
setIsTableFocused: (focused: boolean) => void;
|
|
11
|
+
setFocusedCell: (position: CellPosition | null) => void;
|
|
12
|
+
columnOrder: number[];
|
|
13
|
+
focusCell: (position: CellPosition) => void;
|
|
14
|
+
getNextValidPosition: (currentPosition: CellPosition, direction: "up" | "down" | "left" | "right") => CellPosition | null;
|
|
15
|
+
table: TanstackTable<T>;
|
|
16
|
+
isExpandable: boolean;
|
|
17
|
+
isOffGridInteractionOccurring: boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Hook to handle keyboard events for the table
|
|
21
|
+
* @param isTableFocused - Whether the table is focused
|
|
22
|
+
* @param focusedCell - The currently focused cell
|
|
23
|
+
* @param getCellKey - A function to get the key for a cell
|
|
24
|
+
* @param cellRefs - A reference to the cells in the table
|
|
25
|
+
* @param getSingleFocusableInCell - A function to get the single focusable in a cell
|
|
26
|
+
* @param setIsTableFocused - A function to set the table focused state
|
|
27
|
+
* @param setFocusedCell - A function to set the focused cell
|
|
28
|
+
* @param getAccessibleColumnOrder - A function to get the accessible column order
|
|
29
|
+
* @param focusCell - A function to focus a cell
|
|
30
|
+
* @param getNextValidPosition - A function to get the next valid position
|
|
31
|
+
* @param table - The TanStack table instance
|
|
32
|
+
* @param isExpandable - Whether the table supports row expansion
|
|
33
|
+
*/
|
|
34
|
+
export declare const useHandleKeyDown: <T>({ isTableFocused, focusedCell, getCellKey, cellRefs, getSingleFocusableInCell, setIsTableFocused, setFocusedCell, columnOrder, focusCell, getNextValidPosition, table, isExpandable, isOffGridInteractionOccurring, }: UseHandleKeyDownProps<T>) => {
|
|
35
|
+
handleKeyDown: (event: React.KeyboardEvent) => void;
|
|
36
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Table as TanstackTable } from '@tanstack/react-table';
|
|
2
|
+
/**
|
|
3
|
+
* Hook to scroll an table cell into view when using keyboard navigation
|
|
4
|
+
* @param table - The table to scroll into view
|
|
5
|
+
*/
|
|
6
|
+
export declare const useScrollIntoView: <T>({ table, element, }: {
|
|
7
|
+
table: TanstackTable<T>;
|
|
8
|
+
element?: HTMLElement;
|
|
9
|
+
}) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the width of a column with a colspan greater than 1
|
|
3
|
+
* @param colSpan - The number of columns to span
|
|
4
|
+
* @param cellIndex - The index of the cell
|
|
5
|
+
* @returns The width of the column span
|
|
6
|
+
*/
|
|
7
|
+
export declare const getColSpanWidth: (colSpan: number, cellIndex: number) => string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ColumnDef as TanstackColumnDef } from '@tanstack/react-table';
|
|
2
|
+
import { ColumnDef } from '../types';
|
|
3
|
+
declare module "@tanstack/react-table" {
|
|
4
|
+
interface ColumnMeta<TData, TValue> {
|
|
5
|
+
editMode?: ColumnDef<TData>["editMode"];
|
|
6
|
+
onChange?: ColumnDef<TData>["onChange"];
|
|
7
|
+
options?: ColumnDef<TData>["options"];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Props for the getTanStackColumnDef function
|
|
12
|
+
* @extends ColumnDef<T>
|
|
13
|
+
*/
|
|
14
|
+
export type TanStackColumnDefProps<T> = {
|
|
15
|
+
columnDef: ColumnDef<T>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Build the column definition for TanStack useReactTable
|
|
19
|
+
* This allows for customized column definitions that maintain type safety
|
|
20
|
+
* @param props - The props for the getTanStackColumnDef function
|
|
21
|
+
* @param props.columnDef - The column definition for the TanStack useReactTable
|
|
22
|
+
* @returns The column definition for the TanStack useReactTable
|
|
23
|
+
*/
|
|
24
|
+
export declare function getTanStackColumnDef<T>({ columnDef, }: TanStackColumnDefProps<T>): TanstackColumnDef<T, any>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The type for a table row
|
|
4
|
+
* @extends T
|
|
5
|
+
*/
|
|
6
|
+
export type TableRow<T> = T & {
|
|
7
|
+
/**
|
|
8
|
+
* The id of the row
|
|
9
|
+
*/
|
|
10
|
+
id: string | number;
|
|
11
|
+
/**
|
|
12
|
+
* The sub component displayed when the row is expanded
|
|
13
|
+
*/
|
|
14
|
+
subComponent?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* The sub rows of the row when the row is expanded
|
|
17
|
+
*/
|
|
18
|
+
subRows?: TableRow<T>[];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Internal type for a column definition
|
|
22
|
+
* @extends T
|
|
23
|
+
*/
|
|
24
|
+
export type ColumnDef<T> = {
|
|
25
|
+
/**
|
|
26
|
+
* The id of the column
|
|
27
|
+
*/
|
|
28
|
+
id: keyof T;
|
|
29
|
+
/**
|
|
30
|
+
* The label of the header
|
|
31
|
+
*/
|
|
32
|
+
headerLabel: string;
|
|
33
|
+
/**
|
|
34
|
+
* The alignment of the header
|
|
35
|
+
*/
|
|
36
|
+
align?: "start" | "center" | "end";
|
|
37
|
+
/**
|
|
38
|
+
* Columns of a group column
|
|
39
|
+
*/
|
|
40
|
+
columns?: ColumnDef<T>[];
|
|
41
|
+
/**
|
|
42
|
+
* The edit mode of the cells in the column
|
|
43
|
+
*/
|
|
44
|
+
editMode?: "text" | "select" | "multiselect";
|
|
45
|
+
/**
|
|
46
|
+
* The content of the footer cell. An array will display multiple footer rows
|
|
47
|
+
*/
|
|
48
|
+
footerContent?: ReactNode | ReactNode[];
|
|
49
|
+
/**
|
|
50
|
+
* The maximum width of the column, in pixels
|
|
51
|
+
*/
|
|
52
|
+
maxWidth?: number;
|
|
53
|
+
/**
|
|
54
|
+
* The minimum width of the column, in pixels
|
|
55
|
+
*/
|
|
56
|
+
minWidth?: number;
|
|
57
|
+
/**
|
|
58
|
+
* The function to call when the value of an editable cell is saved
|
|
59
|
+
*/
|
|
60
|
+
onChange?: (value: T[keyof T], rowId: string) => void;
|
|
61
|
+
/**
|
|
62
|
+
* The options for the select or multiselect cells
|
|
63
|
+
*/
|
|
64
|
+
options?: {
|
|
65
|
+
value: T[keyof T];
|
|
66
|
+
label: string;
|
|
67
|
+
}[];
|
|
68
|
+
/**
|
|
69
|
+
* The pinning location of the column
|
|
70
|
+
*/
|
|
71
|
+
pinned?: "left" | "right";
|
|
72
|
+
/**
|
|
73
|
+
* The function to customize how the cell content is rendered
|
|
74
|
+
*/
|
|
75
|
+
renderCell?: (value: T[keyof T], rowDepth: number) => ReactNode;
|
|
76
|
+
/**
|
|
77
|
+
* Whether the column is resizable
|
|
78
|
+
*/
|
|
79
|
+
resizable?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Whether the column is sortable, or a function to customize the sorting logic
|
|
82
|
+
*/
|
|
83
|
+
sortable?: boolean | ((valueA: T[keyof T], valueB: T[keyof T]) => number);
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* The type for a custom table footer cell props
|
|
87
|
+
*/
|
|
88
|
+
export type CustomTableFooterCellProps = {
|
|
89
|
+
/**
|
|
90
|
+
* The content of the footer cell
|
|
91
|
+
*/
|
|
92
|
+
content: string;
|
|
93
|
+
/**
|
|
94
|
+
* The number of columns the footer cell should span
|
|
95
|
+
*/
|
|
96
|
+
colSpan: number;
|
|
97
|
+
};
|
package/dist/beta.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { D as DataTable, c as chipsFormatter, a as currencyFormatter, p as percentFormatter } from './DataTable-B17y3l8v.js';
|
|
2
|
+
export { T as Toolbar, a as ToolbarButton, c as ToolbarButtonLink, b as ToolbarButtonToggle, e as ToolbarControlGroup, g as ToolbarElement, f as ToolbarSearchField, d as ToolbarSelect } from './Toolbar-BGaVd-fy.js';
|
|
3
|
+
export { u as useCalendarBetaProps } from './Calendar-DaVJ96Hp.js';
|
|
2
4
|
//# sourceMappingURL=beta.js.map
|
package/dist/beta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beta.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"beta.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -91,6 +91,10 @@ type CalendarContextCommonProps = {
|
|
|
91
91
|
* Whether the calendar is controlled.
|
|
92
92
|
*/
|
|
93
93
|
controlled?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* The date metadata to determine if a date has a pip associated with it.
|
|
96
|
+
*/
|
|
97
|
+
dateMetadata?: Map<string, string>;
|
|
94
98
|
};
|
|
95
99
|
export type CalendarSingleContextProps = CalendarContextCommonProps & {
|
|
96
100
|
/**
|
|
@@ -10,3 +10,4 @@ export declare const isValidDate: (n: DateTime | undefined, minDate: string | un
|
|
|
10
10
|
export declare const normalizeDate: (date: string, defaultTimeZone: string) => DateTime<true> | DateTime<false>;
|
|
11
11
|
export declare const toDateString: (date: DateTime<boolean>) => string | null;
|
|
12
12
|
export declare function rangeUpdater(value: CalendarRangeContextProps["value"], newDate: DateTime, setValue: CalendarRangeContextProps["setValue"], onSelection: CalendarRangeContextProps["onSelection"]): void;
|
|
13
|
+
export declare const getDateMetadata: (date: DateTime, dateMetadata: Map<string, string> | undefined) => string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Placement, UseFloatingOptions } from '@floating-ui/react';
|
|
2
|
-
import { AriaAttributes, ReactElement, RefObject } from 'react';
|
|
2
|
+
import { AriaAttributes, KeyboardEvent, ReactElement, RefObject } from 'react';
|
|
3
3
|
export type MenuReturnProps = {
|
|
4
4
|
"data-open"?: boolean;
|
|
5
5
|
"aria-controls"?: AriaAttributes["aria-controls"];
|
|
@@ -7,6 +7,7 @@ export type MenuReturnProps = {
|
|
|
7
7
|
"aria-haspopup"?: AriaAttributes["aria-haspopup"];
|
|
8
8
|
"data-state": "open" | "close";
|
|
9
9
|
onClick?: () => void;
|
|
10
|
+
onKeyDown?: (e: KeyboardEvent<HTMLButtonElement>) => void;
|
|
10
11
|
ref?: RefObject<HTMLButtonElement>;
|
|
11
12
|
};
|
|
12
13
|
/**
|
package/dist/index.js
CHANGED
|
@@ -9,50 +9,50 @@ import { B as Button } from './Button-VNQQgZ45.js';
|
|
|
9
9
|
export { B as ButtonCompound } from './ButtonCompound-BbPK-Xjj.js';
|
|
10
10
|
import { B as ButtonLink } from './ButtonLink-CqR1F5Wn.js';
|
|
11
11
|
import { B as ButtonToggle } from './ButtonToggle-PCeSG-5D.js';
|
|
12
|
-
export {
|
|
12
|
+
export { a as Calendar, g as CalendarMonth, f as CalendarMonthButton, e as CalendarNext, b as CalendarNow, d as CalendarPrev, c as CalendarYearButton } from './Calendar-DaVJ96Hp.js';
|
|
13
13
|
export { C as Card } from './Card-vTYeSkxt.js';
|
|
14
|
-
export { C as Checkbox } from './Checkbox-
|
|
15
|
-
export { C as CheckboxGroup } from './Checkbox-
|
|
14
|
+
export { C as Checkbox } from './Checkbox-B5VTqylq.js';
|
|
15
|
+
export { C as CheckboxGroup } from './Checkbox-Dv01A09v.js';
|
|
16
16
|
export { C as Chip } from './Chip-DLU13qe-.js';
|
|
17
|
-
export { C as Combobox, c as ComboboxContent, a as ComboboxElement, i as ComboboxEmpty, e as ComboboxItem, f as ComboboxItemAddNew, d as ComboboxList, g as ComboboxSearchField, b as ComboboxSelect, h as ComboboxSelectTrigger } from './Combobox-
|
|
17
|
+
export { C as Combobox, c as ComboboxContent, a as ComboboxElement, i as ComboboxEmpty, e as ComboboxItem, f as ComboboxItemAddNew, d as ComboboxList, g as ComboboxSearchField, b as ComboboxSelect, h as ComboboxSelectTrigger } from './Combobox-C9-VQHxv.js';
|
|
18
18
|
export { u as useInfiniteCombobox } from './useInfiniteCombobox-WcRgC9p6.js';
|
|
19
|
-
export { D as DateField } from './DateField-
|
|
20
|
-
export { D as DateFieldRange } from './DateFieldRange-
|
|
21
|
-
export { D as DateFieldSingle } from './DateFieldSingle-
|
|
22
|
-
export { D as DateFieldYearless } from './DateFieldYearless-
|
|
23
|
-
export { D as DaysOfTheWeek } from './DaysOfTheWeek-
|
|
19
|
+
export { D as DateField } from './DateField-CKI7Zk4E.js';
|
|
20
|
+
export { D as DateFieldRange } from './DateFieldRange-DIycPI0Y.js';
|
|
21
|
+
export { D as DateFieldSingle } from './DateFieldSingle-BdkVUPvB.js';
|
|
22
|
+
export { D as DateFieldYearless } from './DateFieldYearless-DvbW4vgm.js';
|
|
23
|
+
export { D as DaysOfTheWeek } from './DaysOfTheWeek-BcyYG7dD.js';
|
|
24
24
|
export { D as Details, b as DetailsContent, a as DetailsSummary } from './Details-CF8DImjw.js';
|
|
25
|
-
export { D as Dialog, a as DialogCancelButton, b as DialogContent, c as DialogFooter, d as DialogHeader } from './Dialog-
|
|
25
|
+
export { D as Dialog, a as DialogCancelButton, b as DialogContent, c as DialogFooter, d as DialogHeader } from './Dialog-BLFx4TRs.js';
|
|
26
26
|
export { D as Divider } from './Divider-DJe8kLf2.js';
|
|
27
27
|
export { D as Dnd } from './index-DrM3iid4.js';
|
|
28
|
-
export { D as Drawer, a as DrawerCancelButton, d as DrawerContent, b as DrawerFooter, c as DrawerHeader } from './Drawer-
|
|
28
|
+
export { D as Drawer, a as DrawerCancelButton, d as DrawerContent, b as DrawerFooter, c as DrawerHeader } from './Drawer-DPM-jPb7.js';
|
|
29
29
|
export { E as EditCard } from './EditCard-CZzL0nx7.js';
|
|
30
|
-
export { F as FieldLabel } from './FieldLabel-
|
|
30
|
+
export { F as FieldLabel } from './FieldLabel-C6XZKglC.js';
|
|
31
31
|
export { F as FieldMessage } from './FieldMessage-B7uQ8vmr.js';
|
|
32
32
|
import { F as Flex } from './Flex-BdQMekvA.js';
|
|
33
33
|
export { G as Grid } from './Grid-MGUC698u.js';
|
|
34
34
|
import { I as Icon } from './Icon-D8SPKeO4.js';
|
|
35
|
-
export { I as InputMask } from './InputMask-
|
|
35
|
+
export { I as InputMask } from './InputMask-DkNgXdFO.js';
|
|
36
36
|
export { L as Layout, a as LayoutElement, b as LayoutItem } from './Layout-CUUb2PVr.js';
|
|
37
37
|
export { L as Link, u as useLinkStyles } from './Link-eRsLWPaQ.js';
|
|
38
38
|
export { L as LinkButton } from './LinkButton-2lXfrVoU.js';
|
|
39
|
-
import { L as Listbox } from './Listbox-
|
|
40
|
-
export { a as ListboxOption, b as ListboxOptionGroup } from './Listbox-
|
|
41
|
-
export { L as ListView, a as ListViewOption, b as ListViewOptionCell } from './ListView-
|
|
42
|
-
export { M as Menu, a as MenuItem } from './Menu-
|
|
43
|
-
export { N as NumberField } from './NumberField-
|
|
39
|
+
import { L as Listbox } from './Listbox-CWi30Cwg.js';
|
|
40
|
+
export { a as ListboxOption, b as ListboxOptionGroup } from './Listbox-CWi30Cwg.js';
|
|
41
|
+
export { L as ListView, a as ListViewOption, b as ListViewOptionCell } from './ListView-DYKwVASE.js';
|
|
42
|
+
export { M as Menu, a as MenuItem } from './Menu-D22YbM7y.js';
|
|
43
|
+
export { N as NumberField } from './NumberField-B1hQ8jRn.js';
|
|
44
44
|
export { Overflow, OverflowText } from './Overflow.js';
|
|
45
|
-
export { P as Page } from './Page-
|
|
46
|
-
export { P as Pagination } from './Pagination-
|
|
47
|
-
import { P as Popover } from './Popover-
|
|
48
|
-
export { a as PopoverButton, b as PopoverClose, c as PopoverContent, d as PopoverTrigger } from './Popover-
|
|
49
|
-
export { P as ProgressBar } from './ProgressBar-
|
|
50
|
-
export { R as Radio } from './Radio-
|
|
51
|
-
export { R as RadioGroup } from './RadioGroup-
|
|
52
|
-
export { S as SearchField } from './SearchField-
|
|
45
|
+
export { P as Page } from './Page-DwBcDxi2.js';
|
|
46
|
+
export { P as Pagination } from './Pagination-B7uvkLb3.js';
|
|
47
|
+
import { P as Popover } from './Popover-BuhxFt5z.js';
|
|
48
|
+
export { a as PopoverButton, b as PopoverClose, c as PopoverContent, d as PopoverTrigger } from './Popover-BuhxFt5z.js';
|
|
49
|
+
export { P as ProgressBar } from './ProgressBar-Bq8indkz.js';
|
|
50
|
+
export { R as Radio } from './Radio-57ck6GTm.js';
|
|
51
|
+
export { R as RadioGroup } from './RadioGroup-CcRLdoAl.js';
|
|
52
|
+
export { S as SearchField } from './SearchField-DqV9-0wR.js';
|
|
53
53
|
export { S as SegmentedControl, a as SegmentedControlSegment } from './SegmentedControl-CLDdes8W.js';
|
|
54
|
-
export { S as SelectCard, a as SelectCardElement, b as SelectCardGroup } from './SelectCard-
|
|
55
|
-
export { S as SelectTrigger } from './SelectTrigger-
|
|
54
|
+
export { S as SelectCard, a as SelectCardElement, b as SelectCardGroup } from './SelectCard-dEhb5KAL.js';
|
|
55
|
+
export { S as SelectTrigger } from './SelectTrigger-A96aYNm-.js';
|
|
56
56
|
export { S as SideNav, b as SideNavCollapsible, c as SideNavGroup, a as SideNavLink } from './SideNav-nqq5sAwz.js';
|
|
57
57
|
export { Skeleton, SkeletonCircle, SkeletonPill, SkeletonRectangle, SkeletonText } from './Skeleton.js';
|
|
58
58
|
export { S as Spinner } from './Spinner-wmO8Epw0.js';
|
|
@@ -61,28 +61,28 @@ export { S as Stepper, a as StepperFinalPanel, b as StepperList, c as StepperNex
|
|
|
61
61
|
export { S as Switch } from './Switch-C2ddZcr9.js';
|
|
62
62
|
export { T as Tab, a as TabButton, b as TabList, c as TabPanel } from './Tab-BQ5tMHlN.js';
|
|
63
63
|
export { T as Text } from './Text-BqvcbXyp.js';
|
|
64
|
-
export { T as Textarea } from './Textarea-
|
|
65
|
-
export { T as TextField } from './TextField-
|
|
66
|
-
export { T as TimeField } from './TimeField-
|
|
67
|
-
export { T as Toaster } from './Toaster-
|
|
68
|
-
export { t as toast } from './Toaster-
|
|
64
|
+
export { T as Textarea } from './Textarea-Kb-RF4rR.js';
|
|
65
|
+
export { T as TextField } from './TextField-DLIaLKT1.js';
|
|
66
|
+
export { T as TimeField } from './TimeField-6OSTzIYV.js';
|
|
67
|
+
export { T as Toaster } from './Toaster-BVM24YZG.js';
|
|
68
|
+
export { t as toast } from './Toaster-Du0zf4b-.js';
|
|
69
69
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
70
70
|
import { useContext, createContext, useId, useRef, useCallback, useEffect, forwardRef, useState, useMemo } from 'react';
|
|
71
71
|
import { c as cx } from './index-tZvMCc77.js';
|
|
72
72
|
import { u as useLayoutPropsUtil } from './useLayoutPropsUtil-DjD5IMh0.js';
|
|
73
73
|
import { u as useMergeRefs } from './useMergeRefs-Dfmtq9cI.js';
|
|
74
|
-
import { T as Tooltip } from './Tooltip-
|
|
75
|
-
export { a as TooltipContent, b as TooltipTrigger } from './Tooltip-
|
|
74
|
+
import { T as Tooltip } from './Tooltip-Dp9gWa2P.js';
|
|
75
|
+
export { a as TooltipContent, b as TooltipTrigger } from './Tooltip-Dp9gWa2P.js';
|
|
76
76
|
export { u as useAccessibleColor } from './useAccessibleColor-BYKjkGRg.js';
|
|
77
77
|
export { u as useBreakpoint } from './useBreakpoint-Cv5fnZxs.js';
|
|
78
78
|
export { u as usePrefersColorScheme } from './usePrefersColorScheme-_hT7dK7_.js';
|
|
79
79
|
export { u as useSwipe } from './useSwipe-Cp-CJxLU.js';
|
|
80
80
|
import { useTrackingId } from './useTrackingId.js';
|
|
81
|
-
export { A as AnvilProvider, a as AnvilProviderContext } from './AnvilProvider-
|
|
81
|
+
export { A as AnvilProvider, a as AnvilProviderContext } from './AnvilProvider-DkHInQRh.js';
|
|
82
82
|
export { L as LocalizationProvider } from './LocalizationProvider-DEZyjW5d.js';
|
|
83
83
|
export { L as LocalizationContext, u as useLocalizationContext } from './LocalizationContext-UsmB5mnR.js';
|
|
84
84
|
export { a as PortalProvider, P as PortalProviderContext } from './PortalProvider-9lXkQ0xY.js';
|
|
85
|
-
export { T as ThemeProvider } from './ThemeProvider-
|
|
85
|
+
export { T as ThemeProvider } from './ThemeProvider-7X1D1GxO.js';
|
|
86
86
|
export { u as useTheme } from './useTheme-B4i6a3bM.js';
|
|
87
87
|
export { T as TrackingProvider } from './TrackingProvider-BtSjkmpM.js';
|
|
88
88
|
export { u as useTrackingContext } from './useTrackingContext-DRwDL8DE.js';
|