-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into my_workplans
- Loading branch information
Showing
8 changed files
with
98 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 51 additions & 51 deletions
102
epictrack-web/src/components/shared/filterSelect/components/MultiValueContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
import React from "react"; | ||
import { MultiValueProps } from "react-select"; | ||
import { Box } from "@mui/material"; | ||
import { Palette } from "../../../../styles/theme"; | ||
import { ETCaption2 } from "../.."; | ||
|
||
const MultiValue = (props: MultiValueProps) => { | ||
const { filterProps } = props.selectProps; | ||
return ( | ||
<> | ||
{props.index === 0 && props.selectProps.value && ( | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
height: "2.25rem", | ||
// padding: "0px 12px", | ||
alignItems: "center", | ||
alignSelf: "stretch", | ||
borderRadius: "4px", | ||
background: Palette.primary.bg.light, | ||
cursor: "pointer", | ||
maxWidth: "70%", | ||
}} | ||
key={props.index} | ||
> | ||
<ETCaption2 | ||
bold | ||
color={Palette.primary.accent.light} | ||
sx={{ | ||
overflow: "hidden", | ||
textOverflow: "ellipsis", | ||
}} | ||
> | ||
{filterProps?.variant === "inline" | ||
? "Filtered" | ||
: `${props.selectProps.placeholder}(${ | ||
(props.selectProps.value as []).length | ||
})`} | ||
</ETCaption2> | ||
</Box> | ||
)} | ||
{props.index === 0 && !filterProps?.selectedOptions && ( | ||
<ETCaption2 color={Palette.neutral.light}> | ||
{props.selectProps.placeholder} | ||
</ETCaption2> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default MultiValue; | ||
import React from "react"; | ||
import { MultiValueProps } from "react-select"; | ||
import { Box } from "@mui/material"; | ||
import { Palette } from "../../../../styles/theme"; | ||
import { ETCaption2 } from "../.."; | ||
|
||
const MultiValue = (props: MultiValueProps) => { | ||
const { filterProps } = props.selectProps; | ||
return ( | ||
<> | ||
{props.index === 0 && props.selectProps.value && ( | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
height: "2.25rem", | ||
// padding: "0px 12px", | ||
alignItems: "center", | ||
alignSelf: "stretch", | ||
borderRadius: "4px", | ||
background: Palette.primary.bg.light, | ||
cursor: "pointer", | ||
maxWidth: "70%", | ||
}} | ||
key={props.index} | ||
> | ||
<ETCaption2 | ||
bold | ||
color={Palette.primary.accent.light} | ||
sx={{ | ||
overflow: "hidden", | ||
textOverflow: "ellipsis", | ||
}} | ||
> | ||
{filterProps?.variant === "inline" | ||
? "Filtered" | ||
: `${props.selectProps.placeholder} (${ | ||
(props.selectProps.value as []).length | ||
})`} | ||
</ETCaption2> | ||
</Box> | ||
)} | ||
{props.index === 0 && !filterProps?.selectedOptions && ( | ||
<ETCaption2 color={Palette.neutral.light}> | ||
{props.selectProps.placeholder} | ||
</ETCaption2> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default MultiValue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
import { GroupBase } from "react-select/dist/declarations/src/types"; | ||
import { Props } from "react-select"; | ||
|
||
export interface OptionType { | ||
readonly value: string; | ||
readonly label: string; | ||
} | ||
|
||
declare module "react-select/dist/declarations/src/Select" { | ||
export interface Props< | ||
Option, | ||
IsMulti extends boolean, | ||
Group extends GroupBase<Option> = GroupBase<Option> | ||
> { | ||
// Marking as optional here to not raise errors for ControlledSelect | ||
// Make sure to add for FilterSelect | ||
filterProps?: { | ||
applyFilters?: () => void; | ||
clearFilters?: () => void; | ||
selectedOptions: any[]; | ||
options?: any[]; | ||
onCancel?: () => void; | ||
variant?: "inline" | "bar"; | ||
getOptionLabel?: (option: any) => string; | ||
getOptionValue?: (option: any) => string; | ||
label?: string; | ||
}; | ||
filterAppliedCallback?: (value?: string[] | string) => void; | ||
filterClearedCallback?: (value?: [] | "") => void; | ||
} | ||
} | ||
|
||
export type SelectProps = { | ||
variant: "inline" | "bar"; | ||
info?: boolean; | ||
} & Props<OptionType>; | ||
|
||
export type TableFilterProps = { | ||
header: any; | ||
column: any; | ||
} & SelectProps; | ||
import { GroupBase } from "react-select/dist/declarations/src/types"; | ||
import { Props } from "react-select"; | ||
|
||
export interface OptionType { | ||
readonly value: string; | ||
readonly label: string; | ||
} | ||
|
||
declare module "react-select/dist/declarations/src/Select" { | ||
export interface Props< | ||
Option, | ||
IsMulti extends boolean, | ||
Group extends GroupBase<Option> = GroupBase<Option> | ||
> { | ||
// Marking as optional here to not raise errors for ControlledSelect | ||
// Make sure to add for FilterSelect | ||
filterProps?: { | ||
applyFilters?: () => void; | ||
clearFilters?: () => void; | ||
selectedOptions: any[]; | ||
options?: any[]; | ||
onCancel?: () => void; | ||
variant?: "inline" | "bar" | "inline-standalone"; | ||
getOptionLabel?: (option: any) => string; | ||
getOptionValue?: (option: any) => string; | ||
label?: string; | ||
}; | ||
filterAppliedCallback?: (value?: string[] | string) => void; | ||
filterClearedCallback?: (value?: [] | "") => void; | ||
} | ||
} | ||
|
||
export type SelectProps = { | ||
variant: "inline" | "bar" | "inline-standalone"; | ||
info?: boolean; | ||
} & Props<OptionType>; | ||
|
||
export type TableFilterProps = { | ||
header: any; | ||
column: any; | ||
} & SelectProps; |