reykit 1.0.240 → 1.0.242

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.
package/dist/index.js CHANGED
@@ -49463,21 +49463,29 @@ function Ck({
49463
49463
  selectRowsOption: v,
49464
49464
  pageSize: y = 20,
49465
49465
  mobilePageSize: C = 10,
49466
- language: T = "en"
49466
+ language: T = "en",
49467
+ defaultFieldOption: R
49467
49468
  }) {
49468
- const R = w0(C, y), [N, A] = co(R), [M, O] = co(1), z = u && u.length !== 0 ? u : Array.from(
49469
- new Set(
49470
- a.flatMap((X) => Object.keys(X))
49471
- )
49472
- ).map((X) => ({
49473
- key: X,
49474
- name: X,
49469
+ const N = w0(C, y), [A, M] = co(N), [O, z] = co(1);
49470
+ R = R || {
49475
49471
  isHide: !1,
49476
49472
  isSort: !1,
49477
- isGroup: !1
49478
- })), [D, U] = co(z), [V, _] = co(""), [H, P] = co({}), I = a.filter((X) => (V === "" || f === void 0 || f.method(V, X)) && Object.entries(X).every(
49473
+ isGroup: !1,
49474
+ isGroupSearch: !1
49475
+ };
49476
+ const [D, U] = co(
49477
+ u && u.length !== 0 ? u : Array.from(
49478
+ new Set(
49479
+ a.flatMap((X) => Object.keys(X))
49480
+ )
49481
+ ).map((X) => ({
49482
+ key: X,
49483
+ name: X,
49484
+ ...R
49485
+ }))
49486
+ ), [V, _] = co(""), [H, P] = co({}), I = a.filter((X) => (V === "" || f === void 0 || f.method(V, X)) && Object.entries(X).every(
49479
49487
  ([ee, te]) => !H[ee] || H[ee].length === 0 ? !0 : Array.isArray(te) ? te.some((F) => H[ee]?.includes(F)) : H[ee]?.includes(te)
49480
- )), K = I.slice((M - 1) * N, M * N), [$, J] = co(v && []);
49488
+ )), K = I.slice((O - 1) * A, O * A), [$, J] = co(v && []);
49481
49489
  return U0(() => {
49482
49490
  (!u || u.length === 0) && a.length > 0 && U(
49483
49491
  Array.from(
@@ -49487,9 +49495,7 @@ function Ck({
49487
49495
  ).map((X) => ({
49488
49496
  key: X,
49489
49497
  name: X,
49490
- isHide: !1,
49491
- isSort: !1,
49492
- isGroup: !1
49498
+ ...R
49493
49499
  }))
49494
49500
  );
49495
49501
  }, [a]), /* @__PURE__ */ x.jsxs("div", { className: "relative flex flex-col gap-4 size-full", children: [
@@ -49497,7 +49503,7 @@ function Ck({
49497
49503
  wk,
49498
49504
  {
49499
49505
  data: a,
49500
- setPage: O,
49506
+ setPage: z,
49501
49507
  fieldOption: D,
49502
49508
  setFieldOption: U,
49503
49509
  searchValue: V,
@@ -49527,10 +49533,10 @@ function Ck({
49527
49533
  Nk,
49528
49534
  {
49529
49535
  total: I.length,
49530
- pageSize: N,
49531
- setPageSize: A,
49532
- page: M,
49533
- setPage: O,
49536
+ pageSize: A,
49537
+ setPageSize: M,
49538
+ page: O,
49539
+ setPage: z,
49534
49540
  selectRows: $,
49535
49541
  language: T
49536
49542
  }
@@ -9,6 +9,13 @@ export type TableFieldOption<Row extends Record<string, any>> = {
9
9
  sortMethod?: (a: Row, b: Row) => number;
10
10
  defaultValue?: any;
11
11
  }[];
12
+ export type DefaultTableFieldOption = {
13
+ isHide?: boolean;
14
+ isSort?: boolean;
15
+ isGroup?: boolean;
16
+ isGroupSearch?: boolean;
17
+ defaultValue?: any;
18
+ };
12
19
  export type TableSearchOption<Row extends Record<string, any>> = {
13
20
  method: (value: string, row: Row) => boolean;
14
21
  placeholder?: string;
@@ -71,7 +78,7 @@ export type TableSelectRowsOption<Row extends Record<string, any>> = {
71
78
  * @param mobilePageSize - Page rows size on mobile devices.
72
79
  * @param language - Language type.
73
80
  */
74
- export declare function Table<Row extends Record<string, any>>({ data, setData, fieldOption, searchOption, buttonOption, rowOption, selectRowsOption, pageSize, mobilePageSize, language }: {
81
+ export declare function Table<Row extends Record<string, any>>({ data, setData, fieldOption, searchOption, buttonOption, rowOption, selectRowsOption, pageSize, mobilePageSize, language, defaultFieldOption, }: {
75
82
  data: Row[];
76
83
  setData: (value: Row[] | ((value: Row[]) => Row[])) => void;
77
84
  fieldOption?: TableFieldOption<Row>;
@@ -82,4 +89,5 @@ export declare function Table<Row extends Record<string, any>>({ data, setData,
82
89
  pageSize?: number;
83
90
  mobilePageSize?: number;
84
91
  language?: 'en' | 'zh';
92
+ defaultFieldOption?: DefaultTableFieldOption;
85
93
  }): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reykit",
3
- "version": "1.0.240",
3
+ "version": "1.0.242",
4
4
  "description": "Kit method set.",
5
5
  "author": "reyxbo",
6
6
  "keywords": [