zmdms-webui 0.0.45 → 0.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,18 @@ interface ITreeProps extends TreeProps {
11
11
  */
12
12
  searchType?: "all" | "lazy";
13
13
  onSearch?: (value?: string) => void;
14
+ /** 外层容器样式 */
15
+ style?: React__default.CSSProperties;
16
+ /** 树样式 */
17
+ treeStyle?: React__default.CSSProperties;
18
+ /**
19
+ * 通过css设置树的高度相关控制,并不是通过设置Tree的height属性做虚拟滚动
20
+ * 一般在确认不需要虚拟滚动时使用,再需要自适应外部容器高度时使用
21
+ * 800px
22
+ * 800
23
+ * calc(100vh - 80px)
24
+ */
25
+ cssTreeHeight?: number | string;
14
26
  }
15
27
  interface TreeComponent extends React__default.ForwardRefExoticComponent<ITreeProps & React__default.RefAttributes<unknown>> {
16
28
  DirectoryTree: typeof Tree.DirectoryTree;
@@ -7,9 +7,11 @@ import classNames from '../node_modules/classnames/index.js';
7
7
  import { useBasicInfo, useAllDataHandle, useSearchHandle } from './hooks.js';
8
8
 
9
9
  var Tree = function (props, ref) {
10
- var searchType = props.searchType, onSearch = props.onSearch, className = props.className, resetProps = __rest(props, ["searchType", "onSearch", "className"]);
10
+ var searchType = props.searchType, onSearch = props.onSearch, className = props.className, style = props.style, treeStyle = props.treeStyle, cssTreeHeight = props.cssTreeHeight, resetProps = __rest(props, ["searchType", "onSearch", "className", "style", "treeStyle", "cssTreeHeight"]);
11
11
  var treeData = resetProps.treeData, fieldNames = resetProps.fieldNames;
12
- var classes = classNames("ztxk-tree", className, {});
12
+ var classes = classNames("ztxk-tree", className, {
13
+ "ztxk-tree--height": cssTreeHeight,
14
+ });
13
15
  // 获取基础数据的key值
14
16
  var _a = useBasicInfo({ fieldNames: fieldNames }), valueKey = _a.valueKey, titleKey = _a.titleKey, childrenKey = _a.childrenKey;
15
17
  // 获取拉平数据
@@ -28,7 +30,7 @@ var Tree = function (props, ref) {
28
30
  searchType: searchType,
29
31
  onSearch: onSearch,
30
32
  }), onSearchHandle = _b.onSearchHandle, expandedKeys = _b.expandedKeys, autoExpandParent = _b.autoExpandParent, onExpand = _b.onExpand;
31
- return (jsxs("div", __assign({ className: classes }, { children: [searchType ? jsx(MemoInput.Search, { onSearch: onSearchHandle }) : null, jsx(Tree$1, __assign({ expandedKeys: expandedKeys, autoExpandParent: autoExpandParent, onExpand: onExpand }, resetProps))] })));
33
+ return (jsxs("div", __assign({ className: classes, style: __assign({ height: cssTreeHeight }, style) }, { children: [searchType ? jsx(MemoInput.Search, { onSearch: onSearchHandle }) : null, jsx(Tree$1, __assign({ expandedKeys: expandedKeys, autoExpandParent: autoExpandParent, onExpand: onExpand, style: treeStyle }, resetProps))] })));
32
34
  };
33
35
  var MemoTree = memo(forwardRef(Tree));
34
36
  MemoTree.displayName = "ZTXK_WEBUI_Tree";