diff --git a/bun.lockb b/bun.lockb index 1d32bff..a00a2af 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/docs/style.css b/docs/style.css index 8f6b3c9..e69de29 100644 --- a/docs/style.css +++ b/docs/style.css @@ -1,43 +0,0 @@ -.rspress-doc-container > div > div { - width: 100% !important; -} - -.rspress-doc { - width: 100% !important; - max-width: unset !important; - padding: 0 !important; -} - -.rspress-preview-code-show { - margin-top: -24px !important; -} -.rspress-doc div[class^=language-] { - border: 1px dashed var(--rp-code-block-bg) !important; - border-radius: 0 !important; - border-top: 0 !important; -} - -// to fix FormButtonGroup sticky -.rspress-preview-card > div { - overflow: unset !important; -} - -.rspress-preview-card { - padding: 12px !important; - border-radius: 0px !important; - border-color: var(--rp-code-block-bg) !important; - flex-direction: column; -} - -.rspress-preview-operations.web { - justify-content: flex-end !important; - align-items: flex-end !important; -} - -button, html [type="button"], [type="reset"], [type="submit"] { - -webkit-appearance: button; -} - -img { - display: inline-block; -} diff --git a/src/dict/colors.ts b/src/dict/colors.ts index 365d116..e7f2bd5 100644 --- a/src/dict/colors.ts +++ b/src/dict/colors.ts @@ -1,5 +1,3 @@ -import type { BadgeProps } from "../adaptor/index"; - export type PickArrayItem = T extends (infer P)[] ? P : unknown; const statusColors = { diff --git a/src/dict/helper.ts b/src/dict/helper.ts index 8aded9f..ba8440c 100644 --- a/src/dict/helper.ts +++ b/src/dict/helper.ts @@ -80,7 +80,6 @@ export const registerDictLoader = ( return loaderFactory().then((list) => { const mydict = listToDict(list); memo[name] = mydict; - console.log("πŸš€ ~ returnloaderFactory ~ memo[name:", name, memo[name]); return memo[name]; }); }; diff --git a/src/linkage/index.tsx b/src/linkage/index.tsx index a86745b..2d29149 100644 --- a/src/linkage/index.tsx +++ b/src/linkage/index.tsx @@ -155,7 +155,6 @@ export const Linkage = observer( loadData([]) .then((options) => { state.options = options; - console.log("πŸš€ ~ .then ~ options:", options); const values = value.map((x) => x); state.loading = true; return all diff --git a/src/long-text/index.tsx b/src/long-text/index.tsx index 05051eb..7a99b52 100644 --- a/src/long-text/index.tsx +++ b/src/long-text/index.tsx @@ -12,7 +12,7 @@ export const LongText: React.FC< return ( ["expandable"] & {}; @@ -9,8 +9,8 @@ function expandedSchameRowRender(record: any, index: number) { } export interface ITableExpandableContext { - expandedRowKeys: React.Key[]; - setExpandedRowKeys: React.Dispatch>; + expandedRowKeys: RowKey[]; + setExpandedRowKeys: React.Dispatch>; } export const TableExpandableContext = createContext({ @@ -21,13 +21,13 @@ export const TableExpandableContext = createContext({ export const useExpandable = ( props: IExpandableProps | undefined, dataSlice: any[], - rowKeyRef: React.MutableRefObject, + rowKeyRef: React.MutableRefObject, pageNo?: number, ) => { const [keys, setKeys] = useState([ ...(props?.expandedRowKeys ?? []), ...(props?.defaultExpandedRowKeys ?? []), - ]); + ] as RowKey[]); const inited = useRef(false); const expandAll = () => { diff --git a/src/pro-array-table/features/pagination.tsx b/src/pro-array-table/features/pagination.tsx index e79acbf..7ca734f 100644 --- a/src/pro-array-table/features/pagination.tsx +++ b/src/pro-array-table/features/pagination.tsx @@ -75,7 +75,6 @@ export const usePagination = ( }, } as IPaginationProps) : null; - console.log("πŸš€ ~ usePagination props:", props); return [ctx, merged] as const; }; diff --git a/src/pro-array-table/features/row-selection.tsx b/src/pro-array-table/features/row-selection.tsx index 7f2df5e..314a16d 100644 --- a/src/pro-array-table/features/row-selection.tsx +++ b/src/pro-array-table/features/row-selection.tsx @@ -1,5 +1,5 @@ import React, { createContext, useEffect, useState } from "react"; -import { ProArrayTableProps } from "../types"; +import { ProArrayTableProps, RowKey } from "../types"; export type IRowSelectionProps = ProArrayTableProps["rowSelection"]; @@ -9,8 +9,8 @@ export type IRowSelectionOptions = Exclude< >; export interface ITableSelectionContext { - selectedRowKeys: React.Key[]; - setSelectedRowKeys: React.Dispatch>; + selectedRowKeys: RowKey[]; + setSelectedRowKeys: React.Dispatch>; } export const TableRowSelectionContext = createContext({ @@ -23,6 +23,7 @@ export const useRowSelection = ( pageNo?: number, ) => { const [keys, setKeys] = useState([ + // @ts-ignore for arco ...(propRowSelection?.defaultSelectedRowKeys ?? []), ...(propRowSelection?.selectedRowKeys ?? []), ]); diff --git a/src/pro-array-table/mixin.tsx b/src/pro-array-table/mixin.tsx index 7582db3..914be0f 100644 --- a/src/pro-array-table/mixin.tsx +++ b/src/pro-array-table/mixin.tsx @@ -18,6 +18,7 @@ export const Addition: ArrayBaseMixins["Addition"] = observer((props) => { const page = useContext(TablePaginationContext); return ( >["onChange"]>; +type TableProps = React.ComponentProps; + +export type TableChangeParams = Parameters< + Required>["onChange"] +>; type RequiredTableProps = Required>; export type ColumnProps = Required>["columns"][0]; export type ColumnType = Required>["columns"]; -export type RowKey = string | ((row: any) => React.Key); +export type RowKeyFn = string | ((row: any) => React.Key); +export type RowKey = React.Key; export type IChangeData = { pagination: TableChangeParams[0]; diff --git a/src/query-list/index.tsx b/src/query-list/index.tsx index 8d680a1..8e6a80d 100644 --- a/src/query-list/index.tsx +++ b/src/query-list/index.tsx @@ -11,9 +11,7 @@ import React, { useState, } from "react"; import { noop } from "../__builtins__"; -import type { TableProps } from "../adaptor"; - -type TableChangeParams = Parameters>["onChange"]>; +import { TableChangeParams } from "../pro-array-table/types"; export type IQueryListParams = { pagination?: TableChangeParams[0]; @@ -142,13 +140,6 @@ export const QueryList = React.memo>( s.componentProps.pagination.total = resp.total; }); } - // console.log( - // "πŸš€ ~ .then ~ this.table?.componentProps:", - // this.table?.componentProps, - // ); - // if (this.table?.componentProps?.pagination) { - // this.table.componentProps.pagination.total = resp.total; - // } return resp; }) .catch((e) => { diff --git a/src/suggestion/index.tsx b/src/suggestion/index.tsx index fb10c55..5b64fbd 100644 --- a/src/suggestion/index.tsx +++ b/src/suggestion/index.tsx @@ -88,13 +88,14 @@ export const Suggestion: React.FC<{