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