@adaptabletools/adaptable-cjs
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
36 lines (35 loc) • 1.84 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ValidationSection = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const rebass_1 = require("rebass");
const CheckBox_1 = require("../../../../components/CheckBox");
const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
const Tabs_1 = require("../../../../components/Tabs");
const DataPreview_1 = require("./DataPreview");
const getRowErrors = (errors, primaryKeyValue) => {
if (!errors) {
return null;
}
if (!errors[primaryKeyValue]) {
return null;
}
return errors[primaryKeyValue];
};
const ValidationSection = (props) => {
return (React.createElement(rebass_1.Flex, { flexDirection: "column", p: 2, height: "100%" },
React.createElement(Tabs_1.Tabs, { mb: 2 },
React.createElement(Tabs_1.Tabs.Tab, null, "Import Options"),
React.createElement(Tabs_1.Tabs.Content, null,
React.createElement(FormLayout_1.default, null,
React.createElement(FormLayout_1.FormRow, { label: "Exclude Invalid Rows" },
React.createElement(CheckBox_1.CheckBox, { onChange: () => {
props.onSkipInvalidRowsChange(!props.skipInvalidRows);
}, checked: props.skipInvalidRows }))))),
React.createElement(Tabs_1.Tabs, { flex: 1 },
React.createElement(Tabs_1.Tabs.Tab, null, "Preview"),
React.createElement(Tabs_1.Tabs.Content, null,
React.createElement(DataPreview_1.DataPreview, { columnsMap: props.columnsMap, data: props.data, errors: props.errors, editable: true, onDataChange: props.onDataChange })))));
};
exports.ValidationSection = ValidationSection;