@nethru/ui 1.0.63 → 1.0.65

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/dist/Button.js CHANGED
@@ -1,13 +1,16 @@
1
1
  import { useMemo } from "react";
2
2
  import MuiButton from "@mui/material/Button";
3
- import { Box, IconButton } from "@mui/material";
3
+ import { Box, CircularProgress, IconButton } from "@mui/material";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
6
  export default function Button({
6
7
  label,
7
8
  icon,
8
9
  iconPlacement = 'start',
9
10
  iconSize = '20px',
10
11
  iconProps = {},
12
+ progressProps = {},
13
+ loading = false,
11
14
  ...props
12
15
  }) {
13
16
  const iconComponent = useMemo(() => {
@@ -27,13 +30,32 @@ export default function Button({
27
30
  const endIcon = useMemo(() => {
28
31
  return iconPlacement === 'end' ? iconComponent : null;
29
32
  }, [iconComponent, iconPlacement]);
30
- return label ? /*#__PURE__*/_jsx(MuiButton, {
31
- startIcon: startIcon,
32
- endIcon: endIcon,
33
- ...props,
34
- children: label
35
- }) : /*#__PURE__*/_jsx(IconButton, {
36
- ...props,
37
- children: iconComponent
33
+ return /*#__PURE__*/_jsxs(Box, {
34
+ sx: {
35
+ position: 'relative',
36
+ width: 'fit-content'
37
+ },
38
+ children: [label ? /*#__PURE__*/_jsx(MuiButton, {
39
+ startIcon: startIcon,
40
+ endIcon: endIcon,
41
+ disabled: loading,
42
+ ...props,
43
+ children: label
44
+ }) : /*#__PURE__*/_jsx(IconButton, {
45
+ disabled: loading,
46
+ ...props,
47
+ children: iconComponent
48
+ }), loading && /*#__PURE__*/_jsx(CircularProgress, {
49
+ size: 24,
50
+ thickness: 6,
51
+ sx: {
52
+ position: 'absolute',
53
+ top: '50%',
54
+ left: '50%',
55
+ marginTop: '-12px',
56
+ marginLeft: '-12px'
57
+ },
58
+ ...progressProps
59
+ })]
38
60
  });
39
61
  }
package/dist/DataGrid.js CHANGED
@@ -52,7 +52,7 @@ export default function DataGrid({
52
52
  columns,
53
53
  rows,
54
54
  customToolbar = /*#__PURE__*/_jsx(_Fragment, {}),
55
- customGridCellMap = {},
55
+ customGridCellMap,
56
56
  slots = {},
57
57
  slotProps,
58
58
  initialState,
@@ -112,7 +112,7 @@ export default function DataGrid({
112
112
  },
113
113
  slots: {
114
114
  toolbar: hideToolbar ? null : CustomToolbar,
115
- cell: CustomGridCell,
115
+ cell: customGridCellMap ? CustomGridCell : undefined,
116
116
  ...slots
117
117
  },
118
118
  slotProps: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nethru/ui",
3
- "version": "1.0.63",
3
+ "version": "1.0.65",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "/dist"