feat: Initial clean release of CHM
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
这个提交包含在:
@@ -0,0 +1,63 @@
|
||||
import * as React from 'react';
|
||||
import { useMemo } from 'react';
|
||||
import { NoteListColumns, OnClickHandler } from '@joplin/lib/services/plugins/api/noteListType';
|
||||
import NoteListHeaderItem from './NoteListHeaderItem';
|
||||
import { OnItemClickHander } from './types';
|
||||
import useDragAndDrop, { DataType } from './useDragAndDrop';
|
||||
import useContextMenu from './utils/useContextMenu';
|
||||
import depNameToNoteProp from '@joplin/lib/services/noteList/depNameToNoteProp';
|
||||
|
||||
interface Props {
|
||||
template: string;
|
||||
height: number;
|
||||
onClick: OnClickHandler;
|
||||
columns: NoteListColumns;
|
||||
notesSortOrderField: string;
|
||||
notesSortOrderReverse: boolean;
|
||||
onItemClick: OnItemClickHander;
|
||||
}
|
||||
|
||||
const defaultHeight = 26;
|
||||
|
||||
export default (props: Props) => {
|
||||
const { onItemDragStart, onItemDragOver, onItemDrop, onResizerDragStart, onResizerDragEnd, dropAt, draggedItem } = useDragAndDrop(props.columns);
|
||||
const onContextMenu = useContextMenu(props.columns);
|
||||
|
||||
const items: React.JSX.Element[] = [];
|
||||
|
||||
let isFirst = true;
|
||||
for (const column of props.columns) {
|
||||
let dragCursorLocation = null;
|
||||
if (draggedItem && draggedItem.type === DataType.HeaderItem) {
|
||||
dragCursorLocation = dropAt && dropAt.columnName === column.name ? dropAt.location : null;
|
||||
}
|
||||
|
||||
items.push(<NoteListHeaderItem
|
||||
isFirst={isFirst}
|
||||
key={column.name}
|
||||
column={column}
|
||||
isCurrent={`note.${props.notesSortOrderField}` === depNameToNoteProp(column.name)}
|
||||
isReverse={props.notesSortOrderReverse}
|
||||
onClick={props.onItemClick}
|
||||
onDragStart={onItemDragStart}
|
||||
onDragOver={onItemDragOver}
|
||||
onDrop={onItemDrop}
|
||||
onResizerDragStart={onResizerDragStart}
|
||||
onResizerDragEnd={onResizerDragEnd}
|
||||
dragCursorLocation={dragCursorLocation}
|
||||
/>);
|
||||
isFirst = false;
|
||||
}
|
||||
|
||||
const itemHeight = props.height ? props.height : defaultHeight;
|
||||
|
||||
const style = useMemo(() => {
|
||||
return { height: itemHeight };
|
||||
}, [itemHeight]);
|
||||
|
||||
return (
|
||||
<div className="note-list-header" style={style} onContextMenu={onContextMenu} >
|
||||
{items}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
在新工单中引用
屏蔽一个用户