@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 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(ui.IconButton, Object.assign({
1013
- icon: icon ? icon : mdiOpenInNew,
1014
- type: "submit",
1015
- scheme: "dark",
1016
- variant: "glass",
1017
- size: "md",
1018
- onClick: openPage
1019
- }, props));
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 === null || buttonBar === void 0 ? void 0 : buttonBar.map((button, index) => jsxRuntime.jsxs(React__default["default"].Fragment, {
1342
- children: [button.type === "link" && jsxRuntime.jsx(ViewButton, {
1343
- path: button.path,
1344
- icon: button.icon
1345
- }), button.type === "invalidate" && jsxRuntime.jsx(InvalidateButton, {
1346
- pathOrPermalink: button.pathOrPermalink
1347
- }), button.type == "custom" && button.render(item)]
1348
- }, index)), jsxRuntime.jsxs(admin.ButtonBar, {
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, IconButton, Container, Tile, Popover, Collapse, Modal, Avatar, Popup, Checkbox, Badge } from '@valerya/ui';
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(IconButton, Object.assign({
1003
- icon: icon ? icon : mdiOpenInNew,
1004
- type: "submit",
1005
- scheme: "dark",
1006
- variant: "glass",
1007
- size: "md",
1008
- onClick: openPage
1009
- }, props));
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 === null || buttonBar === void 0 ? void 0 : buttonBar.map((button, index) => jsxs(React.Fragment, {
1332
- children: [button.type === "link" && jsx(ViewButton, {
1333
- path: button.path,
1334
- icon: button.icon
1335
- }), button.type === "invalidate" && jsx(InvalidateButton, {
1336
- pathOrPermalink: button.pathOrPermalink
1337
- }), button.type == "custom" && button.render(item)]
1338
- }, index)), jsxs(ButtonBar$1, {
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
  {
2
2
  "name": "@compill/admin",
3
- "version": "1.0.91",
3
+ "version": "1.0.93",
4
4
  "module": "./index.esm.js",
5
5
  "main": "./index.cjs.js"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { IconButtonProps } from "@valerya/ui";
3
- export declare function ViewButton({ path, icon, ...props }: Omit<IconButtonProps, "icon"> & {
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;
@@ -50,6 +50,7 @@ export type DetailViewButton = {
50
50
  type: "link";
51
51
  path: string;
52
52
  icon?: string;
53
+ label?: string;
53
54
  } | {
54
55
  type: "custom";
55
56
  render: (item: any) => React.ReactNode;