@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.cjs.js
CHANGED
@@ -16,6 +16,7 @@ require('react/jsx-runtime');
|
|
16
16
|
var components = require('@compill/components');
|
17
17
|
var form = require('@compill/form');
|
18
18
|
var react = require('@soperio/react');
|
19
|
+
var formEditor = require('@compill/form-editor');
|
19
20
|
var editor = require('@compill/editor');
|
20
21
|
var reactDom = require('react-dom');
|
21
22
|
var router = require('next/router');
|
@@ -24,6 +25,7 @@ var hooks = require('@compill/hooks');
|
|
24
25
|
var env = require('@compill/env');
|
25
26
|
var reactQuery = require('@tanstack/react-query');
|
26
27
|
var Image = require('next/image');
|
28
|
+
var auth = require('@compill/auth');
|
27
29
|
|
28
30
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
29
31
|
|
@@ -46,7 +48,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
46
48
|
PERFORMANCE OF THIS SOFTWARE.
|
47
49
|
***************************************************************************** */
|
48
50
|
|
49
|
-
function __rest
|
51
|
+
function __rest(s, e) {
|
50
52
|
var t = {};
|
51
53
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
52
54
|
t[p] = s[p];
|
@@ -77,7 +79,7 @@ function SectionTitle(_a) {
|
|
77
79
|
var {
|
78
80
|
children
|
79
81
|
} = _a,
|
80
|
-
props = __rest
|
82
|
+
props = __rest(_a, ["children"]);
|
81
83
|
return jsxRuntime.jsx("h2", Object.assign({
|
82
84
|
textSize: "xl",
|
83
85
|
fontWeight: "600",
|
@@ -93,11 +95,14 @@ var mdiArrowLeft = "M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.
|
|
93
95
|
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";
|
94
96
|
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";
|
95
97
|
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";
|
98
|
+
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";
|
96
99
|
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";
|
97
100
|
var mdiDelete = "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z";
|
101
|
+
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";
|
98
102
|
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";
|
99
103
|
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";
|
100
104
|
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";
|
105
|
+
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";
|
101
106
|
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";
|
102
107
|
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";
|
103
108
|
var mdiPlusThick = "M20 14H14V20H10V14H4V10H10V4H14V10H20V14Z";
|
@@ -110,7 +115,7 @@ function Breadcrumbs(_a) {
|
|
110
115
|
var {
|
111
116
|
breadcrumbs
|
112
117
|
} = _a,
|
113
|
-
props = __rest
|
118
|
+
props = __rest(_a, ["breadcrumbs"]);
|
114
119
|
return jsxRuntime.jsx("div", Object.assign({
|
115
120
|
dflex: true,
|
116
121
|
alignItems: "center",
|
@@ -147,7 +152,7 @@ function DialogButton(_a) {
|
|
147
152
|
var {
|
148
153
|
buildDialog
|
149
154
|
} = _a,
|
150
|
-
props = __rest
|
155
|
+
props = __rest(_a, ["buildDialog"]);
|
151
156
|
const [showDialog, setShowDialog] = React__default["default"].useState(false);
|
152
157
|
const onShowDialog = React__default["default"].useCallback(event => {
|
153
158
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
@@ -168,7 +173,7 @@ function ButtonBar(_a) {
|
|
168
173
|
var {
|
169
174
|
children
|
170
175
|
} = _a,
|
171
|
-
props = __rest
|
176
|
+
props = __rest(_a, ["children"]);
|
172
177
|
return jsxRuntime.jsx("div", Object.assign({
|
173
178
|
dflex: true,
|
174
179
|
border: "1px",
|
@@ -186,7 +191,7 @@ const ButtonBarButton = /*#__PURE__*/React__default["default"].forwardRef(functi
|
|
186
191
|
icon,
|
187
192
|
children
|
188
193
|
} = _a,
|
189
|
-
props = __rest
|
194
|
+
props = __rest(_a, ["icon", "children"]);
|
190
195
|
return jsxRuntime.jsxs(ui.Button, Object.assign({
|
191
196
|
scheme: "dark",
|
192
197
|
size: "sm",
|
@@ -212,7 +217,7 @@ const ButtonBarSubmitButton = /*#__PURE__*/React__default["default"].forwardRef(
|
|
212
217
|
icon,
|
213
218
|
children
|
214
219
|
} = _a,
|
215
|
-
props = __rest
|
220
|
+
props = __rest(_a, ["useDirty", "disabled", "icon", "children"]);
|
216
221
|
const {
|
217
222
|
dirty,
|
218
223
|
handleSubmit
|
@@ -246,7 +251,7 @@ function ButtonBarDialogButton(_a) {
|
|
246
251
|
icon,
|
247
252
|
children
|
248
253
|
} = _a,
|
249
|
-
props = __rest
|
254
|
+
props = __rest(_a, ["icon", "children"]);
|
250
255
|
return jsxRuntime.jsxs(DialogButton, Object.assign({
|
251
256
|
scheme: "dark",
|
252
257
|
size: "sm",
|
@@ -268,7 +273,7 @@ function InvalidateButton(_a) {
|
|
268
273
|
var {
|
269
274
|
pathOrPermalink
|
270
275
|
} = _a,
|
271
|
-
props = __rest
|
276
|
+
props = __rest(_a, ["pathOrPermalink"]);
|
272
277
|
const api$1 = adminApi.INVALIDATE_API.new(pathOrPermalink);
|
273
278
|
const mutation = api.useApiMutation(api$1.invalidate, api$1.queryKey);
|
274
279
|
const invalidate = api.useMutate(mutation, {
|
@@ -286,7 +291,7 @@ function NavigateButton(_a) {
|
|
286
291
|
var {
|
287
292
|
path
|
288
293
|
} = _a,
|
289
|
-
props = __rest
|
294
|
+
props = __rest(_a, ["path"]);
|
290
295
|
const navigate = reactRouterDom.useNavigate();
|
291
296
|
const handleClick = React__default["default"].useCallback(() => {
|
292
297
|
navigate(path);
|
@@ -312,7 +317,7 @@ function PublishButton(_a) {
|
|
312
317
|
queryId,
|
313
318
|
api: api$1
|
314
319
|
} = _a,
|
315
|
-
props = __rest
|
320
|
+
props = __rest(_a, ["status", "queryId", "api"]);
|
316
321
|
const isDraft = status == "draft";
|
317
322
|
const mutation = api.useInvalidateMutation(isDraft ? api$1.publish : api$1.unpublish, api$1.queryKey, queryId, {
|
318
323
|
networkMode: "always"
|
@@ -719,7 +724,7 @@ function useHotkeys(keys, callback, options, dependencies) {
|
|
719
724
|
|
720
725
|
function UpdateButton(_a) {
|
721
726
|
var _b;
|
722
|
-
var props = __rest
|
727
|
+
var props = __rest(_a, []);
|
723
728
|
const {
|
724
729
|
dirty,
|
725
730
|
handleSubmit
|
@@ -745,7 +750,7 @@ function ViewButton(_a) {
|
|
745
750
|
path,
|
746
751
|
icon
|
747
752
|
} = _a,
|
748
|
-
props = __rest
|
753
|
+
props = __rest(_a, ["path", "icon"]);
|
749
754
|
const openPage = React__default["default"].useCallback(() => {
|
750
755
|
window.open(path, '_blank');
|
751
756
|
}, [path]);
|
@@ -804,7 +809,7 @@ function PageContainer(_a) {
|
|
804
809
|
var {
|
805
810
|
children
|
806
811
|
} = _a,
|
807
|
-
props = __rest
|
812
|
+
props = __rest(_a, ["children"]);
|
808
813
|
return jsxRuntime.jsx(ui.Container, Object.assign({
|
809
814
|
center: true,
|
810
815
|
dflex: true,
|
@@ -815,68 +820,11 @@ function PageContainer(_a) {
|
|
815
820
|
}));
|
816
821
|
}
|
817
822
|
|
818
|
-
/******************************************************************************
|
819
|
-
Copyright (c) Microsoft Corporation.
|
820
|
-
|
821
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
822
|
-
purpose with or without fee is hereby granted.
|
823
|
-
|
824
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
825
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
826
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
827
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
828
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
829
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
830
|
-
PERFORMANCE OF THIS SOFTWARE.
|
831
|
-
***************************************************************************** */
|
832
|
-
|
833
|
-
function __rest(s, e) {
|
834
|
-
var t = {};
|
835
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
836
|
-
t[p] = s[p];
|
837
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
838
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
839
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
840
|
-
t[p[i]] = s[p[i]];
|
841
|
-
}
|
842
|
-
return t;
|
843
|
-
}
|
844
|
-
|
845
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
846
|
-
var e = new Error(message);
|
847
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
848
|
-
};
|
849
|
-
|
850
|
-
function FormEditor(_a) {
|
851
|
-
// const { initialValues } = useFormikContext();
|
852
|
-
var {
|
853
|
-
name,
|
854
|
-
placeholder
|
855
|
-
} = _a,
|
856
|
-
props = __rest(_a, ["name", "placeholder"]);
|
857
|
-
return jsxRuntime.jsx(formik.Field, {
|
858
|
-
name: name,
|
859
|
-
children: ({
|
860
|
-
field,
|
861
|
-
meta
|
862
|
-
}) => jsxRuntime.jsx(editor.Editor, Object.assign({}, props, {
|
863
|
-
// placeholder={placeholder}
|
864
|
-
defaultValue: meta.initialValue,
|
865
|
-
onChange: e => field.onChange({
|
866
|
-
target: {
|
867
|
-
name: name,
|
868
|
-
value: e
|
869
|
-
}
|
870
|
-
})
|
871
|
-
}))
|
872
|
-
});
|
873
|
-
}
|
874
|
-
|
875
823
|
function PageMain(_a) {
|
876
824
|
var {
|
877
825
|
children
|
878
826
|
} = _a,
|
879
|
-
props = __rest
|
827
|
+
props = __rest(_a, ["children"]);
|
880
828
|
return jsxRuntime.jsx(ui.Tile, Object.assign({
|
881
829
|
scheme: "light",
|
882
830
|
p: "5"
|
@@ -889,17 +837,19 @@ function PageContentEditor(_a) {
|
|
889
837
|
var {
|
890
838
|
name
|
891
839
|
} = _a,
|
892
|
-
props = __rest
|
840
|
+
props = __rest(_a, ["name"]);
|
841
|
+
const extensions = [editor.ImageExtension];
|
893
842
|
return jsxRuntime.jsx(PageMain, Object.assign({
|
894
843
|
h: "min"
|
895
844
|
}, props, {
|
896
|
-
children: jsxRuntime.jsx(FormEditor, {
|
845
|
+
children: jsxRuntime.jsx(formEditor.FormEditor, {
|
897
846
|
minH: "128",
|
898
847
|
minW: "144",
|
899
848
|
maxW: props.maxW,
|
900
849
|
// w={props.w}
|
901
850
|
name: name,
|
902
|
-
placeHolder: "Write here..."
|
851
|
+
placeHolder: "Write here...",
|
852
|
+
extensions: extensions
|
903
853
|
})
|
904
854
|
}));
|
905
855
|
}
|
@@ -913,7 +863,7 @@ function PageQueryStateContainerInner(_a) {
|
|
913
863
|
errorStyles,
|
914
864
|
children
|
915
865
|
} = _a,
|
916
|
-
props = __rest
|
866
|
+
props = __rest(_a, ["queryId", "api", "apiFn", "loadingStyles", "errorStyles", "children"]);
|
917
867
|
// @ts-ignore
|
918
868
|
const {
|
919
869
|
data,
|
@@ -939,7 +889,7 @@ function PageSidebar(_a) {
|
|
939
889
|
var {
|
940
890
|
children
|
941
891
|
} = _a,
|
942
|
-
props = __rest
|
892
|
+
props = __rest(_a, ["children"]);
|
943
893
|
return jsxRuntime.jsx("div", Object.assign({
|
944
894
|
w: "112",
|
945
895
|
minW: "112",
|
@@ -957,7 +907,7 @@ function PageSidebarSection(_a) {
|
|
957
907
|
title,
|
958
908
|
children
|
959
909
|
} = _a,
|
960
|
-
props = __rest
|
910
|
+
props = __rest(_a, ["title", "children"]);
|
961
911
|
return jsxRuntime.jsxs("div", Object.assign({
|
962
912
|
w: "full"
|
963
913
|
}, props, {
|
@@ -971,7 +921,7 @@ function PageTitle(_a) {
|
|
971
921
|
var {
|
972
922
|
children
|
973
923
|
} = _a,
|
974
|
-
props = __rest
|
924
|
+
props = __rest(_a, ["children"]);
|
975
925
|
return jsxRuntime.jsx("div", Object.assign({
|
976
926
|
trait: "typo.h5"
|
977
927
|
}, props, {
|
@@ -985,7 +935,7 @@ function PageTopBar(_a) {
|
|
985
935
|
breadcrumbs,
|
986
936
|
children
|
987
937
|
} = _a,
|
988
|
-
props = __rest
|
938
|
+
props = __rest(_a, ["title", "breadcrumbs", "children"]);
|
989
939
|
return jsxRuntime.jsxs(components.FlexCenter, Object.assign({
|
990
940
|
gap: "3",
|
991
941
|
minH: "9"
|
@@ -1018,7 +968,7 @@ function PageTabbedTopBar(_a) {
|
|
1018
968
|
breadcrumbs,
|
1019
969
|
children
|
1020
970
|
} = _a,
|
1021
|
-
props = __rest
|
971
|
+
props = __rest(_a, ["title", "breadcrumbs", "children"]);
|
1022
972
|
const ref = /*#__PURE__*/React__default["default"].createRef();
|
1023
973
|
const {
|
1024
974
|
setContainerEl
|
@@ -1172,7 +1122,7 @@ function DetailsView(_a) {
|
|
1172
1122
|
screen,
|
1173
1123
|
tabbed
|
1174
1124
|
} = _a,
|
1175
|
-
props = __rest
|
1125
|
+
props = __rest(_a, ["queryField", "api", "useNextRouter", "processInput", "screen", "tabbed"]);
|
1176
1126
|
const id = useQueryField(queryField, useNextRouter);
|
1177
1127
|
const ref = React__default["default"].useRef(null);
|
1178
1128
|
return jsxRuntime.jsx(PageQueryStateContainer, Object.assign({
|
@@ -1335,7 +1285,7 @@ function QueryWrapper(_a) {
|
|
1335
1285
|
config,
|
1336
1286
|
tabbed
|
1337
1287
|
} = _a,
|
1338
|
-
props = __rest
|
1288
|
+
props = __rest(_a, ["api", "queryField", "fn", "transformFn", "config", "tabbed"]);
|
1339
1289
|
const {
|
1340
1290
|
id,
|
1341
1291
|
api: mApi
|
@@ -1364,7 +1314,7 @@ function TabbedView(_a) {
|
|
1364
1314
|
api,
|
1365
1315
|
screen
|
1366
1316
|
} = _a;
|
1367
|
-
__rest
|
1317
|
+
__rest(_a, ["queryField", "api", "screen"]);
|
1368
1318
|
const {
|
1369
1319
|
[queryField]: id
|
1370
1320
|
} = reactRouterDom.useParams();
|
@@ -1460,7 +1410,7 @@ function TableContainer(_a) {
|
|
1460
1410
|
columns,
|
1461
1411
|
children
|
1462
1412
|
} = _a,
|
1463
|
-
props = __rest
|
1413
|
+
props = __rest(_a, ["initialPageSize", "initialVisibleColumns", "columns", "children"]);
|
1464
1414
|
return jsxRuntime.jsx("div", Object.assign({
|
1465
1415
|
w: "full",
|
1466
1416
|
dflex: true,
|
@@ -1482,7 +1432,7 @@ function TableCreateButton(_a) {
|
|
1482
1432
|
icon,
|
1483
1433
|
children
|
1484
1434
|
} = _a,
|
1485
|
-
props = __rest
|
1435
|
+
props = __rest(_a, ["icon", "children"]);
|
1486
1436
|
return jsxRuntime.jsxs(admin.ButtonBarDialogButton, Object.assign({}, props, {
|
1487
1437
|
children: [jsxRuntime.jsx(ui.Icon, {
|
1488
1438
|
path: icon !== null && icon !== void 0 ? icon : mdiPlusThick
|
@@ -1491,7 +1441,7 @@ function TableCreateButton(_a) {
|
|
1491
1441
|
}
|
1492
1442
|
|
1493
1443
|
function TableFilterButton(_a) {
|
1494
|
-
var props = __rest
|
1444
|
+
var props = __rest(_a, []);
|
1495
1445
|
// return <Button scheme="secondary" {...props}><Icon path={mdiFilter} /></Button>
|
1496
1446
|
return jsxRuntime.jsxs(ui.Popover, {
|
1497
1447
|
side: "bottom-end",
|
@@ -1538,7 +1488,7 @@ function TableTopBar(_a) {
|
|
1538
1488
|
title,
|
1539
1489
|
children
|
1540
1490
|
} = _a,
|
1541
|
-
props = __rest
|
1491
|
+
props = __rest(_a, ["title", "children"]);
|
1542
1492
|
return jsxRuntime.jsxs("div", Object.assign({
|
1543
1493
|
dflex: true,
|
1544
1494
|
flexRow: true,
|
@@ -1831,6 +1781,10 @@ function isEqual(a, b) {
|
|
1831
1781
|
return isEqualWith(a, b, noop);
|
1832
1782
|
}
|
1833
1783
|
|
1784
|
+
function capitalize(str) {
|
1785
|
+
return (str.charAt(0).toUpperCase() + str.slice(1).toLowerCase());
|
1786
|
+
}
|
1787
|
+
|
1834
1788
|
function TableFilters({
|
1835
1789
|
form: form$1,
|
1836
1790
|
initialValues,
|
@@ -2014,7 +1968,7 @@ function ItemEditDialog(_a) {
|
|
2014
1968
|
onClose,
|
2015
1969
|
formikProps
|
2016
1970
|
} = _a,
|
2017
|
-
props = __rest
|
1971
|
+
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"]);
|
2018
1972
|
const {
|
2019
1973
|
isInitialLoading,
|
2020
1974
|
isFetching,
|
@@ -2210,7 +2164,7 @@ function DialogRenderer({
|
|
2210
2164
|
invalidateQueryKey,
|
2211
2165
|
queryId
|
2212
2166
|
}) {
|
2213
|
-
const props = __rest
|
2167
|
+
const props = __rest(config, ["type"]);
|
2214
2168
|
if (config.type === "dialog") return jsxRuntime.jsx(ItemEditDialog, Object.assign({}, props, {
|
2215
2169
|
queryId: queryId,
|
2216
2170
|
invalidateQueryKey: invalidateQueryKey,
|
@@ -2265,7 +2219,7 @@ function ItemDeleteDialog(_a) {
|
|
2265
2219
|
show,
|
2266
2220
|
onClose
|
2267
2221
|
} = _a,
|
2268
|
-
props = __rest
|
2222
|
+
props = __rest(_a, ["title", "actionButtonLabel", "itemLabel", "queryId", "api", "apiFn", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
|
2269
2223
|
const fn = apiFn ? api$1[apiFn] : api$1.delete;
|
2270
2224
|
const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(fn, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey) : api.useApiMutation(fn, api$1.queryKey);
|
2271
2225
|
const mutate = api.useMutate(mutation, {
|
@@ -2453,7 +2407,7 @@ function TableRowPublishPostButton$1(_a) {
|
|
2453
2407
|
status,
|
2454
2408
|
invalidateQueryKey
|
2455
2409
|
} = _a,
|
2456
|
-
props = __rest
|
2410
|
+
props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
|
2457
2411
|
const isDraft = status == "draft";
|
2458
2412
|
const mutation = api.useInvalidateParentMutation(isDraft ? api$1.publish : api$1.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey, {
|
2459
2413
|
networkMode: "always"
|
@@ -2515,7 +2469,7 @@ function ActionButton(_a) {
|
|
2515
2469
|
var {
|
2516
2470
|
onClick
|
2517
2471
|
} = _a,
|
2518
|
-
props = __rest
|
2472
|
+
props = __rest(_a, ["onClick"]);
|
2519
2473
|
const handleClick = React__default["default"].useCallback(event => {
|
2520
2474
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
2521
2475
|
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
@@ -2553,7 +2507,7 @@ function useTableProps(api, table, rowActions) {
|
|
2553
2507
|
onRowClick,
|
2554
2508
|
columns: c
|
2555
2509
|
} = table,
|
2556
|
-
props = __rest
|
2510
|
+
props = __rest(table, ["onRowClick", "columns"]);
|
2557
2511
|
const onRowClickHandler = React__default["default"].useCallback(item => {
|
2558
2512
|
var _a;
|
2559
2513
|
const config = react.runIfFn(onRowClick, item);
|
@@ -2617,7 +2571,7 @@ function TableView(_a) {
|
|
2617
2571
|
subtitle,
|
2618
2572
|
screen
|
2619
2573
|
} = _a,
|
2620
|
-
props = __rest
|
2574
|
+
props = __rest(_a, ["queryField", "title", "subtitle", "screen"]);
|
2621
2575
|
const id = useId(queryField);
|
2622
2576
|
const _screen = react.runIfFn(screen, id);
|
2623
2577
|
return jsxRuntime.jsx(PageContainer, Object.assign({
|
@@ -2820,7 +2774,7 @@ function MultiQueryWrapper(_a) {
|
|
2820
2774
|
config,
|
2821
2775
|
tabbed
|
2822
2776
|
} = _a,
|
2823
|
-
props = __rest
|
2777
|
+
props = __rest(_a, ["queries", "config", "tabbed"]);
|
2824
2778
|
const {
|
2825
2779
|
data,
|
2826
2780
|
isFetching,
|
@@ -2848,7 +2802,7 @@ function ScreenRenderer(_a) {
|
|
2848
2802
|
config,
|
2849
2803
|
tabbed
|
2850
2804
|
} = _a,
|
2851
|
-
props = __rest
|
2805
|
+
props = __rest(_a, ["config", "tabbed"]);
|
2852
2806
|
if (config.type === "table") return jsxRuntime.jsx(TableView, Object.assign({}, config, props));
|
2853
2807
|
if (config.type === "tabbed") return jsxRuntime.jsx(TabbedView, Object.assign({}, config, props));
|
2854
2808
|
if (config.type === "details") return jsxRuntime.jsx(DetailsView, Object.assign({}, config, {
|
@@ -2868,7 +2822,7 @@ function ScreenRenderer(_a) {
|
|
2868
2822
|
*
|
2869
2823
|
*/
|
2870
2824
|
function Content(_a) {
|
2871
|
-
var props = __rest
|
2825
|
+
var props = __rest(_a, []);
|
2872
2826
|
return jsxRuntime.jsx("div", Object.assign({
|
2873
2827
|
w: "100%",
|
2874
2828
|
h: "100%",
|
@@ -2900,7 +2854,7 @@ function MenuButton(_a) {
|
|
2900
2854
|
selected,
|
2901
2855
|
children
|
2902
2856
|
} = _a,
|
2903
|
-
props = __rest
|
2857
|
+
props = __rest(_a, ["depth", "darkMode", "icon", "selected", "children"]);
|
2904
2858
|
return jsxRuntime.jsxs(ui.Button, Object.assign({
|
2905
2859
|
as: "li",
|
2906
2860
|
minH: "8",
|
@@ -2927,7 +2881,7 @@ function MenuButton(_a) {
|
|
2927
2881
|
}));
|
2928
2882
|
}
|
2929
2883
|
|
2930
|
-
function MenuItem(_a) {
|
2884
|
+
function MenuItem$1(_a) {
|
2931
2885
|
var {
|
2932
2886
|
icon,
|
2933
2887
|
path,
|
@@ -2935,7 +2889,7 @@ function MenuItem(_a) {
|
|
2935
2889
|
darkMode,
|
2936
2890
|
subMenu
|
2937
2891
|
} = _a,
|
2938
|
-
props = __rest
|
2892
|
+
props = __rest(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
|
2939
2893
|
const location = reactRouterDom.useLocation();
|
2940
2894
|
const selected = path == "/" ? location.pathname == "/" : location.pathname.startsWith(path.startsWith("/") ? path : `/${path}`);
|
2941
2895
|
const match = reactRouterDom.useMatch("/" + path) != null;
|
@@ -2954,7 +2908,7 @@ function MenuItem(_a) {
|
|
2954
2908
|
}, props)), match && jsxRuntime.jsx(SelectedIndicator, {
|
2955
2909
|
darkMode: darkMode
|
2956
2910
|
})]
|
2957
|
-
}), subMenu === null || subMenu === void 0 ? void 0 : subMenu.map((item, index) => jsxRuntime.jsx(MenuItem, {
|
2911
|
+
}), subMenu === null || subMenu === void 0 ? void 0 : subMenu.map((item, index) => jsxRuntime.jsx(MenuItem$1, {
|
2958
2912
|
icon: item.icon,
|
2959
2913
|
path: item.path,
|
2960
2914
|
depth: (depth !== null && depth !== void 0 ? depth : 0) + 1,
|
@@ -2973,7 +2927,7 @@ function NextMenuItem(_a) {
|
|
2973
2927
|
darkMode,
|
2974
2928
|
subMenu
|
2975
2929
|
} = _a,
|
2976
|
-
props = __rest
|
2930
|
+
props = __rest(_a, ["icon", "path", "depth", "darkMode", "subMenu"]);
|
2977
2931
|
const {
|
2978
2932
|
pathname
|
2979
2933
|
} = router.useRouter();
|
@@ -3014,8 +2968,8 @@ function Menu(_a) {
|
|
3014
2968
|
config,
|
3015
2969
|
useNextRouter
|
3016
2970
|
} = _a,
|
3017
|
-
props = __rest
|
3018
|
-
const Comp = useNextRouter ? NextMenuItem : MenuItem;
|
2971
|
+
props = __rest(_a, ["darkMode", "config", "useNextRouter"]);
|
2972
|
+
const Comp = useNextRouter ? NextMenuItem : MenuItem$1;
|
3019
2973
|
return jsxRuntime.jsx("ul", Object.assign({}, props, {
|
3020
2974
|
children: config.map((item, index) => {
|
3021
2975
|
if (item.type == "divider") return jsxRuntime.jsx(Divider, {
|
@@ -3050,17 +3004,160 @@ function Divider({
|
|
3050
3004
|
});
|
3051
3005
|
}
|
3052
3006
|
|
3007
|
+
function UserBlock({
|
3008
|
+
color,
|
3009
|
+
darkMode,
|
3010
|
+
menuConfig,
|
3011
|
+
path
|
3012
|
+
}) {
|
3013
|
+
var _a, _b, _c, _d;
|
3014
|
+
const {
|
3015
|
+
isLoading,
|
3016
|
+
user
|
3017
|
+
} = auth.useSessionUser();
|
3018
|
+
const navigate = reactRouterDom.useNavigate();
|
3019
|
+
const handleClick = React__default["default"].useCallback(() => navigate(path), [navigate, path]);
|
3020
|
+
if (isLoading) return null;
|
3021
|
+
return jsxRuntime.jsxs("div", {
|
3022
|
+
dflex: true,
|
3023
|
+
alignItems: "center",
|
3024
|
+
border: "0.5",
|
3025
|
+
borderColor: `${color}-${darkMode ? "800" : "200"}`,
|
3026
|
+
ps: "3",
|
3027
|
+
py: "1.5",
|
3028
|
+
textSize: "md",
|
3029
|
+
rounded: "lg",
|
3030
|
+
hover_bgColor: `${color}-${darkMode ? "800" : "200"}`,
|
3031
|
+
cursor: "pointer",
|
3032
|
+
textColor: darkMode ? "white" : "slate-800",
|
3033
|
+
onClick: handleClick,
|
3034
|
+
children: [jsxRuntime.jsx(ui.Avatar, {
|
3035
|
+
size: "sm",
|
3036
|
+
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 : "",
|
3037
|
+
name: `${user === null || user === void 0 ? void 0 : user.firstname} ${user === null || user === void 0 ? void 0 : user.lastname}`
|
3038
|
+
}), jsxRuntime.jsx("span", {
|
3039
|
+
flexGrow: true,
|
3040
|
+
ms: "2",
|
3041
|
+
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")}`
|
3042
|
+
}), jsxRuntime.jsx(ui.IconButton, {
|
3043
|
+
variant: "borderless",
|
3044
|
+
corners: "pill",
|
3045
|
+
scheme: "dark",
|
3046
|
+
textColor: darkMode ? "white" : "slate-800",
|
3047
|
+
hover_textColor: darkMode ? "white" : "slate-800",
|
3048
|
+
hover_bgColor: `${color}-${darkMode ? "900" : "200"}`,
|
3049
|
+
icon: mdiCog,
|
3050
|
+
onClick: handleClick
|
3051
|
+
}), jsxRuntime.jsx(OverflowMenu, {
|
3052
|
+
color: color,
|
3053
|
+
darkMode: darkMode,
|
3054
|
+
menuConfig: menuConfig
|
3055
|
+
})]
|
3056
|
+
});
|
3057
|
+
}
|
3058
|
+
function OverflowMenu({
|
3059
|
+
color,
|
3060
|
+
darkMode,
|
3061
|
+
menuConfig
|
3062
|
+
}) {
|
3063
|
+
const [showPopup, setShowPopup] = React__default["default"].useState(false);
|
3064
|
+
const navigate = reactRouterDom.useNavigate();
|
3065
|
+
const logout = auth.useSessionLogout(false);
|
3066
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
3067
|
+
children: jsxRuntime.jsxs(ui.Popup, {
|
3068
|
+
show: showPopup,
|
3069
|
+
position: "relative",
|
3070
|
+
side: "bottom-end",
|
3071
|
+
onClick: e => {
|
3072
|
+
e.preventDefault();
|
3073
|
+
e.stopPropagation();
|
3074
|
+
setShowPopup(show => !show);
|
3075
|
+
},
|
3076
|
+
onHide: () => setShowPopup(false),
|
3077
|
+
children: [jsxRuntime.jsx(ui.IconButton, {
|
3078
|
+
icon: mdiDotsVertical,
|
3079
|
+
variant: "borderless",
|
3080
|
+
corners: "pill",
|
3081
|
+
scheme: "dark",
|
3082
|
+
textColor: darkMode ? "white" : "slate-800",
|
3083
|
+
hover_textColor: darkMode ? "white" : "slate-800",
|
3084
|
+
hover_bgColor: `${color}-${darkMode ? "900" : "200"}`
|
3085
|
+
}), jsxRuntime.jsxs("div", {
|
3086
|
+
bgColor: "white",
|
3087
|
+
rounded: "sm",
|
3088
|
+
overflow: "hidden",
|
3089
|
+
shadow: true,
|
3090
|
+
mt: "1",
|
3091
|
+
border: "px",
|
3092
|
+
borderColor: "gray-200",
|
3093
|
+
divideColor: "gray-200",
|
3094
|
+
divideY: "px",
|
3095
|
+
minW: "40",
|
3096
|
+
children: [menuConfig && menuConfig.length > 0 && menuConfig.map((item, index) => {
|
3097
|
+
if (item.type == "item") {
|
3098
|
+
return jsxRuntime.jsx(MenuItem, {
|
3099
|
+
icon: item.icon,
|
3100
|
+
onClick: () => navigate(item.path),
|
3101
|
+
children: item.label
|
3102
|
+
}, index);
|
3103
|
+
}
|
3104
|
+
return null;
|
3105
|
+
}), jsxRuntime.jsx(MenuItem, {
|
3106
|
+
icon: mdiLogout,
|
3107
|
+
onClick: logout,
|
3108
|
+
children: "Logout"
|
3109
|
+
})]
|
3110
|
+
})]
|
3111
|
+
})
|
3112
|
+
});
|
3113
|
+
}
|
3114
|
+
function MenuItem(_a) {
|
3115
|
+
var {
|
3116
|
+
icon,
|
3117
|
+
onClick,
|
3118
|
+
children
|
3119
|
+
} = _a,
|
3120
|
+
props = __rest(_a, ["icon", "onClick", "children"]);
|
3121
|
+
const handleClick = React__default["default"].useCallback(e => {
|
3122
|
+
e.preventDefault();
|
3123
|
+
e.stopPropagation();
|
3124
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
3125
|
+
}, []);
|
3126
|
+
return jsxRuntime.jsxs(ui.Button, Object.assign({
|
3127
|
+
variant: "borderless",
|
3128
|
+
scheme: "dark",
|
3129
|
+
size: "sm",
|
3130
|
+
alignItems: "center",
|
3131
|
+
dflex: true,
|
3132
|
+
gap: "2",
|
3133
|
+
px: "2",
|
3134
|
+
py: "1.5",
|
3135
|
+
w: "full",
|
3136
|
+
onClick: handleClick,
|
3137
|
+
textColor: "slate-700"
|
3138
|
+
}, props, {
|
3139
|
+
children: [icon && jsxRuntime.jsx(ui.Icon, {
|
3140
|
+
path: icon,
|
3141
|
+
size: "md"
|
3142
|
+
}), children]
|
3143
|
+
}));
|
3144
|
+
}
|
3145
|
+
|
3053
3146
|
function Sidebar(_a) {
|
3054
3147
|
var {
|
3055
3148
|
show,
|
3056
3149
|
logo,
|
3057
3150
|
title,
|
3058
3151
|
menuConfig,
|
3152
|
+
userMenuConfig,
|
3153
|
+
userSettingsPath,
|
3059
3154
|
color,
|
3060
3155
|
darkMode
|
3061
3156
|
} = _a,
|
3062
|
-
props = __rest
|
3157
|
+
props = __rest(_a, ["show", "logo", "title", "menuConfig", "userMenuConfig", "userSettingsPath", "color", "darkMode"]);
|
3063
3158
|
return jsxRuntime.jsxs("div", Object.assign({
|
3159
|
+
dflex: true,
|
3160
|
+
flexCol: true,
|
3064
3161
|
w: "64",
|
3065
3162
|
minH: "screen",
|
3066
3163
|
p: "0",
|
@@ -3088,6 +3185,14 @@ function Sidebar(_a) {
|
|
3088
3185
|
p: "4",
|
3089
3186
|
darkMode: darkMode,
|
3090
3187
|
config: menuConfig
|
3188
|
+
}), jsxRuntime.jsx("div", {
|
3189
|
+
p: "2",
|
3190
|
+
children: jsxRuntime.jsx(UserBlock, {
|
3191
|
+
darkMode: darkMode,
|
3192
|
+
color: color,
|
3193
|
+
menuConfig: userMenuConfig,
|
3194
|
+
path: userSettingsPath
|
3195
|
+
})
|
3091
3196
|
})]
|
3092
3197
|
}));
|
3093
3198
|
}
|
@@ -3097,7 +3202,7 @@ function Logo(_a) {
|
|
3097
3202
|
height,
|
3098
3203
|
darkMode
|
3099
3204
|
} = _a,
|
3100
|
-
props = __rest
|
3205
|
+
props = __rest(_a, ["width", "height", "darkMode"]);
|
3101
3206
|
return jsxRuntime.jsx("div", Object.assign({}, props, {
|
3102
3207
|
children: jsxRuntime.jsx(Image__default["default"], {
|
3103
3208
|
src: `/logo_${darkMode ? "light" : "dark"}.png`,
|
@@ -3116,9 +3221,11 @@ function AdminLayout(_a) {
|
|
3116
3221
|
darkMode,
|
3117
3222
|
logo,
|
3118
3223
|
title,
|
3119
|
-
menuConfig
|
3224
|
+
menuConfig,
|
3225
|
+
userMenuConfig,
|
3226
|
+
userSettingsPath
|
3120
3227
|
} = _a,
|
3121
|
-
props = __rest
|
3228
|
+
props = __rest(_a, ["color", "darkMode", "logo", "title", "menuConfig", "userMenuConfig", "userSettingsPath"]);
|
3122
3229
|
return jsxRuntime.jsxs("div", Object.assign({
|
3123
3230
|
w: "full",
|
3124
3231
|
h: "screen",
|
@@ -3131,7 +3238,9 @@ function AdminLayout(_a) {
|
|
3131
3238
|
darkMode: darkMode,
|
3132
3239
|
logo: logo,
|
3133
3240
|
title: title,
|
3134
|
-
menuConfig: menuConfig
|
3241
|
+
menuConfig: menuConfig,
|
3242
|
+
userMenuConfig: userMenuConfig,
|
3243
|
+
userSettingsPath: userSettingsPath
|
3135
3244
|
}), jsxRuntime.jsx("div", {
|
3136
3245
|
w: "screen",
|
3137
3246
|
py: "2",
|
@@ -3149,7 +3258,9 @@ function LeftPanel({
|
|
3149
3258
|
darkMode,
|
3150
3259
|
logo,
|
3151
3260
|
title,
|
3152
|
-
menuConfig
|
3261
|
+
menuConfig,
|
3262
|
+
userMenuConfig,
|
3263
|
+
userSettingsPath
|
3153
3264
|
}) {
|
3154
3265
|
const [isOpen, __, toggle] = hooks.useBoolean(true);
|
3155
3266
|
useHotkeys('ctrl+t', () => toggle(), [toggle]);
|
@@ -3164,7 +3275,9 @@ function LeftPanel({
|
|
3164
3275
|
darkMode: darkMode,
|
3165
3276
|
logo: logo,
|
3166
3277
|
title: title,
|
3167
|
-
menuConfig: menuConfig
|
3278
|
+
menuConfig: menuConfig,
|
3279
|
+
userMenuConfig: userMenuConfig,
|
3280
|
+
userSettingsPath: userSettingsPath
|
3168
3281
|
}), jsxRuntime.jsx(ui.IconButton, {
|
3169
3282
|
icon: mdiArrowLeft,
|
3170
3283
|
transition: "all",
|
@@ -3208,7 +3321,7 @@ function AttachDialog(_a) {
|
|
3208
3321
|
formikProps,
|
3209
3322
|
getItemName
|
3210
3323
|
} = _a,
|
3211
|
-
props = __rest
|
3324
|
+
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"]);
|
3212
3325
|
const queryClient = reactQuery.useQueryClient();
|
3213
3326
|
const {
|
3214
3327
|
data: attached,
|
@@ -3334,7 +3447,7 @@ function ListItem(_a) {
|
|
3334
3447
|
value,
|
3335
3448
|
checked
|
3336
3449
|
} = _a,
|
3337
|
-
props = __rest
|
3450
|
+
props = __rest(_a, ["label", "value", "checked"]);
|
3338
3451
|
return jsxRuntime.jsxs("div", Object.assign({
|
3339
3452
|
dflex: true,
|
3340
3453
|
alignItems: "center",
|
@@ -3379,7 +3492,7 @@ function FormActionDialog(_a) {
|
|
3379
3492
|
onClose,
|
3380
3493
|
formikProps
|
3381
3494
|
} = _a,
|
3382
|
-
props = __rest
|
3495
|
+
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"]);
|
3383
3496
|
const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(queryFn, queryKey, queryOptions) : api.useApiMutation(queryFn, queryKey, queryId, queryOptions);
|
3384
3497
|
const mutate = api.useMutate(mutation, {
|
3385
3498
|
onSuccess,
|
@@ -3431,7 +3544,7 @@ function PageSectionTitle(_a) {
|
|
3431
3544
|
var {
|
3432
3545
|
children
|
3433
3546
|
} = _a,
|
3434
|
-
props = __rest
|
3547
|
+
props = __rest(_a, ["children"]);
|
3435
3548
|
return jsxRuntime.jsx("div", Object.assign({
|
3436
3549
|
trait: "typo.h6",
|
3437
3550
|
mb: "5"
|
@@ -3445,7 +3558,7 @@ const PageStateContainer = /*#__PURE__*/React__default["default"].forwardRef((_a
|
|
3445
3558
|
loading = false,
|
3446
3559
|
children
|
3447
3560
|
} = _a,
|
3448
|
-
props = __rest
|
3561
|
+
props = __rest(_a, ["loading", "children"]);
|
3449
3562
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
3450
3563
|
children: [loading && jsxRuntime.jsx(components.QueryLoadingState, {
|
3451
3564
|
w: "full",
|
@@ -3467,7 +3580,7 @@ function PageSubSectionTitle(_a) {
|
|
3467
3580
|
var {
|
3468
3581
|
children
|
3469
3582
|
} = _a,
|
3470
|
-
props = __rest
|
3583
|
+
props = __rest(_a, ["children"]);
|
3471
3584
|
return jsxRuntime.jsx("div", Object.assign({
|
3472
3585
|
trait: "typo.h6",
|
3473
3586
|
mb: "3"
|
@@ -3496,7 +3609,7 @@ function StatusBadge(_a) {
|
|
3496
3609
|
var {
|
3497
3610
|
status
|
3498
3611
|
} = _a,
|
3499
|
-
props = __rest
|
3612
|
+
props = __rest(_a, ["status"]);
|
3500
3613
|
return jsxRuntime.jsx(ui.Badge, Object.assign({
|
3501
3614
|
size: "sm",
|
3502
3615
|
variant: "glass",
|
@@ -3514,7 +3627,7 @@ function TableRowActionButton(_a) {
|
|
3514
3627
|
icon,
|
3515
3628
|
children
|
3516
3629
|
} = _a,
|
3517
|
-
props = __rest
|
3630
|
+
props = __rest(_a, ["icon", "children"]);
|
3518
3631
|
return jsxRuntime.jsxs(ui.Button, Object.assign({
|
3519
3632
|
dflex: true,
|
3520
3633
|
alignContent: "center",
|
@@ -3538,7 +3651,7 @@ function TableRowViewButton(_a) {
|
|
3538
3651
|
var {
|
3539
3652
|
path
|
3540
3653
|
} = _a,
|
3541
|
-
props = __rest
|
3654
|
+
props = __rest(_a, ["path"]);
|
3542
3655
|
const openPage = React__default["default"].useCallback(event => {
|
3543
3656
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
3544
3657
|
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
@@ -3554,7 +3667,7 @@ function TableRowNavigateButton(_a) {
|
|
3554
3667
|
var {
|
3555
3668
|
path
|
3556
3669
|
} = _a,
|
3557
|
-
props = __rest
|
3670
|
+
props = __rest(_a, ["path"]);
|
3558
3671
|
const navigate = reactRouterDom.useNavigate();
|
3559
3672
|
const handleClick = React__default["default"].useCallback(event => {
|
3560
3673
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
@@ -3572,7 +3685,7 @@ function TableRowActionDialogButton(_a) {
|
|
3572
3685
|
icon,
|
3573
3686
|
children
|
3574
3687
|
} = _a,
|
3575
|
-
props = __rest
|
3688
|
+
props = __rest(_a, ["icon", "children"]);
|
3576
3689
|
return jsxRuntime.jsxs(admin.DialogButton, Object.assign({
|
3577
3690
|
dflex: true,
|
3578
3691
|
alignContent: "center",
|
@@ -3596,7 +3709,7 @@ function TableRowEditButton(_a) {
|
|
3596
3709
|
var {
|
3597
3710
|
children
|
3598
3711
|
} = _a,
|
3599
|
-
props = __rest
|
3712
|
+
props = __rest(_a, ["children"]);
|
3600
3713
|
return jsxRuntime.jsx(TableRowActionDialogButton, Object.assign({
|
3601
3714
|
icon: mdiPencil
|
3602
3715
|
}, props, {
|
@@ -3608,7 +3721,7 @@ function TableRowDeleteButton(_a) {
|
|
3608
3721
|
var {
|
3609
3722
|
children
|
3610
3723
|
} = _a,
|
3611
|
-
props = __rest
|
3724
|
+
props = __rest(_a, ["children"]);
|
3612
3725
|
return jsxRuntime.jsx(TableRowActionDialogButton, Object.assign({
|
3613
3726
|
icon: mdiDelete
|
3614
3727
|
}, props, {
|
@@ -3625,7 +3738,7 @@ function TableRowActionBar(_a) {
|
|
3625
3738
|
deleteDialog,
|
3626
3739
|
children
|
3627
3740
|
} = _a,
|
3628
|
-
props = __rest
|
3741
|
+
props = __rest(_a, ["publishId", "viewPath", "navigatePath", "editDialog", "deleteDialog", "children"]);
|
3629
3742
|
return jsxRuntime.jsxs("div", Object.assign({
|
3630
3743
|
dflex: true,
|
3631
3744
|
spaceX: "1",
|
@@ -3650,7 +3763,7 @@ function TableRowPublishPostButton(_a) {
|
|
3650
3763
|
status,
|
3651
3764
|
invalidateQueryKey
|
3652
3765
|
} = _a,
|
3653
|
-
props = __rest
|
3766
|
+
props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
|
3654
3767
|
const isDraft = status == "draft";
|
3655
3768
|
const mutation = api.useInvalidateParentMutation(isDraft ? api$1.publish : api$1.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey, {
|
3656
3769
|
networkMode: "always"
|