Skip to content

fix: test case error #6225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/_util/warning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type Warning = (valid: boolean, component: string, message?: string) => void;
let warning: Warning = noop;
if (process.env.NODE_ENV !== 'production') {
warning = (valid, component, message) => {
vcWarning(valid, `[antd: ${component}] ${message}`);
vcWarning(valid, `[antdv: ${component}] ${message}`);

// StrictMode will inject console which will not throw warning in React 17.
if (process.env.NODE_ENV === 'test') {
Expand Down
2 changes: 1 addition & 1 deletion components/anchor/Anchor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default defineComponent({
const activeLink = ref(null);
const getContainer = computed(() => {
const { getContainer } = props;
return getContainer || getTargetContainer.value || getDefaultContainer;
return getContainer || getTargetContainer?.value || getDefaultContainer;
});
// func...
const getCurrentAnchor = (offsetTop = 0, bounds = 5) => {
Expand Down
14 changes: 7 additions & 7 deletions components/config-provider/hooks/useConfigInject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export default (name: string, props: Record<any, any>) => {
renderEmpty: () => null,
});
const prefixCls = computed(() => configProvider.getPrefixCls(name, props.prefixCls));
const direction = computed(() => props.direction ?? configProvider.direction.value);
const direction = computed(() => props.direction ?? configProvider.direction?.value);
const iconPrefixCls = computed(() => props.iconPrefixCls ?? configProvider.iconPrefixCls.value);
const rootPrefixCls = computed(() => configProvider.getPrefixCls());
const autoInsertSpaceInButton = computed(() => configProvider.autoInsertSpaceInButton.value);
const autoInsertSpaceInButton = computed(() => configProvider.autoInsertSpaceInButton?.value);
const renderEmpty = configProvider.renderEmpty;
const space = configProvider.space;
const pageHeader = configProvider.pageHeader;
Expand All @@ -18,19 +18,19 @@ export default (name: string, props: Record<any, any>) => {
const getPopupContainer = configProvider.getPopupContainer;

const dropdownMatchSelectWidth = computed<boolean | number>(
() => props.dropdownMatchSelectWidth ?? configProvider.dropdownMatchSelectWidth.value,
() => props.dropdownMatchSelectWidth ?? configProvider.dropdownMatchSelectWidth?.value,
);
const virtual = computed(
() =>
(props.virtual === undefined
? configProvider.virtual.value !== false
? configProvider.virtual?.value !== false
: props.virtual !== false) && dropdownMatchSelectWidth.value !== false,
);
const size = computed(() => props.size || configProvider.componentSize.value);
const size = computed(() => props.size || configProvider.componentSize?.value);
const autocomplete = computed(
() => props.autocomplete ?? configProvider.input.value?.autocomplete,
() => props.autocomplete ?? configProvider.input?.value?.autocomplete,
);
const disabled = computed(() => props.disabled || configProvider.componentDisabled.value);
const disabled = computed(() => props.disabled || configProvider.componentDisabled?.value);
const csp = computed(() => props.csp ?? configProvider.csp);
return {
configProvider,
Expand Down
2 changes: 1 addition & 1 deletion components/divider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const Divider = defineComponent({
const prefixCls = prefixClsRef.value;
return {
[prefixCls]: true,
[hashId.value]: true,
[hashId.value]: !!hashId.value,
[`${prefixCls}-${type}`]: true,
[`${prefixCls}-dashed`]: !!dashed,
[`${prefixCls}-plain`]: !!plain,
Expand Down
2 changes: 1 addition & 1 deletion components/dropdown/dropdown-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default defineComponent({
disabled,
trigger: disabled ? [] : trigger,
placement,
getPopupContainer: getPopupContainer.value,
getPopupContainer: getPopupContainer?.value,
onVisibleChange: handleVisibleChange,
mouseEnterDelay,
mouseLeaveDelay,
Expand Down
2 changes: 1 addition & 1 deletion components/dropdown/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const Dropdown = defineComponent({
arrow: !!arrow,
alignPoint,
prefixCls: prefixCls.value,
getPopupContainer: getPopupContainer.value,
getPopupContainer: getPopupContainer?.value,
transitionName: transitionName.value,
trigger: triggerActions,
onVisibleChange: handleVisibleChange,
Expand Down
6 changes: 3 additions & 3 deletions components/grid/demo/flex-align.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Child elements vertically aligned.
<template>
<div id="components-grid-demo-flex-align">
<a-divider orientation="left">Align Top</a-divider>
<a-row type="flex" justify="center" align="top">
<a-row justify="center" align="top">
<a-col :span="4">
<p class="height-100">col-4</p>
</a-col>
Expand All @@ -35,7 +35,7 @@ Child elements vertically aligned.
</a-row>

<a-divider orientation="left">Align Middle</a-divider>
<a-row type="flex" justify="space-around" align="middle">
<a-row justify="space-around" align="middle">
<a-col :span="4">
<p class="height-100">col-4</p>
</a-col>
Expand All @@ -51,7 +51,7 @@ Child elements vertically aligned.
</a-row>

<a-divider orientation="left">Align Bottom</a-divider>
<a-row type="flex" justify="space-between" align="bottom">
<a-row justify="space-between" align="bottom">
<a-col :span="4">
<p class="height-100">col-4</p>
</a-col>
Expand Down
4 changes: 2 additions & 2 deletions components/grid/demo/flex-order.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ To change the element sort by `order`.

<template>
<a-divider orientation="left">Normal</a-divider>
<a-row type="flex">
<a-row>
<a-col :span="6" :order="4">1 col-order-4</a-col>
<a-col :span="6" :order="3">2 col-order-3</a-col>
<a-col :span="6" :order="2">3 col-order-2</a-col>
<a-col :span="6" :order="1">4 col-order-1</a-col>
</a-row>
<a-divider orientation="left">Responsive</a-divider>
<a-row type="flex">
<a-row>
<a-col :span="6" :xs="{ order: 1 }" :sm="{ order: 2 }" :md="{ order: 3 }" :lg="{ order: 4 }">
1 col-order-responsive
</a-col>
Expand Down
6 changes: 3 additions & 3 deletions components/grid/demo/flex-stretch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ Col provides `flex` prop to support fill rest.

<template>
<a-divider orientation="left">Percentage columns</a-divider>
<a-row type="flex">
<a-row>
<a-col :flex="2">2 / 5</a-col>
<a-col :flex="3">3 / 5</a-col>
</a-row>
<a-divider orientation="left">Fill rest</a-divider>
<a-row type="flex">
<a-row>
<a-col flex="100px">100px</a-col>
<a-col flex="auto">auto</a-col>
</a-row>
<a-divider orientation="left">Raw flex style</a-divider>
<a-row type="flex">
<a-row>
<a-col flex="1 1 200px">1 1 200px</a-col>
<a-col flex="0 1 300px">0 1 300px</a-col>
</a-row>
Expand Down
2 changes: 1 addition & 1 deletion components/modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export default defineComponent({
{...attrs}
rootClassName={hashId.value}
class={classNames(hashId.value, attrs.class)}
getContainer={getContainer || getPopupContainer.value}
getContainer={getContainer || getPopupContainer?.value}
prefixCls={prefixCls.value}
wrapClassName={wrapClassNameExtended}
visible={open ?? visible}
Expand Down
2 changes: 1 addition & 1 deletion components/slider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const Slider = defineComponent({
transitionName={`${rootPrefixCls.value}-zoom-down`}
key={index}
overlayClassName={`${prefixCls.value}-tooltip`}
getPopupContainer={getTooltipPopupContainer || getPopupContainer.value}
getPopupContainer={getTooltipPopupContainer || getPopupContainer?.value}
>
<VcHandle
{...restProps}
Expand Down
2 changes: 1 addition & 1 deletion components/space/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Space = defineComponent({
setup(props, { slots }) {
const { prefixCls, space, direction: directionConfig } = useConfigInject('space', props);
const supportFlexGap = useFlexGapSupport();
const size = computed(() => props.size ?? space.value?.size ?? 'small');
const size = computed(() => props.size ?? space?.value?.size ?? 'small');
const horizontalSize = ref<number>();
const verticalSize = ref<number>();
watch(
Expand Down
8 changes: 6 additions & 2 deletions components/tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ export default defineComponent({
return tooltip.value.getPopupDomNode();
};

expose({ getPopupDomNode, open, forcePopupAlign: () => tooltip.value?.forcePopupAlign() });
expose({
getPopupDomNode,
open: innerOpen,
forcePopupAlign: () => tooltip.value?.forcePopupAlign(),
});

const tooltipPlacements = computed(() => {
const { builtinPlacements, arrowPointAtCenter, autoAdjustOverflow } = props;
Expand Down Expand Up @@ -272,7 +276,7 @@ export default defineComponent({
...attrs,
...(props as TooltipProps),
prefixCls: prefixCls.value,
getPopupContainer: getPopupContainer.value,
getPopupContainer: getPopupContainer?.value,
builtinPlacements: tooltipPlacements.value,
visible: tempVisible,
ref: tooltip,
Expand Down