update spec

This commit is contained in:
Bowen Tan 2021-10-11 18:25:08 +08:00
parent 52aa74b965
commit 111ebf79de
28 changed files with 87 additions and 33 deletions

View File

@ -15,13 +15,11 @@ export type Component = {
type ComponentSpec = {
properties: JSONSchema7Object;
acceptTraits: TraitSchema[];
state: JSONSchema7;
methods: MethodSchema[];
};
type TraitSchema = {
name: string;
styleSlots: string[];
slots: string[];
events: string[];
};
// extended runtime

View File

@ -302,9 +302,11 @@ export default {
},
spec: {
properties: StyleSchema,
acceptTraits: [],
state: {},
methods: [],
slots: ['content'],
styleSlots: [],
events: [],
},
}),
impl: Box,

View File

@ -75,13 +75,15 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: StateSchema,
methods: [
{
name: 'click',
},
],
slots: [],
styleSlots: [],
events: ['click'],
},
}),
impl: Button,

View File

@ -125,9 +125,11 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: CheckboxStateSchema,
methods: [],
slots: [],
styleSlots: [],
events: [],
},
}),
impl: Checkbox,

View File

@ -59,9 +59,11 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: StateSchema,
methods: [],
slots: ['content'],
styleSlots: [],
events: [],
},
}),
impl: CheckboxGroup,

View File

@ -117,7 +117,6 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: {},
methods: [
{
@ -133,6 +132,9 @@ export default {
name: 'cancelDialog',
},
],
slots: ['content'],
styleSlots: [],
events: ['cancelDialog', 'confirmDialog'],
},
}),
impl: Dialog,

View File

@ -129,7 +129,6 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: Type.Object({
data: Type.Any(),
disableSubmit: Type.Boolean(),
@ -139,6 +138,9 @@ export default {
name: 'resetForm',
},
],
slots: ['content'],
styleSlots: [],
events: ['onSubmit'],
},
}),
impl: FormImpl,

View File

@ -128,7 +128,6 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: Type.Object({
inputId: Type.String(),
fieldName: Type.String(),
@ -136,6 +135,9 @@ export default {
value: Type.Any(),
}),
methods: [],
slots: ['content'],
styleSlots: [],
events: [],
},
}),
impl: FormControlImpl,

View File

@ -49,9 +49,11 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: {},
methods: [],
slots: ['content'],
styleSlots: [],
events: [],
},
}),
impl: HStack,

View File

@ -137,9 +137,11 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: StateSchema,
methods: [{ name: 'onLoad' }],
methods: [],
slots: [],
styleSlots: [],
events: ['onLoad', 'onError'],
},
}),
impl: Image,

View File

@ -147,7 +147,6 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: StateSchema,
methods: [
{
@ -160,6 +159,9 @@ export default {
name: 'resetInputValue',
},
],
slots: [],
styleSlots: [],
events: [],
},
}),
impl: Input,

View File

@ -46,9 +46,11 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: StateSchema,
methods: [],
slots: [],
styleSlots: [],
events: [],
},
}),
impl: Kbd,

View File

@ -134,9 +134,11 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
methods: [],
state: {},
slots: [],
styleSlots: [],
events: [],
},
}),
impl: List,

View File

@ -115,7 +115,6 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: StateSchema,
methods: [
{
@ -128,6 +127,9 @@ export default {
name: 'resetInputValue',
},
],
slots: [],
styleSlots: [],
events: [],
},
}),
impl: NumberInput,

View File

@ -91,9 +91,11 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: StateSchema,
methods: [],
slots: [],
styleSlots: [],
events: [],
},
}),
impl: Radio,

View File

@ -56,9 +56,11 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: StateSchema,
methods: [],
slots: ['content'],
styleSlots: [],
events: [],
},
}),
impl: RadioGroup,

View File

@ -24,9 +24,11 @@ export default {
},
spec: {
properties: {},
acceptTraits: [],
state: {},
methods: [],
slots: ['root'],
styleSlots: [],
events: [],
},
}),
impl: Root,

View File

@ -118,9 +118,11 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: StateSchema,
methods: [],
slots: [],
styleSlots: [],
events: [],
},
}),
impl: Select,

View File

@ -74,9 +74,11 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: {},
methods: [],
slots: ['content'],
styleSlots: [],
events: [],
},
}),
impl: Stack,

View File

@ -52,9 +52,11 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: TableStateSchema,
methods: [],
slots: [],
styleSlots: [],
events: [],
},
}),
impl: TableImpl,

View File

@ -66,9 +66,12 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: StateSchema,
methods: [],
// tab slot is dynamic
slots: [],
styleSlots: [],
events: [],
},
}),
impl: Tabs,

View File

@ -81,9 +81,11 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: {},
methods: [],
slots: ['trigger'],
styleSlots: [],
events: [],
},
}),
impl: TooltipImpl,

View File

@ -50,9 +50,11 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: {},
methods: [],
slots: ['content'],
styleSlots: [],
events: [],
},
}),
impl: VStack,

View File

@ -24,9 +24,11 @@ export default {
},
spec: {
properties: {},
acceptTraits: [],
state: {},
methods: [],
slots: [],
styleSlots: [],
events: [],
},
}),
impl: Dummy,

View File

@ -50,9 +50,11 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: {},
methods: [],
slots: ['container'],
styleSlots: [],
events: [],
},
}),
impl: GridLayout,

View File

@ -67,9 +67,12 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: {},
methods: [],
// route slots are dynamic
slots: [],
styleSlots: [],
events: [],
},
}),
impl: Router,

View File

@ -31,9 +31,11 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: StateSchema,
methods: [],
slots: [],
styleSlots: [],
events: [],
},
}),
impl: Text,

View File

@ -54,13 +54,15 @@ export default {
},
spec: {
properties: PropsSchema,
acceptTraits: [],
state: StateSchema,
methods: [
{
name: 'click',
},
],
slots: [],
styleSlots: [],
events: ['click'],
},
}),
impl: Button,