From 9f539dfec3611f9aa8aced7d201040f77309904e Mon Sep 17 00:00:00 2001 From: Artea Date: Sat, 4 Jan 2025 18:25:47 +0800 Subject: [PATCH] fix(pagination, collapse): missing type slot and slot props (#6677) * fix(Pagination,Collapse): missing type slot and slot props Signed-off-by: Artea * fix: lint Signed-off-by: Artea * fix: try node22 Signed-off-by: Artea * fix: node22 for test * fix: lint style indent Signed-off-by: Artea --------- Signed-off-by: Artea --- .github/workflows/node.js.yml | 4 ++-- src/collapse/src/Collapse.tsx | 2 ++ src/pagination/src/Pagination.tsx | 3 ++- src/pagination/src/interface.ts | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 97dca1eb766..102a0ec5790 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - node-version: [18, 20] + node-version: [22] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - uses: actions/checkout@v3 @@ -42,7 +42,7 @@ jobs: strategy: matrix: - node-version: [18, 20] + node-version: [22] steps: - uses: actions/checkout@v3 diff --git a/src/collapse/src/Collapse.tsx b/src/collapse/src/Collapse.tsx index d80eb40b1f6..5cd0e04448f 100644 --- a/src/collapse/src/Collapse.tsx +++ b/src/collapse/src/Collapse.tsx @@ -3,6 +3,7 @@ import type { ExtractPublicPropTypes, MaybeArray } from '../../_utils' import type { CollapseArrowSlotProps, CollapseItemHeaderExtraSlotProps, + CollapseItemHeaderSlotProps, HeaderClickInfo, OnItemHeaderClick, OnItemHeaderClickImpl, @@ -88,6 +89,7 @@ export type CollapseProps = ExtractPublicPropTypes export interface CollapseSlots { default?: () => VNode[] arrow?: (props: CollapseArrowSlotProps) => VNode[] + header?: (props: CollapseItemHeaderSlotProps) => VNode[] 'header-extra'?: (props: CollapseItemHeaderExtraSlotProps) => VNode[] } diff --git a/src/pagination/src/Pagination.tsx b/src/pagination/src/Pagination.tsx index b556d49f911..da4fb585f31 100644 --- a/src/pagination/src/Pagination.tsx +++ b/src/pagination/src/Pagination.tsx @@ -6,6 +6,7 @@ import type { Size as SelectSize } from '../../select/src/interface' import type { PaginationTheme } from '../styles' import type { PaginationInfo, + PaginationLabelInfo, PaginationRenderLabel, PaginationSizeOption, RenderGoto, @@ -129,7 +130,7 @@ export type PaginationProps = ExtractPublicPropTypes export interface PaginationSlots { default?: () => VNode[] goto?: () => VNode[] - label?: () => VNode[] + label?: (props: PaginationLabelInfo) => VNode[] next?: (props: PaginationInfo) => VNode prev?: (props: PaginationInfo) => VNode prefix?: (props: PaginationInfo) => VNode diff --git a/src/pagination/src/interface.ts b/src/pagination/src/interface.ts index d711e4bfe85..69d128b6acd 100644 --- a/src/pagination/src/interface.ts +++ b/src/pagination/src/interface.ts @@ -33,3 +33,5 @@ export type PaginationRenderLabel = ( active: boolean } ) => VNodeChild + +export type PaginationLabelInfo = Parameters[0]