-
-
Notifications
You must be signed in to change notification settings - Fork 752
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: record presort * fix: rendering issue with update cell values when grouping in grid view * fix: dragging row is not taking effect * fix: the page crash caused when grouping conditions change * refactor: simplify the code
- Loading branch information
Showing
29 changed files
with
525 additions
and
58 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
35 changes: 35 additions & 0 deletions
35
apps/nextjs-app/src/features/app/blocks/view/grid/components/PresortRowContainer.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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { ArrowUpDown } from '@teable/icons'; | ||
import { useTranslation } from 'next-i18next'; | ||
import { useRef } from 'react'; | ||
import { useClickAway } from 'react-use'; | ||
import { tableConfig } from '@/features/i18n/table.config'; | ||
|
||
interface IRowStatusContainerProps { | ||
children: React.ReactNode; | ||
style?: React.CSSProperties; | ||
onClickOutside?: () => void; | ||
} | ||
|
||
export const PresortRowContainer = (props: IRowStatusContainerProps) => { | ||
const { style, children, onClickOutside } = props; | ||
const prefillingGridContainerRef = useRef<HTMLDivElement>(null); | ||
const { t } = useTranslation(tableConfig.i18nNamespaces); | ||
|
||
useClickAway(prefillingGridContainerRef, () => { | ||
onClickOutside?.(); | ||
}); | ||
|
||
return ( | ||
<div | ||
ref={prefillingGridContainerRef} | ||
className="absolute left-0 w-full border-y-2 border-violet-500 dark:border-violet-700" | ||
style={style} | ||
> | ||
<div className="absolute left-0 top-[-32px] flex h-8 items-center rounded-ss-lg bg-violet-500 px-2 py-1 text-background dark:border-violet-700"> | ||
<ArrowUpDown className="mr-1" /> | ||
<span className="text-[13px]">{t('table:grid.presortRowTitle')}</span> | ||
</div> | ||
{children} | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.