feat: add async demo support and enhance template resolution
- Introduced async demo functionality in the README, allowing for asynchronous data preparation before rendering components. - Updated WccDashboard, WccProperties, and WccSidebar to support Promise-based template factories. - Implemented resolveTemplateFactory to handle both synchronous and asynchronous template results. - Added tests for resolveTemplateFactory to ensure correct behavior for both sync and async templates. - Updated pnpm workspace configuration.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { DeesElement, property, html, customElement, type TemplateResult, state } from '@design.estate/dees-element';
|
||||
import { WccDashboard } from './wcc-dashboard.js';
|
||||
import type { TTemplateFactory } from './wcctools.helpers.js';
|
||||
|
||||
export type TPropertyType = 'String' | 'Number' | 'Boolean' | 'Object' | 'Enum' | 'Array';
|
||||
|
||||
@@ -20,7 +21,7 @@ export class WccProperties extends DeesElement {
|
||||
public dashboardRef: WccDashboard;
|
||||
|
||||
@property()
|
||||
public selectedItem: (() => TemplateResult) | DeesElement;
|
||||
public selectedItem: TTemplateFactory | DeesElement;
|
||||
|
||||
@property()
|
||||
public selectedViewport: TEnvironment = 'native';
|
||||
|
Reference in New Issue
Block a user