@ -5,7 +5,7 @@ import { Entity } from '@/ui/input/relation-picker/types/EntityTypeForSelect';
|
||||
import { FieldContext } from '@/ui/object/field/contexts/FieldContext';
|
||||
import { FieldDefinition } from '@/ui/object/field/types/FieldDefinition';
|
||||
import { FieldRelationMetadata } from '@/ui/object/field/types/FieldMetadata';
|
||||
import { InlineCell } from '@/ui/object/record-inline-cell/components/InlineCell';
|
||||
import { RecordInlineCell } from '@/ui/object/record-inline-cell/components/RecordInlineCell';
|
||||
import { InlineCellHotkeyScope } from '@/ui/object/record-inline-cell/types/InlineCellHotkeyScope';
|
||||
import { Company, User, useUpdateActivityMutation } from '~/generated/graphql';
|
||||
|
||||
@ -47,7 +47,7 @@ export const ActivityAssigneeEditableField = ({
|
||||
|
||||
return (
|
||||
<FieldContext.Provider value={value}>
|
||||
<InlineCell />
|
||||
<RecordInlineCell />
|
||||
</FieldContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
@ -2,7 +2,7 @@ import { IconCalendar } from '@/ui/display/icon/index';
|
||||
import { FieldContext } from '@/ui/object/field/contexts/FieldContext';
|
||||
import { FieldDefinition } from '@/ui/object/field/types/FieldDefinition';
|
||||
import { FieldDateMetadata } from '@/ui/object/field/types/FieldMetadata';
|
||||
import { InlineCell } from '@/ui/object/record-inline-cell/components/InlineCell';
|
||||
import { RecordInlineCell } from '@/ui/object/record-inline-cell/components/RecordInlineCell';
|
||||
import { InlineCellHotkeyScope } from '@/ui/object/record-inline-cell/types/InlineCellHotkeyScope';
|
||||
import { RecoilScope } from '@/ui/utilities/recoil-scope/components/RecoilScope';
|
||||
import { useUpdateActivityMutation } from '~/generated/graphql';
|
||||
@ -33,7 +33,7 @@ export const ActivityEditorDateField = ({
|
||||
hotkeyScope: InlineCellHotkeyScope.InlineCell,
|
||||
}}
|
||||
>
|
||||
<InlineCell />
|
||||
<RecordInlineCell />
|
||||
</FieldContext.Provider>
|
||||
</RecoilScope>
|
||||
);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ActivityTargetChips } from '@/activities/components/ActivityTargetChips';
|
||||
import { IconArrowUpRight, IconPencil } from '@/ui/display/icon';
|
||||
import { RelationPickerHotkeyScope } from '@/ui/input/relation-picker/types/RelationPickerHotkeyScope';
|
||||
import { InlineCellContainer } from '@/ui/object/record-inline-cell/components/InlineCellContainer';
|
||||
import { RecordInlineCellContainer } from '@/ui/object/record-inline-cell/components/RecordInlineCellContainer';
|
||||
import { FieldRecoilScopeContext } from '@/ui/object/record-inline-cell/states/recoil-scope-contexts/FieldRecoilScopeContext';
|
||||
import { RecoilScope } from '@/ui/utilities/recoil-scope/components/RecoilScope';
|
||||
import { Activity, ActivityTarget, Company, Person } from '~/generated/graphql';
|
||||
@ -25,7 +25,7 @@ export const ActivityRelationEditableField = ({
|
||||
return (
|
||||
<RecoilScope CustomRecoilScopeContext={FieldRecoilScopeContext}>
|
||||
<RecoilScope>
|
||||
<InlineCellContainer
|
||||
<RecordInlineCellContainer
|
||||
buttonIcon={IconPencil}
|
||||
customEditHotkeyScope={{
|
||||
scope: RelationPickerHotkeyScope.RelationPicker,
|
||||
|
||||
@ -12,7 +12,7 @@ import { isCardInCompactViewState } from '@/ui/layout/board/states/isCardInCompa
|
||||
import { isCompactViewEnabledState } from '@/ui/layout/board/states/isCompactViewEnabledState';
|
||||
import { visibleBoardCardFieldsScopedSelector } from '@/ui/layout/board/states/selectors/visibleBoardCardFieldsScopedSelector';
|
||||
import { FieldContext } from '@/ui/object/field/contexts/FieldContext';
|
||||
import { InlineCell } from '@/ui/object/record-inline-cell/components/InlineCell';
|
||||
import { RecordInlineCell } from '@/ui/object/record-inline-cell/components/RecordInlineCell';
|
||||
import { InlineCellHotkeyScope } from '@/ui/object/record-inline-cell/types/InlineCellHotkeyScope';
|
||||
import { AnimatedEaseInOut } from '@/ui/utilities/animation/components/AnimatedEaseInOut';
|
||||
import { useRecoilScopedValue } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopedValue';
|
||||
@ -241,7 +241,7 @@ export const CompanyBoardCard = () => {
|
||||
hotkeyScope: InlineCellHotkeyScope.InlineCell,
|
||||
}}
|
||||
>
|
||||
<InlineCell />
|
||||
<RecordInlineCell />
|
||||
</FieldContext.Provider>
|
||||
</PreventSelectOnClickContainer>
|
||||
))}
|
||||
|
||||
@ -17,7 +17,7 @@ import { ShowPageSummaryCard } from '@/ui/layout/show-page/components/ShowPageSu
|
||||
import { ShowPageRecoilScopeContext } from '@/ui/layout/states/ShowPageRecoilScopeContext';
|
||||
import { FieldContext } from '@/ui/object/field/contexts/FieldContext';
|
||||
import { entityFieldsFamilyState } from '@/ui/object/field/states/entityFieldsFamilyState';
|
||||
import { InlineCell } from '@/ui/object/record-inline-cell/components/InlineCell';
|
||||
import { RecordInlineCell } from '@/ui/object/record-inline-cell/components/RecordInlineCell';
|
||||
import { PropertyBox } from '@/ui/object/record-inline-cell/property-box/components/PropertyBox';
|
||||
import { InlineCellHotkeyScope } from '@/ui/object/record-inline-cell/types/InlineCellHotkeyScope';
|
||||
import { PageTitle } from '@/ui/utilities/page-title/PageTitle';
|
||||
@ -140,7 +140,7 @@ export const RecordShowPage = () => {
|
||||
hotkeyScope: InlineCellHotkeyScope.InlineCell,
|
||||
}}
|
||||
>
|
||||
<InlineCell />
|
||||
<RecordInlineCell />
|
||||
</FieldContext.Provider>
|
||||
);
|
||||
})}
|
||||
|
||||
@ -12,9 +12,9 @@ import { FieldInputEvent } from '../../field/types/FieldInputEvent';
|
||||
import { isFieldRelation } from '../../field/types/guards/isFieldRelation';
|
||||
import { useInlineCell } from '../hooks/useInlineCell';
|
||||
|
||||
import { InlineCellContainer } from './InlineCellContainer';
|
||||
import { RecordInlineCellContainer } from './RecordInlineCellContainer';
|
||||
|
||||
export const InlineCell = () => {
|
||||
export const RecordInlineCell = () => {
|
||||
const { fieldDefinition } = useContext(FieldContext);
|
||||
|
||||
const buttonIcon = useGetButtonIcon();
|
||||
@ -59,7 +59,7 @@ export const InlineCell = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<InlineCellContainer
|
||||
<RecordInlineCellContainer
|
||||
buttonIcon={buttonIcon}
|
||||
customEditHotkeyScope={
|
||||
isFieldRelation(fieldDefinition)
|
||||
@ -8,9 +8,9 @@ import { HotkeyScope } from '@/ui/utilities/hotkey/types/HotkeyScope';
|
||||
|
||||
import { useInlineCell } from '../hooks/useInlineCell';
|
||||
|
||||
import { InlineCellDisplayMode } from './InlineCellDisplayMode';
|
||||
import { InlineCellButton } from './InlineCellEditButton';
|
||||
import { InlineCellEditMode } from './InlineCellEditMode';
|
||||
import { RecordInlineCellDisplayMode } from './RecordInlineCellDisplayMode';
|
||||
import { RecordInlineCellButton } from './RecordInlineCellEditButton';
|
||||
import { RecordInlineCellEditMode } from './RecordInlineCellEditMode';
|
||||
|
||||
const StyledIconContainer = styled.div`
|
||||
align-items: center;
|
||||
@ -40,7 +40,7 @@ const StyledValueContainer = styled.div`
|
||||
`;
|
||||
|
||||
const StyledLabel = styled.div<
|
||||
Pick<InlineCellContainerProps, 'labelFixedWidth'>
|
||||
Pick<RecordInlineCellContainerProps, 'labelFixedWidth'>
|
||||
>`
|
||||
align-items: center;
|
||||
|
||||
@ -74,7 +74,7 @@ const StyledInlineCellBaseContainer = styled.div`
|
||||
width: 100%;
|
||||
`;
|
||||
|
||||
type InlineCellContainerProps = {
|
||||
type RecordInlineCellContainerProps = {
|
||||
IconLabel?: IconComponent;
|
||||
label?: string;
|
||||
labelFixedWidth?: number;
|
||||
@ -88,7 +88,7 @@ type InlineCellContainerProps = {
|
||||
disableHoverEffect?: boolean;
|
||||
};
|
||||
|
||||
export const InlineCellContainer = ({
|
||||
export const RecordInlineCellContainer = ({
|
||||
IconLabel,
|
||||
label,
|
||||
labelFixedWidth,
|
||||
@ -100,7 +100,7 @@ export const InlineCellContainer = ({
|
||||
editModeContentOnly,
|
||||
isDisplayModeFixHeight,
|
||||
disableHoverEffect,
|
||||
}: InlineCellContainerProps) => {
|
||||
}: RecordInlineCellContainerProps) => {
|
||||
const [isHovered, setIsHovered] = useState(false);
|
||||
|
||||
const handleContainerMouseEnter = () => {
|
||||
@ -141,28 +141,28 @@ export const InlineCellContainer = ({
|
||||
</StyledLabelAndIconContainer>
|
||||
<StyledValueContainer>
|
||||
{isInlineCellInEditMode ? (
|
||||
<InlineCellEditMode>{editModeContent}</InlineCellEditMode>
|
||||
<RecordInlineCellEditMode>{editModeContent}</RecordInlineCellEditMode>
|
||||
) : editModeContentOnly ? (
|
||||
<StyledClickableContainer>
|
||||
<InlineCellDisplayMode
|
||||
<RecordInlineCellDisplayMode
|
||||
disableHoverEffect={disableHoverEffect}
|
||||
isDisplayModeContentEmpty={isDisplayModeContentEmpty}
|
||||
isDisplayModeFixHeight={isDisplayModeFixHeight}
|
||||
isHovered={isHovered}
|
||||
>
|
||||
{editModeContent}
|
||||
</InlineCellDisplayMode>
|
||||
</RecordInlineCellDisplayMode>
|
||||
</StyledClickableContainer>
|
||||
) : (
|
||||
<StyledClickableContainer onClick={handleDisplayModeClick}>
|
||||
<InlineCellDisplayMode
|
||||
<RecordInlineCellDisplayMode
|
||||
disableHoverEffect={disableHoverEffect}
|
||||
isDisplayModeContentEmpty={isDisplayModeContentEmpty}
|
||||
isDisplayModeFixHeight={isDisplayModeFixHeight}
|
||||
isHovered={isHovered}
|
||||
>
|
||||
{displayModeContent}
|
||||
</InlineCellDisplayMode>
|
||||
</RecordInlineCellDisplayMode>
|
||||
{showEditButton && (
|
||||
<StyledEditButtonContainer
|
||||
initial={{ opacity: 0 }}
|
||||
@ -170,7 +170,7 @@ export const InlineCellContainer = ({
|
||||
transition={{ duration: 0.1 }}
|
||||
whileHover={{ scale: 1.04 }}
|
||||
>
|
||||
<InlineCellButton Icon={buttonIcon} />
|
||||
<RecordInlineCellButton Icon={buttonIcon} />
|
||||
</StyledEditButtonContainer>
|
||||
)}
|
||||
</StyledClickableContainer>
|
||||
@ -1,9 +1,9 @@
|
||||
import { css } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
const StyledInlineCellNormalModeOuterContainer = styled.div<
|
||||
const StyledRecordInlineCellNormalModeOuterContainer = styled.div<
|
||||
Pick<
|
||||
InlineCellDisplayModeProps,
|
||||
RecordInlineCellDisplayModeProps,
|
||||
| 'isDisplayModeContentEmpty'
|
||||
| 'disableHoverEffect'
|
||||
| 'isDisplayModeFixHeight'
|
||||
@ -32,7 +32,7 @@ const StyledInlineCellNormalModeOuterContainer = styled.div<
|
||||
}}
|
||||
`;
|
||||
|
||||
const StyledInlineCellNormalModeInnerContainer = styled.div`
|
||||
const StyledRecordInlineCellNormalModeInnerContainer = styled.div`
|
||||
align-items: center;
|
||||
color: ${({ theme }) => theme.font.color.primary};
|
||||
font-size: 'inherit';
|
||||
@ -50,32 +50,32 @@ const StyledEmptyField = styled.div`
|
||||
color: ${({ theme }) => theme.font.color.light};
|
||||
`;
|
||||
|
||||
type InlineCellDisplayModeProps = {
|
||||
type RecordInlineCellDisplayModeProps = {
|
||||
isDisplayModeContentEmpty?: boolean;
|
||||
disableHoverEffect?: boolean;
|
||||
isDisplayModeFixHeight?: boolean;
|
||||
isHovered?: boolean;
|
||||
};
|
||||
|
||||
export const InlineCellDisplayMode = ({
|
||||
export const RecordInlineCellDisplayMode = ({
|
||||
children,
|
||||
isDisplayModeContentEmpty,
|
||||
disableHoverEffect,
|
||||
isDisplayModeFixHeight,
|
||||
isHovered,
|
||||
}: React.PropsWithChildren<InlineCellDisplayModeProps>) => (
|
||||
<StyledInlineCellNormalModeOuterContainer
|
||||
}: React.PropsWithChildren<RecordInlineCellDisplayModeProps>) => (
|
||||
<StyledRecordInlineCellNormalModeOuterContainer
|
||||
isDisplayModeContentEmpty={isDisplayModeContentEmpty}
|
||||
disableHoverEffect={disableHoverEffect}
|
||||
isDisplayModeFixHeight={isDisplayModeFixHeight}
|
||||
isHovered={isHovered}
|
||||
>
|
||||
<StyledInlineCellNormalModeInnerContainer>
|
||||
<StyledRecordInlineCellNormalModeInnerContainer>
|
||||
{isDisplayModeContentEmpty || !children ? (
|
||||
<StyledEmptyField>{'Empty'}</StyledEmptyField>
|
||||
) : (
|
||||
children
|
||||
)}
|
||||
</StyledInlineCellNormalModeInnerContainer>
|
||||
</StyledInlineCellNormalModeOuterContainer>
|
||||
</StyledRecordInlineCellNormalModeInnerContainer>
|
||||
</StyledRecordInlineCellNormalModeOuterContainer>
|
||||
);
|
||||
@ -3,7 +3,7 @@ import { FloatingIconButton } from '@/ui/input/button/components/FloatingIconBut
|
||||
|
||||
import { useInlineCell } from '../hooks/useInlineCell';
|
||||
|
||||
export const InlineCellButton = ({ Icon }: { Icon: IconComponent }) => {
|
||||
export const RecordInlineCellButton = ({ Icon }: { Icon: IconComponent }) => {
|
||||
const { openInlineCell } = useInlineCell();
|
||||
|
||||
const handleClick = () => {
|
||||
@ -1,6 +1,6 @@
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
const StyledInlineCellEditModeContainer = styled.div<InlineCellEditModeProps>`
|
||||
const StyledInlineCellEditModeContainer = styled.div<RecordInlineCellEditModeProps>`
|
||||
align-items: center;
|
||||
|
||||
display: flex;
|
||||
@ -22,11 +22,13 @@ const StyledInlineCellInput = styled.div`
|
||||
z-index: 10;
|
||||
`;
|
||||
|
||||
type InlineCellEditModeProps = {
|
||||
type RecordInlineCellEditModeProps = {
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
export const InlineCellEditMode = ({ children }: InlineCellEditModeProps) => (
|
||||
export const RecordInlineCellEditMode = ({
|
||||
children,
|
||||
}: RecordInlineCellEditModeProps) => (
|
||||
<StyledInlineCellEditModeContainer data-testid="inline-cell-edit-mode-container">
|
||||
<StyledInlineCellInput>{children}</StyledInlineCellInput>
|
||||
</StyledInlineCellEditModeContainer>
|
||||
@ -17,7 +17,7 @@ import { ShowPageRightContainer } from '@/ui/layout/show-page/components/ShowPag
|
||||
import { ShowPageSummaryCard } from '@/ui/layout/show-page/components/ShowPageSummaryCard';
|
||||
import { ShowPageRecoilScopeContext } from '@/ui/layout/states/ShowPageRecoilScopeContext';
|
||||
import { FieldContext } from '@/ui/object/field/contexts/FieldContext';
|
||||
import { InlineCell } from '@/ui/object/record-inline-cell/components/InlineCell';
|
||||
import { RecordInlineCell } from '@/ui/object/record-inline-cell/components/RecordInlineCell';
|
||||
import { PropertyBox } from '@/ui/object/record-inline-cell/property-box/components/PropertyBox';
|
||||
import { InlineCellHotkeyScope } from '@/ui/object/record-inline-cell/types/InlineCellHotkeyScope';
|
||||
import { PageTitle } from '@/ui/utilities/page-title/PageTitle';
|
||||
@ -102,7 +102,7 @@ export const CompanyShow = () => {
|
||||
hotkeyScope: InlineCellHotkeyScope.InlineCell,
|
||||
}}
|
||||
>
|
||||
<InlineCell />
|
||||
<RecordInlineCell />
|
||||
</FieldContext.Provider>
|
||||
);
|
||||
})}
|
||||
|
||||
@ -18,7 +18,7 @@ import { ShowPageRightContainer } from '@/ui/layout/show-page/components/ShowPag
|
||||
import { ShowPageSummaryCard } from '@/ui/layout/show-page/components/ShowPageSummaryCard';
|
||||
import { ShowPageRecoilScopeContext } from '@/ui/layout/states/ShowPageRecoilScopeContext';
|
||||
import { FieldContext } from '@/ui/object/field/contexts/FieldContext';
|
||||
import { InlineCell } from '@/ui/object/record-inline-cell/components/InlineCell';
|
||||
import { RecordInlineCell } from '@/ui/object/record-inline-cell/components/RecordInlineCell';
|
||||
import { PropertyBox } from '@/ui/object/record-inline-cell/property-box/components/PropertyBox';
|
||||
import { InlineCellHotkeyScope } from '@/ui/object/record-inline-cell/types/InlineCellHotkeyScope';
|
||||
import { PageTitle } from '@/ui/utilities/page-title/PageTitle';
|
||||
@ -128,7 +128,7 @@ export const PersonShow = () => {
|
||||
}}
|
||||
key={person.id + fieldDefinition.label}
|
||||
>
|
||||
<InlineCell />
|
||||
<RecordInlineCell />
|
||||
</FieldContext.Provider>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user