Browse Source

Pull request #1384: KERNEL-4190 fineui换成webpack打包

Merge in VISUAL/fineui from ~TELLER/fineui:KERNEL-4190 to master

* commit '8bf0fd6621f84a0eb083c21b0243625b5fcd857b': (21 commits)
  chore: eslint revert
  chore: 多打包一下fineui
  chore: 增加css的banner
  chore: 多build一个css
  chore: build
  refactor: 更新lib
  chore: webpack打包优化
  refactor: 更新ignore
  chore: 更新依赖
  refactor: 配合webpack打包
  chore: revert 源码修改
  chore: 优化打包
  chore: add dist
  chore: change eslint
  chore: remove grunt
  chore: 先去掉所有打包文件
  chore: update library
  chore: fix打包
  chore: 去掉所有css
  refactor: 全局加载
  ...
es6
Teller 4 years ago
parent
commit
2a8928b136
  1. 3
      .eslintrc
  2. 20
      .npmignore
  3. 460
      Gruntfile.js
  4. 0
      demo/css/center.css
  5. 3
      demo/css/face.css
  6. 0
      demo/css/index.css
  7. 84
      demo/css/main.css
  8. 10
      demo/css/north.css
  9. 0
      demo/css/preview.css
  10. 102
      demo/css/vm.css
  11. 0
      demo/css/west.css
  12. 6566
      dist/2.0/fineui.css
  13. 1
      dist/2.0/fineui.css.map
  14. 91650
      dist/2.0/fineui.ie.js
  15. 1
      dist/2.0/fineui.ie.js.map
  16. 55
      dist/2.0/fineui.ie.min.js
  17. 2
      dist/2.0/fineui.ie.min.js.map
  18. 158265
      dist/2.0/fineui.js
  19. 2
      dist/2.0/fineui.js.map
  20. 3
      dist/2.0/fineui.min.css
  21. 56
      dist/2.0/fineui.min.js
  22. 2
      dist/2.0/fineui.min.js.map
  23. 6219
      dist/2.0/fineui_without_normalize.css
  24. 1
      dist/2.0/fineui_without_normalize.css.map
  25. 3
      dist/2.0/fineui_without_normalize.min.css
  26. 2208
      dist/base.css
  27. 1
      dist/base.css.map
  28. 14465
      dist/base.js
  29. 1
      dist/base.js.map
  30. 6564
      dist/bundle.css
  31. 1
      dist/bundle.css.map
  32. 91650
      dist/bundle.ie.js
  33. 1
      dist/bundle.ie.js.map
  34. 53
      dist/bundle.ie.min.js
  35. 1
      dist/bundle.ie.min.js.map
  36. 92001
      dist/bundle.js
  37. 1
      dist/bundle.js.map
  38. 3
      dist/bundle.min.css
  39. 56
      dist/bundle.min.js
  40. 2
      dist/bundle.min.js.map
  41. 6217
      dist/bundle_without_normalize.css
  42. 1
      dist/bundle_without_normalize.css.map
  43. 9824
      dist/case.js
  44. 1
      dist/case.js.map
  45. 193
      dist/config.js
  46. 1
      dist/config.js.map
  47. 2295
      dist/core.css
  48. 1
      dist/core.css.map
  49. 37053
      dist/core.js
  50. 1
      dist/core.js.map
  51. 1948
      dist/core_without_normalize.css
  52. 1
      dist/core_without_normalize.css.map
  53. 203
      dist/demo.css
  54. 1
      dist/demo.css.map
  55. 98577
      dist/demo.js
  56. 2
      dist/demo.js.map
  57. 1
      dist/es5.fineui.js
  58. 1
      dist/es5.fineui.js.map
  59. 1
      dist/es5.polyfill.js
  60. 1
      dist/es5.polyfill.js.map
  61. 6566
      dist/fineui.css
  62. 1
      dist/fineui.css.map
  63. 91707
      dist/fineui.ie.js
  64. 1
      dist/fineui.ie.js.map
  65. 57
      dist/fineui.ie.min.js
  66. 2
      dist/fineui.ie.min.js.map
  67. 158465
      dist/fineui.js
  68. 2
      dist/fineui.js.map
  69. 3
      dist/fineui.min.css
  70. 59
      dist/fineui.min.js
  71. 2
      dist/fineui.min.js.map
  72. 114196
      dist/fineui_without_jquery_polyfill.js
  73. 2
      dist/fineui_without_jquery_polyfill.js.map
  74. 906
      dist/font.css
  75. 1
      dist/font.css.map
  76. 1
      dist/ie.fineui.js
  77. 1
      dist/ie.fineui.js.map
  78. 1
      dist/ie.polyfill.js
  79. 1
      dist/ie.polyfill.js.map
  80. 2
      dist/lib/base/combination/group.button.d.ts
  81. 9
      dist/lib/base/pane.d.ts
  82. 7
      dist/lib/base/single/button/button.node.d.ts
  83. 7
      dist/lib/base/single/iframe/iframe.d.ts
  84. 20
      dist/lib/component/treevaluechooser/abstract.treevaluechooser.d.ts
  85. 3
      dist/lib/component/treevaluechooser/abstract.treevaluechooser.list.d.ts
  86. 8
      dist/lib/core/base.d.ts
  87. 6
      dist/lib/core/decorator/decorator.d.ts
  88. 6
      dist/lib/core/wrapper/layout/layout.absolute.d.ts
  89. 5
      dist/lib/core/wrapper/layout/layout.vertical.d.ts
  90. 1
      dist/lib/fix/fix.d.ts
  91. 1
      dist/lib/fix/fix.ie.d.ts
  92. 14
      dist/lib/index.d.ts
  93. 11
      dist/lib/widget/downlist/combo.downlist.d.ts
  94. 249
      dist/polyfill.js
  95. 1
      dist/polyfill.js.map
  96. 1649
      dist/resource.css
  97. 1
      dist/resource.css.map
  98. 601
      dist/router.js
  99. 1
      dist/router.js.map
  100. 25123
      dist/utils.js
  101. Some files were not shown because too many files have changed in this diff Show More

3
.eslintrc

@ -12,7 +12,8 @@
"Data": true,
"Fix": true,
"module": true,
"Demo": true
"Demo": true,
"_global": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {

20
.npmignore

@ -2,30 +2,28 @@
!src/less/*.less
!src/less/lib/*.less
!src/less/resource/*.less
!dist/font.css
!dist/lib/*.d.ts
!dist/lib/**/*.d.ts
!dist/font.css
!dist/fineui.css
!dist/fineui.js
!dist/fineui.js.map
!dist/fineui.min.css
!dist/fineui.min.js
!dist/fineui.min.js.map
!dist/fineui.ie.min.js
!dist/fineui.ie.min.js.map
!dist/utils.js
!dist/utils.js.map
!dist/utils.min.js
!dist/utils.min.js.map
!dist/bundle.min.js
!dist/bundle.min.css
!dist/bundle.min.js
!dist/bundle.min.js.map
!dist/fineui_without_jquery_polyfill.js
!babel.config.js
!babel.config.ie8.js
!dist/fineui.min.css
!dist/fineui.js
!dist/fineui.js.map
!dist/2.0/fineui.css
!dist/2.0/fineui.ie.js
!dist/2.0/fineui.ie.js.map
!dist/2.0/fineui.ie.min.js
!dist/2.0/fineui.ie.min.js.map
!dist/2.0/fineui.css
!dist/2.0/fineui.js
!dist/2.0/fineui.js.map
!dist/2.0/fineui.min.css
@ -37,4 +35,6 @@
!dist/font/**/*
!dist/images/*
!dist/images/**/*
!babel.config.js
!babel.config.ie8.js
!.eslintrc

460
Gruntfile.js

@ -1,460 +0,0 @@
module.exports = function (grunt) {
function sync(patterns) {
return [...new Set(grunt.file.expand({
filter: path => !new RegExp(/__test__/g).test(path),
}, patterns))];
}
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
concat: {
options: {
separator: "",
sourceMap: true,
sourceMapStyle: "link",
},
polyfillJs: {
src: ["src/core/foundation.js", "src/polyfill/**/*.js"],
dest: "dist/polyfill.js"
},
coreJs: {
src: sync([
"src/core/foundation.js",
"src/core/lodash.js",
// 'src/core/mvc/**/*.js',
"src/core/base.js",
"src/core/ob.js",
"src/core/widget.js",
// 'src/core/model.js',
// 'src/core/view.js',
"src/core/shortcut.js",
"src/core/utils/**/*.js",
"src/core/behavior/behavior.js",
"src/core/wrapper/layout.js",
"src/core/plugin.js",
"src/core/**/*.js",
"src/data/data.js",
"src/data/**/*.js"
]),
dest: "dist/core.js"
},
// 最基础的控件
baseJs: {
src: sync([
"src/third/**/*.js",
"src/base/pane.js",
"src/base/single/single.js",
"src/base/single/text.js",
"src/base/single/button/button.basic.js",
"src/base/single/button/button.node.js",
"src/base/single/tip/tip.js",
"src/base/combination/group.button.js",
"src/base/combination/tree.button.js",
"src/base/tree/ztree/treeview.js",
"src/base/tree/ztree/asynctree.js",
"src/base/tree/ztree/parttree.js",
"src/base/tree/ztree/list/listtreeview.js",
"src/base/tree/ztree/list/listasynctree.js",
"src/base/tree/ztree/list/listparttree.js",
"src/base/**/*.js"
]),
dest: "dist/base.js"
},
// 实现好的一些基础实例
caseJs: {
src: sync([
"src/case/combo/popup.bubble.js",
"src/case/**/*.js"
]),
dest: "dist/case.js"
},
widgetJs: {
src: sync([
"src/widget/**/*.js",
"src/component/**/*.js"
]),
dest: "dist/widget.js"
},
routerJs: {
src: [
"src/router/**/*.js"
],
dest: "dist/router.js"
},
coreCss: {
src: ["src/css/core/**/*.css", "src/css/theme/**/*.css"],
dest: "dist/core.css"
},
coreWithoutNormalizeCss: {
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"
},
baseCss: {
src: ["src/css/base/**/*.css"],
dest: "dist/base.css"
},
widgetCss: {
src: ["src/css/widget/**/*.css"],
dest: "dist/widget.css"
},
resourceCss: {
src: ["src/css/resource/**/*.css"],
dest: "dist/resource.css"
},
fontCss: {
src: ["public/css/font.css"],
dest: "dist/font.css"
},
bundleJs: {
src: ["dist/core.js", "dist/fix/fix.js", "dist/base.js", "dist/case.js", "dist/widget.js", "dist/fix/fix.compact.js", "dist/router.js", "public/js/**/*.js", "public/js/index.js", "i18n/i18n.cn.js"],
dest: "dist/bundle.js",
},
versionFineuiJs: {
src: ["dist/bundle.js"],
dest: "dist/2.0/fineui.js"
},
bundleIEJs: {
src: ["dist/core.js", "dist/fix/fix.ie.js", "dist/base.js", "dist/case.js", "dist/widget.js", "dist/fix/fix.compact.ie.js", "dist/router.js", "public/js/**/*.js", "public/js/index.js", "i18n/i18n.cn.js"],
dest: "dist/bundle.ie.js"
},
versionFineuiIEJs: {
src: ["dist/bundle.ie.js"],
dest: "dist/2.0/fineui.ie.js"
},
bundleCss: {
src: ["dist/core.css", "dist/base.css", "dist/widget.css", "public/css/app.css", "public/css/**/*.css", "fineui.typescript.css"],
dest: "dist/bundle.css"
},
bundleWithoutNormalizeCss: {
src: ["dist/core_without_normalize.css", "dist/base.css", "dist/widget.css", "public/css/app.css", "public/css/**/*.css", "fineui.typescript.css"],
dest: "dist/bundle_without_normalize.css"
},
versionFineuiCss: {
src: ["dist/bundle.css"],
dest: "dist/2.0/fineui.css"
},
versionFineuiWithoutNormalizeCss: {
src: ["dist/bundle_without_normalize.css"],
dest: "dist/2.0/fineui_without_normalize.css"
},
fineuiJs: {
src: ["dist/es5.polyfill.js","dist/polyfill.js", "dist/core.js", "dist/fix/fix.js", "dist/base.js",
"dist/case.js", "dist/widget.js", "dist/router.js", "dist/fix/fix.compact.js", "ui/js/**/*.js"],
dest: "dist/fineui.js"
},
fineuiIEJs: {
src: ["dist/ie.polyfill.js", "dist/polyfill.js", "dist/core.js", "dist/fix/fix.ie.js", "dist/base.js",
"dist/case.js", "dist/widget.js", "dist/router.js", "dist/fix/fix.compact.ie.js", "ui/js/**/*.js"],
dest: "dist/fineui.ie.js"
},
fineuiWithoutJqueryAndPolyfillJs: {
src: sync(["src/core/foundation.js",
"src/core/lodash.js",
// 'src/core/mvc/**/*.js',
"src/core/base.js",
"src/core/ob.js",
"src/core/widget.js",
// 'src/core/model.js',
// 'src/core/view.js',
"src/core/shortcut.js",
"src/core/utils/*.js",
"src/core/behavior/behavior.js",
"src/core/wrapper/layout.js",
"src/core/plugin.js",
"src/core/**/*.js",
"!src/core/platform/web/**/*.js",
"src/data/data.js",
"src/data/**/*.js",
"dist/fix/fix.js",
"src/base/pane.js",
"src/base/single/single.js",
"src/base/single/text.js",
"src/base/single/button/button.basic.js",
"src/base/single/button/button.node.js",
"src/base/single/tip/tip.js",
"src/base/combination/group.button.js",
"src/base/combination/tree.button.js",
"src/base/combination/map.button.js",
"src/base/**/*.js",
"!src/base/tree/ztree/**/*.js",
"!src/base/single/input/file.js",
"src/case/combo/popup.bubble.js",
"src/case/**/*.js",
"!src/case/colorchooser/**/*.js",
"!src/case/tree/ztree/**/*.js",
"dist/widget.js",
"dist/fix/fix.compact.js",
"ui/js/**/*.js",
"dist/es5.fineui.js"]),
dest: "dist/fineui_without_jquery_polyfill.js"
},
fineuiCss: {
src: ["dist/core.css", "dist/base.css", "dist/widget.css", "ui/css/app.css", "ui/css/**/*.css", "fineui.typescript.css"],
dest: "dist/fineui.css"
},
configJs: {
src: ["demo/version.js", "i18n/i18n.cn.js"],
dest: "dist/config.js"
},
demoJs: {
src: ["demo/app.js", "demo/js/**/*.js", "demo/config.js"],
dest: "dist/demo.js"
},
demoCss: {
src: ["demo/css/**/*.css"],
dest: "dist/demo.css"
},
utilsJs: {
src: [
"src/core/foundation.js",
"src/core/lodash.js",
"src/core/var.js",
"src/core/func/array.js",
"src/core/func/number.js",
"src/core/func/string.js",
"src/core/func/date.js",
"src/core/func/function.js",
"src/core/base.js",
"src/core/ob.js",
"src/core/alias.js",
"src/core/inject.js",
"src/core/i18n.js",
"src/core/utils/*.js",
"i18n/i18n.cn.js",
"_mobile/date.i18n.cn.js",
"src/data/data.js",
"src/data/**/*.js"
],
dest: "dist/utils.js"
}
},
less: {
demo: {
expand: true,
cwd: "demo/less",
src: ["**/*.less"],
dest: "demo/css/",
ext: ".css"
},
main: {
expand: true,
cwd: "public/less",
src: ["**/*.less"],
dest: "public/css",
ext: ".css"
},
ui: {
expand: true,
cwd: "ui/less",
src: ["**/*.less"],
dest: "ui/css",
ext: ".css"
},
src: {
expand: true,
cwd: "src/less",
src: ["**/*.less"],
dest: "src/css",
ext: ".css"
},
dev: {
options: {
compress: true,
yuicompress: false
}
}
},
uglify: {
options: {
banner: "/*! <%= pkg.name %> <%= grunt.template.today(\"yyyy-mm-dd HH:MM:ss\") %> */\n",
mangle: false,
sourceMap: true,
sourceMapIncludeSources: true,
compress: {
unused: false,
},
},
dist: {
files: {
"dist/bundle.min.js": ["<%= concat.bundleJs.dest %>"],
"dist/bundle.ie.min.js": ["<%= concat.bundleIEJs.dest %>"],
"dist/utils.min.js": ["<%= concat.utilsJs.dest %>"],
"dist/fineui.min.js": ["<%= concat.fineuiJs.dest %>"],
"dist/fineui.ie.min.js": ["<%= concat.fineuiIEJs.dest %>"],
"dist/2.0/fineui.min.js": ["<%= concat.versionFineuiJs.dest %>"],
"dist/2.0/fineui.ie.min.js": ["<%= concat.versionFineuiIEJs.dest %>"]
}
}
},
cssmin: {
bundleCss: {
src: "<%= concat.bundleCss.dest %>",
dest: "dist/bundle.min.css"
},
fineuiCss: {
src: "<%= concat.fineuiCss.dest %>",
dest: "dist/fineui.min.css"
},
versionFineuiMinCss: {
src: "<%= concat.versionFineuiCss.dest %>",
dest: "dist/2.0/fineui.min.css"
},
versionFineuiWithoutNormalizeMinCss: {
src: "<%= concat.versionFineuiWithoutNormalizeCss.dest %>",
dest: "dist/2.0/fineui_without_normalize.min.css"
},
},
jshint: {
files: ["Gruntfile.js", "src/**/*.js"],
options: {
globals: {
jQuery: true,
console: true,
module: true,
document: true
}
}
},
copy: {
js: {
files: [
{
expand: true,
cwd: "dist",
src: [
"fineui.js"
],
dest: "dist/",
rename: function (dest, src) {
return dest + src.replace(".js", ".min.js");
}
}
]
}
},
watch: {
scripts: {
files: ["src/**/*.js", "src/**/*.less", "demo/js/**/*.js", "demo/app.js", "demo/version.js", "demo/config.js", "demo/less/**/*.less", "!src/**/__test__/*.js"],
tasks: ["less", "concat"],
options: {
spanw: true,
interrupt: true
}
},
livereload: {
options: {
livereload: "<%= connect.options.livereload %>"
},
files: ["src/**/*.js", "!src/**/__test__/*.js", "src/**/*.less"]
}
},
connect: {
options: {
port: 9000,
open: true,
livereload: 35729,
// Change this to '0.0.0.0' to access the server from outside
hostname: "0.0.0.0"
},
server: {
options: {
port: 9001
}
}
},
clean: ["src/css", "demo/css"]
});
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-less");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.registerTask("analyze", "code analysis", function () {
const authors = ["test_author_imp", "test_author_teller", "test_author_fay", "test_author_young", "test_author_windy", "test_author_lei.wang", "test_author_Kira", "test_author_Zhenfei.Li"];
const info = [];
authors.forEach(function (auth) {
info.push({
author: auth,
reg: new RegExp(auth, "g"),
count: 0
});
});
const testFiles = grunt.file.expand(["src/**/*.test.js", "test/**/*.test.js"]);
testFiles.forEach(function (el) {
const fileStr = grunt.file.read(el);
authors.forEach(function (auth, idx) {
const res = fileStr.match(info[idx].reg);
if (res != null) {
info[idx].count += res.length;
}
});
});
const todayStat = {};
info.forEach(function (inf) {
todayStat[inf.author] = inf.count;
});
const date = grunt.template.today("yyyy-mm-dd");
const dest = "test/unit.test.statistic.json";
let stat;
try {
stat = grunt.file.readJSON(dest);
} catch (e) {
stat = {};
}
if (!stat.date || stat.date === {}) {
stat[date] = todayStat;
}
grunt.file.write(dest, JSON.stringify(stat));
});
var defaultTask = ["clean", "less", "concat", "watch"];
grunt.registerTask("default", defaultTask);
grunt.registerTask("compile", function () {
grunt.config.set("connect.options.open", false);
grunt.task.run(defaultTask);
});
grunt.registerTask("build", ["clean", "less", "concat", "cssmin", "uglify"]);
grunt.registerTask("fake-build", ["clean", "less", "concat", "cssmin", "copy"]);
};

0
demo/css/center.css

3
demo/css/face.css

@ -1,3 +0,0 @@
.demo-face .face-config .config-label {
font-size: 14px;
}

0
demo/css/index.css

84
demo/css/main.css

@ -1,84 +0,0 @@
.layout-bg-white {
background-color: #ffffff;
}
.layout-bg-gray {
background-color: #eeeeee;
}
.layout-bg1 {
color: #ffffff;
background-color: #0088cc;
}
.layout-bg2 {
color: #ffffff;
background-color: #008B8B;
}
.layout-bg3 {
color: #ffffff;
background-color: #6495ED;
}
.layout-bg4 {
color: #ffffff;
background-color: #ff69b4;
}
.layout-bg5 {
color: #ffffff;
background-color: #B8860B;
}
.layout-bg6 {
color: #ffffff;
background-color: #d9534f;
}
.layout-bg7 {
color: #ffffff;
background-color: #ea4738;
}
.layout-bg8 {
color: #ffffff;
background-color: #6495ed;
}
.demo-main .bg1 {
background-color: #178cdf;
}
body {
background-color: #f7f8fa;
}
#wrapper {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.bi-theme-dark body {
background-color: #191b2b;
}
.demo-editor {
border: 1px solid #cccccc;
}
.demo-clolor {
color: #1a1a1a;
}
.bi-progress-bar-processor {
transition: all 0.5s ease;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
background: #3f8ce8;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
}
.bi-progress-text-bar-processor {
transition: all 0.5s ease;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
}
.bi-progress-bar-bar {
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
}

10
demo/css/north.css

@ -1,10 +0,0 @@
.demo-north {
background-color: #3c8dbc;
}
.demo-north .logo {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #ffffff;
background-color: #367fa9;
font-size: 20px;
font-weight: 300;
}

0
demo/css/preview.css

102
demo/css/vm.css

@ -1,102 +0,0 @@
.mvc-button:hover,
.mvc-button.hover {
opacity: 0.5;
filter: alpha(opacity=50);
}
.mvc-button.active,
.mvc-button:active {
opacity: 0.5;
filter: alpha(opacity=50);
}
.bi-set-get .left-title,
.bi-set-get .right-title {
background: #0088cc;
color: #ffffff;
}
.bi-set-get .left-nav {
border-bottom: 1px solid #cccccc;
}
.bi-set-get .left-nav.active,
.bi-set-get .left-nav:active {
color: #ffffff;
background-color: #d9534f;
}
.bi-local .top-button {
background-color: #448eea;
color: #ffffff;
}
.bi-local .bottom-label {
background-color: #EA4738;
color: #ffffff;
}
.bi-local .delete-button {
background-color: #008B8B;
color: #ffffff;
}
.bi-local .vessel-border {
border-left: 1px solid #cccccc;
border-bottom: 1px solid #cccccc;
border-right: 1px solid #cccccc;
}
.bi-event .title {
background: #0088cc;
color: #ffffff;
}
.bi-event .front {
background: #ADD8E6;
}
.bi-event .nav {
border: 1px solid #cccccc;
}
.bi-skip-to {
color: #ffffff;
}
.bi-skip-to .red-pane {
background-color: #0088cc;
}
.bi-skip-to .blue-pane {
background-color: #6495ED;
}
.bi-skip-to .green-pane {
background-color: #008B8B;
}
.bi-skip-to .yellow-pane {
background-color: #B8860B;
}
.bi-change .outer-text {
background-color: #0088cc;
color: #ffffff;
}
.bi-change .inner {
border-left: 1px solid #cccccc;
border-bottom: 1px solid #cccccc;
border-right: 1px solid #cccccc;
}
.bi-change .type-first {
background-color: #008B8B;
}
.bi-change .type-second {
background-color: #6495ED;
}
.bi-change .type-third {
background-color: #0088cc;
}
.bi-tmp .tmp-button {
color: #ffffff;
background: #0088cc;
}
.bi-splice-duplicate .superiors-label {
color: white;
background-color: #008B8B;
}
.bi-splice-duplicate .sd-child {
border: 1px solid #cccccc;
}
.bi-splice-duplicate .sd-child .right-button-add {
color: white;
background-color: #0088cc;
}
.bi-splice-duplicate .sd-child .right-button-del {
color: white;
background-color: #d9534f;
}

0
demo/css/west.css

6566
dist/2.0/fineui.css vendored

File diff suppressed because one or more lines are too long

1
dist/2.0/fineui.css.map vendored

File diff suppressed because one or more lines are too long

91650
dist/2.0/fineui.ie.js vendored

File diff suppressed because one or more lines are too long

1
dist/2.0/fineui.ie.js.map vendored

File diff suppressed because one or more lines are too long

55
dist/2.0/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.ie.min.js.map vendored

File diff suppressed because one or more lines are too long

158265
dist/2.0/fineui.js vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.js.map vendored

File diff suppressed because one or more lines are too long

3
dist/2.0/fineui.min.css vendored

File diff suppressed because one or more lines are too long

56
dist/2.0/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.min.js.map vendored

File diff suppressed because one or more lines are too long

6219
dist/2.0/fineui_without_normalize.css vendored

File diff suppressed because one or more lines are too long

1
dist/2.0/fineui_without_normalize.css.map vendored

File diff suppressed because one or more lines are too long

3
dist/2.0/fineui_without_normalize.min.css vendored

File diff suppressed because one or more lines are too long

2208
dist/base.css vendored

File diff suppressed because it is too large Load Diff

1
dist/base.css.map vendored

File diff suppressed because one or more lines are too long

14465
dist/base.js vendored

File diff suppressed because it is too large Load Diff

1
dist/base.js.map vendored

File diff suppressed because one or more lines are too long

6564
dist/bundle.css vendored

File diff suppressed because it is too large Load Diff

1
dist/bundle.css.map vendored

File diff suppressed because one or more lines are too long

91650
dist/bundle.ie.js vendored

File diff suppressed because one or more lines are too long

1
dist/bundle.ie.js.map vendored

File diff suppressed because one or more lines are too long

53
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

1
dist/bundle.ie.min.js.map vendored

File diff suppressed because one or more lines are too long

92001
dist/bundle.js vendored

File diff suppressed because one or more lines are too long

1
dist/bundle.js.map vendored

File diff suppressed because one or more lines are too long

3
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

56
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/bundle.min.js.map vendored

File diff suppressed because one or more lines are too long

6217
dist/bundle_without_normalize.css vendored

File diff suppressed because it is too large Load Diff

1
dist/bundle_without_normalize.css.map vendored

File diff suppressed because one or more lines are too long

9824
dist/case.js vendored

File diff suppressed because it is too large Load Diff

1
dist/case.js.map vendored

File diff suppressed because one or more lines are too long

193
dist/config.js vendored

@ -1,193 +0,0 @@
BI.i18n = {
"BI-Multi_Date_Quarter_End": "季度末",
"BI-Multi_Date_Month_Begin": "月初",
"BI-Multi_Date_YMD": "年月日",
"BI-Custom_Color": "自定义颜色",
"BI-Numerical_Interval_Input_Data": "请输入数值",
"BI-Please_Input_Natural_Number": "请输入非负整数",
"BI-No_More_Data": "无更多数据",
"BI-Basic_Altogether": "共",
"BI-Basic_Sunday": "星期日",
"BI-Widget_Background_Colour": "组件背景",
"BI-Color_Picker_Error_Text": "请输入0~255的正整数",
"BI-Multi_Date_Month": "月",
"BI-No_Selected_Item": "没有可选项",
"BI-Multi_Date_Year_Begin": "年初",
"BI-Quarter_1": "第1季度",
"BI-Quarter_2": "第2季度",
"BI-Quarter_3": "第3季度",
"BI-Quarter_4": "第4季度",
"BI-Multi_Date_Year_Next": "年后",
"BI-Multi_Date_Month_Prev": "个月前",
"BI-Month_Trigger_Error_Text": "请输入1~12的正整数",
"BI-Less_And_Equal": "小于等于",
"BI-Year_Trigger_Invalid_Text": "请输入有效时间",
"BI-Multi_Date_Week_Next": "周后",
"BI-Font_Size": "字号",
"BI-Basic_Total": "共",
"BI-Already_Selected": "已选择",
"BI-Formula_Insert": "插入",
"BI-Select_All": "全选",
"BI-Basic_Tuesday": "星期二",
"BI-Multi_Date_Month_End": "月末",
"BI-Load_More": "点击加载更多数据",
"BI-Basic_September": "九月",
"BI-Current_Is_Last_Page": "当前已是最后一页",
"BI-Basic_Auto": "自动",
"BI-Basic_Count": "个",
"BI-Basic_Value": "值",
"BI-Basic_Unrestricted": "无限制",
"BI-Quarter_Trigger_Error_Text": "请输入1~4的正整数",
"BI-Basic_More": "更多",
"BI-Basic_Wednesday": "星期三",
"BI-Basic_Bold": "加粗",
"BI-Basic_Simple_Saturday": "六",
"BI-Multi_Date_Month_Next": "个月后",
"BI-Basic_March": "三月",
"BI-Current_Is_First_Page": "当前已是第一页",
"BI-Basic_Thursday": "星期四",
"BI-Basic_Prompt": "提示",
"BI-Multi_Date_Today": "今天",
"BI-Multi_Date_Quarter_Prev": "个季度前",
"BI-Row_Header": "行表头",
"BI-Date_Trigger_Error_Text": "日期格式示例:2015-3-11",
"BI-Basic_Cancel": "取消",
"BI-Basic_January": "一月",
"BI-Basic_June": "六月",
"BI-Basic_July": "七月",
"BI-Basic_April": "四月",
"BI-Multi_Date_Quarter_Begin": "季度初",
"BI-Multi_Date_Week": "周",
"BI-Click_Blank_To_Select": "点击\"空格键\"选中完全匹配项",
"BI-Basic_August": "八月",
"BI-Word_Align_Left": "文字居左",
"BI-Basic_November": "十一月",
"BI-Font_Colour": "字体颜色",
"BI-Multi_Date_Day_Prev": "天前",
"BI-Select_Part": "部分选择",
"BI-Multi_Date_Day_Next": "天后",
"BI-Less_Than": "小于",
"BI-Basic_February": "二月",
"BI-Multi_Date_Year": "年",
"BI-Number_Index": "序号",
"BI-Multi_Date_Week_Prev": "周前",
"BI-Next_Page": "下一页",
"BI-Right_Page": "向右翻页",
"BI-Numerical_Interval_Signal_Value": "前后值相等,请将操作符改为“≤”",
"BI-Basic_December": "十二月",
"BI-Basic_Saturday": "星期六",
"BI-Basic_Simple_Wednesday": "三",
"BI-Multi_Date_Quarter_Next": "个季度后",
"BI-Basic_October": "十月",
"BI-Basic_Simple_Friday": "五",
"BI-Basic_Save": "保存",
"BI-Numerical_Interval_Number_Value": "请保证前面的数值小于/等于后面的数值",
"BI-Previous_Page": "上一页",
"BI-No_Select": "搜索结果为空",
"BI-Basic_Clears": "清空",
"BI-Created_By_Me": "我创建的",
"BI-Basic_Simple_Tuesday": "二",
"BI-Word_Align_Right": "文字居右",
"BI-Summary_Values": "汇总",
"BI-Basic_Clear": "清除",
"BI-Upload_File_Size_Error": "文件大小不支持",
"BI-Up_Page": "向上翻页",
"BI-Basic_Simple_Sunday": "日",
"BI-Multi_Date_Relative_Current_Time": "相对当前时间",
"BI-Selected_Data": "已选数据:",
"BI-Multi_Date_Quarter": "季度",
"BI-Check_Selected": "查看已选",
"BI-Basic_Search": "搜索",
"BI-Basic_May": "五月",
"BI-Continue_Select": "继续选择",
"BI-Please_Input_Positive_Integer": "请输入正整数",
"BI-Upload_File_Type_Error": "文件类型不支持",
"BI-Upload_File_Error": "文件上传失败",
"BI-Basic_Friday": "星期五",
"BI-Down_Page": "向下翻页",
"BI-Basic_Monday": "星期一",
"BI-Left_Page": "向左翻页",
"BI-Transparent_Color": "透明",
"BI-Basic_Simple_Monday": "一",
"BI-Multi_Date_Year_End": "年末",
"BI-Time_Interval_Error_Text": "请保证开始时间早于/等于结束时间",
"BI-Basic_Time": "时间",
"BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定",
"BI-Basic_Simple_Thursday": "四",
"BI-Multi_Date_Year_Prev": "年前",
"BI-Tiao_Data": "条数据",
"BI-Basic_Italic": "斜体",
"BI-Basic_Dynamic_Title": "动态时间",
"BI-Basic_Year": "年",
"BI-Basic_Single_Quarter": "季",
"BI-Basic_Month": "月",
"BI-Basic_Week": "周",
"BI-Basic_Day": "天",
"BI-Basic_Work_Day": "工作日",
"BI-Basic_Front": "前",
"BI-Basic_Behind": "后",
"BI-Basic_Empty": "空",
"BI-Basic_Month_End": "月末",
"BI-Basic_Month_Begin": "月初",
"BI-Basic_Year_End": "年末",
"BI-Basic_Year_Begin": "年初",
"BI-Basic_Quarter_End": "季末",
"BI-Basic_Quarter_Begin": "季初",
"BI-Basic_Week_End": "周末",
"BI-Basic_Week_Begin": "周初",
"BI-Basic_Current_Day": "当天",
"BI-Basic_Begin_Start": "初",
"BI-Basic_End_Stop": "末",
"BI-Basic_Current_Year": "今年",
"BI-Basic_Year_Fen": "年份",
"BI-Basic_Current_Month": "本月",
"BI-Basic_Current_Quarter": "本季度",
"BI-Basic_Year_Month": "年月",
"BI-Basic_Year_Quarter": "年季度",
"BI-Basic_Input_Can_Not_Null": "输入框不能为空",
"BI-Basic_Date_Time_Error_Text": "日期格式示例:2015-3-11 00:00:00",
"BI-Basic_Input_From_To_Number": "请输入{R1}的数值",
"BI-Basic_Or": "或",
"BI-Basic_And": "且",
"BI-Conf_Add_Formula": "添加公式",
"BI-Conf_Add_Condition": "添加条件",
"BI-Conf_Formula_And": "且公式条件",
"BI-Conf_Formula_Or": "或公式条件",
"BI-Conf_Condition_And": "且条件",
"BI-Conf_Condition_Or": "或条件",
"BI-Microsoft_YaHei": "微软雅黑",
"BI-Apple_Light": "苹方-light",
"BI-Font_Family": "字体",
"BI-Basic_Please_Input_Content": "请输入内容",
"BI-Word_Align_Center": "文字居中",
"BI-Basic_Please_Enter_Number_Between": "请输入{R1}-{R2}的值",
"BI-More_Than": "大于",
"BI-More_And_Equal": "大于等于",
"BI-Please_Enter_SQL": "请输入SQL",
"BI-Basic_Click_To_Add_Text": "+点击新增\"{R1}\"",
"BI-Basic_Please_Select": "请选择",
"BI-Basic_Font_Color": "文字颜色",
"BI-Basic_Background_Color": "背景色",
"BI-Basic_Underline": "下划线",
"BI-Basic_Param_Month": "{R1}月",
"BI-Basic_Param_Day": "{R1}日",
"BI-Basic_Param_Quarter": "{R1}季度",
"BI-Basic_Param_Week_Count": "第{R1}周",
"BI-Basic_Param_Hour": "{R1}时",
"BI-Basic_Param_Minute": "{R1}分",
"BI-Basic_Param_Second": "{R1}秒",
"BI-Basic_Param_Year": "{R1}年",
"BI-Basic_Date_Day": "日",
"BI-Basic_Hour_Sin": "时",
"BI-Basic_Seconds": "秒",
"BI-Basic_Minute": "分",
"BI-Basic_Wan": "万",
"BI-Basic_Million": "百万",
"BI-Basic_Billion": "亿",
"BI-Basic_Quarter": "季度",
"BI-Basic_No_Select": "不选",
"BI-Basic_Now": "此刻"
};
//# sourceMappingURL=config.js.map

1
dist/config.js.map vendored

File diff suppressed because one or more lines are too long

2295
dist/core.css vendored

File diff suppressed because it is too large Load Diff

1
dist/core.css.map vendored

File diff suppressed because one or more lines are too long

37053
dist/core.js vendored

File diff suppressed because one or more lines are too long

1
dist/core.js.map vendored

File diff suppressed because one or more lines are too long

1948
dist/core_without_normalize.css vendored

File diff suppressed because it is too large Load Diff

1
dist/core_without_normalize.css.map vendored

File diff suppressed because one or more lines are too long

203
dist/demo.css vendored

File diff suppressed because one or more lines are too long

1
dist/demo.css.map vendored

File diff suppressed because one or more lines are too long

98577
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

1
dist/es5.fineui.js vendored

@ -1 +0,0 @@
!function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=313)}({313:function(e,t,n){e.exports=n(314)},314:function(e,t,n){"use strict";n.r(t);var r={};function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){e.prototype=Object.create(t.prototype),function(e,t){for(var n=Object.getOwnPropertyNames(t),r=0;r<n.length;r++){var o=n[r],u=Object.getOwnPropertyDescriptor(t,o);u&&u.configurable&&e[o]===undefined&&Object.defineProperty(e,o,u)}}(e.prototype.constructor=e,t)}function o(){return function(e){BI.shortcut(e.xtype,e)}}function f(){return function(e){BI.model(e.xtype,e)}}function d(n){var r=1<arguments.length&&arguments[1]!==undefined?arguments[1]:{};return function(e){return function(e){function t(){return e.apply(this,arguments)||this}return c(t,e),t.prototype._store=function(){var e=r.props?r.props.apply(this):undefined;return BI.Models.getModel(n.xtype,e)},t}(e)}}n.r(r),n.d(r,"shortcut",function(){return o}),n.d(r,"model",function(){return f}),n.d(r,"store",function(){return d}),n.d(r,"Model",function(){return l});var l=function(o){function e(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return i(u(e=o.call.apply(o,[this].concat(n))||this),"model",void 0),i(u(e),"store",void 0),i(u(e),"context",void 0),i(u(e),"actions",void 0),i(u(e),"childContext",void 0),i(u(e),"TYPE",void 0),i(u(e),"computed",void 0),e}return c(e,o),e.prototype.state=function(){return{}},e}(Fix.Model),p={Decorators:r};BI.extend(BI,p)}});

1
dist/es5.fineui.js.map vendored

File diff suppressed because one or more lines are too long

1
dist/es5.polyfill.js vendored

File diff suppressed because one or more lines are too long

1
dist/es5.polyfill.js.map vendored

File diff suppressed because one or more lines are too long

6566
dist/fineui.css vendored

File diff suppressed because one or more lines are too long

1
dist/fineui.css.map vendored

File diff suppressed because one or more lines are too long

91707
dist/fineui.ie.js vendored

File diff suppressed because one or more lines are too long

1
dist/fineui.ie.js.map vendored

File diff suppressed because one or more lines are too long

57
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.ie.min.js.map vendored

File diff suppressed because one or more lines are too long

158465
dist/fineui.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.js.map vendored

File diff suppressed because one or more lines are too long

3
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

59
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.min.js.map vendored

File diff suppressed because one or more lines are too long

114196
dist/fineui_without_jquery_polyfill.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui_without_jquery_polyfill.js.map vendored

File diff suppressed because one or more lines are too long

906
dist/font.css vendored

File diff suppressed because one or more lines are too long

1
dist/font.css.map vendored

File diff suppressed because one or more lines are too long

1
dist/ie.fineui.js vendored

@ -1 +0,0 @@
!function(r){var n={};function o(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=n,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=148)}({148:function(e,t,r){e.exports=r(149)},149:function(e,t,r){"use strict";var n,o=(n=r(150))&&n.__esModule?n:{"default":n};BI.extend(BI,o["default"])},150:function(e,t,r){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=void 0;var n={Decorators:function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{"default":e};var t=c();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e){var u;Object.prototype.hasOwnProperty.call(e,o)&&((u=n?Object.getOwnPropertyDescriptor(e,o):null)&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=e[o])}r["default"]=e,t&&t.set(e,r);return r}(r(151))};t["default"]=n},151:function(e,t,r){"use strict";function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){e.prototype=Object.create(t.prototype),function(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var o=r[n],u=Object.getOwnPropertyDescriptor(t,o);u&&u.configurable&&e[o]===undefined&&Object.defineProperty(e,o,u)}}(e.prototype.constructor=e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.shortcut=function(){return function(e){BI.shortcut(e.xtype,e)}},t.model=function(){return function(e){BI.model(e.xtype,e)}},t.store=function(r){var n=1<arguments.length&&arguments[1]!==undefined?arguments[1]:{};return function(e){return function(e){function t(){return e.apply(this,arguments)||this}return c(t,e),t.prototype._store=function(){var e=n.props?n.props.apply(this):undefined;return BI.Models.getModel(r.xtype,e)},t}(e)}},t.Model=void 0;var n=function(o){function e(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return i(u(e=o.call.apply(o,[this].concat(r))||this),"model",void 0),i(u(e),"store",void 0),i(u(e),"context",void 0),i(u(e),"actions",void 0),i(u(e),"childContext",void 0),i(u(e),"TYPE",void 0),i(u(e),"computed",void 0),e}return c(e,o),e.prototype.state=function(){return{}},e}(Fix.Model);t.Model=n}});

1
dist/ie.fineui.js.map vendored

File diff suppressed because one or more lines are too long

1
dist/ie.polyfill.js vendored

File diff suppressed because one or more lines are too long

1
dist/ie.polyfill.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/lib/base/combination/group.button.d.ts vendored

@ -4,7 +4,7 @@ export interface _ButtonGroup extends _Widget {
addItems<T>(items: T[]): void;
removeItemAt(indexes: any): void;
removeItems(values: any): void;
populate(items?: any): void;
populate(items?: any, ...args: any[]): void;
setNotSelectedValue(v: any): void;
getNotSelectedValue<T>(): T[];
setEnabledValue(v: any): void;

9
dist/lib/base/pane.d.ts vendored

@ -1,9 +1,10 @@
import { _Widget } from "../core/widget";
export interface _Pane extends _Widget {
_assertTip: (..._args: any[]) => void;
loading: (..._args: any[]) => void;
loaded: (..._args: any[]) => void;
check: (..._args: any[]) => void;
_assertTip(..._args: any[]): void;
loading(..._args: any[]): void;
loaded(..._args: any[]): void;
check(..._args: any[]): void;
populate(...args: any[]): void;
}
export interface _PaneStatic {
EVENT_LOADED: string;

7
dist/lib/base/single/button/button.node.d.ts vendored

@ -0,0 +1,7 @@
import { _BasicButton } from "./button.basic";
export interface _NodeButton extends _BasicButton {
isOpened: () => void;
setOpened: (b: boolean) => void;
triggerCollapse: () => void;
triggerExpand: () => void;
}

7
dist/lib/base/single/iframe/iframe.d.ts vendored

@ -0,0 +1,7 @@
import { _Single } from "../single";
export interface _Iframe extends _Single {
setSrc(v: string): void;
getSrc(): string;
setNam(v: string): void;
getName(): string;
}

20
dist/lib/component/treevaluechooser/abstract.treevaluechooser.d.ts vendored

@ -0,0 +1,20 @@
import { _Widget } from "../../core/widget";
export interface _AbstractTreeValueChooser extends _Widget {
_valueFormatter: (v: string) => string;
_initData: (items: any[]) => void;
_itemsCreator: (options: any, callback: Function) => void;
_reqDisplayTreeNode: (options: any, callback: Function) => void;
_reqSelectedTreeNode: (options: any, callback: Function) => void;
_reqAdjustTreeNode: (options: any, callback: Function) => void;
_reqInitTreeNode: (options: any, callback: Function) => void;
_reqTreeNode: (options: any, callback: Function) => void;
_getAddedValueNode: (parentValues: any[], selectedValues: any) => any[];
_getNode: (selectedValues: any, parentValues: any[]) => any;
_deleteNode: (selectedValues: any, values: any[]) => void;
_buildTree: (jo: any, values: any) => void;
_isMatch: (parentValues: any, value: any, keyword: any) => boolean;
_getTreeNode: (parentValues: any, v: any) => any;
_getChildren: (parentValues: any) => any;
_getAllChildren: (parentValues: any) => any;
_getChildCount: (parentValues: any) => number;
}

3
dist/lib/component/treevaluechooser/abstract.treevaluechooser.list.d.ts vendored

@ -0,0 +1,3 @@
import { _AbstractTreeValueChooser } from "./abstract.treevaluechooser";
export interface _AbstractListTreeValueChooser extends _AbstractTreeValueChooser {
}

8
dist/lib/core/base.d.ts vendored

@ -21,7 +21,7 @@ export interface _base {
shuffle: (collection: any[] | object | string) => any[];
sample: (collection: any[] | object | string, n?: number) => any[];
toArray: (collection: any[] | object | string) => any[];
size: (collection: any[] | object | string) => number;
size: (collection: any) => number;
each: <T>(collection: T[] | object | string, callback?: ((index: number, value: T) => void) | object | string, thisArg?: any) => any;
map: <T, U>(collection: T[] | object | string | null | undefined, callback?: ((index: number, value: T) => U) | object | string, thisArg?: any) => U[];
reduce: <T, U>(collection: T[] | object | string, callback?: ((total: U extends T ? U : T, currentValue: T, currentIndex: number) => U extends T ? U : T) | object | string, initialValue?: U | T) => U extends T ? U : T;
@ -131,7 +131,7 @@ export interface _base {
length: 0;
};
isNotEmptyArray: <T, U>(arr: T[] | U) => arr is [T, ...T[]];
isEmptyObject: (obj: any) => obj is object;
isEmptyObject: (obj: any) => boolean;
isNotEmptyObject: (obj: any) => obj is object;
isWindow: (obj: any) => obj is Window;
isDeepMatch: (object: any, attrs: any) => boolean;
@ -168,8 +168,8 @@ export interface _base {
isFloat: (value: string | number) => boolean;
isOdd: (value: string | number) => boolean;
isEven: (value: string | number) => boolean;
sum: (array: any[], iteratee: Function, context: any) => number;
average: (array: any[], iteratee: Function, context: any) => number;
sum: (array: any[], iteratee?: Function, context?: any) => number;
average: (array: any[], iteratee?: Function, context?: any) => number;
trim: (string?: string, chars?: string) => string;
toUpperCase: (string: string) => string;
toLowerCase: (string: string) => string;

6
dist/lib/core/decorator/decorator.d.ts vendored

@ -5,6 +5,12 @@ export declare type Constructor<T> = new (...args: any[]) => T;
export declare function shortcut(): <U>(Target: Constructor<U> & {
xtype: string;
}) => void;
/**
* provider
*/
export declare function provider(): <U>(Target: Constructor<U> & {
xtype: string;
}) => void;
/**
* model
*/

6
dist/lib/core/wrapper/layout/layout.absolute.d.ts vendored

@ -0,0 +1,6 @@
import { _Layout } from "../layout";
export interface _AbsoluteLayout extends _Layout {
resize(): void;
stroke<T>(items: T[]): void;
populate<T>(items?: T[]): void;
}

5
dist/lib/core/wrapper/layout/layout.vertical.d.ts vendored

@ -0,0 +1,5 @@
import { _Layout } from "../layout";
export interface _VerticalLayout extends _Layout {
resize(): void;
populate<T>(items?: T[]): void;
}

1
dist/lib/fix/fix.d.ts vendored

@ -0,0 +1 @@
export {};

1
dist/lib/fix/fix.ie.d.ts vendored

@ -0,0 +1 @@
export {};

14
dist/lib/index.d.ts vendored

@ -3,10 +3,12 @@ import { _ButtonGroup, _ButtonGroupChooseType, _ButtonGroupStatic } from "./base
import { _Tab, _TabStatic } from "./base/combination/tab";
import { _Pane, _PaneStatic } from "./base/pane";
import { _BasicButton, _BasicButtonStatic } from "./base/single/button/button.basic";
import { _NodeButton } from "./base/single/button/button.node";
import { _Button, _ButtonStatic } from "./base/single/button/buttons/button";
import { _TextButton, _TextButtonStatic } from "./base/single/button/buttons/button.text";
import { _IconTextItem, _IconTextItemStatic } from "./base/single/button/listitem/icontextitem";
import { _Editor, _EditorStatic } from "./base/single/editor/editor";
import { _Iframe } from "./base/single/iframe/iframe";
import { _Checkbox, _CheckboxStatic } from "./base/single/input/checkbox";
import { _AbstractLabel } from "./base/single/label/abstract.label";
import { _Label } from "./base/single/label/label";
@ -20,6 +22,8 @@ import { _TextValueCombo, _TextValueComboStatic } from "./case/combo/combo.textv
import { _SignEditor, _SignEditorStatic } from "./case/editor/editor.sign";
import { _LoadingPane } from "./case/loading/loading_pane";
import { _AllValueMultiTextValueCombo, _AllValueMultiTextValueComboStatic } from "./component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo";
import { _AbstractTreeValueChooser } from "./component/treevaluechooser/abstract.treevaluechooser";
import { _AbstractListTreeValueChooser } from "./component/treevaluechooser/abstract.treevaluechooser.list";
import { _Action, _ActionFactory } from "./core/action/action";
import { _ShowAction } from "./core/action/action.show";
import { _base } from "./core/base";
@ -32,7 +36,10 @@ import { _i18n } from "./core/i18n";
import { _OB } from "./core/ob";
import { _Widget, _WidgetStatic } from "./core/widget";
import { _Layout } from "./core/wrapper/layout";
import { _AbsoluteLayout } from "./core/wrapper/layout/layout.absolute";
import { _HTapeLayout, _VTapeLayout } from "./core/wrapper/layout/layout.tape";
import { _VerticalLayout } from "./core/wrapper/layout/layout.vertical";
import { _DownListCombo, _DownListComboStatic } from "./widget/downlist/combo.downlist";
declare type ClassConstructor<T extends {}> = T & {
new (config: any): T;
(config: any): T;
@ -43,6 +50,7 @@ export interface BI extends _func, _i18n, _base {
Widget: ClassConstructor<_Widget> & _WidgetStatic;
Single: ClassConstructor<_Single>;
BasicButton: ClassConstructor<_BasicButton> & _BasicButtonStatic;
NodeButton: ClassConstructor<_NodeButton>;
Checkbox: ClassConstructor<_Checkbox> & _CheckboxStatic;
Button: ClassConstructor<_Button> & _ButtonStatic;
TextButton: ClassConstructor<_TextButton> & _TextButtonStatic;
@ -73,7 +81,13 @@ export interface BI extends _func, _i18n, _base {
Layout: ClassConstructor<_Layout>;
HTapeLayout: ClassConstructor<_HTapeLayout>;
VTapeLayout: ClassConstructor<_VTapeLayout>;
AbstractTreeValueChooser: ClassConstructor<_AbstractTreeValueChooser>;
AbstractListTreeValueChooser: ClassConstructor<_AbstractListTreeValueChooser>;
Decorators: typeof decorator;
DownListCombo: ClassConstructor<_DownListCombo> & _DownListComboStatic;
Iframe: ClassConstructor<_Iframe>;
AbsoluteLayout: ClassConstructor<_AbsoluteLayout>;
VerticalLayout: ClassConstructor<_VerticalLayout>;
}
declare const _default: {
Decorators: typeof decorator;

11
dist/lib/widget/downlist/combo.downlist.d.ts vendored

@ -0,0 +1,11 @@
import { _Widget } from "../../core/widget";
export interface _DownListCombo extends _Widget {
hideView: () => void;
showView: (e?: any) => void;
populate: (items?: any) => void;
}
export interface _DownListComboStatic {
EVENT_CHANGE: string;
EVENT_SON_VALUE_CHANGE: string;
EVENT_BEFORE_POPUPVIEW: string;
}

249
dist/polyfill.js vendored

@ -1,249 +0,0 @@
/**
* Created by richie on 15/7/8.
*/
/**
* 初始化BI对象
*/
var _global;
if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (_global.BI == null) {
_global.BI = {prepares: []};
}
if(_global.BI.prepares == null) {
_global.BI.prepares = [];
}// Production steps of ECMA-262, Edition 5, 15.4.4.14
// Reference: http://es5.github.io/#x15.4.4.14
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (searchElement, fromIndex) {
var k;
// 1. Let o be the result of calling ToObject passing
// the this value as the argument.
if (this == null) {
throw new TypeError("\"this\" is null or not defined");
}
var o = Object(this);
// 2. Let lenValue be the result of calling the Get
// internal method of o with the argument "length".
// 3. Let len be ToUint32(lenValue).
var len = o.length >>> 0;
// 4. If len is 0, return -1.
if (len === 0) {
return -1;
}
// 5. If argument fromIndex was passed let n be
// ToInteger(fromIndex); else let n be 0.
var n = fromIndex | 0;
// 6. If n >= len, return -1.
if (n >= len) {
return -1;
}
// 7. If n >= 0, then Let k be n.
// 8. Else, n<0, Let k be len - abs(n).
// If k is less than 0, then let k be 0.
k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);
// 9. Repeat, while k < len
while (k < len) {
// a. Let Pk be ToString(k).
// This is implicit for LHS operands of the in operator
// b. Let kPresent be the result of calling the
// HasProperty internal method of o with argument Pk.
// This step can be combined with c
// c. If kPresent is true, then
// i. Let elementK be the result of calling the Get
// internal method of o with the argument ToString(k).
// ii. Let same be the result of applying the
// Strict Equality Comparison Algorithm to
// searchElement and elementK.
// iii. If same is true, return k.
if (k in o && o[k] === searchElement) {
return k;
}
k++;
}
return -1;
};
}
if (!Array.prototype.lastIndexOf) {
Array.prototype.lastIndexOf = function (searchElement /* , fromIndex*/) {
"use strict";
if (this === void 0 || this === null) {
throw new TypeError();
}
var n, k,
t = Object(this),
len = t.length >>> 0;
if (len === 0) {
return -1;
}
n = len - 1;
if (arguments.length > 1) {
n = Number(arguments[1]);
if (n != n) {
n = 0;
} else if (n != 0 && n != (1 / 0) && n != -(1 / 0)) {
n = (n > 0 || -1) * Math.floor(Math.abs(n));
}
}
for (k = n >= 0
? Math.min(n, len - 1)
: len - Math.abs(n); k >= 0; k--) {
if (k in t && t[k] === searchElement) {
return k;
}
}
return -1;
};
}
/**
* 特殊情况
* Created by wang on 15/6/23.
*/
// 解决console未定义问题 guy
_global.console = _global.console || (function () {
var c = {};
c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile
= c.clear = c.exception = c.trace = c.assert = function () {
};
return c;
})();
/*
* 前端缓存
*/
_global.localStorage || (_global.localStorage = {
items: {},
setItem: function (k, v) {
BI.Cache.addCookie(k, v);
},
getItem: function (k) {
return BI.Cache.getCookie(k);
},
removeItem: function (k) {
BI.Cache.deleteCookie(k);
},
key: function () {
},
clear: function () {
this.items = {};
}
});
if (!Object.keys) {
Object.keys = function(o) {
if (o !== Object(o)) {
throw new TypeError('Object.keys called on a non-object');
}
// fix的问题
var falsy;
var skipArray = {
__ob__: falsy,
$accessors: falsy,
$vbthis: falsy,
$vbsetter: falsy
};
var k = [], p;
for (p in o) {
if (!(p in skipArray)) {
if (Object.prototype.hasOwnProperty.call(o, p)) {
k.push(p);
}
}
}
return k;
};
}
if (!Array.isArray) {
Array.isArray = function(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
};
}
/* core-jspolyfill
// https://stackoverflow.com/questions/10919915/ie8-getprototypeof-method
if (typeof Object.getPrototypeOf !== "function") {
Object.getPrototypeOf = "".__proto__ === String.prototype
? function (object) {
return object.__proto__;
}
: function (object) {
// May break if the constructor has been tampered with
return object.constructor.prototype;
};
}
*/
if(!Date.now) {
Date.now = function () {
return new Date().valueOf();
};
}if (typeof Set !== "undefined" && Set.toString().match(/native code/)) {
} else {
Set = function () {
this.set = {};
};
Set.prototype.has = function (key) {
return this.set[key] !== undefined;
};
Set.prototype.add = function (key) {
this.set[key] = 1;
};
Set.prototype.clear = function () {
this.set = {};
};
}// 修复ie9下sort方法的bug
// IE的sort 需要显示声明返回-1, 0, 1三种比较结果才可正常工作,而Chrome, Firefox中可以直接返回true, false等
// BI-36544 sort提供的参数就可以自定义返回值,不需要特别控制。这边使用冒泡相较于快排可能慢了点。
// 这边先将webkit的限制去掉
!function (window) {
var ua = window.navigator.userAgent.toLowerCase(),
reg = /msie/;
if (reg.test(ua)) {
var _sort = Array.prototype.sort;
Array.prototype.sort = function (fn) {
if (!!fn && typeof fn === "function") {
if (this.length < 2) {
return this;
}
var i = 0, j = i + 1, l = this.length, tmp, r = false, t = 0;
for (; i < l; i++) {
for (j = i + 1; j < l; j++) {
t = fn.call(this, this[i], this[j]);
r = (typeof t === "number" ? t :
t ? 1 : 0) > 0;
if (r === true) {
tmp = this[i];
this[i] = this[j];
this[j] = tmp;
}
}
}
return this;
}
return _sort.call(this);
};
}
}(window);
//# sourceMappingURL=polyfill.js.map

1
dist/polyfill.js.map vendored

File diff suppressed because one or more lines are too long

1649
dist/resource.css vendored

File diff suppressed because it is too large Load Diff

1
dist/resource.css.map vendored

File diff suppressed because one or more lines are too long

601
dist/router.js vendored

@ -1,601 +0,0 @@
(function () {
var Events = {
// Bind an event to a `callback` function. Passing `"all"` will bind
// the callback to all events fired.
on: function (name, callback, context) {
if (!eventsApi(this, "on", name, [callback, context]) || !callback) return this;
this._events || (this._events = {});
var events = this._events[name] || (this._events[name] = []);
events.push({callback: callback, context: context, ctx: context || this});
return this;
},
// Bind an event to only be triggered a single time. After the first time
// the callback is invoked, it will be removed.
once: function (name, callback, context) {
if (!eventsApi(this, "once", name, [callback, context]) || !callback) return this;
var self = this;
var once = _.once(function () {
self.off(name, once);
callback.apply(this, arguments);
});
once._callback = callback;
return this.on(name, once, context);
},
// Remove one or many callbacks. If `context` is null, removes all
// callbacks with that function. If `callback` is null, removes all
// callbacks for the event. If `name` is null, removes all bound
// callbacks for all events.
off: function (name, callback, context) {
if (!this._events || !eventsApi(this, "off", name, [callback, context])) return this;
// Remove all callbacks for all events.
if (!name && !callback && !context) {
this._events = void 0;
return this;
}
var names = name ? [name] : _.keys(this._events);
for (var i = 0, length = names.length; i < length; i++) {
name = names[i];
// Bail out if there are no events stored.
var events = this._events[name];
if (!events) continue;
// Remove all callbacks for this event.
if (!callback && !context) {
delete this._events[name];
continue;
}
// Find any remaining events.
var remaining = [];
for (var j = 0, k = events.length; j < k; j++) {
var event = events[j];
if (
callback && callback !== event.callback &&
callback !== event.callback._callback ||
context && context !== event.context
) {
remaining.push(event);
}
}
// Replace events if there are any remaining. Otherwise, clean up.
if (remaining.length) {
this._events[name] = remaining;
} else {
delete this._events[name];
}
}
return this;
},
un: function () {
this.off.apply(this, arguments);
},
// Trigger one or many events, firing all bound callbacks. Callbacks are
// passed the same arguments as `trigger` is, apart from the event name
// (unless you're listening on `"all"`, which will cause your callback to
// receive the true name of the event as the first argument).
trigger: function (name) {
if (!this._events) return this;
var args = slice.call(arguments, 1);
if (!eventsApi(this, "trigger", name, args)) return this;
var events = this._events[name];
var allEvents = this._events.all;
if (events) triggerEvents(events, args);
if (allEvents) triggerEvents(allEvents, arguments);
return this;
},
fireEvent: function () {
this.trigger.apply(this, arguments);
},
// Inversion-of-control versions of `on` and `once`. Tell *this* object to
// listen to an event in another object ... keeping track of what it's
// listening to.
listenTo: function (obj, name, callback) {
var listeningTo = this._listeningTo || (this._listeningTo = {});
var id = obj._listenId || (obj._listenId = _.uniqueId("l"));
listeningTo[id] = obj;
if (!callback && typeof name === "object") callback = this;
obj.on(name, callback, this);
return this;
},
listenToOnce: function (obj, name, callback) {
if (typeof name === "object") {
for (var event in name) this.listenToOnce(obj, event, name[event]);
return this;
}
if (eventSplitter.test(name)) {
var names = name.split(eventSplitter);
for (var i = 0, length = names.length; i < length; i++) {
this.listenToOnce(obj, names[i], callback);
}
return this;
}
if (!callback) return this;
var once = _.once(function () {
this.stopListening(obj, name, once);
callback.apply(this, arguments);
});
once._callback = callback;
return this.listenTo(obj, name, once);
},
// Tell this object to stop listening to either specific events ... or
// to every object it's currently listening to.
stopListening: function (obj, name, callback) {
var listeningTo = this._listeningTo;
if (!listeningTo) return this;
var remove = !name && !callback;
if (!callback && typeof name === "object") callback = this;
if (obj) (listeningTo = {})[obj._listenId] = obj;
for (var id in listeningTo) {
obj = listeningTo[id];
obj.off(name, callback, this);
if (remove || _.isEmpty(obj._events)) delete this._listeningTo[id];
}
return this;
}
};
// Regular expression used to split event strings.
var eventSplitter = /\s+/;
// Implement fancy features of the Events API such as multiple event
// names `"change blur"` and jQuery-style event maps `{change: action}`
// in terms of the existing API.
var eventsApi = function (obj, action, name, rest) {
if (!name) return true;
// Handle event maps.
if (typeof name === "object") {
for (var key in name) {
obj[action].apply(obj, [key, name[key]].concat(rest));
}
return false;
}
// Handle space separated event names.
if (eventSplitter.test(name)) {
var names = name.split(eventSplitter);
for (var i = 0, length = names.length; i < length; i++) {
obj[action].apply(obj, [names[i]].concat(rest));
}
return false;
}
return true;
};
// A difficult-to-believe, but optimized internal dispatch function for
// triggering events. Tries to keep the usual cases speedy (most internal
// BI events have 3 arguments).
var triggerEvents = function (events, args) {
var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
switch (args.length) {
case 0:
while (++i < l) (ev = events[i]).callback.call(ev.ctx);
return;
case 1:
while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1);
return;
case 2:
while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2);
return;
case 3:
while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3);
return;
default:
while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args);
return;
}
};
// BI.Router
// ---------------
// Routers map faux-URLs to actions, and fire events when routes are
// matched. Creating a new one sets its `routes` hash, if not set statically.
var Router = BI.Router = function (options) {
options || (options = {});
if (options.routes) this.routes = options.routes;
this._bindRoutes();
this._init.apply(this, arguments);
};
// Cached regular expressions for matching named param parts and splatted
// parts of route strings.
var optionalParam = /\((.*?)\)/g;
var namedParam = /(\(\?)?:\w+/g;
var splatParam = /\*\w+/g;
var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g;
// Set up all inheritable **BI.Router** properties and methods.
_.extend(Router.prototype, Events, {
// _init is an empty function by default. Override it with your own
// initialization logic.
_init: function () {
},
// Manually bind a single named route to a callback. For example:
//
// this.route('search/:query/p:num', 'search', function(query, num) {
// ...
// });
//
route: function (route, name, callback) {
if (!_.isRegExp(route)) route = this._routeToRegExp(route);
if (_.isFunction(name)) {
callback = name;
name = "";
}
if (!callback) callback = this[name];
var router = this;
BI.history.route(route, function (fragment) {
var args = router._extractParameters(route, fragment);
if (router.execute(callback, args, name) !== false) {
router.trigger.apply(router, ["route:" + name].concat(args));
router.trigger("route", name, args);
BI.history.trigger("route", router, name, args);
}
});
return this;
},
// Execute a route handler with the provided parameters. This is an
// excellent place to do pre-route setup or post-route cleanup.
execute: function (callback, args, name) {
if (callback) callback.apply(this, args);
},
// Simple proxy to `BI.history` to save a fragment into the history.
navigate: function (fragment, options) {
BI.history.navigate(fragment, options);
return this;
},
// Bind all defined routes to `BI.history`. We have to reverse the
// order of the routes here to support behavior where the most general
// routes can be defined at the bottom of the route map.
_bindRoutes: function () {
if (!this.routes) return;
this.routes = _.result(this, "routes");
var route, routes = _.keys(this.routes);
while ((route = routes.pop()) != null) {
this.route(route, this.routes[route]);
}
},
// Convert a route string into a regular expression, suitable for matching
// against the current location hash.
_routeToRegExp: function (route) {
route = route.replace(escapeRegExp, "\\$&")
.replace(optionalParam, "(?:$1)?")
.replace(namedParam, function (match, optional) {
return optional ? match : "([^/?]+)";
})
.replace(splatParam, "([^?]*?)");
return new RegExp("^" + route + "(?:\\?([\\s\\S]*))?$");
},
// Given a route, and a URL fragment that it matches, return the array of
// extracted decoded parameters. Empty or unmatched parameters will be
// treated as `null` to normalize cross-browser behavior.
_extractParameters: function (route, fragment) {
var params = route.exec(fragment).slice(1);
return _.map(params, function (param, i) {
// Don't decode the search params.
if (i === params.length - 1) return param || null;
return param ? decodeURIComponent(param) : null;
});
}
});
// History
// ----------------
// Handles cross-browser history management, based on either
// [pushState](http://diveintohtml5.info/history.html) and real URLs, or
// [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)
// and URL fragments. If the browser supports neither (old IE, natch),
// falls back to polling.
var History = function () {
this.handlers = [];
this.checkUrl = _.bind(this.checkUrl, this);
// Ensure that `History` can be used outside of the browser.
if (typeof window !== "undefined") {
this.location = _global.location;
this.history = _global.history;
}
};
// Cached regex for stripping a leading hash/slash and trailing space.
var routeStripper = /^[#\/]|\s+$/g;
// Cached regex for stripping leading and trailing slashes.
var rootStripper = /^\/+|\/+$/g;
// Cached regex for stripping urls of hash.
var pathStripper = /#.*$/;
// Has the history handling already been started?
History.started = false;
// Set up all inheritable **BI.History** properties and methods.
_.extend(History.prototype, Events, {
// The default interval to poll for hash changes, if necessary, is
// twenty times a second.
interval: 50,
// Are we at the app root?
atRoot: function () {
var path = this.location.pathname.replace(/[^\/]$/, "$&/");
return path === this.root && !this.getSearch();
},
// In IE6, the hash fragment and search params are incorrect if the
// fragment contains `?`.
getSearch: function () {
var match = this.location.href.replace(/#.*/, "").match(/\?.+/);
return match ? match[0] : "";
},
// Gets the true hash value. Cannot use location.hash directly due to bug
// in Firefox where location.hash will always be decoded.
getHash: function (window) {
var match = (window || this).location.href.match(/#(.*)$/);
return match ? match[1] : "";
},
// Get the pathname and search params, without the root.
getPath: function () {
var path = decodeURI(this.location.pathname + this.getSearch());
var root = this.root.slice(0, -1);
if (!path.indexOf(root)) path = path.slice(root.length);
return path.charAt(0) === "/" ? path.slice(1) : path;
},
// Get the cross-browser normalized URL fragment from the path or hash.
getFragment: function (fragment) {
if (fragment == null) {
if (this._hasPushState || !this._wantsHashChange) {
fragment = this.getPath();
} else {
fragment = this.getHash();
}
}
return fragment.replace(routeStripper, "");
},
// Start the hash change handling, returning `true` if the current URL matches
// an existing route, and `false` otherwise.
start: function (options) {
if (History.started) throw new Error("BI.history has already been started");
History.started = true;
// Figure out the initial configuration. Do we need an iframe?
// Is pushState desired ... is it available?
this.options = _.extend({root: "/"}, this.options, options);
this.root = this.options.root;
this._wantsHashChange = this.options.hashChange !== false;
this._hasHashChange = "onhashchange" in window;
this._wantsPushState = !!this.options.pushState;
this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState);
this.fragment = this.getFragment();
// Normalize root to always include a leading and trailing slash.
this.root = ("/" + this.root + "/").replace(rootStripper, "/");
// Transition from hashChange to pushState or vice versa if both are
// requested.
if (this._wantsHashChange && this._wantsPushState) {
// If we've started off with a route from a `pushState`-enabled
// browser, but we're currently in a browser that doesn't support it...
if (!this._hasPushState && !this.atRoot()) {
var root = this.root.slice(0, -1) || "/";
this.location.replace(root + "#" + this.getPath());
// Return immediately as browser will do redirect to new url
return true;
// Or if we've started out with a hash-based route, but we're currently
// in a browser where it could be `pushState`-based instead...
} else if (this._hasPushState && this.atRoot()) {
this.navigate(this.getHash(), {replace: true});
}
}
// Proxy an iframe to handle location events if the browser doesn't
// support the `hashchange` event, HTML5 history, or the user wants
// `hashChange` but not `pushState`.
if (!this._hasHashChange && this._wantsHashChange && (!this._wantsPushState || !this._hasPushState)) {
var iframe = document.createElement("iframe");
iframe.src = "javascript:0";
iframe.style.display = "none";
iframe.tabIndex = -1;
var body = document.body;
// Using `appendChild` will throw on IE < 9 if the document is not ready.
this.iframe = body.insertBefore(iframe, body.firstChild).contentWindow;
this.iframe.document.open().close();
this.iframe.location.hash = "#" + this.fragment;
}
// Add a cross-platform `addEventListener` shim for older browsers.
var addEventListener = _global.addEventListener || function (eventName, listener) {
return attachEvent("on" + eventName, listener);
};
// Depending on whether we're using pushState or hashes, and whether
// 'onhashchange' is supported, determine how we check the URL state.
if (this._hasPushState) {
addEventListener("popstate", this.checkUrl, false);
} else if (this._wantsHashChange && this._hasHashChange && !this.iframe) {
addEventListener("hashchange", this.checkUrl, false);
} else if (this._wantsHashChange) {
this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
}
if (!this.options.silent) return this.loadUrl();
},
// Disable BI.history, perhaps temporarily. Not useful in a real app,
// but possibly useful for unit testing Routers.
stop: function () {
// Add a cross-platform `removeEventListener` shim for older browsers.
var removeEventListener = _global.removeEventListener || function (eventName, listener) {
return detachEvent("on" + eventName, listener);
};
// Remove window listeners.
if (this._hasPushState) {
removeEventListener("popstate", this.checkUrl, false);
} else if (this._wantsHashChange && this._hasHashChange && !this.iframe) {
removeEventListener("hashchange", this.checkUrl, false);
}
// Clean up the iframe if necessary.
if (this.iframe) {
document.body.removeChild(this.iframe.frameElement);
this.iframe = null;
}
// Some environments will throw when clearing an undefined interval.
if (this._checkUrlInterval) clearInterval(this._checkUrlInterval);
History.started = false;
},
// Add a route to be tested when the fragment changes. Routes added later
// may override previous routes.
route: function (route, callback) {
this.handlers.unshift({route: route, callback: callback});
},
// remove a route match in routes
unRoute: function (route) {
var index = _.findIndex(this.handlers, function (handler) {
return handler.route.test(route);
});
if (index > -1) {
this.handlers.splice(index, 1);
}
},
// Checks the current URL to see if it has changed, and if it has,
// calls `loadUrl`, normalizing across the hidden iframe.
checkUrl: function (e) {
var current = this.getFragment();
try {
// getFragment 得到的值是编码过的,而this.fragment是没有编码过的
// 英文路径没有问题,遇上中文和空格有问题了
current = decodeURIComponent(current);
} catch(e) {
}
// If the user pressed the back button, the iframe's hash will have
// changed and we should use that for comparison.
if (current === this.fragment && this.iframe) {
current = this.getHash(this.iframe);
}
if (current === this.fragment) return false;
if (this.iframe) this.navigate(current);
this.loadUrl();
},
// Attempt to load the current URL fragment. If a route succeeds with a
// match, returns `true`. If no defined routes matches the fragment,
// returns `false`.
loadUrl: function (fragment) {
fragment = this.fragment = this.getFragment(fragment);
return _.some(this.handlers, function (handler) {
if (handler.route.test(fragment)) {
handler.callback(fragment);
return true;
}
});
},
// Save a fragment into the hash history, or replace the URL state if the
// 'replace' option is passed. You are responsible for properly URL-encoding
// the fragment in advance.
//
// The options object can contain `trigger: true` if you wish to have the
// route callback be fired (not usually desirable), or `replace: true`, if
// you wish to modify the current URL without adding an entry to the history.
navigate: function (fragment, options) {
if (!History.started) return false;
if (!options || options === true) options = {trigger: !!options};
// Normalize the fragment.
fragment = this.getFragment(fragment || "");
// Don't include a trailing slash on the root.
var root = this.root;
if (fragment === "" || fragment.charAt(0) === "?") {
root = root.slice(0, -1) || "/";
}
var url = root + fragment;
// Strip the hash and decode for matching.
fragment = decodeURI(fragment.replace(pathStripper, ""));
if (this.fragment === fragment) return;
this.fragment = fragment;
// If pushState is available, we use it to set the fragment as a real URL.
if (this._hasPushState) {
this.history[options.replace ? "replaceState" : "pushState"]({}, document.title, url);
// If hash changes haven't been explicitly disabled, update the hash
// fragment to store history.
} else if (this._wantsHashChange) {
this._updateHash(this.location, fragment, options.replace);
if (this.iframe && (fragment !== this.getHash(this.iframe))) {
// Opening and closing the iframe tricks IE7 and earlier to push a
// history entry on hash-tag change. When replace is true, we don't
// want this.
if (!options.replace) this.iframe.document.open().close();
this._updateHash(this.iframe.location, fragment, options.replace);
}
// If you've told us that you explicitly don't want fallback hashchange-
// based history, then `navigate` becomes a page refresh.
} else {
return this.location.assign(url);
}
if (options.trigger) return this.loadUrl(fragment);
},
// Update the hash location, either replacing the current entry, or adding
// a new one to the browser history.
_updateHash: function (location, fragment, replace) {
if (replace) {
var href = location.href.replace(/(javascript:|#).*$/, "");
location.replace(href + "#" + fragment);
} else {
// Some browsers require that `hash` contains a leading #.
location.hash = "#" + fragment;
}
}
});
// Create the default BI.history.
BI.history = new History;
}());
//# sourceMappingURL=router.js.map

1
dist/router.js.map vendored

File diff suppressed because one or more lines are too long

25123
dist/utils.js vendored

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save