reykit 1.0.178 → 1.0.179

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
@@ -49288,8 +49288,8 @@ function sk({
49288
49288
  }[N]
49289
49289
  ] }),
49290
49290
  /* @__PURE__ */ E.jsx(rc, { align: "start", className: "w-auto", children: /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
49291
- (U = typeof b == "function" ? b(C) : b).options && Object.entries(U.options).map(
49292
- ([_, V], H) => /* @__PURE__ */ E.jsx(
49291
+ (U = typeof b == "function" ? b(C) : b).options && U.options.map(
49292
+ ({ name: _, fn: V }, H) => /* @__PURE__ */ E.jsx(
49293
49293
  Kf,
49294
49294
  {
49295
49295
  onClick: () => {
@@ -49302,8 +49302,8 @@ function sk({
49302
49302
  )
49303
49303
  ),
49304
49304
  U.options && U.destructiveOptions && /* @__PURE__ */ E.jsx(JE, {}),
49305
- U.destructiveOptions && Object.entries(U.destructiveOptions).map(
49306
- ([_, V], H) => /* @__PURE__ */ E.jsx(
49305
+ U.destructiveOptions && U.destructiveOptions.map(
49306
+ ({ name: _, fn: V }, H) => /* @__PURE__ */ E.jsx(
49307
49307
  Kf,
49308
49308
  {
49309
49309
  variant: "destructive",
@@ -49690,8 +49690,8 @@ function uk({
49690
49690
  }
49691
49691
  ), children: /* @__PURE__ */ E.jsx(Tj, {}) }),
49692
49692
  /* @__PURE__ */ E.jsxs(rc, { align: "end", className: "w-auto", children: [
49693
- (T = typeof g == "function" ? g(N) : g).options && Object.entries(T.options).map(
49694
- ([M, w], z) => /* @__PURE__ */ E.jsx(
49693
+ (T = typeof g == "function" ? g(N) : g).options && T.options.map(
49694
+ ({ name: M, fn: w }, z) => /* @__PURE__ */ E.jsx(
49695
49695
  Kf,
49696
49696
  {
49697
49697
  onClick: () => {
@@ -49704,8 +49704,8 @@ function uk({
49704
49704
  )
49705
49705
  ),
49706
49706
  T.options && T.destructiveOptions && /* @__PURE__ */ E.jsx(JE, {}),
49707
- T.destructiveOptions && Object.entries(T.destructiveOptions).map(
49708
- ([M, w], z) => /* @__PURE__ */ E.jsx(
49707
+ T.destructiveOptions && T.destructiveOptions.map(
49708
+ ({ name: M, fn: w }, z) => /* @__PURE__ */ E.jsx(
49709
49709
  Kf,
49710
49710
  {
49711
49711
  variant: "destructive",
@@ -15,20 +15,28 @@ export type ButtonOption = {
15
15
  name: ReactNode;
16
16
  method: () => void;
17
17
  }[];
18
- export type OptionName = string;
18
+ export type OptionName = ReactNode;
19
+ export type RowOptionItem<Row extends Record<string, any>> = {
20
+ name: ReactNode;
21
+ fn: ((row: Row) => void) | null;
22
+ };
19
23
  export type RowOption<Row extends Record<string, any>> = {
20
- options?: Record<OptionName, ((row: Row) => void) | null>;
21
- destructiveOptions?: Record<OptionName, ((row: Row) => void) | null>;
24
+ options?: RowOptionItem<Row>[];
25
+ destructiveOptions?: RowOptionItem<Row>[];
22
26
  } | ((row: Row) => {
23
- options?: Record<OptionName, ((row: Row) => void) | null>;
24
- destructiveOptions?: Record<OptionName, ((row: Row) => void) | null>;
27
+ options?: RowOptionItem<Row>[];
28
+ destructiveOptions?: RowOptionItem<Row>[];
25
29
  });
30
+ export type SelectRowsOptionItem<Row extends Record<string, any>> = {
31
+ name: ReactNode;
32
+ fn: ((selectRows: Row[]) => void) | null;
33
+ };
26
34
  export type SelectRowsOption<Row extends Record<string, any>> = {
27
- options?: Record<OptionName, ((selectRows: Row[]) => void) | null>;
28
- destructiveOptions?: Record<OptionName, ((selectRows: Row[]) => void) | null>;
35
+ options?: SelectRowsOptionItem<Row>[];
36
+ destructiveOptions?: SelectRowsOptionItem<Row>[];
29
37
  } | ((selectRows: Row[]) => {
30
- options?: Record<OptionName, ((selectRows: Row[]) => void) | null>;
31
- destructiveOptions?: Record<OptionName, ((selectRows: Row[]) => void) | null>;
38
+ options?: SelectRowsOptionItem<Row>[];
39
+ destructiveOptions?: SelectRowsOptionItem<Row>[];
32
40
  });
33
41
  /**
34
42
  * Table component.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reykit",
3
- "version": "1.0.178",
3
+ "version": "1.0.179",
4
4
  "description": "Kit method set.",
5
5
  "author": "reyxbo",
6
6
  "keywords": [