onekijs-ui 0.19.27 → 0.19.28
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.js
CHANGED
|
@@ -10534,14 +10534,16 @@ const useFormTableContext = () => {
|
|
|
10534
10534
|
|
|
10535
10535
|
const DeleteRowComponent = ({ rowIndex }) => {
|
|
10536
10536
|
const form = onekijsFramework.useForm();
|
|
10537
|
-
const { tableName
|
|
10537
|
+
const { tableName } = useFormTableContext();
|
|
10538
10538
|
const removeRow = () => {
|
|
10539
|
-
|
|
10540
|
-
form.remove(tableName, rowIndex);
|
|
10541
|
-
}
|
|
10539
|
+
form.remove(tableName, rowIndex);
|
|
10542
10540
|
};
|
|
10543
|
-
const
|
|
10544
|
-
|
|
10541
|
+
const metadata = onekijsFramework.useFormMetadata(tableName);
|
|
10542
|
+
let disabled = false;
|
|
10543
|
+
if (metadata.readOnly || (metadata.editable === false && form.config.reconfigure)) {
|
|
10544
|
+
disabled = true;
|
|
10545
|
+
}
|
|
10546
|
+
return (React.createElement("div", { className: `o-form-table-remove${disabled ? ' o-form-table-remove-disabled' : ''}`, onClick: removeRow },
|
|
10545
10547
|
React.createElement(RemoveIcon$1, { width: "14px", height: "14px" })));
|
|
10546
10548
|
};
|
|
10547
10549
|
const SelectRowComponent = ({ item }) => {
|