Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
initiallyOpen: DataTypes.bool,
compact: DataTypes.bool,
wholeLineSelected: DataTypes.bool,
keepingSelected: DataTypes.bool,
checked: DataTypes.bool,
nestedLevel: DataTypes.number,
secondaryTextLines: DataTypes.number,
lastExpandingState: DataTypes.bool,
checkboxValue: DataTypes.string,
checkboxInputValue: DataTypes.array,
checkboxIndeterminate: DataTypes.bool,
filterText: DataTypes.string,
filtered: DataTypes.bool,
primaryText: DataTypes.string,
secondaryText: DataTypes.oneOfType([DataTypes.string, DataTypes.number]),
extras: DataTypes.arrayOf(DataTypes.objectOf(DataTypes.string))
},
components: {
'san-touch-ripple': TouchRipple,
'san-center-ripple': CenterRipple,
'san-checkbox': Checkbox,
'san-icon': Icon,
'san-chip': Chip,
'san-avatar': Avatar,
'san-tree-view-item': 'self'
},
messages: {
'UI:nested-counter'(arg) {
let target = arg.value;
target.set('nestedLevel', target.get('nestedLevel') + 1);
export default defineComponent({
template,
components: {
'ui-actionloader': ActionLoader,
'ui-button': Button,
'ui-dialog': Dialog
},
dataTypes: {
dialog: DataTypes.bool,
foot: DataTypes.bool,
confirm: DataTypes.objectOf({
label: DataTypes.string,
disabled: DataTypes.bool
}),
actionOptions: DataTypes.objectOf({
open: DataTypes.bool,
width: DataTypes.number,
height: DataTypes.number,
title: DataTypes.string,
url: DataTypes.string,
module: DataTypes.string,
needFoot: DataTypes.bool,
options: DataTypes.objectOf({
parentAction: DataTypes.object
})
})
},
initData() {
return {
dialog: false,
foot: true,
},
computed: {
frozen() {
const columns = this.data.get('columns');
for (let i = 0; i < columns.length; i++) {
const col = columns[i];
if (col.freezed) {
return true;
}
}
return false;
}
},
dataTypes: {
columns: DataTypes.array,
table: DataTypes.objectOf({
error: DataTypes.any,
loading: DataTypes.bool,
disabledSelectAll: DataTypes.bool,
datasource: DataTypes.array,
selectedIndex: DataTypes.array,
cellRenderer: DataTypes.func,
select: DataTypes.string
})
},
onTableCommand(event) {
this.fire('command', event);
},
onFilter(event) {
this.fire('filter', event);
},
onSort(event) {
function isSanPage(erAction) {
return !!(erAction && erAction.page && erAction.SanPage);
}
export default defineComponent({
template,
components: {
'ui-actionloader': ActionLoader,
'ui-button': Button,
'ui-dialog': Dialog
},
dataTypes: {
dialog: DataTypes.bool,
foot: DataTypes.bool,
confirm: DataTypes.objectOf({
label: DataTypes.string,
disabled: DataTypes.bool
}),
actionOptions: DataTypes.objectOf({
open: DataTypes.bool,
width: DataTypes.number,
height: DataTypes.number,
title: DataTypes.string,
url: DataTypes.string,
module: DataTypes.string,
needFoot: DataTypes.bool,
options: DataTypes.objectOf({
parentAction: DataTypes.object
})
})
},
dataTypes: {
dialog: DataTypes.bool,
foot: DataTypes.bool,
confirm: DataTypes.objectOf({
label: DataTypes.string,
disabled: DataTypes.bool
}),
actionOptions: DataTypes.objectOf({
open: DataTypes.bool,
width: DataTypes.number,
height: DataTypes.number,
title: DataTypes.string,
url: DataTypes.string,
module: DataTypes.string,
needFoot: DataTypes.bool,
options: DataTypes.objectOf({
parentAction: DataTypes.object
})
})
},
initData() {
return {
dialog: false,
foot: true,
confirm: {
label: '确定',
disabled: false
},
actionOptions: {
open: false
}
};
*/
import {defineComponent, DataTypes} from 'san';
import {create} from '../components/util';
const cx = create('ui-form');
export default defineComponent({
roleType: 'Form',
template: '<form class="{{mainClass}}">',
dataTypes: {
/**
* 校验规则
*/
rules: DataTypes.objectOf(DataTypes.function),
/**
* 表单错误
*/
errors: DataTypes.object,
/**
* 表单数据
* @default false
*/
formData: DataTypes.object
},
computed: {
mainClass() {
return cx.mainClass(this);
}</form>