@compill/admin 1.0.98 → 1.0.99

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/index.cjs.js CHANGED
@@ -2320,23 +2320,26 @@ function TableRowActionsView({
2320
2320
  alignItems: "stretch",
2321
2321
  placeContent: "end",
2322
2322
  h: "full",
2323
- children: (_a = react.runIfFn(rowActions, item)) === null || _a === void 0 ? void 0 : _a.map((action, index) => jsxRuntime.jsxs(React.Fragment, {
2324
- children: [action.type === "publish" && jsxRuntime.jsx(TableRowPublishPostButton$1, {
2325
- id: item.id,
2326
- api: api,
2327
- status: item.status,
2328
- invalidateQueryKey: queryKey
2329
- }), action.type == "custom" && jsxRuntime.jsx(jsxRuntime.Fragment, {
2330
- children: action.component(item, queryKey, action.icon, action.label)
2331
- }), !["publish", "custom"].includes(action.type) && jsxRuntime.jsx(ActionButton, {
2332
- onClick: () => onAction(action, item),
2333
- scheme: schemes$1[action.type],
2334
- children: jsxRuntime.jsx(ui.Icon, {
2335
- path: icons[action.type],
2336
- size: "sm"
2337
- })
2338
- })]
2339
- }, index))
2323
+ children: (_a = react.runIfFn(rowActions, item)) === null || _a === void 0 ? void 0 : _a.map((action, index) => {
2324
+ var _a;
2325
+ return jsxRuntime.jsxs(React.Fragment, {
2326
+ children: [action.type === "publish" && jsxRuntime.jsx(TableRowPublishPostButton$1, {
2327
+ id: item.id,
2328
+ api: (_a = action.api) !== null && _a !== void 0 ? _a : api,
2329
+ status: item.status,
2330
+ invalidateQueryKey: queryKey
2331
+ }), action.type == "custom" && jsxRuntime.jsx(jsxRuntime.Fragment, {
2332
+ children: action.component(item, queryKey, action.icon, action.label)
2333
+ }), !["publish", "custom"].includes(action.type) && jsxRuntime.jsx(ActionButton, {
2334
+ onClick: () => onAction(action, item),
2335
+ scheme: schemes$1[action.type],
2336
+ children: jsxRuntime.jsx(ui.Icon, {
2337
+ path: icons[action.type],
2338
+ size: "sm"
2339
+ })
2340
+ })]
2341
+ }, index);
2342
+ })
2340
2343
  });
2341
2344
  }
2342
2345
  function ActionButton(_a) {
package/index.esm.js CHANGED
@@ -2318,23 +2318,26 @@ function TableRowActionsView({
2318
2318
  alignItems: "stretch",
2319
2319
  placeContent: "end",
2320
2320
  h: "full",
2321
- children: (_a = runIfFn(rowActions, item)) === null || _a === void 0 ? void 0 : _a.map((action, index) => jsxs(React.Fragment, {
2322
- children: [action.type === "publish" && jsx(TableRowPublishPostButton$1, {
2323
- id: item.id,
2324
- api: api,
2325
- status: item.status,
2326
- invalidateQueryKey: queryKey
2327
- }), action.type == "custom" && jsx(Fragment, {
2328
- children: action.component(item, queryKey, action.icon, action.label)
2329
- }), !["publish", "custom"].includes(action.type) && jsx(ActionButton, {
2330
- onClick: () => onAction(action, item),
2331
- scheme: schemes$1[action.type],
2332
- children: jsx(Icon, {
2333
- path: icons[action.type],
2334
- size: "sm"
2335
- })
2336
- })]
2337
- }, index))
2321
+ children: (_a = runIfFn(rowActions, item)) === null || _a === void 0 ? void 0 : _a.map((action, index) => {
2322
+ var _a;
2323
+ return jsxs(React.Fragment, {
2324
+ children: [action.type === "publish" && jsx(TableRowPublishPostButton$1, {
2325
+ id: item.id,
2326
+ api: (_a = action.api) !== null && _a !== void 0 ? _a : api,
2327
+ status: item.status,
2328
+ invalidateQueryKey: queryKey
2329
+ }), action.type == "custom" && jsx(Fragment, {
2330
+ children: action.component(item, queryKey, action.icon, action.label)
2331
+ }), !["publish", "custom"].includes(action.type) && jsx(ActionButton, {
2332
+ onClick: () => onAction(action, item),
2333
+ scheme: schemes$1[action.type],
2334
+ children: jsx(Icon, {
2335
+ path: icons[action.type],
2336
+ size: "sm"
2337
+ })
2338
+ })]
2339
+ }, index);
2340
+ })
2338
2341
  });
2339
2342
  }
2340
2343
  function ActionButton(_a) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compill/admin",
3
- "version": "1.0.98",
3
+ "version": "1.0.99",
4
4
  "module": "./index.esm.js",
5
5
  "main": "./index.cjs.js"
6
6
  }
@@ -58,6 +58,7 @@ export type TableRowAction = {
58
58
  msg?: (itemLabel: string) => (string | React.ReactNode);
59
59
  } | {
60
60
  type: "publish";
61
+ api?: API<any>;
61
62
  } | {
62
63
  type: "custom";
63
64
  component: (item: any, queryKey: string[], icon?: string, label?: string) => React.ReactNode;