@compill/admin 1.0.44 → 1.0.45
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 +75 -67
- package/index.esm.js +73 -65
- package/package.json +1 -1
- package/src/lib/table/TableTopBar.d.ts +1 -2
package/index.cjs.js
CHANGED
@@ -172,10 +172,10 @@ function InvalidateButton(_a) {
|
|
172
172
|
});
|
173
173
|
return jsxRuntime.jsx(ui.Button, Object.assign({
|
174
174
|
scheme: "dark",
|
175
|
-
variant: "
|
176
|
-
|
177
|
-
|
178
|
-
|
175
|
+
variant: "borderless",
|
176
|
+
size: "sm",
|
177
|
+
corners: "square",
|
178
|
+
aspectRatio: "square",
|
179
179
|
title: "Regenerate",
|
180
180
|
disabled: mutation.isLoading,
|
181
181
|
onClick: invalidate
|
@@ -1363,12 +1363,7 @@ function TableContainer(_a) {
|
|
1363
1363
|
children
|
1364
1364
|
} = _a,
|
1365
1365
|
props = __rest$1(_a, ["initialPageSize", "initialVisibleColumns", "columns", "children"]);
|
1366
|
-
return jsxRuntime.jsx(
|
1367
|
-
scheme: "light",
|
1368
|
-
shadow: true,
|
1369
|
-
rounded: "md",
|
1370
|
-
px: "0",
|
1371
|
-
py: "4",
|
1366
|
+
return jsxRuntime.jsx("div", Object.assign({
|
1372
1367
|
w: "full",
|
1373
1368
|
dflex: true,
|
1374
1369
|
flexCol: true
|
@@ -1390,10 +1385,10 @@ function TableCreateButton(_a) {
|
|
1390
1385
|
} = _a,
|
1391
1386
|
props = __rest$1(_a, ["children"]);
|
1392
1387
|
return jsxRuntime.jsx(DialogButton, Object.assign({
|
1393
|
-
scheme: "
|
1394
|
-
|
1395
|
-
|
1396
|
-
variant: "
|
1388
|
+
scheme: "dark",
|
1389
|
+
size: "sm",
|
1390
|
+
aspectRatio: "square",
|
1391
|
+
variant: "borderless"
|
1397
1392
|
}, props, {
|
1398
1393
|
children: children !== null && children !== void 0 ? children : jsxRuntime.jsx(ui.Icon, {
|
1399
1394
|
path: mdiPlusThick
|
@@ -1408,11 +1403,11 @@ function TableFilterButton(_a) {
|
|
1408
1403
|
side: "bottom-end",
|
1409
1404
|
modal: true,
|
1410
1405
|
children: [jsxRuntime.jsx(ui.Button, Object.assign({
|
1411
|
-
scheme: "
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1406
|
+
scheme: "dark",
|
1407
|
+
size: "sm",
|
1408
|
+
aspectRatio: "square",
|
1409
|
+
variant: "borderless",
|
1410
|
+
corners: "square"
|
1416
1411
|
}, props, {
|
1417
1412
|
children: jsxRuntime.jsx(ui.Icon, {
|
1418
1413
|
path: mdiFilter
|
@@ -1447,26 +1442,18 @@ function TableFilterButton(_a) {
|
|
1447
1442
|
function TableTopBar(_a) {
|
1448
1443
|
var {
|
1449
1444
|
title,
|
1450
|
-
queryKey,
|
1451
1445
|
children
|
1452
1446
|
} = _a,
|
1453
|
-
props = __rest$1(_a, ["title", "
|
1454
|
-
const invalidate = api.useInvalidateQuery(queryKey);
|
1455
|
-
useHotkeys('ctrl+r', () => invalidate(), {
|
1456
|
-
preventDefault: true
|
1457
|
-
}, [invalidate]);
|
1447
|
+
props = __rest$1(_a, ["title", "children"]);
|
1458
1448
|
return jsxRuntime.jsxs("div", Object.assign({
|
1459
1449
|
dflex: true,
|
1460
1450
|
flexRow: true,
|
1461
|
-
pb: "4",
|
1462
1451
|
alignItems: "center",
|
1463
1452
|
gap: "3",
|
1464
|
-
|
1465
|
-
borderB: "0.5",
|
1466
|
-
borderBColor: "--bg-2"
|
1453
|
+
p: "3"
|
1467
1454
|
}, props, {
|
1468
1455
|
children: [title && jsxRuntime.jsx("h2", {
|
1469
|
-
textSize: "
|
1456
|
+
textSize: "x2",
|
1470
1457
|
fontWeight: "600",
|
1471
1458
|
textColor: "#3f4254",
|
1472
1459
|
textTransform: "capitalize",
|
@@ -1474,22 +1461,7 @@ function TableTopBar(_a) {
|
|
1474
1461
|
}), jsxRuntime.jsx("div", {
|
1475
1462
|
flexGrow: true,
|
1476
1463
|
children: "\u00A0"
|
1477
|
-
}),
|
1478
|
-
spaceX: "2",
|
1479
|
-
dflex: true,
|
1480
|
-
alignItems: "center",
|
1481
|
-
children: [jsxRuntime.jsx(ui.Button, {
|
1482
|
-
scheme: "default",
|
1483
|
-
corners: "pill",
|
1484
|
-
w: "10",
|
1485
|
-
h: "10",
|
1486
|
-
variant: "glass",
|
1487
|
-
onClick: invalidate,
|
1488
|
-
children: jsxRuntime.jsx(ui.Icon, {
|
1489
|
-
path: mdiRefresh
|
1490
|
-
})
|
1491
|
-
}), children]
|
1492
|
-
})]
|
1464
|
+
}), children]
|
1493
1465
|
}));
|
1494
1466
|
}
|
1495
1467
|
|
@@ -1952,15 +1924,14 @@ function TableRowPublishPostButton$1(_a) {
|
|
1952
1924
|
mutation.mutateAsync(id).then(() => reactToastify.toast.success(isDraft ? "Published!" : "Unpublished!")).catch(error => reactToastify.toast.error(`Error: ${error}`));
|
1953
1925
|
}, [mutation, id]);
|
1954
1926
|
return jsxRuntime.jsx(ui.Button, Object.assign({
|
1955
|
-
w: "10",
|
1956
|
-
h: "10",
|
1957
1927
|
variant: "borderless",
|
1958
|
-
corners: "
|
1928
|
+
corners: "square",
|
1959
1929
|
scheme: "default",
|
1960
1930
|
onClick: publish
|
1961
1931
|
}, props, {
|
1962
1932
|
children: jsxRuntime.jsx(ui.Icon, {
|
1963
|
-
path: isDraft ? mdiPublish : mdiPublishOff
|
1933
|
+
path: isDraft ? mdiPublish : mdiPublishOff,
|
1934
|
+
size: "sm"
|
1964
1935
|
})
|
1965
1936
|
}));
|
1966
1937
|
}
|
@@ -1975,8 +1946,14 @@ function TableRowActionsView({
|
|
1975
1946
|
const item = row.original;
|
1976
1947
|
return jsxRuntime.jsx("div", {
|
1977
1948
|
dflex: true,
|
1978
|
-
|
1949
|
+
w: "full",
|
1950
|
+
alignItems: "stretch",
|
1979
1951
|
placeContent: "end",
|
1952
|
+
h: "full",
|
1953
|
+
divideX: "1px",
|
1954
|
+
divideColor: "zinc-100",
|
1955
|
+
rounded: "lg",
|
1956
|
+
overflow: "hidden",
|
1980
1957
|
children: rowActions === null || rowActions === void 0 ? void 0 : rowActions.map((action, index) => jsxRuntime.jsxs(React__default["default"].Fragment, {
|
1981
1958
|
children: [action.type === "publish" && jsxRuntime.jsx(TableRowPublishPostButton$1, {
|
1982
1959
|
id: item.id,
|
@@ -1989,7 +1966,8 @@ function TableRowActionsView({
|
|
1989
1966
|
onClick: () => onAction(action, item),
|
1990
1967
|
scheme: schemes$1[action.type],
|
1991
1968
|
children: jsxRuntime.jsx(ui.Icon, {
|
1992
|
-
path: icons[action.type]
|
1969
|
+
path: icons[action.type],
|
1970
|
+
size: "sm"
|
1993
1971
|
})
|
1994
1972
|
})]
|
1995
1973
|
}, index))
|
@@ -2006,10 +1984,15 @@ function ActionButton$1(_a) {
|
|
2006
1984
|
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
2007
1985
|
}, [onClick]);
|
2008
1986
|
return jsxRuntime.jsx(ui.Button, Object.assign({
|
2009
|
-
|
2010
|
-
|
1987
|
+
dflex: true,
|
1988
|
+
alignContent: "center",
|
1989
|
+
placeContent: "center",
|
1990
|
+
py: "2.5",
|
1991
|
+
px: "2",
|
1992
|
+
h: "full",
|
1993
|
+
size: "lg",
|
2011
1994
|
variant: "borderless",
|
2012
|
-
corners: "
|
1995
|
+
corners: "square",
|
2013
1996
|
onClick: handleClick
|
2014
1997
|
}, props));
|
2015
1998
|
}
|
@@ -2505,7 +2488,7 @@ function TableView(_a) {
|
|
2505
2488
|
const id = useId(queryField);
|
2506
2489
|
const _screen = react.runIfFn(screen, id);
|
2507
2490
|
return jsxRuntime.jsx(PageContainer, Object.assign({
|
2508
|
-
|
2491
|
+
bgColor: "white"
|
2509
2492
|
}, props, {
|
2510
2493
|
children: jsxRuntime.jsx(TableContainer, {
|
2511
2494
|
columns: _screen.table.columns,
|
@@ -2544,15 +2527,16 @@ function TT({
|
|
2544
2527
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
2545
2528
|
children: [breadcrumbs && jsxRuntime.jsx(PageTopBar, {
|
2546
2529
|
breadcrumbs: breadcrumbs
|
2547
|
-
}), jsxRuntime.
|
2530
|
+
}), jsxRuntime.jsx(TableTopBar, {
|
2548
2531
|
title: title,
|
2549
|
-
|
2550
|
-
children: [jsxRuntime.jsx(ButtonBar, {
|
2532
|
+
children: jsxRuntime.jsx(ButtonBar, {
|
2551
2533
|
buttonBar: buttonBar,
|
2552
2534
|
createView: createView,
|
2553
2535
|
editView: editView,
|
2554
|
-
api: tableApi
|
2555
|
-
|
2536
|
+
api: tableApi,
|
2537
|
+
queryKey: tableApi.queryKey,
|
2538
|
+
children: filters && jsxRuntime.jsx(TableFilterButton, {})
|
2539
|
+
})
|
2556
2540
|
}), filters && jsxRuntime.jsx(TableFilters, {
|
2557
2541
|
form: filters.form,
|
2558
2542
|
initialValues: filters.initialValues,
|
@@ -2577,10 +2561,16 @@ function TT({
|
|
2577
2561
|
}
|
2578
2562
|
function ButtonBar({
|
2579
2563
|
buttonBar,
|
2564
|
+
queryKey,
|
2580
2565
|
createView,
|
2581
2566
|
editView,
|
2582
|
-
api
|
2567
|
+
api: api$1,
|
2568
|
+
children
|
2583
2569
|
}) {
|
2570
|
+
const invalidate = api.useInvalidateQuery(queryKey);
|
2571
|
+
useHotkeys('ctrl+r', () => invalidate(), {
|
2572
|
+
preventDefault: true
|
2573
|
+
}, [invalidate]);
|
2584
2574
|
const createDialog = React__default["default"].useCallback(onClose => {
|
2585
2575
|
const view = createView !== null && createView !== void 0 ? createView : editView;
|
2586
2576
|
if (view.type == "customDialog") return view.render({
|
@@ -2589,17 +2579,33 @@ function ButtonBar({
|
|
2589
2579
|
});else return jsxRuntime.jsx(DialogRenderer, {
|
2590
2580
|
config: view,
|
2591
2581
|
onClose: onClose,
|
2592
|
-
invalidateQueryKey: api.queryKey
|
2582
|
+
invalidateQueryKey: api$1.queryKey
|
2593
2583
|
});
|
2594
|
-
}, [editView, api]);
|
2595
|
-
return jsxRuntime.
|
2596
|
-
|
2584
|
+
}, [editView, api$1]);
|
2585
|
+
return jsxRuntime.jsxs("div", {
|
2586
|
+
dflex: true,
|
2587
|
+
border: "1px",
|
2588
|
+
borderColor: "zinc-200",
|
2589
|
+
divideX: "1px",
|
2590
|
+
divideColor: "zinc-200",
|
2591
|
+
rounded: "lg",
|
2592
|
+
overflow: "hidden",
|
2593
|
+
children: [jsxRuntime.jsx(ui.Button, {
|
2594
|
+
scheme: "dark",
|
2595
|
+
size: "sm",
|
2596
|
+
aspectRatio: "square",
|
2597
|
+
variant: "borderless",
|
2598
|
+
onClick: invalidate,
|
2599
|
+
children: jsxRuntime.jsx(ui.Icon, {
|
2600
|
+
path: mdiRefresh
|
2601
|
+
})
|
2602
|
+
}), buttonBar && buttonBar.map((button, index) => jsxRuntime.jsxs(React__default["default"].Fragment, {
|
2597
2603
|
children: [button.type === "create" && editView && jsxRuntime.jsx(TableCreateButton, {
|
2598
2604
|
buildDialog: createDialog
|
2599
2605
|
}), button.type === "invalidate" && jsxRuntime.jsx(InvalidateButton, {
|
2600
2606
|
pathOrPermalink: button.pathOrPermalink
|
2601
2607
|
}), button.type === "custom" && button.render()]
|
2602
|
-
}, index))
|
2608
|
+
}, index)), children]
|
2603
2609
|
});
|
2604
2610
|
}
|
2605
2611
|
function TableWrapper({
|
@@ -2621,6 +2627,8 @@ function TableWrapper({
|
|
2621
2627
|
};
|
2622
2628
|
}, [subtitle]);
|
2623
2629
|
return jsxRuntime.jsx(table.Table, Object.assign({}, tableProps, {
|
2630
|
+
px: "3",
|
2631
|
+
py: "3",
|
2624
2632
|
title: _subtitle
|
2625
2633
|
}));
|
2626
2634
|
}
|
package/index.esm.js
CHANGED
@@ -163,10 +163,10 @@ function InvalidateButton(_a) {
|
|
163
163
|
});
|
164
164
|
return jsx(Button, Object.assign({
|
165
165
|
scheme: "dark",
|
166
|
-
variant: "
|
167
|
-
|
168
|
-
|
169
|
-
|
166
|
+
variant: "borderless",
|
167
|
+
size: "sm",
|
168
|
+
corners: "square",
|
169
|
+
aspectRatio: "square",
|
170
170
|
title: "Regenerate",
|
171
171
|
disabled: mutation.isLoading,
|
172
172
|
onClick: invalidate
|
@@ -1354,12 +1354,7 @@ function TableContainer(_a) {
|
|
1354
1354
|
children
|
1355
1355
|
} = _a,
|
1356
1356
|
props = __rest$1(_a, ["initialPageSize", "initialVisibleColumns", "columns", "children"]);
|
1357
|
-
return jsx(
|
1358
|
-
scheme: "light",
|
1359
|
-
shadow: true,
|
1360
|
-
rounded: "md",
|
1361
|
-
px: "0",
|
1362
|
-
py: "4",
|
1357
|
+
return jsx("div", Object.assign({
|
1363
1358
|
w: "full",
|
1364
1359
|
dflex: true,
|
1365
1360
|
flexCol: true
|
@@ -1381,10 +1376,10 @@ function TableCreateButton(_a) {
|
|
1381
1376
|
} = _a,
|
1382
1377
|
props = __rest$1(_a, ["children"]);
|
1383
1378
|
return jsx(DialogButton, Object.assign({
|
1384
|
-
scheme: "
|
1385
|
-
|
1386
|
-
|
1387
|
-
variant: "
|
1379
|
+
scheme: "dark",
|
1380
|
+
size: "sm",
|
1381
|
+
aspectRatio: "square",
|
1382
|
+
variant: "borderless"
|
1388
1383
|
}, props, {
|
1389
1384
|
children: children !== null && children !== void 0 ? children : jsx(Icon, {
|
1390
1385
|
path: mdiPlusThick
|
@@ -1399,11 +1394,11 @@ function TableFilterButton(_a) {
|
|
1399
1394
|
side: "bottom-end",
|
1400
1395
|
modal: true,
|
1401
1396
|
children: [jsx(Button, Object.assign({
|
1402
|
-
scheme: "
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1397
|
+
scheme: "dark",
|
1398
|
+
size: "sm",
|
1399
|
+
aspectRatio: "square",
|
1400
|
+
variant: "borderless",
|
1401
|
+
corners: "square"
|
1407
1402
|
}, props, {
|
1408
1403
|
children: jsx(Icon, {
|
1409
1404
|
path: mdiFilter
|
@@ -1438,26 +1433,18 @@ function TableFilterButton(_a) {
|
|
1438
1433
|
function TableTopBar(_a) {
|
1439
1434
|
var {
|
1440
1435
|
title,
|
1441
|
-
queryKey,
|
1442
1436
|
children
|
1443
1437
|
} = _a,
|
1444
|
-
props = __rest$1(_a, ["title", "
|
1445
|
-
const invalidate = useInvalidateQuery(queryKey);
|
1446
|
-
useHotkeys('ctrl+r', () => invalidate(), {
|
1447
|
-
preventDefault: true
|
1448
|
-
}, [invalidate]);
|
1438
|
+
props = __rest$1(_a, ["title", "children"]);
|
1449
1439
|
return jsxs("div", Object.assign({
|
1450
1440
|
dflex: true,
|
1451
1441
|
flexRow: true,
|
1452
|
-
pb: "4",
|
1453
1442
|
alignItems: "center",
|
1454
1443
|
gap: "3",
|
1455
|
-
|
1456
|
-
borderB: "0.5",
|
1457
|
-
borderBColor: "--bg-2"
|
1444
|
+
p: "3"
|
1458
1445
|
}, props, {
|
1459
1446
|
children: [title && jsx("h2", {
|
1460
|
-
textSize: "
|
1447
|
+
textSize: "x2",
|
1461
1448
|
fontWeight: "600",
|
1462
1449
|
textColor: "#3f4254",
|
1463
1450
|
textTransform: "capitalize",
|
@@ -1465,22 +1452,7 @@ function TableTopBar(_a) {
|
|
1465
1452
|
}), jsx("div", {
|
1466
1453
|
flexGrow: true,
|
1467
1454
|
children: "\u00A0"
|
1468
|
-
}),
|
1469
|
-
spaceX: "2",
|
1470
|
-
dflex: true,
|
1471
|
-
alignItems: "center",
|
1472
|
-
children: [jsx(Button, {
|
1473
|
-
scheme: "default",
|
1474
|
-
corners: "pill",
|
1475
|
-
w: "10",
|
1476
|
-
h: "10",
|
1477
|
-
variant: "glass",
|
1478
|
-
onClick: invalidate,
|
1479
|
-
children: jsx(Icon, {
|
1480
|
-
path: mdiRefresh
|
1481
|
-
})
|
1482
|
-
}), children]
|
1483
|
-
})]
|
1455
|
+
}), children]
|
1484
1456
|
}));
|
1485
1457
|
}
|
1486
1458
|
|
@@ -1943,15 +1915,14 @@ function TableRowPublishPostButton$1(_a) {
|
|
1943
1915
|
mutation.mutateAsync(id).then(() => toast.success(isDraft ? "Published!" : "Unpublished!")).catch(error => toast.error(`Error: ${error}`));
|
1944
1916
|
}, [mutation, id]);
|
1945
1917
|
return jsx(Button, Object.assign({
|
1946
|
-
w: "10",
|
1947
|
-
h: "10",
|
1948
1918
|
variant: "borderless",
|
1949
|
-
corners: "
|
1919
|
+
corners: "square",
|
1950
1920
|
scheme: "default",
|
1951
1921
|
onClick: publish
|
1952
1922
|
}, props, {
|
1953
1923
|
children: jsx(Icon, {
|
1954
|
-
path: isDraft ? mdiPublish : mdiPublishOff
|
1924
|
+
path: isDraft ? mdiPublish : mdiPublishOff,
|
1925
|
+
size: "sm"
|
1955
1926
|
})
|
1956
1927
|
}));
|
1957
1928
|
}
|
@@ -1966,8 +1937,14 @@ function TableRowActionsView({
|
|
1966
1937
|
const item = row.original;
|
1967
1938
|
return jsx("div", {
|
1968
1939
|
dflex: true,
|
1969
|
-
|
1940
|
+
w: "full",
|
1941
|
+
alignItems: "stretch",
|
1970
1942
|
placeContent: "end",
|
1943
|
+
h: "full",
|
1944
|
+
divideX: "1px",
|
1945
|
+
divideColor: "zinc-100",
|
1946
|
+
rounded: "lg",
|
1947
|
+
overflow: "hidden",
|
1971
1948
|
children: rowActions === null || rowActions === void 0 ? void 0 : rowActions.map((action, index) => jsxs(React.Fragment, {
|
1972
1949
|
children: [action.type === "publish" && jsx(TableRowPublishPostButton$1, {
|
1973
1950
|
id: item.id,
|
@@ -1980,7 +1957,8 @@ function TableRowActionsView({
|
|
1980
1957
|
onClick: () => onAction(action, item),
|
1981
1958
|
scheme: schemes$1[action.type],
|
1982
1959
|
children: jsx(Icon, {
|
1983
|
-
path: icons[action.type]
|
1960
|
+
path: icons[action.type],
|
1961
|
+
size: "sm"
|
1984
1962
|
})
|
1985
1963
|
})]
|
1986
1964
|
}, index))
|
@@ -1997,10 +1975,15 @@ function ActionButton$1(_a) {
|
|
1997
1975
|
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
1998
1976
|
}, [onClick]);
|
1999
1977
|
return jsx(Button, Object.assign({
|
2000
|
-
|
2001
|
-
|
1978
|
+
dflex: true,
|
1979
|
+
alignContent: "center",
|
1980
|
+
placeContent: "center",
|
1981
|
+
py: "2.5",
|
1982
|
+
px: "2",
|
1983
|
+
h: "full",
|
1984
|
+
size: "lg",
|
2002
1985
|
variant: "borderless",
|
2003
|
-
corners: "
|
1986
|
+
corners: "square",
|
2004
1987
|
onClick: handleClick
|
2005
1988
|
}, props));
|
2006
1989
|
}
|
@@ -2496,7 +2479,7 @@ function TableView(_a) {
|
|
2496
2479
|
const id = useId(queryField);
|
2497
2480
|
const _screen = runIfFn(screen, id);
|
2498
2481
|
return jsx(PageContainer, Object.assign({
|
2499
|
-
|
2482
|
+
bgColor: "white"
|
2500
2483
|
}, props, {
|
2501
2484
|
children: jsx(TableContainer, {
|
2502
2485
|
columns: _screen.table.columns,
|
@@ -2535,15 +2518,16 @@ function TT({
|
|
2535
2518
|
return jsxs(Fragment, {
|
2536
2519
|
children: [breadcrumbs && jsx(PageTopBar, {
|
2537
2520
|
breadcrumbs: breadcrumbs
|
2538
|
-
}),
|
2521
|
+
}), jsx(TableTopBar, {
|
2539
2522
|
title: title,
|
2540
|
-
|
2541
|
-
children: [jsx(ButtonBar, {
|
2523
|
+
children: jsx(ButtonBar, {
|
2542
2524
|
buttonBar: buttonBar,
|
2543
2525
|
createView: createView,
|
2544
2526
|
editView: editView,
|
2545
|
-
api: tableApi
|
2546
|
-
|
2527
|
+
api: tableApi,
|
2528
|
+
queryKey: tableApi.queryKey,
|
2529
|
+
children: filters && jsx(TableFilterButton, {})
|
2530
|
+
})
|
2547
2531
|
}), filters && jsx(TableFilters, {
|
2548
2532
|
form: filters.form,
|
2549
2533
|
initialValues: filters.initialValues,
|
@@ -2568,10 +2552,16 @@ function TT({
|
|
2568
2552
|
}
|
2569
2553
|
function ButtonBar({
|
2570
2554
|
buttonBar,
|
2555
|
+
queryKey,
|
2571
2556
|
createView,
|
2572
2557
|
editView,
|
2573
|
-
api
|
2558
|
+
api,
|
2559
|
+
children
|
2574
2560
|
}) {
|
2561
|
+
const invalidate = useInvalidateQuery(queryKey);
|
2562
|
+
useHotkeys('ctrl+r', () => invalidate(), {
|
2563
|
+
preventDefault: true
|
2564
|
+
}, [invalidate]);
|
2575
2565
|
const createDialog = React.useCallback(onClose => {
|
2576
2566
|
const view = createView !== null && createView !== void 0 ? createView : editView;
|
2577
2567
|
if (view.type == "customDialog") return view.render({
|
@@ -2583,14 +2573,30 @@ function ButtonBar({
|
|
2583
2573
|
invalidateQueryKey: api.queryKey
|
2584
2574
|
});
|
2585
2575
|
}, [editView, api]);
|
2586
|
-
return
|
2587
|
-
|
2576
|
+
return jsxs("div", {
|
2577
|
+
dflex: true,
|
2578
|
+
border: "1px",
|
2579
|
+
borderColor: "zinc-200",
|
2580
|
+
divideX: "1px",
|
2581
|
+
divideColor: "zinc-200",
|
2582
|
+
rounded: "lg",
|
2583
|
+
overflow: "hidden",
|
2584
|
+
children: [jsx(Button, {
|
2585
|
+
scheme: "dark",
|
2586
|
+
size: "sm",
|
2587
|
+
aspectRatio: "square",
|
2588
|
+
variant: "borderless",
|
2589
|
+
onClick: invalidate,
|
2590
|
+
children: jsx(Icon, {
|
2591
|
+
path: mdiRefresh
|
2592
|
+
})
|
2593
|
+
}), buttonBar && buttonBar.map((button, index) => jsxs(React.Fragment, {
|
2588
2594
|
children: [button.type === "create" && editView && jsx(TableCreateButton, {
|
2589
2595
|
buildDialog: createDialog
|
2590
2596
|
}), button.type === "invalidate" && jsx(InvalidateButton, {
|
2591
2597
|
pathOrPermalink: button.pathOrPermalink
|
2592
2598
|
}), button.type === "custom" && button.render()]
|
2593
|
-
}, index))
|
2599
|
+
}, index)), children]
|
2594
2600
|
});
|
2595
2601
|
}
|
2596
2602
|
function TableWrapper({
|
@@ -2612,6 +2618,8 @@ function TableWrapper({
|
|
2612
2618
|
};
|
2613
2619
|
}, [subtitle]);
|
2614
2620
|
return jsx(Table, Object.assign({}, tableProps, {
|
2621
|
+
px: "3",
|
2622
|
+
py: "3",
|
2615
2623
|
title: _subtitle
|
2616
2624
|
}));
|
2617
2625
|
}
|
package/package.json
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
import { ParentComponent, SoperioComponent } from "@soperio/react";
|
3
3
|
interface TableTopBarProps extends SoperioComponent, ParentComponent {
|
4
4
|
title?: string;
|
5
|
-
queryKey: string[];
|
6
5
|
}
|
7
|
-
export declare function TableTopBar({ title,
|
6
|
+
export declare function TableTopBar({ title, children, ...props }: TableTopBarProps): JSX.Element;
|
8
7
|
export {};
|