@nethru/ui 1.0.42 → 1.0.44

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 ADDED
@@ -0,0 +1,36 @@
1
+ import { useMemo } from "react";
2
+ import MuiButton from "@mui/material/Button";
3
+ import { Box } from "@mui/material";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ export default function Button({
6
+ label,
7
+ icon,
8
+ iconPlacement = 'start',
9
+ iconSize = '20px',
10
+ iconProps = {},
11
+ ...props
12
+ }) {
13
+ const iconComponent = useMemo(() => {
14
+ return icon ? /*#__PURE__*/_jsx(Box, {
15
+ component: icon,
16
+ sx: {
17
+ '&.MuiSvgIcon-root': {
18
+ fontSize: `${iconSize}!important`
19
+ }
20
+ },
21
+ ...iconProps
22
+ }) : null;
23
+ }, [icon, iconSize, iconProps]);
24
+ const startIcon = useMemo(() => {
25
+ return iconPlacement === 'start' ? iconComponent : null;
26
+ }, [iconComponent, iconPlacement]);
27
+ const endIcon = useMemo(() => {
28
+ return iconPlacement === 'end' ? iconComponent : null;
29
+ }, [iconComponent, iconPlacement]);
30
+ return /*#__PURE__*/_jsx(MuiButton, {
31
+ startIcon: startIcon,
32
+ endIcon: endIcon,
33
+ ...props,
34
+ children: label
35
+ });
36
+ }
package/dist/Checkbox.js CHANGED
@@ -1,16 +1,27 @@
1
+ import { useMemo } from "react";
1
2
  import MuiCheckbox from "@mui/material/Checkbox";
2
3
  import { FormControlLabel } from "@mui/material";
3
4
  import { jsx as _jsx } from "react/jsx-runtime";
4
5
  export default function Checkbox({
5
6
  label,
7
+ size = 'medium',
6
8
  sx,
7
9
  ...props
8
10
  }) {
11
+ const styles = useMemo(() => ({
12
+ '& .MuiFormControlLabel-label': {
13
+ fontSize: size === 'small' ? '14px' : '16px'
14
+ }
15
+ }), [size]);
9
16
  return /*#__PURE__*/_jsx(FormControlLabel, {
10
17
  label: label,
11
18
  control: /*#__PURE__*/_jsx(MuiCheckbox, {
19
+ size: size,
12
20
  ...props
13
21
  }),
14
- sx: sx
22
+ sx: {
23
+ ...styles,
24
+ ...sx
25
+ }
15
26
  });
16
27
  }
@@ -3,14 +3,14 @@ import MenuItem from "@mui/material/MenuItem";
3
3
  import { DataGrid, useGridApiContext } from "@mui/x-data-grid";
4
4
  import Select from "./Select";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
- export default function PropertyTable({
6
+ const PropertyTable = /*#__PURE__*/forwardRef(({
7
7
  columns,
8
8
  rows,
9
9
  onUpdate,
10
10
  readOnly,
11
11
  sx,
12
12
  ...props
13
- }) {
13
+ }, ref) => {
14
14
  const styles = useMemo(() => {
15
15
  const result = {
16
16
  '&.MuiDataGrid-root': {
@@ -72,6 +72,7 @@ export default function PropertyTable({
72
72
  return row;
73
73
  };
74
74
  return /*#__PURE__*/_jsx(DataGrid, {
75
+ ref: ref,
75
76
  columns: arrangedColumns,
76
77
  rows: rows,
77
78
  columnHeaderHeight: 35,
@@ -90,7 +91,7 @@ export default function PropertyTable({
90
91
  },
91
92
  ...props
92
93
  });
93
- }
94
+ });
94
95
  const SingleSelect = /*#__PURE__*/forwardRef((props, ref) => {
95
96
  const {
96
97
  id,
@@ -117,4 +118,5 @@ const SingleSelect = /*#__PURE__*/forwardRef((props, ref) => {
117
118
  children: option.label
118
119
  }, option.value))
119
120
  });
120
- });
121
+ });
122
+ export default PropertyTable;
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ export { default as AlertDialog } from "./AlertDialog";
5
5
  export { default as AppBar } from "./AppBar";
6
6
  export { default as AppendableFormList } from "./AppendableFormList";
7
7
  export { default as AvatarDropdown } from "./AvatarDropdown";
8
+ export { default as Button } from "./Button";
8
9
  export { default as Checkbox } from "./Checkbox";
9
10
  export { default as CircularProgress } from "./CircularProgress";
10
11
  export { default as ColumnedSection } from "./ColumnedSection";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nethru/ui",
3
- "version": "1.0.42",
3
+ "version": "1.0.44",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "/dist"