fix: ts error
parent
8e5431886a
commit
c36b69d7bd
|
@ -27,7 +27,14 @@ import { toArray } from './utils/typeUtil';
|
||||||
import { warning } from '../vc-util/warning';
|
import { warning } from '../vc-util/warning';
|
||||||
import find from 'lodash-es/find';
|
import find from 'lodash-es/find';
|
||||||
import { tuple } from '../_util/type';
|
import { tuple } from '../_util/type';
|
||||||
import type { InternalNamePath, Rule, RuleError, RuleObject, ValidateOptions } from './interface';
|
import type {
|
||||||
|
FormLabelAlign,
|
||||||
|
InternalNamePath,
|
||||||
|
Rule,
|
||||||
|
RuleError,
|
||||||
|
RuleObject,
|
||||||
|
ValidateOptions,
|
||||||
|
} from './interface';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import { useInjectForm } from './context';
|
import { useInjectForm } from './context';
|
||||||
import FormItemLabel from './FormItemLabel';
|
import FormItemLabel from './FormItemLabel';
|
||||||
|
@ -90,7 +97,7 @@ export const formItemProps = () => ({
|
||||||
wrapperCol: { type: Object as PropType<ColProps & HTMLAttributes> },
|
wrapperCol: { type: Object as PropType<ColProps & HTMLAttributes> },
|
||||||
hasFeedback: { type: Boolean, default: false },
|
hasFeedback: { type: Boolean, default: false },
|
||||||
colon: { type: Boolean, default: undefined },
|
colon: { type: Boolean, default: undefined },
|
||||||
labelAlign: PropTypes.oneOf(tuple('left', 'right')),
|
labelAlign: String as PropType<FormLabelAlign>,
|
||||||
prop: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
|
prop: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
|
||||||
name: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
|
name: { type: [String, Number, Array] as PropType<string | number | Array<string | number>> },
|
||||||
rules: [Array, Object] as PropType<Rule[] | Rule>,
|
rules: [Array, Object] as PropType<Rule[] | Rule>,
|
||||||
|
|
|
@ -2,13 +2,13 @@ import type { App, PropType, ExtractPropTypes } from 'vue';
|
||||||
import { watch, ref, defineComponent } from 'vue';
|
import { watch, ref, defineComponent } from 'vue';
|
||||||
import classNames from '../_util/classNames';
|
import classNames from '../_util/classNames';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import VcMentions, { Option } from '../vc-mentions';
|
import VcMentions from '../vc-mentions';
|
||||||
import { mentionsProps as baseMentionsProps } from '../vc-mentions/src/mentionsProps';
|
import { mentionsProps as baseMentionsProps } from '../vc-mentions/src/mentionsProps';
|
||||||
import useConfigInject from '../_util/hooks/useConfigInject';
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import { flattenChildren, getOptionProps } from '../_util/props-util';
|
import { flattenChildren, getOptionProps } from '../_util/props-util';
|
||||||
import { useInjectFormItemContext } from '../form/FormItemContext';
|
import { useInjectFormItemContext } from '../form/FormItemContext';
|
||||||
import omit from '../_util/omit';
|
import omit from '../_util/omit';
|
||||||
import { optionProps } from '../vc-mentions/src/Option';
|
import { optionProps, optionOptions } from '../vc-mentions/src/Option';
|
||||||
import type { KeyboardEventHandler } from '../_util/EventInterface';
|
import type { KeyboardEventHandler } from '../_util/EventInterface';
|
||||||
|
|
||||||
interface MentionsConfig {
|
interface MentionsConfig {
|
||||||
|
@ -206,7 +206,7 @@ const Mentions = defineComponent({
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
export const MentionsOption = defineComponent({
|
export const MentionsOption = defineComponent({
|
||||||
compatConfig: { MODE: 3 },
|
compatConfig: { MODE: 3 },
|
||||||
...Option,
|
...optionOptions,
|
||||||
name: 'AMentionsOption',
|
name: 'AMentionsOption',
|
||||||
props: optionProps,
|
props: optionProps,
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,7 +2,6 @@ import Table, { tableProps } from './Table';
|
||||||
import Column from './Column';
|
import Column from './Column';
|
||||||
import ColumnGroup from './ColumnGroup';
|
import ColumnGroup from './ColumnGroup';
|
||||||
import type { TableProps, TablePaginationConfig } from './Table';
|
import type { TableProps, TablePaginationConfig } from './Table';
|
||||||
import { defineComponent } from 'vue';
|
|
||||||
import type { App } from 'vue';
|
import type { App } from 'vue';
|
||||||
import { EXPAND_COLUMN, Summary, SummaryCell, SummaryRow } from '../vc-table';
|
import { EXPAND_COLUMN, Summary, SummaryCell, SummaryRow } from '../vc-table';
|
||||||
import {
|
import {
|
||||||
|
@ -16,8 +15,8 @@ export type { ColumnProps } from './Column';
|
||||||
export type { ColumnsType, ColumnType, ColumnGroupType } from './interface';
|
export type { ColumnsType, ColumnType, ColumnGroupType } from './interface';
|
||||||
export type { TableProps, TablePaginationConfig };
|
export type { TableProps, TablePaginationConfig };
|
||||||
|
|
||||||
const TableSummaryRow = defineComponent({ ...SummaryRow, name: 'ATableSummaryRow' });
|
const TableSummaryRow = SummaryRow;
|
||||||
const TableSummaryCell = defineComponent({ ...SummaryCell, name: 'ATableSummaryCell' });
|
const TableSummaryCell = SummaryCell;
|
||||||
|
|
||||||
const TableSummary = Object.assign(Summary, {
|
const TableSummary = Object.assign(Summary, {
|
||||||
Cell: TableSummaryCell,
|
Cell: TableSummaryCell,
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
import type { App } from 'vue';
|
import type { App } from 'vue';
|
||||||
import { defineComponent } from 'vue';
|
|
||||||
import Tree from './Tree';
|
import Tree from './Tree';
|
||||||
import { TreeNode as VcTreeNode } from '../vc-tree';
|
import { TreeNode as VcTreeNode } from '../vc-tree';
|
||||||
import DirectoryTree from './DirectoryTree';
|
import DirectoryTree from './DirectoryTree';
|
||||||
import { treeNodeProps } from '../vc-tree/props';
|
|
||||||
|
|
||||||
export type { EventDataNode, DataNode } from '../vc-tree/interface';
|
export type { EventDataNode, DataNode } from '../vc-tree/interface';
|
||||||
|
|
||||||
|
@ -26,7 +24,7 @@ export type {
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
|
|
||||||
const TreeNode = defineComponent({ ...VcTreeNode, name: 'ATreeNode', props: treeNodeProps });
|
const TreeNode = VcTreeNode;
|
||||||
|
|
||||||
export { DirectoryTree, TreeNode };
|
export { DirectoryTree, TreeNode };
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,10 @@ export const listItemProps = () => {
|
||||||
onPreview: Function as PropType<(file: UploadFile, e: Event) => void>,
|
onPreview: Function as PropType<(file: UploadFile, e: Event) => void>,
|
||||||
onClose: Function as PropType<(file: UploadFile) => void>,
|
onClose: Function as PropType<(file: UploadFile) => void>,
|
||||||
onDownload: Function as PropType<(file: UploadFile) => void>,
|
onDownload: Function as PropType<(file: UploadFile) => void>,
|
||||||
progress: Object as PropType<UploadListProgressProps>,
|
progress: {
|
||||||
|
type: Object as PropType<UploadListProgressProps>,
|
||||||
|
default: undefined as UploadListProgressProps,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -8,12 +8,14 @@ export const optionProps = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export type OptionProps = Partial<ExtractPropTypes<typeof optionProps>>;
|
export type OptionProps = Partial<ExtractPropTypes<typeof optionProps>>;
|
||||||
|
export const optionOptions = {
|
||||||
export default defineComponent({
|
|
||||||
compatConfig: { MODE: 3 },
|
|
||||||
name: 'Option',
|
name: 'Option',
|
||||||
props: optionProps,
|
props: optionProps,
|
||||||
render(_props: any, { slots }: any) {
|
render(_props: any, { slots }: any) {
|
||||||
return slots.default?.();
|
return slots.default?.();
|
||||||
},
|
},
|
||||||
|
};
|
||||||
|
export default defineComponent({
|
||||||
|
compatConfig: { MODE: 3 },
|
||||||
|
...optionOptions,
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,7 +13,7 @@ export interface SummaryCellProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default defineComponent<SummaryCellProps>({
|
export default defineComponent<SummaryCellProps>({
|
||||||
name: 'SummaryCell',
|
name: 'ATableSummaryCell',
|
||||||
props: ['index', 'colSpan', 'rowSpan', 'align'] as any,
|
props: ['index', 'colSpan', 'rowSpan', 'align'] as any,
|
||||||
setup(props, { attrs, slots }) {
|
setup(props, { attrs, slots }) {
|
||||||
const tableContext = useInjectTable();
|
const tableContext = useInjectTable();
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { defineComponent } from 'vue';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
compatConfig: { MODE: 3 },
|
compatConfig: { MODE: 3 },
|
||||||
name: 'FooterRow',
|
name: 'ATableSummaryRow',
|
||||||
setup(_props, { slots }) {
|
setup(_props, { slots }) {
|
||||||
return () => <tr>{slots.default?.()}</tr>;
|
return () => <tr>{slots.default?.()}</tr>;
|
||||||
},
|
},
|
||||||
|
|
|
@ -25,7 +25,7 @@ const defaultTitle = '---';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
compatConfig: { MODE: 3 },
|
compatConfig: { MODE: 3 },
|
||||||
name: 'TreeNode',
|
name: 'ATreeNode',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: treeNodeProps,
|
props: treeNodeProps,
|
||||||
isTreeNode: 1,
|
isTreeNode: 1,
|
||||||
|
@ -293,7 +293,7 @@ export default defineComponent({
|
||||||
// ==================== Render: Drag Handler ====================
|
// ==================== Render: Drag Handler ====================
|
||||||
const renderDragHandler = () => {
|
const renderDragHandler = () => {
|
||||||
const { draggable, prefixCls } = context.value;
|
const { draggable, prefixCls } = context.value;
|
||||||
return draggable?.icon ? (
|
return draggable && draggable?.icon ? (
|
||||||
<span class={`${prefixCls}-draggable-icon`}>{draggable.icon}</span>
|
<span class={`${prefixCls}-draggable-icon`}>{draggable.icon}</span>
|
||||||
) : null;
|
) : null;
|
||||||
};
|
};
|
||||||
|
|
|
@ -40,7 +40,7 @@ export interface TreeContextProps {
|
||||||
showIcon: boolean;
|
showIcon: boolean;
|
||||||
icon: IconType;
|
icon: IconType;
|
||||||
switcherIcon: IconType;
|
switcherIcon: IconType;
|
||||||
draggable: DraggableConfig;
|
draggable: DraggableConfig | false;
|
||||||
draggingNodeKey?: Key;
|
draggingNodeKey?: Key;
|
||||||
checkable: boolean;
|
checkable: boolean;
|
||||||
customCheckable: () => any;
|
customCheckable: () => any;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
export function isZhCN(name) {
|
export function isZhCN(name) {
|
||||||
return /-cn\/?$/.test(name);
|
return /-cn\/?$/.test(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isLocalStorageNameSupported() {
|
export function isLocalStorageNameSupported() {
|
||||||
const testKey = 'test';
|
const testKey = 'test';
|
||||||
const storage = window.localStorage;
|
const storage = window.localStorage;
|
||||||
|
@ -13,7 +12,6 @@ export function isLocalStorageNameSupported() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getLocalizedPathname(path, zhCN, query = {}, hash) {
|
export function getLocalizedPathname(path, zhCN, query = {}, hash) {
|
||||||
const pathname = path.startsWith('/') ? path : `/${path}`;
|
const pathname = path.startsWith('/') ? path : `/${path}`;
|
||||||
let fullPath;
|
let fullPath;
|
||||||
|
@ -27,7 +25,6 @@ export function getLocalizedPathname(path, zhCN, query = {}, hash) {
|
||||||
} else {
|
} else {
|
||||||
fullPath = `${pathname}-cn`;
|
fullPath = `${pathname}-cn`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hash) {
|
if (hash) {
|
||||||
const localHash = hash[zhCN ? 'zhCN' : 'enUS'];
|
const localHash = hash[zhCN ? 'zhCN' : 'enUS'];
|
||||||
fullPath += `#${localHash}`;
|
fullPath += `#${localHash}`;
|
||||||
|
|
Loading…
Reference in New Issue