Browse Source

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

* commit '77e1c59c0d39a989053c8ec2e64ca0620788568e':
  BI-139113 fix: 优化subs销毁
  BI-138644 fix: 灰化的分秒可设置值
  无JIRA 更新subs实现
  无JIRA Dep的subs换成Set实现
  BI-138976 fix: 在init中计算
  BI-138976 fix: 计算高度
research/test
superman 12 months ago
parent
commit
3d8af126ec
  1. 20
      packages/fineui/src/base/list/virtualgrouplist.js
  2. 774
      packages/fineui/src/fix/fix.js
  3. 18
      packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js

20
packages/fineui/src/base/list/virtualgrouplist.js

@ -25,6 +25,7 @@ export class VirtualGroupList extends Widget {
} }
init() { init() {
this._calculateSummaryHeight();
this.renderedIndex = -1; this.renderedIndex = -1;
} }
@ -44,7 +45,7 @@ export class VirtualGroupList extends Widget {
}, },
{ {
type: VirtualGroup.xtype, type: VirtualGroup.xtype,
height: rowHeight * items.length, height: this.summaryHeight,
ref: (ref) => { ref: (ref) => {
this.container = ref; this.container = ref;
}, },
@ -169,6 +170,16 @@ export class VirtualGroupList extends Widget {
); );
} }
} }
_calculateSummaryHeight() {
const o = this.options;
if (isFunction(o.rowHeight)) {
this.summaryHeight = sum(o.items, o.rowHeight);
} else {
this.summaryHeight = this._isAutoHeight() ? 0 : o.rowHeight * o.items.length;
}
}
_populate(items) { _populate(items) {
const { blockSize, rowHeight, scrollTop } = this.options; const { blockSize, rowHeight, scrollTop } = this.options;
if (items && this.options.items !== items) { if (items && this.options.items !== items) {
@ -198,13 +209,8 @@ export class VirtualGroupList extends Widget {
} }
_restore() { _restore() {
const o = this.options;
this.renderedIndex = -1; this.renderedIndex = -1;
if (isFunction(o.rowHeight)) { this._calculateSummaryHeight();
this.summaryHeight = sum(o.items, o.rowHeight);
} else {
this.summaryHeight = this._isAutoHeight() ? 0 : o.rowHeight * o.items.length;
}
// 依赖于cache的占位元素也要初始化 // 依赖于cache的占位元素也要初始化
this.topBlank.setHeight(0); this.topBlank.setHeight(0);
this.bottomBlank.setHeight(0); this.bottomBlank.setHeight(0);

774
packages/fineui/src/fix/fix.js

File diff suppressed because it is too large Load Diff

18
packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js

@ -181,18 +181,24 @@ export class DynamicDateTimeSelect extends Widget {
} }
_checkHour(value) { _checkHour(value) {
this.hour.setDownEnable(parseInt(value) > 0); const { timeSelectTypes } = this.options;
this.hour.setUpEnable(parseInt(value) < 23); const canSelect = timeSelectTypes.includes(DynamicDateTimeSelect.HOUR);
this.hour.setDownEnable(canSelect && parseInt(value) > 0);
this.hour.setUpEnable(canSelect && parseInt(value) < 23);
} }
_checkMinute(value) { _checkMinute(value) {
this.minute.setDownEnable(parseInt(value) > 0); const { timeSelectTypes } = this.options;
this.minute.setUpEnable(parseInt(value) < 59); const canSelect = timeSelectTypes.includes(DynamicDateTimeSelect.MINUTE);
this.minute.setDownEnable(canSelect && parseInt(value) > 0);
this.minute.setUpEnable(canSelect && parseInt(value) < 59);
} }
_checkSecond(value) { _checkSecond(value) {
this.second.setDownEnable(parseInt(value) > 0); const { timeSelectTypes } = this.options;
this.second.setUpEnable(parseInt(value) < 59); const canSelect = timeSelectTypes.includes(DynamicDateTimeSelect.SECOND);
this.second.setDownEnable(canSelect && parseInt(value) > 0);
this.second.setUpEnable(canSelect && parseInt(value) < 59);
} }
_autoSwitch(v, type) { _autoSwitch(v, type) {

Loading…
Cancel
Save