cloudmr-ux 1.0.4 → 1.0.5

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.d.ts CHANGED
@@ -1,68 +1,69 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ButtonProps } from '@mui/material';
3
- import React, { ChangeEvent, CSSProperties } from 'react';
3
+ import React, { ChangeEvent, CSSProperties, FC } from 'react';
4
4
  import { SizeType } from 'antd/lib/config-provider/SizeContext';
5
5
  import { DataGridProps } from '@mui/x-data-grid';
6
6
 
7
7
  declare const CmrButton: (props: ButtonProps) => react_jsx_runtime.JSX.Element;
8
8
 
9
- interface CmrCheckboxProps extends React.HTMLAttributes<HTMLDivElement> {
10
- autoFocus?: boolean;
11
- checked?: boolean;
12
- defaultChecked?: boolean;
13
- disabled?: boolean;
14
- indeterminate?: boolean;
15
- onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
16
- children?: any;
17
- style?: any;
18
- }
9
+ interface CmrCheckboxProps extends React.HTMLAttributes<HTMLDivElement> {
10
+ autoFocus?: boolean;
11
+ checked?: boolean;
12
+ defaultChecked?: boolean;
13
+ disabled?: boolean;
14
+ indeterminate?: boolean;
15
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
16
+ children?: any;
17
+ style?: any;
18
+ }
19
19
  declare const CmrCheckbox: (props: CmrCheckboxProps) => react_jsx_runtime.JSX.Element;
20
20
 
21
- interface CmrInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'type'> {
22
- defaultValue?: string;
23
- id?: string;
24
- maxLength?: number;
25
- size?: SizeType;
26
- value?: string;
27
- type?: any;
28
- prefix?: React.ReactNode;
29
- bordered?: boolean;
30
- onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
31
- onPressEnter?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
32
- }
21
+ interface CmrInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'type'> {
22
+ defaultValue?: string;
23
+ id?: string;
24
+ maxLength?: number;
25
+ size?: SizeType;
26
+ value?: string;
27
+ type?: any;
28
+ prefix?: React.ReactNode;
29
+ bordered?: boolean;
30
+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
31
+ onPressEnter?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
32
+ }
33
33
  declare const CmrInput: (props: CmrInputProps) => react_jsx_runtime.JSX.Element;
34
34
 
35
- interface CmrRadioOption {
36
- label: string;
37
- value: string;
38
- disabled?: boolean;
39
- }
40
- interface CmrRadioProps {
41
- options: CmrRadioOption[];
42
- groupLabel?: string;
43
- defaultValue?: string;
44
- onChange?: (value: string) => void;
45
- }
35
+ interface CmrRadioOption {
36
+ label: string;
37
+ value: string;
38
+ disabled?: boolean;
39
+ }
40
+ interface CmrRadioProps {
41
+ options: CmrRadioOption[];
42
+ groupLabel?: string;
43
+ defaultValue?: string;
44
+ onChange?: (value: string) => void;
45
+ }
46
46
  declare const CmrRadioGroup: React.FC<CmrRadioProps>;
47
47
 
48
- interface Option {
49
- label: string;
50
- value: string;
51
- }
52
- interface CmrSelectProps {
53
- options: Option[];
54
- label: string;
55
- disabled?: boolean;
56
- }
48
+ interface Option {
49
+ label: string;
50
+ value: string;
51
+ }
52
+ interface CmrSelectProps {
53
+ options: Option[];
54
+ label: string;
55
+ disabled?: boolean;
56
+ }
57
57
  declare const CmrSelect: React.FC<CmrSelectProps>;
58
58
 
59
- interface CmrTableProps extends Omit<DataGridProps, 'rows'> {
60
- dataSource: any[];
61
- idAlias?: string;
62
- name?: string;
63
- style?: CSSProperties;
64
- showCheckbox?: boolean;
59
+ interface CmrTableProps extends Omit<DataGridProps, 'rows'> {
60
+ dataSource: any[];
61
+ idAlias?: string;
62
+ name?: string;
63
+ style?: CSSProperties;
64
+ showCheckbox?: boolean;
65
65
  }
66
- declare const CmrTable: (props: CmrTableProps) => react_jsx_runtime.JSX.Element;
67
66
 
68
- export { CmrButton, CmrCheckbox, CmrInput, CmrRadioGroup, CmrSelect, CmrTable };
67
+ declare const CmrTable: FC<CmrTableProps>;
68
+
69
+ export { CmrButton, CmrCheckbox, CmrInput, CmrRadioGroup, CmrSelect, CmrTable, CmrTableProps };
package/dist/index.js CHANGED
@@ -25,7 +25,7 @@ __export(src_exports, {
25
25
  CmrInput: () => CmrInput,
26
26
  CmrRadioGroup: () => CmrRadioGroup_default,
27
27
  CmrSelect: () => CmrSelect_default,
28
- CmrTable: () => CmrTable_default
28
+ CmrTable: () => CmrTable2
29
29
  });
30
30
  module.exports = __toCommonJS(src_exports);
31
31
 
@@ -178,11 +178,23 @@ var CmrSelect_default = CmrSelect;
178
178
  var import_x_data_grid = require("@mui/x-data-grid");
179
179
  var import_jsx_runtime6 = require("react/jsx-runtime");
180
180
  var CmrTable = (props) => {
181
- const { dataSource, columns, idAlias, className, onRowSelectionModelChange, style, showCheckbox = true, ...rest } = props;
182
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: style ? style : { height: "400px", width: "100%" }, className: `${className ? className : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
181
+ const {
182
+ dataSource,
183
+ columns,
184
+ idAlias,
185
+ className,
186
+ onRowSelectionModelChange,
187
+ style,
188
+ showCheckbox = true,
189
+ ...rest
190
+ } = props;
191
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: style ?? { height: "400px", width: "100%" }, className: className ?? "", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
183
192
  import_x_data_grid.DataGrid,
184
193
  {
185
- rows: dataSource ? dataSource.map((row) => ({ id: idAlias ? row[idAlias] : row["id"], ...row })) : [],
194
+ rows: dataSource ? dataSource.map((row) => ({
195
+ id: idAlias ? row[idAlias] : row["id"],
196
+ ...row
197
+ })) : [],
186
198
  columns,
187
199
  checkboxSelection: showCheckbox,
188
200
  onRowSelectionModelChange,
@@ -197,6 +209,9 @@ var CmrTable = (props) => {
197
209
  ) });
198
210
  };
199
211
  var CmrTable_default = CmrTable;
212
+
213
+ // src/index.ts
214
+ var CmrTable2 = CmrTable_default;
200
215
  // Annotate the CommonJS export names for ESM import in node:
201
216
  0 && (module.exports = {
202
217
  CmrButton,
package/dist/index.mjs CHANGED
@@ -153,11 +153,23 @@ var CmrSelect_default = CmrSelect;
153
153
  import { DataGrid } from "@mui/x-data-grid";
154
154
  import { jsx as jsx6 } from "react/jsx-runtime";
155
155
  var CmrTable = (props) => {
156
- const { dataSource, columns, idAlias, className, onRowSelectionModelChange, style, showCheckbox = true, ...rest } = props;
157
- return /* @__PURE__ */ jsx6("div", { style: style ? style : { height: "400px", width: "100%" }, className: `${className ? className : ""}`, children: /* @__PURE__ */ jsx6(
156
+ const {
157
+ dataSource,
158
+ columns,
159
+ idAlias,
160
+ className,
161
+ onRowSelectionModelChange,
162
+ style,
163
+ showCheckbox = true,
164
+ ...rest
165
+ } = props;
166
+ return /* @__PURE__ */ jsx6("div", { style: style ?? { height: "400px", width: "100%" }, className: className ?? "", children: /* @__PURE__ */ jsx6(
158
167
  DataGrid,
159
168
  {
160
- rows: dataSource ? dataSource.map((row) => ({ id: idAlias ? row[idAlias] : row["id"], ...row })) : [],
169
+ rows: dataSource ? dataSource.map((row) => ({
170
+ id: idAlias ? row[idAlias] : row["id"],
171
+ ...row
172
+ })) : [],
161
173
  columns,
162
174
  checkboxSelection: showCheckbox,
163
175
  onRowSelectionModelChange,
@@ -172,11 +184,14 @@ var CmrTable = (props) => {
172
184
  ) });
173
185
  };
174
186
  var CmrTable_default = CmrTable;
187
+
188
+ // src/index.ts
189
+ var CmrTable2 = CmrTable_default;
175
190
  export {
176
191
  CmrButton,
177
192
  CmrCheckbox,
178
193
  CmrInput,
179
194
  CmrRadioGroup_default as CmrRadioGroup,
180
195
  CmrSelect_default as CmrSelect,
181
- CmrTable_default as CmrTable
196
+ CmrTable2 as CmrTable
182
197
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudmr-ux",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "author": "erosmontin@gmail.com",
5
5
  "license": "MIT",
6
6
  "repository": "erosmontin/cloudmr-ux",
@@ -22,7 +22,7 @@
22
22
  "react": "^18.0.0",
23
23
  "react-dom": "^18.0.0",
24
24
  "tsup": "^6.7.0",
25
- "typescript": "^5.6.3"
25
+ "typescript": "^4.9.5"
26
26
  },
27
27
  "dependencies": {
28
28
  "@emotion/react": "^11.14.0",