Browse Source

Merge pull request #248273 in DEC/fineui from final/11.0 to persist/11.0

* commit '16a7fb68f6f333632f79858d2ed447c2c5f7a99e': (35 commits)
  BI-133048 fix: 图标更新
  BI-130857 fix: 图标更新
  BI-130558 fix: 【6.0.13发散】预览布局和内容缩放,控件下拉搜索,全选和选项的缩放比例不一样
  无JIRA fix调用相关的先放在compact里面,不然会循环引用
  REPORT-102409 fix:FR11样式-下拉树控件-不勾选“异步展开树节点”,模糊搜索异常
  无JIRA 事件名写错了.
  BI-131340 fix: DynamicDateTimeCombo不设置value的默认值
  BI-131340 fix: DynamicDateTimeCombo的value默认值设置为null
  BI-115380 fix: 暗模式下按钮disabled时字体颜色被覆盖
  无JIRA任务 title问题
  BI-115380 fix: 暗模式下按钮disabled时字体颜色被覆盖
  无JIRA任务 提示不对
  无JIRA任务 title 变来变去的
  无jira任务 间距
  BI-115380 fix: 暗模式下按钮disabled时字体颜色被覆盖
  无jira任务 优化height
  无jira任务,Selection没有引用
  无JIRA fix: this指向问题
  无jira任务,组件抛出来
  无jira任务,NumberIntervalSingleEditor抛出来
  ...
research/test
superman 9 months ago
parent
commit
7413e2b051
  1. 5
      README
  2. 1
      package.json
  3. 0
      packages/fineui/bi.lessconfig.json
  4. BIN
      packages/fineui/dist/font/iconfont.eot
  5. 170
      packages/fineui/dist/font/iconfont.svg
  6. BIN
      packages/fineui/dist/font/iconfont.ttf
  7. BIN
      packages/fineui/dist/font/iconfont.woff
  8. BIN
      packages/fineui/dist/font/iconfont.woff2
  9. 0
      packages/fineui/jsy.lessconfig.json
  10. 4
      packages/fineui/package.json
  11. 2
      packages/fineui/src/base/combination/searcher.js
  12. 2
      packages/fineui/src/base/index.js
  13. 1
      packages/fineui/src/base/single/button/button.basic.js
  14. 1
      packages/fineui/src/base/single/button/listitem/icontextitem.js
  15. 2
      packages/fineui/src/base/single/input/file.js
  16. 2
      packages/fineui/src/base/single/input/input.js
  17. 1
      packages/fineui/src/case/combo/bubblecombo/combo.bubble.js
  18. 4
      packages/fineui/src/case/combo/textvaluecombo/combo.textvalue.js
  19. 25
      packages/fineui/src/core/4.widget.js
  20. 2
      packages/fineui/src/core/func/alias.js
  21. 2
      packages/fineui/src/core/structure/cache.js
  22. 59
      packages/fineui/src/fix/fix.compact.js
  23. 2
      packages/fineui/src/index.js
  24. 4
      packages/fineui/src/less/base/single/button/button.less
  25. 1
      packages/fineui/src/third/index.js
  26. 1
      packages/fineui/src/widget/downlist/item.downlist.js
  27. 1
      packages/fineui/src/widget/downlist/item.downlistgroup.js
  28. 1
      packages/fineui/src/widget/downlist/popup.downlist.js
  29. 36
      packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.combo.js
  30. 1
      packages/fineui/src/widget/editor/editor.search.js
  31. 1
      packages/fineui/src/widget/index.js
  32. 2
      packages/fineui/src/widget/multilayerdownlist/combo.downlist.js
  33. 1
      packages/fineui/src/widget/multiselect/multiselect.combo.js
  34. 20
      packages/fineui/src/widget/multiselect/search/multiselect.search.loader.js
  35. 2
      packages/fineui/typescript/case/button/icon/icon.change.ts
  36. 1
      packages/fineui/typescript/widget/timeinterval/timeinterval.ts
  37. 8
      packages/fineui/webpack/attachments.js
  38. 2
      packages/fineui/webpack/webpack.common.js
  39. 2
      packages/fineui/webpack/webpack.css.js
  40. 2293
      pnpm-lock.yaml

5
README

@ -23,9 +23,12 @@ http://fanruan.design/doc.html?post=0169cf558d
`pnpm run build`
## 自定义less变量构建
```
cross-env LESS_CONFIG_PATH=your_less_config.json && pnpm build
```
## 构建自定义的css
```
cd ./packages/fineui
cross-env LESS_CONFIG_PATH=your_less_config.json LESS_FILE_NAME=your_file_name pnpm --filter @fui/core webpack:css
```

1
package.json

@ -41,6 +41,7 @@
"less-loader": "^11.1.0",
"mini-css-extract-plugin": "^2.7.5",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.0",
"postcss": "^8.4.21",
"postcss-loader": "^7.1.0",
"style-loader": "^3.3.1",

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

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

Binary file not shown.

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

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 922 KiB

After

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

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

4
packages/fineui/package.json

@ -1,6 +1,6 @@
{
"name": "@fui/core",
"version": "3.0.20230707165537",
"version": "3.0.20230727164622",
"description": "fineui",
"main": "dist/fineui.min.js",
"module": "dist/lib/index.js",
@ -58,4 +58,4 @@
"core-js": "^3.30.2",
"cross-env": "^7.0.3"
}
}
}

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

@ -134,7 +134,7 @@ export class Searcher extends Widget {
this.popupView = createWidget(popup, {
type: SearcherView.xtype,
chooseType,
});
}, this);
this.popupView.on(Controller.EVENT_CHANGE, (type, value, obj, ...args) => {
this.fireEvent(Controller.EVENT_CHANGE, type, value, obj, ...args);
if (type === Events.CLICK) {

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

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

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

@ -193,6 +193,7 @@ export class BasicButton extends Single {
trigger: "",
// bubble的提示不需要一直存在在界面上
destroyWhenHide: true,
hideWhenAnotherComboOpen: true,
ref: _ref => {
this.combo = _ref;
},

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

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

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

@ -541,7 +541,7 @@ export class File extends Widget {
// We can still show some information
}
this.fireEvent(File.EVENT_PROGRESS, {
file: this.file,
file: _wrap.file,
total: rpe.total,
loaded: rpe.loaded,
simulation: rpe.simulation,

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

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

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

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

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

@ -144,8 +144,8 @@ export class TextValueCombo extends Widget {
return {
type: Combo.xtype,
height: toPix(o.height, 2),
width: toPix(o.width, 2),
height: toPix(o.height, o.simple ? 1 : 2),
width: toPix(o.width, o.simple ? 0 : 2),
ref: ref => (this.combo = ref),
container: o.container,
direction: o.direction,

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

@ -25,7 +25,7 @@ import {
import { OB } from "./3.ob";
import { Providers, _lazyCreateWidget } from "./5.inject";
import { DOM } from "./utils";
import { Events, emptyFn, pixFormat } from "./constant";
import { Events, pixFormat } from "./constant";
import { Plugin } from "./6.plugin";
import { _global } from "./0.foundation";
import { SystemProvider } from "./system";
@ -336,29 +336,6 @@ 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

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

@ -637,7 +637,7 @@ export const getEncodeURL = function(urlTemplate, param) {
export const encodeURIComponent = function(url) {
const specialCharsMap = getSpecialCharsMap();
url = url || "";
url = url ?? "";
url = replaceAll(`${url}`, keys(specialCharsMap || []).join("|"), str => {
switch (str) {
case "\\":

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

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

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

@ -7,7 +7,7 @@ import {
extend,
isFunction,
Widget,
Providers
Providers, emptyFn
} from "@/core";
import { Fix } from "./fix";
@ -76,7 +76,7 @@ function popTarget() {
export const Model = Fix.Model;
const oldWatch = Fix.watch;
Fix.watch = function (model, expOrFn, cb, options) {
Fix.watch = function(model, expOrFn, cb, options) {
if (isPlainObject(cb)) {
options = cb;
cb = cb.handler;
@ -89,7 +89,7 @@ Fix.watch = function (model, expOrFn, cb, options) {
this,
model,
expOrFn,
function () {
function() {
options && options.store && pushTarget(options.store);
let res;
try {
@ -142,9 +142,9 @@ export function createStore() {
if (this._store || this.options._store) {
const store = Widget.findStore(
this.options.context ||
this._parent ||
this.options.element ||
this._context
this._parent ||
this.options.element ||
this._context
);
if (store) {
pushTarget(store);
@ -167,7 +167,7 @@ export function createStore() {
}
const _init = Widget.prototype._init;
Widget.prototype._init = function () {
Widget.prototype._init = function() {
const needPop = createStore.call(this);
try {
_init.apply(this, arguments);
@ -178,7 +178,7 @@ Widget.prototype._init = function () {
};
const __initWatch = Widget.prototype.__initWatch;
Widget.prototype.__initWatch = function () {
Widget.prototype.__initWatch = function() {
__initWatch.apply(this, arguments);
const workerMode =
Providers.getProvider("bi.provider.system").getWorkerMode();
@ -191,7 +191,7 @@ Widget.prototype.__initWatch = function () {
};
const unMount = Widget.prototype.__destroy;
Widget.prototype.__destroy = function () {
Widget.prototype.__destroy = function() {
try {
unMount.apply(this, arguments);
} catch (e) {
@ -213,19 +213,38 @@ Widget.prototype.__destroy = function () {
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) => {
const old = Widget.prototype[name];
old &&
(Widget.prototype[name] = function () {
this.store && pushTarget(this.store);
let res;
try {
res = old.apply(this, arguments);
} catch (e) {
console.error(e);
}
this.store && popTarget();
(Widget.prototype[name] = function() {
this.store && pushTarget(this.store);
let res;
try {
res = old.apply(this, arguments);
} catch (e) {
console.error(e);
}
this.store && popTarget();
return res;
});
return res;
});
});

2
packages/fineui/src/index.js

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

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

@ -479,8 +479,8 @@ body .bi-button, #body .bi-button {
}
}
.bi-theme-dark {
.bi-button, #body .bi-button {
.bi-theme-dark, #body .bi-theme-dark {
.bi-button {
&.button-ignore {
background-color: @color-bi-background-ignore-button-theme-dark;
&:hover, &:focus {

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

@ -0,0 +1 @@
export * from "./sort.gb2312";

1
packages/fineui/src/widget/downlist/item.downlist.js

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

1
packages/fineui/src/widget/downlist/item.downlistgroup.js

@ -42,6 +42,7 @@ export class DownListGroupItem extends BasicButton {
cls: "list-group-item-text",
textAlign: "left",
text: o.text,
title: o.title,
value: o.value,
height: o.height,
});

1
packages/fineui/src/widget/downlist/popup.downlist.js

@ -1,5 +1,6 @@
import { ButtonTree, Pane } from "@/base";
import {
Selection,
VerticalLayout,
Layout,
shortcut,

36
packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.combo.js

@ -31,29 +31,19 @@ export class DynamicDateTimeCombo extends Single {
iconWidth: 24
};
props = () => {
const date = getDate();
return {
baseCls: "bi-dynamic-date--time-combo",
height: 24,
minDate: "1900-01-01",
maxDate: "2099-12-31",
format: "",
allowEdit: true,
supportDynamic: true,
attributes: {
tabIndex: -1
},
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
value: {
type: DynamicDateTimeCombo.Static,
value: {
year: date.getFullYear(),
month: date.getMonth() + 1
}
}
};
props = {
baseCls: "bi-dynamic-date--time-combo",
height: 24,
minDate: "1900-01-01",
maxDate: "2099-12-31",
format: "",
allowEdit: true,
supportDynamic: true,
attributes: {
tabIndex: -1,
},
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
};
static EVENT_KEY_DOWN = "EVENT_KEY_DOWN";

1
packages/fineui/src/widget/editor/editor.search.js

@ -69,6 +69,7 @@ export class SearchEditor extends Widget {
quitChecker: o.quitChecker,
value: o.value,
autoTrim: o.autoTrim,
autocomplete: o.autocomplete
});
this.clear = createWidget({
type: IconButton.xtype,

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

@ -7,6 +7,7 @@ export { MultiTreeInsertCombo } from "./multitree/multi.tree.insert.combo";
export { MultiTreeListCombo } from "./multitree/multi.tree.list.combo";
export { NumberEditor } from "./numbereditor/number.editor";
export { NumberInterval } from "./numberinterval/numberinterval";
export { NumberIntervalSingleEidtor } from "./numberinterval/singleeditor/single.editor";
export { YearMonthInterval } from "./yearmonthinterval/yearmonthinterval";
export { YearQuarterInterval } from "./yearquarterinterval/yearquarterinterval";
export { YearInterval } from "./yearinterval/yearinterval";

2
packages/fineui/src/widget/multilayerdownlist/combo.downlist.js

@ -33,7 +33,7 @@ export class MultiLayerDownListCombo extends Widget {
items: o.items,
chooseType: o.chooseType,
value: o.value,
});
}, this);
this.popupview.on(MultiLayerDownListPopup.EVENT_CHANGE, value => {
this.fireEvent(MultiLayerDownListCombo.EVENT_CHANGE, value);

1
packages/fineui/src/widget/multiselect/multiselect.combo.js

@ -47,7 +47,6 @@ export class MultiSelectCombo extends Single {
static EVENT_SEARCHING = "EVENT_SEARCHING";
static EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
static EVENT_CONFIRM = "EVENT_CONFIRM";
static MultiSelectCombo = "MultiSelectCombo";
static EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
_defaultConfig() {

20
packages/fineui/src/widget/multiselect/search/multiselect.search.loader.js

@ -78,9 +78,9 @@ export class MultiSelectSearchLoader extends Widget {
},
itemsCreator(op, callback) {
self.storeValue &&
(op = extend(op || {}, {
selectedValues: self.storeValue.value,
}));
(op = extend(op || {}, {
selectedValues: self.storeValue.value,
}));
opts.itemsCreator(op, ob => {
const keyword = (ob.keyword = opts.keywordGetter());
hasNext = ob.hasNext;
@ -113,7 +113,7 @@ export class MultiSelectSearchLoader extends Widget {
el: {
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
behaviors: {
redmark () {
redmark() {
return true;
},
},
@ -123,7 +123,7 @@ export class MultiSelectSearchLoader extends Widget {
}
],
},
itemsCreator (op, callback) {
itemsCreator(op, callback) {
self.storeValue && (op = BI.extend(op || {}, {
selectedValues: self.storeValue.value,
}));
@ -146,13 +146,13 @@ export class MultiSelectSearchLoader extends Widget {
},
value: opts.value,
height: "fill",
});
this.button_group.on(Controller.EVENT_CHANGE, function () {
}, this);
this.button_group.on(Controller.EVENT_CHANGE, function() {
self.fireEvent(Controller.EVENT_CHANGE, arguments);
});
const searchLoaderEventChangeName = opts.allowSelectAll ? SelectList.EVENT_CHANGE : ListPane.EVENT_CHANGE;
this.button_group.on(searchLoaderEventChangeName, function () {
this.button_group.on(searchLoaderEventChangeName, function() {
self.fireEvent(MultiSelectSearchLoader.EVENT_CHANGE, arguments);
});
}
@ -179,7 +179,7 @@ export class MultiSelectSearchLoader extends Widget {
isAllSelected() {
const o = this.options;
return o.allowSelectAll ? this.button_group.isAllSelected() : false;
}
@ -222,7 +222,7 @@ export class MultiSelectSearchLoader extends Widget {
if (o.allowSelectAll) {
return this.button_group.getValue();
}
return {
type: ButtonGroup.CHOOSE_TYPE_MULTI,
value: this.button_group.getValue(),

2
packages/fineui/typescript/case/button/icon/icon.change.ts

@ -6,7 +6,7 @@ export declare class IconChangeButton extends Single {
static EVENT_CHANGE: string;
props: {
iconCls: string;
iconCls: string | (() => string);
} & IconButton['props']
isSelected(): boolean;

1
packages/fineui/typescript/widget/timeinterval/timeinterval.ts

@ -12,6 +12,7 @@ export declare class TimeInterval extends Single {
maxDate?: string;
supportDynamic?: boolean;
watermark?: string;
simple?: boolean;
} & Single['props']
getValue(): {

8
packages/fineui/webpack/attachments.js

@ -10,7 +10,7 @@ const basicAttachmentMap = {
resource: sync(["src/less/resource/**/*.less"]),
font: sync(["public/less/font.less"]),
ts: ["./typescript/bundle.ts"],
ui: sync(["ui/less/app.less", "ui/less/**/*.less", "ui/js/**/*.js"]),
ui: sync(["ui/less/app.less", "ui/less/**/*.less",]),
less: sync([
"src/less/core/**/*.less",
"src/less/theme/**/*.less",
@ -20,23 +20,21 @@ const basicAttachmentMap = {
"src/less/component/**/*.less"
]),
js_bundle: sync(["src/bundle.js"]),
js_worker: sync(["src/worker.js"])
js_worker: sync(["src/worker.js"]),
};
const bundleCss = [].concat(basicAttachmentMap.less, sync(["public/less/app.less", "public/less/**/*.less"]));
const bundleCss = uniq([].concat(basicAttachmentMap.less, basicAttachmentMap.ui, sync(["public/less/app.less", "public/less/**/*.less"])));
const fineui = [].concat(
bundleCss,
basicAttachmentMap.polyfill,
basicAttachmentMap.js_bundle,
basicAttachmentMap.ui,
basicAttachmentMap.ts,
configJS
);
const fineuiForWorker = [].concat(
basicAttachmentMap.js_worker,
basicAttachmentMap.ui,
basicAttachmentMap.ts
);

2
packages/fineui/webpack/webpack.common.js

@ -14,7 +14,7 @@ let lessVariables = {};
if (process.env.LESS_CONFIG_PATH) {
const lessConfigPath = path.isAbsolute(process.env.LESS_CONFIG_PATH)
? process.env.LESS_CONFIG_PATH
: path.resolve(__dirname, "../lessconfig", process.env.LESS_CONFIG_PATH);
: path.resolve(__dirname, "../", process.env.LESS_CONFIG_PATH);
lessVariables = fs.existsSync(lessConfigPath) ? require(lessConfigPath) || {} : {};
}

2
packages/fineui/webpack/webpack.css.js

@ -6,6 +6,6 @@ prod.entry = {};
module.exports = merge(prod, {
mode: "production",
entry: {
[`${process.env.LESS_FILE_NAME}.min`]: attachments.bundleCss,
[`${process.env.LESS_FILE_NAME || "custom"}.min`]: attachments.bundleCss,
},
});

2293
pnpm-lock.yaml

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save