fix: lint error
parent
dc4f2b2dcb
commit
ce7ca6895b
|
@ -30,7 +30,7 @@ PropTypes.extend([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export function withUndefined(type: any) {
|
export function withUndefined<T extends { default?: any }>(type: T): T {
|
||||||
type.default = undefined;
|
type.default = undefined;
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
|
@ -198,7 +198,6 @@ const Affix = defineComponent({
|
||||||
this.setState(newState);
|
this.setState(newState);
|
||||||
},
|
},
|
||||||
|
|
||||||
// @ts-ignore TS6133
|
|
||||||
prepareMeasure() {
|
prepareMeasure() {
|
||||||
this.setState({
|
this.setState({
|
||||||
status: AffixStatus.Prepare,
|
status: AffixStatus.Prepare,
|
||||||
|
|
|
@ -64,15 +64,15 @@ export interface AntAnchor {
|
||||||
unregisterLink: (link: string) => void;
|
unregisterLink: (link: string) => void;
|
||||||
$data: AnchorState;
|
$data: AnchorState;
|
||||||
scrollTo: (link: string) => void;
|
scrollTo: (link: string) => void;
|
||||||
$emit?: Function
|
$emit?: Function;
|
||||||
}
|
}
|
||||||
interface AnchorState {
|
interface AnchorState {
|
||||||
activeLink: null | string;
|
activeLink: null | string;
|
||||||
scrollContainer: HTMLElement | Window;
|
scrollContainer: HTMLElement | Window;
|
||||||
links: string[];
|
links: string[];
|
||||||
scrollEvent: any;
|
scrollEvent: any;
|
||||||
animating: boolean;
|
animating: boolean;
|
||||||
sPrefixCls?: string;
|
sPrefixCls?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
@ -242,7 +242,9 @@ export default defineComponent({
|
||||||
`${sPrefixCls}-link-title-active`,
|
`${sPrefixCls}-link-title-active`,
|
||||||
)[0];
|
)[0];
|
||||||
if (linkNode) {
|
if (linkNode) {
|
||||||
(this.$refs.inkNode as HTMLElement).style.top = `${linkNode.offsetTop + linkNode.clientHeight / 2 - 4.5}px`;
|
(this.$refs.inkNode as HTMLElement).style.top = `${linkNode.offsetTop +
|
||||||
|
linkNode.clientHeight / 2 -
|
||||||
|
4.5}px`;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -45,7 +45,7 @@ const AutoComplete = defineComponent({
|
||||||
return {
|
return {
|
||||||
configProvider: inject('configProvider', defaultConfigProvider),
|
configProvider: inject('configProvider', defaultConfigProvider),
|
||||||
popupRef: null,
|
popupRef: null,
|
||||||
select: null
|
select: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -86,7 +86,7 @@ const AutoComplete = defineComponent({
|
||||||
|
|
||||||
const getPrefixCls = this.configProvider.getPrefixCls;
|
const getPrefixCls = this.configProvider.getPrefixCls;
|
||||||
const prefixCls = getPrefixCls('select', customizePrefixCls);
|
const prefixCls = getPrefixCls('select', customizePrefixCls);
|
||||||
const { class: className} = this.$attrs as any;
|
const { class: className } = this.$attrs as any;
|
||||||
const cls = {
|
const cls = {
|
||||||
[className]: !!className,
|
[className]: !!className,
|
||||||
[`${prefixCls}-lg`]: size === 'large',
|
[`${prefixCls}-lg`]: size === 'large',
|
||||||
|
|
|
@ -17,8 +17,6 @@ export interface CardTabListType {
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CardType = 'inner';
|
export type CardType = 'inner';
|
||||||
const CardSize = tuple('default', 'small');
|
|
||||||
export type CardSizeType = typeof CardSize[number];
|
|
||||||
|
|
||||||
const { TabPane } = Tabs;
|
const { TabPane } = Tabs;
|
||||||
|
|
||||||
|
@ -35,10 +33,7 @@ const Card = defineComponent({
|
||||||
loading: PropTypes.looseBool.def(false),
|
loading: PropTypes.looseBool.def(false),
|
||||||
hoverable: PropTypes.looseBool.def(false),
|
hoverable: PropTypes.looseBool.def(false),
|
||||||
type: PropTypes.string,
|
type: PropTypes.string,
|
||||||
size: {
|
size: PropTypes.oneOf(tuple('default', 'small')),
|
||||||
type: String as PropType<CardSizeType>,
|
|
||||||
validator: (val: CardSizeType) => CardSize.includes(val),
|
|
||||||
},
|
|
||||||
actions: PropTypes.VNodeChild,
|
actions: PropTypes.VNodeChild,
|
||||||
tabList: {
|
tabList: {
|
||||||
type: Array as PropType<CardTabListType[]>,
|
type: Array as PropType<CardTabListType[]>,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { CSSProperties, VNodeTypes, inject, App, SetupContext, FunctionalComponent } from 'vue';
|
import { CSSProperties, VNodeTypes, inject, App, SetupContext, FunctionalComponent } from 'vue';
|
||||||
import classNames from '../_util/classNames';
|
import classNames from '../_util/classNames';
|
||||||
import { defaultConfigProvider, ConfigConsumerProps } from '../config-provider';
|
import { defaultConfigProvider } from '../config-provider';
|
||||||
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
||||||
import DefaultEmptyImg from './empty';
|
import DefaultEmptyImg from './empty';
|
||||||
import SimpleEmptyImg from './simple';
|
import SimpleEmptyImg from './simple';
|
||||||
|
@ -11,7 +11,7 @@ const defaultEmptyImg = <DefaultEmptyImg />;
|
||||||
const simpleEmptyImg = <SimpleEmptyImg />;
|
const simpleEmptyImg = <SimpleEmptyImg />;
|
||||||
|
|
||||||
export interface TransferLocale {
|
export interface TransferLocale {
|
||||||
description: string;
|
description?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EmptyProps {
|
export interface EmptyProps {
|
||||||
|
@ -31,7 +31,7 @@ interface EmptyType extends FunctionalComponent<EmptyProps> {
|
||||||
}
|
}
|
||||||
|
|
||||||
const Empty: EmptyType = (props: EmptyProps, { slots = {}, attrs }: SetupContext) => {
|
const Empty: EmptyType = (props: EmptyProps, { slots = {}, attrs }: SetupContext) => {
|
||||||
const configProvider = inject<ConfigConsumerProps>('configProvider', defaultConfigProvider);
|
const configProvider = inject('configProvider', defaultConfigProvider);
|
||||||
const { getPrefixCls, direction } = configProvider;
|
const { getPrefixCls, direction } = configProvider;
|
||||||
const {
|
const {
|
||||||
prefixCls: customizePrefixCls,
|
prefixCls: customizePrefixCls,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { inject, defineComponent, VNodeTypes, PropType } from 'vue';
|
import { inject, defineComponent, VNodeTypes, PropType } from 'vue';
|
||||||
|
import PropTypes from '../_util/vue-types';
|
||||||
import defaultLocaleData from './default';
|
import defaultLocaleData from './default';
|
||||||
import { Locale } from '.';
|
import { Locale } from '.';
|
||||||
|
|
||||||
|
@ -12,12 +13,14 @@ interface LocaleInterface {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface LocaleReceiverContext {
|
||||||
|
antLocale?: LocaleInterface;
|
||||||
|
}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'LocaleReceiver',
|
name: 'LocaleReceiver',
|
||||||
props: {
|
props: {
|
||||||
componentName: {
|
componentName: PropTypes.string,
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
defaultLocale: {
|
defaultLocale: {
|
||||||
type: [Object, Function],
|
type: [Object, Function],
|
||||||
},
|
},
|
||||||
|
@ -29,7 +32,7 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
return {
|
return {
|
||||||
localeData: inject('localeData', {}),
|
localeData: inject<LocaleReceiverContext>('localeData', {}),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { provide, App, defineComponent, VNode } from 'vue';
|
import { provide, App, defineComponent, VNode, PropType } from 'vue';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import interopDefault from '../_util/interopDefault';
|
import interopDefault from '../_util/interopDefault';
|
||||||
|
@ -39,7 +39,7 @@ const LocaleProvider = defineComponent({
|
||||||
name: 'ALocaleProvider',
|
name: 'ALocaleProvider',
|
||||||
props: {
|
props: {
|
||||||
locale: {
|
locale: {
|
||||||
type: Object,
|
type: Object as PropType<Locale>,
|
||||||
},
|
},
|
||||||
_ANT_MARK__: PropTypes.string,
|
_ANT_MARK__: PropTypes.string,
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { FunctionalComponent } from 'vue';
|
||||||
|
|
||||||
import { OptionGroupData } from './interface';
|
import { OptionGroupData } from './interface';
|
||||||
|
|
||||||
export interface OptGroupProps extends Omit<OptionGroupData, 'options'> {}
|
export type OptGroupProps = Omit<OptionGroupData, 'options'>;
|
||||||
|
|
||||||
export interface OptionGroupFC extends FunctionalComponent<OptGroupProps> {
|
export interface OptionGroupFC extends FunctionalComponent<OptGroupProps> {
|
||||||
/** Legacy for check if is a Option Group */
|
/** Legacy for check if is a Option Group */
|
||||||
|
|
|
@ -254,7 +254,7 @@ export default function generateSelector<
|
||||||
const mergedId = computed(() => props.id || `rc_select_${getUUID()}`);
|
const mergedId = computed(() => props.id || `rc_select_${getUUID()}`);
|
||||||
|
|
||||||
// optionLabelProp
|
// optionLabelProp
|
||||||
let mergedOptionLabelProp = computed(() => {
|
const mergedOptionLabelProp = computed(() => {
|
||||||
let mergedOptionLabelProp = props.optionLabelProp;
|
let mergedOptionLabelProp = props.optionLabelProp;
|
||||||
if (mergedOptionLabelProp === undefined) {
|
if (mergedOptionLabelProp === undefined) {
|
||||||
mergedOptionLabelProp = props.options ? 'label' : 'children';
|
mergedOptionLabelProp = props.options ? 'label' : 'children';
|
||||||
|
@ -554,7 +554,7 @@ export default function generateSelector<
|
||||||
// ============================== Open ==============================
|
// ============================== Open ==============================
|
||||||
|
|
||||||
const innerOpen = ref(undefined);
|
const innerOpen = ref(undefined);
|
||||||
let mergedOpen = ref(undefined);
|
const mergedOpen = ref(undefined);
|
||||||
const setInnerOpen = (val: boolean) => {
|
const setInnerOpen = (val: boolean) => {
|
||||||
innerOpen.value = val;
|
innerOpen.value = val;
|
||||||
mergedOpen.value = innerOpen.value;
|
mergedOpen.value = innerOpen.value;
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
|
import { defineComponent } from 'vue';
|
||||||
import InkTabBarNode from './InkTabBarNode';
|
import InkTabBarNode from './InkTabBarNode';
|
||||||
import TabBarTabsNode from './TabBarTabsNode';
|
import TabBarTabsNode from './TabBarTabsNode';
|
||||||
import TabBarRootNode from './TabBarRootNode';
|
import TabBarRootNode from './TabBarRootNode';
|
||||||
import ScrollableTabBarNode from './ScrollableTabBarNode';
|
import ScrollableTabBarNode from './ScrollableTabBarNode';
|
||||||
import SaveRef from './SaveRef';
|
import SaveRef from './SaveRef';
|
||||||
|
|
||||||
export default {
|
export default defineComponent({
|
||||||
name: 'ScrollableInkTabBar',
|
name: 'ScrollableInkTabBar',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
render() {
|
render() {
|
||||||
|
@ -22,4 +23,4 @@ export default {
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
};
|
});
|
||||||
|
|
Loading…
Reference in New Issue