Browse Source

Merge branch 'master' of ssh://code.fineres.com:7999/~dailer/fineui

es6
zsmj 3 years ago
parent
commit
bd0d4e1f3b
  1. 2
      package.json
  2. 182
      src/base/grid/grid.js
  3. 3
      src/base/single/button/listitem/blankiconicontextitem.js
  4. 3
      src/base/single/button/listitem/blankicontexticonitem.js
  5. 3
      src/base/single/button/listitem/blankicontextitem.js
  6. 3
      src/base/single/button/listitem/icontexticonitem.js
  7. 3
      src/base/single/button/listitem/icontextitem.js
  8. 3
      src/base/single/button/listitem/texticonitem.js
  9. 3
      src/base/single/button/node/icontexticonnode.js
  10. 3
      src/base/single/button/node/icontextnode.js
  11. 3
      src/base/single/button/node/texticonnode.js
  12. 3
      src/case/button/item.multiselect.js
  13. 3
      src/case/button/item.singleselect.radio.js
  14. 3
      src/case/button/node/node.arrow.js
  15. 3
      src/case/button/node/node.plus.js
  16. 3
      src/case/button/switch.js
  17. 3
      typescript/base/single/button/listitem/icontexticonitem.ts
  18. 3
      typescript/base/single/button/listitem/icontextitem.ts
  19. 3
      typescript/case/button/item.multiselect.ts
  20. 3
      typescript/case/button/item.singleselect.radio.ts

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "fineui", "name": "fineui",
"version": "2.0.20220516110541", "version": "2.0.20220517140421",
"description": "fineui", "description": "fineui",
"main": "dist/fineui.min.js", "main": "dist/fineui.min.js",
"types": "dist/lib/index.d.ts", "types": "dist/lib/index.d.ts",

182
src/base/grid/grid.js

@ -130,99 +130,99 @@ BI.GridView = BI.inherit(BI.Widget, {
var visibleColumnIndices = this._columnSizeAndPositionManager.getVisibleCellRange(width, scrollLeft); var visibleColumnIndices = this._columnSizeAndPositionManager.getVisibleCellRange(width, scrollLeft);
var visibleRowIndices = this._rowSizeAndPositionManager.getVisibleCellRange(height, scrollTop); var visibleRowIndices = this._rowSizeAndPositionManager.getVisibleCellRange(height, scrollTop);
if (BI.isEmpty(visibleColumnIndices) || BI.isEmpty(visibleRowIndices)) {
return;
}
var horizontalOffsetAdjustment = this._columnSizeAndPositionManager.getOffsetAdjustment(width, scrollLeft);
var verticalOffsetAdjustment = this._rowSizeAndPositionManager.getOffsetAdjustment(height, scrollTop);
this._renderedColumnStartIndex = visibleColumnIndices.start;
this._renderedColumnStopIndex = visibleColumnIndices.stop;
this._renderedRowStartIndex = visibleRowIndices.start;
this._renderedRowStopIndex = visibleRowIndices.stop;
var overscanColumnIndices = this._getOverscanIndices(this.columnCount, overscanColumnCount, this._renderedColumnStartIndex, this._renderedColumnStopIndex);
var overscanRowIndices = this._getOverscanIndices(this.rowCount, overscanRowCount, this._renderedRowStartIndex, this._renderedRowStopIndex);
var columnStartIndex = overscanColumnIndices.overscanStartIndex;
var columnStopIndex = overscanColumnIndices.overscanStopIndex;
var rowStartIndex = overscanRowIndices.overscanStartIndex;
var rowStopIndex = overscanRowIndices.overscanStopIndex;
// 算区间size
var minRowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowStartIndex);
var minColumnDatum = this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnStartIndex);
var maxRowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowStopIndex);
var maxColumnDatum = this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnStopIndex);
var top = minRowDatum.offset + verticalOffsetAdjustment;
var left = minColumnDatum.offset + horizontalOffsetAdjustment;
var bottom = maxRowDatum.offset + verticalOffsetAdjustment + maxRowDatum.size;
var right = maxColumnDatum.offset + horizontalOffsetAdjustment + maxColumnDatum.size;
// 如果滚动的区间并没有超出渲染的范围
if (top >= this.renderRange.minY && bottom <= this.renderRange.maxY && left >= this.renderRange.minX && right <= this.renderRange.maxX) {
return;
}
var renderedCells = [], renderedKeys = {}, renderedWidgets = {}; var renderedCells = [], renderedKeys = {}, renderedWidgets = {};
var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0; // 没有可见的单元格就干掉所有渲染过的
var count = 0; if (!BI.isEmpty(visibleColumnIndices) && !BI.isEmpty(visibleRowIndices)) {
for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) { var horizontalOffsetAdjustment = this._columnSizeAndPositionManager.getOffsetAdjustment(width, scrollLeft);
var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex); var verticalOffsetAdjustment = this._rowSizeAndPositionManager.getOffsetAdjustment(height, scrollTop);
for (var columnIndex = columnStartIndex; columnIndex <= columnStopIndex; columnIndex++) { this._renderedColumnStartIndex = visibleColumnIndices.start;
var key = rowIndex + "-" + columnIndex; this._renderedColumnStopIndex = visibleColumnIndices.stop;
var columnDatum = this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex); this._renderedRowStartIndex = visibleRowIndices.start;
this._renderedRowStopIndex = visibleRowIndices.stop;
var index = this.renderedKeys[key] && this.renderedKeys[key][2];
var child; var overscanColumnIndices = this._getOverscanIndices(this.columnCount, overscanColumnCount, this._renderedColumnStartIndex, this._renderedColumnStopIndex);
if (index >= 0) {
// if (columnDatum.size !== this.renderedCells[index]._width) { var overscanRowIndices = this._getOverscanIndices(this.rowCount, overscanRowCount, this._renderedRowStartIndex, this._renderedRowStopIndex);
// this.renderedCells[index]._width = columnDatum.size;
this.renderedCells[index].el.setWidth(columnDatum.size); var columnStartIndex = overscanColumnIndices.overscanStartIndex;
// } var columnStopIndex = overscanColumnIndices.overscanStopIndex;
// if (rowDatum.size !== this.renderedCells[index]._height) { var rowStartIndex = overscanRowIndices.overscanStartIndex;
// this.renderedCells[index]._height = rowDatum.size; var rowStopIndex = overscanRowIndices.overscanStopIndex;
this.renderedCells[index].el.setHeight(rowDatum.size);
// } // 算区间size
// if (this.renderedCells[index]._left !== columnDatum.offset + horizontalOffsetAdjustment) { var minRowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowStartIndex);
this.renderedCells[index].el.element.css("left", (columnDatum.offset + horizontalOffsetAdjustment) / BI.pixRatio + BI.pixUnit); var minColumnDatum = this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnStartIndex);
// } var maxRowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowStopIndex);
// if (this.renderedCells[index]._top !== rowDatum.offset + verticalOffsetAdjustment) { var maxColumnDatum = this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnStopIndex);
this.renderedCells[index].el.element.css("top", (rowDatum.offset + verticalOffsetAdjustment) / BI.pixRatio + BI.pixUnit); var top = minRowDatum.offset + verticalOffsetAdjustment;
// } var left = minColumnDatum.offset + horizontalOffsetAdjustment;
child = this.renderedCells[index].el; var bottom = maxRowDatum.offset + verticalOffsetAdjustment + maxRowDatum.size;
renderedCells.push(this.renderedCells[index]); var right = maxColumnDatum.offset + horizontalOffsetAdjustment + maxColumnDatum.size;
} else { // 如果滚动的区间并没有超出渲染的范围
var item = o.itemFormatter(o.items[rowIndex][columnIndex], rowIndex, columnIndex); if (top >= this.renderRange.minY && bottom <= this.renderRange.maxY && left >= this.renderRange.minX && right <= this.renderRange.maxX) {
child = BI._lazyCreateWidget(BI.extend({ return;
type: "bi.label", }
width: columnDatum.size,
height: rowDatum.size var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0;
}, item, { var count = 0;
cls: (item.cls || "") + " grid-cell" + (rowIndex === 0 ? " first-row" : "") + (columnIndex === 0 ? " first-col" : ""), for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
_rowIndex: rowIndex, var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex);
_columnIndex: columnIndex,
_left: columnDatum.offset + horizontalOffsetAdjustment, for (var columnIndex = columnStartIndex; columnIndex <= columnStopIndex; columnIndex++) {
_top: rowDatum.offset + verticalOffsetAdjustment var key = rowIndex + "-" + columnIndex;
}), this); var columnDatum = this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex);
renderedCells.push({
el: child, var index = this.renderedKeys[key] && this.renderedKeys[key][2];
left: columnDatum.offset + horizontalOffsetAdjustment, var child;
top: rowDatum.offset + verticalOffsetAdjustment, if (index >= 0) {
_left: columnDatum.offset + horizontalOffsetAdjustment, // if (columnDatum.size !== this.renderedCells[index]._width) {
_top: rowDatum.offset + verticalOffsetAdjustment // this.renderedCells[index]._width = columnDatum.size;
// _width: columnDatum.size, this.renderedCells[index].el.setWidth(columnDatum.size);
// _height: rowDatum.size // }
}); // if (rowDatum.size !== this.renderedCells[index]._height) {
// this.renderedCells[index]._height = rowDatum.size;
this.renderedCells[index].el.setHeight(rowDatum.size);
// }
// if (this.renderedCells[index]._left !== columnDatum.offset + horizontalOffsetAdjustment) {
this.renderedCells[index].el.element.css("left", (columnDatum.offset + horizontalOffsetAdjustment) / BI.pixRatio + BI.pixUnit);
// }
// if (this.renderedCells[index]._top !== rowDatum.offset + verticalOffsetAdjustment) {
this.renderedCells[index].el.element.css("top", (rowDatum.offset + verticalOffsetAdjustment) / BI.pixRatio + BI.pixUnit);
// }
child = this.renderedCells[index].el;
renderedCells.push(this.renderedCells[index]);
} else {
var item = o.itemFormatter(o.items[rowIndex][columnIndex], rowIndex, columnIndex);
child = BI._lazyCreateWidget(BI.extend({
type: "bi.label",
width: columnDatum.size,
height: rowDatum.size
}, item, {
cls: (item.cls || "") + " grid-cell" + (rowIndex === 0 ? " first-row" : "") + (columnIndex === 0 ? " first-col" : ""),
_rowIndex: rowIndex,
_columnIndex: columnIndex,
_left: columnDatum.offset + horizontalOffsetAdjustment,
_top: rowDatum.offset + verticalOffsetAdjustment
}), this);
renderedCells.push({
el: child,
left: columnDatum.offset + horizontalOffsetAdjustment,
top: rowDatum.offset + verticalOffsetAdjustment,
_left: columnDatum.offset + horizontalOffsetAdjustment,
_top: rowDatum.offset + verticalOffsetAdjustment
// _width: columnDatum.size,
// _height: rowDatum.size
});
}
minX = Math.min(minX, columnDatum.offset + horizontalOffsetAdjustment);
maxX = Math.max(maxX, columnDatum.offset + horizontalOffsetAdjustment + columnDatum.size);
minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment);
maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size);
renderedKeys[key] = [rowIndex, columnIndex, count];
renderedWidgets[count] = child;
count++;
} }
minX = Math.min(minX, columnDatum.offset + horizontalOffsetAdjustment);
maxX = Math.max(maxX, columnDatum.offset + horizontalOffsetAdjustment + columnDatum.size);
minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment);
maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size);
renderedKeys[key] = [rowIndex, columnIndex, count];
renderedWidgets[count] = child;
count++;
} }
} }
// 已存在的, 需要添加的和需要删除的 // 已存在的, 需要添加的和需要删除的

3
src/base/single/button/listitem/blankiconicontextitem.js

@ -11,9 +11,6 @@ BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, {
var conf = BI.BlankIconIconTextItem.superclass._defaultConfig.apply(this, arguments); var conf = BI.BlankIconIconTextItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-blank-icon-text-item", baseCls: (conf.baseCls || "") + " bi-blank-icon-text-item",
logic: {
dynamic: false
},
iconCls1: "", iconCls1: "",
iconCls2: "", iconCls2: "",
blankWidth: 0, blankWidth: 0,

3
src/base/single/button/listitem/blankicontexticonitem.js

@ -12,9 +12,6 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, {
var conf = BI.BlankIconTextIconItem.superclass._defaultConfig.apply(this, arguments); var conf = BI.BlankIconTextIconItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-blank-icon-text-icon-item", baseCls: (conf.baseCls || "") + " bi-blank-icon-text-icon-item",
logic: {
dynamic: false
},
iconCls1: "", iconCls1: "",
iconCls2: "", iconCls2: "",
blankWidth: 0, blankWidth: 0,

3
src/base/single/button/listitem/blankicontextitem.js

@ -11,9 +11,6 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, {
var conf = BI.BlankIconTextItem.superclass._defaultConfig.apply(this, arguments); var conf = BI.BlankIconTextItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-blank-icon-text-item", baseCls: (conf.baseCls || "") + " bi-blank-icon-text-item",
logic: {
dynamic: false
},
blankWidth: 0, blankWidth: 0,
iconHeight: null, iconHeight: null,
iconWidth: null, iconWidth: null,

3
src/base/single/button/listitem/icontexticonitem.js

@ -12,9 +12,6 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, {
var conf = BI.IconTextIconItem.superclass._defaultConfig.apply(this, arguments); var conf = BI.IconTextIconItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-icon-item", baseCls: (conf.baseCls || "") + " bi-icon-text-icon-item",
logic: {
dynamic: false
},
iconCls1: "", iconCls1: "",
iconCls2: "", iconCls2: "",
iconHeight: null, iconHeight: null,

3
src/base/single/button/listitem/icontextitem.js

@ -12,9 +12,6 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, {
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-item", baseCls: (conf.baseCls || "") + " bi-icon-text-item",
direction: BI.Direction.Left, direction: BI.Direction.Left,
logic: {
dynamic: false
},
iconWrapperWidth: null, iconWrapperWidth: null,
iconHeight: null, iconHeight: null,
iconWidth: null, iconWidth: null,

3
src/base/single/button/listitem/texticonitem.js

@ -12,9 +12,6 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, {
var conf = BI.TextIconItem.superclass._defaultConfig.apply(this, arguments); var conf = BI.TextIconItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-icon-item", baseCls: (conf.baseCls || "") + " bi-text-icon-item",
logic: {
dynamic: false
},
iconWrapperWidth: null, iconWrapperWidth: null,
iconHeight: null, iconHeight: null,
iconWidth: null, iconWidth: null,

3
src/base/single/button/node/icontexticonnode.js

@ -10,9 +10,6 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
var conf = BI.IconTextIconNode.superclass._defaultConfig.apply(this, arguments); var conf = BI.IconTextIconNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-icon-node", baseCls: (conf.baseCls || "") + " bi-icon-text-icon-node",
logic: {
dynamic: false
},
iconCls1: "close-ha-font", iconCls1: "close-ha-font",
iconCls2: "close-ha-font", iconCls2: "close-ha-font",
iconHeight: null, iconHeight: null,

3
src/base/single/button/node/icontextnode.js

@ -10,9 +10,6 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, {
var conf = BI.IconTextNode.superclass._defaultConfig.apply(this, arguments); var conf = BI.IconTextNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-node", baseCls: (conf.baseCls || "") + " bi-icon-text-node",
logic: {
dynamic: false
},
cls: "close-ha-font", cls: "close-ha-font",
iconHeight: null, iconHeight: null,
iconWidth: null, iconWidth: null,

3
src/base/single/button/node/texticonnode.js

@ -9,9 +9,6 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, {
var conf = BI.TextIconNode.superclass._defaultConfig.apply(this, arguments); var conf = BI.TextIconNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-icon-node", baseCls: (conf.baseCls || "") + " bi-text-icon-node",
logic: {
dynamic: false
},
cls: "close-ha-font", cls: "close-ha-font",
iconHeight: null, iconHeight: null,
iconWidth: null, iconWidth: null,

3
src/case/button/item.multiselect.js

@ -11,9 +11,6 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, {
tabIndex: 1 tabIndex: 1
}, },
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
logic: {
dynamic: false
},
iconWrapperWidth: 26, iconWrapperWidth: 26,
}); });
}, },

3
src/case/button/item.singleselect.radio.js

@ -10,9 +10,6 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, {
attributes: { attributes: {
tabIndex: 1 tabIndex: 1
}, },
logic: {
dynamic: false
},
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
iconWrapperWidth: 16, iconWrapperWidth: 16,
textHgap: 10, textHgap: 10,

3
src/case/button/node/node.arrow.js

@ -6,9 +6,6 @@ BI.ArrowNode = BI.inherit(BI.NodeButton, {
var conf = BI.ArrowNode.superclass._defaultConfig.apply(this, arguments); var conf = BI.ArrowNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-arrow-group-node bi-list-item", baseCls: (conf.baseCls || "") + " bi-arrow-group-node bi-list-item",
logic: {
dynamic: false
},
id: "", id: "",
pId: "", pId: "",
open: false, open: false,

3
src/case/button/node/node.plus.js

@ -9,9 +9,6 @@ BI.PlusGroupNode = BI.inherit(BI.NodeButton, {
var conf = BI.PlusGroupNode.superclass._defaultConfig.apply(this, arguments); var conf = BI.PlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-plus-group-node bi-list-item", baseCls: (conf.baseCls || "") + " bi-plus-group-node bi-list-item",
logic: {
dynamic: false
},
id: "", id: "",
pId: "", pId: "",
open: false, open: false,

3
src/case/button/switch.js

@ -14,9 +14,6 @@ BI.Switch = BI.inherit(BI.BasicButton, {
}, },
height: 20, height: 20,
width: 44, width: 44,
logic: {
dynamic: false
},
showTip: false showTip: false
}, },

3
typescript/base/single/button/listitem/icontexticonitem.ts

@ -5,9 +5,6 @@ export declare class IconTextIconItem extends BasicButton {
static EVENT_CHANGE: string; static EVENT_CHANGE: string;
props: { props: {
logic?: {
dynamic: boolean;
};
iconCls1?: string; iconCls1?: string;
iconCls2?: string; iconCls2?: string;
iconHeight?: number; iconHeight?: number;

3
typescript/base/single/button/listitem/icontextitem.ts

@ -6,9 +6,6 @@ export declare class IconTextItem extends BasicButton {
props: { props: {
direction?: string; direction?: string;
logic?: {
dynamic: boolean;
};
iconWrapperWidth?: number; iconWrapperWidth?: number;
iconCls?: string; iconCls?: string;
iconHeight?: number; iconHeight?: number;

3
typescript/case/button/item.multiselect.ts

@ -6,9 +6,6 @@ export declare class MultiSelectItem extends BasicButton {
static EVENT_CHANGE: string; static EVENT_CHANGE: string;
props: { props: {
logic: {
dynamic: boolean;
}
text: string; text: string;
iconWrapperWidth: number; iconWrapperWidth: number;
textLgap: number; textLgap: number;

3
typescript/case/button/item.singleselect.radio.ts

@ -6,9 +6,6 @@ export declare class SingleSelectRadioItem extends BasicButton {
props: { props: {
iconWrapperWidth: number; iconWrapperWidth: number;
logic: {
dynamic: boolean;
};
textHgap: number; textHgap: number;
textLgap: number; textLgap: number;
textRgap: number; textRgap: number;

Loading…
Cancel
Save