mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 23:16:21 +00:00
feat(wired-ui): expand advanced wired editors
This commit is contained in:
@@ -6,16 +6,17 @@ import { NitroCardContextProvider } from './NitroCardContext';
|
||||
export interface NitroCardViewProps extends DraggableWindowProps, ColumnProps
|
||||
{
|
||||
theme?: string;
|
||||
isResizable?: boolean;
|
||||
}
|
||||
|
||||
export const NitroCardView: FC<NitroCardViewProps> = props =>
|
||||
{
|
||||
const { theme = 'primary', uniqueKey = null, handleSelector = '.drag-handler', windowPosition = DraggableWindowPosition.CENTER, disableDrag = false, overflow = 'hidden', position = 'relative', gap = 0, classNames = [], ...rest } = props;
|
||||
const { theme = 'primary', uniqueKey = null, handleSelector = '.drag-handler', windowPosition = DraggableWindowPosition.CENTER, disableDrag = false, overflow = 'hidden', position = 'relative', gap = 0, classNames = [], isResizable = true, ...rest } = props;
|
||||
const elementRef = useRef<HTMLDivElement>();
|
||||
|
||||
const getClassNames = useMemo(() =>
|
||||
{
|
||||
const newClassNames: string[] = [ 'resize', 'rounded', 'shadow', ];
|
||||
const newClassNames: string[] = [ isResizable ? 'resize' : 'resize-none', 'rounded', 'shadow' ];
|
||||
|
||||
// Card Theme Changer
|
||||
newClassNames.push('border border-[#283F5D]');
|
||||
@@ -23,7 +24,7 @@ export const NitroCardView: FC<NitroCardViewProps> = props =>
|
||||
if(classNames.length) newClassNames.push(...classNames);
|
||||
|
||||
return newClassNames;
|
||||
}, [ classNames ]);
|
||||
}, [ classNames, isResizable ]);
|
||||
|
||||
return (
|
||||
<NitroCardContextProvider value={ { theme } }>
|
||||
|
||||
@@ -232,7 +232,9 @@ export const DraggableWindow: FC<DraggableWindowProps> = props => {
|
||||
...dragStyle,
|
||||
left: 0,
|
||||
top: 0,
|
||||
transform: `translate(${offset.x + delta.x}px, ${offset.y + delta.y}px)`,
|
||||
transform: `translate3d(${offset.x + delta.x}px, ${offset.y + delta.y}px, 0)`,
|
||||
willChange: isDragging ? 'transform' : undefined,
|
||||
backfaceVisibility: 'hidden',
|
||||
visibility: isPositioned ? 'visible' : 'hidden'
|
||||
}}
|
||||
onMouseDownCapture={onMouseDown}
|
||||
|
||||
Reference in New Issue
Block a user