Browse Source

Merge pull request #245541 in DEC/fineui from bugfix/11.0 to release/11.0

* commit '932bea730f37562cf6f3d81484d1cc788105014d': (31 commits)
  BI-130558 fix: 【6.0.13发散】预览布局和内容缩放,控件下拉搜索,全选和选项的缩放比例不一样
  无JIRA fix调用相关的先放在compact里面,不然会循环引用
  无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 变来变去的
  BI-115380 fix: 暗模式下按钮disabled时字体颜色被覆盖
  无jira任务 优化height
  无jira任务,Selection没有引用
  无JIRA fix: this指向问题
  无jira任务,组件抛出来
  无jira任务,NumberIntervalSingleEditor抛出来
  无JIRA任务 fix: encodeURIcomponent
  更新readme
  无JIRA 去less.config.json路径改成和以前一样
  无jira任务,cache.getItem默认值返回null,不要undefined,同原来的结果
  ...
research/test
superman 1 year ago
parent
commit
d978b14aae
  1. 5
      README
  2. 1
      package.json
  3. 0
      packages/fineui/bi.lessconfig.json
  4. 0
      packages/fineui/jsy.lessconfig.json
  5. 2
      packages/fineui/package.json
  6. 2
      packages/fineui/src/base/combination/searcher.js
  7. 1
      packages/fineui/src/base/single/button/button.basic.js
  8. 1
      packages/fineui/src/base/single/button/listitem/icontextitem.js
  9. 2
      packages/fineui/src/base/single/input/file.js
  10. 2
      packages/fineui/src/base/single/input/input.js
  11. 1
      packages/fineui/src/case/combo/bubblecombo/combo.bubble.js
  12. 25
      packages/fineui/src/core/4.widget.js
  13. 2
      packages/fineui/src/core/func/alias.js
  14. 2
      packages/fineui/src/core/structure/cache.js
  15. 21
      packages/fineui/src/fix/fix.compact.js
  16. 2
      packages/fineui/src/index.js
  17. 4
      packages/fineui/src/less/base/single/button/button.less
  18. 1
      packages/fineui/src/third/index.js
  19. 1
      packages/fineui/src/widget/downlist/item.downlist.js
  20. 1
      packages/fineui/src/widget/downlist/item.downlistgroup.js
  21. 1
      packages/fineui/src/widget/downlist/popup.downlist.js
  22. 14
      packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.combo.js
  23. 1
      packages/fineui/src/widget/editor/editor.search.js
  24. 1
      packages/fineui/src/widget/index.js
  25. 2
      packages/fineui/src/widget/multilayerdownlist/combo.downlist.js
  26. 1
      packages/fineui/src/widget/multiselect/multiselect.combo.js
  27. 2
      packages/fineui/src/widget/multiselect/search/multiselect.search.loader.js
  28. 2
      packages/fineui/typescript/case/button/icon/icon.change.ts
  29. 1
      packages/fineui/typescript/widget/timeinterval/timeinterval.ts
  30. 8
      packages/fineui/webpack/attachments.js
  31. 2
      packages/fineui/webpack/webpack.common.js
  32. 2
      packages/fineui/webpack/webpack.css.js
  33. 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

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

2
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",

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

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,

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

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

@ -7,7 +7,7 @@ import {
extend,
isFunction,
Widget,
Providers
Providers, emptyFn
} from "@/core";
import { Fix } from "./fix";
@ -213,6 +213,25 @@ 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 &&

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,

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

@ -31,9 +31,7 @@ export class DynamicDateTimeCombo extends Single {
iconWidth: 24
};
props = () => {
const date = getDate();
return {
props = {
baseCls: "bi-dynamic-date--time-combo",
height: 24,
minDate: "1900-01-01",
@ -42,18 +40,10 @@ export class DynamicDateTimeCombo extends Single {
allowEdit: true,
supportDynamic: true,
attributes: {
tabIndex: -1
tabIndex: -1,
},
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
value: {
type: DynamicDateTimeCombo.Static,
value: {
year: date.getFullYear(),
month: date.getMonth() + 1
}
}
};
};
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() {

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

@ -146,7 +146,7 @@ export class MultiSelectSearchLoader extends Widget {
},
value: opts.value,
height: "fill",
});
}, this);
this.button_group.on(Controller.EVENT_CHANGE, function() {
self.fireEvent(Controller.EVENT_CHANGE, arguments);
});

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