2018-05-16 09:36:42 +00:00
|
|
|
|
2022-06-06 12:49:18 +00:00
|
|
|
var Component = require('vn/component');
|
2018-05-16 09:36:42 +00:00
|
|
|
|
|
|
|
module.exports = new Class({
|
2022-06-06 12:49:18 +00:00
|
|
|
Extends: Component,
|
2018-05-16 09:36:42 +00:00
|
|
|
Tag: 'htk-step',
|
|
|
|
Properties: {
|
|
|
|
name: {
|
|
|
|
type: String,
|
|
|
|
value: null
|
|
|
|
},
|
|
|
|
validateFunc: {
|
|
|
|
type: Function,
|
|
|
|
value: null
|
|
|
|
},
|
|
|
|
showFunc: {
|
|
|
|
type: Function,
|
|
|
|
value: null
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2022-11-16 01:46:44 +00:00
|
|
|
initialize(props) {
|
2022-06-06 16:02:17 +00:00
|
|
|
Component.prototype.initialize.call(this, props);
|
2022-06-06 17:13:57 +00:00
|
|
|
this.createRoot('div');
|
2018-05-16 09:36:42 +00:00
|
|
|
},
|
|
|
|
|
2022-11-16 01:46:44 +00:00
|
|
|
show() {
|
2018-05-16 09:36:42 +00:00
|
|
|
if (this.showFunc)
|
|
|
|
this.showFunc();
|
|
|
|
this.node.style.display = 'block';
|
|
|
|
},
|
|
|
|
|
2022-11-16 01:46:44 +00:00
|
|
|
hide() {
|
2018-05-16 09:36:42 +00:00
|
|
|
this.node.style.display = 'none';
|
|
|
|
},
|
|
|
|
|
2022-11-16 01:46:44 +00:00
|
|
|
validate() {
|
2018-05-16 09:36:42 +00:00
|
|
|
if (this.validateFunc)
|
|
|
|
return this.validateFunc();
|
|
|
|
return true;
|
|
|
|
},
|
|
|
|
|
2022-11-16 01:46:44 +00:00
|
|
|
appendChild(child) {
|
2022-06-06 12:49:18 +00:00
|
|
|
if (child instanceof Component)
|
2018-05-16 09:36:42 +00:00
|
|
|
child = child.node;
|
|
|
|
this.node.appendChild(child);
|
|
|
|
}
|
|
|
|
});
|