0.0.25 • Published 2 years ago
vue-page-kabob v0.0.25
Vue Page
A page builder and display
Components
Vue Page Component
<template>
<vue-page
:form="form"
:state="state"
:languages="languages"
:view="formView"
@onFormChange="onFormChange"
@onStateChange="onStateChange"
/>
</template>
<script>
import {VuePage} from 'vue-page';
...
</script>
Props
Property | Type | Default | Description |
---|---|---|---|
form | Form | The structure of the page including all the widgets and its configurations | |
state | FormState | The state of the form and all its widgets | |
languages | Languages | A JSON containing all locale key-values for each widget | |
view | FormView | The view to display | |
widgetControls | { key: string: WidgetControl } | {} | Import/Override widgets to be used in form |
widgetEffectControls | { key: string: QuestionControl } | {} | Import/Override widget effects to be used in form |
questionControls | { key: string: QuestionControl } | {} | Import/Override widgets to be used in form |
plugins | Plugins | {} | Import/Override widgets to be used in form |
onFormChange | (newForm: Form) => void | ||
onStateChange | (newState: FormState) => void |
Built-in Widget Controls
You can view the list of built-in widget controls here
Built-in Widget Effect Controls
You can view the list of built-in widget controls here
Built-in Question Controls
You can view the list of built-in question controls here
Models
Plugins
Array<{
widgetControls: { [widgetType: string]: WidgetControl };
widgetEffectControls: { [widgetEffectType: string]: WidgetEffectControl };
questionControls: { [questionType: string]: QuestionControl };
}>
Form
{
id: string;
widgets: Widget[];
configs: {};
state: FormState;
}
Widget
{
id: string;
type: string;
code?: string;
parent?: string;
style?: string;
reflexiveRules?: ConditionProperties[];
validationRules?: Array<{ conditions: ConditionProperties[]; error: string }>;
order?: number;
properties: WidgetProperties;
}
FormState
{
widgetState: { [widgetId: string]: any; };
widgetCodeToIdMap: { [widgetCode: string]: string };
reflexCodeToIdsMap: { [widgetCode: string]: string };
}
FormView
"display" | "readOnly";
WidgetControl
{
readOnly: VueConstructor<Vue>;
display: VueConstructor<Vue>;
widgetItem?: typeof WidgetItem;
}
QuestionControl
{
form?: VueConstructor<Vue>;
display: VueConstructor<Vue>;
readOnly: VueConstructor<Vue>;
}
Languages
{
[(formId | widgetId | widgetEffectId): string]: {
[localeKey: string]: string;
}
}
Folder Structure
├── models
│ ├── FormState.ts
│ └── WidgetItem.ts
├── questionControls
│ ├── checkbox
│ ├── numberPicker
│ ├── radio
│ ├── FormControl.ts
│ └── index.ts
├── widgetControls
│ ├── header
│ ├── pages
│ ├── question
│ └── index.ts
├── widgetEffectControls
│ ├── anchor
│ ├── aspectRatio
│ ├── boxed
│ ├── gradient
│ ├── opacity
│ ├── reveal
├── index.ts
├── interfaces.ts
├── utils.ts
├── VuePage.vue
├── WidgetsLayout.vue
└── WidgetView.vue
TODO
widgetEffects to wrap widgets
handle theming/styling
outside triggers/event handlers programmatically
separate question and widget locale messages (question messages should have prefix)
0.0.24
2 years ago
0.0.25
2 years ago
0.0.23
2 years ago
0.0.22
2 years ago
0.0.21
2 years ago
0.0.20
2 years ago
0.0.19
2 years ago
0.0.18
2 years ago
0.0.16
2 years ago
0.0.14
2 years ago
0.0.13
2 years ago
0.0.12
2 years ago
0.0.11
2 years ago
0.0.10
2 years ago
0.0.9
2 years ago
0.0.8
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago