first commit
This commit is contained in:
16
frontend/node_modules/antd/es/tree/DirectoryTree.d.ts
generated
vendored
Normal file
16
frontend/node_modules/antd/es/tree/DirectoryTree.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import * as React from 'react';
|
||||
import type RcTree from 'rc-tree';
|
||||
import type { BasicDataNode } from 'rc-tree';
|
||||
import type { DataNode, Key } from 'rc-tree/lib/interface';
|
||||
import type { TreeProps } from './Tree';
|
||||
export type ExpandAction = false | 'click' | 'doubleClick';
|
||||
export interface DirectoryTreeProps<T extends BasicDataNode = DataNode> extends TreeProps<T> {
|
||||
expandAction?: ExpandAction;
|
||||
}
|
||||
type DirectoryTreeCompoundedComponent = (<T extends BasicDataNode | DataNode = DataNode>(props: React.PropsWithChildren<DirectoryTreeProps<T>> & React.RefAttributes<RcTree>) => React.ReactElement) & Pick<React.FC, 'displayName'>;
|
||||
export interface DirectoryTreeState {
|
||||
expandedKeys?: Key[];
|
||||
selectedKeys?: Key[];
|
||||
}
|
||||
declare const ForwardDirectoryTree: DirectoryTreeCompoundedComponent;
|
||||
export default ForwardDirectoryTree;
|
||||
171
frontend/node_modules/antd/es/tree/DirectoryTree.js
generated
vendored
Normal file
171
frontend/node_modules/antd/es/tree/DirectoryTree.js
generated
vendored
Normal file
@@ -0,0 +1,171 @@
|
||||
"use client";
|
||||
|
||||
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
||||
var __rest = this && this.__rest || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
import * as React from 'react';
|
||||
import FileOutlined from "@ant-design/icons/es/icons/FileOutlined";
|
||||
import FolderOpenOutlined from "@ant-design/icons/es/icons/FolderOpenOutlined";
|
||||
import FolderOutlined from "@ant-design/icons/es/icons/FolderOutlined";
|
||||
import classNames from 'classnames';
|
||||
import { conductExpandParent } from "rc-tree/es/util";
|
||||
import { convertDataToEntities, convertTreeToData } from "rc-tree/es/utils/treeUtil";
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import Tree from './Tree';
|
||||
import { calcRangeKeys, convertDirectoryKeysToNodes } from './utils/dictUtil';
|
||||
function getIcon(props) {
|
||||
const {
|
||||
isLeaf,
|
||||
expanded
|
||||
} = props;
|
||||
if (isLeaf) {
|
||||
return /*#__PURE__*/React.createElement(FileOutlined, null);
|
||||
}
|
||||
return expanded ? /*#__PURE__*/React.createElement(FolderOpenOutlined, null) : /*#__PURE__*/React.createElement(FolderOutlined, null);
|
||||
}
|
||||
function getTreeData({
|
||||
treeData,
|
||||
children
|
||||
}) {
|
||||
return treeData || convertTreeToData(children);
|
||||
}
|
||||
const DirectoryTree = (_a, ref) => {
|
||||
var {
|
||||
defaultExpandAll,
|
||||
defaultExpandParent,
|
||||
defaultExpandedKeys
|
||||
} = _a,
|
||||
props = __rest(_a, ["defaultExpandAll", "defaultExpandParent", "defaultExpandedKeys"]);
|
||||
// Shift click usage
|
||||
const lastSelectedKey = React.useRef(null);
|
||||
const cachedSelectedKeys = React.useRef(null);
|
||||
const getInitExpandedKeys = () => {
|
||||
const {
|
||||
keyEntities
|
||||
} = convertDataToEntities(getTreeData(props), {
|
||||
fieldNames: props.fieldNames
|
||||
});
|
||||
let initExpandedKeys;
|
||||
// Expanded keys
|
||||
if (defaultExpandAll) {
|
||||
initExpandedKeys = Object.keys(keyEntities);
|
||||
} else if (defaultExpandParent) {
|
||||
initExpandedKeys = conductExpandParent(props.expandedKeys || defaultExpandedKeys || [], keyEntities);
|
||||
} else {
|
||||
initExpandedKeys = props.expandedKeys || defaultExpandedKeys || [];
|
||||
}
|
||||
return initExpandedKeys;
|
||||
};
|
||||
const [selectedKeys, setSelectedKeys] = React.useState(props.selectedKeys || props.defaultSelectedKeys || []);
|
||||
const [expandedKeys, setExpandedKeys] = React.useState(() => getInitExpandedKeys());
|
||||
React.useEffect(() => {
|
||||
if ('selectedKeys' in props) {
|
||||
setSelectedKeys(props.selectedKeys);
|
||||
}
|
||||
}, [props.selectedKeys]);
|
||||
React.useEffect(() => {
|
||||
if ('expandedKeys' in props) {
|
||||
setExpandedKeys(props.expandedKeys);
|
||||
}
|
||||
}, [props.expandedKeys]);
|
||||
const onExpand = (keys, info) => {
|
||||
var _a;
|
||||
if (!('expandedKeys' in props)) {
|
||||
setExpandedKeys(keys);
|
||||
}
|
||||
// Call origin function
|
||||
return (_a = props.onExpand) === null || _a === void 0 ? void 0 : _a.call(props, keys, info);
|
||||
};
|
||||
const onSelect = (keys, event) => {
|
||||
var _a;
|
||||
const {
|
||||
multiple,
|
||||
fieldNames
|
||||
} = props;
|
||||
const {
|
||||
node,
|
||||
nativeEvent
|
||||
} = event;
|
||||
const {
|
||||
key = ''
|
||||
} = node;
|
||||
const treeData = getTreeData(props);
|
||||
// const newState: DirectoryTreeState = {};
|
||||
// We need wrap this event since some value is not same
|
||||
const newEvent = Object.assign(Object.assign({}, event), {
|
||||
selected: true
|
||||
});
|
||||
// Windows / Mac single pick
|
||||
const ctrlPick = (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.ctrlKey) || (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.metaKey);
|
||||
const shiftPick = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.shiftKey;
|
||||
// Generate new selected keys
|
||||
let newSelectedKeys;
|
||||
if (multiple && ctrlPick) {
|
||||
// Control click
|
||||
newSelectedKeys = keys;
|
||||
lastSelectedKey.current = key;
|
||||
cachedSelectedKeys.current = newSelectedKeys;
|
||||
newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys, fieldNames);
|
||||
} else if (multiple && shiftPick) {
|
||||
// Shift click
|
||||
newSelectedKeys = Array.from(new Set([].concat(_toConsumableArray(cachedSelectedKeys.current || []), _toConsumableArray(calcRangeKeys({
|
||||
treeData,
|
||||
expandedKeys,
|
||||
startKey: key,
|
||||
endKey: lastSelectedKey.current,
|
||||
fieldNames
|
||||
})))));
|
||||
newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys, fieldNames);
|
||||
} else {
|
||||
// Single click
|
||||
newSelectedKeys = [key];
|
||||
lastSelectedKey.current = key;
|
||||
cachedSelectedKeys.current = newSelectedKeys;
|
||||
newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys, fieldNames);
|
||||
}
|
||||
(_a = props.onSelect) === null || _a === void 0 ? void 0 : _a.call(props, newSelectedKeys, newEvent);
|
||||
if (!('selectedKeys' in props)) {
|
||||
setSelectedKeys(newSelectedKeys);
|
||||
}
|
||||
};
|
||||
const {
|
||||
getPrefixCls,
|
||||
direction
|
||||
} = React.useContext(ConfigContext);
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
className,
|
||||
showIcon = true,
|
||||
expandAction = 'click'
|
||||
} = props,
|
||||
otherProps = __rest(props, ["prefixCls", "className", "showIcon", "expandAction"]);
|
||||
const prefixCls = getPrefixCls('tree', customizePrefixCls);
|
||||
const connectClassName = classNames(`${prefixCls}-directory`, {
|
||||
[`${prefixCls}-directory-rtl`]: direction === 'rtl'
|
||||
}, className);
|
||||
return /*#__PURE__*/React.createElement(Tree, Object.assign({
|
||||
icon: getIcon,
|
||||
ref: ref,
|
||||
blockNode: true
|
||||
}, otherProps, {
|
||||
showIcon: showIcon,
|
||||
expandAction: expandAction,
|
||||
prefixCls: prefixCls,
|
||||
className: connectClassName,
|
||||
expandedKeys: expandedKeys,
|
||||
selectedKeys: selectedKeys,
|
||||
onSelect: onSelect,
|
||||
onExpand: onExpand
|
||||
}));
|
||||
};
|
||||
const ForwardDirectoryTree = /*#__PURE__*/React.forwardRef(DirectoryTree);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
ForwardDirectoryTree.displayName = 'DirectoryTree';
|
||||
}
|
||||
export default ForwardDirectoryTree;
|
||||
136
frontend/node_modules/antd/es/tree/Tree.d.ts
generated
vendored
Normal file
136
frontend/node_modules/antd/es/tree/Tree.d.ts
generated
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
import type { Component } from 'react';
|
||||
import React from 'react';
|
||||
import type { BasicDataNode, TreeProps as RcTreeProps } from 'rc-tree';
|
||||
import RcTree from 'rc-tree';
|
||||
import type { DataNode, Key } from 'rc-tree/lib/interface';
|
||||
export type SwitcherIcon = React.ReactNode | ((props: AntTreeNodeProps) => React.ReactNode);
|
||||
export type TreeLeafIcon = React.ReactNode | ((props: AntTreeNodeProps) => React.ReactNode);
|
||||
type TreeIcon = React.ReactNode | ((props: AntdTreeNodeAttribute) => React.ReactNode);
|
||||
export interface AntdTreeNodeAttribute {
|
||||
eventKey: string;
|
||||
prefixCls: string;
|
||||
className: string;
|
||||
expanded: boolean;
|
||||
selected: boolean;
|
||||
checked: boolean;
|
||||
halfChecked: boolean;
|
||||
children: React.ReactNode;
|
||||
title: React.ReactNode;
|
||||
pos: string;
|
||||
dragOver: boolean;
|
||||
dragOverGapTop: boolean;
|
||||
dragOverGapBottom: boolean;
|
||||
isLeaf: boolean;
|
||||
selectable: boolean;
|
||||
disabled: boolean;
|
||||
disableCheckbox: boolean;
|
||||
}
|
||||
export interface AntTreeNodeProps {
|
||||
className?: string;
|
||||
checkable?: boolean;
|
||||
disabled?: boolean;
|
||||
disableCheckbox?: boolean;
|
||||
title?: React.ReactNode | ((data: DataNode) => React.ReactNode);
|
||||
key?: Key;
|
||||
eventKey?: Key;
|
||||
isLeaf?: boolean;
|
||||
checked?: boolean;
|
||||
expanded?: boolean;
|
||||
loading?: boolean;
|
||||
selected?: boolean;
|
||||
selectable?: boolean;
|
||||
icon?: TreeIcon;
|
||||
children?: React.ReactNode;
|
||||
[customProp: string]: any;
|
||||
}
|
||||
export interface AntTreeNode extends Component<AntTreeNodeProps> {
|
||||
}
|
||||
export interface AntTreeNodeBaseEvent {
|
||||
node: AntTreeNode;
|
||||
nativeEvent: MouseEvent;
|
||||
}
|
||||
export interface AntTreeNodeCheckedEvent extends AntTreeNodeBaseEvent {
|
||||
event: 'check';
|
||||
checked?: boolean;
|
||||
checkedNodes?: AntTreeNode[];
|
||||
}
|
||||
export interface AntTreeNodeSelectedEvent extends AntTreeNodeBaseEvent {
|
||||
event: 'select';
|
||||
selected?: boolean;
|
||||
selectedNodes?: DataNode[];
|
||||
}
|
||||
export interface AntTreeNodeExpandedEvent extends AntTreeNodeBaseEvent {
|
||||
expanded?: boolean;
|
||||
}
|
||||
export interface AntTreeNodeMouseEvent {
|
||||
node: AntTreeNode;
|
||||
event: React.DragEvent<HTMLElement>;
|
||||
}
|
||||
export interface AntTreeNodeDragEnterEvent extends AntTreeNodeMouseEvent {
|
||||
expandedKeys: Key[];
|
||||
}
|
||||
export interface AntTreeNodeDropEvent {
|
||||
node: AntTreeNode;
|
||||
dragNode: AntTreeNode;
|
||||
dragNodesKeys: Key[];
|
||||
dropPosition: number;
|
||||
dropToGap?: boolean;
|
||||
event: React.MouseEvent<HTMLElement>;
|
||||
}
|
||||
export type TreeNodeNormal = DataNode;
|
||||
type DraggableFn = (node: DataNode) => boolean;
|
||||
interface DraggableConfig {
|
||||
icon?: React.ReactNode;
|
||||
nodeDraggable?: DraggableFn;
|
||||
}
|
||||
export interface TreeProps<T extends BasicDataNode = DataNode> extends Omit<RcTreeProps<T>, 'prefixCls' | 'showLine' | 'direction' | 'draggable' | 'icon' | 'switcherIcon'> {
|
||||
showLine?: boolean | {
|
||||
showLeafIcon: boolean | TreeLeafIcon;
|
||||
};
|
||||
className?: string;
|
||||
/** Whether to support multiple selection */
|
||||
multiple?: boolean;
|
||||
/** Whether to automatically expand the parent node */
|
||||
autoExpandParent?: boolean;
|
||||
/** Node selection in Checkable state is fully controlled (the selected state of parent and child nodes is no longer associated) */
|
||||
checkStrictly?: boolean;
|
||||
/** Whether to support selection */
|
||||
checkable?: boolean;
|
||||
/** whether to disable the tree */
|
||||
disabled?: boolean;
|
||||
/** Expand all tree nodes by default */
|
||||
defaultExpandAll?: boolean;
|
||||
/** Expand the corresponding tree node by default */
|
||||
defaultExpandParent?: boolean;
|
||||
/** Expand the specified tree node by default */
|
||||
defaultExpandedKeys?: Key[];
|
||||
/** (Controlled) Expand the specified tree node */
|
||||
expandedKeys?: Key[];
|
||||
/** (Controlled) Tree node with checked checkbox */
|
||||
checkedKeys?: Key[] | {
|
||||
checked: Key[];
|
||||
halfChecked: Key[];
|
||||
};
|
||||
/** Tree node with checkbox checked by default */
|
||||
defaultCheckedKeys?: Key[];
|
||||
/** (Controlled) Set the selected tree node */
|
||||
selectedKeys?: Key[];
|
||||
/** Tree node selected by default */
|
||||
defaultSelectedKeys?: Key[];
|
||||
selectable?: boolean;
|
||||
/** Click on the tree node to trigger */
|
||||
filterAntTreeNode?: (node: AntTreeNode) => boolean;
|
||||
loadedKeys?: Key[];
|
||||
/** Set the node to be draggable (IE>8) */
|
||||
draggable?: DraggableFn | boolean | DraggableConfig;
|
||||
style?: React.CSSProperties;
|
||||
showIcon?: boolean;
|
||||
icon?: TreeIcon;
|
||||
switcherIcon?: SwitcherIcon;
|
||||
switcherLoadingIcon?: React.ReactNode;
|
||||
prefixCls?: string;
|
||||
children?: React.ReactNode;
|
||||
blockNode?: boolean;
|
||||
}
|
||||
declare const Tree: React.ForwardRefExoticComponent<TreeProps<DataNode> & React.RefAttributes<RcTree<DataNode>>>;
|
||||
export default Tree;
|
||||
116
frontend/node_modules/antd/es/tree/Tree.js
generated
vendored
Normal file
116
frontend/node_modules/antd/es/tree/Tree.js
generated
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
"use client";
|
||||
|
||||
import React from 'react';
|
||||
import HolderOutlined from "@ant-design/icons/es/icons/HolderOutlined";
|
||||
import classNames from 'classnames';
|
||||
import RcTree from 'rc-tree';
|
||||
import initCollapseMotion from '../_util/motion';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import DisabledContext from '../config-provider/DisabledContext';
|
||||
import { useToken } from '../theme/internal';
|
||||
import useStyle from './style';
|
||||
import dropIndicatorRender from './utils/dropIndicator';
|
||||
import SwitcherIconCom from './utils/iconUtil';
|
||||
const Tree = /*#__PURE__*/React.forwardRef((props, ref) => {
|
||||
var _a;
|
||||
const {
|
||||
getPrefixCls,
|
||||
direction,
|
||||
virtual,
|
||||
tree
|
||||
} = React.useContext(ConfigContext);
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
className,
|
||||
showIcon = false,
|
||||
showLine,
|
||||
switcherIcon,
|
||||
switcherLoadingIcon,
|
||||
blockNode = false,
|
||||
children,
|
||||
checkable = false,
|
||||
selectable = true,
|
||||
draggable,
|
||||
disabled,
|
||||
motion: customMotion,
|
||||
style
|
||||
} = props;
|
||||
const prefixCls = getPrefixCls('tree', customizePrefixCls);
|
||||
const rootPrefixCls = getPrefixCls();
|
||||
const contextDisabled = React.useContext(DisabledContext);
|
||||
const mergedDisabled = disabled !== null && disabled !== void 0 ? disabled : contextDisabled;
|
||||
const motion = customMotion !== null && customMotion !== void 0 ? customMotion : Object.assign(Object.assign({}, initCollapseMotion(rootPrefixCls)), {
|
||||
motionAppear: false
|
||||
});
|
||||
const newProps = Object.assign(Object.assign({}, props), {
|
||||
checkable,
|
||||
selectable,
|
||||
showIcon,
|
||||
motion,
|
||||
blockNode,
|
||||
disabled: mergedDisabled,
|
||||
showLine: Boolean(showLine),
|
||||
dropIndicatorRender
|
||||
});
|
||||
const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);
|
||||
const [, token] = useToken();
|
||||
const itemHeight = token.paddingXS / 2 + (((_a = token.Tree) === null || _a === void 0 ? void 0 : _a.titleHeight) || token.controlHeightSM);
|
||||
const draggableConfig = React.useMemo(() => {
|
||||
if (!draggable) {
|
||||
return false;
|
||||
}
|
||||
let mergedDraggable = {};
|
||||
switch (typeof draggable) {
|
||||
case 'function':
|
||||
mergedDraggable.nodeDraggable = draggable;
|
||||
break;
|
||||
case 'object':
|
||||
mergedDraggable = Object.assign({}, draggable);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
// Do nothing
|
||||
}
|
||||
if (mergedDraggable.icon !== false) {
|
||||
mergedDraggable.icon = mergedDraggable.icon || /*#__PURE__*/React.createElement(HolderOutlined, null);
|
||||
}
|
||||
return mergedDraggable;
|
||||
}, [draggable]);
|
||||
const renderSwitcherIcon = nodeProps => (/*#__PURE__*/React.createElement(SwitcherIconCom, {
|
||||
prefixCls: prefixCls,
|
||||
switcherIcon: switcherIcon,
|
||||
switcherLoadingIcon: switcherLoadingIcon,
|
||||
treeNodeProps: nodeProps,
|
||||
showLine: showLine
|
||||
}));
|
||||
return wrapCSSVar(
|
||||
/*#__PURE__*/
|
||||
// @ts-ignore
|
||||
React.createElement(RcTree, Object.assign({
|
||||
itemHeight: itemHeight,
|
||||
ref: ref,
|
||||
virtual: virtual
|
||||
}, newProps, {
|
||||
// newProps may contain style so declare style below it
|
||||
style: Object.assign(Object.assign({}, tree === null || tree === void 0 ? void 0 : tree.style), style),
|
||||
prefixCls: prefixCls,
|
||||
className: classNames({
|
||||
[`${prefixCls}-icon-hide`]: !showIcon,
|
||||
[`${prefixCls}-block-node`]: blockNode,
|
||||
[`${prefixCls}-unselectable`]: !selectable,
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl',
|
||||
[`${prefixCls}-disabled`]: mergedDisabled
|
||||
}, tree === null || tree === void 0 ? void 0 : tree.className, className, hashId, cssVarCls),
|
||||
direction: direction,
|
||||
checkable: checkable ? /*#__PURE__*/React.createElement("span", {
|
||||
className: `${prefixCls}-checkbox-inner`
|
||||
}) : checkable,
|
||||
selectable: selectable,
|
||||
switcherIcon: renderSwitcherIcon,
|
||||
draggable: draggableConfig
|
||||
}), children));
|
||||
});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Tree.displayName = 'Tree';
|
||||
}
|
||||
export default Tree;
|
||||
16
frontend/node_modules/antd/es/tree/index.d.ts
generated
vendored
Normal file
16
frontend/node_modules/antd/es/tree/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import type RcTree from 'rc-tree';
|
||||
import type { BasicDataNode } from 'rc-tree';
|
||||
import { TreeNode } from 'rc-tree';
|
||||
import type { DataNode } from 'rc-tree/lib/interface';
|
||||
import DirectoryTree from './DirectoryTree';
|
||||
import type { TreeProps } from './Tree';
|
||||
export type { ExpandAction as DirectoryTreeExpandAction, DirectoryTreeProps, } from './DirectoryTree';
|
||||
export type { AntTreeNode, AntTreeNodeCheckedEvent, AntTreeNodeExpandedEvent, AntTreeNodeMouseEvent, AntTreeNodeProps, AntTreeNodeSelectedEvent, AntdTreeNodeAttribute, TreeProps, } from './Tree';
|
||||
export type { EventDataNode } from 'rc-tree/lib/interface';
|
||||
export type { DataNode, BasicDataNode };
|
||||
type CompoundedComponent = (<T extends BasicDataNode | DataNode = DataNode>(props: React.PropsWithChildren<TreeProps<T>> & React.RefAttributes<RcTree>) => React.ReactElement) & {
|
||||
TreeNode: typeof TreeNode;
|
||||
DirectoryTree: typeof DirectoryTree;
|
||||
};
|
||||
declare const Tree: CompoundedComponent;
|
||||
export default Tree;
|
||||
9
frontend/node_modules/antd/es/tree/index.js
generated
vendored
Normal file
9
frontend/node_modules/antd/es/tree/index.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import { TreeNode } from 'rc-tree';
|
||||
import DirectoryTree from './DirectoryTree';
|
||||
import TreePure from './Tree';
|
||||
const Tree = TreePure;
|
||||
Tree.DirectoryTree = DirectoryTree;
|
||||
Tree.TreeNode = TreeNode;
|
||||
export default Tree;
|
||||
3
frontend/node_modules/antd/es/tree/style/directory.d.ts
generated
vendored
Normal file
3
frontend/node_modules/antd/es/tree/style/directory.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { CSSObject } from '@ant-design/cssinjs';
|
||||
import type { TreeToken } from '.';
|
||||
export declare const genDirectoryStyle: ({ treeCls, treeNodeCls, directoryNodeSelectedBg, directoryNodeSelectedColor, motionDurationMid, borderRadius, controlItemBgHover, }: TreeToken) => CSSObject;
|
||||
59
frontend/node_modules/antd/es/tree/style/directory.js
generated
vendored
Normal file
59
frontend/node_modules/antd/es/tree/style/directory.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
// ============================ Directory =============================
|
||||
export const genDirectoryStyle = ({
|
||||
treeCls,
|
||||
treeNodeCls,
|
||||
directoryNodeSelectedBg,
|
||||
directoryNodeSelectedColor,
|
||||
motionDurationMid,
|
||||
borderRadius,
|
||||
controlItemBgHover
|
||||
}) => ({
|
||||
[`${treeCls}${treeCls}-directory ${treeNodeCls}`]: {
|
||||
// >>> Title
|
||||
[`${treeCls}-node-content-wrapper`]: {
|
||||
position: 'static',
|
||||
[`&:has(${treeCls}-drop-indicator)`]: {
|
||||
position: 'relative'
|
||||
},
|
||||
[`> *:not(${treeCls}-drop-indicator)`]: {
|
||||
position: 'relative'
|
||||
},
|
||||
'&:hover': {
|
||||
background: 'transparent'
|
||||
},
|
||||
// Expand interactive area to whole line
|
||||
'&:before': {
|
||||
position: 'absolute',
|
||||
inset: 0,
|
||||
transition: `background-color ${motionDurationMid}`,
|
||||
content: '""',
|
||||
borderRadius
|
||||
},
|
||||
'&:hover:before': {
|
||||
background: controlItemBgHover
|
||||
}
|
||||
},
|
||||
[`${treeCls}-switcher, ${treeCls}-checkbox, ${treeCls}-draggable-icon`]: {
|
||||
zIndex: 1
|
||||
},
|
||||
// ============= Selected =============
|
||||
'&-selected': {
|
||||
background: directoryNodeSelectedBg,
|
||||
borderRadius,
|
||||
[`${treeCls}-switcher, ${treeCls}-draggable-icon`]: {
|
||||
color: directoryNodeSelectedColor
|
||||
},
|
||||
// >>> Title
|
||||
[`${treeCls}-node-content-wrapper`]: {
|
||||
color: directoryNodeSelectedColor,
|
||||
background: 'transparent',
|
||||
'&, &:hover': {
|
||||
color: directoryNodeSelectedColor
|
||||
},
|
||||
'&:before, &:hover:before': {
|
||||
background: directoryNodeSelectedBg
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
63
frontend/node_modules/antd/es/tree/style/index.d.ts
generated
vendored
Normal file
63
frontend/node_modules/antd/es/tree/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs';
|
||||
import type { AliasToken, CSSUtil, FullToken, GetDefaultToken } from '../../theme/internal';
|
||||
export interface TreeSharedToken {
|
||||
/**
|
||||
* @desc 节点标题高度
|
||||
* @descEN Node title height
|
||||
*/
|
||||
titleHeight: number;
|
||||
/**
|
||||
* @desc 缩进宽度
|
||||
* @descEN Indent width of tree
|
||||
*/
|
||||
indentSize?: number;
|
||||
/**
|
||||
* @desc 节点悬浮态背景色
|
||||
* @descEN Background color of hovered node
|
||||
*/
|
||||
nodeHoverBg: string;
|
||||
/**
|
||||
* @desc 节点悬浮态态文字颜色
|
||||
* @descEN Text color of hovered node
|
||||
*/
|
||||
nodeHoverColor: string;
|
||||
/**
|
||||
* @desc 节点选中态背景色
|
||||
* @descEN Background color of selected node
|
||||
*/
|
||||
nodeSelectedBg: string;
|
||||
/**
|
||||
* @desc 节点选中态文字颜色
|
||||
* @descEN Text color of selected node
|
||||
*/
|
||||
nodeSelectedColor: string;
|
||||
}
|
||||
export interface ComponentToken extends TreeSharedToken {
|
||||
/**
|
||||
* @desc 目录树节点选中文字颜色
|
||||
* @descEN Text color of selected directory node
|
||||
*/
|
||||
directoryNodeSelectedColor: string;
|
||||
/**
|
||||
* @desc 目录树节点选中背景色
|
||||
* @descEN Background color of selected directory node
|
||||
*/
|
||||
directoryNodeSelectedBg: string;
|
||||
}
|
||||
export type TreeToken = FullToken<'Tree'> & {
|
||||
treeCls: string;
|
||||
treeNodeCls: string;
|
||||
treeNodePadding: number | string;
|
||||
};
|
||||
export declare const genBaseStyle: (prefixCls: string, token: TreeToken) => CSSObject;
|
||||
export declare const genTreeStyle: (prefixCls: string, token: AliasToken & TreeSharedToken & CSSUtil,
|
||||
/**
|
||||
* @descCN 是否启用目录树样式
|
||||
* @descEN Whether to enable directory style
|
||||
* @default true
|
||||
*/
|
||||
enableDirectory?: boolean) => CSSInterpolation;
|
||||
export declare const initComponentToken: (token: AliasToken) => TreeSharedToken;
|
||||
export declare const prepareComponentToken: GetDefaultToken<'Tree'>;
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
371
frontend/node_modules/antd/es/tree/style/index.js
generated
vendored
Normal file
371
frontend/node_modules/antd/es/tree/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,371 @@
|
||||
import { Keyframes, unit } from '@ant-design/cssinjs';
|
||||
import { getStyle as getCheckboxStyle } from '../../checkbox/style';
|
||||
import { genFocusOutline, resetComponent } from '../../style';
|
||||
import { genCollapseMotion } from '../../style/motion';
|
||||
import { genStyleHooks, mergeToken } from '../../theme/internal';
|
||||
import { genDirectoryStyle } from './directory';
|
||||
// ============================ Keyframes =============================
|
||||
const treeNodeFX = new Keyframes('ant-tree-node-fx-do-not-use', {
|
||||
'0%': {
|
||||
opacity: 0
|
||||
},
|
||||
'100%': {
|
||||
opacity: 1
|
||||
}
|
||||
});
|
||||
// ============================== Switch ==============================
|
||||
const getSwitchStyle = (prefixCls, token) => ({
|
||||
[`.${prefixCls}-switcher-icon`]: {
|
||||
display: 'inline-block',
|
||||
fontSize: 10,
|
||||
verticalAlign: 'baseline',
|
||||
svg: {
|
||||
transition: `transform ${token.motionDurationSlow}`
|
||||
}
|
||||
}
|
||||
});
|
||||
// =============================== Drop ===============================
|
||||
const getDropIndicatorStyle = (prefixCls, token) => ({
|
||||
[`.${prefixCls}-drop-indicator`]: {
|
||||
position: 'absolute',
|
||||
// it should displayed over the following node
|
||||
zIndex: 1,
|
||||
height: 2,
|
||||
backgroundColor: token.colorPrimary,
|
||||
borderRadius: 1,
|
||||
pointerEvents: 'none',
|
||||
'&:after': {
|
||||
position: 'absolute',
|
||||
top: -3,
|
||||
insetInlineStart: -6,
|
||||
width: 8,
|
||||
height: 8,
|
||||
backgroundColor: 'transparent',
|
||||
border: `${unit(token.lineWidthBold)} solid ${token.colorPrimary}`,
|
||||
borderRadius: '50%',
|
||||
content: '""'
|
||||
}
|
||||
}
|
||||
});
|
||||
export const genBaseStyle = (prefixCls, token) => {
|
||||
const {
|
||||
treeCls,
|
||||
treeNodeCls,
|
||||
treeNodePadding,
|
||||
titleHeight,
|
||||
indentSize,
|
||||
nodeSelectedBg,
|
||||
nodeHoverBg,
|
||||
colorTextQuaternary,
|
||||
controlItemBgActiveDisabled
|
||||
} = token;
|
||||
return {
|
||||
[treeCls]: Object.assign(Object.assign({}, resetComponent(token)), {
|
||||
// fix https://github.com/ant-design/ant-design/issues/50316
|
||||
['--rc-virtual-list-scrollbar-bg']: token.colorSplit,
|
||||
background: token.colorBgContainer,
|
||||
borderRadius: token.borderRadius,
|
||||
transition: `background-color ${token.motionDurationSlow}`,
|
||||
'&-rtl': {
|
||||
direction: 'rtl'
|
||||
},
|
||||
[`&${treeCls}-rtl ${treeCls}-switcher_close ${treeCls}-switcher-icon svg`]: {
|
||||
transform: 'rotate(90deg)'
|
||||
},
|
||||
[`&-focused:not(:hover):not(${treeCls}-active-focused)`]: genFocusOutline(token),
|
||||
// =================== Virtual List ===================
|
||||
[`${treeCls}-list-holder-inner`]: {
|
||||
alignItems: 'flex-start'
|
||||
},
|
||||
[`&${treeCls}-block-node`]: {
|
||||
[`${treeCls}-list-holder-inner`]: {
|
||||
alignItems: 'stretch',
|
||||
// >>> Title
|
||||
[`${treeCls}-node-content-wrapper`]: {
|
||||
flex: 'auto'
|
||||
},
|
||||
// >>> Drag
|
||||
[`${treeNodeCls}.dragging:after`]: {
|
||||
position: 'absolute',
|
||||
inset: 0,
|
||||
border: `1px solid ${token.colorPrimary}`,
|
||||
opacity: 0,
|
||||
animationName: treeNodeFX,
|
||||
animationDuration: token.motionDurationSlow,
|
||||
animationPlayState: 'running',
|
||||
animationFillMode: 'forwards',
|
||||
content: '""',
|
||||
pointerEvents: 'none',
|
||||
borderRadius: token.borderRadius
|
||||
}
|
||||
}
|
||||
},
|
||||
// ===================== TreeNode =====================
|
||||
[treeNodeCls]: {
|
||||
display: 'flex',
|
||||
alignItems: 'flex-start',
|
||||
marginBottom: treeNodePadding,
|
||||
lineHeight: unit(titleHeight),
|
||||
position: 'relative',
|
||||
// 非常重要,避免 drop-indicator 在拖拽过程中闪烁
|
||||
'&:before': {
|
||||
content: '""',
|
||||
position: 'absolute',
|
||||
zIndex: 1,
|
||||
insetInlineStart: 0,
|
||||
width: '100%',
|
||||
top: '100%',
|
||||
height: treeNodePadding
|
||||
},
|
||||
// Disabled
|
||||
[`&-disabled ${treeCls}-node-content-wrapper`]: {
|
||||
color: token.colorTextDisabled,
|
||||
cursor: 'not-allowed',
|
||||
'&:hover': {
|
||||
background: 'transparent'
|
||||
}
|
||||
},
|
||||
[`${treeCls}-checkbox-disabled + ${treeCls}-node-selected,&${treeNodeCls}-disabled${treeNodeCls}-selected ${treeCls}-node-content-wrapper`]: {
|
||||
backgroundColor: controlItemBgActiveDisabled
|
||||
},
|
||||
// we can not set pointer-events to none for checkbox in tree
|
||||
// ref: https://github.com/ant-design/ant-design/issues/39822#issuecomment-2605234058
|
||||
[`${treeCls}-checkbox-disabled`]: {
|
||||
pointerEvents: 'unset'
|
||||
},
|
||||
// not disable
|
||||
[`&:not(${treeNodeCls}-disabled)`]: {
|
||||
// >>> Title
|
||||
[`${treeCls}-node-content-wrapper`]: {
|
||||
'&:hover': {
|
||||
color: token.nodeHoverColor
|
||||
}
|
||||
}
|
||||
},
|
||||
[`&-active ${treeCls}-node-content-wrapper`]: {
|
||||
background: token.controlItemBgHover
|
||||
},
|
||||
[`&:not(${treeNodeCls}-disabled).filter-node ${treeCls}-title`]: {
|
||||
color: token.colorPrimary,
|
||||
fontWeight: token.fontWeightStrong
|
||||
},
|
||||
'&-draggable': {
|
||||
cursor: 'grab',
|
||||
[`${treeCls}-draggable-icon`]: {
|
||||
// https://github.com/ant-design/ant-design/issues/41915
|
||||
flexShrink: 0,
|
||||
width: titleHeight,
|
||||
textAlign: 'center',
|
||||
visibility: 'visible',
|
||||
color: colorTextQuaternary
|
||||
},
|
||||
[`&${treeNodeCls}-disabled ${treeCls}-draggable-icon`]: {
|
||||
visibility: 'hidden'
|
||||
}
|
||||
}
|
||||
},
|
||||
// >>> Indent
|
||||
[`${treeCls}-indent`]: {
|
||||
alignSelf: 'stretch',
|
||||
whiteSpace: 'nowrap',
|
||||
userSelect: 'none',
|
||||
'&-unit': {
|
||||
display: 'inline-block',
|
||||
width: indentSize
|
||||
}
|
||||
},
|
||||
// >>> Drag Handler
|
||||
[`${treeCls}-draggable-icon`]: {
|
||||
visibility: 'hidden'
|
||||
},
|
||||
// Switcher / Checkbox
|
||||
[`${treeCls}-switcher, ${treeCls}-checkbox`]: {
|
||||
marginInlineEnd: token.calc(token.calc(titleHeight).sub(token.controlInteractiveSize)).div(2).equal()
|
||||
},
|
||||
// >>> Switcher
|
||||
[`${treeCls}-switcher`]: Object.assign(Object.assign({}, getSwitchStyle(prefixCls, token)), {
|
||||
position: 'relative',
|
||||
flex: 'none',
|
||||
alignSelf: 'stretch',
|
||||
width: titleHeight,
|
||||
textAlign: 'center',
|
||||
cursor: 'pointer',
|
||||
userSelect: 'none',
|
||||
transition: `all ${token.motionDurationSlow}`,
|
||||
'&-noop': {
|
||||
cursor: 'unset'
|
||||
},
|
||||
'&:before': {
|
||||
pointerEvents: 'none',
|
||||
content: '""',
|
||||
width: titleHeight,
|
||||
height: titleHeight,
|
||||
position: 'absolute',
|
||||
left: {
|
||||
_skip_check_: true,
|
||||
value: 0
|
||||
},
|
||||
top: 0,
|
||||
borderRadius: token.borderRadius,
|
||||
transition: `all ${token.motionDurationSlow}`
|
||||
},
|
||||
[`&:not(${treeCls}-switcher-noop):hover:before`]: {
|
||||
backgroundColor: token.colorBgTextHover
|
||||
},
|
||||
[`&_close ${treeCls}-switcher-icon svg`]: {
|
||||
transform: 'rotate(-90deg)'
|
||||
},
|
||||
'&-loading-icon': {
|
||||
color: token.colorPrimary
|
||||
},
|
||||
'&-leaf-line': {
|
||||
position: 'relative',
|
||||
zIndex: 1,
|
||||
display: 'inline-block',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
// https://github.com/ant-design/ant-design/issues/31884
|
||||
'&:before': {
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
insetInlineEnd: token.calc(titleHeight).div(2).equal(),
|
||||
bottom: token.calc(treeNodePadding).mul(-1).equal(),
|
||||
marginInlineStart: -1,
|
||||
borderInlineEnd: `1px solid ${token.colorBorder}`,
|
||||
content: '""'
|
||||
},
|
||||
'&:after': {
|
||||
position: 'absolute',
|
||||
width: token.calc(token.calc(titleHeight).div(2).equal()).mul(0.8).equal(),
|
||||
height: token.calc(titleHeight).div(2).equal(),
|
||||
borderBottom: `1px solid ${token.colorBorder}`,
|
||||
content: '""'
|
||||
}
|
||||
}
|
||||
}),
|
||||
// >>> Title
|
||||
// add `${treeCls}-checkbox + span` to cover checkbox `${checkboxCls} + span`
|
||||
[`${treeCls}-node-content-wrapper`]: Object.assign(Object.assign({
|
||||
position: 'relative',
|
||||
minHeight: titleHeight,
|
||||
paddingBlock: 0,
|
||||
paddingInline: token.paddingXS,
|
||||
background: 'transparent',
|
||||
borderRadius: token.borderRadius,
|
||||
cursor: 'pointer',
|
||||
transition: `all ${token.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`
|
||||
}, getDropIndicatorStyle(prefixCls, token)), {
|
||||
'&:hover': {
|
||||
backgroundColor: nodeHoverBg
|
||||
},
|
||||
[`&${treeCls}-node-selected`]: {
|
||||
color: token.nodeSelectedColor,
|
||||
backgroundColor: nodeSelectedBg
|
||||
},
|
||||
// Icon
|
||||
[`${treeCls}-iconEle`]: {
|
||||
display: 'inline-block',
|
||||
width: titleHeight,
|
||||
height: titleHeight,
|
||||
textAlign: 'center',
|
||||
verticalAlign: 'top',
|
||||
'&:empty': {
|
||||
display: 'none'
|
||||
}
|
||||
}
|
||||
}),
|
||||
// https://github.com/ant-design/ant-design/issues/28217
|
||||
[`${treeCls}-unselectable ${treeCls}-node-content-wrapper:hover`]: {
|
||||
backgroundColor: 'transparent'
|
||||
},
|
||||
[`${treeNodeCls}.drop-container > [draggable]`]: {
|
||||
boxShadow: `0 0 0 2px ${token.colorPrimary}`
|
||||
},
|
||||
// ==================== Show Line =====================
|
||||
'&-show-line': {
|
||||
// ================ Indent lines ================
|
||||
[`${treeCls}-indent-unit`]: {
|
||||
position: 'relative',
|
||||
height: '100%',
|
||||
'&:before': {
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
insetInlineEnd: token.calc(titleHeight).div(2).equal(),
|
||||
bottom: token.calc(treeNodePadding).mul(-1).equal(),
|
||||
borderInlineEnd: `1px solid ${token.colorBorder}`,
|
||||
content: '""'
|
||||
},
|
||||
'&-end:before': {
|
||||
display: 'none'
|
||||
}
|
||||
},
|
||||
// ============== Cover Background ==============
|
||||
[`${treeCls}-switcher`]: {
|
||||
background: 'transparent',
|
||||
'&-line-icon': {
|
||||
// https://github.com/ant-design/ant-design/issues/32813
|
||||
verticalAlign: '-0.15em'
|
||||
}
|
||||
}
|
||||
},
|
||||
[`${treeNodeCls}-leaf-last ${treeCls}-switcher-leaf-line:before`]: {
|
||||
top: 'auto !important',
|
||||
bottom: 'auto !important',
|
||||
height: `${unit(token.calc(titleHeight).div(2).equal())} !important`
|
||||
}
|
||||
})
|
||||
};
|
||||
};
|
||||
// ============================== Merged ==============================
|
||||
export const genTreeStyle = (prefixCls, token,
|
||||
/**
|
||||
* @descCN 是否启用目录树样式
|
||||
* @descEN Whether to enable directory style
|
||||
* @default true
|
||||
*/
|
||||
enableDirectory = true) => {
|
||||
const treeCls = `.${prefixCls}`;
|
||||
const treeNodeCls = `${treeCls}-treenode`;
|
||||
const treeNodePadding = token.calc(token.paddingXS).div(2).equal();
|
||||
const treeToken = mergeToken(token, {
|
||||
treeCls,
|
||||
treeNodeCls,
|
||||
treeNodePadding
|
||||
});
|
||||
return [
|
||||
// Basic
|
||||
genBaseStyle(prefixCls, treeToken),
|
||||
// Directory
|
||||
enableDirectory && genDirectoryStyle(treeToken)].filter(Boolean);
|
||||
};
|
||||
export const initComponentToken = token => {
|
||||
const {
|
||||
controlHeightSM,
|
||||
controlItemBgHover,
|
||||
controlItemBgActive
|
||||
} = token;
|
||||
const titleHeight = controlHeightSM;
|
||||
return {
|
||||
titleHeight,
|
||||
indentSize: titleHeight,
|
||||
nodeHoverBg: controlItemBgHover,
|
||||
nodeHoverColor: token.colorText,
|
||||
nodeSelectedBg: controlItemBgActive,
|
||||
nodeSelectedColor: token.colorText
|
||||
};
|
||||
};
|
||||
export const prepareComponentToken = token => {
|
||||
const {
|
||||
colorTextLightSolid,
|
||||
colorPrimary
|
||||
} = token;
|
||||
return Object.assign(Object.assign({}, initComponentToken(token)), {
|
||||
directoryNodeSelectedColor: colorTextLightSolid,
|
||||
directoryNodeSelectedBg: colorPrimary
|
||||
});
|
||||
};
|
||||
export default genStyleHooks('Tree', (token, {
|
||||
prefixCls
|
||||
}) => [{
|
||||
[token.componentCls]: getCheckboxStyle(`${prefixCls}-checkbox`, token)
|
||||
}, genTreeStyle(prefixCls, token), genCollapseMotion(token)], prepareComponentToken);
|
||||
13
frontend/node_modules/antd/es/tree/utils/dictUtil.d.ts
generated
vendored
Normal file
13
frontend/node_modules/antd/es/tree/utils/dictUtil.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { DataNode, Key } from 'rc-tree/lib/interface';
|
||||
import type { TreeProps } from '../Tree';
|
||||
type FieldNames = TreeProps['fieldNames'];
|
||||
/** 计算选中范围,只考虑expanded情况以优化性能 */
|
||||
export declare function calcRangeKeys({ treeData, expandedKeys, startKey, endKey, fieldNames, }: {
|
||||
treeData: DataNode[];
|
||||
expandedKeys: Key[];
|
||||
startKey?: Key;
|
||||
endKey?: Key;
|
||||
fieldNames?: FieldNames;
|
||||
}): Key[];
|
||||
export declare function convertDirectoryKeysToNodes(treeData: DataNode[], keys: Key[], fieldNames?: FieldNames): DataNode[];
|
||||
export {};
|
||||
72
frontend/node_modules/antd/es/tree/utils/dictUtil.js
generated
vendored
Normal file
72
frontend/node_modules/antd/es/tree/utils/dictUtil.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
||||
import { fillFieldNames } from "rc-tree/es/utils/treeUtil";
|
||||
const RECORD_NONE = 0;
|
||||
const RECORD_START = 1;
|
||||
const RECORD_END = 2;
|
||||
function traverseNodesKey(treeData, callback, fieldNames) {
|
||||
const {
|
||||
key: fieldKey,
|
||||
children: fieldChildren
|
||||
} = fieldNames;
|
||||
function processNode(dataNode) {
|
||||
const key = dataNode[fieldKey];
|
||||
const children = dataNode[fieldChildren];
|
||||
if (callback(key, dataNode) !== false) {
|
||||
traverseNodesKey(children || [], callback, fieldNames);
|
||||
}
|
||||
}
|
||||
treeData.forEach(processNode);
|
||||
}
|
||||
/** 计算选中范围,只考虑expanded情况以优化性能 */
|
||||
export function calcRangeKeys({
|
||||
treeData,
|
||||
expandedKeys,
|
||||
startKey,
|
||||
endKey,
|
||||
fieldNames
|
||||
}) {
|
||||
const keys = [];
|
||||
let record = RECORD_NONE;
|
||||
if (startKey && startKey === endKey) {
|
||||
return [startKey];
|
||||
}
|
||||
if (!startKey || !endKey) {
|
||||
return [];
|
||||
}
|
||||
function matchKey(key) {
|
||||
return key === startKey || key === endKey;
|
||||
}
|
||||
traverseNodesKey(treeData, key => {
|
||||
if (record === RECORD_END) {
|
||||
return false;
|
||||
}
|
||||
if (matchKey(key)) {
|
||||
// Match test
|
||||
keys.push(key);
|
||||
if (record === RECORD_NONE) {
|
||||
record = RECORD_START;
|
||||
} else if (record === RECORD_START) {
|
||||
record = RECORD_END;
|
||||
return false;
|
||||
}
|
||||
} else if (record === RECORD_START) {
|
||||
// Append selection
|
||||
keys.push(key);
|
||||
}
|
||||
return expandedKeys.includes(key);
|
||||
}, fillFieldNames(fieldNames));
|
||||
return keys;
|
||||
}
|
||||
export function convertDirectoryKeysToNodes(treeData, keys, fieldNames) {
|
||||
const restKeys = _toConsumableArray(keys);
|
||||
const nodes = [];
|
||||
traverseNodesKey(treeData, (key, node) => {
|
||||
const index = restKeys.indexOf(key);
|
||||
if (index !== -1) {
|
||||
nodes.push(node);
|
||||
restKeys.splice(index, 1);
|
||||
}
|
||||
return !!restKeys.length;
|
||||
}, fillFieldNames(fieldNames));
|
||||
return nodes;
|
||||
}
|
||||
11
frontend/node_modules/antd/es/tree/utils/dropIndicator.d.ts
generated
vendored
Normal file
11
frontend/node_modules/antd/es/tree/utils/dropIndicator.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import React from 'react';
|
||||
import type { DirectionType } from '../../config-provider';
|
||||
export declare const offset = 4;
|
||||
declare function dropIndicatorRender(props: {
|
||||
dropPosition: -1 | 0 | 1;
|
||||
dropLevelOffset: number;
|
||||
indent: number;
|
||||
prefixCls: string;
|
||||
direction: DirectionType;
|
||||
}): React.JSX.Element;
|
||||
export default dropIndicatorRender;
|
||||
37
frontend/node_modules/antd/es/tree/utils/dropIndicator.js
generated
vendored
Normal file
37
frontend/node_modules/antd/es/tree/utils/dropIndicator.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
"use client";
|
||||
|
||||
import React from 'react';
|
||||
export const offset = 4;
|
||||
function dropIndicatorRender(props) {
|
||||
const {
|
||||
dropPosition,
|
||||
dropLevelOffset,
|
||||
prefixCls,
|
||||
indent,
|
||||
direction = 'ltr'
|
||||
} = props;
|
||||
const startPosition = direction === 'ltr' ? 'left' : 'right';
|
||||
const endPosition = direction === 'ltr' ? 'right' : 'left';
|
||||
const style = {
|
||||
[startPosition]: -dropLevelOffset * indent + offset,
|
||||
[endPosition]: 0
|
||||
};
|
||||
switch (dropPosition) {
|
||||
case -1:
|
||||
style.top = -3;
|
||||
break;
|
||||
case 1:
|
||||
style.bottom = -3;
|
||||
break;
|
||||
default:
|
||||
// dropPosition === 0
|
||||
style.bottom = -3;
|
||||
style[startPosition] = indent + offset;
|
||||
break;
|
||||
}
|
||||
return /*#__PURE__*/React.createElement("div", {
|
||||
style: style,
|
||||
className: `${prefixCls}-drop-indicator`
|
||||
});
|
||||
}
|
||||
export default dropIndicatorRender;
|
||||
13
frontend/node_modules/antd/es/tree/utils/iconUtil.d.ts
generated
vendored
Normal file
13
frontend/node_modules/antd/es/tree/utils/iconUtil.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import * as React from 'react';
|
||||
import type { AntTreeNodeProps, SwitcherIcon, TreeLeafIcon } from '../Tree';
|
||||
interface SwitcherIconProps {
|
||||
prefixCls: string;
|
||||
treeNodeProps: AntTreeNodeProps;
|
||||
switcherIcon?: SwitcherIcon;
|
||||
switcherLoadingIcon?: React.ReactNode;
|
||||
showLine?: boolean | {
|
||||
showLeafIcon: boolean | TreeLeafIcon;
|
||||
};
|
||||
}
|
||||
declare const SwitcherIconCom: React.FC<SwitcherIconProps>;
|
||||
export default SwitcherIconCom;
|
||||
78
frontend/node_modules/antd/es/tree/utils/iconUtil.js
generated
vendored
Normal file
78
frontend/node_modules/antd/es/tree/utils/iconUtil.js
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
"use client";
|
||||
|
||||
import * as React from 'react';
|
||||
import CaretDownFilled from "@ant-design/icons/es/icons/CaretDownFilled";
|
||||
import FileOutlined from "@ant-design/icons/es/icons/FileOutlined";
|
||||
import LoadingOutlined from "@ant-design/icons/es/icons/LoadingOutlined";
|
||||
import MinusSquareOutlined from "@ant-design/icons/es/icons/MinusSquareOutlined";
|
||||
import PlusSquareOutlined from "@ant-design/icons/es/icons/PlusSquareOutlined";
|
||||
import classNames from 'classnames';
|
||||
import { cloneElement } from '../../_util/reactNode';
|
||||
const SwitcherIconCom = props => {
|
||||
var _a, _b;
|
||||
const {
|
||||
prefixCls,
|
||||
switcherIcon,
|
||||
treeNodeProps,
|
||||
showLine,
|
||||
switcherLoadingIcon
|
||||
} = props;
|
||||
const {
|
||||
isLeaf,
|
||||
expanded,
|
||||
loading
|
||||
} = treeNodeProps;
|
||||
if (loading) {
|
||||
if (/*#__PURE__*/React.isValidElement(switcherLoadingIcon)) {
|
||||
return switcherLoadingIcon;
|
||||
}
|
||||
return /*#__PURE__*/React.createElement(LoadingOutlined, {
|
||||
className: `${prefixCls}-switcher-loading-icon`
|
||||
});
|
||||
}
|
||||
let showLeafIcon;
|
||||
if (showLine && typeof showLine === 'object') {
|
||||
showLeafIcon = showLine.showLeafIcon;
|
||||
}
|
||||
if (isLeaf) {
|
||||
if (!showLine) {
|
||||
return null;
|
||||
}
|
||||
if (typeof showLeafIcon !== 'boolean' && !!showLeafIcon) {
|
||||
const leafIcon = typeof showLeafIcon === 'function' ? showLeafIcon(treeNodeProps) : showLeafIcon;
|
||||
const leafCls = `${prefixCls}-switcher-line-custom-icon`;
|
||||
if (/*#__PURE__*/React.isValidElement(leafIcon)) {
|
||||
return cloneElement(leafIcon, {
|
||||
className: classNames((_a = leafIcon.props) === null || _a === void 0 ? void 0 : _a.className, leafCls)
|
||||
});
|
||||
}
|
||||
return leafIcon;
|
||||
}
|
||||
return showLeafIcon ? (/*#__PURE__*/React.createElement(FileOutlined, {
|
||||
className: `${prefixCls}-switcher-line-icon`
|
||||
})) : (/*#__PURE__*/React.createElement("span", {
|
||||
className: `${prefixCls}-switcher-leaf-line`
|
||||
}));
|
||||
}
|
||||
const switcherCls = `${prefixCls}-switcher-icon`;
|
||||
const switcher = typeof switcherIcon === 'function' ? switcherIcon(treeNodeProps) : switcherIcon;
|
||||
if (/*#__PURE__*/React.isValidElement(switcher)) {
|
||||
return cloneElement(switcher, {
|
||||
className: classNames((_b = switcher.props) === null || _b === void 0 ? void 0 : _b.className, switcherCls)
|
||||
});
|
||||
}
|
||||
if (switcher !== undefined) {
|
||||
return switcher;
|
||||
}
|
||||
if (showLine) {
|
||||
return expanded ? (/*#__PURE__*/React.createElement(MinusSquareOutlined, {
|
||||
className: `${prefixCls}-switcher-line-icon`
|
||||
})) : (/*#__PURE__*/React.createElement(PlusSquareOutlined, {
|
||||
className: `${prefixCls}-switcher-line-icon`
|
||||
}));
|
||||
}
|
||||
return /*#__PURE__*/React.createElement(CaretDownFilled, {
|
||||
className: switcherCls
|
||||
});
|
||||
};
|
||||
export default SwitcherIconCom;
|
||||
Reference in New Issue
Block a user