Compare commits

..

No commits in common. 'master' and 'es6' have entirely different histories.
master ... es6

  1. 14
      README
  2. 142
      examples/watch-order.html
  3. 14
      package.json
  4. BIN
      packages/fineui/dist/font/iconfont.eot
  5. 498
      packages/fineui/dist/font/iconfont.svg
  6. BIN
      packages/fineui/dist/font/iconfont.ttf
  7. BIN
      packages/fineui/dist/font/iconfont.woff
  8. BIN
      packages/fineui/dist/font/iconfont.woff2
  9. 20
      packages/fineui/lessconfig/bi.lessconfig.json
  10. 0
      packages/fineui/lessconfig/jsy.lessconfig.json
  11. 7
      packages/fineui/package.json
  12. 16
      packages/fineui/src/base/1.pane.js
  13. 6
      packages/fineui/src/base/collection/collection.js
  14. 14
      packages/fineui/src/base/combination/bubble.js
  15. 4
      packages/fineui/src/base/combination/expander.js
  16. 4
      packages/fineui/src/base/combination/group.button.js
  17. 6
      packages/fineui/src/base/combination/group.virtual.js
  18. 8
      packages/fineui/src/base/combination/loader.js
  19. 2
      packages/fineui/src/base/combination/navigation.js
  20. 17
      packages/fineui/src/base/combination/searcher.js
  21. 7
      packages/fineui/src/base/combination/switcher.js
  22. 6
      packages/fineui/src/base/combination/tab.js
  23. 487
      packages/fineui/src/base/foundation/message.js
  24. 1
      packages/fineui/src/base/index.js
  25. 122
      packages/fineui/src/base/layer/layer.popover.js
  26. 5
      packages/fineui/src/base/list/listview.js
  27. 36
      packages/fineui/src/base/list/virtualgrouplist.js
  28. 2
      packages/fineui/src/base/single/0.single.js
  29. 3
      packages/fineui/src/base/single/button/button.basic.js
  30. 1
      packages/fineui/src/base/single/button/listitem/icontextitem.js
  31. 2
      packages/fineui/src/base/single/editor/editor.textarea.js
  32. 2
      packages/fineui/src/base/single/input/checkbox/checkbox.js
  33. 11
      packages/fineui/src/base/single/input/file.js
  34. 4
      packages/fineui/src/base/single/input/input.js
  35. 2
      packages/fineui/src/base/single/input/radio/radio.image.js
  36. 2
      packages/fineui/src/base/single/input/radio/radio.js
  37. 11
      packages/fineui/src/base/tree/customtree.js
  38. 7
      packages/fineui/src/bundle.js
  39. 2
      packages/fineui/src/case/button/item.multiselect.js
  40. 26
      packages/fineui/src/case/button/switch.js
  41. 3
      packages/fineui/src/case/button/treeitem/item.icon.treeleaf.js
  42. 100
      packages/fineui/src/case/button/treeitem/item.multilayer.icon.treeleaf.js
  43. 8
      packages/fineui/src/case/button/treeitem/treeitem.js
  44. 3
      packages/fineui/src/case/colorchooser/colorchooser.js
  45. 18
      packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js
  46. 3
      packages/fineui/src/case/colorchooser/colorchooser.trigger.long.js
  47. 49
      packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.hex.js
  48. 6
      packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js
  49. 1
      packages/fineui/src/case/combo/bubblecombo/combo.bubble.js
  50. 16
      packages/fineui/src/case/combo/bubblecombo/popup.bubble.js
  51. 5
      packages/fineui/src/case/combo/textvaluecombo/combo.textvalue.js
  52. 8
      packages/fineui/src/case/list/list.select.js
  53. 53
      packages/fineui/src/case/pager/pager.direction.js
  54. 43
      packages/fineui/src/case/ztree/asynctree.js
  55. 4
      packages/fineui/src/case/ztree/list/listasynctree.js
  56. 4
      packages/fineui/src/case/ztree/list/listparttree.js
  57. 2
      packages/fineui/src/case/ztree/list/listtreeview.js
  58. 15
      packages/fineui/src/case/ztree/parttree.js
  59. 4
      packages/fineui/src/case/ztree/tree.list.display.js
  60. 2
      packages/fineui/src/component/form/form.field.js
  61. 34
      packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.js
  62. 25
      packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.list.js
  63. 11
      packages/fineui/src/component/treevaluechooser/pane.treevaluechooser.js
  64. 33
      packages/fineui/src/core/1.lodash.js
  65. 23
      packages/fineui/src/core/2.base.js
  66. 2
      packages/fineui/src/core/3.ob.js
  67. 33
      packages/fineui/src/core/4.widget.js
  68. 11
      packages/fineui/src/core/5.inject.js
  69. 126
      packages/fineui/src/core/constant/writable.var.js
  70. 17
      packages/fineui/src/core/controller/controller.layer.js
  71. 2
      packages/fineui/src/core/controller/controller.masker.js
  72. 17
      packages/fineui/src/core/controller/controller.popover.js
  73. 130
      packages/fineui/src/core/element/element.js
  74. 11
      packages/fineui/src/core/func/alias.js
  75. 2
      packages/fineui/src/core/func/date.js
  76. 2
      packages/fineui/src/core/loader/loader.style.js
  77. 47
      packages/fineui/src/core/platform/web/config.js
  78. 4
      packages/fineui/src/core/platform/web/detectElementResize.js
  79. 96
      packages/fineui/src/core/platform/web/jquery/jquery.polyfill.js
  80. 19
      packages/fineui/src/core/platform/web/load.js
  81. 2
      packages/fineui/src/core/structure/cache.js
  82. 2
      packages/fineui/src/core/utils/color.js
  83. 37
      packages/fineui/src/core/utils/dom.js
  84. 6
      packages/fineui/src/core/utils/index.js
  85. 2
      packages/fineui/src/core/wrapper/layout/flex/flex.horizontal.js
  86. 7
      packages/fineui/src/core/wrapper/layout/layout.card.js
  87. 2
      packages/fineui/src/core/wrapper/layout/layout.table.js
  88. 50
      packages/fineui/src/fix/fix.compact.js
  89. 791
      packages/fineui/src/fix/fix.js
  90. 2
      packages/fineui/src/index.js
  91. 8
      packages/fineui/src/less/base/colorchooser/colorpicker/button.colorshow.less
  92. 128
      packages/fineui/src/less/base/single/button/button.less
  93. 2
      packages/fineui/src/less/base/single/button/switch.less
  94. 3
      packages/fineui/src/less/base/single/input/radio.less
  95. 4
      packages/fineui/src/less/base/tree/ztree.less
  96. 87
      packages/fineui/src/less/core/utils/common.less
  97. 25
      packages/fineui/src/less/core/utils/list-item.less
  98. 5
      packages/fineui/src/less/lib/colors.less
  99. 2
      packages/fineui/src/less/lib/constant.less
  100. 5
      packages/fineui/src/less/lib/font.less
  101. Some files were not shown because too many files have changed in this diff Show More

14
README

@ -13,24 +13,14 @@ http://fanruan.design/doc.html?post=0169cf558d
## 开发 ## 开发
`pnpm run dev` pnpm run dev
* demo: [http://localhost:3000/](http://localhost:3000/) * demo: [http://localhost:3000/](http://localhost:3000/)
* fineui: [http://localhost:9001/fineui.js](http://localhost:9001/fineui.js) * fineui: [http://localhost:9001/fineui.js](http://localhost:9001/fineui.js)
## 构建 ## 构建
`pnpm run build` pnpm run build
## 自定义less变量构建
```
cross-env LESS_CONFIG_PATH=your_less_config.json && pnpm build
```
## 构建自定义的css
```
cross-env LESS_CONFIG_PATH=your_less_config.json LESS_FILE_NAME=your_file_name pnpm --filter @fui/core webpack:css
```
## 发布 ## 发布

142
examples/watch-order.html

@ -1,142 +0,0 @@
<html>
<head>
<meta charset="utf-8">
<title></title>
<!-- <link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.min.css"/>
<script src="../dist/2.0/fineui.js"></script> -->
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css"/>
<script src="http://localhost:9001/fineui.js"></script>
</head>
<body>
<div id="wrapper"></div>
<script>
var ParentModel = BI.inherit(BI.Model, {
state: function () {
return {
widget: {
name: "触发arr和dims变化",
arr: [],
dims: [],
}
};
},
watch: {
'widget.**': function () {
console.log(Math.random().toFixed(3) + ': widget.** changed');
}
},
childContext: ["widget"],
});
BI.model("demo.model.parent", ParentModel);
var Parent = BI.inherit(BI.Widget, {
_store: function () {
return BI.Models.getModel('demo.model.parent');
},
render: function () {
return {
type: "bi.vertical",
bgap: 10,
items: [{
type: 'bi.label',
text: '父组件watch widget.**, 子组件watch了widget.arr, 修改widget中arr和dims的先后顺序不一样,会导致watch顺序不一样。'
}, {
type: 'bi.label',
text: '不应该在修改属性,watch到修改后,还修改配置,或者使用同步watch把配置修改全'
}, {
type: 'demo.child'
}],
text: function () {
return this.model.name;
}
};
}
});
BI.shortcut("demo.parent", Parent);
var ChildModel = BI.inherit(BI.Model, {
context: ["widget"],
watch: {
arr: {
handler: function () {
console.log(Math.random().toFixed(3) + ': arr changed');
},
sync: false // 改成true 同步watch 修改也行
}
},
computed: {
arr: function () {
return this.model.widget.arr;
},
dims: function () {
return this.model.widget.dims;
}
},
actions: {
addArrFirst: function () {
// 修改arr在前,先触发arr的watch 再触发widget.**的监听
this.model.widget.arr.push(BI.UUID());
this.model.widget.dims.push(BI.UUID());
},
addDimFirst: function () {
// 修改dim在前先执行 widget.** 再出发arr的watch
this.model.widget.dims.push(BI.UUID());
this.model.widget.arr.push(BI.UUID());
}
}
});
BI.model("demo.model.child", ChildModel);
var Child = BI.inherit(BI.Widget, {
_store: function () {
return BI.Models.getModel('demo.model.child');
},
render: function () {
var self = this;
return {
type: 'bi.left',
rgap: 20,
items: [{
type: "bi.button",
text: '先修改widget.arr',
handler: function () {
self.store.addArrFirst();
}
}, {
type: "bi.button",
text: '先修改widget.dims',
handler: function () {
self.store.addDimFirst();
}
}]
};
}
});
BI.shortcut("demo.child", Child);
BI.createWidget({
type: "bi.absolute",
items: [{
el: {
type: "demo.parent"
},
top: 100,
left: 100
}],
element: "#wrapper"
});
</script>
</body>
</html>

14
package.json

@ -15,25 +15,20 @@
"dev:demo": "pnpm --dir packages/demo dev", "dev:demo": "pnpm --dir packages/demo dev",
"dev:fineui": "pnpm --dir packages/fineui dev", "dev:fineui": "pnpm --dir packages/fineui dev",
"build": "pnpm --dir packages/fineui build", "build": "pnpm --dir packages/fineui build",
"build:demo": "pnpm --dir packages/demo build", "build:demo": "pnpm --dir packages/demo build"
"tsc": "pnpm --dir packages/fineui tsc"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.21.0", "@babel/cli": "^7.21.0",
"@babel/core": "^7.21.0", "@babel/core": "^7.21.0",
"@babel/runtime": "^7.21.0", "@babel/runtime": "^7.21.0",
"@fui/babel-preset-fineui": "^3.0.1", "@fui/babel-preset-fineui": "^3.0.1",
"@fui/eslint-plugin": "^1.1.0",
"@types/node": "^18.15.11", "@types/node": "^18.15.11",
"@typescript-eslint/eslint-plugin": "^5.60.0",
"@typescript-eslint/parser": "^5.60.0",
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.14",
"babel-loader": "^9.1.2", "babel-loader": "^9.1.2",
"babel-plugin-module-resolver": "^5.0.0", "babel-plugin-module-resolver": "^5.0.0",
"circular-dependency-plugin": "^5.2.2", "circular-dependency-plugin": "^5.2.2",
"css-loader": "^6.7.3", "css-loader": "^6.7.3",
"css-minimizer-webpack-plugin": "^5.0.0", "css-minimizer-webpack-plugin": "^5.0.0",
"eslint": "^8.43.0",
"fork-ts-checker-webpack-plugin": "^8.0.0", "fork-ts-checker-webpack-plugin": "^8.0.0",
"glob": "^9.3.4", "glob": "^9.3.4",
"html-webpack-plugin": "^5.5.0", "html-webpack-plugin": "^5.5.0",
@ -43,15 +38,14 @@
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"postcss": "^8.4.21", "postcss": "^8.4.21",
"postcss-loader": "^7.1.0", "postcss-loader": "^7.1.0",
"prettier": "^3.0.0",
"style-loader": "^3.3.1", "style-loader": "^3.3.1",
"terser-webpack-plugin": "^5.3.7", "terser-webpack-plugin": "^5.3.7",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typescript": "^4.9.5", "typescript": "^4.9.5",
"webpack": "^5.75.0", "webpack": "^5.75.0",
"webpack-bundle-analyzer": "^4.8.0", "webpack-bundle-analyzer": "^4.8.0",
"webpack-cli": "^5.1.4", "webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.15.1", "webpack-dev-server": "^4.11.1",
"webpack-merge": "^5.9.0" "webpack-merge": "^5.8.0"
} }
} }

BIN
packages/fineui/dist/font/iconfont.eot vendored

Binary file not shown.

498
packages/fineui/dist/font/iconfont.svg vendored

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 898 KiB

BIN
packages/fineui/dist/font/iconfont.ttf vendored

Binary file not shown.

BIN
packages/fineui/dist/font/iconfont.woff vendored

Binary file not shown.

BIN
packages/fineui/dist/font/iconfont.woff2 vendored

Binary file not shown.

20
packages/fineui/bi.lessconfig.json → packages/fineui/lessconfig/bi.lessconfig.json

@ -23,12 +23,12 @@
"@color-bi-border-disabled-radio": "rgba(9, 30, 64, 0.19)", "@color-bi-border-disabled-radio": "rgba(9, 30, 64, 0.19)",
"@color-bi-background-active-radio-content": "#2C60DB", "@color-bi-background-active-radio-content": "#2C60DB",
"@color-bi-border-checkbox-theme-dark": "rgba(255, 255, 255, 0.37)", "@color-bi-border-checkbox-theme-dark": "rgba(255, 255, 255, 0.37)",
"@color-bi-border-hover-active-radio-theme-dark": "#497FFD", "@color-bi-border-hover-active-radio-theme-dark": "#3869DC",
"@color-bi-background-active-radio-content-theme-dark": "#497FFD", "@color-bi-background-active-radio-content-theme-dark": "#3869DC",
"@color-bi-background-disabled-active-radio-content": "#FFFFFF", "@color-bi-background-disabled-active-radio-content": "#FFFFFF",
"@color-bi-background-disabled-active-radio-content-theme-dark": "#606479", "@color-bi-background-disabled-active-radio-content-theme-dark": "#606479",
"@color-bi-background-disabled-active-checkbox-content": "#FFFFFF", "@color-bi-background-disabled-active-checkbox-content": "#FFFFFF",
"@color-bi-background-disabled-active-checkbox-content-theme-dark": "rgba(255, 255, 255, 0.24)", "@color-bi-background-disabled-active-checkbox-content-theme-dark": "#606479",
"@color-bi-background-tooltip-success": "#3F506A", "@color-bi-background-tooltip-success": "#3F506A",
"@color-bi-background-tooltip-failure": "#E65251", "@color-bi-background-tooltip-failure": "#E65251",
"@color-bi-border-tooltip-success": "#2E3A4D", "@color-bi-border-tooltip-success": "#2E3A4D",
@ -48,17 +48,5 @@
"@font-solid-bottom": "e905", "@font-solid-bottom": "e905",
"@font-solid-right": "e906", "@font-solid-right": "e906",
"@font-dot": "e762", "@font-dot": "e762",
"@font-down-triangle": "e70b", "@font-down-triangle": "e70b"
"@color-bi-background-theme-dark": "#1B1F31",
"@border-color-light-line-theme-dark": "#30364B",
"@color-bi-background-header-background": "#F8F9FC",
"@color-bi-background-header-background-theme-dark": "#1B1F31",
"@color-bi-background-common-light-button": "#E5EFFF",
"@color-bi-background-common-light-button-theme-dark": "#0F2A62",
"@color-bi-text-highlight-theme-dark": "#497FFD",
"@color-bi-border-active-chooser-show-button-theme-dark": "#497FFD",
"@color-bi-background-button-theme-dark": "#497FFD",
"@color-bi-background-active-switch-theme-dark": "#497FFD",
"@color-bi-text-common-light-button-theme-dark": "#497FFD",
"@color-bi-text-common-light-button": "#2c60db"
} }

0
packages/fineui/jsy.lessconfig.json → packages/fineui/lessconfig/jsy.lessconfig.json

7
packages/fineui/package.json

@ -1,6 +1,6 @@
{ {
"name": "@fui/core", "name": "@fui/core",
"version": "3.0.20231204103846", "version": "3.0.20230518150312",
"description": "fineui", "description": "fineui",
"main": "dist/fineui.min.js", "main": "dist/fineui.min.js",
"module": "dist/lib/index.js", "module": "dist/lib/index.js",
@ -23,14 +23,11 @@
"dev:fineui": "webpack-dev-server --progress --config=webpack/webpack.dev.js", "dev:fineui": "webpack-dev-server --progress --config=webpack/webpack.dev.js",
"build": "tsc && run-p build:*", "build": "tsc && run-p build:*",
"build:es": "babel src -d dist/lib --config-file ./esm.babel.js", "build:es": "babel src -d dist/lib --config-file ./esm.babel.js",
"webpack:css": "webpack --progress --config=webpack/webpack.css.js --mode production",
"build:fineui": "webpack --progress --config=webpack/webpack.prod.js", "build:fineui": "webpack --progress --config=webpack/webpack.prod.js",
"prepublishToPrivate": "npm run build && node ./lib/prepublish.js", "prepublishToPrivate": "npm run build && node ./lib/prepublish.js",
"publishToPrivate": "npm publish", "publishToPrivate": "npm publish",
"tsc": "tsc", "tsc": "tsc",
"link": "pnpm link --global", "link": "pnpm link --global"
"build:biCss": "cross-env LESS_CONFIG_PATH=bi.lessconfig.json LESS_FILE_NAME=bi npm run webpack:css",
"build:jsyCss": "cross-env LESS_CONFIG_PATH=jsy.lessconfig.json LESS_FILE_NAME=jsy npm run webpack:css"
}, },
"files": [ "files": [
"dist", "dist",

16
packages/fineui/src/base/1.pane.js

@ -111,11 +111,11 @@ export class Pane extends Widget {
} }
]; ];
isNotEmptyString(o.loadingText) && isNotEmptyString(o.loadingText) &&
loadingTipItems.push({ loadingTipItems.push({
type: Text.xtype, type: Text.xtype,
text: o.loadingText, text: o.loadingText,
tgap: this._getSize(10), tgap: this._getSize(10),
}); });
return [ return [
{ {
@ -158,10 +158,4 @@ export class Pane extends Widget {
this.options.items = items || []; this.options.items = items || [];
this.check(); this.check();
} }
destroyed() {
super.destroyed?.();
Layers.remove(`${this.getName()}-loading`);
this._loading?.destroy();
}
} }

6
packages/fineui/src/base/collection/collection.js

@ -125,12 +125,6 @@ export class CollectionView extends Widget {
} }
} }
destroyed() {
each(this.renderedCells, (i, cell) => {
cell.el._destroy();
});
}
_calculateSizeAndPositionData() { _calculateSizeAndPositionData() {
const { items, cellSizeAndPositionGetter } = this.options; const { items, cellSizeAndPositionGetter } = this.options;
const cellMetadata = []; const cellMetadata = [];

14
packages/fineui/src/base/combination/bubble.js

@ -72,7 +72,6 @@ export class Bubble extends Widget {
popup: {}, popup: {},
comboClass: "bi-combo-popup", comboClass: "bi-combo-popup",
hoverClass: "bi-combo-hover", hoverClass: "bi-combo-hover",
extraModifiers: []
}); });
} }
@ -411,16 +410,7 @@ export class Bubble extends Widget {
} }
_popupView(e) { _popupView(e) {
const { const { adjustXOffset, showArrow, adjustYOffset, adjustLength, placement, hideWhenClickOutside, hideWhenBlur } =
adjustXOffset,
showArrow,
adjustYOffset,
adjustLength,
placement,
hideWhenClickOutside,
hideWhenBlur,
extraModifiers
} =
this.options; this.options;
this._assertPopupViewRender(); this._assertPopupViewRender();
this.fireEvent(Bubble.EVENT_BEFORE_POPUPVIEW); this.fireEvent(Bubble.EVENT_BEFORE_POPUPVIEW);
@ -439,7 +429,6 @@ export class Bubble extends Widget {
offset: () => [adjustXOffset, (showArrow ? 12 : 0) + (adjustYOffset + adjustLength)], offset: () => [adjustXOffset, (showArrow ? 12 : 0) + (adjustYOffset + adjustLength)],
}, },
}, },
...extraModifiers
]; ];
if (this.options.showArrow) { if (this.options.showArrow) {
modifiers.push({ modifiers.push({
@ -531,7 +520,6 @@ export class Bubble extends Widget {
this.combo.setValue(v); this.combo.setValue(v);
if (isNull(this.popupView)) { if (isNull(this.popupView)) {
this.options.popup.value = v; this.options.popup.value = v;
!isNull(this.options.popup.el) && (this.options.popup.el.value = v);
} else { } else {
this.popupView.setValue(v); this.popupView.setValue(v);
} }

4
packages/fineui/src/base/combination/expander.js

@ -276,7 +276,7 @@ export class Expander extends Widget {
} }
_setEnable(arg) { _setEnable(arg) {
super._setEnable(...arguments); super._setEnable(arguments);
!arg && this.element.removeClass(this.options.hoverClass); !arg && this.element.removeClass(this.options.hoverClass);
!arg && this.isViewVisible() && this._hideView(); !arg && this.isViewVisible() && this._hideView();
} }
@ -341,6 +341,6 @@ export class Expander extends Widget {
} }
destroy() { destroy() {
super.destroy(...arguments); super.destroy(arguments);
} }
} }

4
packages/fineui/src/base/combination/group.button.js

@ -418,12 +418,12 @@ export class ButtonGroup extends Widget {
} }
empty() { empty() {
super.empty(...arguments); super.empty(arguments);
this.options.items = []; this.options.items = [];
} }
destroy() { destroy() {
super.destroy(...arguments); super.destroy(arguments);
this.options.items = []; this.options.items = [];
} }
} }

6
packages/fineui/src/base/combination/group.virtual.js

@ -56,7 +56,7 @@ export class VirtualGroup extends Widget {
_packageBtns(items) { _packageBtns(items) {
const o = this.options; const o = this.options;
const btMap = (this.buttonMap = {}); const map = (this.buttonMap = {});
const layouts = isArray(o.layouts) ? o.layouts : [o.layouts]; const layouts = isArray(o.layouts) ? o.layouts : [o.layouts];
for (let i = layouts.length - 1; i > 0; i--) { for (let i = layouts.length - 1; i > 0; i--) {
items = map(items, (k, it) => { items = map(items, (k, it) => {
@ -68,8 +68,8 @@ export class VirtualGroup extends Widget {
el: extend( el: extend(
{ {
ref: _ref => { ref: _ref => {
if (isKey(el.value)) { if (isKey(map[el.value])) {
btMap[el.value] = _ref; map[el.value] = _ref;
} }
}, },
}, },

8
packages/fineui/src/base/combination/loader.js

@ -181,7 +181,7 @@ export class Loader extends Widget {
isEmpty(optionsItems) && isEmpty(optionsItems) &&
nextTick( nextTick(
bind(() => { bind(() => {
isDefaultInit && isEmpty(this.options.items) && this._populate(); isDefaultInit && isEmpty(optionsItems) && this._populate();
}, this) }, this)
); );
const items = isFunction(optionsItems) const items = isFunction(optionsItems)
@ -204,7 +204,7 @@ export class Loader extends Widget {
{ {
times: this.times, times: this.times,
count: this.count, count: this.count,
}, this.options }
]); ]);
} }
@ -218,7 +218,7 @@ export class Loader extends Widget {
{ {
times: this.times, times: this.times,
count: this.count, count: this.count,
}, this.options }
]); ]);
} }
@ -342,6 +342,6 @@ export class Loader extends Widget {
} }
destroy() { destroy() {
super.destroy(...arguments); super.destroy(arguments);
} }
} }

2
packages/fineui/src/base/combination/navigation.js

@ -191,6 +191,6 @@ export class Navigation extends Widget {
} }
destroy() { destroy() {
super.destroy(...arguments); super.destroy(arguments);
} }
} }

17
packages/fineui/src/base/combination/searcher.js

@ -17,8 +17,7 @@ import {
BlankSplitChar, BlankSplitChar,
Events, Events,
EVENT_RESPONSE_TIME, EVENT_RESPONSE_TIME,
Func, Func
isFunction,
} from "@/core"; } from "@/core";
import { ButtonGroup } from "./group.button"; import { ButtonGroup } from "./group.button";
import { Maskers } from "@/base/0.base"; import { Maskers } from "@/base/0.base";
@ -128,13 +127,12 @@ export class Searcher extends Widget {
} }
_assertPopupView() { _assertPopupView() {
const { masker, popup, chooseType, isAutoSync } = this.options; const { masker, popup, chooseType, isAutoSync, adapter } = this.options;
const adapter = isFunction(this.options.adapter) ? this.options.adapter() : this.options.adapter;
if ((masker && !Maskers.has(this.getName())) || (masker === false && !this.popupView)) { if ((masker && !Maskers.has(this.getName())) || (masker === false && !this.popupView)) {
this.popupView = createWidget(popup, { this.popupView = createWidget(popup, {
type: SearcherView.xtype, type: SearcherView.xtype,
chooseType, chooseType,
}, this); });
this.popupView.on(Controller.EVENT_CHANGE, (type, value, obj, ...args) => { this.popupView.on(Controller.EVENT_CHANGE, (type, value, obj, ...args) => {
this.fireEvent(Controller.EVENT_CHANGE, type, value, obj, ...args); this.fireEvent(Controller.EVENT_CHANGE, type, value, obj, ...args);
if (type === Events.CLICK) { if (type === Events.CLICK) {
@ -215,8 +213,7 @@ export class Searcher extends Widget {
} }
_search() { _search() {
const { isAutoSearch, isAutoSync, onSearch } = this.options; const { isAutoSearch, adapter, isAutoSync, onSearch } = this.options;
const adapter = isFunction(this.options.adapter) ? this.options.adapter() : this.options.adapter;
const keyword = this.editor.getValue(); const keyword = this.editor.getValue();
if (keyword === "" || this._stop) { if (keyword === "" || this._stop) {
return; return;
@ -336,8 +333,7 @@ export class Searcher extends Widget {
} }
getValue() { getValue() {
const { isAutoSync, popup } = this.options; const { isAutoSync, adapter, popup } = this.options;
const adapter = isFunction(this.options.adapter) ? this.options.adapter() : this.options.adapter;
if (isAutoSync && adapter && adapter.getValue) { if (isAutoSync && adapter && adapter.getValue) {
return adapter.getValue(); return adapter.getValue();
} }
@ -354,8 +350,7 @@ export class Searcher extends Widget {
} }
populate(result, searchResult, keyword) { populate(result, searchResult, keyword) {
const { isAutoSync } = this.options; const { isAutoSync, adapter } = this.options;
const adapter = isFunction(this.options.adapter) ? this.options.adapter() : this.options.adapter;
this._assertPopupView(); this._assertPopupView();
this.popupView.populate(...arguments); this.popupView.populate(...arguments);
if (isAutoSync && adapter && adapter.getValue) { if (isAutoSync && adapter && adapter.getValue) {

7
packages/fineui/src/base/combination/switcher.js

@ -11,7 +11,7 @@ import {
isNull, isNull,
Events, Events,
Direction, Direction,
EVENT_RESPONSE_TIME, isFunction EVENT_RESPONSE_TIME
} from "@/core"; } from "@/core";
import { ButtonGroup } from "./group.button"; import { ButtonGroup } from "./group.button";
import { Maskers } from "@/base/0.base"; import { Maskers } from "@/base/0.base";
@ -188,8 +188,7 @@ export class Switcher extends Widget {
} }
_assertPopupView() { _assertPopupView() {
const { popup, masker, value, direction } = this.options; const { popup, adapter, masker, value, direction } = this.options;
const adapter = isFunction(this.options.adapter) ? this.options.adapter() : this.options.adapter;
if (!this._created) { if (!this._created) {
this.popupView = createWidget( this.popupView = createWidget(
popup, popup,
@ -263,7 +262,7 @@ export class Switcher extends Widget {
} }
_setEnable(arg) { _setEnable(arg) {
super._setEnable(...arguments); super._setEnable(arguments);
!arg && this.isViewVisible() && this._hideView(); !arg && this.isViewVisible() && this._hideView();
} }

6
packages/fineui/src/base/combination/tab.js

@ -158,10 +158,6 @@ export class Tab extends Widget {
return this.layout.isCardExisted(cardName); return this.layout.isCardExisted(cardName);
} }
getAllCardIds() {
return Object.keys(this.cardMap);
}
getSelect() { getSelect() {
return this.curr; return this.curr;
} }
@ -204,6 +200,6 @@ export class Tab extends Widget {
destroy() { destroy() {
this.cardMap = {}; this.cardMap = {};
super.destroy(...arguments); super.destroy(arguments);
} }
} }

487
packages/fineui/src/base/foundation/message.js

@ -3,287 +3,248 @@
* 弹出提示消息框用于模拟阻塞操作通过回调函数实现 * 弹出提示消息框用于模拟阻塞操作通过回调函数实现
* @class Msg * @class Msg
*/ */
import { import { Widget, isString, isNull, isFunction, createWidget, remove, each, emptyFn, delay, zIndex_tip, i18nText, KeyCode, isPlainObject, SIZE_CONSANTS } from "../../core";
Widget, import { Toast } from "../single";
isString,
isNull,
isFunction,
createWidget,
remove,
each,
emptyFn,
delay,
zIndex_tip,
i18nText,
KeyCode,
isPlainObject,
SIZE_CONSANTS,
CenterAdaptLayout,
VerticalLayout,
HTapeLayout,
RightVerticalAdaptLayout
} from "../../core";
import { Button, IconLabel, Label, Toast } from "../single";
let $mask, $pop; export const Msg = (() => {
let $mask, $pop;
const messageShows = []; const messageShows = [];
const toastStack = []; const toastStack = [];
const AlertLevel = { return {
WARNING: 'warning', alert (title, message, callback) {
INFO: 'info', this._show(false, title, message, callback);
ERROR: 'error', },
SUCCESS: 'success', confirm (title, message, callback) {
} this._show(true, title, message, callback);
},
function getIconCls(level) { prompt (title, message, value, callback, min_width) {
switch (level) { // Msg.prompt(title, message, value, callback, min_width);
case AlertLevel.ERROR: },
return 'alert-error-font'; toast (message, options, context) {
case AlertLevel.SUCCESS: isString(options) && (options = { level: options });
return 'alert-success-font'; options = options || {};
case AlertLevel.INFO: context = context || Widget._renderEngine.createElement("body");
return 'alert-info-font'; const level = options.level || "common";
case AlertLevel.WARNING: const autoClose = isNull(options.autoClose) ? true : options.autoClose;
default: const callback = isFunction(options.callback) ? options.callback : emptyFn;
return 'alert-warning-font'; const toast = createWidget({
} type: "bi.toast",
} cls: "bi-message-animate bi-message-leave",
level,
autoClose,
export const Msg = { closable: options.closable,
alert(title, message, callback, config) { text: message,
_show(false, title, message, callback, config); listeners: [
}, {
confirm(title, message, callback, config) { eventName: Toast.EVENT_DESTORY,
_show(true, title, message, callback, config); action () {
}, remove(toastStack, toast.element);
toast(message, options, context) { let _height = SIZE_CONSANTS.TOAST_TOP;
isString(options) && (options = { level: options }); each(toastStack, (i, element) => {
options = options || {}; element.css({ top: _height });
context = context || Widget._renderEngine.createElement("body"); _height += element.outerHeight() + 10;
const level = options.level || "common"; });
const autoClose = isNull(options.autoClose) ? true : options.autoClose; callback();
const callback = isFunction(options.callback) ? options.callback : emptyFn; },
const toast = createWidget({ }
type: "bi.toast", ],
cls: "bi-message-animate bi-message-leave", });
level, let height = SIZE_CONSANTS.TOAST_TOP;
autoClose, each(toastStack, (i, element) => {
closable: options.closable, height += element.outerHeight() + 10;
text: message, });
listeners: [ createWidget({
{ type: "bi.absolute",
eventName: Toast.EVENT_DESTORY, element: context,
action() { items: [
remove(toastStack, toast.element); {
let _height = SIZE_CONSANTS.TOAST_TOP; el: toast,
each(toastStack, (i, element) => { left: "50%",
element.css({ top: _height }); top: height,
_height += element.outerHeight() + 10; }
}); ],
callback(); });
}, toastStack.push(toast.element);
} toast.element.css({ "margin-left": (-1 * toast.element.outerWidth()) / 2 });
], toast.element.removeClass("bi-message-leave").addClass("bi-message-enter");
});
let height = SIZE_CONSANTS.TOAST_TOP;
each(toastStack, (i, element) => {
height += element.outerHeight() + 10;
});
createWidget({
type: "bi.absolute",
element: context,
items: [
{
el: toast,
left: "50%",
top: height,
}
],
});
toastStack.push(toast.element);
toast.element.css({ "margin-left": (-1 * toast.element.outerWidth()) / 2 });
toast.element.removeClass("bi-message-leave").addClass("bi-message-enter");
autoClose &&
delay(() => {
toast.element.removeClass("bi-message-enter").addClass("bi-message-leave");
toast.destroy?.();
}, 5000);
return function() {
toast.element.removeClass("bi-message-enter").addClass("bi-message-leave");
toast.destroy?.();
};
},
};
function _show(hasCancel, title, message, callback, config = {}) {
config = {
buttonHeight: 28,
cancelText: i18nText("BI-Basic_Cancel"),
sureText: i18nText("BI-Basic_OK"),
level: AlertLevel.WARNING,
...config,
}
isNull($mask) &&
($mask = Widget._renderEngine
.createElement("<div class=\"bi-z-index-mask\">")
.css({
position: "absolute",
zIndex: zIndex_tip - 2,
top: 0,
left: 0,
right: 0,
bottom: 0,
opacity: 0.5,
})
.appendTo("body"));
$pop = Widget._renderEngine
.createElement("<div class=\"bi-message-depend\">")
.css({
position: "absolute",
zIndex: zIndex_tip - 1,
top: 0,
left: 0,
right: 0,
bottom: 0,
})
.appendTo("body");
function close() { autoClose &&
messageShows[messageShows.length - 1].destroy(); delay(() => {
messageShows.pop(); toast.element.removeClass("bi-message-enter").addClass("bi-message-leave");
if (messageShows.length === 0) { toast.destroy?.();
$mask.remove(); }, 5000);
$mask = null;
}
}
const controlItems = []; return function () {
if (hasCancel === true) { toast.element.removeClass("bi-message-enter").addClass("bi-message-leave");
controlItems.push({ toast.destroy?.();
el: { };
type: Button.xtype,
height: config.buttonHeight,
text: config.cancelText,
light: true,
handler() {
close();
if (isFunction(callback)) {
callback.apply(null, [false]);
}
},
},
});
}
controlItems.push({
el: {
type: Button.xtype,
height: config.buttonHeight,
text: config.sureText,
handler() {
close();
if (isFunction(callback)) {
callback.apply(null, [true]);
}
},
}, },
}); _show (hasCancel, title, message, callback) {
const conf = { isNull($mask) &&
element: $pop, ($mask = Widget._renderEngine
type: CenterAdaptLayout.xtype, .createElement("<div class=\"bi-z-index-mask\">")
items: [ .css({
{ position: "absolute",
type: VerticalLayout.xtype, zIndex: zIndex_tip - 2,
cls: "bi-card bi-border-radius", top: 0,
width: 450, left: 0,
css: { right: 0,
'max-height': '100%' bottom: 0,
}, opacity: 0.5,
hgap: 32, })
attributes: { .appendTo("body"));
tabIndex: 1, $pop = Widget._renderEngine
}, .createElement("<div class=\"bi-message-depend\">")
mounted() { .css({
this.element.keyup(e => { position: "absolute",
if (e.keyCode === KeyCode.ENTER) { zIndex: zIndex_tip - 1,
top: 0,
left: 0,
right: 0,
bottom: 0,
})
.appendTo("body");
function close() {
messageShows[messageShows.length - 1].destroy();
messageShows.pop();
if (messageShows.length === 0) {
$mask.remove();
$mask = null;
}
}
const controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button",
text: i18nText("BI-Basic_Cancel"),
level: "ignore",
handler () {
close(); close();
if (isFunction(callback)) { if (isFunction(callback)) {
callback.apply(null, [true]); callback.apply(null, [false]);
}
} else if (e.keyCode === KeyCode.ESCAPE) {
close();
if (hasCancel === true) {
if (isFunction(callback)) {
callback.apply(null, [false]);
}
} }
},
},
});
}
controlItems.push({
el: {
type: "bi.button",
text: i18nText("BI-Basic_OK"),
handler () {
close();
if (isFunction(callback)) {
callback.apply(null, [true]);
} }
}); },
try {
this.element.focus();
} catch (e) {
}
}, },
});
const conf = {
element: $pop,
type: "bi.center_adapt",
items: [ items: [
{ {
el: { type: "bi.border",
type: HTapeLayout.xtype, attributes: {
height: 24, tabIndex: 1,
items: [ },
{ mounted () {
type: IconLabel.xtype, this.element.keyup(e => {
cls: `${getIconCls(config.level)} icon-size-20`, if (e.keyCode === KeyCode.ENTER) {
width: 24, close();
height: 24, if (isFunction(callback)) {
callback.apply(null, [true]);
}
} else if (e.keyCode === KeyCode.ESCAPE) {
close();
if (hasCancel === true) {
if (isFunction(callback)) {
callback.apply(null, [false]);
}
}
}
});
try {
this.element.focus();
} catch (e) {}
},
cls: "bi-card",
items: {
north: {
el: {
type: "bi.border",
cls: "bi-message-title bi-background",
items: {
center: {
el: {
type: "bi.label",
cls: "bi-font-bold",
text: title || i18nText("BI-Basic_Prompt"),
textAlign: "left",
hgap: 20,
height: 40,
},
},
east: {
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
// height: 50,
handler () {
close();
if (isFunction(callback)) {
callback.apply(null, [false]);
}
},
},
width: 56,
},
},
}, },
{ height: 40,
el: { },
type: Label.xtype, center: {
css: {"font-size": 16}, el: isPlainObject(message)
cls: 'bi-font-bold', // 16px ? message
textAlign: 'left', : {
text: title || i18nText('BI-Basic_Prompt'), type: "bi.label",
lgap: 16, vgap: 10,
hgap: 20,
whiteSpace: "normal",
text: message,
}, },
width: 'fill', },
south: {
el: {
type: "bi.absolute",
items: [
{
el: {
type: "bi.right_vertical_adapt",
lgap: 10,
items: controlItems,
},
top: 0,
left: 20,
right: 20,
bottom: 0,
}
],
}, },
], height: 44,
},
tgap: 32,
},
{
el: isPlainObject(message)
? message
: {
type: Label.xtype,
css: { "font-size": 14 },
cls: 'alert-content',
textAlign: 'left',
text: message,
whiteSpace: 'normal',
}, },
height: 'fill',
tgap: 12,
lgap: 40,
},
{
el: config.footer && isFunction(config.footer) ? config.footer(close) : {
type: RightVerticalAdaptLayout.xtype,
lgap: 12,
items: controlItems,
}, },
tgap: 32, width: 450,
bgap: 24, height: 200,
}, }
], ],
}, };
],
};
messageShows[messageShows.length] = createWidget(conf); messageShows[messageShows.length] = createWidget(conf);
} },
};
})();

1
packages/fineui/src/base/index.js

@ -11,4 +11,3 @@ export * from "./layer";
export * from "./list"; export * from "./list";
export * from "./single"; export * from "./single";
export * from "./el"; export * from "./el";
export * from "./context";

122
packages/fineui/src/base/layer/layer.popover.js

@ -16,7 +16,6 @@ import {
} from "@/core"; } from "@/core";
import { Label, IconButton, Button } from "../single"; import { Label, IconButton, Button } from "../single";
import { Resizers } from "../0.base"; import { Resizers } from "../0.base";
import { getOuterBody } from "@/core/utils/dom";
/** /**
* Popover弹出层 * Popover弹出层
@ -47,7 +46,6 @@ export class Popover extends Widget {
body: null, body: null,
footer: null, footer: null,
footerHeight: 44, footerHeight: 44,
footerButtonHeight: 28,
closable: true, // BI-40839 是否显示右上角的关闭按钮 closable: true, // BI-40839 是否显示右上角的关闭按钮
bodyHgap: SIZE_CONSANTS.H_GAP_SIZE, bodyHgap: SIZE_CONSANTS.H_GAP_SIZE,
bodyTgap: SIZE_CONSANTS.V_GAP_SIZE, bodyTgap: SIZE_CONSANTS.V_GAP_SIZE,
@ -64,7 +62,29 @@ export class Popover extends Widget {
// var self = this; // var self = this;
const { header, headerHeight, closable, logic, footer, footerHeight, body, bodyTgap, bodyHgap } = this.options; const { header, headerHeight, closable, logic, footer, footerHeight, body, bodyTgap, bodyHgap } = this.options;
const c = this._constant; const c = this._constant;
this.startX = 0;
this.startY = 0;
const size = this._calculateSize(); const size = this._calculateSize();
this.tracker = new MouseMoveTracker(
(deltaX, deltaY) => {
const W = Widget._renderEngine.createElement("body").width();
const H = Widget._renderEngine.createElement("body").height();
this.startX += deltaX;
this.startY += deltaY;
this.element.css({
left: `${clamp(this.startX, 0, W - this.element.width())}px`,
top: `${clamp(this.startY, 0, H - this.element.height())}px`,
});
// BI-12134 没有什么特别好的方法
Resizers._resize({
target: this.element[0],
});
},
() => {
this.tracker.releaseMouseMoves();
},
_global
);
const items = [ const items = [
{ {
el: { el: {
@ -193,33 +213,9 @@ export class Popover extends Widget {
} }
); );
} }
// mounted之后绑定事件 // mounted之后绑定事件
mounted() { mounted() {
this.startX = 0; this.dragger.element.mousedown(e => {
this.startY = 0;
this.tracker = new MouseMoveTracker(
(deltaX, deltaY) => {
const el = Widget._renderEngine.createElement(getOuterBody())[0];
const W = el.clientWidth;
const H = el.clientHeight;
this.startX += deltaX;
this.startY += deltaY;
this.element.css({
left: `${clamp(this.startX, 0, W - this.element.width())}px`,
top: `${clamp(this.startY, 0, H - this.element.height())}px`,
});
// BI-12134 没有什么特别好的方法
Resizers._resize({
target: this.element[0],
});
},
() => {
this.tracker.releaseMouseMoves();
},
_global
);
this.dragger?.element.mousedown(e => {
if (this.options.draggable !== false) { if (this.options.draggable !== false) {
this.startX = this.element[0].offsetLeft; this.startX = this.element[0].offsetLeft;
this.startY = this.element[0].offsetTop; this.startY = this.element[0].offsetTop;
@ -230,23 +226,23 @@ export class Popover extends Widget {
_getSuitableBodyHeight(height) { _getSuitableBodyHeight(height) {
const { headerHeight, footer, footerHeight, bodyTgap } = this.options; const { headerHeight, footer, footerHeight, bodyTgap } = this.options;
const bodyDom = getOuterBody();
return clamp( return clamp(
height, height,
0, 0,
Widget._renderEngine.createElement(bodyDom)[0].clientHeight - Widget._renderEngine.createElement("body")[0].clientHeight -
headerHeight - headerHeight -
(footer ? footerHeight : 0) - (footer ? footerHeight : 0) -
bodyTgap bodyTgap
); );
} }
_getSuitableHeight(height) { _getSuitableHeight(height) {
return clamp(height, 0, Widget._renderEngine.createElement(getOuterBody())[0].clientHeight); return clamp(height, 0, Widget._renderEngine.createElement("body")[0].clientHeight);
} }
_getSuitableWidth(width) { _getSuitableWidth(width) {
return clamp(width, 0, Widget._renderEngine.createElement(getOuterBody())[0].clientWidth); return clamp(width, 0, Widget._renderEngine.createElement("body").width());
} }
_calculateSize() { _calculateSize() {
@ -277,13 +273,11 @@ export class Popover extends Widget {
type: sizeValue.type || "default", type: sizeValue.type || "default",
}; };
} }
setDraggable(b) { setDraggable(b) {
this.options.draggable = b; this.options.draggable = b;
} }
hide() { hide() {}
}
open() { open() {
this.show(); this.show();
@ -311,35 +305,33 @@ export class BarPopover extends Popover {
} }
beforeCreate() { beforeCreate() {
const { footer, warningTitle, footerButtonHeight } = this.options; const { footer, warningTitle } = this.options;
footer || footer ||
(this.options.footer = { (this.options.footer = {
type: RightVerticalAdaptLayout.xtype, type: RightVerticalAdaptLayout.xtype,
lgap: 10, lgap: 10,
items: [ items: [
{ {
type: Button.xtype, type: Button.xtype,
height: footerButtonHeight, text: this.options.btns[1],
text: this.options.btns[1], value: 1,
value: 1, level: "ignore",
light: true, handler: v => {
handler: v => { this.fireEvent(Popover.EVENT_CANCEL, v);
this.fireEvent(Popover.EVENT_CANCEL, v); this.close(v);
this.close(v); },
},
},
{
type: Button.xtype,
height: footerButtonHeight,
text: this.options.btns[0],
warningTitle,
value: 0,
handler: v => {
this.fireEvent(Popover.EVENT_CONFIRM, v);
this.close(v);
}, },
} {
], type: Button.xtype,
}); text: this.options.btns[0],
warningTitle,
value: 0,
handler: v => {
this.fireEvent(Popover.EVENT_CONFIRM, v);
this.close(v);
},
}
],
});
} }
} }

5
packages/fineui/src/base/list/listview.js

@ -111,6 +111,11 @@ export class ListView extends Widget {
} }
} }
_calculateBlocksToRender() { _calculateBlocksToRender() {
// BI-115750 不可见状态下依赖元素实际尺寸构造的线段树会分段错误,所以不进行后续计算和线段树的初始化。
// 这样从不可见状态变为可见状态能够重新触发线段树初始化
if (!this.element.is(":visible")) {
return;
}
this._renderMoreIf(); this._renderMoreIf();
} }

36
packages/fineui/src/base/list/virtualgrouplist.js

@ -1,4 +1,4 @@
import { VerticalLayout, Layout, Widget, shortcut, extend, isFunction, isNumber, sum, PrefixIntervalTree, ResizeDetector } from "@/core"; import { VerticalLayout, Layout, Widget, shortcut, extend, isFunction, isNumber, PrefixIntervalTree, ResizeDetector } from "@/core";
import { VirtualGroup } from "../combination"; import { VirtualGroup } from "../combination";
/** /**
@ -17,7 +17,7 @@ export class VirtualGroupList extends Widget {
overscanHeight: 100, overscanHeight: 100,
blockSize: 10, blockSize: 10,
scrollTop: 0, scrollTop: 0,
rowHeight: "auto", // 'auto' 或 数值 或function rowHeight: "auto",
items: [], items: [],
el: {}, el: {},
itemFormatter: (item, index) => item, itemFormatter: (item, index) => item,
@ -25,7 +25,6 @@ export class VirtualGroupList extends Widget {
} }
init() { init() {
this._calculateSummaryHeight();
this.renderedIndex = -1; this.renderedIndex = -1;
} }
@ -45,7 +44,7 @@ export class VirtualGroupList extends Widget {
}, },
{ {
type: VirtualGroup.xtype, type: VirtualGroup.xtype,
height: this.summaryHeight, height: rowHeight * items.length,
ref: (ref) => { ref: (ref) => {
this.container = ref; this.container = ref;
}, },
@ -98,7 +97,7 @@ export class VirtualGroupList extends Widget {
} }
_isAutoHeight() { _isAutoHeight() {
return this.options.rowHeight === 'auto'; return !isNumber(this.options.rowHeight);
} }
_renderMoreIf() { _renderMoreIf() {
@ -164,22 +163,12 @@ export class VirtualGroupList extends Widget {
itemsArr.push(items[j]); itemsArr.push(items[j]);
} }
} }
this.container.element.height(this.summaryHeight - topHeight); this.container.element.height(rowHeight * items.length - topHeight);
this.container.populate( this.container.populate(
itemsArr.map((item, i) => itemFormatter(item, (start < 0 ? 0 : start) * blockSize + i)) itemsArr.map((item, i) => itemFormatter(item, (start < 0 ? 0 : start) * blockSize + i))
); );
} }
} }
_calculateSummaryHeight() {
const o = this.options;
if (isFunction(o.rowHeight)) {
this.summaryHeight = sum(o.items, o.rowHeight);
} else {
this.summaryHeight = this._isAutoHeight() ? 0 : o.rowHeight * o.items.length;
}
}
_populate(items) { _populate(items) {
const { blockSize, rowHeight, scrollTop } = this.options; const { blockSize, rowHeight, scrollTop } = this.options;
if (items && this.options.items !== items) { if (items && this.options.items !== items) {
@ -191,16 +180,6 @@ export class VirtualGroupList extends Widget {
Math.ceil(this.options.items.length / blockSize), Math.ceil(this.options.items.length / blockSize),
this._isAutoHeight() ? 0 : rowHeight * blockSize this._isAutoHeight() ? 0 : rowHeight * blockSize
); );
if (isFunction(rowHeight)) {
for (let i = 0; i < this.options.items.length / blockSize; i++) {
const index = i * blockSize;
let summaryHeight = 0;
for (let j = index; j < index + blockSize && j < this.options.items.length; j++) {
summaryHeight += rowHeight(j, this.options.items[j]);
}
this.tree.set(i, summaryHeight);
}
}
this._calculateBlocksToRender(); this._calculateBlocksToRender();
try { try {
@ -210,7 +189,6 @@ export class VirtualGroupList extends Widget {
_restore() { _restore() {
this.renderedIndex = -1; this.renderedIndex = -1;
this._calculateSummaryHeight();
// 依赖于cache的占位元素也要初始化 // 依赖于cache的占位元素也要初始化
this.topBlank.setHeight(0); this.topBlank.setHeight(0);
this.bottomBlank.setHeight(0); this.bottomBlank.setHeight(0);
@ -236,8 +214,4 @@ export class VirtualGroupList extends Widget {
ResizeDetector.removeResizeListener(this); ResizeDetector.removeResizeListener(this);
this.restore(); this.restore();
} }
getNodeByValue(value) {
return this.container.getNodeByValue(value);
}
} }

2
packages/fineui/src/base/single/0.single.js

@ -72,7 +72,7 @@ export class Single extends Widget {
this.setValue(newValue); this.setValue(newValue);
}) })
: value; : value;
super._init(...arguments); super._init(arguments);
} }
_mounted() { _mounted() {

3
packages/fineui/src/base/single/button/button.basic.js

@ -69,7 +69,7 @@ export class BasicButton extends Single {
this.setSelected(newValue); this.setSelected(newValue);
}) })
: opts.selected; : opts.selected;
super._init(...arguments); super._init(arguments);
if (opts.shadow) { if (opts.shadow) {
this._createShadow(); this._createShadow();
@ -193,7 +193,6 @@ export class BasicButton extends Single {
trigger: "", trigger: "",
// bubble的提示不需要一直存在在界面上 // bubble的提示不需要一直存在在界面上
destroyWhenHide: true, destroyWhenHide: true,
hideWhenAnotherComboOpen: true,
ref: _ref => { ref: _ref => {
this.combo = _ref; this.combo = _ref;
}, },

1
packages/fineui/src/base/single/button/listitem/icontextitem.js

@ -59,7 +59,6 @@ export class IconTextItem extends BasicButton {
lgap: o.textLgap, lgap: o.textLgap,
rgap: o.textRgap, rgap: o.textRgap,
text: o.text, text: o.text,
title: o.title,
value: o.value, value: o.value,
keyword: o.keyword, keyword: o.keyword,
height: o.height, height: o.height,

2
packages/fineui/src/base/single/editor/editor.textarea.js

@ -279,7 +279,7 @@ export class TextAreaEditor extends Single {
} }
_setValid(b) { _setValid(b) {
super._setValid(...arguments); super._setValid(arguments);
// this.content.setValid(b); // this.content.setValid(b);
// this.watermark && this.watermark.setValid(b); // this.watermark && this.watermark.setValid(b);
} }

2
packages/fineui/src/base/single/input/checkbox/checkbox.js

@ -52,7 +52,7 @@ export class Checkbox extends BasicButton {
} }
doClick() { doClick() {
super.doClick(...arguments); super.doClick(arguments);
if (this.isValid()) { if (this.isValid()) {
this.fireEvent(Checkbox.EVENT_CHANGE); this.fireEvent(Checkbox.EVENT_CHANGE);
} }

11
packages/fineui/src/base/single/input/file.js

@ -242,11 +242,14 @@ const sendFile = (toString => {
upload.onloadstart(); upload.onloadstart();
} }
} }
const boundary = `AjaxUploadBoundary${new Date().getTime()}`;
xhr.setRequestHeader("Content-Type", `multipart/form-data; boundary=${boundary}`);
if (handler.file.getAsBinary) { if (handler.file.getAsBinary) {
const boundary = `AjaxUploadBoundary${new Date().getTime()}`;
xhr.setRequestHeader("Content-Type", `multipart/form-data; boundary=${boundary}`);
xhr[xhr.sendAsBinary ? "sendAsBinary" : "send"](multipart(boundary, handler.name, handler.file)); xhr[xhr.sendAsBinary ? "sendAsBinary" : "send"](multipart(boundary, handler.name, handler.file));
} else { } else {
xhr.setRequestHeader("Content-Type", "multipart/form-data");
// xhr.setRequestHeader("X-Name", handler.name);
// xhr.setRequestHeader("X-File-Name", handler.file.fileName);
const form = new FormData(); const form = new FormData();
form.append("FileData", handler.file); form.append("FileData", handler.file);
xhr.send(form); xhr.send(form);
@ -538,7 +541,7 @@ export class File extends Widget {
// We can still show some information // We can still show some information
} }
this.fireEvent(File.EVENT_PROGRESS, { this.fireEvent(File.EVENT_PROGRESS, {
file: _wrap.file, file: this.file,
total: rpe.total, total: rpe.total,
loaded: rpe.loaded, loaded: rpe.loaded,
simulation: rpe.simulation, simulation: rpe.simulation,
@ -756,7 +759,7 @@ export class File extends Widget {
} }
_setEnable(enable) { _setEnable(enable) {
super._setEnable(...arguments); super._setEnable(arguments);
if (enable === true) { if (enable === true) {
this.element.removeAttr("disabled"); this.element.removeAttr("disabled");
} else { } else {

4
packages/fineui/src/base/single/input/input.js

@ -144,7 +144,7 @@ export class Input extends Single {
_blur() { _blur() {
const blur = () => { const blur = () => {
if (!this.isValid() && this.options.quitChecker.apply(this, [trim(this.getValue())]) !== false) { if (!this.isValid() && this.options.quitChecker.apply(this, [trim(this.getValue())]) !== false) {
this.element.val(this._lastValidValue ?? this.options.value ?? ""); this.element.val(this._lastValidValue ? this._lastValidValue : "");
this._checkValidationOnValueChange(); this._checkValidationOnValueChange();
this._defaultState(); this._defaultState();
} }
@ -344,7 +344,7 @@ export class Input extends Single {
} }
_setValid() { _setValid() {
super._setValid(...arguments); super._setValid(arguments);
if (this.isValid()) { if (this.isValid()) {
this._lastChangedValue = this.getValue(); this._lastChangedValue = this.getValue();
this.element.removeClass("bi-input-error"); this.element.removeClass("bi-input-error");

2
packages/fineui/src/base/single/input/radio/radio.image.js

@ -28,7 +28,7 @@ export class ImageRadio extends IconButton {
} }
doClick() { doClick() {
super.doClick(...arguments); super.doClick(arguments);
if (this.isValid()) { if (this.isValid()) {
this.fireEvent(ImageRadio.EVENT_CHANGE); this.fireEvent(ImageRadio.EVENT_CHANGE);
} }

2
packages/fineui/src/base/single/input/radio/radio.js

@ -51,7 +51,7 @@ export class Radio extends BasicButton {
} }
doClick() { doClick() {
super.doClick(...arguments); super.doClick(arguments);
if (this.isValid()) { if (this.isValid()) {
this.fireEvent(Radio.EVENT_CHANGE); this.fireEvent(Radio.EVENT_CHANGE);
} }

11
packages/fineui/src/base/tree/customtree.js

@ -16,8 +16,7 @@ import {
isNull, isNull,
createWidget, createWidget,
Controller, Controller,
Events, Events
omit,
} from "@/core"; } from "@/core";
/** /**
@ -105,8 +104,7 @@ export class CustomTree extends Widget {
return itemsCreator.apply(this, args); return itemsCreator.apply(this, args);
}; };
isNull(item.popup.el) && (item.popup.el = deepClone(omit(this.options.el, "node"))); isNull(item.popup.el) && (item.popup.el = deepClone(this.options.el));
item.popup.el.node = item.el;
items.push(item); items.push(item);
} else { } else {
items.push(node); items.push(node);
@ -124,8 +122,9 @@ export class CustomTree extends Widget {
itemsCreator: (op, callback) => { itemsCreator: (op, callback) => {
itemsCreator.apply(this, [ itemsCreator.apply(this, [
op, op,
(...args) => { items => {
args[0] = this._formatItems(args[0]); const args = Array.prototype.slice.call(arguments, 0);
args[0] = this._formatItems(items);
callback(...args); callback(...args);
} }
]); ]);

7
packages/fineui/src/bundle.js

@ -5,15 +5,12 @@ import {_defineVarProperties} from "@/core/constant/writable.var";
_global.BI = _global.BI || {}; _global.BI = _global.BI || {};
// for fr, 已经有的就不对外暴露了.
// 要知道BI只有`BI.$`, 挂在全局对象上的只是为了兼容而已
if (!_global.$ && !_global.jQuery) {
_global.jQuery = _global.$ = fuiExport.$;
}
Object.assign(_global, { Object.assign(_global, {
Fix: fuiExport.Fix, Fix: fuiExport.Fix,
_: fuiExport._, _: fuiExport._,
$: fuiExport.$,
jQuery: fuiExport.$,
}); });
Object.assign(_global.BI, fuiExport, injectFn); Object.assign(_global.BI, fuiExport, injectFn);

2
packages/fineui/src/case/button/item.multiselect.js

@ -19,7 +19,6 @@ export class MultiSelectItem extends BasicButton {
}, },
height: SIZE_CONSANTS.LIST_ITEM_HEIGHT, height: SIZE_CONSANTS.LIST_ITEM_HEIGHT,
iconWrapperWidth: 26, iconWrapperWidth: 26,
el: {},
}); });
} }
@ -56,7 +55,6 @@ export class MultiSelectItem extends BasicButton {
keyword: o.keyword, keyword: o.keyword,
value: o.value, value: o.value,
py: o.py, py: o.py,
...o.el
}, },
} }
], ],

26
packages/fineui/src/case/button/switch.js

@ -1,13 +1,15 @@
import { AbsoluteLayout, shortcut, i18nText } from "@/core"; import { AbsoluteLayout, shortcut, i18nText } from "@/core";
import { TextButton, Label, BasicButton } from "@/base"; import { TextButton, Label, BasicButton } from "@/base";
const CIRCLE_SIZE = 12;
@shortcut() @shortcut()
export class Switch extends BasicButton { export class Switch extends BasicButton {
static xtype = "bi.switch"; static xtype = "bi.switch";
static EVENT_CHANGE = "EVENT_CHANGE"; static EVENT_CHANGE = "EVENT_CHANGE";
constants = {
CIRCLE_SIZE: 12,
};
props = { props = {
extraCls: "bi-switch", extraCls: "bi-switch",
attributes: { attributes: {
@ -16,12 +18,12 @@ export class Switch extends BasicButton {
height: 20, height: 20,
width: 44, width: 44,
showTip: false, showTip: false,
textGap: 8,
}; };
render() { render() {
const { selected, width, height, textGap, showTip } = this.options; const o = this.options,
const tgap = (height - CIRCLE_SIZE) / 2; c = this.constants;
const tgap = (o.height - c.CIRCLE_SIZE) / 2;
return { return {
type: AbsoluteLayout.xtype, type: AbsoluteLayout.xtype,
@ -37,15 +39,15 @@ export class Switch extends BasicButton {
width: 12, width: 12,
height: 12, height: 12,
top: tgap, top: tgap,
left: selected ? width - height + tgap : tgap, left: o.selected ? 28 : 4,
}, },
{ {
type: Label.xtype, type: Label.xtype,
text: i18nText("BI-Basic_Simple_Open"), text: i18nText("BI-Basic_Simple_Open"),
cls: "content-tip", cls: "content-tip",
left: textGap, left: 8,
top: tgap - 2, top: tgap - 2,
invisible: !(showTip && selected), invisible: !(o.showTip && o.selected),
ref: _ref => { ref: _ref => {
this.openTip = _ref; this.openTip = _ref;
}, },
@ -54,9 +56,9 @@ export class Switch extends BasicButton {
type: Label.xtype, type: Label.xtype,
text: i18nText("BI-Basic_Simple_Close"), text: i18nText("BI-Basic_Simple_Close"),
cls: "content-tip", cls: "content-tip",
right: textGap, right: 8,
top: tgap - 2, top: tgap - 2,
invisible: !(showTip && !selected), invisible: !(o.showTip && !o.selected),
ref: _ref => { ref: _ref => {
this.closeTip = _ref; this.closeTip = _ref;
}, },
@ -76,9 +78,7 @@ export class Switch extends BasicButton {
setSelected(v) { setSelected(v) {
super.setSelected(...arguments); super.setSelected(...arguments);
const { width, height } = this.options; this.layout.attr("items")[0].left = v ? 28 : 4;
const tgap = (height - CIRCLE_SIZE) / 2;
this.layout.attr("items")[0].left = v ? width - height + tgap : tgap;
this.layout.resize(); this.layout.resize();
this.options.showTip && this.openTip.setVisible(v); this.options.showTip && this.openTip.setVisible(v);
this.options.showTip && this.closeTip.setVisible(!v); this.options.showTip && this.closeTip.setVisible(!v);

3
packages/fineui/src/case/button/treeitem/item.icon.treeleaf.js

@ -1,9 +1,6 @@
import { CenterAdaptLayout, shortcut, extend, createWidget, LogicFactory, Direction } from "@/core"; import { CenterAdaptLayout, shortcut, extend, createWidget, LogicFactory, Direction } from "@/core";
import { Icon, Label, BasicButton } from "@/base"; import { Icon, Label, BasicButton } from "@/base";
/**
* @deprecated
*/
@shortcut() @shortcut()
export class IconTreeLeafItem extends BasicButton { export class IconTreeLeafItem extends BasicButton {
static xtype = "bi.icon_tree_leaf_item"; static xtype = "bi.icon_tree_leaf_item";

100
packages/fineui/src/case/button/treeitem/item.multilayer.icon.treeleaf.js

@ -1,14 +1,9 @@
import { import { IconTreeLeafItem } from "./item.icon.treeleaf";
shortcut, import { Layout, HorizontalAdaptLayout, shortcut, extend, createWidget, Controller, makeArray, count, Events } from "@/core";
extend, import { BasicButton } from "@/base";
} from "@/core";
import { BasicTreeItem } from "./treeitem";
/**
* @deprecated
*/
@shortcut() @shortcut()
export class MultiLayerIconTreeLeafItem extends BasicTreeItem { export class MultiLayerIconTreeLeafItem extends BasicButton {
static xtype = "bi.multilayer_icon_tree_leaf_item"; static xtype = "bi.multilayer_icon_tree_leaf_item";
_defaultConfig() { _defaultConfig() {
@ -19,8 +14,89 @@ export class MultiLayerIconTreeLeafItem extends BasicTreeItem {
iconCls: "", iconCls: "",
iconHeight: 16, iconHeight: 16,
iconWidth: 16, iconWidth: 16,
showLine: false,
indentWidth: 0
}); });
} }
_init() {
super._init(...arguments);
const o = this.options;
this.item = createWidget({
type: IconTreeLeafItem.xtype,
cls: "bi-list-item-none",
iconCls: o.iconCls,
id: o.id,
pId: o.pId,
isFront: true,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight,
});
this.item.on(Controller.EVENT_CHANGE, (...args) => {
const [type] = args;
if (type === Events.CLICK) {
// 本身实现click功能
return;
}
this.fireEvent(Controller.EVENT_CHANGE, ...args);
});
const items = [];
count(0, o.layer, () => {
items.push({
type: Layout.xtype,
width: 15,
height: o.height,
});
});
items.push(this.item);
createWidget({
type: HorizontalAdaptLayout.xtype,
element: this,
columnSize: makeArray(o.layer, 15),
items,
});
}
doRedMark() {
this.item.doRedMark(...arguments);
}
unRedMark() {
this.item.unRedMark(...arguments);
}
doHighLight() {
this.item.doHighLight(...arguments);
}
unHighLight() {
this.item.unHighLight(...arguments);
}
getId() {
return this.options.id;
}
getPId() {
return this.options.pId;
}
doClick() {
super.doClick(...arguments);
this.item.setSelected(this.isSelected());
}
setSelected(v) {
super.setSelected(...arguments);
this.item.setSelected(v);
}
getValue() {
return this.options.value;
}
} }

8
packages/fineui/src/case/button/treeitem/treeitem.js

@ -20,8 +20,6 @@ export class BasicTreeItem extends NodeButton {
iconWidth: null, iconWidth: null,
iconHeight: null, iconHeight: null,
iconCls: "", iconCls: "",
showLine: true,
indentWidth: null,
}); });
} }
@ -39,16 +37,14 @@ export class BasicTreeItem extends NodeButton {
py, py,
keyword, keyword,
iconCls, iconCls,
showLine,
indentWidth
} = this.options; } = this.options;
const indent = { const indent = {
el: { el: {
type: Layout.xtype, type: Layout.xtype,
height, height,
width: indentWidth ?? height, width: height,
cls: showLine ? this.getLineCls() : "", cls: this.getLineCls(),
}, },
lgap: layer * SIZE_CONSANTS.LIST_ITEM_HEIGHT / 2, // 偏移公式为每一层的偏移量为节点高度的一半 lgap: layer * SIZE_CONSANTS.LIST_ITEM_HEIGHT / 2, // 偏移公式为每一层的偏移量为节点高度的一半
width: "", width: "",

3
packages/fineui/src/case/colorchooser/colorchooser.js

@ -24,7 +24,6 @@ export class ColorChooser extends Widget {
height: 24, height: 24,
el: {}, el: {},
simple: false, simple: false,
colorBoardHeight: 80,
}); });
} }
@ -63,8 +62,6 @@ export class ColorChooser extends Widget {
el: extend( el: extend(
{ {
type: HexColorChooserPopup.xtype, type: HexColorChooserPopup.xtype,
colorItems: o.colorItems,
colorBoardHeight: o.colorBoardHeight,
recommendColorsGetter: o.recommendColorsGetter, recommendColorsGetter: o.recommendColorsGetter,
ref: _ref => { ref: _ref => {
this.colorPicker = _ref; this.colorPicker = _ref;

18
packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js

@ -22,13 +22,7 @@ import { Label, Combo, TextItem } from "@/base";
import { PopupPanel } from "../layer"; import { PopupPanel } from "../layer";
import { CustomColorChooser } from "./colorchooser.custom"; import { CustomColorChooser } from "./colorchooser.custom";
import { ColorChooserPopup } from "./colorchooser.popup"; import { ColorChooserPopup } from "./colorchooser.popup";
import { import { ColorPickerEditor, ColorPicker, HexColorPicker } from "./colorpicker";
ColorPickerEditor,
ColorPicker,
HexColorPicker,
SimpleHexColorPickerEditor,
HexColorPickerEditor
} from "./colorpicker";
/** /**
* @author windy * @author windy
@ -47,7 +41,6 @@ export class HexColorChooserPopup extends Widget {
width: 300, width: 300,
recommendColorsGetter: emptyFn, // 推荐色获取接口 recommendColorsGetter: emptyFn, // 推荐色获取接口
simple: false, // 简单模式, popup中没有自动和透明 simple: false, // 简单模式, popup中没有自动和透明
colorBoardHeight: 80,
}; };
render() { render() {
@ -66,12 +59,10 @@ export class HexColorChooserPopup extends Widget {
extend( extend(
{ {
type: o.simple type: o.simple
? SimpleHexColorPickerEditor.xtype ? "bi.simple_hex_color_picker_editor"
: HexColorPickerEditor.xtype, : "bi.hex_color_picker_editor",
value: o.value, value: o.value,
height: o.simple ? 36 : 70, height: o.simple ? 36 : 70,
transparent: o.transparent,
auto: o.auto,
listeners: [ listeners: [
{ {
eventName: ColorPickerEditor.EVENT_CHANGE, eventName: ColorPickerEditor.EVENT_CHANGE,
@ -168,7 +159,6 @@ export class HexColorChooserPopup extends Widget {
type: HexColorPicker.xtype, type: HexColorPicker.xtype,
space: true, space: true,
value: o.value, value: o.value,
items: o.colorItems,
listeners: [ listeners: [
{ {
eventName: ColorPicker.EVENT_CHANGE, eventName: ColorPicker.EVENT_CHANGE,
@ -189,7 +179,7 @@ export class HexColorChooserPopup extends Widget {
bottom: 1, bottom: 1,
} }
], ],
height: o.colorBoardHeight, height: 80,
} }
], ],
}, },

3
packages/fineui/src/case/colorchooser/colorchooser.trigger.long.js

@ -27,7 +27,6 @@ export class LongColorChooserTrigger extends Trigger {
} }
_init() { _init() {
const {height} = this.options;
super._init(...arguments); super._init(...arguments);
this.colorContainer = createWidget({ this.colorContainer = createWidget({
type: HTapeLayout.xtype, type: HTapeLayout.xtype,
@ -52,7 +51,7 @@ export class LongColorChooserTrigger extends Trigger {
}, },
textAlign: "left", textAlign: "left",
hgap: 5, hgap: 5,
height: height - 4, height: 18,
text: i18nText("BI-Basic_Auto"), text: i18nText("BI-Basic_Auto"),
}, },
} }

49
packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.hex.js

@ -39,10 +39,8 @@ export class HexColorPickerEditor extends Widget {
static EVENT_CHANGE = "EVENT_CHANGE"; static EVENT_CHANGE = "EVENT_CHANGE";
props = { props = {
baseCls: "bi-color-picker-editor bi-hex-color-picker-editor", baseCls: "bi-color-picker-editor",
height: 30, height: 30,
transparent: true,
auto: true,
}; };
render() { render() {
@ -97,27 +95,23 @@ export class HexColorPickerEditor extends Widget {
height: 24, height: 24,
items: [ items: [
{ {
el: { type: ColorChooserShowButton.xtype,
type: ColorChooserShowButton.xtype, cls: "trans-color-icon",
cls: "trans-color-icon", height: 22,
height: 22, title: i18nText("BI-Transparent_Color"),
title: i18nText("BI-Transparent_Color"), text: i18nText("BI-Transparent_Color"),
text: i18nText("BI-Transparent_Color"), listeners: [
invisible: !this.options.transparent, {
listeners: [ eventName: ColorChooserShowButton.EVENT_CHANGE,
{ action: () => {
eventName: ColorChooserShowButton.EVENT_CHANGE, this.setValue("transparent");
action: () => { this.fireEvent(ColorPickerEditor.EVENT_CHANGE);
this.setValue("transparent"); },
this.fireEvent(ColorPickerEditor.EVENT_CHANGE); }
}, ],
} ref: _ref => {
], this.transparent = _ref;
ref: _ref => {
this.transparent = _ref;
},
}, },
rgap: this.options.auto ? 5 : 0,
}, },
{ {
el: { el: {
@ -126,7 +120,6 @@ export class HexColorPickerEditor extends Widget {
height: 22, height: 22,
title: i18nText("BI-Basic_Auto"), title: i18nText("BI-Basic_Auto"),
text: i18nText("BI-Basic_Auto"), text: i18nText("BI-Basic_Auto"),
invisible: !this.options.auto,
listeners: [ listeners: [
{ {
eventName: ColorChooserShowButton.EVENT_CHANGE, eventName: ColorChooserShowButton.EVENT_CHANGE,
@ -140,7 +133,7 @@ export class HexColorPickerEditor extends Widget {
this.none = _ref; this.none = _ref;
}, },
}, },
lgap: this.options.transparent ? 5 : 0, lgap: 10,
} }
], ],
}, },
@ -183,9 +176,6 @@ export class HexColorPickerEditor extends Widget {
{ {
eventName: "EVENT_CHANGE", eventName: "EVENT_CHANGE",
action: () => { action: () => {
if (isEmptyString(this.hexEditor.getValue())) {
return;
}
this._checkHexEditor(); this._checkHexEditor();
if ( if (
checker(this.storeValue.r) && checker(this.storeValue.r) &&
@ -271,6 +261,9 @@ export class HexColorPickerEditor extends Widget {
} }
_checkHexEditor() { _checkHexEditor() {
if (isEmptyString(this.hexEditor.getValue())) {
this.hexEditor.setValue("000000");
}
const json = DOM.rgb2json(DOM.hex2rgb(`#${this.hexEditor.getValue()}`)); const json = DOM.rgb2json(DOM.hex2rgb(`#${this.hexEditor.getValue()}`));
this.storeValue = { this.storeValue = {
r: json.r || 0, r: json.r || 0,

6
packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js

@ -23,8 +23,7 @@ import { TextEditor } from "@/widget/editor/editor.text";
const RGB_WIDTH = 32, const RGB_WIDTH = 32,
HEX_WIDTH = 70, HEX_WIDTH = 70,
HEX_PREFIX_POSITION = 1, HEX_PREFIX_POSITION = 1;
DEFAULT_HEX = "ffffff";
/** /**
* @author windy * @author windy
@ -38,7 +37,7 @@ export class SimpleHexColorPickerEditor extends Widget {
static EVENT_CHANGE = "EVENT_CHANGE"; static EVENT_CHANGE = "EVENT_CHANGE";
props = { props = {
baseCls: "bi-color-picker-editor bi-simple-hex-color-picker-editor", baseCls: "bi-color-picker-editor",
height: 36, height: 36,
}; };
@ -113,7 +112,6 @@ export class SimpleHexColorPickerEditor extends Widget {
errorText: i18nText("BI-Color_Picker_Error_Text_Hex"), errorText: i18nText("BI-Color_Picker_Error_Text_Hex"),
width: HEX_WIDTH, width: HEX_WIDTH,
height: 24, height: 24,
value: DEFAULT_HEX,
listeners: [ listeners: [
{ {
eventName: "EVENT_CHANGE", eventName: "EVENT_CHANGE",

1
packages/fineui/src/case/combo/bubblecombo/combo.bubble.js

@ -27,7 +27,6 @@ export class BubbleCombo extends Widget {
destroyWhenHide: false, destroyWhenHide: false,
hideWhenClickOutside: true, hideWhenClickOutside: true,
hideWhenBlur: true, hideWhenBlur: true,
hideWhenAnotherComboOpen: false,
isNeedAdjustHeight: true, // 是否需要高度调整 isNeedAdjustHeight: true, // 是否需要高度调整
isNeedAdjustWidth: true, isNeedAdjustWidth: true,
stopPropagation: false, stopPropagation: false,

16
packages/fineui/src/case/combo/bubblecombo/popup.bubble.js

@ -27,13 +27,13 @@ export class BubblePopupBarView extends BubblePopupView {
static EVENT_CLICK_TOOLBAR_BUTTON = "EVENT_CLICK_TOOLBAR_BUTTON"; static EVENT_CLICK_TOOLBAR_BUTTON = "EVENT_CLICK_TOOLBAR_BUTTON";
_defaultConfig() { _defaultConfig () {
return extend(super._defaultConfig(...arguments), { return extend(super._defaultConfig(...arguments), {
extraCls: "bi-bubble-bar-popup-view", extraCls: "bi-bubble-bar-popup-view",
buttons: [{ buttons: [{
value: false, value: false,
text: i18nText("BI-Basic_Cancel"), text: i18nText("BI-Basic_Cancel"),
light: true, level: "ignore",
}, { }, {
text: i18nText(i18nText("BI-Basic_OK")), text: i18nText(i18nText("BI-Basic_OK")),
value: true, value: true,
@ -43,7 +43,7 @@ export class BubblePopupBarView extends BubblePopupView {
}); });
} }
_createToolBar() { _createToolBar () {
const o = this.options; const o = this.options;
const items = []; const items = [];
@ -75,11 +75,11 @@ export class BubblePopupBarView extends BubblePopupView {
}); });
} }
_createContent() { _createContent () {
return this.options.el; return this.options.el;
} }
_createView() { _createView () {
const o = this.options; const o = this.options;
const view = createWidget({ const view = createWidget({
@ -102,7 +102,7 @@ export class TextBubblePopupBarView extends BubblePopupBarView {
static EVENT_CHANGE = "EVENT_CLICK_TOOLBAR_BUTTON"; static EVENT_CHANGE = "EVENT_CLICK_TOOLBAR_BUTTON";
_defaultConfig() { _defaultConfig () {
const config = super._defaultConfig(...arguments); const config = super._defaultConfig(...arguments);
return extend(config, { return extend(config, {
@ -111,7 +111,7 @@ export class TextBubblePopupBarView extends BubblePopupBarView {
}); });
} }
_createContent() { _createContent () {
const o = this.options; const o = this.options;
return { return {
@ -125,7 +125,7 @@ export class TextBubblePopupBarView extends BubblePopupBarView {
}; };
} }
populate(v) { populate (v) {
this.text.setText(v || this.options.text); this.text.setText(v || this.options.text);
} }
} }

5
packages/fineui/src/case/combo/textvaluecombo/combo.textvalue.js

@ -144,8 +144,8 @@ export class TextValueCombo extends Widget {
return { return {
type: Combo.xtype, type: Combo.xtype,
height: toPix(o.height, o.simple ? 1 : 2), height: toPix(o.height, 2),
width: toPix(o.width, o.simple ? 0 : 2), width: toPix(o.width, 2),
ref: ref => (this.combo = ref), ref: ref => (this.combo = ref),
container: o.container, container: o.container,
direction: o.direction, direction: o.direction,
@ -216,7 +216,6 @@ export class TextValueCombo extends Widget {
} }
setValue(v) { setValue(v) {
this.options.value = v;
this.combo.setValue(v); this.combo.setValue(v);
this._checkError(v); this._checkError(v);
} }

8
packages/fineui/src/case/list/list.select.js

@ -71,12 +71,10 @@ export class SelectList extends Widget {
itemsCreator: (op, callback) => { itemsCreator: (op, callback) => {
op.times === 1 && this.toolbar.setVisible(false); op.times === 1 && this.toolbar.setVisible(false);
o.itemsCreator(op, (items, keywords, context, ...args) => { o.itemsCreator(op, (items, keywords, context, ...args) => {
const tipText = get(context, "tipText", ""); callback(items, keywords, context, ...args);
const isEmptyTipText = isEmptyString(tipText);
// tipText 和 items 本身就是互斥的
callback(isEmptyTipText ? items : [], keywords, context, ...args);
if (op.times === 1) { if (op.times === 1) {
const visible = isEmptyTipText && items && items.length > 0; const tipText = get(context, "tipText", "");
const visible = isEmptyString(tipText) && items && items.length > 0;
this.toolbar.setVisible(visible); this.toolbar.setVisible(visible);
this.toolbar.setEnable(this.isEnabled() && visible); this.toolbar.setEnable(this.isEnabled() && visible);
} }

53
packages/fineui/src/case/pager/pager.direction.js

@ -40,11 +40,6 @@ export class DirectionPager extends Widget {
} }
_init() { _init() {
super._init(...arguments); super._init(...arguments);
this.ITEM_GAP = 0;
this.ITEM_WIDTH = this.options.height - 2 * this.ITEM_GAP;
this.MIDDLE_GAP = 16;
this._createVPager(); this._createVPager();
this._createHPager(); this._createHPager();
this.layout = createWidget({ this.layout = createWidget({
@ -54,23 +49,23 @@ export class DirectionPager extends Widget {
items: [ items: [
{ {
el: this.vpager, el: this.vpager,
top: this.ITEM_GAP, top: 0,
right: this.ITEM_WIDTH * 3 + this.MIDDLE_GAP, right: 86,
}, },
{ {
el: this.vlabel, el: this.vlabel,
top: this.ITEM_GAP, top: 0,
right: this.ITEM_WIDTH * 4 + this.MIDDLE_GAP, right: 110,
}, },
{ {
el: this.hpager, el: this.hpager,
top: this.ITEM_GAP, top: 0,
right: 0, right: 0,
}, },
{ {
el: this.hlabel, el: this.hlabel,
top: this.ITEM_GAP, top: 0,
right: this.ITEM_WIDTH, right: 24,
} }
], ],
}); });
@ -80,20 +75,20 @@ export class DirectionPager extends Widget {
const v = this.options.vertical; const v = this.options.vertical;
this.vlabel = createWidget({ this.vlabel = createWidget({
type: Label.xtype, type: Label.xtype,
width: this.ITEM_WIDTH, width: 24,
height: this.ITEM_WIDTH, height: 24,
value: v.curr, value: v.curr,
title: v.curr, title: v.curr,
invisible: true, invisible: true,
}); });
this.vpager = createWidget({ this.vpager = createWidget({
type: Pager.xtype, type: Pager.xtype,
width: this.ITEM_WIDTH * 3, width: 72,
layouts: [ layouts: [
{ {
type: HorizontalLayout.xtype, type: HorizontalLayout.xtype,
scrollx: false, scrollx: false,
rgap: this.ITEM_WIDTH, rgap: 24,
} }
], ],
invisible: true, invisible: true,
@ -110,8 +105,8 @@ export class DirectionPager extends Widget {
value: "prev", value: "prev",
title: i18nText("BI-Up_Page"), title: i18nText("BI-Up_Page"),
warningTitle: i18nText("BI-Current_Is_First_Page"), warningTitle: i18nText("BI-Current_Is_First_Page"),
height: this.ITEM_WIDTH - 2, height: 22,
width: this.ITEM_WIDTH - 2, width: 22,
cls: "bi-border bi-border-radius direction-pager-prev column-pre-page-h-font bi-list-item-select2", cls: "bi-border bi-border-radius direction-pager-prev column-pre-page-h-font bi-list-item-select2",
}, },
next: { next: {
@ -119,8 +114,8 @@ export class DirectionPager extends Widget {
value: "next", value: "next",
title: i18nText("BI-Down_Page"), title: i18nText("BI-Down_Page"),
warningTitle: i18nText("BI-Current_Is_Last_Page"), warningTitle: i18nText("BI-Current_Is_Last_Page"),
height: this.ITEM_WIDTH - 2, height: 22,
width: this.ITEM_WIDTH - 2, width: 22,
cls: "bi-border bi-border-radius direction-pager-next column-next-page-h-font bi-list-item-select2", cls: "bi-border bi-border-radius direction-pager-next column-next-page-h-font bi-list-item-select2",
}, },
@ -142,20 +137,20 @@ export class DirectionPager extends Widget {
const h = this.options.horizontal; const h = this.options.horizontal;
this.hlabel = createWidget({ this.hlabel = createWidget({
type: Label.xtype, type: Label.xtype,
width: this.ITEM_WIDTH, width: 24,
height: this.ITEM_WIDTH, height: 24,
value: h.curr, value: h.curr,
title: h.curr, title: h.curr,
invisible: true, invisible: true,
}); });
this.hpager = createWidget({ this.hpager = createWidget({
type: Pager.xtype, type: Pager.xtype,
width: this.ITEM_WIDTH * 3, width: 72,
layouts: [ layouts: [
{ {
type: HorizontalLayout.xtype, type: HorizontalLayout.xtype,
scrollx: false, scrollx: false,
rgap: this.ITEM_WIDTH, rgap: 24,
} }
], ],
invisible: true, invisible: true,
@ -172,8 +167,8 @@ export class DirectionPager extends Widget {
value: "prev", value: "prev",
title: i18nText("BI-Left_Page"), title: i18nText("BI-Left_Page"),
warningTitle: i18nText("BI-Current_Is_First_Page"), warningTitle: i18nText("BI-Current_Is_First_Page"),
height: this.ITEM_WIDTH - 2, height: 22,
width: this.ITEM_WIDTH - 2, width: 22,
cls: "bi-border bi-border-radius direction-pager-prev row-pre-page-h-font bi-list-item-select2", cls: "bi-border bi-border-radius direction-pager-prev row-pre-page-h-font bi-list-item-select2",
}, },
next: { next: {
@ -181,8 +176,8 @@ export class DirectionPager extends Widget {
value: "next", value: "next",
title: i18nText("BI-Right_Page"), title: i18nText("BI-Right_Page"),
warningTitle: i18nText("BI-Current_Is_Last_Page"), warningTitle: i18nText("BI-Current_Is_Last_Page"),
height: this.ITEM_WIDTH - 2, height: 22,
width: this.ITEM_WIDTH - 2, width: 22,
cls: "bi-border bi-border-radius direction-pager-next row-next-page-h-font bi-list-item-select2", cls: "bi-border bi-border-radius direction-pager-next row-next-page-h-font bi-list-item-select2",
}, },
@ -265,7 +260,7 @@ export class DirectionPager extends Widget {
vShow = true; vShow = true;
} }
this.setVisible(hShow || vShow); this.setVisible(hShow || vShow);
const num = [this.ITEM_WIDTH * 3 + this.MIDDLE_GAP, this.ITEM_WIDTH * 4 + this.MIDDLE_GAP, 0, this.ITEM_WIDTH]; const num = [86, 110, 0, 24];
const items = this.layout.attr("items"); const items = this.layout.attr("items");
if (vShow === true && hShow === true) { if (vShow === true && hShow === true) {

43
packages/fineui/src/case/ztree/asynctree.js

@ -1,19 +1,7 @@
import { import { cjkEncodeDO, deepClone, each, extend, isEmpty, isNotNull, isNull, shortcut } from "@/core";
cjkEncodeDO,
deepClone,
each,
extend,
isEmpty,
isNotNull,
isNull,
shortcut,
AbsoluteLayout,
createWidget,
} from "@/core";
import { TreeView } from "./treeview"; import { TreeView } from "./treeview";
import { TreeRenderPageService } from "./treerender.page.service"; import { TreeRenderPageService } from "./treerender.page.service";
import $ from "jquery"; import $ from "jquery";
import { IconLabel } from "@/base";
@shortcut() @shortcut()
export class AsyncTree extends TreeView { export class AsyncTree extends TreeView {
@ -209,34 +197,7 @@ export class AsyncTree extends TreeView {
}, },
options options
); );
o.itemsCreator(op, complete);
let loadingIcon;
createWidget({
type: AbsoluteLayout.xtype,
element: self.element.find(`#${treeNode.tId}`),
css: {
position: "relative",
},
items: [
{
el: {
type: IconLabel.xtype,
width: 20,
height: 20,
cls: "button-loading-font anim-rotate bi-card",
ref: ref => {
loadingIcon = ref;
},
},
left: 5,
top: 5,
},
],
});
o.itemsCreator(op, (...args) => {
complete.apply(this, args);
loadingIcon.destroy();
});
} }
// 展开节点会将halfCheck置为false以开启自动计算半选, 所以第一次展开节点的时候需要在置为false之前获取配置 // 展开节点会将halfCheck置为false以开启自动计算半选, 所以第一次展开节点的时候需要在置为false之前获取配置

4
packages/fineui/src/case/ztree/list/listasynctree.js

@ -1,4 +1,4 @@
import { ListTreeView } from "./listtreeview"; import { Listtreeview } from "./listtreeview";
import { cjkEncodeDO, delay, isEmpty, shortcut, extend } from "@/core"; import { cjkEncodeDO, delay, isEmpty, shortcut, extend } from "@/core";
import $ from "jquery"; import $ from "jquery";
@ -11,7 +11,7 @@ import $ from "jquery";
*/ */
@shortcut() @shortcut()
export class ListAsyncTree extends ListTreeView { export class Listasynctree extends Listtreeview {
static xtype = "bi.list_async_tree"; static xtype = "bi.list_async_tree";
// 配置属性 // 配置属性

4
packages/fineui/src/case/ztree/list/listparttree.js

@ -1,4 +1,4 @@
import { ListAsyncTree } from "./listasynctree"; import { Listasynctree } from "./listasynctree";
import { shortcut, extend, Events, delay } from "@/core"; import { shortcut, extend, Events, delay } from "@/core";
import { TreeView } from "../treeview"; import { TreeView } from "../treeview";
import $ from "jquery"; import $ from "jquery";
@ -11,7 +11,7 @@ import $ from "jquery";
*/ */
@shortcut() @shortcut()
export class ListPartTree extends ListAsyncTree { export class ListPartTree extends Listasynctree {
static xtype = "bi.list_part_tree"; static xtype = "bi.list_part_tree";
_loadMore() { _loadMore() {

2
packages/fineui/src/case/ztree/list/listtreeview.js

@ -11,7 +11,7 @@ import $ from "jquery";
*/ */
@shortcut() @shortcut()
export class ListTreeView extends TreeView { export class Listtreeview extends TreeView {
static xtype = "bi.list_tree_view"; static xtype = "bi.list_tree_view";
_constants = { _constants = {

15
packages/fineui/src/case/ztree/parttree.js

@ -16,15 +16,9 @@ export class PartTree extends AsyncTree {
static EVENT_CLICK_TREE_NODE = "EVENT_CLICK_TREE_NODE"; static EVENT_CLICK_TREE_NODE = "EVENT_CLICK_TREE_NODE";
_defaultConfig() {
return extend(super._defaultConfig(...arguments), {
isSelectedAny: true, //是否返回所有被checked的结点(包括被checked的结点的子结点)
});
}
constructor(...args) { constructor(...args) {
super(...args); super(...args);
this.seMethos = AsyncTree.superclass._selectTreeNode; this.seMethos = super._selectTreeNode;
} }
_loadMore() { _loadMore() {
@ -61,11 +55,8 @@ export class PartTree extends AsyncTree {
const name = this._getNodeValue(treeNode); const name = this._getNodeValue(treeNode);
this.fireEvent(PartTree.EVENT_CLICK_TREE_NODE); this.fireEvent(PartTree.EVENT_CLICK_TREE_NODE);
if (treeNode.checked === true) { if (treeNode.checked === true) {
if (this.options.isSelectedAny) { this.options.paras.selectedValues = this._getUnionValue();
this.options.paras.selectedValues = this._getUnionValue(); //获取所有被selected的结点 // this._buildTree(self.options.paras.selectedValues, concat(parentValues, name));
} else {
this._addTreeNode(this.options.paras.selectedValues, parentValues, name, {});//给selectedValues增加被click的结点(不包含该节点的子结点)
}
o.itemsCreator( o.itemsCreator(
extend({}, o.paras, { extend({}, o.paras, {
type: TreeView.REQ_TYPE_ADJUST_DATA, type: TreeView.REQ_TYPE_ADJUST_DATA,

4
packages/fineui/src/case/ztree/tree.list.display.js

@ -1,4 +1,4 @@
import { ListTreeView } from "./list/listtreeview"; import { Listtreeview } from "./list/listtreeview";
import { each, shortcut, i18nText } from "@/core"; import { each, shortcut, i18nText } from "@/core";
import $ from "jquery"; import $ from "jquery";
@ -10,7 +10,7 @@ import $ from "jquery";
*/ */
@shortcut() @shortcut()
export class ListDisplayTree extends ListTreeView { export class ListDisplayTree extends Listtreeview {
static xtype = "bi.list_display_tree"; static xtype = "bi.list_display_tree";
static EVENT_CHANGE = "EVENT_CHANGE"; static EVENT_CHANGE = "EVENT_CHANGE";

2
packages/fineui/src/component/form/form.field.js

@ -69,7 +69,7 @@ export class FormField extends Widget {
return { return {
type: VerticalAdaptLayout.xtype, type: VerticalAdaptLayout.xtype,
columnSize: isKey(o.label) ? ["auto", "fill"] : ["fill"], columnSize: ["auto", "fill"],
verticalAlign: VerticalAlign.Stretch, verticalAlign: VerticalAlign.Stretch,
items: isKey(o.label) items: isKey(o.label)
? [ ? [

34
packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.js

@ -169,13 +169,11 @@ export class AbstractTreeValueChooser extends Widget {
value: node.value, value: node.value,
open: true, open: true,
disabled: node.disabled, disabled: node.disabled,
iconCls: node.iconCls,
}); });
} }
} }
_reqSelectedTreeNode(op, callback) { _reqSelectedTreeNode(op, callback) {
const self = this;
const selectedValues = deepClone(op.selectedValues); const selectedValues = deepClone(op.selectedValues);
const notSelectedValue = op.notSelectedValue || {}; const notSelectedValue = op.notSelectedValue || {};
const keyword = op.keyword || ""; const keyword = op.keyword || "";
@ -190,7 +188,7 @@ export class AbstractTreeValueChooser extends Widget {
dealWithSelectedValues(selectedValues); dealWithSelectedValues(selectedValues);
callback(selectedValues); callback(selectedValues);
function dealWithSelectedValues(selectedValues) { const dealWithSelectedValues = selectedValues => {
let p = parentValues.concat(notSelectedValue); let p = parentValues.concat(notSelectedValue);
// 存储的值中存在这个值就把它删掉 // 存储的值中存在这个值就把它删掉
// 例如选中了中国-江苏-南京, 取消中国或江苏或南京 // 例如选中了中国-江苏-南京, 取消中国或江苏或南京
@ -199,18 +197,18 @@ export class AbstractTreeValueChooser extends Widget {
// 如果搜索的值在父亲链中 // 如果搜索的值在父亲链中
if (isSearchValueInParent(p)) { if (isSearchValueInParent(p)) {
// 例如选中了 中国-江苏, 搜索江苏, 取消江苏(干掉了江苏) // 例如选中了 中国-江苏, 搜索江苏, 取消江苏(干掉了江苏)
self._deleteNode(selectedValues, p); this._deleteNode(selectedValues, p);
} else { } else {
const searched = []; const searched = [];
// 要找到所有以notSelectedValue为叶子节点的链路 // 要找到所有以notSelectedValue为叶子节点的链路
const find = search(parentValues, notSelectedValue, [], searched); const find = search(parentValues, notSelectedValue, [], searched);
if (find && isNotEmptyArray(searched)) { if (find && isNotEmptyArray(searched)) {
each(searched, (i, arr) => { each(searched, (i, arr) => {
const node = self._getNode(selectedValues, arr); const node = this._getNode(selectedValues, arr);
if (node) { if (node) {
// 例如选中了 中国-江苏, 搜索江苏, 取消中国(实际上只想删除中国-江苏,因为搜的是江苏) // 例如选中了 中国-江苏, 搜索江苏, 取消中国(实际上只想删除中国-江苏,因为搜的是江苏)
// 例如选中了 中国-江苏-南京,搜索南京,取消中国(实际上只想删除中国-江苏-南京,因为搜的是南京) // 例如选中了 中国-江苏-南京,搜索南京,取消中国(实际上只想删除中国-江苏-南京,因为搜的是南京)
self._deleteNode(selectedValues, arr); this._deleteNode(selectedValues, arr);
} else { } else {
// 例如选中了 中国-江苏,搜索南京,取消中国(实际上只想删除中国-江苏-南京,因为搜的是南京) // 例如选中了 中国-江苏,搜索南京,取消中国(实际上只想删除中国-江苏-南京,因为搜的是南京)
expandSelectedValue(selectedValues, arr, last(arr)); expandSelectedValue(selectedValues, arr, last(arr));
@ -241,14 +239,14 @@ export class AbstractTreeValueChooser extends Widget {
// 添加去掉搜索的结果集 // 添加去掉搜索的结果集
if (result.length > 0) { if (result.length > 0) {
each(result, (i, strs) => { each(result, (i, strs) => {
self._buildTree(selectedValues, strs); this._buildTree(selectedValues, strs);
}); });
} }
} }
} }
}; };
function expandSelectedValue(selectedValues, parents, notSelectedValue) { const expandSelectedValue = (selectedValues, parents, notSelectedValue) => {
let next = selectedValues; let next = selectedValues;
const childrenCount = []; const childrenCount = [];
const path = []; const path = [];
@ -261,7 +259,7 @@ export class AbstractTreeValueChooser extends Widget {
} }
if (isEmpty(next)) { if (isEmpty(next)) {
const split = parents.slice(0, i); const split = parents.slice(0, i);
const expanded = self._getChildren(split); const expanded = this._getChildren(split);
path.push(split); path.push(split);
childrenCount.push(expanded.length); childrenCount.push(expanded.length);
// 如果只有一个值且取消的就是这个值 // 如果只有一个值且取消的就是这个值
@ -272,7 +270,7 @@ export class AbstractTreeValueChooser extends Widget {
) { ) {
for (let j = childrenCount.length - 1; j >= 0; j--) { for (let j = childrenCount.length - 1; j >= 0; j--) {
if (childrenCount[j] === 1) { if (childrenCount[j] === 1) {
self._deleteNode(selectedValues, path[j]); this._deleteNode(selectedValues, path[j]);
} else { } else {
break; break;
} }
@ -297,16 +295,16 @@ export class AbstractTreeValueChooser extends Widget {
}); });
}; };
function search(parents, current, result, searched) { const search = (parents, current, result, searched) => {
const newParents = clone(parents); const newParents = clone(parents);
newParents.push(current); newParents.push(current);
if (self._isMatch(parents, current, keyword)) { if (this._isMatch(parents, current, keyword)) {
searched && searched.push(newParents); searched && searched.push(newParents);
return true; return true;
} }
const children = self._getChildren(newParents); const children = this._getChildren(newParents);
const notSearch = []; const notSearch = [];
let can = false; let can = false;
@ -329,9 +327,9 @@ export class AbstractTreeValueChooser extends Widget {
return can; return can;
}; };
function isSearchValueInParent(parentValues) { const isSearchValueInParent = parentValues => {
for (let i = 0, len = parentValues.length; i < len; i++) { for (let i = 0, len = parentValues.length; i < len; i++) {
if (self._isMatch(parentValues.slice(0, i), parentValues[i], keyword)) { if (this._isMatch(parentValues.slice(0, i), parentValues[i], keyword)) {
return true; return true;
} }
} }
@ -391,7 +389,7 @@ export class AbstractTreeValueChooser extends Widget {
each(selected, (k, v) => { each(selected, (k, v) => {
const p = clone(parents); const p = clone(parents);
p.push(k); p.push(k);
if (!dealWithSelectedValues(selected[k], p) || op.searcherPaneAutoShrink === false) { if (!dealWithSelectedValues(selected[k], p)) {
each(selected[k], (nk, nv) => { each(selected[k], (nk, nv) => {
const t = clone(p); const t = clone(p);
t.push(nk); t.push(nk);
@ -430,7 +428,7 @@ export class AbstractTreeValueChooser extends Widget {
}); });
}); });
function search() { function search(){
const children = self._getChildren([]); const children = self._getChildren([]);
let start = children.length; let start = children.length;
if (lastSearchValue !== "") { if (lastSearchValue !== "") {
@ -532,7 +530,6 @@ export class AbstractTreeValueChooser extends Widget {
halfCheck: half, halfCheck: half,
flag, flag,
disabled: node.disabled, disabled: node.disabled,
iconCls: node.iconCls,
}); });
} }
@ -704,7 +701,6 @@ export class AbstractTreeValueChooser extends Widget {
disabled: nodes[i].disabled, disabled: nodes[i].disabled,
title: nodes[i].title || nodes[i].text, title: nodes[i].title || nodes[i].text,
warningTitle: nodes[i].warningTitle, warningTitle: nodes[i].warningTitle,
iconCls: nodes[i].iconCls,
}); });
if (openState) { if (openState) {
getResult(parentValues.concat([nodes[i].value]), { checked: state[0], half: state[1] }); getResult(parentValues.concat([nodes[i].value]), { checked: state[0], half: state[1] });

25
packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.list.js

@ -31,7 +31,7 @@ export class AbstractListTreeValueChooser extends AbstractTreeValueChooser {
return; return;
} }
doCheck.call(this, [], this.tree.getRoot(), selectedValues); doCheck([], this.tree.getRoot(), selectedValues);
callback({ callback({
items: values(result), items: values(result),
@ -76,7 +76,6 @@ export class AbstractListTreeValueChooser extends AbstractTreeValueChooser {
} }
_reqInitTreeNode(op, callback) { _reqInitTreeNode(op, callback) {
const self = this;
let result = []; let result = [];
const keyword = op.keyword || ""; const keyword = op.keyword || "";
const selectedValues = op.selectedValues; const selectedValues = op.selectedValues;
@ -90,8 +89,8 @@ export class AbstractListTreeValueChooser extends AbstractTreeValueChooser {
}); });
}); });
function search() { const search = () => {
const children = self._getChildren([]); const children = this._getChildren([]);
let start = children.length; let start = children.length;
if (lastSearchValue !== "") { if (lastSearchValue !== "") {
for (let j = 0, len = start; j < len; j++) { for (let j = 0, len = start; j < len; j++) {
@ -106,22 +105,22 @@ export class AbstractListTreeValueChooser extends AbstractTreeValueChooser {
const output = []; const output = [];
let find; let find;
for (let i = start, len = children.length; i < len; i++) { for (let i = start, len = children.length; i < len; i++) {
if (output.length < self._const.perPage) { if (output.length < this._const.perPage) {
find = nodeSearch(1, [], children[i].value, result); find = nodeSearch(1, [], children[i].value, result);
} else if (output.length === self._const.perPage) { } else if (output.length === this._const.perPage) {
find = nodeSearch(1, [], children[i].value, []); find = nodeSearch(1, [], children[i].value, []);
} }
if (find[0] === true) { if (find[0] === true) {
output.push(children[i].value); output.push(children[i].value);
} }
if (output.length > self._const.perPage) { if (output.length > this._const.perPage) {
break; break;
} }
} }
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加 // 深层嵌套的比较麻烦,这边先实现的是在根节点添加
if (op.times === 1) { if (op.times === 1) {
const nodes = self._getAddedValueNode([], selectedValues); const nodes = this._getAddedValueNode([], selectedValues);
result = concat( result = concat(
filter(nodes, (idx, node) => { filter(nodes, (idx, node) => {
const find = Func.getSearchResult([node.text || node.value], keyword); const find = Func.getSearchResult([node.text || node.value], keyword);
@ -135,8 +134,8 @@ export class AbstractListTreeValueChooser extends AbstractTreeValueChooser {
return output; return output;
}; };
function createOneJson(parentValues, value, isOpen, checked, flag, result) { const createOneJson = (parentValues, value, isOpen, checked, flag, result) => {
const node = self._getTreeNode(parentValues, value); const node = this._getTreeNode(parentValues, value);
result.push({ result.push({
id: node.id, id: node.id,
pId: node.pId, pId: node.pId,
@ -152,9 +151,9 @@ export class AbstractListTreeValueChooser extends AbstractTreeValueChooser {
}); });
}; };
function nodeSearch(deep, parentValues, current, result) { const nodeSearch = (deep, parentValues, current, result) => {
let checked; let checked;
if (self._isMatch(parentValues, current, keyword)) { if (this._isMatch(parentValues, current, keyword)) {
checked = isSelected(parentValues, current); checked = isSelected(parentValues, current);
createOneJson(parentValues, current, false, checked, true, result); createOneJson(parentValues, current, false, checked, true, result);
@ -162,7 +161,7 @@ export class AbstractListTreeValueChooser extends AbstractTreeValueChooser {
} }
const newParents = clone(parentValues); const newParents = clone(parentValues);
newParents.push(current); newParents.push(current);
const children = self._getChildren(newParents); const children = this._getChildren(newParents);
let can = false; let can = false;
checked = false; checked = false;

11
packages/fineui/src/component/treevaluechooser/pane.treevaluechooser.js

@ -15,10 +15,6 @@ export class TreeValueChooserPane extends AbstractTreeValueChooser {
items: null, items: null,
itemsCreator: emptyFn, itemsCreator: emptyFn,
showLine: true, showLine: true,
showIcon: false,
//searcherPaneAutoShrink和searcherPaneIsSelectedAny同时为false时,返回值和非搜索状态下的树逻辑一致
searcherPaneAutoShrink: true,//其搜索树是否会判别子结点全选则取父结点的值
searcherPaneIsSelectedAny: true, //其搜索树是否返回所有被checked的结点(包括被checked的结点的子结点)
}); });
} }
@ -29,12 +25,7 @@ export class TreeValueChooserPane extends AbstractTreeValueChooser {
type: o.hideSearch ? MultiSelectTreePopup.xtype : MultiSelectTree.xtype, type: o.hideSearch ? MultiSelectTreePopup.xtype : MultiSelectTree.xtype,
element: this, element: this,
showLine: o.showLine, showLine: o.showLine,
showIcon: o.showIcon, itemsCreator: bind(this._itemsCreator, this),
searcherPaneIsSelectedAny: o.hideSearch || o.searcherPaneIsSelectedAny,
itemsCreator: (options, callback) => {
options.searcherPaneAutoShrink = o.hideSearch || o.searcherPaneAutoShrink;
this._itemsCreator.call(this, options, callback);
},
}); });
this.pane.on(MultiSelectTree.EVENT_CHANGE, () => { this.pane.on(MultiSelectTree.EVENT_CHANGE, () => {

33
packages/fineui/src/core/1.lodash.js

@ -14,7 +14,7 @@
var undefined; var undefined;
/** Used as the semantic version number. */ /** Used as the semantic version number. */
var VERSION = '4.17.21'; var VERSION = '4.17.5';
/** Used as the size to enable large array optimizations. */ /** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200; var LARGE_ARRAY_SIZE = 200;
@ -899,7 +899,7 @@
} }
/** /**
* Gets the value at `key`, unless `key` is "__proto__" or "constructor". * Gets the value at `key`, unless `key` is "__proto__".
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
@ -907,10 +907,6 @@
* @returns {*} Returns the property value. * @returns {*} Returns the property value.
*/ */
function safeGet(object, key) { function safeGet(object, key) {
if (key === 'constructor' && typeof object[key] === 'function') {
return;
}
return key == '__proto__' return key == '__proto__'
? undefined ? undefined
: object[key]; : object[key];
@ -6146,30 +6142,6 @@
return (array && array.length) ? baseUniq(array, baseIteratee(iteratee, 2)) : []; return (array && array.length) ? baseUniq(array, baseIteratee(iteratee, 2)) : [];
} }
/**
* This method is like `uniq` except that it accepts `comparator` which
* is invoked to compare elements of `array`. The order of result values is
* determined by the order they occur in the array. The comparator is invoked
* with two arguments: (arrVal, othVal).
*
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @see uniq, uniqBy
* @example
*
* const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]
*
* uniqWith(objects, isEqual)
* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
*/
function uniqWith(array, comparator) {
comparator = typeof comparator === 'function' ? comparator : undefined;
return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
}
/** /**
* This method is like `_.zip` except that it accepts an array of grouped * This method is like `_.zip` except that it accepts an array of grouped
* elements and creates an array regrouping the elements to their pre-zip * elements and creates an array regrouping the elements to their pre-zip
@ -10069,7 +10041,6 @@
lodash.union = union; lodash.union = union;
lodash.uniq = uniq; lodash.uniq = uniq;
lodash.uniqBy = uniqBy; lodash.uniqBy = uniqBy;
lodash.uniqWith = uniqWith;
lodash.unzip = unzip; lodash.unzip = unzip;
lodash.values = values; lodash.values = values;
lodash.without = without; lodash.without = without;

23
packages/fineui/src/core/2.base.js

@ -482,7 +482,6 @@ _.each(
"take", "take",
"takeRight", "takeRight",
"uniqBy", "uniqBy",
"uniqWith"
], ],
name => { name => {
lodashFns[name] = _apply(name); lodashFns[name] = _apply(name);
@ -511,7 +510,6 @@ export const range = lodashFns.range;
export const take = lodashFns.take; export const take = lodashFns.take;
export const takeRight = lodashFns.takeRight; export const takeRight = lodashFns.takeRight;
export const uniqBy = lodashFns.uniqBy; export const uniqBy = lodashFns.uniqBy;
export const uniqWith = lodashFns.uniqWith;
export const findIndex = lodashFns.findIndex; export const findIndex = lodashFns.findIndex;
export const findLastIndex = lodashFns.findLastIndex; export const findLastIndex = lodashFns.findLastIndex;
@ -914,8 +912,7 @@ export const delay = lodashFns.delay;
export const defer = lodashFns.defer; export const defer = lodashFns.defer;
export const wrap = lodashFns.wrap; export const wrap = lodashFns.wrap;
export const nextTick = (function () {
export let nextTick = /*!PURE*/(function () {
const callbacks = []; const callbacks = [];
let pending = false; let pending = false;
let timerFunc = void 0; let timerFunc = void 0;
@ -974,7 +971,7 @@ export let nextTick = /*!PURE*/(function () {
pending = true; pending = true;
timerFunc(); timerFunc();
} }
// $flow-disable-line
if (!cb && typeof Promise !== "undefined") { if (!cb && typeof Promise !== "undefined") {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
_resolve = resolve; _resolve = resolve;
@ -983,10 +980,6 @@ export let nextTick = /*!PURE*/(function () {
}; };
})(); })();
export const setNextTick = (fn) => {
nextTick = fn;
}
// 数字相关方法 // 数字相关方法
_.each(["random"], name => { _.each(["random"], name => {
lodashFns[name] = _apply(name); lodashFns[name] = _apply(name);
@ -1234,19 +1227,19 @@ export function checkDateVoid(YY, MM, DD, minDate, maxDate) {
} else if (YY > maxDate[0]) { } else if (YY > maxDate[0]) {
back = ["y", 1]; back = ["y", 1];
} else if (YY >= minDate[0] && YY <= maxDate[0]) { } else if (YY >= minDate[0] && YY <= maxDate[0]) {
if (YY == minDate[0]) { if (YY === minDate[0]) {
if (MM < minDate[1]) { if (MM < minDate[1]) {
back = ["m"]; back = ["m"];
} else if (MM == minDate[1]) { } else if (MM === minDate[1]) {
if (DD < minDate[2]) { if (DD < minDate[2]) {
back = ["d"]; back = ["d"];
} }
} }
} }
if (YY == maxDate[0]) { if (YY === maxDate[0]) {
if (MM > maxDate[1]) { if (MM > maxDate[1]) {
back = ["m", 1]; back = ["m", 1];
} else if (MM == maxDate[1]) { } else if (MM === maxDate[1]) {
if (DD > maxDate[2]) { if (DD > maxDate[2]) {
back = ["d", 1]; back = ["d", 1];
} }
@ -1369,7 +1362,7 @@ export function parseDateTime(str, fmt) {
m = today.getMonth(); m = today.getMonth();
} }
if (_global.isNaN(d)) { if (_global.isNaN(d)) {
d = 1; d = Math.min(getMonthDays(getDate(y, m)), today.getDate());
} }
if (_global.isNaN(hr)) { if (_global.isNaN(hr)) {
hr = today.getHours(); hr = today.getHours();
@ -1518,7 +1511,7 @@ export function getTime() {
} }
if (isNotNull(BI.timeZone)) { if (isNotNull(BI.timeZone)) {
// BI-33791 1901年以前的东8区标准是GMT+0805, 统一无论是什么时间,都以整的0800这样的为基准 // BI-33791 1901年以前的东8区标准是GMT+0805, 统一无论是什么时间,都以整的0800这样的为基准
return dt.getTime() + BI.timeZone + new Date().getTimezoneOffset() * 60000; return dt.getTime() - BI.timeZone - new Date().getTimezoneOffset() * 60000;
} }
return dt.getTime(); return dt.getTime();

2
packages/fineui/src/core/3.ob.js

@ -155,7 +155,7 @@ export class OB {
eventName = eventName.toLowerCase(); eventName = eventName.toLowerCase();
/* alex:如果fn是null,就是把eventName上面所有方法都un掉*/ /* alex:如果fn是null,就是把eventName上面所有方法都un掉*/
if (!fn) { if (fn === null) {
delete this._getEvents()[eventName]; delete this._getEvents()[eventName];
} else { } else {
const fns = this._getEvents()[eventName]; const fns = this._getEvents()[eventName];

33
packages/fineui/src/core/4.widget.js

@ -25,7 +25,7 @@ import {
import { OB } from "./3.ob"; import { OB } from "./3.ob";
import { Providers, _lazyCreateWidget } from "./5.inject"; import { Providers, _lazyCreateWidget } from "./5.inject";
import { DOM } from "./utils"; import { DOM } from "./utils";
import { Events, pixFormat } from "./constant"; import { Events, emptyFn, pixFormat } from "./constant";
import { Plugin } from "./6.plugin"; import { Plugin } from "./6.plugin";
import { _global } from "./0.foundation"; import { _global } from "./0.foundation";
import { SystemProvider } from "./system"; import { SystemProvider } from "./system";
@ -241,8 +241,7 @@ export class Widget extends OB {
if (beforeRenderResult instanceof Promise) { if (beforeRenderResult instanceof Promise) {
beforeRenderResult.then(render).catch((e) => { beforeRenderResult.then(render).catch((e) => {
_global.console && console.error(e); _global.console && console.error(e);
// 异步render,组件此时可能已经被销毁 render();
!this.isDestroyed() ? render() : _global.console && console.error('Async render error! Widget has been destroyed!');
}); });
} }
} else { } else {
@ -259,8 +258,7 @@ export class Widget extends OB {
if (beforeInitResult instanceof Promise) { if (beforeInitResult instanceof Promise) {
beforeInitResult.then(init).catch((e) => { beforeInitResult.then(init).catch((e) => {
_global.console && console.error(e); _global.console && console.error(e);
// 异步init,组件此时可能已经被销毁 init();
!this.isDestroyed() ? init() : _global.console && console.error('Async init error! Widget has been destroyed!');
}); });
} }
} else { } else {
@ -338,6 +336,29 @@ export class Widget extends OB {
} }
} }
__watch(getter, handler, options) {
if (_global.Fix) {
this._watchers = this._watchers || [];
const watcher = new Fix.Watcher(
null,
() => getter.call(this, this),
(handler &&
((v) => {
handler.call(this, this, v);
})) ||
emptyFn,
extend({ deep: true }, options)
);
this._watchers.push(() => {
watcher.teardown();
});
return watcher.value;
} else {
return getter();
}
}
/** /**
* 初始化根节点 * 初始化根节点
* @private * @private
@ -870,13 +891,13 @@ export class Widget extends OB {
callLifeHook(this, "destroyed"); callLifeHook(this, "destroyed");
this.destroyed = null; this.destroyed = null;
this._isDestroyed = true; this._isDestroyed = true;
// this._purgeRef(); // 清除ref的时机还是要仔细考虑一下
} }
_unMount() { _unMount() {
this._assetMounted(); this._assetMounted();
this.__destroy(); this.__destroy();
this.fireEvent(Events.UNMOUNT); this.fireEvent(Events.UNMOUNT);
// this._purgeRef(); // 子组件unmount ref置为null了,父组件拿不到ref,导致报错
this.purgeListeners(); this.purgeListeners();
} }

11
packages/fineui/src/core/5.inject.js

@ -427,7 +427,7 @@ const providers = {},
export const Providers = { export const Providers = {
getProvider: (type, config) => { getProvider: (type, config) => {
if (!providerInjection[type]) { if (!providerInjection[type]) {
_global.console && console.warn(`provider: [${type}] undefined`); _global.console && console.error(`provider: [${type}] undefined`);
} }
runConfigFunction(type); runConfigFunction(type);
if (!providers[type]) { if (!providers[type]) {
@ -601,12 +601,3 @@ export function getResource(type, config) {
} }
throw new Error("unknown type: [" + type + "] undefined"); throw new Error("unknown type: [" + type + "] undefined");
} }
/**
* 根据 xtype 获取已被注册的类
* @param {string} xtype
* @returns
*/
export function getClass(xtype) {
return kv[xtype] || serviceInjection[xtype];
}

126
packages/fineui/src/core/constant/writable.var.js

@ -1,72 +1,76 @@
/** /**
* 可写的常量 * 可写的常量
*/ */
import { isNumber, nextTick, setNextTick } from "../2.base"; import { isNumber } from "../2.base";
import { _global } from "../0.foundation"; import { _global } from "../0.foundation";
import { Cache } from "../structure"; import { Cache } from "../structure";
import { Element, setElement } from "../element/element";
import { setDom, DOM } from "../utils";
const PropertyDescriptors = {}; const PropertyDescriptors = {};
export function _defineVarProperties(libName) {
Object.defineProperties(libName, PropertyDescriptors);
}
function addDescriptor(key, options) {
options.enumerable = options.enumerable === undefined ? true : options.enumerable;
options.configurable = options.configurable === undefined ? true : options.configurable;
PropertyDescriptors[key] = options;
}
export let EVENT_RESPONSE_TIME = 200; export let EVENT_RESPONSE_TIME = 200;
export const setEventResponseTime = v => { export const setEventResponseTime = v => {
EVENT_RESPONSE_TIME = v; EVENT_RESPONSE_TIME = v;
}; };
addDescriptor("EVENT_RESPONSE_TIME", { PropertyDescriptors["EVENT_RESPONSE_TIME"] = {
get: () => EVENT_RESPONSE_TIME, enumerable: true,
configurable: true,
get: function () {
return EVENT_RESPONSE_TIME;
},
set: setEventResponseTime, set: setEventResponseTime,
}); };
export let pixUnit = "px"; export let pixUnit = "px";
export const setPixUnit = v => { export const setPixUnit = v => {
pixUnit = v; pixUnit = v;
}; };
addDescriptor("pixUnit", { PropertyDescriptors["pixUnit"] = {
get: () => pixUnit, enumerable: true,
configurable: true,
get: function () {
return pixUnit;
},
set: setPixUnit, set: setPixUnit,
}); };
export let pixRatio = 1; export let pixRatio = 1;
export const setPixRatio = v => { export const setPixRatio = v => {
pixRatio = v; pixRatio = v;
}; };
addDescriptor("pixRatio", { PropertyDescriptors["pixRatio"] = {
get: () => pixRatio, enumerable: true,
configurable: true,
get: function () {
return pixRatio;
},
set: setPixRatio, set: setPixRatio,
}); };
export let StartOfWeek = 1; export let StartOfWeek = 1;
export const setStartOfWeek = v => { export const setStartOfWeek = v => {
if (![0, 1].includes(v)) {
console.error("setStartOfWeek must be 0 or 1");
return;
}
StartOfWeek = v; StartOfWeek = v;
}; };
addDescriptor("StartOfWeek", { PropertyDescriptors["StartOfWeek"] = {
get: () => StartOfWeek, enumerable: true,
configurable: true,
get: function () {
return StartOfWeek;
},
set: setStartOfWeek, set: setStartOfWeek,
}); };
export let BlankSplitChar = "\u200b \u200b"; export let BlankSplitChar = "\u200b \u200b";
export const setBlankSplitChar = v => { export const setBlankSplitChar = v => {
BlankSplitChar = v; BlankSplitChar = v;
}; };
addDescriptor("BlankSplitChar", { PropertyDescriptors["BlankSplitChar"] = {
get: () => BlankSplitChar, enumerable: true,
configurable: true,
get: function () {
return BlankSplitChar;
},
set: setBlankSplitChar, set: setBlankSplitChar,
}); };
// 一定返回最终的单位 // 一定返回最终的单位
export let pixFormat = (pix, border) => { export let pixFormat = (pix, border) => {
@ -86,10 +90,14 @@ export let pixFormat = (pix, border) => {
export const setPixFormat = v => { export const setPixFormat = v => {
pixFormat = v; pixFormat = v;
}; };
addDescriptor("pixFormat", { PropertyDescriptors["pixFormat"] = {
get: () => pixFormat, enumerable: true,
configurable: true,
get: function () {
return pixFormat;
},
set: setPixFormat, set: setPixFormat,
}); };
export let toPix = (pix, border) => { export let toPix = (pix, border) => {
if (!isNumber(pix)) { if (!isNumber(pix)) {
@ -107,10 +115,14 @@ export let toPix = (pix, border) => {
export let setToPix = v => { export let setToPix = v => {
toPix = v; toPix = v;
}; };
addDescriptor("toPix", { PropertyDescriptors["toPix"] = {
get: () => toPix, enumerable: true,
configurable: true,
get: function () {
return toPix;
},
set: setToPix, set: setToPix,
}); };
const getCacheItem = key => { const getCacheItem = key => {
Cache.getItem(key, { typeConversion: true, defaultValue: true }); Cache.getItem(key, { typeConversion: true, defaultValue: true });
@ -118,33 +130,17 @@ const getCacheItem = key => {
export let EVENT_BLUR = _global.localStorage ? getCacheItem("event.blur") : true; export let EVENT_BLUR = _global.localStorage ? getCacheItem("event.blur") : true;
export const setEventBlur = v => { export const setEventBlur = v => {
EVENT_BLUR = v; EVENT_BLUR = v;
Cache.setItem("event.blur", v); Cache.setItem("event.blur", newVal);
}; };
addDescriptor("EVENT_BLUR", { PropertyDescriptors["EVENT_BLUR"] = {
get: () => EVENT_BLUR, enumerable: true,
configurable: true,
get: function () {
return EVENT_BLUR;
},
set: setEventBlur, set: setEventBlur,
}); };
addDescriptor("Element", {
get: () => Element,
set: setElement,
});
addDescriptor("DOM", {
get: () => DOM,
set: setDom,
});
addDescriptor("nextTick", {
get: () => nextTick,
set: setNextTick,
});
export let PasteLimit = 2000; export function _defineVarProperties(libName) {
export const setPasteLimit = v => { Object.defineProperties(libName, PropertyDescriptors);
PasteLimit = v; }
};
addDescriptor("PasteLimit", {
get: () => PasteLimit,
set: setPasteLimit,
});

17
packages/fineui/src/core/controller/controller.layer.js

@ -8,7 +8,7 @@ import { isNull, isNotNull, each, keys, isWidget, isNotEmptyString, extend, bind
import { Widget } from "../4.widget"; import { Widget } from "../4.widget";
import { createWidget } from "../5.inject"; import { createWidget } from "../5.inject";
import { zIndex_layer } from "../constant"; import { zIndex_layer } from "../constant";
import { getPositionRelativeContainingBlockRect, getOuterBody } from "../utils/dom"; import { DOM } from "../utils";
export class LayerController extends Controller { export class LayerController extends Controller {
constructor(Resizers) { constructor(Resizers) {
@ -63,7 +63,7 @@ export class LayerController extends Controller {
w = from.element; w = from.element;
} }
if (isNotEmptyString(w)) { if (isNotEmptyString(w)) {
w = Widget._renderEngine.createElement(w === 'body' ? getOuterBody() : w); w = Widget._renderEngine.createElement(w);
} }
if (this.has(name)) { if (this.has(name)) {
return this.get(name); return this.get(name);
@ -86,7 +86,7 @@ export class LayerController extends Controller {
}, context); }, context);
createWidget({ createWidget({
type: "bi.absolute", type: "bi.absolute",
element: op.container || this.getRender(), element: op.container || this.options.render,
items: [ items: [
{ {
el: layout, el: layout,
@ -108,7 +108,7 @@ export class LayerController extends Controller {
height: offset.height || (w.outerHeight() - (offset.top || 0) - (offset.bottom || 0)) || "", height: offset.height || (w.outerHeight() - (offset.top || 0) - (offset.bottom || 0)) || "",
}; };
const { top, left, scaleY, scaleX } = getPositionRelativeContainingBlockRect(layout.element[0].parentNode || layout.element[0]); const { top, left, scaleY, scaleX } = DOM.getPositionRelativeContainingBlockRect(layout.element[0]);
css.top = (css.top - top) / scaleY; css.top = (css.top - top) / scaleY;
css.left = (css.left - left) / scaleX; css.left = (css.left - left) / scaleX;
@ -164,15 +164,6 @@ export class LayerController extends Controller {
return this; return this;
} }
getRender() {
// 默认挂在body上的都找最外层的body
let render = this.options.render;
if (render === 'body') {
return getOuterBody();
}
return render;
}
_getLayout(name) { _getLayout(name) {
return this.layouts[name]; return this.layouts[name];
} }

2
packages/fineui/src/core/controller/controller.masker.js

@ -12,7 +12,7 @@ export class MaskersController extends LayerController {
} }
init() { init() {
super.init(...arguments); super.init(arguments);
this.zindex = zIndex_masker; this.zindex = zIndex_masker;
} }
} }

17
packages/fineui/src/core/controller/controller.popover.js

@ -7,7 +7,6 @@ import { isNotNull, each } from "../2.base";
import { Widget } from "../4.widget"; import { Widget } from "../4.widget";
import { createWidget } from "../5.inject"; import { createWidget } from "../5.inject";
import { zIndex_popover } from "../constant"; import { zIndex_popover } from "../constant";
import { getOuterBody } from "../utils/dom";
export class PopoverController extends Controller { export class PopoverController extends Controller {
constructor() { constructor() {
@ -57,9 +56,8 @@ export class PopoverController extends Controller {
this.floatContainer[name].visible(); this.floatContainer[name].visible();
const popover = this.get(name); const popover = this.get(name);
popover.show && popover.show(); popover.show && popover.show();
const render = this.getRender(); const W = Widget._renderEngine.createElement(this.options.render).width(),
const el = Widget._renderEngine.createElement(render)[0]; H = Widget._renderEngine.createElement(this.options.render).height();
const W = el.clientWidth, H = el.clientHeight;
const w = popover.element.width(), h = popover.element.height(); const w = popover.element.width(), h = popover.element.height();
let left = (W - w) / 2, top = (H - h) / 2; let left = (W - w) / 2, top = (H - h) / 2;
if (left < 0) { if (left < 0) {
@ -126,7 +124,7 @@ export class PopoverController extends Controller {
popover.on(BI.Popover.EVENT_CLOSE, () => this.close(name)); popover.on(BI.Popover.EVENT_CLOSE, () => this.close(name));
createWidget({ createWidget({
type: "bi.absolute", type: "bi.absolute",
element: options.container || this.getRender(), element: options.container || this.options.render,
items: [{ items: [{
el: this.floatContainer[name], el: this.floatContainer[name],
left: 0, left: 0,
@ -139,15 +137,6 @@ export class PopoverController extends Controller {
return this; return this;
} }
getRender() {
// 默认挂在body上的都找最外层的body
let render = this.options.render;
if (render === 'body') {
return getOuterBody();
}
return render;
}
get(name) { get(name) {
return this.floatManager[name]; return this.floatManager[name];
} }

130
packages/fineui/src/core/element/element.js

@ -1,78 +1,76 @@
import { registFunction } from "./plugins"; import { registFunction } from "./plugins";
import { isWidget, isString } from "../2.base"; import { isWidget, isString } from "../2.base";
export let Element = class { export function Element(widget, attribs) {
constructor(widget, attribs) { this.l = this.r = this.t = this.b = 0; // 边框
this.l = this.r = this.t = this.b = 0; // 边框 this.marginLeft = this.marginRight = this.marginTop = this.marginBottom = 0; // 间距
this.marginLeft = this.marginRight = this.marginTop = this.marginBottom = 0; // 间距 this.position = {};
this.position = {}; this.classMap = {};
this.classMap = {}; this.classList = [];
this.classList = []; this.children = [];
this.children = []; this.attribs = attribs || {};
this.attribs = attribs || {}; this.styles = {};
this.styles = {}; // 兼容处理
// 兼容处理 this["0"] = this;
this["0"] = this; this.style = {};
this.style = {}; if (!widget) {
if (!widget) { this.nodeName = "body";
this.nodeName = "body"; this.position.x = 0;
this.position.x = 0; this.position.y = 0;
this.position.y = 0; this.attribs.id = "body";
this.attribs.id = "body"; } else if (isWidget(widget)) {
} else if (isWidget(widget)) { this.widget = widget;
this.widget = widget; this.nodeName = widget.options.tagName;
this.nodeName = widget.options.tagName; this.textBaseLine = widget.options.textBaseLine;
this.textBaseLine = widget.options.textBaseLine; } else if (isString(widget)) {
} else if (isString(widget)) { this.nodeName = widget;
this.nodeName = widget;
}
} }
}
appendChild(child) { initElement(Element);
child.parent = this; registFunction(Element);
if (this.children.push(child) !== 1) {
const sibling = this.children[this.children.length - 2];
sibling.next = child;
child.prev = sibling;
child.next = null;
}
}
append(child) {
child.parent = this;
if (this.children.push(child) !== 1) {
const sibling = this.children[this.children.length - 2];
sibling.next = child;
child.prev = sibling;
child.next = null;
}
}
getParent() {
return this.parent;
}
getSiblings() {
const parent = this.getParent();
return parent ? parent.getChildren() : [this];
}
getChildren() { function initElement(element) {
return this.children; element.prototype = {
} appendChild(child) {
child.parent = this;
if (this.children.push(child) !== 1) {
const sibling = this.children[this.children.length - 2];
sibling.next = child;
child.prev = sibling;
child.next = null;
}
},
append(child) {
child.parent = this;
if (this.children.push(child) !== 1) {
const sibling = this.children[this.children.length - 2];
sibling.next = child;
child.prev = sibling;
child.next = null;
}
},
getParent() {
return this.parent;
},
getSiblings() {
const parent = this.getParent();
getBounds() { return parent ? parent.getChildren() : [this];
return {}; },
} getChildren() {
return this.children;
},
width() {} getBounds() {
return {};
},
height() {} width() {
}
registFunction(Element); },
height() {
export function setElement(element) { },
Element = element; };
} }

11
packages/fineui/src/core/func/alias.js

@ -9,8 +9,7 @@ import {
leftPad, leftPad,
parseDateTime, parseDateTime,
values, values,
isArray, isArray
getDate
} from "../2.base"; } from "../2.base";
import { replaceAll } from "./string"; import { replaceAll } from "./string";
import { getFullDayName, getMonthName, getTimezone } from "./date"; import { getFullDayName, getMonthName, getTimezone } from "./date";
@ -457,7 +456,7 @@ export const htmlDecode = function(text) {
export const cjkEncodeDO = function(o) { export const cjkEncodeDO = function(o) {
if (isPlainObject(o)) { if (isPlainObject(o)) {
const result = {}; const result = {};
each(o, (k, v) => { each(o, (v, k) => {
if (!(typeof v === "string")) { if (!(typeof v === "string")) {
v = jsonEncode(v); v = jsonEncode(v);
} }
@ -638,7 +637,7 @@ export const getEncodeURL = function(urlTemplate, param) {
export const encodeURIComponent = function(url) { export const encodeURIComponent = function(url) {
const specialCharsMap = getSpecialCharsMap(); const specialCharsMap = getSpecialCharsMap();
url = url ?? ""; url = url || "";
url = replaceAll(`${url}`, keys(specialCharsMap || []).join("|"), str => { url = replaceAll(`${url}`, keys(specialCharsMap || []).join("|"), str => {
switch (str) { switch (str) {
case "\\": case "\\":
@ -681,10 +680,10 @@ export const contentFormat = function(cv, fmt) {
if (!(cv instanceof Date)) { if (!(cv instanceof Date)) {
if (typeof cv === "number") { if (typeof cv === "number") {
// 毫秒数类型 // 毫秒数类型
cv = getDate(cv); cv = new Date(cv);
} else { } else {
// 字符串类型转化为date类型 // 字符串类型转化为date类型
cv = getDate(Date.parse((`${cv}`).replace(/-|\./g, "/"))); cv = new Date(Date.parse((`${cv}`).replace(/-|\./g, "/")));
} }
} }
if (!isInvalidDate(cv) && !isNull(cv)) { if (!isInvalidDate(cv) && !isNull(cv)) {

2
packages/fineui/src/core/func/date.js

@ -180,7 +180,7 @@ export function getQuarterStartDate(date) {
export function getQuarterEndDate(date) { export function getQuarterEndDate(date) {
const quarterEndMonth = getQuarterStartMonth(date) + 2; const quarterEndMonth = getQuarterStartMonth(date) + 2;
return getDate(date.getFullYear(), quarterEndMonth, getMonthDays(date, quarterEndMonth)); return getDate(date.getFullYear(), quarterEndMonth, getMonthDays(date));
} }
/** /**

2
packages/fineui/src/core/loader/loader.style.js

@ -13,7 +13,7 @@ export class StyleLoaderManager extends OB {
} }
_init() { _init() {
super._init(...arguments); super._init(arguments);
this.stylesManager = {}; this.stylesManager = {};
} }

47
packages/fineui/src/core/platform/web/config.js

@ -3,8 +3,7 @@ import { Providers } from "../../5.inject";
import { Plugin } from "../../6.plugin"; import { Plugin } from "../../6.plugin";
import { isSupportCss3, isIE, getIEVersion } from "../../platform/web"; import { isSupportCss3, isIE, getIEVersion } from "../../platform/web";
import { HorizontalAlign, VerticalAlign } from "../../constant"; import { HorizontalAlign, VerticalAlign } from "../../constant";
import { import { FlexCenterLayout, FlexHorizontalLayout, VerticalLayout,
FlexCenterLayout, FlexHorizontalLayout, VerticalLayout,
FlexVerticalLayout, TdLayout, InlineLayout, FlexVerticalLayout, TdLayout, InlineLayout,
FloatHorizontalFillLayout, ResponsiveInlineLayout, FloatHorizontalFillLayout, ResponsiveInlineLayout,
InlineCenterAdaptLayout, FlexVerticalCenterAdapt, InlineCenterAdaptLayout, FlexVerticalCenterAdapt,
@ -27,7 +26,7 @@ import { HalfButton } from "@/case";
// 1、支持flex的浏览器下使用flex布局 // 1、支持flex的浏览器下使用flex布局
// 2、不支持flex的浏览器下使用inline布局 // 2、不支持flex的浏览器下使用inline布局
// 3、当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了。当横向出滚动条时使用table布局,不出滚动条时使用float布局 // 3、当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了。当横向出滚动条时使用table布局,不出滚动条时使用float布局
let _isSupportFlex, _isSupportGrid, _isSupportSticky; let _isSupportFlex, _isSupportGrid;
function isSupportFlex() { function isSupportFlex() {
if (!_isSupportFlex) { if (!_isSupportFlex) {
@ -46,7 +45,7 @@ function isSupportGrid() {
} }
// 判断浏览器是否支持sticky 属性 // 判断浏览器是否支持sticky 属性
const innerSupportSticky = function() { const isSupportSticky = (function () {
const vendorList = ["", "-webkit-", "-ms-", "-moz-", "-o-"], const vendorList = ["", "-webkit-", "-ms-", "-moz-", "-o-"],
vendorListLength = vendorList.length, vendorListLength = vendorList.length,
stickyElement = document.createElement("div"); stickyElement = document.createElement("div");
@ -58,15 +57,7 @@ const innerSupportSticky = function() {
} }
return false; return false;
}; }());
// 判断浏览器是否支持sticky 属性
const isSupportSticky = function() {
if (_isSupportSticky == null) {
_isSupportSticky = innerSupportSticky();
}
return _isSupportSticky;
};
const configWidget = Plugin.configWidget; const configWidget = Plugin.configWidget;
@ -83,7 +74,7 @@ configWidget("bi.horizontal", ob => {
} }
return extend({ return extend({
scrollx: true scrollx: true,
}, ob, { type: InlineLayout.xtype }); }, ob, { type: InlineLayout.xtype });
}); });
configWidget("bi.vertical", ob => { configWidget("bi.vertical", ob => {
@ -99,15 +90,15 @@ configWidget("bi.vertical", ob => {
return { return {
type: InlineLayout.xtype, type: InlineLayout.xtype,
horizontalAlign: ob.horizontalAlign, horizontalAlign: ob.horizontalAlign,
items: [item] items: [item],
}; };
}) }),
}); });
} }
if (ob.verticalAlign === VerticalAlign.Stretch) { if (ob.verticalAlign === VerticalAlign.Stretch) {
if (isSupportFlex()) { if (isSupportFlex()) {
return extend({ return extend({
horizontalAlign: HorizontalAlign.Stretch horizontalAlign: HorizontalAlign.Stretch,
}, ob, { type: FlexVerticalLayout.xtype }); }, ob, { type: FlexVerticalLayout.xtype });
} }
} }
@ -137,12 +128,12 @@ configWidget("bi.inline", ob => {
// 宽度是不是受限 // 宽度是不是受限
if ((ob.scrollable !== true && ob.scrollx !== true) || ob.horizontalAlign === HorizontalAlign.Stretch) { if ((ob.scrollable !== true && ob.scrollx !== true) || ob.horizontalAlign === HorizontalAlign.Stretch) {
return extend({ return extend({
verticalAlign: VerticalAlign.Top verticalAlign: VerticalAlign.Top,
}, ob, { type: FloatHorizontalFillLayout.xtype }); }, ob, { type: FloatHorizontalFillLayout.xtype });
} }
return extend({ return extend({
horizontalAlign: HorizontalAlign.Stretch horizontalAlign: HorizontalAlign.Stretch,
}, ob, { type: TableAdaptLayout.xtype }); }, ob, { type: TableAdaptLayout.xtype });
} }
if (Providers.getProvider(SystemProvider.xtype).getResponsiveMode()) { if (Providers.getProvider(SystemProvider.xtype).getResponsiveMode()) {
@ -188,18 +179,18 @@ configWidget("bi.horizontal_adapt", ob => {
// 主要出现在center_adapt或者horizontal_adapt的场景,或者主动设置horizontalAlign的场景 // 主要出现在center_adapt或者horizontal_adapt的场景,或者主动设置horizontalAlign的场景
if (isAdapt) { if (isAdapt) {
return extend({ return extend({
horizontalAlign: HorizontalAlign.Center horizontalAlign: HorizontalAlign.Center,
}, ob, { type: TableAdaptLayout.xtype }); }, ob, { type: TableAdaptLayout.xtype });
} }
if (supportFlex) { if (supportFlex) {
return extend({ return extend({
horizontalAlign: HorizontalAlign.Center, horizontalAlign: HorizontalAlign.Center,
scrollx: false scrollx: false,
}, ob, { type: FlexHorizontalLayout.xtype }); }, ob, { type: FlexHorizontalLayout.xtype });
} }
return extend({ return extend({
horizontalAlign: HorizontalAlign.Center horizontalAlign: HorizontalAlign.Center,
}, ob, { type: TableAdaptLayout.xtype }); }, ob, { type: TableAdaptLayout.xtype });
}); });
@ -219,14 +210,14 @@ configWidget("bi.horizontal_fill", ob => {
return extend({ return extend({
horizontalAlign: HorizontalAlign.Stretch, horizontalAlign: HorizontalAlign.Stretch,
verticalAlign: VerticalAlign.Stretch, verticalAlign: VerticalAlign.Stretch,
scrollx: false scrollx: false,
}, ob, { type: FlexHorizontalLayout.xtype }); }, ob, { type: FlexHorizontalLayout.xtype });
} }
if ((ob.horizontalAlign && ob.horizontalAlign !== HorizontalAlign.Stretch) || (ob.scrollable === true || ob.scrollx === true)) { if ((ob.horizontalAlign && ob.horizontalAlign !== HorizontalAlign.Stretch) || (ob.scrollable === true || ob.scrollx === true)) {
// 宽度不受限,要用table布局 // 宽度不受限,要用table布局
return extend({ return extend({
horizontalAlign: HorizontalAlign.Stretch, horizontalAlign: HorizontalAlign.Stretch,
verticalAlign: VerticalAlign.Stretch verticalAlign: VerticalAlign.Stretch,
}, ob, { type: TableLayout.xtype }); }, ob, { type: TableLayout.xtype });
} }
@ -237,14 +228,14 @@ configWidget("bi.vertical_fill", ob => {
return extend({ return extend({
horizontalAlign: HorizontalAlign.Stretch, horizontalAlign: HorizontalAlign.Stretch,
verticalAlign: VerticalAlign.Stretch, verticalAlign: VerticalAlign.Stretch,
scrolly: false scrolly: false,
}, ob, { type: FlexVerticalLayout.xtype }); }, ob, { type: FlexVerticalLayout.xtype });
} }
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) { if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) {
// 有滚动条,降级到table布局处理 // 有滚动条,降级到table布局处理
return extend({}, ob, { return extend({}, ob, {
type: TdLayout.xtype, type: TdLayout.xtype,
items: map(ob.items, (i, item) => [item]) items: map(ob.items, (i, item) => [item]),
}); });
} }
let hasAuto = false; let hasAuto = false;
@ -267,12 +258,12 @@ configWidget("bi.vertical_fill", ob => {
return extend({}, ob, { type: VTapeLayout.xtype }); return extend({}, ob, { type: VTapeLayout.xtype });
}); });
configWidget("bi.horizontal_sticky", ob => { configWidget("bi.horizontal_sticky", ob => {
if (!isSupportSticky()) { if (!isSupportSticky) {
return extend({ scrollx: true }, ob, { type: HorizontalFillLayout.xtype }); return extend({ scrollx: true }, ob, { type: HorizontalFillLayout.xtype });
} }
}); });
configWidget("bi.vertical_sticky", ob => { configWidget("bi.vertical_sticky", ob => {
if (!isSupportSticky()) { if (!isSupportSticky) {
return extend({ scrolly: true }, ob, { type: VerticalFillLayout.xtype }); return extend({ scrolly: true }, ob, { type: VerticalFillLayout.xtype });
} }
}); });

4
packages/fineui/src/core/platform/web/detectElementResize.js

@ -46,14 +46,10 @@ export const ResizeDetector = {
addResizeListener(widget.element[0], fn); addResizeListener(widget.element[0], fn);
return function () { return function () {
// 如果fn是debounce需要cancel掉
fn?.cancel?.();
removeResizeListener(widget.element[0], fn); removeResizeListener(widget.element[0], fn);
}; };
}, },
removeResizeListener(widget, fn) { removeResizeListener(widget, fn) {
// 如果fn是debounce需要cancel掉
fn?.cancel?.();
removeResizeListener(widget.element[0], fn); removeResizeListener(widget.element[0], fn);
}, },
}; };

96
packages/fineui/src/core/platform/web/jquery/jquery.polyfill.js

@ -0,0 +1,96 @@
/**
* 用于 jquery worker 环境或者 V8 引擎的 polyfill
*/
// import { _global } from "@/core/0.foundation";
const _global = globalThis;
const document = {};
const fakeElement = Object.create(document);
Object.assign(document, {
parentNode: null,
nodeType: 9,
head: fakeElement,
body: fakeElement,
ownerDocument: document,
documentElement: document,
toString() {
return "FakeDocument";
},
appendChild(child) {
return child;
},
implementation: {
createHTMLDocument() {
return {
body: {
childNodes: [],
},
};
},
createDocumentFragment() {
return this;
},
},
getElementById() {
return fakeElement;
},
createElement() {
return fakeElement;
},
createDocumentFragment() {
return this;
},
cloneNode() {
return this;
},
getElementsByTagName() {
return [fakeElement];
},
getElementsByClassName() {
return [fakeElement];
},
setAttribute() {
return null;
},
getAttribute() {
return null;
},
removeChild() {
return null;
},
addEventListener() {
return null;
},
removeEventListener() {
return null;
},
});
Object.assign(fakeElement, {
nodeType: 1,
style: {},
ownerDocument: document,
parentNod: fakeElement,
firstChild: fakeElement,
lastChild: fakeElement,
toString() {
return "FakeElement";
},
});
function polyfillProps(key, obj) {
_global[key] = _global[key] || obj;
if (typeof obj === "object") {
try {
Object.assign(_global[key], obj);
} catch(err) {
// _global[key] 可能只有 get 方法
}
}
}
_global.window = _global;
polyfillProps("XMLHttpRequest", function () {});
polyfillProps("document", document);

19
packages/fineui/src/core/platform/web/load.js

@ -81,34 +81,25 @@ export function syncLoadScript(uri) {
return false; return false;
} }
const promises = {};
/** /**
* 默认的异步加载javascript方法 * 默认的异步加载javascript方法
* @param uri * @param uri
* @returns {Promise<boolean>|Promise<unknown>} * @returns {Promise<boolean>|Promise<unknown>}
*/ */
export function loadScript(uri) { export function loadScript(uri) {
if (promises[uri]) { if (_LOADED[uri]) {
return Promise.all(promises[uri]); return Promise.resolve(true);
} }
return new Promise(resolve => {
const promise = new Promise(resolve => {
const script = document.createElement("script"); const script = document.createElement("script");
script.type = "application/javascript"; script.type = "application/javascript";
script.src = uri;
script.onload = function() { script.onload = function() {
_LOADED[uri] = true;
resolve(true); resolve(true);
}; };
script.src = uri;
document.head.appendChild(script); document.head.appendChild(script);
_LOADED[uri] = true;
}); });
promises[uri] = [];
promises[uri].push(promise);
return Promise.all(promises[uri]);
} }
/** /**

2
packages/fineui/src/core/structure/cache.js

@ -13,7 +13,7 @@ export const Cache = {
return Cache._getKeyPrefix() + (key || ""); return Cache._getKeyPrefix() + (key || "");
}, },
getItem: function (key, opt = {}) { getItem: function (key, opt = {}) {
const { defaultValue = null, typeConversion } = opt; const { defaultValue, typeConversion } = opt;
const storageKey = Cache._generateKey(key); const storageKey = Cache._generateKey(key);
let value = localStorage.getItem(storageKey); let value = localStorage.getItem(storageKey);

2
packages/fineui/src/core/utils/color.js

@ -42,7 +42,7 @@ export function getContrastColor(color) {
return "#FFFFFF"; return "#FFFFFF";
} }
return "#091e40"; return "#3D4D66";
} }
export function rgb2hex(rgbColour) { export function rgb2hex(rgbColour) {

37
packages/fineui/src/core/utils/dom.js

@ -1,9 +1,9 @@
/** /**
* 对DOM操作的通用函数 * 对DOM操作的通用函数
*/ */
import $ from "jquery";
import { each, isEmpty, isNotNull, isNull } from "../2.base";
import { Widget } from "../4.widget"; import { Widget } from "../4.widget";
import { each, isEmpty, isNull, isNotNull } from "../2.base";
import $ from "jquery";
import { isIE } from "./../platform"; import { isIE } from "./../platform";
export function ready(fn) { export function ready(fn) {
@ -66,10 +66,10 @@ export function preloadImages(srcArray, onload) {
each(srcArray, (i, src) => { each(srcArray, (i, src) => {
images[i] = new Image(); images[i] = new Image();
images[i].src = src; images[i].src = src;
images[i].onload = function () { images[i].onload = function() {
complete(); complete();
}; };
images[i].onerror = function () { images[i].onerror = function() {
complete(); complete();
}; };
}); });
@ -741,15 +741,8 @@ export function getComboPosition(combo, popup, extraWidth, extraHeight, needAdap
default: default:
break; break;
} }
if (needAdaptHeight === true && popup.resetHeight) { if (needAdaptHeight === true) {
const comboRect = combo.element[0].getBoundingClientRect(); popup.resetHeight && popup.resetHeight(Math.min(viewportBounds.height - position.top - (positionRelativeElement ? positionRelativeElement.getBoundingClientRect().top : 0), maxHeight));
const relativeOffset = positionRelativeElement ? positionRelativeElement.getBoundingClientRect().top : 0;
const positionTop = position.top + relativeOffset;
if (positionTop < comboRect.top) {
popup.resetHeight(Math.min(viewportBounds.height - positionTop, comboRect.top, maxHeight));
} else if (positionTop >= comboRect.bottom) {
popup.resetHeight(Math.min(viewportBounds.height - positionTop, viewportBounds.height - comboRect.bottom, maxHeight));
}
} }
return position; return position;
@ -795,21 +788,3 @@ export function getPositionRelativeContainingBlockRect(element) {
scaleY: rect.height / positionRelativeElement.offsetHeight, scaleY: rect.height / positionRelativeElement.offsetHeight,
}; };
} }
/**
* 获取最外层的body
*/
export function getOuterBody() {
// 默认挂在body上的都找最外层的body
// let parentWindow = window;
// let body = document.body;
// try {
// while (parentWindow.parent !== parentWindow) {
// parentWindow = parentWindow.parent;
// }
// body = parentWindow.document.body;
// } catch (e) {}
// return body;
return document.body;
}

6
packages/fineui/src/core/utils/index.js

@ -6,11 +6,7 @@ import * as platformDom from "./dom";
import * as colorDom from "./color"; import * as colorDom from "./color";
export let DOM = { export const DOM = {
...platformDom, ...platformDom,
...colorDom, ...colorDom,
}; };
export function setDom(dom) {
DOM = dom;
}

2
packages/fineui/src/core/wrapper/layout/flex/flex.horizontal.js

@ -87,7 +87,7 @@ export class FlexHorizontalLayout extends Layout {
} }
} }
if (columnSize > 0) { if (columnSize > 0) {
w.element.css({ width: this._optimiseGap(columnSize) }); w.element.width(this._optimiseGap(columnSize));
} }
if (columnSize === "fill") { if (columnSize === "fill") {
w.element.addClass("f-f"); w.element.addClass("f-f");

7
packages/fineui/src/core/wrapper/layout/layout.card.js

@ -107,12 +107,9 @@ export class CardLayout extends Layout {
throw new Error("cardName not exist", cardName); throw new Error("cardName not exist", cardName);
} }
let child = this._children[this._getChildName(cardName)]; const child = this._children[this._getChildName(cardName)];
this._deleteCardByName(cardName); this._deleteCardByName(cardName);
if (child) { child && child._destroy();
child._destroy();
child = null;
}
} }
addCardByName(cardName, cardItem) { addCardByName(cardName, cardItem) {

2
packages/fineui/src/core/wrapper/layout/layout.table.js

@ -59,7 +59,7 @@ export class TableLayout extends Layout {
return { return {
type: "bi.default", type: "bi.default",
ref: (_ref) => { ref(_ref) {
this.layout = _ref; this.layout = _ref;
}, },
items: this._formatItems(items), items: this._formatItems(items),

50
packages/fineui/src/fix/fix.compact.js

@ -7,7 +7,7 @@ import {
extend, extend,
isFunction, isFunction,
Widget, Widget,
Providers, emptyFn Providers
} from "@/core"; } from "@/core";
import { Fix } from "./fix"; import { Fix } from "./fix";
@ -142,9 +142,9 @@ export function createStore() {
if (this._store || this.options._store) { if (this._store || this.options._store) {
const store = Widget.findStore( const store = Widget.findStore(
this.options.context || this.options.context ||
this._parent || this._parent ||
this.options.element || this.options.element ||
this._context this._context
); );
if (store) { if (store) {
pushTarget(store); pushTarget(store);
@ -204,7 +204,6 @@ Widget.prototype.__destroy = function () {
unwatch(); unwatch();
}); });
}); });
Fix.cleanupDeps();
this._watchers && (this._watchers = []); this._watchers && (this._watchers = []);
if (this.store) { if (this.store) {
this.store._parent && (this.store._parent = null); this.store._parent && (this.store._parent = null);
@ -214,38 +213,19 @@ Widget.prototype.__destroy = function () {
delete this.__cacheStore; delete this.__cacheStore;
}; };
Widget.prototype.__watch = function (getter, handler, options) {
this._watchers = this._watchers || [];
const watcher = new Fix.Watcher(
null,
() => getter.call(this, this),
(handler &&
((v) => {
handler.call(this, this, v);
})) ||
emptyFn,
extend({ deep: true }, options)
);
this._watchers.push(() => {
watcher.teardown();
});
return watcher.value;
};
_.each(["_render", "__afterRender", "_mount", "__afterMount"], (name) => { _.each(["_render", "__afterRender", "_mount", "__afterMount"], (name) => {
const old = Widget.prototype[name]; const old = Widget.prototype[name];
old && old &&
(Widget.prototype[name] = function () { (Widget.prototype[name] = function () {
this.store && pushTarget(this.store); this.store && pushTarget(this.store);
let res; let res;
try { try {
res = old.apply(this, arguments); res = old.apply(this, arguments);
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
this.store && popTarget(); this.store && popTarget();
return res; return res;
}); });
}); });

791
packages/fineui/src/fix/fix.js

File diff suppressed because it is too large Load Diff

2
packages/fineui/src/index.js

@ -10,12 +10,10 @@ export * from "./widget";
export * from "./component"; export * from "./component";
export * from "./fix"; export * from "./fix";
export * from "./router"; export * from "./router";
export * from "./third";
export * as Popper from "@popperjs/core"; export * as Popper from "@popperjs/core";
export const jQuery = jquery; export const jQuery = jquery;
export const $ = jquery; export const $ = jquery;
import * as D from "@/core/decorator"; import * as D from "@/core/decorator";
import { Fix } from "./fix"; import { Fix } from "./fix";
export const Decorators = { ...D, Model: Fix.Model }; export const Decorators = { ...D, Model: Fix.Model };

8
packages/fineui/src/less/base/colorchooser/colorpicker/button.colorshow.less

@ -5,11 +5,3 @@
border-color: @color-bi-border-active-chooser-show-button; border-color: @color-bi-border-active-chooser-show-button;
} }
} }
.bi-theme-dark {
.bi-color-chooser-show-button {
&.active, &:active {
border-color: @color-bi-border-active-chooser-show-button-theme-dark;
}
}
}

128
packages/fineui/src/less/base/single/button/button.less

@ -1,5 +1,4 @@
@import "../../../index.less"; @import "../../../index.less";
@hoverVal: opacity .3s ease; @hoverVal: opacity .3s ease;
@activeVal: transform .5s ease, opacity 1s ease; @activeVal: transform .5s ease, opacity 1s ease;
@activeStopVal: transform 0s; @activeStopVal: transform 0s;
@ -7,7 +6,6 @@ body .bi-button, #body .bi-button {
&.hack { &.hack {
.border-radius(0px); .border-radius(0px);
} }
.border-radius(2px); .border-radius(2px);
outline: 0; outline: 0;
border: 1px solid @color-bi-border-button; border: 1px solid @color-bi-border-button;
@ -16,51 +14,41 @@ body .bi-button, #body .bi-button {
text-align: center; text-align: center;
vertical-align: middle; vertical-align: middle;
cursor: pointer; cursor: pointer;
&.loading { &.loading {
cursor: not-allowed; cursor: not-allowed;
} }
&.block { &.block {
font-size: inherit; font-size: inherit;
border-width: 0; border-width: 0;
.border-radius(0px); .border-radius(0px);
} }
&.clear { &.clear {
font-size: inherit; font-size: inherit;
border-width: 0; border-width: 0;
background-color: transparent; background-color: transparent;
&:hover, &:focus { &:hover, &:focus {
.opacity(0.8); .opacity(0.8);
} }
&:active { &:active {
.opacity(1); .opacity(1);
} }
&:after { &:after {
display: none; display: none;
} }
} }
&.plain { &.plain {
font-size: inherit; font-size: inherit;
border-width: 0; border-width: 0;
background-color: transparent; background-color: transparent;
} }
&.ghost { &.ghost {
font-size: inherit; font-size: inherit;
background-color: transparent; background-color: transparent;
} }
&.button-common { &.button-common {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-common-button; color: @color-bi-text-common-button;
} }
&.light { &.light {
border-width: 0; border-width: 0;
background-color: @color-bi-background-common-light-button; background-color: @color-bi-background-common-light-button;
@ -77,101 +65,81 @@ body .bi-button, #body .bi-button {
background-color: @color-bi-background-active-common-light-button; background-color: @color-bi-background-active-common-light-button;
} }
} }
&.clear, &.clear .b-font:before { &.clear, &.clear .b-font:before {
color: @color-bi-text-common-clear-button; color: @color-bi-text-common-clear-button;
} }
&.plain, &.plain .b-font:before { &.plain, &.plain .b-font:before {
background-color: transparent; background-color: transparent;
color: @color-bi-text-common-plain-button; color: @color-bi-text-common-plain-button;
} }
&.plain { &.plain {
&:hover { &:hover {
background-color: @color-bi-background-hover-plain-button; background-color: @color-bi-background-hover-plain-button;
} }
&:focus { &:focus {
background-color: @color-bi-background-active-plain-button; background-color: @color-bi-background-active-plain-button;
} }
} }
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-common-ghost-button; color: @color-bi-text-common-ghost-button;
} }
&:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before { &:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before {
color: @color-bi-text; color: @color-bi-text;
background-color: @color-bi-background-hover-common-ghost-button; background-color: @color-bi-background-hover-common-ghost-button;
} }
&:active { &:active {
background-color: @color-bi-background-active-common-ghost-button; background-color: @color-bi-background-active-common-ghost-button;
} }
} }
} }
&.button-ignore { &.button-ignore {
& { & {
background-color: @color-bi-background-ignore-button; background-color: @color-bi-background-ignore-button;
&:not(.clear, .ghost) { &:not(.clear, .ghost) {
border-color: @color-bi-border-ignore-button; border-color: @color-bi-border-ignore-button;
} }
} }
&:not(.clear, .ghost) { &:not(.clear, .ghost) {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-ignore-button; color: @color-bi-text-ignore-button;
} }
} }
&.clear { &.clear {
background-color: transparent; background-color: transparent;
border-width: 0; border-width: 0;
} }
&.ghost { &.ghost {
&:hover, &:focus { &:hover, &:focus {
border-color: @color-bi-border-ignore-button; border-color: @color-bi-border-ignore-button;
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-ignore-button; color: @color-bi-text-ignore-button;
} }
} }
background-color: transparent; background-color: transparent;
border-color: @color-bi-border-dark-gray-line; border-color: @color-bi-border-dark-gray-line;
} }
&.plain, &.plain .b-font:before { &.plain, &.plain .b-font:before {
background-color: transparent; background-color: transparent;
color: @color-bi-text-ignore-plain-button; color: @color-bi-text-ignore-plain-button;
} }
&.plain { &.plain {
&:hover { &:hover {
background-color: @color-bi-background-hover-plain-button; background-color: @color-bi-background-hover-plain-button;
} }
&:focus { &:focus {
background-color: @color-bi-background-active-plain-button; background-color: @color-bi-background-active-plain-button;
} }
} }
} }
&.button-success { &.button-success {
& { & {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-success-button; color: @color-bi-text-success-button;
} }
background-color: @color-bi-background-success-button; background-color: @color-bi-background-success-button;
border-color: @color-bi-border-success-button; border-color: @color-bi-border-success-button;
} }
&.light { &.light {
border-width: 0; border-width: 0;
background-color: @color-bi-background-success-light-button; background-color: @color-bi-background-success-light-button;
@ -188,59 +156,47 @@ body .bi-button, #body .bi-button {
background-color: @color-bi-background-active-success-light-button; background-color: @color-bi-background-active-success-light-button;
} }
} }
&.clear { &.clear {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-success-clear-button; color: @color-bi-text-success-clear-button;
} }
background-color: transparent; background-color: transparent;
border-width: 0; border-width: 0;
} }
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-success-ghost-button; color: @color-bi-text-success-ghost-button;
} }
background-color: transparent; background-color: transparent;
&:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before { &:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before {
color: @color-bi-text; color: @color-bi-text;
background-color: @color-bi-background-success-button; background-color: @color-bi-background-success-button;
} }
&:active { &:active {
background-color: @color-bi-background-success-button; background-color: @color-bi-background-success-button;
} }
} }
&.plain, &.plain .b-font:before { &.plain, &.plain .b-font:before {
background-color: transparent; background-color: transparent;
color: @color-bi-text-success-plain-button; color: @color-bi-text-success-plain-button;
} }
&.plain { &.plain {
&:hover { &:hover {
background-color: @color-bi-background-hover-plain-button; background-color: @color-bi-background-hover-plain-button;
} }
&:focus { &:focus {
background-color: @color-bi-background-active-plain-button; background-color: @color-bi-background-active-plain-button;
} }
} }
} }
&.button-warning { &.button-warning {
& { & {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-warning-button; color: @color-bi-text-warning-button;
} }
background-color: @color-bi-background-warning-button; background-color: @color-bi-background-warning-button;
border-color: @color-bi-border-warning-button; border-color: @color-bi-border-warning-button;
} }
&.light { &.light {
border-width: 0; border-width: 0;
background-color: @color-bi-background-warning-light-button; background-color: @color-bi-background-warning-light-button;
@ -257,59 +213,47 @@ body .bi-button, #body .bi-button {
background-color: @color-bi-background-active-warning-light-button; background-color: @color-bi-background-active-warning-light-button;
} }
} }
&.clear { &.clear {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-warning-clear-button; color: @color-bi-text-warning-clear-button;
} }
background-color: transparent; background-color: transparent;
border-width: 0; border-width: 0;
} }
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-warning-ghost-button; color: @color-bi-text-warning-ghost-button;
} }
background-color: transparent; background-color: transparent;
&:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before { &:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before {
color: @color-bi-text; color: @color-bi-text;
background-color: @color-bi-background-warning-button; background-color: @color-bi-background-warning-button;
} }
&:active { &:active {
background-color: @color-bi-background-warning-button; background-color: @color-bi-background-warning-button;
} }
} }
&.plain, &.plain .b-font:before { &.plain, &.plain .b-font:before {
background-color: transparent; background-color: transparent;
color: @color-bi-text-warning-plain-button; color: @color-bi-text-warning-plain-button;
} }
&.plain { &.plain {
&:hover { &:hover {
background-color: @color-bi-background-hover-plain-button; background-color: @color-bi-background-hover-plain-button;
} }
&:focus { &:focus {
background-color: @color-bi-background-active-plain-button; background-color: @color-bi-background-active-plain-button;
} }
} }
} }
&.button-error { &.button-error {
& { & {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-error-button; color: @color-bi-text-error-button;
} }
background-color: @color-bi-background-error-button; background-color: @color-bi-background-error-button;
border-color: @color-bi-border-error-button; border-color: @color-bi-border-error-button;
} }
&.light { &.light {
border-width: 0; border-width: 0;
background-color: @color-bi-background-error-light-button; background-color: @color-bi-background-error-light-button;
@ -326,49 +270,39 @@ body .bi-button, #body .bi-button {
background-color: @color-bi-background-active-error-light-button; background-color: @color-bi-background-active-error-light-button;
} }
} }
&.clear { &.clear {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-error-clear-button; color: @color-bi-text-error-clear-button;
} }
background-color: transparent; background-color: transparent;
border-width: 0; border-width: 0;
} }
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-error-ghost-button; color: @color-bi-text-error-ghost-button;
} }
background-color: transparent; background-color: transparent;
&:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before { &:hover, &:focus, &:hover .b-font:before, &:focus .b-font:before {
color: @color-bi-text; color: @color-bi-text;
background-color: @color-bi-background-error-button; background-color: @color-bi-background-error-button;
} }
&:active { &:active {
background-color: @color-bi-background-error-button; background-color: @color-bi-background-error-button;
} }
} }
&.plain, &.plain .b-font:before { &.plain, &.plain .b-font:before {
background-color: transparent; background-color: transparent;
color: @color-bi-text-error-plain-button; color: @color-bi-text-error-plain-button;
} }
&.plain { &.plain {
&:hover { &:hover {
background-color: @color-bi-background-hover-plain-button; background-color: @color-bi-background-hover-plain-button;
} }
&:focus { &:focus {
background-color: @color-bi-background-active-plain-button; background-color: @color-bi-background-active-plain-button;
} }
} }
} }
&.button-common.disabled, &.button-common.disabled,
&.button-success.disabled, &.button-success.disabled,
&.button-error.disabled, &.button-error.disabled,
@ -377,30 +311,25 @@ body .bi-button, #body .bi-button {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-button !important; color: @color-bi-text-disabled-button !important;
} }
background-color: fade(@color-bi-background-disabled-button, 20%) !important; background-color: fade(@color-bi-background-disabled-button, 20%) !important;
@ieColor: argb(fade(@color-bi-background-disabled-button, 20%)); @ieColor: argb(fade(@color-bi-background-disabled-button, 20%));
filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr=@{ieColor},endColorstr=@{ieColor})";
border-color: @color-bi-border-disabled-button !important; border-color: @color-bi-border-disabled-button !important;
} }
&:after { &:after {
display: none; display: none;
} }
} }
&.button-ignore.disabled { &.button-ignore.disabled {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-ignore-button !important; color: @color-bi-text-disabled-ignore-button !important;
} }
background: @color-bi-background-disabled-ignore-button !important; background: @color-bi-background-disabled-ignore-button !important;
border-color: @color-bi-border-disabled-ignore-button !important; border-color: @color-bi-border-disabled-ignore-button !important;
&:after { &:after {
display: none; display: none;
} }
} }
&.button-common.disabled, &.button-common.disabled,
&.button-success.disabled, &.button-success.disabled,
&.button-warning.disabled, &.button-warning.disabled,
@ -410,81 +339,65 @@ body .bi-button, #body .bi-button {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-ignore-clear-button !important; color: @color-bi-text-disabled-ignore-clear-button !important;
} }
background: transparent !important; background: transparent !important;
border-width: 0 !important; border-width: 0 !important;
&:hover, &:focus, &:active { &:hover, &:focus, &:active {
.opacity(1); .opacity(1);
} }
} }
&.plain { &.plain {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-plain-clear-button !important; color: @color-bi-text-disabled-plain-clear-button !important;
} }
background: transparent !important; background: transparent !important;
border-width: 0 !important; border-width: 0 !important;
&:hover, &:focus, &:active { &:hover, &:focus, &:active {
.opacity(1); .opacity(1);
} }
} }
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
// color: @color-bi-text-disabled-ignore-ghost-button !important; // color: @color-bi-text-disabled-ignore-ghost-button !important;
} }
background: transparent !important; background: transparent !important;
// border-color: @color-bi-border-disabled-ignore-ghost-button !important; // border-color: @color-bi-border-disabled-ignore-ghost-button !important;
.opacity(0.5); .opacity(0.5);
} }
} }
&.button-ignore.disabled { &.button-ignore.disabled {
&.ghost { &.ghost {
.opacity(1); .opacity(1);
} }
} }
&.button-common.disabled { &.button-common.disabled {
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-common-ghost-button !important; color: @color-bi-text-disabled-common-ghost-button !important;
} }
border-color: @color-bi-border-disabled-common-ghost-button !important; border-color: @color-bi-border-disabled-common-ghost-button !important;
} }
} }
&.button-success.disabled { &.button-success.disabled {
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-success-ghost-button !important; color: @color-bi-text-disabled-success-ghost-button !important;
} }
border-color: @color-bi-border-disabled-success-ghost-button !important; border-color: @color-bi-border-disabled-success-ghost-button !important;
} }
} }
&.button-warning.disabled { &.button-warning.disabled {
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-warning-ghost-button !important; color: @color-bi-text-disabled-warning-ghost-button !important;
} }
border-color: @color-bi-border-disabled-warning-ghost-button !important; border-color: @color-bi-border-disabled-warning-ghost-button !important;
} }
} }
&.button-error.disabled { &.button-error.disabled {
&.ghost { &.ghost {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-error-ghost-button !important; color: @color-bi-text-disabled-error-ghost-button !important;
} }
border-color: @color-bi-border-disabled-error-ghost-button !important; border-color: @color-bi-border-disabled-error-ghost-button !important;
} }
} }
@ -511,17 +424,14 @@ body .bi-button, #body .bi-button {
top: 0; top: 0;
pointer-events: none; pointer-events: none;
} }
&.hack:after { &.hack:after {
content: none; content: none;
} }
&:active:after { &:active:after {
transform: scale(0, 1); transform: scale(0, 1);
.opacity(0.1); .opacity(0.1);
.transition(@activeStopVal) .transition(@activeStopVal)
} }
&:hover, &:focus { &:hover, &:focus {
& .bi-button-mask { & .bi-button-mask {
.opacity(0.1); .opacity(0.1);
@ -530,7 +440,6 @@ body .bi-button, #body .bi-button {
} }
} }
} }
&.button-ignore { &.button-ignore {
&:after { &:after {
content: ""; content: "";
@ -547,54 +456,42 @@ body .bi-button, #body .bi-button {
top: 0; top: 0;
pointer-events: none; pointer-events: none;
} }
&.hack:after { &.hack:after {
content: none; content: none;
} }
&:active:after { &:active:after {
transform: scale(0, 1); transform: scale(0, 1);
.opacity(0.1); .opacity(0.1);
.transition(@activeStopVal) .transition(@activeStopVal)
} }
&:hover, &:focus { &:hover, &:focus {
&:not(.clear, .ghost) { &:not(.clear, .ghost) {
background-color: @color-bi-background-hover-ignore-button-mask; background-color: @color-bi-background-hover-ignore-button-mask;
} }
.transition(@hoverVal); .transition(@hoverVal);
} }
} }
& .popup-content{
& .popup-content {
font-size: @font-size-14; font-size: @font-size-14;
} }
.bi-button-mask { .bi-button-mask {
pointer-events: none; pointer-events: none;
} }
} }
.bi-theme-dark, #body .bi-theme-dark { .bi-theme-dark {
.bi-button { .bi-button, #body .bi-button {
background-color: @color-bi-background-button-theme-dark;
&.button-ignore { &.button-ignore {
background-color: @color-bi-background-ignore-button-theme-dark; background-color: @color-bi-background-ignore-button-theme-dark;
&:hover, &:focus { &:hover, &:focus {
background-color: @color-bi-background-hover-ignore-button-theme-dark; background-color: @color-bi-background-hover-ignore-button-theme-dark;
} }
&:active { &:active {
background-color: @color-bi-background-active-ignore-button-theme-dark; background-color: @color-bi-background-active-ignore-button-theme-dark;
} }
&.clear { &.clear {
background-color: transparent; background-color: transparent;
} }
&.ghost { &.ghost {
border-color: @color-bi-border-dark-gray-line-theme-dark; border-color: @color-bi-border-dark-gray-line-theme-dark;
} }
@ -609,51 +506,36 @@ body .bi-button, #body .bi-button {
border-color: @color-bi-border-dark-gray-line-theme-dark !important; border-color: @color-bi-border-dark-gray-line-theme-dark !important;
background-color: fade(@color-bi-background-disabled-button-theme-dark, 20%) !important; background-color: fade(@color-bi-background-disabled-button-theme-dark, 20%) !important;
@ieColor: argb(fade(@color-bi-background-disabled-button-theme-dark, 20%)); @ieColor: argb(fade(@color-bi-background-disabled-button-theme-dark, 20%));
filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr=@{ieColor},endColorstr=@{ieColor})";
&.clear { &.clear {
background-color: transparent !important; background-color: transparent !important;
} }
&.ghost { &.ghost {
// 深色系下灰化就统一用灰化色 // 深色系下灰化就统一用灰化色
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-theme-dark !important; color: @color-bi-text-disabled-theme-dark !important;
} }
background: transparent !important; background: transparent !important;
.opacity(1); .opacity(1);
} }
} }
} }
&.button-ignore.disabled { &.button-ignore.disabled {
&, &.base-disabled { &, &.base-disabled {
&, & .b-font:before { &, & .b-font:before {
color: @color-bi-text-disabled-theme-dark !important; color: @color-bi-text-disabled-theme-dark !important;
} }
border-color: @color-bi-border-dark-gray-line-theme-dark !important; border-color: @color-bi-border-dark-gray-line-theme-dark !important;
background-color: @color-bi-background-ignore-button-theme-dark !important; background-color: @color-bi-background-ignore-button-theme-dark !important;
&.clear { &.clear {
background-color: transparent !important; background-color: transparent !important;
} }
&.ghost { &.ghost {
background: transparent !important; background: transparent !important;
.opacity(1); .opacity(1);
} }
} }
} }
&.button-common {
&.light {
background-color: @color-bi-background-common-light-button-theme-dark;
&, & .b-font:before {
color: @color-bi-text-common-light-button-theme-dark;
}
}
}
} }
} }

2
packages/fineui/src/less/base/single/button/switch.less

@ -25,7 +25,7 @@
.bi-switch { .bi-switch {
background-color: @color-bi-background-switch-theme-dark; background-color: @color-bi-background-switch-theme-dark;
&.active { &.active {
background-color: @color-bi-background-active-switch-theme-dark; background-color: @color-bi-background-active-switch;
} }
} }
} }

3
packages/fineui/src/less/base/single/input/radio.less

@ -15,9 +15,6 @@
border-color: @color-bi-border-hover-active-radio; border-color: @color-bi-border-hover-active-radio;
} }
} }
.bi-radio-icon {
background-color: @color-bi-background-active-radio-content;
}
&.active { &.active {
& .radio-content, &.radio-content { & .radio-content, &.radio-content {
border-color: @color-bi-border-hover-active-radio; border-color: @color-bi-border-hover-active-radio;

4
packages/fineui/src/less/base/tree/ztree.less

@ -272,9 +272,7 @@
} }
.bi-theme-dark { .bi-theme-dark {
.ztree.solid li span.button.center_docu, .ztree.solid li span.button.bottom_docu,.ztree.solid li span.button.roots_docu { .ztree.solid li span.button.center_docu, .ztree.solid li span.button.bottom_docu {
background: none;
&:before { &:before {
border-right: 1px solid @border-color-dark-gray-line-theme-dark; border-right: 1px solid @border-color-dark-gray-line-theme-dark;
} }

87
packages/fineui/src/less/core/utils/common.less

@ -2,20 +2,16 @@
.base-disabled { .base-disabled {
cursor: not-allowed !important; cursor: not-allowed !important;
.cursor-pointer { .cursor-pointer {
cursor: not-allowed !important; cursor: not-allowed !important;
} }
.cursor-default { .cursor-default {
cursor: not-allowed !important; cursor: not-allowed !important;
} }
.cursor-move { .cursor-move {
cursor: not-allowed !important; cursor: not-allowed !important;
} }
.cursor-text{
.cursor-text {
cursor: not-allowed !important; cursor: not-allowed !important;
} }
@ -58,20 +54,16 @@
.base-invalid { .base-invalid {
cursor: default !important; cursor: default !important;
.cursor-pointer { .cursor-pointer {
cursor: default !important; cursor: default !important;
} }
.cursor-default { .cursor-default {
cursor: default !important; cursor: default !important;
} }
.cursor-move { .cursor-move {
cursor: default !important; cursor: default !important;
} }
.cursor-text{
.cursor-text {
cursor: default !important; cursor: default !important;
} }
} }
@ -81,7 +73,6 @@
&:focus, &:hover { &:focus, &:hover {
border-color: @color-bi-border-highlight; border-color: @color-bi-border-highlight;
} }
// ie下不支持focus-within, 和上面写在一起会导致ie下:hover不生效 // ie下不支持focus-within, 和上面写在一起会导致ie下:hover不生效
&:focus-within { &:focus-within {
border-color: @color-bi-border-highlight; border-color: @color-bi-border-highlight;
@ -104,10 +95,6 @@
.bi-theme-dark { .bi-theme-dark {
.bi-focus-shadow { .bi-focus-shadow {
&:focus, &:hover {
border-color: @color-bi-border-highlight-theme-dark;
}
&.disabled { &.disabled {
&:hover { &:hover {
border-color: @border-color-line-theme-dark; border-color: @border-color-line-theme-dark;
@ -138,7 +125,6 @@
& .bi-input { & .bi-input {
color: @color-bi-text-background; color: @color-bi-text-background;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-background; color: @color-bi-text-background;
} }
@ -146,13 +132,11 @@
.bi-theme-dark { .bi-theme-dark {
.bi-background { .bi-background {
background-color: @color-bi-background-theme-dark; background-color: @color-bi-background-normal-theme-dark;
color: @color-bi-text-background-theme-dark; color: @color-bi-text-background-theme-dark;
& .bi-input { & .bi-input {
color: @color-bi-text-background-theme-dark; color: @color-bi-text-background-theme-dark;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-background-theme-dark; color: @color-bi-text-background-theme-dark;
} }
@ -162,11 +146,9 @@
.bi-header-background { .bi-header-background {
background-color: @color-bi-background-header-background; background-color: @color-bi-background-header-background;
color: @color-bi-text-header-background; color: @color-bi-text-header-background;
& .bi-input { & .bi-input {
color: @color-bi-text-header-background; color: @color-bi-text-header-background;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-header-background; color: @color-bi-text-header-background;
} }
@ -176,11 +158,9 @@
.bi-header-background { .bi-header-background {
background-color: @color-bi-background-header-background-theme-dark; background-color: @color-bi-background-header-background-theme-dark;
color: @color-bi-text-header-background-theme-dark; color: @color-bi-text-header-background-theme-dark;
& .bi-input { & .bi-input {
color: @color-bi-text-header-background-theme-dark; color: @color-bi-text-header-background-theme-dark;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-header-background-theme-dark; color: @color-bi-text-header-background-theme-dark;
} }
@ -191,15 +171,12 @@
.bi-card { .bi-card {
background-color: @color-bi-background-card; background-color: @color-bi-background-card;
color: @color-bi-text-card; color: @color-bi-text-card;
& .bi-input { & .bi-input {
color: @color-bi-text-card; color: @color-bi-text-card;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-card; color: @color-bi-text-card;
} }
&.bi-primary { &.bi-primary {
background-color: @background-color-card-primary; background-color: @background-color-card-primary;
color: @color-card-primary; color: @color-card-primary;
@ -207,14 +184,12 @@
} }
.bi-theme-dark { .bi-theme-dark {
.bi-card, &.bi-card { .bi-card {
background-color: @color-bi-background-card-theme-dark; background-color: @color-bi-background-card-theme-dark;
color: @color-bi-text-card-theme-dark; color: @color-bi-text-card-theme-dark;
& .bi-input { & .bi-input {
color: @color-bi-text-card-theme-dark; color: @color-bi-text-card-theme-dark;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-card-theme-dark; color: @color-bi-text-card-theme-dark;
} }
@ -224,24 +199,20 @@
//灰化 //灰化
.bi-disabled { .bi-disabled {
color: @color-bi-text-disabled; color: @color-bi-text-disabled;
& .bi-input { & .bi-input {
color: @color-bi-text-disabled; color: @color-bi-text-disabled;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-disabled; color: @color-bi-text-disabled;
} }
} }
.bi-theme-dark { .bi-theme-dark {
.bi-disabled, &.bi-disabled { .bi-disabled {
color: @color-bi-text-disabled-theme-dark; color: @color-bi-text-disabled-theme-dark;
& .bi-input { & .bi-input {
color: @color-bi-text-disabled-theme-dark; color: @color-bi-text-disabled-theme-dark;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-disabled-theme-dark; color: @color-bi-text-disabled-theme-dark;
} }
@ -251,24 +222,20 @@
// 提示区域, 灰色字体 // 提示区域, 灰色字体
.bi-tips { .bi-tips {
color: @color-bi-text-tips; color: @color-bi-text-tips;
& .bi-input { & .bi-input {
color: @color-bi-text-tips; color: @color-bi-text-tips;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-tips; color: @color-bi-text-tips;
} }
} }
.bi-theme-dark { .bi-theme-dark {
.bi-tips, &.bi-tips { .bi-tips {
color: @color-bi-text-tips-theme-dark; color: @color-bi-text-tips-theme-dark;
& .bi-input { & .bi-input {
color: @color-bi-text-tips-theme-dark;; color: @color-bi-text-tips-theme-dark;;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-tips-theme-dark; color: @color-bi-text-tips-theme-dark;
} }
@ -278,11 +245,9 @@
// 边框 // 边框
.bi-border { .bi-border {
border: 1px solid @color-bi-border-line; border: 1px solid @color-bi-border-line;
&.disabled { &.disabled {
border-color: @color-bi-border-disabled !important; border-color: @color-bi-border-disabled !important;
} }
&.error { &.error {
border-color: @border-color-negative; border-color: @border-color-negative;
} }
@ -290,11 +255,9 @@
.bi-border-top { .bi-border-top {
border-top: 1px solid @color-bi-border-line; border-top: 1px solid @color-bi-border-line;
&.disabled { &.disabled {
border-color: @color-bi-border-disabled !important; border-color: @color-bi-border-disabled !important;
} }
&.error { &.error {
border-color: @border-color-negative; border-color: @border-color-negative;
} }
@ -302,11 +265,9 @@
.bi-border-right { .bi-border-right {
border-right: 1px solid @color-bi-border-line; border-right: 1px solid @color-bi-border-line;
&.disabled { &.disabled {
border-color: @color-bi-border-disabled !important; border-color: @color-bi-border-disabled !important;
} }
&.error { &.error {
border-color: @border-color-negative; border-color: @border-color-negative;
} }
@ -314,11 +275,9 @@
.bi-border-bottom { .bi-border-bottom {
border-bottom: 1px solid @color-bi-border-line; border-bottom: 1px solid @color-bi-border-line;
&.disabled { &.disabled {
border-color: @color-bi-border-disabled !important; border-color: @color-bi-border-disabled !important;
} }
&.error { &.error {
border-color: @border-color-negative; border-color: @border-color-negative;
} }
@ -326,11 +285,9 @@
.bi-border-left { .bi-border-left {
border-left: 1px solid @color-bi-border-line; border-left: 1px solid @color-bi-border-line;
&.disabled { &.disabled {
border-color: @color-bi-border-disabled !important; border-color: @color-bi-border-disabled !important;
} }
&.error { &.error {
border-color: @border-color-negative; border-color: @border-color-negative;
} }
@ -339,7 +296,6 @@
.bi-theme-dark { .bi-theme-dark {
.bi-border { .bi-border {
border: 1px solid @color-bi-border-line-theme-dark; border: 1px solid @color-bi-border-line-theme-dark;
&.disabled { &.disabled {
border-color: @color-bi-border-disabled-theme-dark !important; border-color: @color-bi-border-disabled-theme-dark !important;
} }
@ -347,7 +303,6 @@
.bi-border-top { .bi-border-top {
border-top: 1px solid @color-bi-border-line-theme-dark; border-top: 1px solid @color-bi-border-line-theme-dark;
&.disabled { &.disabled {
border-color: @color-bi-border-disabled-theme-dark !important; border-color: @color-bi-border-disabled-theme-dark !important;
} }
@ -355,7 +310,6 @@
.bi-border-right { .bi-border-right {
border-right: 1px solid @color-bi-border-line-theme-dark; border-right: 1px solid @color-bi-border-line-theme-dark;
&.disabled { &.disabled {
border-color: @color-bi-border-disabled-theme-dark !important; border-color: @color-bi-border-disabled-theme-dark !important;
} }
@ -363,7 +317,6 @@
.bi-border-bottom { .bi-border-bottom {
border-bottom: 1px solid @color-bi-border-line-theme-dark; border-bottom: 1px solid @color-bi-border-line-theme-dark;
&.disabled { &.disabled {
border-color: @color-bi-border-disabled-theme-dark !important; border-color: @color-bi-border-disabled-theme-dark !important;
} }
@ -371,7 +324,6 @@
.bi-border-left { .bi-border-left {
border-left: 1px solid @color-bi-border-line-theme-dark; border-left: 1px solid @color-bi-border-line-theme-dark;
&.disabled { &.disabled {
border-color: @color-bi-border-disabled-theme-dark !important; border-color: @color-bi-border-disabled-theme-dark !important;
} }
@ -469,11 +421,9 @@
// 标红 // 标红
.bi-keyword-red-mark { .bi-keyword-red-mark {
color: @color-bi-text-redmark; color: @color-bi-text-redmark;
& .bi-input { & .bi-input {
color: @color-bi-text-redmark; color: @color-bi-text-redmark;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-redmark; color: @color-bi-text-redmark;
} }
@ -482,11 +432,9 @@
// 高亮 // 高亮
.bi-high-light { .bi-high-light {
color: @color-bi-text-highlight; color: @color-bi-text-highlight;
& .bi-input { & .bi-input {
color: @color-bi-text-highlight; color: @color-bi-text-highlight;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-highlight; color: @color-bi-text-highlight;
} }
@ -494,11 +442,9 @@
.bi-error { .bi-error {
color: @color-bi-text-failure; color: @color-bi-text-failure;
& .bi-input { & .bi-input {
color: @color-bi-text-failure; color: @color-bi-text-failure;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-failure; color: @color-bi-text-failure;
} }
@ -507,11 +453,9 @@
.bi-high-light-background { .bi-high-light-background {
background-color: @color-bi-background-highlight; background-color: @color-bi-background-highlight;
color: @color-bi-text; color: @color-bi-text;
& .bi-input { & .bi-input {
color: @color-bi-text; color: @color-bi-text;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text; color: @color-bi-text;
} }
@ -520,11 +464,9 @@
.bi-error-background { .bi-error-background {
background-color: @color-bi-background-failure; background-color: @color-bi-background-failure;
color: @color-bi-text; color: @color-bi-text;
& .bi-input { & .bi-input {
color: @color-bi-text; color: @color-bi-text;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text; color: @color-bi-text;
} }
@ -532,7 +474,6 @@
.bi-high-light-border { .bi-high-light-border {
border: 1px solid @color-bi-border-highlight; border: 1px solid @color-bi-border-highlight;
&.disabled { &.disabled {
border-color: @color-bi-border-disabled !important; border-color: @color-bi-border-disabled !important;
} }
@ -540,7 +481,6 @@
.bi-high-light-border-top { .bi-high-light-border-top {
border-top: 1px solid @color-bi-border-highlight; border-top: 1px solid @color-bi-border-highlight;
&.disabled { &.disabled {
border-color: @color-bi-border-disabled !important; border-color: @color-bi-border-disabled !important;
} }
@ -548,7 +488,6 @@
.bi-high-light-border-right { .bi-high-light-border-right {
border-right: 1px solid @color-bi-border-highlight; border-right: 1px solid @color-bi-border-highlight;
&.disabled { &.disabled {
border-color: @color-bi-border-disabled !important; border-color: @color-bi-border-disabled !important;
} }
@ -556,7 +495,6 @@
.bi-high-light-border-bottom { .bi-high-light-border-bottom {
border-bottom: 1px solid @color-bi-border-highlight; border-bottom: 1px solid @color-bi-border-highlight;
&.disabled { &.disabled {
border-color: @color-bi-border-disabled !important; border-color: @color-bi-border-disabled !important;
} }
@ -564,7 +502,6 @@
.bi-high-light-border-left { .bi-high-light-border-left {
border-left: 1px solid @color-bi-border-highlight; border-left: 1px solid @color-bi-border-highlight;
&.disabled { &.disabled {
border-color: @color-bi-border-disabled !important; border-color: @color-bi-border-disabled !important;
} }
@ -575,11 +512,9 @@
color: @color-bi-text-water-mark; color: @color-bi-text-water-mark;
cursor: text; cursor: text;
.user-select-disable(); .user-select-disable();
& .bi-input { & .bi-input {
color: @color-bi-text-water-mark; color: @color-bi-text-water-mark;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-water-mark; color: @color-bi-text-water-mark;
} }
@ -588,11 +523,9 @@
.bi-theme-dark { .bi-theme-dark {
.bi-water-mark { .bi-water-mark {
color: @color-bi-text-water-mark-theme-dark; color: @color-bi-text-water-mark-theme-dark;
& .bi-input { & .bi-input {
color: @color-bi-text-water-mark-theme-dark; color: @color-bi-text-water-mark-theme-dark;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-water-mark-theme-dark; color: @color-bi-text-water-mark-theme-dark;
} }
@ -615,30 +548,24 @@
// 蒙板 // 蒙板
.bi-mask { .bi-mask {
color: @color-bi-text; color: @color-bi-text;
& .bi-input { & .bi-input {
color: @color-bi-text; color: @color-bi-text;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text; color: @color-bi-text;
} }
.background-color(@color-bi-background-black, 20%); .background-color(@color-bi-background-black, 20%);
} }
.bi-theme-dark { .bi-theme-dark {
.bi-mask { .bi-mask {
color: @color-bi-text-white-theme-dark; color: @color-bi-text-white-theme-dark;
& .bi-input { & .bi-input {
color: @color-bi-text-white-theme-dark; color: @color-bi-text-white-theme-dark;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-white-theme-dark; color: @color-bi-text-white-theme-dark;
} }
.background-color(@color-bi-background-default, 20%); .background-color(@color-bi-background-default, 20%);
} }
} }
@ -649,7 +576,7 @@
} }
.bi-theme-dark { .bi-theme-dark {
.bi-z-index-mask, &.bi-z-index-mask { .bi-z-index-mask {
//color: @color-bi-background-default; //color: @color-bi-background-default;
//& .bi-input { //& .bi-input {
// color: @color-bi-background-default; // color: @color-bi-background-default;

25
packages/fineui/src/less/core/utils/list-item.less

@ -93,25 +93,6 @@
} }
} }
.bi-theme-dark {
.bi-list-item-simple {
&.disabled {
&, &:hover, &:active {
color: @color-bi-text-disabled-theme-dark !important;
& .bi-input {
color: @color-bi-text-disabled-theme-dark !important;
}
& .bi-textarea {
color: @color-bi-text-disabled-theme-dark !important;
}
& .bi-high-light {
color: @color-bi-text-disabled-theme-dark !important;
}
}
}
}
}
// hover的时候文字变黑 // hover的时候文字变黑
// active的时候文字高亮 // active的时候文字高亮
.bi-list-item-effect { .bi-list-item-effect {
@ -161,12 +142,12 @@
} }
} }
&.active, &:active { &.active, &:active {
color: @color-bi-text-highlight-theme-dark; color: @color-bi-text-highlight;
& .bi-input { & .bi-input {
color: @color-bi-text-highlight-theme-dark; color: @color-bi-text-highlight;
} }
& .bi-textarea { & .bi-textarea {
color: @color-bi-text-highlight-theme-dark; color: @color-bi-text-highlight;
} }
} }
&.disabled { &.disabled {

5
packages/fineui/src/less/lib/colors.less

@ -38,7 +38,6 @@
//基本提亮颜色 //基本提亮颜色
@color-bi-text-highlight: @font-color-highlight; @color-bi-text-highlight: @font-color-highlight;
@color-bi-text-highlight-theme-dark: @font-color-highlight;
//标红色 //标红色
@color-bi-text-redmark: @font-color-warning; @color-bi-text-redmark: @font-color-warning;
@ -51,7 +50,6 @@
@color-bi-background-normal: @background-color-normal; @color-bi-background-normal: @background-color-normal;
//深色主题普通背景 //深色主题普通背景
@color-bi-background-normal-theme-dark: @background-color-normal-theme-dark; @color-bi-background-normal-theme-dark: @background-color-normal-theme-dark;
@color-bi-background-theme-dark: @background-color-normal-theme-dark;
//默认背景 //默认背景
@color-bi-background-default: @background-color-default; @color-bi-background-default: @background-color-default;
//深色主题默认背景 //深色主题默认背景
@ -134,6 +132,3 @@
@color-bi-border-warning: @border-color-warning; @color-bi-border-warning: @border-color-warning;
//边框提亮 //边框提亮
@color-bi-border-highlight: @border-color-highlight; @color-bi-border-highlight: @border-color-highlight;
@color-bi-border-highlight-theme-dark: @border-color-highlight;
@color-bi-alert-warning: @color-bi-orange;

2
packages/fineui/src/less/lib/constant.less

@ -248,5 +248,3 @@
//box-shadow效果 //box-shadow效果
@box-shadow-toast: 0 6px 20px -2px rgba(9, 30, 64, 0.16); @box-shadow-toast: 0 6px 20px -2px rgba(9, 30, 64, 0.16);
@color-bi-orange: #f0ac3c;

5
packages/fineui/src/less/lib/font.less

@ -58,8 +58,3 @@
@font-key: "e1d0"; @font-key: "e1d0";
@font-add: "e1c7"; @font-add: "e1c7";
@font-alert-warning: 'e755';
@font-alert-success: 'e6de';
@font-alert-info: 'e74b';
@font-alert-error: 'e757';

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

Loading…
Cancel
Save