From c316db12a1ec9216f5cf736bc657e729bf675728 Mon Sep 17 00:00:00 2001 From: chucc Date: 2019年11月23日 10:41:42 +0800 Subject: [PATCH 1/5] doc: fix readme display format on github --- README.md | 216 +++++++++++++++++++++++++++--------------------------- 1 file changed, 108 insertions(+), 108 deletions(-) diff --git a/README.md b/README.md index 9ea1d6b..c1f81b4 100644 --- a/README.md +++ b/README.md @@ -32,99 +32,99 @@ npm install @wsfe/ctree ### CTree Props -| 属性 | 说明 | 类型 | 默认值 | -|:---------------------------------|:--------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------|:-------------| -| value | 选中的值,可用 v-model ;单选为字符串或数字,多选为 `separator` 分隔的字符串或数组,优先多选 | `string | number | Array` | 无 | -| data | 传入的树数据。数据量大时,不建议通过 props 传入数据,建议用 `setData` 方法代替 | `object[]` | [] | -| unloadDataList | 供未加载且选中节点查询 title 字段值用的列表,格式与 `data` 一致即可 | `object[]` | [] | -| showUnloadCheckedNodes | 过滤已选时是否在列表后面展示未加载的已选节点 | `boolean` | true | -| emptyText | 数据为空时显示的文本 | `string` | '暂无数据' | -| titleField | 节点标题字段 | `string` | 'title' | -| keyField | 节点唯一标识字段 | `string` | 'id' | -| separator | 多选模式下 value 分隔符 | `string` | ',' | -| checkable | 是否可多选 | `boolean` | false | -| selectable | 是否可单选 | `boolean` | false | -| filteredNodeCheckable | 是否可勾选被过滤节点 | `boolean` | false | -| cascade | 父子节点是否关联 | `boolean` | true | -| enableLeafOnly | 是否只启用子节点,当 `多选且父子不关联` 或 `单选` 时有效 | `boolean` | false | -| disableAll | 是否禁用所有节点 | `boolean` | false | -| defaultExpandAll | 是否默认展开所有节点 | `boolean` | false | -| defaultExpandedKeys `Deprecated` | 默认展开的节点 key | `Array` | [] | -| expandedKeys `2.2.0` | 展开的节点 key ,组件内部将会响应此 Prop 的变化 | `Array` | [] | -| draggable | 是否可拖拽 | `boolean` | false | -| droppable | 是否可放置 | `boolean` | false | -| beforeDropMethod | 在放置节点之前执行的方法,返回 true 允许放置, false 可阻止放置 | `(dragKey: string | number, dropKey: string | number, hoverPart: 'before' | 'body' | 'after') => boolean` | `() => true` | -| ignoreMode | 忽略模式,指定 `getCheckedNodes`, `getCheckedKeys` 与 `v-model` 默认要忽略的部分 | `'none' | 'parents' | 'children'` | 'none' | -| autoLoad | 异步加载初始化时是否自动加载根节点 | `boolean` | true | -| load | 异步加载方法 | `(node: null | TreeNode, resolve: Function, reject: Function) => any` | 无 | -| render | 节点渲染 render 函数 | `(h: CreateElement, node: TreeNode) => VNode` | 无 | -| filterMethod | 节点过滤方法 | `(keyword: string, node: TreeNode) => boolean` | 无 | -| expandOnFilter `2.1.0` | 过滤时是否展开所有可见节点 | `boolean` | true | -| unselectOnClick `2.1.0` | 点击已选中节点是否取消选中 | `boolean` | true | -| loading | 是否显示 loading 图标 | `boolean` | false | -| nodeClassName | 节点根元素的 class ,传入函数以对每个节点定制 class | `string | object | Array | (node: TreeNode) => string | object | Array` | 无 | -| nodeMinHeight | 根据节点最小高度计算数据总高度 | `number` | 30 | -| nodeIndent | 子节点缩进 | `number` | 20 | -| renderNodeAmount | 渲染节点数量,可见节点数大于此值且高度超过(容器可视高度能容纳节点数 + bufferNodeAmount)则不会渲染所有可见节点 | `number` | 100 | -| bufferNodeAmount | 当滚动到视野外的节点个数大于此值时刷新渲染节点 | `number` | 20 | +| 属性 | 说明 | 类型 | 默认值 | +|:---------------------------------|:--------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------|:-------------| +| value | 选中的值,可用 v-model ;单选为字符串或数字,多选为 `separator` 分隔的字符串或数组,优先多选 | `string \| number \| Array` | 无 | +| data | 传入的树数据。数据量大时,不建议通过 props 传入数据,建议用 `setData` 方法代替 | `object[]` | [] | +| unloadDataList | 供未加载且选中节点查询 title 字段值用的列表,格式与 `data` 一致即可 | `object[]` | [] | +| showUnloadCheckedNodes | 过滤已选时是否在列表后面展示未加载的已选节点 | `boolean` | true | +| emptyText | 数据为空时显示的文本 | `string` | '暂无数据' | +| titleField | 节点标题字段 | `string` | 'title' | +| keyField | 节点唯一标识字段 | `string` | 'id' | +| separator | 多选模式下 value 分隔符 | `string` | ',' | +| checkable | 是否可多选 | `boolean` | false | +| selectable | 是否可单选 | `boolean` | false | +| filteredNodeCheckable | 是否可勾选被过滤节点 | `boolean` | false | +| cascade | 父子节点是否关联 | `boolean` | true | +| enableLeafOnly | 是否只启用子节点,当 `多选且父子不关联` 或 `单选` 时有效 | `boolean` | false | +| disableAll | 是否禁用所有节点 | `boolean` | false | +| defaultExpandAll | 是否默认展开所有节点 | `boolean` | false | +| defaultExpandedKeys `Deprecated` | 默认展开的节点 key | `Array` | [] | +| expandedKeys `2.2.0` | 展开的节点 key ,组件内部将会响应此 Prop 的变化 | `Array` | [] | +| draggable | 是否可拖拽 | `boolean` | false | +| droppable | 是否可放置 | `boolean` | false | +| beforeDropMethod | 在放置节点之前执行的方法,返回 true 允许放置, false 可阻止放置 | `(dragKey: string \| number, dropKey: string \| number, hoverPart: 'before' \| 'body' \| 'after') => boolean` | `() => true` | +| ignoreMode | 忽略模式,指定 `getCheckedNodes`, `getCheckedKeys` 与 `v-model` 默认要忽略的部分 | `'none' \| 'parents' \| 'children'` | 'none' | +| autoLoad | 异步加载初始化时是否自动加载根节点 | `boolean` | true | +| load | 异步加载方法 | `(node: null \| TreeNode, resolve: Function, reject: Function) => any` | 无 | +| render | 节点渲染 render 函数 | `(h: CreateElement, node: TreeNode) => VNode` | 无 | +| filterMethod | 节点过滤方法 | `(keyword: string, node: TreeNode) => boolean` | 无 | +| expandOnFilter `2.1.0` | 过滤时是否展开所有可见节点 | `boolean` | true | +| unselectOnClick `2.1.0` | 点击已选中节点是否取消选中 | `boolean` | true | +| loading | 是否显示 loading 图标 | `boolean` | false | +| nodeClassName | 节点根元素的 class ,传入函数以对每个节点定制 class | `string \| object \| Array \| (node: TreeNode) => string \| object \| Array` | 无 | +| nodeMinHeight | 根据节点最小高度计算数据总高度 | `number` | 30 | +| nodeIndent | 子节点缩进 | `number` | 20 | +| renderNodeAmount | 渲染节点数量,可见节点数大于此值且高度超过(容器可视高度能容纳节点数 + bufferNodeAmount)则不会渲染所有可见节点 | `number` | 100 | +| bufferNodeAmount | 当滚动到视野外的节点个数大于此值时刷新渲染节点 | `number` | 20 | ### CTree Events 注:从 `2.0.8` 起,事件中返回的节点信息都是包括 `_parent` 与 `children` 的完整节点信息(拖拽事件的 `dataTransfer` 除外)。 -| 事件名 | 说明 | 返回值 | -|:-----------------|:----------------------------|:-------------------------------------------------------------------------| -| input | 选中节点改变时触发 | 选中的节点 | -| expand | 展开/折叠时触发 | 节点信息 | -| check | 勾选时触发(多选) | 被勾选的节点信息 | -| uncheck | 取消勾选时触发(多选) | 被取消勾选的节点信息 | -| checked-change | 勾选/取消勾选时触发(多选) | 所有被勾选节点(数组) | -| select | 选中时触发(单选) | 被选中的节点信息 | -| unselect | 取消选中时触发(单选) | 被取消选中的节点信息 | -| selected-change | 选中/取消选中时触发(单选) | 被选中节点 | -| click | 点击节点时触发 | 节点信息 | -| node-dblclick | 双击节点时触发 | 节点信息 | -| node-right-click | 右击节点时触发 | 节点信息 | -| node-dragstart | 开始拖拽节点时触发 | 节点信息, 拖拽事件对象 | -| node-dragenter | dragenter 时触发 | 节点信息 , 拖拽事件对象, 事件触发的节点部位 `'before' | 'body | 'after'` | -| node-dragover | dragover 时触发 | 节点信息 , 拖拽事件对象, 事件触发的节点部位 `'before' | 'body | 'after'` | -| node-dragleave | dragleave 时触发 | 节点信息 , 拖拽事件对象, 事件触发的节点部位 `'before' | 'body | 'after'` | -| node-drop | 放置节点时触发 | 节点信息 , 拖拽事件对象, 事件触发的节点部位 `'before' | 'body | 'after'` | +| 事件名 | 说明 | 返回值 | +|:-----------------|:----------------------------|:----------------------------------------------------------------------------| +| input | 选中节点改变时触发 | 选中的节点 | +| expand | 展开/折叠时触发 | 节点信息 | +| check | 勾选时触发(多选) | 被勾选的节点信息 | +| uncheck | 取消勾选时触发(多选) | 被取消勾选的节点信息 | +| checked-change | 勾选/取消勾选时触发(多选) | 所有被勾选节点(数组) | +| select | 选中时触发(单选) | 被选中的节点信息 | +| unselect | 取消选中时触发(单选) | 被取消选中的节点信息 | +| selected-change | 选中/取消选中时触发(单选) | 被选中节点 | +| click | 点击节点时触发 | 节点信息 | +| node-dblclick | 双击节点时触发 | 节点信息 | +| node-right-click | 右击节点时触发 | 节点信息 | +| node-dragstart | 开始拖拽节点时触发 | 节点信息, 拖拽事件对象 | +| node-dragenter | dragenter 时触发 | 节点信息 , 拖拽事件对象, 事件触发的节点部位 `'before' \| 'body' \| 'after'` | +| node-dragover | dragover 时触发 | 节点信息 , 拖拽事件对象, 事件触发的节点部位 `'before' \| 'body' \| 'after'` | +| node-dragleave | dragleave 时触发 | 节点信息 , 拖拽事件对象, 事件触发的节点部位 `'before' \| 'body' \| 'after'` | +| node-drop | 放置节点时触发 | 节点信息 , 拖拽事件对象, 事件触发的节点部位 `'before' \| 'body' \| 'after'` | ### CTree Methods -| 方法 | 说明 | 参数 | 返回值 | -|:-----------------------|:------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------| -| setData | 使用此方法重置树数据,可避免大量数据被 vue 监听 | `data: object[]`: 同 data Prop | `void` | -| setChecked | 设置多选选中/取消选中 | `key: string | number`: 节点 key
`value: boolean`: 是否选中 | `void` | -| setCheckedKeys | 批量设置选中/取消选中 | `keys: Array`: 节点 key
`value: boolean`: 是否选中 | `void` | -| checkAll | 设置所有数据全选 | 无 | `void` | -| clearChecked | 清空选中 | 无 | `void` | -| setSelected | 设置单选选中/取消选中 | `key: string | number`: 节点 key
`value: boolean`: 是否选中 | `void` | -| setExpand | 设置展开/折叠 | `key: string | number`: 节点 key
`value: boolean`: 是否展开
`expandParent: boolean = true`: 如果是展开是否同时展开父节点 `2.0.6` | `void` | -| setExpandKeys | 批量展开/折叠 | `keys: Array`: 节点 key
`value: boolean`: 是否展开 | `void` | -| setExpandAll | 设置全部展开/折叠 | `value: boolean`: 是否展开 | `void` | -| getCheckedNodes | 获取多选选中节点 | `ignoreMode: 'none' | 'parents' | 'children'`: 需要忽略的部分,默认为 ignoreMode Prop | `TreeNode[]` | -| getCheckedKeys | 获取多选选中节点 key | `ignoreMode: 'none' | 'parents' | 'children'`: 需要忽略的部分,默认为 ignoreMode Prop | `Array` | -| getIndeterminateNodes | 获取半选状态的节点 | 无 | `TreeNode[]` | -| getSelectedNode | 获取单选选中节点 | 无 | `TreeNode | null` | -| getSelectedKey | 获取单选选中节点 key | 无 | `TreeNode | null` | -| getExpandNodes | 获取展开的节点 | 无 | `TreeNode[]` | -| getExpandKeys | 获取展开的节点 key | 无 | `TreeNode[]` | -| getCurrentVisibleNodes | 获取当前可见的节点 | 无 | `TreeNode[]` | -| getNode | 根据 key 获取节点 | `key: string | number`: 节点 key | `TreeNode | null` | -| getTreeData | 获取树形结构的节点数据 | 无 | `TreeNode[]` | -| getFlatData | 获取扁平化后的节点数据 | 无 | `TreeNode[]` | -| getNodesCount | 获取节点总数量 | 无 | `number` | -| insertBefore | 在参照节点前插入一个节点 | `insertedNode`: 节点 key 或者单个节点数据
`referenceKey: string | number`: 参照节点 key | `TreeNode | null` 返回插入的节点 | -| insertAfter | 在参照节点后插入一个节点 | `insertedNode`: 节点 key 或者单个节点数据
`referenceKey: string | number`: 参照节点 key | `TreeNode | null` 返回插入的节点 | -| append | 在父节点第一层子节点的末尾插入一个节点 | `insertedNode`: 节点 key 或者单个节点数据
`parentKey: string | number`: 父节点 key | `TreeNode | null` 返回插入的节点 | -| prepend | 在父节点第一层子节点的开头插入一个节点 | `insertedNode`: 节点 key 或者单个节点数据
`parentKey: string | number`: 父节点 key | `TreeNode | null` 返回插入的节点 | -| remove | 删除节点 | `removedKey: string | number`: 要删除的节点 key | `TreeNode | null` 返回删除的节点 | -| filter | 过滤节点 | `keyword: string`: 过滤关键词
`filterMethod: (keyword: string, node: TreeNode) => boolean`: 过滤方法,默认为 filterMethod Prop ,如果没有传 filterMethod Prop 则为搜索 title 字段的一个内置方法 | `void` | -| showCheckedNodes | 展示已选节点 | `showUnloadCheckedNodes: boolean`: 是否显示未加载的选中节点,默认为 Prop 传入的值 | `void` | -| loadRootNodes | 从远程加载根节点 | 无 | `Promise` | -| scrollTo | 滚动到指定节点位置 | `key: string | number`: 节点 key
`verticalPosition: 'top' | 'center' | 'bottom' | number`: 滚动的垂直位置 | `void` | +| 方法 | 说明 | 参数 | 返回值 | +|:-----------------------|:------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------| +| setData | 使用此方法重置树数据,可避免大量数据被 vue 监听 | `data: object[]`: 同 data Prop | `void` | +| setChecked | 设置多选选中/取消选中 | `key: string \| number`: 节点 key
`value: boolean`: 是否选中 | `void` | +| setCheckedKeys | 批量设置选中/取消选中 | `keys: Array`: 节点 key
`value: boolean`: 是否选中 | `void` | +| checkAll | 设置所有数据全选 | 无 | `void` | +| clearChecked | 清空选中 | 无 | `void` | +| setSelected | 设置单选选中/取消选中 | `key: string \| number`: 节点 key
`value: boolean`: 是否选中 | `void` | +| setExpand | 设置展开/折叠 | `key: string \| number`: 节点 key
`value: boolean`: 是否展开
`expandParent: boolean = true`: 如果是展开是否同时展开父节点 `2.0.6` | `void` | +| setExpandKeys | 批量展开/折叠 | `keys: Array`: 节点 key
`value: boolean`: 是否展开 | `void` | +| setExpandAll | 设置全部展开/折叠 | `value: boolean`: 是否展开 | `void` | +| getCheckedNodes | 获取多选选中节点 | `ignoreMode: 'none' \| 'parents' \| 'children'`: 需要忽略的部分,默认为 ignoreMode Prop | `TreeNode[]` | +| getCheckedKeys | 获取多选选中节点 key | `ignoreMode: 'none' \| 'parents' \| 'children'`: 需要忽略的部分,默认为 ignoreMode Prop | `Array` | +| getIndeterminateNodes | 获取半选状态的节点 | 无 | `TreeNode[]` | +| getSelectedNode | 获取单选选中节点 | 无 | `TreeNode \| null` | +| getSelectedKey | 获取单选选中节点 key | 无 | `TreeNode \| null` | +| getExpandNodes | 获取展开的节点 | 无 | `TreeNode[]` | +| getExpandKeys | 获取展开的节点 key | 无 | `TreeNode[]` | +| getCurrentVisibleNodes | 获取当前可见的节点 | 无 | `TreeNode[]` | +| getNode | 根据 key 获取节点 | `key: string \| number`: 节点 key | `TreeNode \| null` | +| getTreeData | 获取树形结构的节点数据 | 无 | `TreeNode[]` | +| getFlatData | 获取扁平化后的节点数据 | 无 | `TreeNode[]` | +| getNodesCount | 获取节点总数量 | 无 | `number` | +| insertBefore | 在参照节点前插入一个节点 | `insertedNode`: 节点 key 或者单个节点数据
`referenceKey: string \| number`: 参照节点 key | `TreeNode \| null` 返回插入的节点 | +| insertAfter | 在参照节点后插入一个节点 | `insertedNode`: 节点 key 或者单个节点数据
`referenceKey: string \| number`: 参照节点 key | `TreeNode \| null` 返回插入的节点 | +| append | 在父节点第一层子节点的末尾插入一个节点 | `insertedNode`: 节点 key 或者单个节点数据
`parentKey: string \| number`: 父节点 key | `TreeNode \| null` 返回插入的节点 | +| prepend | 在父节点第一层子节点的开头插入一个节点 | `insertedNode`: 节点 key 或者单个节点数据
`parentKey: string \| number`: 父节点 key | `TreeNode \| null` 返回插入的节点 | +| remove | 删除节点 | `removedKey: string \| number`: 要删除的节点 key | `TreeNode \| null` 返回删除的节点 | +| filter | 过滤节点 | `keyword: string`: 过滤关键词
`filterMethod: (keyword: string, node: TreeNode) => boolean`: 过滤方法,默认为 filterMethod Prop ,如果没有传 filterMethod Prop 则为搜索 title 字段的一个内置方法 | `void` | +| showCheckedNodes | 展示已选节点 | `showUnloadCheckedNodes: boolean`: 是否显示未加载的选中节点,默认为 Prop 传入的值 | `void` | +| loadRootNodes | 从远程加载根节点 | 无 | `Promise` | +| scrollTo | 滚动到指定节点位置 | `key: string \| number`: 节点 key
`verticalPosition: 'top' \| 'center' \| 'bottom' \| number`: 滚动的垂直位置 | `void` | ### CTree Slots @@ -161,18 +161,18 @@ npm install @wsfe/ctree 注:可在 `CTreeSearch` 上直接使用 `CTree` 的所有 Props -| 属性 | 说明 | 类型 | 默认值 | -|:---------------------|:-----------------------------------------------------------------------------------|:--------------------------------------------|:-------------| -| searchPlaceholder | 搜索输入框的 placeholder | `string` | '搜索关键字' | -| showCheckAll | 是否显示全选复选框 | `boolean` | true | -| showCheckedButton | 是否显示已选按钮 | `boolean` | true | -| checkedButtonText | 已选按钮文字 | `string` | '已选' | -| showFooter | 是否显示底部信息 | `boolean` | true | -| searchMethod `2.0.2` | 如果传入此 Prop ,触发 `search` 事件后将会执行此方法,否则会执行组件内置的搜索方法 | `(keyword: string) => void | Promise` | 无 | -| searchLength | 触发搜索的字符长度 | `number` | 1 | -| searchDisabled | 禁用搜索功能 | `boolean` | false | -| searchRemote | 是否远程搜索,传入 `searchMethod` 时无效 | `boolean` | false | -| searchDebounceTime | 搜索防抖时间,单位为毫秒 | `number` | 300 | +| 属性 | 说明 | 类型 | 默认值 | +|:---------------------|:-----------------------------------------------------------------------------------|:---------------------------------------------|:-------------| +| searchPlaceholder | 搜索输入框的 placeholder | `string` | '搜索关键字' | +| showCheckAll | 是否显示全选复选框 | `boolean` | true | +| showCheckedButton | 是否显示已选按钮 | `boolean` | true | +| checkedButtonText | 已选按钮文字 | `string` | '已选' | +| showFooter | 是否显示底部信息 | `boolean` | true | +| searchMethod `2.0.2` | 如果传入此 Prop ,触发 `search` 事件后将会执行此方法,否则会执行组件内置的搜索方法 | `(keyword: string) => void \| Promise` | 无 | +| searchLength | 触发搜索的字符长度 | `number` | 1 | +| searchDisabled | 禁用搜索功能 | `boolean` | false | +| searchRemote | 是否远程搜索,传入 `searchMethod` 时无效 | `boolean` | false | +| searchDebounceTime | 搜索防抖时间,单位为毫秒 | `number` | 300 | ### CTreeSearch Events @@ -208,17 +208,17 @@ npm install @wsfe/ctree 注:可在 `CTreeDrop` 上直接使用 `CTree` 和 `CTreeSearch` 的所有 Props -| 属性 | 说明 | 类型 | 默认值 | -|:---------------------------|:---------------------------------------------------------------------------------|:-----------------------------------------------------------------------------|:---------------| -| dropHeight | 下拉内容高度 | `number` | 300 | -| dropPlaceholder | 展示输入框 placeholder | `string` | 无 | -| dropDisabled | 是否禁用 | `boolean` | false | -| clearable | 允许清空 | `boolean` | false | -| placement | 下拉弹出框位置,注意!!不支持自动识别方向 | `'bottom-start' | 'bottom-end' | 'bottom' | 'top-start' | 'top-end' | 'top'` | 'bottom-start' | -| transfer | 将下拉 DOM 转移到 body 中 | `boolean` | false | -| dropdownClassName | 在下拉框容器上额外添加的 class | `string | string[]` | 无 | -| dropdownMinWidth `2.0.1` | 下拉框容器最小宽度,未指定则默认为展示输入框宽度。 适合 transfer 为 false 时使用 | `number` | 无 | -| dropdownWidthFixed `2.0.5` | 固定下拉框容器宽度,当内容超出最小宽度不会伸长,而是出现横向滚动条 | `boolean` | false | +| 属性 | 说明 | 类型 | 默认值 | +|:---------------------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------| +| dropHeight | 下拉内容高度 | `number` | 300 | +| dropPlaceholder | 展示输入框 placeholder | `string` | 无 | +| dropDisabled | 是否禁用 | `boolean` | false | +| clearable | 允许清空 | `boolean` | false | +| placement | 下拉弹出框位置,注意!!不支持自动识别方向 | `'bottom-start' \| 'bottom-end' \| 'bottom' \| 'top-start' \| 'top-end' \| 'top'` | 'bottom-start' | +| transfer | 将下拉 DOM 转移到 body 中 | `boolean` | false | +| dropdownClassName | 在下拉框容器上额外添加的 class | `string \| string[]` | 无 | +| dropdownMinWidth `2.0.1` | 下拉框容器最小宽度,未指定则默认为展示输入框宽度。 适合 transfer 为 false 时使用 | `number` | 无 | +| dropdownWidthFixed `2.0.5` | 固定下拉框容器宽度,当内容超出最小宽度不会伸长,而是出现横向滚动条 | `boolean` | false | ### CTreeDrop Events From 3da5fe769079d1dc5a0a4b2af49a72a81455a659 Mon Sep 17 00:00:00 2001 From: ChuChencheng Date: 2019年12月11日 19:10:06 +0800 Subject: [PATCH 2/5] =?UTF-8?q?featfix:=20=E4=BF=AE=E5=A4=8D=20CTreeDrop?= =?UTF-8?q?=20=E4=B8=8B=E6=8B=89=E6=A1=86=E5=AE=9A=E4=BD=8D=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 16 ++++++++++++++++ examples/Drop.vue | 2 ++ package.json | 2 +- src/components/TreeDrop.vue | 16 ++++++++++------ 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bdbbde..d968820 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/ ## [Unreleased] +## [2.2.5] - 2019年12月11日 + +### Added + +### Changed + +### Deprecated + +### Removed + +### Fixed + +- 修复 `CTreeDrop` 下拉框定位不正确的问题 + +### Security + ## [2.2.4] - 2019年11月22日 ### Added diff --git a/examples/Drop.vue b/examples/Drop.vue index 474098c..32573b6 100644 --- a/examples/Drop.vue +++ b/examples/Drop.vue @@ -7,6 +7,7 @@ clearable :cascade="false" drop-placeholder="请选择" + :placement="placement" :dropdown-min-width="300" dropdown-width-fixed @checked-change="handleCheckedChange" @@ -48,6 +49,7 @@ export default { return { data, value: '2', + placement: 'bottom-start', } }, methods: { diff --git a/package.json b/package.json index 4e711ac..8ace92f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wsfe/ctree", - "version": "2.2.4", + "version": "2.2.5", "main": "./dist/ctree.umd.min.js", "types": "./types", "description": "A vue tree component using virtual list.", diff --git a/src/components/TreeDrop.vue b/src/components/TreeDrop.vue index 3acfac4..e34eef6 100644 --- a/src/components/TreeDrop.vue +++ b/src/components/TreeDrop.vue @@ -264,8 +264,8 @@ export default (Vue as VueConstructor Date: 2019年12月12日 10:37:49 +0800 Subject: [PATCH 3/5] =?UTF-8?q?featfix:=20=E4=BF=AE=E5=A4=8D=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86=20top=20bottom=20=E5=AE=9A=E4=BD=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 16 ++++++++++++++++ package.json | 2 +- src/components/TreeDrop.vue | 4 ++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d968820..61c30b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/ ## [Unreleased] +## [2.2.6] - 2019年12月12日 + +### Added + +### Changed + +### Deprecated + +### Removed + +### Fixed + +- 修复 `CTreeDrop` 下拉框定位 `top`, `bottom` 不正确的问题 + +### Security + ## [2.2.5] - 2019年12月11日 ### Added diff --git a/package.json b/package.json index 8ace92f..ce02dd4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wsfe/ctree", - "version": "2.2.5", + "version": "2.2.6", "main": "./dist/ctree.umd.min.js", "types": "./types", "description": "A vue tree component using virtual list.", diff --git a/src/components/TreeDrop.vue b/src/components/TreeDrop.vue index e34eef6..3a3724e 100644 --- a/src/components/TreeDrop.vue +++ b/src/components/TreeDrop.vue @@ -306,7 +306,7 @@ export default (Vue as VueConstructor Date: 2019年12月12日 10:43:26 +0800 Subject: [PATCH 4/5] featfix(types): Update type files --- types/src/components/Tree.vue.d.ts | 6 +++--- types/src/components/TreeDrop.vue.d.ts | 14 +++++++------- types/src/components/TreeSearch.vue.d.ts | 10 +++++----- types/src/store/tree-store.d.ts | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/types/src/components/Tree.vue.d.ts b/types/src/components/Tree.vue.d.ts index 73919ac..f26c810 100644 --- a/types/src/components/Tree.vue.d.ts +++ b/types/src/components/Tree.vue.d.ts @@ -58,8 +58,8 @@ declare const _default: import("vue/types/vue").ExtendedVue boolean; - ignoreMode: "none" | "parents" | "children"; + ignoreMode: "children" | "none" | "parents"; autoLoad: boolean; load: (node: TreeNode | null, resolve: Function, reject: Function) => any; render: (h: CreateElement, node: TreeNode) => VNode; diff --git a/types/src/components/TreeDrop.vue.d.ts b/types/src/components/TreeDrop.vue.d.ts index 8e7a79c..f6f97bb 100644 --- a/types/src/components/TreeDrop.vue.d.ts +++ b/types/src/components/TreeDrop.vue.d.ts @@ -37,8 +37,8 @@ declare const _default: import("vue/types/vue").ExtendedVue void; setExpandKeys: (keys: TreeNodeKeyType[], value: boolean) => void; setExpandAll: (value: boolean) => void; - getCheckedNodes: (ignoreMode?: "none" | "parents" | "children" | undefined) => TreeNode[]; - getCheckedKeys: (ignoreMode?: "none" | "parents" | "children" | undefined) => TreeNodeKeyType[]; + getCheckedNodes: (ignoreMode?: "children" | "none" | "parents" | undefined) => TreeNode[]; + getCheckedKeys: (ignoreMode?: "children" | "none" | "parents" | undefined) => TreeNodeKeyType[]; getIndeterminateNodes: () => TreeNode[]; getSelectedNode: () => TreeNode | null; getSelectedKey: () => string | number | null; @@ -111,8 +111,8 @@ declare const _default: import("vue/types/vue").ExtendedVue boolean; - ignoreMode: "none" | "parents" | "children"; + ignoreMode: "children" | "none" | "parents"; autoLoad: boolean; load: (node: TreeNode | null, resolve: Function, reject: Function) => any; render: (h: import("vue").CreateElement, node: TreeNode) => import("vue").VNode; @@ -242,8 +242,8 @@ declare const _default: import("vue/types/vue").ExtendedVue void; setExpandKeys: (keys: TreeNodeKeyType[], value: boolean) => void; setExpandAll: (value: boolean) => void; - getCheckedNodes: (ignoreMode?: "none" | "parents" | "children" | undefined) => TreeNode[]; - getCheckedKeys: (ignoreMode?: "none" | "parents" | "children" | undefined) => TreeNodeKeyType[]; + getCheckedNodes: (ignoreMode?: "children" | "none" | "parents" | undefined) => TreeNode[]; + getCheckedKeys: (ignoreMode?: "children" | "none" | "parents" | undefined) => TreeNodeKeyType[]; getIndeterminateNodes: () => TreeNode[]; getSelectedNode: () => TreeNode | null; getSelectedKey: () => string | number | null; diff --git a/types/src/components/TreeSearch.vue.d.ts b/types/src/components/TreeSearch.vue.d.ts index 6a88b65..4c60f43 100644 --- a/types/src/components/TreeSearch.vue.d.ts +++ b/types/src/components/TreeSearch.vue.d.ts @@ -30,8 +30,8 @@ declare const _default: import("vue/types/vue").ExtendedVue boolean; - ignoreMode: "none" | "parents" | "children"; + ignoreMode: "children" | "none" | "parents"; autoLoad: boolean; load: (node: TreeNode | null, resolve: Function, reject: Function) => any; render: (h: import("vue").CreateElement, node: TreeNode) => import("vue").VNode; @@ -178,8 +178,8 @@ declare const _default: import("vue/types/vue").ExtendedVue void; setExpandKeys: (keys: TreeNodeKeyType[], value: boolean) => void; setExpandAll: (value: boolean) => void; - getCheckedNodes: (ignoreMode?: "none" | "parents" | "children" | undefined) => TreeNode[]; - getCheckedKeys: (ignoreMode?: "none" | "parents" | "children" | undefined) => TreeNodeKeyType[]; + getCheckedNodes: (ignoreMode?: "children" | "none" | "parents" | undefined) => TreeNode[]; + getCheckedKeys: (ignoreMode?: "children" | "none" | "parents" | undefined) => TreeNodeKeyType[]; getIndeterminateNodes: () => TreeNode[]; getSelectedNode: () => TreeNode | null; getSelectedKey: () => string | number | null; diff --git a/types/src/store/tree-store.d.ts b/types/src/store/tree-store.d.ts index 92df8d3..0bfb621 100644 --- a/types/src/store/tree-store.d.ts +++ b/types/src/store/tree-store.d.ts @@ -122,12 +122,12 @@ export default class TreeStore { * 获取多选选中节点 * @param ignoreMode 忽略模式,可选择忽略父节点或子节点,默认值是 CTree 的 ignoreMode Prop */ - getCheckedNodes(ignoreMode?: "none" | "parents" | "children" | undefined): TreeNode[]; + getCheckedNodes(ignoreMode?: "children" | "none" | "parents" | undefined): TreeNode[]; /** * 获取多选选中的节点 key ,包括未加载的 key * @param ignoreMode 忽略模式,同 `getCheckedNodes` */ - getCheckedKeys(ignoreMode?: "none" | "parents" | "children" | undefined): TreeNodeKeyType[]; + getCheckedKeys(ignoreMode?: "children" | "none" | "parents" | undefined): TreeNodeKeyType[]; /** * 获取多选半选状态节点 */ From 8c1e1c6033d5e3ff66a905ae13b3c699fe4fc9b2 Mon Sep 17 00:00:00 2001 From: ChuChencheng Date: 2020年2月27日 11:14:30 +0800 Subject: [PATCH 5/5] doc: Add demo --- .env.docs | 4 +++ .gitignore | 1 + README.md | 2 ++ docs/css/main.4a7507e0.css | 1 + docs/index.html | 1 + docs/js/chunk-vendors.858205c1.js | 7 +++++ docs/js/main.647a3555.js | 1 + examples/App.vue | 8 +++--- examples/Drop.vue | 33 ++++++++++++------------ examples/Performance.vue | 4 +-- {public => examples}/index.html | 0 {docs => markdown}/design-tree-search.md | 0 {docs => markdown}/design-tree.md | 0 package.json | 1 + vue.config.js | 15 +++++++++++ 15 files changed, 55 insertions(+), 23 deletions(-) create mode 100644 .env.docs create mode 100644 docs/css/main.4a7507e0.css create mode 100644 docs/index.html create mode 100644 docs/js/chunk-vendors.858205c1.js create mode 100644 docs/js/main.647a3555.js rename {public => examples}/index.html (100%) rename {docs => markdown}/design-tree-search.md (100%) rename {docs => markdown}/design-tree.md (100%) diff --git a/.env.docs b/.env.docs new file mode 100644 index 0000000..d237367 --- /dev/null +++ b/.env.docs @@ -0,0 +1,4 @@ +NODE_ENV=production +VUE_APP_IS_BUILDING_DOCS=true +VUE_APP_PUBLIC_PATH=/ctree +VUE_APP_OUTPUT_DIR=docs diff --git a/.gitignore b/.gitignore index 185e663..2e37eda 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +debug.log .DS_Store node_modules /dist diff --git a/README.md b/README.md index c1f81b4..186bc80 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # CTree 2.x +[在线 demo](https://wsfe.github.io/ctree/) + ## 安装 ### yarn 安装方式 diff --git a/docs/css/main.4a7507e0.css b/docs/css/main.4a7507e0.css new file mode 100644 index 0000000..54c62e8 --- /dev/null +++ b/docs/css/main.4a7507e0.css @@ -0,0 +1 @@ +@-webkit-keyframes ctree-animation-spin{0%{-webkit-transform:rotate(0deg) translateZ(0);transform:rotate(0deg) translateZ(0)}to{-webkit-transform:rotate(1turn) translateZ(0);transform:rotate(1turn) translateZ(0)}}@keyframes ctree-animation-spin{0%{-webkit-transform:rotate(0deg) translateZ(0);transform:rotate(0deg) translateZ(0)}to{-webkit-transform:rotate(1turn) translateZ(0);transform:rotate(1turn) translateZ(0)}}@-webkit-keyframes ctree-animation-svg-circle-spin{0%{stroke-dasharray:1 130;stroke-dashoffset:0}50%{stroke-dasharray:90 130;stroke-dashoffset:-30}to{stroke-dasharray:90 130;stroke-dashoffset:-124}}@keyframes ctree-animation-svg-circle-spin{0%{stroke-dasharray:1 130;stroke-dashoffset:0}50%{stroke-dasharray:90 130;stroke-dashoffset:-30}to{stroke-dasharray:90 130;stroke-dashoffset:-124}}.ctree-tree__scroll-area,.ctree-tree__wrapper{width:100%;height:100%;position:relative}.ctree-tree__scroll-area{overflow:auto;display:-webkit-box;display:-ms-flexbox;display:flex}.ctree-tree__block-area{-webkit-box-flex:1;-ms-flex:1;flex:1}.ctree-tree__empty{width:100%;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:absolute;top:0;left:0}.ctree-tree__empty-text_default{width:100%;text-align:center}.ctree-tree__loading{width:100%;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:absolute;top:0;left:0;background-color:hsla(0,0%,100%,.95)}.ctree-tree__loading-wrapper{width:100%;text-align:center}.ctree-tree__loading-icon{display:inline-block;width:30px;height:30px;-webkit-animation:ctree-animation-spin 2s linear infinite;animation:ctree-animation-spin 2s linear infinite}.ctree-tree__loading-icon .ctree-loading-icon__circle{stroke:#2d8cf0;stroke-linecap:round;-webkit-animation:ctree-animation-svg-circle-spin 1.5s ease-in-out infinite;animation:ctree-animation-svg-circle-spin 1.5s ease-in-out infinite}.ctree-tree__iframe{width:100%;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:absolute;top:0;left:0;display:block;border:none;padding:0;margin:0;opacity:0;z-index:-1000;pointer-events:none}.ctree-tree-node__wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.ctree-tree-node__drop{width:100%;height:2px}.ctree-tree-node__drop_active{background-color:#5cadff}.ctree-tree-node__node-body{-webkit-box-flex:1;-ms-flex:1;flex:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ctree-tree-node__square{width:20px;height:20px;-ms-flex-negative:0;flex-shrink:0}.ctree-tree-node__expand,.ctree-tree-node__square{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.ctree-tree-node__expand{cursor:pointer;width:16px;height:16px;-webkit-transition:-webkit-transform .2s linear;transition:-webkit-transform .2s linear;transition:transform .2s linear;transition:transform .2s linear,-webkit-transform .2s linear}.ctree-tree-node__expand:after{content:"";display:block;width:0;height:0;position:absolute;border:5px solid transparent;border-left:5px solid #515a6e}.ctree-tree-node__expand_active{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.ctree-tree-node__loading-icon{display:inline-block;width:14px;height:14px;-webkit-animation:ctree-animation-spin 2s linear infinite;animation:ctree-animation-spin 2s linear infinite}.ctree-tree-node__loading-icon .ctree-loading-icon__circle{stroke:#515a6e;stroke-linecap:round;-webkit-animation:ctree-animation-svg-circle-spin 1.5s ease-in-out infinite;animation:ctree-animation-svg-circle-spin 1.5s ease-in-out infinite}.ctree-tree-node__checkbox{cursor:pointer;width:14px;height:14px;border:1px solid;border-color:#dcdee2;border-radius:2px;background-color:#fff;-webkit-transition:border-color .2s ease-in-out,background-color .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border-color .2s ease-in-out,background-color .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border-color .2s ease-in-out,background-color .2s ease-in-out,box-shadow .2s ease-in-out;transition:border-color .2s ease-in-out,background-color .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ctree-tree-node__checkbox,.ctree-tree-node__checkbox:after{-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute}.ctree-tree-node__checkbox:after{content:"";display:table;border:2px solid #fff;border-top:0;border-left:0;width:4px;height:8px;top:1px;left:4px;-webkit-transform:rotate(45deg) scale(0);transform:rotate(45deg) scale(0);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.ctree-tree-node__checkbox:hover{border-color:#c5c8ce}.ctree-tree-node__checkbox:focus{-webkit-box-shadow:0 0 0 2px #5cadff;box-shadow:0 0 0 2px #5cadff}.ctree-tree-node__checkbox_checked{border-color:#2d8cf0;background-color:#2d8cf0}.ctree-tree-node__checkbox_checked:after{width:4px;height:8px;top:1px;left:4px;-webkit-transform:rotate(45deg) scale(1);transform:rotate(45deg) scale(1)}.ctree-tree-node__checkbox_checked:hover,.ctree-tree-node__checkbox_indeterminate{border-color:#2d8cf0;background-color:#2d8cf0}.ctree-tree-node__checkbox_indeterminate:after{width:8px;height:1px;top:5px;left:2px;-webkit-transform:scale(1);transform:scale(1)}.ctree-tree-node__checkbox_indeterminate:hover{border-color:#2d8cf0;background-color:#2d8cf0}.ctree-tree-node__checkbox_disabled{cursor:not-allowed}.ctree-tree-node__checkbox_disabled,.ctree-tree-node__checkbox_disabled:hover{border-color:#dcdee2;background-color:#e8eaec}.ctree-tree-node__checkbox_disabled:after{border-color:#c5c8ce}.ctree-tree-node__title{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-flex:1;-ms-flex:1;flex:1;height:26px;line-height:26px;margin-left:5px;padding-left:5px;background-color:transparent;word-break:keep-all;white-space:nowrap;word-wrap:none}.ctree-tree-node__title:hover{background-color:#ebf5ff}.ctree-tree-node__title_selected,.ctree-tree-node__title_selected:hover{background-color:#d4e7fc}.ctree-tree-node__title_disabled{cursor:not-allowed;color:#c5c8ce}.ctree-tree-search__wrapper{width:100%;height:100%;position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.ctree-tree-search__search{height:42px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box}.ctree-tree-search__check-all-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-pack:initial;-ms-flex-pack:initial;justify-content:normal;width:40px}.ctree-tree-search__check-all{margin-left:23px}.ctree-tree-search__input-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding-left:5px;-webkit-box-flex:1;-ms-flex:1;flex:1}.ctree-tree-search__input{color:#515a6e;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:32px;border:1px solid #dcdee2;border-radius:4px;padding:4px 7px;outline:none;-webkit-transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,-webkit-box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out;transition:border .2s ease-in-out,box-shadow .2s ease-in-out,-webkit-box-shadow .2s ease-in-out}.ctree-tree-search__input::-webkit-input-placeholder{color:#c5c8ce}.ctree-tree-search__input::-moz-placeholder{color:#c5c8ce}.ctree-tree-search__input:-ms-input-placeholder{color:#c5c8ce}.ctree-tree-search__input::-ms-input-placeholder{color:#c5c8ce}.ctree-tree-search__input::placeholder{color:#c5c8ce}.ctree-tree-search__input:hover{border-color:#57a3f3}.ctree-tree-search__input:focus{border-color:#57a3f3;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ctree-tree-search__input_disabled{cursor:not-allowed;color:#ccc;background-color:#f3f3f3}.ctree-tree-search__input_disabled:hover{border-color:#dcdee2}.ctree-tree-search__action-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:0 10px}.ctree-tree-search__checked-button{cursor:pointer}.ctree-tree-search__checked-button:hover{color:#5cadff}.ctree-tree-search__checked-button_active{color:#2d8cf0}.ctree-tree-search__tree-wrapper{width:100%;-webkit-box-flex:1;-ms-flex:1;flex:1;overflow-y:auto}.ctree-tree-search__footer{padding:5px}.ctree-tree-drop__wrapper{position:relative}.ctree-tree-drop__reference{cursor:pointer}.ctree-tree-drop__display-input{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding-right:20px}.ctree-tree-drop__display-input-text{display:block;height:100%;line-height:22px}.ctree-tree-drop__display-input-placeholder{color:#c5c8ce}.ctree-tree-drop__display-input_focus{border-color:#57a3f3;-webkit-box-shadow:0 0 0 2px rgba(45,140,240,.2);box-shadow:0 0 0 2px rgba(45,140,240,.2)}.ctree-tree-drop__display-icon-drop{position:absolute;top:8px;right:3px;width:14px;height:14px;-webkit-box-sizing:border-box;box-sizing:border-box;border:3px solid #808695;border-top:none;border-left:none;-webkit-transform:rotate(45deg) scale(.5) translateX(-3.5px) translateY(-3.5px);transform:rotate(45deg) scale(.5) translateX(-3.5px) translateY(-3.5px);-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out}.ctree-tree-drop__display-icon-drop_active{-webkit-transform:rotate(225deg) scale(.5) translateX(-3.5px) translateY(-3.5px);transform:rotate(225deg) scale(.5) translateX(-3.5px) translateY(-3.5px)}.ctree-tree-drop__display-icon-clear{position:absolute;top:8px;right:3px;width:14px;height:14px;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:50%;background-color:#808695;overflow:hidden;-webkit-transform:scale(.9) rotate(45deg);transform:scale(.9) rotate(45deg);display:none}.ctree-tree-drop__display-icon-clear:after,.ctree-tree-drop__display-icon-clear:before{content:"";width:1px;height:7px;display:block;background-color:#fff;position:absolute;top:3.5px;left:6.5px}.ctree-tree-drop__display-icon-clear:after{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.ctree-tree-drop__display-input:hover .ctree-tree-drop__display-icon-clear{display:block}.ctree-tree-drop__dropdown{position:absolute;top:-999px;left:-999px;-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);border-radius:4px;margin:5px 0;padding:5px 0;-webkit-transform-origin:center top 0;transform-origin:center top 0;background-color:#fff;z-index:9999}.ctree-tree-drop__dropdown .ctree-tree-search__search{border-bottom:1px solid #dcdee2;padding-bottom:5px;height:38px}.ctree-tree-drop__dropdown .ctree-tree-search__tree-wrapper{padding-top:5px}.ctree-dropdown-enter,.ctree-dropdown-leave-to{opacity:0;-webkit-transform:scaleY(.8);transform:scaleY(.8)}.ctree-dropdown-enter-active,.ctree-dropdown-leave-active{-webkit-transition:opacity .3s,-webkit-transform .3s;transition:opacity .3s,-webkit-transform .3s;transition:opacity .3s,transform .3s;transition:opacity .3s,transform .3s,-webkit-transform .3s}.container[data-v-01d42e0f]{width:100%;height:100%;padding:10px;-webkit-box-sizing:border-box;box-sizing:border-box}.container .panel[data-v-01d42e0f]{width:100%;margin-bottom:10px;border:1px solid #d3d3d3;border-radius:5px}.container .panel .header[data-v-01d42e0f]{height:30px;border-bottom:1px solid #d3d3d3;padding:10px 30px}.container .panel .body[data-v-01d42e0f]{display:-webkit-box;display:-ms-flexbox;display:flex}.container .panel .body .interface[data-v-01d42e0f]{border-right:1px solid #d3d3d3}.container .panel .body .desc[data-v-01d42e0f],.container .panel .body .interface[data-v-01d42e0f]{-webkit-box-flex:1;-ms-flex:1;flex:1;padding:10px 30px}.container .panel .body .desc .desc-block[data-v-01d42e0f]{padding:5px 0;margin-bottom:10px;border-bottom:1px solid #d3d3d3}.container .panel .body .desc .desc-block[data-v-01d42e0f]:last-child{border-bottom:none}.container[data-v-f597b4c8]{width:100%;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.container .tree[data-v-f597b4c8]{-webkit-box-flex:2;-ms-flex:2;flex:2}.container .control[data-v-f597b4c8]{-webkit-box-flex:1;-ms-flex:1;flex:1;padding:30px 0;border-left:1px solid grey}.container .control .desc-block[data-v-f597b4c8]{padding:10px 30px;margin-bottom:20px}.container .control .controls[data-v-f597b4c8]{padding:10px}.container .control .controls label[data-v-f597b4c8]{display:inline-block;width:120px;text-align:right}.container .control .controls .actions[data-v-f597b4c8]{margin-left:120px;margin-bottom:10px}.container .control .controls .actions button[data-v-f597b4c8]{cursor:pointer;margin-right:10px}.app[data-v-6c2a65d2]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;width:100%;height:100%}.app .tab[data-v-6c2a65d2]{height:90px;padding:10px 50px;border-bottom:1px solid #d3d3d3}.app .tab button[data-v-6c2a65d2]{cursor:pointer;width:100px;height:38px;margin-right:30px;margin-bottom:10px;border-radius:5px;background:#e0ffff}.app .tab button[data-v-6c2a65d2]:focus{outline:none}.app .tab .active[data-v-6c2a65d2]{background:#add8e6}.app .tab-panel[data-v-6c2a65d2]{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow-y:auto}body,html{width:100%;height:100%;margin:0;padding:0} \ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..301f968 --- /dev/null +++ b/docs/index.html @@ -0,0 +1 @@ +
We're sorry but ctree doesn't work properly without JavaScript enabled. Please enable it to continue.

AltStyle によって変換されたページ (->オリジナル) /

\ No newline at end of file diff --git a/docs/js/chunk-vendors.858205c1.js b/docs/js/chunk-vendors.858205c1.js new file mode 100644 index 0000000..bad1a51 --- /dev/null +++ b/docs/js/chunk-vendors.858205c1.js @@ -0,0 +1,7 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-vendors"],{2877:function(t,e,n){"use strict";function r(t,e,n,r,i,o,a,s){var c,u="function"===typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),a?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},u._ssrRegister=c):i&&(c=s?function(){i.call(this,this.$root.$options.shadowRoot)}:i),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,e){return c.call(e),l(t,e)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,c):[c]}return{exports:t,options:u}}n.d(e,"a",(function(){return r}))},"2b0e":function(t,e,n){"use strict";(function(t){ +/*! + * Vue.js v2.6.10 + * (c) 2014-2019 Evan You + * Released under the MIT License. + */ +var n=Object.freeze({});function r(t){return void 0===t||null===t}function i(t){return void 0!==t&&null!==t}function o(t){return!0===t}function a(t){return!1===t}function s(t){return"string"===typeof t||"number"===typeof t||"symbol"===typeof t||"boolean"===typeof t}function c(t){return null!==t&&"object"===typeof t}var u=Object.prototype.toString;function l(t){return"[object Object]"===u.call(t)}function f(t){return"[object RegExp]"===u.call(t)}function d(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function p(t){return i(t)&&"function"===typeof t.then&&"function"===typeof t.catch}function v(t){return null==t?"":Array.isArray(t)||l(t)&&t.toString===u?JSON.stringify(t,null,2):String(t)}function h(t){var e=parseFloat(t);return isNaN(e)?t:e}function m(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i-1)return t.splice(n,1)}}var _=Object.prototype.hasOwnProperty;function b(t,e){return _.call(t,e)}function w(t){var e=Object.create(null);return function(n){var r=e[n];return r||(e[n]=t(n))}}var C=/-(\w)/g,$=w((function(t){return t.replace(C,(function(t,e){return e?e.toUpperCase():""}))})),A=w((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),x=/\B([A-Z])/g,O=w((function(t){return t.replace(x,"-1ドル").toLowerCase()}));function k(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function S(t,e){return t.bind(e)}var E=Function.prototype.bind?S:k;function j(t,e){e=e||0;var n=t.length-e,r=new Array(n);while(n--)r[n]=t[n+e];return r}function T(t,e){for(var n in e)t[n]=e[n];return t}function I(t){for(var e={},n=0;n0,nt=Y&&Y.indexOf("edge/")>0,rt=(Y&&Y.indexOf("android"),Y&&/iphone|ipad|ipod|ios/.test(Y)||"ios"===Q),it=(Y&&/chrome\/\d+/.test(Y),Y&&/phantomjs/.test(Y),Y&&Y.match(/firefox\/(\d+)/)),ot={}.watch,at=!1;if(J)try{var st={};Object.defineProperty(st,"passive",{get:function(){at=!0}}),window.addEventListener("test-passive",null,st)}catch($a){}var ct=function(){return void 0===X&&(X=!J&&!Z&&"undefined"!==typeof t&&(t["process"]&&"server"===t["process"].env.VUE_ENV)),X},ut=J&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function lt(t){return"function"===typeof t&&/native code/.test(t.toString())}var ft,dt="undefined"!==typeof Symbol&<(Symbol)&&"undefined"!==typeof Reflect&<(Reflect.ownKeys);ft="undefined"!==typeof Set&<(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var pt=D,vt=0,ht=function(){this.id=vt++,this.subs=[]};ht.prototype.addSub=function(t){this.subs.push(t)},ht.prototype.removeSub=function(t){g(this.subs,t)},ht.prototype.depend=function(){ht.target&&ht.target.addDep(this)},ht.prototype.notify=function(){var t=this.subs.slice();for(var e=0,n=t.length;e-1)if(o&&!b(i,"default"))a=!1;else if(""===a||a===O(t)){var c=te(String,i.type);(c<0||s0&&(a=ke(a,(e||"")+"_"+n),Oe(a[0])&&Oe(u)&&(l[c]=Ct(u.text+a[0].text),a.shift()),l.push.apply(l,a)):s(a)?Oe(u)?l[c]=Ct(u.text+a):""!==a&&l.push(Ct(a)):Oe(a)&&Oe(u)?l[c]=Ct(u.text+a.text):(o(t._isVList)&&i(a.tag)&&r(a.key)&&i(e)&&(a.key="__vlist"+e+"_"+n+"__"),l.push(a)));return l}function Se(t){var e=t.$options.provide;e&&(t._provided="function"===typeof e?e.call(t):e)}function Ee(t){var e=je(t.$options.inject,t);e&&(Et(!1),Object.keys(e).forEach((function(n){Nt(t,n,e[n])})),Et(!0))}function je(t,e){if(t){for(var n=Object.create(null),r=dt?Reflect.ownKeys(t):Object.keys(t),i=0;i0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==n&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var c in i={},t)t[c]&&"$"!==c[0]&&(i[c]=Ne(e,c,t[c]))}else i={};for(var u in e)u in i||(i[u]=Pe(e,u));return t&&Object.isExtensible(t)&&(t._normalized=i),W(i,"$stable",a),W(i,"$key",s),W(i,"$hasNormal",o),i}function Ne(t,e,n){var r=function(){var t=arguments.length?n.apply(null,arguments):n({});return t=t&&"object"===typeof t&&!Array.isArray(t)?[t]:xe(t),t&&(0===t.length||1===t.length&&t[0].isComment)?void 0:t};return n.proxy&&Object.defineProperty(t,e,{get:r,enumerable:!0,configurable:!0}),r}function Pe(t,e){return function(){return t[e]}}function Le(t,e){var n,r,o,a,s;if(Array.isArray(t)||"string"===typeof t)for(n=new Array(t.length),r=0,o=t.length;r1?j(n):n;for(var r=j(arguments,1),i='event handler for "'+t+'"',o=0,a=n.length;odocument.createEvent("Event").timeStamp&&(Xn=function(){return Gn.now()})}function Jn(){var t,e;for(Kn=Xn(),zn=!0,Un.sort((function(t,e){return t.id-e.id})),Wn=0;WnWn&&Un[n].id>t.id)n--;Un.splice(n+1,0,t)}else Un.push(t);Bn||(Bn=!0,ve(Jn))}}var er=0,nr=function(t,e,n,r,i){this.vm=t,i&&(t._watcher=this),t._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++er,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ft,this.newDepIds=new ft,this.expression="","function"===typeof e?this.getter=e:(this.getter=K(e),this.getter||(this.getter=D)),this.value=this.lazy?void 0:this.get()};nr.prototype.get=function(){var t;yt(this);var e=this.vm;try{t=this.getter.call(e,e)}catch($a){if(!this.user)throw $a;ee($a,e,'getter for watcher "'+this.expression+'"')}finally{this.deep&&me(t),gt(),this.cleanupDeps()}return t},nr.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},nr.prototype.cleanupDeps=function(){var t=this.deps.length;while(t--){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},nr.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():tr(this)},nr.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||c(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch($a){ee($a,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},nr.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},nr.prototype.depend=function(){var t=this.deps.length;while(t--)this.deps[t].depend()},nr.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||g(this.vm._watchers,this);var t=this.deps.length;while(t--)this.deps[t].removeSub(this);this.active=!1}};var rr={enumerable:!0,configurable:!0,get:D,set:D};function ir(t,e,n){rr.get=function(){return this[e][n]},rr.set=function(t){this[e][n]=t},Object.defineProperty(t,n,rr)}function or(t){t._watchers=[];var e=t.$options;e.props&&ar(t,e.props),e.methods&&vr(t,e.methods),e.data?sr(t):Dt(t._data={},!0),e.computed&&lr(t,e.computed),e.watch&&e.watch!==ot&&hr(t,e.watch)}function ar(t,e){var n=t.$options.propsData||{},r=t._props={},i=t.$options._propKeys=[],o=!t.$parent;o||Et(!1);var a=function(o){i.push(o);var a=Jt(o,e,n,t);Nt(r,o,a),o in t||ir(t,"_props",o)};for(var s in e)a(s);Et(!0)}function sr(t){var e=t.$options.data;e=t._data="function"===typeof e?cr(e,t):e||{},l(e)||(e={});var n=Object.keys(e),r=t.$options.props,i=(t.$options.methods,n.length);while(i--){var o=n[i];0,r&&b(r,o)||z(o)||ir(t,"_data",o)}Dt(e,!0)}function cr(t,e){yt();try{return t.call(e,e)}catch($a){return ee($a,e,"data()"),{}}finally{gt()}}var ur={lazy:!0};function lr(t,e){var n=t._computedWatchers=Object.create(null),r=ct();for(var i in e){var o=e[i],a="function"===typeof o?o:o.get;0,r||(n[i]=new nr(t,a||D,D,ur)),i in t||fr(t,i,o)}}function fr(t,e,n){var r=!ct();"function"===typeof n?(rr.get=r?dr(e):pr(n),rr.set=D):(rr.get=n.get?r&&!1!==n.cache?dr(e):pr(n.get):D,rr.set=n.set||D),Object.defineProperty(t,e,rr)}function dr(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),ht.target&&e.depend(),e.value}}function pr(t){return function(){return t.call(this,this)}}function vr(t,e){t.$options.props;for(var n in e)t[n]="function"!==typeof e[n]?D:E(e[n],t)}function hr(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var i=0;i-1)return this;var n=j(arguments,1);return n.unshift(this),"function"===typeof t.install?t.install.apply(t,n):"function"===typeof t&&t.apply(null,n),e.push(t),this}}function xr(t){t.mixin=function(t){return this.options=Xt(this.options,t),this}}function Or(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,i=t._Ctor||(t._Ctor={});if(i[r])return i[r];var o=t.name||n.options.name;var a=function(t){this._init(t)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=e++,a.options=Xt(n.options,t),a["super"]=n,a.options.props&&kr(a),a.options.computed&&Sr(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,U.forEach((function(t){a[t]=n[t]})),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=T({},a.options),i[r]=a,a}}function kr(t){var e=t.options.props;for(var n in e)ir(t.prototype,"_props",n)}function Sr(t){var e=t.options.computed;for(var n in e)fr(t.prototype,n,e[n])}function Er(t){U.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&l(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"===typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}function jr(t){return t&&(t.Ctor.options.name||t.tag)}function Tr(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"===typeof t?t.split(",").indexOf(e)>-1:!!f(t)&&t.test(e)}function Ir(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var a=n[o];if(a){var s=jr(a.componentOptions);s&&!e(s)&&Dr(n,o,r,i)}}}function Dr(t,e,n,r){var i=t[e];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),t[e]=null,g(n,e)}_r($r),yr($r),En($r),Dn($r),gn($r);var Nr=[String,RegExp,Array],Pr={name:"keep-alive",abstract:!0,props:{include:Nr,exclude:Nr,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Dr(this.cache,t,this.keys)},mounted:function(){var t=this;this.$watch("include",(function(e){Ir(t,(function(t){return Tr(e,t)}))})),this.$watch("exclude",(function(e){Ir(t,(function(t){return!Tr(e,t)}))}))},render:function(){var t=this.$slots.default,e=$n(t),n=e&&e.componentOptions;if(n){var r=jr(n),i=this,o=i.include,a=i.exclude;if(o&&(!r||!Tr(o,r))||a&&r&&Tr(a,r))return e;var s=this,c=s.cache,u=s.keys,l=null==e.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):e.key;c[l]?(e.componentInstance=c[l].componentInstance,g(u,l),u.push(l)):(c[l]=e,u.push(l),this.max&&u.length>parseInt(this.max)&&Dr(c,u[0],u,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}},Lr={KeepAlive:Pr};function Mr(t){var e={get:function(){return H}};Object.defineProperty(t,"config",e),t.util={warn:pt,extend:T,mergeOptions:Xt,defineReactive:Nt},t.set=Pt,t.delete=Lt,t.nextTick=ve,t.observable=function(t){return Dt(t),t},t.options=Object.create(null),U.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,T(t.options.components,Lr),Ar(t),xr(t),Or(t),Er(t)}Mr($r),Object.defineProperty($r.prototype,"$isServer",{get:ct}),Object.defineProperty($r.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty($r,"FunctionalRenderContext",{value:Ze}),$r.version="2.6.10";var Fr=m("style,class"),Rr=m("input,textarea,option,select,progress"),Ur=function(t,e,n){return"value"===n&&Rr(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},Vr=m("contenteditable,draggable,spellcheck"),Hr=m("events,caret,typing,plaintext-only"),Br=function(t,e){return Xr(e)||"false"===e?"false":"contenteditable"===t&&Hr(e)?e:"true"},zr=m("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Wr="http://www.w3.org/1999/xlink",qr=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Kr=function(t){return qr(t)?t.slice(6,t.length):""},Xr=function(t){return null==t||!1===t};function Gr(t){var e=t.data,n=t,r=t;while(i(r.componentInstance))r=r.componentInstance._vnode,r&&r.data&&(e=Jr(r.data,e));while(i(n=n.parent))n&&n.data&&(e=Jr(e,n.data));return Zr(e.staticClass,e.class)}function Jr(t,e){return{staticClass:Qr(t.staticClass,e.staticClass),class:i(t.class)?[t.class,e.class]:e.class}}function Zr(t,e){return i(t)||i(e)?Qr(t,Yr(e)):""}function Qr(t,e){return t?e?t+" "+e:t:e||""}function Yr(t){return Array.isArray(t)?ti(t):c(t)?ei(t):"string"===typeof t?t:""}function ti(t){for(var e,n="",r=0,o=t.length;r-1?si[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:si[t]=/HTMLUnknownElement/.test(e.toString())}var ui=m("text,number,password,search,email,tel,url");function li(t){if("string"===typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function fi(t,e){var n=document.createElement(t);return"select"!==t?n:(e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function di(t,e){return document.createElementNS(ni[t],e)}function pi(t){return document.createTextNode(t)}function vi(t){return document.createComment(t)}function hi(t,e,n){t.insertBefore(e,n)}function mi(t,e){t.removeChild(e)}function yi(t,e){t.appendChild(e)}function gi(t){return t.parentNode}function _i(t){return t.nextSibling}function bi(t){return t.tagName}function wi(t,e){t.textContent=e}function Ci(t,e){t.setAttribute(e,"")}var $i=Object.freeze({createElement:fi,createElementNS:di,createTextNode:pi,createComment:vi,insertBefore:hi,removeChild:mi,appendChild:yi,parentNode:gi,nextSibling:_i,tagName:bi,setTextContent:wi,setStyleScope:Ci}),Ai={create:function(t,e){xi(e)},update:function(t,e){t.data.ref!==e.data.ref&&(xi(t,!0),xi(e))},destroy:function(t){xi(t,!0)}};function xi(t,e){var n=t.data.ref;if(i(n)){var r=t.context,o=t.componentInstance||t.elm,a=r.$refs;e?Array.isArray(a[n])?g(a[n],o):a[n]===o&&(a[n]=void 0):t.data.refInFor?Array.isArray(a[n])?a[n].indexOf(o)<0&&a[n].push(o):a[n]=[o]:a[n]=o}}var Oi=new _t("",{},[]),ki=["create","activate","update","remove","destroy"];function Si(t,e){return t.key===e.key&&(t.tag===e.tag&&t.isComment===e.isComment&&i(t.data)===i(e.data)&&Ei(t,e)||o(t.isAsyncPlaceholder)&&t.asyncFactory===e.asyncFactory&&r(e.asyncFactory.error))}function Ei(t,e){if("input"!==t.tag)return!0;var n,r=i(n=t.data)&&i(n=n.attrs)&&n.type,o=i(n=e.data)&&i(n=n.attrs)&&n.type;return r===o||ui(r)&&ui(o)}function ji(t,e,n){var r,o,a={};for(r=e;r<=n;++r)o=t[r].key,i(o)&&(a[o]=r);return a}function Ti(t){var e,n,a={},c=t.modules,u=t.nodeOps;for(e=0;eh?(f=r(n[g+1])?null:n[g+1].elm,$(t,f,n,v,g,o)):v>g&&x(t,e,d,h)}function S(t,e,n,r){for(var o=n;o-1?Hi(t,e,n):zr(e)?Xr(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Vr(e)?t.setAttribute(e,Br(e,n)):qr(e)?Xr(n)?t.removeAttributeNS(Wr,Kr(e)):t.setAttributeNS(Wr,e,n):Hi(t,e,n)}function Hi(t,e,n){if(Xr(n))t.removeAttribute(e);else{if(tt&&!et&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var Bi={create:Ui,update:Ui};function zi(t,e){var n=e.elm,o=e.data,a=t.data;if(!(r(o.staticClass)&&r(o.class)&&(r(a)||r(a.staticClass)&&r(a.class)))){var s=Gr(e),c=n._transitionClasses;i(c)&&(s=Qr(s,Yr(c))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var Wi,qi={create:zi,update:zi},Ki="__r",Xi="__c";function Gi(t){if(i(t[Ki])){var e=tt?"change":"input";t[e]=[].concat(t[Ki],t[e]||[]),delete t[Ki]}i(t[Xi])&&(t.change=[].concat(t[Xi],t.change||[]),delete t[Xi])}function Ji(t,e,n){var r=Wi;return function i(){var o=e.apply(null,arguments);null!==o&&Yi(t,i,n,r)}}var Zi=ae&&!(it&&Number(it[1])<=53);function Qi(t,e,n,r){if(Zi){var i=Kn,o=e;e=o._wrapper=function(t){if(t.>=i||t.timeStamp<=0||t.target.ownerdocument!==document)return o.apply(this,arguments)}}Wi.addEventListener(t,e,at?{capture:n,passive:r}:n)}function Yi(t,e,n,r){(r||Wi).removeEventListener(t,e._wrapper||e,n)}function to(t,e){if(!r(t.data.on)||!r(e.data.on)){var n=e.data.on||{},i=t.data.on||{};Wi=e.elm,Gi(n),be(n,i,Qi,Yi,Ji,e.context),Wi=void 0}}var eo,no={create:to,update:to};function ro(t,e){if(!r(t.data.domProps)||!r(e.data.domProps)){var n,o,a=e.elm,s=t.data.domProps||{},c=e.data.domProps||{};for(n in i(c.__ob__)&&(c=e.data.domProps=T({},c)),s)n in c||(a[n]="");for(n in c){if(o=c[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),o===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n&&"PROGRESS"!==a.tagName){a._value=o;var u=r(o)?"":String(o);io(a,u)&&(a.value=u)}else if("innerHTML"===n&&ii(a.tagName)&&r(a.innerHTML)){eo=eo||document.createElement("div"),eo.innerHTML=""+o+"";var l=eo.firstChild;while(a.firstChild)a.removeChild(a.firstChild);while(l.firstChild)a.appendChild(l.firstChild)}else if(o!==s[n])try{a[n]=o}catch($a){}}}}function io(t,e){return!t.composing&&("OPTION"===t.tagName||oo(t,e)||ao(t,e))}function oo(t,e){var n=!0;try{n=document.activeElement!==t}catch($a){}return n&&t.value!==e}function ao(t,e){var n=t.value,r=t._vModifiers;if(i(r)){if(r.number)return h(n)!==h(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}var so={create:ro,update:ro},co=w((function(t){var e={},n=/;(?![^(]*\))/g,r=/:(.+)/;return t.split(n).forEach((function(t){if(t){var n=t.split(r);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}));function uo(t){var e=lo(t.style);return t.staticStyle?T(t.staticStyle,e):e}function lo(t){return Array.isArray(t)?I(t):"string"===typeof t?co(t):t}function fo(t,e){var n,r={};if(e){var i=t;while(i.componentInstance)i=i.componentInstance._vnode,i&&i.data&&(n=uo(i.data))&&T(r,n)}(n=uo(t.data))&&T(r,n);var o=t;while(o=o.parent)o.data&&(n=uo(o.data))&&T(r,n);return r}var po,vo=/^--/,ho=/\s*!important$/,mo=function(t,e,n){if(vo.test(e))t.style.setProperty(e,n);else if(ho.test(n))t.style.setProperty(O(e),n.replace(ho,""),"important");else{var r=go(e);if(Array.isArray(n))for(var i=0,o=n.length;i-1?e.split(wo).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setattribute("class",(n+e).trim())}}function $o(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(wo).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";while(n.indexOf(r)>=0)n=n.replace(r," ");n=n.trim(),n?t.setAttribute("class",n):t.removeAttribute("class")}}function Ao(t){if(t){if("object"===typeof t){var e={};return!1!==t.css&&T(e,xo(t.name||"v")),T(e,t),e}return"string"===typeof t?xo(t):void 0}}var xo=w((function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}})),Oo=J&&!et,ko="transition",So="animation",Eo="transition",jo="transitionend",To="animation",Io="animationend";Oo&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Eo="WebkitTransition",jo="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(To="WebkitAnimation",Io="webkitAnimationEnd"));var Do=J?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function No(t){Do((function(){Do(t)}))}function Po(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),co(t,e))}function Lo(t,e){t._transitionClasses&&g(t._transitionClasses,e),$o(t,e)}function Mo(t,e,n){var r=Ro(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===ko?jo:Io,c=0,u=function(){t.removeEventListener(s,l),n()},l=function(e){e.>=a&&u()};setTimeout((function(){c0&&(n=ko,l=a,f=o.length):e===So?u>0&&(n=So,l=u,f=c.length):(l=Math.max(a,u),n=l>0?a>u?ko:So:null,f=n?n===ko?o.length:c.length:0);var d=n===ko&&Fo.test(r[Eo+"Property"]);return{type:n,timeout:l,propCount:f,hasTransform:d}}function Uo(t,e){while(t.length1}function qo(t,e){!0!==e.data.show&&Ho(e)}var Ko=J?{create:qo,activate:qo,remove:function(t,e){!0!==t.data.show?Bo(t,e):e()}}:{},Xo=[Bi,qi,no,so,bo,Ko],Go=Xo.concat(Ri),Jo=Ti({nodeOps:$i,modules:Go});et&&document.addEventListener("selectionchange",(function(){var t=document.activeElement;t&&t.vmodel&&ia(t,"input")}));var Zo={inserted:function(t,e,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?we(n,"postpatch",(function(){Zo.componentUpdated(t,e,n)})):Qo(t,e,n.context),t._vOptions=[].map.call(t.options,ea)):("textarea"===n.tag||ui(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",na),t.addEventListener("compositionend",ra),t.addEventListener("change",ra),et&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Qo(t,e,n.context);var r=t._vOptions,i=t._vOptions=[].map.call(t.options,ea);if(i.some((function(t,e){return!L(t,r[e])}))){var o=t.multiple?e.value.some((function(t){return ta(t,i)})):e.value!==e.oldValue&&ta(e.value,i);o&&ia(t,"change")}}}};function Qo(t,e,n){Yo(t,e,n),(tt||nt)&&setTimeout((function(){Yo(t,e,n)}),0)}function Yo(t,e,n){var r=e.value,i=t.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=t.options.length;s-1,a.selected!==o&&(a.selected=o);else if(L(ea(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}}function ta(t,e){return e.every((function(e){return!L(e,t)}))}function ea(t){return"_value"in t?t._value:t.value}function na(t){t.target.composing=!0}function ra(t){t.target.composing&&(t.target.composing=!1,ia(t.target,"input"))}function ia(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function oa(t){return!t.componentInstance||t.data&&t.data.transition?t:oa(t.componentInstance._vnode)}var aa={bind:function(t,e,n){var r=e.value;n=oa(n);var i=n.data&&n.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&i?(n.data.show=!0,Ho(n,(function(){t.style.display=o}))):t.style.display=r?o:"none"},update:function(t,e,n){var r=e.value,i=e.oldValue;if(!r!==!i){n=oa(n);var o=n.data&&n.data.transition;o?(n.data.show=!0,r?Ho(n,(function(){t.style.display=t.__vOriginalDisplay})):Bo(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none"}},unbind:function(t,e,n,r,i){i||(t.style.display=t.__vOriginalDisplay)}},sa={model:Zo,show:aa},ca={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function ua(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?ua($n(e.children)):t}function la(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var o in i)e[$(o)]=i[o];return e}function fa(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function da(t){while(t=t.parent)if(t.data.transition)return!0}function pa(t,e){return e.key===t.key&&e.tag===t.tag}var va=function(t){return t.tag||Cn(t)},ha=function(t){return"show"===t.name},ma={name:"transition",props:ca,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(va),n.length)){0;var r=this.mode;0;var i=n[0];if(da(this.$vnode))return i;var o=ua(i);if(!o)return i;if(this._leaving)return fa(t,i);var a="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?a+"comment":a+o.tag:s(o.key)?0===String(o.key).indexOf(a)?o.key:a+o.key:o.key;var c=(o.data||(o.data={})).transition=la(this),u=this._vnode,l=ua(u);if(o.data.directives&&o.data.directives.some(ha)&&(o.data.show=!0),l&&l.data&&!pa(o,l)&&!Cn(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=T({},c);if("out-in"===r)return this._leaving=!0,we(f,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),fa(t,i);if("in-out"===r){if(Cn(o))return u;var d,p=function(){d()};we(c,"afterEnter",p),we(c,"enterCancelled",p),we(f,"delayLeave",(function(t){d=t}))}}return i}}},ya=T({tag:String,moveClass:String},ca);delete ya.mode;var ga={props:ya,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var i=Tn(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=la(this),s=0;s1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id",i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(var r in d(this,e),this._keyField=a,this._remote=i,this._level=0,this.checked=!1,this.selected=!1,this.indeterminate=!1,this.disabled=!1,this.expand=!1,this.visible=!0,this._filterVisible=!0,this._parent=null,this.children=[],this.isLeaf=!1,this._loading=!1,this._loaded=!1,t)-1===p.indexOf(r)&&(this[r]=t[r]);null==this[a]&&(this[a]=Math.random().toString(36).substring(2)),this._parent=n,this._parent&&(this._level=this._parent._level+1),this.visible=null===this._parent||this._parent.expand&&this._parent.visible,Array.isArray(t.children)&&this.setChildren(t.children),this.children.length&&(this._loaded=!0),this._remote||(this.isLeaf=!this.children.length)}return u(e,[{key:"setChildren",value:function(t){var n=this;this.children=t.map((function(t){return new e(Object.assign({},t),n,n._keyField,n._remote)}))}}]),e}();(function(e){e["none"]="none",e["parents"]="parents",e["children"]="children"})(f||(f={}));var g,b,y,m=["setData","setChecked","setCheckedKeys","checkAll","clearChecked","setSelected","clearSelected","setExpand","setExpandKeys","setExpandAll","getCheckedNodes","getCheckedKeys","getIndeterminateNodes","getSelectedNode","getSelectedKey","getExpandNodes","getExpandKeys","getCurrentVisibleNodes","getNode","getTreeData","getFlatData","getNodesCount","insertBefore","insertAfter","append","prepend","remove","filter","showCheckedNodes","loadRootNodes","scrollTo"],k=["clearKeyword","getKeyword","search"];function _(e){return _="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_(e)}function C(e){return x(e)||w(e)||S()}function S(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function w(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function x(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;for(var i in this.data=e.map((function(e){return new v(e,null,t.options.keyField,!!t.options.load)})),this.mapData)delete this.mapData[i];this.currentSelectedKey=null,this.flatData=this.flattenData(this.data),this.setUnloadCheckedKeys(a||[]),n&&(this.currentSelectedKey=null,this.setUnloadSelectedKey(n)),this.emit("visible-data-change"),this.emit("set-data")}},{key:"setChecked",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=this.mapData[e];if(!r)return this.setUnloadChecked(e,t,n,a);r.disabled||r.checked&&t||(r.checked||r.indeterminate||t)&&(this.options.cascade?(this.checkNodeDownward(r,t,i),this.checkNodeUpward(r)):r.checked=t,n&&(r.checked?this.emit("check",r):this.emit("uncheck",r)),this.triggerCheckedChange(n,a))}},{key:"setUnloadChecked",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=this.findIndex(e,this.unloadCheckedKeys);t?-1===i&&this.unloadCheckedKeys.push(e):-1!==i&&this.unloadCheckedKeys.splice(i,1),this.triggerCheckedChange(n,a)}},{key:"setCheckedKeys",value:function(e,t){var n=this,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];e.forEach((function(e){n.setChecked(e,t,!1,!1)})),this.triggerCheckedChange(a,i)}},{key:"checkAll",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.options.cascade){var a=function t(n){n.forEach((function(n){n.disabled?t(n.children):e.setChecked(n[e.options.keyField],!0,!1,!1)}))};a(this.data)}else for(var i=this.flatData.length,r=0;r0&&void 0!==arguments[0])||arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=this.getCheckedNodes();a.forEach((function(t){e.setChecked(t[e.options.keyField],!1,!1,!1)})),this.unloadCheckedKeys=[],this.triggerCheckedChange(t,n)}},{key:"triggerCheckedChange",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&this.emit("checked-change",this.getCheckedNodes(),this.getCheckedKeys()),t&&this.emit("render-data-change")}},{key:"setSelected",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=this.mapData[e];if(!i)return this.setUnloadSelected(e,t,n,a);i.disabled||i.selected!==t&&(e===this.currentSelectedKey?t||(i.selected=t,this.currentSelectedKey=null):t&&(null===this.currentSelectedKey?(i.selected=t,this.currentSelectedKey=i[this.options.keyField]):(this.mapData[this.currentSelectedKey]&&(this.mapData[this.currentSelectedKey].selected=!1),i.selected=t,this.currentSelectedKey=i[this.options.keyField])),n&&(i.selected?this.emit("select",i):this.emit("unselect",i),this.emit("selected-change",this.getSelectedNode(),this.getSelectedKey())),a&&this.emit("render-data-change"))}},{key:"setUnloadSelected",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];t?(this.currentSelectedKey&&this.setSelected(this.currentSelectedKey,!1,!1,!1),this.unloadSelectedKey=e):this.unloadSelectedKey===e&&(this.unloadSelectedKey=null),n&&this.emit("selected-change",this.getSelectedNode(),this.getSelectedKey()),a&&this.emit("render-data-change")}},{key:"clearSelected",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.currentSelectedKey&&this.mapData[this.currentSelectedKey]?this.setSelected(this.currentSelectedKey,!1,e,t):null!==this.unloadSelectedKey&&(this.unloadSelectedKey=null,e&&this.emit("selected-change",this.getSelectedNode(),this.getSelectedKey()),t&&this.emit("render-data-change"))}},{key:"setExpand",value:function(e,t){var n=this,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=this.mapData[e];if(s&&(a||!s.isLeaf)&&s.expand!==t){if(!s.isLeaf){if("function"===typeof this.options.load){if(!s._loaded&&!s._loading&&t)return s._loading=!0,r&&this.emit("visible-data-change"),void new Promise((function(e,t){var a=n.options.load;a(s,e,t)})).then((function(e){if(Array.isArray(e)){var a,i=n.findIndex(s);if(-1===i)return;s._loaded=!0,s.expand=t,s.setChildren(e);var r=n.getCheckedKeys(),o=n.flattenData(s.children,null===n.getSelectedKey);(a=n.flatData).splice.apply(a,[i+1,0].concat(C(o))),n.setUnloadCheckedKeys(r),null!==n.unloadSelectedKey&&n.setUnloadSelectedKey(n.unloadSelectedKey),n.emit("set-data")}})).catch((function(e){var t=e;e instanceof Error||(t=new Error(e)),console.error(t)})).then((function(){s._loading=!1,i&&n.emit("expand",s),r&&n.emit("visible-data-change")}));if(s._loading)return}s.expand=t;var o=C(s.children);while(o.length)o[0].expand&&o[0].children.length&&o.push.apply(o,C(o[0].children)),!1===o[0]._filterVisible?o[0].visible=!1:o[0].visible=null===o[0]._parent||o[0]._parent.expand&&o[0]._parent.visible,o.shift();i&&this.emit("expand",s),r&&this.emit("visible-data-change")}a&&s._parent&&t&&this.setExpand(s._parent[this.options.keyField],t,a,!1,r)}}},{key:"setExpandKeys",value:function(e,t){var n=this,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e.forEach((function(e){n.setExpand(e,t,!1,!1,!1)})),a&&this.emit("visible-data-change")}},{key:"setExpandAll",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.flatData.forEach((function(n){t.options.load&&!n._loaded||t.setExpand(n[t.options.keyField],e,!1,!1,!1)})),n&&this.emit("visible-data-change")}},{key:"getCheckedNodes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.ignoreMode;if(e===f.children){var t=[],n=function e(n){n.forEach((function(n){n.checked?t.push(n):!n.isLeaf&&n.indeterminate&&e(n.children)}))};return n(this.data),t}return this.flatData.filter((function(t){return e===f.parents?t.checked&&t.isLeaf:t.checked}))}},{key:"getCheckedKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.ignoreMode;return this.getCheckedNodes(t).map((function(t){return t[e.options.keyField]})).concat(this.unloadCheckedKeys)}},{key:"getIndeterminateNodes",value:function(){return this.flatData.filter((function(e){return e.indeterminate}))}},{key:"getSelectedNode",value:function(){return null===this.currentSelectedKey?null:this.mapData[this.currentSelectedKey]||null}},{key:"getSelectedKey",value:function(){return this.currentSelectedKey||this.unloadSelectedKey||null}},{key:"getUnloadCheckedKeys",value:function(){return this.unloadCheckedKeys}},{key:"getExpandNodes",value:function(){return this.flatData.filter((function(e){return!e.isLeaf&&e.expand}))}},{key:"getExpandKeys",value:function(){var e=this;return this.getExpandNodes().map((function(t){return t[e.options.keyField]}))}},{key:"getNode",value:function(e){return this.mapData[e]||null}},{key:"insertBefore",value:function(e,t){var n=this.getInsertedNode(e,t);if(!n)return null;this.remove(n[this.options.keyField],!1);var a=this.mapData[t],i=a._parent,r=this.findIndex(t,i&&i.children),s=this.findIndex(t),o=i?-1:this.findIndex(t,this.data);return this.insertIntoStore(n,i,r,s,o),this.emit("visible-data-change"),n}},{key:"insertAfter",value:function(e,t){var n=this.getInsertedNode(e,t);if(!n)return null;this.remove(n[this.options.keyField],!1);for(var a=this.mapData[t],i=a._parent,r=this.findIndex(t,i&&i.children)+1,s=this.flatData.length,o=this.findIndex(t),l=o+1,c=o+1;c<=s;c++){if(c===s){l=c;break}if(this.flatdata[c]._level<=a._level){l=c;break}}var d=i?-1:this.findIndex(t,this.data)+1;return this.insertIntoStore(n,i,r,l,d),this.emit("visible-data-change"),n}},{key:"append",value:function(e,t){var n=this.mapData[t];if(!n.isLeaf){var a=n.children.length;return this.insertAfter(e,n.children[a-1][this.options.keyField])}var i=this.getInsertedNode(e,t,!0);if(!i)return null;this.remove(i[this.options.keyField],!1);var r=this.findIndex(t)+1;return this.insertIntoStore(i,n,0,r),this.emit("visible-data-change"),i}},{key:"prepend",value:function(e,t){var n=this.mapData[t];if(!n.isLeaf)return this.insertBefore(e,n.children[0][this.options.keyField]);var a=this.getInsertedNode(e,t,!0);if(!a)return null;this.remove(a[this.options.keyField],!1);var i=this.findIndex(t)+1;return this.insertIntoStore(a,n,0,i),this.emit("visible-data-change"),a}},{key:"remove",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=this.mapData[e];if(!a)return null;var i=this.findIndex(a);if(-1===i)return null;for(var r=1,s=this.flatData.length,o=i+1;oa._level))break;r++}this.flatData.splice(i,r);var l=function e(n){var a=t.mapData[n];delete t.mapData[n],a.children.forEach((function(n){return e(n[t.options.keyField])}))};if(l(e),!a._parent){var c=this.findIndex(a,this.data);c>-1&&this.data.splice(c,1)}if(a._parent){var d=this.findIndex(a,a._parent.children);-1!==d&&a._parent.children.splice(d,1),a._parent.isLeaf=!a._parent.children.length,a._parent.isLeaf&&(a._parent.expand=!1,a._parent.indeterminate=!1),this.updateMovingNodeStatus(a)}return n&&this.emit("visible-data-change"),a}},{key:"getInsertedNode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=this.mapData[t];if(!a)return null;var i=n?a:a._parent;if(e instanceof v)return e[this.options.keyField]===t?null:e;if("object"===_(e)){if(e[this.options.keyField]===t)return null;var r=this.mapData[e[this.options.keyField]];return r||new v(e,i,this.options.keyField,!!this.options.load)}return this.mapData[e]&&e!==t?this.mapData[e]:null}},{key:"insertIntoStore",value:function(e,t,n,a,i){var r;if(-1!==a){-1!==n&&t&&t.children.splice(n,0,e),e._parent=t,t?(t.isLeaf=!1,this.setExpand(t[this.options.keyField],!0,!1,!1,!1)):"number"===typeof i&&i>-1&&this.data.splice(i,0,e);var s=this.flattenData([e]);e._level=t?t._level+1:0,s.forEach((function(e){return e._level=e._parent?e._parent._level+1:0})),(r=this.flatData).splice.apply(r,[a,0].concat(C(s))),this.updateMovingNodeStatus(e)}}},{key:"updateMovingNodeStatus",value:function(e){this.checkNodeUpward(e),this.triggerCheckedChange(),e.selected&&this.setSelected(e[this.options.keyField],!0)}},{key:"filter",value:function(e,t){var n=this,a=[];this.flatData.forEach((function(n){n._filterVisible=n._parent&&n._parent._filterVisible||t(e,n),n.visible=n._filterVisible,n._filterVisible&&a.push(n)})),a.forEach((function(e){var t=[],a=e._parent;while(a)t.unshift(a),a=a._parent;t.forEach((function(e){e._filterVisible=!0,e.visible=(null===e._parent||e._parent.expand&&e._parent.visible)&&e._filterVisible,n.options.expandOnFilter&&n.setExpand(e[n.options.keyField],!0,!1,!1,!1)})),e.visible=null===e._parent||e._parent.expand&&e._parent.visible})),this.emit("visible-data-change")}},{key:"setUnloadCheckedKeys",value:function(e){this.unloadCheckedKeys=e;for(var t=e.concat(),n=this.unloadCheckedKeys.length,a=n-1;a>=0;a--){var i=this.unloadCheckedKeys[a];this.mapData[i]&&(this.setChecked(i,!0,!1,!1),this.unloadCheckedKeys.splice(a,1))}var r=this.getCheckedKeys();r.length===t.length&&r.every((function(e){return t.some((function(t){return t===e}))}))||this.emit("checked-change",this.getCheckedNodes(),r)}},{key:"setUnloadSelectedKey",value:function(e){var t=this.getSelectedKey();this.mapData[e]?(this.setSelected(e,!0,!1),this.unloadSelectedKey=null):(this.currentSelectedKey&&this.setSelected(this.currentSelectedKey,!1,!1),this.unloadSelectedKey=e);var n=this.getSelectedKey();n!==t&&this.emit("selected-change",this.getSelectedNode(),n)}},{key:"flattenData",value:function(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=e.length,i=0;i2&&void 0!==arguments[2]&&arguments[2];if(e.children.forEach((function(e){n.checkNodeDownward(e,t,a)})),e.isLeaf||this.options.load&&!e.children.length){if(!e.disabled){if(a&&!this.options.filteredNodeCheckable&&!e._filterVisible)return;e.checked=t,e.indeterminate=!1}}else this.checkParentNode(e)}},{key:"checkNodeUpward",value:function(e){var t=e._parent;while(t)this.checkParentNode(t),t=t._parent}},{key:"checkParentNode",value:function(e){var t=e.children.length;if(t){for(var n=!1,a=!1,i=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:this.flatData;if(null!==t)for(var n=e instanceof v?e[this.options.keyField]:e,a=t.length,i=0;i-1&&this.listenersMap[e].splice(n,1)}else this.listenersMap[e]=[]}},{key:"emit",value:function(e){if(this.listenersMap[e]){for(var t=this.listenersMap[e].length,n=arguments.length,a=new Array(n>1?n-1:0),i=1;i1&&void 0!==arguments[1]&&arguments[1];this.dragoverBefore=!1,this.dragoverBody=!1,this.dragoverAfter=!1,t||(e===y.before?this.dragoverBefore=!0:e===y.body?this.dragoverBody=!0:e===y.after&&(this.dragoverAfter=!0))},handleDragStart:function(e){e.dataTransfer&&e.dataTransfer.setData("node",JSON.stringify(this.data)),this.data.expand&&this.handleExpand(),this.$emit("node-dragstart",this.fullData,e)},handleDragEnter:function(e){e.preventDefault();var t=this.getHoverPart(e);this.resetDragoverFlags(t),this.$emit("node-dragenter",this.fullData,e,t)},handleDragOver:function(e){e.preventDefault();var t=this.getHoverPart(e);this.resetDragoverFlags(t),this.$emit("node-dragover",this.fullData,e,t)},handleDragLeave:function(e){var t=this.getHoverPart(e);this.resetDragoverFlags(t,!0),this.$emit("node-dragleave",this.fullData,e,t)},handleDrop:function(e){var t=this.getHoverPart(e);this.resetDragoverFlags(t,!0),this.$emit("node-drop",this.fullData,e,t)}}}),H=V,U=Object(P["a"])(H,K,,ドル!1,null,null,null),W=U.exports;function G(e){return q(e)||X(e)||Y()}function Y(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function X(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function q(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t2&&void 0!==arguments[2])||arguments[2];this.nonReactive.store.setExpand(e,t,n)},setExpandKeys:function(e,t){this.nonReactive.store.setExpandKeys(e,t)},setExpandAll:function(e){this.nonReactive.store.setExpandAll(e)},getCheckedNodes:function(e){return e=e||this.ignoreMode,this.nonReactive.store.getCheckedNodes(e)},getCheckedKeys:function(e){return e=e||this.ignoreMode,this.nonReactive.store.getCheckedKeys(e)},getIndeterminateNodes:function(){return this.nonReactive.store.getIndeterminateNodes()},getSelectedNode:function(){return this.nonReactive.store.getSelectedNode()},getSelectedKey:function(){return this.nonReactive.store.getSelectedKey()},getExpandNodes:function(){return this.nonReactive.store.getExpandNodes()},getExpandKeys:function(){return this.nonReactive.store.getExpandKeys()},getCurrentVisibleNodes:function(){return this.nonReactive.store.flatData.filter((function(e){return e._filterVisible}))},getNode:function(e){return this.nonReactive.store.getNode(e)},getTreeData:function(){return this.nonReactive.store.data},getFlatData:function(){return this.nonReactive.store.flatData},getNodesCount:function(){return this.nonReactive.store.flatData.length},insertBefore:function(e,t){return this.nonReactive.store.insertBefore(e,t)},insertAfter:function(e,t){return this.nonReactive.store.insertAfter(e,t)},append:function(e,t){return this.nonReactive.store.append(e,t)},prepend:function(e,t){return this.nonReactive.store.prepend(e,t)},remove:function(e){return this.nonReactive.store.remove(e)},filter:function(e,t){var n=this,a=function(e,t){var a=t[n.titleField];return!(null==a||!a.toString)&&a.toString().toLowerCase().indexOf(e.toLowerCase())>-1};t=t||this.filterMethod||a,this.nonReactive.store.filter(e,t)},showCheckedNodes:function(e){var t=this;if(this.checkable){e=null==e?this.showUnloadCheckedNodes:e;var n=this.nonReactive.store.getCheckedNodes();if(this.nonReactive.store.filter("",(function(e,t){return t.checked})),e){var a=this.nonReactive.store.getUnloadCheckedKeys();if(a.length){var i,r=a.map((function(e){var a,i=t.unloadDataList.concat(n),r=e;return i.some((function(n){return n[t.keyField]===e&&null!=n[t.titleField]&&(r=n[t.titleField],!0)})),new v((a={},J(a,t.keyField,e),J(a,t.titleField,r),J(a,"checked",!0),J(a,"isLeaf",!0),a),null,t.keyField,!!t.load)}));this.unloadCheckedNodes=r,(i=this.nonReactive.blockNodes).push.apply(i,G(r)),this.updateBlockData(),this.updateRender()}}}},loadRootNodes:function(){var e=this;return this.isRootLoading=!0,new Promise((function(t,n){e.load(null,t,n)})).then((function(t){Array.isArray(t)&&e.setData(t)})).catch((function(){})).then((function(){e.isRootLoading=!1}))},scrollTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b.top,n=this.nonReactive.store.mapData[e];if(n&&n.visible){for(var a=-1,i=0;i-1}))}},handleNodeCheck:function(e){(this.cascade||!this.enableLeafOnly||e.isLeaf)&&this.nonReactive.store.setChecked(e[this.keyField],!e.indeterminate&&!e.checked,!0,!0,!0)},handleNodeSelect:function(e){this.enableLeafOnly&&!e.isLeaf||this.nonReactive.store.setSelected(e[this.keyField],!e.selected)},handleNodeExpand:function(e){this.nonReactive.store.setExpand(e[this.keyField],!e.expand)},handleNodeDrop:function(e,t,n){if(this.droppable&&t.dataTransfer)try{var a=JSON.parse(t.dataTransfer.getData("node")),i=a[this.keyField],r=e[this.keyField],s=this.beforeDropMethod(i,r,n);if(s){if(i===r)return;n===y.before?this.nonReactive.store.insertBefore(i,r):n===y.body||!e.isLeaf&&e.expand?this.nonReactive.store.prepend(i,r):n===y.after&&this.nonReactive.store.insertAfter(i,r),this.$emit("node-drop",e,t,n,this.getNode(i))}}catch(o){throw new Error(o)}},emitCheckableInput:function(e,t){if(this.checkable){var n=t;Array.isArray(this.value)||(n=n.join(this.separator)),Array.isArray(n)?this.valueCache=n.concat():this.valueCache=n,this.$emit("input",n)}},emitSelectableInput:function(e,t){if(this.selectable&&!this.checkable){var n=t||"";this.valueCache=n,this.$emit("input",n)}},attachStoreEvents:function(){for(var e in this.$listeners)if(Q.indexOf(e)>-1){var t=e;this.nonReactive.store.on(t,this.$listeners[e])}},resetSpaceHeights:function(){this.topSpaceHeight=0,this.bottomSpaceHeight=0,this.$refs.scrollArea.scrollTop=0},updateBlockNodes:function(){this.nonReactive.blockNodes=this.nonReactive.store.flatData.filter((function(e){return e.visible})),this.updateBlockData(),this.updateRender()},updateBlockData:function(){this.blockLength=this.nonReactive.blockNodes.length,this.blockAreaHeight=this.nodeMinHeight*this.blockLength},updateRender:function(){this.updateRenderAmount(),this.updateRenderNodes()},updateRenderAmount:function(){var e=this.$refs.scrollArea.clientHeight;this.renderAmount=Math.max(this.renderNodeAmount,Math.ceil(e/this.nodeMinHeight)+this.bufferNodeAmount)},updateRenderNodes:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.blockLength>this.renderAmount){var t=this.$refs.scrollArea.scrollTop,n=Math.floor(t/this.nodeMinHeight);this.renderStart=Math.floor(n/this.bufferNodeAmount)*this.bufferNodeAmount}else this.renderStart=0;e&&this.renderAmountCache===this.renderAmount&&this.renderStartCache===this.renderStart||(this.renderNodes=this.nonReactive.blockNodes.slice(this.renderStart,this.renderStart+this.renderAmount).map((function(e){return Object.assign({},e,{_parent:null,children:[]})})),this.topSpaceHeight=this.renderStart*this.nodeMinHeight,this.bottomSpaceHeight=this.blockAreaHeight-(this.topSpaceHeight+this.renderNodes.length*this.nodeMinHeight))},handleTreeScroll:function(){this.debounceTimer&&window.cancelAnimationFrame(this.debounceTimer),this.renderAmountCache=this.renderAmount,this.renderStartCache=this.renderStart,this.debounceTimer=window.requestAnimationFrame(this.updateRenderNodes.bind(this,!0))}},created:function(){var e=this,t=this.keyField,n=this.ignoreMode,a=this.filteredNodeCheckable,i=this.cascade,r=this.defaultExpandAll,s=this.load,o=this.expandOnFilter;this.nonReactive={store:new O({keyField:t,ignoreMode:n,filteredNodeCheckable:a,cascade:i,defaultExpandAll:r,load:s,expandOnFilter:o}),blockNodes:[]},this.nonReactive.store.on("visible-data-change",this.updateBlockNodes),this.nonReactive.store.on("render-data-change",this.updateRender),this.nonReactive.store.on("checked-change",(function(t,n){e.emitCheckableInput(t,n),e.updateUnloadStatus()})),this.nonReactive.store.on("selected-change",this.emitSelectableInput),this.attachStoreEvents()},mounted:function(){this.data.length?(this.setData(this.data),this.defaultExpandedKeys.length&&this.nonReactive.store.setExpandKeys(this.defaultExpandedKeys,!0)):"function"===typeof this.load&&this.autoLoad&&this.loadRootNodes();var e=this.$refs.iframe;e.contentWindow&&e.contentWindow.addEventListener("resize",this.updateRender)},beforeDestroy:function(){var e=this.$refs.iframe;e.contentWindow&&e.contentWindow.removeEventListener("resize",this.updateRender)},watch:{value:function(e){if(this.checkable){if(ee(e,this.valueCache))return;var t=[];Array.isArray(e)?t=e.concat():"string"===typeof e&&(t=""===e?[]:e.split(this.separator)),this.nonReactive.store.clearChecked(!1,!1),this.nonReactive.store.setCheckedKeys(t,!0)}else if(this.selectable){if(e===this.valueCache)return;var n=this.nonReactive.store.getSelectedKey();""!==e&&null!=e?this.nonReactive.store.setSelected(e,!0):""!==e&&null!=e||!n||this.nonReactive.store.setSelected(n,!1)}},data:{deep:!0,handler:function(e){this.setData(e)}},expandedKeys:function(){this.updateExpandedKeys()},$listeners:function(){this.attachStoreEvents()}}}),ne=te,ae=Object(P["a"])(ne,l,c,!1,null,null,null),ie=ae.exports,re=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.wrapperCls},[n("div",{class:e.searchCls},[e.showCheckAll&&e.checkable?n("div",{class:e.checkAllWrapperCls},[n("div",{class:e.checkboxCls,on:{click:e.handleCheckAll}})]):e._e(),n("div",{class:e.inputWrapperCls},[e._t("search-input",[n("input",{directives:[{name:"model",rawName:"v-model",value:e.keyword,expression:"keyword"}],class:e.inputCls,attrs:{type:"text",placeholder:e.searchPlaceholder,disabled:e.searchDisabled},domProps:{value:e.keyword},on:{input:[function(t){t.target.composing||(e.keyword=t.target.value)},e.handleSearch]}})])],2),n("div",{class:e.actionWrapperCls},[e.showCheckedButton&&e.checkable?n("span",{class:e.checkedButtonCls,on:{click:e.handleShowChecked}},[e._v("\n "+e._s(e.checkedButtonText)+"\n ")]):e._e(),e._t("actions")],2)]),n("div",{class:e.treeWrapperCls},[n("CTree",e._g(e._b({ref:"tree",attrs:{value:e.value},on:{input:e.updateCheckedCount,"set-data":e.handleSetData,"checked-change":e.updateCheckAllStatus},scopedSlots:e._u([e._l(e.$scopedSlots,(function(t,n){return{key:n,fn:function(t){return[e._t(n,null,null,t)]}}}))],null,!0)},"CTree",e.$attrs,!1),e.$listeners))],1),e.showFooter&&e.checkable?n("div",{class:e.footerCls},[e._t("footer",[n("span",{staticStyle:{float:"right"}},[e._v("已选 "+e._s(e.checkedCount)+" 个")])])],2):e._e()])},se=[];function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function le(e){for(var t=1;t-1){var n=ue;n[t]=function(){for(var e=arguments.length,n=new Array(e),a=0;a0&&n.length-1){var n=Ke;n[t]=function(){for(var e=arguments.length,n=new Array(e),a=0;a0&&void 0!==arguments[0]?arguments[0]:{},t=e.treeDepth,n=void 0===t?5:t,a=e.nodesPerLevel,i=e.sameIdTitle,r=void 0!==i&&i,s=e.inOrder,o=void 0!==s&&s,l=e.forceString,c=void 0!==l&&l,d=[],h=0,u=0,f=function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!(i>=n))for(var s=a||Math.floor(100*Math.random()),l=0;l0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0},e))},Ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return Ve({treeDepth:1,nodesPerLevel:e,inOrder:!0})},We={name:"Feature",components:{CTree:Be},data:function(){var e=He().data;e[0].selected=!0;var t=He().data;return t[0].expand=!0,t[1].children[0].disabled=!0,{basicUsage:He().data,orderData:He({inOrder:!0}).data,selectable:e,selectableValue:"",showCheckable:!0,checkable:t,checkableValue:[t[0].id],checkableIgnoreMode:"none",checkableCascade:!0,both:He().data,bothValue:[],remoteShow:!1,remoteLoad:function(e,t,n){setTimeout((function(){t(Ue(e?2:5).data)}),1e3)}}}},Ge=We,Ye=(n("826c"),Object(P["a"])(Ge,s,o,!1,null,"01d42e0f",null)),Xe=Ye.exports,qe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"container"},[n("div",{staticClass:"tree"},[n("CTree",{ref:"tree",attrs:{data:e.treeData,checkable:"",selectable:""}})],1),n("div",{staticClass:"control"},[e._m(0),n("div",{staticClass:"controls"},[n("label",[e._v("节点深度:")]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.params.treeDepth,expression:"params.treeDepth"}],attrs:{type:"number"},domProps:{value:e.params.treeDepth},on:{input:function(t){t.target.composing||e.$set(e.params,"treeDepth",t.target.value)}}})]),n("div",{staticClass:"controls"},[n("label",[e._v("每层节点个数:")]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.params.nodesPerLevel,expression:"params.nodesPerLevel"}],attrs:{type:"number"},domProps:{value:e.params.nodesPerLevel},on:{input:function(t){t.target.composing||e.$set(e.params,"nodesPerLevel",t.target.value)}}})]),n("div",{staticClass:"controls"},[n("label",[e._v("总节点个数:")]),e._v("\n "+e._s(e.nodeTotal)+"\n ")]),n("div",{staticClass:"controls"},[n("div",{staticClass:"actions"},[n("button",{on:{click:e.handleGenerate}},[e._v("生成树节点数据")]),n("button",{on:{click:function(t){return e.handleGenerateTotal("1w")}}},[e._v("1w 节点")]),n("button",{on:{click:function(t){return e.handleGenerateTotal("10w")}}},[e._v("10w 节点")]),n("button",{on:{click:function(t){return e.handleGenerateTotal("20w")}}},[e._v("20w 节点")]),n("button",{on:{click:function(t){return e.handleGenerateTotal("30w")}}},[e._v("30w 节点")])]),n("div",{staticClass:"actions"},[n("button",{on:{click:e.handleSetData}},[e._v("设置树数据")])]),n("div",{staticClass:"actions"},[e.isTreeSet?n("span",{staticStyle:{color:"green"}},[e._v("树数据已设置")]):n("span",{staticStyle:{color:"red"}},[e._v("树数据已生成")])])]),n("div",{staticClass:"controls"},[n("label",[e._v("滚动节点id:")]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.scrollKey,expression:"scrollKey"}],attrs:{type:"text"},domProps:{value:e.scrollKey},on:{input:function(t){t.target.composing||(e.scrollKey=t.target.value)}}})]),n("div",{staticClass:"controls"},[n("label",[e._v("滚动垂直位置:")]),n("select",{directives:[{name:"model",rawName:"v-model",value:e.scrollVerticalOption,expression:"scrollVerticalOption"}],on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.scrollVerticalOption=t.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"top"}},[e._v("top")]),n("option",{attrs:{value:"center"}},[e._v("center")]),n("option",{attrs:{value:"bottom"}},[e._v("bottom")])])]),n("div",{staticClass:"controls"},[n("label",[e._v("滚动垂直偏移值:")]),n("input",{directives:[{name:"model",rawName:"v-model.number",value:e.scrollValue,expression:"scrollValue",modifiers:{number:!0}}],attrs:{type:"text"},domProps:{value:e.scrollValue},on:{input:function(t){t.target.composing||(e.scrollValue=e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})]),n("div",{staticClass:"controls"},[n("div",{staticClass:"actions"},[n("button",{on:{click:e.handleScrollToNode}},[e._v("滚动到此节点")])])])])])},Je=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"desc-block"},[n("p",[e._v("说明:在 Chrome 下表现良好")]),n("p",[e._v("在火狐浏览器下,因为其异步滚动策略 (scroll-linked) ,在快速滚动时会导致内容空白。")]),n("p",[e._v("另:浏览器元素/文档是有最大高度限制的,过多数据会导致显示不正常(Chrome 下 100 万条可以正常显示,但是在火狐或 Edge 则不行)")])])}],ze={"1w":{treeDepth:2,nodesPerLevel:100},"10w":{treeDepth:2,nodesPerLevel:320},"20w":{treeDepth:2,nodesPerLevel:450},"30w":{treeDepth:2,nodesPerLevel:550}},Qe=[],Ze={name:"Performance",components:{CTree:Be},data:function(){return{cache:[],isTreeSet:!1,params:{treeDepth:2,nodesPerLevel:5},nodeTotal:0,treeData:[],scrollKey:"",scrollVerticalOption:"top",scrollValue:0}},methods:{handleGenerate:function(){var e=Ve(Object.assign({},this.params,{inOrder:!0,sameIdTitle:!0,forceString:!0}));Qe=e.data,this.nodeTotal=e.total,this.isTreeSet=!1},handleGenerateTotal:function(e){Object.assign(this.params,ze[e]),this.handleGenerate()},handleSetData:function(){this.$refs.tree.setData(Qe.concat()),this.isTreeSet=!0},handleScrollToNode:function(){this.$refs.tree.scrollTo(this.scrollKey,this.scrollValue||this.scrollVerticalOption)}},created:function(){this.handleGenerate()}},et=Ze,tt=(n("2bc9"),Object(P["a"])(et,qe,Je,!1,null,"f597b4c8",null)),nt=tt.exports,at=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("CTree",{attrs:{data:e.basicUsage,loading:e.loading}}),n("button",{on:{click:e.handleToggle}},[e._v("Toggle Loading")])],1)},it=[],rt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0},e))},st={name:"Loading",components:{CTree:Be},data:function(){return{basicUsage:rt().data,loading:!1}},methods:{handleToggle:function(){this.loading=!this.loading}}},ot=st,lt=Object(P["a"])(ot,at,it,!1,null,null,null),ct=lt.exports,dt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("CTreeSearch",{attrs:{data:e.data,checkable:"",expandOnFilter:!1},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")]),n("template",{slot:"actions"},[n("span",{staticStyle:{"margin-left":"5px"}},[e._v("折叠")]),n("span",{staticStyle:{"margin-left":"5px"}},[e._v("展开")]),n("span",{staticStyle:{"margin-left":"5px"}},[e._v("slot 按钮")])])],2)},ht=[],ut=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},ft={name:"Search",components:{CTreeSearch:me},data:function(){return{data:ut().data,value:"2"}}},pt=ft,vt=Object(P["a"])(pt,dt,ht,!1,null,null,null),gt=vt.exports,bt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{height:"100%"}},[n("CTreeSearch",{attrs:{load:e.load,"search-remote":"",checkable:""},on:{search:e.handleSearch},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n")],1)},yt=[],mt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},kt={name:"Search",components:{CTreeSearch:me},data:function(){var e=this;return{times:[3,2,5],index:0,load:function(t,n){setTimeout((function(){var t=mt({nodesPerLevel:e.times[e.index]}).data;n(t)}),10)},value:["93","124"]}},methods:{handleSearch:function(){this.index++,this.index>=this.times.length&&(this.index=0)}}},_t=kt,Ct=Object(P["a"])(_t,bt,yt,!1,null,null,null),St=(Ct.exports,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{height:"100%"}},[n("CTreeSearch",{attrs:{data:e.data,checkable:"","search-method":e.searchMethod},on:{search:e.handleSearch},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n")],1)}),wt=[],xt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},Dt={name:"Search",components:{CTreeSearch:me},data:function(){return{data:[],times:[3,2,5],index:0,value:["93","124"]}},methods:{searchMethod:function(e){var t=this;return new Promise((function(e){setTimeout((function(){t.data=xt({nodesPerLevel:t.times[t.index]}).data,e()}),10)}))},handleSearch:function(){this.index++,this.index>=this.times.length&&(this.index=0)}}},At=Dt,Nt=Object(P["a"])(At,St,wt,!1,null,null,null),Tt=(Nt.exports,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{width:"200px"}},[n("CTreeDrop",{attrs:{data:e.data,checkable:"",clearable:"","drop-placeholder":"请选择",placement:e.placement,"dropdown-min-width":300,"dropdown-width-fixed":""},on:{"checked-change":e.handleCheckedChange},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n")],1)}),Ot=[],Kt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},$t={name:"Drop",components:{CTreeDrop:Ie},data:function(){var e=Kt().data;return{data:e,value:"2",placement:"bottom-start"}},methods:{handleCheckedChange:function(){console.log("checked-change")}}},Et=$t,Rt=Object(P["a"])(Et,Tt,Ot,!1,null,null,null),Lt=Rt.exports,Ft=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{width:"200px"}},[n("CTreeDrop",{attrs:{data:e.data,checkable:"",clearable:"",cascade:!1,loading:e.loading,"drop-placeholder":"请选择","dropdown-min-width":300},on:{"checked-change":e.handleCheckedChange},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n "),n("button",{on:{click:e.handleChangeValue}},[e._v("Change Value")])],1)},Pt=[],jt=[{id:"p1-id",title:"c(lL%8",checked:!1,children:[{id:"c1-1-id",title:"c1-1",children:[]},{id:"c1-2-id",title:"c1-2",checked:!1,children:[]}]},{id:"p2-id",title:"KfQrp",checked:!1,children:[{id:"c2-1-id",title:"c2-1",checked:!1,children:[]},{id:"c2-2-id",title:"c1-2",checked:!1,children:[{id:"c2-2-1-id",title:"c1-2-1",checked:!1,children:[]}]}]}],It={name:"DropRemote",components:{CTreeDrop:Ie},data:function(){return{data:[],value:"",loading:!1}},created:function(){this.handleSetData()},methods:{handleChangeValue:function(){var e=this;setTimeout((function(){e.value="c1-1-id,c1-2-id"}),100)},handleCheckedChange:function(e){console.log("rrr checked change",e)},handleSetData:function(){var e=this;this.loading=!0,setTimeout((function(){e.data=jt,e.$nextTick((function(){e.value="c1-1-id,c1-2-id",e.loading=!1}))}),2e3)}}},Bt=It,Mt=Object(P["a"])(Bt,Ft,Pt,!1,null,null,null),Vt=(Mt.exports,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("CTree",{attrs:{data:e.data,checkable:"",draggable:"",droppable:""},on:{"node-drop":e.handleDrop},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n")],1)}),Ht=[],Ut=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},Wt={name:"Drag",components:{CTree:Be},data:function(){var e=Ut().data;return{data:e,value:["0"]}},methods:{handleDrop:function(){console.log("node drop")}}},Gt=Wt,Yt=Object(P["a"])(Gt,Vt,Ht,!1,null,null,null),Xt=Yt.exports,qt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{width:"200px"}},[n("CTreeDrop",{attrs:{data:e.data,checkable:"",clearable:"","drop-placeholder":"请选择","dropdown-min-width":300,"dropdown-width-fixed":""},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n")],1)},Jt=[],zt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},Qt=zt().data,Zt={name:"DropDataChange",components:{CTreeDrop:Ie},data:function(){return{data:[],value:"2"}},watch:{value:{handler:function(e){var t=this;setTimeout((function(){t.data=Qt}),3e3)},immediate:!0}}},en=Zt,tn=Object(P["a"])(en,qt,Jt,!1,null,null,null),nn=(tn.exports,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("CTree",{ref:"tree",attrs:{data:e.treeData,render:e.renderTree}})}),an=[],rn={name:"InsertRenderTree",components:{CTree:Be},data:function(){return{treeData:[{}]}},methods:{renderTree:function(e,t){return e("div",[e("input",{attrs:{type:"text"}}),e("button",{on:{click:this.handleAdd.bind(this,t)}},["Add sibling"]),e("button",{on:{click:this.handleAddChild.bind(this,t)}},["Add child"]),e("button",{on:{click:this.handleDelete.bind(this,t)}},["Remove"])])},handleAdd:function(e){this.$refs.tree.insertAfter({},e.id)},handleAddChild:function(e){this.$refs.tree.append({},e.id)},handleDelete:function(e){this.$refs.tree.remove(e.id)}}},sn=rn,on=Object(P["a"])(sn,nn,an,!1,null,null,null),ln=on.exports,cn={Feature:Xe,Performance:nt,Loading:ct,Search:gt,Drop:Lt,Drag:Xt,InsertRenderTree:ln},dn={name:"App",components:cn,data:function(){var e=Object.keys(cn);return{currentTab:e[0],tabList:e}}},hn=dn,un=(n("925e"),Object(P["a"])(hn,i,r,!1,null,"6c2a65d2",null)),fn=un.exports;n("eeb1");a["a"].config.productionTip=!1,new a["a"]({render:function(e){return e(fn)}}).$mount("#app")},e2ab:function(e,t,n){},eeb1:function(e,t,n){}}); \ No newline at end of file diff --git a/examples/App.vue b/examples/App.vue index 14e6d62..e85beb0 100644 --- a/examples/App.vue +++ b/examples/App.vue @@ -34,12 +34,12 @@ const components = { Performance, Loading, Search, - SearchRemote, - SearchRootRemote, + // SearchRemote, + // SearchRootRemote, Drop, - DropRemote, + // DropRemote, Drag, - DropDataChange, + // DropDataChange, InsertRenderTree, } diff --git a/examples/Drop.vue b/examples/Drop.vue index 32573b6..004668d 100644 --- a/examples/Drop.vue +++ b/examples/Drop.vue @@ -3,9 +3,8 @@ { - this.data = [ - { - id: '2', - title: 'xxcxxxx', - } - ] - }, 3000) - }, + // created () { + // setTimeout(() => { + // this.data = [ + // { + // id: '2', + // title: 'xxcxxxx', + // } + // ] + // }, 3000) + // }, } diff --git a/examples/Performance.vue b/examples/Performance.vue index 8396429..501e719 100644 --- a/examples/Performance.vue +++ b/examples/Performance.vue @@ -10,8 +10,8 @@
-

说明:在 Chrome 下表现良好,可实现 100 万条数据较流畅使用。

-

在火狐浏览器下,因为其异步滚动策略 (scroll-linked) ,在快速滚动时会导致内容空白(Edge 也会空白,但貌似是单纯的性能不足导致的)。

+

说明:在 Chrome 下表现良好

+

在火狐浏览器下,因为其异步滚动策略 (scroll-linked) ,在快速滚动时会导致内容空白。

另:浏览器元素/文档是有最大高度限制的,过多数据会导致显示不正常(Chrome 下 100 万条可以正常显示,但是在火狐或 Edge 则不行)

diff --git a/public/index.html b/examples/index.html similarity index 100% rename from public/index.html rename to examples/index.html diff --git a/docs/design-tree-search.md b/markdown/design-tree-search.md similarity index 100% rename from docs/design-tree-search.md rename to markdown/design-tree-search.md diff --git a/docs/design-tree.md b/markdown/design-tree.md similarity index 100% rename from docs/design-tree.md rename to markdown/design-tree.md diff --git a/package.json b/package.json index ce02dd4..8ce34e4 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "scripts": { "serve": "vue-cli-service serve --open", "bundle": "vue-cli-service build --target lib --name ctree ./src/index.ts --report", + "bundle:docs": "vue-cli-service build --mode docs --dest docs", "lint": "vue-cli-service lint", "test": "vue-cli-service test:unit", "prepublishOnly": "yarn bundle" diff --git a/vue.config.js b/vue.config.js index a366eb1..7119336 100644 --- a/vue.config.js +++ b/vue.config.js @@ -7,6 +7,8 @@ module.exports = { css: { // extract: false, }, + publicPath: process.env.VUE_APP_PUBLIC_PATH || '/', + outputDir: process.env.VUE_APP_OUTPUT_DIR || 'dist', configureWebpack: () => { let extraConfig = {} if (process.env.NODE_ENV === 'production') { @@ -17,6 +19,11 @@ module.exports = { entry: './examples/main.js', } } + if (process.env.VUE_APP_IS_BUILDING_DOCS === 'true') { + extraConfig = { + entry: './examples/main.js', + } + } return Object.assign(baseConfig, extraConfig) }, chainWebpack: (config) => { @@ -42,5 +49,13 @@ module.exports = { opts.happyPackMode = false return opts }) + if (process.env.NODE_ENV !== 'production' || process.env.VUE_APP_IS_BUILDING_DOCS === 'true') { + config + .plugin('html') + .tap((args) => { + args[0].template = './examples/index.html' + return args + }) + } }, }