Debian Codegraph @

node/@patternfly/react-table/dist/js/components/Table/EditableTextCell.js

raw
1 "use strict";
2 Object.defineProperty(exports, "__esModule", { value: true });
3 exports.EditableTextCell = void 0;
4 const tslib_1 = require("tslib");
5 const jsx_runtime_1 = require("react/jsx-runtime");
6 const react_1 = require("react");
7 const TextInput_1 = require('@patternfly/react-core/dist/js/components/TextInput');
8 const inline_edit_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/InlineEdit/inline-edit"));
9 const form_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/Form/form"));
10 const react_styles_1 = require("@patternfly/react-styles");
11 const EditableTextCell = ({ value, rowIndex, cellIndex, props, handleTextInputChange, inputAriaLabel, isDisabled = false }) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: inline_edit_1.default.inlineEditValue, children: value }), (0, jsx_runtime_1.jsxs)("div", { className: inline_edit_1.default.inlineEditInput, children: [(0, jsx_runtime_1.jsx)(TextInput_1.TextInput, { isDisabled: isDisabled, value: props.editableValue !== undefined ? props.editableValue : value, validated: props.isValid !== false ? 'default' : 'error', type: "text", onChange: (event, newValue) => {
12 handleTextInputChange(newValue, event, rowIndex, cellIndex);
13 }, "aria-label": inputAriaLabel }), (0, jsx_runtime_1.jsx)("div", { className: (0, react_styles_1.css)(form_1.default.formHelperText), "aria-live": "polite", children: props.errorText })] })] }));
14 exports.EditableTextCell = EditableTextCell;
15 exports.EditableTextCell.displayName = 'EditableTextCell';
16 //# sourceMappingURL=EditableTextCell.js.map