node load props impl - naive

This commit is contained in:
Jan Prochazka
2022-12-28 16:23:43 +01:00
parent 24b5e52666
commit b0f4965fb9
5 changed files with 87 additions and 17 deletions

View File

@@ -164,7 +164,13 @@
}}
/>
{/if}
<ColumnLabel {...column} {foreignKey} forceIcon {iconOverride} />
<ColumnLabel
{...column}
columnName={settings?.getColumnDisplayName ? settings?.getColumnDisplayName(column) : column.columnName}
{foreignKey}
forceIcon
{iconOverride}
/>
{#if designerColumn?.filter}
<FontIcon icon="img filter" />
{/if}

View File

@@ -177,7 +177,7 @@
export function getDomTable() {
const domRefs = { ...columnRefs };
domRefs[''] = domWrapper;
return new DomTableRef(table, domRefs, domCanvas);
return new DomTableRef(table, domRefs, domCanvas, settings);
}
const handleSetTableAlias = () => {
@@ -300,7 +300,7 @@
{/if}
</div>
<div class="columns" on:scroll={() => tick().then(onMoveReferences)} class:scroll={settings?.allowScrollColumns}>
{#each flatColumns || [] as column}
{#each flatColumns || [] as column (column.columnName)}
<ColumnLine
nestingSupported={!!settings?.isColumnExpandable && columns.find(x => settings?.isColumnExpandable(x))}
isExpandable={settings?.isColumnExpandable && settings?.isColumnExpandable(column)}

View File

@@ -6,13 +6,15 @@ export default class DomTableRef {
table: DesignerTableInfo;
designerId: string;
domRefs: { [column: string]: Element };
settings: any;
constructor(table: DesignerTableInfo, domRefs, domWrapper: Element) {
constructor(table: DesignerTableInfo, domRefs, domWrapper: Element, settings) {
this.domTable = domRefs[''];
this.domWrapper = domWrapper;
this.table = table;
this.designerId = table.designerId;
this.domRefs = domRefs;
this.settings = settings;
}
getRect() {
@@ -31,6 +33,10 @@ export default class DomTableRef {
getColumnY(columnName: string) {
let col = this.domRefs[columnName];
while (col == null && this.settings?.getParentColumnName && this.settings?.getParentColumnName(columnName)) {
columnName = this.settings?.getParentColumnName(columnName);
col = this.domRefs[columnName];
}
if (!col) return null;
const rect = col.getBoundingClientRect();
const wrap = this.domWrapper.getBoundingClientRect();