Compare commits

..

11 Commits
master ... es6

Author SHA1 Message Date
treecat-罗群 0ed3e845b1 Pull request #3664: KERNEL-15856 fix:兼容定时调度 8 months ago
Treecat 3995479d53 Revert "无jira: fix:material 代理问题" 8 months ago
Treecat f85867bb66 KERNEL-15856 fix:兼容定时调度 8 months ago
Jimmy.Chai-柴嘉明 f4f58e24e0 Pull request #3607: BI-128881 fix: 深色主题无更多数据这几个字没有显示出来 12 months ago
jimmychai 6c62a7c695 BI-128881 fix: 深色主题无更多数据这几个字没有显示出来 12 months ago
Jimmy.Chai-柴嘉明 c057e5cd2c Pull request #3593: 无jira任务 refactor:reduce类型 12 months ago
jimmychai c5dfb11f1f 无jira任务 refactor:reduce类型 12 months ago
Kobi-蒋科斌 0143741ef5 Pull request #3592: BI-128046 style: 弹窗按钮样式 1 year ago
Kobi 2b50b02d79 Merge remote-tracking branch 'origin/es6' into es6 1 year ago
Kobi 3b4ffbbe45 BI-128046 style: 弹窗按钮样式 1 year ago
Treecat ba1e19280c 无jira: fix:material 代理问题 1 year ago
  1. 14
      README
  2. 11
      package.json
  3. BIN
      packages/fineui/dist/font/iconfont.eot
  4. 380
      packages/fineui/dist/font/iconfont.svg
  5. BIN
      packages/fineui/dist/font/iconfont.ttf
  6. BIN
      packages/fineui/dist/font/iconfont.woff
  7. BIN
      packages/fineui/dist/font/iconfont.woff2
  8. 2
      packages/fineui/lessconfig/bi.lessconfig.json
  9. 0
      packages/fineui/lessconfig/jsy.lessconfig.json
  10. 7
      packages/fineui/package.json
  11. 6
      packages/fineui/src/base/1.pane.js
  12. 6
      packages/fineui/src/base/collection/collection.js
  13. 14
      packages/fineui/src/base/combination/bubble.js
  14. 4
      packages/fineui/src/base/combination/expander.js
  15. 4
      packages/fineui/src/base/combination/group.button.js
  16. 6
      packages/fineui/src/base/combination/group.virtual.js
  17. 8
      packages/fineui/src/base/combination/loader.js
  18. 2
      packages/fineui/src/base/combination/navigation.js
  19. 2
      packages/fineui/src/base/combination/searcher.js
  20. 2
      packages/fineui/src/base/combination/switcher.js
  21. 6
      packages/fineui/src/base/combination/tab.js
  22. 203
      packages/fineui/src/base/foundation/message.js
  23. 1
      packages/fineui/src/base/index.js
  24. 68
      packages/fineui/src/base/layer/layer.popover.js
  25. 5
      packages/fineui/src/base/list/listview.js
  26. 36
      packages/fineui/src/base/list/virtualgrouplist.js
  27. 2
      packages/fineui/src/base/single/0.single.js
  28. 3
      packages/fineui/src/base/single/button/button.basic.js
  29. 1
      packages/fineui/src/base/single/button/listitem/icontextitem.js
  30. 2
      packages/fineui/src/base/single/editor/editor.textarea.js
  31. 2
      packages/fineui/src/base/single/input/checkbox/checkbox.js
  32. 9
      packages/fineui/src/base/single/input/file.js
  33. 4
      packages/fineui/src/base/single/input/input.js
  34. 2
      packages/fineui/src/base/single/input/radio/radio.image.js
  35. 2
      packages/fineui/src/base/single/input/radio/radio.js
  36. 6
      packages/fineui/src/base/tree/customtree.js
  37. 7
      packages/fineui/src/bundle.js
  38. 2
      packages/fineui/src/case/button/item.multiselect.js
  39. 26
      packages/fineui/src/case/button/switch.js
  40. 3
      packages/fineui/src/case/button/treeitem/item.icon.treeleaf.js
  41. 100
      packages/fineui/src/case/button/treeitem/item.multilayer.icon.treeleaf.js
  42. 8
      packages/fineui/src/case/button/treeitem/treeitem.js
  43. 3
      packages/fineui/src/case/colorchooser/colorchooser.js
  44. 18
      packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js
  45. 3
      packages/fineui/src/case/colorchooser/colorchooser.trigger.long.js
  46. 17
      packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.hex.js
  47. 6
      packages/fineui/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js
  48. 1
      packages/fineui/src/case/combo/bubblecombo/combo.bubble.js
  49. 16
      packages/fineui/src/case/combo/bubblecombo/popup.bubble.js
  50. 5
      packages/fineui/src/case/combo/textvaluecombo/combo.textvalue.js
  51. 8
      packages/fineui/src/case/list/list.select.js
  52. 53
      packages/fineui/src/case/pager/pager.direction.js
  53. 43
      packages/fineui/src/case/ztree/asynctree.js
  54. 4
      packages/fineui/src/case/ztree/list/listasynctree.js
  55. 4
      packages/fineui/src/case/ztree/list/listparttree.js
  56. 2
      packages/fineui/src/case/ztree/list/listtreeview.js
  57. 15
      packages/fineui/src/case/ztree/parttree.js
  58. 4
      packages/fineui/src/case/ztree/tree.list.display.js
  59. 2
      packages/fineui/src/component/form/form.field.js
  60. 34
      packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.js
  61. 25
      packages/fineui/src/component/treevaluechooser/abstract.treevaluechooser.list.js
  62. 11
      packages/fineui/src/component/treevaluechooser/pane.treevaluechooser.js
  63. 33
      packages/fineui/src/core/1.lodash.js
  64. 15
      packages/fineui/src/core/2.base.js
  65. 2
      packages/fineui/src/core/3.ob.js
  66. 33
      packages/fineui/src/core/4.widget.js
  67. 5
      packages/fineui/src/core/5.inject.js
  68. 115
      packages/fineui/src/core/constant/writable.var.js
  69. 17
      packages/fineui/src/core/controller/controller.layer.js
  70. 2
      packages/fineui/src/core/controller/controller.masker.js
  71. 17
      packages/fineui/src/core/controller/controller.popover.js
  72. 38
      packages/fineui/src/core/element/element.js
  73. 2
      packages/fineui/src/core/func/alias.js
  74. 2
      packages/fineui/src/core/func/date.js
  75. 2
      packages/fineui/src/core/loader/loader.style.js
  76. 47
      packages/fineui/src/core/platform/web/config.js
  77. 4
      packages/fineui/src/core/platform/web/detectElementResize.js
  78. 19
      packages/fineui/src/core/platform/web/load.js
  79. 2
      packages/fineui/src/core/structure/cache.js
  80. 2
      packages/fineui/src/core/utils/color.js
  81. 36
      packages/fineui/src/core/utils/dom.js
  82. 6
      packages/fineui/src/core/utils/index.js
  83. 2
      packages/fineui/src/core/wrapper/layout/flex/flex.horizontal.js
  84. 7
      packages/fineui/src/core/wrapper/layout/layout.card.js
  85. 2
      packages/fineui/src/core/wrapper/layout/layout.table.js
  86. 22
      packages/fineui/src/fix/fix.compact.js
  87. 725
      packages/fineui/src/fix/fix.js
  88. 2
      packages/fineui/src/index.js
  89. 116
      packages/fineui/src/less/base/single/button/button.less
  90. 3
      packages/fineui/src/less/base/single/input/radio.less
  91. 4
      packages/fineui/src/less/base/tree/ztree.less
  92. 81
      packages/fineui/src/less/core/utils/common.less
  93. 2
      packages/fineui/src/less/lib/colors.less
  94. 2
      packages/fineui/src/less/lib/constant.less
  95. 5
      packages/fineui/src/less/lib/font.less
  96. 14
      packages/fineui/src/less/resource/app.less
  97. 5
      packages/fineui/src/less/resource/font.less
  98. 2
      packages/fineui/src/less/visual.less
  99. 3
      packages/fineui/src/less/widget/intervalslider/intervalslider.label.less
  100. 3
      packages/fineui/src/less/widget/intervalslider/intervalslider.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
```
## 发布 ## 发布

11
package.json

@ -23,17 +23,13 @@
"@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 +39,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.

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

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1.0 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.

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

@ -28,7 +28,7 @@
"@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",

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.20230615140705",
"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",

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

@ -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);
} }
} }

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

@ -134,7 +134,7 @@ export class Searcher extends Widget {
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) {

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

@ -263,7 +263,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);
} }
} }

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

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

68
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,11 +226,11 @@ 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
@ -242,11 +238,11 @@ export class Popover extends Widget {
} }
_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,7 +305,7 @@ 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,
@ -319,10 +313,9 @@ export class BarPopover extends Popover {
items: [ items: [
{ {
type: Button.xtype, type: Button.xtype,
height: footerButtonHeight,
text: this.options.btns[1], text: this.options.btns[1],
value: 1, value: 1,
light: true, level: "ignore",
handler: v => { handler: v => {
this.fireEvent(Popover.EVENT_CANCEL, v); this.fireEvent(Popover.EVENT_CANCEL, v);
this.close(v); this.close(v);
@ -330,7 +323,6 @@ export class BarPopover extends Popover {
}, },
{ {
type: Button.xtype, type: Button.xtype,
height: footerButtonHeight,
text: this.options.btns[0], text: this.options.btns[0],
warningTitle, warningTitle,
value: 0, value: 0,

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);
} }

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

@ -242,11 +242,14 @@ const sendFile = (toString => {
upload.onloadstart(); upload.onloadstart();
} }
} }
if (handler.file.getAsBinary) {
const boundary = `AjaxUploadBoundary${new Date().getTime()}`; const boundary = `AjaxUploadBoundary${new Date().getTime()}`;
xhr.setRequestHeader("Content-Type", `multipart/form-data; boundary=${boundary}`); xhr.setRequestHeader("Content-Type", `multipart/form-data; boundary=${boundary}`);
if (handler.file.getAsBinary) {
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);
} }

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

@ -105,7 +105,6 @@ export class CustomTree extends Widget {
return itemsCreator.apply(this, args); return itemsCreator.apply(this, args);
}; };
isNull(item.popup.el) && (item.popup.el = deepClone(this.options.el)); 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);
@ -123,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"),
}, },
} }

17
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,13 +95,11 @@ 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"),
invisible: !this.options.transparent,
listeners: [ listeners: [
{ {
eventName: ColorChooserShowButton.EVENT_CHANGE, eventName: ColorChooserShowButton.EVENT_CHANGE,
@ -117,8 +113,6 @@ export class HexColorPickerEditor extends Widget {
this.transparent = _ref; this.transparent = _ref;
}, },
}, },
rgap: this.options.auto ? 5 : 0,
},
{ {
el: { el: {
type: ColorChooserShowButton.xtype, type: ColorChooserShowButton.xtype,
@ -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;

15
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);
@ -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();
} }

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

@ -602,11 +602,6 @@ 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) { export function getClass(xtype) {
return kv[xtype] || serviceInjection[xtype]; return kv[xtype] || serviceInjection[xtype];
} }

115
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 });
@ -120,22 +132,15 @@ export const setEventBlur = v => {
EVENT_BLUR = v; EVENT_BLUR = v;
Cache.setItem("event.blur", v); Cache.setItem("event.blur", v);
}; };
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", { export function _defineVarProperties(libName) {
get: () => nextTick, Object.defineProperties(libName, PropertyDescriptors);
set: setNextTick, }
});

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]); 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];
} }

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

@ -1,8 +1,7 @@
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 = {};
@ -26,8 +25,13 @@ export let Element = class {
} else if (isString(widget)) { } else if (isString(widget)) {
this.nodeName = widget; this.nodeName = widget;
} }
} }
initElement(Element);
registFunction(Element);
function initElement(element) {
element.prototype = {
appendChild(child) { appendChild(child) {
child.parent = this; child.parent = this;
if (this.children.push(child) !== 1) { if (this.children.push(child) !== 1) {
@ -36,8 +40,7 @@ export let Element = class {
child.prev = sibling; child.prev = sibling;
child.next = null; child.next = null;
} }
} },
append(child) { append(child) {
child.parent = this; child.parent = this;
if (this.children.push(child) !== 1) { if (this.children.push(child) !== 1) {
@ -46,33 +49,28 @@ export let Element = class {
child.prev = sibling; child.prev = sibling;
child.next = null; child.next = null;
} }
} },
getParent() { getParent() {
return this.parent; return this.parent;
} },
getSiblings() { getSiblings() {
const parent = this.getParent(); const parent = this.getParent();
return parent ? parent.getChildren() : [this]; return parent ? parent.getChildren() : [this];
} },
getChildren() { getChildren() {
return this.children; return this.children;
} },
getBounds() { getBounds() {
return {}; return {};
} },
width() {}
height() {} width() {
}
registFunction(Element); },
height() {
export function setElement(element) { },
Element = element; };
} }

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

@ -637,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 "\\":

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);
}, },
}; };

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) {

36
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,14 +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;
if (position.top < comboRect.top) {
popup.resetHeight(Math.min(viewportBounds.height - position.top - relativeOffset, comboRect.top, maxHeight));
} else if (position.top >= comboRect.bottom) {
popup.resetHeight(Math.min(viewportBounds.height - position.top - relativeOffset, viewportBounds.height - comboRect.bottom, maxHeight));
}
} }
return position; return position;
@ -794,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),

22
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";
@ -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,25 +213,6 @@ 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 &&

725
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 };

116
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,52 +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 {
&.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;
} }
@ -607,36 +506,31 @@ 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);

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;
} }

81
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;
@ -134,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;
} }
@ -144,11 +134,9 @@
.bi-background { .bi-background {
background-color: @color-bi-background-normal-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;
} }
@ -158,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;
} }
@ -172,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;
} }
@ -187,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;
@ -203,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;
} }
@ -220,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;
} }
@ -247,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;
} }
@ -274,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;
} }
@ -286,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;
} }
@ -298,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;
} }
@ -310,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;
} }
@ -322,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;
} }
@ -335,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;
} }
@ -343,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;
} }
@ -351,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;
} }
@ -359,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;
} }
@ -367,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;
} }
@ -465,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;
} }
@ -478,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;
} }
@ -490,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;
} }
@ -503,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;
} }
@ -516,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;
} }
@ -528,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;
} }
@ -536,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;
} }
@ -544,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;
} }
@ -552,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;
} }
@ -560,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;
} }
@ -571,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;
} }
@ -584,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;
} }
@ -611,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%);
} }
} }
@ -645,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;

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

@ -132,5 +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-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';

14
packages/fineui/src/less/resource/app.less

@ -25,20 +25,10 @@ body {
outline: 0 none; outline: 0 none;
} }
@-moz-document url-prefix() { div, textarea {
div, textarea {
scrollbar-color: fade(@scroll-color, 10%) fade(@scroll-color, 5%); scrollbar-color: fade(@scroll-color, 10%) fade(@scroll-color, 5%);
scrollbar-width: thin; scrollbar-width: thin;
}
.bi-theme-dark {
div, textarea {
scrollbar-color: fade(@scroll-color-theme-dark, 10%) fade(@scroll-color-theme-dark, 5%);
}
}
}
div, textarea {
&::-webkit-scrollbar { &::-webkit-scrollbar {
-webkit-appearance: none; -webkit-appearance: none;
width: 10px; width: 10px;
@ -73,6 +63,8 @@ div, textarea {
.bi-theme-dark { .bi-theme-dark {
div, textarea { div, textarea {
scrollbar-color: fade(@scroll-color-theme-dark, 10%) fade(@scroll-color-theme-dark, 5%);
&::-webkit-scrollbar { &::-webkit-scrollbar {
-webkit-appearance: none; -webkit-appearance: none;
} }

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

@ -118,8 +118,3 @@
.font(text-align-left-font, @font-align-left); .font(text-align-left-font, @font-align-left);
.font(text-align-center-font, @font-align-center); .font(text-align-center-font, @font-align-center);
.font(text-align-right-font, @font-align-right); .font(text-align-right-font, @font-align-right);
.font(alert-success-font, @font-alert-success, @color-sea-green-100);
.font(alert-warning-font, @font-alert-warning, @color-bi-alert-warning);
.font(alert-error-font, @font-alert-error, @color-red-100);
.font(alert-info-font, @font-alert-info, @color-bi-text-highlight);

2
packages/fineui/src/less/visual.less

@ -43,11 +43,13 @@
.background-color(@color, @alpha) { .background-color(@color, @alpha) {
background-color: fade(@color, @alpha); background-color: fade(@color, @alpha);
@ieColor: argb(fade(@color, @alpha)); @ieColor: argb(fade(@color, @alpha));
filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr=@{ieColor},endColorstr=@{ieColor})";
} }
.opacity(@opa) { .opacity(@opa) {
opacity: @opa; opacity: @opa;
@opa-ie: @opa*100; @opa-ie: @opa*100;
filter: ~'alpha(opacity=@{opa-ie})';
} }
.transition(@transition) { .transition(@transition) {

3
packages/fineui/src/less/widget/intervalslider/intervalslider.label.less

@ -0,0 +1,3 @@
.bi-interval-slider-label {
min-height: 50px;
}

3
packages/fineui/src/less/widget/intervalslider/intervalslider.less

@ -0,0 +1,3 @@
.bi-interval-slider {
min-height: 50px;
}

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

Loading…
Cancel
Save