@compill/admin 1.0.91 → 1.0.92

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,30 @@ 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,
1013
+ return jsxRuntime.jsx(admin.ButtonBarButton, Object.assign({
1014
1014
  type: "submit",
1015
1015
  scheme: "dark",
1016
1016
  variant: "glass",
1017
1017
  size: "md",
1018
- onClick: openPage
1019
- }, props));
1018
+ onClick: openPage,
1019
+ dflex: true,
1020
+ alignItems: "center",
1021
+ gap: "2",
1022
+ icon: icon || mdiOpenInNew
1023
+ }, props, {
1024
+ children: label
1025
+ }));
1026
+ // return (
1027
+ // <IconButton icon={icon ? icon : mdiOpenInNew} type="submit" scheme="dark" variant="glass" size="md" onClick={openPage} {...props}/>
1028
+ // )
1020
1029
  }
1021
1030
 
1022
1031
  function OrderCell({
@@ -1338,14 +1347,17 @@ function Buttons$1({
1338
1347
  buttonBar
1339
1348
  }) {
1340
1349
  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, {
1350
+ children: [buttonBar && buttonBar.length > 0 && jsxRuntime.jsx(admin.ButtonBar, {
1351
+ children: buttonBar.map((button, index) => jsxRuntime.jsxs(React__default["default"].Fragment, {
1352
+ children: [button.type === "link" && jsxRuntime.jsx(ViewButton, {
1353
+ label: button.label,
1354
+ path: button.path,
1355
+ icon: button.icon
1356
+ }), button.type === "invalidate" && jsxRuntime.jsx(InvalidateButton, {
1357
+ pathOrPermalink: button.pathOrPermalink
1358
+ }), button.type == "custom" && button.render(item)]
1359
+ }, index))
1360
+ }), jsxRuntime.jsxs(admin.ButtonBar, {
1349
1361
  children: [api instanceof adminApi.API && jsxRuntime.jsx(PublishButton, {
1350
1362
  api: api,
1351
1363
  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,30 @@ 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,
1003
+ return jsx(ButtonBarButton$1, Object.assign({
1004
1004
  type: "submit",
1005
1005
  scheme: "dark",
1006
1006
  variant: "glass",
1007
1007
  size: "md",
1008
- onClick: openPage
1009
- }, props));
1008
+ onClick: openPage,
1009
+ dflex: true,
1010
+ alignItems: "center",
1011
+ gap: "2",
1012
+ icon: icon || mdiOpenInNew
1013
+ }, props, {
1014
+ children: label
1015
+ }));
1016
+ // return (
1017
+ // <IconButton icon={icon ? icon : mdiOpenInNew} type="submit" scheme="dark" variant="glass" size="md" onClick={openPage} {...props}/>
1018
+ // )
1010
1019
  }
1011
1020
 
1012
1021
  function OrderCell({
@@ -1328,14 +1337,17 @@ function Buttons$1({
1328
1337
  buttonBar
1329
1338
  }) {
1330
1339
  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, {
1340
+ children: [buttonBar && buttonBar.length > 0 && jsx(ButtonBar$1, {
1341
+ children: buttonBar.map((button, index) => jsxs(React.Fragment, {
1342
+ children: [button.type === "link" && jsx(ViewButton, {
1343
+ label: button.label,
1344
+ path: button.path,
1345
+ icon: button.icon
1346
+ }), button.type === "invalidate" && jsx(InvalidateButton, {
1347
+ pathOrPermalink: button.pathOrPermalink
1348
+ }), button.type == "custom" && button.render(item)]
1349
+ }, index))
1350
+ }), jsxs(ButtonBar$1, {
1339
1351
  children: [api instanceof API && jsx(PublishButton, {
1340
1352
  api: api,
1341
1353
  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.92",
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;