This commit is contained in:
2026-02-09 00:55:02 +01:00
parent f9463b02e4
commit 2ffc1cc58b
3 changed files with 42 additions and 60 deletions

View File

@@ -19,6 +19,31 @@
const icon = (path) => `<svg viewBox="0 0 24 24" width="14" height="14" aria-hidden="true"><path d="${path}" fill="currentColor"/></svg>`;
const tableIcon = icon('M3 4h18v16H3V4zm2 2v3h6V6H5zm8 0v3h6V6h-6zM5 11v3h6v-3H5zm8 0v3h6v-3h-6zM5 16v2h6v-2H5zm8 0v2h6v-2h-6z');
if (!domc.getType || !domc.getType('bridge-table-cell')) {
domc.addType('bridge-table-cell', {
isComponent(el) {
if (!el || !el.tagName) return;
const tag = el.tagName.toUpperCase();
if (tag !== 'TD' && tag !== 'TH') return;
const table = el.closest && el.closest('table');
if (!table || table.getAttribute('data-bridge-table') !== '1') return;
return { type: 'bridge-table-cell' };
},
model: {
defaults: {
editable: true,
selectable: true,
hoverable: true,
highlightable: true,
draggable: false,
droppable: false,
copyable: true,
classes: [],
},
},
});
}
const collectTableCells = (component) => {
const el = component?.view?.el;
if (!el) return [];