cloudmr-ux 1.1.4 → 1.1.6

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/index.css CHANGED
@@ -182,6 +182,8 @@
182
182
  }
183
183
  }
184
184
 
185
+ /* src/CmrComponents/input-number/InputNumber.css */
186
+
185
187
  /* src/CmrTable/CmrTable.css */
186
188
  .css-1lymaxv-MuiDataGrid-root .MuiDataGrid-columnHeader:focus-within,
187
189
  .css-1lymaxv-MuiDataGrid-root .MuiDataGrid-cell:focus-within {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ButtonProps, SxProps, Theme } from '@mui/material';
2
+ import { ButtonProps, SxProps as SxProps$1, Theme as Theme$1 } from '@mui/material';
3
+ import { SxProps, Theme } from '@mui/material/styles';
3
4
  import React, { ReactNode, ChangeEvent, CSSProperties, FC } from 'react';
4
5
  import { SizeType } from 'antd/lib/config-provider/SizeContext';
5
6
  import { CollapsibleType } from 'antd/es/collapse/CollapsePanel';
@@ -7,7 +8,9 @@ import { ExpandIconPosition } from 'antd/es/collapse/Collapse';
7
8
  import { AxiosRequestConfig, AxiosResponse } from 'axios';
8
9
  import { DataGridProps } from '@mui/x-data-grid';
9
10
 
10
- declare const CmrButton: (props: ButtonProps) => react_jsx_runtime.JSX.Element;
11
+ declare const CmrButton: (props: ButtonProps & {
12
+ sx?: SxProps<Theme>;
13
+ }) => react_jsx_runtime.JSX.Element;
11
14
 
12
15
  interface CmrInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'type'> {
13
16
  defaultValue?: string;
@@ -111,7 +114,7 @@ interface CMRUploadProps extends React.HTMLAttributes<HTMLDivElement> {
111
114
  } | undefined>);
112
115
  onUploadProgressUpdate?: (loaded: number, total: number) => void | undefined;
113
116
  onUploaded: (res: AxiosResponse, file: File) => Promise<void> | void;
114
- sx?: SxProps<Theme> | undefined;
117
+ sx?: SxProps$1<Theme$1> | undefined;
115
118
  rest?: any;
116
119
  fileExtension?: string;
117
120
  uploadStarted?: () => void;
@@ -224,6 +227,20 @@ interface CmrLabelProps extends React.HTMLAttributes<HTMLDivElement> {
224
227
  }
225
228
  declare const CmrLabel: (props: CmrLabelProps) => react_jsx_runtime.JSX.Element;
226
229
 
230
+ interface CmrInputNumberProps {
231
+ defaultValue?: number;
232
+ disabled?: boolean;
233
+ keyboard?: boolean;
234
+ max?: number;
235
+ min?: number;
236
+ size?: SizeType;
237
+ value?: number;
238
+ onChange?: (value: number | null) => void;
239
+ children?: React.ReactNode;
240
+ style?: CSSProperties;
241
+ }
242
+ declare const CmrInputNumber: (props: CmrInputNumberProps) => react_jsx_runtime.JSX.Element;
243
+
227
244
  interface CmrTableProps extends Omit<DataGridProps, 'rows'> {
228
245
  dataSource: any[];
229
246
  idAlias?: string;
@@ -234,4 +251,4 @@ interface CmrTableProps extends Omit<DataGridProps, 'rows'> {
234
251
 
235
252
  declare const CmrTable: FC<CmrTableProps>;
236
253
 
237
- export { CmrUpload as CMRUpload, CmrButton, CmrCheckbox, CmrCollapse, CmrConfirmation, CmrDeletionDialog, CmrEditConfirmation, CmrInput, CmrLabel, CmrNameDialog, CmrPanel, CmrRadioGroup, CmrSelect, CmrTable, CmrTableProps, CmrTabs, LambdaFile };
254
+ export { CmrUpload as CMRUpload, CmrButton, CmrCheckbox, CmrCollapse, CmrConfirmation, CmrDeletionDialog, CmrEditConfirmation, CmrInput, CmrInputNumber, CmrLabel, CmrNameDialog, CmrPanel, CmrRadioGroup, CmrSelect, CmrTable, CmrTableProps, CmrTabs, LambdaFile };
package/dist/index.js CHANGED
@@ -38,6 +38,7 @@ __export(src_exports, {
38
38
  CmrDeletionDialog: () => CmrDeletionDialog,
39
39
  CmrEditConfirmation: () => CmrEditConfirmation,
40
40
  CmrInput: () => CmrInput,
41
+ CmrInputNumber: () => InputNumber_default,
41
42
  CmrLabel: () => Label_default,
42
43
  CmrNameDialog: () => CmrNameDialog,
43
44
  CmrPanel: () => Panel_default,
@@ -52,7 +53,29 @@ module.exports = __toCommonJS(src_exports);
52
53
  var import_material = require("@mui/material");
53
54
  var import_jsx_runtime = require("react/jsx-runtime");
54
55
  var CmrButton = (props) => {
55
- const { children, onClick, variant = "contained", disabled = false, ...rest } = props;
56
+ const { children, onClick, variant = "contained", disabled = false, sx, ...rest } = props;
57
+ const baseSx = {
58
+ boxShadow: "none",
59
+ "&:hover": {
60
+ boxShadow: "none"
61
+ }
62
+ };
63
+ let combinedSx;
64
+ if (Array.isArray(sx)) {
65
+ combinedSx = [baseSx, ...sx];
66
+ } else if (typeof sx === "function") {
67
+ combinedSx = (theme) => ({
68
+ ...baseSx,
69
+ ...sx(theme)
70
+ });
71
+ } else if (typeof sx === "object" && sx !== null) {
72
+ combinedSx = {
73
+ ...baseSx,
74
+ ...sx
75
+ };
76
+ } else {
77
+ combinedSx = baseSx;
78
+ }
56
79
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
57
80
  import_material.Button,
58
81
  {
@@ -62,14 +85,7 @@ var CmrButton = (props) => {
62
85
  style: { textTransform: "none" },
63
86
  variant,
64
87
  disabled,
65
- sx: {
66
- boxShadow: "none",
67
- // Removes the shadow on the button by default
68
- "&:hover": {
69
- boxShadow: "none"
70
- // Removes the shadow on hover as well
71
- }
72
- },
88
+ sx: combinedSx,
73
89
  children
74
90
  }
75
91
  );
@@ -1089,9 +1105,18 @@ var CmrCheckbox = (props) => {
1089
1105
  };
1090
1106
  var Checkbox_default = CmrCheckbox;
1091
1107
 
1108
+ // src/CmrComponents/input-number/InputNumber.tsx
1109
+ var import_antd2 = require("antd");
1110
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1111
+ var CmrInputNumber = (props) => {
1112
+ const { defaultValue, style, max, min, value, onChange, children, ...rest } = props;
1113
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_antd2.InputNumber, { defaultValue, max, style, min, value, onChange, ...rest, children });
1114
+ };
1115
+ var InputNumber_default = CmrInputNumber;
1116
+
1092
1117
  // src/CmrTable/CmrTable.tsx
1093
1118
  var import_x_data_grid = require("@mui/x-data-grid");
1094
- var import_jsx_runtime17 = require("react/jsx-runtime");
1119
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1095
1120
  var CmrTable = (props) => {
1096
1121
  const {
1097
1122
  dataSource,
@@ -1103,7 +1128,7 @@ var CmrTable = (props) => {
1103
1128
  showCheckbox = true,
1104
1129
  ...rest
1105
1130
  } = props;
1106
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: style ?? { height: "400px", width: "100%" }, className: className ?? "", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1131
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: style ?? { height: "400px", width: "100%" }, className: className ?? "", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1107
1132
  import_x_data_grid.DataGrid,
1108
1133
  {
1109
1134
  rows: dataSource ? dataSource.map((row) => ({
@@ -1137,6 +1162,7 @@ var CmrTable2 = CmrTable_default;
1137
1162
  CmrDeletionDialog,
1138
1163
  CmrEditConfirmation,
1139
1164
  CmrInput,
1165
+ CmrInputNumber,
1140
1166
  CmrLabel,
1141
1167
  CmrNameDialog,
1142
1168
  CmrPanel,
package/dist/index.mjs CHANGED
@@ -2,7 +2,29 @@
2
2
  import { Button } from "@mui/material";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  var CmrButton = (props) => {
5
- const { children, onClick, variant = "contained", disabled = false, ...rest } = props;
5
+ const { children, onClick, variant = "contained", disabled = false, sx, ...rest } = props;
6
+ const baseSx = {
7
+ boxShadow: "none",
8
+ "&:hover": {
9
+ boxShadow: "none"
10
+ }
11
+ };
12
+ let combinedSx;
13
+ if (Array.isArray(sx)) {
14
+ combinedSx = [baseSx, ...sx];
15
+ } else if (typeof sx === "function") {
16
+ combinedSx = (theme) => ({
17
+ ...baseSx,
18
+ ...sx(theme)
19
+ });
20
+ } else if (typeof sx === "object" && sx !== null) {
21
+ combinedSx = {
22
+ ...baseSx,
23
+ ...sx
24
+ };
25
+ } else {
26
+ combinedSx = baseSx;
27
+ }
6
28
  return /* @__PURE__ */ jsx(
7
29
  Button,
8
30
  {
@@ -12,14 +34,7 @@ var CmrButton = (props) => {
12
34
  style: { textTransform: "none" },
13
35
  variant,
14
36
  disabled,
15
- sx: {
16
- boxShadow: "none",
17
- // Removes the shadow on the button by default
18
- "&:hover": {
19
- boxShadow: "none"
20
- // Removes the shadow on hover as well
21
- }
22
- },
37
+ sx: combinedSx,
23
38
  children
24
39
  }
25
40
  );
@@ -1045,9 +1060,18 @@ var CmrCheckbox = (props) => {
1045
1060
  };
1046
1061
  var Checkbox_default = CmrCheckbox;
1047
1062
 
1063
+ // src/CmrComponents/input-number/InputNumber.tsx
1064
+ import { InputNumber } from "antd";
1065
+ import { jsx as jsx17 } from "react/jsx-runtime";
1066
+ var CmrInputNumber = (props) => {
1067
+ const { defaultValue, style, max, min, value, onChange, children, ...rest } = props;
1068
+ return /* @__PURE__ */ jsx17(InputNumber, { defaultValue, max, style, min, value, onChange, ...rest, children });
1069
+ };
1070
+ var InputNumber_default = CmrInputNumber;
1071
+
1048
1072
  // src/CmrTable/CmrTable.tsx
1049
1073
  import { DataGrid } from "@mui/x-data-grid";
1050
- import { jsx as jsx17 } from "react/jsx-runtime";
1074
+ import { jsx as jsx18 } from "react/jsx-runtime";
1051
1075
  var CmrTable = (props) => {
1052
1076
  const {
1053
1077
  dataSource,
@@ -1059,7 +1083,7 @@ var CmrTable = (props) => {
1059
1083
  showCheckbox = true,
1060
1084
  ...rest
1061
1085
  } = props;
1062
- return /* @__PURE__ */ jsx17("div", { style: style ?? { height: "400px", width: "100%" }, className: className ?? "", children: /* @__PURE__ */ jsx17(
1086
+ return /* @__PURE__ */ jsx18("div", { style: style ?? { height: "400px", width: "100%" }, className: className ?? "", children: /* @__PURE__ */ jsx18(
1063
1087
  DataGrid,
1064
1088
  {
1065
1089
  rows: dataSource ? dataSource.map((row) => ({
@@ -1092,6 +1116,7 @@ export {
1092
1116
  CmrDeletionDialog,
1093
1117
  CmrEditConfirmation,
1094
1118
  CmrInput,
1119
+ InputNumber_default as CmrInputNumber,
1095
1120
  Label_default as CmrLabel,
1096
1121
  CmrNameDialog,
1097
1122
  Panel_default as CmrPanel,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudmr-ux",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "author": "erosmontin@gmail.com",
5
5
  "license": "MIT",
6
6
  "repository": "erosmontin/cloudmr-ux",