schummar-table 0.12.6 → 0.13.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/package.json +7 -7
- package/dist/cjs/index.js +0 -3432
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/package.json +0 -1
- package/dist/es/index.js +0 -3432
- package/dist/es/index.js.map +0 -1
- package/dist/types/components/autoFocusTextField.d.ts +0 -5
- package/dist/types/components/cell.d.ts +0 -6
- package/dist/types/components/clearFiltersButton.d.ts +0 -1
- package/dist/types/components/columnFooter.d.ts +0 -1
- package/dist/types/components/columnHeader.d.ts +0 -6
- package/dist/types/components/columnSelection.d.ts +0 -2
- package/dist/types/components/dateFilter.d.ts +0 -11
- package/dist/types/components/dateInput.d.ts +0 -5
- package/dist/types/components/datePicker.d.ts +0 -25
- package/dist/types/components/expandControl.d.ts +0 -6
- package/dist/types/components/export.d.ts +0 -2
- package/dist/types/components/filterControl.d.ts +0 -3
- package/dist/types/components/formControlLabel.d.ts +0 -6
- package/dist/types/components/resizeHandle.d.ts +0 -5
- package/dist/types/components/row.d.ts +0 -7
- package/dist/types/components/selectComponent.d.ts +0 -5
- package/dist/types/components/selectFilter.d.ts +0 -12
- package/dist/types/components/sortComponent.d.ts +0 -4
- package/dist/types/components/spinnner.d.ts +0 -3
- package/dist/types/components/table.d.ts +0 -9
- package/dist/types/components/textFilter.d.ts +0 -8
- package/dist/types/components/virtualized.d.ts +0 -7
- package/dist/types/hooks/useFilter.d.ts +0 -7
- package/dist/types/hooks/useMemoMap.d.ts +0 -2
- package/dist/types/hooks/useTableMemo.d.ts +0 -6
- package/dist/types/hooks/useTheme.d.ts +0 -2
- package/dist/types/index.d.ts +0 -13
- package/dist/types/internalState/calcItems.d.ts +0 -3
- package/dist/types/internalState/calcProps.d.ts +0 -2
- package/dist/types/internalState/cleanupState.d.ts +0 -3
- package/dist/types/internalState/filterColumns.d.ts +0 -3
- package/dist/types/internalState/normalizeExpanded.d.ts +0 -3
- package/dist/types/internalState/syncSelections.d.ts +0 -3
- package/dist/types/internalState/tableStateStorage.d.ts +0 -13
- package/dist/types/internalState/useTableState.d.ts +0 -3
- package/dist/types/misc/csvExport.d.ts +0 -7
- package/dist/types/misc/debounce.d.ts +0 -4
- package/dist/types/misc/helpers.d.ts +0 -16
- package/dist/types/misc/queue.d.ts +0 -7
- package/dist/types/misc/textMatch.d.ts +0 -2
- package/dist/types/misc/throttle.d.ts +0 -5
- package/dist/types/theme/defaultTheme/badge.d.ts +0 -2
- package/dist/types/theme/defaultTheme/button.d.ts +0 -2
- package/dist/types/theme/defaultTheme/checkbox.d.ts +0 -2
- package/dist/types/theme/defaultTheme/defaultClasses.d.ts +0 -19
- package/dist/types/theme/defaultTheme/defaultColors.d.ts +0 -2
- package/dist/types/theme/defaultTheme/defaultComponents.d.ts +0 -2
- package/dist/types/theme/defaultTheme/defaultIcons.d.ts +0 -2
- package/dist/types/theme/defaultTheme/defaultTexts.d.ts +0 -2
- package/dist/types/theme/defaultTheme/iconButton.d.ts +0 -2
- package/dist/types/theme/defaultTheme/index.d.ts +0 -2
- package/dist/types/theme/defaultTheme/popover.d.ts +0 -7
- package/dist/types/theme/defaultTheme/textField.d.ts +0 -2
- package/dist/types/theme/mui4Theme/index.d.ts +0 -7
- package/dist/types/theme/mui5Theme/index.d.ts +0 -7
- package/dist/types/theme/tableTheme.d.ts +0 -10
- package/dist/types/theme/useCssVariables.d.ts +0 -9
- package/dist/types/types.d.ts +0 -336
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare type DateRange = {
|
|
2
|
-
min: Date;
|
|
3
|
-
max: Date;
|
|
4
|
-
};
|
|
5
|
-
export declare type DatePickerProps = {
|
|
6
|
-
/** Currently selected day or range of days. */
|
|
7
|
-
value: Date | DateRange | null;
|
|
8
|
-
/** Callback for when the day (range) changes. */
|
|
9
|
-
onChange: (value: Date | DateRange | null) => void;
|
|
10
|
-
/** If enabled, ranges can be selected. */
|
|
11
|
-
rangeSelect?: boolean;
|
|
12
|
-
/** Which locale to use to render the calendar. */
|
|
13
|
-
locale?: string;
|
|
14
|
-
/** Which day of the week should be in the first column. */
|
|
15
|
-
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
16
|
-
};
|
|
17
|
-
/** Rounds a date down to the start of the day. */
|
|
18
|
-
export declare const startOfDay: (d: Date) => Date;
|
|
19
|
-
/** Rounds a date up to the end of the day. */
|
|
20
|
-
export declare const endOfDay: (d: Date) => Date;
|
|
21
|
-
export declare const today: () => DateRange;
|
|
22
|
-
export declare const thisWeek: (firstDayOfWeek?: number) => DateRange;
|
|
23
|
-
/** Returns whether two dates and/or date ranges intersect. Intersection is considered per day. */
|
|
24
|
-
export declare function dateIntersect(a: Date | null | DateRange, b: Date | null | DateRange): boolean;
|
|
25
|
-
export declare function DatePicker({ value, onChange, rangeSelect, locale, firstDayOfWeek }: DatePickerProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { HTMLProps } from 'react';
|
|
2
|
-
export declare function ResizeHandle(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
|
-
export declare function ResizeHandleView({ enabled, ...props }: HTMLProps<HTMLDivElement> & {
|
|
4
|
-
enabled?: boolean;
|
|
5
|
-
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Id, MemoizedTableTheme } from '../types';
|
|
3
|
-
export declare function calcClassNames<T>(classes: MemoizedTableTheme<any>['classes'] | undefined, item: T, index: number): (string | false | undefined)[];
|
|
4
|
-
export declare const Row: React.MemoExoticComponent<(<T>({ itemId, rowIndex }: {
|
|
5
|
-
itemId: Id;
|
|
6
|
-
rowIndex: number;
|
|
7
|
-
}) => JSX.Element | null)>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { CommonFilterProps, SerializableValue } from '../types';
|
|
3
|
-
export declare function SelectFilter<T, V, F extends SerializableValue>({ options: providedOptions, stringValue, render, singleSelect, ...props }: {
|
|
4
|
-
/** Which options are provided to select. By default all unique item values are used. */
|
|
5
|
-
options?: F[];
|
|
6
|
-
/** String representation of a value. Used to filter options via the text field. */
|
|
7
|
-
stringValue?: (value: F) => string;
|
|
8
|
-
/** Render values. By default a string representation of the value is used. */
|
|
9
|
-
render?: (value: F) => ReactNode;
|
|
10
|
-
/** If enabled, only one option can be selected at a time. */
|
|
11
|
-
singleSelect?: boolean;
|
|
12
|
-
} & CommonFilterProps<T, V, F, Set<F>>): JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Store } from 'schummar-state/react';
|
|
3
|
-
import { Id, InternalTableState, TableProps } from '../types';
|
|
4
|
-
export declare const TableContext: React.Context<Store<InternalTableState<any>> | null>;
|
|
5
|
-
export declare const TableResetContext: React.Context<() => void>;
|
|
6
|
-
export declare const ColumnContext: React.Context<Id | null>;
|
|
7
|
-
export declare function useTableContext<T>(): Store<InternalTableState<T>>;
|
|
8
|
-
export declare function useColumnContext(): Id;
|
|
9
|
-
export declare function Table<T>(props: TableProps<T>): JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { CommonFilterProps } from '../types';
|
|
3
|
-
export declare function TextFilter<T, V>({ compare, filterBy, ...props }: {
|
|
4
|
-
/** Custom comparison function. Should return true if an item value matches the current filter value.
|
|
5
|
-
* By default a fuzzy text comparison is used.
|
|
6
|
-
*/
|
|
7
|
-
compare?: (itemValue: string, filterValue: string) => boolean;
|
|
8
|
-
} & CommonFilterProps<T, V, string, string>): JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { HTMLProps, ReactNode } from 'react';
|
|
2
|
-
import { Id } from '../types';
|
|
3
|
-
export declare function Virtualized<T>({ header, footer, children, ...props }: {
|
|
4
|
-
header: ReactNode;
|
|
5
|
-
footer: ReactNode;
|
|
6
|
-
children: (itemIds: Id[], startIndex: number) => ReactNode;
|
|
7
|
-
} & HTMLProps<HTMLDivElement>): JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FilterImplementation, SerializableValue } from '../types';
|
|
2
|
-
export declare function useFilter<T, V, F, S extends SerializableValue>(impl: FilterImplementation<T, V, F, S>): {
|
|
3
|
-
value: S | undefined;
|
|
4
|
-
onChange: (value?: S) => void;
|
|
5
|
-
close: () => void;
|
|
6
|
-
filterBy: (value: V, item: T) => F | F[];
|
|
7
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { FunctionWithDeps } from '../types';
|
|
3
|
-
export declare function TableMemoContextProvider({ children }: {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
|
-
export declare function useTableMemo(): <Fn extends (...args: any[]) => any>(key: string, fn: FunctionWithDeps<Fn>) => Fn;
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { AutoFocusTextField } from './components/autoFocusTextField';
|
|
2
|
-
export { DateFilter } from './components/dateFilter';
|
|
3
|
-
export { dateIntersect, DatePicker, endOfDay, startOfDay } from './components/datePicker';
|
|
4
|
-
export type { DatePickerProps, DateRange } from './components/datePicker';
|
|
5
|
-
export { SelectFilter } from './components/selectFilter';
|
|
6
|
-
export { ColumnContext, Table, TableContext, useColumnContext, useTableContext } from './components/table';
|
|
7
|
-
export { TextFilter } from './components/textFilter';
|
|
8
|
-
export { useFilter } from './hooks/useFilter';
|
|
9
|
-
export { useTheme } from './hooks/useTheme';
|
|
10
|
-
export type { TableStateStorage } from './internalState/tableStateStorage';
|
|
11
|
-
export { termMatch, textMatch } from './misc/textMatch';
|
|
12
|
-
export { configureTableTheme, mergeThemes, TableThemeContext, TableThemeProvider } from './theme/tableTheme';
|
|
13
|
-
export type { Column, Id, InternalColumn, PartialTableTheme, Sort, SortDirection, TableProps } from './types';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Store } from 'schummar-state/react';
|
|
2
|
-
import { InternalTableState } from '../types';
|
|
3
|
-
export declare type TableStateStorage = {
|
|
4
|
-
getItem: (key: string) => string | null | Promise<string | null>;
|
|
5
|
-
setItem: (key: string, value: string) => unknown | Promise<unknown>;
|
|
6
|
-
removeItem: (key: string) => unknown | Promise<unknown>;
|
|
7
|
-
} & ({
|
|
8
|
-
keys: () => string[] | Promise<string[]>;
|
|
9
|
-
} | {
|
|
10
|
-
length: number | (() => number | Promise<number>);
|
|
11
|
-
key: (keyIndex: number) => string | null | Promise<string | null>;
|
|
12
|
-
});
|
|
13
|
-
export declare function useTableStateStorage(table: Store<InternalTableState<any>>): readonly [boolean, () => Promise<void>];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Id, TableItem } from '../types';
|
|
2
|
-
export declare const flatMap: <T, S>(arr: Iterable<T>, flatMap: (t: T) => S[]) => S[];
|
|
3
|
-
export declare const orderBy: <T>(arr: T[], selectors?: ((t: T) => any)[], direction?: ('desc' | 'asc')[]) => T[];
|
|
4
|
-
export declare const uniq: <T>(arr: T[]) => T[];
|
|
5
|
-
export declare const intersect: <T>(a: Iterable<T>, b: {
|
|
6
|
-
has(t: T): boolean;
|
|
7
|
-
}) => Set<T>;
|
|
8
|
-
export declare const getAncestors: <T>(activeItemsById: Map<Id, TableItem<T>>, ...items: TableItem<T>[]) => Set<Id>;
|
|
9
|
-
export declare const getDescendants: <T>(...items: TableItem<T>[]) => Set<Id>;
|
|
10
|
-
export declare const identity: (x: unknown) => any;
|
|
11
|
-
export declare const asString: (x: unknown) => string;
|
|
12
|
-
export declare const asStringOrArray: (x: unknown) => string | string[];
|
|
13
|
-
export declare const defaultEquals: (a: unknown, b: unknown) => boolean;
|
|
14
|
-
export declare const subStringMatch: (a: string, b: string) => boolean;
|
|
15
|
-
export declare const castArray: <T>(a: T | T[]) => T[];
|
|
16
|
-
export declare const cx: (...classNames: (string | false | undefined | null | Record<string, boolean>)[]) => string;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export declare const white = "#ffffff";
|
|
2
|
-
export declare const lightGray = "#eeeeee";
|
|
3
|
-
export declare const gray = "#bdbdbd";
|
|
4
|
-
export declare const darkGray = "#777";
|
|
5
|
-
export declare const defaultClasses: {
|
|
6
|
-
table: import("@emotion/utils").SerializedStyles;
|
|
7
|
-
cell: import("@emotion/utils").SerializedStyles;
|
|
8
|
-
cellFill: import("@emotion/utils").SerializedStyles;
|
|
9
|
-
headerCell: import("@emotion/utils").SerializedStyles;
|
|
10
|
-
footerCell: import("@emotion/utils").SerializedStyles;
|
|
11
|
-
firstCell: import("@emotion/utils").SerializedStyles;
|
|
12
|
-
sticky: import("@emotion/utils").SerializedStyles;
|
|
13
|
-
stickyBottom: import("@emotion/utils").SerializedStyles;
|
|
14
|
-
headerFill: import("@emotion/utils").SerializedStyles;
|
|
15
|
-
footerFill: import("@emotion/utils").SerializedStyles;
|
|
16
|
-
text: import("@emotion/utils").SerializedStyles;
|
|
17
|
-
card: import("@emotion/utils").SerializedStyles;
|
|
18
|
-
clearFiltersButton: import("@emotion/utils").SerializedStyles;
|
|
19
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { PartialTableTheme } from '../../types';
|
|
3
|
-
export declare const mui4Theme: PartialTableTheme;
|
|
4
|
-
export declare function Mui4TableThemeProvider({ theme, children }: {
|
|
5
|
-
theme?: PartialTableTheme;
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { PartialTableTheme } from '../../types';
|
|
3
|
-
export declare const mui5Theme: PartialTableTheme;
|
|
4
|
-
export declare function Mui5TableThemeProvider({ theme, children }: {
|
|
5
|
-
theme?: PartialTableTheme;
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { PartialTableTheme } from '../types';
|
|
3
|
-
export declare let globalTableTheme: PartialTableTheme;
|
|
4
|
-
export declare function configureTableTheme(tableTheme: PartialTableTheme): void;
|
|
5
|
-
export declare const TableThemeContext: import("react").Context<PartialTableTheme<unknown>>;
|
|
6
|
-
export declare function TableThemeProvider({ theme, children }: {
|
|
7
|
-
theme: PartialTableTheme;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
10
|
-
export declare function mergeThemes<T>(...themes: PartialTableTheme<T>[]): PartialTableTheme<T>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare function useCssVariables(): {
|
|
2
|
-
'--spacing': string | number;
|
|
3
|
-
'--primaryMain': string;
|
|
4
|
-
'--primaryLight': string;
|
|
5
|
-
'--primaryContrastText': string;
|
|
6
|
-
'--secondaryMain': string;
|
|
7
|
-
'--secondaryLight': string;
|
|
8
|
-
'--secondaryContrastText': string;
|
|
9
|
-
};
|