@ssplib/react-components 0.0.133 → 0.0.135
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.
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
export default function CheckBox({ name, title, defaultValue, xs, sm, md }: {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function CheckBox({ name, title, defaultValue, xs, sm, md, onChange, }: {
|
|
3
3
|
name: string;
|
|
4
4
|
title: string | JSX.Element;
|
|
5
5
|
defaultValue?: boolean;
|
|
6
|
+
onChange?: (e: React.SyntheticEvent<Element, Event>) => void;
|
|
6
7
|
xs?: number;
|
|
7
8
|
sm?: number;
|
|
8
9
|
md?: number;
|
|
@@ -7,9 +7,9 @@ const material_1 = require("@mui/material");
|
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const form_1 = require("../../../context/form");
|
|
9
9
|
const react_2 = __importDefault(require("react"));
|
|
10
|
-
function CheckBox({ name, title, defaultValue = false, xs = 12, sm, md }) {
|
|
10
|
+
function CheckBox({ name, title, defaultValue = false, xs = 12, sm, md, onChange, }) {
|
|
11
11
|
const context = (0, react_1.useContext)(form_1.FormContext);
|
|
12
12
|
return (react_2.default.createElement(material_1.Grid, Object.assign({ item: true }, { xs, sm, md }),
|
|
13
|
-
react_2.default.createElement(material_1.FormControlLabel, Object.assign({ control: react_2.default.createElement(material_1.Checkbox, { size: 'small', defaultChecked: defaultValue }), label: title }, context === null || context === void 0 ? void 0 : context.formRegister(name)))));
|
|
13
|
+
react_2.default.createElement(material_1.FormControlLabel, Object.assign({ control: react_2.default.createElement(material_1.Checkbox, { size: 'small', defaultChecked: defaultValue }), label: title }, context === null || context === void 0 ? void 0 : context.formRegister(name), { onChange: onChange }))));
|
|
14
14
|
}
|
|
15
15
|
exports.default = CheckBox;
|
|
@@ -240,7 +240,7 @@ function Table({ columns, fetchFunc, emptyMsg = {
|
|
|
240
240
|
values.push(value);
|
|
241
241
|
}
|
|
242
242
|
});
|
|
243
|
-
const csvData = hideTitleCSV ?
|
|
243
|
+
const csvData = hideTitleCSV ? values.join('\n') : '\uFEFF' + header + values.join('\n');
|
|
244
244
|
if (values.length > 0)
|
|
245
245
|
zip.file(`${objKey.normalize('NFD').replace(/[\u0300-\u036f]/g, '')}.csv`, csvData);
|
|
246
246
|
});
|