@rebasepro/ui 0.7.0 → 0.8.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/components/VirtualTable/fields/VirtualTableDateField.d.ts +13 -0
- package/dist/components/VirtualTable/fields/VirtualTableInput.d.ts +10 -0
- package/dist/components/VirtualTable/fields/VirtualTableNumberInput.d.ts +9 -0
- package/dist/components/VirtualTable/fields/VirtualTableSelect.d.ts +17 -0
- package/dist/components/VirtualTable/fields/VirtualTableSwitch.d.ts +8 -0
- package/dist/components/VirtualTable/index.d.ts +7 -0
- package/dist/components/VirtualTable/selection/SelectionContext.d.ts +11 -0
- package/dist/components/VirtualTable/selection/SelectionStore.d.ts +14 -0
- package/dist/index.d.ts +13 -4
- package/dist/index.es.js +2411 -2154
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +32 -0
- package/src/components/VirtualTable/fields/VirtualTableInput.tsx +82 -0
- package/src/components/VirtualTable/fields/VirtualTableNumberInput.tsx +71 -0
- package/src/components/VirtualTable/fields/VirtualTableSelect.tsx +107 -0
- package/src/components/VirtualTable/fields/VirtualTableSwitch.tsx +28 -0
- package/src/components/VirtualTable/index.tsx +7 -0
- package/src/components/VirtualTable/selection/SelectionContext.tsx +36 -0
- package/src/components/VirtualTable/selection/SelectionStore.ts +54 -0
- package/src/index.ts +42 -4
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare function VirtualTableDateField(props: {
|
|
3
|
+
name?: string;
|
|
4
|
+
error?: Error;
|
|
5
|
+
mode?: "date" | "date_time";
|
|
6
|
+
timezone?: string;
|
|
7
|
+
internalValue: Date | undefined | null;
|
|
8
|
+
updateValue: (newValue: (Date | null)) => void;
|
|
9
|
+
focused: boolean;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
locale?: string;
|
|
12
|
+
onBlur?: React.FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
13
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare function VirtualTableInput(props: {
|
|
3
|
+
error?: Error;
|
|
4
|
+
value: string;
|
|
5
|
+
multiline?: boolean;
|
|
6
|
+
focused: boolean;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
updateValue: (newValue: (string | null)) => void;
|
|
9
|
+
onBlur?: () => void;
|
|
10
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare function VirtualTableNumberInput(props: {
|
|
3
|
+
error?: Error;
|
|
4
|
+
value: number;
|
|
5
|
+
align?: "right" | "left" | "center";
|
|
6
|
+
updateValue: (newValue: (number | null)) => void;
|
|
7
|
+
focused: boolean;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface VirtualTableSelectOption {
|
|
3
|
+
value: string | number;
|
|
4
|
+
label: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function VirtualTableSelect(props: {
|
|
8
|
+
options: VirtualTableSelectOption[];
|
|
9
|
+
error?: Error;
|
|
10
|
+
multiple?: boolean;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
small?: boolean;
|
|
13
|
+
value: string | number | string[] | number[] | undefined;
|
|
14
|
+
updateValue: (newValue: (string | number | string[] | number[] | null)) => void;
|
|
15
|
+
focused: boolean;
|
|
16
|
+
onBlur?: React.FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
17
|
+
}): React.JSX.Element;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
export { VirtualTable } from "./VirtualTable";
|
|
2
2
|
export * from "./VirtualTableProps";
|
|
3
3
|
export type { FilterFormFieldProps } from "./VirtualTableHeader";
|
|
4
|
+
export * from "./selection/SelectionStore";
|
|
5
|
+
export * from "./selection/SelectionContext";
|
|
6
|
+
export * from "./fields/VirtualTableInput";
|
|
7
|
+
export * from "./fields/VirtualTableNumberInput";
|
|
8
|
+
export * from "./fields/VirtualTableSwitch";
|
|
9
|
+
export * from "./fields/VirtualTableDateField";
|
|
10
|
+
export * from "./fields/VirtualTableSelect";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { VirtualTableSelectionStore, SelectedCell } from "./SelectionStore";
|
|
3
|
+
export interface VirtualTableSelectionContextProps<T extends SelectedCell = SelectedCell> {
|
|
4
|
+
selectionStore: VirtualTableSelectionStore<T>;
|
|
5
|
+
select: (cell: T | undefined) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const VirtualTableSelectionProvider: <T extends SelectedCell = SelectedCell>({ store, children }: {
|
|
8
|
+
store: VirtualTableSelectionStore<T>;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}) => React.JSX.Element;
|
|
11
|
+
export declare const useVirtualTableSelection: <T extends SelectedCell = SelectedCell>() => VirtualTableSelectionContextProps<T>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface SelectedCell {
|
|
2
|
+
columnKey: string;
|
|
3
|
+
rowId: string | number;
|
|
4
|
+
cellRect?: DOMRect;
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function createVirtualTableSelectionStore<T extends SelectedCell = SelectedCell>(): {
|
|
9
|
+
getSnapshot: () => T | undefined;
|
|
10
|
+
subscribe: (listener: () => void) => () => void;
|
|
11
|
+
select: (cell: T | undefined) => void;
|
|
12
|
+
};
|
|
13
|
+
export type VirtualTableSelectionStore<T extends SelectedCell = SelectedCell> = ReturnType<typeof createVirtualTableSelectionStore<T>>;
|
|
14
|
+
export declare function useVirtualTableCellSelected<T extends SelectedCell = SelectedCell>(store: VirtualTableSelectionStore<T>, columnKey: string, rowId: string | number): boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
export * from "./components";
|
|
2
|
-
export * from "./styles";
|
|
3
|
-
export * from "./util";
|
|
4
|
-
export * from "./icons";
|
|
5
|
-
export * from "./hooks";
|
|
6
2
|
export * from "./views";
|
|
3
|
+
export * from "./icons";
|
|
4
|
+
export * from "./styles";
|
|
5
|
+
export { cls } from "./util/cls";
|
|
6
|
+
export { CHIP_COLORS, getColorSchemeForKey, getColorSchemeForSeed } from "./util/chip_colors";
|
|
7
|
+
export { useOutsideAlerter } from "./hooks/useOutsideAlerter";
|
|
8
|
+
export { useDebouncedCallback } from "./hooks/useDebouncedCallback";
|
|
9
|
+
export { useDebounceCallback } from "./hooks/useDebounceCallback";
|
|
10
|
+
export { useDebounceValue } from "./hooks/useDebounceValue";
|
|
11
|
+
export { useInjectStyles } from "./hooks/useInjectStyles";
|
|
12
|
+
export { PortalContainerProvider, usePortalContainer } from "./hooks/PortalContainerContext";
|
|
13
|
+
export type { PortalContainerContextType, PortalContainerProviderProps } from "./hooks/PortalContainerContext";
|
|
14
|
+
export { debounce } from "./util/debounce";
|
|
15
|
+
export type { Cancelable } from "./util/debounce";
|