B: Fix RSForm editor layout
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run

This commit is contained in:
Ivan 2024-08-24 08:24:32 +03:00
parent faa0fd3fcc
commit 2126ab5cac
3 changed files with 20 additions and 15 deletions

View File

@ -49,7 +49,7 @@ function ToolbarConstituenta({
const controller = useRSEdit();
return (
<Overlay position='top-1 right-4' className='cc-icons sm:right-1/2 sm:translate-x-1/2'>
<Overlay position='top-1 right-4' className='cc-icons md:right-1/2 md:translate-x-1/2 transition-all duration-500'>
{controller.schema && controller.schema?.oss.length > 0 ? (
<MiniSelectorOSS
items={controller.schema.oss}

View File

@ -17,6 +17,7 @@ interface TableSideConstituentsProps {
activeCst?: IConstituenta;
onOpenEdit: (cstID: ConstituentaID) => void;
denseThreshold?: number;
autoScroll?: boolean;
maxHeight: string;
}
@ -25,6 +26,7 @@ const columnHelper = createColumnHelper<IConstituenta>();
function TableSideConstituents({
items,
activeCst,
autoScroll = true,
onOpenEdit,
maxHeight,
denseThreshold = 9999
@ -38,17 +40,19 @@ function TableSideConstituents({
if (!activeCst) {
return;
}
setTimeout(() => {
const element = document.getElementById(`${prefixes.cst_side_table}${activeCst.alias}`);
if (element) {
element.scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'end'
});
}
}, PARAMETER.refreshTimeout);
}, [activeCst]);
if (autoScroll) {
setTimeout(() => {
const element = document.getElementById(`${prefixes.cst_side_table}${activeCst.alias}`);
if (element) {
element.scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'end'
});
}
}, PARAMETER.refreshTimeout);
}
}, [activeCst, autoScroll]);
useLayoutEffect(() => {
setColumnVisibility(prev => {

View File

@ -46,6 +46,7 @@ function ViewConstituents({ expression, schema, activeCst, isBottom, onOpenEdit
items={filteredData}
activeCst={activeCst}
onOpenEdit={onOpenEdit}
autoScroll={!isBottom}
denseThreshold={COLUMN_EXPRESSION_HIDE_THRESHOLD}
/>
),
@ -55,10 +56,10 @@ function ViewConstituents({ expression, schema, activeCst, isBottom, onOpenEdit
return (
<motion.div
className={clsx(
'border overflow-visible', // prettier: split-lines
'border', // prettier: split-lines
{
'mt-[2.2rem] rounded-l-md rounded-r-none h-fit': !isBottom,
'mt-3 mx-6 rounded-md md:w-[45.8rem]': isBottom
'mt-[2.2rem] rounded-l-md rounded-r-none h-fit overflow-visible': !isBottom,
'mt-3 mx-6 rounded-md md:max-w-[45.8rem] overflow-hidden': isBottom
}
)}
initial={{ ...animateSideView.initial }}