@campxdev/react-blueprint 2.0.11 → 2.1.1
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/cjs/index.js +1 -1
- package/dist/cjs/types/src/components/Assets/Icons/IconComponents/UpArrow.d.ts +5 -0
- package/dist/cjs/types/src/components/Assets/Icons/Icons.d.ts +1 -0
- package/dist/cjs/types/src/components/Input/MultiSelect/MultiSelect.d.ts +47 -0
- package/dist/cjs/types/src/components/Input/MultiSelect/components/MenuFooter.d.ts +3 -0
- package/dist/cjs/types/src/components/Input/MultiSelect/components/MultiFilter.d.ts +19 -0
- package/dist/cjs/types/src/components/Input/MultiSelect/components/MultiInput.d.ts +19 -0
- package/dist/cjs/types/src/components/Input/MultiSelect/components/OptionsLoader.d.ts +3 -0
- package/dist/cjs/types/src/components/Input/MultiSelect/multiSelectReducer.d.ts +42 -0
- package/dist/cjs/types/src/components/Input/export.d.ts +1 -0
- package/dist/cjs/types/src/stories/Input/MultiSelect.stories.d.ts +16 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/types/src/components/Assets/Icons/IconComponents/UpArrow.d.ts +5 -0
- package/dist/esm/types/src/components/Assets/Icons/Icons.d.ts +1 -0
- package/dist/esm/types/src/components/Input/MultiSelect/MultiSelect.d.ts +47 -0
- package/dist/esm/types/src/components/Input/MultiSelect/components/MenuFooter.d.ts +3 -0
- package/dist/esm/types/src/components/Input/MultiSelect/components/MultiFilter.d.ts +19 -0
- package/dist/esm/types/src/components/Input/MultiSelect/components/MultiInput.d.ts +19 -0
- package/dist/esm/types/src/components/Input/MultiSelect/components/OptionsLoader.d.ts +3 -0
- package/dist/esm/types/src/components/Input/MultiSelect/multiSelectReducer.d.ts +42 -0
- package/dist/esm/types/src/components/Input/export.d.ts +1 -0
- package/dist/esm/types/src/stories/Input/MultiSelect.stories.d.ts +16 -0
- package/dist/index.d.ts +47 -2
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AutocompleteProps } from '@mui/material';
|
|
2
|
+
import { AxiosInstance } from 'axios';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
declare module '@mui/material/Autocomplete' {
|
|
5
|
+
interface AutocompletePaperSlotPropsOverrides {
|
|
6
|
+
loadingOptions: boolean;
|
|
7
|
+
isSearch: boolean;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export type MultiSelectProps = {
|
|
11
|
+
options?: {
|
|
12
|
+
label: string;
|
|
13
|
+
subLabel?: string;
|
|
14
|
+
value: any;
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
}[] | any[];
|
|
17
|
+
optionsApiEndPoint?: string;
|
|
18
|
+
optionsApiEndpointParams?: any;
|
|
19
|
+
externalAxios?: AxiosInstance;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
label?: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
getValue?: (option: any) => any;
|
|
24
|
+
dbValueProps?: {
|
|
25
|
+
valueKey: string;
|
|
26
|
+
isObjectId?: boolean;
|
|
27
|
+
isInt?: boolean;
|
|
28
|
+
isFloat?: boolean;
|
|
29
|
+
};
|
|
30
|
+
dbLabelProps?: {
|
|
31
|
+
labelKey: string;
|
|
32
|
+
subLabelKey?: string;
|
|
33
|
+
useLabelStartCase?: boolean;
|
|
34
|
+
useSubLabelStartCase?: boolean;
|
|
35
|
+
};
|
|
36
|
+
onChange?: (value: any) => void;
|
|
37
|
+
error?: any;
|
|
38
|
+
helperText?: string;
|
|
39
|
+
type?: 'input' | 'filter';
|
|
40
|
+
disableClear?: boolean;
|
|
41
|
+
} & Omit<AutocompleteProps<{
|
|
42
|
+
label: string;
|
|
43
|
+
subLabel?: string;
|
|
44
|
+
value: any;
|
|
45
|
+
} | any, false, true, false>, 'options' | 'open' | 'onChange' | 'autoFocus' | 'PaperComponent' | 'renderOption' | 'options' | 'renderInput'>;
|
|
46
|
+
export declare const MultiSelect: ({ options, optionsApiEndPoint, optionsApiEndpointParams, externalAxios, getValue, value, onChange, dbValueProps, dbLabelProps, onOpen, onClose, type, ...restProps }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export default MultiSelect;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AutocompleteCloseReason } from '@mui/material';
|
|
2
|
+
import { SyntheticEvent } from 'react';
|
|
3
|
+
import { MultiSelectProps } from '../../../export';
|
|
4
|
+
import { MultiSelectState } from '../multiSelectReducer';
|
|
5
|
+
declare module '@mui/material/Autocomplete' {
|
|
6
|
+
interface AutocompletePaperSlotPropsOverrides {
|
|
7
|
+
loadingOptions: boolean;
|
|
8
|
+
isSearch: boolean;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export type MultiFilterProps = {
|
|
12
|
+
onChange: (value: any) => void;
|
|
13
|
+
searchDb: (searchValue: string) => Promise<void>;
|
|
14
|
+
handleOpen: (event: SyntheticEvent) => Promise<void>;
|
|
15
|
+
handleClose: (event: SyntheticEvent, reason: AutocompleteCloseReason) => void;
|
|
16
|
+
handleScroll: (event: any) => Promise<void>;
|
|
17
|
+
state: MultiSelectState;
|
|
18
|
+
} & MultiSelectProps;
|
|
19
|
+
export declare const MultiFilter: ({ options, optionsApiEndPoint, optionsApiEndpointParams, externalAxios, required, label, name, getValue, value, onChange, error, helperText, dbValueProps, dbLabelProps, onOpen, onClose, searchDb, handleOpen, handleClose, handleScroll, state, disableClear, ...restProps }: MultiFilterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AutocompleteCloseReason } from '@mui/material';
|
|
2
|
+
import { SyntheticEvent } from 'react';
|
|
3
|
+
import { MultiSelectProps } from '../../../export';
|
|
4
|
+
import { MultiSelectState } from '../multiSelectReducer';
|
|
5
|
+
declare module '@mui/material/Autocomplete' {
|
|
6
|
+
interface AutocompletePaperSlotPropsOverrides {
|
|
7
|
+
loadingOptions: boolean;
|
|
8
|
+
isSearch: boolean;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export type MultiInputProps = {
|
|
12
|
+
onChange: (value: any) => void;
|
|
13
|
+
searchDb: (searchValue: string) => Promise<void>;
|
|
14
|
+
handleOpen: (event: SyntheticEvent) => Promise<void>;
|
|
15
|
+
handleClose: (event: SyntheticEvent, reason: AutocompleteCloseReason) => void;
|
|
16
|
+
handleScroll: (event: any) => Promise<void>;
|
|
17
|
+
state: MultiSelectState;
|
|
18
|
+
} & MultiSelectProps;
|
|
19
|
+
export declare const MultiInput: ({ required, optionsApiEndPoint, label, name, getValue, value, onChange, error, helperText, dbLabelProps, searchDb, handleOpen, handleClose, handleScroll, state, disableClear, ...restProps }: MultiInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Reducer } from 'react';
|
|
2
|
+
export declare enum MultiSelectActionsTypes {
|
|
3
|
+
OPEN = "open",
|
|
4
|
+
CLOSE = "close",
|
|
5
|
+
LOAD_INTERNAL_OPTIONS_START = "load_internal_options_start",
|
|
6
|
+
LOAD_INTERNAL_OPTIONS_END = "load_internal_options_end",
|
|
7
|
+
LOAD_SELECTED_OPTIONS_START = "load_selected_options_start",
|
|
8
|
+
LOAD_SELECTED_OPTIONS_END = "load_selected_options_end",
|
|
9
|
+
SET_NETWORK_ERROR = "set_network_error",
|
|
10
|
+
SET_INTERNAL_OPTIONS = "set_internal_options",
|
|
11
|
+
APPEND_INTERNAL_OPTIONS = "append_internal_options",
|
|
12
|
+
CHANGE_HAS_MORE_FLAG = "change_has_more_flag",
|
|
13
|
+
SET_SEARCH = "set_search",
|
|
14
|
+
CLEAR_SEARCH = "clear_search"
|
|
15
|
+
}
|
|
16
|
+
export type Option = {
|
|
17
|
+
label: string;
|
|
18
|
+
subLabel?: string;
|
|
19
|
+
value: any;
|
|
20
|
+
};
|
|
21
|
+
export type MultiSelectState = {
|
|
22
|
+
open: boolean;
|
|
23
|
+
loadingInternalOptions: boolean;
|
|
24
|
+
loadingInitialInternalOptions: boolean;
|
|
25
|
+
internalOptions: Option[];
|
|
26
|
+
internalOptionsMap: {
|
|
27
|
+
[x: string]: Option;
|
|
28
|
+
};
|
|
29
|
+
limit: number;
|
|
30
|
+
offset: number;
|
|
31
|
+
hasMore: boolean;
|
|
32
|
+
search: string | null;
|
|
33
|
+
error?: any;
|
|
34
|
+
};
|
|
35
|
+
export type MultiSelectAction = {
|
|
36
|
+
actionType: MultiSelectActionsTypes;
|
|
37
|
+
stateChanges?: Partial<MultiSelectState> & {
|
|
38
|
+
persistOffset?: boolean;
|
|
39
|
+
newOptions?: Option[];
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export declare const multiSelectReducer: Reducer<MultiSelectState, MultiSelectAction>;
|
|
@@ -14,6 +14,7 @@ export * from './SearchBar/SearchBar';
|
|
|
14
14
|
export * from './Select/Select';
|
|
15
15
|
export * from './SingleCheckBox/SingleCheckBox';
|
|
16
16
|
export * from './SingleSelect/SingleSelect';
|
|
17
|
+
export * from './MultiSelect/MultiSelect';
|
|
17
18
|
export * from './Switch/Switch';
|
|
18
19
|
export * from './TextField/TextField';
|
|
19
20
|
export * from './TimePicker/TimePicker';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { MultiSelect, MultiSelectProps } from '../../components/Input/MultiSelect/MultiSelect';
|
|
3
|
+
declare const _default: Meta<typeof MultiSelect>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Default: {
|
|
6
|
+
render: (args: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
args: {
|
|
8
|
+
label: string;
|
|
9
|
+
required: boolean;
|
|
10
|
+
options: {
|
|
11
|
+
label: string;
|
|
12
|
+
value: number;
|
|
13
|
+
}[];
|
|
14
|
+
onChange: () => void;
|
|
15
|
+
};
|
|
16
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -127,6 +127,7 @@ type IconsType = {
|
|
|
127
127
|
DocumentIcon: IconComponent;
|
|
128
128
|
DoneSquare: IconComponent;
|
|
129
129
|
DownArrow: IconComponent;
|
|
130
|
+
UpArrow: IconComponent;
|
|
130
131
|
DownloadIcon: IconComponent;
|
|
131
132
|
DFormsIcon: IconComponent;
|
|
132
133
|
EditIcon: IconComponent;
|
|
@@ -868,6 +869,50 @@ type SingleSelectProps = {
|
|
|
868
869
|
} | any, false, true, false>, 'options' | 'open' | 'onChange' | 'autoFocus' | 'PaperComponent' | 'renderOption' | 'options' | 'renderInput'>;
|
|
869
870
|
declare const SingleSelect: ({ options, optionsApiEndPoint, optionsApiEndpointParams, externalAxios, getValue, value, onChange, dbValueProps, dbLabelProps, onOpen, onClose, type, ...restProps }: SingleSelectProps) => react_jsx_runtime.JSX.Element;
|
|
870
871
|
|
|
872
|
+
declare module '@mui/material/Autocomplete' {
|
|
873
|
+
interface AutocompletePaperSlotPropsOverrides {
|
|
874
|
+
loadingOptions: boolean;
|
|
875
|
+
isSearch: boolean;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
type MultiSelectProps = {
|
|
879
|
+
options?: {
|
|
880
|
+
label: string;
|
|
881
|
+
subLabel?: string;
|
|
882
|
+
value: any;
|
|
883
|
+
icon?: ReactNode;
|
|
884
|
+
}[] | any[];
|
|
885
|
+
optionsApiEndPoint?: string;
|
|
886
|
+
optionsApiEndpointParams?: any;
|
|
887
|
+
externalAxios?: AxiosInstance;
|
|
888
|
+
required?: boolean;
|
|
889
|
+
label?: string;
|
|
890
|
+
name?: string;
|
|
891
|
+
getValue?: (option: any) => any;
|
|
892
|
+
dbValueProps?: {
|
|
893
|
+
valueKey: string;
|
|
894
|
+
isObjectId?: boolean;
|
|
895
|
+
isInt?: boolean;
|
|
896
|
+
isFloat?: boolean;
|
|
897
|
+
};
|
|
898
|
+
dbLabelProps?: {
|
|
899
|
+
labelKey: string;
|
|
900
|
+
subLabelKey?: string;
|
|
901
|
+
useLabelStartCase?: boolean;
|
|
902
|
+
useSubLabelStartCase?: boolean;
|
|
903
|
+
};
|
|
904
|
+
onChange?: (value: any) => void;
|
|
905
|
+
error?: any;
|
|
906
|
+
helperText?: string;
|
|
907
|
+
type?: 'input' | 'filter';
|
|
908
|
+
disableClear?: boolean;
|
|
909
|
+
} & Omit<AutocompleteProps<{
|
|
910
|
+
label: string;
|
|
911
|
+
subLabel?: string;
|
|
912
|
+
value: any;
|
|
913
|
+
} | any, false, true, false>, 'options' | 'open' | 'onChange' | 'autoFocus' | 'PaperComponent' | 'renderOption' | 'options' | 'renderInput'>;
|
|
914
|
+
declare const MultiSelect: ({ options, optionsApiEndPoint, optionsApiEndpointParams, externalAxios, getValue, value, onChange, dbValueProps, dbLabelProps, onOpen, onClose, type, ...restProps }: MultiSelectProps) => react_jsx_runtime.JSX.Element;
|
|
915
|
+
|
|
871
916
|
type SwitchProps = {} & SwitchProps$1;
|
|
872
917
|
declare const Switch: (props: SwitchProps) => react_jsx_runtime.JSX.Element;
|
|
873
918
|
|
|
@@ -1199,5 +1244,5 @@ declare const splitBreadcrumbIdSlug: (param: string) => {
|
|
|
1199
1244
|
declare const isLocal: boolean;
|
|
1200
1245
|
declare const isDevelopment: boolean;
|
|
1201
1246
|
|
|
1202
|
-
export { Accordion, AccordionGroup, ActivityLogView, Alert, AnimatedGIFs, AppHeader, BarChart, Breadcrumbs, Button, Card, CellContainer, CenterBox, Chips, CircularAvatar, ComingSoon, ConfirmDialog, DataTable, DatePicker, DateTimePicker, DensitySelector, Dialog, DialogButton, DropDownButton, DropDownIcon, DropdownMenu, DropdownMenuItem, EditableDataTable, EditableTableCore, EmptyIllustration, FileUpload, FloatingContent, FooterContainerContainer, FormActions, FormControlWrapper, FormWrapper, IconButtons, Icons, InternalServerError, LabelWrapper, LineChart, MuiThemeProvider, MultiCheckBox, NoInterneConnection, NoItemFound, OtpInput, PageContent, PageHeader, PageNotFound, PasswordField, PieChart, PreviewFiles, ProgressCard, RadioGroup, SearchBar, Select, SidePanel, SidePanelVariables, Sidebar, SingleCheckBox, SingleSelect, Snackbar, Spinner, SquareAvatar, StatusCard, Stepper, StyledContainer, Svgs, Switch, TableColumnsSelector, TableColumnsSelectorMenuFooter, TabsContainer, TabsLayout, TextField, TimePicker, Timeline, ToolTipContent, Tooltip, Tutorial, Typography, UnAuthorized, UploadDialog, createBreadcrumbIdSlug, darkTheme, getBreadcrumbsCharacter, isDevelopment, isLocal, lightTheme, reactBlueprintReducers, splitBreadcrumbIdSlug, usePageHeader, useParams, useUrlParams };
|
|
1203
|
-
export type { AccordionProps, Activity, ActivityAction, AlertProps, AppHeaderProps, BarChartProps, BreadcrumbsProps, ButtonConfig, ButtonProps, CardProps, CheckboxProps, CircularAvatarProps, ConfirmDialogProps, ConfirmDialogType, DataTableProps, DensitySelectorProps, DialogButtonProps, DialogProps, DropdownMenuItemProps, DropdownMenuProps, EditableDataTableProps, FileUploadProps, FloatingContainerProps, FormActionsProps, IconComponent, IconProps, IconsType, LineChartProps, MultiCheckboxProps, OtpInputProps, PageContentProps, PasswordFieldProps, PieChartProps, PreviewFilesProps, ProgressCardProps, RadioGroupProps, SearchBarProps, SelectProps, Severity, SideMenuItemProps, SidePanelProps, SingleSelectProps, SnackbarProps, SquareAvatarProps, StatusCardProps, SubMenuItemProps, SwitchProps, TableColumnsSelectorProps, TabsContainerProps, TextFieldProps, TimelineItems, TimelineProps, TooltipContentProps, TooltipProps, TypographyProps, UploadDialogProps };
|
|
1247
|
+
export { Accordion, AccordionGroup, ActivityLogView, Alert, AnimatedGIFs, AppHeader, BarChart, Breadcrumbs, Button, Card, CellContainer, CenterBox, Chips, CircularAvatar, ComingSoon, ConfirmDialog, DataTable, DatePicker, DateTimePicker, DensitySelector, Dialog, DialogButton, DropDownButton, DropDownIcon, DropdownMenu, DropdownMenuItem, EditableDataTable, EditableTableCore, EmptyIllustration, FileUpload, FloatingContent, FooterContainerContainer, FormActions, FormControlWrapper, FormWrapper, IconButtons, Icons, InternalServerError, LabelWrapper, LineChart, MuiThemeProvider, MultiCheckBox, MultiSelect, NoInterneConnection, NoItemFound, OtpInput, PageContent, PageHeader, PageNotFound, PasswordField, PieChart, PreviewFiles, ProgressCard, RadioGroup, SearchBar, Select, SidePanel, SidePanelVariables, Sidebar, SingleCheckBox, SingleSelect, Snackbar, Spinner, SquareAvatar, StatusCard, Stepper, StyledContainer, Svgs, Switch, TableColumnsSelector, TableColumnsSelectorMenuFooter, TabsContainer, TabsLayout, TextField, TimePicker, Timeline, ToolTipContent, Tooltip, Tutorial, Typography, UnAuthorized, UploadDialog, createBreadcrumbIdSlug, darkTheme, getBreadcrumbsCharacter, isDevelopment, isLocal, lightTheme, reactBlueprintReducers, splitBreadcrumbIdSlug, usePageHeader, useParams, useUrlParams };
|
|
1248
|
+
export type { AccordionProps, Activity, ActivityAction, AlertProps, AppHeaderProps, BarChartProps, BreadcrumbsProps, ButtonConfig, ButtonProps, CardProps, CheckboxProps, CircularAvatarProps, ConfirmDialogProps, ConfirmDialogType, DataTableProps, DensitySelectorProps, DialogButtonProps, DialogProps, DropdownMenuItemProps, DropdownMenuProps, EditableDataTableProps, FileUploadProps, FloatingContainerProps, FormActionsProps, IconComponent, IconProps, IconsType, LineChartProps, MultiCheckboxProps, MultiSelectProps, OtpInputProps, PageContentProps, PasswordFieldProps, PieChartProps, PreviewFilesProps, ProgressCardProps, RadioGroupProps, SearchBarProps, SelectProps, Severity, SideMenuItemProps, SidePanelProps, SingleSelectProps, SnackbarProps, SquareAvatarProps, StatusCardProps, SubMenuItemProps, SwitchProps, TableColumnsSelectorProps, TabsContainerProps, TextFieldProps, TimelineItems, TimelineProps, TooltipContentProps, TooltipProps, TypographyProps, UploadDialogProps };
|