@flexem/fc-gui 3.0.0-alpha.184 → 3.0.0-alpha.187

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36157,7 +36157,7 @@ class character_display_element_CharacterDisplayElement extends readable_element
36157
36157
  }
36158
36158
  if (!this.isEnable) {
36159
36159
  const message = !this.isGrantedPermission ? this.localization.permissiontip : this.localization.conditionIsNotMetTip;
36160
- const modalRef = this.modalService.show(alert_modal_component["a" /* AlertModalComponent */], { initialState: { alermMessage: message }, backdrop: 'static', class: 'gui-modal-dialog-position', animated: false });
36160
+ const modalRef = this.modalService.show(alert_modal_component["a" /* AlertModalComponent */], { initialState: { alermMessage: message }, backdrop: 'static', class: 'gui-modal-dialog-position gui-modal-dialog-tip', animated: false });
36161
36161
  const onClosedSub = modalRef.content.onClosed.subscribe(() => {
36162
36162
  modalRef.hide();
36163
36163
  onClosedSub.unsubscribe();
@@ -36166,7 +36166,7 @@ class character_display_element_CharacterDisplayElement extends readable_element
36166
36166
  }
36167
36167
  if (this.model.useSecurity) {
36168
36168
  const modalRef = this.modalService.show(confirm_operation_modal_component["a" /* ConfirmOperationModalComponent */], {
36169
- backdrop: 'static', class: 'gui-modal-dialog-position', animated: false
36169
+ backdrop: 'static', class: 'gui-modal-dialog-position gui-modal-dialog-tip', animated: false
36170
36170
  });
36171
36171
  const onClosedSub = modalRef.content.onClosed.subscribe(result => {
36172
36172
  modalRef.hide();
@@ -37367,19 +37367,6 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
37367
37367
  item.textContent = updatedTimePeriods[i].name;
37368
37368
  }
37369
37369
  });
37370
- // 文字更新后重新测量宽度,修正首次加载时文字为空导致宽度过小的问题
37371
- const prevDisplay = this.dropdownListEl.style.display;
37372
- const prevVisibility = this.dropdownListEl.style.visibility;
37373
- this.dropdownListEl.style.display = 'block';
37374
- this.dropdownListEl.style.visibility = 'hidden';
37375
- this.dropdownListEl.style.width = '';
37376
- const newWidth = this.dropdownListEl.offsetWidth;
37377
- this.dropdownListEl.style.display = prevDisplay;
37378
- this.dropdownListEl.style.visibility = prevVisibility;
37379
- this.dropdownListEl.style.width = newWidth + 'px';
37380
- if (this.dropdownTriggerEl) {
37381
- this.dropdownTriggerEl.style.width = newWidth + 'px';
37382
- }
37383
37370
  }
37384
37371
  // 更新触发按钮文字(显示当前选中项的最新语言文案)
37385
37372
  if (this.dropdownTriggerEl) {
@@ -37874,9 +37861,7 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
37874
37861
  .style('padding', '4px 8px')
37875
37862
  .style('cursor', 'pointer')
37876
37863
  .style('white-space', 'nowrap')
37877
- .style('font-size', (parseFloat(this.displayOption.operationSelectFontSize) * scale) + 'px')
37878
- .style('line-height', (this.displayOption.operationAreaHeight * scale - 8) + 'px')
37879
- .style('min-height', (this.displayOption.operationAreaHeight * scale - 8) + 'px')
37864
+ // 字号/行高在打开时动态根据 trigger 的视口实际尺寸设置,见 dropdownTrigger.on('click') 处理
37880
37865
  .style('background', tp.key === Number(this.currentTimePeriod) ? '#1890ff' : 'transparent')
37881
37866
  .style('color', tp.key === Number(this.currentTimePeriod) ? '#fff' : '#333')
37882
37867
  .text(tp.name)
@@ -37918,15 +37903,6 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
37918
37903
  this.reRenderElement(this.startTime, this.endTime, this.displayOption.dataLimit, HistoricalCurveTimeRange.BeginOpenEndOpen);
37919
37904
  });
37920
37905
  });
37921
- // 测量下拉列表最大宽度,让 trigger 和列表宽度一致
37922
- dropdownListEl.style.display = 'block';
37923
- dropdownListEl.style.visibility = 'hidden';
37924
- const listContentWidth = dropdownListEl.offsetWidth;
37925
- dropdownListEl.style.display = 'none';
37926
- dropdownListEl.style.visibility = '';
37927
- dropdownListEl.style.width = listContentWidth + 'px';
37928
- dropdownTrigger.node().style.width = listContentWidth + 'px';
37929
- dropdownTrigger.node().style.boxSizing = 'border-box';
37930
37906
  const hideDropdown = () => { dropdownListEl.style.display = 'none'; };
37931
37907
  dropdownTrigger.on('click', () => {
37932
37908
  const isVisible = dropdownListEl.style.display !== 'none';
@@ -37936,10 +37912,19 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
37936
37912
  else {
37937
37913
  const triggerNode = dropdownTrigger.node();
37938
37914
  const triggerRect = triggerNode.getBoundingClientRect();
37939
- // 设置宽度至少和 trigger 一样宽
37915
+ // trigger 在视口中的实际高度(已经过画布 transform 缩放),用于对齐下拉项尺寸。
37916
+ // 不能在渲染时写死设计像素,因为下拉挂在 body 上不受画布 transform 影响。
37917
+ const itemHeight = triggerRect.height;
37918
+ // 字号取行高的 60%,保证文字在行内垂直居中且不溢出
37919
+ const itemFontSize = Math.round(itemHeight * 0.6);
37920
+ dropdownList.selectAll('.hc-dropdown-item')
37921
+ .style('font-size', itemFontSize + 'px')
37922
+ .style('line-height', itemHeight + 'px')
37923
+ .style('min-height', itemHeight + 'px');
37924
+ // 设置宽度至少和 trigger 一样宽,先展示再测宽度
37925
+ dropdownListEl.style.display = 'block';
37940
37926
  dropdownListEl.style.minWidth = triggerRect.width + 'px';
37941
37927
  dropdownListEl.style.left = triggerRect.left + 'px';
37942
- dropdownListEl.style.display = 'block';
37943
37928
  const listHeight = dropdownListEl.offsetHeight;
37944
37929
  const spaceBelow = window.innerHeight - triggerRect.bottom;
37945
37930
  if (spaceBelow < listHeight) {
@@ -38547,7 +38532,7 @@ class numerical_display_element_NumericalDisplayElement extends readable_element
38547
38532
  }
38548
38533
  if (!this.isEnable) {
38549
38534
  const message = !this.isGrantedPermission ? this.localization.permissiontip : this.localization.conditionIsNotMetTip;
38550
- const modalRef = this.modalService.show(alert_modal_component["a" /* AlertModalComponent */], { initialState: { alermMessage: message }, backdrop: 'static', class: 'gui-modal-dialog-position', animated: false });
38535
+ const modalRef = this.modalService.show(alert_modal_component["a" /* AlertModalComponent */], { initialState: { alermMessage: message }, backdrop: 'static', class: 'gui-modal-dialog-position gui-modal-dialog-tip', animated: false });
38551
38536
  const onClosedSub = modalRef.content.onClosed.subscribe(() => {
38552
38537
  modalRef.hide();
38553
38538
  onClosedSub.unsubscribe();
@@ -38556,7 +38541,7 @@ class numerical_display_element_NumericalDisplayElement extends readable_element
38556
38541
  }
38557
38542
  if (this.model.useSecurity) {
38558
38543
  const modalRef = this.modalService.show(confirm_operation_modal_component["a" /* ConfirmOperationModalComponent */], {
38559
- backdrop: 'static', class: 'gui-modal-dialog-position', animated: false
38544
+ backdrop: 'static', class: 'gui-modal-dialog-position gui-modal-dialog-tip', animated: false
38560
38545
  });
38561
38546
  const onClosedSub = modalRef.content.onClosed.subscribe(result => {
38562
38547
  modalRef.hide();
@@ -40520,7 +40505,7 @@ class switch_indicator_light_element_SwitchIndicatorLightElement extends conditi
40520
40505
  }
40521
40506
  if (!this.isEnable) {
40522
40507
  const message = !this.isGrantedPermission ? this.localization.permissiontip : this.localization.conditionIsNotMetTip;
40523
- const modalRef = this.modalService.show(alert_modal_component["a" /* AlertModalComponent */], { initialState: { alermMessage: message }, backdrop: 'static', class: 'gui-modal-dialog-position', animated: false });
40508
+ const modalRef = this.modalService.show(alert_modal_component["a" /* AlertModalComponent */], { initialState: { alermMessage: message }, backdrop: 'static', class: 'gui-modal-dialog-position gui-modal-dialog-tip', animated: false });
40524
40509
  const onClosedSub = modalRef.content.onClosed.subscribe(() => {
40525
40510
  modalRef.hide();
40526
40511
  onClosedSub.unsubscribe();
@@ -40530,7 +40515,7 @@ class switch_indicator_light_element_SwitchIndicatorLightElement extends conditi
40530
40515
  if (this.switchOperator.canExecute()) {
40531
40516
  if (!this.isBitRestoration || !this.isVerifiedForRestoration) {
40532
40517
  if (this.model.useSecurity) {
40533
- const modalRef = this.modalService.show(confirm_operation_modal_component["a" /* ConfirmOperationModalComponent */], { backdrop: 'static', class: 'gui-modal-dialog-position', animated: false });
40518
+ const modalRef = this.modalService.show(confirm_operation_modal_component["a" /* ConfirmOperationModalComponent */], { backdrop: 'static', class: 'gui-modal-dialog-position gui-modal-dialog-tip', animated: false });
40534
40519
  const onClosedSub = modalRef.content.onClosed.subscribe(result => {
40535
40520
  modalRef.hide();
40536
40521
  onClosedSub.unsubscribe();
@@ -41214,7 +41199,7 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
41214
41199
  on_event.preventDefault();
41215
41200
  if (!this.isEnable) {
41216
41201
  const message = !this.isGrantedPermission ? this.localization.permissiontip : this.localization.conditionIsNotMetTip;
41217
- const modalRef = this.modalService.show(alert_modal_component["a" /* AlertModalComponent */], { initialState: { alermMessage: message }, backdrop: 'static', class: 'gui-modal-dialog-position', animated: false });
41202
+ const modalRef = this.modalService.show(alert_modal_component["a" /* AlertModalComponent */], { initialState: { alermMessage: message }, backdrop: 'static', class: 'gui-modal-dialog-position gui-modal-dialog-tip', animated: false });
41218
41203
  const onClosedSub = modalRef.content.onClosed.subscribe(() => {
41219
41204
  modalRef.hide();
41220
41205
  onClosedSub.unsubscribe();
@@ -41230,7 +41215,7 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
41230
41215
  }
41231
41216
  if (this.model.useSecurity) {
41232
41217
  const modalRef = this.modalService.show(confirm_operation_modal_component["a" /* ConfirmOperationModalComponent */], {
41233
- backdrop: 'static', class: 'gui-modal-dialog-position', animated: false
41218
+ backdrop: 'static', class: 'gui-modal-dialog-position gui-modal-dialog-tip', animated: false
41234
41219
  });
41235
41220
  const onClosedSub = modalRef.content.onClosed.subscribe(result => {
41236
41221
  modalRef.hide();