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",
"version": "2.0.20220516110541",
"version": "2.0.20220517140421",
"description": "fineui",
"main": "dist/fineui.min.js",
"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 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 minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0;
var count = 0;
for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex);
for (var columnIndex = columnStartIndex; columnIndex <= columnStopIndex; columnIndex++) {
var key = rowIndex + "-" + columnIndex;
var columnDatum = this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex);
var index = this.renderedKeys[key] && this.renderedKeys[key][2];
var child;
if (index >= 0) {
// if (columnDatum.size !== this.renderedCells[index]._width) {
// this.renderedCells[index]._width = columnDatum.size;
this.renderedCells[index].el.setWidth(columnDatum.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
});
// 没有可见的单元格就干掉所有渲染过的
if (!BI.isEmpty(visibleColumnIndices) && !BI.isEmpty(visibleRowIndices)) {
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 minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0;
var count = 0;
for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex);
for (var columnIndex = columnStartIndex; columnIndex <= columnStopIndex; columnIndex++) {
var key = rowIndex + "-" + columnIndex;
var columnDatum = this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex);
var index = this.renderedKeys[key] && this.renderedKeys[key][2];
var child;
if (index >= 0) {
// if (columnDatum.size !== this.renderedCells[index]._width) {
// this.renderedCells[index]._width = columnDatum.size;
this.renderedCells[index].el.setWidth(columnDatum.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);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-blank-icon-text-item",
logic: {
dynamic: false
},
iconCls1: "",
iconCls2: "",
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);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-blank-icon-text-icon-item",
logic: {
dynamic: false
},
iconCls1: "",
iconCls2: "",
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);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-blank-icon-text-item",
logic: {
dynamic: false
},
blankWidth: 0,
iconHeight: 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);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-icon-item",
logic: {
dynamic: false
},
iconCls1: "",
iconCls2: "",
iconHeight: null,

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

@ -12,9 +12,6 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, {
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-item",
direction: BI.Direction.Left,
logic: {
dynamic: false
},
iconWrapperWidth: null,
iconHeight: 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);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-icon-item",
logic: {
dynamic: false
},
iconWrapperWidth: null,
iconHeight: 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);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-icon-node",
logic: {
dynamic: false
},
iconCls1: "close-ha-font",
iconCls2: "close-ha-font",
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);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-node",
logic: {
dynamic: false
},
cls: "close-ha-font",
iconHeight: 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);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-icon-node",
logic: {
dynamic: false
},
cls: "close-ha-font",
iconHeight: null,
iconWidth: null,

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

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

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

@ -10,9 +10,6 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, {
attributes: {
tabIndex: 1
},
logic: {
dynamic: false
},
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
iconWrapperWidth: 16,
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);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-arrow-group-node bi-list-item",
logic: {
dynamic: false
},
id: "",
pId: "",
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);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-plus-group-node bi-list-item",
logic: {
dynamic: false
},
id: "",
pId: "",
open: false,

3
src/case/button/switch.js

@ -14,9 +14,6 @@ BI.Switch = BI.inherit(BI.BasicButton, {
},
height: 20,
width: 44,
logic: {
dynamic: 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;
props: {
logic?: {
dynamic: boolean;
};
iconCls1?: string;
iconCls2?: string;
iconHeight?: number;

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

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

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

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

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

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

Loading…
Cancel
Save