style: lint format
parent
fdf7c5d4ce
commit
1ae763b8f5
|
@ -1,15 +1,18 @@
|
||||||
import { ExtractPropTypes, nextTick, onUpdated, PropType, ref, watch } from 'vue';
|
import type { ExtractPropTypes, PropType } from 'vue';
|
||||||
|
import { nextTick, onUpdated, ref, watch } from 'vue';
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import debounce from 'lodash-es/debounce';
|
import debounce from 'lodash-es/debounce';
|
||||||
import FolderOpenOutlined from '@ant-design/icons-vue/FolderOpenOutlined';
|
import FolderOpenOutlined from '@ant-design/icons-vue/FolderOpenOutlined';
|
||||||
import FolderOutlined from '@ant-design/icons-vue/FolderOutlined';
|
import FolderOutlined from '@ant-design/icons-vue/FolderOutlined';
|
||||||
import FileOutlined from '@ant-design/icons-vue/FileOutlined';
|
import FileOutlined from '@ant-design/icons-vue/FileOutlined';
|
||||||
import classNames from '../_util/classNames';
|
import classNames from '../_util/classNames';
|
||||||
import { AntdTreeNodeAttribute, treeProps } from './Tree';
|
import type { AntdTreeNodeAttribute } from './Tree';
|
||||||
import Tree, { TreeProps } from './Tree';
|
import { treeProps } from './Tree';
|
||||||
|
import type { TreeProps } from './Tree';
|
||||||
|
import Tree from './Tree';
|
||||||
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
||||||
import { convertDataToEntities, convertTreeToData } from '../vc-tree/utils/treeUtil';
|
import { convertDataToEntities, convertTreeToData } from '../vc-tree/utils/treeUtil';
|
||||||
import { DataNode, EventDataNode, Key } from '../vc-tree/interface';
|
import type { DataNode, EventDataNode, Key } from '../vc-tree/interface';
|
||||||
import { conductExpandParent } from '../vc-tree/util';
|
import { conductExpandParent } from '../vc-tree/util';
|
||||||
import { calcRangeKeys, convertDirectoryKeysToNodes } from './utils/dictUtil';
|
import { calcRangeKeys, convertDirectoryKeysToNodes } from './utils/dictUtil';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
|
|
|
@ -71,8 +71,8 @@ export type ExportedSelectProps<T extends DefaultValueType = DefaultValueType> =
|
||||||
const Select = defineComponent({
|
const Select = defineComponent({
|
||||||
name: 'Select',
|
name: 'Select',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
Option: Option,
|
Option,
|
||||||
OptGroup: OptGroup,
|
OptGroup,
|
||||||
props: RefSelect.props,
|
props: RefSelect.props,
|
||||||
setup(props, { attrs, expose, slots }) {
|
setup(props, { attrs, expose, slots }) {
|
||||||
const selectRef = ref(null);
|
const selectRef = ref(null);
|
||||||
|
|
|
@ -1,14 +1,7 @@
|
||||||
import type { FlattenDataNode, Key, LegacyDataNode, RawValueType } from './interface';
|
import type { FlattenDataNode, Key, LegacyDataNode, RawValueType } from './interface';
|
||||||
import type { SkipType } from './hooks/useKeyValueMapping';
|
import type { SkipType } from './hooks/useKeyValueMapping';
|
||||||
import {
|
import type { ComputedRef, InjectionKey, PropType } from 'vue';
|
||||||
computed,
|
import { computed, defineComponent, inject, provide } from 'vue';
|
||||||
ComputedRef,
|
|
||||||
defineComponent,
|
|
||||||
inject,
|
|
||||||
InjectionKey,
|
|
||||||
PropType,
|
|
||||||
provide,
|
|
||||||
} from 'vue';
|
|
||||||
|
|
||||||
interface ContextProps {
|
interface ContextProps {
|
||||||
checkable: boolean;
|
checkable: boolean;
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import type { DataNode, TreeDataNode, Key } from './interface';
|
import type { DataNode, TreeDataNode, Key } from './interface';
|
||||||
import { useInjectSelectContext } from './Context';
|
import { useInjectSelectContext } from './Context';
|
||||||
import { RefOptionListProps } from '../vc-select/OptionList';
|
import type { RefOptionListProps } from '../vc-select/OptionList';
|
||||||
import { ScrollTo } from '../vc-virtual-list/List';
|
import type { ScrollTo } from '../vc-virtual-list/List';
|
||||||
import { computed, defineComponent, nextTick, ref, watch } from 'vue';
|
import { computed, defineComponent, nextTick, ref, watch } from 'vue';
|
||||||
import { optionListProps } from './props';
|
import { optionListProps } from './props';
|
||||||
import useMemo from '../_util/hooks/useMemo';
|
import useMemo from '../_util/hooks/useMemo';
|
||||||
import { EventDataNode } from '../tree';
|
import type { EventDataNode } from '../tree';
|
||||||
import KeyCode from '../_util/KeyCode';
|
import KeyCode from '../_util/KeyCode';
|
||||||
import Tree from '../vc-tree/Tree';
|
import Tree from '../vc-tree/Tree';
|
||||||
import { TreeProps } from '../vc-tree/props';
|
import type { TreeProps } from '../vc-tree/props';
|
||||||
|
|
||||||
const HIDDEN_STYLE = {
|
const HIDDEN_STYLE = {
|
||||||
width: 0,
|
width: 0,
|
||||||
|
@ -70,7 +70,7 @@ export default defineComponent({
|
||||||
() => {
|
() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
if (props.open && !props.multiple && valueKeys.value.length) {
|
if (props.open && !props.multiple && valueKeys.value.length) {
|
||||||
treeRef.value?.scrollTo({ key: valueKeys[0] });
|
treeRef.value?.scrollTo({ key: valueKeys.value[0] });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -214,13 +214,13 @@ export default defineComponent({
|
||||||
if (treeLoadedKeys) {
|
if (treeLoadedKeys) {
|
||||||
treeProps.loadedKeys = treeLoadedKeys;
|
treeProps.loadedKeys = treeLoadedKeys;
|
||||||
}
|
}
|
||||||
if (mergedExpandedKeys) {
|
if (mergedExpandedKeys.value) {
|
||||||
treeProps.expandedKeys = mergedExpandedKeys.value;
|
treeProps.expandedKeys = mergedExpandedKeys.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div onMousedown={onListMouseDown} onMouseenter={onMouseenter}>
|
<div onMousedown={onListMouseDown} onMouseenter={onMouseenter}>
|
||||||
{activeEntity && open && (
|
{activeEntity.value && open && (
|
||||||
<span style={HIDDEN_STYLE} aria-live="assertive">
|
<span style={HIDDEN_STYLE} aria-live="assertive">
|
||||||
{activeEntity.value.data.value}
|
{activeEntity.value.data.value}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
|
|
||||||
import { FunctionalComponent } from 'vue';
|
import type { FunctionalComponent } from 'vue';
|
||||||
import type { DataNode, Key } from './interface';
|
import type { DataNode, Key } from './interface';
|
||||||
|
|
||||||
export interface TreeNodeProps extends Omit<DataNode, 'children'> {
|
export interface TreeNodeProps extends Omit<DataNode, 'children'> {
|
||||||
|
|
|
@ -1,17 +1,14 @@
|
||||||
import generateSelector, { GenerateConfig } from '../vc-select/generate';
|
import type { GenerateConfig } from '../vc-select/generate';
|
||||||
|
import generateSelector from '../vc-select/generate';
|
||||||
import TreeNode from './TreeNode';
|
import TreeNode from './TreeNode';
|
||||||
import type {
|
import type {
|
||||||
Key,
|
|
||||||
DefaultValueType,
|
DefaultValueType,
|
||||||
DataNode,
|
DataNode,
|
||||||
LabelValueType,
|
LabelValueType,
|
||||||
SimpleModeConfig,
|
|
||||||
RawValueType,
|
RawValueType,
|
||||||
ChangeEventExtra,
|
ChangeEventExtra,
|
||||||
LegacyDataNode,
|
|
||||||
SelectSource,
|
SelectSource,
|
||||||
FlattenDataNode,
|
FlattenDataNode,
|
||||||
FieldNames,
|
|
||||||
} from './interface';
|
} from './interface';
|
||||||
import {
|
import {
|
||||||
flattenOptions,
|
flattenOptions,
|
||||||
|
@ -32,7 +29,8 @@ import useKeyValueMapping from './hooks/useKeyValueMapping';
|
||||||
import { formatStrategyKeys, SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from './utils/strategyUtil';
|
import { formatStrategyKeys, SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from './utils/strategyUtil';
|
||||||
import { fillAdditionalInfo } from './utils/legacyUtil';
|
import { fillAdditionalInfo } from './utils/legacyUtil';
|
||||||
import useSelectValues from './hooks/useSelectValues';
|
import useSelectValues from './hooks/useSelectValues';
|
||||||
import { treeSelectProps, TreeSelectProps } from './props';
|
import type { TreeSelectProps } from './props';
|
||||||
|
import { treeSelectProps } from './props';
|
||||||
import { getLabeledValue } from '../vc-select/utils/valueUtil';
|
import { getLabeledValue } from '../vc-select/utils/valueUtil';
|
||||||
import omit from '../_util/omit';
|
import omit from '../_util/omit';
|
||||||
import { computed, defineComponent, ref, toRef, watch, watchEffect } from 'vue';
|
import { computed, defineComponent, ref, toRef, watch, watchEffect } from 'vue';
|
||||||
|
@ -94,10 +92,10 @@ export default function generate(config: {
|
||||||
props: treeSelectProps(),
|
props: treeSelectProps(),
|
||||||
slots: [],
|
slots: [],
|
||||||
name: 'TreeSelect',
|
name: 'TreeSelect',
|
||||||
TreeNode: TreeNode,
|
TreeNode,
|
||||||
SHOW_ALL: SHOW_ALL,
|
SHOW_ALL,
|
||||||
SHOW_PARENT: SHOW_PARENT,
|
SHOW_PARENT,
|
||||||
SHOW_CHILD: SHOW_CHILD,
|
SHOW_CHILD,
|
||||||
setup(props, { expose, slots, attrs }) {
|
setup(props, { expose, slots, attrs }) {
|
||||||
const mergedCheckable = computed(() => props.treeCheckable || props.treeCheckStrictly);
|
const mergedCheckable = computed(() => props.treeCheckable || props.treeCheckStrictly);
|
||||||
const mergedMultiple = computed(() => props.multiple || mergedCheckable.value);
|
const mergedMultiple = computed(() => props.multiple || mergedCheckable.value);
|
||||||
|
|
|
@ -3,7 +3,8 @@ import type { FlattenNode } from './interface';
|
||||||
import type { TreeNodeRequiredProps } from './utils/treeUtil';
|
import type { TreeNodeRequiredProps } from './utils/treeUtil';
|
||||||
import { getTreeNodeProps } from './utils/treeUtil';
|
import { getTreeNodeProps } from './utils/treeUtil';
|
||||||
import { useInjectTreeContext } from './contextTypes';
|
import { useInjectTreeContext } from './contextTypes';
|
||||||
import { computed, nextTick, PropType } from 'vue';
|
import type { PropType } from 'vue';
|
||||||
|
import { computed, nextTick } from 'vue';
|
||||||
import { defineComponent, onBeforeUnmount, onMounted, ref, Transition, watch } from 'vue';
|
import { defineComponent, onBeforeUnmount, onMounted, ref, Transition, watch } from 'vue';
|
||||||
import { treeNodeProps } from './props';
|
import { treeNodeProps } from './props';
|
||||||
import { collapseMotion } from '../_util/transition';
|
import { collapseMotion } from '../_util/transition';
|
||||||
|
|
|
@ -642,7 +642,6 @@ export default defineComponent({
|
||||||
eventObj.checkedNodes = [];
|
eventObj.checkedNodes = [];
|
||||||
eventObj.checkedNodesPositions = [];
|
eventObj.checkedNodesPositions = [];
|
||||||
eventObj.halfCheckedKeys = newHalfCheckedKeys;
|
eventObj.halfCheckedKeys = newHalfCheckedKeys;
|
||||||
console.log(eventObj);
|
|
||||||
newCheckedKeys.forEach(checkedKey => {
|
newCheckedKeys.forEach(checkedKey => {
|
||||||
const entity = keyEntities.value[checkedKey];
|
const entity = keyEntities.value[checkedKey];
|
||||||
if (!entity) return;
|
if (!entity) return;
|
||||||
|
@ -1044,7 +1043,7 @@ export default defineComponent({
|
||||||
onNodeDragLeave,
|
onNodeDragLeave,
|
||||||
onNodeDragEnd,
|
onNodeDragEnd,
|
||||||
onNodeDrop,
|
onNodeDrop,
|
||||||
slots: slots,
|
slots,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { computed, defineComponent, onMounted, onUpdated, ref } from 'vue';
|
||||||
import { treeNodeProps } from './props';
|
import { treeNodeProps } from './props';
|
||||||
import classNames from '../_util/classNames';
|
import classNames from '../_util/classNames';
|
||||||
import { warning } from '../vc-util/warning';
|
import { warning } from '../vc-util/warning';
|
||||||
import { DragNodeEvent } from './interface';
|
import type { DragNodeEvent } from './interface';
|
||||||
|
|
||||||
const ICON_OPEN = 'open';
|
const ICON_OPEN = 'open';
|
||||||
const ICON_CLOSE = 'close';
|
const ICON_CLOSE = 'close';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import type { ComputedRef, CSSProperties, Ref, VNode } from 'vue';
|
import type { ComputedRef, CSSProperties, Ref, VNode } from 'vue';
|
||||||
import { TreeNodeProps } from './props';
|
import type { TreeNodeProps } from './props';
|
||||||
export type { ScrollTo } from '../vc-virtual-list/List';
|
export type { ScrollTo } from '../vc-virtual-list/List';
|
||||||
|
|
||||||
export interface DataNode {
|
export interface DataNode {
|
||||||
|
|
Loading…
Reference in New Issue