|
@@ -0,0 +1,488 @@
|
|
|
|
+import _ from 'lodash'
|
|
|
|
+import {PropertyDescription, PropertyDescriptionInterface, PropertyValue} from './PropertyDescription'
|
|
|
|
+
|
|
|
|
+export const PropertyDescriptionTable = new Map<String, PropertyDescription>()
|
|
|
|
+
|
|
|
|
+PropertyDescriptionTable.set(
|
|
|
|
+ 'tabCell',
|
|
|
|
+ new PropertyDescription({
|
|
|
|
+ props: [
|
|
|
|
+ {
|
|
|
|
+ name: 'header',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '选项卡名称',
|
|
|
|
+ type: 'string'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'close',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '是否允许关闭',
|
|
|
|
+ type: 'boolean'
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
|
|
+ })
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+export const width: PropertyValue = {
|
|
|
|
+ name: 'width',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '宽',
|
|
|
|
+ type: 'number'
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export const height: PropertyValue = {
|
|
|
|
+ name: 'height',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '高',
|
|
|
|
+ type: 'number'
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export const fieldLabel: PropertyValue = {
|
|
|
|
+ name: 'fieldLabel',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '文本描述',
|
|
|
|
+ type: 'string',
|
|
|
|
+ expr: true,
|
|
|
|
+};
|
|
|
|
+export const borderless: PropertyValue = {
|
|
|
|
+ name: 'borderless',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'css',
|
|
|
|
+ desc: '是否有边框',
|
|
|
|
+ type: 'boolean',
|
|
|
|
+};
|
|
|
|
+export const labelAlign: PropertyValue = {
|
|
|
|
+ name: 'labelAlign',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '描述对齐方式',
|
|
|
|
+ type: ['left', 'right', 'center']
|
|
|
|
+};
|
|
|
|
+export const type: PropertyValue = {
|
|
|
|
+ name: 'type',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'css',
|
|
|
|
+ desc: '容器内部线类型',
|
|
|
|
+ type: ['line', 'clean', 'wide', 'space', 'form']
|
|
|
|
+};
|
|
|
|
+export const labelWidth: PropertyValue = {
|
|
|
|
+ name: 'labelWidth',
|
|
|
|
+ default: undefined,
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '文本宽度',
|
|
|
|
+ type: 'number'
|
|
|
|
+};
|
|
|
|
+export const gravity: PropertyValue = {
|
|
|
|
+ name: 'gravity',
|
|
|
|
+ default: 1,
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '占位权重',
|
|
|
|
+ type: 'number'
|
|
|
|
+};
|
|
|
|
+export const hidden: PropertyValue = {
|
|
|
|
+ name: 'hidden',
|
|
|
|
+ default: false,
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '隐藏',
|
|
|
|
+ type: 'boolean',
|
|
|
|
+ expr: true,
|
|
|
|
+};
|
|
|
|
+export const readonly: PropertyValue = {
|
|
|
|
+ name: 'readonly',
|
|
|
|
+ default: false,
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '只读',
|
|
|
|
+ type: 'boolean',
|
|
|
|
+ expr: true,
|
|
|
|
+};
|
|
|
|
+export const disabled: PropertyValue = {
|
|
|
|
+ name: 'disabled',
|
|
|
|
+ default: false,
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '禁用',
|
|
|
|
+ type: 'boolean',
|
|
|
|
+ expr: true,
|
|
|
|
+};
|
|
|
|
+export const loading: PropertyValue = {
|
|
|
|
+ name: 'loading',
|
|
|
|
+ default: false,
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '载入中',
|
|
|
|
+ type: 'boolean',
|
|
|
|
+ expr: true,
|
|
|
|
+};
|
|
|
|
+export const required: PropertyValue = {
|
|
|
|
+ name: 'required',
|
|
|
|
+ default: false,
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '必填',
|
|
|
|
+ type: 'boolean',
|
|
|
|
+ expr: true,
|
|
|
|
+};
|
|
|
|
+export const value: PropertyValue = {
|
|
|
|
+ name: 'value',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '字段值',
|
|
|
|
+ type: 'string',
|
|
|
|
+ expr: true,
|
|
|
|
+};
|
|
|
|
+export const prompt: PropertyValue = {
|
|
|
|
+ name: 'prompt',
|
|
|
|
+ default: '请输入',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '水印',
|
|
|
|
+ type: 'string'
|
|
|
|
+};
|
|
|
|
+export const validType: PropertyValue = {
|
|
|
|
+ name: 'validType',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '校验类型',
|
|
|
|
+ type: 'valid'
|
|
|
|
+};
|
|
|
|
+export const metaId: PropertyValue = {
|
|
|
|
+ name: 'metaId',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'bind',
|
|
|
|
+ desc: '元数据ID',
|
|
|
|
+ type: 'string'
|
|
|
|
+};
|
|
|
|
+export const template: PropertyValue = {
|
|
|
|
+ name: 'template',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: 'HTML内容',
|
|
|
|
+ type: 'string',
|
|
|
|
+ expr: true,
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export const tooltip: PropertyValue = {
|
|
|
|
+ name: 'tooltip',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '悬停提示',
|
|
|
|
+ type: 'string'
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export const onClick: PropertyValue = {
|
|
|
|
+ name: 'onClick',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'event',
|
|
|
|
+ desc: '点击事件',
|
|
|
|
+ eventParamter: [
|
|
|
|
+ 'sender: YvanUI.CtlButton',
|
|
|
|
+ 'e: any'
|
|
|
|
+ ],
|
|
|
|
+ eventDoc(vjson) {
|
|
|
|
+ return (vjson['text'] ? vjson['text'] : '按钮') + '被点击后触发';
|
|
|
|
+ },
|
|
|
|
+ type: 'string'
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+PropertyDescriptionTable.set(
|
|
|
|
+ 'rows',
|
|
|
|
+ new PropertyDescription({
|
|
|
|
+ props: [
|
|
|
|
+ gravity,
|
|
|
|
+ width
|
|
|
|
+ ]
|
|
|
|
+ })
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+PropertyDescriptionTable.set(
|
|
|
|
+ 'cols',
|
|
|
|
+ new PropertyDescription({
|
|
|
|
+ props: [
|
|
|
|
+ gravity,
|
|
|
|
+ height
|
|
|
|
+ ]
|
|
|
|
+ })
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+PropertyDescriptionTable.set(
|
|
|
|
+ 'window',
|
|
|
|
+ new PropertyDescription({
|
|
|
|
+ props: [
|
|
|
|
+ {
|
|
|
|
+ name: '_designMode',
|
|
|
|
+ default: 'module',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '设计类型',
|
|
|
|
+ type: ['none', 'dialog', 'scroll-dialog']
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'title',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '对话框标题',
|
|
|
|
+ type: 'string'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'modal',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '是否模态',
|
|
|
|
+ type: 'boolean'
|
|
|
|
+ },
|
|
|
|
+ _.merge(_.cloneDeep(width), {default: 200}),
|
|
|
|
+ _.merge(_.cloneDeep(height), {default: 200}),
|
|
|
|
+ {
|
|
|
|
+ name: 'top',
|
|
|
|
+ default: 200,
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '顶像素',
|
|
|
|
+ type: 'number'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'left',
|
|
|
|
+ default: 200,
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '左像素',
|
|
|
|
+ type: 'number'
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ })
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+PropertyDescriptionTable.set(
|
|
|
|
+ 'layout',
|
|
|
|
+ new PropertyDescription({
|
|
|
|
+ props: [
|
|
|
|
+ {
|
|
|
|
+ name: 'borderless',
|
|
|
|
+ default: true,
|
|
|
|
+ group: 'css',
|
|
|
|
+ desc: '有无边框',
|
|
|
|
+ type: 'boolean'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'type',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'css',
|
|
|
|
+ desc: '布局类型',
|
|
|
|
+ type: ['line', 'clean', 'wide', 'space', 'form']
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: '_designMode',
|
|
|
|
+ default: 'module',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '设计类型',
|
|
|
|
+ type: ['none', 'module', 'scroll-module']
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ })
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+export const YvBase: PropertyDescriptionInterface = {
|
|
|
|
+ props: [
|
|
|
|
+ {
|
|
|
|
+ name: 'bind',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'bind',
|
|
|
|
+ desc: '实体类名',
|
|
|
|
+ type: 'string'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'ref',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'bind',
|
|
|
|
+ desc: '控件名',
|
|
|
|
+ type: 'string'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'css',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'css',
|
|
|
|
+ desc: '样式类名',
|
|
|
|
+ type: 'string'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'hidden',
|
|
|
|
+ default: true,
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '是否显示',
|
|
|
|
+ type: 'boolean'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'padding',
|
|
|
|
+ default: undefined,
|
|
|
|
+ group: 'css',
|
|
|
|
+ desc: '内边距',
|
|
|
|
+ type: 'object'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'margin',
|
|
|
|
+ default: undefined,
|
|
|
|
+ group: 'css',
|
|
|
|
+ desc: '外边距',
|
|
|
|
+ type: 'object'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'ff',
|
|
|
|
+ default: 0,
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '自动定焦时间',
|
|
|
|
+ type: 'number'
|
|
|
|
+ },
|
|
|
|
+ width, height,
|
|
|
|
+ {
|
|
|
|
+ name: 'autowidth',
|
|
|
|
+ default: false,
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '自动计算宽度',
|
|
|
|
+ type: 'boolean'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'autoheight',
|
|
|
|
+ default: false,
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '自动计算高度',
|
|
|
|
+ type: 'boolean'
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ events: [
|
|
|
|
+ {name: 'onRender', desc: '第一次控件被渲染时触发'}
|
|
|
|
+ ]
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export const YvDataSource: PropertyDescriptionInterface = {
|
|
|
|
+ props: [
|
|
|
|
+ {
|
|
|
|
+ name: 'type',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'data',
|
|
|
|
+ desc: '数据源类型',
|
|
|
|
+ type: 'dataSource'
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ events: [{name: 'onDataComplete', desc: '数据绑定完成后触发'}]
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+PropertyDescriptionTable.set(
|
|
|
|
+ 'template',
|
|
|
|
+ new PropertyDescription(YvBase, {
|
|
|
|
+ props: [
|
|
|
|
+ template
|
|
|
|
+ ]
|
|
|
|
+ })
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+PropertyDescriptionTable.set(
|
|
|
|
+ 'fieldset',
|
|
|
|
+ new PropertyDescription(YvBase, {
|
|
|
|
+ props: [
|
|
|
|
+ {
|
|
|
|
+ name: 'label',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '字段组标题',
|
|
|
|
+ type: 'string'
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ })
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+PropertyDescriptionTable.set(
|
|
|
|
+ 'iframe',
|
|
|
|
+ new PropertyDescription(YvBase, {
|
|
|
|
+ props: [
|
|
|
|
+ {
|
|
|
|
+ name: 'src',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '地址路径',
|
|
|
|
+ type: 'string'
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ })
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+PropertyDescriptionTable.set(
|
|
|
|
+ 'uploader',
|
|
|
|
+ new PropertyDescription(YvBase, {
|
|
|
|
+ props: [
|
|
|
|
+ width, height,
|
|
|
|
+ {
|
|
|
|
+ name: 'value',
|
|
|
|
+ default: '上传',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '文本描述',
|
|
|
|
+ type: 'string'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'upload',
|
|
|
|
+ default: '/upload',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '上传地址',
|
|
|
|
+ type: 'string'
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ events: [
|
|
|
|
+ {name: 'onFileUpload', desc: '文件上传成功结束时触发'},
|
|
|
|
+ {name: 'onFileUploadError', desc: '在上传过程中发生服务器端错误时触发'},
|
|
|
|
+ ]
|
|
|
|
+ })
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+PropertyDescriptionTable.set(
|
|
|
|
+ 'viewer',
|
|
|
|
+ new PropertyDescription(YvBase, {
|
|
|
|
+ props: [
|
|
|
|
+ value,
|
|
|
|
+ gravity,
|
|
|
|
+ {
|
|
|
|
+ name: 'imgWidth',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '图片宽',
|
|
|
|
+ type: 'string'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'imgHeight',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '图片高',
|
|
|
|
+ type: 'string'
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ })
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+PropertyDescriptionTable.set(
|
|
|
|
+ 'image',
|
|
|
|
+ new PropertyDescription(YvBase, {
|
|
|
|
+ props: [
|
|
|
|
+ value,
|
|
|
|
+ gravity,
|
|
|
|
+ {
|
|
|
|
+ name: 'imgWidth',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '图片宽',
|
|
|
|
+ type: 'string'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'imgHeight',
|
|
|
|
+ default: '',
|
|
|
|
+ group: 'common',
|
|
|
|
+ desc: '图片高',
|
|
|
|
+ type: 'string'
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ })
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+PropertyDescriptionTable.set(
|
|
|
|
+ 'scrollview',
|
|
|
|
+ new PropertyDescription(YvBase, {
|
|
|
|
+ props: [
|
|
|
|
+ width, height
|
|
|
|
+ ]
|
|
|
|
+ })
|
|
|
|
+)
|