@loadsmart/loadsmart-ui 5.1.1 → 5.3.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/Dropdown/Dropdown.types.d.ts +2 -2
- package/dist/components/Dropdown/useDropdown.d.ts +1 -5
- package/dist/components/Icon/Icon.d.ts +1 -0
- package/dist/components/Select/Select.types.d.ts +4 -4
- package/dist/components/TablePagination/RowsPerPage.d.ts +4 -0
- package/dist/components/TablePagination/TablePagination.d.ts +4 -0
- package/dist/components/TablePagination/TablePagination.stories.d.ts +5 -0
- package/dist/components/TablePagination/TablePagination.styles.d.ts +5 -0
- package/dist/components/TablePagination/TablePagination.test.d.ts +1 -0
- package/dist/components/TablePagination/TablePagination.types.d.ts +50 -0
- package/dist/components/TablePagination/TablePaginationActions.d.ts +11 -0
- package/dist/components/TablePagination/index.d.ts +2 -0
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +445 -437
- package/dist/index.js.map +1 -1
- package/dist/loadsmart.theme-63c13988.js +2 -0
- package/dist/{loadsmart.theme-37a60d56.js.map → loadsmart.theme-63c13988.js.map} +1 -1
- package/dist/{prop-06c02f6d.js → prop-0c635ee9.js} +2 -2
- package/dist/{prop-06c02f6d.js.map → prop-0c635ee9.js.map} +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/theming/index.js +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/utils/toolset/keyboard.d.ts +4 -0
- package/package.json +1 -1
- package/src/components/Dropdown/Dropdown.tsx +11 -8
- package/src/components/Dropdown/Dropdown.types.ts +2 -2
- package/src/components/Dropdown/useDropdown.ts +1 -6
- package/src/components/Icon/Icon.tsx +2 -0
- package/src/components/Icon/assets/caret-right-last.svg +4 -0
- package/src/components/Select/Select.test.tsx +23 -1
- package/src/components/Select/Select.types.ts +4 -4
- package/src/components/Select/useSelect.ts +11 -9
- package/src/components/TablePagination/RowsPerPage.tsx +76 -0
- package/src/components/TablePagination/TablePagination.stories.tsx +37 -0
- package/src/components/TablePagination/TablePagination.styles.ts +13 -0
- package/src/components/TablePagination/TablePagination.test.tsx +112 -0
- package/src/components/TablePagination/TablePagination.tsx +51 -0
- package/src/components/TablePagination/TablePagination.types.ts +59 -0
- package/src/components/TablePagination/TablePaginationActions.tsx +144 -0
- package/src/components/TablePagination/index.ts +2 -0
- package/src/components/Tag/Tag.tsx +1 -1
- package/src/hooks/useClickOutside/useClickOutside.ts +6 -6
- package/src/index.ts +3 -0
- package/src/testing/SelectEvent/SelectEvent.ts +8 -7
- package/src/utils/toolset/keyboard.ts +4 -0
- package/dist/loadsmart.theme-37a60d56.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
1
|
import type { ButtonProps } from "../Button";
|
|
2
|
+
import type { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
3
3
|
export interface useDropdownProps {
|
|
4
4
|
expanded: boolean;
|
|
5
5
|
toggle: () => void;
|
|
@@ -12,7 +12,7 @@ export interface useDropdownReturn {
|
|
|
12
12
|
}
|
|
13
13
|
export interface DropdownProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'onBlur'> {
|
|
14
14
|
disabled?: boolean;
|
|
15
|
-
onBlur?: () => void;
|
|
15
|
+
onBlur?: (event?: MouseEvent | TouchEvent | KeyboardEvent) => void;
|
|
16
16
|
}
|
|
17
17
|
export interface GenericDropdownProps extends DropdownProps, useDropdownProps {
|
|
18
18
|
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export interface DropdownProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'onBlur'> {
|
|
3
|
-
disabled?: boolean;
|
|
4
|
-
onBlur?: () => void;
|
|
5
|
-
}
|
|
1
|
+
import type { DropdownProps } from './Dropdown.types';
|
|
6
2
|
export interface useDropdownProps {
|
|
7
3
|
expanded: boolean;
|
|
8
4
|
toggle: () => void;
|
|
@@ -21,6 +21,7 @@ declare const icons: {
|
|
|
21
21
|
upload: JSX.Element;
|
|
22
22
|
warning: JSX.Element;
|
|
23
23
|
'dots-horizontal': JSX.Element;
|
|
24
|
+
'caret-right-last': JSX.Element;
|
|
24
25
|
};
|
|
25
26
|
declare const Icon: (props: GenericIconProps<import("../IconFactory").IconMapping>) => JSX.Element;
|
|
26
27
|
export declare type IconProps = GenericIconProps<typeof icons>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import EventLike from "../../utils/types/EventLike";
|
|
2
|
-
import type {
|
|
3
|
-
import type { DropdownProps, DropdownMenuItemProps } from "../Dropdown";
|
|
2
|
+
import type { DropdownMenuItemProps, DropdownProps } from "../Dropdown";
|
|
4
3
|
import type { TextFieldProps } from "../TextField";
|
|
5
|
-
import type {
|
|
4
|
+
import type { Selectable, SelectableAdapter, SelectableKeyType, SelectableState } from "../../hooks/useSelectable";
|
|
6
5
|
import { useSelectableReturn } from "../../hooks/useSelectable/useSelectable.types";
|
|
6
|
+
import type { ChangeEvent, ComponentType, FocusEvent, HTMLAttributes } from 'react';
|
|
7
7
|
export declare type Option = Selectable;
|
|
8
8
|
export interface GenericOption {
|
|
9
9
|
label: string;
|
|
@@ -98,7 +98,7 @@ export declare type useSelectReturn = {
|
|
|
98
98
|
getDropdownProps: () => {
|
|
99
99
|
toggle: () => void;
|
|
100
100
|
expanded: boolean;
|
|
101
|
-
onBlur: () => void;
|
|
101
|
+
onBlur: (event?: MouseEvent | TouchEvent | KeyboardEvent) => void;
|
|
102
102
|
};
|
|
103
103
|
getCreatebleProps: () => CreatableProps;
|
|
104
104
|
isCreatable: () => boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RowsPerPageProps } from './TablePagination.types';
|
|
3
|
+
declare function RowsPerPage({ page, rowsPerPage, onRowsPerPageChange, labelRowsPerPage, count, rowsPerPageOptions, disabled, }: RowsPerPageProps): JSX.Element;
|
|
4
|
+
export default RowsPerPage;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Meta, Story } from '@storybook/react/types-6-0';
|
|
2
|
+
import type { TablePaginationProps } from './TablePagination.types';
|
|
3
|
+
declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Playground: Story<TablePaginationProps>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const NoPaddingButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../Button").ButtonProps & import("react").RefAttributes<HTMLButtonElement>>, any, {
|
|
3
|
+
variant: "tertiary";
|
|
4
|
+
scale: "small";
|
|
5
|
+
}, "scale" | "variant">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { GroupProps } from "../Layout/Group";
|
|
2
|
+
export interface TablePaginationProps extends GroupProps {
|
|
3
|
+
/**
|
|
4
|
+
* The pagination variant
|
|
5
|
+
* @default 'default'
|
|
6
|
+
*/
|
|
7
|
+
variant?: 'compact' | 'default';
|
|
8
|
+
/**
|
|
9
|
+
* The total number of paginated items
|
|
10
|
+
*/
|
|
11
|
+
count: number;
|
|
12
|
+
/**
|
|
13
|
+
* Customize the rows per page label.
|
|
14
|
+
* @default 'Rows per page:'
|
|
15
|
+
*/
|
|
16
|
+
labelRowsPerPage?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Callback fired when the page is changed.
|
|
19
|
+
*/
|
|
20
|
+
onPageChange: (page: number) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Callback fired when the number of rows per page is changed.
|
|
23
|
+
*/
|
|
24
|
+
onRowsPerPageChange: (rowsPerPage: number) => void;
|
|
25
|
+
/**
|
|
26
|
+
* The number of rows per page.
|
|
27
|
+
* @default 50
|
|
28
|
+
*/
|
|
29
|
+
rowsPerPage?: number;
|
|
30
|
+
/**
|
|
31
|
+
* The zero-based index of the current page.
|
|
32
|
+
*/
|
|
33
|
+
page: number;
|
|
34
|
+
/**
|
|
35
|
+
* Customizes the options of the rows per page select field.
|
|
36
|
+
* @default [10, 25, 50, 100]
|
|
37
|
+
*/
|
|
38
|
+
rowsPerPageOptions?: number[];
|
|
39
|
+
/**
|
|
40
|
+
* Disable all the pagination actions
|
|
41
|
+
*/
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export declare type TablePaginationActionsProps = Omit<TablePaginationProps, 'labelRowsPerPage' | 'onRowsPerPageChange' | 'rowsPerPageOptions' | 'rowsPerPage'> & {
|
|
45
|
+
rowsPerPage: number;
|
|
46
|
+
};
|
|
47
|
+
export declare type RowsPerPageProps = Omit<TablePaginationProps, 'rowsPerPageOptions' | 'onPageChange' | 'rowsPerPage'> & {
|
|
48
|
+
rowsPerPageOptions: number[];
|
|
49
|
+
rowsPerPage: number;
|
|
50
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TablePaginationActionsProps } from "./TablePagination.types";
|
|
3
|
+
import { IconProps } from "../Icon";
|
|
4
|
+
export declare const ActionIcon: import("styled-components").StyledComponent<(props: import("../IconFactory").IconProps<import("../IconFactory").IconMapping>) => JSX.Element, any, {
|
|
5
|
+
color: "neutral-darker";
|
|
6
|
+
size: "16";
|
|
7
|
+
} & IconProps & {
|
|
8
|
+
rotate?: number | undefined;
|
|
9
|
+
}, "size" | "color">;
|
|
10
|
+
declare function TablePaginationActions({ variant, disabled, onPageChange, page, count, rowsPerPage, }: TablePaginationActionsProps): JSX.Element;
|
|
11
|
+
export default TablePaginationActions;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { RefObject } from 'react';
|
|
2
|
-
declare function useClickOutside<T extends HTMLElement>(container: RefObject<T>, callback: () => void, disabled?: boolean): void;
|
|
2
|
+
declare function useClickOutside<T extends HTMLElement>(container: RefObject<T>, callback: (event?: MouseEvent | TouchEvent | KeyboardEvent) => void, disabled?: boolean): void;
|
|
3
3
|
export default useClickOutside;
|
package/dist/index.d.ts
CHANGED
|
@@ -92,3 +92,5 @@ export type { ErrorMessageProps } from './components/ErrorMessage';
|
|
|
92
92
|
export { DragDropFileProvider, useDragDropFileContext, } from './components/DragDropFile/DragDropFile.context';
|
|
93
93
|
export { default as DragDropFile } from './components/DragDropFile/DragDropFile';
|
|
94
94
|
export type { FileStatus, FileWithStatus, DropZoneProps, DragDropFileProviderProps, DragDropFileContextValue, } from './components/DragDropFile/types';
|
|
95
|
+
export { TablePagination } from './components/TablePagination';
|
|
96
|
+
export type { TablePaginationProps } from './components/TablePagination';
|