@ant-design/icons#FolderOpenOutlined TypeScript Examples
The following examples show how to use
@ant-design/icons#FolderOpenOutlined.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Icon.tsx From html2sketch with MIT License | 4 votes |
IconSymbol: FC = () => {
return (
<Row>
{/*<CaretUpOutlined*/}
{/* className="icon"*/}
{/* symbolName={'1.General/2.Icons/1.CaretUpOutlined'}*/}
{/*/>*/}
{/* className="icon"*/}
{/* symbolName={'1.General/2.Icons/2.MailOutlined'}*/}
{/*/>*/}
{/*<StepBackwardOutlined*/}
{/* className="icon"*/}
{/* symbolName={'1.General/2.Icons/2.StepBackwardOutlined'}*/}
{/*/>*/}
{/*<StepForwardOutlined*/}
{/* className="icon"*/}
{/* symbolName={'1.General/2.Icons/2.StepBackwardOutlined'}*/}
{/*/>*/}
<StepForwardOutlined />
<ShrinkOutlined />
<ArrowsAltOutlined />
<DownOutlined />
<UpOutlined />
<LeftOutlined />
<RightOutlined />
<CaretUpOutlined />
<CaretDownOutlined />
<CaretLeftOutlined />
<CaretRightOutlined />
<VerticalAlignTopOutlined />
<RollbackOutlined />
<FastBackwardOutlined />
<FastForwardOutlined />
<DoubleRightOutlined />
<DoubleLeftOutlined />
<VerticalLeftOutlined />
<VerticalRightOutlined />
<VerticalAlignMiddleOutlined />
<VerticalAlignBottomOutlined />
<ForwardOutlined />
<BackwardOutlined />
<EnterOutlined />
<RetweetOutlined />
<SwapOutlined />
<SwapLeftOutlined />
<SwapRightOutlined />
<ArrowUpOutlined />
<ArrowDownOutlined />
<ArrowLeftOutlined />
<ArrowRightOutlined />
<LoginOutlined />
<LogoutOutlined />
<MenuFoldOutlined />
<MenuUnfoldOutlined />
<BorderBottomOutlined />
<BorderHorizontalOutlined />
<BorderInnerOutlined />
<BorderOuterOutlined />
<BorderLeftOutlined />
<BorderRightOutlined />
<BorderTopOutlined />
<BorderVerticleOutlined />
<PicCenterOutlined />
<PicLeftOutlined />
<PicRightOutlined />
<RadiusBottomleftOutlined />
<RadiusBottomrightOutlined />
<RadiusUpleftOutlined />
<RadiusUprightOutlined />
<FullscreenOutlined />
<FullscreenExitOutlined />
<QuestionOutlined />
<PauseOutlined />
<MinusOutlined />
<PauseCircleOutlined />
<InfoOutlined />
<CloseOutlined />
<ExclamationOutlined />
<CheckOutlined />
<WarningOutlined />
<IssuesCloseOutlined />
<StopOutlined />
<EditOutlined />
<CopyOutlined />
<ScissorOutlined />
<DeleteOutlined />
<SnippetsOutlined />
<DiffOutlined />
<HighlightOutlined />
<AlignCenterOutlined />
<AlignLeftOutlined />
<AlignRightOutlined />
<BgColorsOutlined />
<BoldOutlined />
<ItalicOutlined />
<UnderlineOutlined />
<StrikethroughOutlined />
<RedoOutlined />
<UndoOutlined />
<ZoomInOutlined />
<ZoomOutOutlined />
<FontColorsOutlined />
<FontSizeOutlined />
<LineHeightOutlined />
<SortAscendingOutlined />
<SortDescendingOutlined />
<DragOutlined />
<OrderedListOutlined />
<UnorderedListOutlined />
<RadiusSettingOutlined />
<ColumnWidthOutlined />
<ColumnHeightOutlined />
<AreaChartOutlined />
<PieChartOutlined />
<BarChartOutlined />
<DotChartOutlined />
<LineChartOutlined />
<RadarChartOutlined />
<HeatMapOutlined />
<FallOutlined />
<RiseOutlined />
<StockOutlined />
<BoxPlotOutlined />
<FundOutlined />
<SlidersOutlined />
<AndroidOutlined />
<AppleOutlined />
<WindowsOutlined />
<IeOutlined />
<ChromeOutlined />
<GithubOutlined />
<AliwangwangOutlined />
<DingdingOutlined />
<WeiboSquareOutlined />
<WeiboCircleOutlined />
<TaobaoCircleOutlined />
<Html5Outlined />
<WeiboOutlined />
<TwitterOutlined />
<WechatOutlined />
<AlipayCircleOutlined />
<TaobaoOutlined />
<SkypeOutlined />
<FacebookOutlined />
<CodepenOutlined />
<CodeSandboxOutlined />
<AmazonOutlined />
<GoogleOutlined />
<AlipayOutlined />
<AntDesignOutlined />
<AntCloudOutlined />
<ZhihuOutlined />
<SlackOutlined />
<SlackSquareOutlined />
<BehanceSquareOutlined />
<DribbbleOutlined />
<DribbbleSquareOutlined />
<InstagramOutlined />
<YuqueOutlined />
<AlibabaOutlined />
<YahooOutlined />
<RedditOutlined />
<SketchOutlined />
<AccountBookOutlined />
<AlertOutlined />
<ApartmentOutlined />
<ApiOutlined />
<QqOutlined />
<MediumWorkmarkOutlined />
<GitlabOutlined />
<MediumOutlined />
<GooglePlusOutlined />
<AppstoreAddOutlined />
<AppstoreOutlined />
<AudioOutlined />
<AudioMutedOutlined />
<AuditOutlined />
<BankOutlined />
<BarcodeOutlined />
<BarsOutlined />
<BellOutlined />
<BlockOutlined />
<BookOutlined />
<BorderOutlined />
<BranchesOutlined />
<BuildOutlined />
<BulbOutlined />
<CalculatorOutlined />
<CalendarOutlined />
<CameraOutlined />
<CarOutlined />
<CarryOutOutlined />
<CiCircleOutlined />
<CiOutlined />
<CloudOutlined />
<ClearOutlined />
<ClusterOutlined />
<CodeOutlined />
<CoffeeOutlined />
<CompassOutlined />
<CompressOutlined />
<ContactsOutlined />
<ContainerOutlined />
<ControlOutlined />
<CopyrightCircleOutlined />
<CopyrightOutlined />
<CreditCardOutlined />
<CrownOutlined />
<CustomerServiceOutlined />
<DashboardOutlined />
<DatabaseOutlined />
<DeleteColumnOutlined />
<DeleteRowOutlined />
<DisconnectOutlined />
<DislikeOutlined />
<DollarCircleOutlined />
<DollarOutlined />
<DownloadOutlined />
<EllipsisOutlined />
<EnvironmentOutlined />
<EuroCircleOutlined />
<EuroOutlined />
<ExceptionOutlined />
<ExpandAltOutlined />
<ExpandOutlined />
<ExperimentOutlined />
<ExportOutlined />
<EyeOutlined />
<FieldBinaryOutlined />
<FieldNumberOutlined />
<FieldStringOutlined />
<DesktopOutlined />
<DingtalkOutlined />
<FileAddOutlined />
<FileDoneOutlined />
<FileExcelOutlined />
<FileExclamationOutlined />
<FileOutlined />
<FileImageOutlined />
<FileJpgOutlined />
<FileMarkdownOutlined />
<FilePdfOutlined />
<FilePptOutlined />
<FileProtectOutlined />
<FileSearchOutlined />
<FileSyncOutlined />
<FileTextOutlined />
<FileUnknownOutlined />
<FileWordOutlined />
<FilterOutlined />
<FireOutlined />
<FlagOutlined />
<FolderAddOutlined />
<FolderOutlined />
<FolderOpenOutlined />
<ForkOutlined />
<FormatPainterOutlined />
<FrownOutlined />
<FunctionOutlined />
<FunnelPlotOutlined />
<GatewayOutlined />
<GifOutlined />
<GiftOutlined />
<GlobalOutlined />
<GoldOutlined />
<GroupOutlined />
<HddOutlined />
<HeartOutlined />
<HistoryOutlined />
<HomeOutlined />
<HourglassOutlined />
<IdcardOutlined />
<ImportOutlined />
<InboxOutlined />
<InsertRowAboveOutlined />
<InsertRowBelowOutlined />
<InsertRowLeftOutlined />
<InsertRowRightOutlined />
<InsuranceOutlined />
<InteractionOutlined />
<KeyOutlined />
<LaptopOutlined />
<LayoutOutlined />
<LikeOutlined />
<LineOutlined />
<LinkOutlined />
<Loading3QuartersOutlined />
<LoadingOutlined />
<LockOutlined />
<MailOutlined />
<ManOutlined />
<MedicineBoxOutlined />
<MehOutlined />
<MenuOutlined />
<MergeCellsOutlined />
<MessageOutlined />
<MobileOutlined />
<MoneyCollectOutlined />
<MonitorOutlined />
<MoreOutlined />
<NodeCollapseOutlined />
<NodeExpandOutlined />
<NodeIndexOutlined />
<NotificationOutlined />
<NumberOutlined />
<PaperClipOutlined />
<PartitionOutlined />
<PayCircleOutlined />
<PercentageOutlined />
<PhoneOutlined />
<PictureOutlined />
<PoundCircleOutlined />
<PoundOutlined />
<PoweroffOutlined />
<PrinterOutlined />
<ProfileOutlined />
<ProjectOutlined />
<PropertySafetyOutlined />
<PullRequestOutlined />
<PushpinOutlined />
<QrcodeOutlined />
<ReadOutlined />
<ReconciliationOutlined />
<RedEnvelopeOutlined />
<ReloadOutlined />
<RestOutlined />
<RobotOutlined />
<RocketOutlined />
<SafetyCertificateOutlined />
<SafetyOutlined />
<ScanOutlined />
<ScheduleOutlined />
<SearchOutlined />
<SecurityScanOutlined />
<SelectOutlined />
<SendOutlined />
<SettingOutlined />
<ShakeOutlined />
<ShareAltOutlined />
<ShopOutlined />
<ShoppingCartOutlined />
<ShoppingOutlined />
<SisternodeOutlined />
<SkinOutlined />
<SmileOutlined />
<SolutionOutlined />
<SoundOutlined />
<SplitCellsOutlined />
<StarOutlined />
<SubnodeOutlined />
<SyncOutlined />
<TableOutlined />
<TabletOutlined />
<TagOutlined />
<TagsOutlined />
<TeamOutlined />
<ThunderboltOutlined />
<ToTopOutlined />
<ToolOutlined />
<TrademarkCircleOutlined />
<TrademarkOutlined />
<TransactionOutlined />
<TrophyOutlined />
<UngroupOutlined />
<UnlockOutlined />
<UploadOutlined />
<UsbOutlined />
<UserAddOutlined />
<UserDeleteOutlined />
<UserOutlined />
<UserSwitchOutlined />
<UsergroupAddOutlined />
<UsergroupDeleteOutlined />
<VideoCameraOutlined />
<WalletOutlined />
<WifiOutlined />
<BorderlessTableOutlined />
<WomanOutlined />
<BehanceOutlined />
<DropboxOutlined />
<DeploymentUnitOutlined />
<UpCircleOutlined />
<DownCircleOutlined />
<LeftCircleOutlined />
<RightCircleOutlined />
<UpSquareOutlined />
<DownSquareOutlined />
<LeftSquareOutlined />
<RightSquareOutlined />
<PlayCircleOutlined />
<QuestionCircleOutlined />
<PlusCircleOutlined />
<PlusSquareOutlined />
<MinusSquareOutlined />
<MinusCircleOutlined />
<InfoCircleOutlined />
<ExclamationCircleOutlined />
<CloseCircleOutlined />
<CloseSquareOutlined />
<CheckCircleOutlined />
<CheckSquareOutlined />
<ClockCircleOutlined />
<FormOutlined />
<DashOutlined />
<SmallDashOutlined />
<YoutubeOutlined />
<CodepenCircleOutlined />
<AliyunOutlined />
<PlusOutlined />
<LinkedinOutlined />
<AimOutlined />
<BugOutlined />
<CloudDownloadOutlined />
<CloudServerOutlined />
<CloudSyncOutlined />
<CloudUploadOutlined />
<CommentOutlined />
<ConsoleSqlOutlined />
<EyeInvisibleOutlined />
<FileGifOutlined />
<DeliveredProcedureOutlined />
<FieldTimeOutlined />
<FileZipOutlined />
<FolderViewOutlined />
<FundProjectionScreenOutlined />
<FundViewOutlined />
<MacCommandOutlined />
<PlaySquareOutlined />
<OneToOneOutlined />
<RotateLeftOutlined />
<RotateRightOutlined />
<SaveOutlined />
<SwitcherOutlined />
<TranslationOutlined />
<VerifiedOutlined />
<VideoCameraAddOutlined />
<WhatsAppOutlined />
{/*</Col>*/}
</Row>
);
}
Example #2
Source File: index.tsx From Aragorn with MIT License | 4 votes |
Dashboard = () => {
const {
state: {
uploaderProfiles,
configuration: { defaultUploaderProfileId },
uploadedFiles
}
} = useAppContext();
const history = useHistory();
const [selectRowKeys, setRowKeys] = useState([]);
const [selectRows, setSelectRows] = useState([] as UploadedFileInfo[]);
const handleProfileAdd = () => {
history.push('/uploader');
};
const handleProfileClick = id => {
if (id === defaultUploaderProfileId) {
history.push(`/profile/${id}`);
} else {
ipcRenderer.send('set-default-uploader-profile', id);
}
};
const handleCopy = url => {
clipboard.writeText(url);
message.success('已复制到粘贴板');
};
const handleOpen = path => {
shell.showItemInFolder(path);
};
const handleTableRowChange = (selectedRowKeys, selectedRows) => {
setRowKeys(selectedRowKeys);
setSelectRows(selectedRows);
};
const handleClear = () => {
const ids = selectRows.map(item => item.id);
ipcRenderer.send('clear-upload-history', ids);
setRowKeys([]);
};
const handleReUpload = () => {
const data = selectRows.map(item => {
return { id: item.uploaderProfileId, path: item.path };
});
ipcRenderer.send('file-reupload', data);
setRowKeys([]);
};
const columns: ColumnsType<UploadedFileInfo> = [
{
title: '文件名',
dataIndex: 'name',
ellipsis: true,
render: (val, record) => (
<Popover
placement="topLeft"
content={() =>
/(jpg|png|gif|jpeg)$/.test(val) ? (
<Image
style={{ maxWidth: 500 }}
src={record.url}
fallback="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIj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f7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="
/>
) : (
val
)
}
trigger="hover"
>
<span onClick={() => handleCopy(record.url)} className="row-item">
{val}
</span>
</Popover>
)
},
{
title: '类型',
dataIndex: 'type',
ellipsis: true,
width: 120
},
{
title: '上传器配置',
dataIndex: 'uploaderProfileId',
ellipsis: true,
width: 120,
render: val => (
<a onClick={() => handleProfileClick(val)}>
{uploaderProfiles.find(item => item.id === val)?.name || '未找到'}
</a>
)
},
{
title: '状态',
dataIndex: 'url',
ellipsis: true,
width: 80,
render: val => (
<>
<Badge status={val ? 'success' : 'error'} />
{val ? '成功' : '失败'}
</>
)
},
{
title: '上传时间',
dataIndex: 'date',
width: 180,
ellipsis: true,
render: val => dayjs(val).format('YYYY-MM-DD HH:mm:ss')
},
{
title: '操作',
width: 80,
render: (_, record) => (
<Space>
<FolderOpenOutlined onClick={() => handleOpen(record.path)} />
<CopyOutlined onClick={() => handleCopy(record.url)} />
</Space>
)
}
];
return (
<div className="dashboard-page">
<header>
<span>控制台</span>
<Divider />
</header>
<main>
<div className="profile-wrapper">
<div className="title">上传器配置</div>
<div className="card-wrapper">
{uploaderProfiles.map(item => (
<div
key={item.id}
className={item.id === defaultUploaderProfileId ? 'card card-active' : 'card'}
onClick={() => handleProfileClick(item.id)}
>
<Box className="card-icon" />
<span>{item.name}</span>
</div>
))}
<div className="card" onClick={handleProfileAdd}>
<Plus className="card-icon" />
</div>
</div>
</div>
<div className="history-wrapper">
<div className="title">最近上传</div>
<div className="card-wrapper">
{selectRowKeys.length > 0 && (
<Space style={{ marginBottom: 10 }}>
<Button icon={<DeleteOutlined />} onClick={handleClear}>
清除
</Button>
<Button icon={<UploadOutlined />} onClick={handleReUpload}>
重新上传
</Button>
</Space>
)}
<Table
size="small"
rowKey="id"
dataSource={uploadedFiles}
columns={columns}
rowSelection={{ onChange: handleTableRowChange, selectedRowKeys: selectRowKeys }}
/>
</div>
</div>
</main>
</div>
);
}
Example #3
Source File: ChartDraggableSourceContainer.tsx From datart with Apache License 2.0 | 4 votes |
ChartDraggableSourceContainer: FC<
{
availableSourceFunctions?: string[];
onDeleteComputedField?: (fieldName) => void;
onEditComputedField?: (fieldName) => void;
onSelectionChange?: (dataItemId, cmdKeyActive, shiftKeyActive) => void;
onClearCheckedList?: () => void;
} & ChartDataViewMeta
> = memo(function ChartDraggableSourceContainer({
id,
name: colName,
type,
subType,
category,
expression,
selectedItems,
isActive,
availableSourceFunctions,
role,
children,
onDeleteComputedField,
onEditComputedField,
onSelectionChange,
onClearCheckedList,
}) {
const t = useI18NPrefix(`viz.workbench.dataview`);
const [showChild, setShowChild] = useToggle(false);
const isHierarchyField = role === ColumnRole.Hierarchy;
const [, drag] = useDrag(
() => ({
type: isHierarchyField
? CHART_DRAG_ELEMENT_TYPE.DATASET_COLUMN_GROUP
: CHART_DRAG_ELEMENT_TYPE.DATASET_COLUMN,
canDrag: true,
item: selectedItems?.length
? selectedItems.map(item => buildDragItem(item))
: buildDragItem({ id: colName, type, subType, category }, children),
collect: monitor => ({
isDragging: monitor.isDragging(),
}),
end: onClearCheckedList,
}),
[selectedItems],
);
const styleClasses: Array<string> = useMemo(() => {
let styleArr: Array<string> = [];
if (isActive) {
styleArr.push('container-active');
}
return styleArr;
}, [isActive]);
const renderContent = useMemo(() => {
const _handleMenuClick = (e, fieldName) => {
if (e.key === 'delete') {
onDeleteComputedField?.(fieldName);
} else {
onEditComputedField?.(fieldName);
}
};
const _isAllowMoreAction = () => {
return (
ChartDataViewFieldCategory.Field === category ||
ChartDataViewFieldCategory.Hierarchy === category
);
};
const _getIconStyle = () => {
if (role === ColumnRole.Hierarchy) {
return WARNING;
}
if (
ChartDataViewFieldCategory.ComputedField === category ||
ChartDataViewFieldCategory.AggregateComputedField === category
) {
return WARNING;
} else {
switch (type) {
case DataViewFieldType.NUMERIC:
return SUCCESS;
default:
return INFO;
}
}
};
const _getExtraActionMenus = () => {
return (
<Menu onClick={e => _handleMenuClick(e, colName)}>
<Menu.Item key="edit">{t('editField')}</Menu.Item>
<Menu.Item key="delete">{t('deleteField')}</Menu.Item>
</Menu>
);
};
let icon = <FileUnknownOutlined />;
const props = {
style: {
alignSelf: 'center',
color: _getIconStyle(),
},
};
if (role === ColumnRole.Hierarchy) {
if (!showChild) {
icon = (
<FolderAddOutlined
{...props}
onClick={() => {
setShowChild(!showChild);
}}
/>
);
} else {
icon = (
<FolderOpenOutlined
{...props}
onClick={() => {
setShowChild(!showChild);
}}
/>
);
}
} else {
switch (type) {
case DataViewFieldType.STRING:
icon = <FieldStringOutlined {...props} />;
break;
case DataViewFieldType.NUMERIC:
icon = <NumberOutlined {...props} />;
break;
case DataViewFieldType.DATE:
icon = <CalendarOutlined {...props} />;
break;
default:
icon = <FileUnknownOutlined {...props} />;
}
}
return type === 'DATE' && category === 'field' ? (
<Row align="middle" style={{ width: '100%' }}>
<CollapseWrapper
defaultActiveKey={[colName]}
ghost
expandIconPosition="right"
expandIcon={({ isActive }) => {
return <DownOutlined rotate={isActive ? -180 : 0} />;
}}
>
<Panel
key={colName}
header={
<div ref={drag}>
<IW fontSize={FONT_SIZE_HEADING}>{icon}</IW>
<p>{colName}</p>
</div>
}
>
{DATE_LEVELS.map((item, i) => {
if (availableSourceFunctions?.includes(item.expression)) {
return (
<DateLevelFieldContainer
colName={colName}
key={i}
item={item}
onClearCheckedList={onClearCheckedList}
/>
);
}
return null;
})}
</Panel>
</CollapseWrapper>
</Row>
) : (
<Row align="middle" style={{ width: '100%' }}>
<IW fontSize={FONT_SIZE_HEADING}>{icon}</IW>
<StyledFieldContent>{colName}</StyledFieldContent>
<div onClick={stopPPG}>
<Dropdown
disabled={_isAllowMoreAction()}
overlay={_getExtraActionMenus()}
trigger={['click']}
>
<ToolbarButton
icon={<MoreOutlined />}
iconSize={FONT_SIZE_BASE}
className="setting"
onClick={e => e.preventDefault()}
/>
</Dropdown>
</div>
</Row>
);
}, [
type,
role,
colName,
showChild,
setShowChild,
onDeleteComputedField,
onEditComputedField,
category,
t,
onClearCheckedList,
drag,
availableSourceFunctions,
]);
const renderChildren = useMemo(() => {
return (children || []).map(item => (
<ChartDraggableSourceContainer
key={item.id}
id={item.id}
name={item.id}
category={item.category}
expression={item.expression}
type={item.type}
role={item.role}
children={item.children}
onDeleteComputedField={onDeleteComputedField}
onClearCheckedList={onClearCheckedList}
selectedItems={selectedItems}
/>
));
}, [children, onDeleteComputedField, onClearCheckedList, selectedItems]);
return (
<Container
flexDirection={children ? 'column' : 'row'}
onClick={e => {
if (isHierarchyField) {
return;
}
onSelectionChange?.(colName, e.metaKey || e.ctrlKey, e.shiftKey);
}}
ref={type === 'DATE' && category === 'field' ? null : drag}
className={
type === 'DATE' && category === 'field' ? '' : styleClasses.join(' ')
}
>
{renderContent}
{showChild && renderChildren}
</Container>
);
})
Example #4
Source File: DataModelBranch.tsx From datart with Apache License 2.0 | 4 votes |
DataModelBranch: FC<{
node: Column;
onNodeTypeChange: (type: any, name: string) => void;
onMoveToHierarchy: (node: Column) => void;
onEditBranch;
onDelete: (node: Column) => void;
onDeleteFromHierarchy: (parent: Column) => (node: Column) => void;
}> = memo(
({
node,
onNodeTypeChange,
onMoveToHierarchy,
onEditBranch,
onDelete,
onDeleteFromHierarchy,
}) => {
const t = useI18NPrefix('view.model');
const [isHover, setIsHover] = useState(false);
const renderNode = (node, isDragging) => {
let icon = (
<FolderOpenOutlined style={{ alignSelf: 'center', color: YELLOW }} />
);
return (
<>
<div
className="content"
onMouseEnter={() => {
setIsHover(true);
}}
onMouseLeave={() => {
setIsHover(false);
}}
>
<IW fontSize={FONT_SIZE_HEADING}>{icon}</IW>
<span>{node.name}</span>
<div className="action">
{isHover && !isDragging && (
<Tooltip title={t('rename')}>
<Button
type="link"
onClick={() => onEditBranch(node)}
icon={<EditOutlined />}
/>
</Tooltip>
)}
{isHover && !isDragging && (
<Tooltip title={t('delete')}>
<Button
type="link"
onClick={() => onDelete(node)}
icon={<DeleteOutlined />}
/>
</Tooltip>
)}
</div>
</div>
<div className="children">
{node?.children?.map(childNode => (
<DataModelNode
className="in-hierarchy"
node={childNode}
key={childNode.name}
onMoveToHierarchy={onMoveToHierarchy}
onNodeTypeChange={onNodeTypeChange}
onDeleteFromHierarchy={onDeleteFromHierarchy(node)}
/>
))}
</div>
</>
);
};
return (
<Draggable
key={node?.name}
draggableId={node?.name}
index={node?.index}
isDragDisabled={true}
>
{(draggableProvided, draggableSnapshot) => {
return (
<StyledDataModelBranch
ref={draggableProvided.innerRef}
{...draggableProvided.draggableProps}
{...draggableProvided.dragHandleProps}
>
<Droppable
droppableId={node?.name}
type={TreeNodeHierarchy.Branch}
isCombineEnabled={false}
>
{(droppableProvided, droppableSnapshot) => (
<div ref={droppableProvided.innerRef}>
{renderNode(node, draggableSnapshot.isDragging)}
{droppableProvided.placeholder}
</div>
)}
</Droppable>
</StyledDataModelBranch>
);
}}
</Draggable>
);
},
)
Example #5
Source File: YakExecutor.tsx From yakit with GNU Affero General Public License v3.0 | 4 votes |
ExecutorFileList = (props: ExecutorFileListProps) => {
const {
lists,
activeFile,
addFile,
newFile,
openFile,
fileFunction,
renameFlag,
renameIndex,
renameCache,
setRenameCache
} = props
return (
<AutoCard
className={"executor-file-list"}
title={<span style={{color: "#000", fontWeight: 400}}>近期文件</span>}
headStyle={{
minHeight: 0,
fontSize: 14,
fontWeight: 300,
padding: "0 5px",
backgroundColor: "#e8e9e8",
borderBottom: "2px solid #d7d7d7"
}}
bodyStyle={{padding: 0, paddingTop: 7, backgroundColor: "#efefef"}}
extra={
<>
<Upload multiple={false} maxCount={1} showUploadList={false} beforeUpload={(f: any) => addFile(f)}>
<FolderOpenOutlined className='file-list-icon' title='Open File' />
</Upload>
<FolderAddOutlined className='file-list-icon' title='New File' onClick={newFile} />
</>
}
>
{lists.length > 0 && (
<div className={"file-list"}>
{lists.map((item, index) => {
return (
<Dropdown
key={index}
overlay={CustomMenu(`${index}`, true, fileMenu, fileFunction)}
trigger={["contextMenu"]}
>
<div
className={`list-opt ${activeFile === item.route ? "selected" : ""}`}
style={{top: `${index * 22}px`}}
onClick={() => openFile({name: item.tab, path: item.route, extraParams: item.extraParams})}
>
<div>
{renameFlag && renameIndex === index ? (
<div>
<Input
id='rename-input'
className='input'
size='small'
value={renameCache}
onChange={(e) => setRenameCache(e.target.value)}
/>
</div>
) : (
<div className='name'>
<Text ellipsis={{tooltip: item.tab}} style={{width: "100%"}}>
{item.tab}
</Text>
</div>
)}
</div>
</div>
</Dropdown>
)
})}
</div>
)}
{lists.length === 0 && (
<Empty
className='file-empty '
imageStyle={{display: "none"}}
description={
<div style={{marginTop: 90}}>
<Button type='link' icon={<FileAddOutlined style={{fontSize: 30}} />} onClick={newFile} />
<p style={{marginTop: 10}}>新建文件</p>
</div>
}
/>
)}
</AutoCard>
)
}
Example #6
Source File: App.tsx From pcap2socks-gui with MIT License | 4 votes |
render() {
return (
<Layout className="layout">
<Content className="content-wrapper">
<div className="content">
{(() => {
switch (this.state.stage) {
case STAGE_WELCOME:
return this.renderWelcome();
case STAGE_INTERFACE:
return this.renderInterface();
case STAGE_DEVICE:
return this.renderDevice();
case STAGE_PROXY:
return this.renderProxy();
case STAGE_RUNNING:
return this.renderRunning();
default:
return;
}
})()}
</div>
<div className="footer">
{(() => {
if (this.state.stage > STAGE_WELCOME && this.state.stage <= STAGE_PROXY) {
return (
<Button
className="button"
disabled={this.state.loading > 0}
icon={<LeftOutlined />}
onClick={() => this.setState({ stage: this.state.stage - 1 })}
>
上一步
</Button>
);
}
})()}
{(() => {
if (this.state.stage === STAGE_INTERFACE) {
return (
<Button
className="button"
disabled={this.state.loading > 0 && this.state.loading !== 1}
icon={<ReloadOutlined />}
onClick={this.updateInterfaces}
>
刷新网卡列表
</Button>
);
}
})()}
{(() => {
if (this.state.stage === STAGE_PROXY) {
return (
<Button
className="button"
disabled={this.state.loading > 0}
icon={<FolderOpenOutlined />}
onClick={() => {
const node = document.getElementById("open");
if (node) {
node.click();
}
}}
>
导入代理配置
<input id="open" type="file" onChange={this.import} style={{ display: "none" }} />
</Button>
);
}
})()}
{(() => {
if (this.state.stage === STAGE_PROXY) {
return (
<Button className="button" icon={<ExportOutlined />} onClick={this.export}>
导出代理配置
</Button>
);
}
})()}
{(() => {
if (this.state.stage === STAGE_PROXY) {
return (
<Button
className="button"
disabled={this.state.loading > 0 && this.state.loading !== 2}
loading={this.state.loading === 2}
icon={<ExperimentOutlined />}
onClick={this.test}
>
测试代理服务器
</Button>
);
}
})()}
{(() => {
if (this.state.stage === STAGE_WELCOME && this.state.ready) {
return (
<Tooltip title={this.state.destination}>
<Button
className="button"
type="primary"
disabled={this.state.loading > 0 && this.state.loading !== 3}
loading={this.state.loading === 3}
icon={<PlayCircleOutlined />}
onClick={this.run}
>
以上次的配置运行
</Button>
</Tooltip>
);
}
})()}
{(() => {
if (this.state.stage >= STAGE_WELCOME && this.state.stage < STAGE_PROXY) {
return (
<Button
className="button"
disabled={this.state.loading > 0}
icon={<RightOutlined />}
type="primary"
onClick={() => this.setState({ stage: this.state.stage + 1 })}
>
下一步
</Button>
);
}
})()}
{(() => {
if (this.state.stage === STAGE_PROXY) {
return (
<Button
className="button"
type="primary"
disabled={this.state.loading > 0 && this.state.loading !== 3}
loading={this.state.loading === 3}
icon={<PoweroffOutlined />}
onClick={this.run}
>
运行
</Button>
);
}
})()}
{(() => {
if (this.state.stage === STAGE_RUNNING) {
return (
<Button className="button" icon={<GlobalOutlined />} onClick={this.notifyNetwork}>
显示网络设置
</Button>
);
}
})()}
{(() => {
if (this.state.stage === STAGE_RUNNING) {
return (
<Button
className="button"
type="primary"
danger
disabled={this.state.loading > 0 && this.state.loading !== 4}
loading={this.state.loading === 4}
icon={<PoweroffOutlined />}
onClick={this.stopConfirm}
>
停止
</Button>
);
}
})()}
</div>
</Content>
</Layout>
);
}