expangine / expangine-vue

A Vue component library for expangine, a visual development framework.
http://expangine.com/vue/
GNU General Public License v3.0
54 stars 0 forks source link

Add Interfaces #232

Open ClickerMonkey opened 4 years ago

ClickerMonkey commented 4 years ago

Describe the solution you'd like Interfaces let you design a UI through dragging and dropping components. There is a component picker which is organized by Collection -> Category -> Component. Components are defined using the following structure:

interface Component {
  collection: string;
  category: string | string[];
  state: Type;
  template: ComponentTemplate,
  watch: Record<string, ComponentWatcher>,
  slots: Record<string, ComponentSlot>
}
type ComponentValue = { expectedType: Type, value: string }
type ComponentTemplate = [Expression | string, Record<string, ComponentValue>, Array<Expression | string | ComponentTemplate>]
type ComponentWatcher = { type: Type, immediate: boolean, update: (value: any, e: Element, c: ComponentInstance) }
type ComponentSlot = { input: Type, 

interface ComponentInstance {
  values: Record<string, Expression>
  watch: Record<string, Expression>
}
// TODO

Requirements

ClickerMonkey commented 3 years ago

A library defines:

Features for designer: