@7shifts/sous-chef 3.27.1 → 3.28.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/forms/MultiSelectField/MultiSelectField.d.ts +3 -1
- package/dist/index.css +270 -4
- package/dist/index.js +266 -96
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +266 -96
- package/dist/index.modern.js.map +1 -1
- package/dist/lists/DataTable/DataTable.d.ts +4 -2
- package/dist/lists/DataTable/DataTableCoverShadow/DataTableCoverShadow.d.ts +7 -0
- package/dist/lists/DataTable/DataTableCoverShadow/index.d.ts +1 -0
- package/dist/lists/DataTable/DataTableStickyColumnsContainer/DataTableStickyColumnsContainer.d.ts +10 -0
- package/dist/lists/DataTable/DataTableStickyColumnsContainer/index.d.ts +1 -0
- package/dist/lists/DataTable/constants.d.ts +6 -0
- package/dist/lists/DataTable/domain.d.ts +6 -1
- package/dist/lists/DataTable/types.d.ts +2 -0
- package/dist/lists/hooks/useDataTableScrollState.d.ts +13 -0
- package/dist/utils/browser.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { DataTableColumn, DataTableCustomComponent, DataTableItem, DataTableSort } from './types';
|
|
2
|
+
import type { DataTableColumn, DataTableCustomComponent, DataTableItem, DataTableSort, StickyColumns } from './types';
|
|
3
3
|
declare type Props<T> = {
|
|
4
4
|
/** Each element represents a row and each key of the object represents a column */
|
|
5
5
|
items: DataTableItem<T>[];
|
|
@@ -28,6 +28,8 @@ declare type Props<T> = {
|
|
|
28
28
|
hasVerticalBorders?: boolean;
|
|
29
29
|
/** Used to override the default data-testid */
|
|
30
30
|
testId?: string;
|
|
31
|
+
/** Used to make the left, rigth or both edge columns sticky */
|
|
32
|
+
stickyColumns?: StickyColumns;
|
|
31
33
|
};
|
|
32
|
-
declare const DataTable: <T extends unknown>({ items, columns, itemComponent, maxHeight, hasPrevious, hasNext, onPreviousClick, onNextClick, onSort, isLoading, showActionMenu, footerComponent, hasVerticalBorders, testId, skeletonRowLayout }: Props<T>) => JSX.Element;
|
|
34
|
+
declare const DataTable: <T extends unknown>({ items, columns, itemComponent, maxHeight, hasPrevious, hasNext, onPreviousClick, onNextClick, onSort, isLoading, showActionMenu, footerComponent, hasVerticalBorders, testId, skeletonRowLayout, stickyColumns }: Props<T>) => JSX.Element;
|
|
33
35
|
export default DataTable;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare type Props = {
|
|
2
|
+
showShadowOnLeft: boolean;
|
|
3
|
+
showShadowOnRight: boolean;
|
|
4
|
+
isShowingColumns: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const DataTableCoverShadow: ({ showShadowOnLeft, showShadowOnRight, isShowingColumns }: Props) => JSX.Element;
|
|
7
|
+
export default DataTableCoverShadow;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DataTableCoverShadow';
|
package/dist/lists/DataTable/DataTableStickyColumnsContainer/DataTableStickyColumnsContainer.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { StickyColumns } from '../types';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
stickyColumns?: StickyColumns;
|
|
6
|
+
isShowingColumns: boolean;
|
|
7
|
+
isShowingFooter: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const DataTableStickyColumnsContainer: ({ children, stickyColumns, isShowingColumns, isShowingFooter }: Props) => JSX.Element;
|
|
10
|
+
export default DataTableStickyColumnsContainer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DataTableStickyColumnsContainer';
|
|
@@ -3,4 +3,10 @@ export declare const DATA_TABLE_STATES: {
|
|
|
3
3
|
readonly SKELETON_LOADING: "SKELETON_LOADING";
|
|
4
4
|
readonly BACKGROUND_LOADING: "BACKGROUND_LOADING";
|
|
5
5
|
};
|
|
6
|
+
export declare const DATA_TABLE_SCROLL_STATES: {
|
|
7
|
+
readonly NO_SCROLL: "NO_SCROLL";
|
|
8
|
+
readonly SCROLLABLE_CONTENT_ON_BOTH_SIDES: "SCROLLABLE_CONTENT_ON_BOTH_SIDES";
|
|
9
|
+
readonly SCROLLABLE_CONTENT_ON_LEFT: "SCROLLABLE_CONTENT_ON_LEFT";
|
|
10
|
+
readonly SCROLLABLE_CONTENT_ON_RIGHT: "SCROLLABLE_CONTENT_ON_RIGHT";
|
|
11
|
+
};
|
|
6
12
|
export declare const AMOUNT_OF_SKELETON_ROWS = 10;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import { DataTableState } from './types';
|
|
1
|
+
import { DataTableState, ScrollState } from './types';
|
|
2
2
|
export declare const getDataTableState: (isLoading: boolean, amountOfItems: number) => DataTableState;
|
|
3
|
+
export declare const calculateScrollState: (scrollContainer: {
|
|
4
|
+
scrollLeft: number;
|
|
5
|
+
scrollWidth: number;
|
|
6
|
+
clientWidth: number;
|
|
7
|
+
}) => ScrollState;
|
|
@@ -34,4 +34,6 @@ declare type ButtonAction = {
|
|
|
34
34
|
} & MenuAction;
|
|
35
35
|
export declare type DataTableAction = KebabAction | ButtonAction;
|
|
36
36
|
export declare type DataTableState = 'CONTENT' | 'SKELETON_LOADING' | 'BACKGROUND_LOADING';
|
|
37
|
+
export declare type StickyColumns = 'left' | 'right' | 'both';
|
|
38
|
+
export declare type ScrollState = 'NO_SCROLL' | 'SCROLLABLE_CONTENT_ON_BOTH_SIDES' | 'SCROLLABLE_CONTENT_ON_LEFT' | 'SCROLLABLE_CONTENT_ON_RIGHT';
|
|
37
39
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ScrollState } from '../DataTable/types';
|
|
3
|
+
export declare const useDataTableScrollState: (stickyColumns?: "left" | "right" | "both" | undefined) => {
|
|
4
|
+
scrollState: ScrollState;
|
|
5
|
+
onScroll: () => void;
|
|
6
|
+
scrollContainerRef: import("react").RefObject<HTMLDivElement>;
|
|
7
|
+
hasScrollOnLeft: boolean;
|
|
8
|
+
hasScrollOnRight: boolean;
|
|
9
|
+
hasRightColumnSticky: boolean;
|
|
10
|
+
hasLeftColumnSticky: boolean;
|
|
11
|
+
showCoverShadowOnRight: boolean;
|
|
12
|
+
showCoverShadowOnLeft: boolean;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getBrowserVersion: () => string;
|