diff --git a/components/_util/hooks/_vueuse/_configurable.ts b/components/_util/hooks/_vueuse/_configurable.ts index 1d1e001d4b..a32d339399 100644 --- a/components/_util/hooks/_vueuse/_configurable.ts +++ b/components/_util/hooks/_vueuse/_configurable.ts @@ -28,7 +28,7 @@ export interface ConfigurableLocation { location?: Location; } -export const defaultWindow = /* #__PURE__ */ isClient ? window : undefined; -export const defaultDocument = /* #__PURE__ */ isClient ? window.document : undefined; -export const defaultNavigator = /* #__PURE__ */ isClient ? window.navigator : undefined; -export const defaultLocation = /* #__PURE__ */ isClient ? window.location : undefined; +export const defaultWindow = isClient ? window : undefined; +export const defaultDocument = isClient ? window.document : undefined; +export const defaultNavigator = isClient ? window.navigator : undefined; +export const defaultLocation = isClient ? window.location : undefined; diff --git a/components/_util/hooks/_vueuse/is.ts b/components/_util/hooks/_vueuse/is.ts index 52b4e9a30d..2fd86bd478 100644 --- a/components/_util/hooks/_vueuse/is.ts +++ b/components/_util/hooks/_vueuse/is.ts @@ -21,7 +21,7 @@ export const rand = (min: number, max: number) => { return Math.floor(Math.random() * (max - min + 1)) + min; }; export const isIOS = - /* #__PURE__ */ isClient && + isClient && window?.navigator?.userAgent && /iP(ad|hone|od)/.test(window.navigator.userAgent); export const hasOwn = (val: T, key: K): key is K => diff --git a/components/_util/vnode.ts b/components/_util/vnode.ts index 505bb638d2..1f8265c2d9 100644 --- a/components/_util/vnode.ts +++ b/components/_util/vnode.ts @@ -1,6 +1,6 @@ import { filterEmpty } from './props-util'; import type { VNode, VNodeProps } from 'vue'; -import { cloneVNode } from 'vue'; +import { cloneVNode, isVNode } from 'vue'; import warning from './warning'; import type { RefObject } from './createRef'; type NodeProps = Record & @@ -40,6 +40,10 @@ export function deepCloneElement( if (Array.isArray(vnode)) { return vnode.map(item => deepCloneElement(item, nodeProps, override, mergeRef)); } else { + // 需要判断是否为vnode方可进行clone操作 + if (!isVNode(vnode)) { + return vnode; + } const cloned = cloneElement(vnode, nodeProps, override, mergeRef); if (Array.isArray(cloned.children)) { cloned.children = deepCloneElement(cloned.children as VNode[]); diff --git a/components/checkbox/Checkbox.tsx b/components/checkbox/Checkbox.tsx index 3c6f62f181..b0226f28ac 100644 --- a/components/checkbox/Checkbox.tsx +++ b/components/checkbox/Checkbox.tsx @@ -46,6 +46,7 @@ export default defineComponent({ const targetChecked = event.target.checked; emit('update:checked', targetChecked); emit('change', event); + formItemContext.onFieldChange(); }; const checkboxRef = ref(); const focus = () => { diff --git a/components/empty/index.tsx b/components/empty/index.tsx index 89a1e8f65d..d0ce00b30c 100644 --- a/components/empty/index.tsx +++ b/components/empty/index.tsx @@ -36,7 +36,7 @@ const Empty: EmptyType = (props, { slots = {}, attrs }) => { const prefixCls = prefixClsRef.value; const { - image = defaultEmptyImg, + image = slots.image?.() || defaultEmptyImg, description = slots.description?.() || undefined, imageStyle, class: className = '', diff --git a/components/form/FormItem.tsx b/components/form/FormItem.tsx index 28d983454f..f914cd7b2a 100644 --- a/components/form/FormItem.tsx +++ b/components/form/FormItem.tsx @@ -308,7 +308,7 @@ export default defineComponent({ const value = fieldValue.value; const prop = getPropByPath(model, namePath.value, true); if (Array.isArray(value)) { - prop.o[prop.k] = [].concat(initialValue.value); + prop.o[prop.k] = [].concat(initialValue.value ?? []); } else { prop.o[prop.k] = initialValue.value; } diff --git a/components/select/index.tsx b/components/select/index.tsx index a997322f1b..f4ee557f96 100644 --- a/components/select/index.tsx +++ b/components/select/index.tsx @@ -36,10 +36,10 @@ export const selectProps = () => ({ 'backfill', ]), value: { - type: [Array, Object, String, Number] as PropType, + type: [Array, Object, String, Number, Boolean] as PropType, }, defaultValue: { - type: [Array, Object, String, Number] as PropType, + type: [Array, Object, String, Number, Boolean] as PropType, }, notFoundContent: PropTypes.any, suffixIcon: PropTypes.any, diff --git a/components/tabs/src/TabNavList/OperationNode.tsx b/components/tabs/src/TabNavList/OperationNode.tsx index b23b4d4b84..984d075ef4 100644 --- a/components/tabs/src/TabNavList/OperationNode.tsx +++ b/components/tabs/src/TabNavList/OperationNode.tsx @@ -14,7 +14,7 @@ import EllipsisOutlined from '@ant-design/icons-vue/EllipsisOutlined'; export const operationNodeProps = { prefixCls: { type: String }, id: { type: String }, - tabs: { type: Object as PropType<(Tab & { closeIcon?: () => any })[]> }, + tabs: { type: Array as PropType<(Tab & { closeIcon?: () => any })[]> }, rtl: { type: Boolean }, tabBarGutter: { type: Number }, activeKey: { type: [String, Number] }, @@ -121,6 +121,15 @@ export default defineComponent({ } }); + watch( + () => props.tabs.length, + val => { + if (!val) { + setOpen(false); + } + }, + ); + return () => { const { prefixCls, @@ -135,6 +144,7 @@ export default defineComponent({ rtl, onTabClick, } = props; + if (!tabs.length) return null; const dropdownPrefix = `${prefixCls}-dropdown`; const dropdownAriaLabel = locale?.dropdownAriaLabel; diff --git a/components/transfer/style/index.less b/components/transfer/style/index.less index e7005bb062..79634a29f6 100644 --- a/components/transfer/style/index.less +++ b/components/transfer/style/index.less @@ -189,6 +189,15 @@ &-footer { border-top: @border-width-base @border-style-base @border-color-split; } + + &-checkbox { + line-height: 1; + align-items: center; + + & > span { + top: 0; + } + } } &-operation { diff --git a/components/vc-trigger/Popup/PopupInner.tsx b/components/vc-trigger/Popup/PopupInner.tsx index 71c91291e8..f876f9c442 100644 --- a/components/vc-trigger/Popup/PopupInner.tsx +++ b/components/vc-trigger/Popup/PopupInner.tsx @@ -127,7 +127,10 @@ export default defineComponent({ }, }); const alignDisabled = computed(() => { - if ((props.align as any)?.points && (status.value === 'align' || status.value === 'stable')) { + if ( + (props.align as any)?.points && + (status.value === 'align' || status.value === 'motion' || status.value === 'stable') + ) { return false; } return true; diff --git a/package.json b/package.json index a3238eb364..987591e744 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "routes": "node site/scripts/genrateRoutes.js", "tsc": "tsc --noEmit", "vue-tsc": "vue-tsc --noEmit", - "site": "npm run routes && ./node_modules/vite/bin/vite.js build site --base=https://www.antdv.com/", + "site": "npm run routes && ./node_modules/vite/bin/vite.js build site --base=https://3x.antdv.com/", "pub:site": "npm run site && node site/scripts/pushToOSS.js", "prepare": "husky install", "version": "node ./scripts/generate-version", diff --git a/site/scripts/pushToOSS.js b/site/scripts/pushToOSS.js index 3c9b883958..8fbbb46acd 100644 --- a/site/scripts/pushToOSS.js +++ b/site/scripts/pushToOSS.js @@ -8,9 +8,9 @@ const accessKeyId = process.env.ALI_OSS_ACCESSKEY; const accessKeySecret = process.env.ALI_OSS_SECRETKEY; const client = new OSS({ - bucket: 'next-antdv', + bucket: '3x-antdv', cname: 'true', - endpoint: 'next-antdv.oss-cn-beijing.aliyuncs.com', + endpoint: '3x-antdv.oss-cn-beijing.aliyuncs.com', region: 'oss-cn-beijing', accessKeyId, accessKeySecret, diff --git a/site/src/layouts/header/Menu.vue b/site/src/layouts/header/Menu.vue index 0da6422a02..ed36233fa5 100644 --- a/site/src/layouts/header/Menu.vue +++ b/site/src/layouts/header/Menu.vue @@ -12,7 +12,6 @@ :default-value="antdVersion" > {{ antdVersion }} - 4.x (Next) 2.x (Not Recommended) diff --git a/site/src/theme/static/dark.less b/site/src/theme/static/dark.less index 3b560c6951..1697869219 100644 --- a/site/src/theme/static/dark.less +++ b/site/src/theme/static/dark.less @@ -366,4 +366,8 @@ color: rgba(255, 255, 255, 0.65); } } + + .drawer-handle { + background: #1d1d1d; + } } diff --git a/site/src/vueDocs/replace-date.en-US.md b/site/src/vueDocs/replace-date.en-US.md index 1acfda9f3e..a490cbabc1 100644 --- a/site/src/vueDocs/replace-date.en-US.md +++ b/site/src/vueDocs/replace-date.en-US.md @@ -2,7 +2,7 @@ Starting from the V3 version, the momentjs library is replaced by dayjs by default. If you need to use the momentjs or date-fns date library, you can replace it as follows: -### 替换 DatePicker +### replace DatePicker ```js // moment or date-fns