@compill/admin 1.0.91 → 1.0.93
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 +25 -17
- package/index.esm.js +26 -18
- package/package.json +1 -1
- package/src/lib/buttons/ViewButton.d.ts +3 -3
- package/src/lib/json/types/DetailsView.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -1002,21 +1002,26 @@ function UpdateButton(_a) {
|
|
|
1002
1002
|
|
|
1003
1003
|
function ViewButton(_a) {
|
|
1004
1004
|
var {
|
|
1005
|
+
label,
|
|
1005
1006
|
path,
|
|
1006
1007
|
icon
|
|
1007
1008
|
} = _a,
|
|
1008
|
-
props = tslib.__rest(_a, ["path", "icon"]);
|
|
1009
|
+
props = tslib.__rest(_a, ["label", "path", "icon"]);
|
|
1009
1010
|
const openPage = React__default["default"].useCallback(() => {
|
|
1010
1011
|
window.open(path, '_blank');
|
|
1011
1012
|
}, [path]);
|
|
1012
|
-
return jsxRuntime.jsx(
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1013
|
+
return jsxRuntime.jsx(admin.ButtonBarButton, Object.assign({
|
|
1014
|
+
onClick: openPage,
|
|
1015
|
+
dflex: true,
|
|
1016
|
+
alignItems: "center",
|
|
1017
|
+
gap: "2",
|
|
1018
|
+
icon: icon || mdiOpenInNew
|
|
1019
|
+
}, props, {
|
|
1020
|
+
children: label
|
|
1021
|
+
}));
|
|
1022
|
+
// return (
|
|
1023
|
+
// <IconButton icon={icon ? icon : mdiOpenInNew} type="submit" scheme="dark" variant="glass" size="md" onClick={openPage} {...props}/>
|
|
1024
|
+
// )
|
|
1020
1025
|
}
|
|
1021
1026
|
|
|
1022
1027
|
function OrderCell({
|
|
@@ -1338,14 +1343,17 @@ function Buttons$1({
|
|
|
1338
1343
|
buttonBar
|
|
1339
1344
|
}) {
|
|
1340
1345
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1341
|
-
children: [buttonBar
|
|
1342
|
-
children:
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1346
|
+
children: [buttonBar && buttonBar.length > 0 && jsxRuntime.jsx(admin.ButtonBar, {
|
|
1347
|
+
children: buttonBar.map((button, index) => jsxRuntime.jsxs(React__default["default"].Fragment, {
|
|
1348
|
+
children: [button.type === "link" && jsxRuntime.jsx(ViewButton, {
|
|
1349
|
+
label: button.label,
|
|
1350
|
+
path: button.path,
|
|
1351
|
+
icon: button.icon
|
|
1352
|
+
}), button.type === "invalidate" && jsxRuntime.jsx(InvalidateButton, {
|
|
1353
|
+
pathOrPermalink: button.pathOrPermalink
|
|
1354
|
+
}), button.type == "custom" && button.render(item)]
|
|
1355
|
+
}, index))
|
|
1356
|
+
}), jsxRuntime.jsxs(admin.ButtonBar, {
|
|
1349
1357
|
children: [api instanceof adminApi.API && jsxRuntime.jsx(PublishButton, {
|
|
1350
1358
|
api: api,
|
|
1351
1359
|
queryId: item.id,
|
package/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import { __rest, __awaiter } from 'tslib';
|
|
|
2
2
|
import { jsx, jsxs, Fragment } from '@soperio/jsx-runtime';
|
|
3
3
|
import { useApiQuery, useApiMutation, useMutate, useInvalidateMutation, useInvalidateQuery, useInvalidateParentMutation, useApiQueries } from '@compill/api';
|
|
4
4
|
import { Shimmer, FlexCenter, QueryLoadingState, RetryOnError, TabContainer, ModalLoadingOverlay } from '@compill/components';
|
|
5
|
-
import { Icon, Button,
|
|
5
|
+
import { Icon, Button, Container, Tile, Popover, Collapse, Modal, Avatar, IconButton, Popup, Checkbox, Badge } from '@valerya/ui';
|
|
6
6
|
import Link from 'next/link';
|
|
7
7
|
import { useParams, useNavigate, Outlet, useLocation, useMatch, Link as Link$1 } from 'react-router-dom';
|
|
8
8
|
import React, { useRef, useCallback, useContext as useContext$2, useLayoutEffect, useEffect, createContext } from 'react';
|
|
@@ -992,21 +992,26 @@ function UpdateButton(_a) {
|
|
|
992
992
|
|
|
993
993
|
function ViewButton(_a) {
|
|
994
994
|
var {
|
|
995
|
+
label,
|
|
995
996
|
path,
|
|
996
997
|
icon
|
|
997
998
|
} = _a,
|
|
998
|
-
props = __rest(_a, ["path", "icon"]);
|
|
999
|
+
props = __rest(_a, ["label", "path", "icon"]);
|
|
999
1000
|
const openPage = React.useCallback(() => {
|
|
1000
1001
|
window.open(path, '_blank');
|
|
1001
1002
|
}, [path]);
|
|
1002
|
-
return jsx(
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1003
|
+
return jsx(ButtonBarButton$1, Object.assign({
|
|
1004
|
+
onClick: openPage,
|
|
1005
|
+
dflex: true,
|
|
1006
|
+
alignItems: "center",
|
|
1007
|
+
gap: "2",
|
|
1008
|
+
icon: icon || mdiOpenInNew
|
|
1009
|
+
}, props, {
|
|
1010
|
+
children: label
|
|
1011
|
+
}));
|
|
1012
|
+
// return (
|
|
1013
|
+
// <IconButton icon={icon ? icon : mdiOpenInNew} type="submit" scheme="dark" variant="glass" size="md" onClick={openPage} {...props}/>
|
|
1014
|
+
// )
|
|
1010
1015
|
}
|
|
1011
1016
|
|
|
1012
1017
|
function OrderCell({
|
|
@@ -1328,14 +1333,17 @@ function Buttons$1({
|
|
|
1328
1333
|
buttonBar
|
|
1329
1334
|
}) {
|
|
1330
1335
|
return jsxs(Fragment, {
|
|
1331
|
-
children: [buttonBar
|
|
1332
|
-
children:
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1336
|
+
children: [buttonBar && buttonBar.length > 0 && jsx(ButtonBar$1, {
|
|
1337
|
+
children: buttonBar.map((button, index) => jsxs(React.Fragment, {
|
|
1338
|
+
children: [button.type === "link" && jsx(ViewButton, {
|
|
1339
|
+
label: button.label,
|
|
1340
|
+
path: button.path,
|
|
1341
|
+
icon: button.icon
|
|
1342
|
+
}), button.type === "invalidate" && jsx(InvalidateButton, {
|
|
1343
|
+
pathOrPermalink: button.pathOrPermalink
|
|
1344
|
+
}), button.type == "custom" && button.render(item)]
|
|
1345
|
+
}, index))
|
|
1346
|
+
}), jsxs(ButtonBar$1, {
|
|
1339
1347
|
children: [api instanceof API && jsx(PublishButton, {
|
|
1340
1348
|
api: api,
|
|
1341
1349
|
queryId: item.id,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export declare function ViewButton({ path, icon, ...props }:
|
|
2
|
+
import { ButtonBarButtonProps } from "@compill/admin";
|
|
3
|
+
export declare function ViewButton({ label, path, icon, ...props }: ButtonBarButtonProps & {
|
|
4
|
+
label?: string;
|
|
4
5
|
path: string;
|
|
5
|
-
icon?: string;
|
|
6
6
|
}): JSX.Element;
|