@compill/admin 1.0.75 → 1.0.76

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
@@ -2258,6 +2258,8 @@ function RefreshButton({
2258
2258
 
2259
2259
  function ItemDeleteDialog(_a) {
2260
2260
  var {
2261
+ title,
2262
+ actionButtonLabel,
2261
2263
  itemLabel,
2262
2264
  queryId = "",
2263
2265
  api: api$1,
@@ -2270,7 +2272,7 @@ function ItemDeleteDialog(_a) {
2270
2272
  show,
2271
2273
  onClose
2272
2274
  } = _a,
2273
- props = __rest$1(_a, ["itemLabel", "queryId", "api", "apiFn", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
2275
+ props = __rest$1(_a, ["title", "actionButtonLabel", "itemLabel", "queryId", "api", "apiFn", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
2274
2276
  const fn = apiFn ? api$1[apiFn] : api$1.delete;
2275
2277
  const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(fn, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey) : api.useApiMutation(fn, api$1.queryKey);
2276
2278
  const mutate = api.useMutate(mutation, {
@@ -2286,7 +2288,7 @@ function ItemDeleteDialog(_a) {
2286
2288
  transition: true
2287
2289
  }, props, {
2288
2290
  children: [jsxRuntime.jsx(ui.Modal.Header, {
2289
- children: `Delete ${itemLabel}`
2291
+ children: title !== null && title !== void 0 ? title : `Delete ${itemLabel}`
2290
2292
  }), jsxRuntime.jsxs(ui.Modal.Body, {
2291
2293
  pb: "6",
2292
2294
  children: [!msg && `Do you really want to delete ${itemLabel}?`, msg && react.runIfFn(msg, itemLabel)]
@@ -2305,7 +2307,7 @@ function ItemDeleteDialog(_a) {
2305
2307
  scheme: "danger",
2306
2308
  disabled: mutation.isLoading,
2307
2309
  onClick: handleDelete,
2308
- children: "Delete"
2310
+ children: "actionButtonLabel ?? Delete"
2309
2311
  })]
2310
2312
  }), mutation.isLoading && jsxRuntime.jsx(components.ModalLoadingOverlay, {})]
2311
2313
  }));
package/index.esm.js CHANGED
@@ -2248,6 +2248,8 @@ function RefreshButton({
2248
2248
 
2249
2249
  function ItemDeleteDialog(_a) {
2250
2250
  var {
2251
+ title,
2252
+ actionButtonLabel,
2251
2253
  itemLabel,
2252
2254
  queryId = "",
2253
2255
  api,
@@ -2260,7 +2262,7 @@ function ItemDeleteDialog(_a) {
2260
2262
  show,
2261
2263
  onClose
2262
2264
  } = _a,
2263
- props = __rest$1(_a, ["itemLabel", "queryId", "api", "apiFn", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
2265
+ props = __rest$1(_a, ["title", "actionButtonLabel", "itemLabel", "queryId", "api", "apiFn", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
2264
2266
  const fn = apiFn ? api[apiFn] : api.delete;
2265
2267
  const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(fn, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey) : useApiMutation(fn, api.queryKey);
2266
2268
  const mutate = useMutate(mutation, {
@@ -2276,7 +2278,7 @@ function ItemDeleteDialog(_a) {
2276
2278
  transition: true
2277
2279
  }, props, {
2278
2280
  children: [jsx(Modal.Header, {
2279
- children: `Delete ${itemLabel}`
2281
+ children: title !== null && title !== void 0 ? title : `Delete ${itemLabel}`
2280
2282
  }), jsxs(Modal.Body, {
2281
2283
  pb: "6",
2282
2284
  children: [!msg && `Do you really want to delete ${itemLabel}?`, msg && runIfFn(msg, itemLabel)]
@@ -2295,7 +2297,7 @@ function ItemDeleteDialog(_a) {
2295
2297
  scheme: "danger",
2296
2298
  disabled: mutation.isLoading,
2297
2299
  onClick: handleDelete,
2298
- children: "Delete"
2300
+ children: "actionButtonLabel ?? Delete"
2299
2301
  })]
2300
2302
  }), mutation.isLoading && jsx(ModalLoadingOverlay, {})]
2301
2303
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compill/admin",
3
- "version": "1.0.75",
3
+ "version": "1.0.76",
4
4
  "module": "./index.esm.js",
5
5
  "main": "./index.cjs.js"
6
6
  }
@@ -9,5 +9,7 @@ export interface ItemDeleteDialogProps extends ModalProps {
9
9
  invalidateQueriesOnSuccess?: boolean;
10
10
  invalidateQueryKey?: string[];
11
11
  msg?: (itemLabel: string) => string | React.ReactNode;
12
+ actionButtonLabel?: string;
13
+ title?: string;
12
14
  }
13
- export declare function ItemDeleteDialog({ itemLabel, queryId, api, apiFn, invalidateQueriesOnSuccess, invalidateQueryKey, size, md_boxSizing, msg, show, onClose, ...props }: ItemDeleteDialogProps): JSX.Element;
15
+ export declare function ItemDeleteDialog({ title, actionButtonLabel, itemLabel, queryId, api, apiFn, invalidateQueriesOnSuccess, invalidateQueryKey, size, md_boxSizing, msg, show, onClose, ...props }: ItemDeleteDialogProps): JSX.Element;