reykit 1.0.188 → 1.0.189

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- export type FieldOption<Row extends Record<string, any>> = {
2
+ export type TableFieldOption<Row extends Record<string, any>> = {
3
3
  key: string;
4
4
  name: string;
5
5
  isHide?: boolean;
@@ -8,20 +8,20 @@ export type FieldOption<Row extends Record<string, any>> = {
8
8
  sortMethod?: (a: Row, b: Row) => number;
9
9
  defaultValue?: any;
10
10
  }[];
11
- export type SearchOption<Row extends Record<string, any>> = {
11
+ export type TableSearchOption<Row extends Record<string, any>> = {
12
12
  method: (value: string, row: Row) => boolean;
13
13
  placeholder?: string;
14
14
  };
15
- export type ButtonOption = {
15
+ export type TableButtonOption = {
16
16
  name: ReactNode;
17
17
  method: () => void;
18
18
  }[];
19
- export type OptionName = ReactNode;
19
+ export type TableOptionName = ReactNode;
20
20
  export type RowOptionItem<Row extends Record<string, any>> = {
21
21
  name: ReactNode;
22
22
  fn: ((row: Row) => void) | null;
23
23
  };
24
- export type RowOption<Row extends Record<string, any>> = {
24
+ export type TableRowOption<Row extends Record<string, any>> = {
25
25
  options?: RowOptionItem<Row>[];
26
26
  destructiveOptions?: RowOptionItem<Row>[];
27
27
  } | ((row: Row) => {
@@ -32,7 +32,7 @@ export type SelectRowsOptionItem<Row extends Record<string, any>> = {
32
32
  name: ReactNode;
33
33
  fn: ((selectRows: Row[]) => void) | null;
34
34
  };
35
- export type SelectRowsOption<Row extends Record<string, any>> = {
35
+ export type TableSelectRowsOption<Row extends Record<string, any>> = {
36
36
  options?: SelectRowsOptionItem<Row>[];
37
37
  destructiveOptions?: SelectRowsOptionItem<Row>[];
38
38
  } | ((selectRows: Row[]) => {
@@ -56,11 +56,11 @@ export type SelectRowsOption<Row extends Record<string, any>> = {
56
56
  export declare function Table<Row extends Record<string, any>>({ data, setData, fieldOption, searchOption, buttonOption, rowOption, selectRowsOption, pageSize, mobilePageSize, language }: {
57
57
  data: Row[];
58
58
  setData: (value: Row[] | ((value: Row[]) => Row[])) => void;
59
- fieldOption?: FieldOption<Row>;
60
- searchOption?: SearchOption<Row>;
61
- buttonOption?: ButtonOption;
62
- rowOption?: RowOption<Row>;
63
- selectRowsOption?: SelectRowsOption<Row>;
59
+ fieldOption?: TableFieldOption<Row>;
60
+ searchOption?: TableSearchOption<Row>;
61
+ buttonOption?: TableButtonOption;
62
+ rowOption?: TableRowOption<Row>;
63
+ selectRowsOption?: TableSelectRowsOption<Row>;
64
64
  pageSize?: number;
65
65
  mobilePageSize?: number;
66
66
  language?: 'en' | 'zh';
@@ -12,6 +12,6 @@ export { CycleButton } from './Button';
12
12
  export { Form } from './Form';
13
13
  export { Loading, useLoading } from './Loading';
14
14
  export { Notice, notice } from './Notice';
15
- export { type FieldOption, type SearchOption, type ButtonOption, type OptionName, type RowOption, type SelectRowsOption, Table } from './Table';
15
+ export { type TableFieldOption, type TableSearchOption, type TableButtonOption, type TableOptionName, type TableRowOption, type TableSelectRowsOption, Table } from './Table';
16
16
  export { IconText } from './Text';
17
17
  export { IconToggle } from './Toggle';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reykit",
3
- "version": "1.0.188",
3
+ "version": "1.0.189",
4
4
  "description": "Kit method set.",
5
5
  "author": "reyxbo",
6
6
  "keywords": [