@carto/ps-react-ui 1.3.1 → 2.0.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/index.cjs +27 -0
- package/dist/index.js +878 -0
- package/dist/types/components/index.d.ts +4 -23
- package/dist/types/components/list-data/index.d.ts +2 -0
- package/dist/types/components/{list/list.component.d.ts → list-data/list-data.component.d.ts} +7 -6
- package/dist/types/components/list-data/list-data.stories.d.ts +53 -0
- package/dist/types/components/list-data/list-data.styles.d.ts +6 -0
- package/dist/types/components/{list → list-data}/types.d.ts +7 -7
- package/dist/types/components/map/components/deckgl-map/deckgl-maps.component.d.ts +2 -0
- package/dist/types/components/map/components/deckgl-map/deckgl-maps.stories.d.ts +83 -0
- package/dist/types/components/map/components/google-maps/google-maps.component.d.ts +2 -0
- package/dist/types/components/map/components/google-maps/google-maps.stories.d.ts +85 -0
- package/dist/types/components/map/index.d.ts +4 -0
- package/dist/types/components/map/map.component.d.ts +2 -0
- package/dist/types/components/map/map.stories.d.ts +92 -0
- package/dist/types/components/map/types.d.ts +67 -0
- package/dist/types/components/scroll-to-anchor/index.d.ts +2 -0
- package/dist/types/components/scroll-to-anchor/scroll-to-anchor.component.d.ts +34 -0
- package/dist/types/components/scroll-to-anchor/scroll-to-anchor.stories.d.ts +42 -0
- package/dist/types/components/scroll-to-anchor/scroll-to-anchor.styles.d.ts +13 -0
- package/dist/types/components/scroll-to-anchor/types.d.ts +10 -0
- package/dist/types/components/section-container/index.d.ts +2 -0
- package/dist/types/components/section-container/section-container.component.d.ts +1 -0
- package/dist/types/components/section-container/section-container.stories.d.ts +5 -0
- package/dist/types/components/section-container/section-container.styles.d.ts +32 -0
- package/dist/types/components/section-container/types.d.ts +2 -1
- package/dist/types/components/tabs-to-anchor/index.d.ts +2 -0
- package/dist/types/components/tabs-to-anchor/tabs-to-anchor.component.d.ts +1 -1
- package/dist/types/components/tabs-to-anchor/tabs-to-anchor.stories.d.ts +30 -0
- package/dist/types/components/tabs-to-anchor/tabs-to-anchor.styles.d.ts +23 -0
- package/dist/types/components/tabs-to-anchor/types.d.ts +2 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/create-select-options-from-array.utils.d.ts +5 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +49 -36
- package/dist/ps-react-ui.js +0 -21290
- package/dist/types/components/button-warning/button-warning.component.d.ts +0 -31
- package/dist/types/components/button-warning/icon-button-warning.d.ts +0 -31
- package/dist/types/components/button-warning/styles.d.ts +0 -29
- package/dist/types/components/button-warning/types.d.ts +0 -16
- package/dist/types/components/grouped-chips/grouped-chips.component.d.ts +0 -30
- package/dist/types/components/grouped-chips/types.d.ts +0 -15
- package/dist/types/components/input-file/input-file.component.d.ts +0 -45
- package/dist/types/components/input-file/types.d.ts +0 -17
- package/dist/types/components/selects/autocomplete/autocomplete-select/autocomplete-select.component.d.ts +0 -39
- package/dist/types/components/selects/autocomplete/autocomplete-select-simple/autocomplete-select-simple.component.d.ts +0 -35
- package/dist/types/components/selects/autocomplete/commons/autocomplete-select-option.component.d.ts +0 -2
- package/dist/types/components/selects/autocomplete/commons/listbox-select.component.d.ts +0 -19
- package/dist/types/components/selects/simple-select/create-options-from-array.utils.d.ts +0 -2
- package/dist/types/components/selects/simple-select/simple-select.component.d.ts +0 -25
- package/dist/types/components/selects/types.d.ts +0 -36
- package/dist/types/components/table/components/table-body.component.d.ts +0 -32
- package/dist/types/components/table/components/table-cell.component.d.ts +0 -31
- package/dist/types/components/table/components/table-header.component.d.ts +0 -27
- package/dist/types/components/table/table.component.d.ts +0 -39
- package/dist/types/components/table/types.d.ts +0 -90
- package/dist/types/components/table/utils.d.ts +0 -4
- package/dist/types/styling/index.d.ts +0 -1
- package/dist/types/styling/types.d.ts +0 -4
@@ -1,31 +0,0 @@
|
|
1
|
-
import { ButtonWarningProps } from './types';
|
2
|
-
export declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"buttonWarning">;
|
3
|
-
/**
|
4
|
-
* ButtonWarning component is used to display a warning button with a custom style.
|
5
|
-
*
|
6
|
-
* @param {ButtonWarningProps} props - Material UI Button props
|
7
|
-
*
|
8
|
-
* @defaultValues
|
9
|
-
*
|
10
|
-
* | Prop | Value |
|
11
|
-
* | --- | --- |
|
12
|
-
* | `variant` | `'contained'` |
|
13
|
-
* | `size` | `'medium'` |
|
14
|
-
*
|
15
|
-
* @remarks
|
16
|
-
* The ButtonWarning component is a wrapper around the Material UI Button component. More information about the props can be found here: https://v4.mui.com/api/button/
|
17
|
-
*
|
18
|
-
* @example
|
19
|
-
*
|
20
|
-
* ```jsx
|
21
|
-
* <ButtonWarning
|
22
|
-
* variant="contained"
|
23
|
-
* size="medium"
|
24
|
-
* startIcon={<Icon />}
|
25
|
-
* endIcon={<Icon />}
|
26
|
-
* disabled={false}
|
27
|
-
* onClick={(): void => {}}
|
28
|
-
* >
|
29
|
-
* ```
|
30
|
-
*/
|
31
|
-
export declare function ButtonWarning({ children, variant, size, startIcon, endIcon, disabled, onClick, ...props }: ButtonWarningProps): JSX.Element;
|
@@ -1,31 +0,0 @@
|
|
1
|
-
import { IconButtonWarningProps } from './types';
|
2
|
-
export declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"buttonWarning" | "iconButtonWarning">;
|
3
|
-
/**
|
4
|
-
* IconButtonWarning component is used to display a warning button with a custom style.
|
5
|
-
*
|
6
|
-
* @param {IconButtonWarningProps} props
|
7
|
-
*
|
8
|
-
* @defaultValues
|
9
|
-
*
|
10
|
-
* | Prop | Value |
|
11
|
-
* | --- | --- |
|
12
|
-
* | `variant` | `'text'` |
|
13
|
-
* | `size` | `'medium'` |
|
14
|
-
*
|
15
|
-
* @remarks
|
16
|
-
* The ButtonWarning component is a wrapper around the Material UI Button component. More information about the props can be found here: https://v4.mui.com/api/icon-button/
|
17
|
-
*
|
18
|
-
* @example
|
19
|
-
*
|
20
|
-
* ```jsx
|
21
|
-
* <ButtonWarning
|
22
|
-
* variant="contained"
|
23
|
-
* size="medium"
|
24
|
-
* startIcon={<Icon />}
|
25
|
-
* endIcon={<Icon />}
|
26
|
-
* disabled={false}
|
27
|
-
* onClick={(): void => {}}
|
28
|
-
* >
|
29
|
-
* ```
|
30
|
-
*/
|
31
|
-
export declare function IconButtonWarning({ children, variant, size, disabled, onClick, ...props }: IconButtonWarningProps): JSX.Element;
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import { Theme } from '@material-ui/core';
|
2
|
-
export declare const styles: ({ palette }: Theme) => {
|
3
|
-
buttonWarning: {
|
4
|
-
backgroundColor: string;
|
5
|
-
color: string;
|
6
|
-
'&:hover': {
|
7
|
-
backgroundColor: string;
|
8
|
-
};
|
9
|
-
'&.text': {
|
10
|
-
backgroundColor: string;
|
11
|
-
color: string;
|
12
|
-
'&:hover': {
|
13
|
-
backgroundColor: string;
|
14
|
-
};
|
15
|
-
};
|
16
|
-
'&.outlined': {
|
17
|
-
backgroundColor: string;
|
18
|
-
borderColor: string;
|
19
|
-
color: string;
|
20
|
-
'&:hover': {
|
21
|
-
borderColor: string;
|
22
|
-
color: string;
|
23
|
-
};
|
24
|
-
};
|
25
|
-
'&.Mui-disabled': {
|
26
|
-
opacity: number;
|
27
|
-
};
|
28
|
-
};
|
29
|
-
};
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import type { ButtonProps } from '@material-ui/core';
|
2
|
-
interface ButtonWarningBase extends ButtonProps {
|
3
|
-
variant?: 'text' | 'outlined' | 'contained';
|
4
|
-
children: JSX.Element;
|
5
|
-
disabled?: boolean;
|
6
|
-
onClick?: () => void;
|
7
|
-
}
|
8
|
-
export interface IconButtonWarningProps extends ButtonWarningBase {
|
9
|
-
size?: 'medium' | 'small';
|
10
|
-
}
|
11
|
-
export interface ButtonWarningProps extends ButtonWarningBase {
|
12
|
-
size?: 'medium' | 'small' | 'large';
|
13
|
-
startIcon?: JSX.Element;
|
14
|
-
endIcon?: JSX.Element;
|
15
|
-
}
|
16
|
-
export {};
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import { GroupedChipsProps } from './types';
|
2
|
-
/**
|
3
|
-
* GroupedChips component is used to group chips in a single component.
|
4
|
-
*
|
5
|
-
* @param {GroupedChipsProps} props - Material UI Chip props
|
6
|
-
*
|
7
|
-
* @defaultValues
|
8
|
-
*
|
9
|
-
* | Prop | Value |
|
10
|
-
* | --- | --- |
|
11
|
-
* | `size` | `'medium'` |
|
12
|
-
*
|
13
|
-
* @remarks
|
14
|
-
* The Chip component is a wrapper around the Material UI Chip component. More information about the props can be found here: https://v4.mui.com/api/chip/
|
15
|
-
*
|
16
|
-
* @example
|
17
|
-
*
|
18
|
-
* ```jsx
|
19
|
-
* <GroupedChips
|
20
|
-
* items={[
|
21
|
-
* { id: '1', label: 'Option 1', info: 'Option 1 is the prefered option if you prefer one.' },
|
22
|
-
* { id: '2', label: 'Option 2' },
|
23
|
-
* ]}
|
24
|
-
* label='Select'
|
25
|
-
* size='small'
|
26
|
-
* onDelete={onDelete}
|
27
|
-
* />;
|
28
|
-
* ```
|
29
|
-
*/
|
30
|
-
export declare function GroupedChips({ label, items, size, onDelete, ChipProps, BoxProps, TooltipProps, }: GroupedChipsProps): JSX.Element;
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import type { BoxProps, ChipProps, TooltipProps } from '@material-ui/core';
|
2
|
-
export interface GroupedChipsOption {
|
3
|
-
id: string | number;
|
4
|
-
label: string;
|
5
|
-
info?: string;
|
6
|
-
}
|
7
|
-
export interface GroupedChipsProps {
|
8
|
-
label?: string;
|
9
|
-
items: GroupedChipsOption[];
|
10
|
-
size?: 'small' | 'medium';
|
11
|
-
onDelete: (item: GroupedChipsOption) => void;
|
12
|
-
ChipProps?: ChipProps;
|
13
|
-
BoxProps?: BoxProps;
|
14
|
-
TooltipProps?: TooltipProps;
|
15
|
-
}
|
@@ -1,45 +0,0 @@
|
|
1
|
-
import { InputFileProps } from './types';
|
2
|
-
/**
|
3
|
-
* `InputFile` allow users to upload files into a UI.
|
4
|
-
*
|
5
|
-
* @param {InputFileProps} props - InputFile props
|
6
|
-
*
|
7
|
-
* @defaultValues
|
8
|
-
*
|
9
|
-
* | Prop | Value |
|
10
|
-
* | --- | --- |
|
11
|
-
* | `id` | `'fileupload'` |
|
12
|
-
* | `placeholder` | `'Upload file'` |
|
13
|
-
* | `buttonText` | `'Browse'` |
|
14
|
-
* | `multipleSummaryText` | `'files selected'` |
|
15
|
-
* | `accept` | `'application/JSON'` |
|
16
|
-
* | `multiple` | `false` |
|
17
|
-
* | `required` | `false` |
|
18
|
-
* | `disabled` | `false` |
|
19
|
-
* | `error` | `false` |
|
20
|
-
* | `variant` | `'outlined'` |
|
21
|
-
* | `defaultValue` | `[]` |
|
22
|
-
*
|
23
|
-
* @example
|
24
|
-
*
|
25
|
-
* ```ts
|
26
|
-
* <InputFile
|
27
|
-
* id='fileupload'
|
28
|
-
* placeholder='Upload file'
|
29
|
-
* description='Drag and drop or click to select files',
|
30
|
-
* buttonText='Browse'
|
31
|
-
* multipleSummaryText='files selected'
|
32
|
-
* accept='*'
|
33
|
-
* multiple={false}
|
34
|
-
* required={false},
|
35
|
-
* disabled={false}
|
36
|
-
* error={false}
|
37
|
-
* variant='filled'
|
38
|
-
* defaultValue={[]}
|
39
|
-
* onChange={(files: File[]) => {})}
|
40
|
-
* />
|
41
|
-
* ```
|
42
|
-
*
|
43
|
-
* **@alpha**
|
44
|
-
*/
|
45
|
-
export declare function InputFile({ id, placeholder, buttonText, multipleSummaryText, helperText, accept, multiple, required, disabled, error, variant, defaultValue, onChange, }: InputFileProps): JSX.Element;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
/// <reference types="web" />
|
2
|
-
export declare type Variant = 'outlined' | 'filled';
|
3
|
-
export interface InputFileProps {
|
4
|
-
id?: string;
|
5
|
-
placeholder?: string;
|
6
|
-
buttonText?: string;
|
7
|
-
multipleSummaryText?: string;
|
8
|
-
helperText?: string;
|
9
|
-
accept?: string;
|
10
|
-
required?: boolean;
|
11
|
-
multiple?: boolean;
|
12
|
-
disabled?: boolean;
|
13
|
-
error?: boolean;
|
14
|
-
variant?: Variant;
|
15
|
-
defaultValue?: File[] | undefined;
|
16
|
-
onChange: (files: File[]) => void;
|
17
|
-
}
|
@@ -1,39 +0,0 @@
|
|
1
|
-
import { AutocompleteSelectProps } from '../../types';
|
2
|
-
/**
|
3
|
-
* AutocompleteSelect component
|
4
|
-
*
|
5
|
-
* @param {AutocompleteSelectProps} props - Material UI Autocomplete props
|
6
|
-
*
|
7
|
-
* @defaultValues
|
8
|
-
*
|
9
|
-
* | Prop | Value |
|
10
|
-
* | --- | --- |
|
11
|
-
* | `grouped` | `false` |
|
12
|
-
* | `hasAll` | `false` |
|
13
|
-
* | `placeholder` | `'Select'` |
|
14
|
-
* | `selectAllLabel` | `'Select all'` |
|
15
|
-
* | `size` | `'small'` |
|
16
|
-
*
|
17
|
-
* @remarks
|
18
|
-
* The AutocompleteSelect component is a wrapper around the Material UI Autocomplete component. More information about the props can be found here: https://v4.mui.com/api/autocomplete
|
19
|
-
*
|
20
|
-
* @example
|
21
|
-
*
|
22
|
-
* ```jsx
|
23
|
-
* <AutocompleteSelect
|
24
|
-
* options={[
|
25
|
-
* { value: '1', label: 'Option 1', group: 'Group 1' },
|
26
|
-
* { value: '2', label: 'Option 2', group: 'Group 1' },
|
27
|
-
* ]}
|
28
|
-
* hasAll={true}
|
29
|
-
* grouped={true}
|
30
|
-
* label='Select'
|
31
|
-
* placeholder='Select'
|
32
|
-
* selectAllLabel='Select all'
|
33
|
-
* size='small'
|
34
|
-
* value={value}
|
35
|
-
* onChange={onChange}
|
36
|
-
* />;
|
37
|
-
* ```
|
38
|
-
*/
|
39
|
-
export declare function AutocompleteSelect({ options, grouped, hasAll, label, placeholder, selectAllLabel, size, texts, value, RenderInputProps, onChange, ...props }: AutocompleteSelectProps): JSX.Element;
|
@@ -1,35 +0,0 @@
|
|
1
|
-
import { AutocompleteSelectSimpleProps } from '../../types';
|
2
|
-
/**
|
3
|
-
* AutocompleteSelectSimple component
|
4
|
-
*
|
5
|
-
* @param {AutocompleteSelectSimpleProps} props - Material UI Autocomplete props
|
6
|
-
*
|
7
|
-
* @defaultValues
|
8
|
-
*
|
9
|
-
* | Prop | Value |
|
10
|
-
* | --- | --- |
|
11
|
-
* | `grouped` | `false` |
|
12
|
-
* | `placeholder` | `'Select'` |
|
13
|
-
* | `size` | `'small'` |
|
14
|
-
*
|
15
|
-
* @remarks
|
16
|
-
* The AutocompleteSelectSimple component is a wrapper around the Material UI Autocomplete component. More information about the props can be found here: https://v4.mui.com/api/autocomplete
|
17
|
-
*
|
18
|
-
* @example
|
19
|
-
*
|
20
|
-
* ```jsx
|
21
|
-
* <AutocompleteSelectSimple
|
22
|
-
* options={[
|
23
|
-
* { value: '1', label: 'Option 1', group: 'Group 1' },
|
24
|
-
* { value: '2', label: 'Option 2', group: 'Group 1' },
|
25
|
-
* ]}
|
26
|
-
* grouped={true}
|
27
|
-
* label='Select'
|
28
|
-
* placeholder='Select'
|
29
|
-
* size='small'
|
30
|
-
* value={value}
|
31
|
-
* onChange={onChange}
|
32
|
-
* />;
|
33
|
-
* ```
|
34
|
-
*/
|
35
|
-
export declare function AutocompleteSelectSimple({ options, grouped, label, placeholder, size, value, onChange, ...props }: AutocompleteSelectSimpleProps): JSX.Element;
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
2
|
-
export declare type Props = PropsWithChildren<unknown> & {
|
3
|
-
hasAll: boolean;
|
4
|
-
grouped: boolean;
|
5
|
-
some: number;
|
6
|
-
selectAll: boolean;
|
7
|
-
selectAllLabel: string;
|
8
|
-
onChange: (state: boolean) => void;
|
9
|
-
};
|
10
|
-
export declare const ListboxSelect: React.ForwardRefExoticComponent<{
|
11
|
-
children?: React.ReactNode;
|
12
|
-
} & {
|
13
|
-
hasAll: boolean;
|
14
|
-
grouped: boolean;
|
15
|
-
some: number;
|
16
|
-
selectAll: boolean;
|
17
|
-
selectAllLabel: string;
|
18
|
-
onChange: (state: boolean) => void;
|
19
|
-
} & React.RefAttributes<HTMLUListElement>>;
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import { SimpleSelectProps } from '../types';
|
2
|
-
/**
|
3
|
-
* SimpleSelect component
|
4
|
-
*
|
5
|
-
* @param {SimpleSelectProps} props - Material UI Select props
|
6
|
-
*
|
7
|
-
* @remarks
|
8
|
-
* The SimpleSelect component is a wrapper around the Material UI Select component. More information about the props can be found here: https://v4.mui.com/api/select/
|
9
|
-
*
|
10
|
-
* @example
|
11
|
-
*
|
12
|
-
* ```jsx
|
13
|
-
* <SimpleSelect
|
14
|
-
* options={[
|
15
|
-
* { label: 'Option 1', value: '1' },
|
16
|
-
* { label: 'Option 2', value: '2' },
|
17
|
-
* ]}
|
18
|
-
* label='Select'
|
19
|
-
* placeholder='Select an option'
|
20
|
-
* value={value}
|
21
|
-
* onChange={onChange}
|
22
|
-
* >
|
23
|
-
* ```
|
24
|
-
*/
|
25
|
-
export declare function SimpleSelect({ options, label, placeholder, value, onChange, ...props }: SimpleSelectProps): JSX.Element;
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import type { ChangeEvent, ReactNode } from 'react';
|
2
|
-
import type { SelectProps } from '@material-ui/core/Select';
|
3
|
-
import { AutocompleteChangeDetails, AutocompleteChangeReason, AutocompleteProps, AutocompleteRenderOptionState, Value } from '@material-ui/lab';
|
4
|
-
import { TextFieldProps } from '@material-ui/core';
|
5
|
-
export interface SelectOption {
|
6
|
-
label: string;
|
7
|
-
value: string | number;
|
8
|
-
group?: string;
|
9
|
-
}
|
10
|
-
export interface SimpleSelectProps extends SelectProps {
|
11
|
-
options: SelectOption[];
|
12
|
-
placeholder?: string;
|
13
|
-
}
|
14
|
-
export interface OptionProps<T = SelectOption> {
|
15
|
-
option: T;
|
16
|
-
state: AutocompleteRenderOptionState;
|
17
|
-
simple?: boolean;
|
18
|
-
}
|
19
|
-
export interface AutocompleteSelectProps<T = SelectOption, Multiple extends boolean | undefined = true, DisableClearable extends boolean | undefined = undefined, FreeSolo extends boolean | undefined = undefined> extends Omit<AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>, 'onChange' | 'renderInput'> {
|
20
|
-
grouped?: boolean;
|
21
|
-
hasAll?: boolean;
|
22
|
-
label?: ReactNode;
|
23
|
-
selectAllLabel?: string;
|
24
|
-
RenderInputProps?: TextFieldProps;
|
25
|
-
texts?: {
|
26
|
-
renderTags: {
|
27
|
-
selected: string;
|
28
|
-
};
|
29
|
-
};
|
30
|
-
onChange: (event: ChangeEvent<unknown>, options: Value<T, Multiple, DisableClearable, FreeSolo>, reason: AutocompleteChangeReason, detail?: AutocompleteChangeDetails<T>) => void;
|
31
|
-
}
|
32
|
-
export interface AutocompleteSelectSimpleProps<T = SelectOption, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = undefined, FreeSolo extends boolean | undefined = undefined> extends Omit<AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>, 'onChange' | 'renderInput'> {
|
33
|
-
grouped?: boolean;
|
34
|
-
label?: ReactNode;
|
35
|
-
onChange: (event: ChangeEvent<unknown>, options: Value<T, Multiple, DisableClearable, FreeSolo>, reason: AutocompleteChangeReason, detail?: AutocompleteChangeDetails<T>) => void;
|
36
|
-
}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
import type { TableBodyProps, TData } from '../types';
|
2
|
-
/**
|
3
|
-
* `TableBody` component is a wrapper for Material-UI TableBody component.
|
4
|
-
*
|
5
|
-
* @param {TableBodyProps} props - TableBody props
|
6
|
-
*
|
7
|
-
* @defaultValues
|
8
|
-
*
|
9
|
-
* | Prop | Value |
|
10
|
-
* | --- | --- |
|
11
|
-
* | `orderBy` | `'id'` |
|
12
|
-
*
|
13
|
-
* @remarks
|
14
|
-
* The TableBody component is a wrapper around the Material UI TableBody component. More information about the props can be found here: https://v4.mui.com/api/table-body/
|
15
|
-
*
|
16
|
-
*
|
17
|
-
* @example
|
18
|
-
*
|
19
|
-
* ```ts
|
20
|
-
* <TableBody
|
21
|
-
* columns={COLUMNS}
|
22
|
-
* order='asc'
|
23
|
-
* page={0}
|
24
|
-
* rows={ROWS}
|
25
|
-
* rowPerPage={10}
|
26
|
-
* selected={[]}
|
27
|
-
* remote={false}
|
28
|
-
* dense={false}
|
29
|
-
* />
|
30
|
-
* ```
|
31
|
-
*/
|
32
|
-
export declare function TableBody<T extends TData>({ columns, order, page, rows, rowsPerPage, selected, clickable, coloredRow, dense, orderBy, pagination, remote, selectable, sortable, onRowClick, onSelect, }: TableBodyProps<T>): JSX.Element;
|
@@ -1,31 +0,0 @@
|
|
1
|
-
import type { TableCellProps, TData } from '../types';
|
2
|
-
/**
|
3
|
-
* `TableCell` component is a wrapper for Material-UI TableCell component.
|
4
|
-
*
|
5
|
-
* @param {TableCellProps} props - TableCell props
|
6
|
-
*
|
7
|
-
* @defaultValues
|
8
|
-
*
|
9
|
-
* | Prop | Value |
|
10
|
-
* | --- | --- |
|
11
|
-
* | `disabled` | `false` |
|
12
|
-
* | `noBorder` | `false` |
|
13
|
-
* | `clickable` | `false` |
|
14
|
-
*
|
15
|
-
* @remarks
|
16
|
-
* The TableCell component is a wrapper around the Material UI TableCell component. More information about the props can be found here: https://v4.mui.com/api/table-cell/
|
17
|
-
*
|
18
|
-
* @example
|
19
|
-
*
|
20
|
-
* ```ts
|
21
|
-
* <TableCell
|
22
|
-
* columns={COLUMNS}
|
23
|
-
* row={ROW}
|
24
|
-
* disabled={false}
|
25
|
-
* noBorder={false}
|
26
|
-
* clickable={true}
|
27
|
-
* onClick={handleClick}
|
28
|
-
* />
|
29
|
-
* ```
|
30
|
-
*/
|
31
|
-
export declare function TableCell<T extends TData>({ column, row, disabled, noBorder, clickable, onClick, }: TableCellProps<T>): JSX.Element;
|
@@ -1,27 +0,0 @@
|
|
1
|
-
import type { TableHeaderProps } from '../types';
|
2
|
-
/**
|
3
|
-
* `TableHeader` component is a wrapper for Material-UI TableHead component.
|
4
|
-
*
|
5
|
-
* @param {TableHeaderProps} props - TableHeader props
|
6
|
-
*
|
7
|
-
* @remarks
|
8
|
-
* The TableHeader component is a wrapper around the Material UI TableHead component. More information about the props can be found here: https://v4.mui.com/api/table-head/
|
9
|
-
*
|
10
|
-
*
|
11
|
-
* @example
|
12
|
-
*
|
13
|
-
* ```ts
|
14
|
-
* <TableHeader
|
15
|
-
* columns={COLUMNS}
|
16
|
-
* selectable={true}
|
17
|
-
* sortable={true}
|
18
|
-
* order='asc'
|
19
|
-
* orderBy='id'
|
20
|
-
* numSelected={1}
|
21
|
-
* rowCount={2}
|
22
|
-
* onSelectAll={() => {}}
|
23
|
-
* onSort={() => {}}
|
24
|
-
* />
|
25
|
-
* ```
|
26
|
-
*/
|
27
|
-
export declare function TableHeader({ columns, selectable, sortable, order, orderBy, numSelected, rowCount, dense, onSelectAll, onSort, }: TableHeaderProps): JSX.Element;
|
@@ -1,39 +0,0 @@
|
|
1
|
-
import { TableProps, TData } from './types';
|
2
|
-
/**
|
3
|
-
* `Table` component is a wrapper for Material-UI Table component.
|
4
|
-
*
|
5
|
-
* @param {TableProps} props - Table props
|
6
|
-
*
|
7
|
-
* @defaultValues
|
8
|
-
*
|
9
|
-
* | Prop | Value |
|
10
|
-
* | --- | --- |
|
11
|
-
* | `clickable` | `false` |
|
12
|
-
* | `fixedLayout` | `false` |
|
13
|
-
* | `order` | `'asc'` |
|
14
|
-
* | `orderBy` | `'id'` |
|
15
|
-
* | `pagination` | `false` |
|
16
|
-
* | `remote` | `false` |
|
17
|
-
* | `rowsPerPage` | `10` |
|
18
|
-
* | `rowsPerPageOptions` | `[10, 20, 30]` |
|
19
|
-
* | `selectable` | `false` |
|
20
|
-
* | `sort` | `false` |
|
21
|
-
*
|
22
|
-
* @remarks
|
23
|
-
* The Table component is a wrapper around the Material UI Table component. More information about the props can be found here: https://v4.mui.com/api/table/
|
24
|
-
*
|
25
|
-
* @example
|
26
|
-
*
|
27
|
-
* ```ts
|
28
|
-
* <Table
|
29
|
-
* title='Section title'
|
30
|
-
* columns={COLUMNS}
|
31
|
-
* rows={ROWS}
|
32
|
-
* sort={false}
|
33
|
-
* selectable={false}
|
34
|
-
* clickable={true}
|
35
|
-
* onRowClick={(row) => console.log(row)}
|
36
|
-
* />
|
37
|
-
* ```
|
38
|
-
*/
|
39
|
-
export declare function Table<T extends TData>({ columns, rows, clickable, colorRows, dense, fixedLayout, order, orderBy, page, pagination, remote, rowsPerPage, rowsPerPageOptions, selectable, sort, TableProps, onSelect, onOrderChange, onChangePage, onChangeRowsPerPage, onRowClick, }: TableProps<T>): JSX.Element;
|
@@ -1,90 +0,0 @@
|
|
1
|
-
import type { ChangeEvent, CSSProperties } from 'react';
|
2
|
-
import type { TableProps as MaterialTableProps } from '@material-ui/core';
|
3
|
-
export declare type Alignment = 'left' | 'right' | 'center';
|
4
|
-
export declare type Order = 'desc' | 'asc';
|
5
|
-
export interface TableCellInterface {
|
6
|
-
id: string | number;
|
7
|
-
field: string;
|
8
|
-
headerName: string;
|
9
|
-
sort?: boolean;
|
10
|
-
width?: number | string;
|
11
|
-
maxWidth?: number | string;
|
12
|
-
minWidth?: number | string;
|
13
|
-
align?: Alignment;
|
14
|
-
colSpan?: number;
|
15
|
-
disabled?: boolean;
|
16
|
-
component?: JSX.Element;
|
17
|
-
disablePadding?: boolean;
|
18
|
-
}
|
19
|
-
export interface TableProps<T extends TData = TData> {
|
20
|
-
columns: TableCellInterface[];
|
21
|
-
rows: T[];
|
22
|
-
clickable?: boolean;
|
23
|
-
colorRows?: boolean;
|
24
|
-
dense?: boolean;
|
25
|
-
fixedLayout?: boolean;
|
26
|
-
order?: Order;
|
27
|
-
orderBy?: string;
|
28
|
-
page?: number;
|
29
|
-
pagination?: boolean;
|
30
|
-
remote?: boolean;
|
31
|
-
rowsPerPage?: number;
|
32
|
-
rowsPerPageOptions?: number[];
|
33
|
-
selectable?: boolean;
|
34
|
-
sort?: boolean;
|
35
|
-
TableProps?: MaterialTableProps;
|
36
|
-
onChangePage?: (data: number) => void;
|
37
|
-
onChangeRowsPerPage?: (data: number) => void;
|
38
|
-
onOrderChange?: (orderBy: string, order: Order) => void;
|
39
|
-
onRowClick?: (row: T) => void;
|
40
|
-
onSelect?: (id: TData['id'][]) => void;
|
41
|
-
}
|
42
|
-
export interface TableHeaderProps {
|
43
|
-
columns: TableCellInterface[];
|
44
|
-
numSelected: number;
|
45
|
-
rowCount: number;
|
46
|
-
dense?: boolean;
|
47
|
-
order: Order;
|
48
|
-
orderBy?: string;
|
49
|
-
selectable?: boolean;
|
50
|
-
sortable?: boolean;
|
51
|
-
onSelectAll?: (event: ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
52
|
-
onSort?: (data: TableCellInterface['field']) => void;
|
53
|
-
}
|
54
|
-
export interface TableBodyProps<T extends TData> {
|
55
|
-
columns: TableCellInterface[];
|
56
|
-
order: Order;
|
57
|
-
page: number;
|
58
|
-
rows: T[];
|
59
|
-
rowsPerPage: number;
|
60
|
-
selected: (string | number)[];
|
61
|
-
clickable?: boolean;
|
62
|
-
coloredRow?: boolean;
|
63
|
-
dense?: boolean;
|
64
|
-
orderBy?: string;
|
65
|
-
pagination?: boolean;
|
66
|
-
remote?: boolean;
|
67
|
-
selectable?: boolean;
|
68
|
-
sortable?: boolean;
|
69
|
-
onRowClick?: (row: T) => void;
|
70
|
-
onSelect?: (id: TData['id']) => void;
|
71
|
-
}
|
72
|
-
export interface TableBodyCellProps<T extends TData> {
|
73
|
-
columns: TableCellInterface[];
|
74
|
-
index: number;
|
75
|
-
row: T;
|
76
|
-
clickable?: boolean;
|
77
|
-
onClick?: (row: T) => void;
|
78
|
-
}
|
79
|
-
export interface TableCellProps<T extends TData> {
|
80
|
-
column: TableCellInterface;
|
81
|
-
row: T;
|
82
|
-
clickable?: boolean;
|
83
|
-
disabled?: boolean;
|
84
|
-
noBorder?: boolean;
|
85
|
-
onClick?: (row: T) => void;
|
86
|
-
}
|
87
|
-
export declare type TData = {
|
88
|
-
id: string | number;
|
89
|
-
style?: CSSProperties;
|
90
|
-
} & Record<string, unknown>;
|
@@ -1,4 +0,0 @@
|
|
1
|
-
import type { TData } from './types';
|
2
|
-
export declare function getComparator<T extends TData>(order: string, orderBy: string): (a: T, b: T) => number;
|
3
|
-
export declare function stableSort<T>(data: T[], comparator: (a: T, b: T) => number): T[];
|
4
|
-
export declare function ascendingComparator<T extends TData>(a: T, b: T, orderBy: string): number;
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './types';
|