@compill/admin 1.0.88 → 1.0.90

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.
Files changed (3) hide show
  1. package/index.cjs.js +66 -106
  2. package/index.esm.js +3 -43
  3. package/package.json +1 -1
package/index.cjs.js CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var tslib = require('tslib');
5
6
  var jsxRuntime = require('@soperio/jsx-runtime');
6
7
  var api = require('@compill/api');
7
8
  var components = require('@compill/components');
@@ -33,53 +34,11 @@ var Link__default = /*#__PURE__*/_interopDefaultLegacy(Link);
33
34
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
34
35
  var Image__default = /*#__PURE__*/_interopDefaultLegacy(Image);
35
36
 
36
- /******************************************************************************
37
- Copyright (c) Microsoft Corporation.
38
-
39
- Permission to use, copy, modify, and/or distribute this software for any
40
- purpose with or without fee is hereby granted.
41
-
42
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
43
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
44
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
45
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
46
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
47
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
48
- PERFORMANCE OF THIS SOFTWARE.
49
- ***************************************************************************** */
50
-
51
- function __rest(s, e) {
52
- var t = {};
53
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
54
- t[p] = s[p];
55
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
56
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
57
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
58
- t[p[i]] = s[p[i]];
59
- }
60
- return t;
61
- }
62
-
63
- function __awaiter(thisArg, _arguments, P, generator) {
64
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
65
- return new (P || (P = Promise))(function (resolve, reject) {
66
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
67
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
68
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
69
- step((generator = generator.apply(thisArg, _arguments || [])).next());
70
- });
71
- }
72
-
73
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
74
- var e = new Error(message);
75
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
76
- };
77
-
78
37
  function SectionTitle(_a) {
79
38
  var {
80
39
  children
81
40
  } = _a,
82
- props = __rest(_a, ["children"]);
41
+ props = tslib.__rest(_a, ["children"]);
83
42
  return jsxRuntime.jsx("h2", Object.assign({
84
43
  textSize: "xl",
85
44
  fontWeight: "600",
@@ -363,7 +322,7 @@ function Breadcrumbs(_a) {
363
322
  var {
364
323
  breadcrumbs
365
324
  } = _a,
366
- props = __rest(_a, ["breadcrumbs"]);
325
+ props = tslib.__rest(_a, ["breadcrumbs"]);
367
326
  if (isArray(breadcrumbs)) {
368
327
  return jsxRuntime.jsx("div", Object.assign({
369
328
  dflex: true,
@@ -388,7 +347,7 @@ function QueryBreadcrumbs(_a) {
388
347
  queryField,
389
348
  generate
390
349
  } = _a,
391
- props = __rest(_a, ["queryFn", "queryField", "generate"]);
350
+ props = tslib.__rest(_a, ["queryFn", "queryField", "generate"]);
392
351
  const params = reactRouterDom.useParams();
393
352
  const id = queryField ? params[queryField] : undefined;
394
353
  const {
@@ -448,7 +407,7 @@ function DialogButton(_a) {
448
407
  var {
449
408
  buildDialog
450
409
  } = _a,
451
- props = __rest(_a, ["buildDialog"]);
410
+ props = tslib.__rest(_a, ["buildDialog"]);
452
411
  const [showDialog, setShowDialog] = React__default["default"].useState(false);
453
412
  const onShowDialog = React__default["default"].useCallback(event => {
454
413
  event === null || event === void 0 ? void 0 : event.preventDefault();
@@ -469,7 +428,7 @@ function ButtonBar(_a) {
469
428
  var {
470
429
  children
471
430
  } = _a,
472
- props = __rest(_a, ["children"]);
431
+ props = tslib.__rest(_a, ["children"]);
473
432
  return jsxRuntime.jsx("div", Object.assign({
474
433
  dflex: true,
475
434
  border: "1px",
@@ -487,7 +446,7 @@ const ButtonBarButton = /*#__PURE__*/React__default["default"].forwardRef(functi
487
446
  icon,
488
447
  children
489
448
  } = _a,
490
- props = __rest(_a, ["icon", "children"]);
449
+ props = tslib.__rest(_a, ["icon", "children"]);
491
450
  return jsxRuntime.jsxs(ui.Button, Object.assign({
492
451
  scheme: "dark",
493
452
  size: "sm",
@@ -513,7 +472,7 @@ const ButtonBarSubmitButton = /*#__PURE__*/React__default["default"].forwardRef(
513
472
  icon,
514
473
  children
515
474
  } = _a,
516
- props = __rest(_a, ["useDirty", "disabled", "icon", "children"]);
475
+ props = tslib.__rest(_a, ["useDirty", "disabled", "icon", "children"]);
517
476
  const {
518
477
  dirty,
519
478
  handleSubmit
@@ -547,7 +506,7 @@ function ButtonBarDialogButton(_a) {
547
506
  icon,
548
507
  children
549
508
  } = _a,
550
- props = __rest(_a, ["icon", "children"]);
509
+ props = tslib.__rest(_a, ["icon", "children"]);
551
510
  return jsxRuntime.jsxs(DialogButton, Object.assign({
552
511
  scheme: "dark",
553
512
  size: "sm",
@@ -569,7 +528,7 @@ function InvalidateButton(_a) {
569
528
  var {
570
529
  pathOrPermalink
571
530
  } = _a,
572
- props = __rest(_a, ["pathOrPermalink"]);
531
+ props = tslib.__rest(_a, ["pathOrPermalink"]);
573
532
  const api$1 = adminApi.INVALIDATE_API.new(pathOrPermalink);
574
533
  const mutation = api.useApiMutation(api$1.invalidate, api$1.queryKey);
575
534
  const invalidate = api.useMutate(mutation, {
@@ -587,7 +546,7 @@ function NavigateButton(_a) {
587
546
  var {
588
547
  path
589
548
  } = _a,
590
- props = __rest(_a, ["path"]);
549
+ props = tslib.__rest(_a, ["path"]);
591
550
  const navigate = reactRouterDom.useNavigate();
592
551
  const handleClick = React__default["default"].useCallback(() => {
593
552
  navigate(path);
@@ -613,7 +572,7 @@ function PublishButton(_a) {
613
572
  queryId,
614
573
  api: api$1
615
574
  } = _a,
616
- props = __rest(_a, ["status", "queryId", "api"]);
575
+ props = tslib.__rest(_a, ["status", "queryId", "api"]);
617
576
  const isDraft = status == "draft";
618
577
  const mutation = api.useInvalidateMutation(isDraft ? api$1.publish : api$1.unpublish, api$1.queryKey, queryId, {
619
578
  networkMode: "always"
@@ -1020,7 +979,7 @@ function useHotkeys(keys, callback, options, dependencies) {
1020
979
 
1021
980
  function UpdateButton(_a) {
1022
981
  var _b;
1023
- var props = __rest(_a, []);
982
+ var props = tslib.__rest(_a, []);
1024
983
  const {
1025
984
  dirty,
1026
985
  handleSubmit
@@ -1046,7 +1005,7 @@ function ViewButton(_a) {
1046
1005
  path,
1047
1006
  icon
1048
1007
  } = _a,
1049
- props = __rest(_a, ["path", "icon"]);
1008
+ props = tslib.__rest(_a, ["path", "icon"]);
1050
1009
  const openPage = React__default["default"].useCallback(() => {
1051
1010
  window.open(path, '_blank');
1052
1011
  }, [path]);
@@ -1105,7 +1064,7 @@ function PageContainer(_a) {
1105
1064
  var {
1106
1065
  children
1107
1066
  } = _a,
1108
- props = __rest(_a, ["children"]);
1067
+ props = tslib.__rest(_a, ["children"]);
1109
1068
  return jsxRuntime.jsx(ui.Container, Object.assign({
1110
1069
  center: true,
1111
1070
  dflex: true,
@@ -1120,7 +1079,7 @@ function PageMain(_a) {
1120
1079
  var {
1121
1080
  children
1122
1081
  } = _a,
1123
- props = __rest(_a, ["children"]);
1082
+ props = tslib.__rest(_a, ["children"]);
1124
1083
  return jsxRuntime.jsx(ui.Tile, Object.assign({
1125
1084
  scheme: "light",
1126
1085
  p: "5"
@@ -1133,7 +1092,7 @@ function PageContentEditor(_a) {
1133
1092
  var {
1134
1093
  name
1135
1094
  } = _a,
1136
- props = __rest(_a, ["name"]);
1095
+ props = tslib.__rest(_a, ["name"]);
1137
1096
  const extensions = [editor.ImageExtension];
1138
1097
  return jsxRuntime.jsx(PageMain, Object.assign({
1139
1098
  h: "min"
@@ -1159,7 +1118,7 @@ function PageQueryStateContainerInner(_a) {
1159
1118
  errorStyles,
1160
1119
  children
1161
1120
  } = _a,
1162
- props = __rest(_a, ["queryId", "api", "apiFn", "loadingStyles", "errorStyles", "children"]);
1121
+ props = tslib.__rest(_a, ["queryId", "api", "apiFn", "loadingStyles", "errorStyles", "children"]);
1163
1122
  // @ts-ignore
1164
1123
  const {
1165
1124
  data,
@@ -1185,7 +1144,7 @@ function PageSidebar(_a) {
1185
1144
  var {
1186
1145
  children
1187
1146
  } = _a,
1188
- props = __rest(_a, ["children"]);
1147
+ props = tslib.__rest(_a, ["children"]);
1189
1148
  return jsxRuntime.jsx("div", Object.assign({
1190
1149
  w: "112",
1191
1150
  minW: "112",
@@ -1203,7 +1162,7 @@ function PageSidebarSection(_a) {
1203
1162
  title,
1204
1163
  children
1205
1164
  } = _a,
1206
- props = __rest(_a, ["title", "children"]);
1165
+ props = tslib.__rest(_a, ["title", "children"]);
1207
1166
  return jsxRuntime.jsxs("div", Object.assign({
1208
1167
  w: "full"
1209
1168
  }, props, {
@@ -1217,7 +1176,7 @@ function PageTitle(_a) {
1217
1176
  var {
1218
1177
  children
1219
1178
  } = _a,
1220
- props = __rest(_a, ["children"]);
1179
+ props = tslib.__rest(_a, ["children"]);
1221
1180
  return jsxRuntime.jsx("div", Object.assign({
1222
1181
  trait: "typo.h5"
1223
1182
  }, props, {
@@ -1231,7 +1190,7 @@ function PageTopBar(_a) {
1231
1190
  breadcrumbs,
1232
1191
  children
1233
1192
  } = _a,
1234
- props = __rest(_a, ["title", "breadcrumbs", "children"]);
1193
+ props = tslib.__rest(_a, ["title", "breadcrumbs", "children"]);
1235
1194
  return jsxRuntime.jsxs(components.FlexCenter, Object.assign({
1236
1195
  gap: "3",
1237
1196
  minH: "9"
@@ -1264,7 +1223,7 @@ function PageTabbedTopBar(_a) {
1264
1223
  breadcrumbs,
1265
1224
  children
1266
1225
  } = _a,
1267
- props = __rest(_a, ["title", "breadcrumbs", "children"]);
1226
+ props = tslib.__rest(_a, ["title", "breadcrumbs", "children"]);
1268
1227
  const ref = /*#__PURE__*/React__default["default"].createRef();
1269
1228
  const {
1270
1229
  setContainerEl
@@ -1418,7 +1377,7 @@ function DetailsView(_a) {
1418
1377
  screen,
1419
1378
  tabbed
1420
1379
  } = _a,
1421
- props = __rest(_a, ["queryField", "api", "useNextRouter", "processInput", "screen", "tabbed"]);
1380
+ props = tslib.__rest(_a, ["queryField", "api", "useNextRouter", "processInput", "screen", "tabbed"]);
1422
1381
  const id = useQueryField(queryField, useNextRouter);
1423
1382
  const ref = React__default["default"].useRef(null);
1424
1383
  return jsxRuntime.jsx(PageQueryStateContainer, Object.assign({
@@ -1581,7 +1540,7 @@ function QueryWrapper(_a) {
1581
1540
  config,
1582
1541
  tabbed
1583
1542
  } = _a,
1584
- props = __rest(_a, ["api", "queryField", "fn", "transformFn", "config", "tabbed"]);
1543
+ props = tslib.__rest(_a, ["api", "queryField", "fn", "transformFn", "config", "tabbed"]);
1585
1544
  const {
1586
1545
  id,
1587
1546
  api: mApi
@@ -1610,7 +1569,7 @@ function TabbedView(_a) {
1610
1569
  api,
1611
1570
  screen
1612
1571
  } = _a;
1613
- __rest(_a, ["queryField", "api", "screen"]);
1572
+ tslib.__rest(_a, ["queryField", "api", "screen"]);
1614
1573
  const {
1615
1574
  [queryField]: id
1616
1575
  } = reactRouterDom.useParams();
@@ -1707,7 +1666,7 @@ function TableContainer(_a) {
1707
1666
  filtersMethod = "reactRouter",
1708
1667
  children
1709
1668
  } = _a,
1710
- props = __rest(_a, ["initialPageSize", "initialVisibleColumns", "columns", "filtersMethod", "children"]);
1669
+ props = tslib.__rest(_a, ["initialPageSize", "initialVisibleColumns", "columns", "filtersMethod", "children"]);
1711
1670
  return jsxRuntime.jsx("div", Object.assign({
1712
1671
  w: "full",
1713
1672
  dflex: true,
@@ -1730,7 +1689,7 @@ function TableCreateButton(_a) {
1730
1689
  icon,
1731
1690
  children
1732
1691
  } = _a,
1733
- props = __rest(_a, ["icon", "children"]);
1692
+ props = tslib.__rest(_a, ["icon", "children"]);
1734
1693
  return jsxRuntime.jsxs(admin.ButtonBarDialogButton, Object.assign({}, props, {
1735
1694
  children: [jsxRuntime.jsx(ui.Icon, {
1736
1695
  path: icon !== null && icon !== void 0 ? icon : mdiPlusThick
@@ -1739,7 +1698,7 @@ function TableCreateButton(_a) {
1739
1698
  }
1740
1699
 
1741
1700
  function TableFilterButton(_a) {
1742
- var props = __rest(_a, []);
1701
+ var props = tslib.__rest(_a, []);
1743
1702
  // return <Button scheme="secondary" {...props}><Icon path={mdiFilter} /></Button>
1744
1703
  return jsxRuntime.jsxs(ui.Popover, {
1745
1704
  side: "bottom-end",
@@ -1787,7 +1746,7 @@ function TableTopBar(_a) {
1787
1746
  breadcrumbs,
1788
1747
  children
1789
1748
  } = _a,
1790
- props = __rest(_a, ["title", "breadcrumbs", "children"]);
1749
+ props = tslib.__rest(_a, ["title", "breadcrumbs", "children"]);
1791
1750
  return jsxRuntime.jsxs("div", Object.assign({
1792
1751
  dflex: true,
1793
1752
  flexRow: true,
@@ -2027,7 +1986,7 @@ function ItemEditDialog(_a) {
2027
1986
  onClose,
2028
1987
  formikProps
2029
1988
  } = _a,
2030
- props = __rest(_a, ["initialValues", "itemLabel", "queryId", "api", "queryFetchOptions", "querySaveOptions", "onSuccess", "onFetchError", "fetchErrorMsg", "onSaveError", "saveErrorMsg", "fetchToFormData", "formToQueryData", "invalidateQueriesOnSuccess", "invalidateQueryKey", "retryText", "cancelLabel", "saveLabel", "size", "title", "form", "show", "onClose", "formikProps"]);
1989
+ props = tslib.__rest(_a, ["initialValues", "itemLabel", "queryId", "api", "queryFetchOptions", "querySaveOptions", "onSuccess", "onFetchError", "fetchErrorMsg", "onSaveError", "saveErrorMsg", "fetchToFormData", "formToQueryData", "invalidateQueriesOnSuccess", "invalidateQueryKey", "retryText", "cancelLabel", "saveLabel", "size", "title", "form", "show", "onClose", "formikProps"]);
2031
1990
  const {
2032
1991
  isInitialLoading,
2033
1992
  isFetching,
@@ -2043,7 +2002,7 @@ function ItemEditDialog(_a) {
2043
2002
  // const [showTab, setShowTab] = React.useState(true);
2044
2003
  const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(api$1.upsert, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey, querySaveOptions) : api.useApiMutation(api$1.upsert, api$1.queryKey, queryId, querySaveOptions);
2045
2004
  const retry = React__default["default"].useCallback(() => refetch(), [refetch]);
2046
- const saveItem = React__default["default"].useCallback((item, actions) => __awaiter(this, void 0, void 0, function* () {
2005
+ const saveItem = React__default["default"].useCallback((item, actions) => tslib.__awaiter(this, void 0, void 0, function* () {
2047
2006
  // Clear mutation error if any
2048
2007
  mutation.reset();
2049
2008
  const formItem = formToQueryData ? formToQueryData(item) : Object.assign({}, item);
@@ -2223,7 +2182,7 @@ function DialogRenderer({
2223
2182
  invalidateQueryKey,
2224
2183
  queryId
2225
2184
  }) {
2226
- const props = __rest(config, ["type"]);
2185
+ const props = tslib.__rest(config, ["type"]);
2227
2186
  if (config.type === "dialog") return jsxRuntime.jsx(ItemEditDialog, Object.assign({}, props, {
2228
2187
  queryId: queryId,
2229
2188
  invalidateQueryKey: invalidateQueryKey,
@@ -2278,7 +2237,7 @@ function ItemDeleteDialog(_a) {
2278
2237
  show,
2279
2238
  onClose
2280
2239
  } = _a,
2281
- props = __rest(_a, ["title", "actionButtonLabel", "itemLabel", "queryId", "api", "apiFn", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
2240
+ props = tslib.__rest(_a, ["title", "actionButtonLabel", "itemLabel", "queryId", "api", "apiFn", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
2282
2241
  const fn = apiFn ? api$1[apiFn] : api$1.delete;
2283
2242
  const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(fn, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey) : api.useApiMutation(fn, api$1.queryKey);
2284
2243
  const mutate = api.useMutate(mutation, {
@@ -2466,7 +2425,7 @@ function TableRowPublishPostButton$1(_a) {
2466
2425
  status,
2467
2426
  invalidateQueryKey
2468
2427
  } = _a,
2469
- props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
2428
+ props = tslib.__rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
2470
2429
  const isDraft = status == "draft";
2471
2430
  const mutation = api.useInvalidateParentMutation(isDraft ? api$1.publish : api$1.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey, {
2472
2431
  networkMode: "always"
@@ -2528,7 +2487,7 @@ function ActionButton(_a) {
2528
2487
  var {
2529
2488
  onClick
2530
2489
  } = _a,
2531
- props = __rest(_a, ["onClick"]);
2490
+ props = tslib.__rest(_a, ["onClick"]);
2532
2491
  const handleClick = React__default["default"].useCallback(event => {
2533
2492
  event === null || event === void 0 ? void 0 : event.preventDefault();
2534
2493
  event === null || event === void 0 ? void 0 : event.stopPropagation();
@@ -2566,7 +2525,7 @@ function useTableProps(api, table, rowActions, queryParams) {
2566
2525
  onRowClick,
2567
2526
  columns: c
2568
2527
  } = table,
2569
- props = __rest(table, ["onRowClick", "columns"]);
2528
+ props = tslib.__rest(table, ["onRowClick", "columns"]);
2570
2529
  const onRowClickHandler = React__default["default"].useCallback(item => {
2571
2530
  var _a;
2572
2531
  const config = react.runIfFn(onRowClick, item);
@@ -2611,7 +2570,8 @@ function useTableProps(api, table, rowActions, queryParams) {
2611
2570
  tableProps.columns = columns;
2612
2571
  tableProps.onRowClick = onRowClickHandler;
2613
2572
  tableProps.queryKey = api.queryKey;
2614
- tableProps.queryFilters = queryParams(tableProps).queryFn = api.search;
2573
+ tableProps.queryFilters = queryParams;
2574
+ tableProps.queryFn = api.search;
2615
2575
  return tableProps;
2616
2576
  }
2617
2577
 
@@ -2630,7 +2590,7 @@ function TableView(_a) {
2630
2590
  subtitle,
2631
2591
  screen
2632
2592
  } = _a,
2633
- props = __rest(_a, ["queryField", "title", "subtitle", "screen"]);
2593
+ props = tslib.__rest(_a, ["queryField", "title", "subtitle", "screen"]);
2634
2594
  const id = useId(queryField);
2635
2595
  const _screen = react.runIfFn(screen, id);
2636
2596
  return jsxRuntime.jsx(PageContainer, Object.assign({
@@ -2835,7 +2795,7 @@ function MultiQueryWrapper(_a) {
2835
2795
  config,
2836
2796
  tabbed
2837
2797
  } = _a,
2838
- props = __rest(_a, ["queries", "config", "tabbed"]);
2798
+ props = tslib.__rest(_a, ["queries", "config", "tabbed"]);
2839
2799
  const {
2840
2800
  data,
2841
2801
  isFetching,
@@ -2863,7 +2823,7 @@ function ScreenRenderer(_a) {
2863
2823
  config,
2864
2824
  tabbed
2865
2825
  } = _a,
2866
- props = __rest(_a, ["config", "tabbed"]);
2826
+ props = tslib.__rest(_a, ["config", "tabbed"]);
2867
2827
  if (config.type === "table") return jsxRuntime.jsx(TableView, Object.assign({}, config, props));
2868
2828
  if (config.type === "tabbed") return jsxRuntime.jsx(TabbedView, Object.assign({}, config, props));
2869
2829
  if (config.type === "details") return jsxRuntime.jsx(DetailsView, Object.assign({}, config, {
@@ -2883,7 +2843,7 @@ function ScreenRenderer(_a) {
2883
2843
  *
2884
2844
  */
2885
2845
  function Content(_a) {
2886
- var props = __rest(_a, []);
2846
+ var props = tslib.__rest(_a, []);
2887
2847
  return jsxRuntime.jsx("div", Object.assign({
2888
2848
  w: "100%",
2889
2849
  h: "100%",
@@ -2915,7 +2875,7 @@ function MenuButton(_a) {
2915
2875
  selected,
2916
2876
  children
2917
2877
  } = _a,
2918
- props = __rest(_a, ["depth", "darkMode", "icon", "selected", "children"]);
2878
+ props = tslib.__rest(_a, ["depth", "darkMode", "icon", "selected", "children"]);
2919
2879
  return jsxRuntime.jsxs(ui.Button, Object.assign({
2920
2880
  as: "li",
2921
2881
  minH: "8",
@@ -2950,7 +2910,7 @@ function MenuItem$1(_a) {
2950
2910
  darkMode,
2951
2911
  subMenu
2952
2912
  } = _a,
2953
- props = __rest(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
2913
+ props = tslib.__rest(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
2954
2914
  const location = reactRouterDom.useLocation();
2955
2915
  const selected = path == "/" ? location.pathname == "/" : location.pathname.startsWith(path.startsWith("/") ? path : `/${path}`);
2956
2916
  const match = reactRouterDom.useMatch("/" + path) != null;
@@ -2988,7 +2948,7 @@ function NextMenuItem(_a) {
2988
2948
  darkMode,
2989
2949
  subMenu
2990
2950
  } = _a,
2991
- props = __rest(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
2951
+ props = tslib.__rest(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
2992
2952
  const {
2993
2953
  pathname
2994
2954
  } = router.useRouter();
@@ -3029,7 +2989,7 @@ function Menu(_a) {
3029
2989
  config,
3030
2990
  useNextRouter
3031
2991
  } = _a,
3032
- props = __rest(_a, ["darkMode", "config", "useNextRouter"]);
2992
+ props = tslib.__rest(_a, ["darkMode", "config", "useNextRouter"]);
3033
2993
  const Comp = useNextRouter ? NextMenuItem : MenuItem$1;
3034
2994
  return jsxRuntime.jsx("ul", Object.assign({}, props, {
3035
2995
  children: config.map((item, index) => {
@@ -3178,7 +3138,7 @@ function MenuItem(_a) {
3178
3138
  onClick,
3179
3139
  children
3180
3140
  } = _a,
3181
- props = __rest(_a, ["icon", "onClick", "children"]);
3141
+ props = tslib.__rest(_a, ["icon", "onClick", "children"]);
3182
3142
  const handleClick = React__default["default"].useCallback(e => {
3183
3143
  e.preventDefault();
3184
3144
  e.stopPropagation();
@@ -3215,7 +3175,7 @@ function Sidebar(_a) {
3215
3175
  color,
3216
3176
  darkMode
3217
3177
  } = _a,
3218
- props = __rest(_a, ["show", "logo", "title", "menuConfig", "userMenuConfig", "userSettingsPath", "color", "darkMode"]);
3178
+ props = tslib.__rest(_a, ["show", "logo", "title", "menuConfig", "userMenuConfig", "userSettingsPath", "color", "darkMode"]);
3219
3179
  return jsxRuntime.jsxs("div", Object.assign({
3220
3180
  dflex: true,
3221
3181
  flexCol: true,
@@ -3264,7 +3224,7 @@ function Logo(_a) {
3264
3224
  height,
3265
3225
  darkMode
3266
3226
  } = _a,
3267
- props = __rest(_a, ["width", "height", "darkMode"]);
3227
+ props = tslib.__rest(_a, ["width", "height", "darkMode"]);
3268
3228
  return jsxRuntime.jsx("div", Object.assign({}, props, {
3269
3229
  children: jsxRuntime.jsx(Image__default["default"], {
3270
3230
  src: `/logo_${darkMode ? "light" : "dark"}.png`,
@@ -3287,7 +3247,7 @@ function AdminLayout(_a) {
3287
3247
  userMenuConfig,
3288
3248
  userSettingsPath
3289
3249
  } = _a,
3290
- props = __rest(_a, ["color", "darkMode", "logo", "title", "menuConfig", "userMenuConfig", "userSettingsPath"]);
3250
+ props = tslib.__rest(_a, ["color", "darkMode", "logo", "title", "menuConfig", "userMenuConfig", "userSettingsPath"]);
3291
3251
  return jsxRuntime.jsxs("div", Object.assign({
3292
3252
  w: "full",
3293
3253
  h: "screen",
@@ -3383,7 +3343,7 @@ function AttachDialog(_a) {
3383
3343
  formikProps,
3384
3344
  getItemName
3385
3345
  } = _a,
3386
- props = __rest(_a, ["queryId", "queryKey", "queryFetchFn", "queryFetchAllKey", "queryFetchAllFn", "querySaveFn", "matchKey", "size", "show", "onClose", "itemLabel", "onSuccess", "onFetchError", "fetchErrorMsg", "onSaveError", "saveErrorMsg", "invalidateQueriesOnSuccess", "retryText", "cancelLabel", "saveLabel", "formikProps", "getItemName"]);
3346
+ props = tslib.__rest(_a, ["queryId", "queryKey", "queryFetchFn", "queryFetchAllKey", "queryFetchAllFn", "querySaveFn", "matchKey", "size", "show", "onClose", "itemLabel", "onSuccess", "onFetchError", "fetchErrorMsg", "onSaveError", "saveErrorMsg", "invalidateQueriesOnSuccess", "retryText", "cancelLabel", "saveLabel", "formikProps", "getItemName"]);
3387
3347
  const queryClient = reactQuery.useQueryClient();
3388
3348
  const {
3389
3349
  data: attached,
@@ -3509,7 +3469,7 @@ function ListItem(_a) {
3509
3469
  value,
3510
3470
  checked
3511
3471
  } = _a,
3512
- props = __rest(_a, ["label", "value", "checked"]);
3472
+ props = tslib.__rest(_a, ["label", "value", "checked"]);
3513
3473
  return jsxRuntime.jsxs("div", Object.assign({
3514
3474
  dflex: true,
3515
3475
  alignItems: "center",
@@ -3554,7 +3514,7 @@ function FormActionDialog(_a) {
3554
3514
  onClose,
3555
3515
  formikProps
3556
3516
  } = _a,
3557
- props = __rest(_a, ["initialValues", "itemLabel", "queryId", "queryKey", "queryFn", "queryOptions", "onSuccess", "successMsg", "showSuccessMsg", "onError", "errorMsg", "showErrorMsg", "processInput", "invalidateQueriesOnSuccess", "cancelLabel", "saveLabel", "size", "title", "form", "show", "onClose", "formikProps"]);
3517
+ props = tslib.__rest(_a, ["initialValues", "itemLabel", "queryId", "queryKey", "queryFn", "queryOptions", "onSuccess", "successMsg", "showSuccessMsg", "onError", "errorMsg", "showErrorMsg", "processInput", "invalidateQueriesOnSuccess", "cancelLabel", "saveLabel", "size", "title", "form", "show", "onClose", "formikProps"]);
3558
3518
  const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(queryFn, queryKey, queryOptions) : api.useApiMutation(queryFn, queryKey, queryId, queryOptions);
3559
3519
  const mutate = api.useMutate(mutation, {
3560
3520
  onSuccess,
@@ -3606,7 +3566,7 @@ function PageSectionTitle(_a) {
3606
3566
  var {
3607
3567
  children
3608
3568
  } = _a,
3609
- props = __rest(_a, ["children"]);
3569
+ props = tslib.__rest(_a, ["children"]);
3610
3570
  return jsxRuntime.jsx("div", Object.assign({
3611
3571
  trait: "typo.h6",
3612
3572
  mb: "5"
@@ -3620,7 +3580,7 @@ const PageStateContainer = /*#__PURE__*/React__default["default"].forwardRef((_a
3620
3580
  loading = false,
3621
3581
  children
3622
3582
  } = _a,
3623
- props = __rest(_a, ["loading", "children"]);
3583
+ props = tslib.__rest(_a, ["loading", "children"]);
3624
3584
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
3625
3585
  children: [loading && jsxRuntime.jsx(components.QueryLoadingState, {
3626
3586
  w: "full",
@@ -3642,7 +3602,7 @@ function PageSubSectionTitle(_a) {
3642
3602
  var {
3643
3603
  children
3644
3604
  } = _a,
3645
- props = __rest(_a, ["children"]);
3605
+ props = tslib.__rest(_a, ["children"]);
3646
3606
  return jsxRuntime.jsx("div", Object.assign({
3647
3607
  trait: "typo.h6",
3648
3608
  mb: "3"
@@ -3671,7 +3631,7 @@ function StatusBadge(_a) {
3671
3631
  var {
3672
3632
  status
3673
3633
  } = _a,
3674
- props = __rest(_a, ["status"]);
3634
+ props = tslib.__rest(_a, ["status"]);
3675
3635
  return jsxRuntime.jsx(ui.Badge, Object.assign({
3676
3636
  size: "sm",
3677
3637
  variant: "glass",
@@ -3689,7 +3649,7 @@ function TableRowActionButton(_a) {
3689
3649
  icon,
3690
3650
  children
3691
3651
  } = _a,
3692
- props = __rest(_a, ["icon", "children"]);
3652
+ props = tslib.__rest(_a, ["icon", "children"]);
3693
3653
  return jsxRuntime.jsxs(ui.Button, Object.assign({
3694
3654
  dflex: true,
3695
3655
  alignContent: "center",
@@ -3713,7 +3673,7 @@ function TableRowViewButton(_a) {
3713
3673
  var {
3714
3674
  path
3715
3675
  } = _a,
3716
- props = __rest(_a, ["path"]);
3676
+ props = tslib.__rest(_a, ["path"]);
3717
3677
  const openPage = React__default["default"].useCallback(event => {
3718
3678
  event === null || event === void 0 ? void 0 : event.preventDefault();
3719
3679
  event === null || event === void 0 ? void 0 : event.stopPropagation();
@@ -3729,7 +3689,7 @@ function TableRowNavigateButton(_a) {
3729
3689
  var {
3730
3690
  path
3731
3691
  } = _a,
3732
- props = __rest(_a, ["path"]);
3692
+ props = tslib.__rest(_a, ["path"]);
3733
3693
  const navigate = reactRouterDom.useNavigate();
3734
3694
  const handleClick = React__default["default"].useCallback(event => {
3735
3695
  event === null || event === void 0 ? void 0 : event.preventDefault();
@@ -3747,7 +3707,7 @@ function TableRowActionDialogButton(_a) {
3747
3707
  icon,
3748
3708
  children
3749
3709
  } = _a,
3750
- props = __rest(_a, ["icon", "children"]);
3710
+ props = tslib.__rest(_a, ["icon", "children"]);
3751
3711
  return jsxRuntime.jsxs(admin.DialogButton, Object.assign({
3752
3712
  dflex: true,
3753
3713
  alignContent: "center",
@@ -3771,7 +3731,7 @@ function TableRowEditButton(_a) {
3771
3731
  var {
3772
3732
  children
3773
3733
  } = _a,
3774
- props = __rest(_a, ["children"]);
3734
+ props = tslib.__rest(_a, ["children"]);
3775
3735
  return jsxRuntime.jsx(TableRowActionDialogButton, Object.assign({
3776
3736
  icon: mdiPencil
3777
3737
  }, props, {
@@ -3783,7 +3743,7 @@ function TableRowDeleteButton(_a) {
3783
3743
  var {
3784
3744
  children
3785
3745
  } = _a,
3786
- props = __rest(_a, ["children"]);
3746
+ props = tslib.__rest(_a, ["children"]);
3787
3747
  return jsxRuntime.jsx(TableRowActionDialogButton, Object.assign({
3788
3748
  icon: mdiDelete
3789
3749
  }, props, {
@@ -3800,7 +3760,7 @@ function TableRowActionBar(_a) {
3800
3760
  deleteDialog,
3801
3761
  children
3802
3762
  } = _a,
3803
- props = __rest(_a, ["publishId", "viewPath", "navigatePath", "editDialog", "deleteDialog", "children"]);
3763
+ props = tslib.__rest(_a, ["publishId", "viewPath", "navigatePath", "editDialog", "deleteDialog", "children"]);
3804
3764
  return jsxRuntime.jsxs("div", Object.assign({
3805
3765
  dflex: true,
3806
3766
  spaceX: "1",
@@ -3825,7 +3785,7 @@ function TableRowPublishPostButton(_a) {
3825
3785
  status,
3826
3786
  invalidateQueryKey
3827
3787
  } = _a,
3828
- props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
3788
+ props = tslib.__rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
3829
3789
  const isDraft = status == "draft";
3830
3790
  const mutation = api.useInvalidateParentMutation(isDraft ? api$1.publish : api$1.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey, {
3831
3791
  networkMode: "always"
package/index.esm.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { __rest, __awaiter } from 'tslib';
1
2
  import { jsx, jsxs, Fragment } from '@soperio/jsx-runtime';
2
3
  import { useApiQuery, useApiMutation, useMutate, useInvalidateMutation, useInvalidateQuery, useInvalidateParentMutation, useApiQueries } from '@compill/api';
3
4
  import { Shimmer, FlexCenter, QueryLoadingState, RetryOnError, TabContainer, ModalLoadingOverlay } from '@compill/components';
@@ -23,48 +24,6 @@ import { useQueryClient } from '@tanstack/react-query';
23
24
  import Image from 'next/image';
24
25
  import { useSessionUser, useSessionLogout } from '@compill/auth';
25
26
 
26
- /******************************************************************************
27
- Copyright (c) Microsoft Corporation.
28
-
29
- Permission to use, copy, modify, and/or distribute this software for any
30
- purpose with or without fee is hereby granted.
31
-
32
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
33
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
34
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
35
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
36
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
37
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
38
- PERFORMANCE OF THIS SOFTWARE.
39
- ***************************************************************************** */
40
-
41
- function __rest(s, e) {
42
- var t = {};
43
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
44
- t[p] = s[p];
45
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
46
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
47
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
48
- t[p[i]] = s[p[i]];
49
- }
50
- return t;
51
- }
52
-
53
- function __awaiter(thisArg, _arguments, P, generator) {
54
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
55
- return new (P || (P = Promise))(function (resolve, reject) {
56
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
57
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
58
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
59
- step((generator = generator.apply(thisArg, _arguments || [])).next());
60
- });
61
- }
62
-
63
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
64
- var e = new Error(message);
65
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
66
- };
67
-
68
27
  function SectionTitle(_a) {
69
28
  var {
70
29
  children
@@ -2601,7 +2560,8 @@ function useTableProps(api, table, rowActions, queryParams) {
2601
2560
  tableProps.columns = columns;
2602
2561
  tableProps.onRowClick = onRowClickHandler;
2603
2562
  tableProps.queryKey = api.queryKey;
2604
- tableProps.queryFilters = queryParams(tableProps).queryFn = api.search;
2563
+ tableProps.queryFilters = queryParams;
2564
+ tableProps.queryFn = api.search;
2605
2565
  return tableProps;
2606
2566
  }
2607
2567
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compill/admin",
3
- "version": "1.0.88",
3
+ "version": "1.0.90",
4
4
  "module": "./index.esm.js",
5
5
  "main": "./index.cjs.js"
6
6
  }