add drag and drop builder

This commit is contained in:
Krrish Ghimire
2026-07-01 01:14:40 +05:45
parent 65f38d68c5
commit 77b32b4d32
31 changed files with 2187 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
import { Component, Input } from '@angular/core';
@Component({
selector: 'app-button-renderer',
standalone: true,
template: `
<a [href]="config['link'] || '#'" class="inline-block text-center no-underline cursor-pointer"
[style]="styleStr">
{{ config['text'] }}
</a>
`,
})
export class ButtonRenderer {
@Input() config: Record<string, unknown> = {};
@Input() styles: Record<string, unknown> = {};
get styleStr(): string {
return Object.entries(this.styles).map(([k, v]) => `${k.replace(/[A-Z]/g, c => '-' + c.toLowerCase())}: ${v}`).join('; ');
}
}