plain-design 1.0.0-beta.121 → 1.0.0-beta.123

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plain-design",
3
- "version": "1.0.0-beta.121",
3
+ "version": "1.0.0-beta.123",
4
4
  "description": "",
5
5
  "main": "dist/plain-design.min.js",
6
6
  "module": "dist/plain-design.commonjs.min.js",
@@ -33,7 +33,7 @@ export const RenderTreeNode = designComponent({
33
33
  const classes = useClasses(() => [
34
34
  getComponentCls('tree-node'),
35
35
  {
36
- 'tree-node-current': tree.state.current === props.treeNode.key,
36
+ 'tree-node-current': !tree.props.disableCurrent && tree.state.current === props.treeNode.key,
37
37
  'tree-node-lead': isLeaf.value,
38
38
  'tree-node-single-check': !props.multiple && props.treeNode.checkStatus() === CheckboxStatus.check,
39
39
  'tree-node-multi-check': props.multiple && props.treeNode.checkStatus() === CheckboxStatus.check,
@@ -35,6 +35,8 @@ export interface iTreeProps {
35
35
  getChildrenData?: (treeNode: iTreeNode | null) => Promise<any[] | null>,
36
36
  /*当前高亮的选中行,单选时这个值与modelValue逻辑一致*/
37
37
  current?: string,
38
+ /*禁用高亮当前选中行*/
39
+ disableCurrent?: boolean,
38
40
  /*是否为多选*/
39
41
  multiple?: boolean,
40
42
  /*单选的时候绑定值类型,last点击的最后一个节点,all所有父子节点*/
@@ -136,6 +136,7 @@ export function createTreeNode(
136
136
  };
137
137
  /*当前节点的文本是否匹配搜索关键词*/
138
138
  const isMatchSearch = () => {
139
+ if (empty) {return false;}
139
140
  const { filterMethod, filterText } = props;
140
141
  if (filterText == null || !filterText.trim().length) {
141
142
  return true;
@@ -15,6 +15,7 @@ export const TreePropsOptions = {
15
15
  lazy: { type: Boolean as PropType<iTreeProps["lazy"]> },
16
16
  getChildrenData: { type: Function as PropType<iTreeProps["getChildrenData"]> },
17
17
  current: { type: String as PropType<iTreeProps["current"]> },
18
+ disableCurrent: { type: Boolean as PropType<iTreeProps["disableCurrent"]> },
18
19
  multiple: { type: Boolean as PropType<iTreeProps["multiple"]> },
19
20
  singleValueType: { type: String as PropType<iTreeProps['singleValueType']> },
20
21
  checkLast: { type: Boolean as PropType<iTreeProps['checkLast']>, default: null },
@@ -14,6 +14,7 @@ export const TreeNodeWithMenu = designComponent({
14
14
  treeNode: { type: Object as PropType<iTreeNode>, required: true },
15
15
  dropdownOptions: { type: Array as PropType<iTreeNodeWithMenuOption[]> },
16
16
  dropdownAttrs: { type: Object as PropType<ComponentPropsType<typeof Dropdown>> },
17
+ hideButton: { type: Boolean },
17
18
  },
18
19
  setup({ props }) {
19
20
 
@@ -56,6 +57,9 @@ export const TreeNodeWithMenu = designComponent({
56
57
  <div className={classes.value}>
57
58
  <div className="tree-node-with-menu-content" ref={onRef.content}>{props.treeNode.label()}</div>
58
59
  {(() => {
60
+ if (props.hideButton) {
61
+ return;
62
+ }
59
63
  let btn = (
60
64
  <div className="tree-node-with-menu-button" onMouseDown={handler.onMousedownDraggier.value}>
61
65
  <Icon icon="pi-drag-dot-vertical"/>