@compill/admin 1.0.80 → 1.0.82
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 +240 -127
- package/index.esm.js +242 -129
- package/package.json +1 -1
- package/src/lib/layout/AdminLayout.d.ts +3 -1
- package/src/lib/layout/Sidebar.d.ts +3 -1
- package/src/lib/layout/menu/UserBlock.d.ts +10 -0
package/index.esm.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
import { jsx, jsxs, Fragment } from '@soperio/jsx-runtime';
|
2
|
-
import { Icon, Button, IconButton, Container, Tile, Popover, Collapse, Modal, Checkbox, Badge } from '@valerya/ui';
|
2
|
+
import { Icon, Button, IconButton, Container, Tile, Popover, Collapse, Modal, Avatar, Popup, Checkbox, Badge } from '@valerya/ui';
|
3
3
|
import Link from 'next/link';
|
4
4
|
import React, { useRef, useCallback, useContext as useContext$2, useLayoutEffect, useEffect, createContext } from 'react';
|
5
5
|
import { INVALIDATE_API, API } from '@compill/admin-api';
|
6
6
|
import { useApiMutation, useMutate, useInvalidateMutation, useApiQuery, useInvalidateQuery, useInvalidateParentMutation, useApiQueries } from '@compill/api';
|
7
|
-
import { useFormikContext,
|
7
|
+
import { useFormikContext, Formik, Form } from 'formik';
|
8
8
|
import { useNavigate, useParams, Outlet, useLocation, useMatch, Link as Link$1 } from 'react-router-dom';
|
9
9
|
import { ButtonBarButton as ButtonBarButton$1, ButtonBarSubmitButton as ButtonBarSubmitButton$1, PageSectionTitle as PageSectionTitle$1, ButtonBar as ButtonBar$1, ButtonBarDialogButton as ButtonBarDialogButton$1, TableRowActionButton as TableRowActionButton$1, DialogButton as DialogButton$1 } from '@compill/admin';
|
10
10
|
import { toast } from 'react-toastify';
|
@@ -12,7 +12,8 @@ import 'react/jsx-runtime';
|
|
12
12
|
import { FlexCenter, QueryLoadingState, RetryOnError, TabContainer, ModalLoadingOverlay } from '@compill/components';
|
13
13
|
import { FormProvider, TextArea, FormRenderer, mergeInitialFormValues, FieldLabel, SubmitButton } from '@compill/form';
|
14
14
|
import { createContext as createContext$1, runIfFn, isFunction } from '@soperio/react';
|
15
|
-
import {
|
15
|
+
import { FormEditor } from '@compill/form-editor';
|
16
|
+
import { ImageExtension } from '@compill/editor';
|
16
17
|
import { createPortal } from 'react-dom';
|
17
18
|
import { useRouter } from 'next/router';
|
18
19
|
import { TableContextProvider, useTableContext, Table } from '@compill/table';
|
@@ -20,6 +21,7 @@ import { useOpenLink, useBoolean } from '@compill/hooks';
|
|
20
21
|
import { AppEnv } from '@compill/env';
|
21
22
|
import { useQueryClient } from '@tanstack/react-query';
|
22
23
|
import Image from 'next/image';
|
24
|
+
import { useSessionUser, useSessionLogout } from '@compill/auth';
|
23
25
|
|
24
26
|
/******************************************************************************
|
25
27
|
Copyright (c) Microsoft Corporation.
|
@@ -36,7 +38,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
36
38
|
PERFORMANCE OF THIS SOFTWARE.
|
37
39
|
***************************************************************************** */
|
38
40
|
|
39
|
-
function __rest
|
41
|
+
function __rest(s, e) {
|
40
42
|
var t = {};
|
41
43
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
42
44
|
t[p] = s[p];
|
@@ -67,7 +69,7 @@ function SectionTitle(_a) {
|
|
67
69
|
var {
|
68
70
|
children
|
69
71
|
} = _a,
|
70
|
-
props = __rest
|
72
|
+
props = __rest(_a, ["children"]);
|
71
73
|
return jsx("h2", Object.assign({
|
72
74
|
textSize: "xl",
|
73
75
|
fontWeight: "600",
|
@@ -83,11 +85,14 @@ var mdiArrowLeft = "M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.
|
|
83
85
|
var mdiArrowUpBoldBox = "M19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21M12,7L7,12H10V16H14V12H17L12,7Z";
|
84
86
|
var mdiCircleSmall = "M12,10A2,2 0 0,0 10,12C10,13.11 10.9,14 12,14C13.11,14 14,13.11 14,12A2,2 0 0,0 12,10Z";
|
85
87
|
var mdiCloudUpload = "M11 20H6.5Q4.22 20 2.61 18.43 1 16.85 1 14.58 1 12.63 2.17 11.1 3.35 9.57 5.25 9.15 5.88 6.85 7.75 5.43 9.63 4 12 4 14.93 4 16.96 6.04 19 8.07 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 17.38 21.69 18.69 20.38 20 18.5 20H13V12.85L14.6 14.4L16 13L12 9L8 13L9.4 14.4L11 12.85Z";
|
88
|
+
var mdiCog = "M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z";
|
86
89
|
var mdiDatabaseRefreshOutline = "M6 12.45V9.64C7.47 10.47 9.61 11 12 11S16.53 10.47 18 9.64V12.03C18.17 12 18.33 12 18.5 12C19 12 19.5 12.07 20 12.18V7C20 4.79 16.42 3 12 3S4 4.79 4 7V17C4 19.21 7.59 21 12 21C12.17 21 12.33 21 12.5 21C12.24 20.37 12.09 19.7 12.03 19L12 19C8.13 19 6 17.5 6 17V14.77C7.61 15.55 9.72 16 12 16C12.17 16 12.34 16 12.5 16C12.85 15.18 13.34 14.46 13.95 13.86C13.32 13.95 12.67 14 12 14C9.58 14 7.3 13.4 6 12.45M12 5C15.87 5 18 6.5 18 7S15.87 9 12 9 6 7.5 6 7 8.13 5 12 5M18 18.5L19.77 16.73C19.32 16.28 18.69 16 18 16C16.62 16 15.5 17.12 15.5 18.5S16.62 21 18 21C18.82 21 19.54 20.61 20 20H21.71C21.12 21.47 19.68 22.5 18 22.5C15.79 22.5 14 20.71 14 18.5S15.79 14.5 18 14.5C19.11 14.5 20.11 14.95 20.83 15.67L22 14.5V18.5H18Z";
|
87
90
|
var mdiDelete = "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z";
|
91
|
+
var mdiDotsVertical = "M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z";
|
88
92
|
var mdiEye = "M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z";
|
89
93
|
var mdiEyeOff = "M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z";
|
90
94
|
var mdiFilter = "M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z";
|
95
|
+
var mdiLogout = "M17 7L15.59 8.41L18.17 11H8V13H18.17L15.59 15.58L17 17L22 12M4 5H12V3H4C2.9 3 2 3.9 2 5V19C2 20.1 2.9 21 4 21H12V19H4V5Z";
|
91
96
|
var mdiOpenInNew = "M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z";
|
92
97
|
var mdiPencil = "M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z";
|
93
98
|
var mdiPlusThick = "M20 14H14V20H10V14H4V10H10V4H14V10H20V14Z";
|
@@ -100,7 +105,7 @@ function Breadcrumbs(_a) {
|
|
100
105
|
var {
|
101
106
|
breadcrumbs
|
102
107
|
} = _a,
|
103
|
-
props = __rest
|
108
|
+
props = __rest(_a, ["breadcrumbs"]);
|
104
109
|
return jsx("div", Object.assign({
|
105
110
|
dflex: true,
|
106
111
|
alignItems: "center",
|
@@ -137,7 +142,7 @@ function DialogButton(_a) {
|
|
137
142
|
var {
|
138
143
|
buildDialog
|
139
144
|
} = _a,
|
140
|
-
props = __rest
|
145
|
+
props = __rest(_a, ["buildDialog"]);
|
141
146
|
const [showDialog, setShowDialog] = React.useState(false);
|
142
147
|
const onShowDialog = React.useCallback(event => {
|
143
148
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
@@ -158,7 +163,7 @@ function ButtonBar(_a) {
|
|
158
163
|
var {
|
159
164
|
children
|
160
165
|
} = _a,
|
161
|
-
props = __rest
|
166
|
+
props = __rest(_a, ["children"]);
|
162
167
|
return jsx("div", Object.assign({
|
163
168
|
dflex: true,
|
164
169
|
border: "1px",
|
@@ -176,7 +181,7 @@ const ButtonBarButton = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
176
181
|
icon,
|
177
182
|
children
|
178
183
|
} = _a,
|
179
|
-
props = __rest
|
184
|
+
props = __rest(_a, ["icon", "children"]);
|
180
185
|
return jsxs(Button, Object.assign({
|
181
186
|
scheme: "dark",
|
182
187
|
size: "sm",
|
@@ -202,7 +207,7 @@ const ButtonBarSubmitButton = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
202
207
|
icon,
|
203
208
|
children
|
204
209
|
} = _a,
|
205
|
-
props = __rest
|
210
|
+
props = __rest(_a, ["useDirty", "disabled", "icon", "children"]);
|
206
211
|
const {
|
207
212
|
dirty,
|
208
213
|
handleSubmit
|
@@ -236,7 +241,7 @@ function ButtonBarDialogButton(_a) {
|
|
236
241
|
icon,
|
237
242
|
children
|
238
243
|
} = _a,
|
239
|
-
props = __rest
|
244
|
+
props = __rest(_a, ["icon", "children"]);
|
240
245
|
return jsxs(DialogButton, Object.assign({
|
241
246
|
scheme: "dark",
|
242
247
|
size: "sm",
|
@@ -258,7 +263,7 @@ function InvalidateButton(_a) {
|
|
258
263
|
var {
|
259
264
|
pathOrPermalink
|
260
265
|
} = _a,
|
261
|
-
props = __rest
|
266
|
+
props = __rest(_a, ["pathOrPermalink"]);
|
262
267
|
const api = INVALIDATE_API.new(pathOrPermalink);
|
263
268
|
const mutation = useApiMutation(api.invalidate, api.queryKey);
|
264
269
|
const invalidate = useMutate(mutation, {
|
@@ -276,7 +281,7 @@ function NavigateButton(_a) {
|
|
276
281
|
var {
|
277
282
|
path
|
278
283
|
} = _a,
|
279
|
-
props = __rest
|
284
|
+
props = __rest(_a, ["path"]);
|
280
285
|
const navigate = useNavigate();
|
281
286
|
const handleClick = React.useCallback(() => {
|
282
287
|
navigate(path);
|
@@ -302,7 +307,7 @@ function PublishButton(_a) {
|
|
302
307
|
queryId,
|
303
308
|
api
|
304
309
|
} = _a,
|
305
|
-
props = __rest
|
310
|
+
props = __rest(_a, ["status", "queryId", "api"]);
|
306
311
|
const isDraft = status == "draft";
|
307
312
|
const mutation = useInvalidateMutation(isDraft ? api.publish : api.unpublish, api.queryKey, queryId, {
|
308
313
|
networkMode: "always"
|
@@ -709,7 +714,7 @@ function useHotkeys(keys, callback, options, dependencies) {
|
|
709
714
|
|
710
715
|
function UpdateButton(_a) {
|
711
716
|
var _b;
|
712
|
-
var props = __rest
|
717
|
+
var props = __rest(_a, []);
|
713
718
|
const {
|
714
719
|
dirty,
|
715
720
|
handleSubmit
|
@@ -735,7 +740,7 @@ function ViewButton(_a) {
|
|
735
740
|
path,
|
736
741
|
icon
|
737
742
|
} = _a,
|
738
|
-
props = __rest
|
743
|
+
props = __rest(_a, ["path", "icon"]);
|
739
744
|
const openPage = React.useCallback(() => {
|
740
745
|
window.open(path, '_blank');
|
741
746
|
}, [path]);
|
@@ -794,7 +799,7 @@ function PageContainer(_a) {
|
|
794
799
|
var {
|
795
800
|
children
|
796
801
|
} = _a,
|
797
|
-
props = __rest
|
802
|
+
props = __rest(_a, ["children"]);
|
798
803
|
return jsx(Container, Object.assign({
|
799
804
|
center: true,
|
800
805
|
dflex: true,
|
@@ -805,68 +810,11 @@ function PageContainer(_a) {
|
|
805
810
|
}));
|
806
811
|
}
|
807
812
|
|
808
|
-
/******************************************************************************
|
809
|
-
Copyright (c) Microsoft Corporation.
|
810
|
-
|
811
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
812
|
-
purpose with or without fee is hereby granted.
|
813
|
-
|
814
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
815
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
816
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
817
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
818
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
819
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
820
|
-
PERFORMANCE OF THIS SOFTWARE.
|
821
|
-
***************************************************************************** */
|
822
|
-
|
823
|
-
function __rest(s, e) {
|
824
|
-
var t = {};
|
825
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
826
|
-
t[p] = s[p];
|
827
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
828
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
829
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
830
|
-
t[p[i]] = s[p[i]];
|
831
|
-
}
|
832
|
-
return t;
|
833
|
-
}
|
834
|
-
|
835
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
836
|
-
var e = new Error(message);
|
837
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
838
|
-
};
|
839
|
-
|
840
|
-
function FormEditor(_a) {
|
841
|
-
// const { initialValues } = useFormikContext();
|
842
|
-
var {
|
843
|
-
name,
|
844
|
-
placeholder
|
845
|
-
} = _a,
|
846
|
-
props = __rest(_a, ["name", "placeholder"]);
|
847
|
-
return jsx(Field, {
|
848
|
-
name: name,
|
849
|
-
children: ({
|
850
|
-
field,
|
851
|
-
meta
|
852
|
-
}) => jsx(Editor, Object.assign({}, props, {
|
853
|
-
// placeholder={placeholder}
|
854
|
-
defaultValue: meta.initialValue,
|
855
|
-
onChange: e => field.onChange({
|
856
|
-
target: {
|
857
|
-
name: name,
|
858
|
-
value: e
|
859
|
-
}
|
860
|
-
})
|
861
|
-
}))
|
862
|
-
});
|
863
|
-
}
|
864
|
-
|
865
813
|
function PageMain(_a) {
|
866
814
|
var {
|
867
815
|
children
|
868
816
|
} = _a,
|
869
|
-
props = __rest
|
817
|
+
props = __rest(_a, ["children"]);
|
870
818
|
return jsx(Tile, Object.assign({
|
871
819
|
scheme: "light",
|
872
820
|
p: "5"
|
@@ -879,7 +827,8 @@ function PageContentEditor(_a) {
|
|
879
827
|
var {
|
880
828
|
name
|
881
829
|
} = _a,
|
882
|
-
props = __rest
|
830
|
+
props = __rest(_a, ["name"]);
|
831
|
+
const extensions = [ImageExtension];
|
883
832
|
return jsx(PageMain, Object.assign({
|
884
833
|
h: "min"
|
885
834
|
}, props, {
|
@@ -889,7 +838,8 @@ function PageContentEditor(_a) {
|
|
889
838
|
maxW: props.maxW,
|
890
839
|
// w={props.w}
|
891
840
|
name: name,
|
892
|
-
placeHolder: "Write here..."
|
841
|
+
placeHolder: "Write here...",
|
842
|
+
extensions: extensions
|
893
843
|
})
|
894
844
|
}));
|
895
845
|
}
|
@@ -903,7 +853,7 @@ function PageQueryStateContainerInner(_a) {
|
|
903
853
|
errorStyles,
|
904
854
|
children
|
905
855
|
} = _a,
|
906
|
-
props = __rest
|
856
|
+
props = __rest(_a, ["queryId", "api", "apiFn", "loadingStyles", "errorStyles", "children"]);
|
907
857
|
// @ts-ignore
|
908
858
|
const {
|
909
859
|
data,
|
@@ -929,7 +879,7 @@ function PageSidebar(_a) {
|
|
929
879
|
var {
|
930
880
|
children
|
931
881
|
} = _a,
|
932
|
-
props = __rest
|
882
|
+
props = __rest(_a, ["children"]);
|
933
883
|
return jsx("div", Object.assign({
|
934
884
|
w: "112",
|
935
885
|
minW: "112",
|
@@ -947,7 +897,7 @@ function PageSidebarSection(_a) {
|
|
947
897
|
title,
|
948
898
|
children
|
949
899
|
} = _a,
|
950
|
-
props = __rest
|
900
|
+
props = __rest(_a, ["title", "children"]);
|
951
901
|
return jsxs("div", Object.assign({
|
952
902
|
w: "full"
|
953
903
|
}, props, {
|
@@ -961,7 +911,7 @@ function PageTitle(_a) {
|
|
961
911
|
var {
|
962
912
|
children
|
963
913
|
} = _a,
|
964
|
-
props = __rest
|
914
|
+
props = __rest(_a, ["children"]);
|
965
915
|
return jsx("div", Object.assign({
|
966
916
|
trait: "typo.h5"
|
967
917
|
}, props, {
|
@@ -975,7 +925,7 @@ function PageTopBar(_a) {
|
|
975
925
|
breadcrumbs,
|
976
926
|
children
|
977
927
|
} = _a,
|
978
|
-
props = __rest
|
928
|
+
props = __rest(_a, ["title", "breadcrumbs", "children"]);
|
979
929
|
return jsxs(FlexCenter, Object.assign({
|
980
930
|
gap: "3",
|
981
931
|
minH: "9"
|
@@ -1008,7 +958,7 @@ function PageTabbedTopBar(_a) {
|
|
1008
958
|
breadcrumbs,
|
1009
959
|
children
|
1010
960
|
} = _a,
|
1011
|
-
props = __rest
|
961
|
+
props = __rest(_a, ["title", "breadcrumbs", "children"]);
|
1012
962
|
const ref = /*#__PURE__*/React.createRef();
|
1013
963
|
const {
|
1014
964
|
setContainerEl
|
@@ -1162,7 +1112,7 @@ function DetailsView(_a) {
|
|
1162
1112
|
screen,
|
1163
1113
|
tabbed
|
1164
1114
|
} = _a,
|
1165
|
-
props = __rest
|
1115
|
+
props = __rest(_a, ["queryField", "api", "useNextRouter", "processInput", "screen", "tabbed"]);
|
1166
1116
|
const id = useQueryField(queryField, useNextRouter);
|
1167
1117
|
const ref = React.useRef(null);
|
1168
1118
|
return jsx(PageQueryStateContainer, Object.assign({
|
@@ -1325,7 +1275,7 @@ function QueryWrapper(_a) {
|
|
1325
1275
|
config,
|
1326
1276
|
tabbed
|
1327
1277
|
} = _a,
|
1328
|
-
props = __rest
|
1278
|
+
props = __rest(_a, ["api", "queryField", "fn", "transformFn", "config", "tabbed"]);
|
1329
1279
|
const {
|
1330
1280
|
id,
|
1331
1281
|
api: mApi
|
@@ -1354,7 +1304,7 @@ function TabbedView(_a) {
|
|
1354
1304
|
api,
|
1355
1305
|
screen
|
1356
1306
|
} = _a;
|
1357
|
-
__rest
|
1307
|
+
__rest(_a, ["queryField", "api", "screen"]);
|
1358
1308
|
const {
|
1359
1309
|
[queryField]: id
|
1360
1310
|
} = useParams();
|
@@ -1450,7 +1400,7 @@ function TableContainer(_a) {
|
|
1450
1400
|
columns,
|
1451
1401
|
children
|
1452
1402
|
} = _a,
|
1453
|
-
props = __rest
|
1403
|
+
props = __rest(_a, ["initialPageSize", "initialVisibleColumns", "columns", "children"]);
|
1454
1404
|
return jsx("div", Object.assign({
|
1455
1405
|
w: "full",
|
1456
1406
|
dflex: true,
|
@@ -1472,7 +1422,7 @@ function TableCreateButton(_a) {
|
|
1472
1422
|
icon,
|
1473
1423
|
children
|
1474
1424
|
} = _a,
|
1475
|
-
props = __rest
|
1425
|
+
props = __rest(_a, ["icon", "children"]);
|
1476
1426
|
return jsxs(ButtonBarDialogButton$1, Object.assign({}, props, {
|
1477
1427
|
children: [jsx(Icon, {
|
1478
1428
|
path: icon !== null && icon !== void 0 ? icon : mdiPlusThick
|
@@ -1481,7 +1431,7 @@ function TableCreateButton(_a) {
|
|
1481
1431
|
}
|
1482
1432
|
|
1483
1433
|
function TableFilterButton(_a) {
|
1484
|
-
var props = __rest
|
1434
|
+
var props = __rest(_a, []);
|
1485
1435
|
// return <Button scheme="secondary" {...props}><Icon path={mdiFilter} /></Button>
|
1486
1436
|
return jsxs(Popover, {
|
1487
1437
|
side: "bottom-end",
|
@@ -1528,7 +1478,7 @@ function TableTopBar(_a) {
|
|
1528
1478
|
title,
|
1529
1479
|
children
|
1530
1480
|
} = _a,
|
1531
|
-
props = __rest
|
1481
|
+
props = __rest(_a, ["title", "children"]);
|
1532
1482
|
return jsxs("div", Object.assign({
|
1533
1483
|
dflex: true,
|
1534
1484
|
flexRow: true,
|
@@ -1821,6 +1771,10 @@ function isEqual(a, b) {
|
|
1821
1771
|
return isEqualWith(a, b, noop);
|
1822
1772
|
}
|
1823
1773
|
|
1774
|
+
function capitalize(str) {
|
1775
|
+
return (str.charAt(0).toUpperCase() + str.slice(1).toLowerCase());
|
1776
|
+
}
|
1777
|
+
|
1824
1778
|
function TableFilters({
|
1825
1779
|
form,
|
1826
1780
|
initialValues,
|
@@ -2004,7 +1958,7 @@ function ItemEditDialog(_a) {
|
|
2004
1958
|
onClose,
|
2005
1959
|
formikProps
|
2006
1960
|
} = _a,
|
2007
|
-
props = __rest
|
1961
|
+
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"]);
|
2008
1962
|
const {
|
2009
1963
|
isInitialLoading,
|
2010
1964
|
isFetching,
|
@@ -2200,7 +2154,7 @@ function DialogRenderer({
|
|
2200
2154
|
invalidateQueryKey,
|
2201
2155
|
queryId
|
2202
2156
|
}) {
|
2203
|
-
const props = __rest
|
2157
|
+
const props = __rest(config, ["type"]);
|
2204
2158
|
if (config.type === "dialog") return jsx(ItemEditDialog, Object.assign({}, props, {
|
2205
2159
|
queryId: queryId,
|
2206
2160
|
invalidateQueryKey: invalidateQueryKey,
|
@@ -2255,7 +2209,7 @@ function ItemDeleteDialog(_a) {
|
|
2255
2209
|
show,
|
2256
2210
|
onClose
|
2257
2211
|
} = _a,
|
2258
|
-
props = __rest
|
2212
|
+
props = __rest(_a, ["title", "actionButtonLabel", "itemLabel", "queryId", "api", "apiFn", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
|
2259
2213
|
const fn = apiFn ? api[apiFn] : api.delete;
|
2260
2214
|
const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(fn, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey) : useApiMutation(fn, api.queryKey);
|
2261
2215
|
const mutate = useMutate(mutation, {
|
@@ -2443,7 +2397,7 @@ function TableRowPublishPostButton$1(_a) {
|
|
2443
2397
|
status,
|
2444
2398
|
invalidateQueryKey
|
2445
2399
|
} = _a,
|
2446
|
-
props = __rest
|
2400
|
+
props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
|
2447
2401
|
const isDraft = status == "draft";
|
2448
2402
|
const mutation = useInvalidateParentMutation(isDraft ? api.publish : api.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey, {
|
2449
2403
|
networkMode: "always"
|
@@ -2505,7 +2459,7 @@ function ActionButton(_a) {
|
|
2505
2459
|
var {
|
2506
2460
|
onClick
|
2507
2461
|
} = _a,
|
2508
|
-
props = __rest
|
2462
|
+
props = __rest(_a, ["onClick"]);
|
2509
2463
|
const handleClick = React.useCallback(event => {
|
2510
2464
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
2511
2465
|
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
@@ -2543,7 +2497,7 @@ function useTableProps(api, table, rowActions) {
|
|
2543
2497
|
onRowClick,
|
2544
2498
|
columns: c
|
2545
2499
|
} = table,
|
2546
|
-
props = __rest
|
2500
|
+
props = __rest(table, ["onRowClick", "columns"]);
|
2547
2501
|
const onRowClickHandler = React.useCallback(item => {
|
2548
2502
|
var _a;
|
2549
2503
|
const config = runIfFn(onRowClick, item);
|
@@ -2607,7 +2561,7 @@ function TableView(_a) {
|
|
2607
2561
|
subtitle,
|
2608
2562
|
screen
|
2609
2563
|
} = _a,
|
2610
|
-
props = __rest
|
2564
|
+
props = __rest(_a, ["queryField", "title", "subtitle", "screen"]);
|
2611
2565
|
const id = useId(queryField);
|
2612
2566
|
const _screen = runIfFn(screen, id);
|
2613
2567
|
return jsx(PageContainer, Object.assign({
|
@@ -2810,7 +2764,7 @@ function MultiQueryWrapper(_a) {
|
|
2810
2764
|
config,
|
2811
2765
|
tabbed
|
2812
2766
|
} = _a,
|
2813
|
-
props = __rest
|
2767
|
+
props = __rest(_a, ["queries", "config", "tabbed"]);
|
2814
2768
|
const {
|
2815
2769
|
data,
|
2816
2770
|
isFetching,
|
@@ -2838,7 +2792,7 @@ function ScreenRenderer(_a) {
|
|
2838
2792
|
config,
|
2839
2793
|
tabbed
|
2840
2794
|
} = _a,
|
2841
|
-
props = __rest
|
2795
|
+
props = __rest(_a, ["config", "tabbed"]);
|
2842
2796
|
if (config.type === "table") return jsx(TableView, Object.assign({}, config, props));
|
2843
2797
|
if (config.type === "tabbed") return jsx(TabbedView, Object.assign({}, config, props));
|
2844
2798
|
if (config.type === "details") return jsx(DetailsView, Object.assign({}, config, {
|
@@ -2858,7 +2812,7 @@ function ScreenRenderer(_a) {
|
|
2858
2812
|
*
|
2859
2813
|
*/
|
2860
2814
|
function Content(_a) {
|
2861
|
-
var props = __rest
|
2815
|
+
var props = __rest(_a, []);
|
2862
2816
|
return jsx("div", Object.assign({
|
2863
2817
|
w: "100%",
|
2864
2818
|
h: "100%",
|
@@ -2890,7 +2844,7 @@ function MenuButton(_a) {
|
|
2890
2844
|
selected,
|
2891
2845
|
children
|
2892
2846
|
} = _a,
|
2893
|
-
props = __rest
|
2847
|
+
props = __rest(_a, ["depth", "darkMode", "icon", "selected", "children"]);
|
2894
2848
|
return jsxs(Button, Object.assign({
|
2895
2849
|
as: "li",
|
2896
2850
|
minH: "8",
|
@@ -2917,7 +2871,7 @@ function MenuButton(_a) {
|
|
2917
2871
|
}));
|
2918
2872
|
}
|
2919
2873
|
|
2920
|
-
function MenuItem(_a) {
|
2874
|
+
function MenuItem$1(_a) {
|
2921
2875
|
var {
|
2922
2876
|
icon,
|
2923
2877
|
path,
|
@@ -2925,7 +2879,7 @@ function MenuItem(_a) {
|
|
2925
2879
|
darkMode,
|
2926
2880
|
subMenu
|
2927
2881
|
} = _a,
|
2928
|
-
props = __rest
|
2882
|
+
props = __rest(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
|
2929
2883
|
const location = useLocation();
|
2930
2884
|
const selected = path == "/" ? location.pathname == "/" : location.pathname.startsWith(path.startsWith("/") ? path : `/${path}`);
|
2931
2885
|
const match = useMatch("/" + path) != null;
|
@@ -2944,7 +2898,7 @@ function MenuItem(_a) {
|
|
2944
2898
|
}, props)), match && jsx(SelectedIndicator, {
|
2945
2899
|
darkMode: darkMode
|
2946
2900
|
})]
|
2947
|
-
}), subMenu === null || subMenu === void 0 ? void 0 : subMenu.map((item, index) => jsx(MenuItem, {
|
2901
|
+
}), subMenu === null || subMenu === void 0 ? void 0 : subMenu.map((item, index) => jsx(MenuItem$1, {
|
2948
2902
|
icon: item.icon,
|
2949
2903
|
path: item.path,
|
2950
2904
|
depth: (depth !== null && depth !== void 0 ? depth : 0) + 1,
|
@@ -2963,7 +2917,7 @@ function NextMenuItem(_a) {
|
|
2963
2917
|
darkMode,
|
2964
2918
|
subMenu
|
2965
2919
|
} = _a,
|
2966
|
-
props = __rest
|
2920
|
+
props = __rest(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
|
2967
2921
|
const {
|
2968
2922
|
pathname
|
2969
2923
|
} = useRouter();
|
@@ -3004,8 +2958,8 @@ function Menu(_a) {
|
|
3004
2958
|
config,
|
3005
2959
|
useNextRouter
|
3006
2960
|
} = _a,
|
3007
|
-
props = __rest
|
3008
|
-
const Comp = useNextRouter ? NextMenuItem : MenuItem;
|
2961
|
+
props = __rest(_a, ["darkMode", "config", "useNextRouter"]);
|
2962
|
+
const Comp = useNextRouter ? NextMenuItem : MenuItem$1;
|
3009
2963
|
return jsx("ul", Object.assign({}, props, {
|
3010
2964
|
children: config.map((item, index) => {
|
3011
2965
|
if (item.type == "divider") return jsx(Divider, {
|
@@ -3040,17 +2994,160 @@ function Divider({
|
|
3040
2994
|
});
|
3041
2995
|
}
|
3042
2996
|
|
2997
|
+
function UserBlock({
|
2998
|
+
color,
|
2999
|
+
darkMode,
|
3000
|
+
menuConfig,
|
3001
|
+
path
|
3002
|
+
}) {
|
3003
|
+
var _a, _b, _c, _d;
|
3004
|
+
const {
|
3005
|
+
isLoading,
|
3006
|
+
user
|
3007
|
+
} = useSessionUser();
|
3008
|
+
const navigate = useNavigate();
|
3009
|
+
const handleClick = React.useCallback(() => navigate(path), [navigate, path]);
|
3010
|
+
if (isLoading) return null;
|
3011
|
+
return jsxs("div", {
|
3012
|
+
dflex: true,
|
3013
|
+
alignItems: "center",
|
3014
|
+
border: "0.5",
|
3015
|
+
borderColor: `${color}-${darkMode ? "800" : "200"}`,
|
3016
|
+
ps: "3",
|
3017
|
+
py: "1.5",
|
3018
|
+
textSize: "md",
|
3019
|
+
rounded: "lg",
|
3020
|
+
hover_bgColor: `${color}-${darkMode ? "800" : "200"}`,
|
3021
|
+
cursor: "pointer",
|
3022
|
+
textColor: darkMode ? "white" : "slate-800",
|
3023
|
+
onClick: handleClick,
|
3024
|
+
children: [jsx(Avatar, {
|
3025
|
+
size: "sm",
|
3026
|
+
src: (_b = (_a = user === null || user === void 0 ? void 0 : user.media) === null || _a === void 0 ? void 0 : _a.url) !== null && _b !== void 0 ? _b : "",
|
3027
|
+
name: `${user === null || user === void 0 ? void 0 : user.firstname} ${user === null || user === void 0 ? void 0 : user.lastname}`
|
3028
|
+
}), jsx("span", {
|
3029
|
+
flexGrow: true,
|
3030
|
+
ms: "2",
|
3031
|
+
children: `${capitalize((_d = (_c = user === null || user === void 0 ? void 0 : user.firstname) !== null && _c !== void 0 ? _c : user === null || user === void 0 ? void 0 : user.lastname) !== null && _d !== void 0 ? _d : "Jonathan")}`
|
3032
|
+
}), jsx(IconButton, {
|
3033
|
+
variant: "borderless",
|
3034
|
+
corners: "pill",
|
3035
|
+
scheme: "dark",
|
3036
|
+
textColor: darkMode ? "white" : "slate-800",
|
3037
|
+
hover_textColor: darkMode ? "white" : "slate-800",
|
3038
|
+
hover_bgColor: `${color}-${darkMode ? "900" : "200"}`,
|
3039
|
+
icon: mdiCog,
|
3040
|
+
onClick: handleClick
|
3041
|
+
}), jsx(OverflowMenu, {
|
3042
|
+
color: color,
|
3043
|
+
darkMode: darkMode,
|
3044
|
+
menuConfig: menuConfig
|
3045
|
+
})]
|
3046
|
+
});
|
3047
|
+
}
|
3048
|
+
function OverflowMenu({
|
3049
|
+
color,
|
3050
|
+
darkMode,
|
3051
|
+
menuConfig
|
3052
|
+
}) {
|
3053
|
+
const [showPopup, setShowPopup] = React.useState(false);
|
3054
|
+
const navigate = useNavigate();
|
3055
|
+
const logout = useSessionLogout(false);
|
3056
|
+
return jsx(Fragment, {
|
3057
|
+
children: jsxs(Popup, {
|
3058
|
+
show: showPopup,
|
3059
|
+
position: "relative",
|
3060
|
+
side: "bottom-end",
|
3061
|
+
onClick: e => {
|
3062
|
+
e.preventDefault();
|
3063
|
+
e.stopPropagation();
|
3064
|
+
setShowPopup(show => !show);
|
3065
|
+
},
|
3066
|
+
onHide: () => setShowPopup(false),
|
3067
|
+
children: [jsx(IconButton, {
|
3068
|
+
icon: mdiDotsVertical,
|
3069
|
+
variant: "borderless",
|
3070
|
+
corners: "pill",
|
3071
|
+
scheme: "dark",
|
3072
|
+
textColor: darkMode ? "white" : "slate-800",
|
3073
|
+
hover_textColor: darkMode ? "white" : "slate-800",
|
3074
|
+
hover_bgColor: `${color}-${darkMode ? "900" : "200"}`
|
3075
|
+
}), jsxs("div", {
|
3076
|
+
bgColor: "white",
|
3077
|
+
rounded: "sm",
|
3078
|
+
overflow: "hidden",
|
3079
|
+
shadow: true,
|
3080
|
+
mt: "1",
|
3081
|
+
border: "px",
|
3082
|
+
borderColor: "gray-200",
|
3083
|
+
divideColor: "gray-200",
|
3084
|
+
divideY: "px",
|
3085
|
+
minW: "40",
|
3086
|
+
children: [menuConfig && menuConfig.length > 0 && menuConfig.map((item, index) => {
|
3087
|
+
if (item.type == "item") {
|
3088
|
+
return jsx(MenuItem, {
|
3089
|
+
icon: item.icon,
|
3090
|
+
onClick: () => navigate(item.path),
|
3091
|
+
children: item.label
|
3092
|
+
}, index);
|
3093
|
+
}
|
3094
|
+
return null;
|
3095
|
+
}), jsx(MenuItem, {
|
3096
|
+
icon: mdiLogout,
|
3097
|
+
onClick: logout,
|
3098
|
+
children: "Logout"
|
3099
|
+
})]
|
3100
|
+
})]
|
3101
|
+
})
|
3102
|
+
});
|
3103
|
+
}
|
3104
|
+
function MenuItem(_a) {
|
3105
|
+
var {
|
3106
|
+
icon,
|
3107
|
+
onClick,
|
3108
|
+
children
|
3109
|
+
} = _a,
|
3110
|
+
props = __rest(_a, ["icon", "onClick", "children"]);
|
3111
|
+
const handleClick = React.useCallback(e => {
|
3112
|
+
e.preventDefault();
|
3113
|
+
e.stopPropagation();
|
3114
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
3115
|
+
}, []);
|
3116
|
+
return jsxs(Button, Object.assign({
|
3117
|
+
variant: "borderless",
|
3118
|
+
scheme: "dark",
|
3119
|
+
size: "sm",
|
3120
|
+
alignItems: "center",
|
3121
|
+
dflex: true,
|
3122
|
+
gap: "2",
|
3123
|
+
px: "2",
|
3124
|
+
py: "1.5",
|
3125
|
+
w: "full",
|
3126
|
+
onClick: handleClick,
|
3127
|
+
textColor: "slate-700"
|
3128
|
+
}, props, {
|
3129
|
+
children: [icon && jsx(Icon, {
|
3130
|
+
path: icon,
|
3131
|
+
size: "md"
|
3132
|
+
}), children]
|
3133
|
+
}));
|
3134
|
+
}
|
3135
|
+
|
3043
3136
|
function Sidebar(_a) {
|
3044
3137
|
var {
|
3045
3138
|
show,
|
3046
3139
|
logo,
|
3047
3140
|
title,
|
3048
3141
|
menuConfig,
|
3142
|
+
userMenuConfig,
|
3143
|
+
userSettingsPath,
|
3049
3144
|
color,
|
3050
3145
|
darkMode
|
3051
3146
|
} = _a,
|
3052
|
-
props = __rest
|
3147
|
+
props = __rest(_a, ["show", "logo", "title", "menuConfig", "userMenuConfig", "userSettingsPath", "color", "darkMode"]);
|
3053
3148
|
return jsxs("div", Object.assign({
|
3149
|
+
dflex: true,
|
3150
|
+
flexCol: true,
|
3054
3151
|
w: "64",
|
3055
3152
|
minH: "screen",
|
3056
3153
|
p: "0",
|
@@ -3078,6 +3175,14 @@ function Sidebar(_a) {
|
|
3078
3175
|
p: "4",
|
3079
3176
|
darkMode: darkMode,
|
3080
3177
|
config: menuConfig
|
3178
|
+
}), jsx("div", {
|
3179
|
+
p: "2",
|
3180
|
+
children: jsx(UserBlock, {
|
3181
|
+
darkMode: darkMode,
|
3182
|
+
color: color,
|
3183
|
+
menuConfig: userMenuConfig,
|
3184
|
+
path: userSettingsPath
|
3185
|
+
})
|
3081
3186
|
})]
|
3082
3187
|
}));
|
3083
3188
|
}
|
@@ -3087,7 +3192,7 @@ function Logo(_a) {
|
|
3087
3192
|
height,
|
3088
3193
|
darkMode
|
3089
3194
|
} = _a,
|
3090
|
-
props = __rest
|
3195
|
+
props = __rest(_a, ["width", "height", "darkMode"]);
|
3091
3196
|
return jsx("div", Object.assign({}, props, {
|
3092
3197
|
children: jsx(Image, {
|
3093
3198
|
src: `/logo_${darkMode ? "light" : "dark"}.png`,
|
@@ -3106,9 +3211,11 @@ function AdminLayout(_a) {
|
|
3106
3211
|
darkMode,
|
3107
3212
|
logo,
|
3108
3213
|
title,
|
3109
|
-
menuConfig
|
3214
|
+
menuConfig,
|
3215
|
+
userMenuConfig,
|
3216
|
+
userSettingsPath
|
3110
3217
|
} = _a,
|
3111
|
-
props = __rest
|
3218
|
+
props = __rest(_a, ["color", "darkMode", "logo", "title", "menuConfig", "userMenuConfig", "userSettingsPath"]);
|
3112
3219
|
return jsxs("div", Object.assign({
|
3113
3220
|
w: "full",
|
3114
3221
|
h: "screen",
|
@@ -3121,7 +3228,9 @@ function AdminLayout(_a) {
|
|
3121
3228
|
darkMode: darkMode,
|
3122
3229
|
logo: logo,
|
3123
3230
|
title: title,
|
3124
|
-
menuConfig: menuConfig
|
3231
|
+
menuConfig: menuConfig,
|
3232
|
+
userMenuConfig: userMenuConfig,
|
3233
|
+
userSettingsPath: userSettingsPath
|
3125
3234
|
}), jsx("div", {
|
3126
3235
|
w: "screen",
|
3127
3236
|
py: "2",
|
@@ -3139,7 +3248,9 @@ function LeftPanel({
|
|
3139
3248
|
darkMode,
|
3140
3249
|
logo,
|
3141
3250
|
title,
|
3142
|
-
menuConfig
|
3251
|
+
menuConfig,
|
3252
|
+
userMenuConfig,
|
3253
|
+
userSettingsPath
|
3143
3254
|
}) {
|
3144
3255
|
const [isOpen, __, toggle] = useBoolean(true);
|
3145
3256
|
useHotkeys('ctrl+t', () => toggle(), [toggle]);
|
@@ -3154,7 +3265,9 @@ function LeftPanel({
|
|
3154
3265
|
darkMode: darkMode,
|
3155
3266
|
logo: logo,
|
3156
3267
|
title: title,
|
3157
|
-
menuConfig: menuConfig
|
3268
|
+
menuConfig: menuConfig,
|
3269
|
+
userMenuConfig: userMenuConfig,
|
3270
|
+
userSettingsPath: userSettingsPath
|
3158
3271
|
}), jsx(IconButton, {
|
3159
3272
|
icon: mdiArrowLeft,
|
3160
3273
|
transition: "all",
|
@@ -3198,7 +3311,7 @@ function AttachDialog(_a) {
|
|
3198
3311
|
formikProps,
|
3199
3312
|
getItemName
|
3200
3313
|
} = _a,
|
3201
|
-
props = __rest
|
3314
|
+
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"]);
|
3202
3315
|
const queryClient = useQueryClient();
|
3203
3316
|
const {
|
3204
3317
|
data: attached,
|
@@ -3324,7 +3437,7 @@ function ListItem(_a) {
|
|
3324
3437
|
value,
|
3325
3438
|
checked
|
3326
3439
|
} = _a,
|
3327
|
-
props = __rest
|
3440
|
+
props = __rest(_a, ["label", "value", "checked"]);
|
3328
3441
|
return jsxs("div", Object.assign({
|
3329
3442
|
dflex: true,
|
3330
3443
|
alignItems: "center",
|
@@ -3369,7 +3482,7 @@ function FormActionDialog(_a) {
|
|
3369
3482
|
onClose,
|
3370
3483
|
formikProps
|
3371
3484
|
} = _a,
|
3372
|
-
props = __rest
|
3485
|
+
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"]);
|
3373
3486
|
const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(queryFn, queryKey, queryOptions) : useApiMutation(queryFn, queryKey, queryId, queryOptions);
|
3374
3487
|
const mutate = useMutate(mutation, {
|
3375
3488
|
onSuccess,
|
@@ -3421,7 +3534,7 @@ function PageSectionTitle(_a) {
|
|
3421
3534
|
var {
|
3422
3535
|
children
|
3423
3536
|
} = _a,
|
3424
|
-
props = __rest
|
3537
|
+
props = __rest(_a, ["children"]);
|
3425
3538
|
return jsx("div", Object.assign({
|
3426
3539
|
trait: "typo.h6",
|
3427
3540
|
mb: "5"
|
@@ -3435,7 +3548,7 @@ const PageStateContainer = /*#__PURE__*/React.forwardRef((_a, ref) => {
|
|
3435
3548
|
loading = false,
|
3436
3549
|
children
|
3437
3550
|
} = _a,
|
3438
|
-
props = __rest
|
3551
|
+
props = __rest(_a, ["loading", "children"]);
|
3439
3552
|
return jsxs(Fragment, {
|
3440
3553
|
children: [loading && jsx(QueryLoadingState, {
|
3441
3554
|
w: "full",
|
@@ -3457,7 +3570,7 @@ function PageSubSectionTitle(_a) {
|
|
3457
3570
|
var {
|
3458
3571
|
children
|
3459
3572
|
} = _a,
|
3460
|
-
props = __rest
|
3573
|
+
props = __rest(_a, ["children"]);
|
3461
3574
|
return jsx("div", Object.assign({
|
3462
3575
|
trait: "typo.h6",
|
3463
3576
|
mb: "3"
|
@@ -3486,7 +3599,7 @@ function StatusBadge(_a) {
|
|
3486
3599
|
var {
|
3487
3600
|
status
|
3488
3601
|
} = _a,
|
3489
|
-
props = __rest
|
3602
|
+
props = __rest(_a, ["status"]);
|
3490
3603
|
return jsx(Badge, Object.assign({
|
3491
3604
|
size: "sm",
|
3492
3605
|
variant: "glass",
|
@@ -3504,7 +3617,7 @@ function TableRowActionButton(_a) {
|
|
3504
3617
|
icon,
|
3505
3618
|
children
|
3506
3619
|
} = _a,
|
3507
|
-
props = __rest
|
3620
|
+
props = __rest(_a, ["icon", "children"]);
|
3508
3621
|
return jsxs(Button, Object.assign({
|
3509
3622
|
dflex: true,
|
3510
3623
|
alignContent: "center",
|
@@ -3528,7 +3641,7 @@ function TableRowViewButton(_a) {
|
|
3528
3641
|
var {
|
3529
3642
|
path
|
3530
3643
|
} = _a,
|
3531
|
-
props = __rest
|
3644
|
+
props = __rest(_a, ["path"]);
|
3532
3645
|
const openPage = React.useCallback(event => {
|
3533
3646
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
3534
3647
|
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
@@ -3544,7 +3657,7 @@ function TableRowNavigateButton(_a) {
|
|
3544
3657
|
var {
|
3545
3658
|
path
|
3546
3659
|
} = _a,
|
3547
|
-
props = __rest
|
3660
|
+
props = __rest(_a, ["path"]);
|
3548
3661
|
const navigate = useNavigate();
|
3549
3662
|
const handleClick = React.useCallback(event => {
|
3550
3663
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
@@ -3562,7 +3675,7 @@ function TableRowActionDialogButton(_a) {
|
|
3562
3675
|
icon,
|
3563
3676
|
children
|
3564
3677
|
} = _a,
|
3565
|
-
props = __rest
|
3678
|
+
props = __rest(_a, ["icon", "children"]);
|
3566
3679
|
return jsxs(DialogButton$1, Object.assign({
|
3567
3680
|
dflex: true,
|
3568
3681
|
alignContent: "center",
|
@@ -3586,7 +3699,7 @@ function TableRowEditButton(_a) {
|
|
3586
3699
|
var {
|
3587
3700
|
children
|
3588
3701
|
} = _a,
|
3589
|
-
props = __rest
|
3702
|
+
props = __rest(_a, ["children"]);
|
3590
3703
|
return jsx(TableRowActionDialogButton, Object.assign({
|
3591
3704
|
icon: mdiPencil
|
3592
3705
|
}, props, {
|
@@ -3598,7 +3711,7 @@ function TableRowDeleteButton(_a) {
|
|
3598
3711
|
var {
|
3599
3712
|
children
|
3600
3713
|
} = _a,
|
3601
|
-
props = __rest
|
3714
|
+
props = __rest(_a, ["children"]);
|
3602
3715
|
return jsx(TableRowActionDialogButton, Object.assign({
|
3603
3716
|
icon: mdiDelete
|
3604
3717
|
}, props, {
|
@@ -3615,7 +3728,7 @@ function TableRowActionBar(_a) {
|
|
3615
3728
|
deleteDialog,
|
3616
3729
|
children
|
3617
3730
|
} = _a,
|
3618
|
-
props = __rest
|
3731
|
+
props = __rest(_a, ["publishId", "viewPath", "navigatePath", "editDialog", "deleteDialog", "children"]);
|
3619
3732
|
return jsxs("div", Object.assign({
|
3620
3733
|
dflex: true,
|
3621
3734
|
spaceX: "1",
|
@@ -3640,7 +3753,7 @@ function TableRowPublishPostButton(_a) {
|
|
3640
3753
|
status,
|
3641
3754
|
invalidateQueryKey
|
3642
3755
|
} = _a,
|
3643
|
-
props = __rest
|
3756
|
+
props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
|
3644
3757
|
const isDraft = status == "draft";
|
3645
3758
|
const mutation = useInvalidateParentMutation(isDraft ? api.publish : api.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey, {
|
3646
3759
|
networkMode: "always"
|