BREAKING CHANGE(decorators): Migrate to TC39 standard decorators (accessor) across components, update tsconfig and bump dependencies

This commit is contained in:
2025-11-17 13:27:11 +00:00
parent 70c29c778c
commit 92f69e2aa6
75 changed files with 2142 additions and 1901 deletions

View File

@@ -34,38 +34,38 @@ export class DeesTable<T> extends DeesElement {
@property({
type: String,
})
public heading1: string = 'heading 1';
accessor heading1: string = 'heading 1';
@property({
type: String,
})
public heading2: string = 'heading 2';
accessor heading2: string = 'heading 2';
@property({
type: Array,
})
public data: T[] = [];
accessor data: T[] = [];
// dees-form compatibility -----------------------------------------
@property({
type: String,
})
public key: string;
accessor key: string;
@property({
type: String,
})
public label: string;
accessor label: string;
@property({
type: Boolean,
})
public disabled: boolean = false;
accessor disabled: boolean = false;
@property({
type: Boolean,
})
public required: boolean = false;
accessor required: boolean = false;
get value() {
return this.data;
@@ -81,77 +81,77 @@ export class DeesTable<T> extends DeesElement {
type: String,
reflect: true,
})
public dataName: string;
accessor dataName: string;
@property({
type: Boolean,
})
searchable: boolean = true;
accessor searchable: boolean = true;
@property({
type: Array,
})
public dataActions: ITableAction<T>[] = [];
accessor dataActions: ITableAction<T>[] = [];
// schema-first columns API
@property({ attribute: false })
public columns: Column<T>[] = [];
accessor columns: Column<T>[] = [];
/**
* Stable row identity for selection and updates. If provided as a function,
* it is only usable as a property (not via attribute).
*/
@property({ attribute: false })
public rowKey?: keyof T | ((row: T) => string);
accessor rowKey: keyof T | ((row: T) => string) | undefined = undefined;
/**
* When true and columns are provided, merge any missing columns discovered
* via displayFunction into the effective schema.
*/
@property({ type: Boolean })
public augmentFromDisplayFunction: boolean = false;
accessor augmentFromDisplayFunction: boolean = false;
@property({
attribute: false,
})
public displayFunction: TDisplayFunction = (itemArg: T) => itemArg as any;
accessor displayFunction: TDisplayFunction = (itemArg: T) => itemArg as any;
@property({
attribute: false,
})
public reverseDisplayFunction: (itemArg: any) => T = (itemArg: any) => itemArg as T;
accessor reverseDisplayFunction: (itemArg: any) => T = (itemArg: any) => itemArg as T;
@property({
type: Object,
})
public selectedDataRow: T;
accessor selectedDataRow: T;
@property({
type: Array,
})
public editableFields: string[] = [];
accessor editableFields: string[] = [];
@property({
type: Boolean,
reflect: true,
attribute: 'show-vertical-lines'
})
public showVerticalLines: boolean = false;
accessor showVerticalLines: boolean = false;
@property({
type: Boolean,
reflect: true,
attribute: 'show-horizontal-lines'
})
public showHorizontalLines: boolean = false;
accessor showHorizontalLines: boolean = false;
@property({
type: Boolean,
reflect: true,
attribute: 'show-grid'
})
public showGrid: boolean = true;
accessor showGrid: boolean = true;
public files: File[] = [];
public fileWeakMap = new WeakMap();
@@ -160,32 +160,32 @@ export class DeesTable<T> extends DeesElement {
// simple client-side sorting (Phase 1)
@property({ attribute: false })
private sortKey?: string;
accessor sortKey: string | undefined = undefined;
@property({ attribute: false })
private sortDir: 'asc' | 'desc' | null = null;
accessor sortDir: 'asc' | 'desc' | null = null;
// simple client-side filtering (Phase 1)
@property({ type: String })
public filterText: string = '';
accessor filterText: string = '';
// per-column quick filters
@property({ attribute: false })
public columnFilters: Record<string, string> = {};
accessor columnFilters: Record<string, string> = {};
@property({ type: Boolean, attribute: 'show-column-filters' })
public showColumnFilters: boolean = false;
accessor showColumnFilters: boolean = false;
@property({ type: Boolean, reflect: true, attribute: 'sticky-header' })
public stickyHeader: boolean = false;
accessor stickyHeader: boolean = false;
// search row state
@property({ type: String })
public searchMode: 'table' | 'data' | 'server' = 'table';
accessor searchMode: 'table' | 'data' | 'server' = 'table';
private __searchTextSub?: { unsubscribe?: () => void };
private __searchModeSub?: { unsubscribe?: () => void };
// selection (Phase 1)
@property({ type: String })
public selectionMode: 'none' | 'single' | 'multi' = 'none';
accessor selectionMode: 'none' | 'single' | 'multi' = 'none';
@property({ attribute: false })
private selectedIds: Set<string> = new Set();
accessor selectedIds: Set<string> = new Set();
private _rowIdMap = new WeakMap<object, string>();
private _rowIdCounter = 0;