Browse Source

Merge pull request #226976 in DEC/fineui from release/11.0 to final/11.0

* commit '0440f9d8583ad061c63ef3f6e821f576e8f53b6c':
  BI-122401 refactor(trigger.text): 使支持指定 title
  auto upgrade version to 2.0.20230227095536
  BI-119323 style: 图标更新
  auto upgrade version to 2.0.20230223101228
  KERNEL-14300 fix:NumberInterval补充simple的ts声明
  FDL-3530🐞 fix:custom_tree的expander支持virtual_group
  BI-121538 fix(bi.file): 严格文件类型校验
  update
  无JIRA 用core-js/stable替代已经废弃的@babel/polyfill
  auto upgrade version to 2.0.20230208163847
  无JIRA fix: 组件创建完之后再执行setMinMax修复
  auto upgrade version to 2.0.20230207102533
  BI-120672 feat:时间选择控件opt里支持传height
  BI-120672 feat:时间选择控件opt里支持传height
  auto upgrade version to 2.0.20230206100506
  auto upgrade version to 2.0.20230203202509
  JSY-26262 fix: 更改布局方式
  JSY-26289 fix: 统一setValue和getValue方法
  JSY-26289 fix: 修复无全选按钮时搜索面板勾选不生效
  JSY-26262 fix: multi_select_insert_no_bar_list 结果为空时,提示居中
research/test
superman 2 years ago
parent
commit
afbd420249
  1. 6
      package.json
  2. 4
      src/base/single/input/file.js
  3. 1
      src/base/tree/customtree.js
  4. 1
      src/case/trigger/trigger.text.js
  5. 2
      src/case/trigger/trigger.text.select.js
  6. 15
      src/widget/dynamicdatetime/dynamicdatetime.timeselect.js
  7. 14
      src/widget/multiselect/multiselect.loader.nobar.js
  8. 27
      src/widget/multiselect/search/multiselect.search.loader.js
  9. 174
      src/widget/singleslider/singleslider.js
  10. 1
      typescript/widget/numberinterval/numberinterval.ts
  11. 2
      webpack/attachments.js

6
package.json

@ -1,6 +1,6 @@
{
"name": "fineui",
"version": "2.0.20230202142959",
"version": "2.0.20230227095536",
"description": "fineui",
"main": "dist/fineui_without_conflict.min.js",
"types": "dist/lib/index.d.ts",
@ -9,8 +9,7 @@
},
"devDependencies": {
"@babel/core": "^7.17.4",
"@babel/polyfill": "7.6.0",
"@fui/babel-preset-fineui": "^2.0.0",
"@fui/babel-preset-fineui": "^3.0.0",
"@fui/eslint-plugin": "^1.0.19",
"@types/node": "15.6.1",
"@typescript-eslint/eslint-plugin": "2.33.0",
@ -18,7 +17,6 @@
"autoprefixer": "9.6.1",
"babel-loader": "8.0.6",
"chai": "4.2.0",
"cnpm": "6.1.1",
"concat": "1.0.3",
"core-js": "3.3.2",
"cross-env": "6.0.0",

4
src/base/single/input/file.js

@ -437,11 +437,11 @@
var matches;
matches = mime.match(r1);
if (matches) {
return fileName.toLowerCase().indexOf(matches[1]) > -1;
return fileName.toLowerCase().endsWith(matches[0]);
}
matches = mime.match(r2);
if (matches) {
return matches[1] === "*" ? true : fileName.toLowerCase().indexOf(matches[1]) > -1;
return matches[1] === "*" ? true : fileName.toLowerCase().endsWith(`.${matches[1]}`);
}
});
}

1
src/base/tree/customtree.js

@ -51,6 +51,7 @@ BI.CustomTree = BI.inherit(BI.Widget, {
}, BI.deepClone(o.expander), {
id: node.id,
pId: node.pId,
key: node.key,
});
var el = BI.stripEL(node);
if (!BI.isWidget(el)) {

1
src/case/trigger/trigger.text.js

@ -40,6 +40,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
height: o.height,
text: text || o.defaultText,
tipType: o.tipType,
title: o.title,
warningTitle: o.warningTitle,
hgap: o.textHgap,
vgap: o.textVgap,

2
src/case/trigger/trigger.text.select.js

@ -35,7 +35,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
textTgap: o.textTgap,
textBgap: o.textBgap,
tipType: o.tipType,
title: null,
title: o.title,
allowClear: o.allowClear,
listeners: [
{

15
src/widget/dynamicdatetime/dynamicdatetime.timeselect.js

@ -1,11 +1,16 @@
BI.DynamicDateTimeSelect = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-date-time-select"
props: function () {
return {
baseCls: "bi-date-time-select",
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
};
},
render: function () {
var self = this;
var o = this.options;
return {
type: "bi.center_adapt",
items: [{
@ -41,7 +46,7 @@ BI.DynamicDateTimeSelect = BI.inherit(BI.Widget, {
}
}],
width: 60,
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT
height: o.height,
}
}, {
type: "bi.label",
@ -77,7 +82,7 @@ BI.DynamicDateTimeSelect = BI.inherit(BI.Widget, {
}
}],
width: 60,
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT
height: o.height,
}, {
type: "bi.label",
text: ":",
@ -106,7 +111,7 @@ BI.DynamicDateTimeSelect = BI.inherit(BI.Widget, {
}
}],
width: 60,
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT
height: o.height,
}]
}]
};

14
src/widget/multiselect/multiselect.loader.nobar.js

@ -98,13 +98,15 @@ BI.MultiSelectNoBarLoader = BI.inherit(BI.Widget, {
value: this.storeValue
}, opts.el));
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.button_group],
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top), BI.extend({
scrolly: true,
vgap: 5
});
}, opts.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top, this.button_group)
}))));
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});

27
src/widget/multiselect/search/multiselect.search.loader.js

@ -134,15 +134,10 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
if (opts.allowSelectAll) {
this.button_group.on(BI.SelectList.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE, arguments);
});
} else {
this.button_group.on(BI.ListPane.EVENT_CHANGE, function (val) {
self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE, val);
});
}
var searchLoaderEventChangeName = opts.allowSelectAll ? BI.SelectList.EVENT_CHANGE : BI.ListPane.EVENT_CHANGE
this.button_group.on(searchLoaderEventChangeName, function () {
self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE, arguments);
});
},
_createItems: function (items) {
@ -196,13 +191,23 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
},
setValue: function (v) {
v || (v = {});
var o = this.options;
// 暂存的值一定是新的值,不然v改掉后,storeValue也跟着改了
this.storeValue = BI.deepClone(v);
this.button_group.setValue(v);
o.allowSelectAll ? (this.button_group.setValue(v)) : (this.button_group.setValue(v.value));
},
getValue: function () {
return this.button_group.getValue();
var o = this.options;
if (o.allowSelectAll) {
return this.button_group.getValue();
}
return {
type: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
value: this.button_group.getValue(),
assist: this.button_group.getNotSelectedValue()
};
},
getAllButtons: function () {

174
src/widget/singleslider/singleslider.js

@ -58,16 +58,18 @@ BI.SingleSlider = BI.inherit(BI.Single, {
type: "bi.vertical_adapt",
cls: "slider-wrapper",
columnSize: ["fill"],
items: [{
type: "bi.absolute",
items: [
{
el: this.slider,
top: 8,
}
],
height: c.SLIDER_HEIGHT
}],
items: [
{
type: "bi.absolute",
items: [
{
el: this.slider,
top: 8,
}
],
height: c.SLIDER_HEIGHT
}
],
hgap: c.SLIDER_WIDTH_HALF,
height: c.SLIDER_HEIGHT
});
@ -124,41 +126,49 @@ BI.SingleSlider = BI.inherit(BI.Single, {
this._setVisible(false);
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.vertical",
items: [{
type: "bi.absolute",
items: [{
el: this.track,
width: "100%",
height: c.TRACK_HEIGHT
}]
}],
hgap: c.TRACK_GAP_HALF,
height: c.TRACK_HEIGHT
},
top: 23,
left: 0,
width: "100%"
}, {
el: sliderVertical,
top: 20,
left: 0,
width: "100%"
}, {
el: {
type: "bi.vertical",
items: [{
type: "bi.horizontal_auto",
items: [this.label]
}],
// height: c.EDITOR_HEIGHT
},
top: 0,
left: 0,
width: "100%"
}]
items: [
{
el: {
type: "bi.vertical",
items: [
{
type: "bi.absolute",
items: [
{
el: this.track,
width: "100%",
height: c.TRACK_HEIGHT
}
]
}
],
hgap: c.TRACK_GAP_HALF,
height: c.TRACK_HEIGHT
},
top: 23,
left: 0,
width: "100%"
}, {
el: sliderVertical,
top: 20,
left: 0,
width: "100%"
}, {
el: {
type: "bi.vertical",
items: [
{
type: "bi.horizontal_auto",
items: [this.label]
}
],
// height: c.EDITOR_HEIGHT
},
top: 0,
left: 0,
width: "100%"
}
]
};
},
@ -198,7 +208,7 @@ BI.SingleSlider = BI.inherit(BI.Single, {
self.fireEvent(BI.SingleSlider.EVENT_CHANGE);
}, window);
widget.element.on("mousedown", function (event) {
if(!widget.isEnabled()) {
if (!widget.isEnabled()) {
return;
}
defaultSize = this.offsetLeft;
@ -206,7 +216,7 @@ BI.SingleSlider = BI.inherit(BI.Single, {
mouseMoveTracker.captureMouseMoves(event);
});
function optimizeSize (s) {
function optimizeSize(s) {
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},
@ -214,30 +224,36 @@ BI.SingleSlider = BI.inherit(BI.Single, {
_createTrackWrapper: function () {
return BI.createWidget({
type: "bi.absolute",
items: [{
el: {
type: "bi.vertical",
items: [{
type: "bi.absolute",
items: [{
el: this.grayTrack,
top: 0,
left: 0,
width: "100%"
}, {
el: this.blueTrack,
top: 0,
left: 0,
width: "0%"
}]
}],
hgap: 8,
height: 8
},
top: 8,
left: 0,
width: "100%"
}]
items: [
{
el: {
type: "bi.vertical",
items: [
{
type: "bi.absolute",
items: [
{
el: this.grayTrack,
top: 0,
left: 0,
width: "100%"
}, {
el: this.blueTrack,
top: 0,
left: 0,
width: "0%"
}
]
}
],
hgap: 8,
height: 8
},
top: 8,
left: 0,
width: "100%"
}
]
});
},
@ -245,9 +261,9 @@ BI.SingleSlider = BI.inherit(BI.Single, {
var o = this.options;
var valid = false;
if (BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max)) {
if(o.digit === false) {
if (o.digit === false) {
valid = true;
}else{
} else {
var dotText = (v + "").split(".")[1] || "";
valid = (dotText.length === o.digit);
}
@ -256,7 +272,7 @@ BI.SingleSlider = BI.inherit(BI.Single, {
},
_setBlueTrack: function (percent) {
this.blueTrack.element.css({width: percent + "%"});
this.blueTrack.element.css({ width: percent + "%" });
},
_setLabelPosition: function (percent) {
@ -264,7 +280,7 @@ BI.SingleSlider = BI.inherit(BI.Single, {
},
_setSliderPosition: function (percent) {
this.slider.element.css({left: percent + "%"});
this.slider.element.css({ left: percent + "%" });
},
_setAllPosition: function (percent) {
@ -314,7 +330,7 @@ BI.SingleSlider = BI.inherit(BI.Single, {
_setEnable: function (b) {
BI.SingleSlider.superclass._setEnable.apply(this, [b]);
if(b) {
if (b) {
this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track");
} else {
this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track");
@ -322,9 +338,9 @@ BI.SingleSlider = BI.inherit(BI.Single, {
},
setMinAndMax: function (v) {
var minNumber = BI.parseFloat(v.min);
var maxNumber = BI.parseFloat(v.max);
if ((!isNaN(minNumber)) && (!isNaN(maxNumber)) && (maxNumber > minNumber )) {
var minNumber = this.options.min = BI.parseFloat(v.min);
var maxNumber = this.options.max = BI.parseFloat(v.max);
if ((!isNaN(minNumber)) && (!isNaN(maxNumber)) && (maxNumber > minNumber)) {
this.min = minNumber;
this.max = maxNumber;
}

1
typescript/widget/numberinterval/numberinterval.ts

@ -16,6 +16,7 @@ export declare class NumberInterval extends Single {
closeMax?: boolean;
validation?: 'invalid' | 'valid';
numTip?: string;
simple?: boolean;
} & Single['props'];
isStateValid(): boolean;

2
webpack/attachments.js

@ -7,7 +7,7 @@ const workerCompact = './dist/fix/worker.compact.js';
const lodashJs = "src/core/1.lodash.js";
const jqueryJs = "src/core/platform/web/jquery/_jquery.js";
const runtimePolyfill = ["@babel/polyfill", "es6-promise/auto"];
const runtimePolyfill = ["core-js/stable"];
const basicAttachmentMap = {
polyfill: sync([

Loading…
Cancel
Save