mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-16 03:32:36 +08:00
fix: dnd box z-index (#1353)
Some checks are pending
Alpha Build / alpha (macos-latest, aarch64-apple-darwin) (push) Waiting to run
Alpha Build / alpha (macos-latest, x86_64-apple-darwin) (push) Waiting to run
Alpha Build / alpha (windows-latest, aarch64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha (windows-latest, i686-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha (windows-latest, x86_64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, aarch64-unknown-linux-gnu) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, armv7-unknown-linux-gnueabihf) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, i686-unknown-linux-gnu) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, x86_64-unknown-linux-gnu) (push) Waiting to run
Alpha Build / alpha-for-fixed-webview2 (arm64, windows-latest, aarch64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha-for-fixed-webview2 (x64, windows-latest, x86_64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha-for-fixed-webview2 (x86, windows-latest, i686-pc-windows-msvc) (push) Waiting to run
Alpha Build / Update tag (push) Blocked by required conditions
Some checks are pending
Alpha Build / alpha (macos-latest, aarch64-apple-darwin) (push) Waiting to run
Alpha Build / alpha (macos-latest, x86_64-apple-darwin) (push) Waiting to run
Alpha Build / alpha (windows-latest, aarch64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha (windows-latest, i686-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha (windows-latest, x86_64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, aarch64-unknown-linux-gnu) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, armv7-unknown-linux-gnueabihf) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, i686-unknown-linux-gnu) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, x86_64-unknown-linux-gnu) (push) Waiting to run
Alpha Build / alpha-for-fixed-webview2 (arm64, windows-latest, aarch64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha-for-fixed-webview2 (x64, windows-latest, x86_64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha-for-fixed-webview2 (x86, windows-latest, i686-pc-windows-msvc) (push) Waiting to run
Alpha Build / Update tag (push) Blocked by required conditions
* fix: dnd box z-index * fix: dnd boxes
This commit is contained in:
parent
1dcc95d16a
commit
9d045e24db
|
@ -22,7 +22,14 @@ export const GroupItem = (props: Props) => {
|
||||||
let { type, group, onDelete } = props;
|
let { type, group, onDelete } = props;
|
||||||
const sortable = type === "prepend" || type === "append";
|
const sortable = type === "prepend" || type === "append";
|
||||||
|
|
||||||
const { attributes, listeners, setNodeRef, transform, transition } = sortable
|
const {
|
||||||
|
attributes,
|
||||||
|
listeners,
|
||||||
|
setNodeRef,
|
||||||
|
transform,
|
||||||
|
transition,
|
||||||
|
isDragging,
|
||||||
|
} = sortable
|
||||||
? useSortable({ id: group.name })
|
? useSortable({ id: group.name })
|
||||||
: {
|
: {
|
||||||
attributes: {},
|
attributes: {},
|
||||||
|
@ -30,6 +37,7 @@ export const GroupItem = (props: Props) => {
|
||||||
setNodeRef: null,
|
setNodeRef: null,
|
||||||
transform: null,
|
transform: null,
|
||||||
transition: null,
|
transition: null,
|
||||||
|
isDragging: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
const [iconCachePath, setIconCachePath] = useState("");
|
const [iconCachePath, setIconCachePath] = useState("");
|
||||||
|
@ -55,6 +63,7 @@ export const GroupItem = (props: Props) => {
|
||||||
<ListItem
|
<ListItem
|
||||||
dense
|
dense
|
||||||
sx={({ palette }) => ({
|
sx={({ palette }) => ({
|
||||||
|
position: "relative",
|
||||||
background:
|
background:
|
||||||
type === "original"
|
type === "original"
|
||||||
? palette.mode === "dark"
|
? palette.mode === "dark"
|
||||||
|
@ -68,6 +77,7 @@ export const GroupItem = (props: Props) => {
|
||||||
borderRadius: "8px",
|
borderRadius: "8px",
|
||||||
transform: CSS.Transform.toString(transform),
|
transform: CSS.Transform.toString(transform),
|
||||||
transition,
|
transition,
|
||||||
|
zIndex: isDragging ? "calc(infinity)" : undefined,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{group.icon && group.icon?.trim().startsWith("http") && (
|
{group.icon && group.icon?.trim().startsWith("http") && (
|
||||||
|
|
|
@ -51,8 +51,14 @@ interface Props {
|
||||||
export const ProfileItem = (props: Props) => {
|
export const ProfileItem = (props: Props) => {
|
||||||
const { selected, activating, itemData, onSelect, onEdit, onSave, onDelete } =
|
const { selected, activating, itemData, onSelect, onEdit, onSave, onDelete } =
|
||||||
props;
|
props;
|
||||||
const { attributes, listeners, setNodeRef, transform, transition } =
|
const {
|
||||||
useSortable({ id: props.id });
|
attributes,
|
||||||
|
listeners,
|
||||||
|
setNodeRef,
|
||||||
|
transform,
|
||||||
|
transition,
|
||||||
|
isDragging,
|
||||||
|
} = useSortable({ id: props.id });
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [anchorEl, setAnchorEl] = useState<any>(null);
|
const [anchorEl, setAnchorEl] = useState<any>(null);
|
||||||
|
@ -300,8 +306,10 @@ export const ProfileItem = (props: Props) => {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
|
position: "relative",
|
||||||
transform: CSS.Transform.toString(transform),
|
transform: CSS.Transform.toString(transform),
|
||||||
transition,
|
transition,
|
||||||
|
zIndex: isDragging ? "calc(infinity)" : undefined,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ProfileBox
|
<ProfileBox
|
||||||
|
|
|
@ -20,7 +20,14 @@ export const ProxyItem = (props: Props) => {
|
||||||
let { type, proxy, onDelete } = props;
|
let { type, proxy, onDelete } = props;
|
||||||
const sortable = type === "prepend" || type === "append";
|
const sortable = type === "prepend" || type === "append";
|
||||||
|
|
||||||
const { attributes, listeners, setNodeRef, transform, transition } = sortable
|
const {
|
||||||
|
attributes,
|
||||||
|
listeners,
|
||||||
|
setNodeRef,
|
||||||
|
transform,
|
||||||
|
transition,
|
||||||
|
isDragging,
|
||||||
|
} = sortable
|
||||||
? useSortable({ id: proxy.name })
|
? useSortable({ id: proxy.name })
|
||||||
: {
|
: {
|
||||||
attributes: {},
|
attributes: {},
|
||||||
|
@ -28,12 +35,14 @@ export const ProxyItem = (props: Props) => {
|
||||||
setNodeRef: null,
|
setNodeRef: null,
|
||||||
transform: null,
|
transform: null,
|
||||||
transition: null,
|
transition: null,
|
||||||
|
isDragging: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ListItem
|
<ListItem
|
||||||
dense
|
dense
|
||||||
sx={({ palette }) => ({
|
sx={({ palette }) => ({
|
||||||
|
position: "relative",
|
||||||
background:
|
background:
|
||||||
type === "original"
|
type === "original"
|
||||||
? palette.mode === "dark"
|
? palette.mode === "dark"
|
||||||
|
@ -47,6 +56,7 @@ export const ProxyItem = (props: Props) => {
|
||||||
borderRadius: "8px",
|
borderRadius: "8px",
|
||||||
transform: CSS.Transform.toString(transform),
|
transform: CSS.Transform.toString(transform),
|
||||||
transition,
|
transition,
|
||||||
|
zIndex: isDragging ? "calc(infinity)" : undefined,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
|
|
|
@ -24,7 +24,14 @@ export const RuleItem = (props: Props) => {
|
||||||
const proxyPolicy = rule.match(/[^,]+$/)?.[0] ?? "";
|
const proxyPolicy = rule.match(/[^,]+$/)?.[0] ?? "";
|
||||||
const ruleContent = rule.slice(ruleType.length + 1, -proxyPolicy.length - 1);
|
const ruleContent = rule.slice(ruleType.length + 1, -proxyPolicy.length - 1);
|
||||||
|
|
||||||
const { attributes, listeners, setNodeRef, transform, transition } = sortable
|
const {
|
||||||
|
attributes,
|
||||||
|
listeners,
|
||||||
|
setNodeRef,
|
||||||
|
transform,
|
||||||
|
transition,
|
||||||
|
isDragging,
|
||||||
|
} = sortable
|
||||||
? useSortable({ id: ruleRaw })
|
? useSortable({ id: ruleRaw })
|
||||||
: {
|
: {
|
||||||
attributes: {},
|
attributes: {},
|
||||||
|
@ -32,11 +39,13 @@ export const RuleItem = (props: Props) => {
|
||||||
setNodeRef: null,
|
setNodeRef: null,
|
||||||
transform: null,
|
transform: null,
|
||||||
transition: null,
|
transition: null,
|
||||||
|
isDragging: false,
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<ListItem
|
<ListItem
|
||||||
dense
|
dense
|
||||||
sx={({ palette }) => ({
|
sx={({ palette }) => ({
|
||||||
|
position: "relative",
|
||||||
background:
|
background:
|
||||||
type === "original"
|
type === "original"
|
||||||
? palette.mode === "dark"
|
? palette.mode === "dark"
|
||||||
|
@ -50,6 +59,7 @@ export const RuleItem = (props: Props) => {
|
||||||
borderRadius: "8px",
|
borderRadius: "8px",
|
||||||
transform: CSS.Transform.toString(transform),
|
transform: CSS.Transform.toString(transform),
|
||||||
transition,
|
transition,
|
||||||
|
zIndex: isDragging ? "calc(infinity)" : undefined,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
|
|
|
@ -32,8 +32,14 @@ let eventListener: UnlistenFn | null = null;
|
||||||
|
|
||||||
export const TestItem = (props: Props) => {
|
export const TestItem = (props: Props) => {
|
||||||
const { itemData, onEdit, onDelete: onDeleteItem } = props;
|
const { itemData, onEdit, onDelete: onDeleteItem } = props;
|
||||||
const { attributes, listeners, setNodeRef, transform, transition } =
|
const {
|
||||||
useSortable({ id: props.id });
|
attributes,
|
||||||
|
listeners,
|
||||||
|
setNodeRef,
|
||||||
|
transform,
|
||||||
|
transition,
|
||||||
|
isDragging,
|
||||||
|
} = useSortable({ id: props.id });
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [anchorEl, setAnchorEl] = useState<any>(null);
|
const [anchorEl, setAnchorEl] = useState<any>(null);
|
||||||
|
@ -99,8 +105,10 @@ export const TestItem = (props: Props) => {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
|
position: "relative",
|
||||||
transform: CSS.Transform.toString(transform),
|
transform: CSS.Transform.toString(transform),
|
||||||
transition,
|
transition,
|
||||||
|
zIndex: isDragging ? "calc(infinity)" : undefined,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<TestBox
|
<TestBox
|
||||||
|
|
Loading…
Reference in New Issue
Block a user