乱改。

This commit is contained in:
liteng 2018-11-12 20:53:32 +08:00
parent e630ad2263
commit 53afb28d4e
18 changed files with 360 additions and 34 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,4 @@
import { Control, UI } from './third_party';
import { Control, UI } from '../third_party';
/**
* 布尔值
@ -53,4 +53,6 @@ Boolean.prototype.setValue = function (value) {
this.input.checked = value;
};
UI.addXType('boolean', Boolean);
export default Boolean;

View File

@ -1,13 +1,12 @@
import Control from './Control';
import { Control, UI } from '../third_party';
/**
* 复选框
* @author tengge / https://github.com/tengge1
* @param {*} options
*/
function Checkbox(options) {
function Checkbox(options = {}) {
Control.call(this, options);
options = options || {};
this.value = options.value || false;
this.cls = options.cls || 'Checkbox';
@ -51,4 +50,6 @@ Checkbox.prototype.setValue = function (value) {
return this;
};
UI.addXType('checkbox', Checkbox);
export default Checkbox;

View File

@ -1,4 +1,4 @@
import Control from './Control';
import { Control, UI } from '../third_party';
/**
* 关闭按钮
@ -40,4 +40,6 @@ CloseButton.prototype.render = function () {
this.dom.appendChild(this.icon);
};
UI.addXType('closebutton', CloseButton);
export default CloseButton;

View File

@ -1,4 +1,4 @@
import Control from './Control';
import { Control, UI } from '../third_party';
/**
* 颜色选择器
@ -67,4 +67,6 @@ Color.prototype.setHexValue = function (hex) {
return this;
};
UI.addXType('color', Color);
export default Color;

View File

@ -1,4 +1,4 @@
import Control from './Control';
import { Control, UI } from '../third_party';
/**
* 输入框

View File

@ -4,4 +4,10 @@ import '../assets/css/ui.css';
import './common/Html';
import './common/Container';
// form
import './form/Boolean';
import './form/Checkbox';
import './form/CloseButton';
import './form/Color';
export { Control, UI } from './third_party';

View File

@ -6,7 +6,6 @@
<meta charset="utf-8">
<title>08 BooleanTest</title>
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link href="../../assets/css/main.css" rel="stylesheet" />
<style>
.red {
background-color: #ccc;
@ -31,7 +30,7 @@
borderBottom: '1px solid #aaa'
},
onChange: function () {
UI.msg(this.getValue());
alert(this.getValue());
}
});

View File

@ -6,21 +6,24 @@
<meta charset="utf-8">
<title>Checkbox Test</title>
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link href="../../assets/css/main.css" rel="stylesheet" />
</head>
<body>
<script src="../../node_modules/three/build/three.js"></script>
<script src="../../dist/ShadowEditor.js"></script>
<script src="../dist/ShadowEditor.UI.js"></script>
<script>
var control = Shadow.UI.create({
const {
Control,
UI
} = Shadow;
var control = UI.create({
xtype: 'checkbox',
value: true,
style: {
borderBottom: '1px solid #aaa'
},
onChange: function () {
UI.msg(this.getValue());
alert(this.getValue());
}
});

View File

@ -4,23 +4,26 @@
<head>
<meta charset="utf-8">
<title>CloseButton Test</title>
<title>10 CloseButtonTest</title>
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link href="../../assets/css/icon/iconfont.css" />
<link href="../../assets/css/main.css" rel="stylesheet" />
<link rel="stylesheet" href="../assets/css/icon/iconfont.css" />
</head>
<body>
<script src="../../node_modules/three/build/three.js"></script>
<script src="../../dist/ShadowEditor.js"></script>
<script src="../dist/ShadowEditor.UI.js"></script>
<script>
var control = Shadow.UI.create({
const {
Control,
UI
} = Shadow;
var control = UI.create({
xtype: 'closebutton',
style: {
color: '#555'
},
onClick: function () {
UI.msg('You clicked CloseButton.');
alert('You clicked CloseButton.');
}
});

View File

@ -6,18 +6,21 @@
<meta charset="utf-8">
<title>Color Test</title>
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link href="../../assets/css/main.css" rel="stylesheet" />
</head>
<body>
<script src="../../node_modules/three/build/three.js"></script>
<script src="../../dist/ShadowEditor.js"></script>
<script src="../dist/ShadowEditor.UI.js"></script>
<script>
var control = Shadow.UI.create({
const {
Control,
UI
} = Shadow;
var control = UI.create({
xtype: 'color',
value: '#ff0000',
onChange: function () {
UI.msg(`Value: ${this.getValue()}\nHexValue: ${this.getHexValue()}`);
alert(`Value: ${this.getValue()}\nHexValue: ${this.getHexValue()}`);
}
});

View File

@ -6,14 +6,17 @@
<meta charset="utf-8">
<title>Horizontal Rule Test</title>
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link href="../../assets/css/main.css" rel="stylesheet" />
</head>
<body>
<script src="../../node_modules/three/build/three.js"></script>
<script src="../../dist/ShadowEditor.js"></script>
<script src="../dist/ShadowEditor.UI.js"></script>
<script>
var control = Shadow.UI.create({
const {
Control,
UI
} = Shadow;
var control = UI.create({
xtype: 'hr'
});

View File

@ -6,14 +6,17 @@
<meta charset="utf-8">
<title>Input Test</title>
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link href="../../assets/css/main.css" rel="stylesheet" />
</head>
<body>
<script src="../../node_modules/three/build/three.js"></script>
<script src="../../dist/ShadowEditor.js"></script>
<script src="../dist/ShadowEditor.UI.js"></script>
<script>
var control = Shadow.UI.create({
const {
Control,
UI
} = Shadow;
var control = UI.create({
xtype: 'input',
value: '123',
onChange: function () {