windy 7 years ago
parent
commit
b458b2e6eb
  1. 234
      Gruntfile.js
  2. 31
      dist/README.md
  3. 3
      dist/base.css
  4. 3
      dist/bundle.css
  5. 189
      dist/bundle.js
  6. 2
      dist/bundle.min.css
  7. 189
      dist/case.js
  8. 3702
      dist/fineui.css
  9. 100163
      dist/fineui.js
  10. 1
      dist/fineui.min.css
  11. 50
      dist/fineui.min.js
  12. 7
      dist/fix/fix.js
  13. 188
      src/case/richeditor/bar/action.richeditor.param.js
  14. 3
      src/css/base/combo/combo.css
  15. 5
      src/less/base/combo/combo.less

234
Gruntfile.js

@ -2,172 +2,180 @@ module.exports = function (grunt) {
// Project configuration. // Project configuration.
grunt.initConfig({ grunt.initConfig({
pkg: grunt.file.readJSON('package.json'), pkg: grunt.file.readJSON("package.json"),
concat: { concat: {
options: { options: {
separator: '' separator: ""
}, },
polyfillJs: { polyfillJs: {
src: ['src/polyfill/**/*.js'], src: ["src/polyfill/**/*.js"],
dest: 'dist/polyfill.js' dest: "dist/polyfill.js"
}, },
coreJs: { coreJs: {
src: [ src: [
'src/core/jquery.js', "src/core/jquery.js",
'src/core/underscore.js', "src/core/underscore.js",
'src/core/foundation.js', "src/core/foundation.js",
// 'src/core/mvc/**/*.js', // 'src/core/mvc/**/*.js',
'src/core/base.js', "src/core/base.js",
'src/core/ob.js', "src/core/ob.js",
'src/core/widget.js', "src/core/widget.js",
// 'src/core/model.js', // 'src/core/model.js',
// 'src/core/view.js', // 'src/core/view.js',
'src/core/shortcut.js', "src/core/shortcut.js",
'src/core/utils/*.js', "src/core/utils/*.js",
'src/core/behavior/behavior.js', "src/core/behavior/behavior.js",
'src/core/wrapper/layout.js', "src/core/wrapper/layout.js",
'src/core/**/*.js', "src/core/**/*.js",
'src/data/data.js', "src/data/data.js",
'src/data/**/*.js' "src/data/**/*.js"
], ],
dest: 'dist/core.js' dest: "dist/core.js"
}, },
//最基础的控件 //最基础的控件
baseJs: { baseJs: {
src: [ src: [
'src/third/**/*.js', "src/third/**/*.js",
'src/base/formula/config.js', "src/base/formula/config.js",
'src/base/pane.js', "src/base/pane.js",
'src/base/single/single.js', "src/base/single/single.js",
'src/base/single/text.js', "src/base/single/text.js",
'src/base/single/button/button.basic.js', "src/base/single/button/button.basic.js",
'src/base/single/button/button.node.js', "src/base/single/button/button.node.js",
'src/base/single/tip/tip.js', "src/base/single/tip/tip.js",
'src/base/combination/group.button.js', "src/base/combination/group.button.js",
'src/base/combination/tree.button.js', "src/base/combination/tree.button.js",
'src/base/combination/map.button.js', "src/base/combination/map.button.js",
'src/base/tree/treeview.js', "src/base/tree/treeview.js",
'src/base/tree/asynctree.js', "src/base/tree/asynctree.js",
'src/base/tree/parttree.js', "src/base/tree/parttree.js",
'src/base/**/*.js' "src/base/**/*.js"
], ],
dest: 'dist/base.js' dest: "dist/base.js"
}, },
//实现好的一些基础实例 //实现好的一些基础实例
caseJs: { caseJs: {
src: [ src: [
'src/case/combo/popup.bubble.js', "src/case/combo/popup.bubble.js",
'src/case/**/*.js' "src/case/**/*.js"
], ],
dest: 'dist/case.js' dest: "dist/case.js"
}, },
widgetJs: { widgetJs: {
src: [ src: [
'src/widget/paramsettingcombo/popup.param.js', "src/widget/paramsettingcombo/popup.param.js",
'src/widget/sequencetable/treenumber.sequencetable.js', "src/widget/sequencetable/treenumber.sequencetable.js",
'src/widget/**/*.js', "src/widget/**/*.js",
'src/component/**/*.js' "src/component/**/*.js"
], ],
dest: 'dist/widget.js' dest: "dist/widget.js"
}, },
routerJs: { routerJs: {
src: [ src: [
'src/router/**/*.js' "src/router/**/*.js"
], ],
dest: 'dist/router.js' dest: "dist/router.js"
}, },
chartJs: { chartJs: {
src: [ src: [
'src/addons/chart/chart.js', "src/addons/chart/chart.js",
'src/addons/chart/chart.combine.js', "src/addons/chart/chart.combine.js",
'src/addons/chart/factory.charts.js', "src/addons/chart/factory.charts.js",
'src/addons/chart/**/*.js' "src/addons/chart/**/*.js"
], ],
dest: 'dist/chart.js' dest: "dist/chart.js"
}, },
coreCss: { coreCss: {
src: ['src/css/core/**/*.css', 'src/css/theme/**/*.css'], src: ["src/css/core/**/*.css", "src/css/theme/**/*.css"],
dest: 'dist/core.css' dest: "dist/core.css"
}, },
coreWithoutNormalizeCss: { coreWithoutNormalizeCss: {
src: ['src/css/core/**/*.css', 'src/css/theme/**/*.css', '!src/css/core/normalize.css','!src/css/core/normalize2.css'], src: ["src/css/core/**/*.css", "src/css/theme/**/*.css", "!src/css/core/normalize.css", "!src/css/core/normalize2.css"],
dest: 'dist/core_without_normalize.css' dest: "dist/core_without_normalize.css"
}, },
baseCss: { baseCss: {
src: ['src/css/base/**/*.css'], src: ["src/css/base/**/*.css"],
dest: 'dist/base.css' dest: "dist/base.css"
}, },
widgetCss: { widgetCss: {
src: ['src/css/widget/**/*.css'], src: ["src/css/widget/**/*.css"],
dest: 'dist/widget.css' dest: "dist/widget.css"
}, },
resourceCss: { resourceCss: {
src: ['src/css/resource/**/*.css'], src: ["src/css/resource/**/*.css"],
dest: 'dist/resource.css' dest: "dist/resource.css"
}, },
publicBundleJs: { publicBundleJs: {
src: ['public/js/**/*.js', 'public/js/index.js'], src: ["public/js/**/*.js", "public/js/index.js"],
dest: 'public/bundle.js' dest: "public/bundle.js"
}, },
bundleJs: { bundleJs: {
src: ['dist/core.js', 'dist/base.js', 'dist/case.js', 'dist/widget.js', 'dist/router.js', 'public/js/**/*.js', 'public/js/index.js'], src: ["dist/core.js", "dist/base.js", "dist/case.js", "dist/widget.js", "dist/router.js", "public/js/**/*.js", "public/js/index.js"],
dest: 'dist/bundle.js' dest: "dist/bundle.js"
}, },
publicBundleCss: { publicBundleCss: {
src: ['public/css/app.css', 'public/css/**/*.css'], src: ["public/css/app.css", "public/css/**/*.css"],
dest: 'public/bundle.css' dest: "public/bundle.css"
}, },
bundleCss: { bundleCss: {
src: ['dist/core.css', 'dist/base.css', 'dist/widget.css', 'public/css/app.css', 'public/css/**/*.css'], src: ["dist/core.css", "dist/base.css", "dist/widget.css", "public/css/app.css", "public/css/**/*.css"],
dest: 'dist/bundle.css' dest: "dist/bundle.css"
}, },
configJs: { configJs: {
src: ['demo/version.js'], src: ["demo/version.js"],
dest: 'dist/config.js' dest: "dist/config.js"
}, },
demoJs: { demoJs: {
src: ['demo/app.js', 'demo/js/**/*.js', ' demo/config.js'], src: ["demo/app.js", "demo/js/**/*.js", " demo/config.js"],
dest: 'dist/demo.js' dest: "dist/demo.js"
}, },
demoCss: { demoCss: {
src: ['demo/css/**/*.css'], src: ["demo/css/**/*.css"],
dest: 'dist/demo.css' dest: "dist/demo.css"
},
fineuiJs: {
src: ["dist/polyfill.js", "dist/core.js", "dist/fix/fix.js", "dist/fix/fix.compact.js", "dist/base.js", "dist/case.js", "dist/widget.js"],
dest: "dist/fineui.js"
},
fineuiCss: {
src: ["dist/core.css", "dist/base.css", "dist/widget.css"],
dest: "dist/fineui.css"
}, },
utilsJs: { utilsJs: {
src: [ src: [
'src/core/underscore.js', "src/core/underscore.js",
'src/core/foundation.js', "src/core/foundation.js",
'src/core/var.js', "src/core/var.js",
'src/core/proto/array.js', "src/core/proto/array.js",
'src/core/proto/number.js', "src/core/proto/number.js",
'src/core/proto/string.js', "src/core/proto/string.js",
'src/core/base.js', "src/core/base.js",
'src/core/ob.js', "src/core/ob.js",
'src/core/alias.js', "src/core/alias.js",
'src/core/inject.js', "src/core/inject.js",
'src/core/utils/*.js', "src/core/utils/*.js",
'src/data/data.js', "src/data/data.js",
'src/data/**/*.js' "src/data/**/*.js"
], ],
dest: 'utils/utils.js' dest: "utils/utils.js"
}, }
}, },
less: { less: {
demo: { demo: {
expand: true, expand: true,
cwd: 'demo/less', cwd: "demo/less",
src: ['**/*.less'], src: ["**/*.less"],
dest: 'demo/css/', dest: "demo/css/",
ext: '.css' ext: ".css"
}, },
main: { main: {
expand: true, expand: true,
@ -186,11 +194,12 @@ module.exports = function (grunt) {
uglify: { uglify: {
options: { options: {
banner: '/*! <%= pkg.name %> */\n' banner: "/*! <%= pkg.name %> */\n"
}, },
dist: { dist: {
files: { files: {
'dist/bundle.min.js': ['<%= concat.bundleJs.dest %>'], "dist/bundle.min.js": ["<%= concat.bundleJs.dest %>"],
"dist/fineui.min.js": ["<%= concat.fineuiJs.dest %>"]
} }
} }
}, },
@ -199,15 +208,22 @@ module.exports = function (grunt) {
bundleCss: { bundleCss: {
src: '<%= concat.bundleCss.dest %>', src: "<%= concat.bundleCss.dest %>",
dest: 'dist/bundle.min.css' dest: "dist/bundle.min.css"
}, },
fineuiCss: {
src: "<%= concat.fineuiCss.dest %>",
dest: "dist/fineui.min.css"
}
}, },
jshint: { jshint: {
files: ['Gruntfile.js', 'src/**/*.js'], files: ["Gruntfile.js", "src/**/*.js"],
options: { options: {
globals: { globals: {
jQuery: true, jQuery: true,
@ -219,8 +235,8 @@ module.exports = function (grunt) {
}, },
watch: { watch: {
scripts: { scripts: {
files: ['src/**/*.js', 'demo/js/**/*.js', 'demo/version.js', 'demo/config.js', 'demo/less/**/*.less'], files: ["src/**/*.js", "demo/js/**/*.js", "demo/version.js", "demo/config.js", "demo/less/**/*.less"],
tasks: ['less', 'concat'], tasks: ["less", "concat"],
options: { options: {
spanw: true, spanw: true,
interrupt: true interrupt: true
@ -229,13 +245,13 @@ module.exports = function (grunt) {
} }
}); });
grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks('grunt-contrib-less'); grunt.loadNpmTasks("grunt-contrib-less");
grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.registerTask('default', ['less', 'concat', 'watch']); grunt.registerTask("default", ["less", "concat", "watch"]);
grunt.registerTask('min', ['less', 'concat', 'uglify', 'cssmin']); grunt.registerTask("min", ["less", "concat", "uglify", "cssmin"]);
}; };

31
dist/README.md vendored

@ -0,0 +1,31 @@
#### fineui.js
整个fineui打包文件,不包括配置文件和路由
#### fineui.css
整个fineui打包文件,不包括资源文件
#### config.js
配置文件,这只是一个案例,集成进系统的时候需要进行配置
#### resource.css
app.css background.css icon.css font.css的合并文件,集成进系统的时候需要进行配置
#### router.js
#### 路由文件,使用fineui路由的时候才需要引入
#### bundle.js bundle.css
所有文件的合并文件, 主要给在线demo和文档用的
#### core_without_normalize.css
不带标准化的core.css文件,只引入通用css样式的时候才需要
#### chart.js
封装好的一层图表api

3
dist/base.css vendored

@ -84,6 +84,9 @@
border-right: 6px solid transparent; border-right: 6px solid transparent;
border-bottom: 6px solid #3f8ce8; border-bottom: 6px solid #3f8ce8;
} }
.bi-combo.bi-combo-popup {
display: block !important;
}
.bi-bubble-popup-view { .bi-bubble-popup-view {
} }

3
dist/bundle.css vendored

@ -1806,6 +1806,9 @@ i {
border-right: 6px solid transparent; border-right: 6px solid transparent;
border-bottom: 6px solid #3f8ce8; border-bottom: 6px solid #3f8ce8;
} }
.bi-combo.bi-combo-popup {
display: block !important;
}
.bi-bubble-popup-view { .bi-bubble-popup-view {
} }

189
dist/bundle.js vendored

@ -71707,10 +71707,6 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
BI.RichEditorParamAction.superclass._init.apply(this, arguments); BI.RichEditorParamAction.superclass._init.apply(this, arguments);
}, },
_isParam: function (sel) {
return sel.attr("data-type") === "param";
},
_createBlankNode: function () { _createBlankNode: function () {
return $("<span>").html("&nbsp;"); return $("<span>").html("&nbsp;");
}, },
@ -71719,10 +71715,8 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
var o = this.options; var o = this.options;
var instance = o.editor.selectedInstance; var instance = o.editor.selectedInstance;
var next = $param.next(); var next = $param.next();
if (next.length === 0 || this._isParam(next)) { if (next.length === 0) {
var preNode = this._createBlankNode();
var nextNode = this._createBlankNode(); var nextNode = this._createBlankNode();
$param.before(preNode);
$param.after(nextNode); $param.after(nextNode);
instance.setFocus(nextNode[0]); instance.setFocus(nextNode[0]);
} else { } else {
@ -71730,70 +71724,131 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
} }
}, },
_get$Sel: function () {
var o = this.options;
var instance = o.editor.selectedInstance;
var sel = $(instance.selElm());
if (sel[0].nodeType === 3 && this._isParam(sel.parent())) {
sel = sel.parent();
}
return sel;
},
addParam: function (param) { addParam: function (param) {
var o = this.options; var o = this.options;
var sel = this._get$Sel(); var instance = o.editor.instance;
var $param = $("<span>").attr({ var image = new Image();
"data-type": "param", var canvas = document.createElement("canvas");
"data-value": param $("body").append(canvas);
}).css({ canvas.width = BI.DOM.getTextSizeWidth(param, 14) + 6;
color: "white", canvas.height = 16;
backgroundColor: "#009de3", var ctx = canvas.getContext("2d");
padding: "0 5px" ctx.font = "14px Georgia";
}).text(param).keydown(function (e) { ctx.fillStyle = "#ffffff";
if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) { ctx.fillText(param, 3, 14);
$param.destroy(); image.src = canvas.toDataURL("image/png");
} image.alt = param;
e.stopEvent(); $(image).css({"background-color": "#3f8ce8", "vertical-align": "sub", "margin": "0 3px;"});
return false; instance.getElm().element.append(image);
}); this._addBlank($(image));
var wrapper = o.editor.instance.getElm().element; $(canvas).destroy();
if (wrapper.find(sel).length <= 0) { }
wrapper.append($param); });
} else {
sel.after($param);
}
this._addBlank($param);
},
keydown: function (e) { // /**
var o = this.options; // *
var sel = this._get$Sel(); // * Created by GUY on 2017/09/18.
if (e.keyCode === 229) {// 中文输入法 // * @class BI.RichEditorParamAction
if (this._isParam(sel)) { // * @extends BI.Widget
this._addBlank(sel); // */
e.stopEvent(); // BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
return false; // _defaultConfig: function () {
} // return BI.extend(BI.RichEditorParamAction.superclass._defaultConfig.apply(this, arguments), {});
} // },
if (BI.Key[e.keyCode] || e.keyCode === BI.KeyCode.TAB || e.keyCode === BI.KeyCode.ENTER || e.keyCode === BI.KeyCode.SPACE) { //
if (this._isParam(sel)) { // _init: function () {
e.stopEvent(); // BI.RichEditorParamAction.superclass._init.apply(this, arguments);
return false; // },
} //
} // _isParam: function (sel) {
if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) { // return sel.attr("data-type") === "param";
if (this._isParam(sel)) { // },
sel.destroy(); //
e.preventDefault(); // _createBlankNode: function () {
return false; // return $("<span>").html("&nbsp;");
} // },
} //
}, // _addBlank: function ($param) {
// var o = this.options;
// var instance = o.editor.selectedInstance;
// var next = $param.next();
// if (next.length === 0 || this._isParam(next)) {
// var preNode = this._createBlankNode();
// var nextNode = this._createBlankNode();
// $param.before(preNode);
// $param.after(nextNode);
// instance.setFocus(nextNode[0]);
// } else {
// instance.setFocus(next[0]);
// }
// },
//
// _get$Sel: function () {
// var o = this.options;
// var instance = o.editor.selectedInstance;
// var sel = $(instance.selElm());
// if (sel[0].nodeType === 3 && this._isParam(sel.parent())) {
// sel = sel.parent();
// }
// return sel;
// },
//
// addParam: function (param) {
// var o = this.options;
// var sel = this._get$Sel();
// var $param = $("<span>").attr({
// "data-type": "param",
// "data-value": param
// }).css({
// color: "white",
// backgroundColor: "#009de3",
// padding: "0 5px"
// }).text(param).keydown(function (e) {
// if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) {
// $param.destroy();
// }
// e.stopEvent();
// return false;
// });
// var wrapper = o.editor.instance.getElm().element;
// if (wrapper.find(sel).length <= 0) {
// wrapper.append($param);
// } else {
// sel.after($param);
// }
// this._addBlank($param);
// },
//
// keydown: function (e) {
// var o = this.options;
// var sel = this._get$Sel();
// if (e.keyCode === 229) {// 中文输入法
// if (this._isParam(sel)) {
// this._addBlank(sel);
// e.stopEvent();
// return false;
// }
// }
// if (BI.Key[e.keyCode] || e.keyCode === BI.KeyCode.TAB || e.keyCode === BI.KeyCode.ENTER || e.keyCode === BI.KeyCode.SPACE) {
// if (this._isParam(sel)) {
// e.stopEvent();
// return false;
// }
// }
// if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) {
// if (this._isParam(sel)) {
// sel.destroy();
// e.preventDefault();
// return false;
// }
// }
// },
//
// key: function (e) {
// }
// });
key: function (e) { /**
}
});/**
* 颜色选择 * 颜色选择
* *
* Created by GUY on 2015/11/26. * Created by GUY on 2015/11/26.

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

189
dist/case.js vendored

@ -9561,10 +9561,6 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
BI.RichEditorParamAction.superclass._init.apply(this, arguments); BI.RichEditorParamAction.superclass._init.apply(this, arguments);
}, },
_isParam: function (sel) {
return sel.attr("data-type") === "param";
},
_createBlankNode: function () { _createBlankNode: function () {
return $("<span>").html("&nbsp;"); return $("<span>").html("&nbsp;");
}, },
@ -9573,10 +9569,8 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
var o = this.options; var o = this.options;
var instance = o.editor.selectedInstance; var instance = o.editor.selectedInstance;
var next = $param.next(); var next = $param.next();
if (next.length === 0 || this._isParam(next)) { if (next.length === 0) {
var preNode = this._createBlankNode();
var nextNode = this._createBlankNode(); var nextNode = this._createBlankNode();
$param.before(preNode);
$param.after(nextNode); $param.after(nextNode);
instance.setFocus(nextNode[0]); instance.setFocus(nextNode[0]);
} else { } else {
@ -9584,70 +9578,131 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
} }
}, },
_get$Sel: function () {
var o = this.options;
var instance = o.editor.selectedInstance;
var sel = $(instance.selElm());
if (sel[0].nodeType === 3 && this._isParam(sel.parent())) {
sel = sel.parent();
}
return sel;
},
addParam: function (param) { addParam: function (param) {
var o = this.options; var o = this.options;
var sel = this._get$Sel(); var instance = o.editor.instance;
var $param = $("<span>").attr({ var image = new Image();
"data-type": "param", var canvas = document.createElement("canvas");
"data-value": param $("body").append(canvas);
}).css({ canvas.width = BI.DOM.getTextSizeWidth(param, 14) + 6;
color: "white", canvas.height = 16;
backgroundColor: "#009de3", var ctx = canvas.getContext("2d");
padding: "0 5px" ctx.font = "14px Georgia";
}).text(param).keydown(function (e) { ctx.fillStyle = "#ffffff";
if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) { ctx.fillText(param, 3, 14);
$param.destroy(); image.src = canvas.toDataURL("image/png");
} image.alt = param;
e.stopEvent(); $(image).css({"background-color": "#3f8ce8", "vertical-align": "sub", "margin": "0 3px;"});
return false; instance.getElm().element.append(image);
}); this._addBlank($(image));
var wrapper = o.editor.instance.getElm().element; $(canvas).destroy();
if (wrapper.find(sel).length <= 0) { }
wrapper.append($param); });
} else {
sel.after($param);
}
this._addBlank($param);
},
keydown: function (e) { // /**
var o = this.options; // *
var sel = this._get$Sel(); // * Created by GUY on 2017/09/18.
if (e.keyCode === 229) {// 中文输入法 // * @class BI.RichEditorParamAction
if (this._isParam(sel)) { // * @extends BI.Widget
this._addBlank(sel); // */
e.stopEvent(); // BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
return false; // _defaultConfig: function () {
} // return BI.extend(BI.RichEditorParamAction.superclass._defaultConfig.apply(this, arguments), {});
} // },
if (BI.Key[e.keyCode] || e.keyCode === BI.KeyCode.TAB || e.keyCode === BI.KeyCode.ENTER || e.keyCode === BI.KeyCode.SPACE) { //
if (this._isParam(sel)) { // _init: function () {
e.stopEvent(); // BI.RichEditorParamAction.superclass._init.apply(this, arguments);
return false; // },
} //
} // _isParam: function (sel) {
if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) { // return sel.attr("data-type") === "param";
if (this._isParam(sel)) { // },
sel.destroy(); //
e.preventDefault(); // _createBlankNode: function () {
return false; // return $("<span>").html("&nbsp;");
} // },
} //
}, // _addBlank: function ($param) {
// var o = this.options;
// var instance = o.editor.selectedInstance;
// var next = $param.next();
// if (next.length === 0 || this._isParam(next)) {
// var preNode = this._createBlankNode();
// var nextNode = this._createBlankNode();
// $param.before(preNode);
// $param.after(nextNode);
// instance.setFocus(nextNode[0]);
// } else {
// instance.setFocus(next[0]);
// }
// },
//
// _get$Sel: function () {
// var o = this.options;
// var instance = o.editor.selectedInstance;
// var sel = $(instance.selElm());
// if (sel[0].nodeType === 3 && this._isParam(sel.parent())) {
// sel = sel.parent();
// }
// return sel;
// },
//
// addParam: function (param) {
// var o = this.options;
// var sel = this._get$Sel();
// var $param = $("<span>").attr({
// "data-type": "param",
// "data-value": param
// }).css({
// color: "white",
// backgroundColor: "#009de3",
// padding: "0 5px"
// }).text(param).keydown(function (e) {
// if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) {
// $param.destroy();
// }
// e.stopEvent();
// return false;
// });
// var wrapper = o.editor.instance.getElm().element;
// if (wrapper.find(sel).length <= 0) {
// wrapper.append($param);
// } else {
// sel.after($param);
// }
// this._addBlank($param);
// },
//
// keydown: function (e) {
// var o = this.options;
// var sel = this._get$Sel();
// if (e.keyCode === 229) {// 中文输入法
// if (this._isParam(sel)) {
// this._addBlank(sel);
// e.stopEvent();
// return false;
// }
// }
// if (BI.Key[e.keyCode] || e.keyCode === BI.KeyCode.TAB || e.keyCode === BI.KeyCode.ENTER || e.keyCode === BI.KeyCode.SPACE) {
// if (this._isParam(sel)) {
// e.stopEvent();
// return false;
// }
// }
// if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) {
// if (this._isParam(sel)) {
// sel.destroy();
// e.preventDefault();
// return false;
// }
// }
// },
//
// key: function (e) {
// }
// });
key: function (e) { /**
}
});/**
* 颜色选择 * 颜色选择
* *
* Created by GUY on 2015/11/26. * Created by GUY on 2015/11/26.

3702
dist/fineui.css vendored

File diff suppressed because it is too large Load Diff

100163
dist/fineui.js vendored

File diff suppressed because one or more lines are too long

1
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

50
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

7
dist/fix/fix.js vendored

@ -1303,6 +1303,13 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return Model; return Model;
}(); }();
Model.prototype.state = {};
Model.prototype.computed = {};
Model.prototype.context = [];
Model.prototype.childContext = [];
Model.prototype.watch = {};
Model.prototype.actions = {};
function toJSON(model) { function toJSON(model) {
var result = void 0; var result = void 0;
if (_.isArray(model)) { if (_.isArray(model)) {

188
src/case/richeditor/bar/action.richeditor.param.js

@ -13,10 +13,6 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
BI.RichEditorParamAction.superclass._init.apply(this, arguments); BI.RichEditorParamAction.superclass._init.apply(this, arguments);
}, },
_isParam: function (sel) {
return sel.attr("data-type") === "param";
},
_createBlankNode: function () { _createBlankNode: function () {
return $("<span>").html("&nbsp;"); return $("<span>").html("&nbsp;");
}, },
@ -25,10 +21,8 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
var o = this.options; var o = this.options;
var instance = o.editor.selectedInstance; var instance = o.editor.selectedInstance;
var next = $param.next(); var next = $param.next();
if (next.length === 0 || this._isParam(next)) { if (next.length === 0) {
var preNode = this._createBlankNode();
var nextNode = this._createBlankNode(); var nextNode = this._createBlankNode();
$param.before(preNode);
$param.after(nextNode); $param.after(nextNode);
instance.setFocus(nextNode[0]); instance.setFocus(nextNode[0]);
} else { } else {
@ -36,67 +30,127 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
} }
}, },
_get$Sel: function () {
var o = this.options;
var instance = o.editor.selectedInstance;
var sel = $(instance.selElm());
if (sel[0].nodeType === 3 && this._isParam(sel.parent())) {
sel = sel.parent();
}
return sel;
},
addParam: function (param) { addParam: function (param) {
var o = this.options; var o = this.options;
var sel = this._get$Sel(); var instance = o.editor.instance;
var $param = $("<span>").attr({ var image = new Image();
"data-type": "param", var canvas = document.createElement("canvas");
"data-value": param $("body").append(canvas);
}).css({ canvas.width = BI.DOM.getTextSizeWidth(param, 14) + 6;
color: "white", canvas.height = 16;
backgroundColor: "#009de3", var ctx = canvas.getContext("2d");
padding: "0 5px" ctx.font = "14px Georgia";
}).text(param).keydown(function (e) { ctx.fillStyle = "#ffffff";
if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) { ctx.fillText(param, 3, 14);
$param.destroy(); image.src = canvas.toDataURL("image/png");
} image.alt = param;
e.stopEvent(); $(image).css({"background-color": "#3f8ce8", "vertical-align": "sub", "margin": "0 3px;"});
return false; instance.getElm().element.append(image);
}); this._addBlank($(image));
var wrapper = o.editor.instance.getElm().element; $(canvas).destroy();
if (wrapper.find(sel).length <= 0) { }
wrapper.append($param); });
} else {
sel.after($param);
}
this._addBlank($param);
},
keydown: function (e) { // /**
var o = this.options; // *
var sel = this._get$Sel(); // * Created by GUY on 2017/09/18.
if (e.keyCode === 229) {// 中文输入法 // * @class BI.RichEditorParamAction
if (this._isParam(sel)) { // * @extends BI.Widget
this._addBlank(sel); // */
e.stopEvent(); // BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
return false; // _defaultConfig: function () {
} // return BI.extend(BI.RichEditorParamAction.superclass._defaultConfig.apply(this, arguments), {});
} // },
if (BI.Key[e.keyCode] || e.keyCode === BI.KeyCode.TAB || e.keyCode === BI.KeyCode.ENTER || e.keyCode === BI.KeyCode.SPACE) { //
if (this._isParam(sel)) { // _init: function () {
e.stopEvent(); // BI.RichEditorParamAction.superclass._init.apply(this, arguments);
return false; // },
} //
} // _isParam: function (sel) {
if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) { // return sel.attr("data-type") === "param";
if (this._isParam(sel)) { // },
sel.destroy(); //
e.preventDefault(); // _createBlankNode: function () {
return false; // return $("<span>").html("&nbsp;");
} // },
} //
}, // _addBlank: function ($param) {
// var o = this.options;
// var instance = o.editor.selectedInstance;
// var next = $param.next();
// if (next.length === 0 || this._isParam(next)) {
// var preNode = this._createBlankNode();
// var nextNode = this._createBlankNode();
// $param.before(preNode);
// $param.after(nextNode);
// instance.setFocus(nextNode[0]);
// } else {
// instance.setFocus(next[0]);
// }
// },
//
// _get$Sel: function () {
// var o = this.options;
// var instance = o.editor.selectedInstance;
// var sel = $(instance.selElm());
// if (sel[0].nodeType === 3 && this._isParam(sel.parent())) {
// sel = sel.parent();
// }
// return sel;
// },
//
// addParam: function (param) {
// var o = this.options;
// var sel = this._get$Sel();
// var $param = $("<span>").attr({
// "data-type": "param",
// "data-value": param
// }).css({
// color: "white",
// backgroundColor: "#009de3",
// padding: "0 5px"
// }).text(param).keydown(function (e) {
// if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) {
// $param.destroy();
// }
// e.stopEvent();
// return false;
// });
// var wrapper = o.editor.instance.getElm().element;
// if (wrapper.find(sel).length <= 0) {
// wrapper.append($param);
// } else {
// sel.after($param);
// }
// this._addBlank($param);
// },
//
// keydown: function (e) {
// var o = this.options;
// var sel = this._get$Sel();
// if (e.keyCode === 229) {// 中文输入法
// if (this._isParam(sel)) {
// this._addBlank(sel);
// e.stopEvent();
// return false;
// }
// }
// if (BI.Key[e.keyCode] || e.keyCode === BI.KeyCode.TAB || e.keyCode === BI.KeyCode.ENTER || e.keyCode === BI.KeyCode.SPACE) {
// if (this._isParam(sel)) {
// e.stopEvent();
// return false;
// }
// }
// if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) {
// if (this._isParam(sel)) {
// sel.destroy();
// e.preventDefault();
// return false;
// }
// }
// },
//
// key: function (e) {
// }
// });
key: function (e) {
}
});

3
src/css/base/combo/combo.css

@ -0,0 +1,3 @@
.bi-combo.bi-combo-popup {
display: block !important;
}

5
src/less/base/combo/combo.less

@ -0,0 +1,5 @@
.bi-combo {
&.bi-combo-popup {
display: block !important;
}
}
Loading…
Cancel
Save